kashmiribailey 1.4.7
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 +116 -0
- package/WAProto/GenerateStatics.sh +4 -0
- package/WAProto/WAProto.proto +4775 -0
- package/WAProto/index.d.ts +55057 -0
- package/WAProto/index.js +169661 -0
- package/WAProto/index.ts.ts +53473 -0
- package/lib/Defaults/baileys-version.json +3 -0
- package/lib/Defaults/index.d.ts +62 -0
- package/lib/Defaults/index.js +117 -0
- package/lib/Signal/Group/ciphertext-message.d.ts +9 -0
- package/lib/Signal/Group/ciphertext-message.js +15 -0
- package/lib/Signal/Group/group-session-builder.d.ts +14 -0
- package/lib/Signal/Group/group-session-builder.js +64 -0
- package/lib/Signal/Group/group_cipher.d.ts +17 -0
- package/lib/Signal/Group/group_cipher.js +96 -0
- package/lib/Signal/Group/index.d.ts +11 -0
- package/lib/Signal/Group/index.js +57 -0
- package/lib/Signal/Group/keyhelper.d.ts +10 -0
- package/lib/Signal/Group/keyhelper.js +55 -0
- package/lib/Signal/Group/queue-job.d.ts +1 -0
- package/lib/Signal/Group/queue-job.js +57 -0
- package/lib/Signal/Group/sender-chain-key.d.ts +13 -0
- package/lib/Signal/Group/sender-chain-key.js +34 -0
- package/lib/Signal/Group/sender-key-distribution-message.d.ts +16 -0
- package/lib/Signal/Group/sender-key-distribution-message.js +66 -0
- package/lib/Signal/Group/sender-key-message.d.ts +18 -0
- package/lib/Signal/Group/sender-key-message.js +69 -0
- package/lib/Signal/Group/sender-key-name.d.ts +17 -0
- package/lib/Signal/Group/sender-key-name.js +51 -0
- package/lib/Signal/Group/sender-key-record.d.ts +30 -0
- package/lib/Signal/Group/sender-key-record.js +53 -0
- package/lib/Signal/Group/sender-key-state.d.ts +38 -0
- package/lib/Signal/Group/sender-key-state.js +99 -0
- package/lib/Signal/Group/sender-message-key.d.ts +11 -0
- package/lib/Signal/Group/sender-message-key.js +29 -0
- package/lib/Signal/libsignal.d.ts +3 -0
- package/lib/Signal/libsignal.js +174 -0
- package/lib/Socket/Client/index.d.ts +2 -0
- package/lib/Socket/Client/index.js +18 -0
- package/lib/Socket/Client/types.d.ts +16 -0
- package/lib/Socket/Client/types.js +13 -0
- package/lib/Socket/Client/websocket.d.ts +13 -0
- package/lib/Socket/Client/websocket.js +111 -0
- package/lib/Socket/business.d.ts +172 -0
- package/lib/Socket/business.js +260 -0
- package/lib/Socket/chats.d.ts +82 -0
- package/lib/Socket/chats.js +871 -0
- package/lib/Socket/groups.d.ts +124 -0
- package/lib/Socket/groups.js +332 -0
- package/lib/Socket/index.d.ts +172 -0
- package/lib/Socket/index.js +10 -0
- package/lib/Socket/messages-recv.d.ts +161 -0
- package/lib/Socket/messages-recv.js +1054 -0
- package/lib/Socket/messages-send.d.ts +151 -0
- package/lib/Socket/messages-send.js +1057 -0
- package/lib/Socket/newsletter.d.ts +136 -0
- package/lib/Socket/newsletter.js +268 -0
- package/lib/Socket/setup.js +481 -0
- package/lib/Socket/setup.ts +623 -0
- package/lib/Socket/socket.d.ts +270 -0
- package/lib/Socket/socket.js +654 -0
- package/lib/Socket/usync.d.ts +36 -0
- package/lib/Socket/usync.js +70 -0
- package/lib/Store/index.d.ts +2 -0
- package/lib/Store/index.js +8 -0
- package/lib/Store/make-in-memory-store.d.ts +118 -0
- package/lib/Store/make-in-memory-store.js +439 -0
- package/lib/Store/make-ordered-dictionary.d.ts +13 -0
- package/lib/Store/make-ordered-dictionary.js +81 -0
- package/lib/Store/object-repository.d.ts +10 -0
- package/lib/Store/object-repository.js +27 -0
- package/lib/Types/Auth.d.ts +103 -0
- package/lib/Types/Auth.js +2 -0
- package/lib/Types/Call.d.ts +13 -0
- package/lib/Types/Call.js +2 -0
- package/lib/Types/Chat.d.ts +109 -0
- package/lib/Types/Chat.js +4 -0
- package/lib/Types/Contact.d.ts +23 -0
- package/lib/Types/Contact.js +2 -0
- package/lib/Types/Events.d.ts +199 -0
- package/lib/Types/Events.js +2 -0
- package/lib/Types/GroupMetadata.d.ts +64 -0
- package/lib/Types/GroupMetadata.js +2 -0
- package/lib/Types/Label.d.ts +35 -0
- package/lib/Types/Label.js +27 -0
- package/lib/Types/LabelAssociation.d.ts +29 -0
- package/lib/Types/LabelAssociation.js +9 -0
- package/lib/Types/Message.d.ts +400 -0
- package/lib/Types/Message.js +7 -0
- package/lib/Types/Newsletter.d.ts +79 -0
- package/lib/Types/Newsletter.js +18 -0
- package/lib/Types/Product.d.ts +78 -0
- package/lib/Types/Product.js +2 -0
- package/lib/Types/Signal.d.ts +57 -0
- package/lib/Types/Signal.js +2 -0
- package/lib/Types/Socket.d.ts +119 -0
- package/lib/Types/Socket.js +2 -0
- package/lib/Types/State.d.ts +27 -0
- package/lib/Types/State.js +2 -0
- package/lib/Types/USync.d.ts +25 -0
- package/lib/Types/USync.js +2 -0
- package/lib/Types/index.d.ts +64 -0
- package/lib/Types/index.js +42 -0
- package/lib/Utils/auth-utils.d.ts +18 -0
- package/lib/Utils/auth-utils.js +199 -0
- package/lib/Utils/baileys-event-stream.d.ts +16 -0
- package/lib/Utils/baileys-event-stream.js +63 -0
- package/lib/Utils/business.d.ts +22 -0
- package/lib/Utils/business.js +234 -0
- package/lib/Utils/chat-utils.d.ts +70 -0
- package/lib/Utils/chat-utils.js +730 -0
- package/lib/Utils/crypto.d.ts +40 -0
- package/lib/Utils/crypto.js +193 -0
- package/lib/Utils/decode-wa-message.d.ts +35 -0
- package/lib/Utils/decode-wa-message.js +207 -0
- package/lib/Utils/event-buffer.d.ts +35 -0
- package/lib/Utils/event-buffer.js +518 -0
- package/lib/Utils/generics.d.ts +89 -0
- package/lib/Utils/generics.js +441 -0
- package/lib/Utils/history.d.ts +19 -0
- package/lib/Utils/history.js +94 -0
- package/lib/Utils/index.d.ts +17 -0
- package/lib/Utils/index.js +33 -0
- package/lib/Utils/link-preview.d.ts +21 -0
- package/lib/Utils/link-preview.js +126 -0
- package/lib/Utils/logger.d.ts +11 -0
- package/lib/Utils/logger.js +7 -0
- package/lib/Utils/lt-hash.d.ts +12 -0
- package/lib/Utils/lt-hash.js +51 -0
- package/lib/Utils/make-mutex.d.ts +7 -0
- package/lib/Utils/make-mutex.js +43 -0
- package/lib/Utils/messages-media.d.ts +120 -0
- package/lib/Utils/messages-media.js +980 -0
- package/lib/Utils/messages.d.ts +80 -0
- package/lib/Utils/messages.js +1101 -0
- package/lib/Utils/noise-handler.d.ts +19 -0
- package/lib/Utils/noise-handler.js +150 -0
- package/lib/Utils/process-message.d.ts +42 -0
- package/lib/Utils/process-message.js +404 -0
- package/lib/Utils/signal.d.ts +33 -0
- package/lib/Utils/signal.js +153 -0
- package/lib/Utils/use-multi-file-auth-state.d.ts +12 -0
- package/lib/Utils/use-multi-file-auth-state.js +125 -0
- package/lib/Utils/validate-connection.d.ts +10 -0
- package/lib/Utils/validate-connection.js +229 -0
- package/lib/WABinary/constants.d.ts +27 -0
- package/lib/WABinary/constants.js +1303 -0
- package/lib/WABinary/decode.d.ts +6 -0
- package/lib/WABinary/decode.js +265 -0
- package/lib/WABinary/encode.d.ts +2 -0
- package/lib/WABinary/encode.js +250 -0
- package/lib/WABinary/generic-utils.d.ts +14 -0
- package/lib/WABinary/generic-utils.js +110 -0
- package/lib/WABinary/index.d.ts +5 -0
- package/lib/WABinary/index.js +21 -0
- package/lib/WABinary/jid-utils.d.ts +37 -0
- package/lib/WABinary/jid-utils.js +85 -0
- package/lib/WABinary/jid-utils.js.bak +83 -0
- package/lib/WABinary/types.d.ts +18 -0
- package/lib/WABinary/types.js +2 -0
- package/lib/WAM/BinaryInfo.d.ts +8 -0
- package/lib/WAM/BinaryInfo.js +13 -0
- package/lib/WAM/constants.d.ts +38 -0
- package/lib/WAM/constants.js +15350 -0
- package/lib/WAM/encode.d.ts +2 -0
- package/lib/WAM/encode.js +155 -0
- package/lib/WAM/index.d.ts +3 -0
- package/lib/WAM/index.js +19 -0
- package/lib/WAUSync/Protocols/USyncContactProtocol.d.ts +9 -0
- package/lib/WAUSync/Protocols/USyncContactProtocol.js +32 -0
- package/lib/WAUSync/Protocols/USyncDeviceProtocol.d.ts +22 -0
- package/lib/WAUSync/Protocols/USyncDeviceProtocol.js +57 -0
- package/lib/WAUSync/Protocols/USyncDisappearingModeProtocol.d.ts +12 -0
- package/lib/WAUSync/Protocols/USyncDisappearingModeProtocol.js +30 -0
- package/lib/WAUSync/Protocols/USyncStatusProtocol.d.ts +12 -0
- package/lib/WAUSync/Protocols/USyncStatusProtocol.js +42 -0
- package/lib/WAUSync/Protocols/UsyncBotProfileProtocol.d.ts +25 -0
- package/lib/WAUSync/Protocols/UsyncBotProfileProtocol.js +53 -0
- package/lib/WAUSync/Protocols/UsyncLIDProtocol.d.ts +8 -0
- package/lib/WAUSync/Protocols/UsyncLIDProtocol.js +24 -0
- package/lib/WAUSync/Protocols/index.d.ts +4 -0
- package/lib/WAUSync/Protocols/index.js +20 -0
- package/lib/WAUSync/USyncQuery.d.ts +28 -0
- package/lib/WAUSync/USyncQuery.js +89 -0
- package/lib/WAUSync/USyncUser.d.ts +12 -0
- package/lib/WAUSync/USyncUser.js +26 -0
- package/lib/WAUSync/index.d.ts +3 -0
- package/lib/WAUSync/index.js +19 -0
- package/lib/index.d.ts +16 -0
- package/lib/index.js +53 -0
- package/package.json +100 -0
package/README.md
ADDED
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
<h1 align="center">
|
|
2
|
+
Angularsockets
|
|
3
|
+
</h1>
|
|
4
|
+
|
|
5
|
+
<p align="center">
|
|
6
|
+
<img src="https://dabby.vercel.app/menu.jpg" width="400" style="border-radius:8px;">
|
|
7
|
+
</p>
|
|
8
|
+
|
|
9
|
+
<p align="center">
|
|
10
|
+
<strong>Enterprise-Grade WhatsApp Business API</strong>
|
|
11
|
+
</p>
|
|
12
|
+
|
|
13
|
+
<p align="center">
|
|
14
|
+
<sub>High-performance modified Baileys library for scalable WhatsApp integrations</sub>
|
|
15
|
+
</p>
|
|
16
|
+
|
|
17
|
+
---
|
|
18
|
+
|
|
19
|
+
# 🎀 Angularsockets
|
|
20
|
+
|
|
21
|
+
> **Angularsockets** a mod og *Baileys WhatsApp Web API* by **Mr Frank**
|
|
22
|
+
---
|
|
23
|
+
|
|
24
|
+
## ✨ Mafeatures
|
|
25
|
+
✅ Stabil & lasts long
|
|
26
|
+
|
|
27
|
+
✅ Support multi-device (MD)
|
|
28
|
+
|
|
29
|
+
✅ Support buttons
|
|
30
|
+
|
|
31
|
+
✅ SSupport Custom Pairing Code
|
|
32
|
+
|
|
33
|
+
✅ Support Group
|
|
34
|
+
|
|
35
|
+
---
|
|
36
|
+
|
|
37
|
+
## 📦 Installation
|
|
38
|
+
Install npm
|
|
39
|
+
```bash
|
|
40
|
+
npm i kashmiribailey
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
## Handling Events
|
|
44
|
+
|
|
45
|
+
- Baileys uses the EventEmitter syntax for events.
|
|
46
|
+
They're all nicely typed up, so you shouldn't have any issues with an Intellisense editor like VS Code.
|
|
47
|
+
|
|
48
|
+
> [!IMPORTANT]
|
|
49
|
+
> **The events are [these](https://baileys.whiskeysockets.io/types/BaileysEventMap.html)**, it's important you see all events
|
|
50
|
+
|
|
51
|
+
You can listen to these events like this:
|
|
52
|
+
```ts
|
|
53
|
+
const sock = makeWASocket()
|
|
54
|
+
sock.ev.on('messages.upsert', ({ messages }) => {
|
|
55
|
+
console.log('got messages', messages)
|
|
56
|
+
})
|
|
57
|
+
```
|
|
58
|
+
This is a fix mention @lid for bots working in groups
|
|
59
|
+
|
|
60
|
+
```js
|
|
61
|
+
|
|
62
|
+
sock.ev.on('messages.upsert', async chatUpdate => {
|
|
63
|
+
try {
|
|
64
|
+
mek = chatUpdate.messages[0]
|
|
65
|
+
if (!mek.message) return
|
|
66
|
+
mek.message = (Object.keys(mek.message)[0] === 'ephemeralMessage') ? mek.message.ephemeralMessage.message : mek.message
|
|
67
|
+
const m = mek
|
|
68
|
+
const isGroup = m.key.remoteJid.endsWith('@g.us');
|
|
69
|
+
const mentionedJid = mek.message?.extendedTextMessage?.contextInfo?.mentionedJid || [];
|
|
70
|
+
if (isGroup && Array.isArray(mentionedJid) && mentionedJid.some(j => j.endsWith('@lid'))) {
|
|
71
|
+
const groupMetadata = await sock.groupMetadata(mek.key.remoteJid);
|
|
72
|
+
const resolvedMentions = mentionedJid.map(jid => {
|
|
73
|
+
if (jid.endsWith('@lid')) {
|
|
74
|
+
const match = groupMetadata.participants.find(p => p.id === jid);
|
|
75
|
+
return match?.jid || jid;
|
|
76
|
+
}
|
|
77
|
+
return jid;
|
|
78
|
+
});
|
|
79
|
+
mek.message.extendedTextMessage.contextInfo.mentionedJid = resolvedMentions;
|
|
80
|
+
const lidMap = {};
|
|
81
|
+
mentionedJid.forEach(originalLid => {
|
|
82
|
+
if (originalLid.endsWith('@lid')) {
|
|
83
|
+
const match = groupMetadata.participants.find(p => p.id === originalLid);
|
|
84
|
+
if (match && match.jid) {
|
|
85
|
+
const jidNumber = match.jid.split('@')[0];
|
|
86
|
+
const lidNumber = originalLid.split('@')[0];
|
|
87
|
+
lidMap[lidNumber] = jidNumber;
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
});
|
|
91
|
+
const replaceLidInText = (text) => {
|
|
92
|
+
if (!text) return text;
|
|
93
|
+
Object.entries(lidMap).forEach(([lidNum, jidNum]) => {
|
|
94
|
+
const regex = new RegExp(`@${lidNum}\\b`, 'g');
|
|
95
|
+
text = text.replace(regex, `@${jidNum}`);
|
|
96
|
+
});
|
|
97
|
+
return text;
|
|
98
|
+
};
|
|
99
|
+
if (mek.message.conversation) {
|
|
100
|
+
mek.message.conversation = replaceLidInText(mek.message.conversation);
|
|
101
|
+
}
|
|
102
|
+
if (mek.message.extendedTextMessage?.text) {
|
|
103
|
+
mek.message.extendedTextMessage.text = replaceLidInText(mek.message.extendedTextMessage.text);
|
|
104
|
+
}
|
|
105
|
+
let msg = {
|
|
106
|
+
messages: [proto.WebMessageInfo.fromObject(mek)],
|
|
107
|
+
type: "append",
|
|
108
|
+
};
|
|
109
|
+
return conn.ev.emit("messages.upsert", msg);
|
|
110
|
+
}
|
|
111
|
+
} catch (err) {
|
|
112
|
+
|
|
113
|
+
}
|
|
114
|
+
});
|
|
115
|
+
|
|
116
|
+
```
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
yarn pbjs -t static-module -w commonjs -o ./WAProto/index.js ./WAProto/WAProto.proto;
|
|
2
|
+
yarn pbts -o ./WAProto/index.d.ts ./WAProto/index.js;
|
|
3
|
+
|
|
4
|
+
#protoc --plugin=./node_modules/.bin/protoc-gen-ts_proto --ts_proto_opt=env=node,useOptionals=true,forceLong=long --ts_proto_out=. ./src/Binary/WAMessage.proto;
|