@lordmega/baileys 0.3.22 → 0.3.24
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 -5
- package/WAProto/index.d.ts +26 -0
- package/WAProto/index.js +203 -0
- package/lib/Defaults/index.d.ts +1 -0
- package/lib/Defaults/index.d.ts.map +1 -1
- package/lib/Defaults/index.js +1 -0
- package/lib/Defaults/index.js.map +1 -1
- package/lib/Signal/libsignal.js +4 -4
- package/lib/Socket/Client/websocket.js +10 -5
- package/lib/Socket/business.d.ts +1 -1
- package/lib/Socket/chats.d.ts +1 -1
- package/lib/Socket/chats.js +8 -6
- package/lib/Socket/chats.js.map +1 -1
- package/lib/Socket/communities.d.ts +1 -1
- package/lib/Socket/communities.js +3 -2
- package/lib/Socket/groups.d.ts +1 -1
- package/lib/Socket/groups.js +24 -8
- package/lib/Socket/index.d.ts +1 -1
- package/lib/Socket/messages-recv.d.ts +1 -1
- package/lib/Socket/messages-recv.js +92 -24
- package/lib/Socket/messages-send.d.ts +2 -1
- package/lib/Socket/messages-send.js +68 -8
- package/lib/Socket/messages-send.js.map +1 -1
- package/lib/Socket/newsletter.d.ts +1 -1
- package/lib/Socket/newsletter.js +28 -1
- package/lib/Socket/socket.js +41 -13
- package/lib/Store/make-in-memory-store.js +7 -2
- package/lib/Utils/browser-utils.d.ts +1 -0
- package/lib/Utils/browser-utils.js +1 -0
- package/lib/Utils/crypto.js +34 -1
- package/lib/Utils/decode-wa-message.d.ts.map +1 -1
- package/lib/Utils/decode-wa-message.js.map +1 -1
- package/lib/Utils/event-buffer.js +19 -2
- package/lib/Utils/generics.js +3 -6
- package/lib/Utils/index.js.map +1 -1
- package/lib/Utils/message-retry-manager.d.ts +1 -0
- package/lib/Utils/message-retry-manager.js +7 -0
- package/lib/Utils/messages-media.js +108 -41
- package/lib/Utils/messages.d.ts.map +1 -1
- package/lib/Utils/messages.js +58 -162
- package/lib/Utils/messages.js.map +1 -1
- package/lib/Utils/process-message.d.ts +1 -0
- package/lib/Utils/process-message.d.ts.map +1 -1
- package/lib/Utils/process-message.js +154 -78
- package/lib/Utils/process-message.js.map +1 -1
- package/lib/Utils/reporting-utils.d.ts +1 -0
- package/lib/Utils/reporting-utils.js +1 -1
- package/lib/Utils/rich-message-utils.d.ts.map +1 -1
- package/lib/Utils/rich-message-utils.js.map +1 -1
- package/lib/Utils/tc-token-utils.js +9 -11
- package/lib/Utils/use-multi-file-auth-state.js +10 -11
- package/lib/Utils/use-single-file-auth-state.js +8 -2
- package/lib/Utils/validate-connection.js +10 -4
- package/lib/WABinary/constants.d.ts.map +1 -1
- package/lib/WABinary/constants.js.map +1 -1
- package/lib/WAUSync/USyncQuery.js +24 -2
- package/package.json +10 -7
- package/lib/Utils/use-sqlite-auth-state.d.ts.map +0 -1
- package/lib/Utils/use-sqlite-auth-state.js.map +0 -1
package/README.md
CHANGED
|
@@ -1,11 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
1
|
# 🗿 lordmega baileys
|
|
4
2
|
|
|
5
3
|
[](https://www.npmjs.com/package/@lordmega/baileys)
|
|
6
4
|
|
|
7
5
|
<p align="center">
|
|
8
|
-
Mega
|
|
6
|
+
Mega enhanced Baileys v7 with newsletter media upload fixes, interactive messages, album support, and extended message type coverage.
|
|
9
7
|
<br><br>
|
|
10
8
|
<a href="https://www.npmjs.com/package/@lordmega/baileys">
|
|
11
9
|
<img src="https://img.shields.io/npm/v/@lordmega/baileys?style=for-the-badge&logo=npm"/>
|
|
@@ -31,10 +29,11 @@
|
|
|
31
29
|
- [📋 Table of Contents](#-table-of-contents)
|
|
32
30
|
- [✨ Highlights](#-highlights)
|
|
33
31
|
- [🛠️ Internal Adjustments](#%EF%B8%8F-internal-adjustments)
|
|
34
|
-
- [📨 Messages Handling & Compatibility](#-
|
|
32
|
+
- [📨 Messages Handling & Compatibility](#-messages-handling--compatibility)
|
|
35
33
|
- [🧩 Additional Message Options](#-additional-message-options)
|
|
36
34
|
- [📥 Installation](#-installation)
|
|
37
35
|
- [🧩 Import (ESM & CJS)](#-import-esm--cjs)
|
|
36
|
+
- [🚀 Quick Start](#-quick-start)
|
|
38
37
|
- [🌐 Connect to WhatsApp (Quick Step)](#-connect-to-whatsapp-quick-step)
|
|
39
38
|
- [🔐 Auth State](#-auth-state)
|
|
40
39
|
- [🗄️ Implementing Data Store](#%EF%B8%8F-implementing-data-store)
|
|
@@ -66,6 +65,7 @@
|
|
|
66
65
|
- [🗂️ Document](#%EF%B8%8F-document)
|
|
67
66
|
- [🖼️ Album (Image & Video)](#%EF%B8%8F-album-image--video)
|
|
68
67
|
- [📦 Sticker Pack](#-sticker-pack)
|
|
68
|
+
- [👁️ Reveal View-Once](#%EF%B8%8F-reveal-view-once)
|
|
69
69
|
- [👉🏻 Sending Interactive Messages](#-sending-interactive-messages)
|
|
70
70
|
- [🔘 Buttons](#-buttons)
|
|
71
71
|
- [📋 List](#-list)
|
|
@@ -105,20 +105,29 @@
|
|
|
105
105
|
- [🚀 Try the Bot](#-try-the-bot)
|
|
106
106
|
- [📦 Fork Base](#-fork-base)
|
|
107
107
|
|
|
108
|
+
---
|
|
109
|
+
|
|
108
110
|
### ✨ Highlights
|
|
109
111
|
|
|
110
112
|
Built for production with an emphasis on readability and reliability:
|
|
111
113
|
|
|
112
114
|
- 🚫 No obfuscation — clean, auditable code.
|
|
113
115
|
- 🚫 No auto-follow channel (newsletter) behavior.
|
|
116
|
+
- 👁️ Reveal view-once messages via `sock.rvo()`.
|
|
117
|
+
- 📱 Android browser support to receive view-once messages.
|
|
118
|
+
- ✏️ Automatic decryption of E2EE message edits (May 2026+).
|
|
119
|
+
- 🔑 Caller-supplied `messageSecret` support on any message type.
|
|
114
120
|
|
|
115
121
|
### 🛠️ Internal Adjustments
|
|
122
|
+
|
|
116
123
|
- 🖼️ Fixed newsletter media upload failures caused by an upstream bug.
|
|
117
124
|
- 📁 Restored `makeInMemoryStore` with a lightweight ESM adaptation and minor compatibility tweaks for Baileys v7.
|
|
118
125
|
- 📦 Replaced FFmpeg `exec` calls with `spawn` for more reliable process management.
|
|
119
126
|
- 🗃️ Added [`@napi-rs/image`](https://www.npmjs.com/package/@napi-rs/image) as a supported backend in [`getImageProcessingLibrary()`](#%EF%B8%8F-image-processing), providing a solid balance between speed and compatibility.
|
|
127
|
+
- 🔒 Spoofing guards on self-only protocol messages.
|
|
120
128
|
|
|
121
129
|
### 📨 Messages Handling & Compatibility
|
|
130
|
+
|
|
122
131
|
- 📩 Extended message type support for:
|
|
123
132
|
- 🖼️ [Album Message](#%EF%B8%8F-album-image--video)
|
|
124
133
|
- 👤 [Group Status Message](#%E2%80%8D%E2%80%8D-group-status)
|
|
@@ -133,14 +142,19 @@ Built for production with an emphasis on readability and reliability:
|
|
|
133
142
|
- 📰 Simplified ad thumbnail sending via [`externalAdReply`](#-external-ad-reply) — no manual `contextInfo` required.
|
|
134
143
|
- 💭 Added support for quoting messages inside newsletters. **[NEW]**
|
|
135
144
|
- 🎀 Added support for [custom button icons](#%EF%B8%8F-interactive). **[NEW]**
|
|
145
|
+
- 👁️ Reveal view-once messages and resend as normal media via [`sock.rvo()`](#%EF%B8%8F-reveal-view-once). **[NEW]**
|
|
136
146
|
|
|
137
147
|
### 🧩 Additional Message Options
|
|
148
|
+
|
|
138
149
|
- 👁️ Optional boolean flags for message behavior:
|
|
139
150
|
- 🤖 [`ai`](#-ai-icon) — AI icon on message
|
|
140
151
|
- 📣 [`mentionAll`](#-mention) — Mention all group participants without specifying individual JIDs **[NEW]**
|
|
141
152
|
- 🔧 [`ephemeral`](#-ephemeral), [`groupStatus`](#%E2%80%8D%E2%80%8D-group-status), [`isLottie`](#-lottie-sticker), [`spoiler`](#-spoiler), [`viewOnce`](#%EF%B8%8F-view-once), [`viewOnceV2`](#%EF%B8%8F-view-once-v2), [`viewOnceV2Extension`](#%EF%B8%8F-view-once-v2-extension), [`interactiveAsTemplate`](#%EF%B8%8F-interactive) — Message wrappers
|
|
142
153
|
- 🔒 [`secureMetaServiceLabel`](#%EF%B8%8F-secure-meta-service-label) — Secure meta service label **[NEW]**
|
|
143
154
|
- 📄 [`raw`](#-raw) — Build message proto manually **(DO NOT USE FOR EXPLOITATION)**
|
|
155
|
+
- 🔑 Pass a custom 32-byte `messageSecret` on any message type via send options.
|
|
156
|
+
|
|
157
|
+
---
|
|
144
158
|
|
|
145
159
|
### 📥 Installation
|
|
146
160
|
|
|
@@ -178,6 +192,37 @@ import { makeWASocket } from '@lordmega/baileys'
|
|
|
178
192
|
const { makeWASocket } = require('@lordmega/baileys')
|
|
179
193
|
```
|
|
180
194
|
|
|
195
|
+
---
|
|
196
|
+
|
|
197
|
+
### 🚀 Quick Start
|
|
198
|
+
|
|
199
|
+
```javascript
|
|
200
|
+
import { makeWASocket, useMultiFileAuthState, DisconnectReason } from '@lordmega/baileys'
|
|
201
|
+
import { Boom } from '@hapi/boom'
|
|
202
|
+
|
|
203
|
+
const { state, saveCreds } = await useMultiFileAuthState('auth')
|
|
204
|
+
|
|
205
|
+
const sock = makeWASocket({ auth: state, printQRInTerminal: true })
|
|
206
|
+
|
|
207
|
+
sock.ev.on('creds.update', saveCreds)
|
|
208
|
+
|
|
209
|
+
sock.ev.on('connection.update', ({ connection, lastDisconnect }) => {
|
|
210
|
+
if (connection === 'close') {
|
|
211
|
+
const reconnect = lastDisconnect?.error?.output?.statusCode !== DisconnectReason.loggedOut
|
|
212
|
+
if (reconnect) makeWASocket({ auth: state })
|
|
213
|
+
}
|
|
214
|
+
})
|
|
215
|
+
|
|
216
|
+
sock.ev.on('messages.upsert', async ({ messages }) => {
|
|
217
|
+
const msg = messages[0]
|
|
218
|
+
if (!msg.key.fromMe && msg.message?.conversation) {
|
|
219
|
+
await sock.sendMessage(msg.key.remoteJid, { text: 'pong' })
|
|
220
|
+
}
|
|
221
|
+
})
|
|
222
|
+
```
|
|
223
|
+
|
|
224
|
+
---
|
|
225
|
+
|
|
181
226
|
### 🌐 Connect to WhatsApp (Quick Step)
|
|
182
227
|
|
|
183
228
|
```javascript
|
|
@@ -238,6 +283,18 @@ connectToWhatsApp()
|
|
|
238
283
|
> [!NOTE]
|
|
239
284
|
> You can use the experimental `useSingleFileAuthState` and `useSqliteAuthState` as alternatives to `useMultiFileAuthState`. Note that `useSingleFileAuthState` has built-in caching, so wrapping `state.keys` with `makeCacheableSignalKeyStore` is unnecessary.
|
|
240
285
|
|
|
286
|
+
#### 📱 Android Browser (receive view-once)
|
|
287
|
+
|
|
288
|
+
Connect as an Android client to receive view-once messages natively:
|
|
289
|
+
|
|
290
|
+
```javascript
|
|
291
|
+
import { makeWASocket, Browsers } from '@lordmega/baileys'
|
|
292
|
+
|
|
293
|
+
const sock = makeWASocket({ auth: state, browser: Browsers.android('Chrome') })
|
|
294
|
+
```
|
|
295
|
+
|
|
296
|
+
---
|
|
297
|
+
|
|
241
298
|
### 🗄️ Implementing Data Store
|
|
242
299
|
|
|
243
300
|
> [!CAUTION]
|
|
@@ -306,6 +363,8 @@ const connectToWhatsApp = async () => {
|
|
|
306
363
|
connectToWhatsApp()
|
|
307
364
|
```
|
|
308
365
|
|
|
366
|
+
---
|
|
367
|
+
|
|
309
368
|
### 🪪 WhatsApp IDs Explain
|
|
310
369
|
|
|
311
370
|
`id` is the WhatsApp ID (also referred to as `jid` or `lid`) of the person or group you're messaging.
|
|
@@ -316,6 +375,8 @@ connectToWhatsApp()
|
|
|
316
375
|
- Broadcast lists: `[timestamp]@broadcast`
|
|
317
376
|
- Stories: `status@broadcast`
|
|
318
377
|
|
|
378
|
+
---
|
|
379
|
+
|
|
319
380
|
### ✉️ Sending Messages
|
|
320
381
|
|
|
321
382
|
#### 🔠 Text
|
|
@@ -761,6 +822,8 @@ sock.sendMessage([jidA, jidB, jidC], {
|
|
|
761
822
|
})
|
|
762
823
|
```
|
|
763
824
|
|
|
825
|
+
---
|
|
826
|
+
|
|
764
827
|
### 📁 Sending Media Messages
|
|
765
828
|
|
|
766
829
|
> [!NOTE]
|
|
@@ -852,6 +915,28 @@ sock.sendMessage(jid, {
|
|
|
852
915
|
}, { quoted: message })
|
|
853
916
|
```
|
|
854
917
|
|
|
918
|
+
---
|
|
919
|
+
|
|
920
|
+
### 👁️ Reveal View-Once
|
|
921
|
+
|
|
922
|
+
Download a view-once message and resend it as normal media. Works for image, video, audio, document, and sticker. Downloads and re-uploads so it stays valid even after the original was opened.
|
|
923
|
+
|
|
924
|
+
```javascript
|
|
925
|
+
sock.ev.on('messages.upsert', async ({ messages }) => {
|
|
926
|
+
for (const m of messages) {
|
|
927
|
+
const vo = m.message?.viewOnceMessage
|
|
928
|
+
|| m.message?.viewOnceMessageV2
|
|
929
|
+
|| m.message?.viewOnceMessageV2Extension
|
|
930
|
+
if (vo) {
|
|
931
|
+
await sock.rvo(m) // resend to the original chat
|
|
932
|
+
// await sock.rvo(m, jid) // or to a specific jid
|
|
933
|
+
}
|
|
934
|
+
}
|
|
935
|
+
})
|
|
936
|
+
```
|
|
937
|
+
|
|
938
|
+
---
|
|
939
|
+
|
|
855
940
|
### 👉🏻 Sending Interactive Messages
|
|
856
941
|
|
|
857
942
|
#### 🔘 Buttons
|
|
@@ -959,7 +1044,8 @@ sock.sendMessage(jid, {
|
|
|
959
1044
|
}]
|
|
960
1045
|
}],
|
|
961
1046
|
icon: 'default'
|
|
962
|
-
}]
|
|
1047
|
+
}],
|
|
1048
|
+
interactiveAsTemplate: false // Optional, wrap into templateMessage
|
|
963
1049
|
}, { quoted: message })
|
|
964
1050
|
|
|
965
1051
|
// --- Carousel with native flow
|
|
@@ -1023,6 +1109,8 @@ sock.sendMessage(jid, {
|
|
|
1023
1109
|
}, { quoted: message })
|
|
1024
1110
|
```
|
|
1025
1111
|
|
|
1112
|
+
---
|
|
1113
|
+
|
|
1026
1114
|
### 💳 Sending Payment Messages
|
|
1027
1115
|
|
|
1028
1116
|
#### ➕ Invite Payment
|
|
@@ -1063,6 +1151,8 @@ sock.sendMessage(jid, {
|
|
|
1063
1151
|
})
|
|
1064
1152
|
```
|
|
1065
1153
|
|
|
1154
|
+
---
|
|
1155
|
+
|
|
1066
1156
|
### 👁️ Other Message Options
|
|
1067
1157
|
|
|
1068
1158
|
#### 🤖 AI Icon
|
|
@@ -1194,6 +1284,18 @@ sock.sendMessage(jid, {
|
|
|
1194
1284
|
})
|
|
1195
1285
|
```
|
|
1196
1286
|
|
|
1287
|
+
#### 🔑 Caller-Supplied messageSecret
|
|
1288
|
+
|
|
1289
|
+
Pass your own 32-byte `messageSecret` on any message type:
|
|
1290
|
+
|
|
1291
|
+
```javascript
|
|
1292
|
+
import { randomBytes } from 'crypto'
|
|
1293
|
+
|
|
1294
|
+
await sock.sendMessage(jid, { text: 'hi' }, { messageSecret: randomBytes(32) })
|
|
1295
|
+
```
|
|
1296
|
+
|
|
1297
|
+
---
|
|
1298
|
+
|
|
1197
1299
|
### ♻️ Modify Messages
|
|
1198
1300
|
|
|
1199
1301
|
#### 🗑️ Delete Messages
|
|
@@ -1220,6 +1322,11 @@ sock.sendMessage(jid, {
|
|
|
1220
1322
|
})
|
|
1221
1323
|
```
|
|
1222
1324
|
|
|
1325
|
+
> [!NOTE]
|
|
1326
|
+
> Encrypted E2EE message edits (May 2026+) are automatically decrypted — edited messages arrive via the normal `protocolMessage.editedMessage` path.
|
|
1327
|
+
|
|
1328
|
+
---
|
|
1329
|
+
|
|
1223
1330
|
### 🧰 Additional Contents
|
|
1224
1331
|
|
|
1225
1332
|
#### 🏷️ Find User ID (JID|PN/LID)
|
|
@@ -1486,12 +1593,16 @@ sock.ev.on('newsletter-settings.update', (update) => {})
|
|
|
1486
1593
|
sock.ev.on('settings.update', (update) => {})
|
|
1487
1594
|
```
|
|
1488
1595
|
|
|
1596
|
+
---
|
|
1597
|
+
|
|
1489
1598
|
### 🚀 Try the Bot
|
|
1490
1599
|
|
|
1491
1600
|
A lightweight, modular WhatsApp bot built on this library — includes group management, moderation, quiz games, and utility tools.
|
|
1492
1601
|
|
|
1493
1602
|
👉🏻 [MegaBot MD](https://github.com/LORDMEGA-MD/MegaBot)
|
|
1494
1603
|
|
|
1604
|
+
---
|
|
1605
|
+
|
|
1495
1606
|
### 📦 Fork Base
|
|
1496
1607
|
|
|
1497
1608
|
Based on [WhiskeySockets/Baileys](https://github.com/WhiskeySockets/Baileys)
|
package/WAProto/index.d.ts
CHANGED
|
@@ -1709,6 +1709,7 @@ export namespace proto {
|
|
|
1709
1709
|
}
|
|
1710
1710
|
|
|
1711
1711
|
interface IBotMetadata {
|
|
1712
|
+
avatarMetadata?: (proto.IBotAvatarMetadata|null);
|
|
1712
1713
|
personaId?: (string|null);
|
|
1713
1714
|
pluginMetadata?: (proto.IBotPluginMetadata|null);
|
|
1714
1715
|
suggestedPromptMetadata?: (proto.IBotSuggestedPromptMetadata|null);
|
|
@@ -1755,6 +1756,7 @@ export namespace proto {
|
|
|
1755
1756
|
|
|
1756
1757
|
class BotMetadata implements IBotMetadata {
|
|
1757
1758
|
constructor(p?: proto.IBotMetadata);
|
|
1759
|
+
public avatarMetadata?: (proto.IBotAvatarMetadata|null);
|
|
1758
1760
|
public personaId?: (string|null);
|
|
1759
1761
|
public pluginMetadata?: (proto.IBotPluginMetadata|null);
|
|
1760
1762
|
public suggestedPromptMetadata?: (proto.IBotSuggestedPromptMetadata|null);
|
|
@@ -1806,6 +1808,30 @@ export namespace proto {
|
|
|
1806
1808
|
public static getTypeUrl(typeUrlPrefix?: string): string;
|
|
1807
1809
|
}
|
|
1808
1810
|
|
|
1811
|
+
interface IBotAvatarMetadata {
|
|
1812
|
+
sentiment?: (number|null);
|
|
1813
|
+
behaviorGraph?: (string|null);
|
|
1814
|
+
action?: (number|null);
|
|
1815
|
+
intensity?: (number|null);
|
|
1816
|
+
wordCount?: (number|null);
|
|
1817
|
+
}
|
|
1818
|
+
|
|
1819
|
+
class BotAvatarMetadata implements IBotAvatarMetadata {
|
|
1820
|
+
constructor(p?: proto.IBotAvatarMetadata);
|
|
1821
|
+
public sentiment?: (number|null);
|
|
1822
|
+
public behaviorGraph?: (string|null);
|
|
1823
|
+
public action?: (number|null);
|
|
1824
|
+
public intensity?: (number|null);
|
|
1825
|
+
public wordCount?: (number|null);
|
|
1826
|
+
public static create(properties?: proto.IBotAvatarMetadata): proto.BotAvatarMetadata;
|
|
1827
|
+
public static encode(m: proto.IBotAvatarMetadata, w?: $protobuf.Writer): $protobuf.Writer;
|
|
1828
|
+
public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.BotAvatarMetadata;
|
|
1829
|
+
public static fromObject(d: { [k: string]: any }): proto.BotAvatarMetadata;
|
|
1830
|
+
public static toObject(m: proto.BotAvatarMetadata, o?: $protobuf.IConversionOptions): { [k: string]: any };
|
|
1831
|
+
public toJSON(): { [k: string]: any };
|
|
1832
|
+
public static getTypeUrl(typeUrlPrefix?: string): string;
|
|
1833
|
+
}
|
|
1834
|
+
|
|
1809
1835
|
enum BotMetricsEntryPoint {
|
|
1810
1836
|
UNDEFINED_ENTRY_POINT = 0,
|
|
1811
1837
|
FAVICON = 1,
|
package/WAProto/index.js
CHANGED
|
@@ -11369,6 +11369,7 @@ export const proto = $root.proto = (() => {
|
|
|
11369
11369
|
this[ks[i]] = p[ks[i]];
|
|
11370
11370
|
}
|
|
11371
11371
|
|
|
11372
|
+
BotMetadata.prototype.avatarMetadata = null;
|
|
11372
11373
|
BotMetadata.prototype.personaId = null;
|
|
11373
11374
|
BotMetadata.prototype.pluginMetadata = null;
|
|
11374
11375
|
BotMetadata.prototype.suggestedPromptMetadata = null;
|
|
@@ -11414,6 +11415,12 @@ export const proto = $root.proto = (() => {
|
|
|
11414
11415
|
|
|
11415
11416
|
let $oneOfFields;
|
|
11416
11417
|
|
|
11418
|
+
// Virtual OneOf for proto3 optional field
|
|
11419
|
+
Object.defineProperty(BotMetadata.prototype, "_avatarMetadata", {
|
|
11420
|
+
get: $util.oneOfGetter($oneOfFields = ["avatarMetadata"]),
|
|
11421
|
+
set: $util.oneOfSetter($oneOfFields)
|
|
11422
|
+
});
|
|
11423
|
+
|
|
11417
11424
|
// Virtual OneOf for proto3 optional field
|
|
11418
11425
|
Object.defineProperty(BotMetadata.prototype, "_personaId", {
|
|
11419
11426
|
get: $util.oneOfGetter($oneOfFields = ["personaId"]),
|
|
@@ -11673,6 +11680,8 @@ export const proto = $root.proto = (() => {
|
|
|
11673
11680
|
BotMetadata.encode = function encode(m, w) {
|
|
11674
11681
|
if (!w)
|
|
11675
11682
|
w = $Writer.create();
|
|
11683
|
+
if (m.avatarMetadata != null && Object.hasOwnProperty.call(m, "avatarMetadata"))
|
|
11684
|
+
$root.proto.BotAvatarMetadata.encode(m.avatarMetadata, w.uint32(10).fork()).ldelim();
|
|
11676
11685
|
if (m.personaId != null && Object.hasOwnProperty.call(m, "personaId"))
|
|
11677
11686
|
w.uint32(18).string(m.personaId);
|
|
11678
11687
|
if (m.pluginMetadata != null && Object.hasOwnProperty.call(m, "pluginMetadata"))
|
|
@@ -11773,6 +11782,10 @@ export const proto = $root.proto = (() => {
|
|
|
11773
11782
|
if (t === e)
|
|
11774
11783
|
break;
|
|
11775
11784
|
switch (t >>> 3) {
|
|
11785
|
+
case 1: {
|
|
11786
|
+
m.avatarMetadata = $root.proto.BotAvatarMetadata.decode(r, r.uint32(), undefined, n + 1);
|
|
11787
|
+
break;
|
|
11788
|
+
}
|
|
11776
11789
|
case 2: {
|
|
11777
11790
|
m.personaId = r.string();
|
|
11778
11791
|
break;
|
|
@@ -11957,6 +11970,11 @@ export const proto = $root.proto = (() => {
|
|
|
11957
11970
|
if (n > $util.recursionLimit)
|
|
11958
11971
|
throw Error("maximum nesting depth exceeded");
|
|
11959
11972
|
var m = new $root.proto.BotMetadata();
|
|
11973
|
+
if (d.avatarMetadata != null) {
|
|
11974
|
+
if (typeof d.avatarMetadata !== "object")
|
|
11975
|
+
throw TypeError(".proto.BotMetadata.avatarMetadata: object expected");
|
|
11976
|
+
m.avatarMetadata = $root.proto.BotAvatarMetadata.fromObject(d.avatarMetadata, n + 1);
|
|
11977
|
+
}
|
|
11960
11978
|
if (d.personaId != null) {
|
|
11961
11979
|
m.personaId = String(d.personaId);
|
|
11962
11980
|
}
|
|
@@ -12164,6 +12182,11 @@ export const proto = $root.proto = (() => {
|
|
|
12164
12182
|
if (!o)
|
|
12165
12183
|
o = {};
|
|
12166
12184
|
var d = {};
|
|
12185
|
+
if (m.avatarMetadata != null && m.hasOwnProperty("avatarMetadata")) {
|
|
12186
|
+
d.avatarMetadata = $root.proto.BotAvatarMetadata.toObject(m.avatarMetadata, o);
|
|
12187
|
+
if (o.oneofs)
|
|
12188
|
+
d._avatarMetadata = "avatarMetadata";
|
|
12189
|
+
}
|
|
12167
12190
|
if (m.personaId != null && m.hasOwnProperty("personaId")) {
|
|
12168
12191
|
d.personaId = m.personaId;
|
|
12169
12192
|
if (o.oneofs)
|
|
@@ -12391,6 +12414,186 @@ export const proto = $root.proto = (() => {
|
|
|
12391
12414
|
return BotMetadata;
|
|
12392
12415
|
})();
|
|
12393
12416
|
|
|
12417
|
+
proto.BotAvatarMetadata = (function() {
|
|
12418
|
+
|
|
12419
|
+
function BotAvatarMetadata(p) {
|
|
12420
|
+
if (p)
|
|
12421
|
+
for (var ks = Object.keys(p), i = 0; i < ks.length; ++i)
|
|
12422
|
+
if (p[ks[i]] != null && ks[i] !== "__proto__")
|
|
12423
|
+
this[ks[i]] = p[ks[i]];
|
|
12424
|
+
}
|
|
12425
|
+
|
|
12426
|
+
BotAvatarMetadata.prototype.sentiment = null;
|
|
12427
|
+
BotAvatarMetadata.prototype.behaviorGraph = null;
|
|
12428
|
+
BotAvatarMetadata.prototype.action = null;
|
|
12429
|
+
BotAvatarMetadata.prototype.intensity = null;
|
|
12430
|
+
BotAvatarMetadata.prototype.wordCount = null;
|
|
12431
|
+
|
|
12432
|
+
let $oneOfFields;
|
|
12433
|
+
|
|
12434
|
+
// Virtual OneOf for proto3 optional field
|
|
12435
|
+
Object.defineProperty(BotAvatarMetadata.prototype, "_sentiment", {
|
|
12436
|
+
get: $util.oneOfGetter($oneOfFields = ["sentiment"]),
|
|
12437
|
+
set: $util.oneOfSetter($oneOfFields)
|
|
12438
|
+
});
|
|
12439
|
+
|
|
12440
|
+
// Virtual OneOf for proto3 optional field
|
|
12441
|
+
Object.defineProperty(BotAvatarMetadata.prototype, "_behaviorGraph", {
|
|
12442
|
+
get: $util.oneOfGetter($oneOfFields = ["behaviorGraph"]),
|
|
12443
|
+
set: $util.oneOfSetter($oneOfFields)
|
|
12444
|
+
});
|
|
12445
|
+
|
|
12446
|
+
// Virtual OneOf for proto3 optional field
|
|
12447
|
+
Object.defineProperty(BotAvatarMetadata.prototype, "_action", {
|
|
12448
|
+
get: $util.oneOfGetter($oneOfFields = ["action"]),
|
|
12449
|
+
set: $util.oneOfSetter($oneOfFields)
|
|
12450
|
+
});
|
|
12451
|
+
|
|
12452
|
+
// Virtual OneOf for proto3 optional field
|
|
12453
|
+
Object.defineProperty(BotAvatarMetadata.prototype, "_intensity", {
|
|
12454
|
+
get: $util.oneOfGetter($oneOfFields = ["intensity"]),
|
|
12455
|
+
set: $util.oneOfSetter($oneOfFields)
|
|
12456
|
+
});
|
|
12457
|
+
|
|
12458
|
+
// Virtual OneOf for proto3 optional field
|
|
12459
|
+
Object.defineProperty(BotAvatarMetadata.prototype, "_wordCount", {
|
|
12460
|
+
get: $util.oneOfGetter($oneOfFields = ["wordCount"]),
|
|
12461
|
+
set: $util.oneOfSetter($oneOfFields)
|
|
12462
|
+
});
|
|
12463
|
+
|
|
12464
|
+
BotAvatarMetadata.create = function create(properties) {
|
|
12465
|
+
return new BotAvatarMetadata(properties);
|
|
12466
|
+
};
|
|
12467
|
+
|
|
12468
|
+
BotAvatarMetadata.encode = function encode(m, w) {
|
|
12469
|
+
if (!w)
|
|
12470
|
+
w = $Writer.create();
|
|
12471
|
+
if (m.sentiment != null && Object.hasOwnProperty.call(m, "sentiment"))
|
|
12472
|
+
w.uint32(8).uint32(m.sentiment);
|
|
12473
|
+
if (m.behaviorGraph != null && Object.hasOwnProperty.call(m, "behaviorGraph"))
|
|
12474
|
+
w.uint32(18).string(m.behaviorGraph);
|
|
12475
|
+
if (m.action != null && Object.hasOwnProperty.call(m, "action"))
|
|
12476
|
+
w.uint32(24).uint32(m.action);
|
|
12477
|
+
if (m.intensity != null && Object.hasOwnProperty.call(m, "intensity"))
|
|
12478
|
+
w.uint32(32).uint32(m.intensity);
|
|
12479
|
+
if (m.wordCount != null && Object.hasOwnProperty.call(m, "wordCount"))
|
|
12480
|
+
w.uint32(40).uint32(m.wordCount);
|
|
12481
|
+
return w;
|
|
12482
|
+
};
|
|
12483
|
+
|
|
12484
|
+
BotAvatarMetadata.decode = function decode(r, l, e, n) {
|
|
12485
|
+
if (!(r instanceof $Reader))
|
|
12486
|
+
r = $Reader.create(r);
|
|
12487
|
+
if (n === undefined)
|
|
12488
|
+
n = 0;
|
|
12489
|
+
if (n > $Reader.recursionLimit)
|
|
12490
|
+
throw Error("maximum nesting depth exceeded");
|
|
12491
|
+
var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.BotAvatarMetadata();
|
|
12492
|
+
while (r.pos < c) {
|
|
12493
|
+
var t = r.uint32();
|
|
12494
|
+
if (t === e)
|
|
12495
|
+
break;
|
|
12496
|
+
switch (t >>> 3) {
|
|
12497
|
+
case 1: {
|
|
12498
|
+
m.sentiment = r.uint32();
|
|
12499
|
+
break;
|
|
12500
|
+
}
|
|
12501
|
+
case 2: {
|
|
12502
|
+
m.behaviorGraph = r.string();
|
|
12503
|
+
break;
|
|
12504
|
+
}
|
|
12505
|
+
case 3: {
|
|
12506
|
+
m.action = r.uint32();
|
|
12507
|
+
break;
|
|
12508
|
+
}
|
|
12509
|
+
case 4: {
|
|
12510
|
+
m.intensity = r.uint32();
|
|
12511
|
+
break;
|
|
12512
|
+
}
|
|
12513
|
+
case 5: {
|
|
12514
|
+
m.wordCount = r.uint32();
|
|
12515
|
+
break;
|
|
12516
|
+
}
|
|
12517
|
+
default:
|
|
12518
|
+
r.skipType(t & 7, n);
|
|
12519
|
+
break;
|
|
12520
|
+
}
|
|
12521
|
+
}
|
|
12522
|
+
return m;
|
|
12523
|
+
};
|
|
12524
|
+
|
|
12525
|
+
BotAvatarMetadata.fromObject = function fromObject(d, n) {
|
|
12526
|
+
if (d instanceof $root.proto.BotAvatarMetadata)
|
|
12527
|
+
return d;
|
|
12528
|
+
if (n === undefined)
|
|
12529
|
+
n = 0;
|
|
12530
|
+
if (n > $util.recursionLimit)
|
|
12531
|
+
throw Error("maximum nesting depth exceeded");
|
|
12532
|
+
var m = new $root.proto.BotAvatarMetadata();
|
|
12533
|
+
if (d.sentiment != null) {
|
|
12534
|
+
m.sentiment = d.sentiment >>> 0;
|
|
12535
|
+
}
|
|
12536
|
+
if (d.behaviorGraph != null) {
|
|
12537
|
+
m.behaviorGraph = String(d.behaviorGraph);
|
|
12538
|
+
}
|
|
12539
|
+
if (d.action != null) {
|
|
12540
|
+
m.action = d.action >>> 0;
|
|
12541
|
+
}
|
|
12542
|
+
if (d.intensity != null) {
|
|
12543
|
+
m.intensity = d.intensity >>> 0;
|
|
12544
|
+
}
|
|
12545
|
+
if (d.wordCount != null) {
|
|
12546
|
+
m.wordCount = d.wordCount >>> 0;
|
|
12547
|
+
}
|
|
12548
|
+
return m;
|
|
12549
|
+
};
|
|
12550
|
+
|
|
12551
|
+
BotAvatarMetadata.toObject = function toObject(m, o) {
|
|
12552
|
+
if (!o)
|
|
12553
|
+
o = {};
|
|
12554
|
+
var d = {};
|
|
12555
|
+
if (m.sentiment != null && m.hasOwnProperty("sentiment")) {
|
|
12556
|
+
d.sentiment = m.sentiment;
|
|
12557
|
+
if (o.oneofs)
|
|
12558
|
+
d._sentiment = "sentiment";
|
|
12559
|
+
}
|
|
12560
|
+
if (m.behaviorGraph != null && m.hasOwnProperty("behaviorGraph")) {
|
|
12561
|
+
d.behaviorGraph = m.behaviorGraph;
|
|
12562
|
+
if (o.oneofs)
|
|
12563
|
+
d._behaviorGraph = "behaviorGraph";
|
|
12564
|
+
}
|
|
12565
|
+
if (m.action != null && m.hasOwnProperty("action")) {
|
|
12566
|
+
d.action = m.action;
|
|
12567
|
+
if (o.oneofs)
|
|
12568
|
+
d._action = "action";
|
|
12569
|
+
}
|
|
12570
|
+
if (m.intensity != null && m.hasOwnProperty("intensity")) {
|
|
12571
|
+
d.intensity = m.intensity;
|
|
12572
|
+
if (o.oneofs)
|
|
12573
|
+
d._intensity = "intensity";
|
|
12574
|
+
}
|
|
12575
|
+
if (m.wordCount != null && m.hasOwnProperty("wordCount")) {
|
|
12576
|
+
d.wordCount = m.wordCount;
|
|
12577
|
+
if (o.oneofs)
|
|
12578
|
+
d._wordCount = "wordCount";
|
|
12579
|
+
}
|
|
12580
|
+
return d;
|
|
12581
|
+
};
|
|
12582
|
+
|
|
12583
|
+
BotAvatarMetadata.prototype.toJSON = function toJSON() {
|
|
12584
|
+
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
|
12585
|
+
};
|
|
12586
|
+
|
|
12587
|
+
BotAvatarMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
|
|
12588
|
+
if (typeUrlPrefix === undefined) {
|
|
12589
|
+
typeUrlPrefix = "type.googleapis.com";
|
|
12590
|
+
}
|
|
12591
|
+
return typeUrlPrefix + "/proto.BotAvatarMetadata";
|
|
12592
|
+
};
|
|
12593
|
+
|
|
12594
|
+
return BotAvatarMetadata;
|
|
12595
|
+
})();
|
|
12596
|
+
|
|
12394
12597
|
proto.BotMetricsEntryPoint = (function() {
|
|
12395
12598
|
const valuesById = {}, values = Object.create(valuesById);
|
|
12396
12599
|
values[valuesById[0] = "UNDEFINED_ENTRY_POINT"] = 0;
|
package/lib/Defaults/index.d.ts
CHANGED
|
@@ -48,6 +48,7 @@ export namespace DEFAULT_CONNECTION_CONFIG {
|
|
|
48
48
|
export let customUploadHosts: never[];
|
|
49
49
|
export let retryRequestDelayMs: number;
|
|
50
50
|
export let maxMsgRetryCount: number;
|
|
51
|
+
export let offlineNodeBatchSize: number;
|
|
51
52
|
export let fireInitQueries: boolean;
|
|
52
53
|
export let auth: undefined;
|
|
53
54
|
export let markOnlineOnConnect: boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/Defaults/index.js"],"names":[],"mappings":"AAKA,0CAAkD;AAClD,sCAAuC,mMAAiL,CAAC;AACzN,6BAA8B,0BAA0B,CAAC;AACzD,gCAAiC,kCAAkC,CAAC;AACpE,gCAAiC,kCAAkC,CAAC;AACpE,yBAA0B,6BAA6B,CAAC;AACxD,2BAA4B,kBAAkB,CAAC;AAC/C,kCAAmC,KAAK,CAAC;AACzC,6BAA8B,MAAM,CAAC;AACrC,kCAAmC,SAAS,CAAC;AAC7C,4CAA6D;AAC7D,2CAA4D;AAC5D,mDAAoE;AACpE,kDAAmE;AACnE,0CAAqD;AACrD,iEAAiE;AACjE,2CAAkD;AAClD,2EAA2E;AAC3E,iDAA6D;AAC7D,yBAA0B,sCAAsC,CAAC;AACjE,2BAA4B,CAAC,CAAC;AAC9B,kCAAgD;AAChD,kCAAsE;AACtE,iCAA+L;AAC/L,yGAAyG;AACzG,+BAA+G;;;;;;AAM/G,4EAQE;;;;;;;;;;;;;;;;;;;;;;;IAuB6B,yDAAU;IACX;;gBAEzB;IACgB,2CAAW;;;;;;;;;;;;;;;IAYhB,iDAAqB;IACZ,0DAAqB;;;AAG9C
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/Defaults/index.js"],"names":[],"mappings":"AAKA,0CAAkD;AAClD,sCAAuC,mMAAiL,CAAC;AACzN,6BAA8B,0BAA0B,CAAC;AACzD,gCAAiC,kCAAkC,CAAC;AACpE,gCAAiC,kCAAkC,CAAC;AACpE,yBAA0B,6BAA6B,CAAC;AACxD,2BAA4B,kBAAkB,CAAC;AAC/C,kCAAmC,KAAK,CAAC;AACzC,6BAA8B,MAAM,CAAC;AACrC,kCAAmC,SAAS,CAAC;AAC7C,4CAA6D;AAC7D,2CAA4D;AAC5D,mDAAoE;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,wBAAwB,EAAE,wBAAwB;IAChD,OAAO,EAAE,OAAO;IAChB,KAAK,EAAE,OAAO;IACd,oBAAoB,EAAE,oBAAoB;IAC1C,iBAAiB,EAAE,iBAAiB;IACpC,iBAAiB,EAAE,iBAAiB;IACpC,gBAAgB,EAAE,gBAAgB;IAClC,aAAa,EAAE,SAAS;IACxB,cAAc,EAAE,WAAW;IAC3B,uBAAuB,EAAE,EAAE;IAC3B,kBAAkB,EAAE,oBAAoB;IACxC,GAAG,EAAE,OAAO;IACZ,iBAAiB,EAAE,OAAO;CAC7B,CAAC;AACF,MAAM,CAAC,MAAM,UAAU,GAAG,MAAM,CAAC,IAAI,CAAC,cAAc,CAAC,CAAC;AACtD,yHAAyH;AACzH,MAAM,CAAC,MAAM,8BAA8B,GAAG,MAAM,CAAC;AACrD,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC,CAAC;AAClC,MAAM,CAAC,MAAM,oBAAoB,GAAG,GAAG,CAAC;AACxC,MAAM,CAAC,MAAM,cAAc,GAAG,KAAK,CAAC,CAAC,aAAa;AAClD,MAAM,CAAC,MAAM,MAAM,GAAG;IAClB,MAAM,EAAE,EAAE,GAAG,IAAI;IACjB,IAAI,EAAE,EAAE,GAAG,EAAE,GAAG,IAAI;IACpB,GAAG,EAAE,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,IAAI;IACxB,IAAI,EAAE,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,IAAI;CAChC,CAAC"}
|
package/lib/Signal/libsignal.js
CHANGED
|
@@ -212,10 +212,10 @@ export function makeLibSignalRepository(auth, logger, pnToLIDFunc) {
|
|
|
212
212
|
const { user } = jidDecode(fromJid);
|
|
213
213
|
logger.debug({ fromJid }, 'bulk device migration - loading all user devices');
|
|
214
214
|
// Get user's device list from storage
|
|
215
|
-
const { [user]:
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
215
|
+
const { [user]: storedDevices } = await parsedKeys.get('device-list', [user]);
|
|
216
|
+
// If device-list absent, fall back to single device from fromJid so messages
|
|
217
|
+
// are not silently dropped (fixes #2548 — group messages dropped when device-list missing)
|
|
218
|
+
const userDevices = storedDevices || [];
|
|
219
219
|
const { device: fromDevice } = jidDecode(fromJid);
|
|
220
220
|
const fromDeviceStr = fromDevice?.toString() || '0';
|
|
221
221
|
if (!userDevices.includes(fromDeviceStr)) {
|
|
@@ -39,12 +39,17 @@ export class WebSocketClient extends AbstractSocketClient {
|
|
|
39
39
|
if (!this.socket) {
|
|
40
40
|
return;
|
|
41
41
|
}
|
|
42
|
-
|
|
43
|
-
|
|
42
|
+
await new Promise(resolve => {
|
|
43
|
+
const done = () => {
|
|
44
|
+
clearTimeout(timer);
|
|
45
|
+
this.socket = null;
|
|
46
|
+
resolve();
|
|
47
|
+
};
|
|
48
|
+
// guard against socket that never fires close (e.g. half-open TCP)
|
|
49
|
+
const timer = setTimeout(done, 5000);
|
|
50
|
+
this.socket?.once('close', done);
|
|
51
|
+
this.socket?.close();
|
|
44
52
|
});
|
|
45
|
-
this.socket.close();
|
|
46
|
-
await closePromise;
|
|
47
|
-
this.socket = null;
|
|
48
53
|
}
|
|
49
54
|
send(str, cb) {
|
|
50
55
|
this.socket?.send(str, cb);
|
package/lib/Socket/business.d.ts
CHANGED
|
@@ -291,7 +291,7 @@ export function makeBusinessSocket(config: any): {
|
|
|
291
291
|
appPatch: (patchCreate: any) => Promise<void>;
|
|
292
292
|
sendPresenceUpdate: (type: any, toJid: any) => Promise<void>;
|
|
293
293
|
presenceSubscribe: (toJid: any) => Promise<void>;
|
|
294
|
-
profilePictureUrl: (jid: any, type
|
|
294
|
+
profilePictureUrl: (jid: any, type: string | undefined, timeoutMs: any) => Promise<any>;
|
|
295
295
|
fetchBlocklist: () => Promise<any>;
|
|
296
296
|
fetchStatus: (...jids: any[]) => Promise<any>;
|
|
297
297
|
fetchDisappearingDuration: (...jids: any[]) => Promise<any>;
|
package/lib/Socket/chats.d.ts
CHANGED
|
@@ -33,7 +33,7 @@ export function makeChatsSocket(config: any): {
|
|
|
33
33
|
appPatch: (patchCreate: any) => Promise<void>;
|
|
34
34
|
sendPresenceUpdate: (type: any, toJid: any) => Promise<void>;
|
|
35
35
|
presenceSubscribe: (toJid: any) => Promise<void>;
|
|
36
|
-
profilePictureUrl: (jid: any, type
|
|
36
|
+
profilePictureUrl: (jid: any, type: string | undefined, timeoutMs: any) => Promise<any>;
|
|
37
37
|
fetchBlocklist: () => Promise<any>;
|
|
38
38
|
fetchStatus: (...jids: any[]) => Promise<any>;
|
|
39
39
|
fetchDisappearingDuration: (...jids: any[]) => Promise<any>;
|