meta-cloud-api 0.2.44 → 1.0.1
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 +180 -64
- package/dist/{BusinessProfileApi-DE7Nnuy_.d.ts → BusinessProfileApi-WXscSgo-.d.ts} +4 -3
- package/dist/{EncryptionApi-PHxeI2G_.d.ts → EncryptionApi-D7pt-OXT.d.ts} +3 -2
- package/dist/FlowApi-UAvzhJfV.d.ts +136 -0
- package/dist/{MediaApi-B2vtjiCm.d.ts → MediaApi-BrEKpqi_.d.ts} +3 -2
- package/dist/{MessageApi-ptFlWg3O.d.ts → MessageApi-Circorzz.d.ts} +4 -3
- package/dist/{PhoneNumberApi-DMb_G3uw.d.ts → PhoneNumberApi-DKlu9PHl.d.ts} +4 -3
- package/dist/{QrCodeApi-D3rVKuxV.d.ts → QrCodeApi-7vDwIBHR.d.ts} +3 -2
- package/dist/{RegistrationApi-DZBJWAZS.d.ts → RegistrationApi-qO_qoti9.d.ts} +4 -3
- package/dist/{TemplateApi-BFeM9qJS.d.ts → TemplateApi-xGgIZt89.d.ts} +5 -4
- package/dist/{TwoStepVerificationApi-6jV5pDxS.d.ts → TwoStepVerificationApi-DfNPIz-C.d.ts} +3 -2
- package/dist/{WabaApi-B8Gv2UNE.d.ts → WabaApi-DqQi_68m.d.ts} +3 -2
- package/dist/{WebhookHandler-Bxxi6SdT.d.ts → WebhookProcessor-ByAe7Kf_.d.ts} +22 -32
- package/dist/WhatsApp-BIBtT-y9.d.ts +82 -0
- package/dist/api/encryption/index.d.ts +10 -0
- package/dist/api/encryption/index.js +2 -0
- package/dist/api/flow/index.d.ts +10 -0
- package/dist/api/flow/index.js +2 -0
- package/dist/api/index.d.ts +16 -0
- package/dist/api/index.js +2 -0
- package/dist/api/media/index.d.ts +10 -0
- package/dist/api/media/index.js +2 -0
- package/dist/{features → api}/messages/index.d.ts +6 -5
- package/dist/api/messages/index.js +2 -0
- package/dist/{features → api}/phone/index.d.ts +6 -5
- package/dist/api/phone/index.js +2 -0
- package/dist/{features → api}/profile/index.d.ts +6 -5
- package/dist/api/profile/index.js +2 -0
- package/dist/api/qrCode/index.d.ts +10 -0
- package/dist/api/qrCode/index.js +2 -0
- package/dist/api/registration/index.d.ts +10 -0
- package/dist/api/registration/index.js +2 -0
- package/dist/{features → api}/template/index.d.ts +6 -5
- package/dist/api/template/index.js +2 -0
- package/dist/api/twoStepVerification/index.d.ts +10 -0
- package/dist/api/twoStepVerification/index.js +2 -0
- package/dist/api/waba/index.d.ts +10 -0
- package/dist/api/waba/index.js +2 -0
- package/dist/api/waba/index.js.map +1 -0
- package/dist/base-CdGDdVEl.d.ts +18 -0
- package/dist/{chunk-2NJVBJUN.js → chunk-7QBIZCJ4.js} +2 -2
- package/dist/chunk-7QBIZCJ4.js.map +1 -0
- package/dist/chunk-AMHQGG6Z.js +2 -0
- package/dist/{chunk-4C666HHU.js.map → chunk-AMHQGG6Z.js.map} +1 -1
- package/dist/chunk-B7DCL6I7.js +10 -0
- package/dist/chunk-B7DCL6I7.js.map +1 -0
- package/dist/{chunk-7GL74SXM.js → chunk-CRZ7EUYR.js} +2 -2
- package/dist/chunk-CRZ7EUYR.js.map +1 -0
- package/dist/chunk-FKXSL2JK.js +3 -0
- package/dist/chunk-FKXSL2JK.js.map +1 -0
- package/dist/chunk-FSKBLPGE.js +2 -0
- package/dist/chunk-FSKBLPGE.js.map +1 -0
- package/dist/chunk-HJGN3PO4.js +3 -0
- package/dist/chunk-HJGN3PO4.js.map +1 -0
- package/dist/{chunk-7NQLQPLH.js → chunk-IYSR44P6.js} +2 -2
- package/dist/chunk-IYSR44P6.js.map +1 -0
- package/dist/chunk-JC6YMVID.js +2 -0
- package/dist/chunk-JC6YMVID.js.map +1 -0
- package/dist/{chunk-GT3XQN7Y.js → chunk-JPAV644F.js} +2 -2
- package/dist/chunk-JPAV644F.js.map +1 -0
- package/dist/{chunk-XPPDOFBN.js → chunk-JXCLRKQ7.js} +2 -2
- package/dist/chunk-JXCLRKQ7.js.map +1 -0
- package/dist/chunk-KMAH6636.js +2 -0
- package/dist/chunk-KMAH6636.js.map +1 -0
- package/dist/{chunk-5JGM556C.js → chunk-L4ESAO2S.js} +2 -2
- package/dist/chunk-L4ESAO2S.js.map +1 -0
- package/dist/chunk-LV3TULSI.js +2 -0
- package/dist/chunk-LV3TULSI.js.map +1 -0
- package/dist/{chunk-BZ5QDXNR.js → chunk-MJEG3K4V.js} +2 -2
- package/dist/chunk-MJEG3K4V.js.map +1 -0
- package/dist/chunk-NLF2JGYY.js +2 -0
- package/dist/chunk-NLF2JGYY.js.map +1 -0
- package/dist/chunk-OA2SW4AF.js +2 -0
- package/dist/chunk-OA2SW4AF.js.map +1 -0
- package/dist/chunk-PHPQ5HP3.js +2 -0
- package/dist/chunk-PHPQ5HP3.js.map +1 -0
- package/dist/chunk-RIL6QABY.js +2 -0
- package/dist/chunk-RIL6QABY.js.map +1 -0
- package/dist/chunk-RWCVPWRC.js +2 -0
- package/dist/chunk-RWCVPWRC.js.map +1 -0
- package/dist/chunk-SNNRWNGZ.js +2 -0
- package/dist/chunk-SNNRWNGZ.js.map +1 -0
- package/dist/chunk-UCBYECNQ.js +2 -0
- package/dist/chunk-UCBYECNQ.js.map +1 -0
- package/dist/chunk-VHAODWCN.js +2 -0
- package/dist/chunk-VHAODWCN.js.map +1 -0
- package/dist/chunk-WGGN32O2.js +2 -0
- package/dist/chunk-WGGN32O2.js.map +1 -0
- package/dist/{FlowApi-CASVC-Al.d.ts → common-DDXsNyLF.d.ts} +2 -133
- package/dist/core/webhook/frameworks/express.d.ts +48 -0
- package/dist/core/webhook/frameworks/express.js +2 -0
- package/dist/core/webhook/frameworks/express.js.map +1 -0
- package/dist/core/webhook/frameworks/nextjs.d.ts +44 -0
- package/dist/core/webhook/frameworks/nextjs.js +2 -0
- package/dist/core/webhook/frameworks/nextjs.js.map +1 -0
- package/dist/core/webhook/index.d.ts +21 -16
- package/dist/core/webhook/index.js +1 -1
- package/dist/core/whatsapp/index.d.ts +39 -15
- package/dist/core/whatsapp/index.js +1 -1
- package/dist/{enums-DvwSJq9w.d.ts → enums-BZd9T2ul.d.ts} +1 -1
- package/dist/httpsClient-v4gmltzS.d.ts +19 -0
- package/dist/index.d.ts +21 -82
- package/dist/index.js +1 -1
- package/dist/logger-BdE0Vyim.d.ts +9 -0
- package/dist/{base-BhCbbsxB.d.ts → request-vYMaEfk5.d.ts} +2 -16
- package/dist/{shared/types → types}/config.d.ts +1 -1
- package/dist/types/enums.d.ts +1 -0
- package/dist/{shared/types → types}/enums.js +1 -1
- package/dist/types/index.d.ts +6 -0
- package/dist/types/index.js +2 -0
- package/dist/types/index.js.map +1 -0
- package/dist/utils/index.d.ts +98 -0
- package/dist/utils/index.js +2 -0
- package/dist/utils/index.js.map +1 -0
- package/package.json +91 -34
- package/dist/chunk-2NJVBJUN.js.map +0 -1
- package/dist/chunk-3MO3BTBC.js +0 -2
- package/dist/chunk-3MO3BTBC.js.map +0 -1
- package/dist/chunk-4C666HHU.js +0 -2
- package/dist/chunk-4O3T25CT.js +0 -2
- package/dist/chunk-4O3T25CT.js.map +0 -1
- package/dist/chunk-5JGM556C.js.map +0 -1
- package/dist/chunk-5O5GLWIE.js +0 -3
- package/dist/chunk-5O5GLWIE.js.map +0 -1
- package/dist/chunk-7GL74SXM.js.map +0 -1
- package/dist/chunk-7NQLQPLH.js.map +0 -1
- package/dist/chunk-BZ5QDXNR.js.map +0 -1
- package/dist/chunk-CNGQISKS.js +0 -2
- package/dist/chunk-CNGQISKS.js.map +0 -1
- package/dist/chunk-GIQLIMOD.js +0 -2
- package/dist/chunk-GIQLIMOD.js.map +0 -1
- package/dist/chunk-GT3XQN7Y.js.map +0 -1
- package/dist/chunk-I222VSWK.js +0 -2
- package/dist/chunk-I222VSWK.js.map +0 -1
- package/dist/chunk-JGX3AVD7.js +0 -3
- package/dist/chunk-JGX3AVD7.js.map +0 -1
- package/dist/chunk-KFPOVYEJ.js +0 -2
- package/dist/chunk-KFPOVYEJ.js.map +0 -1
- package/dist/chunk-LGLRGXCE.js +0 -2
- package/dist/chunk-LGLRGXCE.js.map +0 -1
- package/dist/chunk-O2OTHNWM.js +0 -2
- package/dist/chunk-O2OTHNWM.js.map +0 -1
- package/dist/chunk-R36L2XYO.js +0 -2
- package/dist/chunk-R36L2XYO.js.map +0 -1
- package/dist/chunk-UQPD6GIF.js +0 -2
- package/dist/chunk-UQPD6GIF.js.map +0 -1
- package/dist/chunk-VW3LGHTJ.js +0 -2
- package/dist/chunk-VW3LGHTJ.js.map +0 -1
- package/dist/chunk-XPPDOFBN.js.map +0 -1
- package/dist/features/encryption/index.d.ts +0 -9
- package/dist/features/encryption/index.js +0 -2
- package/dist/features/flow/index.d.ts +0 -9
- package/dist/features/flow/index.js +0 -2
- package/dist/features/media/index.d.ts +0 -9
- package/dist/features/media/index.js +0 -2
- package/dist/features/messages/index.js +0 -2
- package/dist/features/phone/index.js +0 -2
- package/dist/features/profile/index.js +0 -2
- package/dist/features/qrCode/index.d.ts +0 -9
- package/dist/features/qrCode/index.js +0 -2
- package/dist/features/registration/index.d.ts +0 -9
- package/dist/features/registration/index.js +0 -2
- package/dist/features/template/index.js +0 -2
- package/dist/features/twoStepVerification/index.d.ts +0 -9
- package/dist/features/twoStepVerification/index.js +0 -2
- package/dist/features/waba/index.d.ts +0 -9
- package/dist/features/waba/index.js +0 -2
- package/dist/index-DiCI1vEz.d.ts +0 -100
- package/dist/shared/types/enums.d.ts +0 -1
- package/dist/shared/utils/isMetaError.d.ts +0 -21
- package/dist/shared/utils/isMetaError.js +0 -2
- package/dist/shared/utils/isMetaError.js.map +0 -1
- /package/dist/{features → api}/encryption/index.js.map +0 -0
- /package/dist/{features → api}/flow/index.js.map +0 -0
- /package/dist/{features/media → api}/index.js.map +0 -0
- /package/dist/{features/messages → api/media}/index.js.map +0 -0
- /package/dist/{features/phone → api/messages}/index.js.map +0 -0
- /package/dist/{features/profile → api/phone}/index.js.map +0 -0
- /package/dist/{features/qrCode → api/profile}/index.js.map +0 -0
- /package/dist/{features/registration → api/qrCode}/index.js.map +0 -0
- /package/dist/{features/template → api/registration}/index.js.map +0 -0
- /package/dist/{features/twoStepVerification → api/template}/index.js.map +0 -0
- /package/dist/{features/waba → api/twoStepVerification}/index.js.map +0 -0
- /package/dist/{shared/types → types}/config.js +0 -0
- /package/dist/{shared/types → types}/config.js.map +0 -0
- /package/dist/{shared/types → types}/enums.js.map +0 -0
package/README.md
CHANGED
|
@@ -18,10 +18,11 @@
|
|
|
18
18
|
## Features
|
|
19
19
|
|
|
20
20
|
- **Type-Safe Development** - Built with TypeScript to provide code completion and catch errors during development
|
|
21
|
-
- **Comprehensive Coverage** - Full support for WhatsApp Business Platform APIs
|
|
22
|
-
- **
|
|
21
|
+
- **Comprehensive Coverage** - Full support for WhatsApp Business Platform APIs including Messages, Media, Templates, Flows, and more
|
|
22
|
+
- **Modular Architecture** - Clean separation of concerns with dedicated API classes for each domain
|
|
23
|
+
- **Framework-Specific Webhooks** - Built-in support for Express.js and Next.js webhook handling
|
|
24
|
+
- **Advanced Features** - Support for Flows, Encryption, QR Codes, Two-Step Verification, and WABA management
|
|
23
25
|
- **Error Handling** - Standardized error handling with detailed Meta API error information
|
|
24
|
-
- **Webhook Handler** - Built-in support for webhook verification and message handling
|
|
25
26
|
|
|
26
27
|
## Installation
|
|
27
28
|
|
|
@@ -58,8 +59,6 @@ console.log(`Message ID: ${response.messages[0].id}`);
|
|
|
58
59
|
|
|
59
60
|
### Messaging
|
|
60
61
|
|
|
61
|
-
Send different types of messages through WhatsApp Business Platform:
|
|
62
|
-
|
|
63
62
|
#### Text Message
|
|
64
63
|
|
|
65
64
|
```typescript
|
|
@@ -146,71 +145,96 @@ const result = await client.messages.interactive({
|
|
|
146
145
|
});
|
|
147
146
|
```
|
|
148
147
|
|
|
149
|
-
|
|
148
|
+
### Webhook Integration
|
|
150
149
|
|
|
151
|
-
|
|
150
|
+
#### Express.js Webhook
|
|
152
151
|
|
|
153
|
-
|
|
154
|
-
|
|
152
|
+
```typescript
|
|
153
|
+
import express from 'express';
|
|
154
|
+
import { MessageTypesEnum } from 'meta-cloud-api';
|
|
155
|
+
import { webhookHandler } from 'meta-cloud-api/webhook/express';
|
|
155
156
|
|
|
156
|
-
|
|
157
|
+
const app = express();
|
|
157
158
|
|
|
158
|
-
|
|
159
|
+
// Create webhook handler
|
|
160
|
+
const bot = webhookHandler({
|
|
161
|
+
accessToken: process.env.CLOUD_API_ACCESS_TOKEN!,
|
|
162
|
+
phoneNumberId: parseInt(process.env.WA_PHONE_NUMBER_ID!),
|
|
163
|
+
webhookVerificationToken: process.env.WEBHOOK_VERIFICATION_TOKEN!,
|
|
164
|
+
});
|
|
165
|
+
|
|
166
|
+
// Handle text messages
|
|
167
|
+
bot.processor.onMessage(MessageTypesEnum.Text, async (whatsapp, message) => {
|
|
168
|
+
await whatsapp.messages.text({
|
|
169
|
+
to: message.from,
|
|
170
|
+
body: `Echo: ${message.text?.body}`,
|
|
171
|
+
});
|
|
172
|
+
});
|
|
173
|
+
|
|
174
|
+
// Setup webhook endpoints
|
|
175
|
+
app.get('/webhook', bot.webhook);
|
|
176
|
+
app.post('/webhook', express.json(), bot.webhook);
|
|
159
177
|
|
|
160
|
-
|
|
178
|
+
app.listen(3000);
|
|
179
|
+
```
|
|
180
|
+
|
|
181
|
+
#### Next.js Webhook
|
|
161
182
|
|
|
162
183
|
```typescript
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
phoneNumberId: Number(process.env.WA_PHONE_NUMBER_ID),
|
|
173
|
-
businessAcctId: process.env.WA_BUSINESS_ACCOUNT_ID,
|
|
174
|
-
webhookVerificationToken: process.env.WEBHOOK_VERIFICATION_TOKEN
|
|
184
|
+
// pages/api/webhook.ts
|
|
185
|
+
import { NextApiRequest, NextApiResponse } from 'next';
|
|
186
|
+
import { MessageTypesEnum } from 'meta-cloud-api';
|
|
187
|
+
import { webhookHandler } from 'meta-cloud-api/webhook/nextjs';
|
|
188
|
+
|
|
189
|
+
const bot = webhookHandler({
|
|
190
|
+
accessToken: process.env.CLOUD_API_ACCESS_TOKEN!,
|
|
191
|
+
phoneNumberId: parseInt(process.env.WA_PHONE_NUMBER_ID!),
|
|
192
|
+
webhookVerificationToken: process.env.WEBHOOK_VERIFICATION_TOKEN!,
|
|
175
193
|
});
|
|
176
194
|
|
|
177
|
-
// Handle
|
|
178
|
-
|
|
179
|
-
|
|
195
|
+
// Handle text messages
|
|
196
|
+
bot.processor.onMessage(MessageTypesEnum.Text, async (whatsapp, message) => {
|
|
197
|
+
await whatsapp.messages.text({
|
|
198
|
+
to: message.from,
|
|
199
|
+
body: `Echo: ${message.text?.body}`,
|
|
200
|
+
});
|
|
180
201
|
});
|
|
181
202
|
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
203
|
+
export default async function handler(req: NextApiRequest, res: NextApiResponse) {
|
|
204
|
+
return bot.webhook(req, res);
|
|
205
|
+
}
|
|
206
|
+
```
|
|
207
|
+
|
|
208
|
+
### Advanced Message Handling
|
|
209
|
+
|
|
210
|
+
```typescript
|
|
211
|
+
import { MessageTypesEnum } from 'meta-cloud-api';
|
|
186
212
|
|
|
187
213
|
// Pre-process all messages (e.g., mark as read)
|
|
188
|
-
|
|
189
|
-
await
|
|
214
|
+
bot.processor.onMessagePreProcess(async (whatsapp, message) => {
|
|
215
|
+
await whatsapp.messages.markAsRead({ messageId: message.id });
|
|
190
216
|
});
|
|
191
217
|
|
|
192
|
-
// Handle
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
await client.messages.text({
|
|
196
|
-
body: `You said: "${message.text.body}"`,
|
|
197
|
-
to: message.from
|
|
198
|
-
});
|
|
199
|
-
}
|
|
218
|
+
// Handle different message types
|
|
219
|
+
bot.processor.onMessage(MessageTypesEnum.Text, async (whatsapp, message) => {
|
|
220
|
+
// Handle text messages
|
|
200
221
|
});
|
|
201
222
|
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
223
|
+
bot.processor.onMessage(MessageTypesEnum.Image, async (whatsapp, message) => {
|
|
224
|
+
// Handle image messages
|
|
225
|
+
});
|
|
226
|
+
|
|
227
|
+
bot.processor.onMessage(MessageTypesEnum.Document, async (whatsapp, message) => {
|
|
228
|
+
// Handle document messages
|
|
208
229
|
});
|
|
209
|
-
```
|
|
210
230
|
|
|
211
|
-
|
|
231
|
+
// Handle message status updates
|
|
232
|
+
bot.processor.onMessageStatus(async (whatsapp, status) => {
|
|
233
|
+
console.log(`Message ${status.id} status: ${status.status}`);
|
|
234
|
+
});
|
|
235
|
+
```
|
|
212
236
|
|
|
213
|
-
|
|
237
|
+
### Templates Management
|
|
214
238
|
|
|
215
239
|
```typescript
|
|
216
240
|
// List all templates
|
|
@@ -221,21 +245,17 @@ const templates = await client.templates.list({
|
|
|
221
245
|
// Create a new template
|
|
222
246
|
const newTemplate = await client.templates.create({
|
|
223
247
|
businessId: process.env.WA_BUSINESS_ACCOUNT_ID,
|
|
224
|
-
name: "
|
|
248
|
+
name: "welcome_message",
|
|
225
249
|
category: "MARKETING",
|
|
226
250
|
components: [
|
|
227
251
|
{
|
|
228
252
|
type: "HEADER",
|
|
229
253
|
format: "TEXT",
|
|
230
|
-
text: "
|
|
254
|
+
text: "Welcome!"
|
|
231
255
|
},
|
|
232
256
|
{
|
|
233
257
|
type: "BODY",
|
|
234
|
-
text: "Hi {{1}},
|
|
235
|
-
},
|
|
236
|
-
{
|
|
237
|
-
type: "FOOTER",
|
|
238
|
-
text: "Tap the button below to shop now"
|
|
258
|
+
text: "Hi {{1}}, welcome to our service!"
|
|
239
259
|
}
|
|
240
260
|
],
|
|
241
261
|
language: "en_US"
|
|
@@ -244,8 +264,6 @@ const newTemplate = await client.templates.create({
|
|
|
244
264
|
|
|
245
265
|
### Media Management
|
|
246
266
|
|
|
247
|
-
Upload and retrieve media for your messages:
|
|
248
|
-
|
|
249
267
|
```typescript
|
|
250
268
|
import fs from 'fs';
|
|
251
269
|
|
|
@@ -259,13 +277,17 @@ const mediaUpload = await client.media.upload({
|
|
|
259
277
|
const media = await client.media.get({
|
|
260
278
|
mediaId: mediaUpload.id
|
|
261
279
|
});
|
|
262
|
-
```
|
|
263
280
|
|
|
264
|
-
|
|
281
|
+
// Download media
|
|
282
|
+
const mediaBuffer = await client.media.download({
|
|
283
|
+
mediaId: mediaUpload.id
|
|
284
|
+
});
|
|
285
|
+
```
|
|
265
286
|
|
|
266
|
-
|
|
287
|
+
### Business Profile Management
|
|
267
288
|
|
|
268
289
|
```typescript
|
|
290
|
+
// Update business profile
|
|
269
291
|
const profile = await client.businessProfile.update({
|
|
270
292
|
about: "We provide the best service!",
|
|
271
293
|
address: "123 Business St, City",
|
|
@@ -273,12 +295,106 @@ const profile = await client.businessProfile.update({
|
|
|
273
295
|
email: "contact@business.com",
|
|
274
296
|
websites: ["https://www.business.com"]
|
|
275
297
|
});
|
|
298
|
+
|
|
299
|
+
// Get current profile
|
|
300
|
+
const currentProfile = await client.businessProfile.get();
|
|
301
|
+
```
|
|
302
|
+
|
|
303
|
+
### WhatsApp Flows
|
|
304
|
+
|
|
305
|
+
```typescript
|
|
306
|
+
// Create a flow
|
|
307
|
+
const flow = await client.flows.create({
|
|
308
|
+
name: "Customer Survey",
|
|
309
|
+
categories: ["SURVEY"],
|
|
310
|
+
clone_flow_id: "existing_flow_id" // Optional
|
|
311
|
+
});
|
|
312
|
+
|
|
313
|
+
// Update flow
|
|
314
|
+
const updatedFlow = await client.flows.update({
|
|
315
|
+
flowId: flow.id,
|
|
316
|
+
name: "Updated Survey",
|
|
317
|
+
categories: ["SURVEY", "FEEDBACK"]
|
|
318
|
+
});
|
|
319
|
+
```
|
|
320
|
+
|
|
321
|
+
## Example Projects
|
|
322
|
+
|
|
323
|
+
We provide ready-to-use example projects demonstrating integration with different frameworks:
|
|
324
|
+
|
|
325
|
+
### [Express.js Echo Bot](./examples/express-example)
|
|
326
|
+
A simple echo bot that responds to any text message. Perfect for getting started!
|
|
327
|
+
|
|
328
|
+
```bash
|
|
329
|
+
cd examples/express-example
|
|
330
|
+
npm install
|
|
331
|
+
cp env.example .env # Configure your credentials
|
|
332
|
+
npm run dev
|
|
333
|
+
```
|
|
334
|
+
|
|
335
|
+
### [Next.js Echo Bot](./examples/nextjs-page-router-example)
|
|
336
|
+
Next.js implementation with API routes for webhook handling.
|
|
337
|
+
|
|
338
|
+
```bash
|
|
339
|
+
cd examples/nextjs-page-router-example
|
|
340
|
+
npm install
|
|
341
|
+
cp env.example .env.local # Configure your credentials
|
|
342
|
+
npm run dev
|
|
343
|
+
```
|
|
344
|
+
|
|
345
|
+
## Modular Imports
|
|
346
|
+
|
|
347
|
+
Use specific imports for better tree-shaking:
|
|
348
|
+
|
|
349
|
+
```typescript
|
|
350
|
+
// Import specific API classes
|
|
351
|
+
import { MessagesApi } from 'meta-cloud-api/messages';
|
|
352
|
+
import { MediaApi } from 'meta-cloud-api/media';
|
|
353
|
+
import { TemplateApi } from 'meta-cloud-api/template';
|
|
354
|
+
|
|
355
|
+
// Import specific webhook handlers
|
|
356
|
+
import { webhookHandler } from 'meta-cloud-api/webhook/express';
|
|
357
|
+
import { webhookHandler } from 'meta-cloud-api/webhook/nextjs';
|
|
358
|
+
|
|
359
|
+
// Import types and enums
|
|
360
|
+
import { MessageTypesEnum, InteractiveTypesEnum } from 'meta-cloud-api/types/enums';
|
|
361
|
+
import type { WhatsAppConfig } from 'meta-cloud-api/types/config';
|
|
362
|
+
```
|
|
363
|
+
|
|
364
|
+
## Configuration
|
|
365
|
+
|
|
366
|
+
```typescript
|
|
367
|
+
interface WhatsAppConfig {
|
|
368
|
+
accessToken: string; // Required: Meta Cloud API access token
|
|
369
|
+
phoneNumberId: number; // Required: WhatsApp phone number ID
|
|
370
|
+
businessAcctId?: string; // Optional: Business account ID
|
|
371
|
+
apiVersion?: string; // Optional: API version (default: v21.0)
|
|
372
|
+
webhookVerificationToken?: string; // Optional: For webhook verification
|
|
373
|
+
requestTimeout?: number; // Optional: Request timeout in ms
|
|
374
|
+
}
|
|
375
|
+
```
|
|
376
|
+
|
|
377
|
+
## Error Handling
|
|
378
|
+
|
|
379
|
+
```typescript
|
|
380
|
+
try {
|
|
381
|
+
const result = await client.messages.text({
|
|
382
|
+
to: "15551234567",
|
|
383
|
+
body: "Hello World"
|
|
384
|
+
});
|
|
385
|
+
} catch (error) {
|
|
386
|
+
if (error.response?.data?.error) {
|
|
387
|
+
console.error('Meta API Error:', error.response.data.error);
|
|
388
|
+
} else {
|
|
389
|
+
console.error('Network Error:', error.message);
|
|
390
|
+
}
|
|
391
|
+
}
|
|
276
392
|
```
|
|
277
393
|
|
|
278
394
|
## Requirements
|
|
279
395
|
|
|
280
|
-
-
|
|
281
|
-
-
|
|
396
|
+
- **Node.js** 18 LTS or later
|
|
397
|
+
- **TypeScript** 4.5+ (for TypeScript projects)
|
|
282
398
|
|
|
283
399
|
## Contributing
|
|
284
400
|
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { WabaConfigType } from './
|
|
3
|
-
import {
|
|
1
|
+
import { a as BaseClass, B as BaseAPI } from './base-CdGDdVEl.js';
|
|
2
|
+
import { WabaConfigType } from './types/config.js';
|
|
3
|
+
import { e as ResponseSuccess, R as RequesterClass } from './request-vYMaEfk5.js';
|
|
4
|
+
import { k as BusinessVerticalEnum } from './enums-BZd9T2ul.js';
|
|
4
5
|
|
|
5
6
|
/**
|
|
6
7
|
* Upload session information for creating upload sessions.
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { WabaConfigType } from './
|
|
1
|
+
import { B as BaseAPI } from './base-CdGDdVEl.js';
|
|
2
|
+
import { WabaConfigType } from './types/config.js';
|
|
3
|
+
import { c as ResponseData, e as ResponseSuccess, R as RequesterClass } from './request-vYMaEfk5.js';
|
|
3
4
|
|
|
4
5
|
type EncryptionPublicKeyResponse = ResponseData<{
|
|
5
6
|
business_public_key: string;
|
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
import { B as BaseAPI } from './base-CdGDdVEl.js';
|
|
2
|
+
import { WabaConfigType } from './types/config.js';
|
|
3
|
+
import { R as RequesterClass, e as ResponseSuccess } from './request-vYMaEfk5.js';
|
|
4
|
+
import { e as FlowClass, j as FlowsListResponse, d as FlowCategoryEnum, C as CreateFlowResponse, F as Flow, i as FlowPreviewResponse, c as FlowAssetsResponse, U as UpdateFlowResponse, V as ValidateFlowJsonResponse, h as FlowMigrationResponse } from './common-DDXsNyLF.js';
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* API for managing WhatsApp Flows.
|
|
8
|
+
*
|
|
9
|
+
* This API allows you to:
|
|
10
|
+
* - List flows
|
|
11
|
+
* - Create flows
|
|
12
|
+
* - Get flow details and previews
|
|
13
|
+
* - Update flow metadata and JSON
|
|
14
|
+
* - Delete flows
|
|
15
|
+
* - Publish and deprecate flows
|
|
16
|
+
* - Migrate flows between WABAs
|
|
17
|
+
* - Validate flow JSON
|
|
18
|
+
*/
|
|
19
|
+
declare class FlowApi extends BaseAPI implements FlowClass {
|
|
20
|
+
constructor(config: WabaConfigType, client: RequesterClass);
|
|
21
|
+
/**
|
|
22
|
+
* List Flows
|
|
23
|
+
*
|
|
24
|
+
* @param wabaId - The WABA ID
|
|
25
|
+
* @returns Promise with the list of flows
|
|
26
|
+
*/
|
|
27
|
+
listFlows(wabaId: string): Promise<FlowsListResponse>;
|
|
28
|
+
/**
|
|
29
|
+
* Create Flow
|
|
30
|
+
*
|
|
31
|
+
* @param wabaId - The WABA ID
|
|
32
|
+
* @param data - The flow data including name, categories, endpoint_uri, and optional clone_flow_id
|
|
33
|
+
* @returns Promise with the created flow ID and validation errors if any
|
|
34
|
+
*/
|
|
35
|
+
createFlow(wabaId: string, data: {
|
|
36
|
+
name: string;
|
|
37
|
+
categories?: FlowCategoryEnum[];
|
|
38
|
+
endpoint_uri?: string;
|
|
39
|
+
clone_flow_id?: string;
|
|
40
|
+
flow_json?: string;
|
|
41
|
+
publish?: boolean;
|
|
42
|
+
}): Promise<CreateFlowResponse>;
|
|
43
|
+
/**
|
|
44
|
+
* Get Flow details
|
|
45
|
+
*
|
|
46
|
+
* @param flowId - The flow ID
|
|
47
|
+
* @param fields - Optional fields to return (e.g., 'name,status,preview.invalidate(false)')
|
|
48
|
+
* @param dateFormat - Optional date format
|
|
49
|
+
* @returns Promise with the flow details or preview response
|
|
50
|
+
*/
|
|
51
|
+
getFlow(flowId: string, fields?: string, dateFormat?: string): Promise<Flow | FlowPreviewResponse>;
|
|
52
|
+
/**
|
|
53
|
+
* Get Flow Preview URL
|
|
54
|
+
*
|
|
55
|
+
* @param flowId - The flow ID
|
|
56
|
+
* @param invalidate - Optional. If true, invalidates existing preview and generates a new one. Defaults to false.
|
|
57
|
+
* @returns Promise with the flow preview details
|
|
58
|
+
*/
|
|
59
|
+
getFlowPreview(flowId: string, invalidate?: boolean): Promise<FlowPreviewResponse>;
|
|
60
|
+
/**
|
|
61
|
+
* Update Flow Metadata
|
|
62
|
+
*
|
|
63
|
+
* @param flowId - The flow ID
|
|
64
|
+
* @param data - The flow metadata to update (name, categories, endpoint_uri, application_id)
|
|
65
|
+
* @returns Promise with the success status
|
|
66
|
+
*/
|
|
67
|
+
updateFlowMetadata(flowId: string, data: {
|
|
68
|
+
name?: string;
|
|
69
|
+
categories?: FlowCategoryEnum[];
|
|
70
|
+
endpoint_uri?: string;
|
|
71
|
+
application_id?: string;
|
|
72
|
+
}): Promise<ResponseSuccess>;
|
|
73
|
+
/**
|
|
74
|
+
* Delete Flow (only works if the Flow is in DRAFT status)
|
|
75
|
+
*
|
|
76
|
+
* @param flowId - The flow ID
|
|
77
|
+
* @returns Promise with the success status
|
|
78
|
+
*/
|
|
79
|
+
deleteFlow(flowId: string): Promise<ResponseSuccess>;
|
|
80
|
+
/**
|
|
81
|
+
* List Assets (e.g., get Flow JSON download URL)
|
|
82
|
+
*
|
|
83
|
+
* @param flowId - The flow ID
|
|
84
|
+
* @returns Promise with the list of assets
|
|
85
|
+
*/
|
|
86
|
+
listAssets(flowId: string): Promise<FlowAssetsResponse>;
|
|
87
|
+
/**
|
|
88
|
+
* Update Flow JSON by uploading a file, buffer, JSON object, or Blob.
|
|
89
|
+
*
|
|
90
|
+
* @param flowId - The flow ID
|
|
91
|
+
* @param data - Object containing the file data and optional name.
|
|
92
|
+
* @param data.file - The Flow JSON content as a Buffer, JSON object, or Blob.
|
|
93
|
+
* @param data.name - Optional name for the asset, defaults to 'flow.json'.
|
|
94
|
+
* @returns Promise with the success status and validation errors, if any.
|
|
95
|
+
*/
|
|
96
|
+
updateFlowJson(flowId: string, data: {
|
|
97
|
+
file: Blob | Buffer | object;
|
|
98
|
+
name?: string;
|
|
99
|
+
}): Promise<UpdateFlowResponse>;
|
|
100
|
+
/**
|
|
101
|
+
* Validate Flow JSON by attempting an update without publishing.
|
|
102
|
+
* This is a convenience method; the API doesn't have a dedicated validation endpoint.
|
|
103
|
+
*
|
|
104
|
+
* @param flowId - The ID of the Flow (must exist, can be in DRAFT status).
|
|
105
|
+
* @param flowJsonData - The Flow JSON content as a file path (string), Buffer, JSON object, or Blob.
|
|
106
|
+
* @returns Promise indicating if the JSON is valid and includes validation errors if any.
|
|
107
|
+
*/
|
|
108
|
+
validateFlowJson(flowId: string, flowJsonData: Blob | Buffer | object): Promise<ValidateFlowJsonResponse>;
|
|
109
|
+
/**
|
|
110
|
+
* Publish Flow
|
|
111
|
+
*
|
|
112
|
+
* @param flowId - The flow ID
|
|
113
|
+
* @returns Promise with the success status
|
|
114
|
+
*/
|
|
115
|
+
publishFlow(flowId: string): Promise<ResponseSuccess>;
|
|
116
|
+
/**
|
|
117
|
+
* Deprecate Flow
|
|
118
|
+
*
|
|
119
|
+
* @param flowId - The flow ID
|
|
120
|
+
* @returns Promise with the success status
|
|
121
|
+
*/
|
|
122
|
+
deprecateFlow(flowId: string): Promise<ResponseSuccess>;
|
|
123
|
+
/**
|
|
124
|
+
* Migrate Flows between WABAs
|
|
125
|
+
*
|
|
126
|
+
* @param destinationWabaId - The destination WABA ID
|
|
127
|
+
* @param data - The migration data including source_waba_id and optional source_flow_names
|
|
128
|
+
* @returns Promise with migration results (successes and failures)
|
|
129
|
+
*/
|
|
130
|
+
migrateFlows(destinationWabaId: string, data: {
|
|
131
|
+
source_waba_id: string;
|
|
132
|
+
source_flow_names?: string[];
|
|
133
|
+
}): Promise<FlowMigrationResponse>;
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
export { FlowApi as F };
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { WabaConfigType } from './
|
|
1
|
+
import { B as BaseAPI } from './base-CdGDdVEl.js';
|
|
2
|
+
import { WabaConfigType } from './types/config.js';
|
|
3
|
+
import { e as ResponseSuccess, R as RequesterClass } from './request-vYMaEfk5.js';
|
|
3
4
|
|
|
4
5
|
type MediaResponse = {
|
|
5
6
|
id: string;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { WabaConfigType } from './
|
|
3
|
-
import { I as InteractiveTypesEnum,
|
|
1
|
+
import { a as BaseClass, B as BaseAPI } from './base-CdGDdVEl.js';
|
|
2
|
+
import { WabaConfigType } from './types/config.js';
|
|
3
|
+
import { I as InteractiveTypesEnum, C as ComponentTypesEnum, L as LanguagesEnum, P as ParametersTypesEnum, i as CurrencyCodesEnum, S as SubTypeEnum, B as ButtonPositionEnum, M as MessageTypesEnum } from './enums-BZd9T2ul.js';
|
|
4
|
+
import { a as GeneralRequestBody, R as RequesterClass } from './request-vYMaEfk5.js';
|
|
4
5
|
|
|
5
6
|
interface ReactionParams {
|
|
6
7
|
messageId: string;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { WabaConfigType } from './
|
|
1
|
+
import { B as BaseAPI } from './base-CdGDdVEl.js';
|
|
2
|
+
import { WabaConfigType } from './types/config.js';
|
|
3
|
+
import { P as Paging, e as ResponseSuccess, R as RequesterClass } from './request-vYMaEfk5.js';
|
|
3
4
|
|
|
4
5
|
type QualityRating = 'GREEN' | 'YELLOW' | 'RED' | 'NA';
|
|
5
6
|
type AccountMode = 'LIVE' | 'SANDBOX';
|
|
@@ -80,7 +81,7 @@ interface PhoneNumberClass {
|
|
|
80
81
|
}
|
|
81
82
|
|
|
82
83
|
/**
|
|
83
|
-
* API for managing WhatsApp Phone
|
|
84
|
+
* API for managing WhatsApp Phone Numb ers.
|
|
84
85
|
*
|
|
85
86
|
* This API allows you to:
|
|
86
87
|
* - Get phone number information by ID
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { WabaConfigType } from './
|
|
1
|
+
import { B as BaseAPI } from './base-CdGDdVEl.js';
|
|
2
|
+
import { WabaConfigType } from './types/config.js';
|
|
3
|
+
import { c as ResponseData, e as ResponseSuccess, R as RequesterClass } from './request-vYMaEfk5.js';
|
|
3
4
|
|
|
4
5
|
type QrCodeResponse = {
|
|
5
6
|
code: string;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { WabaConfigType } from './
|
|
3
|
-
import {
|
|
1
|
+
import { B as BaseAPI } from './base-CdGDdVEl.js';
|
|
2
|
+
import { WabaConfigType } from './types/config.js';
|
|
3
|
+
import { j as DataLocalizationRegionEnum } from './enums-BZd9T2ul.js';
|
|
4
|
+
import { e as ResponseSuccess, R as RequesterClass } from './request-vYMaEfk5.js';
|
|
4
5
|
|
|
5
6
|
type RegistrationRequest = {
|
|
6
7
|
messaging_product: 'whatsapp';
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { WabaConfigType } from './
|
|
3
|
-
import {
|
|
1
|
+
import { B as BaseAPI } from './base-CdGDdVEl.js';
|
|
2
|
+
import { WabaConfigType } from './types/config.js';
|
|
3
|
+
import { a as GeneralRequestBody, e as ResponseSuccess, d as ResponsePagination, R as RequesterClass } from './request-vYMaEfk5.js';
|
|
4
|
+
import { L as LanguagesEnum, a as CategoryEnum, T as TemplateStatusEnum } from './enums-BZd9T2ul.js';
|
|
4
5
|
|
|
5
6
|
type TemplateFormat = 'TEXT' | 'IMAGE' | 'VIDEO' | 'DOCUMENT' | 'LOCATION' | 'PRODUCT';
|
|
6
7
|
type PhoneNumberButton = {
|
|
@@ -157,4 +158,4 @@ declare class TemplateApi extends BaseAPI implements TemplateClass {
|
|
|
157
158
|
deleteTemplate(params: TemplateDeleteParams): Promise<ResponseSuccess>;
|
|
158
159
|
}
|
|
159
160
|
|
|
160
|
-
export { type CatalogButton as C, type FlowButton as F, type MPMButton as M, type OTPButton as O, type PhoneNumberButton as P, type QuickReplyButton as Q, type SPMButton as S,
|
|
161
|
+
export { type CatalogButton as C, type FlowButton as F, type MPMButton as M, type OTPButton as O, type PhoneNumberButton as P, type QuickReplyButton as Q, type SPMButton as S, TemplateApi as T, type URLButton as U, TemplateClass as a, type TemplateDeleteParams as b, type TemplateGetParams as c, type TemplateRequestBody as d, type TemplateResponse as e, type TemplateFormat as f, type ComponentTypes as g, type CopyCodeButton as h, type TemplateBody as i, type TemplateButton as j, type TemplateButtons as k, type TemplateCarousel as l, type TemplateFooter as m, type TemplateHeader as n, type TemplateHeaderExample as o, type TemplateLimitedTimeOffer as p, type MediaCarouselCard as q, type ProductCarouselCard as r };
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { WabaConfigType } from './
|
|
1
|
+
import { B as BaseAPI } from './base-CdGDdVEl.js';
|
|
2
|
+
import { WabaConfigType } from './types/config.js';
|
|
3
|
+
import { e as ResponseSuccess, R as RequesterClass } from './request-vYMaEfk5.js';
|
|
3
4
|
|
|
4
5
|
type TwoStepVerificationRequest = {
|
|
5
6
|
pin: string;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { WabaConfigType } from './
|
|
1
|
+
import { B as BaseAPI } from './base-CdGDdVEl.js';
|
|
2
|
+
import { WabaConfigType } from './types/config.js';
|
|
3
|
+
import { e as ResponseSuccess, R as RequesterClass } from './request-vYMaEfk5.js';
|
|
3
4
|
|
|
4
5
|
/**
|
|
5
6
|
* WhatsApp Business Account subscription configuration
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { WabaConfigType, WhatsAppConfig } from './
|
|
3
|
-
import { M as MessageTypesEnum } from './enums-
|
|
4
|
-
import { W as WhatsApp } from './
|
|
1
|
+
import { f as FlowEndpointRequest, l as FlowTypeEnum } from './common-DDXsNyLF.js';
|
|
2
|
+
import { WabaConfigType, WhatsAppConfig } from './types/config.js';
|
|
3
|
+
import { M as MessageTypesEnum } from './enums-BZd9T2ul.js';
|
|
4
|
+
import { W as WhatsApp } from './WhatsApp-BIBtT-y9.js';
|
|
5
5
|
|
|
6
6
|
interface WebhookContact {
|
|
7
7
|
/**
|
|
@@ -672,11 +672,20 @@ declare function processWebhookMessages(request: Request, whatsapp: WhatsApp, ha
|
|
|
672
672
|
* Handle flow requests
|
|
673
673
|
*/
|
|
674
674
|
declare function processFlowRequest(request: Request, config: WabaConfigType, whatsapp: WhatsApp, flowHandlers: Map<FlowTypeEnum, FlowHandler>): Promise<Response>;
|
|
675
|
-
|
|
676
675
|
/**
|
|
677
|
-
*
|
|
676
|
+
* Constructs a full URL from framework-specific request headers and URL
|
|
677
|
+
* @param headers - Request headers containing host and protocol information
|
|
678
|
+
* @param url - Relative URL path
|
|
679
|
+
* @returns Full URL string
|
|
678
680
|
*/
|
|
679
|
-
declare
|
|
681
|
+
declare function constructFullUrl(headers: Record<string, string | string[] | undefined>, url?: string): string;
|
|
682
|
+
|
|
683
|
+
interface WebhookResponse {
|
|
684
|
+
status: number;
|
|
685
|
+
body: string;
|
|
686
|
+
headers: Record<string, string>;
|
|
687
|
+
}
|
|
688
|
+
declare class WebhookProcessor {
|
|
680
689
|
private config;
|
|
681
690
|
private client;
|
|
682
691
|
private messageHandlers;
|
|
@@ -684,34 +693,15 @@ declare class WebhookHandler {
|
|
|
684
693
|
private postProcessHandler;
|
|
685
694
|
private flowHandlers;
|
|
686
695
|
constructor(config: WhatsAppConfig);
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
handleWebhook(request: Request): Promise<Response>;
|
|
691
|
-
/**
|
|
692
|
-
* Handle flow requests
|
|
693
|
-
*/
|
|
694
|
-
handleFlow(request: Request): Promise<Response>;
|
|
695
|
-
/**
|
|
696
|
-
* Verify webhook signature
|
|
697
|
-
*/
|
|
698
|
-
private verifySignature;
|
|
699
|
-
/**
|
|
700
|
-
* Register a message handler for a specific message type
|
|
701
|
-
*/
|
|
696
|
+
processVerification(mode: string | null, token: string | null, challenge: string | null): Promise<WebhookResponse>;
|
|
697
|
+
processWebhook(request: Request): Promise<WebhookResponse>;
|
|
698
|
+
processFlow(request: Request): Promise<WebhookResponse>;
|
|
702
699
|
onMessage(type: MessageTypesEnum, handler: MessageHandler): void;
|
|
703
|
-
/**
|
|
704
|
-
* Register a pre-process handler that runs before all message handlers
|
|
705
|
-
*/
|
|
706
700
|
onMessagePreProcess(handler: MessageHandler): void;
|
|
707
|
-
/**
|
|
708
|
-
* Register a post-process handler that runs after all message handlers
|
|
709
|
-
*/
|
|
710
701
|
onMessagePostProcess(handler: MessageHandler): void;
|
|
711
|
-
/**
|
|
712
|
-
* Register a flow handler for a specific flow type
|
|
713
|
-
*/
|
|
714
702
|
onFlow(type: FlowTypeEnum, handler: FlowHandler): void;
|
|
703
|
+
getClient(): WhatsApp;
|
|
704
|
+
getConfig(): WabaConfigType;
|
|
715
705
|
}
|
|
716
706
|
|
|
717
|
-
export { type FlowHandler as F, MessageStatus as M, type WebhookContact as W, type WebhookEvent as a, type WebhookMessage as b,
|
|
707
|
+
export { type FlowHandler as F, MessageStatus as M, type WebhookContact as W, type WebhookEvent as a, type WebhookMessage as b, WebhookProcessor as c, type WebhookResponse as d, type MessageHandler as e, processFlowRequest as f, constructFullUrl as g, processWebhookMessages as p };
|