meta-cloud-api 1.7.2 → 2.0.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 +39 -526
- package/dist/chunk-WfQuXRBF.js +1 -0
- package/dist/{index.d.ts → index-BXi6HUC-.d.ts} +601 -22
- package/dist/index-BXi6HUC-.d.ts.map +1 -0
- package/dist/index.js +11 -9
- package/dist/index.js.map +1 -1
- package/dist/types/{enums-DEu7hLmx.d.ts → enums-DyHU9JT1.d.ts} +2 -1
- package/dist/types/enums-DyHU9JT1.d.ts.map +1 -0
- package/dist/types/enums.js +2 -1
- package/dist/types/enums.js.map +1 -0
- package/dist/types/{index.d.ts → index-CNpKf-Cm.d.ts} +408 -19
- package/dist/types/index-CNpKf-Cm.d.ts.map +1 -0
- package/dist/types/index.js +1 -1
- package/dist/types/index.js.map +1 -1
- package/dist/utils/{index.d.ts → index-DS_nKCVm.d.ts} +111 -13
- package/dist/utils/index-DS_nKCVm.d.ts.map +1 -0
- package/dist/utils/index.js +13 -2
- package/dist/utils/index.js.map +1 -1
- package/package.json +1 -1
- package/dist/chunk-CTAAG5j7.js +0 -1
- package/dist/index.d.ts.map +0 -1
- package/dist/types/enums-DEu7hLmx.d.ts.map +0 -1
- package/dist/types/enums-U752Hos7.js +0 -2
- package/dist/types/enums-U752Hos7.js.map +0 -1
- package/dist/types/enums.d.ts +0 -2
- package/dist/types/index.d.ts.map +0 -1
- package/dist/utils/index.d.ts.map +0 -1
|
@@ -1,10 +1,8 @@
|
|
|
1
|
+
import { t as __exportAll } from "./chunk-WfQuXRBF.js";
|
|
1
2
|
import { Agent } from "https";
|
|
2
3
|
import { IncomingHttpHeaders, IncomingMessage } from "http";
|
|
3
4
|
|
|
4
5
|
//#region src/types/enums.d.ts
|
|
5
|
-
declare namespace enums_d_exports {
|
|
6
|
-
export { AudioMediaTypesEnum, BusinessVerticalEnum, ButtonPositionEnum, CategoryEnum, ComponentTypesEnum, ConversationTypesEnum, CurrencyCodesEnum, DataLocalizationRegionEnum, DocumentMediaTypesEnum, HttpMethodsEnum, ImageMediaTypesEnum, InteractiveTypesEnum, LanguagesEnum, MessageTypesEnum, ParametersTypesEnum, ReferralSourceTypesEnum, RequestCodeMethodsEnum, StatusEnum, StickerMediaTypesEnum, SubTypeEnum, SystemChangeTypesEnum, TemplateStatusEnum, VideoMediaTypesEnum, WabaConfigEnum, WebhookTypesEnum };
|
|
7
|
-
}
|
|
8
6
|
declare enum CategoryEnum {
|
|
9
7
|
Authentication = "AUTHENTICATION",
|
|
10
8
|
Marketing = "MARKETING",
|
|
@@ -69,6 +67,7 @@ declare enum InteractiveTypesEnum {
|
|
|
69
67
|
Product = "product",
|
|
70
68
|
ProductList = "product_list",
|
|
71
69
|
CtaUrl = "cta_url",
|
|
70
|
+
Carousel = "carousel",
|
|
72
71
|
LocationRequest = "location_request_message",
|
|
73
72
|
AddressMessage = "address_message",
|
|
74
73
|
Flow = "flow",
|
|
@@ -1765,7 +1764,7 @@ interface GetUploadHandleParams {
|
|
|
1765
1764
|
/**
|
|
1766
1765
|
* Available fields that can be requested when retrieving a business profile.
|
|
1767
1766
|
*/
|
|
1768
|
-
type BusinessProfileField = 'about' | 'address' | 'description' | 'email' | 'profile_picture_url' | 'websites' | 'vertical';
|
|
1767
|
+
type BusinessProfileField = 'about' | 'address' | 'description' | 'email' | 'messaging_product' | 'profile_picture_url' | 'websites' | 'vertical';
|
|
1769
1768
|
type BusinessProfileFieldsParam = BusinessProfileField[] | string;
|
|
1770
1769
|
/**
|
|
1771
1770
|
* Business profile data structure containing all profile information.
|
|
@@ -1930,6 +1929,8 @@ type QualityScore = {
|
|
|
1930
1929
|
type Throughput = {
|
|
1931
1930
|
level: ThroughputLevel;
|
|
1932
1931
|
};
|
|
1932
|
+
type PhoneNumberField = 'display_phone_number' | 'id' | 'quality_rating' | 'verified_name' | 'account_mode' | 'certificate' | 'code_verification_status' | 'conversational_automation' | 'eligibility_for_api_business_global_search' | 'health_status' | 'is_official_business_account' | 'is_on_biz_app' | 'is_pin_enabled' | 'is_preverified_number' | 'last_onboarded_time' | 'messaging_limit_tier' | 'name_status' | 'new_certificate' | 'new_name_status' | 'platform_type' | 'quality_score' | 'search_visibility' | 'status' | 'throughput';
|
|
1933
|
+
type PhoneNumberFieldsParam = PhoneNumberField[] | string;
|
|
1933
1934
|
type PhoneNumberResponse = {
|
|
1934
1935
|
display_phone_number: string;
|
|
1935
1936
|
id: string;
|
|
@@ -2010,7 +2011,7 @@ type ThroughputResponse = {
|
|
|
2010
2011
|
id: string;
|
|
2011
2012
|
};
|
|
2012
2013
|
interface PhoneNumberClass {
|
|
2013
|
-
getPhoneNumberById(fields?:
|
|
2014
|
+
getPhoneNumberById(fields?: PhoneNumberFieldsParam): Promise<PhoneNumberResponse>;
|
|
2014
2015
|
getPhoneNumbers(): Promise<PhoneNumbersResponse>;
|
|
2015
2016
|
requestVerificationCode(params: RequestVerificationCodeRequest): Promise<ResponseSuccess>;
|
|
2016
2017
|
verifyCode(params: VerifyCodeRequest): Promise<ResponseSuccess>;
|
|
@@ -2500,7 +2501,7 @@ type OrgObject = {
|
|
|
2500
2501
|
title?: string;
|
|
2501
2502
|
};
|
|
2502
2503
|
type PhoneObject = {
|
|
2503
|
-
phone?:
|
|
2504
|
+
phone?: string;
|
|
2504
2505
|
type?: 'CELL' | 'MAIN' | 'IPHONE' | 'HOME' | 'WORK' | string;
|
|
2505
2506
|
wa_id?: string;
|
|
2506
2507
|
};
|
|
@@ -2698,7 +2699,51 @@ type FlowInteractiveObject = {
|
|
|
2698
2699
|
header?: HeaderObject;
|
|
2699
2700
|
action: FlowActionObject;
|
|
2700
2701
|
};
|
|
2701
|
-
type
|
|
2702
|
+
type CarouselHeaderObject = {
|
|
2703
|
+
type: 'image' | 'video';
|
|
2704
|
+
image?: ImageMediaObject$1;
|
|
2705
|
+
video?: VideoMediaObject$1;
|
|
2706
|
+
};
|
|
2707
|
+
type CarouselQuickReply = {
|
|
2708
|
+
id: string;
|
|
2709
|
+
title: string;
|
|
2710
|
+
};
|
|
2711
|
+
type CarouselQuickReplyButton = {
|
|
2712
|
+
type: 'quick_reply';
|
|
2713
|
+
quick_reply: CarouselQuickReply;
|
|
2714
|
+
};
|
|
2715
|
+
type CarouselCtaUrlAction = {
|
|
2716
|
+
name: 'cta_url';
|
|
2717
|
+
parameters: CtaUrlParameters;
|
|
2718
|
+
};
|
|
2719
|
+
type CarouselQuickReplyAction = {
|
|
2720
|
+
buttons: CarouselQuickReplyButton[];
|
|
2721
|
+
};
|
|
2722
|
+
type MediaCarouselCard$1 = {
|
|
2723
|
+
card_index: number;
|
|
2724
|
+
type: 'cta_url';
|
|
2725
|
+
header: CarouselHeaderObject;
|
|
2726
|
+
body?: SimpleTextObject;
|
|
2727
|
+
action: CarouselCtaUrlAction | CarouselQuickReplyAction;
|
|
2728
|
+
};
|
|
2729
|
+
type ProductCarouselAction = {
|
|
2730
|
+
product_retailer_id: string;
|
|
2731
|
+
catalog_id: string;
|
|
2732
|
+
};
|
|
2733
|
+
type ProductCarouselCard$1 = {
|
|
2734
|
+
card_index: number;
|
|
2735
|
+
type: 'product';
|
|
2736
|
+
action: ProductCarouselAction;
|
|
2737
|
+
};
|
|
2738
|
+
type CarouselActionObject = {
|
|
2739
|
+
cards: Array<MediaCarouselCard$1 | ProductCarouselCard$1>;
|
|
2740
|
+
};
|
|
2741
|
+
type CarouselInteractiveObject = {
|
|
2742
|
+
type: InteractiveTypesEnum.Carousel;
|
|
2743
|
+
body: SimpleTextObject;
|
|
2744
|
+
action: CarouselActionObject;
|
|
2745
|
+
};
|
|
2746
|
+
type InteractiveObject = ButtonInteractiveObject | ListInteractiveObject | ProductInteractiveObject | ProductListInteractiveObject | CtaUrlInteractiveObject | CarouselInteractiveObject | LocationRequestInteractiveObject | AddressMessageInteractiveObject | FlowInteractiveObject;
|
|
2702
2747
|
//#endregion
|
|
2703
2748
|
//#region src/api/messages/types/reaction.d.ts
|
|
2704
2749
|
interface ReactionParams {
|
|
@@ -2774,6 +2819,9 @@ declare class MessagesClass extends BaseClass {
|
|
|
2774
2819
|
interactiveFlow(params: MessageRequestParams<InteractiveObject & {
|
|
2775
2820
|
type: InteractiveTypesEnum.Flow;
|
|
2776
2821
|
}>): Promise<MessagesResponse>;
|
|
2822
|
+
interactiveCarousel(params: MessageRequestParams<InteractiveObject & {
|
|
2823
|
+
type: InteractiveTypesEnum.Carousel;
|
|
2824
|
+
}>): Promise<MessagesResponse>;
|
|
2777
2825
|
reaction(params: ReactionParams): Promise<MessagesResponse>;
|
|
2778
2826
|
markAsRead(params: {
|
|
2779
2827
|
messageId: string;
|
|
@@ -2933,12 +2981,14 @@ interface WabaAccount {
|
|
|
2933
2981
|
message_template_namespace?: string;
|
|
2934
2982
|
name?: string;
|
|
2935
2983
|
ownership_type?: string;
|
|
2984
|
+
timezone_id?: string;
|
|
2985
|
+
primary_business_location?: Record<string, unknown> | string;
|
|
2936
2986
|
currency?: string;
|
|
2937
2987
|
}
|
|
2938
2988
|
/**
|
|
2939
2989
|
* Available fields for WABA account queries
|
|
2940
2990
|
*/
|
|
2941
|
-
type WabaAccountFields = 'id' | 'name' | 'account_review_status' | 'auth_international_rate_eligibility' | 'business_verification_status' | 'country' | 'currency' | 'health_status' | 'status' | 'ownership_type' | 'message_template_namespace';
|
|
2991
|
+
type WabaAccountFields = 'id' | 'name' | 'timezone_id' | 'account_review_status' | 'auth_international_rate_eligibility' | 'business_verification_status' | 'country' | 'currency' | 'health_status' | 'status' | 'ownership_type' | 'message_template_namespace' | 'primary_business_location';
|
|
2942
2992
|
/**
|
|
2943
2993
|
* Parameter type for specifying which WABA account fields to retrieve
|
|
2944
2994
|
*/
|
|
@@ -3093,19 +3143,416 @@ interface BlockUsersClass {
|
|
|
3093
3143
|
listBlockedUsers(params?: ListBlockedUsersParams): Promise<ListBlockedUsersResponse>;
|
|
3094
3144
|
}
|
|
3095
3145
|
//#endregion
|
|
3146
|
+
//#region src/api/groups/types/groups.d.ts
|
|
3147
|
+
/**
|
|
3148
|
+
* Groups API Types
|
|
3149
|
+
* @see https://developers.facebook.com/documentation/business-messaging/whatsapp/groups/reference/
|
|
3150
|
+
*/
|
|
3151
|
+
type GroupJoinApprovalMode = 'approval_required' | 'auto_approve';
|
|
3152
|
+
type GroupCreateRequest = {
|
|
3153
|
+
subject: string;
|
|
3154
|
+
description?: string;
|
|
3155
|
+
join_approval_mode?: GroupJoinApprovalMode;
|
|
3156
|
+
};
|
|
3157
|
+
type GroupCreateResponse = {
|
|
3158
|
+
messaging_product: 'whatsapp';
|
|
3159
|
+
id: string;
|
|
3160
|
+
invite_link?: string;
|
|
3161
|
+
};
|
|
3162
|
+
type GroupInfoField = 'join_approval_mode' | 'subject' | 'description' | 'suspended' | 'creation_timestamp' | 'participants' | 'total_participant_count';
|
|
3163
|
+
type GroupInfoFieldsParam = GroupInfoField[] | string;
|
|
3164
|
+
type GroupParticipant = {
|
|
3165
|
+
wa_id: string;
|
|
3166
|
+
};
|
|
3167
|
+
type GroupInfoResponse = {
|
|
3168
|
+
messaging_product: 'whatsapp';
|
|
3169
|
+
id: string;
|
|
3170
|
+
subject?: string;
|
|
3171
|
+
description?: string;
|
|
3172
|
+
suspended?: boolean;
|
|
3173
|
+
creation_timestamp?: number;
|
|
3174
|
+
participants?: GroupParticipant[];
|
|
3175
|
+
total_participant_count?: number;
|
|
3176
|
+
join_approval_mode?: GroupJoinApprovalMode;
|
|
3177
|
+
};
|
|
3178
|
+
type GroupInviteLinkResponse = {
|
|
3179
|
+
messaging_product: 'whatsapp';
|
|
3180
|
+
invite_link: string;
|
|
3181
|
+
};
|
|
3182
|
+
type GroupJoinRequest = {
|
|
3183
|
+
join_request_id: string;
|
|
3184
|
+
wa_id: string;
|
|
3185
|
+
creation_timestamp: number;
|
|
3186
|
+
};
|
|
3187
|
+
type GroupJoinRequestError = {
|
|
3188
|
+
code: number;
|
|
3189
|
+
message: string;
|
|
3190
|
+
title?: string;
|
|
3191
|
+
error_data?: {
|
|
3192
|
+
details?: string;
|
|
3193
|
+
};
|
|
3194
|
+
};
|
|
3195
|
+
type GroupJoinRequestFailure = {
|
|
3196
|
+
join_request_id: string;
|
|
3197
|
+
errors: GroupJoinRequestError[];
|
|
3198
|
+
};
|
|
3199
|
+
type GroupJoinRequestsResponse = {
|
|
3200
|
+
data: GroupJoinRequest[];
|
|
3201
|
+
paging?: PagingInfo$1;
|
|
3202
|
+
};
|
|
3203
|
+
type GroupJoinRequestsActionResponse = {
|
|
3204
|
+
messaging_product: 'whatsapp';
|
|
3205
|
+
approved_join_requests?: string[];
|
|
3206
|
+
rejected_join_requests?: string[];
|
|
3207
|
+
failed_join_requests?: GroupJoinRequestFailure[];
|
|
3208
|
+
errors?: GroupJoinRequestError[];
|
|
3209
|
+
};
|
|
3210
|
+
type GroupSummary = {
|
|
3211
|
+
id: string;
|
|
3212
|
+
subject: string;
|
|
3213
|
+
created_at: number;
|
|
3214
|
+
};
|
|
3215
|
+
type GroupListResponse = {
|
|
3216
|
+
data: {
|
|
3217
|
+
groups: GroupSummary[];
|
|
3218
|
+
};
|
|
3219
|
+
paging?: PagingInfo$1;
|
|
3220
|
+
};
|
|
3221
|
+
type GroupListParams = {
|
|
3222
|
+
limit?: number;
|
|
3223
|
+
after?: string;
|
|
3224
|
+
before?: string;
|
|
3225
|
+
};
|
|
3226
|
+
type UpdateGroupSettingsRequest = {
|
|
3227
|
+
subject?: string;
|
|
3228
|
+
description?: string;
|
|
3229
|
+
profilePictureFile?: Blob | Buffer;
|
|
3230
|
+
};
|
|
3231
|
+
type GroupSettingsResponse = ResponseSuccess;
|
|
3232
|
+
interface GroupsClass {
|
|
3233
|
+
createGroup(params: GroupCreateRequest): Promise<GroupCreateResponse>;
|
|
3234
|
+
deleteGroup(groupId: string): Promise<ResponseSuccess>;
|
|
3235
|
+
getGroupInfo(groupId: string, fields?: GroupInfoFieldsParam): Promise<GroupInfoResponse>;
|
|
3236
|
+
getActiveGroups(params?: GroupListParams): Promise<GroupListResponse>;
|
|
3237
|
+
getGroupInviteLink(groupId: string): Promise<GroupInviteLinkResponse>;
|
|
3238
|
+
resetGroupInviteLink(groupId: string): Promise<GroupInviteLinkResponse>;
|
|
3239
|
+
getJoinRequests(groupId: string): Promise<GroupJoinRequestsResponse>;
|
|
3240
|
+
approveJoinRequests(groupId: string, joinRequestIds: string[]): Promise<GroupJoinRequestsActionResponse>;
|
|
3241
|
+
rejectJoinRequests(groupId: string, joinRequestIds: string[]): Promise<GroupJoinRequestsActionResponse>;
|
|
3242
|
+
removeParticipants(groupId: string, participants: string[]): Promise<ResponseSuccess>;
|
|
3243
|
+
updateGroupSettings(groupId: string, params: UpdateGroupSettingsRequest): Promise<GroupSettingsResponse>;
|
|
3244
|
+
}
|
|
3245
|
+
type PagingInfo$1 = {
|
|
3246
|
+
cursors?: {
|
|
3247
|
+
before?: string;
|
|
3248
|
+
after?: string;
|
|
3249
|
+
};
|
|
3250
|
+
previous?: string;
|
|
3251
|
+
next?: string;
|
|
3252
|
+
};
|
|
3253
|
+
//#endregion
|
|
3254
|
+
//#region src/api/calling/types/calling.d.ts
|
|
3255
|
+
/**
|
|
3256
|
+
* Calling API Types
|
|
3257
|
+
* @see https://developers.facebook.com/documentation/business-messaging/whatsapp/calling/reference/
|
|
3258
|
+
*/
|
|
3259
|
+
type CallingStatus = 'ENABLED' | 'DISABLED';
|
|
3260
|
+
type CallIconVisibility = 'DEFAULT' | 'DISABLE_ALL';
|
|
3261
|
+
type CallbackPermissionStatus = 'ENABLED' | 'DISABLED';
|
|
3262
|
+
type CallHoursStatus = 'ENABLED' | 'DISABLED';
|
|
3263
|
+
type SipStatus = 'ENABLED' | 'DISABLED';
|
|
3264
|
+
type CallHoursDay = 'MONDAY' | 'TUESDAY' | 'WEDNESDAY' | 'THURSDAY' | 'FRIDAY' | 'SATURDAY' | 'SUNDAY';
|
|
3265
|
+
type WeeklyOperatingHours = {
|
|
3266
|
+
day_of_week: CallHoursDay;
|
|
3267
|
+
open_time: string;
|
|
3268
|
+
close_time: string;
|
|
3269
|
+
};
|
|
3270
|
+
type HolidaySchedule = {
|
|
3271
|
+
date: string;
|
|
3272
|
+
start_time: string;
|
|
3273
|
+
end_time: string;
|
|
3274
|
+
};
|
|
3275
|
+
type CallHours = {
|
|
3276
|
+
status: CallHoursStatus;
|
|
3277
|
+
timezone_id: string;
|
|
3278
|
+
weekly_operating_hours: WeeklyOperatingHours[];
|
|
3279
|
+
holiday_schedule?: HolidaySchedule[];
|
|
3280
|
+
};
|
|
3281
|
+
type SipServer = {
|
|
3282
|
+
hostname: string;
|
|
3283
|
+
port?: number;
|
|
3284
|
+
request_uri_user_params?: Record<string, string>;
|
|
3285
|
+
sip_user_password?: string;
|
|
3286
|
+
};
|
|
3287
|
+
type SipSettings = {
|
|
3288
|
+
status: SipStatus;
|
|
3289
|
+
servers?: SipServer[];
|
|
3290
|
+
};
|
|
3291
|
+
type CallingSettings = {
|
|
3292
|
+
status?: CallingStatus;
|
|
3293
|
+
call_icon_visibility?: CallIconVisibility;
|
|
3294
|
+
call_hours?: CallHours;
|
|
3295
|
+
callback_permission_status?: CallbackPermissionStatus;
|
|
3296
|
+
sip?: SipSettings;
|
|
3297
|
+
};
|
|
3298
|
+
type UpdateCallingSettingsRequest = {
|
|
3299
|
+
calling: CallingSettings;
|
|
3300
|
+
};
|
|
3301
|
+
type CallingSettingsResponse = {
|
|
3302
|
+
calling?: CallingSettings;
|
|
3303
|
+
[key: string]: unknown;
|
|
3304
|
+
};
|
|
3305
|
+
type CallPermission = {
|
|
3306
|
+
status: string;
|
|
3307
|
+
expiration_time?: number;
|
|
3308
|
+
};
|
|
3309
|
+
type CallPermissionLimit = {
|
|
3310
|
+
time_period: string;
|
|
3311
|
+
max_allowed: number;
|
|
3312
|
+
current_usage: number;
|
|
3313
|
+
limit_expiration_time?: number;
|
|
3314
|
+
};
|
|
3315
|
+
type CallPermissionAction = {
|
|
3316
|
+
action_name: string;
|
|
3317
|
+
can_perform_action: boolean;
|
|
3318
|
+
limits?: CallPermissionLimit[];
|
|
3319
|
+
};
|
|
3320
|
+
type CallPermissionsResponse = {
|
|
3321
|
+
messaging_product: 'whatsapp';
|
|
3322
|
+
permission: CallPermission;
|
|
3323
|
+
actions?: CallPermissionAction[];
|
|
3324
|
+
};
|
|
3325
|
+
type CallSdpType = 'offer' | 'answer';
|
|
3326
|
+
type CallSession = {
|
|
3327
|
+
sdp_type: CallSdpType;
|
|
3328
|
+
sdp: string;
|
|
3329
|
+
};
|
|
3330
|
+
type CallAction = 'connect' | 'pre_accept' | 'accept' | 'reject' | 'terminate';
|
|
3331
|
+
type InitiateCallRequest = {
|
|
3332
|
+
to: string;
|
|
3333
|
+
session: CallSession;
|
|
3334
|
+
biz_opaque_callback_data?: string;
|
|
3335
|
+
};
|
|
3336
|
+
type PreAcceptCallRequest = {
|
|
3337
|
+
call_id: string;
|
|
3338
|
+
session?: CallSession;
|
|
3339
|
+
};
|
|
3340
|
+
type AcceptCallRequest = {
|
|
3341
|
+
call_id: string;
|
|
3342
|
+
session?: CallSession;
|
|
3343
|
+
biz_opaque_callback_data?: string;
|
|
3344
|
+
};
|
|
3345
|
+
type RejectCallRequest = {
|
|
3346
|
+
call_id: string;
|
|
3347
|
+
};
|
|
3348
|
+
type TerminateCallRequest = {
|
|
3349
|
+
call_id: string;
|
|
3350
|
+
};
|
|
3351
|
+
type InitiateCallResponse = {
|
|
3352
|
+
messaging_product: 'whatsapp';
|
|
3353
|
+
calls: Array<{
|
|
3354
|
+
id: string;
|
|
3355
|
+
}>;
|
|
3356
|
+
};
|
|
3357
|
+
type CallActionResponse = {
|
|
3358
|
+
messaging_product: 'whatsapp';
|
|
3359
|
+
success: boolean;
|
|
3360
|
+
};
|
|
3361
|
+
interface CallingClass {
|
|
3362
|
+
updateCallingSettings(params: UpdateCallingSettingsRequest): Promise<ResponseSuccess>;
|
|
3363
|
+
getCallingSettings(params?: {
|
|
3364
|
+
fields?: string[] | string;
|
|
3365
|
+
include_sip_credentials?: boolean;
|
|
3366
|
+
}): Promise<CallingSettingsResponse>;
|
|
3367
|
+
getCallPermissions(params: {
|
|
3368
|
+
userWaId: string;
|
|
3369
|
+
}): Promise<CallPermissionsResponse>;
|
|
3370
|
+
initiateCall(params: InitiateCallRequest): Promise<InitiateCallResponse>;
|
|
3371
|
+
preAcceptCall(params: PreAcceptCallRequest): Promise<CallActionResponse>;
|
|
3372
|
+
acceptCall(params: AcceptCallRequest): Promise<CallActionResponse>;
|
|
3373
|
+
rejectCall(params: RejectCallRequest): Promise<CallActionResponse>;
|
|
3374
|
+
terminateCall(params: TerminateCallRequest): Promise<CallActionResponse>;
|
|
3375
|
+
}
|
|
3376
|
+
//#endregion
|
|
3377
|
+
//#region src/api/marketingMessages/types/marketingMessages.d.ts
|
|
3378
|
+
/**
|
|
3379
|
+
* Marketing Messages API Types
|
|
3380
|
+
* @see https://developers.facebook.com/documentation/business-messaging/whatsapp/marketing-messages/send-marketing-messages/
|
|
3381
|
+
*/
|
|
3382
|
+
type MarketingMessageRequest = {
|
|
3383
|
+
to: string;
|
|
3384
|
+
template: MessageTemplateObject<ComponentTypesEnum>;
|
|
3385
|
+
message_activity_sharing?: boolean;
|
|
3386
|
+
};
|
|
3387
|
+
interface MarketingMessagesClass {
|
|
3388
|
+
sendTemplateMessage(params: MarketingMessageRequest): Promise<MessagesResponse>;
|
|
3389
|
+
}
|
|
3390
|
+
//#endregion
|
|
3391
|
+
//#region src/api/commerce/types/commerce.d.ts
|
|
3392
|
+
/**
|
|
3393
|
+
* Commerce Settings API Types
|
|
3394
|
+
* @see https://developers.facebook.com/documentation/business-messaging/whatsapp/catalogs/sell-products-and-services/set-commerce-settings/
|
|
3395
|
+
*/
|
|
3396
|
+
type CommerceSetting = {
|
|
3397
|
+
id: string;
|
|
3398
|
+
is_cart_enabled?: boolean;
|
|
3399
|
+
is_catalog_visible?: boolean;
|
|
3400
|
+
};
|
|
3401
|
+
type CommerceSettingsResponse = {
|
|
3402
|
+
data: CommerceSetting[];
|
|
3403
|
+
};
|
|
3404
|
+
type UpdateCommerceSettingsRequest = {
|
|
3405
|
+
is_cart_enabled?: boolean;
|
|
3406
|
+
is_catalog_visible?: boolean;
|
|
3407
|
+
};
|
|
3408
|
+
interface CommerceClass {
|
|
3409
|
+
getCommerceSettings(): Promise<CommerceSettingsResponse>;
|
|
3410
|
+
updateCommerceSettings(params: UpdateCommerceSettingsRequest): Promise<ResponseSuccess>;
|
|
3411
|
+
}
|
|
3412
|
+
//#endregion
|
|
3413
|
+
//#region src/api/payments/types/payments.d.ts
|
|
3414
|
+
/**
|
|
3415
|
+
* Payments API Types (India Payment Configuration)
|
|
3416
|
+
* @see https://developers.facebook.com/documentation/business-messaging/whatsapp/payments/payments-in/onboarding-apis/
|
|
3417
|
+
*/
|
|
3418
|
+
type PaymentConfigurationProvider = 'upi_vpa' | 'razorpay' | 'payu' | 'zaakpay';
|
|
3419
|
+
type PaymentConfigurationStatus = 'Active' | 'Needs_Connecting' | 'Needs_Testing';
|
|
3420
|
+
type PaymentConfigurationCode = {
|
|
3421
|
+
code: string;
|
|
3422
|
+
description?: string;
|
|
3423
|
+
};
|
|
3424
|
+
type PaymentConfiguration = {
|
|
3425
|
+
configuration_name: string;
|
|
3426
|
+
provider_name: string;
|
|
3427
|
+
provider_mid?: string;
|
|
3428
|
+
status?: PaymentConfigurationStatus;
|
|
3429
|
+
merchant_category_code?: PaymentConfigurationCode;
|
|
3430
|
+
purpose_code?: PaymentConfigurationCode;
|
|
3431
|
+
created_timestamp?: number;
|
|
3432
|
+
updated_timestamp?: number;
|
|
3433
|
+
};
|
|
3434
|
+
type PaymentConfigurationsResponse = {
|
|
3435
|
+
data: Array<{
|
|
3436
|
+
payment_configurations: PaymentConfiguration[];
|
|
3437
|
+
}>;
|
|
3438
|
+
};
|
|
3439
|
+
type PaymentConfigurationCreateRequest = {
|
|
3440
|
+
configuration_name: string;
|
|
3441
|
+
provider_name: PaymentConfigurationProvider;
|
|
3442
|
+
purpose_code?: string;
|
|
3443
|
+
merchant_category_code?: string;
|
|
3444
|
+
redirect_url?: string;
|
|
3445
|
+
merchant_vpa?: string;
|
|
3446
|
+
};
|
|
3447
|
+
type PaymentConfigurationUpdateRequest = {
|
|
3448
|
+
provider_name?: PaymentConfigurationProvider;
|
|
3449
|
+
purpose_code?: string;
|
|
3450
|
+
merchant_category_code?: string;
|
|
3451
|
+
redirect_url?: string;
|
|
3452
|
+
merchant_vpa?: string;
|
|
3453
|
+
};
|
|
3454
|
+
type PaymentConfigurationCreateResponse = {
|
|
3455
|
+
success: boolean;
|
|
3456
|
+
oauth_url?: string;
|
|
3457
|
+
expiration?: number;
|
|
3458
|
+
};
|
|
3459
|
+
type PaymentConfigurationUpdateResponse = PaymentConfigurationCreateResponse;
|
|
3460
|
+
type PaymentConfigurationOauthLinkRequest = {
|
|
3461
|
+
configuration_name: string;
|
|
3462
|
+
redirect_url?: string;
|
|
3463
|
+
};
|
|
3464
|
+
type PaymentConfigurationOauthLinkResponse = {
|
|
3465
|
+
oauth_url: string;
|
|
3466
|
+
expiration?: number;
|
|
3467
|
+
};
|
|
3468
|
+
type PaymentConfigurationDeleteRequest = {
|
|
3469
|
+
configuration_name: string;
|
|
3470
|
+
};
|
|
3471
|
+
interface PaymentsClass {
|
|
3472
|
+
listPaymentConfigurations(wabaId: string): Promise<PaymentConfigurationsResponse>;
|
|
3473
|
+
getPaymentConfiguration(wabaId: string, configurationName: string): Promise<PaymentConfigurationsResponse>;
|
|
3474
|
+
createPaymentConfiguration(wabaId: string, params: PaymentConfigurationCreateRequest): Promise<PaymentConfigurationCreateResponse>;
|
|
3475
|
+
updatePaymentConfiguration(wabaId: string, configurationName: string, params: PaymentConfigurationUpdateRequest): Promise<PaymentConfigurationUpdateResponse>;
|
|
3476
|
+
generatePaymentConfigurationOauthLink(wabaId: string, params: PaymentConfigurationOauthLinkRequest): Promise<PaymentConfigurationOauthLinkResponse>;
|
|
3477
|
+
deletePaymentConfiguration(wabaId: string, params: PaymentConfigurationDeleteRequest): Promise<ResponseSuccess>;
|
|
3478
|
+
}
|
|
3479
|
+
//#endregion
|
|
3096
3480
|
//#region src/utils/isMetaError.d.ts
|
|
3097
|
-
|
|
3098
|
-
|
|
3099
|
-
|
|
3100
|
-
|
|
3101
|
-
|
|
3102
|
-
|
|
3103
|
-
|
|
3104
|
-
details: string;
|
|
3105
|
-
};
|
|
3106
|
-
error_subcode?: number;
|
|
3107
|
-
fbtrace_id: string;
|
|
3481
|
+
type MetaErrorData = {
|
|
3482
|
+
message: string;
|
|
3483
|
+
type: string;
|
|
3484
|
+
code: number;
|
|
3485
|
+
error_data?: {
|
|
3486
|
+
messaging_product?: 'whatsapp';
|
|
3487
|
+
details?: string;
|
|
3108
3488
|
};
|
|
3489
|
+
error_subcode?: number;
|
|
3490
|
+
fbtrace_id: string;
|
|
3491
|
+
};
|
|
3492
|
+
interface MetaError extends Error {
|
|
3493
|
+
error: MetaErrorData;
|
|
3494
|
+
}
|
|
3495
|
+
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];
|
|
3496
|
+
type ApiPermissionErrorCode = number;
|
|
3497
|
+
type WhatsAppErrorCode = (typeof WHATSAPP_ERROR_CODES)[number] | ApiPermissionErrorCode;
|
|
3498
|
+
declare const AUTHORIZATION_ERROR_CODES: readonly [0, 3, 10, 190];
|
|
3499
|
+
declare const THROTTLING_ERROR_CODES: readonly [4, 80007, 130429, 131048, 131056];
|
|
3500
|
+
declare const INTEGRITY_ERROR_CODES: readonly [368, 130497, 131031];
|
|
3501
|
+
declare const SEND_MESSAGE_ERROR_CODES: readonly [130472, 131000, 131005, 131008, 131009, 131016, 131021, 131026, 131030, 131042, 131044, 131045, 131047, 131050, 131051, 131052, 131053, 131056, 131057, 131048, 132000, 132001, 132005, 132007, 132008, 132012, 132015, 132016, 132068, 132069, 135000, 137000];
|
|
3502
|
+
declare const FLOW_ERROR_CODES: readonly [139000, 139001, 139002, 139003, 139004];
|
|
3503
|
+
declare const BLOCK_USER_ERROR_CODES: readonly [139100, 139101, 139102, 139103];
|
|
3504
|
+
declare const CALLING_ERROR_CODES: readonly [138000, 138001, 138002, 138003, 138004, 138005, 138006, 138007, 138009, 138012, 138013, 138018, 613];
|
|
3505
|
+
declare const GROUP_ERROR_CODES: readonly [131020, 131041, 131059, 131201, 131202, 131203, 131204, 131207, 131208, 131209, 131210, 131211, 131212, 131213, 131214, 131215];
|
|
3506
|
+
declare function isWhatsAppErrorCode(code: number): code is WhatsAppErrorCode;
|
|
3507
|
+
declare function isApiPermissionErrorCode(code: number): code is ApiPermissionErrorCode;
|
|
3508
|
+
declare function isAuthorizationErrorCode(code: number): code is ApiPermissionErrorCode | (typeof AUTHORIZATION_ERROR_CODES)[number];
|
|
3509
|
+
declare function isThrottlingErrorCode(code: number): code is (typeof THROTTLING_ERROR_CODES)[number];
|
|
3510
|
+
declare function isIntegrityErrorCode(code: number): code is (typeof INTEGRITY_ERROR_CODES)[number];
|
|
3511
|
+
declare function isSendMessageErrorCode(code: number): code is (typeof SEND_MESSAGE_ERROR_CODES)[number];
|
|
3512
|
+
declare function isFlowErrorCode(code: number): code is (typeof FLOW_ERROR_CODES)[number];
|
|
3513
|
+
declare function isBlockUserErrorCode(code: number): code is (typeof BLOCK_USER_ERROR_CODES)[number];
|
|
3514
|
+
declare function isCallingErrorCode(code: number): code is (typeof CALLING_ERROR_CODES)[number];
|
|
3515
|
+
declare function isGroupErrorCode(code: number): code is (typeof GROUP_ERROR_CODES)[number];
|
|
3516
|
+
declare class WhatsAppError extends Error {
|
|
3517
|
+
constructor(message: string);
|
|
3518
|
+
}
|
|
3519
|
+
declare class WhatsAppApiError extends WhatsAppError {
|
|
3520
|
+
readonly error: MetaErrorData;
|
|
3521
|
+
readonly statusCode?: number;
|
|
3522
|
+
constructor(message: string, error: MetaErrorData, statusCode?: number);
|
|
3523
|
+
}
|
|
3524
|
+
declare class WhatsAppAuthorizationError extends WhatsAppApiError {
|
|
3525
|
+
constructor(message: string, error: MetaErrorData, statusCode?: number);
|
|
3526
|
+
}
|
|
3527
|
+
declare class WhatsAppThrottlingError extends WhatsAppApiError {
|
|
3528
|
+
constructor(message: string, error: MetaErrorData, statusCode?: number);
|
|
3529
|
+
}
|
|
3530
|
+
declare class WhatsAppIntegrityError extends WhatsAppApiError {
|
|
3531
|
+
constructor(message: string, error: MetaErrorData, statusCode?: number);
|
|
3532
|
+
}
|
|
3533
|
+
declare class WhatsAppSendMessageError extends WhatsAppApiError {
|
|
3534
|
+
constructor(message: string, error: MetaErrorData, statusCode?: number);
|
|
3535
|
+
}
|
|
3536
|
+
declare class WhatsAppFlowError extends WhatsAppApiError {
|
|
3537
|
+
constructor(message: string, error: MetaErrorData, statusCode?: number);
|
|
3538
|
+
}
|
|
3539
|
+
declare class WhatsAppBlockUserError extends WhatsAppApiError {
|
|
3540
|
+
constructor(message: string, error: MetaErrorData, statusCode?: number);
|
|
3541
|
+
}
|
|
3542
|
+
declare class WhatsAppCallingError extends WhatsAppApiError {
|
|
3543
|
+
constructor(message: string, error: MetaErrorData, statusCode?: number);
|
|
3544
|
+
}
|
|
3545
|
+
declare class WhatsAppGroupError extends WhatsAppApiError {
|
|
3546
|
+
constructor(message: string, error: MetaErrorData, statusCode?: number);
|
|
3547
|
+
}
|
|
3548
|
+
declare function createWhatsAppApiError(error: MetaErrorData, statusCode?: number): WhatsAppApiError;
|
|
3549
|
+
declare class WhatsAppNetworkError extends WhatsAppError {
|
|
3550
|
+
readonly cause?: unknown;
|
|
3551
|
+
constructor(message: string, cause?: unknown);
|
|
3552
|
+
}
|
|
3553
|
+
declare class WhatsAppUnknownError extends WhatsAppError {
|
|
3554
|
+
readonly cause?: unknown;
|
|
3555
|
+
constructor(message: string, cause?: unknown);
|
|
3109
3556
|
}
|
|
3110
3557
|
/**
|
|
3111
3558
|
* Determines if the error is a Meta API error response
|
|
@@ -3113,6 +3560,20 @@ interface MetaError extends Error {
|
|
|
3113
3560
|
* @returns Type guard indicating if error is a Meta API error
|
|
3114
3561
|
*/
|
|
3115
3562
|
declare function isMetaError(error: any): error is MetaError;
|
|
3563
|
+
declare function isWhatsAppApiErrorResponse(error: any): error is MetaError & {
|
|
3564
|
+
error: {
|
|
3565
|
+
code: WhatsAppErrorCode;
|
|
3566
|
+
};
|
|
3567
|
+
};
|
|
3568
|
+
declare function isWhatsAppAuthorizationError(error: unknown): error is WhatsAppAuthorizationError;
|
|
3569
|
+
declare function isWhatsAppThrottlingError(error: unknown): error is WhatsAppThrottlingError;
|
|
3570
|
+
declare function isWhatsAppIntegrityError(error: unknown): error is WhatsAppIntegrityError;
|
|
3571
|
+
declare function isWhatsAppSendMessageError(error: unknown): error is WhatsAppSendMessageError;
|
|
3572
|
+
declare function isWhatsAppFlowError(error: unknown): error is WhatsAppFlowError;
|
|
3573
|
+
declare function isWhatsAppBlockUserError(error: unknown): error is WhatsAppBlockUserError;
|
|
3574
|
+
declare function isWhatsAppCallingError(error: unknown): error is WhatsAppCallingError;
|
|
3575
|
+
declare function isWhatsAppGroupError(error: unknown): error is WhatsAppGroupError;
|
|
3576
|
+
declare function normalizeMetaError(errorData: unknown, statusCode?: number): MetaError;
|
|
3116
3577
|
//#endregion
|
|
3117
3578
|
//#region src/api/flow/types/common.d.ts
|
|
3118
3579
|
/**
|
|
@@ -3686,6 +4147,27 @@ type EncryptionKeyPair = {
|
|
|
3686
4147
|
* ```
|
|
3687
4148
|
*/
|
|
3688
4149
|
declare function generateEncryption(passphrase?: string): EncryptionKeyPair;
|
|
4150
|
+
/**
|
|
4151
|
+
* Decrypt a WhatsApp Flow request
|
|
4152
|
+
* @param body - Encrypted request body containing encrypted_aes_key, encrypted_flow_data, and initial_vector
|
|
4153
|
+
* @param config - WABA configuration containing FLOW_API_PRIVATE_PEM and FLOW_API_PASSPHRASE
|
|
4154
|
+
* @returns Decrypted flow request body, AES key buffer, and initial vector buffer
|
|
4155
|
+
* @throws {Error} If required encryption properties are missing or decryption fails
|
|
4156
|
+
*/
|
|
4157
|
+
declare function decryptFlowRequest(body: any, config: WabaConfigType): {
|
|
4158
|
+
decryptedBody: FlowEndpointRequest;
|
|
4159
|
+
aesKeyBuffer: Buffer;
|
|
4160
|
+
initialVectorBuffer: Buffer;
|
|
4161
|
+
};
|
|
4162
|
+
/**
|
|
4163
|
+
* Encrypt a WhatsApp Flow response
|
|
4164
|
+
* @param response - Response object to encrypt
|
|
4165
|
+
* @param aesKeyBuffer - AES key buffer from the decrypted request
|
|
4166
|
+
* @param initialVectorBuffer - Initial vector buffer from the decrypted request
|
|
4167
|
+
* @returns Base64-encoded encrypted response
|
|
4168
|
+
* @throws {Error} If encryption fails
|
|
4169
|
+
*/
|
|
4170
|
+
declare function encryptFlowResponse(response: any, aesKeyBuffer: Buffer, initialVectorBuffer: Buffer): string;
|
|
3689
4171
|
//#endregion
|
|
3690
4172
|
//#region src/utils/http/httpsClient.d.ts
|
|
3691
4173
|
declare class HttpsClient implements HttpsClientClass {
|
|
@@ -3795,6 +4277,39 @@ declare class BlockUsersApi extends BaseAPI implements BlockUsersClass {
|
|
|
3795
4277
|
listBlockedUsers(params?: ListBlockedUsersParams): Promise<ListBlockedUsersResponse>;
|
|
3796
4278
|
}
|
|
3797
4279
|
//#endregion
|
|
4280
|
+
//#region src/api/calling/CallingApi.d.ts
|
|
4281
|
+
/**
|
|
4282
|
+
* API for WhatsApp Calling features.
|
|
4283
|
+
*/
|
|
4284
|
+
declare class CallingApi extends BaseAPI implements CallingClass {
|
|
4285
|
+
private readonly endpoint;
|
|
4286
|
+
constructor(config: WabaConfigType, client: RequesterClass);
|
|
4287
|
+
updateCallingSettings(params: UpdateCallingSettingsRequest): Promise<ResponseSuccess>;
|
|
4288
|
+
getCallingSettings(params?: {
|
|
4289
|
+
fields?: string[] | string;
|
|
4290
|
+
include_sip_credentials?: boolean;
|
|
4291
|
+
}): Promise<CallingSettingsResponse>;
|
|
4292
|
+
getCallPermissions(params: {
|
|
4293
|
+
userWaId: string;
|
|
4294
|
+
}): Promise<CallPermissionsResponse>;
|
|
4295
|
+
initiateCall(params: InitiateCallRequest): Promise<InitiateCallResponse>;
|
|
4296
|
+
preAcceptCall(params: PreAcceptCallRequest): Promise<CallActionResponse>;
|
|
4297
|
+
acceptCall(params: AcceptCallRequest): Promise<CallActionResponse>;
|
|
4298
|
+
rejectCall(params: RejectCallRequest): Promise<CallActionResponse>;
|
|
4299
|
+
terminateCall(params: TerminateCallRequest): Promise<CallActionResponse>;
|
|
4300
|
+
}
|
|
4301
|
+
//#endregion
|
|
4302
|
+
//#region src/api/commerce/CommerceApi.d.ts
|
|
4303
|
+
/**
|
|
4304
|
+
* API for WhatsApp Commerce Settings.
|
|
4305
|
+
*/
|
|
4306
|
+
declare class CommerceApi extends BaseAPI implements CommerceClass {
|
|
4307
|
+
private readonly endpoint;
|
|
4308
|
+
constructor(config: WabaConfigType, client: RequesterClass);
|
|
4309
|
+
getCommerceSettings(): Promise<CommerceSettingsResponse>;
|
|
4310
|
+
updateCommerceSettings(params: UpdateCommerceSettingsRequest): Promise<ResponseSuccess>;
|
|
4311
|
+
}
|
|
4312
|
+
//#endregion
|
|
3798
4313
|
//#region src/api/encryption/EncryptionApi.d.ts
|
|
3799
4314
|
declare class EncryptionApi extends BaseAPI implements EncryptionClass {
|
|
3800
4315
|
private readonly endpoint;
|
|
@@ -3803,6 +4318,43 @@ declare class EncryptionApi extends BaseAPI implements EncryptionClass {
|
|
|
3803
4318
|
setEncryptionPublicKey(businessPublicKey: string): Promise<ResponseSuccess>;
|
|
3804
4319
|
}
|
|
3805
4320
|
//#endregion
|
|
4321
|
+
//#region src/api/groups/GroupsApi.d.ts
|
|
4322
|
+
/**
|
|
4323
|
+
* API for managing WhatsApp Groups.
|
|
4324
|
+
*
|
|
4325
|
+
* This API allows you to:
|
|
4326
|
+
* - Create and delete groups
|
|
4327
|
+
* - Approve/reject join requests
|
|
4328
|
+
* - Manage group invite links
|
|
4329
|
+
* - Remove participants
|
|
4330
|
+
* - Update group settings
|
|
4331
|
+
* - Fetch group metadata and active groups
|
|
4332
|
+
*/
|
|
4333
|
+
declare class GroupsApi extends BaseAPI implements GroupsClass {
|
|
4334
|
+
constructor(config: WabaConfigType, client: RequesterClass);
|
|
4335
|
+
createGroup(params: GroupCreateRequest): Promise<GroupCreateResponse>;
|
|
4336
|
+
deleteGroup(groupId: string): Promise<ResponseSuccess>;
|
|
4337
|
+
getGroupInfo(groupId: string, fields?: GroupInfoFieldsParam): Promise<GroupInfoResponse>;
|
|
4338
|
+
getActiveGroups(params?: GroupListParams): Promise<GroupListResponse>;
|
|
4339
|
+
getGroupInviteLink(groupId: string): Promise<GroupInviteLinkResponse>;
|
|
4340
|
+
resetGroupInviteLink(groupId: string): Promise<GroupInviteLinkResponse>;
|
|
4341
|
+
getJoinRequests(groupId: string): Promise<GroupJoinRequestsResponse>;
|
|
4342
|
+
approveJoinRequests(groupId: string, joinRequestIds: string[]): Promise<GroupJoinRequestsActionResponse>;
|
|
4343
|
+
rejectJoinRequests(groupId: string, joinRequestIds: string[]): Promise<GroupJoinRequestsActionResponse>;
|
|
4344
|
+
removeParticipants(groupId: string, participants: string[]): Promise<ResponseSuccess>;
|
|
4345
|
+
updateGroupSettings(groupId: string, params: UpdateGroupSettingsRequest): Promise<GroupSettingsResponse>;
|
|
4346
|
+
}
|
|
4347
|
+
//#endregion
|
|
4348
|
+
//#region src/api/marketingMessages/MarketingMessagesApi.d.ts
|
|
4349
|
+
/**
|
|
4350
|
+
* API for WhatsApp Marketing Messages.
|
|
4351
|
+
*/
|
|
4352
|
+
declare class MarketingMessagesApi extends BaseAPI implements MarketingMessagesClass {
|
|
4353
|
+
private readonly endpoint;
|
|
4354
|
+
constructor(config: WabaConfigType, client: RequesterClass);
|
|
4355
|
+
sendTemplateMessage(params: MarketingMessageRequest): Promise<MessagesResponse>;
|
|
4356
|
+
}
|
|
4357
|
+
//#endregion
|
|
3806
4358
|
//#region src/api/media/MediaApi.d.ts
|
|
3807
4359
|
/**
|
|
3808
4360
|
* API for managing WhatsApp Media.
|
|
@@ -4019,6 +4571,14 @@ declare class MessagesApi extends BaseAPI implements MessagesClass {
|
|
|
4019
4571
|
interactiveFlow(params: MessageRequestParams<InteractiveObject & {
|
|
4020
4572
|
type: InteractiveTypesEnum.Flow;
|
|
4021
4573
|
}>): Promise<MessagesResponse>;
|
|
4574
|
+
/**
|
|
4575
|
+
* Sends a carousel interactive message
|
|
4576
|
+
* @param params The carousel interactive message parameters
|
|
4577
|
+
* @returns Promise with the message response
|
|
4578
|
+
*/
|
|
4579
|
+
interactiveCarousel(params: MessageRequestParams<InteractiveObject & {
|
|
4580
|
+
type: InteractiveTypesEnum.Carousel;
|
|
4581
|
+
}>): Promise<MessagesResponse>;
|
|
4022
4582
|
/**
|
|
4023
4583
|
* Sends a reaction to a message
|
|
4024
4584
|
* @param params The reaction parameters
|
|
@@ -4027,6 +4587,20 @@ declare class MessagesApi extends BaseAPI implements MessagesClass {
|
|
|
4027
4587
|
reaction(params: ReactionParams): Promise<MessagesResponse>;
|
|
4028
4588
|
}
|
|
4029
4589
|
//#endregion
|
|
4590
|
+
//#region src/api/payments/PaymentsApi.d.ts
|
|
4591
|
+
/**
|
|
4592
|
+
* API for WhatsApp Payments (India payment configuration).
|
|
4593
|
+
*/
|
|
4594
|
+
declare class PaymentsApi extends BaseAPI implements PaymentsClass {
|
|
4595
|
+
constructor(config: WabaConfigType, client: RequesterClass);
|
|
4596
|
+
listPaymentConfigurations(wabaId: string): Promise<PaymentConfigurationsResponse>;
|
|
4597
|
+
getPaymentConfiguration(wabaId: string, configurationName: string): Promise<PaymentConfigurationsResponse>;
|
|
4598
|
+
createPaymentConfiguration(wabaId: string, params: PaymentConfigurationCreateRequest): Promise<PaymentConfigurationCreateResponse>;
|
|
4599
|
+
updatePaymentConfiguration(wabaId: string, configurationName: string, params: PaymentConfigurationUpdateRequest): Promise<PaymentConfigurationUpdateResponse>;
|
|
4600
|
+
generatePaymentConfigurationOauthLink(wabaId: string, params: PaymentConfigurationOauthLinkRequest): Promise<PaymentConfigurationOauthLinkResponse>;
|
|
4601
|
+
deletePaymentConfiguration(wabaId: string, params: PaymentConfigurationDeleteRequest): Promise<ResponseSuccess>;
|
|
4602
|
+
}
|
|
4603
|
+
//#endregion
|
|
4030
4604
|
//#region src/api/phone/PhoneNumberApi.d.ts
|
|
4031
4605
|
/**
|
|
4032
4606
|
* API for managing WhatsApp Phone Numb ers.
|
|
@@ -4050,7 +4624,7 @@ declare class PhoneNumberApi extends BaseAPI implements PhoneNumberClass {
|
|
|
4050
4624
|
* const phoneNumber = await whatsappClient.phoneNumber.getPhoneNumberById();
|
|
4051
4625
|
* const phoneNumberWithFields = await whatsappClient.phoneNumber.getPhoneNumberById('display_phone_number,verified_name');
|
|
4052
4626
|
*/
|
|
4053
|
-
getPhoneNumberById(fields?:
|
|
4627
|
+
getPhoneNumberById(fields?: PhoneNumberFieldsParam): Promise<PhoneNumberResponse>;
|
|
4054
4628
|
/**
|
|
4055
4629
|
* Get all phone numbers for the business account.
|
|
4056
4630
|
*
|
|
@@ -4505,8 +5079,13 @@ declare class WhatsApp {
|
|
|
4505
5079
|
config: WabaConfigType;
|
|
4506
5080
|
requester: Readonly<Requester>;
|
|
4507
5081
|
blockUsers: BlockUsersApi;
|
|
5082
|
+
calling: CallingApi;
|
|
5083
|
+
commerce: CommerceApi;
|
|
5084
|
+
groups: GroupsApi;
|
|
5085
|
+
marketingMessages: MarketingMessagesApi;
|
|
4508
5086
|
messages: MessagesApi;
|
|
4509
5087
|
media: MediaApi;
|
|
5088
|
+
payments: PaymentsApi;
|
|
4510
5089
|
phoneNumbers: PhoneNumberApi;
|
|
4511
5090
|
twoStepVerification: TwoStepVerificationApi;
|
|
4512
5091
|
flows: FlowApi;
|
|
@@ -5119,5 +5698,5 @@ declare function isFlowErrorRequest(request: FlowEndpointRequest): request is Fl
|
|
|
5119
5698
|
*/
|
|
5120
5699
|
declare function isFlowPingRequest(request: FlowEndpointRequest): request is FlowHealthCheckRequest;
|
|
5121
5700
|
//#endregion
|
|
5122
|
-
export { AccountMode, AudioMediaObject, AudioMediaTypesEnum, AudioMessage, AudioMessageHandler, AudioProcessedMessage, AuthenticationTemplateOptions, BaseClass, BlockUserObject, BlockUsersApi, BlockUsersClass, BlockUsersRequest, BlockUsersResponse, BlockedUserInfo, BodyOptions, BusinessProfileApi, BusinessProfileClass, BusinessProfileData, BusinessProfileField, BusinessProfileFieldsParam, BusinessProfileResponse, BusinessVerticalEnum, ButtonMessage, ButtonMessageHandler, ButtonOptions, ButtonPositionEnum, ButtonProcessedMessage, CarouselCard, CarouselOptions, CatalogButton, CatalogTemplateOptions, CategoryEnum, CodeVerificationStatus, ComponentTypes, ComponentTypesEnum, ContactObject, ContactsMessage, ContactsMessageHandler, ContactsProcessedMessage, ConversationTypesEnum, CopyCodeButton, CouponTemplateOptions, CreateFlowResponse, CreateQrCodeRequest, CreateUploadSessionParams, CurrencyCodesEnum, CurrencyParameter, Cursors, DataLocalizationRegionEnum, DateTimeParameter, DocumentMediaObject, DocumentMediaTypesEnum, DocumentMessage, DocumentMessageHandler, DocumentProcessedMessage, EncryptionApi, EncryptionClass, EncryptionKeyPair, EncryptionPublicKeyResponse, ErrorWebhookValue, ExpressRequest, ExpressResponse, ExpressWebhookConfig, FailedUserInfo, Flow, FlowActionEnum, FlowApi, FlowAsset, FlowAssetsResponse, FlowButton, FlowCategoryEnum, FlowClass, FlowDataExchangeRequest, FlowDataExchangeResponse, FlowDecryptedRequestResponse, FlowEncryptedRequestPayload, FlowEndpointRequest, FlowEndpointResponse, FlowErrorNotificationRequest, FlowErrorNotificationResponse, FlowHandler, FlowHealthCheckRequest, FlowHealthCheckResponse, FlowHttpRequest, FlowMigrationFailure, FlowMigrationResponse, FlowMigrationResult, FlowPreview, FlowPreviewResponse, FlowStatusEnum, FlowSuccessScreenResponse, FlowType, FlowTypeEnum, FlowValidationError, FlowValidationErrorPointer, FlowsListResponse, FooterOptions, GeneralHeaderInterface, GeneralMessageBody, GeneralRequestBody, GetUploadHandleParams, GroupMessage, HeaderOptions, HealthStatus, HealthStatusEntity, HttpMethodsEnum, HttpsClientClass, HttpsClientResponseClass, ImageMediaObject, ImageMediaTypesEnum, ImageMessage, ImageMessageHandler, ImageProcessedMessage, InteractiveButtonReplyMessage, InteractiveListReplyMessage, InteractiveMessage, InteractiveMessageHandler, InteractiveObject, InteractiveProcessedMessage, InteractiveTypesEnum, LanguagesEnum, LimitedTimeOfferOptions, LimitedTimeOfferTemplateOptions, ListBlockedUsersParams, ListBlockedUsersResponse, LocationMessage, LocationMessageHandler, LocationObject, LocationParameter, LocationProcessedMessage, Logger, LoggerInterface, MPMButton, MPMTemplateOptions, MediaApi, MediaCardCarouselTemplateOptions, MediaCarouselCard, MediaClass, MediaParameter, MediaResponse, MediasResponse, MessagesApi as MessageApi, MessagesApi, MessageHandler, MessageRequestBody, MessageRequestParams, MessageStatus, MessageTemplateObject, MessageTypesEnum, MessageWebhookValue, MessagesClass, MessagesResponse, MessagingLimitTier, MetaError, MetaErrorDetail, NextFunction, NextJsAppWebhookConfig, NextJsWebhookConfig, OTPButton, OTPTemplateOptions, OrderMessage, OrderMessageHandler, OrderProcessedMessage, Pagination, PaginationCursors, Paging, PagingCursors, PagingInfo, ParametersTypesEnum, PhoneNumberApi, PhoneNumberButton, PhoneNumberClass, PhoneNumberResponse, PhoneNumbersResponse, PlatformType, ProcessedMessage, ProcessedStatus, ProductCardCarouselTemplateOptions, ProductCarouselCard, ProductParameter, ProductSection, QrCodeApi, QrCodeClass, QrCodeResponse, QrCodesResponse, QualityRating, QualityScore, QuickReplyButton, ReactionMessage, ReactionMessageHandler, ReactionParams, ReactionProcessedMessage, ReferralSourceTypesEnum, RegistrationApi, RegistrationClass, RegistrationRequest, RequestCodeMethodsEnum, RequestVerificationCodeRequest, RequesterClass, RequesterResponseInterface, ResponseData, ResponseHeaderValue, ResponseHeaders, ResponseJSONBody, ResponsePagination, ResponseSuccess, SPMButton, SPMTemplateOptions, StatusEnum, StatusHandler, StatusParams, StatusWebhook, StatusWebhookValue, StickerMediaObject, StickerMediaTypesEnum, StickerMessage, StickerMessageHandler, StickerProcessedMessage, SubTypeEnum, SystemChangeTypesEnum, SystemMessage, SystemMessageHandler, SystemProcessedMessage, TemplateApi, TemplateBody, TemplateButton, TemplateButtons, TemplateCarousel, TemplateClass, TemplateDeleteParams, TemplateFooter, TemplateFormat, TemplateGetParams, TemplateHeader, TemplateHeaderExample, TemplateLimitedTimeOffer, TemplateOptions, TemplateParameter, TemplateRequestBody, TemplateResponse, TemplateStatusEnum, TextMessage, TextMessageHandler, TextMessageParams, TextObject, TextParameter, TextProcessedMessage, Throughput, ThroughputLevel, TwoStepVerificationApi, TwoStepVerificationClass, TwoStepVerificationParams, TwoStepVerificationRequest, URLButton, UnblockUsersRequest, UnsupportedMessage, UpdateBusinessProfileRequest, UpdateFlowResponse, UpdateQrCodeRequest, UpdateWabaSubscription, UploadBusinessProfileResponse, UploadHandle, UploadMediaParams, UploadMediaResponse, UploadSession, UploadSessionResponse, ValidateFlowJsonResponse, VerifyCodeRequest, VideoMediaObject, VideoMediaTypesEnum, VideoMessage, VideoMessageHandler, VideoProcessedMessage, WABAClass, WabaAccount, WabaAccountFields, WabaAccountFieldsParam, WabaAccountReviewStatus, WabaAccountStatus, WabaApi, WabaBusinessVerificationStatus, WabaConfigEnum, WabaConfigType, WabaHealthStatus, WabaHealthStatusCanSendMessage, WabaHealthStatusEntity, WabaHealthStatusError, WabaSubscription, WabaSubscriptions, WebhookContact, WebhookEvent, WebhookMessage, WebhookPayload, WebhookProcessor, WebhookResponse, WebhookTypesEnum, WebhookValue, WhatsApp, WhatsAppConfig, WhatsAppMessage, buildFieldsQueryString, constructFullUrl, createAuthenticationTemplate, createCatalogTemplate, createCouponTemplate, createLimitedTimeOfferTemplate, createMPMTemplate, createMediaCardCarouselTemplate, createOTPTemplate, createProductCardCarouselTemplate, createSPMTemplate, createTemplate, expressWebhookHandler, formatConfigTable, generateEncryption, generateXHub256Sig, isFlowDataExchangeRequest, isFlowErrorRequest, isFlowPingRequest, isMetaError, nextjsAppWebhookHandler, nextjsPagesWebhookHandler, objectToQueryString, processFlowRequest, processWebhookMessages };
|
|
5123
|
-
//# sourceMappingURL=index
|
|
5701
|
+
export { AUTHORIZATION_ERROR_CODES, AcceptCallRequest, AccountMode, ApiPermissionErrorCode, AudioMediaObject, AudioMediaTypesEnum, AudioMessage, AudioMessageHandler, AudioProcessedMessage, AuthenticationTemplateOptions, BLOCK_USER_ERROR_CODES, BaseApiRequest, BaseApiResponse, BaseClass, BlockUserObject, BlockUsersApi, BlockUsersClass, BlockUsersRequest, BlockUsersResponse, BlockedUserInfo, BodyOptions, BusinessProfileApi, BusinessProfileClass, BusinessProfileData, BusinessProfileField, BusinessProfileFieldsParam, BusinessProfileResponse, BusinessVerticalEnum, ButtonMessage, ButtonMessageHandler, ButtonOptions, ButtonPositionEnum, ButtonProcessedMessage, CALLING_ERROR_CODES, CallAction, CallActionResponse, CallHours, CallHoursDay, CallHoursStatus, CallIconVisibility, CallPermission, CallPermissionAction, CallPermissionLimit, CallPermissionsResponse, CallSdpType, CallSession, CallbackPermissionStatus, CallingApi, CallingClass, CallingSettings, CallingSettingsResponse, CallingStatus, CarouselCard, CarouselOptions, CatalogButton, CatalogTemplateOptions, CategoryEnum, CodeVerificationStatus, CommerceApi, CommerceClass, CommerceSetting, CommerceSettingsResponse, ComponentTypes, ComponentTypesEnum, ContactObject, ContactsMessage, ContactsMessageHandler, ContactsProcessedMessage, ConversationTypesEnum, CopyCodeButton, CouponTemplateOptions, CreateFlowResponse, CreateQrCodeRequest, CreateUploadSessionParams, CurrencyCodesEnum, CurrencyParameter, Cursors, DataLocalizationRegionEnum, DateTimeParameter, DocumentMediaObject, DocumentMediaTypesEnum, DocumentMessage, DocumentMessageHandler, DocumentProcessedMessage, EncryptionApi, EncryptionClass, EncryptionKeyPair, EncryptionPublicKeyResponse, ErrorWebhookValue, ExpressRequest, ExpressResponse, ExpressWebhookConfig, FLOW_ERROR_CODES, FailedUserInfo, Flow, FlowActionEnum, FlowApi, FlowAsset, FlowAssetsResponse, FlowButton, FlowCategoryEnum, FlowClass, FlowDataExchangeRequest, FlowDataExchangeResponse, FlowDecryptedRequestResponse, FlowEncryptedRequestPayload, FlowEndpointRequest, FlowEndpointResponse, FlowErrorNotificationRequest, FlowErrorNotificationResponse, FlowHandler, FlowHealthCheckRequest, FlowHealthCheckResponse, FlowHttpRequest, FlowMigrationFailure, FlowMigrationResponse, FlowMigrationResult, FlowPreview, FlowPreviewResponse, FlowStatusEnum, FlowSuccessScreenResponse, FlowType, FlowTypeEnum, FlowValidationError, FlowValidationErrorPointer, FlowsListResponse, FooterOptions, GROUP_ERROR_CODES, GeneralHeaderInterface, GeneralMessageBody, GeneralRequestBody, GetUploadHandleParams, GroupCreateRequest, GroupCreateResponse, GroupInfoField, GroupInfoFieldsParam, GroupInfoResponse, GroupInviteLinkResponse, GroupJoinApprovalMode, GroupJoinRequest, GroupJoinRequestError, GroupJoinRequestFailure, GroupJoinRequestsActionResponse, GroupJoinRequestsResponse, GroupListParams, GroupListResponse, GroupMessage, GroupParticipant, GroupSettingsResponse, GroupsApi, GroupsClass, HeaderOptions, HealthStatus, HealthStatusEntity, HolidaySchedule, HttpMethodsEnum, HttpsClientClass, HttpsClientResponseClass, INTEGRITY_ERROR_CODES, ImageMediaObject, ImageMediaTypesEnum, ImageMessage, ImageMessageHandler, ImageProcessedMessage, InitiateCallRequest, InitiateCallResponse, InteractiveButtonReplyMessage, InteractiveListReplyMessage, InteractiveMessage, InteractiveMessageHandler, InteractiveObject, InteractiveProcessedMessage, InteractiveTypesEnum, LanguagesEnum, LimitedTimeOfferOptions, LimitedTimeOfferTemplateOptions, ListBlockedUsersParams, ListBlockedUsersResponse, LocationMessage, LocationMessageHandler, LocationObject, LocationParameter, LocationProcessedMessage, Logger, LoggerInterface, MPMButton, MPMTemplateOptions, MarketingMessageRequest, MarketingMessagesApi, MarketingMessagesClass, MediaApi, MediaCardCarouselTemplateOptions, MediaCarouselCard, MediaClass, MediaParameter, MediaResponse, MediasResponse, MessagesApi as MessageApi, MessagesApi, MessageHandler, MessageRequestBody, MessageRequestParams, MessageStatus, MessageTemplateObject, MessageTypesEnum, MessageWebhookValue, MessagesClass, MessagesResponse, MessagingLimitTier, MetaError, MetaErrorData, MetaErrorDetail, NextFunction, NextJsAppWebhookConfig, NextJsWebhookConfig, OTPButton, OTPTemplateOptions, OrderMessage, OrderMessageHandler, OrderProcessedMessage, Pagination, PaginationCursors, Paging, PagingCursors, PagingInfo, ParametersTypesEnum, PaymentConfiguration, PaymentConfigurationCode, PaymentConfigurationCreateRequest, PaymentConfigurationCreateResponse, PaymentConfigurationDeleteRequest, PaymentConfigurationOauthLinkRequest, PaymentConfigurationOauthLinkResponse, PaymentConfigurationProvider, PaymentConfigurationStatus, PaymentConfigurationUpdateRequest, PaymentConfigurationUpdateResponse, PaymentConfigurationsResponse, PaymentsApi, PaymentsClass, PhoneNumberApi, PhoneNumberButton, PhoneNumberClass, PhoneNumberResponse, PhoneNumbersResponse, PlatformType, PreAcceptCallRequest, ProcessedMessage, ProcessedStatus, ProductCardCarouselTemplateOptions, ProductCarouselCard, ProductParameter, ProductSection, QrCodeApi, QrCodeClass, QrCodeResponse, QrCodesResponse, QualityRating, QualityScore, QuickReplyButton, ReactionMessage, ReactionMessageHandler, ReactionParams, ReactionProcessedMessage, ReferralSourceTypesEnum, RegistrationApi, RegistrationClass, RegistrationRequest, RejectCallRequest, RequestCodeMethodsEnum, RequestVerificationCodeRequest, RequesterClass, RequesterResponseInterface, ResponseData, ResponseHeaderValue, ResponseHeaders, ResponseJSONBody, ResponsePagination, ResponseSuccess, SEND_MESSAGE_ERROR_CODES, SPMButton, SPMTemplateOptions, SipServer, SipSettings, SipStatus, StatusEnum, StatusHandler, StatusParams, StatusWebhook, StatusWebhookValue, StickerMediaObject, StickerMediaTypesEnum, StickerMessage, StickerMessageHandler, StickerProcessedMessage, SubTypeEnum, SystemChangeTypesEnum, SystemMessage, SystemMessageHandler, SystemProcessedMessage, THROTTLING_ERROR_CODES, TemplateApi, TemplateBody, TemplateButton, TemplateButtons, TemplateCarousel, TemplateClass, TemplateDeleteParams, TemplateFooter, TemplateFormat, TemplateGetParams, TemplateHeader, TemplateHeaderExample, TemplateLimitedTimeOffer, TemplateOptions, TemplateParameter, TemplateRequestBody, TemplateResponse, TemplateStatusEnum, TerminateCallRequest, TextMessage, TextMessageHandler, TextMessageParams, TextObject, TextParameter, TextProcessedMessage, Throughput, ThroughputLevel, TwoStepVerificationApi, TwoStepVerificationClass, TwoStepVerificationParams, TwoStepVerificationRequest, URLButton, UnblockUsersRequest, UnsupportedMessage, UpdateBusinessProfileRequest, UpdateCallingSettingsRequest, UpdateCommerceSettingsRequest, UpdateFlowResponse, UpdateGroupSettingsRequest, UpdateQrCodeRequest, UpdateWabaSubscription, UploadBusinessProfileResponse, UploadHandle, UploadMediaParams, UploadMediaResponse, UploadSession, UploadSessionResponse, ValidateFlowJsonResponse, VerifyCodeRequest, VideoMediaObject, VideoMediaTypesEnum, VideoMessage, VideoMessageHandler, VideoProcessedMessage, WABAClass, WHATSAPP_ERROR_CODES, WabaAccount, WabaAccountFields, WabaAccountFieldsParam, WabaAccountReviewStatus, WabaAccountStatus, WabaApi, WabaBusinessVerificationStatus, WabaConfigEnum, WabaConfigType, WabaHealthStatus, WabaHealthStatusCanSendMessage, WabaHealthStatusEntity, WabaHealthStatusError, WabaSubscription, WabaSubscriptions, WebhookContact, WebhookEvent, WebhookMessage, WebhookPayload, WebhookProcessor, WebhookResponse, WebhookTypesEnum, WebhookValue, WeeklyOperatingHours, WhatsApp, WhatsAppApiError, WhatsAppAuthorizationError, WhatsAppBlockUserError, WhatsAppCallingError, WhatsAppConfig, WhatsAppError, WhatsAppErrorCode, WhatsAppFlowError, WhatsAppGroupError, WhatsAppIntegrityError, WhatsAppMessage, WhatsAppNetworkError, WhatsAppSendMessageError, WhatsAppThrottlingError, WhatsAppUnknownError, buildFieldsQueryString, constructFullUrl, createAuthenticationTemplate, createCatalogTemplate, createCouponTemplate, createLimitedTimeOfferTemplate, createMPMTemplate, createMediaCardCarouselTemplate, createOTPTemplate, createProductCardCarouselTemplate, createSPMTemplate, createTemplate, createWhatsAppApiError, decryptFlowRequest, encryptFlowResponse, expressWebhookHandler, formatConfigTable, generateEncryption, generateXHub256Sig, isApiPermissionErrorCode, isAuthorizationErrorCode, isBlockUserErrorCode, isCallingErrorCode, isFlowDataExchangeRequest, isFlowErrorCode, isFlowErrorRequest, isFlowPingRequest, isGroupErrorCode, isIntegrityErrorCode, isMetaError, isSendMessageErrorCode, isThrottlingErrorCode, isWhatsAppApiErrorResponse, isWhatsAppAuthorizationError, isWhatsAppBlockUserError, isWhatsAppCallingError, isWhatsAppErrorCode, isWhatsAppFlowError, isWhatsAppGroupError, isWhatsAppIntegrityError, isWhatsAppSendMessageError, isWhatsAppThrottlingError, nextjsAppWebhookHandler, nextjsPagesWebhookHandler, normalizeMetaError, objectToQueryString, processFlowRequest, processWebhookMessages };
|
|
5702
|
+
//# sourceMappingURL=index-BXi6HUC-.d.ts.map
|