supun-bailey-vip 1.0.3 → 1.0.5
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 +105 -0
- package/lib/Defaults/index.js +1 -0
- package/lib/MessageBuilder/bot-signature.js +1 -1
- package/lib/MessageBuilder/extras.js +1 -1
- package/lib/MessageBuilder/metaai.js +1 -1
- package/lib/Socket/messages-send.js +167 -251
- package/lib/Types/Message.js +3 -0
- package/lib/Utils/auth-store.d.ts +1 -1
- package/lib/Utils/auth-store.js +1 -1
- package/lib/Utils/group-metadata-cache.d.ts +1 -1
- package/lib/Utils/group-metadata-cache.js +1 -1
- package/lib/Utils/html-app.js +1 -1
- package/lib/Utils/html-multiplayer.js +1 -1
- package/lib/Utils/link-preview-metadata.js +1 -1
- package/lib/Utils/messages.js +112 -13
- package/lib/Utils/native-flow.js +1 -1
- package/lib/Utils/offline-node-processor.js +1 -1
- package/lib/Utils/optional-media.js +1 -1
- package/lib/Utils/payment-messages.js +1 -1
- package/lib/Utils/pre-key-manager.d.ts +1 -1
- package/lib/Utils/pre-key-manager.js +1 -1
- package/lib/Utils/scheduled-message.js +1 -1
- package/lib/Utils/sender-key-memory.d.ts +1 -1
- package/lib/Utils/sender-key-memory.js +1 -1
- package/lib/Utils/status-stickers.js +1 -1
- package/lib/Utils/sync-action-utils.d.ts +1 -1
- package/lib/Utils/sync-action-utils.js +1 -1
- package/lib/Utils/ttl-cache.d.ts +1 -1
- package/lib/Utils/ttl-cache.js +2 -2
- package/lib/Utils/use-mongo-auth-state.d.ts +1 -1
- package/lib/Utils/use-mongo-auth-state.js +1 -1
- package/lib/Utils/use-mysql-auth-state.d.ts +1 -1
- package/lib/Utils/use-mysql-auth-state.js +1 -1
- package/lib/Utils/use-postgres-auth-state.d.ts +1 -1
- package/lib/Utils/use-postgres-auth-state.js +1 -1
- package/lib/Utils/use-redis-auth-state.d.ts +1 -1
- package/lib/Utils/use-redis-auth-state.js +1 -1
- package/lib/Utils/use-single-file-auth-state.d.ts +1 -1
- package/lib/Utils/use-single-file-auth-state.js +1 -1
- package/lib/Utils/use-sqlite-auth-state.d.ts +1 -1
- package/lib/Utils/use-sqlite-auth-state.js +1 -1
- package/lib/Utils/useNekoDBAuth.js +1 -1
- package/lib/Voip/audio-feeder.d.ts +1 -1
- package/lib/Voip/audio-feeder.js +1 -1
- package/lib/Voip/index.d.ts +1 -1
- package/lib/Voip/index.js +1 -1
- package/lib/Voip/relay-transport.d.ts +1 -1
- package/lib/Voip/relay-transport.js +1 -1
- package/lib/Voip/signaling.d.ts +1 -1
- package/lib/Voip/signaling.js +2 -2
- package/lib/Voip/types.d.ts +1 -1
- package/lib/Voip/types.js +1 -1
- package/lib/Voip/video-feeder.d.ts +1 -1
- package/lib/Voip/video-feeder.js +1 -1
- package/lib/Voip/wasm-engine.d.ts +1 -1
- package/lib/Voip/wasm-engine.js +2 -2
- package/lib/Voip/worker-bootstrap.js +2 -2
- package/lib/WABinary/generic-utils.js +106 -1
- package/lib/foundation/license.js +25 -105
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -651,6 +651,111 @@ carousel.addCard({
|
|
|
651
651
|
await sock.sendMessage(jid, carousel.run())
|
|
652
652
|
```
|
|
653
653
|
|
|
654
|
+
### 🔘 Direct Buttons & Native Flow in `sendMessage`
|
|
655
|
+
|
|
656
|
+
You can also send buttons and interactive messages directly without builders:
|
|
657
|
+
|
|
658
|
+
```javascript
|
|
659
|
+
// 1. Buttons with Media & Single Select
|
|
660
|
+
await sock.sendMessage(jid, {
|
|
661
|
+
image: { url: 'https://example.com/banner.jpg' },
|
|
662
|
+
caption: '👆 Buttons with Native Flow!',
|
|
663
|
+
footer: 'Powered by supun-bailey-vip',
|
|
664
|
+
buttons: [
|
|
665
|
+
{ text: '👋 Rating', id: '#rating' },
|
|
666
|
+
{
|
|
667
|
+
text: '📋 Select Option',
|
|
668
|
+
sections: [
|
|
669
|
+
{
|
|
670
|
+
title: 'Section 1',
|
|
671
|
+
rows: [{ title: 'Feature A', id: '#feat_a', description: 'Explore Feature A' }]
|
|
672
|
+
}
|
|
673
|
+
]
|
|
674
|
+
}
|
|
675
|
+
]
|
|
676
|
+
})
|
|
677
|
+
|
|
678
|
+
// 2. Full Native Flow with Offers & Bottom Sheet
|
|
679
|
+
await sock.sendMessage(jid, {
|
|
680
|
+
text: 'Interactive Menu with Options',
|
|
681
|
+
footer: 'supun-bailey-vip',
|
|
682
|
+
optionText: '👉 Select Options', // Bottom sheet dropdown list
|
|
683
|
+
optionTitle: '📄 Options List',
|
|
684
|
+
offerText: '🏷️ Exclusive Promo Code!', // Limited-time offer card
|
|
685
|
+
offerCode: 'SUPUN2026',
|
|
686
|
+
offerUrl: 'https://supunofc.site',
|
|
687
|
+
offerExpiration: Date.now() + 3600000,
|
|
688
|
+
nativeFlow: [
|
|
689
|
+
{ text: '👋 Quick Reply', id: '#reply', icon: 'review' },
|
|
690
|
+
{ text: '📞 Call Us', call: '+94712345678' },
|
|
691
|
+
{ text: '📋 Copy Code', copy: 'SUPUN2026' },
|
|
692
|
+
{ text: '🌐 Website', url: 'https://supunofc.site', useWebview: true },
|
|
693
|
+
{ text: '📍 Send Location', sendLocation: true },
|
|
694
|
+
{
|
|
695
|
+
text: '📋 Menu Options',
|
|
696
|
+
sections: [
|
|
697
|
+
{ title: 'Categories', rows: [{ title: 'Category 1', id: '#cat1' }] }
|
|
698
|
+
]
|
|
699
|
+
}
|
|
700
|
+
],
|
|
701
|
+
interactiveAsTemplate: false // set true to wrap into template
|
|
702
|
+
})
|
|
703
|
+
|
|
704
|
+
// 3. Carousel Cards directly in sendMessage
|
|
705
|
+
await sock.sendMessage(jid, {
|
|
706
|
+
text: 'Featured Product Cards',
|
|
707
|
+
footer: 'Swipe cards to view',
|
|
708
|
+
cards: [
|
|
709
|
+
{
|
|
710
|
+
image: { url: 'https://example.com/item1.jpg' },
|
|
711
|
+
caption: 'Smart Watch Series 9',
|
|
712
|
+
footer: 'In Stock',
|
|
713
|
+
nativeFlow: [
|
|
714
|
+
{ text: '🛒 Buy Now', id: '#buy_1' },
|
|
715
|
+
{ text: '🌐 Specs', url: 'https://supunofc.site' }
|
|
716
|
+
]
|
|
717
|
+
},
|
|
718
|
+
{
|
|
719
|
+
image: { url: 'https://example.com/item2.jpg' },
|
|
720
|
+
caption: 'Wireless Earbuds',
|
|
721
|
+
footer: 'Best Seller',
|
|
722
|
+
nativeFlow: [
|
|
723
|
+
{ text: '🛒 Buy Now', id: '#buy_2' }
|
|
724
|
+
]
|
|
725
|
+
}
|
|
726
|
+
]
|
|
727
|
+
})
|
|
728
|
+
|
|
729
|
+
// 4. Hydrated Template Buttons
|
|
730
|
+
await sock.sendMessage(jid, {
|
|
731
|
+
text: 'Template Message with Action Buttons',
|
|
732
|
+
footer: 'supun-bailey-vip',
|
|
733
|
+
templateButtons: [
|
|
734
|
+
{ text: '👉 Quick Action', id: '#action' },
|
|
735
|
+
{ text: '🌐 Visit Website', url: 'https://supunofc.site' },
|
|
736
|
+
{ text: '📞 Call Support', call: '+94712345678' }
|
|
737
|
+
]
|
|
738
|
+
})
|
|
739
|
+
|
|
740
|
+
// 5. Native Flow & Button Responses
|
|
741
|
+
// Responding to a Flow
|
|
742
|
+
await sock.sendMessage(jid, {
|
|
743
|
+
flowReply: {
|
|
744
|
+
name: 'flow_name',
|
|
745
|
+
paramsJson: JSON.stringify({ key: 'value' })
|
|
746
|
+
}
|
|
747
|
+
})
|
|
748
|
+
|
|
749
|
+
// Responding to a Button
|
|
750
|
+
await sock.sendMessage(jid, {
|
|
751
|
+
buttonReply: {
|
|
752
|
+
displayText: 'Selected Option',
|
|
753
|
+
id: '#action'
|
|
754
|
+
},
|
|
755
|
+
type: 'plain' // or 'template'
|
|
756
|
+
})
|
|
757
|
+
```
|
|
758
|
+
|
|
654
759
|
---
|
|
655
760
|
|
|
656
761
|
## ☁️ Dugong Cloud Engine (`sock.cloud`)
|
package/lib/Defaults/index.js
CHANGED
|
@@ -45,6 +45,7 @@ export const DEFAULT_CACHE_TTLS = {
|
|
|
45
45
|
CALL_OFFER: 5 * 60, // 5 minutes
|
|
46
46
|
USER_DEVICES: 5 * 60 // 5 minutes
|
|
47
47
|
};
|
|
48
|
+
export const DEFAULT_CACHE_MAX_KEYS = 1000;
|
|
48
49
|
export const DEFAULT_CONNECTION_CONFIG = {
|
|
49
50
|
version: version,
|
|
50
51
|
browser: Browsers.macOS('Chrome'),
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*
|
|
1
|
+
/* supun-bailey-vip maintained distribution. Upstream notices and license are preserved in LICENSE and NOTICE.md. */
|
|
2
2
|
import { X509Certificate, verify as cryptoVerify } from 'crypto'
|
|
3
3
|
|
|
4
4
|
export const BOT_SIGNATURE_VERSION = '1'
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*
|
|
1
|
+
/* supun-bailey-vip maintained distribution. Upstream notices and license are preserved in LICENSE and NOTICE.md. */
|
|
2
2
|
import { randomUUID } from 'crypto'
|
|
3
3
|
import { AIRich } from './index.js'
|
|
4
4
|
import { extractMessageContent, generateWAMessageFromContent, prepareWAMessageMedia } from '../Utils/messages.js'
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*
|
|
1
|
+
/* supun-bailey-vip maintained distribution. Upstream notices and license are preserved in LICENSE and NOTICE.md. */
|
|
2
2
|
import { AIRich } from './index.js'
|
|
3
3
|
import { AddonActionType } from './extras.js'
|
|
4
4
|
import { generateWAMessageFromContent } from '../Utils/messages.js'
|