@developmentyora/baileyss 0.0.1-security → 1.0.0

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.

Potentially problematic release.


This version of @developmentyora/baileyss might be problematic. Click here for more details.

Files changed (116) hide show
  1. package/LICENSE +30 -0
  2. package/README.md +404 -3
  3. package/WAProto/GenerateStatics.sh +3 -0
  4. package/WAProto/WAProto.proto +6902 -0
  5. package/WAProto/fix-imports.js +85 -0
  6. package/WAProto/index.d.ts +79257 -0
  7. package/WAProto/index.js +242946 -0
  8. package/engine-requirements.js +10 -0
  9. package/lib/Defaults/index.js +130 -0
  10. package/lib/Signal/Group/ciphertext-message.js +12 -0
  11. package/lib/Signal/Group/group-session-builder.js +30 -0
  12. package/lib/Signal/Group/group_cipher.js +82 -0
  13. package/lib/Signal/Group/index.js +12 -0
  14. package/lib/Signal/Group/keyhelper.js +18 -0
  15. package/lib/Signal/Group/sender-chain-key.js +26 -0
  16. package/lib/Signal/Group/sender-key-distribution-message.js +63 -0
  17. package/lib/Signal/Group/sender-key-message.js +66 -0
  18. package/lib/Signal/Group/sender-key-name.js +48 -0
  19. package/lib/Signal/Group/sender-key-record.js +41 -0
  20. package/lib/Signal/Group/sender-key-state.js +84 -0
  21. package/lib/Signal/Group/sender-message-key.js +26 -0
  22. package/lib/Signal/libsignal.js +431 -0
  23. package/lib/Signal/lid-mapping.js +277 -0
  24. package/lib/Socket/Client/index.js +3 -0
  25. package/lib/Socket/Client/types.js +11 -0
  26. package/lib/Socket/Client/websocket.js +84 -0
  27. package/lib/Socket/business.js +379 -0
  28. package/lib/Socket/chats.js +1193 -0
  29. package/lib/Socket/communities.js +431 -0
  30. package/lib/Socket/groups.js +374 -0
  31. package/lib/Socket/index.js +12 -0
  32. package/lib/Socket/luxu.js +386 -0
  33. package/lib/Socket/messages-recv.js +1916 -0
  34. package/lib/Socket/messages-send.js +1453 -0
  35. package/lib/Socket/mex.js +41 -0
  36. package/lib/Socket/newsletter.js +294 -0
  37. package/lib/Socket/socket.js +980 -0
  38. package/lib/Socket/username.js +234 -0
  39. package/lib/Store/index.js +10 -0
  40. package/lib/Store/keyed-db.js +108 -0
  41. package/lib/Store/make-cache-manager-store.js +85 -0
  42. package/lib/Store/make-in-memory-store.js +198 -0
  43. package/lib/Store/make-ordered-dictionary.js +75 -0
  44. package/lib/Store/object-repository.js +32 -0
  45. package/lib/Types/Auth.js +2 -0
  46. package/lib/Types/Bussines.js +2 -0
  47. package/lib/Types/Call.js +2 -0
  48. package/lib/Types/Chat.js +8 -0
  49. package/lib/Types/Contact.js +2 -0
  50. package/lib/Types/Events.js +2 -0
  51. package/lib/Types/GroupMetadata.js +2 -0
  52. package/lib/Types/Label.js +25 -0
  53. package/lib/Types/LabelAssociation.js +7 -0
  54. package/lib/Types/Message.js +11 -0
  55. package/lib/Types/Mex.js +37 -0
  56. package/lib/Types/Product.js +2 -0
  57. package/lib/Types/Signal.js +2 -0
  58. package/lib/Types/Socket.js +3 -0
  59. package/lib/Types/State.js +56 -0
  60. package/lib/Types/USync.js +2 -0
  61. package/lib/Types/index.js +26 -0
  62. package/lib/Utils/auth-utils.js +302 -0
  63. package/lib/Utils/browser-utils.js +49 -0
  64. package/lib/Utils/business.js +231 -0
  65. package/lib/Utils/chat-utils.js +872 -0
  66. package/lib/Utils/companion-reg-client-utils.js +35 -0
  67. package/lib/Utils/crypto.js +118 -0
  68. package/lib/Utils/decode-wa-message.js +350 -0
  69. package/lib/Utils/event-buffer.js +622 -0
  70. package/lib/Utils/generics.js +403 -0
  71. package/lib/Utils/history.js +134 -0
  72. package/lib/Utils/identity-change-handler.js +50 -0
  73. package/lib/Utils/index.js +23 -0
  74. package/lib/Utils/link-preview.js +85 -0
  75. package/lib/Utils/logger.js +3 -0
  76. package/lib/Utils/lt-hash.js +8 -0
  77. package/lib/Utils/make-mutex.js +33 -0
  78. package/lib/Utils/message-composer.js +273 -0
  79. package/lib/Utils/message-retry-manager.js +265 -0
  80. package/lib/Utils/messages-media.js +788 -0
  81. package/lib/Utils/messages.js +1260 -0
  82. package/lib/Utils/noise-handler.js +201 -0
  83. package/lib/Utils/offline-node-processor.js +40 -0
  84. package/lib/Utils/pre-key-manager.js +106 -0
  85. package/lib/Utils/process-message.js +630 -0
  86. package/lib/Utils/reporting-utils.js +258 -0
  87. package/lib/Utils/signal.js +201 -0
  88. package/lib/Utils/stanza-ack.js +38 -0
  89. package/lib/Utils/sync-action-utils.js +49 -0
  90. package/lib/Utils/tc-token-utils.js +163 -0
  91. package/lib/Utils/use-multi-file-auth-state.js +121 -0
  92. package/lib/Utils/validate-connection.js +203 -0
  93. package/lib/WABinary/constants.js +1301 -0
  94. package/lib/WABinary/decode.js +262 -0
  95. package/lib/WABinary/encode.js +220 -0
  96. package/lib/WABinary/generic-utils.js +204 -0
  97. package/lib/WABinary/index.js +6 -0
  98. package/lib/WABinary/jid-utils.js +98 -0
  99. package/lib/WABinary/types.js +2 -0
  100. package/lib/WAM/BinaryInfo.js +10 -0
  101. package/lib/WAM/constants.js +22853 -0
  102. package/lib/WAM/encode.js +150 -0
  103. package/lib/WAM/index.js +4 -0
  104. package/lib/WAUSync/Protocols/USyncContactProtocol.js +52 -0
  105. package/lib/WAUSync/Protocols/USyncDeviceProtocol.js +54 -0
  106. package/lib/WAUSync/Protocols/USyncDisappearingModeProtocol.js +27 -0
  107. package/lib/WAUSync/Protocols/USyncStatusProtocol.js +38 -0
  108. package/lib/WAUSync/Protocols/USyncUsernameProtocol.js +25 -0
  109. package/lib/WAUSync/Protocols/UsyncBotProfileProtocol.js +51 -0
  110. package/lib/WAUSync/Protocols/UsyncLIDProtocol.js +29 -0
  111. package/lib/WAUSync/Protocols/index.js +6 -0
  112. package/lib/WAUSync/USyncQuery.js +98 -0
  113. package/lib/WAUSync/USyncUser.js +31 -0
  114. package/lib/WAUSync/index.js +4 -0
  115. package/lib/index.js +20 -0
  116. package/package.json +152 -3
package/LICENSE ADDED
@@ -0,0 +1,30 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2021 Adhiraj Singh
4
+ Copyright (c) 2022-2026 WhiskeySockets and Baileys contributors
5
+ Copyright (c) 2026 alluffyxkiyora (modifications and fork maintenance)
6
+
7
+ This software ("alluffyxkiyora") is a derivative work based on Baileys
8
+ (https://github.com/WhiskeySockets/Baileys), originally created by Adhiraj Singh
9
+ and maintained by the WhiskeySockets community, licensed under the MIT License.
10
+ The original copyright notice above is retained as required by the MIT License.
11
+ Modifications, rebranding, and additional changes in this fork are
12
+ Copyright (c) 2026 alluffyxkiyora.
13
+
14
+ Permission is hereby granted, free of charge, to any person obtaining a copy
15
+ of this software and associated documentation files (the "Software"), to deal
16
+ in the Software without restriction, including without limitation the rights
17
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
18
+ copies of the Software, and to permit persons to whom the Software is
19
+ furnished to do so, subject to the following conditions:
20
+
21
+ The above copyright notice and this permission notice shall be included in all
22
+ copies or substantial portions of the Software.
23
+
24
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
25
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
26
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
27
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
28
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
29
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
30
+ SOFTWARE.
package/README.md CHANGED
@@ -1,5 +1,406 @@
1
- # Security holding package
1
+ # <div align='center'>alluffyxkiyora</div>
2
2
 
3
- This package contained malicious code and was removed from the registry by the npm security team. A placeholder was published to ensure users are not affected in the future.
3
+ <p align="center">
4
4
 
5
- Please refer to www.npmjs.com/advisories?search=%40developmentyora%2Fbaileyss for more information.
5
+ <img src="https://files.catbox.moe/dh8egd.jpg" width="180" alt="ᴋɪʏᴏʀᴀ ᴍᴀɴᴀɢᴇᴍᴇɴᴛ"/>
6
+
7
+ </p>
8
+
9
+ <div align='center'>
10
+
11
+ [![License](https://img.shields.io/badge/license-MIT-blue.svg)](LICENSE)
12
+ [![GitHub](https://img.shields.io/badge/source-GitHub-black.svg)](https://github.com/alluffyxkiyora/Baileyss)
13
+ [![Node](https://img.shields.io/badge/node-%3E%3D20-brightgreen.svg)](package.json)
14
+
15
+ A WebSockets library for interacting with WhatsApp Web, maintained under the **alluffyxkiyora** brand.
16
+ This project is a fork built on top of [Baileys](https://github.com/WhiskeySockets/Baileys) by WhiskeySockets.
17
+
18
+ </div>
19
+
20
+ ---
21
+
22
+ ## Installation
23
+ Install directly from GitHub (not published on npm registry):
24
+ ```bash
25
+ npm install github:alluffyxkiyora/Baileyss
26
+ ```
27
+
28
+ Or add it to your `package.json` manually:
29
+ ```json
30
+ "dependencies": {
31
+ "@alluffyxkiyora/baileyss": "github:alluffyxkiyora/Baileyss"
32
+ }
33
+ ```
34
+
35
+ Already have a bot built on the original `@whiskeysockets/baileys` and don't want to change every
36
+ `require`/`import` in your codebase? Alias the dependency name instead, so the original package
37
+ name points to this fork:
38
+ ```json
39
+ "dependencies": {
40
+ "@whiskeysockets/baileys": "github:alluffyxkiyora/Baileyss"
41
+ }
42
+ ```
43
+ With this alias, keep using `require('@whiskeysockets/baileys')` in your code as-is — npm will
44
+ resolve it to this fork under the hood.
45
+
46
+ You can also pin to a specific branch or commit:
47
+ ```bash
48
+ npm install github:alluffyxkiyora/Baileyss#main
49
+ ```
50
+
51
+ ## Import
52
+ ```javascript
53
+ const {
54
+ default: makeWASocket,
55
+ // other exports
56
+ } = require('@alluffyxkiyora/baileys');
57
+ ```
58
+
59
+ ---
60
+
61
+ # Connecting To WhatsApp
62
+
63
+ ## With QR Code
64
+ ```javascript
65
+ const {
66
+ default: makeWASocket,
67
+ Browsers
68
+ } = require('@alluffyxkiyora/baileys');
69
+
70
+ const client = makeWASocket({
71
+ browser: Browsers.alluffyxkiyora('Chrome'),
72
+ printQRInTerminal: true
73
+ });
74
+ ```
75
+
76
+ ## Connect With Pairing Code
77
+ ```javascript
78
+ const {
79
+ default: makeWASocket,
80
+ fetchLatestWAWebVersion,
81
+ Browsers
82
+ } = require('@alluffyxkiyora/baileys');
83
+
84
+ const client = makeWASocket({
85
+ browser: Browsers.alluffyxkiyora('Chrome'),
86
+ printQRInTerminal: false,
87
+ version: await fetchLatestWAWebVersion(),
88
+ aiLabel: false // set true to show an AI label on messages sent by the bot
89
+ // other options
90
+ });
91
+
92
+ const number = "628XXXXXXXXXX";
93
+ const code = await client.requestPairingCode(number.trim()); // or (number, "YYYYYYYY") for a custom pairing code
94
+
95
+ console.log("Your pairing code: " + code);
96
+ ```
97
+
98
+ # Storing Data
99
+ ```javascript
100
+ const {
101
+ default: makeWASocket,
102
+ makeInMemoryStore
103
+ } = require('@alluffyxkiyora/baileys');
104
+ const pino = require('pino');
105
+
106
+ const store = makeInMemoryStore({
107
+ logger: pino().child({ level: 'silent', stream: 'store' })
108
+ });
109
+ const client = makeWASocket({
110
+ // options
111
+ });
112
+ store.bind(client.ev);
113
+
114
+ client.ev.on('contacts.upsert', () => {
115
+ console.log('New contact: ' + Object.values(store.contacts()));
116
+ });
117
+ ```
118
+
119
+ # Sending Messages
120
+
121
+ ## Send / relay a message with `noSelfSync`
122
+
123
+ `noSelfSync` is a `relayMessage` option (private/1-on-1 chats only) that controls whether the
124
+ message is also synced to your **other own linked devices** (other phones/WhatsApp Web sessions
125
+ logged into the same account). It does not affect delivery to the recipient.
126
+
127
+ - **`noSelfSync: true`** — the message is sent to the recipient as normal, but is **not** synced
128
+ to your other own devices. Useful when you don't want a message to show up on your other
129
+ linked sessions (e.g. silent/automated sends from a bot account).
130
+ - **`noSelfSync: false`** (default) — normal behavior. The message is sent to the recipient and
131
+ also synced to your other own devices, so it appears everywhere you're logged in, just like
132
+ sending from the official WhatsApp app.
133
+
134
+ ```javascript
135
+ // Sent to the recipient, but NOT synced to your other devices
136
+ await client.relayMessage(m.chat, {
137
+ conversation: "Hello from alluffyxkiyora"
138
+ }, {
139
+ noSelfSync: true
140
+ });
141
+
142
+ // Sent to the recipient AND synced to your other devices (default behavior)
143
+ await client.relayMessage(m.chat, {
144
+ conversation: "Hello from alluffyxkiyora"
145
+ }, {
146
+ noSelfSync: false
147
+ });
148
+
149
+ // Also works through sendMessage
150
+ await client.sendMessage(m.chat, {
151
+ text: "Hello from alluffyxkiyora"
152
+ }, {
153
+ noSelfSync: true
154
+ });
155
+ ```
156
+
157
+ ## Send an orderMessage
158
+ ```javascript
159
+ const fs = require('fs');
160
+ const thumbnail = fs.readFileSync('./pouthumb.jpg');
161
+
162
+ await client.sendMessage(m.chat, {
163
+ thumbnail,
164
+ message: "Order summary",
165
+ orderTitle: "My Store",
166
+ totalAmount1000: 72502,
167
+ totalCurrencyCode: "IDR"
168
+ }, { quoted: m });
169
+ ```
170
+
171
+ ## Send a pollResultSnapshotMessage
172
+ ```javascript
173
+ await client.sendMessage(m.chat, {
174
+ pollResultMessage: {
175
+ name: "My Poll",
176
+ options: [
177
+ { optionName: "Option 1" },
178
+ { optionName: "Option 2" }
179
+ ],
180
+ newsletter: {
181
+ newsletterName: "0X8 - Society",
182
+ newsletterJid: "120363424944937940@newsletter"
183
+ }
184
+ }
185
+ });
186
+ ```
187
+
188
+ ## Send a productMessage
189
+ ```javascript
190
+ await client.relayMessage(m.chat, {
191
+ productMessage: {
192
+ title: "Product.pdf",
193
+ description: "Product description",
194
+ thumbnail: { url: "./pouthumb.jpg" },
195
+ productId: "EXAMPLE_TOKEN",
196
+ retailerId: "EXAMPLE_RETAILER_ID",
197
+ url: "https://example.com",
198
+ body: "Body text",
199
+ footer: "Footer",
200
+ buttons: [
201
+ {
202
+ name: "cta_url",
203
+ buttonParamsJson: "{\"display_text\":\"Visit\",\"url\":\"https://example.com\"}"
204
+ }
205
+ ],
206
+ priceAmount1000: 72502,
207
+ currencyCode: "IDR"
208
+ }
209
+ });
210
+ ```
211
+
212
+ ## Send an interactiveMessage
213
+ ```javascript
214
+ await client.sendMessage(m.chat, {
215
+ image: { url: "./pouimg.jpg" },
216
+ text: "body",
217
+ title: "title", // required when sending media
218
+ footer: "footer",
219
+ interactiveButtons: [
220
+ {
221
+ name: "single_select",
222
+ buttonParamsJson: JSON.stringify({
223
+ title: "\0"
224
+ })
225
+ }
226
+ ],
227
+ messageParams: JSON.stringify({
228
+ bottom_sheet: {
229
+ /** other params **/
230
+ }
231
+ })
232
+ });
233
+ ```
234
+
235
+ ## Send a member label
236
+ ```javascript
237
+ await client.sendMessage(m.chat, {
238
+ groupLabel: {
239
+ labelText: "Tagged members appear here"
240
+ }
241
+ });
242
+ ```
243
+
244
+ ## Send a message to group members
245
+ ```javascript
246
+ await client.sendMessageMembers(m.chat, {
247
+ extendedTextMessage: {
248
+ text: "Hello members"
249
+ }
250
+ }, {});
251
+ ```
252
+
253
+ # Simple sendMessage Helpers
254
+
255
+ ## Send text
256
+ ```javascript
257
+ await client.sendText(m.chat, "Hello!", {
258
+ contextInfo: {
259
+ mentionedJid: [m.chat]
260
+ }
261
+ }, {
262
+ key: {
263
+ remoteJid: "status@broadcast",
264
+ participant: m.sender,
265
+ fromMe: true
266
+ },
267
+ message: {
268
+ conversation: "\0"
269
+ }
270
+ });
271
+ ```
272
+
273
+ ## Send image
274
+ ```javascript
275
+ await client.sendImage(m.chat, { url: "./pouimg.jpg" }, "Caption", {
276
+ contextInfo: {
277
+ mentionedJid: [m.chat]
278
+ }
279
+ }, {
280
+ key: {
281
+ remoteJid: "status@broadcast",
282
+ participant: m.sender,
283
+ fromMe: true
284
+ },
285
+ message: {
286
+ conversation: "\0"
287
+ }
288
+ });
289
+ ```
290
+
291
+ ## Send video
292
+ ```javascript
293
+ await client.sendVideo(m.chat, { url: "./video.mp4" }, "Caption", {
294
+ contextInfo: {
295
+ mentionedJid: [m.chat]
296
+ }
297
+ }, {
298
+ key: {
299
+ remoteJid: "status@broadcast",
300
+ participant: m.sender,
301
+ fromMe: true
302
+ },
303
+ message: {
304
+ conversation: "\0"
305
+ }
306
+ });
307
+ ```
308
+
309
+ ## Send audio
310
+ ```javascript
311
+ await client.sendAudio(m.chat, { url: "./pouaudio.mp3" }, {
312
+ contextInfo: {
313
+ mentionedJid: [m.chat]
314
+ }
315
+ }, {
316
+ key: {
317
+ remoteJid: "status@broadcast",
318
+ participant: m.sender,
319
+ fromMe: true
320
+ },
321
+ message: {
322
+ conversation: "\0"
323
+ }
324
+ });
325
+ ```
326
+
327
+ ## Send location
328
+ ```javascript
329
+ await client.sendLocation(m.chat, "Caption", 90.0, 90.0, "https://example.com", "1234567890", {
330
+ contextInfo: {
331
+ mentionedJid: [m.chat]
332
+ }
333
+ }, {
334
+ key: {
335
+ remoteJid: "status@broadcast",
336
+ participant: m.sender,
337
+ fromMe: true
338
+ },
339
+ message: {
340
+ conversation: "\0"
341
+ }
342
+ });
343
+ ```
344
+
345
+ ## Send poll
346
+ ```javascript
347
+ await client.sendPoll(m.chat, "Pick one", ["1", "2", "3"], true, {
348
+ contextInfo: {
349
+ mentionedJid: [m.chat]
350
+ }
351
+ }, {
352
+ key: {
353
+ remoteJid: "status@broadcast",
354
+ participant: m.sender,
355
+ fromMe: true
356
+ },
357
+ message: {
358
+ conversation: "\0"
359
+ }
360
+ });
361
+ ```
362
+
363
+ ## Send quiz
364
+ ```javascript
365
+ await client.sendQuiz(m.chat, "Quiz question", ["1", "2", "3"], "2", {
366
+ contextInfo: {
367
+ mentionedJid: [m.chat]
368
+ }
369
+ }, {
370
+ key: {
371
+ remoteJid: "status@broadcast",
372
+ participant: m.sender,
373
+ fromMe: true
374
+ },
375
+ message: {
376
+ conversation: "\0"
377
+ }
378
+ });
379
+ ```
380
+
381
+ ## Send status mention
382
+ ```javascript
383
+ await client.statusMention(m.chat, {
384
+ extendedTextMessage: {
385
+ text: "Mentioned in status"
386
+ }
387
+ });
388
+ ```
389
+
390
+ ---
391
+
392
+ # Credits
393
+
394
+ alluffyxkiyora is a fork of [Baileys](https://github.com/WhiskeySockets/Baileys), originally created by
395
+ [Adhiraj Singh](https://github.com/adiwajshing) and maintained by the WhiskeySockets community.
396
+ All credit for the underlying protocol implementation goes to the original authors and contributors.
397
+ See [LICENSE](LICENSE) for the full license text and copyright notices.
398
+
399
+ # Contributing
400
+
401
+ See [CONTRIBUTING.md](CONTRIBUTING.md) for guidelines on reporting issues and submitting pull requests.
402
+
403
+ # Disclaimer
404
+
405
+ This is **not** an official WhatsApp product. Use of this library to send bulk or unsolicited messages
406
+ may violate WhatsApp's Terms of Service and can result in your number being banned. Use responsibly.
@@ -0,0 +1,3 @@
1
+ yarn pbjs -t static-module --no-beautify -w es6 --no-bundle --no-delimited --no-verify --no-comments -o ./index.js ./WAProto.proto;
2
+ yarn pbjs -t static-module --no-beautify -w es6 --no-bundle --no-delimited --no-verify ./WAProto.proto | yarn pbts --no-comments -o ./index.d.ts -;
3
+ node ./fix-imports.js