meta-cloud-api 3.1.1 → 3.3.0
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/README.md +14 -10
- package/dist/index.d.mts +334 -10
- package/dist/index.d.mts.map +1 -1
- package/dist/index.mjs +4 -4
- package/dist/index.mjs.map +1 -1
- package/dist/types/enums.d.ts +19 -2
- package/dist/types/enums.d.ts.map +1 -1
- package/dist/types/enums.js +1 -1
- package/dist/types/enums.js.map +1 -1
- package/dist/types/index.d.ts +221 -8
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/index.js +1 -1
- package/dist/types/index.js.map +1 -1
- package/dist/utils/index.d.ts +1 -1
- package/dist/utils/index.d.ts.map +1 -1
- package/dist/utils/index.js +1 -1
- package/dist/utils/index.js.map +1 -1
- package/package.json +17 -13
package/dist/types/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { AudioMediaTypesEnum, BusinessVerticalEnum, ButtonPositionEnum, CategoryEnum, ComponentTypesEnum, ConversationTypesEnum, CurrencyCodesEnum, DataLocalizationRegionEnum, DocumentMediaTypesEnum, HttpMethodsEnum, ImageMediaTypesEnum, InteractiveTypesEnum, LanguagesEnum, MessageTypesEnum, ParametersTypesEnum, ReferralSourceTypesEnum, RequestCodeMethodsEnum, StatusEnum, StickerMediaTypesEnum, SubTypeEnum, SystemChangeTypesEnum, TemplateStatusEnum, VideoMediaTypesEnum, WabaConfigEnum, WebhookTypesEnum } from "./enums.js";
|
|
1
|
+
import { AudioMediaTypesEnum, BusinessVerticalEnum, ButtonPositionEnum, CategoryEnum, ComponentTypesEnum, ConversationTypesEnum, CurrencyCodesEnum, DataLocalizationRegionEnum, DocumentMediaTypesEnum, HttpMethodsEnum, ImageMediaTypesEnum, InteractiveTypesEnum, LanguagesEnum, MessageCategoryEnum, MessageTypesEnum, ParametersTypesEnum, ReferralSourceTypesEnum, RequestCodeMethodsEnum, StatusEnum, StickerMediaTypesEnum, SubTypeEnum, SystemChangeTypesEnum, TemplateStatusEnum, VideoMediaTypesEnum, WabaConfigEnum, WebhookTypesEnum } from "./enums.js";
|
|
2
2
|
import { IncomingHttpHeaders, IncomingMessage } from "node:http";
|
|
3
3
|
|
|
4
4
|
//#region src/types/request.d.ts
|
|
@@ -225,10 +225,38 @@ type CallSession = {
|
|
|
225
225
|
sdp: string;
|
|
226
226
|
};
|
|
227
227
|
type CallAction = 'connect' | 'pre_accept' | 'accept' | 'reject' | 'terminate';
|
|
228
|
+
type CallCaptureStatus = 'ENABLED' | 'DISABLED';
|
|
229
|
+
/**
|
|
230
|
+
* Supported announcement locales for call recording / transcription.
|
|
231
|
+
* The announcement is played to both participants before capture starts.
|
|
232
|
+
*/
|
|
233
|
+
type CallAnnouncementLanguage = 'en' | 'en_US' | 'en_AU' | 'en_CA' | 'en_GB' | 'en_IN' | 'en_NZ' | 'nl' | 'fr' | 'de' | 'hi' | 'it' | 'kn' | 'pt' | 'es' | 'es_ES' | 'te' | 'vi' | (string & {});
|
|
234
|
+
/**
|
|
235
|
+
* Per-call recording configuration. When status is ENABLED, `purpose` and
|
|
236
|
+
* `announcement_language` are required; the recording arrives via the
|
|
237
|
+
* `call_recording_available` webhook event.
|
|
238
|
+
*/
|
|
239
|
+
type CallRecordingConfig = {
|
|
240
|
+
status: CallCaptureStatus; /** Reason for recording, max 250 characters — required when status is ENABLED */
|
|
241
|
+
purpose?: string; /** Locale of the pre-recording announcement — required when status is ENABLED */
|
|
242
|
+
announcement_language?: CallAnnouncementLanguage;
|
|
243
|
+
};
|
|
244
|
+
/**
|
|
245
|
+
* Per-call transcription configuration. When status is ENABLED, `purpose` and
|
|
246
|
+
* `announcement_language` are required; the transcript arrives via the
|
|
247
|
+
* `call_transcription_available` webhook event.
|
|
248
|
+
*/
|
|
249
|
+
type CallTranscriptionConfig = {
|
|
250
|
+
status: CallCaptureStatus; /** Reason for transcription, max 250 characters — required when status is ENABLED */
|
|
251
|
+
purpose?: string; /** Locale of the pre-transcription announcement — required when status is ENABLED */
|
|
252
|
+
announcement_language?: CallAnnouncementLanguage;
|
|
253
|
+
};
|
|
228
254
|
type InitiateCallRequest = {
|
|
229
255
|
to: string;
|
|
230
256
|
session: CallSession;
|
|
231
257
|
biz_opaque_callback_data?: string;
|
|
258
|
+
recording?: CallRecordingConfig;
|
|
259
|
+
transcription?: CallTranscriptionConfig;
|
|
232
260
|
};
|
|
233
261
|
type PreAcceptCallRequest = {
|
|
234
262
|
call_id: string;
|
|
@@ -238,6 +266,8 @@ type AcceptCallRequest = {
|
|
|
238
266
|
call_id: string;
|
|
239
267
|
session?: CallSession;
|
|
240
268
|
biz_opaque_callback_data?: string;
|
|
269
|
+
recording?: CallRecordingConfig;
|
|
270
|
+
transcription?: CallTranscriptionConfig;
|
|
241
271
|
};
|
|
242
272
|
type RejectCallRequest = {
|
|
243
273
|
call_id: string;
|
|
@@ -688,6 +718,32 @@ type CallPermissionRequestInteractiveObject = {
|
|
|
688
718
|
header?: HeaderObject;
|
|
689
719
|
action: CallPermissionRequestActionObject;
|
|
690
720
|
};
|
|
721
|
+
type VoiceCallParameters = {
|
|
722
|
+
/** Button label. Maximum 20 characters. Defaults to "Call on WhatsApp" when omitted. */display_text?: string; /** Active duration in minutes, 1 to 43200 (30 days). Defaults to 10080 (7 days). */
|
|
723
|
+
ttl_minutes?: number;
|
|
724
|
+
};
|
|
725
|
+
type VoiceCallActionObject = {
|
|
726
|
+
name: 'voice_call';
|
|
727
|
+
parameters?: VoiceCallParameters;
|
|
728
|
+
};
|
|
729
|
+
/**
|
|
730
|
+
* "Call on WhatsApp" voice call button, a Direct Send interactive type.
|
|
731
|
+
*
|
|
732
|
+
* Send it on its own with a top-level `category: 'utility'`; it cannot be combined
|
|
733
|
+
* with CTA URL or reply buttons, and footers are not allowed. Calling must be
|
|
734
|
+
* enabled on the business phone number first, otherwise the send fails with
|
|
735
|
+
* error `138000`.
|
|
736
|
+
*
|
|
737
|
+
* @see {@link https://developers.facebook.com/documentation/business-messaging/whatsapp/direct-send/supported-message-types | Direct Send supported message types}
|
|
738
|
+
*/
|
|
739
|
+
type VoiceCallInteractiveObject = {
|
|
740
|
+
type: InteractiveTypesEnum.VoiceCall | 'voice_call';
|
|
741
|
+
body: SimpleTextObject; /** Text header only, maximum 60 characters. */
|
|
742
|
+
header?: HeaderObject & {
|
|
743
|
+
type: 'text';
|
|
744
|
+
};
|
|
745
|
+
action: VoiceCallActionObject;
|
|
746
|
+
};
|
|
691
747
|
type CtaUrlParameters = {
|
|
692
748
|
display_text: string;
|
|
693
749
|
url: string;
|
|
@@ -816,7 +872,7 @@ type CarouselInteractiveObject = {
|
|
|
816
872
|
body: SimpleTextObject;
|
|
817
873
|
action: CarouselActionObject;
|
|
818
874
|
};
|
|
819
|
-
type InteractiveObject = ButtonInteractiveObject | ListInteractiveObject | ProductInteractiveObject | ProductListInteractiveObject | CatalogMessageInteractiveObject | CallPermissionRequestInteractiveObject | CtaUrlInteractiveObject | CarouselInteractiveObject | LocationRequestInteractiveObject | AddressMessageInteractiveObject | FlowInteractiveObject;
|
|
875
|
+
type InteractiveObject = ButtonInteractiveObject | ListInteractiveObject | ProductInteractiveObject | ProductListInteractiveObject | CatalogMessageInteractiveObject | CallPermissionRequestInteractiveObject | CtaUrlInteractiveObject | VoiceCallInteractiveObject | CarouselInteractiveObject | LocationRequestInteractiveObject | AddressMessageInteractiveObject | FlowInteractiveObject;
|
|
820
876
|
//#endregion
|
|
821
877
|
//#region src/api/messages/types/reaction.d.ts
|
|
822
878
|
interface ReactionParams {
|
|
@@ -968,17 +1024,49 @@ type ConTextObject = {
|
|
|
968
1024
|
message_id: string;
|
|
969
1025
|
};
|
|
970
1026
|
type MessageRecipientType = 'individual' | 'group';
|
|
1027
|
+
/**
|
|
1028
|
+
* Category of a Direct Send message. Omitting it is equivalent to `'service'`
|
|
1029
|
+
* and keeps the existing free-form Cloud API send behavior.
|
|
1030
|
+
*
|
|
1031
|
+
* @see {@link https://developers.facebook.com/documentation/business-messaging/whatsapp/direct-send/send-utility-and-authentication-messages | Direct Send}
|
|
1032
|
+
*/
|
|
1033
|
+
type DirectSendCategory = MessageCategoryEnum | 'authentication' | 'service' | 'utility';
|
|
1034
|
+
/**
|
|
1035
|
+
* Optional Direct Send configuration.
|
|
1036
|
+
*
|
|
1037
|
+
* Supplying `template_name` makes message-to-template attribution predictable:
|
|
1038
|
+
* Direct Send creates or reuses a template with that exact name instead of
|
|
1039
|
+
* auto-matching. Supported for `category: 'utility'` only.
|
|
1040
|
+
*
|
|
1041
|
+
* @see {@link https://developers.facebook.com/documentation/business-messaging/whatsapp/direct-send/business-named-templates | Business-named templates}
|
|
1042
|
+
*/
|
|
1043
|
+
type DirectSendConfig = {
|
|
1044
|
+
/**
|
|
1045
|
+
* Unique template name within the WABA.
|
|
1046
|
+
* Lowercase alphanumeric characters and underscores only (`^[a-z0-9_]+$`), max 512 characters.
|
|
1047
|
+
*/
|
|
1048
|
+
template_name?: string;
|
|
1049
|
+
};
|
|
971
1050
|
type MessageRequestBody<T extends MessageTypesEnum> = GeneralMessageBody & {
|
|
972
1051
|
recipient_type?: MessageRecipientType;
|
|
973
1052
|
to: string;
|
|
974
1053
|
context?: ConTextObject;
|
|
975
1054
|
type?: T;
|
|
1055
|
+
category?: DirectSendCategory;
|
|
1056
|
+
direct_send_config?: DirectSendConfig;
|
|
976
1057
|
};
|
|
977
1058
|
interface MessageRequestParams<T> {
|
|
978
1059
|
body: T;
|
|
979
1060
|
to: string;
|
|
980
1061
|
recipientType?: MessageRecipientType;
|
|
981
1062
|
replyMessageId?: string;
|
|
1063
|
+
/**
|
|
1064
|
+
* Direct Send category. Set to `'utility'` or `'authentication'` to send a
|
|
1065
|
+
* business-initiated message without a pre-approved template.
|
|
1066
|
+
*/
|
|
1067
|
+
category?: DirectSendCategory;
|
|
1068
|
+
/** Direct Send configuration, applied only when {@link MessageRequestParams.category} is set. */
|
|
1069
|
+
directSendConfig?: DirectSendConfig;
|
|
982
1070
|
}
|
|
983
1071
|
interface StatusParams {
|
|
984
1072
|
status: StatusObject['status'];
|
|
@@ -1019,6 +1107,9 @@ declare class MessagesClass extends BaseClass {
|
|
|
1019
1107
|
interactiveCtaUrl(params: MessageRequestParams<InteractiveObject & {
|
|
1020
1108
|
type: InteractiveTypesEnum.CtaUrl;
|
|
1021
1109
|
}>): Promise<MessagesResponse>;
|
|
1110
|
+
interactiveVoiceCall(params: MessageRequestParams<InteractiveObject & {
|
|
1111
|
+
type: InteractiveTypesEnum.VoiceCall;
|
|
1112
|
+
}>): Promise<MessagesResponse>;
|
|
1022
1113
|
interactiveLocationRequest(params: MessageRequestParams<InteractiveObject & {
|
|
1023
1114
|
type: InteractiveTypesEnum.LocationRequest;
|
|
1024
1115
|
}>): Promise<MessagesResponse>;
|
|
@@ -1293,6 +1384,34 @@ type PhoneNumbersResponse = {
|
|
|
1293
1384
|
data: PhoneNumberResponse[];
|
|
1294
1385
|
paging: Paging;
|
|
1295
1386
|
};
|
|
1387
|
+
/**
|
|
1388
|
+
* Username status.
|
|
1389
|
+
*
|
|
1390
|
+
* - "approved" — Username has been approved and will be visible when the feature is available
|
|
1391
|
+
* - "reserved" — Username is reserved and approved, but not yet visible to users
|
|
1392
|
+
*/
|
|
1393
|
+
type UsernameStatus = 'approved' | 'reserved' | (string & {});
|
|
1394
|
+
/**
|
|
1395
|
+
* Behavior when the desired username is already in use by another phone number
|
|
1396
|
+
* in the same portfolio.
|
|
1397
|
+
*
|
|
1398
|
+
* - "none" — Default; do not transfer a username already in use elsewhere
|
|
1399
|
+
* - "force_transfer" — Move the username from another phone number in the portfolio.
|
|
1400
|
+
* If the API returns error code 147005, retry the request with "force_transfer".
|
|
1401
|
+
*/
|
|
1402
|
+
type UsernameTransferAction = 'none' | 'force_transfer';
|
|
1403
|
+
type UpdateUsernameRequest = {
|
|
1404
|
+
username: string; /** Optional. Defaults to "none". */
|
|
1405
|
+
transfer_action?: UsernameTransferAction;
|
|
1406
|
+
};
|
|
1407
|
+
type UsernameResponse = {
|
|
1408
|
+
username?: string;
|
|
1409
|
+
status?: UsernameStatus;
|
|
1410
|
+
[key: string]: unknown;
|
|
1411
|
+
};
|
|
1412
|
+
type UsernameSuggestionsResponse = {
|
|
1413
|
+
[key: string]: unknown;
|
|
1414
|
+
};
|
|
1296
1415
|
type RequestVerificationCodeRequest = {
|
|
1297
1416
|
code_method: 'SMS' | 'VOICE';
|
|
1298
1417
|
language: string;
|
|
@@ -1354,6 +1473,10 @@ interface PhoneNumberClass {
|
|
|
1354
1473
|
updateOfficialBusinessAccountStatus(params: UpdateOfficialBusinessAccountStatusRequest): Promise<ResponseSuccess>;
|
|
1355
1474
|
getBusinessComplianceInfo(): Promise<BusinessComplianceInfoResponse>;
|
|
1356
1475
|
updateBusinessComplianceInfo(params: UpdateBusinessComplianceInfoRequest): Promise<ResponseSuccess>;
|
|
1476
|
+
getUsername(): Promise<UsernameResponse>;
|
|
1477
|
+
updateUsername(params: UpdateUsernameRequest): Promise<ResponseSuccess>;
|
|
1478
|
+
deleteUsername(): Promise<ResponseSuccess>;
|
|
1479
|
+
getUsernameSuggestions(): Promise<UsernameSuggestionsResponse>;
|
|
1357
1480
|
}
|
|
1358
1481
|
//#endregion
|
|
1359
1482
|
//#region src/api/profile/types/upload.d.ts
|
|
@@ -2461,8 +2584,12 @@ interface BusinessStatusUpdateWebhookValue {
|
|
|
2461
2584
|
* - "call_status" — Business-initiated call started ringing or was accepted (business-initiated only)
|
|
2462
2585
|
* - "media_update" — Consumer-side media event; apply the new SDP to your peer connection (business-initiated only)
|
|
2463
2586
|
* - "terminate" — Call ended for any reason
|
|
2587
|
+
* - "call_created" — A call was created on a SIP-enabled number; SIP call webhooks do not include
|
|
2588
|
+
* the `session` object since call signaling is handled via SIP rather than WebRTC
|
|
2589
|
+
* - "call_recording_available" — A call recording is ready for download (7-day retention)
|
|
2590
|
+
* - "call_transcription_available" — A call transcript is ready for download (7-day retention)
|
|
2464
2591
|
*/
|
|
2465
|
-
type CallEventType = 'connect' | 'call_status' | 'media_update' | 'terminate';
|
|
2592
|
+
type CallEventType = 'connect' | 'call_status' | 'media_update' | 'terminate' | 'call_created' | 'call_recording_available' | 'call_transcription_available';
|
|
2466
2593
|
/**
|
|
2467
2594
|
* Direction of the call.
|
|
2468
2595
|
*
|
|
@@ -2499,6 +2626,31 @@ interface CallSession$1 {
|
|
|
2499
2626
|
/** Contains the SDP offer from Meta; generate an answer and apply to your peer connection */
|
|
2500
2627
|
sdp_renegotiation: CallSdpRenegotiation;
|
|
2501
2628
|
}
|
|
2629
|
+
/**
|
|
2630
|
+
* Call recording media payload (call_recording_available event).
|
|
2631
|
+
* Download the audio via the Media API or the short-lived URL (valid ~5 minutes).
|
|
2632
|
+
*/
|
|
2633
|
+
interface CallRecordingMedia {
|
|
2634
|
+
type: 'audio';
|
|
2635
|
+
audio: {
|
|
2636
|
+
/** Media asset ID for retrieval via the Media API */id: string; /** Base64-encoded SHA-256 hash for integrity verification */
|
|
2637
|
+
sha256: string; /** e.g. "audio/ogg; codecs=opus" */
|
|
2638
|
+
mime_type: string; /** Short-lived download URL (valid ~5 minutes) */
|
|
2639
|
+
url: string;
|
|
2640
|
+
};
|
|
2641
|
+
}
|
|
2642
|
+
/**
|
|
2643
|
+
* Call transcript document payload (call_transcription_available event).
|
|
2644
|
+
* The document is a JSON transcript; download via the Media API or the short-lived URL.
|
|
2645
|
+
*/
|
|
2646
|
+
interface CallTranscriptDocument {
|
|
2647
|
+
document: {
|
|
2648
|
+
/** Media asset ID for retrieval via the Media API */id: string; /** Base64-encoded SHA-256 hash for integrity verification */
|
|
2649
|
+
sha256: string; /** Always "application/json" */
|
|
2650
|
+
mime_type: string; /** Short-lived download URL (valid ~5 minutes) */
|
|
2651
|
+
url: string;
|
|
2652
|
+
};
|
|
2653
|
+
}
|
|
2502
2654
|
interface CallEntry {
|
|
2503
2655
|
/** Unique ID for the call — use in accept / reject / terminate API calls */
|
|
2504
2656
|
id: string;
|
|
@@ -2509,12 +2661,18 @@ interface CallEntry {
|
|
|
2509
2661
|
event: CallEventType;
|
|
2510
2662
|
/** Unix timestamp */
|
|
2511
2663
|
timestamp: number;
|
|
2512
|
-
/** Callee of the call (Page ID) — present on connect */
|
|
2664
|
+
/** Callee of the call (Page ID) — present on connect / call_created */
|
|
2513
2665
|
to?: string;
|
|
2514
|
-
/** Caller of the call (PSID) — present on connect */
|
|
2666
|
+
/** Caller of the call (PSID) — present on connect / call_created */
|
|
2515
2667
|
from?: string;
|
|
2516
2668
|
/** Whether the call was business- or user-initiated — present on connect */
|
|
2517
2669
|
call_direction?: CallDirection;
|
|
2670
|
+
/** Whether the call was business- or user-initiated — present on call_created (SIP) */
|
|
2671
|
+
direction?: CallDirection;
|
|
2672
|
+
/** Business-scoped user ID of the caller, when Meta includes it */
|
|
2673
|
+
from_user_id?: string;
|
|
2674
|
+
/** Parent business-scoped user ID of the caller, when Meta includes it */
|
|
2675
|
+
from_parent_user_id?: string;
|
|
2518
2676
|
/** PSID of the consumer — present on call_status */
|
|
2519
2677
|
recipient_id?: string;
|
|
2520
2678
|
/** Ringing or accepted — present on call_status */
|
|
@@ -2533,6 +2691,10 @@ interface CallEntry {
|
|
|
2533
2691
|
* Present on terminate.
|
|
2534
2692
|
*/
|
|
2535
2693
|
duration?: number;
|
|
2694
|
+
/** Recorded call audio — present on call_recording_available */
|
|
2695
|
+
call_recording?: CallRecordingMedia;
|
|
2696
|
+
/** Call transcript document — present on call_transcription_available */
|
|
2697
|
+
call_transcript?: CallTranscriptDocument;
|
|
2536
2698
|
}
|
|
2537
2699
|
interface CallContact {
|
|
2538
2700
|
profile: {
|
|
@@ -2966,6 +3128,43 @@ interface SystemMessage extends BaseMessage {
|
|
|
2966
3128
|
type: 'user_changed_number';
|
|
2967
3129
|
};
|
|
2968
3130
|
}
|
|
3131
|
+
/**
|
|
3132
|
+
* Message edit webhook — only available for WhatsApp Business app users (Coexistence).
|
|
3133
|
+
* Business-side edits made in the WhatsApp Business app are identified by
|
|
3134
|
+
* business-scoped user IDs when present.
|
|
3135
|
+
*/
|
|
3136
|
+
interface EditMessage extends BaseMessage {
|
|
3137
|
+
type: MessageTypesEnum.Edit;
|
|
3138
|
+
/** Business-scoped user ID of the sender, when the edit originated business-side */
|
|
3139
|
+
from_user_id?: string;
|
|
3140
|
+
/** Parent business-scoped user ID of the sender, when the edit originated business-side */
|
|
3141
|
+
from_parent_user_id?: string;
|
|
3142
|
+
edit: {
|
|
3143
|
+
original_message_id: string; /** The edited message content (text, media with caption, etc.) */
|
|
3144
|
+
message: {
|
|
3145
|
+
context?: {
|
|
3146
|
+
id: string;
|
|
3147
|
+
};
|
|
3148
|
+
type: MessageTypesEnum | string;
|
|
3149
|
+
[key: string]: unknown;
|
|
3150
|
+
};
|
|
3151
|
+
};
|
|
3152
|
+
}
|
|
3153
|
+
/**
|
|
3154
|
+
* Message revoke (delete) webhook — only available for WhatsApp Business app users (Coexistence).
|
|
3155
|
+
* Business-side revokes made in the WhatsApp Business app are identified by
|
|
3156
|
+
* business-scoped user IDs when present.
|
|
3157
|
+
*/
|
|
3158
|
+
interface RevokeMessage extends BaseMessage {
|
|
3159
|
+
type: MessageTypesEnum.Revoke;
|
|
3160
|
+
/** Business-scoped user ID of the sender, when the revoke originated business-side */
|
|
3161
|
+
from_user_id?: string;
|
|
3162
|
+
/** Parent business-scoped user ID of the sender, when the revoke originated business-side */
|
|
3163
|
+
from_parent_user_id?: string;
|
|
3164
|
+
revoke: {
|
|
3165
|
+
original_message_id: string;
|
|
3166
|
+
};
|
|
3167
|
+
}
|
|
2969
3168
|
interface UnsupportedMessage extends BaseMessage {
|
|
2970
3169
|
type: MessageTypesEnum.Unsupported;
|
|
2971
3170
|
errors: Array<WebhookError>;
|
|
@@ -2973,7 +3172,7 @@ interface UnsupportedMessage extends BaseMessage {
|
|
|
2973
3172
|
type GroupMessage = {
|
|
2974
3173
|
group_id: string;
|
|
2975
3174
|
} & (TextMessage | ImageMessage | VideoMessage | AudioMessage | DocumentMessage | LocationMessage | ContactsMessage);
|
|
2976
|
-
type WhatsAppMessage = TextMessage | ImageMessage | VideoMessage | AudioMessage | DocumentMessage | StickerMessage | InteractiveMessage | ButtonMessage | LocationMessage | ContactsMessage | ReactionMessage | OrderMessage | SystemMessage | UnsupportedMessage | GroupMessage;
|
|
3175
|
+
type WhatsAppMessage = TextMessage | ImageMessage | VideoMessage | AudioMessage | DocumentMessage | StickerMessage | InteractiveMessage | ButtonMessage | LocationMessage | ContactsMessage | ReactionMessage | OrderMessage | SystemMessage | EditMessage | RevokeMessage | UnsupportedMessage | GroupMessage;
|
|
2977
3176
|
//#endregion
|
|
2978
3177
|
//#region src/core/webhook/types/history.d.ts
|
|
2979
3178
|
/**
|
|
@@ -3413,6 +3612,13 @@ interface StatusWebhook {
|
|
|
3413
3612
|
recipient_participant_id?: string;
|
|
3414
3613
|
recipient_identity_key_hash?: string;
|
|
3415
3614
|
biz_opaque_callback_data?: string;
|
|
3615
|
+
/**
|
|
3616
|
+
* ID of the template used to send a Direct Send message.
|
|
3617
|
+
* Present only on statuses for messages sent with a `category` field.
|
|
3618
|
+
*
|
|
3619
|
+
* @see {@link https://developers.facebook.com/documentation/business-messaging/whatsapp/direct-send/supported-message-types | Direct Send}
|
|
3620
|
+
*/
|
|
3621
|
+
template_id?: string;
|
|
3416
3622
|
conversation?: {
|
|
3417
3623
|
id: string;
|
|
3418
3624
|
expiration_timestamp?: string;
|
|
@@ -3621,7 +3827,7 @@ type MetaErrorData = {
|
|
|
3621
3827
|
interface MetaError extends Error {
|
|
3622
3828
|
error: MetaErrorData;
|
|
3623
3829
|
}
|
|
3624
|
-
declare const WHATSAPP_ERROR_CODES: readonly [0, 1, 2, 3, 4, 10, 33, 100, 190, 200, 299, 368, 613, 80007, 130429, 130472, 130497, 131000, 131005, 131008, 131009, 131016, 131020, 131021, 131026, 131030, 131031, 131037, 131041, 131042, 131044, 131045, 131047, 131048, 131049, 131050, 131051, 131052, 131053, 131055, 131056, 131057, 131059, 131201, 131202, 131203, 131204, 131207, 131208, 131209, 131210, 131211, 131212, 131213, 131214, 131215, 132000, 132001, 132005, 132007, 132008, 132012, 132015, 132016, 132068, 132069, 133000, 133004, 133005, 133006, 133008, 133009, 133010, 133015, 133016, 134011, 134100, 134101, 134102, 135000, 137000, 138000, 138001, 138002, 138003, 138004, 138005, 138006, 138007, 138009, 138012, 138013, 138018, 139000, 139001, 139002, 139003, 139004, 139100, 139101, 139102, 139103, 200005, 200006, 200007, 1752041, 2388001, 2388012, 2388019, 2388040, 2388047, 2388072, 2388073, 2388091, 2388093, 2388103, 2388293, 2388299, 2494100, 2593079, 2593085, 2593107, 2593108];
|
|
3830
|
+
declare const WHATSAPP_ERROR_CODES: readonly [0, 1, 2, 3, 4, 10, 33, 100, 190, 200, 299, 368, 613, 80007, 130429, 130472, 130497, 131000, 131005, 131008, 131009, 131016, 131020, 131021, 131026, 131030, 131031, 131037, 131041, 131042, 131044, 131045, 131047, 131048, 131049, 131050, 131051, 131052, 131053, 131055, 131056, 131057, 131059, 131201, 131202, 131203, 131204, 131207, 131208, 131209, 131210, 131211, 131212, 131213, 131214, 131215, 132000, 132001, 132005, 132007, 132008, 132012, 132015, 132016, 132068, 132069, 133000, 133004, 133005, 133006, 133008, 133009, 133010, 133015, 133016, 134011, 134100, 134101, 134102, 135000, 137000, 138000, 138001, 138002, 138003, 138004, 138005, 138006, 138007, 138009, 138012, 138013, 138018, 139000, 139001, 139002, 139003, 139004, 139100, 139101, 139102, 139103, 147005, 200005, 200006, 200007, 1752041, 2388001, 2388012, 2388019, 2388040, 2388047, 2388072, 2388073, 2388091, 2388093, 2388103, 2388293, 2388299, 2494100, 2593079, 2593085, 2593107, 2593108];
|
|
3625
3831
|
type ApiPermissionErrorCode = number;
|
|
3626
3832
|
type WhatsAppErrorCode = (typeof WHATSAPP_ERROR_CODES)[number] | ApiPermissionErrorCode;
|
|
3627
3833
|
//#endregion
|
|
@@ -4041,6 +4247,12 @@ declare const Category: {
|
|
|
4041
4247
|
readonly Utility: "UTILITY";
|
|
4042
4248
|
};
|
|
4043
4249
|
type CategoryType = (typeof Category)[keyof typeof Category];
|
|
4250
|
+
declare const MessageCategory: {
|
|
4251
|
+
readonly Authentication: "authentication";
|
|
4252
|
+
readonly Service: "service";
|
|
4253
|
+
readonly Utility: "utility";
|
|
4254
|
+
};
|
|
4255
|
+
type MessageCategoryType = (typeof MessageCategory)[keyof typeof MessageCategory];
|
|
4044
4256
|
declare const TemplateStatus: {
|
|
4045
4257
|
readonly Approved: "APPROVED";
|
|
4046
4258
|
readonly Pending: "PENDING";
|
|
@@ -4105,6 +4317,7 @@ declare const InteractiveTypes: {
|
|
|
4105
4317
|
readonly LocationRequest: "location_request_message";
|
|
4106
4318
|
readonly AddressMessage: "address_message";
|
|
4107
4319
|
readonly Flow: "flow";
|
|
4320
|
+
readonly VoiceCall: "voice_call";
|
|
4108
4321
|
};
|
|
4109
4322
|
type InteractiveTypesType = (typeof InteractiveTypes)[keyof typeof InteractiveTypes];
|
|
4110
4323
|
declare const ButtonPosition: {
|
|
@@ -4326,5 +4539,5 @@ interface LoggerInterface {
|
|
|
4326
4539
|
debug(...data: any[]): void;
|
|
4327
4540
|
}
|
|
4328
4541
|
//#endregion
|
|
4329
|
-
export { type AcceptCallRequest, type AccountMode, type ApiPermissionErrorCode, type AudioMediaObject, AudioMediaTypes, AudioMediaTypesEnum, AudioMediaTypesType, type AudioMessage, type AuthenticationTemplateOptions, type BaseClass, type BlockUsersClass, type BlockUsersResponse, type BlockedUserInfo, type BodyOptions, type BusinessProfileClass, type BusinessProfileData, type BusinessProfileField, type BusinessProfileFieldsParam, type BusinessProfileResponse, BusinessVerticalEnum, type ButtonMessage, type ButtonOptions, ButtonPosition, ButtonPositionEnum, ButtonPositionType, type CallAction, type CallActionResponse, type CallHours, type CallHoursDay, type CallHoursStatus, type CallIconVisibility, type CallPermission, type CallPermissionAction, type CallPermissionLimit, type CallPermissionsResponse, type CallSdpType, type CallSession, type CallbackPermissionStatus, type CallingClass, type CallingSettings, type CallingSettingsResponse, type CallingStatus,
|
|
4542
|
+
export { type AcceptCallRequest, type AccountMode, type ApiPermissionErrorCode, type AudioMediaObject, AudioMediaTypes, AudioMediaTypesEnum, AudioMediaTypesType, type AudioMessage, type AuthenticationTemplateOptions, type BaseClass, type BlockUsersClass, type BlockUsersResponse, type BlockedUserInfo, type BodyOptions, type BusinessProfileClass, type BusinessProfileData, type BusinessProfileField, type BusinessProfileFieldsParam, type BusinessProfileResponse, BusinessVerticalEnum, type ButtonMessage, type ButtonOptions, ButtonPosition, ButtonPositionEnum, ButtonPositionType, type CallAction, type CallActionResponse, type CallHours, type CallHoursDay, type CallHoursStatus, type CallIconVisibility, type CallPermission, type CallPermissionAction, type CallPermissionLimit, type CallPermissionsResponse, type CallSdpType, type CallSession, type CallbackPermissionStatus, type CallingClass, type CallingSettings, type CallingSettingsResponse, type CallingStatus, CarouselCard, type CarouselOptions, CatalogButton, type CatalogTemplateOptions, Category, CategoryEnum, CategoryType, type CodeVerificationStatus, type CommerceClass, type CommerceSetting, type CommerceSettingsResponse, ComponentType, ComponentTypeType, ComponentTypes, ComponentTypesEnum, type ContactObject, type ContactsMessage, ConversationTypes, ConversationTypesEnum, ConversationTypesType, CopyCodeButton, type CouponTemplateOptions, type CreateFlowResponse, type CreateQrCodeRequest, CurrencyCodesEnum, type CurrencyParameter, type Cursors, DataLocalizationRegion, DataLocalizationRegionEnum, DataLocalizationRegionType, type DateTimeParameter, type DocumentMediaObject, DocumentMediaTypes, DocumentMediaTypesEnum, DocumentMediaTypesType, type DocumentMessage, type EncryptionPublicKeyResponse, type ErrorWebhookValue, type FailedUserInfo, type Flow, FlowActionEnum, type FlowAsset, type FlowAssetsResponse, FlowButton, FlowCategoryEnum, type FlowClass, type FlowDataExchangeRequest, type FlowDataExchangeResponse, type FlowDecryptedRequestResponse, type FlowEncryptedRequestPayload, type FlowEndpointRequest, type FlowEndpointResponse, type FlowErrorNotificationRequest, type FlowErrorNotificationResponse, type FlowHealthCheckRequest, type FlowHealthCheckResponse, type FlowHttpRequest, type FlowMigrationFailure, type FlowMigrationResponse, type FlowMigrationResult, type FlowPreview, type FlowPreviewResponse, FlowStatusEnum, type FlowSuccessScreenResponse, type FlowType, FlowTypeEnum, type FlowValidationError, type FlowValidationErrorPointer, type FlowsListResponse, type FooterOptions, type GeneralHeaderInterface, type GeneralMessageBody, type GeneralRequestBody, type GroupCreateRequest, type GroupCreateResponse, type GroupInfoField, type GroupInfoFieldsParam, type GroupInfoResponse, type GroupInviteLinkResponse, type GroupJoinApprovalMode, type GroupJoinRequest, type GroupJoinRequestError, type GroupJoinRequestFailure, type GroupJoinRequestsActionResponse, type GroupJoinRequestsResponse, type GroupListParams, type GroupListResponse, type GroupMessage, type GroupParticipant, type GroupSettingsResponse, type GroupsClass, type HeaderOptions, type HealthStatus, type HealthStatusEntity, type HolidaySchedule, type HostPlatform, HttpMethods, HttpMethodsEnum, HttpMethodsType, type HttpsClientClass, type HttpsClientResponseClass, type ImageMediaObject, ImageMediaTypes, ImageMediaTypesEnum, ImageMediaTypesType, type ImageMessage, type InitiateCallRequest, type InitiateCallResponse, type InteractiveButtonReplyMessage, type InteractiveListReplyMessage, type InteractiveMessage, type InteractiveObject, InteractiveTypes, InteractiveTypesEnum, InteractiveTypesType, Languages, LanguagesEnum, LanguagesType, type LimitedTimeOfferOptions, type LimitedTimeOfferTemplateOptions, type ListBlockedUsersParams, type ListBlockedUsersResponse, type LocationMessage, type LocationObject, type LocationParameter, type LoggerInterface, MPMButton, type MPMTemplateOptions, type MarketingMessageRequest, type MarketingMessagesClass, type MediaCardCarouselTemplateOptions, MediaCarouselCard, MediaClass, type MediaParameter, MediaResponse, MediasResponse, MessageCategory, MessageCategoryEnum, MessageCategoryType, type MessageRecipientType, type MessageRequestBody, type MessageRequestParams, type MessageTemplateObject, MessageTypes, MessageTypesEnum, MessageTypesType, type MessageWebhookValue, type MessagesClass, type MessagesResponse, type MessagingLimitTier, type MetaError, type MetaErrorData, type MetaErrorDetail, OTPButton, type OTPTemplateOptions, type OrderMessage, type Pagination, type PaginationCursors, type Paging, ParametersTypes, ParametersTypesEnum, ParametersTypesType, type PaymentConfiguration, type PaymentConfigurationCode, type PaymentConfigurationCreateRequest, type PaymentConfigurationCreateResponse, type PaymentConfigurationDeleteRequest, type PaymentConfigurationOauthLinkRequest, type PaymentConfigurationOauthLinkResponse, type PaymentConfigurationProvider, type PaymentConfigurationStatus, type PaymentConfigurationUpdateRequest, type PaymentConfigurationUpdateResponse, type PaymentConfigurationsResponse, type PaymentsClass, PhoneNumberButton, type PhoneNumberClass, type PhoneNumberField, type PhoneNumberFieldsParam, type PhoneNumberFilter, type PhoneNumberResponse, type PhoneNumberSort, type PhoneNumberStatus, type PhoneNumbersListParams, type PhoneNumbersResponse, type PlatformType, type PreAcceptCallRequest, type ProductCardCarouselTemplateOptions, ProductCarouselCard, type ProductParameter, type ProductSection, type QrCodeClass, type QrCodeResponse, type QrCodesResponse, type QualityRating, type QualityScore, QuickReplyButton, type ReactionMessage, type ReactionParams, ReferralSourceTypes, ReferralSourceTypesEnum, ReferralSourceTypesType, type RegistrationClass, type RegistrationRequest, type RejectCallRequest, RequestCodeMethods, RequestCodeMethodsEnum, RequestCodeMethodsType, type RequestVerificationCodeRequest, type RequesterClass, type RequesterResponseInterface, type ResponseData, type ResponseHeaderValue, type ResponseHeaders, type ResponseJSONBody, type ResponsePagination, type ResponseSuccess, SPMButton, type SPMTemplateOptions, type SipServer, type SipSettings, type SipStatus, Status, StatusEnum, type StatusParams, type StatusResponse, StatusType, type StatusWebhook, type StatusWebhookValue, type StickerMediaObject, StickerMediaTypes, StickerMediaTypesEnum, StickerMediaTypesType, type StickerMessage, SubType, SubTypeEnum, SubTypeType, SystemChangeTypes, SystemChangeTypesEnum, SystemChangeTypesType, type SystemMessage, TemplateBody, TemplateButton, TemplateButtons, TemplateCarousel, TemplateClass, TemplateDeleteParams, TemplateFooter, TemplateFormat, TemplateGetParams, TemplateHeader, TemplateHeaderExample, TemplateLimitedTimeOffer, type TemplateOptions, type TemplateParameter, TemplateRequestBody, TemplateResponse, TemplateStatus, TemplateStatusEnum, TemplateStatusType, type TerminateCallRequest, type TextMessage, type TextMessageParams, type TextObject, type TextParameter, type Throughput, type ThroughputLevel, type TwoStepVerificationClass, type TwoStepVerificationParams, type TwoStepVerificationRequest, URLButton, type UnifiedCertStatus, type UnsupportedMessage, type UpdateBusinessProfileRequest, type UpdateCallingSettingsRequest, type UpdateCommerceSettingsRequest, type UpdateFlowResponse, type UpdateGroupSettingsRequest, type UpdateQrCodeRequest, type UpdateWabaSubscription, UploadMediaResponse, type ValidateFlowJsonResponse, type VerifyCodeRequest, type VideoMediaObject, VideoMediaTypes, VideoMediaTypesEnum, VideoMediaTypesType, type VideoMessage, type WABAClass, type WabaAccount, type WabaAccountFields, type WabaAccountFieldsParam, WabaAccountReviewStatus, WabaAccountStatus, WabaBusinessVerificationStatus, WabaConfigEnum, type WabaConfigType, type WabaHealthStatus, WabaHealthStatusCanSendMessage, type WabaHealthStatusEntity, type WabaHealthStatusError, type WabaSubscription, type WabaSubscriptions, type WebhookContact, type WebhookEvent, type WebhookMessage, type WebhookPayload, WebhookTypes, WebhookTypesEnum, WebhookTypesType, type WebhookValue, type WeeklyOperatingHours, type WhatsAppConfig, type WhatsAppErrorCode, type WhatsAppMessage };
|
|
4330
4543
|
//# sourceMappingURL=index.d.ts.map
|