dibosockets 1.0.1

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 (195) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +269 -0
  3. package/WAProto/GenerateStatics.sh +4 -0
  4. package/WAProto/WAProto.proto +4775 -0
  5. package/WAProto/index.d.ts +55057 -0
  6. package/WAProto/index.js +169661 -0
  7. package/WAProto/index.ts.ts +53473 -0
  8. package/engine-requirements.js +11 -0
  9. package/lib/Defaults/baileys-version.json +3 -0
  10. package/lib/Defaults/index.d.ts +51 -0
  11. package/lib/Defaults/index.js +106 -0
  12. package/lib/Signal/Group/ciphertext-message.d.ts +9 -0
  13. package/lib/Signal/Group/ciphertext-message.js +15 -0
  14. package/lib/Signal/Group/group-session-builder.d.ts +14 -0
  15. package/lib/Signal/Group/group-session-builder.js +64 -0
  16. package/lib/Signal/Group/group_cipher.d.ts +17 -0
  17. package/lib/Signal/Group/group_cipher.js +96 -0
  18. package/lib/Signal/Group/index.d.ts +11 -0
  19. package/lib/Signal/Group/index.js +57 -0
  20. package/lib/Signal/Group/keyhelper.d.ts +10 -0
  21. package/lib/Signal/Group/keyhelper.js +55 -0
  22. package/lib/Signal/Group/queue-job.d.ts +1 -0
  23. package/lib/Signal/Group/queue-job.js +57 -0
  24. package/lib/Signal/Group/sender-chain-key.d.ts +13 -0
  25. package/lib/Signal/Group/sender-chain-key.js +34 -0
  26. package/lib/Signal/Group/sender-key-distribution-message.d.ts +16 -0
  27. package/lib/Signal/Group/sender-key-distribution-message.js +66 -0
  28. package/lib/Signal/Group/sender-key-message.d.ts +18 -0
  29. package/lib/Signal/Group/sender-key-message.js +69 -0
  30. package/lib/Signal/Group/sender-key-name.d.ts +17 -0
  31. package/lib/Signal/Group/sender-key-name.js +51 -0
  32. package/lib/Signal/Group/sender-key-record.d.ts +30 -0
  33. package/lib/Signal/Group/sender-key-record.js +53 -0
  34. package/lib/Signal/Group/sender-key-state.d.ts +38 -0
  35. package/lib/Signal/Group/sender-key-state.js +99 -0
  36. package/lib/Signal/Group/sender-message-key.d.ts +11 -0
  37. package/lib/Signal/Group/sender-message-key.js +29 -0
  38. package/lib/Signal/libsignal.d.ts +3 -0
  39. package/lib/Signal/libsignal.js +174 -0
  40. package/lib/Socket/Client/index.d.ts +2 -0
  41. package/lib/Socket/Client/index.js +18 -0
  42. package/lib/Socket/Client/types.d.ts +16 -0
  43. package/lib/Socket/Client/types.js +13 -0
  44. package/lib/Socket/Client/websocket.d.ts +13 -0
  45. package/lib/Socket/Client/websocket.js +111 -0
  46. package/lib/Socket/RHandler.d.ts +416 -0
  47. package/lib/Socket/RHandler.js +530 -0
  48. package/lib/Socket/business.d.ts +172 -0
  49. package/lib/Socket/business.js +260 -0
  50. package/lib/Socket/chats.d.ts +94 -0
  51. package/lib/Socket/chats.js +908 -0
  52. package/lib/Socket/groups.d.ts +124 -0
  53. package/lib/Socket/groups.js +332 -0
  54. package/lib/Socket/index.d.ts +172 -0
  55. package/lib/Socket/index.js +10 -0
  56. package/lib/Socket/messages-recv.d.ts +161 -0
  57. package/lib/Socket/messages-recv.js +1054 -0
  58. package/lib/Socket/messages-send.d.ts +152 -0
  59. package/lib/Socket/messages-send.js +903 -0
  60. package/lib/Socket/newsletter.d.ts +136 -0
  61. package/lib/Socket/newsletter.js +303 -0
  62. package/lib/Socket/socket.d.ts +43 -0
  63. package/lib/Socket/socket.js +654 -0
  64. package/lib/Socket/usync.d.ts +36 -0
  65. package/lib/Socket/usync.js +70 -0
  66. package/lib/Store/index.d.ts +2 -0
  67. package/lib/Store/index.js +8 -0
  68. package/lib/Store/make-in-memory-store.d.ts +118 -0
  69. package/lib/Store/make-in-memory-store.js +439 -0
  70. package/lib/Store/make-ordered-dictionary.d.ts +13 -0
  71. package/lib/Store/make-ordered-dictionary.js +81 -0
  72. package/lib/Store/object-repository.d.ts +10 -0
  73. package/lib/Store/object-repository.js +27 -0
  74. package/lib/Types/Auth.d.ts +103 -0
  75. package/lib/Types/Auth.js +2 -0
  76. package/lib/Types/Call.d.ts +13 -0
  77. package/lib/Types/Call.js +2 -0
  78. package/lib/Types/Chat.d.ts +109 -0
  79. package/lib/Types/Chat.js +4 -0
  80. package/lib/Types/Contact.d.ts +23 -0
  81. package/lib/Types/Contact.js +2 -0
  82. package/lib/Types/Events.d.ts +199 -0
  83. package/lib/Types/Events.js +2 -0
  84. package/lib/Types/GroupMetadata.d.ts +64 -0
  85. package/lib/Types/GroupMetadata.js +2 -0
  86. package/lib/Types/Label.d.ts +35 -0
  87. package/lib/Types/Label.js +27 -0
  88. package/lib/Types/LabelAssociation.d.ts +29 -0
  89. package/lib/Types/LabelAssociation.js +9 -0
  90. package/lib/Types/Message.d.ts +402 -0
  91. package/lib/Types/Message.js +7 -0
  92. package/lib/Types/Newsletter.d.ts +103 -0
  93. package/lib/Types/Newsletter.js +38 -0
  94. package/lib/Types/Product.d.ts +78 -0
  95. package/lib/Types/Product.js +2 -0
  96. package/lib/Types/Signal.d.ts +57 -0
  97. package/lib/Types/Signal.js +2 -0
  98. package/lib/Types/Socket.d.ts +119 -0
  99. package/lib/Types/Socket.js +2 -0
  100. package/lib/Types/State.d.ts +27 -0
  101. package/lib/Types/State.js +2 -0
  102. package/lib/Types/USync.d.ts +25 -0
  103. package/lib/Types/USync.js +2 -0
  104. package/lib/Types/index.d.ts +64 -0
  105. package/lib/Types/index.js +42 -0
  106. package/lib/Utils/audioToBuffer.js +29 -0
  107. package/lib/Utils/auth-utils.d.ts +18 -0
  108. package/lib/Utils/auth-utils.js +199 -0
  109. package/lib/Utils/baileys-event-stream.d.ts +16 -0
  110. package/lib/Utils/baileys-event-stream.js +63 -0
  111. package/lib/Utils/business.d.ts +22 -0
  112. package/lib/Utils/business.js +234 -0
  113. package/lib/Utils/chat-utils.d.ts +70 -0
  114. package/lib/Utils/chat-utils.js +730 -0
  115. package/lib/Utils/crypto.d.ts +40 -0
  116. package/lib/Utils/crypto.js +193 -0
  117. package/lib/Utils/decode-wa-message.d.ts +35 -0
  118. package/lib/Utils/decode-wa-message.js +207 -0
  119. package/lib/Utils/event-buffer.d.ts +35 -0
  120. package/lib/Utils/event-buffer.js +518 -0
  121. package/lib/Utils/generics.d.ts +89 -0
  122. package/lib/Utils/generics.js +428 -0
  123. package/lib/Utils/history.d.ts +19 -0
  124. package/lib/Utils/history.js +94 -0
  125. package/lib/Utils/index.d.ts +19 -0
  126. package/lib/Utils/index.js +36 -0
  127. package/lib/Utils/link-preview.d.ts +21 -0
  128. package/lib/Utils/link-preview.js +126 -0
  129. package/lib/Utils/logger.d.ts +11 -0
  130. package/lib/Utils/logger.js +7 -0
  131. package/lib/Utils/lt-hash.d.ts +12 -0
  132. package/lib/Utils/lt-hash.js +51 -0
  133. package/lib/Utils/make-mutex.d.ts +7 -0
  134. package/lib/Utils/make-mutex.js +43 -0
  135. package/lib/Utils/messages-media.d.ts +124 -0
  136. package/lib/Utils/messages-media.js +887 -0
  137. package/lib/Utils/messages.d.ts +75 -0
  138. package/lib/Utils/messages.js +1030 -0
  139. package/lib/Utils/noise-handler.d.ts +19 -0
  140. package/lib/Utils/noise-handler.js +150 -0
  141. package/lib/Utils/process-message.d.ts +42 -0
  142. package/lib/Utils/process-message.js +385 -0
  143. package/lib/Utils/signal.d.ts +33 -0
  144. package/lib/Utils/signal.js +153 -0
  145. package/lib/Utils/streamToBuffer.js +15 -0
  146. package/lib/Utils/use-multi-file-auth-state.d.ts +12 -0
  147. package/lib/Utils/use-multi-file-auth-state.js +125 -0
  148. package/lib/Utils/validate-connection.d.ts +10 -0
  149. package/lib/Utils/validate-connection.js +173 -0
  150. package/lib/WABinary/constants.d.ts +27 -0
  151. package/lib/WABinary/constants.js +1303 -0
  152. package/lib/WABinary/decode.d.ts +6 -0
  153. package/lib/WABinary/decode.js +265 -0
  154. package/lib/WABinary/encode.d.ts +2 -0
  155. package/lib/WABinary/encode.js +250 -0
  156. package/lib/WABinary/generic-utils.d.ts +14 -0
  157. package/lib/WABinary/generic-utils.js +110 -0
  158. package/lib/WABinary/index.d.ts +5 -0
  159. package/lib/WABinary/index.js +21 -0
  160. package/lib/WABinary/jid-utils.d.ts +36 -0
  161. package/lib/WABinary/jid-utils.js +83 -0
  162. package/lib/WABinary/jid-utils.js.bak +83 -0
  163. package/lib/WABinary/types.d.ts +18 -0
  164. package/lib/WABinary/types.js +2 -0
  165. package/lib/WAM/BinaryInfo.d.ts +8 -0
  166. package/lib/WAM/BinaryInfo.js +13 -0
  167. package/lib/WAM/constants.d.ts +38 -0
  168. package/lib/WAM/constants.js +15350 -0
  169. package/lib/WAM/encode.d.ts +2 -0
  170. package/lib/WAM/encode.js +155 -0
  171. package/lib/WAM/index.d.ts +3 -0
  172. package/lib/WAM/index.js +19 -0
  173. package/lib/WAUSync/Protocols/USyncContactProtocol.d.ts +9 -0
  174. package/lib/WAUSync/Protocols/USyncContactProtocol.js +32 -0
  175. package/lib/WAUSync/Protocols/USyncDeviceProtocol.d.ts +22 -0
  176. package/lib/WAUSync/Protocols/USyncDeviceProtocol.js +57 -0
  177. package/lib/WAUSync/Protocols/USyncDisappearingModeProtocol.d.ts +12 -0
  178. package/lib/WAUSync/Protocols/USyncDisappearingModeProtocol.js +30 -0
  179. package/lib/WAUSync/Protocols/USyncStatusProtocol.d.ts +12 -0
  180. package/lib/WAUSync/Protocols/USyncStatusProtocol.js +42 -0
  181. package/lib/WAUSync/Protocols/UsyncBotProfileProtocol.d.ts +25 -0
  182. package/lib/WAUSync/Protocols/UsyncBotProfileProtocol.js +53 -0
  183. package/lib/WAUSync/Protocols/UsyncLIDProtocol.d.ts +8 -0
  184. package/lib/WAUSync/Protocols/UsyncLIDProtocol.js +24 -0
  185. package/lib/WAUSync/Protocols/index.d.ts +4 -0
  186. package/lib/WAUSync/Protocols/index.js +20 -0
  187. package/lib/WAUSync/USyncQuery.d.ts +28 -0
  188. package/lib/WAUSync/USyncQuery.js +89 -0
  189. package/lib/WAUSync/USyncUser.d.ts +12 -0
  190. package/lib/WAUSync/USyncUser.js +26 -0
  191. package/lib/WAUSync/index.d.ts +3 -0
  192. package/lib/WAUSync/index.js +19 -0
  193. package/lib/index.d.ts +16 -0
  194. package/lib/index.js +75 -0
  195. package/package.json +110 -0
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2025 Khayzu.
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/README.md ADDED
@@ -0,0 +1,269 @@
1
+ <div align="center">
2
+ <h1>✨ DiboSockets.</h1>
3
+ <p><em>Custom WhatsApp library built upon Baileys — enhanced, modernized, and elegant ✨</em></p>
4
+
5
+ ---
6
+
7
+ <p>
8
+ <a href="https://www.npmjs.com/package/dibosockets">
9
+ <img src="https://img.shields.io/npm/v/dibosockets?color=blueviolet&label=version&logo=npm" alt="npm version" />
10
+ </a>
11
+ <a href="https://www.npmjs.com/package/dibosockets">
12
+ <img src="https://img.shields.io/npm/dt/dibosockets?color=blueviolet&label=downloads&logo=npm" alt="npm downloads" />
13
+ </a>
14
+ </p>
15
+ </div>
16
+ <p align="center">
17
+ <a href="https://github.com/KINGXDEN/dibosockets">
18
+ <img src="https://img.shields.io/badge/Lihat-Repositori%20GitHub-blue?style=for-the-badge&logo=github&logoColor=white" alt="Lihat Repositori GitHub">
19
+ </a>
20
+ </p>
21
+
22
+ ---
23
+
24
+ ## 📌 Overview
25
+
26
+ > `DiboSockets` is a refined version of the Baileys library with cleaner API usage, exclusive features like album messaging, newsletter controls, and full-size profile uploads — tailored for modern WhatsApp automation needs.
27
+
28
+ ## 📦 Installation
29
+
30
+ ### Via `package.json` Fork Baileys (NPM)
31
+ @whiskeysockets/baileys
32
+ ```json
33
+ "dependencies": {
34
+ "@whiskeysockets/baileys": "npm:dibosockets@latest"
35
+ }
36
+ ```
37
+ @adiwajsing/baileys
38
+ ```json
39
+ "dependencies": {
40
+ "@adiwajshing/baileys": "npm:dibosockets@latest"
41
+ }
42
+ ```
43
+ baileys
44
+ ```json
45
+ "dependencies": {
46
+ "baileys": "npm:dibosockets@latest"
47
+ }
48
+ ```
49
+
50
+ Or via terminal
51
+ ```bash
52
+ npm install npm:dibosockets@latest
53
+ ```
54
+
55
+ Importing (**for those who don't fork another repository**)
56
+
57
+ ESM
58
+ ```bash
59
+ import makeWASocket from 'dibosockets'
60
+ ```
61
+
62
+ CJS
63
+ ```bash
64
+ const { default: makeWASocket } = require('dibosockets')
65
+ ```
66
+
67
+
68
+ ---
69
+
70
+ ## 🌟 Key Features
71
+
72
+ | Category | Description |
73
+ |------------------|-----------------------------------------------------------------------------|
74
+ | 📢 Channels | Seamlessly send messages to WhatsApp Channels. |
75
+ | 🖱️ Buttons | Create interactive messages with button options and quick replies. |
76
+ | 🖼️ Albums | Send grouped images or videos as an album (carousel-like format). |
77
+ | 👤 LID Grouping | Handle group operations using the latest @lid addressing style. |
78
+ | 🤖 AI Message Style | Add a stylized “AI” icon to messages. |
79
+ | 📷 HD Profile Pics | Upload full-size profile pictures without cropping. |
80
+ | 🔐 Pairing Code | Generate custom alphanumeric pairing codes. |
81
+ | 🛠️ Dev Experience | Reduced noise from logs with optimized libsignal printouts. |
82
+
83
+ ---
84
+
85
+ ## 💡 Use Case Examples
86
+
87
+ <details>
88
+ <summary><strong>📬 Newsletter Control</strong></summary>
89
+
90
+ ```javascript
91
+ // Create a newsletter
92
+ await sock.newsletterCreate("DiboSockets");
93
+
94
+ // Change description
95
+ await sock.newsletterUpdateDescription("dibosockets@newsletter", "Fresh updates weekly");
96
+
97
+ // Send a reaction to a channel message
98
+ await sock.newsletterReactMessage("dibosockets@newsletter", "175", "🔥");
99
+ ```
100
+
101
+ </details>
102
+
103
+ <details>
104
+ <summary><strong>📌 Interactive Messaging</strong></summary>
105
+
106
+ ```javascript
107
+ const buttons = [
108
+ { buttonId: 'btn1', buttonText: { displayText: 'Click Me' }, type: 1 },
109
+ { buttonId: 'btn2', buttonText: { displayText: 'Visit Site' }, type: 1 }
110
+ ];
111
+
112
+ const msg = {
113
+ text: "Choose one:",
114
+ footer: "From DiboSockets with love 💜",
115
+ buttons,
116
+ headerType: 1
117
+ };
118
+
119
+ await sock.sendMessage(id, msg, { quoted: null });
120
+ ```
121
+
122
+ </details>
123
+
124
+ <details>
125
+ <summary><strong>🖼️ Send Album</strong></summary>
126
+
127
+ ```javascript
128
+ const media = [
129
+ { image: { url: "https://example.com/pic1.jpg" } },
130
+ { video: { url: "https://example.com/clip.mp4" } }
131
+ ];
132
+
133
+ await sock.sendMessage(id, { album: media, caption: "Memories 💫" }, { quoted: null });
134
+ ```
135
+
136
+ </details>
137
+
138
+ <details>
139
+ <summary><strong>🔐 Pairing with Custom Code</strong></summary>
140
+
141
+ ```javascript
142
+ const code = await sock.requestPairingCode("62xxxxxxxxxx", "DIBO01");
143
+ console.log("Your Pairing Code:", code);
144
+ ```
145
+
146
+ </details>
147
+
148
+ <details>
149
+ <summary><strong>📊 Poll Creation</strong></summary>
150
+
151
+ ```javascript
152
+ const pollMessage = {
153
+ name: "Favorite Color?",
154
+ values: ["Red", "Blue", "Green"],
155
+ selectableCount: 1
156
+ };
157
+
158
+ await sock.sendMessage(id, { poll: pollMessage });
159
+ ```
160
+
161
+ </details>
162
+
163
+ <details>
164
+ <summary><strong>📍 Location Sharing</strong></summary>
165
+
166
+ ```javascript
167
+ const locationMessage = {
168
+ degreesLatitude: 37.422,
169
+ degreesLongitude: -122.084,
170
+ name: "Googleplex",
171
+ address: "1600 Amphitheatre Pkwy, Mountain View, CA 94043"
172
+ };
173
+
174
+ await sock.sendMessage(id, { location: locationMessage });
175
+ ```
176
+
177
+ </details>
178
+
179
+ <details>
180
+ <summary><strong>👥 Group Management</strong></summary>
181
+
182
+ ```javascript
183
+ // Create group
184
+ const group = await sock.groupCreate("My New Group", [number1, number2]);
185
+
186
+ // Add participants
187
+ await sock.groupAdd(group.id, [number3, number4]);
188
+
189
+ // Change group description
190
+ await sock.groupUpdateDescription(group.id, "This is our awesome group!");
191
+ ```
192
+
193
+ </details>
194
+
195
+ ---
196
+
197
+ **Note:** Replace `id` with the actual recipient ID and `sock` with your WhatsApp socket connection variable.
198
+
199
+ ---
200
+
201
+ ## 🐞 Found a Bug?
202
+
203
+ Please open an issue at [ *UNCOMING WEBSITE* ]
204
+ Or contact the maintainer directly via WhatsApp:
205
+
206
+ <p align="center">
207
+ <a href="https://wa.me/6282144323683?text=hai, min?" target="_blank">
208
+ <img alt="WhatsApp" src="https://img.shields.io/badge/Chat%20on%20WhatsApp-25D366?style=for-the-badge&logo=whatsapp&logoColor=white">
209
+ </a>
210
+ </p>
211
+
212
+ ---
213
+
214
+ <details>
215
+ <summary>🙏 <strong>TQTO (Thanks To)</strong></summary>
216
+
217
+ Terima kasih kepada pihak-pihak yang telah memberikan dukungan, inspirasi, dan kontribusi secara langsung maupun tidak langsung dalam pengembangan proyek ini:
218
+
219
+ - **Allah SWT**
220
+ For all His grace and ease.
221
+
222
+ - **Parent**
223
+ For your continued love, prayers, and support.
224
+
225
+ - **[Nstar-Y / Nstar-bail](https://github.com/Nstar-Y)**
226
+ As an initial foundation and reference in the development of this system.
227
+
228
+ - **[RexxHayanasi](https://github.com/RexxHayanasi)**
229
+ For the original modified version of Baileys.
230
+
231
+ - **[Muh. Deni Setiawan](https://github.com/KINGXDEN)** (Me)
232
+ The main developer of this project.
233
+
234
+ </details>
235
+
236
+ > [!CAUTION]
237
+ > Built on top of the WhiskeySockets/Baileys project. All original core logic credits go to their team. Dibo Socket extends it with thoughtful UX and DX improvements.
238
+
239
+ ---
240
+
241
+ ### 🙌 Contributors outside the Baileys code
242
+
243
+ Thanks to the following awesome contributors who help improve this project 💖
244
+
245
+ <table>
246
+ <tr>
247
+ <td align="center">
248
+ <a href="https://github.com/KINGXDEN">
249
+ <img src="https://avatars.githubusercontent.com/u/96621497?v=4" width="80px;" style="border-radius:50%;" alt="Muh. Deni Setiawan"/>
250
+ <br />
251
+ <sub><b>Muh. Deni Setiawan</b></sub>
252
+ </a>
253
+ </td>
254
+ <td align="center">
255
+ <a href="https://github.com/RexxHayanasi">
256
+ <img src="https://avatars.githubusercontent.com/u/150516773?v=4" width="80px;" style="border-radius:50%;" alt="RexxHayanasi"/>
257
+ <br />
258
+ <sub><b>RexxHayanasi</b></sub>
259
+ </a>
260
+ </td>
261
+ <td align="center">
262
+ <a href="https://github.com/nstar-y">
263
+ <img src="https://avatars.githubusercontent.com/u/81209428?v=4" width="80px;" style="border-radius:50%;" alt="nstar-y"/>
264
+ <br />
265
+ <sub><b>nstar-y</b></sub>
266
+ </a>
267
+ </td>
268
+ </tr>
269
+ </table>
@@ -0,0 +1,4 @@
1
+ yarn pbjs -t static-module -w commonjs -o ./WAProto/index.js ./WAProto/WAProto.proto;
2
+ yarn pbts -o ./WAProto/index.d.ts ./WAProto/index.js;
3
+
4
+ #protoc --plugin=./node_modules/.bin/protoc-gen-ts_proto --ts_proto_opt=env=node,useOptionals=true,forceLong=long --ts_proto_out=. ./src/Binary/WAMessage.proto;