meta-cloud-api 0.2.11 → 0.2.13
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 +5 -2
- package/dist/api/index.d.mts +495 -27
- package/dist/api/index.mjs +1 -1
- package/dist/api/index.mjs.map +1 -1
- package/dist/chunk-KZQQJAPX.mjs +2 -0
- package/dist/chunk-KZQQJAPX.mjs.map +1 -0
- package/dist/chunk-N7A7DQDX.mjs +2 -0
- package/dist/chunk-N7A7DQDX.mjs.map +1 -0
- package/dist/chunk-QE4PKOSW.mjs +2 -0
- package/dist/chunk-QE4PKOSW.mjs.map +1 -0
- package/dist/chunk-R4CFE2XP.mjs +2 -0
- package/dist/chunk-R4CFE2XP.mjs.map +1 -0
- package/dist/chunk-XVYL7ZTG.mjs +2 -0
- package/dist/chunk-XVYL7ZTG.mjs.map +1 -0
- package/dist/index.d.mts +142 -43
- package/dist/index.mjs +2 -2
- package/dist/index.mjs.map +1 -1
- package/dist/types/index.d.mts +512 -19
- package/dist/types/index.mjs +1 -1
- package/dist/types/index.mjs.map +1 -1
- package/dist/utils/index.d.mts +70 -21
- package/dist/utils/index.mjs +1 -1
- package/dist/utils/index.mjs.map +1 -1
- package/dist/waba-RRlZTQUG.d.mts +2229 -0
- package/dist/{types/whatsapp.d.ts → whatsapp-BNHXjrds.d.mts} +2 -17
- package/package.json +52 -18
- package/dist/api/base.d.mts +0 -15
- package/dist/api/base.d.ts +0 -15
- package/dist/api/base.js +0 -2
- package/dist/api/base.js.map +0 -1
- package/dist/api/base.mjs +0 -2
- package/dist/api/base.mjs.map +0 -1
- package/dist/api/businessProfile.d.mts +0 -145
- package/dist/api/businessProfile.d.ts +0 -145
- package/dist/api/businessProfile.js +0 -2
- package/dist/api/businessProfile.js.map +0 -1
- package/dist/api/businessProfile.mjs +0 -2
- package/dist/api/businessProfile.mjs.map +0 -1
- package/dist/api/encryption.d.mts +0 -15
- package/dist/api/encryption.d.ts +0 -15
- package/dist/api/encryption.js +0 -2
- package/dist/api/encryption.js.map +0 -1
- package/dist/api/encryption.mjs +0 -2
- package/dist/api/encryption.mjs.map +0 -1
- package/dist/api/flow.d.mts +0 -126
- package/dist/api/flow.d.ts +0 -126
- package/dist/api/flow.js +0 -2
- package/dist/api/flow.js.map +0 -1
- package/dist/api/flow.mjs +0 -2
- package/dist/api/flow.mjs.map +0 -1
- package/dist/api/index.d.ts +0 -28
- package/dist/api/index.js +0 -2
- package/dist/api/index.js.map +0 -1
- package/dist/api/media.d.mts +0 -17
- package/dist/api/media.d.ts +0 -17
- package/dist/api/media.js +0 -2
- package/dist/api/media.js.map +0 -1
- package/dist/api/media.mjs +0 -2
- package/dist/api/media.mjs.map +0 -1
- package/dist/api/messages.d.mts +0 -193
- package/dist/api/messages.d.ts +0 -193
- package/dist/api/messages.js +0 -2
- package/dist/api/messages.js.map +0 -1
- package/dist/api/messages.mjs +0 -2
- package/dist/api/messages.mjs.map +0 -1
- package/dist/api/phoneNumber.d.mts +0 -17
- package/dist/api/phoneNumber.d.ts +0 -17
- package/dist/api/phoneNumber.js +0 -2
- package/dist/api/phoneNumber.js.map +0 -1
- package/dist/api/phoneNumber.mjs +0 -2
- package/dist/api/phoneNumber.mjs.map +0 -1
- package/dist/api/qrCode.d.mts +0 -18
- package/dist/api/qrCode.d.ts +0 -18
- package/dist/api/qrCode.js +0 -2
- package/dist/api/qrCode.js.map +0 -1
- package/dist/api/qrCode.mjs +0 -2
- package/dist/api/qrCode.mjs.map +0 -1
- package/dist/api/registration.d.mts +0 -14
- package/dist/api/registration.d.ts +0 -14
- package/dist/api/registration.js +0 -2
- package/dist/api/registration.js.map +0 -1
- package/dist/api/registration.mjs +0 -2
- package/dist/api/registration.mjs.map +0 -1
- package/dist/api/template.d.mts +0 -18
- package/dist/api/template.d.ts +0 -18
- package/dist/api/template.js +0 -2
- package/dist/api/template.js.map +0 -1
- package/dist/api/template.mjs +0 -2
- package/dist/api/template.mjs.map +0 -1
- package/dist/api/twoStepVerification.d.mts +0 -13
- package/dist/api/twoStepVerification.d.ts +0 -13
- package/dist/api/twoStepVerification.js +0 -2
- package/dist/api/twoStepVerification.js.map +0 -1
- package/dist/api/twoStepVerification.mjs +0 -2
- package/dist/api/twoStepVerification.mjs.map +0 -1
- package/dist/api/waba.d.mts +0 -16
- package/dist/api/waba.d.ts +0 -16
- package/dist/api/waba.js +0 -2
- package/dist/api/waba.js.map +0 -1
- package/dist/api/waba.mjs +0 -2
- package/dist/api/waba.mjs.map +0 -1
- package/dist/enums-CI7vzKhn.d.mts +0 -687
- package/dist/enums-CI7vzKhn.d.ts +0 -687
- package/dist/httpsClient.d.mts +0 -22
- package/dist/httpsClient.d.ts +0 -22
- package/dist/httpsClient.js +0 -2
- package/dist/httpsClient.js.map +0 -1
- package/dist/httpsClient.mjs +0 -2
- package/dist/httpsClient.mjs.map +0 -1
- package/dist/index.d.ts +0 -46
- package/dist/index.js +0 -3
- package/dist/index.js.map +0 -1
- package/dist/request.d.mts +0 -25
- package/dist/request.d.ts +0 -25
- package/dist/request.js +0 -2
- package/dist/request.js.map +0 -1
- package/dist/request.mjs +0 -2
- package/dist/request.mjs.map +0 -1
- package/dist/types/base.d.mts +0 -8
- package/dist/types/base.d.ts +0 -8
- package/dist/types/base.js +0 -2
- package/dist/types/base.js.map +0 -1
- package/dist/types/base.mjs +0 -1
- package/dist/types/base.mjs.map +0 -1
- package/dist/types/businessProfile.d.mts +0 -153
- package/dist/types/businessProfile.d.ts +0 -153
- package/dist/types/businessProfile.js +0 -2
- package/dist/types/businessProfile.js.map +0 -1
- package/dist/types/businessProfile.mjs +0 -1
- package/dist/types/businessProfile.mjs.map +0 -1
- package/dist/types/config.d.mts +0 -62
- package/dist/types/config.d.ts +0 -62
- package/dist/types/config.js +0 -2
- package/dist/types/config.js.map +0 -1
- package/dist/types/config.mjs +0 -1
- package/dist/types/config.mjs.map +0 -1
- package/dist/types/encryption.d.mts +0 -13
- package/dist/types/encryption.d.ts +0 -13
- package/dist/types/encryption.js +0 -2
- package/dist/types/encryption.js.map +0 -1
- package/dist/types/encryption.mjs +0 -1
- package/dist/types/encryption.mjs.map +0 -1
- package/dist/types/enums.d.mts +0 -1
- package/dist/types/enums.d.ts +0 -1
- package/dist/types/enums.js +0 -2
- package/dist/types/enums.js.map +0 -1
- package/dist/types/enums.mjs +0 -2
- package/dist/types/enums.mjs.map +0 -1
- package/dist/types/flow.d.mts +0 -404
- package/dist/types/flow.d.ts +0 -404
- package/dist/types/flow.js +0 -2
- package/dist/types/flow.js.map +0 -1
- package/dist/types/flow.mjs +0 -2
- package/dist/types/flow.mjs.map +0 -1
- package/dist/types/httpsClient.d.mts +0 -19
- package/dist/types/httpsClient.d.ts +0 -19
- package/dist/types/httpsClient.js +0 -2
- package/dist/types/httpsClient.js.map +0 -1
- package/dist/types/httpsClient.mjs +0 -1
- package/dist/types/httpsClient.mjs.map +0 -1
- package/dist/types/index.d.ts +0 -20
- package/dist/types/index.js +0 -2
- package/dist/types/index.js.map +0 -1
- package/dist/types/logger.d.mts +0 -9
- package/dist/types/logger.d.ts +0 -9
- package/dist/types/logger.js +0 -2
- package/dist/types/logger.js.map +0 -1
- package/dist/types/logger.mjs +0 -1
- package/dist/types/logger.mjs.map +0 -1
- package/dist/types/media.d.mts +0 -31
- package/dist/types/media.d.ts +0 -31
- package/dist/types/media.js +0 -2
- package/dist/types/media.js.map +0 -1
- package/dist/types/media.mjs +0 -1
- package/dist/types/media.mjs.map +0 -1
- package/dist/types/messages.d.mts +0 -558
- package/dist/types/messages.d.ts +0 -558
- package/dist/types/messages.js +0 -2
- package/dist/types/messages.js.map +0 -1
- package/dist/types/messages.mjs +0 -1
- package/dist/types/messages.mjs.map +0 -1
- package/dist/types/phoneNumber.d.mts +0 -82
- package/dist/types/phoneNumber.d.ts +0 -82
- package/dist/types/phoneNumber.js +0 -2
- package/dist/types/phoneNumber.js.map +0 -1
- package/dist/types/phoneNumber.mjs +0 -1
- package/dist/types/phoneNumber.mjs.map +0 -1
- package/dist/types/qrCode.d.mts +0 -27
- package/dist/types/qrCode.d.ts +0 -27
- package/dist/types/qrCode.js +0 -2
- package/dist/types/qrCode.js.map +0 -1
- package/dist/types/qrCode.mjs +0 -1
- package/dist/types/qrCode.mjs.map +0 -1
- package/dist/types/registration.d.mts +0 -14
- package/dist/types/registration.d.ts +0 -14
- package/dist/types/registration.js +0 -2
- package/dist/types/registration.js.map +0 -1
- package/dist/types/registration.mjs +0 -1
- package/dist/types/registration.mjs.map +0 -1
- package/dist/types/request.d.mts +0 -50
- package/dist/types/request.d.ts +0 -50
- package/dist/types/request.js +0 -2
- package/dist/types/request.js.map +0 -1
- package/dist/types/request.mjs +0 -1
- package/dist/types/request.mjs.map +0 -1
- package/dist/types/template.d.mts +0 -106
- package/dist/types/template.d.ts +0 -106
- package/dist/types/template.js +0 -2
- package/dist/types/template.js.map +0 -1
- package/dist/types/template.mjs +0 -1
- package/dist/types/template.mjs.map +0 -1
- package/dist/types/twoStepVerification.d.mts +0 -11
- package/dist/types/twoStepVerification.d.ts +0 -11
- package/dist/types/twoStepVerification.js +0 -2
- package/dist/types/twoStepVerification.js.map +0 -1
- package/dist/types/twoStepVerification.mjs +0 -1
- package/dist/types/twoStepVerification.mjs.map +0 -1
- package/dist/types/waba.d.mts +0 -78
- package/dist/types/waba.d.ts +0 -78
- package/dist/types/waba.js +0 -2
- package/dist/types/waba.js.map +0 -1
- package/dist/types/waba.mjs +0 -2
- package/dist/types/waba.mjs.map +0 -1
- package/dist/types/webhook.d.mts +0 -486
- package/dist/types/webhook.d.ts +0 -486
- package/dist/types/webhook.js +0 -2
- package/dist/types/webhook.js.map +0 -1
- package/dist/types/webhook.mjs +0 -2
- package/dist/types/webhook.mjs.map +0 -1
- package/dist/types/whatsapp.d.mts +0 -61
- package/dist/types/whatsapp.js +0 -2
- package/dist/types/whatsapp.js.map +0 -1
- package/dist/types/whatsapp.mjs +0 -1
- package/dist/types/whatsapp.mjs.map +0 -1
- package/dist/utils/buildFieldsQueryString.d.mts +0 -3
- package/dist/utils/buildFieldsQueryString.d.ts +0 -3
- package/dist/utils/buildFieldsQueryString.js +0 -2
- package/dist/utils/buildFieldsQueryString.js.map +0 -1
- package/dist/utils/buildFieldsQueryString.mjs +0 -2
- package/dist/utils/buildFieldsQueryString.mjs.map +0 -1
- package/dist/utils/filters.d.mts +0 -144
- package/dist/utils/filters.d.ts +0 -144
- package/dist/utils/filters.js +0 -2
- package/dist/utils/filters.js.map +0 -1
- package/dist/utils/filters.mjs +0 -2
- package/dist/utils/filters.mjs.map +0 -1
- package/dist/utils/flowTypeGuards.d.mts +0 -46
- package/dist/utils/flowTypeGuards.d.ts +0 -46
- package/dist/utils/flowTypeGuards.js +0 -2
- package/dist/utils/flowTypeGuards.js.map +0 -1
- package/dist/utils/flowTypeGuards.mjs +0 -2
- package/dist/utils/flowTypeGuards.mjs.map +0 -1
- package/dist/utils/generateXHub256Sig.d.mts +0 -3
- package/dist/utils/generateXHub256Sig.d.ts +0 -3
- package/dist/utils/generateXHub256Sig.js +0 -2
- package/dist/utils/generateXHub256Sig.js.map +0 -1
- package/dist/utils/generateXHub256Sig.mjs +0 -2
- package/dist/utils/generateXHub256Sig.mjs.map +0 -1
- package/dist/utils/importConfig.d.mts +0 -21
- package/dist/utils/importConfig.d.ts +0 -21
- package/dist/utils/importConfig.js +0 -2
- package/dist/utils/importConfig.js.map +0 -1
- package/dist/utils/importConfig.mjs +0 -2
- package/dist/utils/importConfig.mjs.map +0 -1
- package/dist/utils/index.d.ts +0 -22
- package/dist/utils/index.js +0 -2
- package/dist/utils/index.js.map +0 -1
- package/dist/utils/isMetaError.d.mts +0 -21
- package/dist/utils/isMetaError.d.ts +0 -21
- package/dist/utils/isMetaError.js +0 -2
- package/dist/utils/isMetaError.js.map +0 -1
- package/dist/utils/isMetaError.mjs +0 -2
- package/dist/utils/isMetaError.mjs.map +0 -1
- package/dist/utils/logger.d.mts +0 -13
- package/dist/utils/logger.d.ts +0 -13
- package/dist/utils/logger.js +0 -2
- package/dist/utils/logger.js.map +0 -1
- package/dist/utils/logger.mjs +0 -2
- package/dist/utils/logger.mjs.map +0 -1
- package/dist/utils/objectToQueryString.d.mts +0 -3
- package/dist/utils/objectToQueryString.d.ts +0 -3
- package/dist/utils/objectToQueryString.js +0 -2
- package/dist/utils/objectToQueryString.js.map +0 -1
- package/dist/utils/objectToQueryString.mjs +0 -2
- package/dist/utils/objectToQueryString.mjs.map +0 -1
- package/dist/webhook.d.mts +0 -123
- package/dist/webhook.d.ts +0 -123
- package/dist/webhook.js +0 -3
- package/dist/webhook.js.map +0 -1
- package/dist/webhook.mjs +0 -3
- package/dist/webhook.mjs.map +0 -1
- package/dist/whatsapp.d.mts +0 -58
- package/dist/whatsapp.d.ts +0 -58
- package/dist/whatsapp.js +0 -2
- package/dist/whatsapp.js.map +0 -1
- package/dist/whatsapp.mjs +0 -2
- package/dist/whatsapp.mjs.map +0 -1
|
@@ -0,0 +1,2229 @@
|
|
|
1
|
+
import { IncomingMessage, IncomingHttpHeaders } from 'http';
|
|
2
|
+
|
|
3
|
+
declare enum CategoryEnum {
|
|
4
|
+
Authentication = "AUTHENTICATION",
|
|
5
|
+
Marketing = "MARKETING",
|
|
6
|
+
Utility = "UTILITY"
|
|
7
|
+
}
|
|
8
|
+
declare enum TemplateStatusEnum {
|
|
9
|
+
Approved = "APPROVED",
|
|
10
|
+
Pending = "PENDING",
|
|
11
|
+
Rejected = "REJECTED"
|
|
12
|
+
}
|
|
13
|
+
declare enum HttpMethodsEnum {
|
|
14
|
+
Get = "GET",
|
|
15
|
+
Post = "POST",
|
|
16
|
+
Put = "PUT",
|
|
17
|
+
Delete = "DELETE"
|
|
18
|
+
}
|
|
19
|
+
declare enum MessageTypesEnum {
|
|
20
|
+
Audio = "audio",
|
|
21
|
+
Contacts = "contacts",
|
|
22
|
+
Document = "document",
|
|
23
|
+
Image = "image",
|
|
24
|
+
Interactive = "interactive",
|
|
25
|
+
Location = "location",
|
|
26
|
+
Reaction = "reaction",
|
|
27
|
+
Sticker = "sticker",
|
|
28
|
+
Template = "template",
|
|
29
|
+
Text = "text",
|
|
30
|
+
Video = "video",
|
|
31
|
+
Button = "button",
|
|
32
|
+
Order = "order",
|
|
33
|
+
System = "system",
|
|
34
|
+
Unknown = "unknown",
|
|
35
|
+
'*' = "*"
|
|
36
|
+
}
|
|
37
|
+
declare enum ParametersTypesEnum {
|
|
38
|
+
Currency = "currency",
|
|
39
|
+
DateTime = "date_time",
|
|
40
|
+
Document = "document",
|
|
41
|
+
Image = "image",
|
|
42
|
+
Text = "text",
|
|
43
|
+
Video = "video",
|
|
44
|
+
Payload = "payload"
|
|
45
|
+
}
|
|
46
|
+
declare enum InteractiveTypesEnum {
|
|
47
|
+
Button = "button",
|
|
48
|
+
List = "list",
|
|
49
|
+
Product = "product",
|
|
50
|
+
ProductList = "product_list",
|
|
51
|
+
CtaUrl = "cta_url",
|
|
52
|
+
LocationRequest = "location_request_message",
|
|
53
|
+
AddressMessage = "address_message",
|
|
54
|
+
Flow = "flow"
|
|
55
|
+
}
|
|
56
|
+
declare enum ButtonTypesEnum {
|
|
57
|
+
QuickReply = "quick_reply",
|
|
58
|
+
URL = "url"
|
|
59
|
+
}
|
|
60
|
+
declare enum ButtonPositionEnum {
|
|
61
|
+
First = 0,
|
|
62
|
+
Second = 1,
|
|
63
|
+
Third = 2
|
|
64
|
+
}
|
|
65
|
+
declare enum ComponentTypesEnum {
|
|
66
|
+
Header = "HEADER",
|
|
67
|
+
Body = "BODY",
|
|
68
|
+
Button = "BUTTON",
|
|
69
|
+
Footer = "FOOTER"
|
|
70
|
+
}
|
|
71
|
+
declare enum WabaConfigEnum {
|
|
72
|
+
AppId = "M4D_APP_ID",
|
|
73
|
+
Port = "WA_PORT",
|
|
74
|
+
AppSecret = "M4D_APP_SECRET",
|
|
75
|
+
PhoneNumberId = "WA_PHONE_NUMBER_ID",
|
|
76
|
+
BusinessAcctId = "WA_BUSINESS_ACCOUNT_ID",
|
|
77
|
+
APIVersion = "CLOUD_API_VERSION",
|
|
78
|
+
AccessToken = "CLOUD_API_ACCESS_TOKEN",
|
|
79
|
+
WebhookEndpoint = "WEBHOOK_ENDPOINT",
|
|
80
|
+
WebhookVerificationToken = "WEBHOOK_VERIFICATION_TOKEN",
|
|
81
|
+
ListenerPort = "LISTENER_PORT",
|
|
82
|
+
MaxRetriesAfterWait = "MAX_RETRIES_AFTER_WAIT",
|
|
83
|
+
RequestTimeout = "REQUEST_TIMEOUT",
|
|
84
|
+
Debug = "DEBUG",
|
|
85
|
+
PrivatePem = "FLOW_API_PRIVATE_PEM",
|
|
86
|
+
Passphrase = "FLOW_API_PASSPHRASE"
|
|
87
|
+
}
|
|
88
|
+
declare enum ConversationTypesEnum {
|
|
89
|
+
BusinessInitiated = "business_initiated",
|
|
90
|
+
CustomerInitiated = "customer_initiated",
|
|
91
|
+
ReferralConversion = "referral_conversion"
|
|
92
|
+
}
|
|
93
|
+
declare enum StatusEnum {
|
|
94
|
+
Delivered = "delivered",
|
|
95
|
+
Read = "read",
|
|
96
|
+
Sent = "sent"
|
|
97
|
+
}
|
|
98
|
+
declare enum VideoMediaTypesEnum {
|
|
99
|
+
Mp4 = "video/mp4",
|
|
100
|
+
Threegp = "video/3gp"
|
|
101
|
+
}
|
|
102
|
+
declare enum StickerMediaTypesEnum {
|
|
103
|
+
Webp = "image/webp"
|
|
104
|
+
}
|
|
105
|
+
declare enum ImageMediaTypesEnum {
|
|
106
|
+
Jpeg = "image/jpeg",
|
|
107
|
+
Png = "image/png"
|
|
108
|
+
}
|
|
109
|
+
declare enum DocumentMediaTypesEnum {
|
|
110
|
+
Text = "text/plain",
|
|
111
|
+
Pdf = "application/pdf",
|
|
112
|
+
Ppt = "application/vnd.ms-powerpoint",
|
|
113
|
+
Word = "application/msword",
|
|
114
|
+
Excel = "application/vnd.ms-excel",
|
|
115
|
+
OpenDoc = "application/vnd.openxmlformats-officedocument.wordprocessingml.document",
|
|
116
|
+
OpenPres = "application/vnd.openxmlformats-officedocument.presentationml.presentation",
|
|
117
|
+
OpenSheet = "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"
|
|
118
|
+
}
|
|
119
|
+
declare enum AudioMediaTypesEnum {
|
|
120
|
+
Aac = "audio/aac",
|
|
121
|
+
Mp4 = "audio/mp4",
|
|
122
|
+
Mpeg = "audio/mpeg",
|
|
123
|
+
Amr = "audio/amr",
|
|
124
|
+
Ogg = "audio/ogg"
|
|
125
|
+
}
|
|
126
|
+
declare enum WebhookTypesEnum {
|
|
127
|
+
Audio = "audio",
|
|
128
|
+
Button = "button",
|
|
129
|
+
Document = "document",
|
|
130
|
+
Text = "text",
|
|
131
|
+
Image = "image",
|
|
132
|
+
Interactive = "interactive",
|
|
133
|
+
Order = "order",
|
|
134
|
+
Sticker = "sticker",
|
|
135
|
+
System = "system",
|
|
136
|
+
Unknown = "unknown",
|
|
137
|
+
Video = "video"
|
|
138
|
+
}
|
|
139
|
+
declare enum SystemChangeTypesEnum {
|
|
140
|
+
CustomerChangedNumber = "customer_changed_number",
|
|
141
|
+
CustomerIdentityChanged = "customer_identity_changed"
|
|
142
|
+
}
|
|
143
|
+
declare enum ReferralSourceTypesEnum {
|
|
144
|
+
Ad = "ad",
|
|
145
|
+
Post = "post"
|
|
146
|
+
}
|
|
147
|
+
declare enum RequestCodeMethodsEnum {
|
|
148
|
+
Sms = "SMS",
|
|
149
|
+
Voice = "VOICE"
|
|
150
|
+
}
|
|
151
|
+
declare enum LanguagesEnum {
|
|
152
|
+
Afrikaans = "af",
|
|
153
|
+
Albanian = "sq",
|
|
154
|
+
Arabic = "ar",
|
|
155
|
+
Azerbaijani = "az",
|
|
156
|
+
Bengali = "bn",
|
|
157
|
+
Bulgarian = "bg",
|
|
158
|
+
Catalan = "ca",
|
|
159
|
+
Chinese_CHN = "zh_CN",
|
|
160
|
+
Chinese_HKG = "zh_HK",
|
|
161
|
+
Chinese_TAI = "zh_TW",
|
|
162
|
+
Croatian = "hr",
|
|
163
|
+
Czech = "cs",
|
|
164
|
+
Danish = "da",
|
|
165
|
+
Dutch = "nl",
|
|
166
|
+
English = "en",
|
|
167
|
+
English_UK = "en_GB",
|
|
168
|
+
English_US = "en_US",
|
|
169
|
+
Estonian = "et",
|
|
170
|
+
Filipino = "fil",
|
|
171
|
+
Finnish = "fi",
|
|
172
|
+
French = "fr",
|
|
173
|
+
Georgian = "ka",
|
|
174
|
+
German = "de",
|
|
175
|
+
Greek = "el",
|
|
176
|
+
Gujarati = "gu",
|
|
177
|
+
Hausa = "ha",
|
|
178
|
+
Hebrew = "he",
|
|
179
|
+
Hindi = "hi",
|
|
180
|
+
Hungarian = "hu",
|
|
181
|
+
Indonesian = "id",
|
|
182
|
+
Irish = "ga",
|
|
183
|
+
Italian = "it",
|
|
184
|
+
Japanese = "ja",
|
|
185
|
+
Kannada = "kn",
|
|
186
|
+
Kazakh = "kk",
|
|
187
|
+
Kinyarwanda = "rw_RW",
|
|
188
|
+
Korean = "ko",
|
|
189
|
+
Kyrgyz_Kyrgyzstan = "ky_KG",
|
|
190
|
+
Lao = "lo",
|
|
191
|
+
Latvian = "lv",
|
|
192
|
+
Lithuanian = "lt",
|
|
193
|
+
Macedonian = "mk",
|
|
194
|
+
Malay = "ms",
|
|
195
|
+
Malayalam = "ml",
|
|
196
|
+
Marathi = "mr",
|
|
197
|
+
Norwegian = "nb",
|
|
198
|
+
Persian = "fa",
|
|
199
|
+
Polish = "pl",
|
|
200
|
+
Portuguese_BR = "pt_BR",
|
|
201
|
+
Portuguese_POR = "pt_PT",
|
|
202
|
+
Punjabi = "pa",
|
|
203
|
+
Romanian = "ro",
|
|
204
|
+
Russian = "ru",
|
|
205
|
+
Serbian = "sr",
|
|
206
|
+
Slovak = "sk",
|
|
207
|
+
Slovenian = "sl",
|
|
208
|
+
Spanish = "es",
|
|
209
|
+
Spanish_ARG = "es_AR",
|
|
210
|
+
Spanish_SPA = "es_ES",
|
|
211
|
+
Spanish_MEX = "es_MX",
|
|
212
|
+
Swahili = "sw",
|
|
213
|
+
Swedish = "sv",
|
|
214
|
+
Tamil = "ta",
|
|
215
|
+
Telugu = "te",
|
|
216
|
+
Thai = "th",
|
|
217
|
+
Turkish = "tr",
|
|
218
|
+
Ukrainian = "uk",
|
|
219
|
+
Urdu = "ur",
|
|
220
|
+
Uzbek = "uz",
|
|
221
|
+
Vietnamese = "vi",
|
|
222
|
+
Zulu = "zu"
|
|
223
|
+
}
|
|
224
|
+
declare enum CurrencyCodesEnum {
|
|
225
|
+
AFN = "AFN",
|
|
226
|
+
EUR = "EUR",
|
|
227
|
+
ALL = "ALL",
|
|
228
|
+
DZD = "DZD",
|
|
229
|
+
USD = "USD",
|
|
230
|
+
AOA = "AOA",
|
|
231
|
+
XCD = "XCD",
|
|
232
|
+
ARS = "ARS",
|
|
233
|
+
AMD = "AMD",
|
|
234
|
+
AWG = "AWG",
|
|
235
|
+
AUD = "AUD",
|
|
236
|
+
AZN = "AZN",
|
|
237
|
+
BSD = "BSD",
|
|
238
|
+
BHD = "BHD",
|
|
239
|
+
BDT = "BDT",
|
|
240
|
+
BBD = "BBD",
|
|
241
|
+
BYN = "BYN",
|
|
242
|
+
BZD = "BZD",
|
|
243
|
+
XOF = "XOF",
|
|
244
|
+
BMD = "BMD",
|
|
245
|
+
INR = "INR",
|
|
246
|
+
BTN = "BTN",
|
|
247
|
+
BOB = "BOB",
|
|
248
|
+
BOV = "BOV",
|
|
249
|
+
BAM = "BAM",
|
|
250
|
+
BWP = "BWP",
|
|
251
|
+
NOK = "NOK",
|
|
252
|
+
BRL = "BRL",
|
|
253
|
+
BND = "BND",
|
|
254
|
+
BGN = "BGN",
|
|
255
|
+
BIF = "BIF",
|
|
256
|
+
CVE = "CVE",
|
|
257
|
+
KHR = "KHR",
|
|
258
|
+
XAF = "XAF",
|
|
259
|
+
CAD = "CAD",
|
|
260
|
+
KYD = "KYD",
|
|
261
|
+
CLP = "CLP",
|
|
262
|
+
CLF = "CLF",
|
|
263
|
+
CNY = "CNY",
|
|
264
|
+
COP = "COP",
|
|
265
|
+
COU = "COU",
|
|
266
|
+
KMF = "KMF",
|
|
267
|
+
CDF = "CDF",
|
|
268
|
+
NZD = "NZD",
|
|
269
|
+
CRC = "CRC",
|
|
270
|
+
HRK = "HRK",
|
|
271
|
+
CUP = "CUP",
|
|
272
|
+
CUC = "CUC",
|
|
273
|
+
ANG = "ANG",
|
|
274
|
+
CZK = "CZK",
|
|
275
|
+
DKK = "DKK",
|
|
276
|
+
DJF = "DJF",
|
|
277
|
+
DOP = "DOP",
|
|
278
|
+
EGP = "EGP",
|
|
279
|
+
SVC = "SVC",
|
|
280
|
+
ERN = "ERN",
|
|
281
|
+
SZL = "SZL",
|
|
282
|
+
ETB = "ETB",
|
|
283
|
+
FKP = "FKP",
|
|
284
|
+
FJD = "FJD",
|
|
285
|
+
XPF = "XPF",
|
|
286
|
+
GMD = "GMD",
|
|
287
|
+
GEL = "GEL",
|
|
288
|
+
GHS = "GHS",
|
|
289
|
+
GIP = "GIP",
|
|
290
|
+
GTQ = "GTQ",
|
|
291
|
+
GBP = "GBP",
|
|
292
|
+
GNF = "GNF",
|
|
293
|
+
GYD = "GYD",
|
|
294
|
+
HTG = "HTG",
|
|
295
|
+
HNL = "HNL",
|
|
296
|
+
HKD = "HKD",
|
|
297
|
+
HUF = "HUF",
|
|
298
|
+
ISK = "ISK",
|
|
299
|
+
IDR = "IDR",
|
|
300
|
+
XDR = "XDR",
|
|
301
|
+
IRR = "IRR",
|
|
302
|
+
IQD = "IQD",
|
|
303
|
+
ILS = "ILS",
|
|
304
|
+
JMD = "JMD",
|
|
305
|
+
JPY = "JPY",
|
|
306
|
+
JOD = "JOD",
|
|
307
|
+
KZT = "KZT",
|
|
308
|
+
KES = "KES",
|
|
309
|
+
KPW = "KPW",
|
|
310
|
+
KRW = "KRW",
|
|
311
|
+
KWD = "KWD",
|
|
312
|
+
KGS = "KGS",
|
|
313
|
+
LAK = "LAK",
|
|
314
|
+
LBP = "LBP",
|
|
315
|
+
LSL = "LSL",
|
|
316
|
+
ZAR = "ZAR",
|
|
317
|
+
LRD = "LRD",
|
|
318
|
+
LYD = "LYD",
|
|
319
|
+
CHF = "CHF",
|
|
320
|
+
MOP = "MOP",
|
|
321
|
+
MKD = "MKD",
|
|
322
|
+
MGA = "MGA",
|
|
323
|
+
MWK = "MWK",
|
|
324
|
+
MYR = "MYR",
|
|
325
|
+
MVR = "MVR",
|
|
326
|
+
MRU = "MRU",
|
|
327
|
+
MUR = "MUR",
|
|
328
|
+
XUA = "XUA",
|
|
329
|
+
MXN = "MXN",
|
|
330
|
+
MXV = "MXV",
|
|
331
|
+
MDL = "MDL",
|
|
332
|
+
MNT = "MNT",
|
|
333
|
+
MAD = "MAD",
|
|
334
|
+
MZN = "MZN",
|
|
335
|
+
MMK = "MMK",
|
|
336
|
+
NAD = "NAD",
|
|
337
|
+
NPR = "NPR",
|
|
338
|
+
NIO = "NIO",
|
|
339
|
+
NGN = "NGN",
|
|
340
|
+
OMR = "OMR",
|
|
341
|
+
PKR = "PKR",
|
|
342
|
+
PAB = "PAB",
|
|
343
|
+
PGK = "PGK",
|
|
344
|
+
PYG = "PYG",
|
|
345
|
+
PEN = "PEN",
|
|
346
|
+
PHP = "PHP",
|
|
347
|
+
PLN = "PLN",
|
|
348
|
+
QAR = "QAR",
|
|
349
|
+
RON = "RON",
|
|
350
|
+
RUB = "RUB",
|
|
351
|
+
RWF = "RWF",
|
|
352
|
+
SHP = "SHP",
|
|
353
|
+
WST = "WST",
|
|
354
|
+
STN = "STN",
|
|
355
|
+
SAR = "SAR",
|
|
356
|
+
RSD = "RSD",
|
|
357
|
+
SCR = "SCR",
|
|
358
|
+
SLL = "SLL",
|
|
359
|
+
SGD = "SGD",
|
|
360
|
+
XSU = "XSU",
|
|
361
|
+
SBD = "SBD",
|
|
362
|
+
SOS = "SOS",
|
|
363
|
+
SSP = "SSP",
|
|
364
|
+
LKR = "LKR",
|
|
365
|
+
SDG = "SDG",
|
|
366
|
+
SRD = "SRD",
|
|
367
|
+
SEK = "SEK",
|
|
368
|
+
CHE = "CHE",
|
|
369
|
+
CHW = "CHW",
|
|
370
|
+
SYP = "SYP",
|
|
371
|
+
TWD = "TWD",
|
|
372
|
+
TJS = "TJS",
|
|
373
|
+
TZS = "TZS",
|
|
374
|
+
THB = "THB",
|
|
375
|
+
TOP = "TOP",
|
|
376
|
+
TTD = "TTD",
|
|
377
|
+
TND = "TND",
|
|
378
|
+
TRY = "TRY",
|
|
379
|
+
TMT = "TMT",
|
|
380
|
+
UGX = "UGX",
|
|
381
|
+
UAH = "UAH",
|
|
382
|
+
AED = "AED",
|
|
383
|
+
USN = "USN",
|
|
384
|
+
UYU = "UYU",
|
|
385
|
+
UYI = "UYI",
|
|
386
|
+
UYW = "UYW",
|
|
387
|
+
UZS = "UZS",
|
|
388
|
+
VUV = "VUV",
|
|
389
|
+
VES = "VES",
|
|
390
|
+
VND = "VND",
|
|
391
|
+
YER = "YER",
|
|
392
|
+
ZMW = "ZMW",
|
|
393
|
+
ZWL = "ZWL",
|
|
394
|
+
XBA = "XBA",
|
|
395
|
+
XBB = "XBB",
|
|
396
|
+
XBC = "XBC",
|
|
397
|
+
XBD = "XBD",
|
|
398
|
+
XTS = "XTS",
|
|
399
|
+
XXX = "XXX",
|
|
400
|
+
XAU = "XAU",
|
|
401
|
+
XPD = "XPD",
|
|
402
|
+
XPT = "XPT",
|
|
403
|
+
XAG = "XAG",
|
|
404
|
+
AFA = "AFA",
|
|
405
|
+
FIM = "FIM",
|
|
406
|
+
ALK = "ALK",
|
|
407
|
+
ADP = "ADP",
|
|
408
|
+
ESP = "ESP",
|
|
409
|
+
FRF = "FRF",
|
|
410
|
+
AOK = "AOK",
|
|
411
|
+
AON = "AON",
|
|
412
|
+
AOR = "AOR",
|
|
413
|
+
ARA = "ARA",
|
|
414
|
+
ARP = "ARP",
|
|
415
|
+
ARY = "ARY",
|
|
416
|
+
RUR = "RUR",
|
|
417
|
+
ATS = "ATS",
|
|
418
|
+
AYM = "AYM",
|
|
419
|
+
AZM = "AZM",
|
|
420
|
+
BYB = "BYB",
|
|
421
|
+
BYR = "BYR",
|
|
422
|
+
BEC = "BEC",
|
|
423
|
+
BEF = "BEF",
|
|
424
|
+
BEL = "BEL",
|
|
425
|
+
BOP = "BOP",
|
|
426
|
+
BAD = "BAD",
|
|
427
|
+
BRB = "BRB",
|
|
428
|
+
BRC = "BRC",
|
|
429
|
+
BRE = "BRE",
|
|
430
|
+
BRN = "BRN",
|
|
431
|
+
BRR = "BRR",
|
|
432
|
+
BGJ = "BGJ",
|
|
433
|
+
BGK = "BGK",
|
|
434
|
+
BGL = "BGL",
|
|
435
|
+
BUK = "BUK",
|
|
436
|
+
HRD = "HRD",
|
|
437
|
+
CYP = "CYP",
|
|
438
|
+
CSJ = "CSJ",
|
|
439
|
+
CSK = "CSK",
|
|
440
|
+
ECS = "ECS",
|
|
441
|
+
ECV = "ECV",
|
|
442
|
+
GQE = "GQE",
|
|
443
|
+
EEK = "EEK",
|
|
444
|
+
XEU = "XEU",
|
|
445
|
+
GEK = "GEK",
|
|
446
|
+
DDM = "DDM",
|
|
447
|
+
DEM = "DEM",
|
|
448
|
+
GHC = "GHC",
|
|
449
|
+
GHP = "GHP",
|
|
450
|
+
GRD = "GRD",
|
|
451
|
+
GNE = "GNE",
|
|
452
|
+
GNS = "GNS",
|
|
453
|
+
GWE = "GWE",
|
|
454
|
+
GWP = "GWP",
|
|
455
|
+
ITL = "ITL",
|
|
456
|
+
ISJ = "ISJ",
|
|
457
|
+
IEP = "IEP",
|
|
458
|
+
ILP = "ILP",
|
|
459
|
+
ILR = "ILR",
|
|
460
|
+
LAJ = "LAJ",
|
|
461
|
+
LVL = "LVL",
|
|
462
|
+
LVR = "LVR",
|
|
463
|
+
LSM = "LSM",
|
|
464
|
+
ZAL = "ZAL",
|
|
465
|
+
LTL = "LTL",
|
|
466
|
+
LTT = "LTT",
|
|
467
|
+
LUC = "LUC",
|
|
468
|
+
LUF = "LUF",
|
|
469
|
+
LUL = "LUL",
|
|
470
|
+
MGF = "MGF",
|
|
471
|
+
MVQ = "MVQ",
|
|
472
|
+
MLF = "MLF",
|
|
473
|
+
MTL = "MTL",
|
|
474
|
+
MTP = "MTP",
|
|
475
|
+
MRO = "MRO",
|
|
476
|
+
MXP = "MXP",
|
|
477
|
+
MZE = "MZE",
|
|
478
|
+
MZM = "MZM",
|
|
479
|
+
NLG = "NLG",
|
|
480
|
+
NIC = "NIC",
|
|
481
|
+
PEH = "PEH",
|
|
482
|
+
PEI = "PEI",
|
|
483
|
+
PES = "PES",
|
|
484
|
+
PLZ = "PLZ",
|
|
485
|
+
PTE = "PTE",
|
|
486
|
+
ROK = "ROK",
|
|
487
|
+
ROL = "ROL",
|
|
488
|
+
STD = "STD",
|
|
489
|
+
CSD = "CSD",
|
|
490
|
+
SKK = "SKK",
|
|
491
|
+
SIT = "SIT",
|
|
492
|
+
RHD = "RHD",
|
|
493
|
+
ESA = "ESA",
|
|
494
|
+
ESB = "ESB",
|
|
495
|
+
SDD = "SDD",
|
|
496
|
+
SDP = "SDP",
|
|
497
|
+
SRG = "SRG",
|
|
498
|
+
CHC = "CHC",
|
|
499
|
+
TJR = "TJR",
|
|
500
|
+
TPE = "TPE",
|
|
501
|
+
TRL = "TRL",
|
|
502
|
+
TMM = "TMM",
|
|
503
|
+
UGS = "UGS",
|
|
504
|
+
UGW = "UGW",
|
|
505
|
+
UAK = "UAK",
|
|
506
|
+
SUR = "SUR",
|
|
507
|
+
USS = "USS",
|
|
508
|
+
UYN = "UYN",
|
|
509
|
+
UYP = "UYP",
|
|
510
|
+
VEB = "VEB",
|
|
511
|
+
VEF = "VEF",
|
|
512
|
+
VNC = "VNC",
|
|
513
|
+
YDD = "YDD",
|
|
514
|
+
YUD = "YUD",
|
|
515
|
+
YUM = "YUM",
|
|
516
|
+
YUN = "YUN",
|
|
517
|
+
ZRN = "ZRN",
|
|
518
|
+
ZRZ = "ZRZ",
|
|
519
|
+
ZMK = "ZMK",
|
|
520
|
+
ZWC = "ZWC",
|
|
521
|
+
ZWD = "ZWD",
|
|
522
|
+
ZWN = "ZWN",
|
|
523
|
+
ZWR = "ZWR",
|
|
524
|
+
XFO = "XFO",
|
|
525
|
+
XRE = "XRE",
|
|
526
|
+
XFU = "XFU"
|
|
527
|
+
}
|
|
528
|
+
declare enum DataLocalizationRegionEnum {
|
|
529
|
+
AU = "AU",// Australia
|
|
530
|
+
ID = "ID",// Indonesia
|
|
531
|
+
IN = "IN",// India
|
|
532
|
+
JP = "JP",// Japan
|
|
533
|
+
SG = "SG",// Singapore
|
|
534
|
+
KR = "KR",// South Korea
|
|
535
|
+
DE = "DE",// EU (Germany)
|
|
536
|
+
CH = "CH",// Switzerland
|
|
537
|
+
GB = "GB",// United Kingdom
|
|
538
|
+
BR = "BR",// Brazil
|
|
539
|
+
BH = "BH",// Bahrain
|
|
540
|
+
ZA = "ZA",// South Africa
|
|
541
|
+
AE = "AE",// United Arab Emirates
|
|
542
|
+
CA = "CA"
|
|
543
|
+
}
|
|
544
|
+
/**
|
|
545
|
+
* Business category values for WhatsApp Business Profile.
|
|
546
|
+
* These values map to specific strings displayed in the WhatsApp client.
|
|
547
|
+
*/
|
|
548
|
+
declare enum BusinessVerticalEnum {
|
|
549
|
+
/**
|
|
550
|
+
* Alcoholic Beverages
|
|
551
|
+
*/
|
|
552
|
+
ALCOHOL = "ALCOHOL",
|
|
553
|
+
/**
|
|
554
|
+
* Clothing and Apparel
|
|
555
|
+
*/
|
|
556
|
+
APPAREL = "APPAREL",
|
|
557
|
+
/**
|
|
558
|
+
* Automotive
|
|
559
|
+
*/
|
|
560
|
+
AUTO = "AUTO",
|
|
561
|
+
/**
|
|
562
|
+
* Beauty, Spa and Salon
|
|
563
|
+
*/
|
|
564
|
+
BEAUTY = "BEAUTY",
|
|
565
|
+
/**
|
|
566
|
+
* Education
|
|
567
|
+
*/
|
|
568
|
+
EDU = "EDU",
|
|
569
|
+
/**
|
|
570
|
+
* Entertainment
|
|
571
|
+
*/
|
|
572
|
+
ENTERTAIN = "ENTERTAIN",
|
|
573
|
+
/**
|
|
574
|
+
* Event Planning and Service
|
|
575
|
+
*/
|
|
576
|
+
EVENT_PLAN = "EVENT_PLAN",
|
|
577
|
+
/**
|
|
578
|
+
* Finance and Banking
|
|
579
|
+
*/
|
|
580
|
+
FINANCE = "FINANCE",
|
|
581
|
+
/**
|
|
582
|
+
* Public Service
|
|
583
|
+
*/
|
|
584
|
+
GOVT = "GOVT",
|
|
585
|
+
/**
|
|
586
|
+
* Food and Grocery
|
|
587
|
+
*/
|
|
588
|
+
GROCERY = "GROCERY",
|
|
589
|
+
/**
|
|
590
|
+
* Medical and Health
|
|
591
|
+
*/
|
|
592
|
+
HEALTH = "HEALTH",
|
|
593
|
+
/**
|
|
594
|
+
* Hotel and Lodging
|
|
595
|
+
*/
|
|
596
|
+
HOTEL = "HOTEL",
|
|
597
|
+
/**
|
|
598
|
+
* Non-profit
|
|
599
|
+
*/
|
|
600
|
+
NONPROFIT = "NONPROFIT",
|
|
601
|
+
/**
|
|
602
|
+
* Online Gambling & Gaming
|
|
603
|
+
*/
|
|
604
|
+
ONLINE_GAMBLING = "ONLINE_GAMBLING",
|
|
605
|
+
/**
|
|
606
|
+
* Over-the-Counter Drugs
|
|
607
|
+
*/
|
|
608
|
+
OTC_DRUGS = "OTC_DRUGS",
|
|
609
|
+
/**
|
|
610
|
+
* Other
|
|
611
|
+
*/
|
|
612
|
+
OTHER = "OTHER",
|
|
613
|
+
/**
|
|
614
|
+
* Non-Online Gambling & Gaming (E.g. Brick and mortar)
|
|
615
|
+
*/
|
|
616
|
+
PHYSICAL_GAMBLING = "PHYSICAL_GAMBLING",
|
|
617
|
+
/**
|
|
618
|
+
* Professional Services
|
|
619
|
+
*/
|
|
620
|
+
PROF_SERVICES = "PROF_SERVICES",
|
|
621
|
+
/**
|
|
622
|
+
* Restaurant
|
|
623
|
+
*/
|
|
624
|
+
RESTAURANT = "RESTAURANT",
|
|
625
|
+
/**
|
|
626
|
+
* Shopping and Retail
|
|
627
|
+
*/
|
|
628
|
+
RETAIL = "RETAIL",
|
|
629
|
+
/**
|
|
630
|
+
* Travel and Transportation
|
|
631
|
+
*/
|
|
632
|
+
TRAVEL = "TRAVEL"
|
|
633
|
+
}
|
|
634
|
+
|
|
635
|
+
type SDKEnums_AudioMediaTypesEnum = AudioMediaTypesEnum;
|
|
636
|
+
declare const SDKEnums_AudioMediaTypesEnum: typeof AudioMediaTypesEnum;
|
|
637
|
+
type SDKEnums_BusinessVerticalEnum = BusinessVerticalEnum;
|
|
638
|
+
declare const SDKEnums_BusinessVerticalEnum: typeof BusinessVerticalEnum;
|
|
639
|
+
type SDKEnums_ButtonPositionEnum = ButtonPositionEnum;
|
|
640
|
+
declare const SDKEnums_ButtonPositionEnum: typeof ButtonPositionEnum;
|
|
641
|
+
type SDKEnums_ButtonTypesEnum = ButtonTypesEnum;
|
|
642
|
+
declare const SDKEnums_ButtonTypesEnum: typeof ButtonTypesEnum;
|
|
643
|
+
type SDKEnums_CategoryEnum = CategoryEnum;
|
|
644
|
+
declare const SDKEnums_CategoryEnum: typeof CategoryEnum;
|
|
645
|
+
type SDKEnums_ComponentTypesEnum = ComponentTypesEnum;
|
|
646
|
+
declare const SDKEnums_ComponentTypesEnum: typeof ComponentTypesEnum;
|
|
647
|
+
type SDKEnums_ConversationTypesEnum = ConversationTypesEnum;
|
|
648
|
+
declare const SDKEnums_ConversationTypesEnum: typeof ConversationTypesEnum;
|
|
649
|
+
type SDKEnums_CurrencyCodesEnum = CurrencyCodesEnum;
|
|
650
|
+
declare const SDKEnums_CurrencyCodesEnum: typeof CurrencyCodesEnum;
|
|
651
|
+
type SDKEnums_DataLocalizationRegionEnum = DataLocalizationRegionEnum;
|
|
652
|
+
declare const SDKEnums_DataLocalizationRegionEnum: typeof DataLocalizationRegionEnum;
|
|
653
|
+
type SDKEnums_DocumentMediaTypesEnum = DocumentMediaTypesEnum;
|
|
654
|
+
declare const SDKEnums_DocumentMediaTypesEnum: typeof DocumentMediaTypesEnum;
|
|
655
|
+
type SDKEnums_HttpMethodsEnum = HttpMethodsEnum;
|
|
656
|
+
declare const SDKEnums_HttpMethodsEnum: typeof HttpMethodsEnum;
|
|
657
|
+
type SDKEnums_ImageMediaTypesEnum = ImageMediaTypesEnum;
|
|
658
|
+
declare const SDKEnums_ImageMediaTypesEnum: typeof ImageMediaTypesEnum;
|
|
659
|
+
type SDKEnums_InteractiveTypesEnum = InteractiveTypesEnum;
|
|
660
|
+
declare const SDKEnums_InteractiveTypesEnum: typeof InteractiveTypesEnum;
|
|
661
|
+
type SDKEnums_LanguagesEnum = LanguagesEnum;
|
|
662
|
+
declare const SDKEnums_LanguagesEnum: typeof LanguagesEnum;
|
|
663
|
+
type SDKEnums_MessageTypesEnum = MessageTypesEnum;
|
|
664
|
+
declare const SDKEnums_MessageTypesEnum: typeof MessageTypesEnum;
|
|
665
|
+
type SDKEnums_ParametersTypesEnum = ParametersTypesEnum;
|
|
666
|
+
declare const SDKEnums_ParametersTypesEnum: typeof ParametersTypesEnum;
|
|
667
|
+
type SDKEnums_ReferralSourceTypesEnum = ReferralSourceTypesEnum;
|
|
668
|
+
declare const SDKEnums_ReferralSourceTypesEnum: typeof ReferralSourceTypesEnum;
|
|
669
|
+
type SDKEnums_RequestCodeMethodsEnum = RequestCodeMethodsEnum;
|
|
670
|
+
declare const SDKEnums_RequestCodeMethodsEnum: typeof RequestCodeMethodsEnum;
|
|
671
|
+
type SDKEnums_StatusEnum = StatusEnum;
|
|
672
|
+
declare const SDKEnums_StatusEnum: typeof StatusEnum;
|
|
673
|
+
type SDKEnums_StickerMediaTypesEnum = StickerMediaTypesEnum;
|
|
674
|
+
declare const SDKEnums_StickerMediaTypesEnum: typeof StickerMediaTypesEnum;
|
|
675
|
+
type SDKEnums_SystemChangeTypesEnum = SystemChangeTypesEnum;
|
|
676
|
+
declare const SDKEnums_SystemChangeTypesEnum: typeof SystemChangeTypesEnum;
|
|
677
|
+
type SDKEnums_TemplateStatusEnum = TemplateStatusEnum;
|
|
678
|
+
declare const SDKEnums_TemplateStatusEnum: typeof TemplateStatusEnum;
|
|
679
|
+
type SDKEnums_VideoMediaTypesEnum = VideoMediaTypesEnum;
|
|
680
|
+
declare const SDKEnums_VideoMediaTypesEnum: typeof VideoMediaTypesEnum;
|
|
681
|
+
type SDKEnums_WabaConfigEnum = WabaConfigEnum;
|
|
682
|
+
declare const SDKEnums_WabaConfigEnum: typeof WabaConfigEnum;
|
|
683
|
+
type SDKEnums_WebhookTypesEnum = WebhookTypesEnum;
|
|
684
|
+
declare const SDKEnums_WebhookTypesEnum: typeof WebhookTypesEnum;
|
|
685
|
+
declare namespace SDKEnums {
|
|
686
|
+
export { SDKEnums_AudioMediaTypesEnum as AudioMediaTypesEnum, SDKEnums_BusinessVerticalEnum as BusinessVerticalEnum, SDKEnums_ButtonPositionEnum as ButtonPositionEnum, SDKEnums_ButtonTypesEnum as ButtonTypesEnum, SDKEnums_CategoryEnum as CategoryEnum, SDKEnums_ComponentTypesEnum as ComponentTypesEnum, SDKEnums_ConversationTypesEnum as ConversationTypesEnum, SDKEnums_CurrencyCodesEnum as CurrencyCodesEnum, SDKEnums_DataLocalizationRegionEnum as DataLocalizationRegionEnum, SDKEnums_DocumentMediaTypesEnum as DocumentMediaTypesEnum, SDKEnums_HttpMethodsEnum as HttpMethodsEnum, SDKEnums_ImageMediaTypesEnum as ImageMediaTypesEnum, SDKEnums_InteractiveTypesEnum as InteractiveTypesEnum, SDKEnums_LanguagesEnum as LanguagesEnum, SDKEnums_MessageTypesEnum as MessageTypesEnum, SDKEnums_ParametersTypesEnum as ParametersTypesEnum, SDKEnums_ReferralSourceTypesEnum as ReferralSourceTypesEnum, SDKEnums_RequestCodeMethodsEnum as RequestCodeMethodsEnum, SDKEnums_StatusEnum as StatusEnum, SDKEnums_StickerMediaTypesEnum as StickerMediaTypesEnum, SDKEnums_SystemChangeTypesEnum as SystemChangeTypesEnum, SDKEnums_TemplateStatusEnum as TemplateStatusEnum, SDKEnums_VideoMediaTypesEnum as VideoMediaTypesEnum, SDKEnums_WabaConfigEnum as WabaConfigEnum, SDKEnums_WebhookTypesEnum as WebhookTypesEnum };
|
|
687
|
+
}
|
|
688
|
+
|
|
689
|
+
type WabaConfigType = {
|
|
690
|
+
/**
|
|
691
|
+
* The Meta for Developers business application Id for this registered application.
|
|
692
|
+
*/
|
|
693
|
+
[WabaConfigEnum.AppId]: string;
|
|
694
|
+
/**
|
|
695
|
+
* The Meta for Developers business application secret for this registered application.
|
|
696
|
+
*/
|
|
697
|
+
[WabaConfigEnum.AppSecret]: string;
|
|
698
|
+
/**
|
|
699
|
+
* The Meta for Developers phone number id used by the registered business.
|
|
700
|
+
*/
|
|
701
|
+
[WabaConfigEnum.PhoneNumberId]: number;
|
|
702
|
+
/**
|
|
703
|
+
* The Meta for Developers business id for the registered business.
|
|
704
|
+
*/
|
|
705
|
+
[WabaConfigEnum.BusinessAcctId]: string;
|
|
706
|
+
/**
|
|
707
|
+
* The version of the Cloud API being used. Starts with a "v" and follows the major number.
|
|
708
|
+
*/
|
|
709
|
+
[WabaConfigEnum.APIVersion]: string;
|
|
710
|
+
/**
|
|
711
|
+
* The access token to make calls on behalf of the signed in Meta for Developers account or business.
|
|
712
|
+
*/
|
|
713
|
+
[WabaConfigEnum.AccessToken]: string;
|
|
714
|
+
/**
|
|
715
|
+
* The endpoint path (e.g. if the value here is webhook, the webhook URL would look like http/https://{host}/webhook).
|
|
716
|
+
*/
|
|
717
|
+
[WabaConfigEnum.WebhookEndpoint]: string;
|
|
718
|
+
/**
|
|
719
|
+
* The verification token that needs to match what is sent by the Cloud API webhook in order to subscribe.
|
|
720
|
+
*/
|
|
721
|
+
[WabaConfigEnum.WebhookVerificationToken]: string;
|
|
722
|
+
/**
|
|
723
|
+
* The listener port for the webhook web server.
|
|
724
|
+
*/
|
|
725
|
+
[WabaConfigEnum.ListenerPort]: number;
|
|
726
|
+
/**
|
|
727
|
+
* To turn on global debugging of the logger to print verbose output across the APIs.
|
|
728
|
+
*/
|
|
729
|
+
[WabaConfigEnum.Debug]: boolean;
|
|
730
|
+
/**
|
|
731
|
+
* The total number of times a request should be retried after the wait period if it fails.
|
|
732
|
+
*/
|
|
733
|
+
[WabaConfigEnum.MaxRetriesAfterWait]: number;
|
|
734
|
+
/**
|
|
735
|
+
* The timeout period for a request to quit and destroy the attempt in ms.
|
|
736
|
+
*/
|
|
737
|
+
[WabaConfigEnum.RequestTimeout]: number;
|
|
738
|
+
/**
|
|
739
|
+
* The private key for the Meta for Developers business.
|
|
740
|
+
*/
|
|
741
|
+
[WabaConfigEnum.PrivatePem]: string;
|
|
742
|
+
/**
|
|
743
|
+
* The passphrase for the Meta for Developers business.
|
|
744
|
+
*/
|
|
745
|
+
[WabaConfigEnum.Passphrase]: string;
|
|
746
|
+
};
|
|
747
|
+
|
|
748
|
+
declare class BaseClass {
|
|
749
|
+
constructor(config: WabaConfigType);
|
|
750
|
+
}
|
|
751
|
+
|
|
752
|
+
type GeneralRequestBody = Record<string, unknown>;
|
|
753
|
+
interface GeneralHeaderInterface {
|
|
754
|
+
/**
|
|
755
|
+
* Authorization token. This is required for all HTTP requests made to the graph API.
|
|
756
|
+
* @default 'Bearer '
|
|
757
|
+
*/
|
|
758
|
+
Authorization: string;
|
|
759
|
+
/**
|
|
760
|
+
* Content type of the message being sent. This is required for all HTTP requests made to the graph API.
|
|
761
|
+
* @default 'application/json'
|
|
762
|
+
*/
|
|
763
|
+
'Content-Type': string;
|
|
764
|
+
/**
|
|
765
|
+
* User agent field sent in all requests. This is used to gather SDK usage metrics and help
|
|
766
|
+
* better triage support requests.
|
|
767
|
+
* @default `WA_SDK/${ SDK_version } (Node.js ${ process.version })`
|
|
768
|
+
*/
|
|
769
|
+
'User-Agent': string;
|
|
770
|
+
}
|
|
771
|
+
interface RequesterResponseInterface<T> {
|
|
772
|
+
json: () => Promise<T>;
|
|
773
|
+
}
|
|
774
|
+
interface ResponseSuccess {
|
|
775
|
+
success: boolean;
|
|
776
|
+
}
|
|
777
|
+
interface ResponseData<T> {
|
|
778
|
+
data: T;
|
|
779
|
+
}
|
|
780
|
+
interface ResponsePagination<T> {
|
|
781
|
+
data: T[];
|
|
782
|
+
paging: Paging;
|
|
783
|
+
}
|
|
784
|
+
interface Paging {
|
|
785
|
+
cursors: {
|
|
786
|
+
before: string;
|
|
787
|
+
after: string;
|
|
788
|
+
};
|
|
789
|
+
next: string;
|
|
790
|
+
}
|
|
791
|
+
declare class RequesterClass {
|
|
792
|
+
constructor(apiVersion: string, phoneNumberId: number, accessToken: string, businessAcctId: string, userAgent: string);
|
|
793
|
+
sendRequest: (method: HttpMethodsEnum, path: string, timeout: number, body?: GeneralRequestBody, contentType?: string, additionalHeaders?: Record<string, string>) => Promise<RequesterResponseInterface<unknown>>;
|
|
794
|
+
getJson<T>(method: HttpMethodsEnum, endpoint: string, timeout: number, body?: GeneralRequestBody, additionalHeaders?: Record<string, string>): Promise<T>;
|
|
795
|
+
sendFormData<T>(method: HttpMethodsEnum, endpoint: string, timeout: number, formData: FormData, additionalHeaders?: Record<string, string>): Promise<T>;
|
|
796
|
+
sendUrlEncodedForm<T>(method: HttpMethodsEnum, endpoint: string, timeout: number, formData: Record<string, string>, additionalHeaders?: Record<string, string>): Promise<T>;
|
|
797
|
+
}
|
|
798
|
+
|
|
799
|
+
/**
|
|
800
|
+
* Available fields that can be requested when retrieving a business profile.
|
|
801
|
+
*/
|
|
802
|
+
type BusinessProfileField = 'about' | 'address' | 'description' | 'email' | 'profile_picture_url' | 'websites' | 'vertical';
|
|
803
|
+
type BusinessProfileFieldsParam = BusinessProfileField[];
|
|
804
|
+
interface BusinessProfileData {
|
|
805
|
+
/**
|
|
806
|
+
* The business's About text. This text appears in the business's profile, beneath its profile image,
|
|
807
|
+
* phone number, and contact buttons.
|
|
808
|
+
* - String cannot be empty
|
|
809
|
+
* - Strings must be between 1 and 139 characters
|
|
810
|
+
* - Rendered emojis are supported however their unicode values are not.
|
|
811
|
+
* Emoji unicode values must be Java- or JavaScript-escape encoded
|
|
812
|
+
* - Hyperlinks can be included but will not render as clickable links
|
|
813
|
+
* - Markdown is not supported
|
|
814
|
+
*/
|
|
815
|
+
about?: string;
|
|
816
|
+
/**
|
|
817
|
+
* Address of the business. Character limit 256.
|
|
818
|
+
*/
|
|
819
|
+
address?: string;
|
|
820
|
+
/**
|
|
821
|
+
* Description of the business. Character limit 512.
|
|
822
|
+
*/
|
|
823
|
+
description?: string;
|
|
824
|
+
/**
|
|
825
|
+
* The contact email address (in valid email format) of the business. Character limit 128.
|
|
826
|
+
*/
|
|
827
|
+
email?: string;
|
|
828
|
+
/**
|
|
829
|
+
* The messaging service used for the request. Always set it to "whatsapp" if you are using
|
|
830
|
+
* the WhatsApp Business API.
|
|
831
|
+
*/
|
|
832
|
+
messaging_product: string;
|
|
833
|
+
/**
|
|
834
|
+
* Profile picture URL.
|
|
835
|
+
*/
|
|
836
|
+
profile_picture_url?: string;
|
|
837
|
+
/**
|
|
838
|
+
* The URLs associated with the business. For instance, a website, Facebook Page, or Instagram.
|
|
839
|
+
* - You must include the http:// or https:// portion of the URL
|
|
840
|
+
* - There is a maximum of 2 websites with a maximum of 256 characters each
|
|
841
|
+
*/
|
|
842
|
+
websites?: string[];
|
|
843
|
+
/**
|
|
844
|
+
* Business category. This can be either an empty string or one of the predefined business categories.
|
|
845
|
+
* @see BusinessVerticalEnum for all available options
|
|
846
|
+
*/
|
|
847
|
+
vertical?: BusinessVerticalEnum | string;
|
|
848
|
+
}
|
|
849
|
+
interface BusinessProfileResponse {
|
|
850
|
+
data: BusinessProfileData[];
|
|
851
|
+
}
|
|
852
|
+
interface UpdateBusinessProfileRequest {
|
|
853
|
+
/**
|
|
854
|
+
* The messaging service used for the request. Always set it to "whatsapp" if you are using
|
|
855
|
+
* the WhatsApp Business API.
|
|
856
|
+
* @required
|
|
857
|
+
*/
|
|
858
|
+
messaging_product: string;
|
|
859
|
+
/**
|
|
860
|
+
* The business's About text. This text appears in the business's profile, beneath its profile image,
|
|
861
|
+
* phone number, and contact buttons.
|
|
862
|
+
* - String cannot be empty
|
|
863
|
+
* - Strings must be between 1 and 139 characters
|
|
864
|
+
* - Rendered emojis are supported however their unicode values are not.
|
|
865
|
+
* Emoji unicode values must be Java- or JavaScript-escape encoded
|
|
866
|
+
* - Hyperlinks can be included but will not render as clickable links
|
|
867
|
+
* - Markdown is not supported
|
|
868
|
+
*/
|
|
869
|
+
about?: string;
|
|
870
|
+
/**
|
|
871
|
+
* Address of the business. Character limit 256.
|
|
872
|
+
*/
|
|
873
|
+
address?: string;
|
|
874
|
+
/**
|
|
875
|
+
* Description of the business. Character limit 512.
|
|
876
|
+
*/
|
|
877
|
+
description?: string;
|
|
878
|
+
/**
|
|
879
|
+
* Business category. This can be either an empty string or one of the predefined business categories.
|
|
880
|
+
* @see BusinessVerticalEnum for all available options
|
|
881
|
+
*/
|
|
882
|
+
vertical?: BusinessVerticalEnum | string;
|
|
883
|
+
/**
|
|
884
|
+
* The contact email address (in valid email format) of the business. Character limit 128.
|
|
885
|
+
*/
|
|
886
|
+
email?: string;
|
|
887
|
+
/**
|
|
888
|
+
* The URLs associated with the business. For instance, a website, Facebook Page, or Instagram.
|
|
889
|
+
* - You must include the http:// or https:// portion of the URL
|
|
890
|
+
* - There is a maximum of 2 websites with a maximum of 256 characters each
|
|
891
|
+
*/
|
|
892
|
+
websites?: string[];
|
|
893
|
+
/**
|
|
894
|
+
* Handle of the profile picture. This handle is generated when you upload the binary file
|
|
895
|
+
* for the profile picture to Meta using the Resumable Upload API.
|
|
896
|
+
*/
|
|
897
|
+
profile_picture_handle?: string;
|
|
898
|
+
}
|
|
899
|
+
interface UploadSession {
|
|
900
|
+
id: string;
|
|
901
|
+
video?: boolean;
|
|
902
|
+
}
|
|
903
|
+
interface UploadSessionResponse {
|
|
904
|
+
id: string;
|
|
905
|
+
}
|
|
906
|
+
interface UploadBusinessProfileResponse {
|
|
907
|
+
h: string;
|
|
908
|
+
}
|
|
909
|
+
interface UploadHandle {
|
|
910
|
+
handle: string;
|
|
911
|
+
file_size: number;
|
|
912
|
+
upload_result: {
|
|
913
|
+
handle_type: string;
|
|
914
|
+
name: string;
|
|
915
|
+
};
|
|
916
|
+
}
|
|
917
|
+
interface BusinessProfileClass {
|
|
918
|
+
/**
|
|
919
|
+
* Get your business profile.
|
|
920
|
+
* @param fields Specific fields to be returned in the response. If not specified, all fields will be returned.
|
|
921
|
+
*/
|
|
922
|
+
getBusinessProfile(fields?: BusinessProfileFieldsParam | string): Promise<BusinessProfileResponse>;
|
|
923
|
+
/**
|
|
924
|
+
* Update your business profile.
|
|
925
|
+
* @param updateRequest The request object containing the fields to update.
|
|
926
|
+
*/
|
|
927
|
+
updateBusinessProfile(updateRequest: UpdateBusinessProfileRequest): Promise<ResponseSuccess>;
|
|
928
|
+
/**
|
|
929
|
+
* Create an upload session for profile picture.
|
|
930
|
+
* @param fileLength Length of the file to be uploaded in bytes.
|
|
931
|
+
* @param fileType MIME type of the file (e.g., 'image/jpeg').
|
|
932
|
+
* @param fileName Name of the file.
|
|
933
|
+
*/
|
|
934
|
+
createUploadSession(fileLength: number, fileType: string, fileName: string): Promise<UploadSessionResponse>;
|
|
935
|
+
/**
|
|
936
|
+
* Upload media file to the upload session.
|
|
937
|
+
* @param uploadId The ID of the upload session.
|
|
938
|
+
* @param file The binary data of the file.
|
|
939
|
+
*/
|
|
940
|
+
uploadMedia(uploadId: string, file: Buffer): Promise<UploadBusinessProfileResponse>;
|
|
941
|
+
/**
|
|
942
|
+
* Get the upload handle information.
|
|
943
|
+
* @param uploadId The ID of the upload session.
|
|
944
|
+
*/
|
|
945
|
+
getUploadHandle(uploadId: string): Promise<UploadHandle>;
|
|
946
|
+
}
|
|
947
|
+
|
|
948
|
+
type EncryptionPublicKeyResponse = ResponseData<{
|
|
949
|
+
business_public_key: string;
|
|
950
|
+
business_public_key_signature_status: 'VALID' | 'MISMATCH';
|
|
951
|
+
}>;
|
|
952
|
+
interface EncryptionClass {
|
|
953
|
+
getEncryptionPublicKey(): Promise<EncryptionPublicKeyResponse>;
|
|
954
|
+
setEncryptionPublicKey(businessPublicKey: string): Promise<ResponseSuccess>;
|
|
955
|
+
}
|
|
956
|
+
|
|
957
|
+
/**
|
|
958
|
+
* Enum for Flow Status
|
|
959
|
+
*/
|
|
960
|
+
declare enum FlowStatusEnum {
|
|
961
|
+
Draft = "DRAFT",
|
|
962
|
+
Published = "PUBLISHED",
|
|
963
|
+
Throttled = "THROTTLED",
|
|
964
|
+
Blocked = "BLOCKED",
|
|
965
|
+
Deprecated = "DEPRECATED"
|
|
966
|
+
}
|
|
967
|
+
/**
|
|
968
|
+
* Enum for Flow Categories
|
|
969
|
+
*/
|
|
970
|
+
declare enum FlowCategoryEnum {
|
|
971
|
+
SignUp = "SIGN_UP",
|
|
972
|
+
SignIn = "SIGN_IN",
|
|
973
|
+
AppointmentBooking = "APPOINTMENT_BOOKING",
|
|
974
|
+
LeadGeneration = "LEAD_GENERATION",
|
|
975
|
+
ContactUs = "CONTACT_US",
|
|
976
|
+
CustomerSupport = "CUSTOMER_SUPPORT",
|
|
977
|
+
Survey = "SURVEY",
|
|
978
|
+
Other = "OTHER"
|
|
979
|
+
}
|
|
980
|
+
declare enum FlowActionEnum {
|
|
981
|
+
INIT = "INIT",
|
|
982
|
+
BACK = "BACK",
|
|
983
|
+
DATA_EXCHANGE = "data_exchange"
|
|
984
|
+
}
|
|
985
|
+
/**
|
|
986
|
+
* Enum for Flow Types in webhook handlers
|
|
987
|
+
* Used to register handlers for specific flow events
|
|
988
|
+
*/
|
|
989
|
+
declare enum FlowTypeEnum {
|
|
990
|
+
/** Health check/ping requests */
|
|
991
|
+
Ping = "ping",
|
|
992
|
+
/** Data exchange requests */
|
|
993
|
+
Change = "data_exchange",
|
|
994
|
+
/** Error notification requests */
|
|
995
|
+
Error = "error",
|
|
996
|
+
/** Match all flow action types */
|
|
997
|
+
All = "*"
|
|
998
|
+
}
|
|
999
|
+
/**
|
|
1000
|
+
* Flow Validation Error Pointer
|
|
1001
|
+
*/
|
|
1002
|
+
interface FlowValidationErrorPointer {
|
|
1003
|
+
line_start: number;
|
|
1004
|
+
line_end: number;
|
|
1005
|
+
column_start: number;
|
|
1006
|
+
column_end: number;
|
|
1007
|
+
path: string;
|
|
1008
|
+
}
|
|
1009
|
+
/**
|
|
1010
|
+
* Flow Validation Error
|
|
1011
|
+
*/
|
|
1012
|
+
interface FlowValidationError {
|
|
1013
|
+
error: string;
|
|
1014
|
+
error_type: string;
|
|
1015
|
+
message: string;
|
|
1016
|
+
line_start: number;
|
|
1017
|
+
line_end: number;
|
|
1018
|
+
column_start: number;
|
|
1019
|
+
column_end: number;
|
|
1020
|
+
pointers: FlowValidationErrorPointer[];
|
|
1021
|
+
}
|
|
1022
|
+
/**
|
|
1023
|
+
* Flow Item
|
|
1024
|
+
*/
|
|
1025
|
+
interface Flow {
|
|
1026
|
+
id: string;
|
|
1027
|
+
name: string;
|
|
1028
|
+
status: FlowStatusEnum;
|
|
1029
|
+
categories: FlowCategoryEnum[];
|
|
1030
|
+
validation_errors: FlowValidationError[];
|
|
1031
|
+
}
|
|
1032
|
+
/**
|
|
1033
|
+
* Pagination Cursors
|
|
1034
|
+
*/
|
|
1035
|
+
interface PaginationCursors {
|
|
1036
|
+
before: string;
|
|
1037
|
+
after: string;
|
|
1038
|
+
}
|
|
1039
|
+
/**
|
|
1040
|
+
* Pagination Object
|
|
1041
|
+
*/
|
|
1042
|
+
interface Pagination {
|
|
1043
|
+
cursors: PaginationCursors;
|
|
1044
|
+
}
|
|
1045
|
+
/**
|
|
1046
|
+
* Flows List Response
|
|
1047
|
+
*/
|
|
1048
|
+
interface FlowsListResponse {
|
|
1049
|
+
data: Flow[];
|
|
1050
|
+
paging: Pagination;
|
|
1051
|
+
}
|
|
1052
|
+
/**
|
|
1053
|
+
* Flow Asset
|
|
1054
|
+
*/
|
|
1055
|
+
interface FlowAsset {
|
|
1056
|
+
name: string;
|
|
1057
|
+
asset_type: string;
|
|
1058
|
+
download_url: string;
|
|
1059
|
+
}
|
|
1060
|
+
/**
|
|
1061
|
+
* Flow Assets Response
|
|
1062
|
+
*/
|
|
1063
|
+
interface FlowAssetsResponse {
|
|
1064
|
+
data: FlowAsset[];
|
|
1065
|
+
paging: Pagination;
|
|
1066
|
+
}
|
|
1067
|
+
/**
|
|
1068
|
+
* Flow Preview
|
|
1069
|
+
*/
|
|
1070
|
+
interface FlowPreview {
|
|
1071
|
+
preview_url: string;
|
|
1072
|
+
expires_at: string;
|
|
1073
|
+
}
|
|
1074
|
+
/**
|
|
1075
|
+
* Flow Preview Response
|
|
1076
|
+
*/
|
|
1077
|
+
interface FlowPreviewResponse {
|
|
1078
|
+
preview: FlowPreview;
|
|
1079
|
+
id: string;
|
|
1080
|
+
}
|
|
1081
|
+
/**
|
|
1082
|
+
* Flow Migration Result
|
|
1083
|
+
*/
|
|
1084
|
+
interface FlowMigrationResult {
|
|
1085
|
+
source_name: string;
|
|
1086
|
+
source_id: string;
|
|
1087
|
+
migrated_id: string;
|
|
1088
|
+
}
|
|
1089
|
+
/**
|
|
1090
|
+
* Flow Migration Failure
|
|
1091
|
+
*/
|
|
1092
|
+
interface FlowMigrationFailure {
|
|
1093
|
+
source_name: string;
|
|
1094
|
+
error_code: string;
|
|
1095
|
+
error_message: string;
|
|
1096
|
+
}
|
|
1097
|
+
/**
|
|
1098
|
+
* Create Flow Response
|
|
1099
|
+
*/
|
|
1100
|
+
interface CreateFlowResponse {
|
|
1101
|
+
id: string;
|
|
1102
|
+
success: boolean;
|
|
1103
|
+
validation_errors?: FlowValidationError[];
|
|
1104
|
+
}
|
|
1105
|
+
/**
|
|
1106
|
+
* Update Flow Response
|
|
1107
|
+
*/
|
|
1108
|
+
interface UpdateFlowResponse {
|
|
1109
|
+
success: boolean;
|
|
1110
|
+
validation_errors?: FlowValidationError[];
|
|
1111
|
+
}
|
|
1112
|
+
/**
|
|
1113
|
+
* Flow Migration Response
|
|
1114
|
+
*/
|
|
1115
|
+
interface FlowMigrationResponse {
|
|
1116
|
+
migrated_flows: FlowMigrationResult[];
|
|
1117
|
+
failed_flows: FlowMigrationFailure[];
|
|
1118
|
+
}
|
|
1119
|
+
/**
|
|
1120
|
+
* Validate Flow JSON Response
|
|
1121
|
+
*/
|
|
1122
|
+
interface ValidateFlowJsonResponse {
|
|
1123
|
+
valid: boolean;
|
|
1124
|
+
success: boolean;
|
|
1125
|
+
validation_errors?: FlowValidationError[];
|
|
1126
|
+
}
|
|
1127
|
+
/**
|
|
1128
|
+
* WhatsApp Flow Endpoint - Encrypted Request Payload
|
|
1129
|
+
* Represents the raw encrypted data received from WhatsApp
|
|
1130
|
+
*/
|
|
1131
|
+
interface FlowEncryptedRequestPayload {
|
|
1132
|
+
encrypted_aes_key: string;
|
|
1133
|
+
encrypted_flow_data: string;
|
|
1134
|
+
initial_vector: string;
|
|
1135
|
+
}
|
|
1136
|
+
/**
|
|
1137
|
+
* WhatsApp Flow Endpoint - Decrypted Request Response
|
|
1138
|
+
* Represents the successfully decrypted data and encryption keys
|
|
1139
|
+
*/
|
|
1140
|
+
interface FlowDecryptedRequestResponse {
|
|
1141
|
+
decryptedBody: any;
|
|
1142
|
+
aesKeyBuffer: Buffer;
|
|
1143
|
+
initialVectorBuffer: Buffer;
|
|
1144
|
+
}
|
|
1145
|
+
/**
|
|
1146
|
+
* WhatsApp Flow Endpoint - HTTP Request with Body
|
|
1147
|
+
* Represents an HTTP request with the encrypted payload
|
|
1148
|
+
*/
|
|
1149
|
+
interface FlowHttpRequest extends IncomingMessage {
|
|
1150
|
+
body: FlowEncryptedRequestPayload;
|
|
1151
|
+
headers: IncomingHttpHeaders;
|
|
1152
|
+
}
|
|
1153
|
+
/**
|
|
1154
|
+
* WhatsApp Flow Endpoint - Health Check Request
|
|
1155
|
+
* Represents the structure of a health check request
|
|
1156
|
+
*/
|
|
1157
|
+
interface FlowHealthCheckRequest {
|
|
1158
|
+
action: 'ping';
|
|
1159
|
+
version: '3.0';
|
|
1160
|
+
}
|
|
1161
|
+
/**
|
|
1162
|
+
* WhatsApp Flow Endpoint - Health Check Response
|
|
1163
|
+
* The expected response structure for health check requests
|
|
1164
|
+
*/
|
|
1165
|
+
interface FlowHealthCheckResponse {
|
|
1166
|
+
data: {
|
|
1167
|
+
status: 'active';
|
|
1168
|
+
};
|
|
1169
|
+
}
|
|
1170
|
+
/**
|
|
1171
|
+
* WhatsApp Flow Endpoint - Data Exchange Request
|
|
1172
|
+
* Represents the structure of a data exchange request
|
|
1173
|
+
*/
|
|
1174
|
+
interface FlowDataExchangeRequest {
|
|
1175
|
+
version: '3.0';
|
|
1176
|
+
action: FlowActionEnum;
|
|
1177
|
+
screen: string;
|
|
1178
|
+
flow_token: string;
|
|
1179
|
+
data?: Record<string, any> & {
|
|
1180
|
+
error_message?: string;
|
|
1181
|
+
};
|
|
1182
|
+
}
|
|
1183
|
+
/**
|
|
1184
|
+
* WhatsApp Flow Endpoint - Data Exchange Response
|
|
1185
|
+
* The expected response structure for data exchange requests
|
|
1186
|
+
*/
|
|
1187
|
+
interface FlowDataExchangeResponse {
|
|
1188
|
+
screen?: string;
|
|
1189
|
+
data?: Record<string, any | {
|
|
1190
|
+
error_message?: string;
|
|
1191
|
+
}>;
|
|
1192
|
+
}
|
|
1193
|
+
/**
|
|
1194
|
+
* WhatsApp Flow Endpoint - Success Screen Response
|
|
1195
|
+
* The expected response structure for success screen requests
|
|
1196
|
+
*/
|
|
1197
|
+
interface FlowSuccessScreenResponse {
|
|
1198
|
+
screen: 'SUCCESS';
|
|
1199
|
+
data: {
|
|
1200
|
+
extension_message_response?: {
|
|
1201
|
+
params?: {
|
|
1202
|
+
flow_token: string;
|
|
1203
|
+
[key: string]: string;
|
|
1204
|
+
};
|
|
1205
|
+
};
|
|
1206
|
+
};
|
|
1207
|
+
}
|
|
1208
|
+
/**
|
|
1209
|
+
* WhatsApp Flow Endpoint - Error Notification Request
|
|
1210
|
+
* Represents the structure of an error notification request
|
|
1211
|
+
*/
|
|
1212
|
+
interface FlowErrorNotificationRequest {
|
|
1213
|
+
version: '3.0';
|
|
1214
|
+
action: Exclude<FlowActionEnum, FlowActionEnum.BACK>;
|
|
1215
|
+
screen: string;
|
|
1216
|
+
flow_token: string;
|
|
1217
|
+
data: {
|
|
1218
|
+
error: string;
|
|
1219
|
+
error_message: string;
|
|
1220
|
+
};
|
|
1221
|
+
}
|
|
1222
|
+
/**
|
|
1223
|
+
* WhatsApp Flow Endpoint - Error Notification Response
|
|
1224
|
+
* The expected response structure for error notification requests
|
|
1225
|
+
*/
|
|
1226
|
+
interface FlowErrorNotificationResponse {
|
|
1227
|
+
acknowledged: boolean;
|
|
1228
|
+
}
|
|
1229
|
+
/**
|
|
1230
|
+
* WhatsApp Flow Endpoint - Comprehensive Request Object
|
|
1231
|
+
* A combined type that includes all possible fields from different request types
|
|
1232
|
+
* with all fields being optional for flexibility
|
|
1233
|
+
*/
|
|
1234
|
+
interface FlowEndpointRequest {
|
|
1235
|
+
version?: '3.0';
|
|
1236
|
+
action?: 'ping' | FlowActionEnum;
|
|
1237
|
+
screen?: string;
|
|
1238
|
+
flow_token?: string;
|
|
1239
|
+
data?: Record<string, any> & {
|
|
1240
|
+
error_key?: string;
|
|
1241
|
+
error_message?: string;
|
|
1242
|
+
};
|
|
1243
|
+
}
|
|
1244
|
+
/**
|
|
1245
|
+
* WhatsApp Flow Endpoint - Response
|
|
1246
|
+
* Union type for all possible response types from a Flow endpoint
|
|
1247
|
+
*/
|
|
1248
|
+
type FlowEndpointResponse = FlowHealthCheckResponse | FlowDataExchangeResponse | FlowErrorNotificationResponse | FlowSuccessScreenResponse;
|
|
1249
|
+
interface FlowClass {
|
|
1250
|
+
/**
|
|
1251
|
+
* List Flows
|
|
1252
|
+
*
|
|
1253
|
+
* @param wabaId - The WABA ID
|
|
1254
|
+
* @returns Promise with the list of flows
|
|
1255
|
+
*/
|
|
1256
|
+
listFlows(wabaId: string): Promise<FlowsListResponse>;
|
|
1257
|
+
/**
|
|
1258
|
+
* Create Flow
|
|
1259
|
+
*
|
|
1260
|
+
* @param wabaId - The WABA ID
|
|
1261
|
+
* @param data - The flow data including name, categories, endpoint_uri, and optional clone_flow_id
|
|
1262
|
+
* @returns Promise with the created flow ID
|
|
1263
|
+
*/
|
|
1264
|
+
createFlow(wabaId: string, data: {
|
|
1265
|
+
name: string;
|
|
1266
|
+
categories?: FlowCategoryEnum[];
|
|
1267
|
+
endpoint_uri?: string;
|
|
1268
|
+
clone_flow_id?: string;
|
|
1269
|
+
flow_json?: string;
|
|
1270
|
+
publish?: boolean;
|
|
1271
|
+
}): Promise<CreateFlowResponse>;
|
|
1272
|
+
/**
|
|
1273
|
+
* Get Flow
|
|
1274
|
+
*
|
|
1275
|
+
* @param flowId - The flow ID
|
|
1276
|
+
* @param fields - Optional fields to return
|
|
1277
|
+
* @param dateFormat - Optional date format
|
|
1278
|
+
* @returns Promise with the flow details
|
|
1279
|
+
*/
|
|
1280
|
+
getFlow(flowId: string, fields?: string, dateFormat?: string): Promise<Flow | FlowPreviewResponse>;
|
|
1281
|
+
/**
|
|
1282
|
+
* Update Flow Metadata
|
|
1283
|
+
*
|
|
1284
|
+
* @param flowId - The flow ID
|
|
1285
|
+
* @param data - The flow metadata to update
|
|
1286
|
+
* @returns Promise with the success status
|
|
1287
|
+
*/
|
|
1288
|
+
updateFlowMetadata(flowId: string, data: {
|
|
1289
|
+
name?: string;
|
|
1290
|
+
categories?: FlowCategoryEnum[];
|
|
1291
|
+
endpoint_uri?: string;
|
|
1292
|
+
application_id?: string;
|
|
1293
|
+
}): Promise<ResponseSuccess>;
|
|
1294
|
+
/**
|
|
1295
|
+
* Delete Flow
|
|
1296
|
+
*
|
|
1297
|
+
* @param flowId - The flow ID
|
|
1298
|
+
* @returns Promise with the success status
|
|
1299
|
+
*/
|
|
1300
|
+
deleteFlow(flowId: string): Promise<ResponseSuccess>;
|
|
1301
|
+
/**
|
|
1302
|
+
* List Assets (Get Flow JSON URL)
|
|
1303
|
+
*
|
|
1304
|
+
* @param flowId - The flow ID
|
|
1305
|
+
* @returns Promise with the list of assets
|
|
1306
|
+
*/
|
|
1307
|
+
listAssets(flowId: string): Promise<FlowAssetsResponse>;
|
|
1308
|
+
/**
|
|
1309
|
+
* Update Flow JSON
|
|
1310
|
+
*
|
|
1311
|
+
* @param flowId - The flow ID
|
|
1312
|
+
* @param data - The asset data including asset_type, file, and name
|
|
1313
|
+
* @returns Promise with the success status and validation errors
|
|
1314
|
+
*/
|
|
1315
|
+
updateFlowJson(flowId: string, data: {
|
|
1316
|
+
asset_type: 'FLOW_JSON';
|
|
1317
|
+
file: Blob;
|
|
1318
|
+
name: string;
|
|
1319
|
+
}): Promise<UpdateFlowResponse>;
|
|
1320
|
+
/**
|
|
1321
|
+
* Validate Flow JSON by attempting an update without publishing.
|
|
1322
|
+
* This is a convenience method; the API doesn't have a dedicated validation endpoint.
|
|
1323
|
+
*
|
|
1324
|
+
* @param flowId - The ID of the Flow (must exist, can be in DRAFT status).
|
|
1325
|
+
* @param flowJsonData - The Flow JSON content as a Buffer, JSON object, or Blob.
|
|
1326
|
+
* @returns Promise indicating if the JSON is valid and includes validation errors if any.
|
|
1327
|
+
*/
|
|
1328
|
+
validateFlowJson(flowId: string, flowJsonData: Blob | Buffer | object): Promise<ValidateFlowJsonResponse>;
|
|
1329
|
+
/**
|
|
1330
|
+
* Publish Flow
|
|
1331
|
+
*
|
|
1332
|
+
* @param flowId - The flow ID
|
|
1333
|
+
* @returns Promise with the success status
|
|
1334
|
+
*/
|
|
1335
|
+
publishFlow(flowId: string): Promise<ResponseSuccess>;
|
|
1336
|
+
/**
|
|
1337
|
+
* Deprecate Flow
|
|
1338
|
+
*
|
|
1339
|
+
* @param flowId - The flow ID
|
|
1340
|
+
* @returns Promise with the success status
|
|
1341
|
+
*/
|
|
1342
|
+
deprecateFlow(flowId: string): Promise<ResponseSuccess>;
|
|
1343
|
+
/**
|
|
1344
|
+
* Migrate Flows
|
|
1345
|
+
*
|
|
1346
|
+
* @param wabaId - The destination WABA ID
|
|
1347
|
+
* @param data - The migration data including source_waba_id and optional source_flow_names
|
|
1348
|
+
* @returns Promise with migration results
|
|
1349
|
+
*/
|
|
1350
|
+
migrateFlows(wabaId: string, data: {
|
|
1351
|
+
source_waba_id: string;
|
|
1352
|
+
source_flow_names?: string[];
|
|
1353
|
+
}): Promise<FlowMigrationResponse>;
|
|
1354
|
+
}
|
|
1355
|
+
|
|
1356
|
+
type MediaResponse = {
|
|
1357
|
+
id: string;
|
|
1358
|
+
url: string;
|
|
1359
|
+
mime_type: string;
|
|
1360
|
+
sha256: string;
|
|
1361
|
+
file_size: number;
|
|
1362
|
+
messaging_product: 'whatsapp';
|
|
1363
|
+
};
|
|
1364
|
+
type MediasResponse = {
|
|
1365
|
+
data: MediaResponse[];
|
|
1366
|
+
paging: {
|
|
1367
|
+
cursors: {
|
|
1368
|
+
before: string;
|
|
1369
|
+
after: string;
|
|
1370
|
+
};
|
|
1371
|
+
};
|
|
1372
|
+
};
|
|
1373
|
+
type UploadMediaResponse = {
|
|
1374
|
+
id: string;
|
|
1375
|
+
};
|
|
1376
|
+
interface MediaClass {
|
|
1377
|
+
getMediaById(mediaId: string, phone_number_id?: string): Promise<MediaResponse>;
|
|
1378
|
+
uploadMedia(file: File, messagingProduct?: string): Promise<UploadMediaResponse>;
|
|
1379
|
+
deleteMedia(mediaId: string, phone_number_id?: string): Promise<ResponseSuccess>;
|
|
1380
|
+
downloadMedia(mediaUrl: string): Promise<Blob>;
|
|
1381
|
+
}
|
|
1382
|
+
|
|
1383
|
+
/**
|
|
1384
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
1385
|
+
* All rights reserved.
|
|
1386
|
+
*
|
|
1387
|
+
* This source code is licensed under the license found in the
|
|
1388
|
+
* LICENSE file in the root directory of this source tree.
|
|
1389
|
+
*/
|
|
1390
|
+
|
|
1391
|
+
type GeneralMessageBody = GeneralRequestBody & {
|
|
1392
|
+
/**
|
|
1393
|
+
* The Meta messaging product name.
|
|
1394
|
+
* @default 'whatsapp'
|
|
1395
|
+
*/
|
|
1396
|
+
messaging_product: 'whatsapp';
|
|
1397
|
+
};
|
|
1398
|
+
type StatusObject = {
|
|
1399
|
+
status: 'read';
|
|
1400
|
+
message_id: string;
|
|
1401
|
+
typing_indicator?: TypingIndicatorObject;
|
|
1402
|
+
};
|
|
1403
|
+
type TypingIndicatorObject = {
|
|
1404
|
+
type: 'text';
|
|
1405
|
+
};
|
|
1406
|
+
type StatusRequestBody = GeneralMessageBody & StatusObject;
|
|
1407
|
+
type ConTextObject = {
|
|
1408
|
+
message_id: string;
|
|
1409
|
+
};
|
|
1410
|
+
type MessageRequestBody<T extends MessageTypesEnum> = GeneralMessageBody & {
|
|
1411
|
+
recipient_type?: string;
|
|
1412
|
+
to: string;
|
|
1413
|
+
context?: ConTextObject;
|
|
1414
|
+
type?: T;
|
|
1415
|
+
};
|
|
1416
|
+
type MetaAudioMediaObject = {
|
|
1417
|
+
id: string;
|
|
1418
|
+
link?: never;
|
|
1419
|
+
};
|
|
1420
|
+
type HostedAudioMediaObject = {
|
|
1421
|
+
id?: never;
|
|
1422
|
+
link: string;
|
|
1423
|
+
};
|
|
1424
|
+
type AudioMediaObject = MetaAudioMediaObject | HostedAudioMediaObject;
|
|
1425
|
+
type AudioMessageRequestBody = MessageRequestBody<MessageTypesEnum.Audio> & {
|
|
1426
|
+
[MessageTypesEnum.Audio]: [AudioMediaObject];
|
|
1427
|
+
};
|
|
1428
|
+
type AddressesObject = {
|
|
1429
|
+
street?: string;
|
|
1430
|
+
city?: string;
|
|
1431
|
+
state?: string;
|
|
1432
|
+
zip?: string;
|
|
1433
|
+
country?: string;
|
|
1434
|
+
country_code?: string;
|
|
1435
|
+
type?: 'HOME' | 'WORK' | string;
|
|
1436
|
+
};
|
|
1437
|
+
type EmailObject = {
|
|
1438
|
+
email?: string;
|
|
1439
|
+
type?: 'HOME' | 'WORK' | string;
|
|
1440
|
+
};
|
|
1441
|
+
type NameObject = {
|
|
1442
|
+
formatted_name: string;
|
|
1443
|
+
first_name?: string;
|
|
1444
|
+
last_name?: string;
|
|
1445
|
+
middle_name?: string;
|
|
1446
|
+
suffix?: string;
|
|
1447
|
+
prefix?: string;
|
|
1448
|
+
};
|
|
1449
|
+
type OrgObject = {
|
|
1450
|
+
company?: string;
|
|
1451
|
+
department?: string;
|
|
1452
|
+
title?: string;
|
|
1453
|
+
};
|
|
1454
|
+
type PhoneObject = {
|
|
1455
|
+
phone?: 'PHONE_NUMBER';
|
|
1456
|
+
type?: 'CELL' | 'MAIN' | 'IPHONE' | 'HOME' | 'WORK' | string;
|
|
1457
|
+
wa_id?: string;
|
|
1458
|
+
};
|
|
1459
|
+
type URLObject = {
|
|
1460
|
+
url?: string;
|
|
1461
|
+
type?: 'HOME' | 'WORK' | string;
|
|
1462
|
+
};
|
|
1463
|
+
type ContactObject = {
|
|
1464
|
+
addresses?: AddressesObject[];
|
|
1465
|
+
birthday?: `${number}${number}${number}${number}-${number}${number}-${number}${number}`;
|
|
1466
|
+
emails?: EmailObject[];
|
|
1467
|
+
name: NameObject;
|
|
1468
|
+
org?: OrgObject;
|
|
1469
|
+
phones?: PhoneObject[];
|
|
1470
|
+
urls?: URLObject[];
|
|
1471
|
+
};
|
|
1472
|
+
type ContactsMessageRequestBody = MessageRequestBody<MessageTypesEnum.Contacts> & {
|
|
1473
|
+
[MessageTypesEnum.Contacts]: [ContactObject];
|
|
1474
|
+
};
|
|
1475
|
+
type MetaDocumentMediaObject = {
|
|
1476
|
+
id: string;
|
|
1477
|
+
link?: never;
|
|
1478
|
+
caption?: string;
|
|
1479
|
+
filename?: string;
|
|
1480
|
+
};
|
|
1481
|
+
type HostedDocumentMediaObject = {
|
|
1482
|
+
id?: never;
|
|
1483
|
+
link: string;
|
|
1484
|
+
caption?: string;
|
|
1485
|
+
filename?: string;
|
|
1486
|
+
};
|
|
1487
|
+
type DocumentMediaObject = MetaDocumentMediaObject | HostedDocumentMediaObject;
|
|
1488
|
+
type DocumentMessageRequestBody = MessageRequestBody<MessageTypesEnum.Document> & {
|
|
1489
|
+
[MessageTypesEnum.Document]: [DocumentMediaObject];
|
|
1490
|
+
};
|
|
1491
|
+
type MetaImageMediaObject = {
|
|
1492
|
+
id: string;
|
|
1493
|
+
link?: never;
|
|
1494
|
+
caption?: string;
|
|
1495
|
+
};
|
|
1496
|
+
type HostedImageMediaObject = {
|
|
1497
|
+
id?: never;
|
|
1498
|
+
link: string;
|
|
1499
|
+
caption?: string;
|
|
1500
|
+
};
|
|
1501
|
+
type ImageMediaObject = MetaImageMediaObject | HostedImageMediaObject;
|
|
1502
|
+
type ImageMessageRequestBody = MessageRequestBody<MessageTypesEnum.Image> & {
|
|
1503
|
+
[MessageTypesEnum.Image]: [ImageMediaObject];
|
|
1504
|
+
};
|
|
1505
|
+
type ProductObject = {
|
|
1506
|
+
product_retailer_id: string;
|
|
1507
|
+
};
|
|
1508
|
+
type SimpleTextObject = {
|
|
1509
|
+
text: string;
|
|
1510
|
+
};
|
|
1511
|
+
type RowObject = {
|
|
1512
|
+
id: string;
|
|
1513
|
+
title: string;
|
|
1514
|
+
description?: string;
|
|
1515
|
+
};
|
|
1516
|
+
type MultiProductSectionObject = {
|
|
1517
|
+
product_items: ProductObject[];
|
|
1518
|
+
rows?: never;
|
|
1519
|
+
title?: string;
|
|
1520
|
+
};
|
|
1521
|
+
type ListSectionObject = {
|
|
1522
|
+
product_items?: never;
|
|
1523
|
+
rows: RowObject[];
|
|
1524
|
+
title?: string;
|
|
1525
|
+
};
|
|
1526
|
+
type SectionObject = MultiProductSectionObject | ListSectionObject;
|
|
1527
|
+
type ButtonObject = {
|
|
1528
|
+
title: string;
|
|
1529
|
+
id: string;
|
|
1530
|
+
};
|
|
1531
|
+
type ReplyButtonObject = {
|
|
1532
|
+
type: 'reply';
|
|
1533
|
+
reply: ButtonObject;
|
|
1534
|
+
};
|
|
1535
|
+
type ActionObject = {
|
|
1536
|
+
button?: string;
|
|
1537
|
+
buttons?: ReplyButtonObject[];
|
|
1538
|
+
catalog_id?: string;
|
|
1539
|
+
product_retailer_id?: string;
|
|
1540
|
+
sections?: SectionObject;
|
|
1541
|
+
};
|
|
1542
|
+
type HeaderObject = {
|
|
1543
|
+
type: 'document' | 'image' | 'text' | 'video';
|
|
1544
|
+
document?: DocumentMediaObject;
|
|
1545
|
+
image?: ImageMediaObject;
|
|
1546
|
+
text?: string;
|
|
1547
|
+
video?: VideoMediaObject;
|
|
1548
|
+
};
|
|
1549
|
+
type ButtonInteractiveObject = {
|
|
1550
|
+
type: InteractiveTypesEnum.Button;
|
|
1551
|
+
body: SimpleTextObject;
|
|
1552
|
+
footer?: SimpleTextObject;
|
|
1553
|
+
header?: HeaderObject;
|
|
1554
|
+
action: ActionObject;
|
|
1555
|
+
};
|
|
1556
|
+
type ListInteractiveObject = {
|
|
1557
|
+
type: InteractiveTypesEnum.List;
|
|
1558
|
+
body: SimpleTextObject;
|
|
1559
|
+
footer?: SimpleTextObject;
|
|
1560
|
+
header?: HeaderObject;
|
|
1561
|
+
action: ActionObject;
|
|
1562
|
+
};
|
|
1563
|
+
type ProductInteractiveObject = {
|
|
1564
|
+
type: InteractiveTypesEnum.Product;
|
|
1565
|
+
body?: SimpleTextObject;
|
|
1566
|
+
footer?: SimpleTextObject;
|
|
1567
|
+
header?: HeaderObject;
|
|
1568
|
+
action: ActionObject;
|
|
1569
|
+
};
|
|
1570
|
+
type ProductListInteractiveObject = {
|
|
1571
|
+
type: InteractiveTypesEnum.ProductList;
|
|
1572
|
+
body: SimpleTextObject;
|
|
1573
|
+
footer?: SimpleTextObject;
|
|
1574
|
+
header: HeaderObject;
|
|
1575
|
+
action: ActionObject;
|
|
1576
|
+
};
|
|
1577
|
+
type CtaUrlParameters = {
|
|
1578
|
+
display_text: string;
|
|
1579
|
+
url: string;
|
|
1580
|
+
};
|
|
1581
|
+
type CtaUrlActionObject = {
|
|
1582
|
+
name: 'cta_url';
|
|
1583
|
+
parameters: CtaUrlParameters;
|
|
1584
|
+
};
|
|
1585
|
+
type CtaUrlInteractiveObject = {
|
|
1586
|
+
type: InteractiveTypesEnum.CtaUrl;
|
|
1587
|
+
body?: SimpleTextObject;
|
|
1588
|
+
footer?: SimpleTextObject;
|
|
1589
|
+
header?: HeaderObject;
|
|
1590
|
+
action: CtaUrlActionObject;
|
|
1591
|
+
};
|
|
1592
|
+
type LocationRequestActionObject = {
|
|
1593
|
+
name: 'send_location';
|
|
1594
|
+
};
|
|
1595
|
+
type LocationRequestInteractiveObject = {
|
|
1596
|
+
type: InteractiveTypesEnum.LocationRequest;
|
|
1597
|
+
body: SimpleTextObject;
|
|
1598
|
+
footer?: SimpleTextObject;
|
|
1599
|
+
header?: HeaderObject;
|
|
1600
|
+
action: LocationRequestActionObject;
|
|
1601
|
+
};
|
|
1602
|
+
type AddressValues = {
|
|
1603
|
+
name?: string;
|
|
1604
|
+
phone_number?: string;
|
|
1605
|
+
in_pin_code?: string;
|
|
1606
|
+
house_number?: string;
|
|
1607
|
+
floor_number?: string;
|
|
1608
|
+
tower_number?: string;
|
|
1609
|
+
building_name?: string;
|
|
1610
|
+
address?: string;
|
|
1611
|
+
landmark_area?: string;
|
|
1612
|
+
city?: string;
|
|
1613
|
+
state?: string;
|
|
1614
|
+
};
|
|
1615
|
+
type SavedAddress = {
|
|
1616
|
+
id: string;
|
|
1617
|
+
value: AddressValues;
|
|
1618
|
+
};
|
|
1619
|
+
type ValidationErrors = {
|
|
1620
|
+
[key in keyof AddressValues]?: string;
|
|
1621
|
+
};
|
|
1622
|
+
type AddressMessageParameters = {
|
|
1623
|
+
country: string;
|
|
1624
|
+
values?: AddressValues;
|
|
1625
|
+
saved_addresses?: SavedAddress[];
|
|
1626
|
+
validation_errors?: ValidationErrors;
|
|
1627
|
+
};
|
|
1628
|
+
type AddressMessageActionObject = {
|
|
1629
|
+
name: 'address_message';
|
|
1630
|
+
parameters: AddressMessageParameters;
|
|
1631
|
+
};
|
|
1632
|
+
type AddressMessageInteractiveObject = {
|
|
1633
|
+
type: InteractiveTypesEnum.AddressMessage;
|
|
1634
|
+
body: SimpleTextObject;
|
|
1635
|
+
footer?: SimpleTextObject;
|
|
1636
|
+
header?: HeaderObject;
|
|
1637
|
+
action: AddressMessageActionObject;
|
|
1638
|
+
};
|
|
1639
|
+
type FlowParameters = {
|
|
1640
|
+
flow_message_version: string;
|
|
1641
|
+
flow_id?: string;
|
|
1642
|
+
flow_name?: string;
|
|
1643
|
+
flow_cta: string;
|
|
1644
|
+
mode?: 'draft' | 'published';
|
|
1645
|
+
flow_token: string;
|
|
1646
|
+
flow_action: 'navigate' | 'data_exchange';
|
|
1647
|
+
flow_action_payload?: {
|
|
1648
|
+
screen?: string;
|
|
1649
|
+
data?: Record<string, string>;
|
|
1650
|
+
};
|
|
1651
|
+
};
|
|
1652
|
+
type FlowActionObject = {
|
|
1653
|
+
name: 'flow';
|
|
1654
|
+
parameters: FlowParameters;
|
|
1655
|
+
};
|
|
1656
|
+
type FlowInteractiveObject = {
|
|
1657
|
+
type: InteractiveTypesEnum.Flow;
|
|
1658
|
+
body: SimpleTextObject;
|
|
1659
|
+
footer?: SimpleTextObject;
|
|
1660
|
+
header?: HeaderObject;
|
|
1661
|
+
action: FlowActionObject;
|
|
1662
|
+
};
|
|
1663
|
+
type InteractiveObject = ButtonInteractiveObject | ListInteractiveObject | ProductInteractiveObject | ProductListInteractiveObject | CtaUrlInteractiveObject | LocationRequestInteractiveObject | AddressMessageInteractiveObject | FlowInteractiveObject;
|
|
1664
|
+
type InteractiveMessageRequestBody = MessageRequestBody<MessageTypesEnum.Interactive> & {
|
|
1665
|
+
[MessageTypesEnum.Interactive]: InteractiveObject;
|
|
1666
|
+
};
|
|
1667
|
+
type MetaStickerMediaObject = {
|
|
1668
|
+
id: string;
|
|
1669
|
+
link?: never;
|
|
1670
|
+
};
|
|
1671
|
+
type HostedStickerMediaObject = {
|
|
1672
|
+
id?: never;
|
|
1673
|
+
link: string;
|
|
1674
|
+
};
|
|
1675
|
+
type StickerMediaObject = MetaStickerMediaObject | HostedStickerMediaObject;
|
|
1676
|
+
type StickerMessageRequestBody = MessageRequestBody<MessageTypesEnum.Sticker> & {
|
|
1677
|
+
[MessageTypesEnum.Sticker]: [StickerMediaObject];
|
|
1678
|
+
};
|
|
1679
|
+
type ReActionObject = {
|
|
1680
|
+
message_id: string;
|
|
1681
|
+
emoji: string;
|
|
1682
|
+
};
|
|
1683
|
+
type ReactionMessageRequestBody = MessageRequestBody<MessageTypesEnum.Reaction> & ReActionObject;
|
|
1684
|
+
type TextObject = {
|
|
1685
|
+
body: string;
|
|
1686
|
+
preview_url?: boolean;
|
|
1687
|
+
};
|
|
1688
|
+
type TextMessageRequestBody = MessageRequestBody<MessageTypesEnum.Text> & {
|
|
1689
|
+
[MessageTypesEnum.Text]: [TextObject];
|
|
1690
|
+
};
|
|
1691
|
+
type MetaHostedVideoMediaObject = {
|
|
1692
|
+
id: string;
|
|
1693
|
+
link?: never;
|
|
1694
|
+
caption?: string;
|
|
1695
|
+
};
|
|
1696
|
+
type SelfHostedVideoMediaObject = {
|
|
1697
|
+
id?: never;
|
|
1698
|
+
link: string;
|
|
1699
|
+
caption?: string;
|
|
1700
|
+
};
|
|
1701
|
+
type VideoMediaObject = MetaHostedVideoMediaObject | SelfHostedVideoMediaObject;
|
|
1702
|
+
type VideoMessageRequestBody = MessageRequestBody<MessageTypesEnum.Video> & {
|
|
1703
|
+
[MessageTypesEnum.Video]: [VideoMediaObject];
|
|
1704
|
+
};
|
|
1705
|
+
type LanguageObject = {
|
|
1706
|
+
policy: 'deterministic';
|
|
1707
|
+
code: LanguagesEnum;
|
|
1708
|
+
};
|
|
1709
|
+
type ParametersObject<T extends ParametersTypesEnum> = {
|
|
1710
|
+
type: T;
|
|
1711
|
+
};
|
|
1712
|
+
type TextParametersObject = ParametersObject<ParametersTypesEnum.Text> & SimpleTextObject;
|
|
1713
|
+
type CurrencyObject = {
|
|
1714
|
+
fallback_value: string;
|
|
1715
|
+
code: CurrencyCodesEnum;
|
|
1716
|
+
amount_1000: number;
|
|
1717
|
+
};
|
|
1718
|
+
type CurrencyParametersObject = ParametersObject<ParametersTypesEnum.Currency> & {
|
|
1719
|
+
currency: CurrencyObject;
|
|
1720
|
+
};
|
|
1721
|
+
type DateTimeObject = {
|
|
1722
|
+
fallback_value: string;
|
|
1723
|
+
};
|
|
1724
|
+
type DateTimeParametersObject = ParametersObject<ParametersTypesEnum.Currency> & {
|
|
1725
|
+
date_time: DateTimeObject;
|
|
1726
|
+
};
|
|
1727
|
+
type DocumentParametersObject = ParametersObject<ParametersTypesEnum.Document> & DocumentMediaObject;
|
|
1728
|
+
type ImageParametersObject = ParametersObject<ParametersTypesEnum.Image> & ImageMediaObject;
|
|
1729
|
+
type VideoParametersObject = ParametersObject<ParametersTypesEnum.Video> & VideoMediaObject;
|
|
1730
|
+
type QuickReplyButtonParametersObject = {
|
|
1731
|
+
type: ParametersTypesEnum.Payload;
|
|
1732
|
+
payload: string;
|
|
1733
|
+
};
|
|
1734
|
+
type URLButtonParametersObject = SimpleTextObject & {
|
|
1735
|
+
type: ParametersTypesEnum.Text;
|
|
1736
|
+
};
|
|
1737
|
+
type ButtonParameterObject = QuickReplyButtonParametersObject | URLButtonParametersObject;
|
|
1738
|
+
type ComponentObject<T extends ComponentTypesEnum> = {
|
|
1739
|
+
type: T;
|
|
1740
|
+
parameters: (CurrencyParametersObject | DateTimeParametersObject | DocumentParametersObject | ImageParametersObject | TextParametersObject | VideoParametersObject)[];
|
|
1741
|
+
};
|
|
1742
|
+
type ButtonComponentObject = ComponentObject<ComponentTypesEnum.Button> & {
|
|
1743
|
+
parameters: ButtonParameterObject;
|
|
1744
|
+
sub_type: ButtonTypesEnum;
|
|
1745
|
+
index: ButtonPositionEnum;
|
|
1746
|
+
};
|
|
1747
|
+
type MessageTemplateObject<T extends ComponentTypesEnum> = {
|
|
1748
|
+
name: string;
|
|
1749
|
+
language: LanguageObject;
|
|
1750
|
+
components?: (ComponentObject<T> | ButtonComponentObject)[];
|
|
1751
|
+
};
|
|
1752
|
+
type MessageTemplateRequestBody<T extends ComponentTypesEnum> = MessageRequestBody<MessageTypesEnum.Template> & MessageTemplateObject<T>;
|
|
1753
|
+
type LocationObject = {
|
|
1754
|
+
longitude: number;
|
|
1755
|
+
latitude: number;
|
|
1756
|
+
name?: string;
|
|
1757
|
+
address?: string;
|
|
1758
|
+
};
|
|
1759
|
+
type LocationMessageRequestBody = MessageRequestBody<MessageTypesEnum.Location> & {
|
|
1760
|
+
[MessageTypesEnum.Location]: [LocationObject];
|
|
1761
|
+
};
|
|
1762
|
+
type MessagesResponse = GeneralMessageBody & {
|
|
1763
|
+
contacts: [
|
|
1764
|
+
{
|
|
1765
|
+
input: string;
|
|
1766
|
+
wa_id: string;
|
|
1767
|
+
}
|
|
1768
|
+
];
|
|
1769
|
+
messages: [
|
|
1770
|
+
{
|
|
1771
|
+
id: string;
|
|
1772
|
+
}
|
|
1773
|
+
];
|
|
1774
|
+
};
|
|
1775
|
+
interface MessageRequestParams<T> {
|
|
1776
|
+
body: T;
|
|
1777
|
+
to: string;
|
|
1778
|
+
replyMessageId?: string;
|
|
1779
|
+
}
|
|
1780
|
+
interface TextMessageParams extends MessageRequestParams<TextObject | string> {
|
|
1781
|
+
previewUrl?: boolean;
|
|
1782
|
+
}
|
|
1783
|
+
interface ReactionParams {
|
|
1784
|
+
messageId: string;
|
|
1785
|
+
emoji: string;
|
|
1786
|
+
to: string;
|
|
1787
|
+
}
|
|
1788
|
+
interface StatusParams {
|
|
1789
|
+
status: string;
|
|
1790
|
+
messageId: string;
|
|
1791
|
+
typingIndicator?: {
|
|
1792
|
+
type: string;
|
|
1793
|
+
};
|
|
1794
|
+
}
|
|
1795
|
+
declare class MessagesClass extends BaseClass {
|
|
1796
|
+
/**
|
|
1797
|
+
* Sends an audio message via WhatsApp
|
|
1798
|
+
* @param params The audio message parameter object
|
|
1799
|
+
* @returns Promise with the message response
|
|
1800
|
+
*/
|
|
1801
|
+
audio(params: MessageRequestParams<AudioMediaObject>): Promise<MessagesResponse>;
|
|
1802
|
+
/**
|
|
1803
|
+
* Sends a contact card via WhatsApp
|
|
1804
|
+
* @param params The contact message parameter object
|
|
1805
|
+
* @returns Promise with the message response
|
|
1806
|
+
*/
|
|
1807
|
+
contacts(params: MessageRequestParams<[ContactObject]>): Promise<MessagesResponse>;
|
|
1808
|
+
/**
|
|
1809
|
+
* Sends a document via WhatsApp
|
|
1810
|
+
* @param params The document message parameter object
|
|
1811
|
+
* @returns Promise with the message response
|
|
1812
|
+
*/
|
|
1813
|
+
document(params: MessageRequestParams<DocumentMediaObject>): Promise<MessagesResponse>;
|
|
1814
|
+
/**
|
|
1815
|
+
* Sends an image via WhatsApp
|
|
1816
|
+
* @param params The image message parameter object
|
|
1817
|
+
* @returns Promise with the message response
|
|
1818
|
+
*/
|
|
1819
|
+
image(params: MessageRequestParams<ImageMediaObject>): Promise<MessagesResponse>;
|
|
1820
|
+
/**
|
|
1821
|
+
* Sends an interactive message via WhatsApp
|
|
1822
|
+
* @param params The interactive message parameter object
|
|
1823
|
+
* @returns Promise with the message response
|
|
1824
|
+
*/
|
|
1825
|
+
interactive(params: MessageRequestParams<InteractiveObject>): Promise<MessagesResponse>;
|
|
1826
|
+
/**
|
|
1827
|
+
* Sends a location via WhatsApp
|
|
1828
|
+
* @param params The location message parameter object
|
|
1829
|
+
* @returns Promise with the message response
|
|
1830
|
+
*/
|
|
1831
|
+
location(params: MessageRequestParams<LocationObject>): Promise<MessagesResponse>;
|
|
1832
|
+
/**
|
|
1833
|
+
* Updates message status (used for read receipts and typing indicators)
|
|
1834
|
+
* @param params The status update parameter object
|
|
1835
|
+
* @returns Promise with the response
|
|
1836
|
+
*/
|
|
1837
|
+
status(params: StatusParams): Promise<MessagesResponse>;
|
|
1838
|
+
/**
|
|
1839
|
+
* Sends a sticker via WhatsApp
|
|
1840
|
+
* @param params The sticker message parameter object
|
|
1841
|
+
* @returns Promise with the message response
|
|
1842
|
+
*/
|
|
1843
|
+
sticker(params: MessageRequestParams<StickerMediaObject>): Promise<MessagesResponse>;
|
|
1844
|
+
/**
|
|
1845
|
+
* Sends a template message via WhatsApp
|
|
1846
|
+
* @param params The template message parameter object
|
|
1847
|
+
* @returns Promise with the message response
|
|
1848
|
+
*/
|
|
1849
|
+
template(params: MessageRequestParams<MessageTemplateObject<ComponentTypesEnum>>): Promise<MessagesResponse>;
|
|
1850
|
+
/**
|
|
1851
|
+
* Sends a text message via WhatsApp
|
|
1852
|
+
* @param params The text message parameter object
|
|
1853
|
+
* @returns Promise with the message response
|
|
1854
|
+
*/
|
|
1855
|
+
text(params: TextMessageParams): Promise<MessagesResponse>;
|
|
1856
|
+
/**
|
|
1857
|
+
* Sends a video via WhatsApp
|
|
1858
|
+
* @param params The video message parameter object
|
|
1859
|
+
* @returns Promise with the message response
|
|
1860
|
+
*/
|
|
1861
|
+
video(params: MessageRequestParams<VideoMediaObject>): Promise<MessagesResponse>;
|
|
1862
|
+
/**
|
|
1863
|
+
* Marks a message as read in WhatsApp
|
|
1864
|
+
* @param params The parameter object to mark message as read
|
|
1865
|
+
* @returns Promise with the response
|
|
1866
|
+
*/
|
|
1867
|
+
markAsRead(params: {
|
|
1868
|
+
messageId: string;
|
|
1869
|
+
}): Promise<MessagesResponse>;
|
|
1870
|
+
/**
|
|
1871
|
+
* Marks a message as read and shows a typing indicator in WhatsApp
|
|
1872
|
+
* @param params The typing indicator parameter object
|
|
1873
|
+
* @returns Promise with the response
|
|
1874
|
+
*/
|
|
1875
|
+
showTypingIndicator(params: {
|
|
1876
|
+
messageId: string;
|
|
1877
|
+
}): Promise<MessagesResponse>;
|
|
1878
|
+
/**
|
|
1879
|
+
* Sends an interactive list message
|
|
1880
|
+
* @param params The list message parameter object
|
|
1881
|
+
* @returns Promise with the response
|
|
1882
|
+
*/
|
|
1883
|
+
interactiveList(params: MessageRequestParams<InteractiveObject & {
|
|
1884
|
+
type: InteractiveTypesEnum.List;
|
|
1885
|
+
}>): Promise<MessagesResponse>;
|
|
1886
|
+
/**
|
|
1887
|
+
* Sends an interactive CTA URL message
|
|
1888
|
+
* @param params The CTA URL message parameter object
|
|
1889
|
+
* @returns Promise with the response
|
|
1890
|
+
*/
|
|
1891
|
+
interactiveCtaUrl(params: MessageRequestParams<InteractiveObject & {
|
|
1892
|
+
type: InteractiveTypesEnum.CtaUrl;
|
|
1893
|
+
}>): Promise<MessagesResponse>;
|
|
1894
|
+
/**
|
|
1895
|
+
* Sends a location request message
|
|
1896
|
+
* @param params The location request message parameter object
|
|
1897
|
+
* @returns Promise with the response
|
|
1898
|
+
*/
|
|
1899
|
+
interactiveLocationRequest(params: MessageRequestParams<InteractiveObject & {
|
|
1900
|
+
type: InteractiveTypesEnum.LocationRequest;
|
|
1901
|
+
}>): Promise<MessagesResponse>;
|
|
1902
|
+
/**
|
|
1903
|
+
* Sends an address message to request shipping address from the user
|
|
1904
|
+
* Note: This feature is only available for businesses based in India and their India customers
|
|
1905
|
+
* @param params The address message parameter object
|
|
1906
|
+
* @returns Promise with the response
|
|
1907
|
+
*/
|
|
1908
|
+
interactiveAddressMessage(params: MessageRequestParams<InteractiveObject & {
|
|
1909
|
+
type: InteractiveTypesEnum.AddressMessage;
|
|
1910
|
+
}>): Promise<MessagesResponse>;
|
|
1911
|
+
/**
|
|
1912
|
+
* Sends an interactive reply buttons message
|
|
1913
|
+
* @param params The reply buttons message parameter object
|
|
1914
|
+
* @returns Promise with the response
|
|
1915
|
+
*/
|
|
1916
|
+
interactiveReplyButtons(params: MessageRequestParams<InteractiveObject & {
|
|
1917
|
+
type: InteractiveTypesEnum.Button;
|
|
1918
|
+
}>): Promise<MessagesResponse>;
|
|
1919
|
+
/**
|
|
1920
|
+
* Sends a reaction to a message (emoji response)
|
|
1921
|
+
* @param params The reaction message parameter object
|
|
1922
|
+
* @returns Promise with the response
|
|
1923
|
+
*/
|
|
1924
|
+
reaction(params: ReactionParams): Promise<MessagesResponse>;
|
|
1925
|
+
/**
|
|
1926
|
+
* Sends an interactive Flow message
|
|
1927
|
+
* @param params The Flow message parameter object
|
|
1928
|
+
* @returns Promise with the response
|
|
1929
|
+
*/
|
|
1930
|
+
interactiveFlow(params: MessageRequestParams<InteractiveObject & {
|
|
1931
|
+
type: InteractiveTypesEnum.Flow;
|
|
1932
|
+
}>): Promise<MessagesResponse>;
|
|
1933
|
+
}
|
|
1934
|
+
|
|
1935
|
+
type QualityRating = 'GREEN' | 'YELLOW' | 'RED' | 'NA';
|
|
1936
|
+
type AccountMode = 'LIVE' | 'SANDBOX';
|
|
1937
|
+
type CodeVerificationStatus = 'NOT_VERIFIED' | 'VERIFIED' | 'EXPIRED' | 'PENDING' | 'DELETED' | 'MIGRATED' | 'BANNED' | 'RESTRICTED' | 'RATE_LIMITED' | 'FLAGGED' | 'CONNECTED' | 'DISCONNECTED' | 'UNKNOWN' | 'UNVERIFIED';
|
|
1938
|
+
type MessagingLimitTier = 'TIER_50' | 'TIER_250' | 'TIER_1K' | 'TIER_10K' | 'TIER_100K' | 'TIER_UNLIMITED';
|
|
1939
|
+
type PlatformType = 'CLOUD_API' | 'ON_PREMISE' | 'NOT_APPLICABLE';
|
|
1940
|
+
type ThroughputLevel = 'STANDARD' | 'HIGH' | 'NOT_APPLICABLE';
|
|
1941
|
+
type HealthStatusEntity = {
|
|
1942
|
+
entity_type: string;
|
|
1943
|
+
id: string;
|
|
1944
|
+
can_send_message: string;
|
|
1945
|
+
additional_info?: string[];
|
|
1946
|
+
errors?: Array<{
|
|
1947
|
+
error_code: number;
|
|
1948
|
+
error_description: string;
|
|
1949
|
+
possible_solution: string;
|
|
1950
|
+
}>;
|
|
1951
|
+
};
|
|
1952
|
+
type HealthStatus = {
|
|
1953
|
+
can_send_message: string;
|
|
1954
|
+
entities: HealthStatusEntity[];
|
|
1955
|
+
};
|
|
1956
|
+
type QualityScore = {
|
|
1957
|
+
score: QualityRating;
|
|
1958
|
+
};
|
|
1959
|
+
type Throughput = {
|
|
1960
|
+
level: ThroughputLevel;
|
|
1961
|
+
};
|
|
1962
|
+
type PhoneNumberResponse = {
|
|
1963
|
+
display_phone_number: string;
|
|
1964
|
+
id: string;
|
|
1965
|
+
quality_rating: QualityRating;
|
|
1966
|
+
verified_name: string;
|
|
1967
|
+
account_mode?: AccountMode;
|
|
1968
|
+
certificate?: string;
|
|
1969
|
+
code_verification_status?: CodeVerificationStatus;
|
|
1970
|
+
conversational_automation?: Record<string, unknown>;
|
|
1971
|
+
eligibility_for_api_business_global_search?: string;
|
|
1972
|
+
health_status?: HealthStatus;
|
|
1973
|
+
is_official_business_account?: boolean;
|
|
1974
|
+
is_on_biz_app?: boolean;
|
|
1975
|
+
is_pin_enabled?: boolean;
|
|
1976
|
+
is_preverified_number?: boolean;
|
|
1977
|
+
last_onboarded_time?: string;
|
|
1978
|
+
messaging_limit_tier?: MessagingLimitTier;
|
|
1979
|
+
name_status?: string;
|
|
1980
|
+
new_certificate?: string;
|
|
1981
|
+
new_name_status?: string;
|
|
1982
|
+
platform_type?: PlatformType;
|
|
1983
|
+
quality_score?: QualityScore;
|
|
1984
|
+
search_visibility?: string;
|
|
1985
|
+
status?: CodeVerificationStatus;
|
|
1986
|
+
throughput?: Throughput;
|
|
1987
|
+
};
|
|
1988
|
+
type Cursors = {
|
|
1989
|
+
before: string;
|
|
1990
|
+
after: string;
|
|
1991
|
+
};
|
|
1992
|
+
type PhoneNumbersResponse = {
|
|
1993
|
+
data: PhoneNumberResponse[];
|
|
1994
|
+
paging: Paging;
|
|
1995
|
+
};
|
|
1996
|
+
type RequestVerificationCodeRequest = {
|
|
1997
|
+
code_method: 'SMS' | 'VOICE';
|
|
1998
|
+
language: string;
|
|
1999
|
+
};
|
|
2000
|
+
type VerifyCodeRequest = {
|
|
2001
|
+
code: string;
|
|
2002
|
+
};
|
|
2003
|
+
type TwoStepVerificationParams = {
|
|
2004
|
+
pin: string;
|
|
2005
|
+
};
|
|
2006
|
+
declare class PhoneNumberClass {
|
|
2007
|
+
getPhoneNumberById(fields?: string): Promise<PhoneNumberResponse>;
|
|
2008
|
+
getPhoneNumbers(): Promise<PhoneNumbersResponse>;
|
|
2009
|
+
requestVerificationCode(params: RequestVerificationCodeRequest): Promise<ResponseSuccess>;
|
|
2010
|
+
verifyCode(params: VerifyCodeRequest): Promise<ResponseSuccess>;
|
|
2011
|
+
}
|
|
2012
|
+
|
|
2013
|
+
type QrCodeResponse = {
|
|
2014
|
+
code: string;
|
|
2015
|
+
prefilled_message: string;
|
|
2016
|
+
deep_link_url: string;
|
|
2017
|
+
qr_image_url?: string;
|
|
2018
|
+
};
|
|
2019
|
+
type QrCodesResponse = ResponseData<QrCodeResponse[]>;
|
|
2020
|
+
type CreateQrCodeRequest = {
|
|
2021
|
+
prefilled_message: string;
|
|
2022
|
+
generate_qr_image?: 'SVG' | 'PNG';
|
|
2023
|
+
};
|
|
2024
|
+
type UpdateQrCodeRequest = {
|
|
2025
|
+
code: string;
|
|
2026
|
+
prefilled_message: string;
|
|
2027
|
+
};
|
|
2028
|
+
interface QrCodeClass {
|
|
2029
|
+
createQrCode(request: CreateQrCodeRequest): Promise<QrCodeResponse>;
|
|
2030
|
+
getQrCodes(): Promise<QrCodesResponse>;
|
|
2031
|
+
getQrCode(qrCodeId: string): Promise<QrCodeResponse>;
|
|
2032
|
+
updateQrCode(request: UpdateQrCodeRequest): Promise<QrCodeResponse>;
|
|
2033
|
+
deleteQrCode(qrCodeId: string): Promise<ResponseSuccess>;
|
|
2034
|
+
}
|
|
2035
|
+
|
|
2036
|
+
type RegistrationRequest = {
|
|
2037
|
+
messaging_product: 'whatsapp';
|
|
2038
|
+
pin: string;
|
|
2039
|
+
data_localization_region?: DataLocalizationRegionEnum;
|
|
2040
|
+
};
|
|
2041
|
+
interface RegistrationClass {
|
|
2042
|
+
register(pin: string, dataLocalizationRegion?: DataLocalizationRegionEnum): Promise<ResponseSuccess>;
|
|
2043
|
+
deregister(): Promise<ResponseSuccess>;
|
|
2044
|
+
}
|
|
2045
|
+
|
|
2046
|
+
type TemplateFormat = 'TEXT' | 'IMAGE' | 'VIDEO' | 'DOCUMENT' | 'LOCATION';
|
|
2047
|
+
type PhoneNumberButton = {
|
|
2048
|
+
type: 'PHONE_NUMBER';
|
|
2049
|
+
text: string;
|
|
2050
|
+
phone_number: string;
|
|
2051
|
+
};
|
|
2052
|
+
type URLButton = {
|
|
2053
|
+
type: 'URL';
|
|
2054
|
+
text: string;
|
|
2055
|
+
url: string;
|
|
2056
|
+
example?: string[];
|
|
2057
|
+
};
|
|
2058
|
+
type QuickReplyButton = {
|
|
2059
|
+
type: 'QUICK_REPLY';
|
|
2060
|
+
text: string;
|
|
2061
|
+
};
|
|
2062
|
+
type CopyCodeButton = {
|
|
2063
|
+
type: 'COPY_CODE';
|
|
2064
|
+
example: string;
|
|
2065
|
+
};
|
|
2066
|
+
type FlowButton = {
|
|
2067
|
+
type: 'FLOW';
|
|
2068
|
+
text: string;
|
|
2069
|
+
flow_id?: string;
|
|
2070
|
+
flow_name?: string;
|
|
2071
|
+
flow_json?: string;
|
|
2072
|
+
flow_action?: 'navigate' | 'data_exchange';
|
|
2073
|
+
navigate_screen?: string;
|
|
2074
|
+
};
|
|
2075
|
+
type MPMButton = {
|
|
2076
|
+
type: 'MPM';
|
|
2077
|
+
};
|
|
2078
|
+
type OTPButton = {
|
|
2079
|
+
type: 'OTP';
|
|
2080
|
+
};
|
|
2081
|
+
type SPMButton = {
|
|
2082
|
+
type: 'SPM';
|
|
2083
|
+
};
|
|
2084
|
+
type TemplateButton = PhoneNumberButton | URLButton | QuickReplyButton | CopyCodeButton | FlowButton | MPMButton | OTPButton | SPMButton;
|
|
2085
|
+
type TemplateHeaderExample = {
|
|
2086
|
+
header_text?: string[];
|
|
2087
|
+
header_text_named_params?: Array<{
|
|
2088
|
+
param_name: string;
|
|
2089
|
+
example: string;
|
|
2090
|
+
}>;
|
|
2091
|
+
header_handle?: string[];
|
|
2092
|
+
};
|
|
2093
|
+
type TemplateHeader = {
|
|
2094
|
+
type: 'HEADER';
|
|
2095
|
+
format: TemplateFormat;
|
|
2096
|
+
text?: string;
|
|
2097
|
+
example?: TemplateHeaderExample;
|
|
2098
|
+
};
|
|
2099
|
+
type TemplateBody = {
|
|
2100
|
+
type: 'BODY';
|
|
2101
|
+
text: string;
|
|
2102
|
+
example?: {
|
|
2103
|
+
body_text?: Array<Array<string>>;
|
|
2104
|
+
body_text_named_params?: Array<{
|
|
2105
|
+
param_name: string;
|
|
2106
|
+
example: string;
|
|
2107
|
+
}>;
|
|
2108
|
+
};
|
|
2109
|
+
};
|
|
2110
|
+
type TemplateFooter = {
|
|
2111
|
+
type: 'FOOTER';
|
|
2112
|
+
text: string;
|
|
2113
|
+
};
|
|
2114
|
+
type ComponentTypes = TemplateHeader | TemplateBody | TemplateFooter | TemplateButton;
|
|
2115
|
+
type TemplateRequestBody = GeneralRequestBody & {
|
|
2116
|
+
name: string;
|
|
2117
|
+
language: LanguagesEnum;
|
|
2118
|
+
category?: CategoryEnum;
|
|
2119
|
+
components?: ComponentTypes[];
|
|
2120
|
+
};
|
|
2121
|
+
type TemplateResponse = {
|
|
2122
|
+
id: string;
|
|
2123
|
+
status: string;
|
|
2124
|
+
language: LanguagesEnum;
|
|
2125
|
+
category: CategoryEnum;
|
|
2126
|
+
name: string;
|
|
2127
|
+
components: ComponentTypes[];
|
|
2128
|
+
};
|
|
2129
|
+
type TemplateGetParams = {
|
|
2130
|
+
limit?: number;
|
|
2131
|
+
name?: string;
|
|
2132
|
+
language?: LanguagesEnum;
|
|
2133
|
+
category?: CategoryEnum;
|
|
2134
|
+
status?: TemplateStatusEnum;
|
|
2135
|
+
};
|
|
2136
|
+
type TemplateDeleteParams = {
|
|
2137
|
+
hsm_id: string;
|
|
2138
|
+
name: string;
|
|
2139
|
+
};
|
|
2140
|
+
declare class TemplateClass {
|
|
2141
|
+
getTemplate(templateId: string): Promise<TemplateResponse>;
|
|
2142
|
+
updateTemplate(templateId: string, template: Partial<TemplateRequestBody>): Promise<ResponseSuccess>;
|
|
2143
|
+
getTemplates(params: TemplateGetParams): Promise<ResponsePagination<TemplateResponse>>;
|
|
2144
|
+
createTemplate(template: TemplateRequestBody): Promise<TemplateResponse>;
|
|
2145
|
+
deleteTemplate(params: TemplateDeleteParams): Promise<ResponseSuccess>;
|
|
2146
|
+
}
|
|
2147
|
+
|
|
2148
|
+
type TwoStepVerificationRequest = {
|
|
2149
|
+
pin: string;
|
|
2150
|
+
};
|
|
2151
|
+
interface TwoStepVerificationClass {
|
|
2152
|
+
setTwoStepVerificationCode(pin: string): Promise<ResponseSuccess>;
|
|
2153
|
+
}
|
|
2154
|
+
|
|
2155
|
+
type WabaSubscription = {
|
|
2156
|
+
whatsapp_business_api_data: {
|
|
2157
|
+
id: string;
|
|
2158
|
+
link: string;
|
|
2159
|
+
name: string;
|
|
2160
|
+
category: string;
|
|
2161
|
+
};
|
|
2162
|
+
override_callback_uri?: string;
|
|
2163
|
+
};
|
|
2164
|
+
interface UpdateWabaSubscription {
|
|
2165
|
+
override_callback_uri: string;
|
|
2166
|
+
verify_token: string;
|
|
2167
|
+
}
|
|
2168
|
+
interface WabaSubscriptions {
|
|
2169
|
+
data: Array<WabaSubscription>;
|
|
2170
|
+
}
|
|
2171
|
+
interface WABAClass {
|
|
2172
|
+
getWabaAccount(fields?: WabaAccountFieldsParam): Promise<WabaAccount>;
|
|
2173
|
+
getAllWabaSubscriptions(): Promise<WabaSubscriptions>;
|
|
2174
|
+
updateWabaSubscription(params: UpdateWabaSubscription): Promise<ResponseSuccess>;
|
|
2175
|
+
unsubscribeFromWaba(): Promise<ResponseSuccess>;
|
|
2176
|
+
}
|
|
2177
|
+
declare enum WabaAccountReviewStatus {
|
|
2178
|
+
Approved = "APPROVED",
|
|
2179
|
+
Active = "ACTIVE",
|
|
2180
|
+
Inactive = "INACTIVE",
|
|
2181
|
+
Disabled = "DISABLED"
|
|
2182
|
+
}
|
|
2183
|
+
declare enum WabaHealthStatusCanSendMessage {
|
|
2184
|
+
Blocked = "BLOCKED",
|
|
2185
|
+
Limited = "LIMITED",
|
|
2186
|
+
Available = "AVAILABLE"
|
|
2187
|
+
}
|
|
2188
|
+
declare enum WabaAccountStatus {
|
|
2189
|
+
Approved = "APPROVED",
|
|
2190
|
+
Active = "ACTIVE",
|
|
2191
|
+
Inactive = "INACTIVE",
|
|
2192
|
+
Disabled = "DISABLED"
|
|
2193
|
+
}
|
|
2194
|
+
declare enum WabaBusinessVerificationStatus {
|
|
2195
|
+
Verified = "verified",
|
|
2196
|
+
PendingSubmission = "pending_submission",
|
|
2197
|
+
Unverified = "unverified",
|
|
2198
|
+
Rejected = "rejected"
|
|
2199
|
+
}
|
|
2200
|
+
interface WabaHealthStatusError {
|
|
2201
|
+
error_code?: number;
|
|
2202
|
+
error_description?: string;
|
|
2203
|
+
possible_solution?: string;
|
|
2204
|
+
}
|
|
2205
|
+
interface WabaHealthStatusEntity {
|
|
2206
|
+
entity_type?: string;
|
|
2207
|
+
id?: string;
|
|
2208
|
+
can_send_message?: string;
|
|
2209
|
+
errors?: WabaHealthStatusError[];
|
|
2210
|
+
}
|
|
2211
|
+
interface WabaHealthStatus {
|
|
2212
|
+
can_send_message?: WabaHealthStatusCanSendMessage;
|
|
2213
|
+
entities?: WabaHealthStatusEntity[];
|
|
2214
|
+
}
|
|
2215
|
+
interface WabaAccount {
|
|
2216
|
+
account_review_status?: WabaAccountReviewStatus;
|
|
2217
|
+
id?: string;
|
|
2218
|
+
health_status?: WabaHealthStatus;
|
|
2219
|
+
status?: WabaAccountStatus;
|
|
2220
|
+
business_verification_status?: WabaBusinessVerificationStatus;
|
|
2221
|
+
message_template_namespace?: string;
|
|
2222
|
+
name?: string;
|
|
2223
|
+
ownership_type?: string;
|
|
2224
|
+
currency?: string;
|
|
2225
|
+
}
|
|
2226
|
+
type WabaAccountFields = 'id' | 'name' | 'account_review_status' | 'auth_international_rate_eligibility' | 'business_verification_status' | 'country' | 'currency' | 'health_status' | 'status' | 'ownership_type' | 'message_template_namespace';
|
|
2227
|
+
type WabaAccountFieldsParam = WabaAccountFields[];
|
|
2228
|
+
|
|
2229
|
+
export { FlowCategoryEnum as $, ImageMediaTypesEnum as A, type BusinessProfileClass as B, CategoryEnum as C, DocumentMediaTypesEnum as D, type EncryptionClass as E, type FlowClass as F, AudioMediaTypesEnum as G, HttpMethodsEnum as H, InteractiveTypesEnum as I, WebhookTypesEnum as J, SystemChangeTypesEnum as K, ReferralSourceTypesEnum as L, MessagesClass as M, RequestCodeMethodsEnum as N, LanguagesEnum as O, PhoneNumberClass as P, type QrCodeClass as Q, type RegistrationClass as R, SDKEnums as S, TemplateClass as T, type UpdateBusinessProfileRequest as U, VideoMediaTypesEnum as V, type WABAClass as W, CurrencyCodesEnum as X, DataLocalizationRegionEnum as Y, BusinessVerticalEnum as Z, FlowStatusEnum as _, type TwoStepVerificationClass as a, type AccountMode as a$, FlowActionEnum as a0, type FlowValidationErrorPointer as a1, type FlowValidationError as a2, type Flow as a3, type PaginationCursors as a4, type Pagination as a5, type FlowsListResponse as a6, type FlowAsset as a7, type FlowAssetsResponse as a8, type FlowPreview as a9, type AudioMediaObject as aA, type AudioMessageRequestBody as aB, type ContactObject as aC, type ContactsMessageRequestBody as aD, type DocumentMediaObject as aE, type DocumentMessageRequestBody as aF, type ImageMediaObject as aG, type ImageMessageRequestBody as aH, type InteractiveObject as aI, type InteractiveMessageRequestBody as aJ, type StickerMediaObject as aK, type StickerMessageRequestBody as aL, type ReactionMessageRequestBody as aM, type TextObject as aN, type TextMessageRequestBody as aO, type VideoMediaObject as aP, type VideoMessageRequestBody as aQ, type MessageTemplateObject as aR, type MessageTemplateRequestBody as aS, type LocationObject as aT, type LocationMessageRequestBody as aU, type MessagesResponse as aV, type MessageRequestParams as aW, type TextMessageParams as aX, type ReactionParams as aY, type StatusParams as aZ, type QualityRating as a_, type FlowPreviewResponse as aa, type FlowMigrationResult as ab, type FlowMigrationFailure as ac, type CreateFlowResponse as ad, type UpdateFlowResponse as ae, type FlowMigrationResponse as af, type ValidateFlowJsonResponse as ag, type FlowEncryptedRequestPayload as ah, type FlowDecryptedRequestResponse as ai, type FlowHttpRequest as aj, type FlowHealthCheckRequest as ak, type FlowHealthCheckResponse as al, type FlowDataExchangeRequest as am, type FlowDataExchangeResponse as an, type FlowSuccessScreenResponse as ao, type FlowErrorNotificationRequest as ap, type FlowErrorNotificationResponse as aq, type FlowEndpointResponse as ar, type MediaResponse as as, type MediasResponse as at, type UploadMediaResponse as au, type GeneralMessageBody as av, type StatusObject as aw, type TypingIndicatorObject as ax, type StatusRequestBody as ay, type MessageRequestBody as az, type MediaClass as b, type CodeVerificationStatus as b0, type MessagingLimitTier as b1, type PlatformType as b2, type ThroughputLevel as b3, type HealthStatusEntity as b4, type HealthStatus as b5, type QualityScore as b6, type Throughput as b7, type PhoneNumberResponse as b8, type Cursors as b9, type TemplateHeaderExample as bA, type TemplateHeader as bB, type TemplateBody as bC, type TemplateFooter as bD, type ComponentTypes as bE, type TemplateRequestBody as bF, type TemplateResponse as bG, type TemplateGetParams as bH, type TemplateDeleteParams as bI, type TwoStepVerificationRequest as bJ, type WabaSubscription as bK, type UpdateWabaSubscription as bL, type WabaSubscriptions as bM, WabaAccountReviewStatus as bN, WabaHealthStatusCanSendMessage as bO, WabaAccountStatus as bP, WabaBusinessVerificationStatus as bQ, type WabaHealthStatusError as bR, type WabaHealthStatusEntity as bS, type WabaHealthStatus as bT, type WabaAccount as bU, type WabaAccountFields as bV, type WabaAccountFieldsParam as bW, type PhoneNumbersResponse as ba, type RequestVerificationCodeRequest as bb, type VerifyCodeRequest as bc, type TwoStepVerificationParams as bd, type QrCodeResponse as be, type QrCodesResponse as bf, type CreateQrCodeRequest as bg, type UpdateQrCodeRequest as bh, type RegistrationRequest as bi, type GeneralRequestBody as bj, type GeneralHeaderInterface as bk, type RequesterResponseInterface as bl, type ResponseSuccess as bm, type ResponseData as bn, type ResponsePagination as bo, type Paging as bp, type TemplateFormat as bq, type PhoneNumberButton as br, type URLButton as bs, type QuickReplyButton as bt, type CopyCodeButton as bu, type FlowButton as bv, type MPMButton as bw, type OTPButton as bx, type SPMButton as by, type TemplateButton as bz, RequesterClass as c, type WabaConfigType as d, MessageTypesEnum as e, type FlowEndpointRequest as f, FlowTypeEnum as g, BaseClass as h, type BusinessProfileField as i, type BusinessProfileFieldsParam as j, type BusinessProfileData as k, type BusinessProfileResponse as l, type UploadSession as m, type UploadSessionResponse as n, type UploadBusinessProfileResponse as o, type UploadHandle as p, type EncryptionPublicKeyResponse as q, TemplateStatusEnum as r, ParametersTypesEnum as s, ButtonTypesEnum as t, ButtonPositionEnum as u, ComponentTypesEnum as v, WabaConfigEnum as w, ConversationTypesEnum as x, StatusEnum as y, StickerMediaTypesEnum as z };
|