@zelynskybail/baileys 0.0.0-stage → 2.6.28

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.
Files changed (226) hide show
  1. package/BUILD_STATUS.md +21 -0
  2. package/CHANGELOG.md +17 -0
  3. package/LICENSE +21 -0
  4. package/NOTICE.md +9 -0
  5. package/README.md +165 -2
  6. package/THANKS.md +7 -0
  7. package/THIRD_PARTY_NOTICES.md +8 -0
  8. package/WAProto/GenerateStatics.sh +3 -0
  9. package/WAProto/WAProto.proto +6035 -0
  10. package/WAProto/fix-imports.js +81 -0
  11. package/WAProto/index.d.ts +2 -0
  12. package/WAProto/index.js +132326 -0
  13. package/lib/Builders/advanced.d.ts +14 -0
  14. package/lib/Builders/advanced.js +142 -0
  15. package/lib/Builders/group-status.d.ts +9 -0
  16. package/lib/Builders/group-status.js +19 -0
  17. package/lib/Builders/index.d.ts +62 -0
  18. package/lib/Builders/index.js +242 -0
  19. package/lib/Defaults/index.d.ts +74 -0
  20. package/lib/Defaults/index.js +136 -0
  21. package/lib/Modded/MessageBuilder.js +3222 -0
  22. package/lib/Modded/message_builder.d.ts +43 -0
  23. package/lib/Modded/message_builder.js +2 -0
  24. package/lib/Signal/Group/ciphertext-message.d.ts +10 -0
  25. package/lib/Signal/Group/ciphertext-message.js +11 -0
  26. package/lib/Signal/Group/group-session-builder.d.ts +15 -0
  27. package/lib/Signal/Group/group-session-builder.js +29 -0
  28. package/lib/Signal/Group/group_cipher.d.ts +17 -0
  29. package/lib/Signal/Group/group_cipher.js +81 -0
  30. package/lib/Signal/Group/index.d.ts +12 -0
  31. package/lib/Signal/Group/index.js +11 -0
  32. package/lib/Signal/Group/keyhelper.d.ts +11 -0
  33. package/lib/Signal/Group/keyhelper.js +17 -0
  34. package/lib/Signal/Group/sender-chain-key.d.ts +14 -0
  35. package/lib/Signal/Group/sender-chain-key.js +25 -0
  36. package/lib/Signal/Group/sender-key-distribution-message.d.ts +17 -0
  37. package/lib/Signal/Group/sender-key-distribution-message.js +62 -0
  38. package/lib/Signal/Group/sender-key-message.d.ts +19 -0
  39. package/lib/Signal/Group/sender-key-message.js +65 -0
  40. package/lib/Signal/Group/sender-key-name.d.ts +18 -0
  41. package/lib/Signal/Group/sender-key-name.js +47 -0
  42. package/lib/Signal/Group/sender-key-record.d.ts +31 -0
  43. package/lib/Signal/Group/sender-key-record.js +40 -0
  44. package/lib/Signal/Group/sender-key-state.d.ts +39 -0
  45. package/lib/Signal/Group/sender-key-state.js +83 -0
  46. package/lib/Signal/Group/sender-message-key.d.ts +12 -0
  47. package/lib/Signal/Group/sender-message-key.js +25 -0
  48. package/lib/Signal/libsignal.d.ts +5 -0
  49. package/lib/Signal/libsignal.js +402 -0
  50. package/lib/Signal/lid-mapping.d.ts +19 -0
  51. package/lib/Signal/lid-mapping.js +270 -0
  52. package/lib/Socket/Client/index.d.ts +3 -0
  53. package/lib/Socket/Client/index.js +2 -0
  54. package/lib/Socket/Client/types.d.ts +16 -0
  55. package/lib/Socket/Client/types.js +10 -0
  56. package/lib/Socket/Client/websocket.d.ts +13 -0
  57. package/lib/Socket/Client/websocket.js +53 -0
  58. package/lib/Socket/business.d.ts +536 -0
  59. package/lib/Socket/business.js +421 -0
  60. package/lib/Socket/chats.d.ts +111 -0
  61. package/lib/Socket/chats.js +990 -0
  62. package/lib/Socket/communities.d.ts +645 -0
  63. package/lib/Socket/communities.js +430 -0
  64. package/lib/Socket/dugong.d.ts +130 -0
  65. package/lib/Socket/dugong.js +767 -0
  66. package/lib/Socket/groups.d.ts +150 -0
  67. package/lib/Socket/groups.js +326 -0
  68. package/lib/Socket/index.d.ts +657 -0
  69. package/lib/Socket/index.js +26 -0
  70. package/lib/Socket/messages-recv.d.ts +238 -0
  71. package/lib/Socket/messages-recv.js +1307 -0
  72. package/lib/Socket/messages-send.d.ts +579 -0
  73. package/lib/Socket/messages-send.js +1594 -0
  74. package/lib/Socket/mex.d.ts +3 -0
  75. package/lib/Socket/mex.js +47 -0
  76. package/lib/Socket/newsletter.d.ts +177 -0
  77. package/lib/Socket/newsletter.js +314 -0
  78. package/lib/Socket/socket.d.ts +55 -0
  79. package/lib/Socket/socket.js +935 -0
  80. package/lib/Types/Auth.d.ts +116 -0
  81. package/lib/Types/Auth.js +1 -0
  82. package/lib/Types/Bussines.d.ts +37 -0
  83. package/lib/Types/Bussines.js +1 -0
  84. package/lib/Types/Call.d.ts +15 -0
  85. package/lib/Types/Call.js +1 -0
  86. package/lib/Types/Chat.d.ts +123 -0
  87. package/lib/Types/Chat.js +7 -0
  88. package/lib/Types/Contact.d.ts +24 -0
  89. package/lib/Types/Contact.js +1 -0
  90. package/lib/Types/Events.d.ts +237 -0
  91. package/lib/Types/Events.js +1 -0
  92. package/lib/Types/GroupMetadata.d.ts +68 -0
  93. package/lib/Types/GroupMetadata.js +1 -0
  94. package/lib/Types/Label.d.ts +47 -0
  95. package/lib/Types/Label.js +24 -0
  96. package/lib/Types/LabelAssociation.d.ts +30 -0
  97. package/lib/Types/LabelAssociation.js +6 -0
  98. package/lib/Types/Message.d.ts +422 -0
  99. package/lib/Types/Message.js +10 -0
  100. package/lib/Types/Newsletter.d.ts +135 -0
  101. package/lib/Types/Newsletter.js +30 -0
  102. package/lib/Types/Product.d.ts +79 -0
  103. package/lib/Types/Product.js +1 -0
  104. package/lib/Types/Signal.d.ts +76 -0
  105. package/lib/Types/Signal.js +1 -0
  106. package/lib/Types/Socket.d.ts +154 -0
  107. package/lib/Types/Socket.js +2 -0
  108. package/lib/Types/State.d.ts +39 -0
  109. package/lib/Types/State.js +12 -0
  110. package/lib/Types/USync.d.ts +26 -0
  111. package/lib/Types/USync.js +1 -0
  112. package/lib/Types/index.d.ts +66 -0
  113. package/lib/Types/index.js +32 -0
  114. package/lib/Utils/auth-utils.d.ts +19 -0
  115. package/lib/Utils/auth-utils.js +289 -0
  116. package/lib/Utils/browser-utils.d.ts +4 -0
  117. package/lib/Utils/browser-utils.js +27 -0
  118. package/lib/Utils/business.d.ts +23 -0
  119. package/lib/Utils/business.js +230 -0
  120. package/lib/Utils/chat-utils.d.ts +70 -0
  121. package/lib/Utils/chat-utils.js +811 -0
  122. package/lib/Utils/crypto.d.ts +37 -0
  123. package/lib/Utils/crypto.js +117 -0
  124. package/lib/Utils/decode-wa-message.d.ts +48 -0
  125. package/lib/Utils/decode-wa-message.js +282 -0
  126. package/lib/Utils/event-buffer.d.ts +34 -0
  127. package/lib/Utils/event-buffer.js +573 -0
  128. package/lib/Utils/generics.d.ts +91 -0
  129. package/lib/Utils/generics.js +383 -0
  130. package/lib/Utils/history.d.ts +22 -0
  131. package/lib/Utils/history.js +130 -0
  132. package/lib/Utils/identity-change-handler.d.ts +37 -0
  133. package/lib/Utils/identity-change-handler.js +48 -0
  134. package/lib/Utils/index.d.ts +24 -0
  135. package/lib/Utils/index.js +24 -0
  136. package/lib/Utils/link-preview.d.ts +21 -0
  137. package/lib/Utils/link-preview.js +84 -0
  138. package/lib/Utils/logger.d.ts +13 -0
  139. package/lib/Utils/logger.js +2 -0
  140. package/lib/Utils/lt-hash.d.ts +8 -0
  141. package/lib/Utils/lt-hash.js +7 -0
  142. package/lib/Utils/make-mutex.d.ts +9 -0
  143. package/lib/Utils/make-mutex.js +32 -0
  144. package/lib/Utils/message-retry-manager.d.ts +110 -0
  145. package/lib/Utils/message-retry-manager.js +224 -0
  146. package/lib/Utils/message-tools.d.ts +31 -0
  147. package/lib/Utils/message-tools.js +182 -0
  148. package/lib/Utils/messages-media.d.ts +130 -0
  149. package/lib/Utils/messages-media.js +781 -0
  150. package/lib/Utils/messages.d.ts +91 -0
  151. package/lib/Utils/messages.js +1239 -0
  152. package/lib/Utils/noise-handler.d.ts +20 -0
  153. package/lib/Utils/noise-handler.js +200 -0
  154. package/lib/Utils/offline-node-processor.d.ts +17 -0
  155. package/lib/Utils/offline-node-processor.js +68 -0
  156. package/lib/Utils/performance.d.ts +3 -0
  157. package/lib/Utils/performance.js +35 -0
  158. package/lib/Utils/pre-key-manager.d.ts +28 -0
  159. package/lib/Utils/pre-key-manager.js +105 -0
  160. package/lib/Utils/process-message.d.ts +60 -0
  161. package/lib/Utils/process-message.js +527 -0
  162. package/lib/Utils/reporting-utils.d.ts +11 -0
  163. package/lib/Utils/reporting-utils.js +257 -0
  164. package/lib/Utils/rich-messages.d.ts +277 -0
  165. package/lib/Utils/rich-messages.js +1143 -0
  166. package/lib/Utils/signal.d.ts +34 -0
  167. package/lib/Utils/signal.js +158 -0
  168. package/lib/Utils/stanza-ack.d.ts +11 -0
  169. package/lib/Utils/stanza-ack.js +37 -0
  170. package/lib/Utils/sticker-pack.d.ts +10 -0
  171. package/lib/Utils/sticker-pack.js +111 -0
  172. package/lib/Utils/sync-action-utils.d.ts +19 -0
  173. package/lib/Utils/sync-action-utils.js +47 -0
  174. package/lib/Utils/tc-token-utils.d.ts +12 -0
  175. package/lib/Utils/tc-token-utils.js +17 -0
  176. package/lib/Utils/use-multi-file-auth-state.d.ts +13 -0
  177. package/lib/Utils/use-multi-file-auth-state.js +120 -0
  178. package/lib/Utils/validate-connection.d.ts +11 -0
  179. package/lib/Utils/validate-connection.js +199 -0
  180. package/lib/VoIP/index.d.ts +18 -0
  181. package/lib/VoIP/index.js +81 -0
  182. package/lib/WABinary/constants.d.ts +28 -0
  183. package/lib/WABinary/constants.js +1300 -0
  184. package/lib/WABinary/decode.d.ts +7 -0
  185. package/lib/WABinary/decode.js +261 -0
  186. package/lib/WABinary/encode.d.ts +3 -0
  187. package/lib/WABinary/encode.js +219 -0
  188. package/lib/WABinary/generic-utils.d.ts +17 -0
  189. package/lib/WABinary/generic-utils.js +190 -0
  190. package/lib/WABinary/index.d.ts +6 -0
  191. package/lib/WABinary/index.js +5 -0
  192. package/lib/WABinary/jid-utils.d.ts +48 -0
  193. package/lib/WABinary/jid-utils.js +95 -0
  194. package/lib/WABinary/types.d.ts +19 -0
  195. package/lib/WABinary/types.js +1 -0
  196. package/lib/WAM/BinaryInfo.d.ts +9 -0
  197. package/lib/WAM/BinaryInfo.js +9 -0
  198. package/lib/WAM/constants.d.ts +40 -0
  199. package/lib/WAM/constants.js +22852 -0
  200. package/lib/WAM/encode.d.ts +3 -0
  201. package/lib/WAM/encode.js +149 -0
  202. package/lib/WAM/index.d.ts +4 -0
  203. package/lib/WAM/index.js +3 -0
  204. package/lib/WAUSync/Protocols/USyncContactProtocol.d.ts +10 -0
  205. package/lib/WAUSync/Protocols/USyncContactProtocol.js +28 -0
  206. package/lib/WAUSync/Protocols/USyncDeviceProtocol.d.ts +23 -0
  207. package/lib/WAUSync/Protocols/USyncDeviceProtocol.js +53 -0
  208. package/lib/WAUSync/Protocols/USyncDisappearingModeProtocol.d.ts +13 -0
  209. package/lib/WAUSync/Protocols/USyncDisappearingModeProtocol.js +26 -0
  210. package/lib/WAUSync/Protocols/USyncStatusProtocol.d.ts +13 -0
  211. package/lib/WAUSync/Protocols/USyncStatusProtocol.js +37 -0
  212. package/lib/WAUSync/Protocols/UsyncBotProfileProtocol.d.ts +26 -0
  213. package/lib/WAUSync/Protocols/UsyncBotProfileProtocol.js +50 -0
  214. package/lib/WAUSync/Protocols/UsyncLIDProtocol.d.ts +10 -0
  215. package/lib/WAUSync/Protocols/UsyncLIDProtocol.js +28 -0
  216. package/lib/WAUSync/Protocols/index.d.ts +5 -0
  217. package/lib/WAUSync/Protocols/index.js +4 -0
  218. package/lib/WAUSync/USyncQuery.d.ts +29 -0
  219. package/lib/WAUSync/USyncQuery.js +93 -0
  220. package/lib/WAUSync/USyncUser.d.ts +13 -0
  221. package/lib/WAUSync/USyncUser.js +22 -0
  222. package/lib/WAUSync/index.d.ts +4 -0
  223. package/lib/WAUSync/index.js +3 -0
  224. package/lib/index.d.ts +14 -0
  225. package/lib/index.js +14 -0
  226. package/package.json +128 -4
@@ -0,0 +1,21 @@
1
+ # ZelynskyBail Baileys 2.6.28 — build and validation status
2
+
3
+ This is the requested versioned source build. It is not a claim of complete WhatsApp protocol parity or production certification.
4
+
5
+ ## Implemented in this package
6
+ - Baileys v7-derived socket/auth/Signal/WABinary/WAProto/WAM/WAUSync core from the supplied Delkira distribution.
7
+ - Interactive and rich-message builders, including bundled MessageBuilder 4.7, Button V1/V2, Carousel, AIRich/ORich, NativeFlow, polls, albums, contacts, locations, link preview and status helpers.
8
+ - ButtonV3 hydrated-template builder and experimental A2UI payload validator.
9
+ - In-memory message indexing/search, anti-delete event observer, and atomic JSON PersistentStore.
10
+ - Newsletter, groups, communities, business, privacy, profile, message edit/delete and status protocol methods present in the supplied core.
11
+ - Call event/reject/link/privacy helpers. Optional outbound 1:1 voice call client is exposed through `VoipClient` using its own linked-device session.
12
+ - Group Status helper for text, image, video, audio and sticker, backed by the core `swgc` path.
13
+ - VCardBuilder alias over the built-in contact-card builder.
14
+ - No automatic newsletter/channel follow or invite acceptance on connect.
15
+
16
+ ## Explicit limitations
17
+ - VoIP engine supports outbound 1:1 voice calls and audio streaming only. It does not support incoming RTC calls, video calls, or group calls. It uses its own linked-device `authDir`, not the parent socket.
18
+ - A2UI is an experimental payload builder/validator; live rendering depends on WhatsApp client support and has not been verified.
19
+ - Group Status, every Casileys-specific manager, and every undocumented private WhatsApp payload are not claimed complete.
20
+ - Runtime install, live pairing, media relay, and end-to-end tests have not been performed in this environment.
21
+ - Before public npm publication, review every upstream license and preserve notices. The bundled MessageBuilder license restricts redistribution as a standalone product; it is bundled as a module with the original watermark retained, but permission should be confirmed for public distribution.
package/CHANGELOG.md ADDED
@@ -0,0 +1,17 @@
1
+ # Changelog
2
+
3
+ ## 2.6.28
4
+
5
+ - Set requested package version to 2.6.28 and retained the scoped npm name `@zelynskybail/baileys`.
6
+ - Integrated the user-provided NIXCODE MessageBuilder 4.7 source into `lib/Modded/MessageBuilder.js`; preserved its watermark and attribution.
7
+ - Adapted MessageBuilder imports to ZelynskyBail internal utility modules and lazy-loaded optional `sharp` / `fluent-ffmpeg`.
8
+ - Added ButtonV3 hydrated-template builder and experimental A2UI tree validation/payload builder.
9
+ - Added bounded in-memory MessageSearch and AntiDeleteManager observers.
10
+ - Added atomic JSON PersistentStore for small metadata.
11
+ - Added optional `baileys-caller` adapter for outbound 1:1 voice calls; call engine remains optional and separate-session.
12
+ - Kept automatic channel/newsletter following removed. Explicit newsletter APIs remain available.
13
+ - Preserved selectable performance profiles and low-overhead offline queue processing.
14
+
15
+ ## 0.1.0-alpha.1
16
+
17
+ - Initial ZelynskyBail package layout, adaptive socket profiles, base builders, call-control manager, and auto-follow removal.
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Grace Olivia
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/NOTICE.md ADDED
@@ -0,0 +1,9 @@
1
+ # Notices and attribution
2
+
3
+ ZelynskyBail is a derivative Baileys distribution. It contains code and generated protocol artifacts from the WhiskeySockets/Baileys ecosystem and the supplied Delkira Baileys archive. Their original MIT notices and source headers are retained.
4
+
5
+ The bundled `lib/Modded/MessageBuilder.js` is the user-supplied NIXCODE MessageBuilder 4.7. Its original watermark and license wording are preserved. The license allows use and modification for personal/commercial projects but restricts redistribution as a standalone product. This file is integrated as a module within the larger Baileys distribution and is not offered as a separate package; obtain direct permission from the rightsholder before public redistribution if needed.
6
+
7
+ The optional VoIP engine is a separate MIT-licensed dependency and is loaded only when requested.
8
+
9
+ This project is independent and is not affiliated with or endorsed by WhatsApp or Meta Platforms, Inc.
package/README.md CHANGED
@@ -1,3 +1,166 @@
1
- # Temporary Holding Version
1
+ # @zelynskybail/baileys
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ Adaptive Baileys v7-derived distribution with internal rich-message builders, message utilities, call controls, optional outbound voice calling, and selectable connection profiles.
4
+
5
+ **Requested package version:** `2.6.28`
6
+ **Module format:** ESM
7
+ **Runtime:** Node.js 20+
8
+ **Package name:** `@zelynskybail/baileys`
9
+
10
+ > This is a community-maintained, reverse-engineered WhatsApp Web library. It is not affiliated with or endorsed by WhatsApp or Meta. WhatsApp protocol changes can break compatibility without notice.
11
+
12
+ ## Installation
13
+
14
+ ```bash
15
+ npm install @zelynskybail/baileys
16
+ ```
17
+
18
+ ## Quick start
19
+
20
+ ```js
21
+ import makeWASocket, {
22
+ useMultiFileAuthState,
23
+ fetchLatestBaileysVersion,
24
+ Browsers
25
+ } from '@zelynskybail/baileys'
26
+ import pino from 'pino'
27
+
28
+ const { state, saveCreds } = await useMultiFileAuthState('./session')
29
+ const { version } = await fetchLatestBaileysVersion()
30
+
31
+ const sock = makeWASocket({
32
+ auth: state,
33
+ version,
34
+ logger: pino({ level: 'silent' }),
35
+ browser: Browsers.ubuntu('Chrome'),
36
+ performanceProfile: 'balanced'
37
+ })
38
+
39
+ sock.ev.on('creds.update', saveCreds)
40
+ ```
41
+
42
+ ## Included feature groups
43
+
44
+ ### Core Baileys
45
+
46
+ The supplied core distribution includes socket creation, authentication, Signal, WABinary, WAProto, WAM, WAUSync, message generation and receive/send pipelines, groups, communities, business, newsletter, privacy, profile, presence, and media helpers. Root exports preserve the upstream-style Baileys import surface wherever the source package exported it.
47
+
48
+ ### Message builders
49
+
50
+ All builders ship inside this package; no project-local `MessageBuilder.js` file is required:
51
+
52
+ ```js
53
+ import {
54
+ Button, ButtonV2, ButtonV3, NativeFlow,
55
+ Carousel, AIRich, ORich, A2UIBuilder,
56
+ PollBuilder, AlbumBuilder, ContactBuilder, VCardBuilder,
57
+ LocationBuilder, LinkPreviewBuilder, GroupStatusHelper,
58
+ MessageBuilder
59
+ } from '@zelynskybail/baileys'
60
+ ```
61
+
62
+ The bundled NIXCODE MessageBuilder 4.7 keeps its author watermark and notice. It contains Button, ButtonV2, Carousel, AIRich, ORich and Toolkit functionality, including rich response sections, code, tables, inline links/citations/LaTeX, image/video, product/post/reel cards, widgets, footer actions, suggestions, edit and send helpers.
63
+
64
+ Additional builders include ButtonV3 hydrated templates, NativeFlow, poll, album, contact/VCard, location and link-preview builders. `A2UIBuilder` validates/normalizes a Bloks-style widget tree; it is experimental and live rendering is client/protocol dependent.
65
+
66
+ A socket receives convenience factories such as `sock.createButton()`, `sock.createButtonV2()`, `sock.createNativeFlow()`, `sock.createCarousel()`, `sock.createAIRich()`, `sock.createPoll()`, `sock.createAlbum()`, `sock.createContact()`, `sock.createVCard()`, `sock.createLocation()`, and `sock.createLinkPreview()`. The lazy message-search and anti-delete factories are asynchronous and must be awaited.
67
+
68
+ ### Group Status and VCard
69
+
70
+ ```js
71
+ import { GroupStatusHelper, VCardBuilder } from '@zelynskybail/baileys'
72
+
73
+ await GroupStatusHelper.text(sock, '1203xxx@g.us', 'Hello group')
74
+ await GroupStatusHelper.image(sock, '1203xxx@g.us', './status.jpg', 'Group status')
75
+
76
+ const card = sock.createVCard()
77
+ .add({ name: 'Zell', phone: '+628123456789' })
78
+ await card.send('628123456789@s.whatsapp.net')
79
+ ```
80
+
81
+ Group Status uses the core `swgc` path. Availability and rendering are controlled by WhatsApp's current group-story protocol.
82
+
83
+ ### Search, anti-delete observation and persistent storage
84
+
85
+ ```js
86
+ const search = await sock.createMessageSearch({ maxEntries: 5000 })
87
+ const antiDelete = await sock.createAntiDeleteManager({
88
+ messageSearch: search,
89
+ onDelete: ({ key, message }) => {
90
+ console.log('Deleted message:', key, message)
91
+ }
92
+ }).start()
93
+
94
+ // Later:
95
+ const matches = search.search('hello', { jid: '628xxxx@s.whatsapp.net', limit: 20 })
96
+ ```
97
+
98
+ `MessageSearch` indexes text and bounded message references in memory. `AntiDeleteManager` observes deletion events and invokes an application callback; it does not silently forward or repost deleted content. `PersistentStore` is an atomic JSON key/value store for small metadata, not media files or high-volume databases.
99
+
100
+ ```js
101
+ import { PersistentStore } from '@zelynskybail/baileys'
102
+ const store = await new PersistentStore('./data/bot-store.json').open()
103
+ await store.set('mode', 'public')
104
+ console.log(store.get('mode'))
105
+ await store.close()
106
+ ```
107
+
108
+ ### Voice calls / VoIP
109
+
110
+ `CallManager` on `sock.calls` exposes incoming call events, reject, call-link creation and privacy controls supported by the core socket. `VoipClient` is an optional adapter to the MIT-licensed `@paiavaliable/baileys-caller` engine:
111
+
112
+ ```js
113
+ import { VoipClient } from '@zelynskybail/baileys'
114
+
115
+ const voip = new VoipClient({ authDir: './voip-session' })
116
+ await voip.connect()
117
+ const call = await voip.call('628123456789', {
118
+ audioSource: './audio.mp3',
119
+ durationMs: 30000
120
+ })
121
+ call.on('ringing', () => console.log('ringing'))
122
+ call.on('connected', () => console.log('connected'))
123
+ call.on('ended', (reason) => console.log('ended:', reason))
124
+ ```
125
+
126
+ The current caller engine supports outbound 1:1 voice calls, MP3/WAV audio streaming and received PCM audio. It uses a **separate linked-device session** in `authDir`; it does not take over the primary socket. It does not support inbound RTC media, video or group calls. `ffmpeg` is needed only for file-based audio sources. The optional caller dependency may fail to install on platforms without a compatible WebRTC native build; the rest of Baileys remains usable.
127
+
128
+ ### Performance profiles
129
+
130
+ ```js
131
+ const sock = makeWASocket({ auth: state, performanceProfile: 'low-latency' })
132
+ ```
133
+
134
+ Available profiles: `balanced`, `low-latency`, `high-throughput`, `low-memory`. `balanced` retains baseline defaults. Other profiles deliberately trade history sync, caching, retries or preview quality for resource use. They do not guarantee a fixed response time; benchmark in the target environment.
135
+
136
+ ### Security behavior
137
+
138
+ - No automatic channel/newsletter follow is performed during socket connection.
139
+ - Explicit newsletter methods remain available for deliberate application calls.
140
+ - No `preinstall`, `install` or `postinstall` package lifecycle hooks are defined.
141
+ - Optional image/video dependencies are lazy-loaded.
142
+ - Session files and auth credentials are secrets; never commit them or send them in logs.
143
+
144
+ ## Exports
145
+
146
+ - `@zelynskybail/baileys` — core and all main exports.
147
+ - `@zelynskybail/baileys/builders` — message builders.
148
+ - `@zelynskybail/baileys/message-builder` — bundled MessageBuilder implementation.
149
+ - `@zelynskybail/baileys/calls` — call manager and VoIP client.
150
+ - `@zelynskybail/baileys/utils/message-tools` — search, anti-delete observer and persistent store.
151
+
152
+ ## Development checks
153
+
154
+ ```bash
155
+ npm run verify
156
+ npm test
157
+ npm pack --dry-run
158
+ ```
159
+
160
+ Static checks and local unit tests do not replace installing dependencies, pairing a disposable account, and testing message send/receive, media, reconnect, and voice call paths on the deployment platform.
161
+
162
+ ## Attribution and licensing
163
+
164
+ This is a derivative package. Keep upstream Baileys, Delkira, MessageBuilder, and VoIP engine license/attribution notices. Read `LICENSE`, `NOTICE.md`, and `THIRD_PARTY_NOTICES.md` before redistribution. The NIXCODE MessageBuilder watermark is intentionally preserved. Public redistribution should be cleared with its rightsholder because its header contains additional terms restricting standalone redistribution.
165
+
166
+ See `THANKS.md` for acknowledgements.
package/THANKS.md ADDED
@@ -0,0 +1,7 @@
1
+ # Thanks
2
+
3
+ Terima kasih kepada pengembang dan kontributor Baileys serta komunitas yang telah membagikan pengetahuan dan perbaikan protokol.
4
+
5
+ A special thanks message is prepared for the Baileys developer contact supplied by the project owner: **6283198620678**. This build process cannot send WhatsApp messages, so use the prefilled link below to send it manually:
6
+
7
+ [Open WhatsApp with thanks message](https://wa.me/6283198620678?text=Terima%20kasih%20atas%20kerja%20keras%20dan%20kontribusinya%20mengembangkan%20Baileys.%20Kami%20menghargai%20ilmu%20dan%20waktu%20yang%20dibagikan.)
@@ -0,0 +1,8 @@
1
+ # Third-party notices
2
+
3
+ - **WhiskeySockets/Baileys ecosystem** — upstream core and protocol implementation; preserve upstream MIT notices and source headers.
4
+ - **Delkira Baileys** — supplied compiled fork distribution; upstream repository package metadata declares MIT. Preserve its copyright notices and MIT license.
5
+ - **NIXCODE MessageBuilder 4.7** — created by Nixel; contributors credited in the source watermark. Its file-level notice grants use/modification for personal or commercial projects and restricts redistribution as a standalone product. The full header/watermark is retained in `lib/Modded/MessageBuilder.js`. Obtain permission for public redistribution if the bundle is deemed outside that grant.
6
+ - **baileys-caller** — optional outbound audio calling adapter, authored by ShellTear and distributed under MIT by the npm fork used by this project. It is loaded dynamically and its license applies to that dependency.
7
+
8
+ No third-party code is represented as wholly original ZelynskyBail work.
@@ -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