@queenanya/baileys 8.6.0-beta → 9.0.3

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 (397) hide show
  1. package/WAProto/GenerateStatics.sh +3 -0
  2. package/WAProto/WAProto.proto +4633 -0
  3. package/WAProto/fix-imports.js +29 -0
  4. package/WAProto/index.d.ts +2165 -45253
  5. package/WAProto/index.js +45236 -130529
  6. package/lib/Defaults/index.d.ts +14 -3
  7. package/lib/Defaults/index.d.ts.map +1 -0
  8. package/lib/Defaults/index.js +64 -55
  9. package/lib/Defaults/index.js.map +1 -0
  10. package/lib/Signal/Group/ciphertext-message.d.ts +1 -0
  11. package/lib/Signal/Group/ciphertext-message.d.ts.map +1 -0
  12. package/lib/Signal/Group/ciphertext-message.js +2 -5
  13. package/lib/Signal/Group/ciphertext-message.js.map +1 -0
  14. package/lib/Signal/Group/group-session-builder.d.ts +4 -3
  15. package/lib/Signal/Group/group-session-builder.d.ts.map +1 -0
  16. package/lib/Signal/Group/group-session-builder.js +7 -41
  17. package/lib/Signal/Group/group-session-builder.js.map +1 -0
  18. package/lib/Signal/Group/group_cipher.d.ts +4 -4
  19. package/lib/Signal/Group/group_cipher.d.ts.map +1 -0
  20. package/lib/Signal/Group/group_cipher.js +37 -51
  21. package/lib/Signal/Group/group_cipher.js.map +1 -0
  22. package/lib/Signal/Group/index.d.ts +12 -11
  23. package/lib/Signal/Group/index.d.ts.map +1 -0
  24. package/lib/Signal/Group/index.js +12 -57
  25. package/lib/Signal/Group/index.js.map +1 -0
  26. package/lib/Signal/Group/keyhelper.d.ts +2 -1
  27. package/lib/Signal/Group/keyhelper.d.ts.map +1 -0
  28. package/lib/Signal/Group/keyhelper.js +7 -44
  29. package/lib/Signal/Group/keyhelper.js.map +1 -0
  30. package/lib/Signal/Group/sender-chain-key.d.ts +3 -2
  31. package/lib/Signal/Group/sender-chain-key.d.ts.map +1 -0
  32. package/lib/Signal/Group/sender-chain-key.js +7 -15
  33. package/lib/Signal/Group/sender-chain-key.js.map +1 -0
  34. package/lib/Signal/Group/sender-key-distribution-message.d.ts +2 -1
  35. package/lib/Signal/Group/sender-key-distribution-message.d.ts.map +1 -0
  36. package/lib/Signal/Group/sender-key-distribution-message.js +8 -11
  37. package/lib/Signal/Group/sender-key-distribution-message.js.map +1 -0
  38. package/lib/Signal/Group/sender-key-message.d.ts +2 -1
  39. package/lib/Signal/Group/sender-key-message.d.ts.map +1 -0
  40. package/lib/Signal/Group/sender-key-message.js +9 -12
  41. package/lib/Signal/Group/sender-key-message.js.map +1 -0
  42. package/lib/Signal/Group/sender-key-name.d.ts +1 -0
  43. package/lib/Signal/Group/sender-key-name.d.ts.map +1 -0
  44. package/lib/Signal/Group/sender-key-name.js +2 -5
  45. package/lib/Signal/Group/sender-key-name.js.map +1 -0
  46. package/lib/Signal/Group/sender-key-record.d.ts +3 -2
  47. package/lib/Signal/Group/sender-key-record.d.ts.map +1 -0
  48. package/lib/Signal/Group/sender-key-record.js +9 -21
  49. package/lib/Signal/Group/sender-key-record.js.map +1 -0
  50. package/lib/Signal/Group/sender-key-state.d.ts +7 -6
  51. package/lib/Signal/Group/sender-key-state.d.ts.map +1 -0
  52. package/lib/Signal/Group/sender-key-state.js +27 -42
  53. package/lib/Signal/Group/sender-key-state.js.map +1 -0
  54. package/lib/Signal/Group/sender-message-key.d.ts +1 -0
  55. package/lib/Signal/Group/sender-message-key.d.ts.map +1 -0
  56. package/lib/Signal/Group/sender-message-key.js +4 -7
  57. package/lib/Signal/Group/sender-message-key.js.map +1 -0
  58. package/lib/Signal/libsignal.d.ts +5 -3
  59. package/lib/Signal/libsignal.d.ts.map +1 -0
  60. package/lib/Signal/libsignal.js +258 -90
  61. package/lib/Signal/libsignal.js.map +1 -0
  62. package/lib/Signal/lid-mapping.d.ts +23 -0
  63. package/lib/Signal/lid-mapping.d.ts.map +1 -0
  64. package/lib/Signal/lid-mapping.js +171 -0
  65. package/lib/Signal/lid-mapping.js.map +1 -0
  66. package/lib/Socket/Client/index.d.ts +3 -2
  67. package/lib/Socket/Client/index.d.ts.map +1 -0
  68. package/lib/Socket/Client/index.js +3 -18
  69. package/lib/Socket/Client/index.js.map +1 -0
  70. package/lib/Socket/Client/types.d.ts +2 -2
  71. package/lib/Socket/Client/types.d.ts.map +1 -0
  72. package/lib/Socket/Client/types.js +4 -6
  73. package/lib/Socket/Client/types.js.map +1 -0
  74. package/lib/Socket/Client/websocket.d.ts +2 -2
  75. package/lib/Socket/Client/websocket.d.ts.map +1 -0
  76. package/lib/Socket/Client/websocket.js +15 -37
  77. package/lib/Socket/Client/websocket.js.map +1 -0
  78. package/lib/Socket/business.d.ts +106 -94
  79. package/lib/Socket/business.d.ts.map +1 -0
  80. package/lib/Socket/business.js +159 -43
  81. package/lib/Socket/business.js.map +1 -0
  82. package/lib/Socket/chats.d.ts +39 -27
  83. package/lib/Socket/chats.d.ts.map +1 -0
  84. package/lib/Socket/chats.js +271 -261
  85. package/lib/Socket/chats.js.map +1 -0
  86. package/lib/Socket/communities.d.ts +111 -86
  87. package/lib/Socket/communities.d.ts.map +1 -0
  88. package/lib/Socket/communities.js +138 -70
  89. package/lib/Socket/communities.js.map +1 -0
  90. package/lib/Socket/groups.d.ts +53 -43
  91. package/lib/Socket/groups.d.ts.map +1 -0
  92. package/lib/Socket/groups.js +94 -99
  93. package/lib/Socket/groups.js.map +1 -0
  94. package/lib/Socket/index.d.ts +133 -108
  95. package/lib/Socket/index.d.ts.map +1 -0
  96. package/lib/Socket/index.js +17 -9
  97. package/lib/Socket/index.js.map +1 -0
  98. package/lib/Socket/messages-recv.d.ts +90 -82
  99. package/lib/Socket/messages-recv.d.ts.map +1 -0
  100. package/lib/Socket/messages-recv.js +635 -480
  101. package/lib/Socket/messages-recv.js.map +1 -0
  102. package/lib/Socket/messages-send.d.ts +90 -76
  103. package/lib/Socket/messages-send.d.ts.map +1 -0
  104. package/lib/Socket/messages-send.js +476 -402
  105. package/lib/Socket/messages-send.js.map +1 -0
  106. package/lib/Socket/mex.d.ts +3 -0
  107. package/lib/Socket/mex.d.ts.map +1 -0
  108. package/lib/Socket/mex.js +42 -0
  109. package/lib/Socket/mex.js.map +1 -0
  110. package/lib/Socket/newsletter.d.ts +83 -73
  111. package/lib/Socket/newsletter.d.ts.map +1 -0
  112. package/lib/Socket/newsletter.js +181 -202
  113. package/lib/Socket/newsletter.js.map +1 -0
  114. package/lib/Socket/socket.d.ts +24 -16
  115. package/lib/Socket/socket.d.ts.map +1 -0
  116. package/lib/Socket/socket.js +402 -196
  117. package/lib/Socket/socket.js.map +1 -0
  118. package/lib/Types/Auth.d.ts +13 -5
  119. package/lib/Types/Auth.d.ts.map +1 -0
  120. package/lib/Types/Auth.js +2 -2
  121. package/lib/Types/Auth.js.map +1 -0
  122. package/lib/Types/Bussines.d.ts +25 -0
  123. package/lib/Types/Bussines.d.ts.map +1 -0
  124. package/lib/Types/Bussines.js +2 -0
  125. package/lib/Types/Bussines.js.map +1 -0
  126. package/lib/Types/Call.d.ts +1 -0
  127. package/lib/Types/Call.d.ts.map +1 -0
  128. package/lib/Types/Call.js +2 -2
  129. package/lib/Types/Call.js.map +1 -0
  130. package/lib/Types/Chat.d.ts +18 -9
  131. package/lib/Types/Chat.d.ts.map +1 -0
  132. package/lib/Types/Chat.js +8 -4
  133. package/lib/Types/Chat.js.map +1 -0
  134. package/lib/Types/Contact.d.ts +5 -4
  135. package/lib/Types/Contact.d.ts.map +1 -0
  136. package/lib/Types/Contact.js +2 -2
  137. package/lib/Types/Contact.js.map +1 -0
  138. package/lib/Types/Events.d.ts +36 -33
  139. package/lib/Types/Events.d.ts.map +1 -0
  140. package/lib/Types/Events.js +2 -2
  141. package/lib/Types/Events.js.map +1 -0
  142. package/lib/Types/GroupMetadata.d.ts +12 -11
  143. package/lib/Types/GroupMetadata.d.ts.map +1 -0
  144. package/lib/Types/GroupMetadata.js +2 -2
  145. package/lib/Types/GroupMetadata.js.map +1 -0
  146. package/lib/Types/Label.d.ts +12 -0
  147. package/lib/Types/Label.d.ts.map +1 -0
  148. package/lib/Types/Label.js +3 -5
  149. package/lib/Types/Label.js.map +1 -0
  150. package/lib/Types/LabelAssociation.d.ts +1 -0
  151. package/lib/Types/LabelAssociation.d.ts.map +1 -0
  152. package/lib/Types/LabelAssociation.js +3 -5
  153. package/lib/Types/LabelAssociation.js.map +1 -0
  154. package/lib/Types/Message.d.ts +51 -148
  155. package/lib/Types/Message.d.ts.map +1 -0
  156. package/lib/Types/Message.js +11 -7
  157. package/lib/Types/Message.js.map +1 -0
  158. package/lib/Types/Newsletter.d.ts +173 -71
  159. package/lib/Types/Newsletter.d.ts.map +1 -0
  160. package/lib/Types/Newsletter.js +54 -11
  161. package/lib/Types/Newsletter.js.map +1 -0
  162. package/lib/Types/Product.d.ts +2 -1
  163. package/lib/Types/Product.d.ts.map +1 -0
  164. package/lib/Types/Product.js +2 -2
  165. package/lib/Types/Product.js.map +1 -0
  166. package/lib/Types/Signal.d.ts +20 -1
  167. package/lib/Types/Signal.d.ts.map +1 -0
  168. package/lib/Types/Signal.js +2 -2
  169. package/lib/Types/Signal.js.map +1 -0
  170. package/lib/Types/Socket.d.ts +34 -20
  171. package/lib/Types/Socket.d.ts.map +1 -0
  172. package/lib/Types/Socket.js +3 -2
  173. package/lib/Types/Socket.js.map +1 -0
  174. package/lib/Types/State.d.ts +14 -2
  175. package/lib/Types/State.d.ts.map +1 -0
  176. package/lib/Types/State.js +13 -2
  177. package/lib/Types/State.js.map +1 -0
  178. package/lib/Types/USync.d.ts +3 -2
  179. package/lib/Types/USync.d.ts.map +1 -0
  180. package/lib/Types/USync.js +2 -2
  181. package/lib/Types/USync.js.map +1 -0
  182. package/lib/Types/index.d.ts +15 -14
  183. package/lib/Types/index.d.ts.map +1 -0
  184. package/lib/Types/index.js +15 -31
  185. package/lib/Types/index.js.map +1 -0
  186. package/lib/Utils/auth-utils.d.ts +5 -4
  187. package/lib/Utils/auth-utils.d.ts.map +1 -0
  188. package/lib/Utils/auth-utils.js +199 -141
  189. package/lib/Utils/auth-utils.js.map +1 -0
  190. package/lib/Utils/baileys-event-stream.d.ts +2 -1
  191. package/lib/Utils/baileys-event-stream.d.ts.map +1 -0
  192. package/lib/Utils/baileys-event-stream.js +15 -22
  193. package/lib/Utils/baileys-event-stream.js.map +1 -0
  194. package/lib/Utils/browser-utils.d.ts +4 -0
  195. package/lib/Utils/browser-utils.d.ts.map +1 -0
  196. package/lib/Utils/browser-utils.js +28 -0
  197. package/lib/Utils/browser-utils.js.map +1 -0
  198. package/lib/Utils/business.d.ts +3 -2
  199. package/lib/Utils/business.d.ts.map +1 -0
  200. package/lib/Utils/business.js +66 -69
  201. package/lib/Utils/business.js.map +1 -0
  202. package/lib/Utils/chat-utils.d.ts +11 -11
  203. package/lib/Utils/chat-utils.d.ts.map +1 -0
  204. package/lib/Utils/chat-utils.js +203 -194
  205. package/lib/Utils/chat-utils.js.map +1 -0
  206. package/lib/Utils/crypto.d.ts +8 -7
  207. package/lib/Utils/crypto.d.ts.map +1 -0
  208. package/lib/Utils/crypto.js +50 -101
  209. package/lib/Utils/crypto.js.map +1 -0
  210. package/lib/Utils/decode-wa-message.d.ts +18 -5
  211. package/lib/Utils/decode-wa-message.d.ts.map +1 -0
  212. package/lib/Utils/decode-wa-message.js +134 -62
  213. package/lib/Utils/decode-wa-message.js.map +1 -0
  214. package/lib/Utils/event-buffer.d.ts +6 -7
  215. package/lib/Utils/event-buffer.d.ts.map +1 -0
  216. package/lib/Utils/event-buffer.js +99 -69
  217. package/lib/Utils/event-buffer.js.map +1 -0
  218. package/lib/Utils/generics.d.ts +57 -68
  219. package/lib/Utils/generics.d.ts.map +1 -0
  220. package/lib/Utils/generics.js +179 -356
  221. package/lib/Utils/generics.js.map +1 -0
  222. package/lib/Utils/history.d.ts +10 -10
  223. package/lib/Utils/history.d.ts.map +1 -0
  224. package/lib/Utils/history.js +37 -50
  225. package/lib/Utils/history.js.map +1 -0
  226. package/lib/Utils/index.d.ts +21 -17
  227. package/lib/Utils/index.d.ts.map +1 -0
  228. package/lib/Utils/index.js +21 -33
  229. package/lib/Utils/index.js.map +1 -0
  230. package/lib/Utils/link-preview.d.ts +4 -4
  231. package/lib/Utils/link-preview.d.ts.map +1 -0
  232. package/lib/Utils/link-preview.js +15 -56
  233. package/lib/Utils/link-preview.js.map +1 -0
  234. package/lib/Utils/logger.d.ts +8 -6
  235. package/lib/Utils/logger.d.ts.map +1 -0
  236. package/lib/Utils/logger.js +3 -7
  237. package/lib/Utils/logger.js.map +1 -0
  238. package/lib/Utils/lt-hash.d.ts +9 -8
  239. package/lib/Utils/lt-hash.d.ts.map +1 -0
  240. package/lib/Utils/lt-hash.js +23 -26
  241. package/lib/Utils/lt-hash.js.map +1 -0
  242. package/lib/Utils/make-mutex.d.ts +1 -0
  243. package/lib/Utils/make-mutex.d.ts.map +1 -0
  244. package/lib/Utils/make-mutex.js +7 -10
  245. package/lib/Utils/make-mutex.js.map +1 -0
  246. package/lib/Utils/message-retry-manager.d.ts +82 -0
  247. package/lib/Utils/message-retry-manager.d.ts.map +1 -0
  248. package/lib/Utils/message-retry-manager.js +149 -0
  249. package/lib/Utils/message-retry-manager.js.map +1 -0
  250. package/lib/Utils/messages-media.d.ts +32 -38
  251. package/lib/Utils/messages-media.d.ts.map +1 -0
  252. package/lib/Utils/messages-media.js +283 -496
  253. package/lib/Utils/messages-media.js.map +1 -0
  254. package/lib/Utils/messages.d.ts +11 -10
  255. package/lib/Utils/messages.d.ts.map +1 -0
  256. package/lib/Utils/messages.js +309 -519
  257. package/lib/Utils/messages.js.map +1 -0
  258. package/lib/Utils/noise-handler.d.ts +5 -4
  259. package/lib/Utils/noise-handler.d.ts.map +1 -0
  260. package/lib/Utils/noise-handler.js +23 -26
  261. package/lib/Utils/noise-handler.js.map +1 -0
  262. package/lib/Utils/pre-key-manager.d.ts +28 -0
  263. package/lib/Utils/pre-key-manager.d.ts.map +1 -0
  264. package/lib/Utils/pre-key-manager.js +106 -0
  265. package/lib/Utils/pre-key-manager.js.map +1 -0
  266. package/lib/Utils/process-message.d.ts +12 -12
  267. package/lib/Utils/process-message.d.ts.map +1 -0
  268. package/lib/Utils/process-message.js +196 -155
  269. package/lib/Utils/process-message.js.map +1 -0
  270. package/lib/Utils/signal.d.ts +7 -6
  271. package/lib/Utils/signal.d.ts.map +1 -0
  272. package/lib/Utils/signal.js +70 -64
  273. package/lib/Utils/signal.js.map +1 -0
  274. package/lib/Utils/use-multi-file-auth-state.d.ts +2 -1
  275. package/lib/Utils/use-multi-file-auth-state.d.ts.map +1 -0
  276. package/lib/Utils/use-multi-file-auth-state.js +23 -27
  277. package/lib/Utils/use-multi-file-auth-state.js.map +1 -0
  278. package/lib/Utils/use-single-file-auth-state.d.ts +3 -2
  279. package/lib/Utils/use-single-file-auth-state.d.ts.map +1 -0
  280. package/lib/Utils/use-single-file-auth-state.js +63 -41
  281. package/lib/Utils/use-single-file-auth-state.js.map +1 -0
  282. package/lib/Utils/validate-connection.d.ts +4 -3
  283. package/lib/Utils/validate-connection.d.ts.map +1 -0
  284. package/lib/Utils/validate-connection.js +99 -77
  285. package/lib/Utils/validate-connection.js.map +1 -0
  286. package/lib/WABinary/constants.d.ts +1 -0
  287. package/lib/WABinary/constants.d.ts.map +1 -0
  288. package/lib/WABinary/constants.js +9 -11
  289. package/lib/WABinary/constants.js.map +1 -0
  290. package/lib/WABinary/decode.d.ts +2 -1
  291. package/lib/WABinary/decode.d.ts.map +1 -0
  292. package/lib/WABinary/decode.js +25 -52
  293. package/lib/WABinary/decode.js.map +1 -0
  294. package/lib/WABinary/encode.d.ts +2 -1
  295. package/lib/WABinary/encode.d.ts.map +1 -0
  296. package/lib/WABinary/encode.js +14 -48
  297. package/lib/WABinary/encode.js.map +1 -0
  298. package/lib/WABinary/generic-utils.d.ts +4 -3
  299. package/lib/WABinary/generic-utils.d.ts.map +1 -0
  300. package/lib/WABinary/generic-utils.js +31 -39
  301. package/lib/WABinary/generic-utils.js.map +1 -0
  302. package/lib/WABinary/index.d.ts +6 -5
  303. package/lib/WABinary/index.d.ts.map +1 -0
  304. package/lib/WABinary/index.js +6 -21
  305. package/lib/WABinary/index.js.map +1 -0
  306. package/lib/WABinary/jid-utils.d.ts +23 -10
  307. package/lib/WABinary/jid-utils.d.ts.map +1 -0
  308. package/lib/WABinary/jid-utils.js +75 -60
  309. package/lib/WABinary/jid-utils.js.map +1 -0
  310. package/lib/WABinary/types.d.ts +2 -1
  311. package/lib/WABinary/types.d.ts.map +1 -0
  312. package/lib/WABinary/types.js +2 -2
  313. package/lib/WABinary/types.js.map +1 -0
  314. package/lib/WAM/BinaryInfo.d.ts +2 -1
  315. package/lib/WAM/BinaryInfo.d.ts.map +1 -0
  316. package/lib/WAM/BinaryInfo.js +2 -5
  317. package/lib/WAM/BinaryInfo.js.map +1 -0
  318. package/lib/WAM/constants.d.ts +5 -3
  319. package/lib/WAM/constants.d.ts.map +1 -0
  320. package/lib/WAM/constants.js +19071 -11568
  321. package/lib/WAM/constants.js.map +1 -0
  322. package/lib/WAM/encode.d.ts +2 -1
  323. package/lib/WAM/encode.d.ts.map +1 -0
  324. package/lib/WAM/encode.js +17 -22
  325. package/lib/WAM/encode.js.map +1 -0
  326. package/lib/WAM/index.d.ts +4 -3
  327. package/lib/WAM/index.d.ts.map +1 -0
  328. package/lib/WAM/index.js +4 -19
  329. package/lib/WAM/index.js.map +1 -0
  330. package/lib/WAUSync/Protocols/USyncContactProtocol.d.ts +4 -3
  331. package/lib/WAUSync/Protocols/USyncContactProtocol.d.ts.map +1 -0
  332. package/lib/WAUSync/Protocols/USyncContactProtocol.js +8 -11
  333. package/lib/WAUSync/Protocols/USyncContactProtocol.js.map +1 -0
  334. package/lib/WAUSync/Protocols/USyncDeviceProtocol.d.ts +3 -2
  335. package/lib/WAUSync/Protocols/USyncDeviceProtocol.d.ts.map +1 -0
  336. package/lib/WAUSync/Protocols/USyncDeviceProtocol.js +11 -14
  337. package/lib/WAUSync/Protocols/USyncDeviceProtocol.js.map +1 -0
  338. package/lib/WAUSync/Protocols/USyncDisappearingModeProtocol.d.ts +3 -2
  339. package/lib/WAUSync/Protocols/USyncDisappearingModeProtocol.d.ts.map +1 -0
  340. package/lib/WAUSync/Protocols/USyncDisappearingModeProtocol.js +8 -11
  341. package/lib/WAUSync/Protocols/USyncDisappearingModeProtocol.js.map +1 -0
  342. package/lib/WAUSync/Protocols/USyncStatusProtocol.d.ts +3 -2
  343. package/lib/WAUSync/Protocols/USyncStatusProtocol.d.ts.map +1 -0
  344. package/lib/WAUSync/Protocols/USyncStatusProtocol.js +9 -13
  345. package/lib/WAUSync/Protocols/USyncStatusProtocol.js.map +1 -0
  346. package/lib/WAUSync/Protocols/UsyncBotProfileProtocol.d.ts +4 -3
  347. package/lib/WAUSync/Protocols/UsyncBotProfileProtocol.d.ts.map +1 -0
  348. package/lib/WAUSync/Protocols/UsyncBotProfileProtocol.js +20 -22
  349. package/lib/WAUSync/Protocols/UsyncBotProfileProtocol.js.map +1 -0
  350. package/lib/WAUSync/Protocols/UsyncLIDProtocol.d.ts +5 -3
  351. package/lib/WAUSync/Protocols/UsyncLIDProtocol.d.ts.map +1 -0
  352. package/lib/WAUSync/Protocols/UsyncLIDProtocol.js +13 -8
  353. package/lib/WAUSync/Protocols/UsyncLIDProtocol.js.map +1 -0
  354. package/lib/WAUSync/Protocols/index.d.ts +5 -4
  355. package/lib/WAUSync/Protocols/index.d.ts.map +1 -0
  356. package/lib/WAUSync/Protocols/index.js +5 -20
  357. package/lib/WAUSync/Protocols/index.js.map +1 -0
  358. package/lib/WAUSync/USyncQuery.d.ts +5 -4
  359. package/lib/WAUSync/USyncQuery.d.ts.map +1 -0
  360. package/lib/WAUSync/USyncQuery.js +40 -35
  361. package/lib/WAUSync/USyncQuery.js.map +1 -0
  362. package/lib/WAUSync/USyncUser.d.ts +6 -5
  363. package/lib/WAUSync/USyncUser.d.ts.map +1 -0
  364. package/lib/WAUSync/USyncUser.js +2 -5
  365. package/lib/WAUSync/USyncUser.js.map +1 -0
  366. package/lib/WAUSync/index.d.ts +4 -3
  367. package/lib/WAUSync/index.d.ts.map +1 -0
  368. package/lib/WAUSync/index.js +4 -19
  369. package/lib/WAUSync/index.js.map +1 -0
  370. package/lib/index.d.ts +10 -12
  371. package/lib/index.d.ts.map +1 -0
  372. package/lib/index.js +11 -34
  373. package/lib/index.js.map +1 -0
  374. package/package.json +55 -65
  375. package/CHANGELOG.md +0 -4
  376. package/README-anya.md +0 -459
  377. package/README-shizo.md +0 -445
  378. package/README-whiskey.md +0 -44
  379. package/lib/Defaults/baileys-version.json +0 -3
  380. package/lib/Signal/Group/queue-job.d.ts +0 -1
  381. package/lib/Signal/Group/queue-job.js +0 -57
  382. package/lib/Socket/usync.d.ts +0 -36
  383. package/lib/Socket/usync.js +0 -70
  384. package/lib/Store/index.d.ts +0 -2
  385. package/lib/Store/index.js +0 -8
  386. package/lib/Store/make-in-memory-store.d.ts +0 -118
  387. package/lib/Store/make-in-memory-store.js +0 -429
  388. package/lib/Store/make-ordered-dictionary.d.ts +0 -13
  389. package/lib/Store/make-ordered-dictionary.js +0 -81
  390. package/lib/Store/object-repository.d.ts +0 -10
  391. package/lib/Store/object-repository.js +0 -27
  392. package/lib/WAMedia/index.d.ts +0 -2
  393. package/lib/WAMedia/index.js +0 -18
  394. package/lib/WAMedia/media-messages.d.ts +0 -18
  395. package/lib/WAMedia/media-messages.js +0 -102
  396. package/lib/WAMedia/media-set.d.ts +0 -9
  397. package/lib/WAMedia/media-set.js +0 -312
package/README-shizo.md DELETED
@@ -1,445 +0,0 @@
1
- # 🚀 BAILEYS-ELITE
2
- <div align="center">
3
-
4
- <img src="https://raw.githubusercontent.com/shizothetechie/database/refs/heads/main/image/shizo.png" width="350px">
5
-
6
- <br>
7
-
8
- <div style="background: linear-gradient(90deg, #6366F1, #3B82F6, #2DD4BF); padding: 8px; border-radius: 10px; margin: 15px 0;">
9
- <span style="font-size: 18px; font-weight: bold; color: white;">🔥 Ultimate WhatsApp Web API Experience 🥵</span>
10
- </div>
11
-
12
- ![TypeScript](https://img.shields.io/badge/-%F0%9F%94%B7%20TypeScript-007ACC?style=for-the-badge&logo=typescript&logoColor=white&labelColor=0D1117)
13
- ![JavaScript](https://img.shields.io/badge/-%F0%9F%94%B8%20JavaScript-F7DF1E?style=for-the-badge&logo=javascript&logoColor=F7DF1E&labelColor=0D1117)
14
- ![WhatsApp](https://img.shields.io/badge/-%F0%9F%92%AC%20WhatsApp-25D366?style=for-the-badge&logo=whatsapp&logoColor=white&labelColor=0D1117)
15
- ![NPM](https://img.shields.io/badge/-%F0%9F%93%A6%20npm-CB3837?style=for-the-badge&logo=npm&logoColor=white&labelColor=0D1117)
16
- </div>
17
-
18
- <br>
19
-
20
- <div align="center">
21
- <img src="https://capsule-render.vercel.app/api?type=waving&color=gradient&height=60&section=header" width="100%">
22
- </div>
23
-
24
- <div style="border-left: 4px solid #3B82F6; padding-left: 15px; margin: 25px 0;">
25
- <h2>⚡️ Supercharged WhatsApp API 🌟</h2>
26
- <p><i>Elevate your messaging experience with the most advanced WhatsApp Web API solution available</i></p>
27
- </div>
28
-
29
- ---
30
-
31
- ## 🔮 | WHY BAILEYS-ELITE?
32
-
33
- <div style="display: flex; justify-content: center; align-items: center; flex-wrap: wrap; gap: 10px; margin: 20px 0;">
34
- <div style="background: rgba(45, 212, 191, 0.1); border-radius: 10px; padding: 15px; width: 180px; text-align: center;">
35
- <div style="font-weight: bold;">⚡ Lightning Fast</div>
36
- </div>
37
- <div style="background: rgba(99, 102, 241, 0.1); border-radius: 10px; padding: 15px; width: 180px; text-align: center;">
38
- <div style="font-weight: bold;">🛡️ Secure</div>
39
- </div>
40
- <div style="background: rgba(244, 114, 182, 0.1); border-radius: 10px; padding: 15px; width: 180px; text-align: center;">
41
- <div style="font-weight: bold;">🧩 Feature-Rich</div>
42
- </div>
43
- <div style="background: rgba(234, 179, 8, 0.1); border-radius: 10px; padding: 15px; width: 180px; text-align: center;">
44
- <div style="font-weight: bold;">🔄 Active Development</div>
45
- </div>
46
- </div>
47
-
48
- ## 📌 | IMPORTANT NOTE
49
-
50
- <div style="background: linear-gradient(90deg, rgba(239, 68, 68, 0.1), rgba(239, 68, 68, 0.05)); border-left: 4px solid #EF4444; padding: 15px; border-radius: 5px; margin: 20px 0;">
51
- <p>⚠️ The original repository was initially removed by its creator and subsequently taken over by <a href="https://github.com/WhiskeySockets" style="color: #60A5FA; text-decoration: none; font-weight: bold;">WhiskeySockets</a>. This enhanced version includes numerous improvements and powerful new features designed to transform your WhatsApp development experience.</p>
52
- </div>
53
-
54
- ## 💫 | INSTALLATION
55
-
56
- <div style="background: rgba(17, 24, 39, 0.6); border-radius: 8px; padding: 20px; margin: 20px 0;">
57
-
58
- ### 📂 In package.json:
59
- ```json
60
- "dependencies": {
61
- "baileys-elite": "*"
62
- }
63
- ```
64
-
65
- ### ⚙️ Terminal Installation:
66
- ```bash
67
- npm install baileys-elite
68
- ```
69
-
70
- ### 🔌 Import:
71
- <div style="display: flex; gap: 20px; flex-wrap: wrap;">
72
- <div style="background: rgba(6, 182, 212, 0.1); border-radius: 5px; padding: 10px; flex: 1;">
73
-
74
- ```typescript
75
- // ESM
76
- import makeWASocket from 'baileys-elite'
77
- ```
78
- </div>
79
- <div style="background: rgba(234, 179, 8, 0.1); border-radius: 5px; padding: 10px; flex: 1;">
80
-
81
- ```javascript
82
- // CommonJS
83
- const { default: makeWASocket } = require("baileys-elite")
84
- ```
85
- </div>
86
- </div>
87
- </div>
88
-
89
- <div align="center">
90
- <img src="https://capsule-render.vercel.app/api?type=rect&color=gradient&height=2&section=header" width="100%">
91
- </div>
92
-
93
- ## ✨ | FEATURE SHOWCASE
94
-
95
- <div style="background: linear-gradient(45deg, rgba(124, 58, 237, 0.05), rgba(139, 92, 246, 0.05)); border-radius: 10px; padding: 15px; margin: 20px 0;">
96
-
97
- ### 🎀 Enhanced Features Matrix
98
-
99
- | Feature | Description | Status |
100
- |---------|-------------|--------|
101
- | 🔊 **Channel Messaging** | Send & manage WhatsApp channel content | ✅ |
102
- | 🎛️ **Interactive Messages** | Create rich button-based experiences | ✅ |
103
- | 🤖 **AI Message Icon** | Brand your bot messages with AI icon | ✅ |
104
- | 🖼️ **Enhanced Media** | Uncropped profile pictures & optimized media | ✅ |
105
- | 🔐 **Custom Pairing** | Personalized device pairing codes | ✅ |
106
- | 🔧 **Performance Optimizations** | Cleaner logs & improved signal handling | ✅ |
107
- | 📱 **Cross-Platform** | Works on all NodeJS supported platforms | ✅ |
108
-
109
- </div>
110
-
111
- <br>
112
-
113
- <div style="display: flex; justify-content: center; margin: 30px 0;">
114
- <div style="background: linear-gradient(135deg, #0EA5E9, #2DD4BF); color: white; padding: 12px 25px; border-radius: 25px; font-weight: bold; font-size: 16px;">🌱 SMALL BUT POWERFUL FEATURES 🎉</div>
115
- </div>
116
-
117
- ## 📰 | NEWSLETTER MANAGEMENT
118
-
119
- <details>
120
- <summary style="background: linear-gradient(90deg, #4F46E5, #7C3AED); color: white; padding: 10px 15px; border-radius: 5px; cursor: pointer; font-weight: bold;">📚 Expand Newsletter Features</summary>
121
-
122
- <div style="padding: 15px; background: rgba(79, 70, 229, 0.05); border-radius: 0 0 10px 10px; margin-top: -5px;">
123
-
124
- ### 📊 Get Newsletter Info
125
- ```typescript
126
- // By invite
127
- const metadata = await sock.newsletterMetadata("invite", "xxxxx")
128
- // By JID
129
- const metadata = await sock.newsletterMetadata("jid", "abcd@newsletter")
130
- console.log(metadata)
131
- ```
132
-
133
- ### 📝 Update Newsletter Content
134
- ```typescript
135
- // Update description
136
- await sock.newsletterUpdateDescription("abcd@newsletter", "New Description")
137
-
138
- // Update name
139
- await sock.newsletterUpdateName("abcd@newsletter", "New Name")
140
-
141
- // Update picture
142
- await sock.newsletterUpdatePicture("abcd@newsletter", buffer)
143
-
144
- // Remove picture
145
- await sock.newsletterRemovePicture("abcd@newsletter")
146
- ```
147
-
148
- ### 🔔 Notification Management
149
- ```typescript
150
- // Unmute newsletter
151
- await sock.newsletterUnmute("abcd@newsletter")
152
-
153
- // Mute newsletter
154
- await sock.newsletterMute("abcd@newsletter")
155
- ```
156
-
157
- ### 🔄 Newsletter Management
158
- ```typescript
159
- // Create new newsletter
160
- const metadata = await sock.newsletterCreate("Newsletter Name", "Newsletter Description")
161
- console.log(metadata)
162
-
163
- // Delete newsletter
164
- await sock.newsletterDelete("abcd@newsletter")
165
-
166
- // Follow newsletter
167
- await sock.newsletterFollow("abcd@newsletter")
168
-
169
- // Unfollow newsletter
170
- await sock.newsletterUnfollow("abcd@newsletter")
171
- ```
172
-
173
- ### 😀 Engagement Features
174
- ```typescript
175
- // Send reaction to newsletter post
176
- // Get ID from message URL: https://whatsapp.com/channel/xxxxx/175
177
- const id = "175"
178
- await sock.newsletterReactMessage("abcd@newsletter", id, "🥳")
179
- ```
180
-
181
- </div>
182
- </details>
183
-
184
- ## 🎛️ | INTERACTIVE MESSAGING
185
-
186
- <details>
187
- <summary style="background: linear-gradient(90deg, #EC4899, #F43F5E); color: white; padding: 10px 15px; border-radius: 5px; cursor: pointer; font-weight: bold;">🎯 Expand Button & Interactive Features</summary>
188
-
189
- <div style="padding: 15px; background: rgba(236, 72, 153, 0.05); border-radius: 0 0 10px 10px; margin-top: -5px;">
190
-
191
- ### 📝 Text Buttons
192
- ```typescript
193
- const buttons = [
194
- { buttonId: 'id1', buttonText: { displayText: 'Button 1' }, type: 1 },
195
- { buttonId: 'id2', buttonText: { displayText: 'Button 2' }, type: 1 }
196
- ]
197
-
198
- const buttonMessage = {
199
- text: "Hi it's button message",
200
- footer: 'Hello World',
201
- buttons,
202
- headerType: 1,
203
- viewOnce: true
204
- }
205
-
206
- await sock.sendMessage(id, buttonMessage, { quoted: null })
207
- ```
208
-
209
- ### 🖼️ Image Buttons
210
- ```typescript
211
- const buttons = [
212
- { buttonId: 'id1', buttonText: { displayText: 'Button 1' }, type: 1 },
213
- { buttonId: 'id2', buttonText: { displayText: 'Button 2' }, type: 1 }
214
- ]
215
-
216
- const buttonMessage = {
217
- image: { url: "https://example.com/abcd.jpg" }, // image: buffer or path
218
- caption: "Hi it's button message with image",
219
- footer: 'Hello World',
220
- buttons,
221
- headerType: 1,
222
- viewOnce: true
223
- }
224
-
225
- await sock.sendMessage(id, buttonMessage, { quoted: null })
226
- ```
227
-
228
- ### 🎬 Video Buttons
229
- ```typescript
230
- const buttons = [
231
- { buttonId: 'id1', buttonText: { displayText: 'Button 1' }, type: 1 },
232
- { buttonId: 'id2', buttonText: { displayText: 'Button 2' }, type: 1 }
233
- ]
234
-
235
- const buttonMessage = {
236
- video: { url: "https://example.com/abcd.mp4" }, // video: buffer or path
237
- caption: "Hi it's button message with video",
238
- footer: 'Hello World',
239
- buttons,
240
- headerType: 1,
241
- viewOnce: true
242
- }
243
-
244
- await sock.sendMessage(id, buttonMessage, { quoted: null })
245
- ```
246
-
247
- ### 🔄 Advanced Interactive Messages
248
- ```typescript
249
- const interactiveButtons = [
250
- {
251
- name: "quick_reply",
252
- buttonParamsJson: JSON.stringify({
253
- display_text: "Quick Reply",
254
- id: "ID"
255
- })
256
- },
257
- {
258
- name: "cta_url",
259
- buttonParamsJson: JSON.stringify({
260
- display_text: "Tap Here!",
261
- url: "https://www.example.com/"
262
- })
263
- },
264
- {
265
- name: "cta_copy",
266
- buttonParamsJson: JSON.stringify({
267
- display_text: "Copy Code",
268
- id: "12345",
269
- copy_code: "12345"
270
- })
271
- }
272
- ]
273
-
274
- const interactiveMessage = {
275
- text: "Hello World!",
276
- title: "this is the title",
277
- footer: "this is the footer",
278
- interactiveButtons
279
- }
280
-
281
- await sock.sendMessage(id, interactiveMessage, { quoted: null })
282
- ```
283
-
284
- ### 🖼️ Rich Media Interactive Messages
285
- ```typescript
286
- const interactiveButtons = [
287
- {
288
- name: "quick_reply",
289
- buttonParamsJson: JSON.stringify({
290
- display_text: "Quick Reply",
291
- id: "ID"
292
- })
293
- },
294
- {
295
- name: "cta_url",
296
- buttonParamsJson: JSON.stringify({
297
- display_text: "Visit Website",
298
- url: "https://www.example.com/"
299
- })
300
- }
301
- ]
302
-
303
- // With Image
304
- const imageInteractiveMessage = {
305
- image: { url: "https://example.com/abcd.jpg" },
306
- caption: "Check out this amazing photo!",
307
- title: "Photo Showcase",
308
- footer: "Tap a button below",
309
- interactiveButtons
310
- }
311
-
312
- await sock.sendMessage(id, imageInteractiveMessage, { quoted: null })
313
-
314
- // With Video
315
- const videoInteractiveMessage = {
316
- video: { url: "https://example.com/abcd.mp4" },
317
- caption: "Watch this awesome video!",
318
- title: "Video Showcase",
319
- footer: "Tap a button below",
320
- interactiveButtons
321
- }
322
-
323
- await sock.sendMessage(id, videoInteractiveMessage, { quoted: null })
324
- ```
325
-
326
- </div>
327
- </details>
328
-
329
- ## 🤖 | AI MESSAGING
330
-
331
- <div style="background: linear-gradient(135deg, rgba(16, 185, 129, 0.1), rgba(5, 150, 105, 0.1)); border-radius: 10px; padding: 20px; margin: 20px 0;">
332
-
333
- ### AI Icon Feature
334
- ```typescript
335
- // Simply add "ai: true" to display AI icon with your message
336
- await sock.sendMessage(id, { text: "Hello! I'm your AI assistant.", ai: true })
337
- ```
338
-
339
- <div style="background: rgba(16, 185, 129, 0.2); border-radius: 5px; padding: 10px; margin-top: 15px;">
340
- <strong>💡 Pro Tip:</strong> AI icons make your bot messages stand out and indicate automated responses to users.
341
- </div>
342
-
343
- </div>
344
-
345
- ## 🔐 | CUSTOM PAIRING
346
-
347
- <div style="background: linear-gradient(135deg, rgba(245, 158, 11, 0.1), rgba(217, 119, 6, 0.1)); border-radius: 10px; padding: 20px; margin: 20px 0;">
348
-
349
- ### Custom Code Implementation
350
- ```typescript
351
- if(usePairingCode && !sock.authState.creds.registered) {
352
- const phoneNumber = await question('Please enter your mobile phone number:\n')
353
- const custom = "SH1Z0D3V" // must be 8 digits, can be letters or numbers
354
- const code = await sock.requestPairingCode(phoneNumber, custom)
355
- console.log(`Pairing code: ${code?.match(/.{1,4}/g)?.join('-') || code}`)
356
- }
357
- ```
358
-
359
- <div style="background: rgba(245, 158, 11, 0.2); border-radius: 5px; padding: 10px; margin-top: 15px;">
360
- <strong>🔒 Security Note:</strong> Custom pairing codes enhance security while providing a personalized experience.
361
- </div>
362
-
363
- </div>
364
-
365
- <div align="center">
366
- <img src="https://capsule-render.vercel.app/api?type=rect&color=gradient&height=2&section=header" width="100%">
367
- </div>
368
-
369
- ## 🛠️ | QUICK IMPLEMENTATION GUIDE
370
-
371
- <div style="display: flex; flex-wrap: wrap; gap: 15px; margin: 20px 0;">
372
- <div style="flex: 1; min-width: 250px; background: rgba(59, 130, 246, 0.05); border-radius: 10px; padding: 15px;">
373
- <h3>🚀 Step 1: Install</h3>
374
- <p>Add baileys-elite to your project using npm</p>
375
- <div style="background: rgba(0, 0, 0, 0.2); padding: 10px; border-radius: 5px;">
376
- <code>npm install baileys-elite</code>
377
- </div>
378
- </div>
379
-
380
- <div style="flex: 1; min-width: 250px; background: rgba(59, 130, 246, 0.05); border-radius: 10px; padding: 15px;">
381
- <h3>🔄 Step 2: Import</h3>
382
- <p>Import the library into your project</p>
383
- <div style="background: rgba(0, 0, 0, 0.2); padding: 10px; border-radius: 5px;">
384
- <code>import makeWASocket from 'baileys-elite'</code>
385
- </div>
386
- </div>
387
-
388
- <div style="flex: 1; min-width: 250px; background: rgba(59, 130, 246, 0.05); border-radius: 10px; padding: 15px;">
389
- <h3>⚙️ Step 3: Configure</h3>
390
- <p>Set up your WhatsApp connection</p>
391
- <div style="background: rgba(0, 0, 0, 0.2); padding: 10px; border-radius: 5px;">
392
- <code>const sock = makeWASocket({...})</code>
393
- </div>
394
- </div>
395
-
396
- <div style="flex: 1; min-width: 250px; background: rgba(59, 130, 246, 0.05); border-radius: 10px; padding: 15px;">
397
- <h3>🚀 Step 4: Implement</h3>
398
- <p>Start using the enhanced features</p>
399
- <div style="background: rgba(0, 0, 0, 0.2); padding: 10px; border-radius: 5px;">
400
- <code>await sock.sendMessage(id, {...})</code>
401
- </div>
402
- </div>
403
- </div>
404
-
405
- ## 🐛 | REPORTING ISSUES
406
-
407
- <div style="background: linear-gradient(135deg, rgba(239, 68, 68, 0.05), rgba(220, 38, 38, 0.05)); border-radius: 10px; padding: 20px; margin: 20px 0;">
408
- <h3>Found a bug? Have a suggestion?</h3>
409
- <p>If you encounter any issues while using this repository, please feel free to open a <a href="https://github.com/shizo-devs/baileys/issues" style="color: #60A5FA; text-decoration: none; font-weight: bold;">new issue</a>.</p>
410
-
411
- <div style="display: flex; align-items: center; gap: 10px; margin-top: 15px; background: rgba(239, 68, 68, 0.1); padding: 10px; border-radius: 5px;">
412
- <span style="font-size: 24px;">👾</span>
413
- <span>Our team actively monitors and responds to all issues.</span>
414
- </div>
415
- </div>
416
-
417
- ## 📝 | NOTES
418
-
419
- <div style="background: linear-gradient(135deg, rgba(107, 114, 128, 0.05), rgba(75, 85, 99, 0.05)); border-radius: 10px; padding: 20px; margin: 20px 0;">
420
- <p>Everything other than the modifications mentioned above remains the same as the original repository. You can check out the original repository at <a href="https://github.com/WhiskeySockets/Baileys" style="color: #60A5FA; text-decoration: none; font-weight: bold;">WhiskeySockets</a>.</p>
421
- </div>
422
-
423
- <div align="center">
424
- <img src="https://capsule-render.vercel.app/api?type=waving&color=gradient&height=100&section=footer" width="100%">
425
- </div>
426
-
427
- <div align="center" style="margin-top: -40px;">
428
- <div style="background: linear-gradient(90deg, #6366F1, #3B82F6, #2DD4BF); -webkit-background-clip: text; -webkit-text-fill-color: transparent; font-size: 24px; font-weight: bold; margin-bottom: 10px;">
429
- ⭐ STAR THIS REPOSITORY ⭐
430
- </div>
431
-
432
- <div style="display: flex; justify-content: center; gap: 10px; margin: 20px 0;">
433
- <div style="background: rgba(6, 182, 212, 0.1); border-radius: 5px; padding: 8px 15px;">
434
- <span style="font-size: 20px;">👨‍💻</span> <span>Developers</span>
435
- </div>
436
- <div style="background: rgba(16, 185, 129, 0.1); border-radius: 5px; padding: 8px 15px;">
437
- <span style="font-size: 20px;">🤖</span> <span>Bot Creators</span>
438
- </div>
439
- <div style="background: rgba(245, 158, 11, 0.1); border-radius: 5px; padding: 8px 15px;">
440
- <span style="font-size: 20px;">🚀</span> <span>Innovators</span>
441
- </div>
442
- </div>
443
-
444
- <p style="font-style: italic; max-width: 600px; margin: 0 auto;">Powered by Baileys-Elite - The Ultimate WhatsApp Web API Experience</p>
445
- </div>
package/README-whiskey.md DELETED
@@ -1,44 +0,0 @@
1
- <h1><img alt="Baileys logo" src="https://raw.githubusercontent.com/WhiskeySockets/Baileys/refs/heads/master/Media/logo.png" height="75"/></h1>
2
-
3
- ![NPM Downloads](https://img.shields.io/npm/dw/%40whiskeysockets%2Fbaileys?label=npm&color=%23CB3837)
4
- ![GitHub code size in bytes](https://img.shields.io/github/languages/code-size/whiskeysockets/baileys)
5
- ![Discord](https://img.shields.io/discord/725839806084546610?label=discord&color=%235865F2)
6
-
7
- Baileys is a WebSockets-based TypeScript library for interacting with the WhatsApp Web API.
8
-
9
- # Usage
10
- A new guide has been posted at https://baileys.wiki.
11
-
12
- # Sponsor
13
- If you'd like to financially support this project, you can do so by supporting the current maintainer [here](https://purpshell.dev/sponsor).
14
-
15
- # Disclaimer
16
- This project is not affiliated, associated, authorized, endorsed by, or in any way officially connected with WhatsApp or any of its subsidiaries or its affiliates.
17
- The official WhatsApp website can be found at whatsapp.com. "WhatsApp" as well as related names, marks, emblems and images are registered trademarks of their respective owners.
18
-
19
- The maintainers of Baileys do not in any way condone the use of this application in practices that violate the Terms of Service of WhatsApp. The maintainers of this application call upon the personal responsibility of its users to use this application in a fair way, as it is intended to be used.
20
- Use at your own discretion. Do not spam people with this. We discourage any stalkerware, bulk or automated messaging usage.
21
-
22
- # License
23
- Copyright (c) 2025 Rajeh Taher/WhiskeySockets
24
-
25
- Licensed under the MIT License:
26
- Permission is hereby granted, free of charge, to any person obtaining a copy
27
- of this software and associated documentation files (the "Software"), to deal
28
- in the Software without restriction, including without limitation the rights
29
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
30
- copies of the Software, and to permit persons to whom the Software is
31
- furnished to do so, subject to the following conditions:
32
-
33
- The above copyright notice and this permission notice shall be included in all
34
- copies or substantial portions of the Software.
35
-
36
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
37
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
38
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
39
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
40
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
41
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
42
- SOFTWARE.
43
-
44
- Thus, the maintainers of the project can't be held liable for any potential misuse of this project.
@@ -1,3 +0,0 @@
1
- {
2
- "version": [2, 3000, 1026056356]
3
- }
@@ -1 +0,0 @@
1
- export default function queueJob<T>(bucket: string | number, awaitable: () => Promise<T>): Promise<T>;
@@ -1,57 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.default = queueJob;
4
- const _queueAsyncBuckets = new Map();
5
- const _gcLimit = 10000;
6
- async function _asyncQueueExecutor(queue, cleanup) {
7
- let offt = 0;
8
- // eslint-disable-next-line no-constant-condition
9
- while (true) {
10
- const limit = Math.min(queue.length, _gcLimit);
11
- for (let i = offt; i < limit; i++) {
12
- const job = queue[i];
13
- try {
14
- job.resolve(await job.awaitable());
15
- }
16
- catch (e) {
17
- job.reject(e);
18
- }
19
- }
20
- if (limit < queue.length) {
21
- if (limit >= _gcLimit) {
22
- queue.splice(0, limit);
23
- offt = 0;
24
- }
25
- else {
26
- offt = limit;
27
- }
28
- }
29
- else {
30
- break;
31
- }
32
- }
33
- cleanup();
34
- }
35
- function queueJob(bucket, awaitable) {
36
- // Skip name assignment since it's readonly in strict mode
37
- if (typeof bucket !== 'string') {
38
- console.warn('Unhandled bucket type (for naming):', typeof bucket, bucket);
39
- }
40
- let inactive = false;
41
- if (!_queueAsyncBuckets.has(bucket)) {
42
- _queueAsyncBuckets.set(bucket, []);
43
- inactive = true;
44
- }
45
- const queue = _queueAsyncBuckets.get(bucket);
46
- const job = new Promise((resolve, reject) => {
47
- queue.push({
48
- awaitable,
49
- resolve: resolve,
50
- reject
51
- });
52
- });
53
- if (inactive) {
54
- _asyncQueueExecutor(queue, () => _queueAsyncBuckets.delete(bucket));
55
- }
56
- return job;
57
- }
@@ -1,36 +0,0 @@
1
- import { Boom } from '@hapi/boom';
2
- import { SocketConfig } from '../Types';
3
- import { BinaryNode } from '../WABinary';
4
- import { USyncQuery } from '../WAUSync';
5
- export declare const makeUSyncSocket: (config: SocketConfig) => {
6
- executeUSyncQuery: (usyncQuery: USyncQuery) => Promise<import("../WAUSync").USyncQueryResult | undefined>;
7
- type: "md";
8
- ws: import("./Client").WebSocketClient;
9
- ev: import("../Types").BaileysEventEmitter & {
10
- process(handler: (events: Partial<import("../Types").BaileysEventMap>) => void | Promise<void>): (() => void);
11
- buffer(): void;
12
- createBufferedFunction<A extends any[], T>(work: (...args: A) => Promise<T>): ((...args: A) => Promise<T>);
13
- flush(force?: boolean): boolean;
14
- isBuffering(): boolean;
15
- };
16
- authState: {
17
- creds: import("../Types").AuthenticationCreds;
18
- keys: import("../Types").SignalKeyStoreWithTransaction;
19
- };
20
- signalRepository: import("../Types").SignalRepository;
21
- user: import("../Types").Contact | undefined;
22
- generateMessageTag: () => string;
23
- query: (node: BinaryNode, timeoutMs?: number) => Promise<any>;
24
- waitForMessage: <T>(msgId: string, timeoutMs?: number | undefined) => Promise<any>;
25
- waitForSocketOpen: () => Promise<void>;
26
- sendRawMessage: (data: Uint8Array | Buffer) => Promise<void>;
27
- sendNode: (frame: BinaryNode) => Promise<void>;
28
- logout: (msg?: string) => Promise<void>;
29
- end: (error: Error | undefined) => void;
30
- onUnexpectedError: (err: Error | Boom, msg: string) => void;
31
- uploadPreKeys: (count?: number) => Promise<void>;
32
- uploadPreKeysToServerIfRequired: () => Promise<void>;
33
- requestPairingCode: (phoneNumber: string, pairCode: string) => Promise<string>;
34
- waitForConnectionUpdate: (check: (u: Partial<import("../Types").ConnectionState>) => Promise<boolean | undefined>, timeoutMs?: number) => Promise<void>;
35
- sendWAMBuffer: (wamBuffer: Buffer) => Promise<any>;
36
- };
@@ -1,70 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.makeUSyncSocket = void 0;
4
- const boom_1 = require("@hapi/boom");
5
- const WABinary_1 = require("../WABinary");
6
- const socket_1 = require("./socket");
7
- const makeUSyncSocket = (config) => {
8
- const sock = (0, socket_1.makeSocket)(config);
9
- const { generateMessageTag, query, } = sock;
10
- const executeUSyncQuery = async (usyncQuery) => {
11
- if (usyncQuery.protocols.length === 0) {
12
- throw new boom_1.Boom('USyncQuery must have at least one protocol');
13
- }
14
- // todo: validate users, throw WARNING on no valid users
15
- // variable below has only validated users
16
- const validUsers = usyncQuery.users;
17
- const userNodes = validUsers.map((user) => {
18
- return {
19
- tag: 'user',
20
- attrs: {
21
- jid: !user.phone ? user.id : undefined,
22
- },
23
- content: usyncQuery.protocols
24
- .map((a) => a.getUserElement(user))
25
- .filter(a => a !== null)
26
- };
27
- });
28
- const listNode = {
29
- tag: 'list',
30
- attrs: {},
31
- content: userNodes
32
- };
33
- const queryNode = {
34
- tag: 'query',
35
- attrs: {},
36
- content: usyncQuery.protocols.map((a) => a.getQueryElement())
37
- };
38
- const iq = {
39
- tag: 'iq',
40
- attrs: {
41
- to: WABinary_1.S_WHATSAPP_NET,
42
- type: 'get',
43
- xmlns: 'usync',
44
- },
45
- content: [
46
- {
47
- tag: 'usync',
48
- attrs: {
49
- context: usyncQuery.context,
50
- mode: usyncQuery.mode,
51
- sid: generateMessageTag(),
52
- last: 'true',
53
- index: '0',
54
- },
55
- content: [
56
- queryNode,
57
- listNode
58
- ]
59
- }
60
- ],
61
- };
62
- const result = await query(iq);
63
- return usyncQuery.parseUSyncQueryResult(result);
64
- };
65
- return {
66
- ...sock,
67
- executeUSyncQuery,
68
- };
69
- };
70
- exports.makeUSyncSocket = makeUSyncSocket;
@@ -1,2 +0,0 @@
1
- import makeInMemoryStore from './make-in-memory-store';
2
- export { makeInMemoryStore };
@@ -1,8 +0,0 @@
1
- "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.makeInMemoryStore = void 0;
7
- const make_in_memory_store_1 = __importDefault(require("./make-in-memory-store"));
8
- exports.makeInMemoryStore = make_in_memory_store_1.default;