@nuiisweety/baileys 0.1.12 → 0.1.14

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 CHANGED
@@ -7,7 +7,7 @@
7
7
  *Fork dari [`@whiskeysockets/baileys`](https://github.com/WhiskeySockets/Baileys) v7.0.0-rc11*
8
8
  *dikembangkan dengan sepenuh hati oleh **NuiiS4TORU***
9
9
 
10
- [![npm version](https://img.shields.io/badge/npm-0.1.12-pink?style=flat-square&logo=npm)](https://www.npmjs.com/package/@nuiisweety/baileys)
10
+ [![npm version](https://img.shields.io/badge/npm-0.1.14-pink?style=flat-square&logo=npm)](https://www.npmjs.com/package/@nuiisweety/baileys)
11
11
  [![license](https://img.shields.io/badge/license-MIT-lavender?style=flat-square)](LICENSE)
12
12
  [![based on](https://img.shields.io/badge/based%20on-@whiskeysockets%2Fbaileys-orchid?style=flat-square)](https://github.com/WhiskeySockets/Baileys)
13
13
 
@@ -77,7 +77,11 @@
77
77
  [List Message](#list-message) ·
78
78
  [Template Buttons](#template-buttons) ·
79
79
  [Native Flow](#native-flow) ·
80
- [Carousel](#carousel)
80
+ [Carousel](#carousel) ·
81
+ [Shop Message](#shop-message) ·
82
+ [Collection Message](#collection-message) ·
83
+ [Order Status Message](#order-status-message) ·
84
+ [Product List Message](#product-list-message)
81
85
 
82
86
  🤖 **Rich Message (AI)** —
83
87
  [Text](#addtext) ·
@@ -1259,7 +1263,118 @@ await sock.sendMessage(jid, {
1259
1263
  })
1260
1264
  ```
1261
1265
 
1262
- > **Tipe tombol ditentukan otomatis** dari field yang ada: `id` → quick_reply · `url` → cta_url · `copy` → cta_copy · `call` → cta_call · `sections` → single_select. Bisa juga pakai `name` + `paramsJson` langsung untuk kontrol penuh. `text` atau `buttonText` keduanya diterima. Field `icon` opsional (string uppercase, e.g. `'CHECK'`, `'LINK'`).
1266
+ > **Tipe tombol ditentukan otomatis** dari field yang ada:
1267
+ >
1268
+ > | Field pada button | Native Flow yang dihasilkan |
1269
+ > |---|---|
1270
+ > | `id` | `quick_reply` |
1271
+ > | `url` | `cta_url` |
1272
+ > | `copy` | `cta_copy` |
1273
+ > | `call` | `cta_call` |
1274
+ > | `sections` | `single_select` |
1275
+ > | `catalog` | `cta_catalog` |
1276
+ > | `reminder: true` | `cta_reminder` |
1277
+ > | `cancelReminder: true` | `cta_cancel_reminder` |
1278
+ > | `address: true` | `address_message` |
1279
+ > | `location: true` | `send_location` |
1280
+ > | `webview` | `open_webview` |
1281
+ > | `productId` | `mpm` |
1282
+ > | `transactionId` | `wa_payment_transaction_details` |
1283
+ > | `catalogProduct` | `automated_greeting_message_view_catalog` |
1284
+ > | `flow` | `galaxy_message` (WA Flow) |
1285
+ >
1286
+ > Bisa juga pakai `name` + `paramsJson` langsung untuk kontrol penuh. `text` atau `buttonText` keduanya diterima. Field `icon` opsional (string uppercase, e.g. `'CHECK'`, `'LINK'`).
1287
+
1288
+ ```js
1289
+ // Catalog button — buka katalog bisnis
1290
+ await sock.sendMessage(jid, {
1291
+ text: 'Lihat produk kami',
1292
+ nativeFlow: [
1293
+ { catalog: '628xxx', text: 'Buka Katalog' }
1294
+ ]
1295
+ })
1296
+
1297
+ // Reminder button
1298
+ await sock.sendMessage(jid, {
1299
+ text: 'Ingatkan saya',
1300
+ nativeFlow: [
1301
+ { reminder: true, text: 'Set Pengingat' },
1302
+ { cancelReminder: true, text: 'Batalkan Pengingat' }
1303
+ ]
1304
+ })
1305
+
1306
+ // Address & Location button
1307
+ await sock.sendMessage(jid, {
1308
+ text: 'Butuh info lokasi',
1309
+ nativeFlow: [
1310
+ { address: true, text: 'Bagikan Alamat' },
1311
+ { location: true, text: 'Kirim Lokasi' }
1312
+ ]
1313
+ })
1314
+
1315
+ // Open Webview button
1316
+ await sock.sendMessage(jid, {
1317
+ text: 'Buka halaman web',
1318
+ nativeFlow: [
1319
+ { webview: 'https://example.com', text: 'Buka', inAppWebview: true }
1320
+ ]
1321
+ })
1322
+
1323
+ // MPM — Multi-product message button
1324
+ await sock.sendMessage(jid, {
1325
+ text: 'Produk pilihan',
1326
+ nativeFlow: [
1327
+ { productId: '8816262248471474', text: 'Lihat Produk' }
1328
+ ]
1329
+ })
1330
+
1331
+ // Payment transaction details button
1332
+ await sock.sendMessage(jid, {
1333
+ text: 'Detail pembayaran',
1334
+ nativeFlow: [
1335
+ { transactionId: '12345848', text: 'Lihat Detail' }
1336
+ ]
1337
+ })
1338
+
1339
+ // Automated greeting catalog button
1340
+ await sock.sendMessage(jid, {
1341
+ text: 'Halo! Cek katalog kami',
1342
+ nativeFlow: [
1343
+ {
1344
+ catalogProduct: { bizPhone: '628xxx', productId: '12345' },
1345
+ text: 'Lihat Katalog'
1346
+ }
1347
+ ]
1348
+ })
1349
+
1350
+ // WA Flow (galaxy_message)
1351
+ await sock.sendMessage(jid, {
1352
+ text: 'Isi formulir pendaftaran',
1353
+ nativeFlow: [
1354
+ {
1355
+ flow: {
1356
+ mode: 'published',
1357
+ flowId: '1307913409923914',
1358
+ flowToken: '1:1307913409923914:293680f87029f5a13d1ec5e35e718af3',
1359
+ flowCta: 'Daftar Sekarang',
1360
+ flowAction: 'navigate',
1361
+ flowActionPayload: {
1362
+ screen: 'QUESTION_ONE',
1363
+ params: { user_id: '123456789' }
1364
+ },
1365
+ flowMetadata: {
1366
+ flow_json_version: '201',
1367
+ data_api_protocol: 'v2',
1368
+ flow_name: 'Lead Qualification',
1369
+ data_api_version: 'v2',
1370
+ categories: ['Lead Generation']
1371
+ }
1372
+ },
1373
+ text: 'Buka Flow'
1374
+ }
1375
+ ]
1376
+ })
1377
+ ```
1263
1378
 
1264
1379
  </details>
1265
1380
 
@@ -1298,6 +1413,172 @@ await sock.sendMessage(jid, {
1298
1413
 
1299
1414
  ---
1300
1415
 
1416
+ <details>
1417
+ <summary>🏪 Shop Message</summary>
1418
+
1419
+ Menampilkan storefront toko bisnis WhatsApp. Bisa dengan header teks, gambar, video, dokumen, lokasi, atau produk.
1420
+
1421
+ ```js
1422
+ // Teks biasa
1423
+ await sock.sendMessage(jid, {
1424
+ text: 'Kunjungi toko kami!',
1425
+ title: 'Toko Kami',
1426
+ subtitle: 'Produk terbaik',
1427
+ footer: 'Belanja sekarang',
1428
+ shop: {
1429
+ surface: 1, // 1 | 2 | 3 | 4
1430
+ id: 'https://example.com'
1431
+ }
1432
+ })
1433
+
1434
+ // Dengan gambar
1435
+ await sock.sendMessage(jid, {
1436
+ image: { url: 'https://example.com/banner.jpg' },
1437
+ caption: 'Promo spesial hari ini!',
1438
+ title: 'Toko Kami',
1439
+ subtitle: 'Diskon 50%',
1440
+ footer: 'Tap untuk belanja',
1441
+ hasMediaAttachment: true,
1442
+ shop: {
1443
+ surface: 1,
1444
+ id: 'https://example.com'
1445
+ }
1446
+ })
1447
+
1448
+ // Dengan video
1449
+ await sock.sendMessage(jid, {
1450
+ video: { url: 'https://example.com/promo.mp4' },
1451
+ caption: 'Tonton promo kami!',
1452
+ title: 'Promo Bulan Ini',
1453
+ footer: 'Belanja sekarang',
1454
+ hasMediaAttachment: true,
1455
+ shop: { surface: 2, id: 'https://example.com' }
1456
+ })
1457
+ ```
1458
+
1459
+ </details>
1460
+
1461
+ ---
1462
+
1463
+ <details>
1464
+ <summary>📦 Collection Message</summary>
1465
+
1466
+ Menampilkan koleksi produk dari bisnis WhatsApp.
1467
+
1468
+ ```js
1469
+ // Teks biasa
1470
+ await sock.sendMessage(jid, {
1471
+ text: 'Koleksi terbaru kami',
1472
+ title: 'Koleksi Musim Ini',
1473
+ subtitle: 'Pilihan terbaik',
1474
+ footer: 'Lihat semua',
1475
+ collection: {
1476
+ bizJid: '628xxx@s.whatsapp.net',
1477
+ id: 'collection-id-123',
1478
+ version: 1
1479
+ }
1480
+ })
1481
+
1482
+ // Dengan gambar
1483
+ await sock.sendMessage(jid, {
1484
+ image: { url: 'https://example.com/collection.jpg' },
1485
+ caption: 'Temukan koleksi terbaru!',
1486
+ title: 'Koleksi Baru',
1487
+ subtitle: 'Limited edition',
1488
+ footer: 'Stok terbatas!',
1489
+ hasMediaAttachment: true,
1490
+ collection: {
1491
+ bizJid: '628xxx@s.whatsapp.net',
1492
+ id: 'collection-id-456',
1493
+ version: 1
1494
+ }
1495
+ })
1496
+ ```
1497
+
1498
+ </details>
1499
+
1500
+ ---
1501
+
1502
+ <details>
1503
+ <summary>📦 Order Status Message</summary>
1504
+
1505
+ Mengirim kartu status pesanan dengan tampilan native WhatsApp (menggunakan `order_status` native flow, dibungkus view once).
1506
+
1507
+ ```js
1508
+ await sock.sendMessage(jid, {
1509
+ orderStatus: {
1510
+ image: 'path/to/image.jpg', // string path, URL, atau Buffer — wajib
1511
+ title: 'Status Pesananmu', // judul header
1512
+ text: 'Pesananmu sedang diproses.',
1513
+ footer: 'Terima kasih sudah belanja!',
1514
+ referenceId: 'ORDER-001', // ID referensi pesanan
1515
+ status: 'PROCESSING', // PROCESSING | COMPLETED | CANCELLED | dst
1516
+ subtotalValue: 50000, // subtotal dalam satuan terkecil
1517
+ subtotalOffset: 100, // pembagi (100 = dalam rupiah)
1518
+ taxValue: 5000,
1519
+ taxOffset: 100,
1520
+ currency: 'IDR'
1521
+ }
1522
+ })
1523
+
1524
+ // Status pesanan selesai
1525
+ await sock.sendMessage(jid, {
1526
+ orderStatus: {
1527
+ image: { url: 'https://example.com/order.jpg' },
1528
+ title: 'Pesanan Selesai! 🎉',
1529
+ text: 'Pesananmu telah dikirim.',
1530
+ referenceId: 'ORDER-789',
1531
+ status: 'COMPLETED',
1532
+ subtotalValue: 150000,
1533
+ subtotalOffset: 100,
1534
+ taxValue: 0,
1535
+ taxOffset: 100,
1536
+ currency: 'IDR'
1537
+ }
1538
+ }, { quoted: m })
1539
+ ```
1540
+
1541
+ > ⚠️ `image` wajib diisi — `orderStatus` selalu dibungkus dalam viewOnceMessage.
1542
+
1543
+ </details>
1544
+
1545
+ ---
1546
+
1547
+ <details>
1548
+ <summary>🛒 Product List Message</summary>
1549
+
1550
+ Menampilkan list produk bisnis (hanya berfungsi di private chat).
1551
+
1552
+ ```js
1553
+ await sock.sendMessage(jid, {
1554
+ text: 'Pilih produk yang kamu inginkan',
1555
+ title: 'Produk Pilihan',
1556
+ buttonText: 'Lihat Daftar Produk',
1557
+ footer: 'Stok terbatas!',
1558
+ businessOwnerJid: '628xxx@s.whatsapp.net',
1559
+ thumbnail: { url: 'https://example.com/thumbnail.jpg' }, // opsional
1560
+ productList: [
1561
+ {
1562
+ title: 'Kategori Makanan',
1563
+ products: [
1564
+ { productId: '111222333' },
1565
+ { productId: '444555666' }
1566
+ ]
1567
+ },
1568
+ {
1569
+ title: 'Kategori Minuman',
1570
+ products: [
1571
+ { productId: '777888999' }
1572
+ ]
1573
+ }
1574
+ ]
1575
+ })
1576
+ ```
1577
+
1578
+ </details>
1579
+
1580
+ ---
1581
+
1301
1582
  <details>
1302
1583
  <summary>🏷️ Status Mention</summary>
1303
1584
 
package/README.md.bak CHANGED
@@ -77,7 +77,11 @@
77
77
  [List Message](#list-message) ·
78
78
  [Template Buttons](#template-buttons) ·
79
79
  [Native Flow](#native-flow) ·
80
- [Carousel](#carousel)
80
+ [Carousel](#carousel) ·
81
+ [Shop Message](#shop-message) ·
82
+ [Collection Message](#collection-message) ·
83
+ [Order Status Message](#order-status-message) ·
84
+ [Product List Message](#product-list-message)
81
85
 
82
86
  🤖 **Rich Message (AI)** —
83
87
  [Text](#addtext) ·
@@ -1259,7 +1263,118 @@ await sock.sendMessage(jid, {
1259
1263
  })
1260
1264
  ```
1261
1265
 
1262
- > **Tipe tombol ditentukan otomatis** dari field yang ada: `id` → quick_reply · `url` → cta_url · `copy` → cta_copy · `call` → cta_call · `sections` → single_select. Bisa juga pakai `name` + `paramsJson` langsung untuk kontrol penuh. `text` atau `buttonText` keduanya diterima. Field `icon` opsional (string uppercase, e.g. `'CHECK'`, `'LINK'`).
1266
+ > **Tipe tombol ditentukan otomatis** dari field yang ada:
1267
+ >
1268
+ > | Field pada button | Native Flow yang dihasilkan |
1269
+ > |---|---|
1270
+ > | `id` | `quick_reply` |
1271
+ > | `url` | `cta_url` |
1272
+ > | `copy` | `cta_copy` |
1273
+ > | `call` | `cta_call` |
1274
+ > | `sections` | `single_select` |
1275
+ > | `catalog` | `cta_catalog` |
1276
+ > | `reminder: true` | `cta_reminder` |
1277
+ > | `cancelReminder: true` | `cta_cancel_reminder` |
1278
+ > | `address: true` | `address_message` |
1279
+ > | `location: true` | `send_location` |
1280
+ > | `webview` | `open_webview` |
1281
+ > | `productId` | `mpm` |
1282
+ > | `transactionId` | `wa_payment_transaction_details` |
1283
+ > | `catalogProduct` | `automated_greeting_message_view_catalog` |
1284
+ > | `flow` | `galaxy_message` (WA Flow) |
1285
+ >
1286
+ > Bisa juga pakai `name` + `paramsJson` langsung untuk kontrol penuh. `text` atau `buttonText` keduanya diterima. Field `icon` opsional (string uppercase, e.g. `'CHECK'`, `'LINK'`).
1287
+
1288
+ ```js
1289
+ // Catalog button — buka katalog bisnis
1290
+ await sock.sendMessage(jid, {
1291
+ text: 'Lihat produk kami',
1292
+ nativeFlow: [
1293
+ { catalog: '628xxx', text: 'Buka Katalog' }
1294
+ ]
1295
+ })
1296
+
1297
+ // Reminder button
1298
+ await sock.sendMessage(jid, {
1299
+ text: 'Ingatkan saya',
1300
+ nativeFlow: [
1301
+ { reminder: true, text: 'Set Pengingat' },
1302
+ { cancelReminder: true, text: 'Batalkan Pengingat' }
1303
+ ]
1304
+ })
1305
+
1306
+ // Address & Location button
1307
+ await sock.sendMessage(jid, {
1308
+ text: 'Butuh info lokasi',
1309
+ nativeFlow: [
1310
+ { address: true, text: 'Bagikan Alamat' },
1311
+ { location: true, text: 'Kirim Lokasi' }
1312
+ ]
1313
+ })
1314
+
1315
+ // Open Webview button
1316
+ await sock.sendMessage(jid, {
1317
+ text: 'Buka halaman web',
1318
+ nativeFlow: [
1319
+ { webview: 'https://example.com', text: 'Buka', inAppWebview: true }
1320
+ ]
1321
+ })
1322
+
1323
+ // MPM — Multi-product message button
1324
+ await sock.sendMessage(jid, {
1325
+ text: 'Produk pilihan',
1326
+ nativeFlow: [
1327
+ { productId: '8816262248471474', text: 'Lihat Produk' }
1328
+ ]
1329
+ })
1330
+
1331
+ // Payment transaction details button
1332
+ await sock.sendMessage(jid, {
1333
+ text: 'Detail pembayaran',
1334
+ nativeFlow: [
1335
+ { transactionId: '12345848', text: 'Lihat Detail' }
1336
+ ]
1337
+ })
1338
+
1339
+ // Automated greeting catalog button
1340
+ await sock.sendMessage(jid, {
1341
+ text: 'Halo! Cek katalog kami',
1342
+ nativeFlow: [
1343
+ {
1344
+ catalogProduct: { bizPhone: '628xxx', productId: '12345' },
1345
+ text: 'Lihat Katalog'
1346
+ }
1347
+ ]
1348
+ })
1349
+
1350
+ // WA Flow (galaxy_message)
1351
+ await sock.sendMessage(jid, {
1352
+ text: 'Isi formulir pendaftaran',
1353
+ nativeFlow: [
1354
+ {
1355
+ flow: {
1356
+ mode: 'published',
1357
+ flowId: '1307913409923914',
1358
+ flowToken: '1:1307913409923914:293680f87029f5a13d1ec5e35e718af3',
1359
+ flowCta: 'Daftar Sekarang',
1360
+ flowAction: 'navigate',
1361
+ flowActionPayload: {
1362
+ screen: 'QUESTION_ONE',
1363
+ params: { user_id: '123456789' }
1364
+ },
1365
+ flowMetadata: {
1366
+ flow_json_version: '201',
1367
+ data_api_protocol: 'v2',
1368
+ flow_name: 'Lead Qualification',
1369
+ data_api_version: 'v2',
1370
+ categories: ['Lead Generation']
1371
+ }
1372
+ },
1373
+ text: 'Buka Flow'
1374
+ }
1375
+ ]
1376
+ })
1377
+ ```
1263
1378
 
1264
1379
  </details>
1265
1380
 
@@ -1298,6 +1413,172 @@ await sock.sendMessage(jid, {
1298
1413
 
1299
1414
  ---
1300
1415
 
1416
+ <details>
1417
+ <summary>🏪 Shop Message</summary>
1418
+
1419
+ Menampilkan storefront toko bisnis WhatsApp. Bisa dengan header teks, gambar, video, dokumen, lokasi, atau produk.
1420
+
1421
+ ```js
1422
+ // Teks biasa
1423
+ await sock.sendMessage(jid, {
1424
+ text: 'Kunjungi toko kami!',
1425
+ title: 'Toko Kami',
1426
+ subtitle: 'Produk terbaik',
1427
+ footer: 'Belanja sekarang',
1428
+ shop: {
1429
+ surface: 1, // 1 | 2 | 3 | 4
1430
+ id: 'https://example.com'
1431
+ }
1432
+ })
1433
+
1434
+ // Dengan gambar
1435
+ await sock.sendMessage(jid, {
1436
+ image: { url: 'https://example.com/banner.jpg' },
1437
+ caption: 'Promo spesial hari ini!',
1438
+ title: 'Toko Kami',
1439
+ subtitle: 'Diskon 50%',
1440
+ footer: 'Tap untuk belanja',
1441
+ hasMediaAttachment: true,
1442
+ shop: {
1443
+ surface: 1,
1444
+ id: 'https://example.com'
1445
+ }
1446
+ })
1447
+
1448
+ // Dengan video
1449
+ await sock.sendMessage(jid, {
1450
+ video: { url: 'https://example.com/promo.mp4' },
1451
+ caption: 'Tonton promo kami!',
1452
+ title: 'Promo Bulan Ini',
1453
+ footer: 'Belanja sekarang',
1454
+ hasMediaAttachment: true,
1455
+ shop: { surface: 2, id: 'https://example.com' }
1456
+ })
1457
+ ```
1458
+
1459
+ </details>
1460
+
1461
+ ---
1462
+
1463
+ <details>
1464
+ <summary>📦 Collection Message</summary>
1465
+
1466
+ Menampilkan koleksi produk dari bisnis WhatsApp.
1467
+
1468
+ ```js
1469
+ // Teks biasa
1470
+ await sock.sendMessage(jid, {
1471
+ text: 'Koleksi terbaru kami',
1472
+ title: 'Koleksi Musim Ini',
1473
+ subtitle: 'Pilihan terbaik',
1474
+ footer: 'Lihat semua',
1475
+ collection: {
1476
+ bizJid: '628xxx@s.whatsapp.net',
1477
+ id: 'collection-id-123',
1478
+ version: 1
1479
+ }
1480
+ })
1481
+
1482
+ // Dengan gambar
1483
+ await sock.sendMessage(jid, {
1484
+ image: { url: 'https://example.com/collection.jpg' },
1485
+ caption: 'Temukan koleksi terbaru!',
1486
+ title: 'Koleksi Baru',
1487
+ subtitle: 'Limited edition',
1488
+ footer: 'Stok terbatas!',
1489
+ hasMediaAttachment: true,
1490
+ collection: {
1491
+ bizJid: '628xxx@s.whatsapp.net',
1492
+ id: 'collection-id-456',
1493
+ version: 1
1494
+ }
1495
+ })
1496
+ ```
1497
+
1498
+ </details>
1499
+
1500
+ ---
1501
+
1502
+ <details>
1503
+ <summary>📦 Order Status Message</summary>
1504
+
1505
+ Mengirim kartu status pesanan dengan tampilan native WhatsApp (menggunakan `order_status` native flow, dibungkus view once).
1506
+
1507
+ ```js
1508
+ await sock.sendMessage(jid, {
1509
+ orderStatus: {
1510
+ image: 'path/to/image.jpg', // string path, URL, atau Buffer — wajib
1511
+ title: 'Status Pesananmu', // judul header
1512
+ text: 'Pesananmu sedang diproses.',
1513
+ footer: 'Terima kasih sudah belanja!',
1514
+ referenceId: 'ORDER-001', // ID referensi pesanan
1515
+ status: 'PROCESSING', // PROCESSING | COMPLETED | CANCELLED | dst
1516
+ subtotalValue: 50000, // subtotal dalam satuan terkecil
1517
+ subtotalOffset: 100, // pembagi (100 = dalam rupiah)
1518
+ taxValue: 5000,
1519
+ taxOffset: 100,
1520
+ currency: 'IDR'
1521
+ }
1522
+ })
1523
+
1524
+ // Status pesanan selesai
1525
+ await sock.sendMessage(jid, {
1526
+ orderStatus: {
1527
+ image: { url: 'https://example.com/order.jpg' },
1528
+ title: 'Pesanan Selesai! 🎉',
1529
+ text: 'Pesananmu telah dikirim.',
1530
+ referenceId: 'ORDER-789',
1531
+ status: 'COMPLETED',
1532
+ subtotalValue: 150000,
1533
+ subtotalOffset: 100,
1534
+ taxValue: 0,
1535
+ taxOffset: 100,
1536
+ currency: 'IDR'
1537
+ }
1538
+ }, { quoted: m })
1539
+ ```
1540
+
1541
+ > ⚠️ `image` wajib diisi — `orderStatus` selalu dibungkus dalam viewOnceMessage.
1542
+
1543
+ </details>
1544
+
1545
+ ---
1546
+
1547
+ <details>
1548
+ <summary>🛒 Product List Message</summary>
1549
+
1550
+ Menampilkan list produk bisnis (hanya berfungsi di private chat).
1551
+
1552
+ ```js
1553
+ await sock.sendMessage(jid, {
1554
+ text: 'Pilih produk yang kamu inginkan',
1555
+ title: 'Produk Pilihan',
1556
+ buttonText: 'Lihat Daftar Produk',
1557
+ footer: 'Stok terbatas!',
1558
+ businessOwnerJid: '628xxx@s.whatsapp.net',
1559
+ thumbnail: { url: 'https://example.com/thumbnail.jpg' }, // opsional
1560
+ productList: [
1561
+ {
1562
+ title: 'Kategori Makanan',
1563
+ products: [
1564
+ { productId: '111222333' },
1565
+ { productId: '444555666' }
1566
+ ]
1567
+ },
1568
+ {
1569
+ title: 'Kategori Minuman',
1570
+ products: [
1571
+ { productId: '777888999' }
1572
+ ]
1573
+ }
1574
+ ]
1575
+ })
1576
+ ```
1577
+
1578
+ </details>
1579
+
1580
+ ---
1581
+
1301
1582
  <details>
1302
1583
  <summary>🏷️ Status Mention</summary>
1303
1584
 
@@ -545,6 +545,37 @@ const prepareNativeFlowButtons = (message) => {
545
545
  else if (hasOptionalProperty(button, 'sections') && !!button.sections) {
546
546
  return { name: 'single_select', buttonParamsJson: JSON.stringify({ title: buttonText || '📋 Select', sections: button.sections, icon: buttonIcon }) };
547
547
  }
548
+ else if (hasOptionalProperty(button, 'catalog') && !!button.catalog) {
549
+ return { name: 'cta_catalog', buttonParamsJson: JSON.stringify({ display_text: buttonText || '🛍️ Catalog', business_phone_number: button.catalog, icon: buttonIcon }) };
550
+ }
551
+ else if (hasOptionalProperty(button, 'reminder') && button.reminder === true) {
552
+ return { name: 'cta_reminder', buttonParamsJson: JSON.stringify({ display_text: buttonText || '⏰ Remind Me', icon: buttonIcon }) };
553
+ }
554
+ else if (hasOptionalProperty(button, 'cancelReminder') && button.cancelReminder === true) {
555
+ return { name: 'cta_cancel_reminder', buttonParamsJson: JSON.stringify({ display_text: buttonText || '❌ Cancel Reminder', icon: buttonIcon }) };
556
+ }
557
+ else if (hasOptionalProperty(button, 'address') && button.address === true) {
558
+ return { name: 'address_message', buttonParamsJson: JSON.stringify({ display_text: buttonText || '📍 Share Address', icon: buttonIcon }) };
559
+ }
560
+ else if (hasOptionalProperty(button, 'location') && button.location === true) {
561
+ return { name: 'send_location', buttonParamsJson: JSON.stringify({ display_text: buttonText || '📍 Send Location', icon: buttonIcon }) };
562
+ }
563
+ else if (hasOptionalProperty(button, 'webview') && !!button.webview) {
564
+ return { name: 'open_webview', buttonParamsJson: JSON.stringify({ title: buttonText || '🌐 Open', link: { in_app_webview: button.inAppWebview !== false, url: button.webview }, icon: buttonIcon }) };
565
+ }
566
+ else if (hasOptionalProperty(button, 'productId') && !!button.productId) {
567
+ return { name: 'mpm', buttonParamsJson: JSON.stringify({ display_text: buttonText || '🛒 View Product', product_id: button.productId, icon: buttonIcon }) };
568
+ }
569
+ else if (hasOptionalProperty(button, 'transactionId') && !!button.transactionId) {
570
+ return { name: 'wa_payment_transaction_details', buttonParamsJson: JSON.stringify({ display_text: buttonText || '💳 Payment Details', transaction_id: button.transactionId, icon: buttonIcon }) };
571
+ }
572
+ else if (hasOptionalProperty(button, 'catalogProduct') && !!button.catalogProduct) {
573
+ return { name: 'automated_greeting_message_view_catalog', buttonParamsJson: JSON.stringify({ display_text: buttonText || '🛍️ View Catalog', business_phone_number: button.catalogProduct.bizPhone, catalog_product_id: button.catalogProduct.productId, icon: buttonIcon }) };
574
+ }
575
+ else if (hasOptionalProperty(button, 'flow') && !!button.flow) {
576
+ const f = button.flow;
577
+ return { name: 'galaxy_message', buttonParamsJson: JSON.stringify({ mode: f.mode || 'published', flow_message_version: f.flowMessageVersion || '3', flow_token: f.flowToken, flow_id: f.flowId, flow_cta: buttonText || f.flowCta || '▶️ Open Flow', flow_action: f.flowAction || 'navigate', flow_action_payload: f.flowActionPayload, flow_metadata: f.flowMetadata, icon: buttonIcon }) };
578
+ }
548
579
  return button;
549
580
  }),
550
581
  messageParamsJson: JSON.stringify(messageParamsJson),
@@ -919,6 +950,80 @@ export const generateWAMessageContent = async (message, options) => {
919
950
  }
920
951
  };
921
952
  }
953
+ else if (hasNonNullishProperty(message, 'orderStatus')) {
954
+ const os = message.orderStatus;
955
+ if (!os.image) {
956
+ throw new Boom('"image" wajib diisi untuk orderStatus', { statusCode: 400 });
957
+ }
958
+ let imageInput = os.image;
959
+ if (typeof imageInput === 'string' && !imageInput.startsWith('http://') && !imageInput.startsWith('https://')) {
960
+ imageInput = await fs.readFile(imageInput);
961
+ }
962
+ const media = await prepareWAMessageMedia({ image: imageInput }, options);
963
+ m = {
964
+ viewOnceMessage: {
965
+ message: {
966
+ messageContextInfo: {
967
+ deviceListMetadata: {},
968
+ deviceListMetadataVersion: 2
969
+ },
970
+ interactiveMessage: proto.Message.InteractiveMessage.create({
971
+ header: {
972
+ title: os.title || 'Status Pesanan',
973
+ hasMediaAttachment: true,
974
+ ...media
975
+ },
976
+ body: { text: os.text || 'Silakan cek status pesanan Anda.' },
977
+ footer: { text: os.footer || '' },
978
+ nativeFlowMessage: {
979
+ buttons: [{
980
+ name: 'order_status',
981
+ buttonParamsJson: JSON.stringify({
982
+ reference_id: os.referenceId || 'ORDER-001',
983
+ order: {
984
+ status: os.status || 'PROCESSING',
985
+ subtotal: {
986
+ value: os.subtotalValue || 0,
987
+ offset: os.subtotalOffset || 100
988
+ },
989
+ tax: {
990
+ value: os.taxValue || 0,
991
+ offset: os.taxOffset || 100
992
+ },
993
+ currency: os.currency || 'IDR'
994
+ }
995
+ })
996
+ }]
997
+ }
998
+ })
999
+ }
1000
+ }
1001
+ };
1002
+ }
1003
+ else if (hasNonNullishProperty(message, 'productList')) {
1004
+ let thumbnail = null;
1005
+ if (message.thumbnail) {
1006
+ const { imageMessage } = await prepareWAMessageMedia({ image: message.thumbnail }, options);
1007
+ thumbnail = imageMessage;
1008
+ }
1009
+ m = {
1010
+ listMessage: {
1011
+ title: message.title,
1012
+ buttonText: message.buttonText || 'Lihat Produk',
1013
+ footerText: message.footer,
1014
+ description: message.text,
1015
+ productListInfo: {
1016
+ productSections: message.productList,
1017
+ headerImage: {
1018
+ productId: message.productList?.[0]?.products?.[0]?.productId,
1019
+ jpegThumbnail: thumbnail?.jpegThumbnail || null
1020
+ },
1021
+ businessOwnerJid: message.businessOwnerJid
1022
+ },
1023
+ listType: proto.Message.ListMessage.ListType.PRODUCT_LIST
1024
+ }
1025
+ };
1026
+ }
922
1027
  else if (hasNonNullishProperty(message, 'buttonsMessage')) {
923
1028
  // Direct buttonsMessage passthrough — supports headerType 6 (locationMessage), etc.
924
1029
  const btnMsg = { ...message.buttonsMessage };
@@ -1171,6 +1276,74 @@ export const generateWAMessageContent = async (message, options) => {
1171
1276
  }
1172
1277
  m = { interactiveMessage };
1173
1278
  }
1279
+ else if (hasNonNullishProperty(message, 'shop')) {
1280
+ const interactiveMessage = {
1281
+ shopStorefrontMessage: {
1282
+ surface: message.shop.surface || 1,
1283
+ id: message.shop.id,
1284
+ messageVersion: 1
1285
+ }
1286
+ };
1287
+ if (hasOptionalProperty(message, 'caption')) {
1288
+ // Media header mode — m already contains mediaMessage from chain 1 else block
1289
+ const mediaKey = Object.keys(m)[0]; // e.g. 'videoMessage', 'imageMessage'
1290
+ interactiveMessage.header = {
1291
+ title: message.title || '',
1292
+ subtitle: message.subtitle || '',
1293
+ hasMediaAttachment: true,
1294
+ [mediaKey]: m[mediaKey]
1295
+ };
1296
+ interactiveMessage.body = { text: message.caption };
1297
+ }
1298
+ else if (hasOptionalProperty(message, 'text')) {
1299
+ interactiveMessage.body = { text: message.text };
1300
+ if (hasOptionalProperty(message, 'title')) {
1301
+ interactiveMessage.header = {
1302
+ title: message.title,
1303
+ subtitle: message.subtitle || null,
1304
+ hasMediaAttachment: false
1305
+ };
1306
+ }
1307
+ }
1308
+ if (hasOptionalProperty(message, 'footer')) {
1309
+ interactiveMessage.footer = { text: message.footer };
1310
+ }
1311
+ m = { interactiveMessage };
1312
+ }
1313
+ else if (hasNonNullishProperty(message, 'collection')) {
1314
+ const interactiveMessage = {
1315
+ collectionMessage: {
1316
+ bizJid: message.collection.bizJid,
1317
+ id: message.collection.id,
1318
+ messageVersion: message.collection.version || 1
1319
+ }
1320
+ };
1321
+ if (hasOptionalProperty(message, 'caption')) {
1322
+ // Media header mode
1323
+ const mediaKey = Object.keys(m)[0];
1324
+ interactiveMessage.header = {
1325
+ title: message.title || '',
1326
+ subtitle: message.subtitle || '',
1327
+ hasMediaAttachment: true,
1328
+ [mediaKey]: m[mediaKey]
1329
+ };
1330
+ interactiveMessage.body = { text: message.caption };
1331
+ }
1332
+ else if (hasOptionalProperty(message, 'text')) {
1333
+ interactiveMessage.body = { text: message.text };
1334
+ if (hasOptionalProperty(message, 'title')) {
1335
+ interactiveMessage.header = {
1336
+ title: message.title,
1337
+ subtitle: message.subtitle || null,
1338
+ hasMediaAttachment: false
1339
+ };
1340
+ }
1341
+ }
1342
+ if (hasOptionalProperty(message, 'footer')) {
1343
+ interactiveMessage.footer = { text: message.footer };
1344
+ }
1345
+ m = { interactiveMessage };
1346
+ }
1174
1347
  else if (hasNonNullishProperty(message, 'requestPaymentFrom')) {
1175
1348
  const requestPaymentMessage = {
1176
1349
  amount: {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@nuiisweety/baileys",
3
3
  "type": "module",
4
- "version": "0.1.12",
4
+ "version": "0.1.14",
5
5
  "description": "A WebSockets library for interacting with WhatsApp Web — forked STRICTLY from @whiskeysockets/baileys only, NOT from any other baileys fork. Modified by NuiiSweety.",
6
6
  "keywords": [
7
7
  "whatsapp",