@zanxiky/baileys 0.0.1-security → 1.1.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 @zanxiky/baileys might be problematic. Click here for more details.

Files changed (116) hide show
  1. package/LICENSE +30 -0
  2. package/README.md +375 -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 +86 -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 +409 -0
  37. package/lib/Socket/socket.js +988 -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 +24 -0
  116. package/package.json +145 -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 PouCode (modifications and fork maintenance)
6
+
7
+ This software ("PouCode") 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 PouCode.
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,377 @@
1
- # Security holding package
1
+ # <div align='center'>Iky Baileys</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=%40zanxiky%2Fbaileys for more information.
5
+ <img src="https://files.catbox.moe/2jex1b.jpg" width="180" alt="Pou"/>
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/pou-code/Baileys)
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 **Iky Baileys** 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
+ ## Import
23
+ ```javascript
24
+ const {
25
+ default: makeWASocket,
26
+ // other exports
27
+ } = require('@zanxiky/baileys');
28
+ ```
29
+
30
+ ---
31
+
32
+ # Connecting To WhatsApp
33
+
34
+ ## With QR Code
35
+ ```javascript
36
+ const {
37
+ default: makeWASocket,
38
+ Browsers
39
+ } = require('@zanxiky/baileys');
40
+
41
+ const client = makeWASocket({
42
+ browser: Browsers.zanxiky('Chrome'),
43
+ printQRInTerminal: true
44
+ });
45
+ ```
46
+
47
+ ## Connect With Pairing Code
48
+ ```javascript
49
+ const {
50
+ default: makeWASocket,
51
+ fetchLatestWAWebVersion,
52
+ Browsers
53
+ } = require('@zanxiky/baileys');
54
+
55
+ const client = makeWASocket({
56
+ browser: Browsers.zanxiky('Chrome'),
57
+ printQRInTerminal: false,
58
+ version: await fetchLatestWAWebVersion(),
59
+ aiLabel: false // set true to show an AI label on messages sent by the bot
60
+ // other options
61
+ });
62
+
63
+ const number = "628XXXXXXXXXX";
64
+ const code = await client.requestPairingCode(number.trim()); // or (number, "YYYYYYYY") for a custom pairing code
65
+
66
+ console.log("Your pairing code: " + code);
67
+ ```
68
+
69
+ # Storing Data
70
+ ```javascript
71
+ const {
72
+ default: makeWASocket,
73
+ makeInMemoryStore
74
+ } = require('@zanxiky/baileys');
75
+ const pino = require('pino');
76
+
77
+ const store = makeInMemoryStore({
78
+ logger: pino().child({ level: 'silent', stream: 'store' })
79
+ });
80
+ const client = makeWASocket({
81
+ // options
82
+ });
83
+ store.bind(client.ev);
84
+
85
+ client.ev.on('contacts.upsert', () => {
86
+ console.log('New contact: ' + Object.values(store.contacts()));
87
+ });
88
+ ```
89
+
90
+ # Sending Messages
91
+
92
+ ## Send / relay a message with `noSelfSync`
93
+
94
+ `noSelfSync` is a `relayMessage` option (private/1-on-1 chats only) that controls whether the
95
+ message is also synced to your **other own linked devices** (other phones/WhatsApp Web sessions
96
+ logged into the same account). It does not affect delivery to the recipient.
97
+
98
+ - **`noSelfSync: true`** — the message is sent to the recipient as normal, but is **not** synced
99
+ to your other own devices. Useful when you don't want a message to show up on your other
100
+ linked sessions (e.g. silent/automated sends from a bot account).
101
+ - **`noSelfSync: false`** (default) — normal behavior. The message is sent to the recipient and
102
+ also synced to your other own devices, so it appears everywhere you're logged in, just like
103
+ sending from the official WhatsApp app.
104
+
105
+ ```javascript
106
+ // Sent to the recipient, but NOT synced to your other devices
107
+ await client.relayMessage(m.chat, {
108
+ conversation: "Hello from zanxiky"
109
+ }, {
110
+ noSelfSync: true
111
+ });
112
+
113
+ // Sent to the recipient AND synced to your other devices (default behavior)
114
+ await client.relayMessage(m.chat, {
115
+ conversation: "Hello from zanxiky"
116
+ }, {
117
+ noSelfSync: false
118
+ });
119
+
120
+ // Also works through sendMessage
121
+ await client.sendMessage(m.chat, {
122
+ text: "Hello from zanxiky"
123
+ }, {
124
+ noSelfSync: true
125
+ });
126
+ ```
127
+
128
+ ## Send an orderMessage
129
+ ```javascript
130
+ const fs = require('fs');
131
+ const thumbnail = fs.readFileSync('./pouthumb.jpg');
132
+
133
+ await client.sendMessage(m.chat, {
134
+ thumbnail,
135
+ message: "Order summary",
136
+ orderTitle: "My Store",
137
+ totalAmount1000: 72502,
138
+ totalCurrencyCode: "IDR"
139
+ }, { quoted: m });
140
+ ```
141
+
142
+ ## Send a pollResultSnapshotMessage
143
+ ```javascript
144
+ await client.sendMessage(m.chat, {
145
+ pollResultMessage: {
146
+ name: "My Poll",
147
+ options: [
148
+ { optionName: "Option 1" },
149
+ { optionName: "Option 2" }
150
+ ],
151
+ newsletter: {
152
+ newsletterName: "0X8 - Society",
153
+ newsletterJid: "120363424944937940@newsletter"
154
+ }
155
+ }
156
+ });
157
+ ```
158
+
159
+ ## Send a productMessage
160
+ ```javascript
161
+ await client.relayMessage(m.chat, {
162
+ productMessage: {
163
+ title: "Product.pdf",
164
+ description: "Product description",
165
+ thumbnail: { url: "./pouthumb.jpg" },
166
+ productId: "EXAMPLE_TOKEN",
167
+ retailerId: "EXAMPLE_RETAILER_ID",
168
+ url: "https://example.com",
169
+ body: "Body text",
170
+ footer: "Footer",
171
+ buttons: [
172
+ {
173
+ name: "cta_url",
174
+ buttonParamsJson: "{\"display_text\":\"Visit\",\"url\":\"https://example.com\"}"
175
+ }
176
+ ],
177
+ priceAmount1000: 72502,
178
+ currencyCode: "IDR"
179
+ }
180
+ });
181
+ ```
182
+
183
+ ## Send an interactiveMessage
184
+ ```javascript
185
+ await client.sendMessage(m.chat, {
186
+ image: { url: "./pouimg.jpg" },
187
+ text: "body",
188
+ title: "title", // required when sending media
189
+ footer: "footer",
190
+ interactiveButtons: [
191
+ {
192
+ name: "single_select",
193
+ buttonParamsJson: JSON.stringify({
194
+ title: "\0"
195
+ })
196
+ }
197
+ ],
198
+ messageParams: JSON.stringify({
199
+ bottom_sheet: {
200
+ /** other params **/
201
+ }
202
+ })
203
+ });
204
+ ```
205
+
206
+ ## Send a member label
207
+ ```javascript
208
+ await client.sendMessage(m.chat, {
209
+ groupLabel: {
210
+ labelText: "Tagged members appear here"
211
+ }
212
+ });
213
+ ```
214
+
215
+ ## Send a message to group members
216
+ ```javascript
217
+ await client.sendMessageMembers(m.chat, {
218
+ extendedTextMessage: {
219
+ text: "Hello members"
220
+ }
221
+ }, {});
222
+ ```
223
+
224
+ # Simple sendMessage Helpers
225
+
226
+ ## Send text
227
+ ```javascript
228
+ await client.sendText(m.chat, "Hello!", {
229
+ contextInfo: {
230
+ mentionedJid: [m.chat]
231
+ }
232
+ }, {
233
+ key: {
234
+ remoteJid: "status@broadcast",
235
+ participant: m.sender,
236
+ fromMe: true
237
+ },
238
+ message: {
239
+ conversation: "\0"
240
+ }
241
+ });
242
+ ```
243
+
244
+ ## Send image
245
+ ```javascript
246
+ await client.sendImage(m.chat, { url: "./pouimg.jpg" }, "Caption", {
247
+ contextInfo: {
248
+ mentionedJid: [m.chat]
249
+ }
250
+ }, {
251
+ key: {
252
+ remoteJid: "status@broadcast",
253
+ participant: m.sender,
254
+ fromMe: true
255
+ },
256
+ message: {
257
+ conversation: "\0"
258
+ }
259
+ });
260
+ ```
261
+
262
+ ## Send video
263
+ ```javascript
264
+ await client.sendVideo(m.chat, { url: "./video.mp4" }, "Caption", {
265
+ contextInfo: {
266
+ mentionedJid: [m.chat]
267
+ }
268
+ }, {
269
+ key: {
270
+ remoteJid: "status@broadcast",
271
+ participant: m.sender,
272
+ fromMe: true
273
+ },
274
+ message: {
275
+ conversation: "\0"
276
+ }
277
+ });
278
+ ```
279
+
280
+ ## Send audio
281
+ ```javascript
282
+ await client.sendAudio(m.chat, { url: "./pouaudio.mp3" }, {
283
+ contextInfo: {
284
+ mentionedJid: [m.chat]
285
+ }
286
+ }, {
287
+ key: {
288
+ remoteJid: "status@broadcast",
289
+ participant: m.sender,
290
+ fromMe: true
291
+ },
292
+ message: {
293
+ conversation: "\0"
294
+ }
295
+ });
296
+ ```
297
+
298
+ ## Send location
299
+ ```javascript
300
+ await client.sendLocation(m.chat, "Caption", 90.0, 90.0, "https://example.com", "1234567890", {
301
+ contextInfo: {
302
+ mentionedJid: [m.chat]
303
+ }
304
+ }, {
305
+ key: {
306
+ remoteJid: "status@broadcast",
307
+ participant: m.sender,
308
+ fromMe: true
309
+ },
310
+ message: {
311
+ conversation: "\0"
312
+ }
313
+ });
314
+ ```
315
+
316
+ ## Send poll
317
+ ```javascript
318
+ await client.sendPoll(m.chat, "Pick one", ["1", "2", "3"], true, {
319
+ contextInfo: {
320
+ mentionedJid: [m.chat]
321
+ }
322
+ }, {
323
+ key: {
324
+ remoteJid: "status@broadcast",
325
+ participant: m.sender,
326
+ fromMe: true
327
+ },
328
+ message: {
329
+ conversation: "\0"
330
+ }
331
+ });
332
+ ```
333
+
334
+ ## Send quiz
335
+ ```javascript
336
+ await client.sendQuiz(m.chat, "Quiz question", ["1", "2", "3"], "2", {
337
+ contextInfo: {
338
+ mentionedJid: [m.chat]
339
+ }
340
+ }, {
341
+ key: {
342
+ remoteJid: "status@broadcast",
343
+ participant: m.sender,
344
+ fromMe: true
345
+ },
346
+ message: {
347
+ conversation: "\0"
348
+ }
349
+ });
350
+ ```
351
+
352
+ ## Send status mention
353
+ ```javascript
354
+ await client.statusMention(m.chat, {
355
+ extendedTextMessage: {
356
+ text: "Mentioned in status"
357
+ }
358
+ });
359
+ ```
360
+
361
+ ---
362
+
363
+ # Credits
364
+
365
+ Iky Baileys is a fork of [Baileys](https://github.com/WhiskeySockets/Baileys), originally created by
366
+ [Adhiraj Singh](https://github.com/adiwajshing) and maintained by the WhiskeySockets community.
367
+ All credit for the underlying protocol implementation goes to the original authors and contributors.
368
+ See [LICENSE](LICENSE) for the full license text and copyright notices.
369
+
370
+ # Contributing
371
+
372
+ See [CONTRIBUTING.md](CONTRIBUTING.md) for guidelines on reporting issues and submitting pull requests.
373
+
374
+ # Disclaimer
375
+
376
+ This is **not** an official WhatsApp product. Use of this library to send bulk or unsolicited messages
377
+ 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