@vinzsocket/baileys 2.8.20 → 2.8.35

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 (377) hide show
  1. package/lib/Defaults/index.js +38 -31
  2. package/lib/Signal/Group/ciphertext-message.js +9 -2
  3. package/lib/Signal/Group/group-session-builder.js +15 -7
  4. package/lib/Signal/Group/group_cipher.js +21 -13
  5. package/lib/Signal/Group/index.js +79 -12
  6. package/lib/Signal/Group/keyhelper.js +16 -6
  7. package/lib/Signal/Group/queue-job.js +9 -2
  8. package/lib/Signal/Group/sender-chain-key.js +14 -6
  9. package/lib/Signal/Group/sender-key-distribution-message.js +13 -6
  10. package/lib/Signal/Group/sender-key-message.js +17 -9
  11. package/lib/Signal/Group/sender-key-name.js +9 -2
  12. package/lib/Signal/Group/sender-key-record.js +16 -9
  13. package/lib/Signal/Group/sender-key-state.js +13 -6
  14. package/lib/Signal/Group/sender-message-key.js +12 -4
  15. package/lib/Signal/libsignal.js +35 -26
  16. package/lib/Signal/lid-mapping.js +27 -19
  17. package/lib/Socket/Client/index.js +27 -3
  18. package/lib/Socket/Client/types.js +11 -4
  19. package/lib/Socket/Client/websocket.js +19 -11
  20. package/lib/Socket/business.js +41 -34
  21. package/lib/Socket/chats.js +103 -95
  22. package/lib/Socket/communities.js +58 -49
  23. package/lib/Socket/groups.js +59 -51
  24. package/lib/Socket/index.js +11 -6
  25. package/lib/Socket/messages-recv.js +153 -145
  26. package/lib/Socket/messages-send.js +112 -104
  27. package/lib/Socket/mex.js +15 -8
  28. package/lib/Socket/newsletter.js +30 -23
  29. package/lib/Socket/socket.js +112 -105
  30. package/lib/Store/index.js +49 -4
  31. package/lib/Store/make-cache-manager-store.js +19 -11
  32. package/lib/Store/make-in-memory-store.js +38 -29
  33. package/lib/Store/make-ordered-dictionary.js +9 -2
  34. package/lib/Store/object-repository.js +9 -2
  35. package/lib/Types/Auth.js +5 -2
  36. package/lib/Types/Bussines.js +5 -2
  37. package/lib/Types/Call.js +5 -2
  38. package/lib/Types/Chat.js +7 -1
  39. package/lib/Types/Contact.js +5 -2
  40. package/lib/Types/Events.js +3 -2
  41. package/lib/Types/GroupMetadata.js +5 -2
  42. package/lib/Types/Label.js +8 -2
  43. package/lib/Types/LabelAssociation.js +8 -2
  44. package/lib/Types/Message.js +18 -6
  45. package/lib/Types/Newsletter.js +10 -4
  46. package/lib/Types/Product.js +5 -2
  47. package/lib/Types/Signal.js +3 -2
  48. package/lib/Types/Socket.js +4 -3
  49. package/lib/Types/State.js +9 -3
  50. package/lib/Types/USync.js +3 -2
  51. package/lib/Types/index.js +155 -14
  52. package/lib/Utils/auth-utils.js +35 -25
  53. package/lib/Utils/baileys-event-stream.js +24 -15
  54. package/lib/Utils/business.js +72 -59
  55. package/lib/Utils/chat-utils.js +94 -77
  56. package/lib/Utils/crypto.js +55 -30
  57. package/lib/Utils/decode-wa-message.js +47 -37
  58. package/lib/Utils/event-buffer.js +25 -17
  59. package/lib/Utils/extended-messages.js +16 -9
  60. package/lib/Utils/generics.js +101 -62
  61. package/lib/Utils/history.js +33 -23
  62. package/lib/Utils/index.js +236 -22
  63. package/lib/Utils/lid-resolver.js +14 -5
  64. package/lib/Utils/link-preview.js +14 -7
  65. package/lib/Utils/logger.js +10 -4
  66. package/lib/Utils/lt-hash.js +10 -4
  67. package/lib/Utils/make-mutex.js +11 -3
  68. package/lib/Utils/mention.js +14 -4
  69. package/lib/Utils/message-retry-manager.js +13 -6
  70. package/lib/Utils/messages-media.js +128 -93
  71. package/lib/Utils/messages.js +125 -98
  72. package/lib/Utils/noise-handler.js +28 -21
  73. package/lib/Utils/process-message.js +74 -63
  74. package/lib/Utils/signal.js +48 -33
  75. package/lib/Utils/use-multi-file-auth-state.js +27 -20
  76. package/lib/Utils/validate-connection.js +57 -47
  77. package/lib/WABinary/constants.js +10 -4
  78. package/lib/WABinary/decode.js +20 -10
  79. package/lib/WABinary/encode.js +12 -4
  80. package/lib/WABinary/generic-utils.js +32 -15
  81. package/lib/WABinary/index.js +60 -6
  82. package/lib/WABinary/jid-utils.js +39 -20
  83. package/lib/WABinary/types.js +4 -2
  84. package/lib/WAM/BinaryInfo.js +9 -2
  85. package/lib/WAM/constants.js +13001 -1
  86. package/lib/WAM/encode.js +17 -10
  87. package/lib/WAM/index.js +38 -4
  88. package/lib/WAUSync/Protocols/USyncContactProtocol.js +12 -5
  89. package/lib/WAUSync/Protocols/USyncDeviceProtocol.js +13 -6
  90. package/lib/WAUSync/Protocols/USyncDisappearingModeProtocol.js +11 -4
  91. package/lib/WAUSync/Protocols/USyncStatusProtocol.js +11 -4
  92. package/lib/WAUSync/Protocols/USyncUsernameProtocol.js +11 -4
  93. package/lib/WAUSync/Protocols/UsyncBotProfileProtocol.js +26 -19
  94. package/lib/WAUSync/Protocols/UsyncLIDProtocol.js +9 -2
  95. package/lib/WAUSync/Protocols/index.js +60 -6
  96. package/lib/WAUSync/USyncQuery.js +24 -17
  97. package/lib/WAUSync/USyncUser.js +9 -2
  98. package/lib/WAUSync/index.js +38 -4
  99. package/lib/index.js +114 -12
  100. package/package.json +2 -1
  101. package/lib/Defaults/index.d.ts +0 -58
  102. package/lib/Defaults/index.d.ts.map +0 -1
  103. package/lib/Defaults/index.js.map +0 -1
  104. package/lib/Signal/Group/ciphertext-message.d.ts +0 -10
  105. package/lib/Signal/Group/ciphertext-message.d.ts.map +0 -1
  106. package/lib/Signal/Group/ciphertext-message.js.map +0 -1
  107. package/lib/Signal/Group/group-session-builder.d.ts +0 -15
  108. package/lib/Signal/Group/group-session-builder.d.ts.map +0 -1
  109. package/lib/Signal/Group/group-session-builder.js.map +0 -1
  110. package/lib/Signal/Group/group_cipher.d.ts +0 -18
  111. package/lib/Signal/Group/group_cipher.d.ts.map +0 -1
  112. package/lib/Signal/Group/group_cipher.js.map +0 -1
  113. package/lib/Signal/Group/index.d.ts +0 -12
  114. package/lib/Signal/Group/index.d.ts.map +0 -1
  115. package/lib/Signal/Group/index.js.map +0 -1
  116. package/lib/Signal/Group/keyhelper.d.ts +0 -11
  117. package/lib/Signal/Group/keyhelper.d.ts.map +0 -1
  118. package/lib/Signal/Group/keyhelper.js.map +0 -1
  119. package/lib/Signal/Group/queue-job.d.ts +0 -2
  120. package/lib/Signal/Group/sender-chain-key.d.ts +0 -14
  121. package/lib/Signal/Group/sender-chain-key.d.ts.map +0 -1
  122. package/lib/Signal/Group/sender-chain-key.js.map +0 -1
  123. package/lib/Signal/Group/sender-key-distribution-message.d.ts +0 -17
  124. package/lib/Signal/Group/sender-key-distribution-message.d.ts.map +0 -1
  125. package/lib/Signal/Group/sender-key-distribution-message.js.map +0 -1
  126. package/lib/Signal/Group/sender-key-message.d.ts +0 -19
  127. package/lib/Signal/Group/sender-key-message.d.ts.map +0 -1
  128. package/lib/Signal/Group/sender-key-message.js.map +0 -1
  129. package/lib/Signal/Group/sender-key-name.d.ts +0 -18
  130. package/lib/Signal/Group/sender-key-name.d.ts.map +0 -1
  131. package/lib/Signal/Group/sender-key-name.js.map +0 -1
  132. package/lib/Signal/Group/sender-key-record.d.ts +0 -31
  133. package/lib/Signal/Group/sender-key-record.d.ts.map +0 -1
  134. package/lib/Signal/Group/sender-key-record.js.map +0 -1
  135. package/lib/Signal/Group/sender-key-state.d.ts +0 -39
  136. package/lib/Signal/Group/sender-key-state.d.ts.map +0 -1
  137. package/lib/Signal/Group/sender-key-state.js.map +0 -1
  138. package/lib/Signal/Group/sender-message-key.d.ts +0 -12
  139. package/lib/Signal/Group/sender-message-key.d.ts.map +0 -1
  140. package/lib/Signal/Group/sender-message-key.js.map +0 -1
  141. package/lib/Signal/libsignal.d.ts +0 -8
  142. package/lib/Signal/libsignal.d.ts.map +0 -1
  143. package/lib/Signal/libsignal.js.map +0 -1
  144. package/lib/Signal/lid-mapping.d.ts +0 -30
  145. package/lib/Signal/lid-mapping.d.ts.map +0 -1
  146. package/lib/Signal/lid-mapping.js.map +0 -1
  147. package/lib/Socket/Client/index.d.ts +0 -3
  148. package/lib/Socket/Client/index.d.ts.map +0 -1
  149. package/lib/Socket/Client/index.js.map +0 -1
  150. package/lib/Socket/Client/types.d.ts +0 -16
  151. package/lib/Socket/Client/types.d.ts.map +0 -1
  152. package/lib/Socket/Client/types.js.map +0 -1
  153. package/lib/Socket/Client/websocket.d.ts +0 -13
  154. package/lib/Socket/Client/websocket.d.ts.map +0 -1
  155. package/lib/Socket/Client/websocket.js.map +0 -1
  156. package/lib/Socket/business.d.ts +0 -188
  157. package/lib/Socket/business.d.ts.map +0 -1
  158. package/lib/Socket/business.js.map +0 -1
  159. package/lib/Socket/chats.d.ts +0 -98
  160. package/lib/Socket/chats.d.ts.map +0 -1
  161. package/lib/Socket/chats.js.map +0 -1
  162. package/lib/Socket/communities.d.ts +0 -233
  163. package/lib/Socket/communities.d.ts.map +0 -1
  164. package/lib/Socket/communities.js.map +0 -1
  165. package/lib/Socket/groups.d.ts +0 -137
  166. package/lib/Socket/groups.d.ts.map +0 -1
  167. package/lib/Socket/groups.js.map +0 -1
  168. package/lib/Socket/index.d.ts +0 -220
  169. package/lib/Socket/index.d.ts.map +0 -1
  170. package/lib/Socket/index.js.map +0 -1
  171. package/lib/Socket/messages-recv.d.ts +0 -173
  172. package/lib/Socket/messages-recv.d.ts.map +0 -1
  173. package/lib/Socket/messages-recv.js.map +0 -1
  174. package/lib/Socket/messages-send.d.ts +0 -169
  175. package/lib/Socket/messages-send.d.ts.map +0 -1
  176. package/lib/Socket/messages-send.js.map +0 -1
  177. package/lib/Socket/mex.d.ts +0 -3
  178. package/lib/Socket/mex.d.ts.map +0 -1
  179. package/lib/Socket/mex.js.map +0 -1
  180. package/lib/Socket/newsletter.d.ts +0 -147
  181. package/lib/Socket/newsletter.d.ts.map +0 -1
  182. package/lib/Socket/newsletter.js.map +0 -1
  183. package/lib/Socket/socket.d.ts +0 -50
  184. package/lib/Socket/socket.d.ts.map +0 -1
  185. package/lib/Socket/socket.js.map +0 -1
  186. package/lib/Store/index.d.ts +0 -4
  187. package/lib/Store/make-cache-manager-store.d.ts +0 -17
  188. package/lib/Store/make-in-memory-store.d.ts +0 -118
  189. package/lib/Store/make-ordered-dictionary.d.ts +0 -14
  190. package/lib/Store/object-repository.d.ts +0 -10
  191. package/lib/Types/Auth.d.ts +0 -105
  192. package/lib/Types/Auth.d.ts.map +0 -1
  193. package/lib/Types/Auth.js.map +0 -1
  194. package/lib/Types/Bussines.d.ts +0 -25
  195. package/lib/Types/Bussines.d.ts.map +0 -1
  196. package/lib/Types/Bussines.js.map +0 -1
  197. package/lib/Types/Call.d.ts +0 -14
  198. package/lib/Types/Call.d.ts.map +0 -1
  199. package/lib/Types/Call.js.map +0 -1
  200. package/lib/Types/Chat.d.ts +0 -123
  201. package/lib/Types/Chat.d.ts.map +0 -1
  202. package/lib/Types/Chat.js.map +0 -1
  203. package/lib/Types/Contact.d.ts +0 -24
  204. package/lib/Types/Contact.d.ts.map +0 -1
  205. package/lib/Types/Contact.js.map +0 -1
  206. package/lib/Types/Events.d.ts +0 -199
  207. package/lib/Types/Events.d.ts.map +0 -1
  208. package/lib/Types/Events.js.map +0 -1
  209. package/lib/Types/GroupMetadata.d.ts +0 -66
  210. package/lib/Types/GroupMetadata.d.ts.map +0 -1
  211. package/lib/Types/GroupMetadata.js.map +0 -1
  212. package/lib/Types/Label.d.ts +0 -47
  213. package/lib/Types/Label.d.ts.map +0 -1
  214. package/lib/Types/Label.js.map +0 -1
  215. package/lib/Types/LabelAssociation.d.ts +0 -30
  216. package/lib/Types/LabelAssociation.d.ts.map +0 -1
  217. package/lib/Types/LabelAssociation.js.map +0 -1
  218. package/lib/Types/Message.d.ts +0 -300
  219. package/lib/Types/Message.d.ts.map +0 -1
  220. package/lib/Types/Message.js.map +0 -1
  221. package/lib/Types/Newsletter.d.ts +0 -135
  222. package/lib/Types/Newsletter.d.ts.map +0 -1
  223. package/lib/Types/Newsletter.js.map +0 -1
  224. package/lib/Types/Product.d.ts +0 -79
  225. package/lib/Types/Product.d.ts.map +0 -1
  226. package/lib/Types/Product.js.map +0 -1
  227. package/lib/Types/Signal.d.ts +0 -82
  228. package/lib/Types/Signal.d.ts.map +0 -1
  229. package/lib/Types/Signal.js.map +0 -1
  230. package/lib/Types/Socket.d.ts +0 -130
  231. package/lib/Types/Socket.d.ts.map +0 -1
  232. package/lib/Types/Socket.js.map +0 -1
  233. package/lib/Types/State.d.ts +0 -39
  234. package/lib/Types/State.d.ts.map +0 -1
  235. package/lib/Types/State.js.map +0 -1
  236. package/lib/Types/USync.d.ts +0 -26
  237. package/lib/Types/USync.d.ts.map +0 -1
  238. package/lib/Types/USync.js.map +0 -1
  239. package/lib/Types/index.d.ts +0 -65
  240. package/lib/Types/index.d.ts.map +0 -1
  241. package/lib/Types/index.js.map +0 -1
  242. package/lib/Utils/auth-utils.d.ts +0 -19
  243. package/lib/Utils/auth-utils.d.ts.map +0 -1
  244. package/lib/Utils/auth-utils.js.map +0 -1
  245. package/lib/Utils/baileys-event-stream.d.ts +0 -17
  246. package/lib/Utils/baileys-event-stream.d.ts.map +0 -1
  247. package/lib/Utils/baileys-event-stream.js.map +0 -1
  248. package/lib/Utils/business.d.ts +0 -23
  249. package/lib/Utils/business.d.ts.map +0 -1
  250. package/lib/Utils/business.js.map +0 -1
  251. package/lib/Utils/chat-utils.d.ts +0 -71
  252. package/lib/Utils/chat-utils.d.ts.map +0 -1
  253. package/lib/Utils/chat-utils.js.map +0 -1
  254. package/lib/Utils/crypto.d.ts +0 -41
  255. package/lib/Utils/crypto.d.ts.map +0 -1
  256. package/lib/Utils/crypto.js.map +0 -1
  257. package/lib/Utils/decode-wa-message.d.ts +0 -46
  258. package/lib/Utils/decode-wa-message.d.ts.map +0 -1
  259. package/lib/Utils/decode-wa-message.js.map +0 -1
  260. package/lib/Utils/event-buffer.d.ts +0 -34
  261. package/lib/Utils/event-buffer.d.ts.map +0 -1
  262. package/lib/Utils/event-buffer.js.map +0 -1
  263. package/lib/Utils/extended-messages.d.ts +0 -73
  264. package/lib/Utils/generics.d.ts +0 -92
  265. package/lib/Utils/generics.d.ts.map +0 -1
  266. package/lib/Utils/generics.js.map +0 -1
  267. package/lib/Utils/history.d.ts +0 -20
  268. package/lib/Utils/history.d.ts.map +0 -1
  269. package/lib/Utils/history.js.map +0 -1
  270. package/lib/Utils/index.d.ts +0 -22
  271. package/lib/Utils/index.d.ts.map +0 -1
  272. package/lib/Utils/index.js.map +0 -1
  273. package/lib/Utils/lid-resolver.d.ts +0 -17
  274. package/lib/Utils/link-preview.d.ts +0 -22
  275. package/lib/Utils/link-preview.d.ts.map +0 -1
  276. package/lib/Utils/link-preview.js.map +0 -1
  277. package/lib/Utils/logger.d.ts +0 -12
  278. package/lib/Utils/logger.d.ts.map +0 -1
  279. package/lib/Utils/logger.js.map +0 -1
  280. package/lib/Utils/lt-hash.d.ts +0 -13
  281. package/lib/Utils/lt-hash.d.ts.map +0 -1
  282. package/lib/Utils/lt-hash.js.map +0 -1
  283. package/lib/Utils/make-mutex.d.ts +0 -8
  284. package/lib/Utils/make-mutex.d.ts.map +0 -1
  285. package/lib/Utils/make-mutex.js.map +0 -1
  286. package/lib/Utils/mention.d.ts +0 -27
  287. package/lib/Utils/message-retry-manager.d.ts +0 -82
  288. package/lib/Utils/message-retry-manager.d.ts.map +0 -1
  289. package/lib/Utils/message-retry-manager.js.map +0 -1
  290. package/lib/Utils/messages-media.d.ts +0 -113
  291. package/lib/Utils/messages-media.d.ts.map +0 -1
  292. package/lib/Utils/messages-media.js.map +0 -1
  293. package/lib/Utils/messages.d.ts +0 -76
  294. package/lib/Utils/messages.d.ts.map +0 -1
  295. package/lib/Utils/messages.js.map +0 -1
  296. package/lib/Utils/noise-handler.d.ts +0 -20
  297. package/lib/Utils/noise-handler.d.ts.map +0 -1
  298. package/lib/Utils/noise-handler.js.map +0 -1
  299. package/lib/Utils/process-message.d.ts +0 -43
  300. package/lib/Utils/process-message.d.ts.map +0 -1
  301. package/lib/Utils/process-message.js.map +0 -1
  302. package/lib/Utils/signal.d.ts +0 -34
  303. package/lib/Utils/signal.d.ts.map +0 -1
  304. package/lib/Utils/signal.js.map +0 -1
  305. package/lib/Utils/use-multi-file-auth-state.d.ts +0 -13
  306. package/lib/Utils/use-multi-file-auth-state.d.ts.map +0 -1
  307. package/lib/Utils/use-multi-file-auth-state.js.map +0 -1
  308. package/lib/Utils/validate-connection.d.ts +0 -11
  309. package/lib/Utils/validate-connection.d.ts.map +0 -1
  310. package/lib/Utils/validate-connection.js.map +0 -1
  311. package/lib/WABinary/constants.d.ts +0 -28
  312. package/lib/WABinary/constants.d.ts.map +0 -1
  313. package/lib/WABinary/constants.js.map +0 -1
  314. package/lib/WABinary/decode.d.ts +0 -7
  315. package/lib/WABinary/decode.d.ts.map +0 -1
  316. package/lib/WABinary/decode.js.map +0 -1
  317. package/lib/WABinary/encode.d.ts +0 -3
  318. package/lib/WABinary/encode.d.ts.map +0 -1
  319. package/lib/WABinary/encode.js.map +0 -1
  320. package/lib/WABinary/generic-utils.d.ts +0 -15
  321. package/lib/WABinary/generic-utils.d.ts.map +0 -1
  322. package/lib/WABinary/generic-utils.js.map +0 -1
  323. package/lib/WABinary/index.d.ts +0 -6
  324. package/lib/WABinary/index.d.ts.map +0 -1
  325. package/lib/WABinary/index.js.map +0 -1
  326. package/lib/WABinary/jid-utils.d.ts +0 -37
  327. package/lib/WABinary/jid-utils.d.ts.map +0 -1
  328. package/lib/WABinary/jid-utils.js.map +0 -1
  329. package/lib/WABinary/types.d.ts +0 -19
  330. package/lib/WABinary/types.d.ts.map +0 -1
  331. package/lib/WABinary/types.js.map +0 -1
  332. package/lib/WAM/BinaryInfo.d.ts +0 -9
  333. package/lib/WAM/BinaryInfo.d.ts.map +0 -1
  334. package/lib/WAM/BinaryInfo.js.map +0 -1
  335. package/lib/WAM/constants.d.ts +0 -40
  336. package/lib/WAM/constants.d.ts.map +0 -1
  337. package/lib/WAM/constants.js.map +0 -1
  338. package/lib/WAM/encode.d.ts +0 -3
  339. package/lib/WAM/encode.d.ts.map +0 -1
  340. package/lib/WAM/encode.js.map +0 -1
  341. package/lib/WAM/index.d.ts +0 -4
  342. package/lib/WAM/index.d.ts.map +0 -1
  343. package/lib/WAM/index.js.map +0 -1
  344. package/lib/WAUSync/Protocols/USyncContactProtocol.d.ts +0 -10
  345. package/lib/WAUSync/Protocols/USyncContactProtocol.d.ts.map +0 -1
  346. package/lib/WAUSync/Protocols/USyncContactProtocol.js.map +0 -1
  347. package/lib/WAUSync/Protocols/USyncDeviceProtocol.d.ts +0 -23
  348. package/lib/WAUSync/Protocols/USyncDeviceProtocol.d.ts.map +0 -1
  349. package/lib/WAUSync/Protocols/USyncDeviceProtocol.js.map +0 -1
  350. package/lib/WAUSync/Protocols/USyncDisappearingModeProtocol.d.ts +0 -13
  351. package/lib/WAUSync/Protocols/USyncDisappearingModeProtocol.d.ts.map +0 -1
  352. package/lib/WAUSync/Protocols/USyncDisappearingModeProtocol.js.map +0 -1
  353. package/lib/WAUSync/Protocols/USyncStatusProtocol.d.ts +0 -13
  354. package/lib/WAUSync/Protocols/USyncStatusProtocol.d.ts.map +0 -1
  355. package/lib/WAUSync/Protocols/USyncStatusProtocol.js.map +0 -1
  356. package/lib/WAUSync/Protocols/USyncUsernameProtocol.d.ts +0 -8
  357. package/lib/WAUSync/Protocols/UsyncBotProfileProtocol.d.ts +0 -26
  358. package/lib/WAUSync/Protocols/UsyncBotProfileProtocol.d.ts.map +0 -1
  359. package/lib/WAUSync/Protocols/UsyncBotProfileProtocol.js.map +0 -1
  360. package/lib/WAUSync/Protocols/UsyncLIDProtocol.d.ts +0 -9
  361. package/lib/WAUSync/Protocols/UsyncLIDProtocol.d.ts.map +0 -1
  362. package/lib/WAUSync/Protocols/UsyncLIDProtocol.js.map +0 -1
  363. package/lib/WAUSync/Protocols/index.d.ts +0 -6
  364. package/lib/WAUSync/Protocols/index.d.ts.map +0 -1
  365. package/lib/WAUSync/Protocols/index.js.map +0 -1
  366. package/lib/WAUSync/USyncQuery.d.ts +0 -30
  367. package/lib/WAUSync/USyncQuery.d.ts.map +0 -1
  368. package/lib/WAUSync/USyncQuery.js.map +0 -1
  369. package/lib/WAUSync/USyncUser.d.ts +0 -13
  370. package/lib/WAUSync/USyncUser.d.ts.map +0 -1
  371. package/lib/WAUSync/USyncUser.js.map +0 -1
  372. package/lib/WAUSync/index.d.ts +0 -4
  373. package/lib/WAUSync/index.d.ts.map +0 -1
  374. package/lib/WAUSync/index.js.map +0 -1
  375. package/lib/index.d.ts +0 -13
  376. package/lib/index.d.ts.map +0 -1
  377. package/lib/index.js.map +0 -1
@@ -1,6 +1,13 @@
1
- import { proto } from '../../WAProto/index.js';
2
- import { BufferJSON, initAuthCreds } from '../Utils/index.js';
3
- import logger from '../Utils/logger.js';
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.makeCacheManagerAuthState = exports.default = void 0;
7
+ var _index = require("../../WAProto/index.js");
8
+ var _index2 = require("../Utils/index.js");
9
+ var _logger = _interopRequireDefault(require("../Utils/logger.js"));
10
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
4
11
  /**
5
12
  * Creates an authentication state backed by any `cache-manager` compatible
6
13
  * store (Redis, Memcached, the built-in memory store, etc). Useful when you
@@ -13,7 +20,7 @@ import logger from '../Utils/logger.js';
13
20
  * @param store a `cache-manager` store config/instance, as accepted by `caching()`
14
21
  * @param sessionKey a unique key prefix to namespace this session's data in the store
15
22
  */
16
- export const makeCacheManagerAuthState = async (store, sessionKey) => {
23
+ const makeCacheManagerAuthState = async (store, sessionKey) => {
17
24
  let caching;
18
25
  try {
19
26
  const cacheManagerModule = await import('cache-manager');
@@ -33,17 +40,17 @@ export const makeCacheManagerAuthState = async (store, sessionKey) => {
33
40
  if (file === 'creds') {
34
41
  ttl = 63115200; // 2 years
35
42
  }
36
- await databaseConn.set(defaultKey(file), JSON.stringify(data, BufferJSON.replacer), ttl);
43
+ await databaseConn.set(defaultKey(file), JSON.stringify(data, _index2.BufferJSON.replacer), ttl);
37
44
  };
38
45
  const readData = async file => {
39
46
  try {
40
47
  const data = await databaseConn.get(defaultKey(file));
41
48
  if (data) {
42
- return JSON.parse(data, BufferJSON.reviver);
49
+ return JSON.parse(data, _index2.BufferJSON.reviver);
43
50
  }
44
51
  return null;
45
52
  } catch (error) {
46
- logger.error(error);
53
+ _logger.default.error(error);
47
54
  return null;
48
55
  }
49
56
  };
@@ -51,7 +58,7 @@ export const makeCacheManagerAuthState = async (store, sessionKey) => {
51
58
  try {
52
59
  return await databaseConn.del(defaultKey(file));
53
60
  } catch {
54
- logger.error(`Error removing ${file} from session ${sessionKey}`);
61
+ _logger.default.error(`Error removing ${file} from session ${sessionKey}`);
55
62
  }
56
63
  };
57
64
  const clearState = async () => {
@@ -62,7 +69,7 @@ export const makeCacheManagerAuthState = async (store, sessionKey) => {
62
69
  // ignore
63
70
  }
64
71
  };
65
- const creds = (await readData('creds')) || initAuthCreds();
72
+ const creds = (await readData('creds')) || (0, _index2.initAuthCreds)();
66
73
  return {
67
74
  clearState,
68
75
  saveCreds: () => writeData('creds', creds),
@@ -74,7 +81,7 @@ export const makeCacheManagerAuthState = async (store, sessionKey) => {
74
81
  await Promise.all(ids.map(async id => {
75
82
  let value = await readData(`${type}-${id}`);
76
83
  if (type === 'app-state-sync-key' && value) {
77
- value = proto.Message.AppStateSyncKeyData.create(value);
84
+ value = _index.proto.Message.AppStateSyncKeyData.create(value);
78
85
  }
79
86
  data[id] = value;
80
87
  }));
@@ -95,4 +102,5 @@ export const makeCacheManagerAuthState = async (store, sessionKey) => {
95
102
  }
96
103
  };
97
104
  };
98
- export default makeCacheManagerAuthState;
105
+ exports.makeCacheManagerAuthState = makeCacheManagerAuthState;
106
+ var _default = exports.default = makeCacheManagerAuthState;
@@ -1,25 +1,33 @@
1
- import { createRequire } from 'module';
2
- import { proto } from '../../WAProto/index.js';
3
- import { DEFAULT_CONNECTION_CONFIG } from '../Defaults/index.js';
4
- import { LabelAssociationType } from '../Types/LabelAssociation.js';
5
- import { md5, toNumber, updateMessageWithReaction, updateMessageWithReceipt } from '../Utils/index.js';
6
- import { jidDecode, jidNormalizedUser } from '../WABinary/index.js';
7
- import { makeOrderedDictionary } from './make-ordered-dictionary.js';
8
- import { ObjectRepository } from './object-repository.js';
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.waMessageID = exports.waLabelAssociationKey = exports.waChatKey = exports.makeInMemoryStore = exports.default = void 0;
7
+ var _module = require("module");
8
+ var _index = require("../../WAProto/index.js");
9
+ var _index2 = require("../Defaults/index.js");
10
+ var _LabelAssociation = require("../Types/LabelAssociation.js");
11
+ var _index3 = require("../Utils/index.js");
12
+ var _index4 = require("../WABinary/index.js");
13
+ var _makeOrderedDictionary = require("./make-ordered-dictionary.js");
14
+ var _objectRepository = require("./object-repository.js");
9
15
  // ESM has no native `require`; this gives us one to synchronously load
10
16
  // optional CJS dependencies (keyed-db) only when actually needed, the
11
17
  // same way the original implementation lazily required it.
12
- const require = createRequire(import.meta.url);
13
- export const waChatKey = pin => ({
18
+ const _require = (0, _module.createRequire)(import.meta.url);
19
+ const waChatKey = pin => ({
14
20
  key: c => (pin ? c.pinned ? '1' : '0' : '') + (c.archived ? '0' : '1') + (c.conversationTimestamp ? c.conversationTimestamp.toString(16).padStart(8, '0') : '') + c.id,
15
21
  compare: (k1, k2) => k2.localeCompare(k1)
16
22
  });
17
- export const waMessageID = m => m.key.id || '';
18
- export const waLabelAssociationKey = {
19
- key: la => la.type === LabelAssociationType.Chat ? la.chatId + la.labelId : la.chatId + la.messageId + la.labelId,
23
+ exports.waChatKey = waChatKey;
24
+ const waMessageID = m => m.key.id || '';
25
+ exports.waMessageID = waMessageID;
26
+ const waLabelAssociationKey = exports.waLabelAssociationKey = {
27
+ key: la => la.type === _LabelAssociation.LabelAssociationType.Chat ? la.chatId + la.labelId : la.chatId + la.messageId + la.labelId,
20
28
  compare: (k1, k2) => k2.localeCompare(k1)
21
29
  };
22
- const makeMessagesDictionary = () => makeOrderedDictionary(waMessageID);
30
+ const makeMessagesDictionary = () => (0, _makeOrderedDictionary.makeOrderedDictionary)(waMessageID);
23
31
  /**
24
32
  * An in-memory cache for chats, contacts, messages, group metadata, presences
25
33
  * and labels. Bind it to your socket's event emitter with `store.bind(sock.ev)`
@@ -28,16 +36,16 @@ const makeMessagesDictionary = () => makeOrderedDictionary(waMessageID);
28
36
  * Requires the optional `@adiwajshing/keyed-db` package to be installed
29
37
  * (`npm install @adiwajshing/keyed-db`).
30
38
  */
31
- export const makeInMemoryStore = config => {
39
+ const makeInMemoryStore = config => {
32
40
  const socket = config.socket;
33
41
  const chatKey = config.chatKey || waChatKey(true);
34
42
  const labelAssociationKey = config.labelAssociationKey || waLabelAssociationKey;
35
- const logger = config.logger || DEFAULT_CONNECTION_CONFIG.logger.child({
43
+ const logger = config.logger || _index2.DEFAULT_CONNECTION_CONFIG.logger.child({
36
44
  stream: 'in-mem-store'
37
45
  });
38
46
  let KeyedDB;
39
47
  try {
40
- KeyedDB = require('@adiwajshing/keyed-db').default;
48
+ KeyedDB = _require('@adiwajshing/keyed-db').default;
41
49
  } catch {
42
50
  throw new Error('The "@adiwajshing/keyed-db" package is required to use makeInMemoryStore(). Install it with: npm install @adiwajshing/keyed-db');
43
51
  }
@@ -49,7 +57,7 @@ export const makeInMemoryStore = config => {
49
57
  const state = {
50
58
  connection: 'close'
51
59
  };
52
- const labels = new ObjectRepository();
60
+ const labels = new _objectRepository.ObjectRepository();
53
61
  const labelAssociations = new KeyedDB(labelAssociationKey, labelAssociationKey.key);
54
62
  const assertMessageList = jid => {
55
63
  if (!messages[jid]) {
@@ -136,8 +144,8 @@ export const makeInMemoryStore = config => {
136
144
  const contactHashes = validContacts.map(contactId => {
137
145
  const {
138
146
  user
139
- } = jidDecode(contactId);
140
- return [contactId, md5(Buffer.from(user + 'WA_ADD_NOTIF', 'utf8')).toString('base64').slice(0, 3)];
147
+ } = (0, _index4.jidDecode)(contactId);
148
+ return [contactId, (0, _index3.md5)(Buffer.from(user + 'WA_ADD_NOTIF', 'utf8')).toString('base64').slice(0, 3)];
141
149
  });
142
150
  contact = contacts[contactHashes.find(([, b]) => b === update.id)?.[0] || '']; // find contact by attrs.hash, when user is not saved as a contact
143
151
  }
@@ -223,14 +231,14 @@ export const makeInMemoryStore = config => {
223
231
  case 'append':
224
232
  case 'notify':
225
233
  for (const msg of newMessages) {
226
- const jid = jidNormalizedUser(msg.key.remoteJid);
234
+ const jid = (0, _index4.jidNormalizedUser)(msg.key.remoteJid);
227
235
  const list = assertMessageList(jid);
228
236
  list.upsert(msg, 'append');
229
237
  if (type === 'notify') {
230
238
  if (!chats.get(jid)) {
231
239
  ev.emit('chats.upsert', [{
232
240
  id: jid,
233
- conversationTimestamp: toNumber(msg.messageTimestamp),
241
+ conversationTimestamp: (0, _index3.toNumber)(msg.messageTimestamp),
234
242
  unreadCount: 1
235
243
  }]);
236
244
  }
@@ -244,7 +252,7 @@ export const makeInMemoryStore = config => {
244
252
  update,
245
253
  key
246
254
  } of updates) {
247
- const list = assertMessageList(jidNormalizedUser(key.remoteJid));
255
+ const list = assertMessageList((0, _index4.jidNormalizedUser)(key.remoteJid));
248
256
  if (update?.status) {
249
257
  const listStatus = list.get(key.id)?.status;
250
258
  if (listStatus && update?.status <= listStatus) {
@@ -328,7 +336,7 @@ export const makeInMemoryStore = config => {
328
336
  const obj = messages[key.remoteJid];
329
337
  const msg = obj?.get(key.id);
330
338
  if (msg) {
331
- updateMessageWithReceipt(msg, receipt);
339
+ (0, _index3.updateMessageWithReceipt)(msg, receipt);
332
340
  }
333
341
  }
334
342
  });
@@ -340,7 +348,7 @@ export const makeInMemoryStore = config => {
340
348
  const obj = messages[key.remoteJid];
341
349
  const msg = obj?.get(key.id);
342
350
  if (msg) {
343
- updateMessageWithReaction(msg, reaction);
351
+ (0, _index3.updateMessageWithReaction)(msg, reaction);
344
352
  }
345
353
  }
346
354
  });
@@ -360,7 +368,7 @@ export const makeInMemoryStore = config => {
360
368
  for (const jid in json.messages) {
361
369
  const list = assertMessageList(jid);
362
370
  for (const msg of json.messages[jid]) {
363
- list.upsert(proto.WebMessageInfo.create(msg), 'append');
371
+ list.upsert(_index.proto.WebMessageInfo.create(msg), 'append');
364
372
  }
365
373
  }
366
374
  };
@@ -463,7 +471,7 @@ export const makeInMemoryStore = config => {
463
471
  // require fs here so that in case "fs" is not available -- the app does not crash
464
472
  const {
465
473
  writeFileSync
466
- } = require('fs');
474
+ } = _require('fs');
467
475
  writeFileSync(path, JSON.stringify(toJSON()));
468
476
  },
469
477
  readFromFile: path => {
@@ -471,7 +479,7 @@ export const makeInMemoryStore = config => {
471
479
  const {
472
480
  readFileSync,
473
481
  existsSync
474
- } = require('fs');
482
+ } = _require('fs');
475
483
  if (existsSync(path)) {
476
484
  logger.debug({
477
485
  path
@@ -485,4 +493,5 @@ export const makeInMemoryStore = config => {
485
493
  }
486
494
  };
487
495
  };
488
- export default makeInMemoryStore;
496
+ exports.makeInMemoryStore = makeInMemoryStore;
497
+ var _default = exports.default = makeInMemoryStore;
@@ -1,4 +1,11 @@
1
- export function makeOrderedDictionary(idGetter) {
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.default = void 0;
7
+ exports.makeOrderedDictionary = makeOrderedDictionary;
8
+ function makeOrderedDictionary(idGetter) {
2
9
  const array = [];
3
10
  const dict = {};
4
11
  const get = id => dict[id];
@@ -73,4 +80,4 @@ export function makeOrderedDictionary(idGetter) {
73
80
  }
74
81
  };
75
82
  }
76
- export default makeOrderedDictionary;
83
+ var _default = exports.default = makeOrderedDictionary;
@@ -1,4 +1,10 @@
1
- export class ObjectRepository {
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.ObjectRepository = void 0;
7
+ class ObjectRepository {
2
8
  constructor(entities = {}) {
3
9
  this.entityMap = new Map(Object.entries(entities));
4
10
  }
@@ -22,4 +28,5 @@ export class ObjectRepository {
22
28
  toJSON() {
23
29
  return this.findAll();
24
30
  }
25
- }
31
+ }
32
+ exports.ObjectRepository = ObjectRepository;
package/lib/Types/Auth.js CHANGED
@@ -1,2 +1,5 @@
1
- export {};
2
- //# sourceMappingURL=Auth.js.map
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
@@ -1,2 +1,5 @@
1
- export {};
2
- //# sourceMappingURL=Bussines.js.map
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
package/lib/Types/Call.js CHANGED
@@ -1,2 +1,5 @@
1
- export {};
2
- //# sourceMappingURL=Call.js.map
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
package/lib/Types/Chat.js CHANGED
@@ -1,2 +1,8 @@
1
- export const ALL_WA_PATCH_NAMES = ['critical_block', 'critical_unblock_low', 'regular_high', 'regular_low', 'regular'];
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.ALL_WA_PATCH_NAMES = void 0;
7
+ const ALL_WA_PATCH_NAMES = exports.ALL_WA_PATCH_NAMES = ['critical_block', 'critical_unblock_low', 'regular_high', 'regular_low', 'regular'];
2
8
  //# sourceMappingURL=Chat.js.map
@@ -1,2 +1,5 @@
1
- export {};
2
- //# sourceMappingURL=Contact.js.map
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
@@ -1,2 +1,3 @@
1
- import { proto } from '../../WAProto/index.js';
2
- //# sourceMappingURL=Events.js.map
1
+ "use strict";
2
+
3
+ var _index = require("../../WAProto/index.js");
@@ -1,2 +1,5 @@
1
- export {};
2
- //# sourceMappingURL=GroupMetadata.js.map
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
@@ -1,5 +1,11 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.LabelColor = void 0;
1
7
  /** WhatsApp has 20 predefined colors */
2
- export var LabelColor;
8
+ var LabelColor;
3
9
  (function (LabelColor) {
4
10
  LabelColor[LabelColor["Color1"] = 0] = "Color1";
5
11
  LabelColor[LabelColor["Color2"] = 1] = "Color2";
@@ -21,5 +27,5 @@ export var LabelColor;
21
27
  LabelColor[LabelColor["Color18"] = 17] = "Color18";
22
28
  LabelColor[LabelColor["Color19"] = 18] = "Color19";
23
29
  LabelColor[LabelColor["Color20"] = 19] = "Color20";
24
- })(LabelColor || (LabelColor = {}));
30
+ })(LabelColor || (exports.LabelColor = LabelColor = {}));
25
31
  //# sourceMappingURL=Label.js.map
@@ -1,7 +1,13 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.LabelAssociationType = void 0;
1
7
  /** Association type */
2
- export var LabelAssociationType;
8
+ var LabelAssociationType;
3
9
  (function (LabelAssociationType) {
4
10
  LabelAssociationType["Chat"] = "label_jid";
5
11
  LabelAssociationType["Message"] = "label_message";
6
- })(LabelAssociationType || (LabelAssociationType = {}));
12
+ })(LabelAssociationType || (exports.LabelAssociationType = LabelAssociationType = {}));
7
13
  //# sourceMappingURL=LabelAssociation.js.map
@@ -1,11 +1,23 @@
1
- import { proto } from '../../WAProto/index.js';
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.WAMessageStubType = exports.WAMessageStatus = exports.WAMessageAddressingMode = void 0;
7
+ Object.defineProperty(exports, "WAProto", {
8
+ enumerable: true,
9
+ get: function () {
10
+ return _index.proto;
11
+ }
12
+ });
13
+ var _index = require("../../WAProto/index.js");
2
14
  // export the WAMessage Prototypes
3
- export { proto as WAProto };
4
- export const WAMessageStubType = proto.WebMessageInfo.StubType;
5
- export const WAMessageStatus = proto.WebMessageInfo.Status;
6
- export var WAMessageAddressingMode;
15
+
16
+ const WAMessageStubType = exports.WAMessageStubType = _index.proto.WebMessageInfo.StubType;
17
+ const WAMessageStatus = exports.WAMessageStatus = _index.proto.WebMessageInfo.Status;
18
+ var WAMessageAddressingMode;
7
19
  (function (WAMessageAddressingMode) {
8
20
  WAMessageAddressingMode["PN"] = "pn";
9
21
  WAMessageAddressingMode["LID"] = "lid";
10
- })(WAMessageAddressingMode || (WAMessageAddressingMode = {}));
22
+ })(WAMessageAddressingMode || (exports.WAMessageAddressingMode = WAMessageAddressingMode = {}));
11
23
  //# sourceMappingURL=Message.js.map
@@ -1,4 +1,10 @@
1
- export var XWAPaths;
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.XWAPaths = exports.QueryIds = void 0;
7
+ var XWAPaths;
2
8
  (function (XWAPaths) {
3
9
  XWAPaths["xwa2_newsletter_create"] = "xwa2_newsletter_create";
4
10
  XWAPaths["xwa2_newsletter_subscribers"] = "xwa2_newsletter_subscribers";
@@ -12,8 +18,8 @@ export var XWAPaths;
12
18
  XWAPaths["xwa2_newsletter_change_owner"] = "xwa2_newsletter_change_owner";
13
19
  XWAPaths["xwa2_newsletter_demote"] = "xwa2_newsletter_demote";
14
20
  XWAPaths["xwa2_newsletter_delete_v2"] = "xwa2_newsletter_delete_v2";
15
- })(XWAPaths || (XWAPaths = {}));
16
- export var QueryIds;
21
+ })(XWAPaths || (exports.XWAPaths = XWAPaths = {}));
22
+ var QueryIds;
17
23
  (function (QueryIds) {
18
24
  QueryIds["CREATE"] = "8823471724422422";
19
25
  QueryIds["UPDATE_METADATA"] = "24250201037901610";
@@ -27,5 +33,5 @@ export var QueryIds;
27
33
  QueryIds["CHANGE_OWNER"] = "7341777602580933";
28
34
  QueryIds["DEMOTE"] = "6551828931592903";
29
35
  QueryIds["DELETE"] = "30062808666639665";
30
- })(QueryIds || (QueryIds = {}));
36
+ })(QueryIds || (exports.QueryIds = QueryIds = {}));
31
37
  //# sourceMappingURL=Newsletter.js.map
@@ -1,2 +1,5 @@
1
- export {};
2
- //# sourceMappingURL=Product.js.map
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
@@ -1,2 +1,3 @@
1
- import { proto } from '../../WAProto/index.js';
2
- //# sourceMappingURL=Signal.js.map
1
+ "use strict";
2
+
3
+ var _index = require("../../WAProto/index.js");
@@ -1,3 +1,4 @@
1
- import { proto } from '../../WAProto/index.js';
2
- import './Message.js';
3
- //# sourceMappingURL=Socket.js.map
1
+ "use strict";
2
+
3
+ var _index = require("../../WAProto/index.js");
4
+ require("./Message.js");
@@ -1,5 +1,11 @@
1
- import { Boom } from '@hapi/boom';
2
- export var SyncState;
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.SyncState = void 0;
7
+ var _boom = require("@hapi/boom");
8
+ var SyncState;
3
9
  (function (SyncState) {
4
10
  /** The socket is connecting, but we haven't received pending notifications yet. */
5
11
  SyncState[SyncState["Connecting"] = 0] = "Connecting";
@@ -9,5 +15,5 @@ export var SyncState;
9
15
  SyncState[SyncState["Syncing"] = 2] = "Syncing";
10
16
  /** Initial sync is complete, or was skipped. The socket is fully operational and events are processed in real-time. */
11
17
  SyncState[SyncState["Online"] = 3] = "Online";
12
- })(SyncState || (SyncState = {}));
18
+ })(SyncState || (exports.SyncState = SyncState = {}));
13
19
  //# sourceMappingURL=State.js.map
@@ -1,2 +1,3 @@
1
- import { USyncUser } from '../WAUSync/index.js';
2
- //# sourceMappingURL=USync.js.map
1
+ "use strict";
2
+
3
+ var _index = require("../WAUSync/index.js");