meta-cloud-api 1.3.0 → 1.4.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 +102 -0
- package/dist/index.d.ts +782 -1137
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +13 -13
- package/dist/index.js.map +1 -1
- package/dist/types/{enums-mxRGX-JN.d.ts → enums-DEu7hLmx.d.ts} +5 -1
- package/dist/types/enums-DEu7hLmx.d.ts.map +1 -0
- package/dist/types/enums-U752Hos7.js +2 -0
- package/dist/types/enums-U752Hos7.js.map +1 -0
- package/dist/types/enums.d.ts +1 -1
- package/dist/types/enums.js +1 -1
- package/dist/types/index.d.ts +373 -518
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/index.js +1 -1
- package/dist/utils/index.d.ts +43 -1
- package/dist/utils/index.d.ts.map +1 -1
- package/dist/utils/index.js +2 -2
- package/dist/utils/index.js.map +1 -1
- package/package.json +1 -1
- package/dist/types/enums-mxRGX-JN.d.ts.map +0 -1
- package/dist/types/enums-r-Amysog.js +0 -2
- package/dist/types/enums-r-Amysog.js.map +0 -1
package/README.md
CHANGED
|
@@ -300,6 +300,108 @@ const profile = await client.businessProfile.update({
|
|
|
300
300
|
const currentProfile = await client.businessProfile.get();
|
|
301
301
|
```
|
|
302
302
|
|
|
303
|
+
### Phone Number Management
|
|
304
|
+
|
|
305
|
+
#### Conversational Automation
|
|
306
|
+
|
|
307
|
+
Configure conversational components like Welcome Messages, Ice Breakers, and Commands to enhance user interactions:
|
|
308
|
+
|
|
309
|
+
```typescript
|
|
310
|
+
// Enable welcome message
|
|
311
|
+
await client.phoneNumber.setConversationalAutomation({
|
|
312
|
+
enable_welcome_message: true
|
|
313
|
+
});
|
|
314
|
+
|
|
315
|
+
// Configure ice breakers (prompts) - up to 4, each max 80 characters
|
|
316
|
+
await client.phoneNumber.setConversationalAutomation({
|
|
317
|
+
prompts: ['Book a flight', 'Plan a vacation', 'Find hotels', 'Get travel tips']
|
|
318
|
+
});
|
|
319
|
+
|
|
320
|
+
// Configure commands - up to 30, each command max 32 chars, description max 256 chars
|
|
321
|
+
await client.phoneNumber.setConversationalAutomation({
|
|
322
|
+
commands: [
|
|
323
|
+
{ command_name: 'tickets', command_description: 'Book flight tickets' },
|
|
324
|
+
{ command_name: 'hotel', command_description: 'Book hotel rooms' },
|
|
325
|
+
{ command_name: 'imagine', command_description: 'Create images using a text prompt' }
|
|
326
|
+
]
|
|
327
|
+
});
|
|
328
|
+
|
|
329
|
+
// Configure all features at once
|
|
330
|
+
await client.phoneNumber.setConversationalAutomation({
|
|
331
|
+
enable_welcome_message: true,
|
|
332
|
+
commands: [
|
|
333
|
+
{ command_name: 'tickets', command_description: 'Book flight tickets' }
|
|
334
|
+
],
|
|
335
|
+
prompts: ['Book a flight', 'Plan a vacation']
|
|
336
|
+
});
|
|
337
|
+
|
|
338
|
+
// Get current configuration
|
|
339
|
+
const config = await client.phoneNumber.getConversationalAutomation();
|
|
340
|
+
console.log('Welcome message enabled:', config.enable_welcome_message);
|
|
341
|
+
console.log('Commands:', config.commands);
|
|
342
|
+
console.log('Ice breakers:', config.prompts);
|
|
343
|
+
```
|
|
344
|
+
|
|
345
|
+
#### Phone Number Information
|
|
346
|
+
|
|
347
|
+
```typescript
|
|
348
|
+
// Get phone number details
|
|
349
|
+
const phoneInfo = await client.phoneNumber.getPhoneNumberById();
|
|
350
|
+
console.log('Display number:', phoneInfo.display_phone_number);
|
|
351
|
+
console.log('Quality rating:', phoneInfo.quality_rating);
|
|
352
|
+
console.log('Verified name:', phoneInfo.verified_name);
|
|
353
|
+
|
|
354
|
+
// Get specific fields only
|
|
355
|
+
const phoneDetails = await client.phoneNumber.getPhoneNumberById(
|
|
356
|
+
'display_phone_number,verified_name,code_verification_status'
|
|
357
|
+
);
|
|
358
|
+
```
|
|
359
|
+
|
|
360
|
+
### Block Users Management
|
|
361
|
+
|
|
362
|
+
```typescript
|
|
363
|
+
// Block a user (only works for users who messaged you in last 24 hours)
|
|
364
|
+
const blockResult = await client.blockUsers.block(['1234567890']);
|
|
365
|
+
console.log('Blocked users:', blockResult.block_users.added_users);
|
|
366
|
+
console.log('Failed to block:', blockResult.block_users.failed_users);
|
|
367
|
+
|
|
368
|
+
// Block multiple users at once
|
|
369
|
+
const multiBlockResult = await client.blockUsers.block([
|
|
370
|
+
'1234567890',
|
|
371
|
+
'0987654321',
|
|
372
|
+
'1122334455'
|
|
373
|
+
]);
|
|
374
|
+
|
|
375
|
+
// Unblock users
|
|
376
|
+
const unblockResult = await client.blockUsers.unblock(['1234567890']);
|
|
377
|
+
|
|
378
|
+
// Get list of blocked users with pagination
|
|
379
|
+
const blockedUsers = await client.blockUsers.listBlockedUsers({
|
|
380
|
+
limit: 10
|
|
381
|
+
});
|
|
382
|
+
|
|
383
|
+
// Iterate through all blocked users
|
|
384
|
+
let cursor: string | undefined;
|
|
385
|
+
const allBlockedUsers = [];
|
|
386
|
+
|
|
387
|
+
do {
|
|
388
|
+
const page = await client.blockUsers.listBlockedUsers({
|
|
389
|
+
limit: 100,
|
|
390
|
+
after: cursor
|
|
391
|
+
});
|
|
392
|
+
|
|
393
|
+
page.data.forEach(item => {
|
|
394
|
+
if (item.block_users) {
|
|
395
|
+
allBlockedUsers.push(...item.block_users);
|
|
396
|
+
}
|
|
397
|
+
});
|
|
398
|
+
|
|
399
|
+
cursor = page.paging?.cursors?.after;
|
|
400
|
+
} while (cursor);
|
|
401
|
+
|
|
402
|
+
console.log(`Total blocked users: ${allBlockedUsers.length}`);
|
|
403
|
+
```
|
|
404
|
+
|
|
303
405
|
### WhatsApp Flows
|
|
304
406
|
|
|
305
407
|
```typescript
|