integrate-sdk 0.9.25 → 0.9.26-dev.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/adapters/index.js +28 -10
- package/dist/adapters/solid-start.js +28 -10
- package/dist/adapters/svelte-kit.js +28 -10
- package/dist/ai/anthropic.js +11 -1
- package/dist/ai/google.js +11 -1
- package/dist/ai/index.js +11 -1
- package/dist/ai/openai.js +11 -1
- package/dist/ai/vercel-ai.js +11 -1
- package/dist/code-mode/executor.js +5 -1
- package/dist/code-mode/index.js +11 -1
- package/dist/code-mode/runtime-stub.d.ts +1 -1
- package/dist/code-mode/runtime-stub.d.ts.map +1 -1
- package/dist/code-mode/runtime-stub.js +5 -1
- package/dist/code-mode/tool-builder.d.ts.map +1 -1
- package/dist/code-mode/tool-builder.js +11 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +197 -10
- package/dist/server.js +292 -64
- package/dist/src/code-mode/runtime-stub.d.ts +1 -1
- package/dist/src/code-mode/runtime-stub.d.ts.map +1 -1
- package/dist/src/code-mode/tool-builder.d.ts.map +1 -1
- package/dist/src/integrations/excel-client.d.ts +284 -0
- package/dist/src/integrations/excel-client.d.ts.map +1 -0
- package/dist/src/integrations/excel.d.ts +22 -0
- package/dist/src/integrations/excel.d.ts.map +1 -0
- package/dist/src/integrations/gdrive-client.d.ts +264 -0
- package/dist/src/integrations/gdrive-client.d.ts.map +1 -0
- package/dist/src/integrations/gdrive.d.ts +22 -0
- package/dist/src/integrations/gdrive.d.ts.map +1 -0
- package/dist/src/integrations/onedrive-client.d.ts +47 -250
- package/dist/src/integrations/onedrive-client.d.ts.map +1 -1
- package/dist/src/integrations/onedrive.d.ts +1 -1
- package/dist/src/integrations/onedrive.d.ts.map +1 -1
- package/dist/src/integrations/powerpoint-client.d.ts +99 -0
- package/dist/src/integrations/powerpoint-client.d.ts.map +1 -0
- package/dist/src/integrations/powerpoint.d.ts +22 -0
- package/dist/src/integrations/powerpoint.d.ts.map +1 -0
- package/dist/src/integrations/whatsapp-client.d.ts +406 -211
- package/dist/src/integrations/whatsapp-client.d.ts.map +1 -1
- package/dist/src/integrations/whatsapp.d.ts +1 -1
- package/dist/src/integrations/whatsapp.d.ts.map +1 -1
- package/dist/src/integrations/word-client.d.ts +99 -0
- package/dist/src/integrations/word-client.d.ts.map +1 -0
- package/dist/src/integrations/word.d.ts +22 -0
- package/dist/src/integrations/word.d.ts.map +1 -0
- package/dist/src/integrations/youtube-client.d.ts +292 -283
- package/dist/src/integrations/youtube-client.d.ts.map +1 -1
- package/dist/src/integrations/youtube.d.ts +2 -2
- package/dist/src/integrations/youtube.d.ts.map +1 -1
- package/dist/src/server.d.ts +4 -0
- package/dist/src/server.d.ts.map +1 -1
- package/index.ts +8 -0
- package/package.json +1 -1
|
@@ -1,320 +1,515 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* WhatsApp Business Integration Client Types
|
|
3
|
-
* Fully typed interface for WhatsApp Business
|
|
3
|
+
* Fully typed interface for WhatsApp Business Cloud API methods
|
|
4
4
|
*/
|
|
5
5
|
import type { MCPToolCallResponse } from "../protocol/messages.js";
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
*/
|
|
9
|
-
export interface WhatsAppMessage {
|
|
10
|
-
id: string;
|
|
11
|
-
from: string;
|
|
12
|
-
to: string;
|
|
13
|
-
timestamp: string;
|
|
14
|
-
type: "text" | "image" | "video" | "audio" | "document" | "template";
|
|
15
|
-
text?: {
|
|
16
|
-
body: string;
|
|
17
|
-
};
|
|
18
|
-
image?: {
|
|
19
|
-
id: string;
|
|
20
|
-
mime_type: string;
|
|
21
|
-
sha256: string;
|
|
22
|
-
};
|
|
23
|
-
video?: {
|
|
24
|
-
id: string;
|
|
25
|
-
mime_type: string;
|
|
26
|
-
sha256: string;
|
|
27
|
-
};
|
|
28
|
-
audio?: {
|
|
29
|
-
id: string;
|
|
30
|
-
mime_type: string;
|
|
31
|
-
sha256: string;
|
|
32
|
-
};
|
|
33
|
-
document?: {
|
|
6
|
+
export interface WhatsAppSendResult {
|
|
7
|
+
messages: Array<{
|
|
34
8
|
id: string;
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
9
|
+
}>;
|
|
10
|
+
contacts: Array<{
|
|
11
|
+
input: string;
|
|
12
|
+
wa_id: string;
|
|
13
|
+
}>;
|
|
40
14
|
}
|
|
41
|
-
/**
|
|
42
|
-
* WhatsApp Message Template
|
|
43
|
-
*/
|
|
44
15
|
export interface WhatsAppTemplate {
|
|
45
16
|
id: string;
|
|
46
17
|
name: string;
|
|
18
|
+
status: "APPROVED" | "PENDING" | "REJECTED" | "PAUSED" | "DISABLED";
|
|
19
|
+
category: "MARKETING" | "UTILITY" | "AUTHENTICATION";
|
|
47
20
|
language: string;
|
|
48
|
-
status: "approved" | "pending" | "rejected";
|
|
49
|
-
category: "marketing" | "utility" | "authentication";
|
|
50
21
|
components: Array<{
|
|
51
|
-
type: "
|
|
52
|
-
text?: string;
|
|
22
|
+
type: "HEADER" | "BODY" | "FOOTER" | "BUTTONS";
|
|
53
23
|
format?: string;
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
24
|
+
text?: string;
|
|
25
|
+
buttons?: Array<{
|
|
26
|
+
type: string;
|
|
27
|
+
text: string;
|
|
28
|
+
url?: string;
|
|
29
|
+
}>;
|
|
58
30
|
}>;
|
|
59
31
|
}
|
|
60
|
-
/**
|
|
61
|
-
* WhatsApp Phone Number
|
|
62
|
-
*/
|
|
63
32
|
export interface WhatsAppPhoneNumber {
|
|
64
33
|
id: string;
|
|
65
34
|
display_phone_number: string;
|
|
66
35
|
verified_name: string;
|
|
67
36
|
code_verification_status: string;
|
|
68
|
-
quality_rating: "
|
|
37
|
+
quality_rating: "GREEN" | "YELLOW" | "RED";
|
|
69
38
|
platform_type: string;
|
|
70
39
|
throughput: {
|
|
71
40
|
level: string;
|
|
72
41
|
};
|
|
73
42
|
}
|
|
74
|
-
/**
|
|
75
|
-
* WhatsApp Business Profile
|
|
76
|
-
*/
|
|
77
43
|
export interface WhatsAppBusinessProfile {
|
|
78
44
|
about?: string;
|
|
79
45
|
address?: string;
|
|
80
46
|
description?: string;
|
|
81
47
|
email?: string;
|
|
82
|
-
messaging_product: string;
|
|
83
48
|
profile_picture_url?: string;
|
|
84
49
|
websites?: string[];
|
|
85
50
|
vertical?: string;
|
|
86
51
|
}
|
|
87
52
|
/**
|
|
88
|
-
* WhatsApp
|
|
89
|
-
*/
|
|
90
|
-
export interface WhatsAppMessageStatus {
|
|
91
|
-
id: string;
|
|
92
|
-
status: "sent" | "delivered" | "read" | "failed";
|
|
93
|
-
timestamp: string;
|
|
94
|
-
recipient_id: string;
|
|
95
|
-
errors?: Array<{
|
|
96
|
-
code: number;
|
|
97
|
-
title: string;
|
|
98
|
-
message: string;
|
|
99
|
-
error_data?: {
|
|
100
|
-
details: string;
|
|
101
|
-
};
|
|
102
|
-
}>;
|
|
103
|
-
}
|
|
104
|
-
/**
|
|
105
|
-
* WhatsApp Integration Client Interface
|
|
106
|
-
* Provides type-safe methods for all WhatsApp Business operations
|
|
53
|
+
* WhatsApp Business Integration Client Interface
|
|
107
54
|
*/
|
|
108
55
|
export interface WhatsAppIntegrationClient {
|
|
109
56
|
/**
|
|
110
|
-
* Send a text message
|
|
57
|
+
* Send a plain text message
|
|
111
58
|
*
|
|
112
59
|
* @example
|
|
113
60
|
* ```typescript
|
|
114
|
-
*
|
|
115
|
-
*
|
|
116
|
-
*
|
|
117
|
-
* text:
|
|
61
|
+
* await client.whatsapp.sendMessage({
|
|
62
|
+
* phone_number_id: "123456789",
|
|
63
|
+
* to: "+15551234567",
|
|
64
|
+
* text: "Hello!",
|
|
118
65
|
* });
|
|
119
66
|
* ```
|
|
120
67
|
*/
|
|
121
68
|
sendMessage(params: {
|
|
122
|
-
/**
|
|
69
|
+
/** Sending phone number ID */
|
|
70
|
+
phone_number_id: string;
|
|
71
|
+
/** Recipient phone number in E.164 format */
|
|
123
72
|
to: string;
|
|
124
|
-
/** Message
|
|
125
|
-
|
|
126
|
-
/** Text message content */
|
|
127
|
-
text: {
|
|
128
|
-
/** Message body text */
|
|
129
|
-
body: string;
|
|
130
|
-
/** Preview URL (optional) */
|
|
131
|
-
preview_url?: boolean;
|
|
132
|
-
};
|
|
73
|
+
/** Message body text */
|
|
74
|
+
text: string;
|
|
133
75
|
}): Promise<MCPToolCallResponse>;
|
|
134
76
|
/**
|
|
135
|
-
*
|
|
77
|
+
* Reply to a specific message (quoted reply)
|
|
136
78
|
*
|
|
137
79
|
* @example
|
|
138
80
|
* ```typescript
|
|
139
|
-
*
|
|
140
|
-
*
|
|
141
|
-
*
|
|
142
|
-
*
|
|
143
|
-
*
|
|
144
|
-
*
|
|
145
|
-
*
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
81
|
+
* await client.whatsapp.replyMessage({
|
|
82
|
+
* phone_number_id: "123456789",
|
|
83
|
+
* to: "+15551234567",
|
|
84
|
+
* message_id: "wamid.XXX",
|
|
85
|
+
* text: "Got it!",
|
|
86
|
+
* });
|
|
87
|
+
* ```
|
|
88
|
+
*/
|
|
89
|
+
replyMessage(params: {
|
|
90
|
+
/** Sending phone number ID */
|
|
91
|
+
phone_number_id: string;
|
|
92
|
+
/** Recipient phone number */
|
|
93
|
+
to: string;
|
|
94
|
+
/** The wamid of the message to reply to */
|
|
95
|
+
message_id: string;
|
|
96
|
+
/** Reply text */
|
|
97
|
+
text: string;
|
|
98
|
+
}): Promise<MCPToolCallResponse>;
|
|
99
|
+
/**
|
|
100
|
+
* Send a pre-approved template message
|
|
101
|
+
*
|
|
102
|
+
* @example
|
|
103
|
+
* ```typescript
|
|
104
|
+
* await client.whatsapp.sendTemplate({
|
|
105
|
+
* phone_number_id: "123456789",
|
|
106
|
+
* to: "+15551234567",
|
|
107
|
+
* template_name: "order_confirmation",
|
|
108
|
+
* language_code: "en_US",
|
|
109
|
+
* components: JSON.stringify([{
|
|
110
|
+
* type: "body",
|
|
111
|
+
* parameters: [{ type: "text", text: "Alice" }, { type: "text", text: "ORDER-123" }],
|
|
112
|
+
* }]),
|
|
151
113
|
* });
|
|
152
114
|
* ```
|
|
153
115
|
*/
|
|
154
116
|
sendTemplate(params: {
|
|
155
|
-
/**
|
|
117
|
+
/** Sending phone number ID */
|
|
118
|
+
phone_number_id: string;
|
|
119
|
+
/** Recipient phone number */
|
|
156
120
|
to: string;
|
|
157
|
-
/**
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
/** Language code */
|
|
164
|
-
code: string;
|
|
165
|
-
};
|
|
166
|
-
/** Template components with parameters */
|
|
167
|
-
components?: Array<{
|
|
168
|
-
type: "header" | "body" | "button";
|
|
169
|
-
parameters?: Array<{
|
|
170
|
-
type: "text" | "currency" | "date_time" | "image" | "document" | "video";
|
|
171
|
-
text?: string;
|
|
172
|
-
currency?: {
|
|
173
|
-
fallback_value: string;
|
|
174
|
-
code: string;
|
|
175
|
-
amount_1000: number;
|
|
176
|
-
};
|
|
177
|
-
date_time?: {
|
|
178
|
-
fallback_value: string;
|
|
179
|
-
};
|
|
180
|
-
image?: {
|
|
181
|
-
link: string;
|
|
182
|
-
};
|
|
183
|
-
document?: {
|
|
184
|
-
link: string;
|
|
185
|
-
filename?: string;
|
|
186
|
-
};
|
|
187
|
-
video?: {
|
|
188
|
-
link: string;
|
|
189
|
-
};
|
|
190
|
-
}>;
|
|
191
|
-
sub_type?: string;
|
|
192
|
-
index?: number;
|
|
193
|
-
}>;
|
|
194
|
-
};
|
|
121
|
+
/** Approved template name */
|
|
122
|
+
template_name: string;
|
|
123
|
+
/** Language code e.g. en_US, es, pt_BR */
|
|
124
|
+
language_code: string;
|
|
125
|
+
/** JSON array of component objects for variable substitution */
|
|
126
|
+
components?: string;
|
|
195
127
|
}): Promise<MCPToolCallResponse>;
|
|
196
128
|
/**
|
|
197
|
-
* Send
|
|
129
|
+
* Send an image, video, document, or audio file by URL
|
|
198
130
|
*
|
|
199
131
|
* @example
|
|
200
132
|
* ```typescript
|
|
201
|
-
*
|
|
202
|
-
*
|
|
203
|
-
*
|
|
204
|
-
*
|
|
205
|
-
*
|
|
206
|
-
*
|
|
207
|
-
* }
|
|
133
|
+
* await client.whatsapp.sendMedia({
|
|
134
|
+
* phone_number_id: "123456789",
|
|
135
|
+
* to: "+15551234567",
|
|
136
|
+
* media_type: "image",
|
|
137
|
+
* media_url: "https://example.com/photo.jpg",
|
|
138
|
+
* caption: "Check this out",
|
|
208
139
|
* });
|
|
209
140
|
* ```
|
|
210
141
|
*/
|
|
211
142
|
sendMedia(params: {
|
|
212
|
-
/**
|
|
143
|
+
/** Sending phone number ID */
|
|
144
|
+
phone_number_id: string;
|
|
145
|
+
/** Recipient phone number */
|
|
146
|
+
to: string;
|
|
147
|
+
/** image, video, document, or audio */
|
|
148
|
+
media_type: "image" | "video" | "document" | "audio";
|
|
149
|
+
/** Publicly accessible URL to the media file */
|
|
150
|
+
media_url: string;
|
|
151
|
+
/** Caption text (supported for image, video, document) */
|
|
152
|
+
caption?: string;
|
|
153
|
+
}): Promise<MCPToolCallResponse>;
|
|
154
|
+
/**
|
|
155
|
+
* React to a message with an emoji
|
|
156
|
+
*
|
|
157
|
+
* @example
|
|
158
|
+
* ```typescript
|
|
159
|
+
* await client.whatsapp.sendReaction({
|
|
160
|
+
* phone_number_id: "123456789",
|
|
161
|
+
* to: "+15551234567",
|
|
162
|
+
* message_id: "wamid.XXX",
|
|
163
|
+
* emoji: "👍",
|
|
164
|
+
* });
|
|
165
|
+
* ```
|
|
166
|
+
*/
|
|
167
|
+
sendReaction(params: {
|
|
168
|
+
/** Sending phone number ID */
|
|
169
|
+
phone_number_id: string;
|
|
170
|
+
/** Recipient phone number */
|
|
213
171
|
to: string;
|
|
214
|
-
/**
|
|
215
|
-
|
|
216
|
-
/**
|
|
217
|
-
|
|
218
|
-
/** Media URL or ID */
|
|
219
|
-
link?: string;
|
|
220
|
-
id?: string;
|
|
221
|
-
/** Image caption */
|
|
222
|
-
caption?: string;
|
|
223
|
-
};
|
|
224
|
-
/** Video media (when type is "video") */
|
|
225
|
-
video?: {
|
|
226
|
-
/** Media URL or ID */
|
|
227
|
-
link?: string;
|
|
228
|
-
id?: string;
|
|
229
|
-
/** Video caption */
|
|
230
|
-
caption?: string;
|
|
231
|
-
};
|
|
232
|
-
/** Document media (when type is "document") */
|
|
233
|
-
document?: {
|
|
234
|
-
/** Media URL or ID */
|
|
235
|
-
link?: string;
|
|
236
|
-
id?: string;
|
|
237
|
-
/** Document caption */
|
|
238
|
-
caption?: string;
|
|
239
|
-
/** Document filename */
|
|
240
|
-
filename?: string;
|
|
241
|
-
};
|
|
242
|
-
/** Audio media (when type is "audio") */
|
|
243
|
-
audio?: {
|
|
244
|
-
/** Media URL or ID */
|
|
245
|
-
link?: string;
|
|
246
|
-
id?: string;
|
|
247
|
-
};
|
|
172
|
+
/** The wamid of the message to react to */
|
|
173
|
+
message_id: string;
|
|
174
|
+
/** A single emoji character */
|
|
175
|
+
emoji: string;
|
|
248
176
|
}): Promise<MCPToolCallResponse>;
|
|
249
177
|
/**
|
|
250
|
-
*
|
|
178
|
+
* Send a location pin
|
|
251
179
|
*
|
|
252
180
|
* @example
|
|
253
181
|
* ```typescript
|
|
254
|
-
*
|
|
255
|
-
*
|
|
182
|
+
* await client.whatsapp.sendLocation({
|
|
183
|
+
* phone_number_id: "123456789",
|
|
184
|
+
* to: "+15551234567",
|
|
185
|
+
* latitude: "37.7749",
|
|
186
|
+
* longitude: "-122.4194",
|
|
187
|
+
* name: "Golden Gate Park",
|
|
256
188
|
* });
|
|
257
189
|
* ```
|
|
258
190
|
*/
|
|
259
|
-
|
|
260
|
-
/**
|
|
261
|
-
|
|
262
|
-
/**
|
|
263
|
-
|
|
264
|
-
/**
|
|
265
|
-
|
|
191
|
+
sendLocation(params: {
|
|
192
|
+
/** Sending phone number ID */
|
|
193
|
+
phone_number_id: string;
|
|
194
|
+
/** Recipient phone number */
|
|
195
|
+
to: string;
|
|
196
|
+
/** Decimal latitude */
|
|
197
|
+
latitude: string;
|
|
198
|
+
/** Decimal longitude */
|
|
199
|
+
longitude: string;
|
|
200
|
+
/** Location name */
|
|
201
|
+
name?: string;
|
|
202
|
+
/** Address string */
|
|
203
|
+
address?: string;
|
|
266
204
|
}): Promise<MCPToolCallResponse>;
|
|
267
205
|
/**
|
|
268
|
-
*
|
|
206
|
+
* Send one or more vCard-style contact cards
|
|
269
207
|
*
|
|
270
208
|
* @example
|
|
271
209
|
* ```typescript
|
|
272
|
-
*
|
|
210
|
+
* await client.whatsapp.sendContact({
|
|
211
|
+
* phone_number_id: "123456789",
|
|
212
|
+
* to: "+15551234567",
|
|
213
|
+
* contacts: JSON.stringify([{
|
|
214
|
+
* name: { formatted_name: "Alice Smith", first_name: "Alice", last_name: "Smith" },
|
|
215
|
+
* phones: [{ phone: "+15551234567", type: "CELL" }],
|
|
216
|
+
* }]),
|
|
217
|
+
* });
|
|
273
218
|
* ```
|
|
274
219
|
*/
|
|
275
|
-
|
|
276
|
-
/**
|
|
277
|
-
|
|
220
|
+
sendContact(params: {
|
|
221
|
+
/** Sending phone number ID */
|
|
222
|
+
phone_number_id: string;
|
|
223
|
+
/** Recipient phone number */
|
|
224
|
+
to: string;
|
|
225
|
+
/** JSON array of contact objects */
|
|
226
|
+
contacts: string;
|
|
278
227
|
}): Promise<MCPToolCallResponse>;
|
|
279
228
|
/**
|
|
280
|
-
*
|
|
229
|
+
* Send a message with up to 3 quick-reply buttons
|
|
281
230
|
*
|
|
282
231
|
* @example
|
|
283
232
|
* ```typescript
|
|
284
|
-
*
|
|
285
|
-
*
|
|
233
|
+
* await client.whatsapp.sendInteractiveButtons({
|
|
234
|
+
* phone_number_id: "123456789",
|
|
235
|
+
* to: "+15551234567",
|
|
236
|
+
* body_text: "Do you confirm your order?",
|
|
237
|
+
* buttons: JSON.stringify([{ id: "yes", title: "Yes" }, { id: "no", title: "No" }]),
|
|
286
238
|
* });
|
|
287
239
|
* ```
|
|
288
240
|
*/
|
|
289
|
-
|
|
290
|
-
/**
|
|
291
|
-
|
|
241
|
+
sendInteractiveButtons(params: {
|
|
242
|
+
/** Sending phone number ID */
|
|
243
|
+
phone_number_id: string;
|
|
244
|
+
/** Recipient phone number */
|
|
245
|
+
to: string;
|
|
246
|
+
/** Main message body */
|
|
247
|
+
body_text: string;
|
|
248
|
+
/** JSON array of 1–3 button objects [{"id":"btn1","title":"Yes"}] */
|
|
249
|
+
buttons: string;
|
|
250
|
+
/** Optional header above the body */
|
|
251
|
+
header_text?: string;
|
|
252
|
+
/** Optional footer below the buttons */
|
|
253
|
+
footer_text?: string;
|
|
254
|
+
}): Promise<MCPToolCallResponse>;
|
|
255
|
+
/**
|
|
256
|
+
* Send a message with a scrollable list of options
|
|
257
|
+
*
|
|
258
|
+
* @example
|
|
259
|
+
* ```typescript
|
|
260
|
+
* await client.whatsapp.sendInteractiveList({
|
|
261
|
+
* phone_number_id: "123456789",
|
|
262
|
+
* to: "+15551234567",
|
|
263
|
+
* body_text: "Choose your shipping method",
|
|
264
|
+
* button_text: "See options",
|
|
265
|
+
* sections: JSON.stringify([{
|
|
266
|
+
* title: "Shipping",
|
|
267
|
+
* rows: [
|
|
268
|
+
* { id: "standard", title: "Standard (5-7 days)", description: "Free" },
|
|
269
|
+
* { id: "express", title: "Express (1-2 days)", description: "$9.99" },
|
|
270
|
+
* ],
|
|
271
|
+
* }]),
|
|
272
|
+
* });
|
|
273
|
+
* ```
|
|
274
|
+
*/
|
|
275
|
+
sendInteractiveList(params: {
|
|
276
|
+
/** Sending phone number ID */
|
|
277
|
+
phone_number_id: string;
|
|
278
|
+
/** Recipient phone number */
|
|
279
|
+
to: string;
|
|
280
|
+
/** Main message body */
|
|
281
|
+
body_text: string;
|
|
282
|
+
/** Label on the button that opens the list (max 20 chars) */
|
|
283
|
+
button_text: string;
|
|
284
|
+
/** JSON array of section objects */
|
|
285
|
+
sections: string;
|
|
286
|
+
/** Optional header */
|
|
287
|
+
header_text?: string;
|
|
288
|
+
/** Optional footer */
|
|
289
|
+
footer_text?: string;
|
|
292
290
|
}): Promise<MCPToolCallResponse>;
|
|
293
291
|
/**
|
|
294
|
-
* Mark message as read
|
|
292
|
+
* Mark a received message as read (shows blue ticks to sender)
|
|
295
293
|
*
|
|
296
294
|
* @example
|
|
297
295
|
* ```typescript
|
|
298
296
|
* await client.whatsapp.markRead({
|
|
299
|
-
*
|
|
297
|
+
* phone_number_id: "123456789",
|
|
298
|
+
* message_id: "wamid.XXX",
|
|
300
299
|
* });
|
|
301
300
|
* ```
|
|
302
301
|
*/
|
|
303
302
|
markRead(params: {
|
|
304
|
-
/**
|
|
303
|
+
/** Your phone number ID */
|
|
304
|
+
phone_number_id: string;
|
|
305
|
+
/** The wamid of the received message */
|
|
305
306
|
message_id: string;
|
|
306
307
|
}): Promise<MCPToolCallResponse>;
|
|
307
308
|
/**
|
|
308
|
-
* Get
|
|
309
|
+
* Get the download URL and metadata for a received media object
|
|
310
|
+
*
|
|
311
|
+
* @example
|
|
312
|
+
* ```typescript
|
|
313
|
+
* const media = await client.whatsapp.getMediaUrl({
|
|
314
|
+
* media_id: "media123",
|
|
315
|
+
* phone_number_id: "123456789",
|
|
316
|
+
* });
|
|
317
|
+
* // media.url expires in ~5 minutes — download promptly
|
|
318
|
+
* ```
|
|
319
|
+
*/
|
|
320
|
+
getMediaUrl(params: {
|
|
321
|
+
/** Media object ID (from webhook payload) */
|
|
322
|
+
media_id: string;
|
|
323
|
+
/** Your phone number ID */
|
|
324
|
+
phone_number_id: string;
|
|
325
|
+
}): Promise<MCPToolCallResponse>;
|
|
326
|
+
/**
|
|
327
|
+
* Delete an uploaded media object from Meta's servers
|
|
328
|
+
*
|
|
329
|
+
* @example
|
|
330
|
+
* ```typescript
|
|
331
|
+
* await client.whatsapp.deleteMedia({ media_id: "media123", phone_number_id: "123456789" });
|
|
332
|
+
* ```
|
|
333
|
+
*/
|
|
334
|
+
deleteMedia(params: {
|
|
335
|
+
/** Media object ID */
|
|
336
|
+
media_id: string;
|
|
337
|
+
/** Your phone number ID */
|
|
338
|
+
phone_number_id: string;
|
|
339
|
+
}): Promise<MCPToolCallResponse>;
|
|
340
|
+
/**
|
|
341
|
+
* List all message templates for a WhatsApp Business Account
|
|
342
|
+
*
|
|
343
|
+
* @example
|
|
344
|
+
* ```typescript
|
|
345
|
+
* const templates = await client.whatsapp.listTemplates({ business_account_id: "WABA123" });
|
|
346
|
+
* ```
|
|
347
|
+
*/
|
|
348
|
+
listTemplates(params: {
|
|
349
|
+
/** WABA ID */
|
|
350
|
+
business_account_id: string;
|
|
351
|
+
}): Promise<MCPToolCallResponse>;
|
|
352
|
+
/**
|
|
353
|
+
* Get a specific template by name
|
|
354
|
+
*
|
|
355
|
+
* @example
|
|
356
|
+
* ```typescript
|
|
357
|
+
* const tpl = await client.whatsapp.getTemplate({ business_account_id: "WABA123", name: "order_confirmation" });
|
|
358
|
+
* ```
|
|
359
|
+
*/
|
|
360
|
+
getTemplate(params: {
|
|
361
|
+
/** WABA ID */
|
|
362
|
+
business_account_id: string;
|
|
363
|
+
/** Template name */
|
|
364
|
+
name: string;
|
|
365
|
+
}): Promise<MCPToolCallResponse>;
|
|
366
|
+
/**
|
|
367
|
+
* Create a new message template (submitted for Meta review)
|
|
368
|
+
*
|
|
369
|
+
* @example
|
|
370
|
+
* ```typescript
|
|
371
|
+
* await client.whatsapp.createTemplate({
|
|
372
|
+
* business_account_id: "WABA123",
|
|
373
|
+
* name: "order_ready",
|
|
374
|
+
* language: "en_US",
|
|
375
|
+
* category: "UTILITY",
|
|
376
|
+
* components: JSON.stringify([
|
|
377
|
+
* { type: "BODY", text: "Hi {{1}}, your order {{2}} is ready for pickup." },
|
|
378
|
+
* ]),
|
|
379
|
+
* });
|
|
380
|
+
* ```
|
|
381
|
+
*/
|
|
382
|
+
createTemplate(params: {
|
|
383
|
+
/** WABA ID */
|
|
384
|
+
business_account_id: string;
|
|
385
|
+
/** Template name — lowercase letters, numbers, underscores only */
|
|
386
|
+
name: string;
|
|
387
|
+
/** Language code e.g. en_US */
|
|
388
|
+
language: string;
|
|
389
|
+
/** MARKETING, UTILITY, or AUTHENTICATION */
|
|
390
|
+
category: "MARKETING" | "UTILITY" | "AUTHENTICATION";
|
|
391
|
+
/** JSON array of component objects */
|
|
392
|
+
components: string;
|
|
393
|
+
}): Promise<MCPToolCallResponse>;
|
|
394
|
+
/**
|
|
395
|
+
* Delete a template by name (all language variants)
|
|
396
|
+
*
|
|
397
|
+
* @example
|
|
398
|
+
* ```typescript
|
|
399
|
+
* await client.whatsapp.deleteTemplate({ business_account_id: "WABA123", name: "old_promo" });
|
|
400
|
+
* ```
|
|
401
|
+
*/
|
|
402
|
+
deleteTemplate(params: {
|
|
403
|
+
/** WABA ID */
|
|
404
|
+
business_account_id: string;
|
|
405
|
+
/** Template name to delete */
|
|
406
|
+
name: string;
|
|
407
|
+
}): Promise<MCPToolCallResponse>;
|
|
408
|
+
/**
|
|
409
|
+
* List all phone numbers registered to a WABA
|
|
410
|
+
*
|
|
411
|
+
* @example
|
|
412
|
+
* ```typescript
|
|
413
|
+
* const numbers = await client.whatsapp.getPhoneNumbers({ business_account_id: "WABA123" });
|
|
414
|
+
* ```
|
|
415
|
+
*/
|
|
416
|
+
getPhoneNumbers(params: {
|
|
417
|
+
/** WABA ID */
|
|
418
|
+
business_account_id: string;
|
|
419
|
+
}): Promise<MCPToolCallResponse>;
|
|
420
|
+
/**
|
|
421
|
+
* Get full details for a specific phone number
|
|
422
|
+
*
|
|
423
|
+
* @example
|
|
424
|
+
* ```typescript
|
|
425
|
+
* const number = await client.whatsapp.getPhoneNumber({ phone_number_id: "123456789" });
|
|
426
|
+
* ```
|
|
427
|
+
*/
|
|
428
|
+
getPhoneNumber(params: {
|
|
429
|
+
/** Phone number ID */
|
|
430
|
+
phone_number_id: string;
|
|
431
|
+
}): Promise<MCPToolCallResponse>;
|
|
432
|
+
/**
|
|
433
|
+
* Get the public business profile for a phone number
|
|
434
|
+
*
|
|
435
|
+
* @example
|
|
436
|
+
* ```typescript
|
|
437
|
+
* const profile = await client.whatsapp.getProfile({ phone_number_id: "123456789" });
|
|
438
|
+
* ```
|
|
439
|
+
*/
|
|
440
|
+
getProfile(params: {
|
|
441
|
+
/** Phone number ID */
|
|
442
|
+
phone_number_id: string;
|
|
443
|
+
}): Promise<MCPToolCallResponse>;
|
|
444
|
+
/**
|
|
445
|
+
* Update the business profile (pass only the fields you want to change)
|
|
446
|
+
*
|
|
447
|
+
* @example
|
|
448
|
+
* ```typescript
|
|
449
|
+
* await client.whatsapp.updateProfile({
|
|
450
|
+
* phone_number_id: "123456789",
|
|
451
|
+
* about: "Best prices guaranteed",
|
|
452
|
+
* email: "support@example.com",
|
|
453
|
+
* });
|
|
454
|
+
* ```
|
|
455
|
+
*/
|
|
456
|
+
updateProfile(params: {
|
|
457
|
+
/** Phone number ID */
|
|
458
|
+
phone_number_id: string;
|
|
459
|
+
/** Short about text (max 139 chars) */
|
|
460
|
+
about?: string;
|
|
461
|
+
/** Business address */
|
|
462
|
+
address?: string;
|
|
463
|
+
/** Business description */
|
|
464
|
+
description?: string;
|
|
465
|
+
/** Business email */
|
|
466
|
+
email?: string;
|
|
467
|
+
/** Industry vertical */
|
|
468
|
+
vertical?: string;
|
|
469
|
+
/** JSON array of URLs (max 2) */
|
|
470
|
+
websites?: string;
|
|
471
|
+
}): Promise<MCPToolCallResponse>;
|
|
472
|
+
/**
|
|
473
|
+
* Get status of a sent message by message ID
|
|
474
|
+
*
|
|
475
|
+
* @example
|
|
476
|
+
* ```typescript
|
|
477
|
+
* const status = await client.whatsapp.getMessageStatus({ message_id: "wamid.XXX" });
|
|
478
|
+
* ```
|
|
479
|
+
*/
|
|
480
|
+
getMessageStatus(params: {
|
|
481
|
+
/** The wamid of the message */
|
|
482
|
+
message_id: string;
|
|
483
|
+
}): Promise<MCPToolCallResponse>;
|
|
484
|
+
/**
|
|
485
|
+
* Create a QR code that opens a chat with a prefilled message
|
|
486
|
+
*
|
|
487
|
+
* @example
|
|
488
|
+
* ```typescript
|
|
489
|
+
* const qr = await client.whatsapp.createQrCode({
|
|
490
|
+
* phone_number_id: "123456789",
|
|
491
|
+
* prefilled_message: "Hi, I have a question",
|
|
492
|
+
* });
|
|
493
|
+
* console.log(qr.deep_link_url, qr.qr_image_url);
|
|
494
|
+
* ```
|
|
495
|
+
*/
|
|
496
|
+
createQrCode(params: {
|
|
497
|
+
/** Phone number ID */
|
|
498
|
+
phone_number_id: string;
|
|
499
|
+
/** Message text to prefill when QR is scanned */
|
|
500
|
+
prefilled_message: string;
|
|
501
|
+
}): Promise<MCPToolCallResponse>;
|
|
502
|
+
/**
|
|
503
|
+
* List all QR codes for a phone number
|
|
309
504
|
*
|
|
310
505
|
* @example
|
|
311
506
|
* ```typescript
|
|
312
|
-
* const
|
|
507
|
+
* const codes = await client.whatsapp.listQrCodes({ phone_number_id: "123456789" });
|
|
313
508
|
* ```
|
|
314
509
|
*/
|
|
315
|
-
|
|
316
|
-
/**
|
|
317
|
-
|
|
510
|
+
listQrCodes(params: {
|
|
511
|
+
/** Phone number ID */
|
|
512
|
+
phone_number_id: string;
|
|
318
513
|
}): Promise<MCPToolCallResponse>;
|
|
319
514
|
}
|
|
320
515
|
//# sourceMappingURL=whatsapp-client.d.ts.map
|