@qadeer-xtech/stablebail 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 +279 -53
- package/WAProto/WAProto.proto +6 -0
- package/WAProto/index.d.ts +20 -0
- package/WAProto/index.js +139 -0
- package/lib/Defaults/index.js +1 -1
- package/lib/Socket/chats.js +30 -1
- package/lib/Socket/messages-send.d.ts +19 -1
- package/lib/Socket/messages-send.js +134 -3
- package/lib/Socket/socket.js +43 -10
- package/lib/Types/Auth.d.ts +2 -1
- package/lib/Types/Socket.d.ts +2 -1
- package/lib/Utils/auth-utils.js +2 -2
- package/lib/Utils/banner.d.ts +6 -0
- package/lib/Utils/banner.js +19 -0
- package/lib/Utils/chat-utils.js +5 -1
- package/lib/Utils/history.js +1 -1
- package/lib/Utils/index.js +1 -1
- package/lib/Utils/process-message.js +4 -1
- package/lib/Utils/tc-token-utils.d.ts +3 -2
- package/lib/Utils/tc-token-utils.js +5 -1
- package/lib/Utils/validate-connection.js +1 -2
- package/package.json +2 -2
- package/lib/Socket/chats.js.map +0 -1
- package/lib/Socket/messages-send.d.ts.map +0 -1
- package/lib/Socket/messages-send.js.map +0 -1
- package/lib/Socket/socket.js.map +0 -1
- package/lib/Types/Auth.d.ts.map +0 -1
- package/lib/Types/Socket.d.ts.map +0 -1
- package/lib/Utils/auth-utils.js.map +0 -1
- package/lib/Utils/chat-utils.js.map +0 -1
- package/lib/Utils/history.js.map +0 -1
- package/lib/Utils/index.js.map +0 -1
- package/lib/Utils/process-message.js.map +0 -1
- package/lib/Utils/tc-token-utils.d.ts.map +0 -1
- package/lib/Utils/tc-token-utils.js.map +0 -1
- package/lib/Utils/validate-connection.js.map +0 -1
package/README.md
CHANGED
|
@@ -1,95 +1,321 @@
|
|
|
1
|
-
|
|
1
|
+
@qadeer-xtech/stablebail
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
<p align="center">
|
|
4
|
+
**STABLEBAIL — POWERED BY TEAM QADEER**
|
|
5
|
+
</p>
|
|
4
6
|
|
|
5
|
-
|
|
7
|
+
A powerful WhatsApp Web API library built on the Baileys architecture, enhanced with custom fixes, improved media handling, advanced newsletter support, and additional WhatsApp features.
|
|
6
8
|
|
|
7
|
-
|
|
9
|
+
Designed for developers who need a familiar Baileys-compatible API with extra functionality and a smoother development experience.
|
|
10
|
+
|
|
11
|
+
## 📦 Installation
|
|
12
|
+
|
|
13
|
+
```bash
|
|
8
14
|
npm install @qadeer-xtech/stablebail
|
|
9
15
|
```
|
|
10
16
|
|
|
11
|
-
|
|
17
|
+
## Use as Official Baileys Replacement
|
|
18
|
+
|
|
19
|
+
To use StableBail without changing your existing import paths, add this alias to your "package.json":
|
|
12
20
|
|
|
13
21
|
```json
|
|
14
|
-
|
|
22
|
+
{
|
|
23
|
+
"dependencies": {
|
|
24
|
+
"@whiskeysockets/baileys": "npm:@qadeer-xtech/stablebail@latest"
|
|
25
|
+
}
|
|
26
|
+
}
|
|
15
27
|
```
|
|
16
28
|
|
|
17
|
-
|
|
29
|
+
This allows existing Baileys-based projects to use StableBail while keeping their original package imports.
|
|
30
|
+
|
|
31
|
+
## ✨ Key Features
|
|
32
|
+
|
|
33
|
+
- Baileys-Compatible API — Familiar socket methods and existing Baileys workflow.
|
|
34
|
+
- Newsletter Enhancements — Improved channel messaging, media uploads, subscriptions, and metadata fetching.
|
|
35
|
+
- Media Stream Fixes — Improved download error handling, media retries, and expired-link recovery.
|
|
36
|
+
- Windows Hybrid Support — Updated device identification for modern WhatsApp connections.
|
|
37
|
+
- LID Compatibility — Improved "onWhatsApp()" support for LID-based addresses.
|
|
38
|
+
- Status Mentions — Mention contacts and groups in WhatsApp status updates.
|
|
39
|
+
- CSToken / NCT Support — Additional token handling for LID-addressed messaging.
|
|
40
|
+
- Connection Banner — Optional branded startup banner.
|
|
41
|
+
- Improved Stability — Additional fixes for connection handling and media operations.
|
|
42
|
+
|
|
43
|
+
## 🔧 What's Included
|
|
44
|
+
|
|
45
|
+
### 1. Newsletter / Channel Support
|
|
46
|
+
|
|
47
|
+
Extended newsletter functionality with improved message fetching, media handling, and channel metadata support.
|
|
48
|
+
|
|
49
|
+
Available methods:
|
|
18
50
|
|
|
19
|
-
|
|
51
|
+
| Method | Description |
|
|
52
|
+
| --- | --- |
|
|
53
|
+
| "newsletterFromUrl()" | Fetch channel information from an invite link |
|
|
54
|
+
| "newsletterSubscribed()" | Get subscribed channels |
|
|
55
|
+
| "newsletterFetchAllSubscribe()" | Fetch all subscribed channels |
|
|
56
|
+
| "newsletterFetchMessages()" | Retrieve channel messages |
|
|
57
|
+
| "newsletterFetchUpdates()" | Fetch views and reactions |
|
|
58
|
+
| "newsletterReactionMode()" | Change channel reaction settings |
|
|
59
|
+
| "newsletterFollow()" | Follow a channel |
|
|
60
|
+
| "newsletterUnfollow()" | Unfollow a channel |
|
|
61
|
+
| "newsletterReactMessage()" | React to channel messages |
|
|
20
62
|
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
-
|
|
24
|
-
-
|
|
25
|
-
-
|
|
26
|
-
-
|
|
27
|
-
-
|
|
63
|
+
Additional improvements:
|
|
64
|
+
|
|
65
|
+
- Dedicated newsletter media upload handling.
|
|
66
|
+
- Improved channel message decoding.
|
|
67
|
+
- Better thumbnail handling.
|
|
68
|
+
- Protection against missing channel profile pictures.
|
|
69
|
+
- Support for legacy message-fetching arguments.
|
|
70
|
+
|
|
71
|
+
### 2. Media Streaming Improvements
|
|
72
|
+
|
|
73
|
+
Enhanced media download and retry handling.
|
|
74
|
+
|
|
75
|
+
- Proper stream error propagation.
|
|
76
|
+
- Prevents downloads from remaining stuck after stream failures.
|
|
77
|
+
- Improved recovery for expired media links.
|
|
78
|
+
- Handles CDN "403", "404", and "410" responses.
|
|
79
|
+
- Improved phone-based media reupload handling.
|
|
80
|
+
- Automatically converts Base64 media keys into usable byte data when required.
|
|
81
|
+
|
|
82
|
+
### 3. Connection & Device Compatibility
|
|
83
|
+
|
|
84
|
+
- Updated Windows device identification using "WIN_HYBRID".
|
|
85
|
+
- Updated default WhatsApp Web version configuration.
|
|
86
|
+
- Improved LID address handling in "onWhatsApp()".
|
|
87
|
+
- Returns LID information alongside standard WhatsApp lookup results when available.
|
|
88
|
+
|
|
89
|
+
Example response:
|
|
90
|
+
|
|
91
|
+
```js
|
|
92
|
+
{
|
|
93
|
+
jid,
|
|
94
|
+
exists,
|
|
95
|
+
lid
|
|
96
|
+
}
|
|
97
|
+
```
|
|
28
98
|
|
|
29
|
-
|
|
99
|
+
### 4. Status Mentions
|
|
30
100
|
|
|
31
|
-
|
|
101
|
+
StableBail includes "sendStatusMention()" for mentioning contacts or groups in WhatsApp status updates.
|
|
102
|
+
|
|
103
|
+
Mention individual contacts:
|
|
104
|
+
|
|
105
|
+
```js
|
|
106
|
+
await sock.sendStatusMention(
|
|
107
|
+
[
|
|
108
|
+
'923001234567@s.whatsapp.net',
|
|
109
|
+
'923009876543@s.whatsapp.net'
|
|
110
|
+
],
|
|
111
|
+
{
|
|
112
|
+
text: 'Eid Mubarak! 🌙'
|
|
113
|
+
}
|
|
114
|
+
)
|
|
115
|
+
```
|
|
116
|
+
|
|
117
|
+
Mention a group:
|
|
118
|
+
|
|
119
|
+
```js
|
|
120
|
+
await sock.sendStatusMention(
|
|
121
|
+
['120363000000000000@g.us'],
|
|
122
|
+
{
|
|
123
|
+
image: {
|
|
124
|
+
url: 'https://example.com/pic.jpg'
|
|
125
|
+
},
|
|
126
|
+
caption: 'Team Qadeer'
|
|
127
|
+
},
|
|
128
|
+
{
|
|
129
|
+
delayMs: 1500
|
|
130
|
+
}
|
|
131
|
+
)
|
|
132
|
+
```
|
|
133
|
+
|
|
134
|
+
"delayMs" controls the delay between mention operations. Its default value is "1500" milliseconds.
|
|
135
|
+
|
|
136
|
+
### 5. CSToken / NCT Support
|
|
137
|
+
|
|
138
|
+
Additional support for WhatsApp's NCT and contact token handling.
|
|
139
|
+
|
|
140
|
+
- Collects NCT salt through history and app-state synchronization.
|
|
141
|
+
- Stores available NCT salt in authentication credentials.
|
|
142
|
+
- Supports regular-high synchronization when history synchronization is disabled.
|
|
143
|
+
- Computes CSToken using HMAC-SHA256 when a required token is unavailable.
|
|
144
|
+
- Prioritizes existing TCToken data when available.
|
|
145
|
+
- Adds additional token handling for LID-addressed messaging.
|
|
146
|
+
|
|
147
|
+
The library also exposes existing reach-out timelock information through:
|
|
148
|
+
|
|
149
|
+
```js
|
|
150
|
+
sock.fetchAccountReachoutTimelock()
|
|
151
|
+
```
|
|
152
|
+
|
|
153
|
+
And the connection update event can provide "reachoutTimeLock" information.
|
|
154
|
+
|
|
155
|
+
### 6. Custom Connection Banner
|
|
156
|
+
|
|
157
|
+
StableBail includes an optional branded connection banner.
|
|
158
|
+
|
|
159
|
+
```
|
|
160
|
+
╭───────────────────────────╮
|
|
161
|
+
│ ✦ Q A D E E R ✦ │
|
|
162
|
+
│ stablebail • Qadeer-Xtech │
|
|
163
|
+
╰───────────────────────────╯
|
|
164
|
+
```
|
|
32
165
|
|
|
33
|
-
|
|
166
|
+
The banner is displayed once when the connection opens.
|
|
34
167
|
|
|
35
|
-
|
|
36
|
-
- **Purani media par reupload** — CDN 404/410 de to bot phone se reupload mangta hai; fetch (undici) migration ke baad status check kharab tha, reupload kabhi manga hi nahi jata tha (official issue #2767).
|
|
37
|
-
- **Expire link (403) par bhi reupload** — signed media link expire ho jaye (oe param) to 403 ata tha aur media hamesha ke liye fail; ab WhatsApp Web ki tarah reupload se naya link ata hai.
|
|
38
|
-
- **mediaKey string wala bug** — database/JSON se restore hue messages ki mediaKey base64 string hoti thi, jis se retry decryption fail hoti thi; ab pehle bytes mein badalti hai.
|
|
168
|
+
To disable it:
|
|
39
169
|
|
|
40
|
-
|
|
170
|
+
```js
|
|
171
|
+
const sock = makeWASocket({
|
|
172
|
+
auth: state,
|
|
173
|
+
printQRInTerminal: true,
|
|
174
|
+
banner: false
|
|
175
|
+
})
|
|
176
|
+
```
|
|
41
177
|
|
|
42
|
-
##
|
|
178
|
+
## 🚀 Basic Usage
|
|
43
179
|
|
|
44
180
|
```js
|
|
45
|
-
const makeWASocket =
|
|
46
|
-
|
|
181
|
+
const makeWASocket =
|
|
182
|
+
require('@qadeer-xtech/stablebail').default
|
|
183
|
+
|
|
184
|
+
const {
|
|
185
|
+
useMultiFileAuthState,
|
|
186
|
+
DisconnectReason
|
|
187
|
+
} = require('@qadeer-xtech/stablebail')
|
|
47
188
|
|
|
48
189
|
async function startBot() {
|
|
49
|
-
const { state, saveCreds } =
|
|
50
|
-
|
|
190
|
+
const { state, saveCreds } =
|
|
191
|
+
await useMultiFileAuthState('auth_info')
|
|
192
|
+
|
|
193
|
+
const sock = makeWASocket({
|
|
194
|
+
auth: state,
|
|
195
|
+
printQRInTerminal: true
|
|
196
|
+
})
|
|
197
|
+
|
|
51
198
|
sock.ev.on('creds.update', saveCreds)
|
|
199
|
+
|
|
52
200
|
return sock
|
|
53
201
|
}
|
|
202
|
+
|
|
203
|
+
startBot()
|
|
54
204
|
```
|
|
55
205
|
|
|
56
|
-
##
|
|
206
|
+
## 📡 Newsletter Examples
|
|
207
|
+
|
|
208
|
+
Fetch Channel Information
|
|
57
209
|
|
|
58
210
|
```js
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
211
|
+
const channel = await sock.newsletterFromUrl(
|
|
212
|
+
'https://whatsapp.com/channel/CHANNEL_ID'
|
|
213
|
+
)
|
|
214
|
+
|
|
215
|
+
console.log(
|
|
216
|
+
channel.id,
|
|
217
|
+
channel.name,
|
|
218
|
+
channel.subscribers
|
|
219
|
+
)
|
|
220
|
+
```
|
|
62
221
|
|
|
63
|
-
|
|
222
|
+
Follow / Unfollow
|
|
223
|
+
|
|
224
|
+
```js
|
|
64
225
|
await sock.newsletterFollow(channel.id)
|
|
226
|
+
|
|
65
227
|
await sock.newsletterUnfollow(channel.id)
|
|
228
|
+
```
|
|
66
229
|
|
|
67
|
-
|
|
68
|
-
const list = await sock.newsletterSubscribed()
|
|
230
|
+
Get Subscribed Channels
|
|
69
231
|
|
|
70
|
-
|
|
71
|
-
const
|
|
72
|
-
const msgsOld = await sock.newsletterFetchMessages(channel.id, 20)
|
|
232
|
+
```js
|
|
233
|
+
const channels = await sock.newsletterSubscribed()
|
|
73
234
|
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
console.log(updates[0].server_id, updates[0].views, updates[0].reactions)
|
|
235
|
+
console.log(channels)
|
|
236
|
+
```
|
|
77
237
|
|
|
78
|
-
|
|
79
|
-
await sock.sendMessage(channel.id, { text: 'Assalam o Alaikum!' })
|
|
80
|
-
await sock.sendMessage(channel.id, { image: { url: 'https://example.com/pic.jpg' }, caption: 'Nayi post' })
|
|
238
|
+
Fetch Channel Messages
|
|
81
239
|
|
|
82
|
-
|
|
83
|
-
await sock.
|
|
240
|
+
```js
|
|
241
|
+
const messages = await sock.newsletterFetchMessages(
|
|
242
|
+
channel.id,
|
|
243
|
+
20
|
|
244
|
+
)
|
|
245
|
+
|
|
246
|
+
console.log(messages)
|
|
84
247
|
```
|
|
85
248
|
|
|
86
|
-
|
|
249
|
+
Fetch Views & Reactions
|
|
250
|
+
|
|
251
|
+
```js
|
|
252
|
+
const updates = await sock.newsletterFetchUpdates(
|
|
253
|
+
channel.id,
|
|
254
|
+
20
|
|
255
|
+
)
|
|
256
|
+
|
|
257
|
+
console.log(
|
|
258
|
+
updates[0].server_id,
|
|
259
|
+
updates[0].views,
|
|
260
|
+
updates[0].reactions
|
|
261
|
+
)
|
|
262
|
+
```
|
|
263
|
+
|
|
264
|
+
Send Channel Message
|
|
265
|
+
|
|
266
|
+
```js
|
|
267
|
+
await sock.sendMessage(channel.id, {
|
|
268
|
+
text: 'Assalam o Alaikum! 👋'
|
|
269
|
+
})
|
|
270
|
+
```
|
|
271
|
+
|
|
272
|
+
Send Channel Image
|
|
273
|
+
|
|
274
|
+
```js
|
|
275
|
+
await sock.sendMessage(channel.id, {
|
|
276
|
+
image: {
|
|
277
|
+
url: 'https://example.com/pic.jpg'
|
|
278
|
+
},
|
|
279
|
+
caption: 'New Channel Update'
|
|
280
|
+
})
|
|
281
|
+
```
|
|
282
|
+
|
|
283
|
+
React to Channel Message
|
|
284
|
+
|
|
285
|
+
```js
|
|
286
|
+
await sock.newsletterReactMessage(
|
|
287
|
+
channel.id,
|
|
288
|
+
updates[0].server_id,
|
|
289
|
+
'❤️'
|
|
290
|
+
)
|
|
291
|
+
```
|
|
292
|
+
|
|
293
|
+
## ⚙️ Compatibility
|
|
294
|
+
|
|
295
|
+
- Node.js environment
|
|
296
|
+
- Baileys-compatible socket workflow
|
|
297
|
+
- Existing Baileys-based bot projects
|
|
298
|
+
- Multi-file authentication
|
|
299
|
+
- WhatsApp Web connection workflows
|
|
300
|
+
|
|
301
|
+
StableBail is designed to minimize migration work for existing Baileys users. However, custom methods and options are specific to this package.
|
|
302
|
+
|
|
303
|
+
## ⚠️ Important Notes
|
|
304
|
+
|
|
305
|
+
- Some custom features may require live WhatsApp testing.
|
|
306
|
+
- Status mention functionality should be tested with a dedicated account before production use.
|
|
307
|
+
- WhatsApp may change its internal protocols without notice.
|
|
308
|
+
- Connection restrictions, account-level limitations, and server-side errors cannot always be resolved through library-side changes.
|
|
309
|
+
- Always keep your authentication credentials private.
|
|
310
|
+
|
|
311
|
+
## 📄 License
|
|
312
|
+
|
|
313
|
+
MIT License
|
|
314
|
+
|
|
315
|
+
## 🖤 Credits
|
|
87
316
|
|
|
88
|
-
|
|
89
|
-
- **1.0.2** — Channels/newsletter fixes
|
|
90
|
-
- **1.0.1** — Dependencies apne packages par: `@qadeer-xtech/libsignal`, `@qadeer-xtech/whatsapp-rust-bridge`
|
|
91
|
-
- **1.0.0** — Official Baileys 7.0.0-rc14 ki saaf copy
|
|
317
|
+
Developed and maintained by Team Qadeer.
|
|
92
318
|
|
|
93
|
-
|
|
319
|
+
STABLEBAIL — Built for developers. Enhanced for performance.
|
|
94
320
|
|
|
95
|
-
|
|
321
|
+
"Powered by Team Qadeer"
|
package/WAProto/WAProto.proto
CHANGED
|
@@ -1844,6 +1844,7 @@ message HistorySync {
|
|
|
1844
1844
|
optional string companionMetaNonce = 16;
|
|
1845
1845
|
optional bytes shareableChatIdentifierEncryptionKey = 17;
|
|
1846
1846
|
repeated Account accounts = 18;
|
|
1847
|
+
optional bytes nctSalt = 19;
|
|
1847
1848
|
enum BotAIWaitListState {
|
|
1848
1849
|
IN_WAITLIST = 0;
|
|
1849
1850
|
AI_AVAILABLE = 1;
|
|
@@ -4527,12 +4528,17 @@ message SyncActionValue {
|
|
|
4527
4528
|
optional NewsletterSavedInterestsAction newsletterSavedInterestsAction = 75;
|
|
4528
4529
|
optional AiThreadRenameAction aiThreadRenameAction = 76;
|
|
4529
4530
|
optional InteractiveMessageAction interactiveMessageAction = 77;
|
|
4531
|
+
optional NctSaltSyncAction nctSaltSyncAction = 80;
|
|
4530
4532
|
message AgentAction {
|
|
4531
4533
|
optional string name = 1;
|
|
4532
4534
|
optional int32 deviceID = 2;
|
|
4533
4535
|
optional bool isDeleted = 3;
|
|
4534
4536
|
}
|
|
4535
4537
|
|
|
4538
|
+
message NctSaltSyncAction {
|
|
4539
|
+
optional bytes salt = 1;
|
|
4540
|
+
}
|
|
4541
|
+
|
|
4536
4542
|
message AiThreadRenameAction {
|
|
4537
4543
|
optional string newTitle = 1;
|
|
4538
4544
|
}
|
package/WAProto/index.d.ts
CHANGED
|
@@ -4532,6 +4532,7 @@ export namespace proto {
|
|
|
4532
4532
|
companionMetaNonce?: (string|null);
|
|
4533
4533
|
shareableChatIdentifierEncryptionKey?: (Uint8Array|null);
|
|
4534
4534
|
accounts?: (proto.IAccount[]|null);
|
|
4535
|
+
nctSalt?: (Uint8Array|null);
|
|
4535
4536
|
}
|
|
4536
4537
|
|
|
4537
4538
|
class HistorySync implements IHistorySync {
|
|
@@ -4553,6 +4554,7 @@ export namespace proto {
|
|
|
4553
4554
|
public companionMetaNonce?: (string|null);
|
|
4554
4555
|
public shareableChatIdentifierEncryptionKey?: (Uint8Array|null);
|
|
4555
4556
|
public accounts: proto.IAccount[];
|
|
4557
|
+
public nctSalt?: (Uint8Array|null);
|
|
4556
4558
|
public static create(properties?: proto.IHistorySync): proto.HistorySync;
|
|
4557
4559
|
public static encode(m: proto.IHistorySync, w?: $protobuf.Writer): $protobuf.Writer;
|
|
4558
4560
|
public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.HistorySync;
|
|
@@ -11494,6 +11496,7 @@ export namespace proto {
|
|
|
11494
11496
|
newsletterSavedInterestsAction?: (proto.SyncActionValue.INewsletterSavedInterestsAction|null);
|
|
11495
11497
|
aiThreadRenameAction?: (proto.SyncActionValue.IAiThreadRenameAction|null);
|
|
11496
11498
|
interactiveMessageAction?: (proto.SyncActionValue.IInteractiveMessageAction|null);
|
|
11499
|
+
nctSaltSyncAction?: (proto.SyncActionValue.INctSaltSyncAction|null);
|
|
11497
11500
|
}
|
|
11498
11501
|
|
|
11499
11502
|
class SyncActionValue implements ISyncActionValue {
|
|
@@ -11567,6 +11570,7 @@ export namespace proto {
|
|
|
11567
11570
|
public newsletterSavedInterestsAction?: (proto.SyncActionValue.INewsletterSavedInterestsAction|null);
|
|
11568
11571
|
public aiThreadRenameAction?: (proto.SyncActionValue.IAiThreadRenameAction|null);
|
|
11569
11572
|
public interactiveMessageAction?: (proto.SyncActionValue.IInteractiveMessageAction|null);
|
|
11573
|
+
public nctSaltSyncAction?: (proto.SyncActionValue.INctSaltSyncAction|null);
|
|
11570
11574
|
public static create(properties?: proto.ISyncActionValue): proto.SyncActionValue;
|
|
11571
11575
|
public static encode(m: proto.ISyncActionValue, w?: $protobuf.Writer): $protobuf.Writer;
|
|
11572
11576
|
public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.SyncActionValue;
|
|
@@ -11598,6 +11602,22 @@ export namespace proto {
|
|
|
11598
11602
|
public static getTypeUrl(typeUrlPrefix?: string): string;
|
|
11599
11603
|
}
|
|
11600
11604
|
|
|
11605
|
+
interface INctSaltSyncAction {
|
|
11606
|
+
salt?: (Uint8Array|null);
|
|
11607
|
+
}
|
|
11608
|
+
|
|
11609
|
+
class NctSaltSyncAction implements INctSaltSyncAction {
|
|
11610
|
+
constructor(p?: proto.SyncActionValue.INctSaltSyncAction);
|
|
11611
|
+
public salt?: (Uint8Array|null);
|
|
11612
|
+
public static create(properties?: proto.SyncActionValue.INctSaltSyncAction): proto.SyncActionValue.NctSaltSyncAction;
|
|
11613
|
+
public static encode(m: proto.SyncActionValue.INctSaltSyncAction, w?: $protobuf.Writer): $protobuf.Writer;
|
|
11614
|
+
public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.SyncActionValue.NctSaltSyncAction;
|
|
11615
|
+
public static fromObject(d: { [k: string]: any }): proto.SyncActionValue.NctSaltSyncAction;
|
|
11616
|
+
public static toObject(m: proto.SyncActionValue.NctSaltSyncAction, o?: $protobuf.IConversionOptions): { [k: string]: any };
|
|
11617
|
+
public toJSON(): { [k: string]: any };
|
|
11618
|
+
public static getTypeUrl(typeUrlPrefix?: string): string;
|
|
11619
|
+
}
|
|
11620
|
+
|
|
11601
11621
|
interface IAiThreadRenameAction {
|
|
11602
11622
|
newTitle?: (string|null);
|
|
11603
11623
|
}
|
package/WAProto/index.js
CHANGED
|
@@ -30984,6 +30984,7 @@ export const proto = $root.proto = (() => {
|
|
|
30984
30984
|
HistorySync.prototype.companionMetaNonce = null;
|
|
30985
30985
|
HistorySync.prototype.shareableChatIdentifierEncryptionKey = null;
|
|
30986
30986
|
HistorySync.prototype.accounts = $util.emptyArray;
|
|
30987
|
+
HistorySync.prototype.nctSalt = null;
|
|
30987
30988
|
|
|
30988
30989
|
let $oneOfFields;
|
|
30989
30990
|
|
|
@@ -31035,6 +31036,12 @@ export const proto = $root.proto = (() => {
|
|
|
31035
31036
|
set: $util.oneOfSetter($oneOfFields)
|
|
31036
31037
|
});
|
|
31037
31038
|
|
|
31039
|
+
// Virtual OneOf for proto3 optional field
|
|
31040
|
+
Object.defineProperty(HistorySync.prototype, "_nctSalt", {
|
|
31041
|
+
get: $util.oneOfGetter($oneOfFields = ["nctSalt"]),
|
|
31042
|
+
set: $util.oneOfSetter($oneOfFields)
|
|
31043
|
+
});
|
|
31044
|
+
|
|
31038
31045
|
HistorySync.create = function create(properties) {
|
|
31039
31046
|
return new HistorySync(properties);
|
|
31040
31047
|
};
|
|
@@ -31092,6 +31099,8 @@ export const proto = $root.proto = (() => {
|
|
|
31092
31099
|
for (var i = 0; i < m.accounts.length; ++i)
|
|
31093
31100
|
$root.proto.Account.encode(m.accounts[i], w.uint32(146).fork()).ldelim();
|
|
31094
31101
|
}
|
|
31102
|
+
if (m.nctSalt != null && Object.hasOwnProperty.call(m, "nctSalt"))
|
|
31103
|
+
w.uint32(154).bytes(m.nctSalt);
|
|
31095
31104
|
return w;
|
|
31096
31105
|
};
|
|
31097
31106
|
|
|
@@ -31188,6 +31197,10 @@ export const proto = $root.proto = (() => {
|
|
|
31188
31197
|
m.accounts.push($root.proto.Account.decode(r, r.uint32()));
|
|
31189
31198
|
break;
|
|
31190
31199
|
}
|
|
31200
|
+
case 19: {
|
|
31201
|
+
m.nctSalt = r.bytes();
|
|
31202
|
+
break;
|
|
31203
|
+
}
|
|
31191
31204
|
default:
|
|
31192
31205
|
r.skipType(t & 7);
|
|
31193
31206
|
break;
|
|
@@ -31361,6 +31374,12 @@ export const proto = $root.proto = (() => {
|
|
|
31361
31374
|
m.accounts[i] = $root.proto.Account.fromObject(d.accounts[i]);
|
|
31362
31375
|
}
|
|
31363
31376
|
}
|
|
31377
|
+
if (d.nctSalt != null) {
|
|
31378
|
+
if (typeof d.nctSalt === "string")
|
|
31379
|
+
$util.base64.decode(d.nctSalt, m.nctSalt = $util.newBuffer($util.base64.length(d.nctSalt)), 0);
|
|
31380
|
+
else if (d.nctSalt.length >= 0)
|
|
31381
|
+
m.nctSalt = d.nctSalt;
|
|
31382
|
+
}
|
|
31364
31383
|
return m;
|
|
31365
31384
|
};
|
|
31366
31385
|
|
|
@@ -31472,6 +31491,11 @@ export const proto = $root.proto = (() => {
|
|
|
31472
31491
|
d.accounts[j] = $root.proto.Account.toObject(m.accounts[j], o);
|
|
31473
31492
|
}
|
|
31474
31493
|
}
|
|
31494
|
+
if (m.nctSalt != null && m.hasOwnProperty("nctSalt")) {
|
|
31495
|
+
d.nctSalt = o.bytes === String ? $util.base64.encode(m.nctSalt, 0, m.nctSalt.length) : o.bytes === Array ? Array.prototype.slice.call(m.nctSalt) : m.nctSalt;
|
|
31496
|
+
if (o.oneofs)
|
|
31497
|
+
d._nctSalt = "nctSalt";
|
|
31498
|
+
}
|
|
31475
31499
|
return d;
|
|
31476
31500
|
};
|
|
31477
31501
|
|
|
@@ -79685,6 +79709,7 @@ export const proto = $root.proto = (() => {
|
|
|
79685
79709
|
SyncActionValue.prototype.newsletterSavedInterestsAction = null;
|
|
79686
79710
|
SyncActionValue.prototype.aiThreadRenameAction = null;
|
|
79687
79711
|
SyncActionValue.prototype.interactiveMessageAction = null;
|
|
79712
|
+
SyncActionValue.prototype.nctSaltSyncAction = null;
|
|
79688
79713
|
|
|
79689
79714
|
let $oneOfFields;
|
|
79690
79715
|
|
|
@@ -80102,6 +80127,12 @@ export const proto = $root.proto = (() => {
|
|
|
80102
80127
|
set: $util.oneOfSetter($oneOfFields)
|
|
80103
80128
|
});
|
|
80104
80129
|
|
|
80130
|
+
// Virtual OneOf for proto3 optional field
|
|
80131
|
+
Object.defineProperty(SyncActionValue.prototype, "_nctSaltSyncAction", {
|
|
80132
|
+
get: $util.oneOfGetter($oneOfFields = ["nctSaltSyncAction"]),
|
|
80133
|
+
set: $util.oneOfSetter($oneOfFields)
|
|
80134
|
+
});
|
|
80135
|
+
|
|
80105
80136
|
SyncActionValue.create = function create(properties) {
|
|
80106
80137
|
return new SyncActionValue(properties);
|
|
80107
80138
|
};
|
|
@@ -80247,6 +80278,8 @@ export const proto = $root.proto = (() => {
|
|
|
80247
80278
|
$root.proto.SyncActionValue.AiThreadRenameAction.encode(m.aiThreadRenameAction, w.uint32(610).fork()).ldelim();
|
|
80248
80279
|
if (m.interactiveMessageAction != null && Object.hasOwnProperty.call(m, "interactiveMessageAction"))
|
|
80249
80280
|
$root.proto.SyncActionValue.InteractiveMessageAction.encode(m.interactiveMessageAction, w.uint32(618).fork()).ldelim();
|
|
80281
|
+
if (m.nctSaltSyncAction != null && Object.hasOwnProperty.call(m, "nctSaltSyncAction"))
|
|
80282
|
+
$root.proto.SyncActionValue.NctSaltSyncAction.encode(m.nctSaltSyncAction, w.uint32(642).fork()).ldelim();
|
|
80250
80283
|
return w;
|
|
80251
80284
|
};
|
|
80252
80285
|
|
|
@@ -80535,6 +80568,10 @@ export const proto = $root.proto = (() => {
|
|
|
80535
80568
|
m.interactiveMessageAction = $root.proto.SyncActionValue.InteractiveMessageAction.decode(r, r.uint32());
|
|
80536
80569
|
break;
|
|
80537
80570
|
}
|
|
80571
|
+
case 80: {
|
|
80572
|
+
m.nctSaltSyncAction = $root.proto.SyncActionValue.NctSaltSyncAction.decode(r, r.uint32());
|
|
80573
|
+
break;
|
|
80574
|
+
}
|
|
80538
80575
|
default:
|
|
80539
80576
|
r.skipType(t & 7);
|
|
80540
80577
|
break;
|
|
@@ -80897,6 +80934,11 @@ export const proto = $root.proto = (() => {
|
|
|
80897
80934
|
throw TypeError(".proto.SyncActionValue.interactiveMessageAction: object expected");
|
|
80898
80935
|
m.interactiveMessageAction = $root.proto.SyncActionValue.InteractiveMessageAction.fromObject(d.interactiveMessageAction);
|
|
80899
80936
|
}
|
|
80937
|
+
if (d.nctSaltSyncAction != null) {
|
|
80938
|
+
if (typeof d.nctSaltSyncAction !== "object")
|
|
80939
|
+
throw TypeError(".proto.SyncActionValue.nctSaltSyncAction: object expected");
|
|
80940
|
+
m.nctSaltSyncAction = $root.proto.SyncActionValue.NctSaltSyncAction.fromObject(d.nctSaltSyncAction);
|
|
80941
|
+
}
|
|
80900
80942
|
return m;
|
|
80901
80943
|
};
|
|
80902
80944
|
|
|
@@ -81252,6 +81294,11 @@ export const proto = $root.proto = (() => {
|
|
|
81252
81294
|
if (o.oneofs)
|
|
81253
81295
|
d._interactiveMessageAction = "interactiveMessageAction";
|
|
81254
81296
|
}
|
|
81297
|
+
if (m.nctSaltSyncAction != null && m.hasOwnProperty("nctSaltSyncAction")) {
|
|
81298
|
+
d.nctSaltSyncAction = $root.proto.SyncActionValue.NctSaltSyncAction.toObject(m.nctSaltSyncAction, o);
|
|
81299
|
+
if (o.oneofs)
|
|
81300
|
+
d._nctSaltSyncAction = "nctSaltSyncAction";
|
|
81301
|
+
}
|
|
81255
81302
|
return d;
|
|
81256
81303
|
};
|
|
81257
81304
|
|
|
@@ -81266,6 +81313,98 @@ export const proto = $root.proto = (() => {
|
|
|
81266
81313
|
return typeUrlPrefix + "/proto.SyncActionValue";
|
|
81267
81314
|
};
|
|
81268
81315
|
|
|
81316
|
+
SyncActionValue.NctSaltSyncAction = (function() {
|
|
81317
|
+
|
|
81318
|
+
function NctSaltSyncAction(p) {
|
|
81319
|
+
if (p)
|
|
81320
|
+
for (var ks = Object.keys(p), i = 0; i < ks.length; ++i)
|
|
81321
|
+
if (p[ks[i]] != null)
|
|
81322
|
+
this[ks[i]] = p[ks[i]];
|
|
81323
|
+
}
|
|
81324
|
+
|
|
81325
|
+
NctSaltSyncAction.prototype.salt = null;
|
|
81326
|
+
|
|
81327
|
+
let $oneOfFields;
|
|
81328
|
+
|
|
81329
|
+
// Virtual OneOf for proto3 optional field
|
|
81330
|
+
Object.defineProperty(NctSaltSyncAction.prototype, "_salt", {
|
|
81331
|
+
get: $util.oneOfGetter($oneOfFields = ["salt"]),
|
|
81332
|
+
set: $util.oneOfSetter($oneOfFields)
|
|
81333
|
+
});
|
|
81334
|
+
|
|
81335
|
+
NctSaltSyncAction.create = function create(properties) {
|
|
81336
|
+
return new NctSaltSyncAction(properties);
|
|
81337
|
+
};
|
|
81338
|
+
|
|
81339
|
+
NctSaltSyncAction.encode = function encode(m, w) {
|
|
81340
|
+
if (!w)
|
|
81341
|
+
w = $Writer.create();
|
|
81342
|
+
if (m.salt != null && Object.hasOwnProperty.call(m, "salt"))
|
|
81343
|
+
w.uint32(10).bytes(m.salt);
|
|
81344
|
+
return w;
|
|
81345
|
+
};
|
|
81346
|
+
|
|
81347
|
+
NctSaltSyncAction.decode = function decode(r, l, e) {
|
|
81348
|
+
if (!(r instanceof $Reader))
|
|
81349
|
+
r = $Reader.create(r);
|
|
81350
|
+
var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.SyncActionValue.NctSaltSyncAction();
|
|
81351
|
+
while (r.pos < c) {
|
|
81352
|
+
var t = r.uint32();
|
|
81353
|
+
if (t === e)
|
|
81354
|
+
break;
|
|
81355
|
+
switch (t >>> 3) {
|
|
81356
|
+
case 1: {
|
|
81357
|
+
m.salt = r.bytes();
|
|
81358
|
+
break;
|
|
81359
|
+
}
|
|
81360
|
+
default:
|
|
81361
|
+
r.skipType(t & 7);
|
|
81362
|
+
break;
|
|
81363
|
+
}
|
|
81364
|
+
}
|
|
81365
|
+
return m;
|
|
81366
|
+
};
|
|
81367
|
+
|
|
81368
|
+
NctSaltSyncAction.fromObject = function fromObject(d) {
|
|
81369
|
+
if (d instanceof $root.proto.SyncActionValue.NctSaltSyncAction)
|
|
81370
|
+
return d;
|
|
81371
|
+
var m = new $root.proto.SyncActionValue.NctSaltSyncAction();
|
|
81372
|
+
if (d.salt != null) {
|
|
81373
|
+
if (typeof d.salt === "string")
|
|
81374
|
+
$util.base64.decode(d.salt, m.salt = $util.newBuffer($util.base64.length(d.salt)), 0);
|
|
81375
|
+
else if (d.salt.length >= 0)
|
|
81376
|
+
m.salt = d.salt;
|
|
81377
|
+
}
|
|
81378
|
+
return m;
|
|
81379
|
+
};
|
|
81380
|
+
|
|
81381
|
+
NctSaltSyncAction.toObject = function toObject(m, o) {
|
|
81382
|
+
if (!o)
|
|
81383
|
+
o = {};
|
|
81384
|
+
var d = {};
|
|
81385
|
+
if (m.salt != null && m.hasOwnProperty("salt")) {
|
|
81386
|
+
d.salt = o.bytes === String ? $util.base64.encode(m.salt, 0, m.salt.length) : o.bytes === Array ? Array.prototype.slice.call(m.salt) : m.salt;
|
|
81387
|
+
if (o.oneofs)
|
|
81388
|
+
d._salt = "salt";
|
|
81389
|
+
}
|
|
81390
|
+
return d;
|
|
81391
|
+
};
|
|
81392
|
+
|
|
81393
|
+
NctSaltSyncAction.prototype.toJSON = function toJSON() {
|
|
81394
|
+
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
|
81395
|
+
};
|
|
81396
|
+
|
|
81397
|
+
NctSaltSyncAction.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
|
|
81398
|
+
if (typeUrlPrefix === undefined) {
|
|
81399
|
+
typeUrlPrefix = "type.googleapis.com";
|
|
81400
|
+
}
|
|
81401
|
+
return typeUrlPrefix + "/proto.SyncActionValue.NctSaltSyncAction";
|
|
81402
|
+
};
|
|
81403
|
+
|
|
81404
|
+
return NctSaltSyncAction;
|
|
81405
|
+
})();
|
|
81406
|
+
|
|
81407
|
+
|
|
81269
81408
|
SyncActionValue.AgentAction = (function() {
|
|
81270
81409
|
|
|
81271
81410
|
function AgentAction(p) {
|