@fer2809fl/baileys 7.0.1 → 7.0.4

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 (350) hide show
  1. package/README.md +322 -578
  2. package/WAProto/WAProto.proto +916 -360
  3. package/WAProto/fix-imports.js +18 -22
  4. package/WAProto/index.d.ts +15471 -8638
  5. package/WAProto/index.js +80576 -45941
  6. package/lib/Defaults/index.d.ts +14 -18
  7. package/lib/Defaults/index.js +111 -115
  8. package/lib/Signal/libsignal.js +22 -31
  9. package/lib/Signal/lid-mapping.d.ts +0 -4
  10. package/lib/Signal/lid-mapping.js +0 -6
  11. package/lib/Socket/business.d.ts +8 -75
  12. package/lib/Socket/business.js +1 -0
  13. package/lib/Socket/chats.d.ts +0 -6
  14. package/lib/Socket/chats.js +3 -67
  15. package/lib/Socket/communities.d.ts +641 -336
  16. package/lib/Socket/communities.js +3 -6
  17. package/lib/Socket/dugong.d.ts +130 -0
  18. package/lib/Socket/dugong.js +772 -0
  19. package/lib/Socket/groups.d.ts +18 -23
  20. package/lib/Socket/groups.js +88 -168
  21. package/lib/Socket/index.d.ts +631 -322
  22. package/lib/Socket/index.js +12 -9
  23. package/lib/Socket/messages-recv.d.ts +52 -84
  24. package/lib/Socket/messages-recv.js +193 -677
  25. package/lib/Socket/messages-send.d.ts +643 -262
  26. package/lib/Socket/messages-send.js +1559 -1359
  27. package/lib/Socket/mex.d.ts +0 -1
  28. package/lib/Socket/mex.js +8 -22
  29. package/lib/Socket/native-buttons.js +231 -0
  30. package/lib/Socket/newsletter.d.ts +27 -42
  31. package/lib/Socket/newsletter.js +439 -402
  32. package/lib/Socket/socket.d.ts +2 -6
  33. package/lib/Socket/socket.js +47 -39
  34. package/lib/Types/Auth.d.ts +0 -1
  35. package/lib/Types/Bussines.d.ts +34 -22
  36. package/lib/Types/Call.d.ts +1 -1
  37. package/lib/Types/Chat.d.ts +0 -1
  38. package/lib/Types/Contact.d.ts +0 -2
  39. package/lib/Types/Events.d.ts +1 -20
  40. package/lib/Types/GroupMetadata.d.ts +1 -4
  41. package/lib/Types/Message.d.ts +348 -354
  42. package/lib/Types/Message.js +0 -4
  43. package/lib/Types/{Mex.d.ts → Newsletter.d.ts} +7 -17
  44. package/lib/Types/{Mex.js → Newsletter.js} +5 -3
  45. package/lib/Types/Signal.d.ts +1 -12
  46. package/lib/Types/Socket.d.ts +148 -135
  47. package/lib/Types/State.d.ts +0 -65
  48. package/lib/Types/State.js +0 -43
  49. package/lib/Types/index.d.ts +52 -52
  50. package/lib/Types/index.js +30 -23
  51. package/lib/Utils/auth-utils.d.ts +0 -5
  52. package/lib/Utils/auth-utils.js +0 -12
  53. package/lib/Utils/browser-utils.js +0 -1
  54. package/lib/Utils/crypto.d.ts +12 -12
  55. package/lib/Utils/decode-wa-message.d.ts +0 -18
  56. package/lib/Utils/decode-wa-message.js +0 -34
  57. package/lib/Utils/event-buffer.d.ts +0 -2
  58. package/lib/Utils/generics.d.ts +2 -3
  59. package/lib/Utils/generics.js +1 -10
  60. package/lib/Utils/history.d.ts +0 -2
  61. package/lib/Utils/history.js +9 -12
  62. package/lib/Utils/identity-change-handler.d.ts +0 -7
  63. package/lib/Utils/identity-change-handler.js +0 -1
  64. package/lib/Utils/index.d.ts +23 -30
  65. package/lib/Utils/index.js +3 -9
  66. package/lib/Utils/link-preview.js +2 -2
  67. package/lib/Utils/message-retry-manager.d.ts +0 -5
  68. package/lib/Utils/message-retry-manager.js +11 -11
  69. package/lib/Utils/messages-media.d.ts +13 -45
  70. package/lib/Utils/messages-media.js +98 -293
  71. package/lib/Utils/messages.d.ts +3 -16
  72. package/lib/Utils/messages.js +1123 -1219
  73. package/lib/Utils/noise-handler.d.ts +1 -1
  74. package/lib/Utils/process-message.js +1 -103
  75. package/lib/Utils/rich-messages.d.ts +277 -0
  76. package/lib/Utils/rich-messages.js +1144 -0
  77. package/lib/Utils/signal.d.ts +0 -13
  78. package/lib/Utils/signal.js +0 -42
  79. package/lib/Utils/sticker-pack.d.ts +10 -0
  80. package/lib/Utils/sticker-pack.js +111 -0
  81. package/lib/Utils/sync-action-utils.js +0 -1
  82. package/lib/Utils/tc-token-utils.d.ts +1 -26
  83. package/lib/Utils/tc-token-utils.js +5 -151
  84. package/lib/Utils/validate-connection.d.ts +0 -1
  85. package/lib/Utils/validate-connection.js +3 -13
  86. package/lib/WABinary/decode.d.ts +1 -1
  87. package/lib/WABinary/generic-utils.d.ts +3 -1
  88. package/lib/WABinary/generic-utils.js +78 -0
  89. package/lib/WABinary/jid-utils.d.ts +0 -11
  90. package/lib/WABinary/jid-utils.js +0 -33
  91. package/lib/WAM/encode.d.ts +1 -1
  92. package/lib/WAUSync/Protocols/USyncContactProtocol.js +3 -26
  93. package/lib/WAUSync/Protocols/index.d.ts +0 -1
  94. package/lib/WAUSync/USyncQuery.d.ts +0 -1
  95. package/lib/WAUSync/USyncQuery.js +1 -1
  96. package/lib/WAUSync/USyncUser.d.ts +0 -4
  97. package/lib/WAUSync/USyncUser.js +0 -8
  98. package/lib/index.d.ts +1 -1
  99. package/lib/index.js +1 -4
  100. package/package.json +27 -31
  101. package/LICENSE +0 -21
  102. package/engine-requirements.js +0 -10
  103. package/lib/Defaults/index.d.ts.map +0 -1
  104. package/lib/Defaults/index.js.map +0 -1
  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.map +0 -1
  108. package/lib/Signal/Group/group-session-builder.js.map +0 -1
  109. package/lib/Signal/Group/group_cipher.d.ts.map +0 -1
  110. package/lib/Signal/Group/group_cipher.js.map +0 -1
  111. package/lib/Signal/Group/index.d.ts.map +0 -1
  112. package/lib/Signal/Group/index.js.map +0 -1
  113. package/lib/Signal/Group/keyhelper.d.ts.map +0 -1
  114. package/lib/Signal/Group/keyhelper.js.map +0 -1
  115. package/lib/Signal/Group/sender-chain-key.d.ts.map +0 -1
  116. package/lib/Signal/Group/sender-chain-key.js.map +0 -1
  117. package/lib/Signal/Group/sender-key-distribution-message.d.ts.map +0 -1
  118. package/lib/Signal/Group/sender-key-distribution-message.js.map +0 -1
  119. package/lib/Signal/Group/sender-key-message.d.ts.map +0 -1
  120. package/lib/Signal/Group/sender-key-message.js.map +0 -1
  121. package/lib/Signal/Group/sender-key-name.d.ts.map +0 -1
  122. package/lib/Signal/Group/sender-key-name.js.map +0 -1
  123. package/lib/Signal/Group/sender-key-record.d.ts.map +0 -1
  124. package/lib/Signal/Group/sender-key-record.js.map +0 -1
  125. package/lib/Signal/Group/sender-key-state.d.ts.map +0 -1
  126. package/lib/Signal/Group/sender-key-state.js.map +0 -1
  127. package/lib/Signal/Group/sender-message-key.d.ts.map +0 -1
  128. package/lib/Signal/Group/sender-message-key.js.map +0 -1
  129. package/lib/Signal/libsignal.d.ts.map +0 -1
  130. package/lib/Signal/libsignal.js.map +0 -1
  131. package/lib/Signal/lid-mapping.d.ts.map +0 -1
  132. package/lib/Signal/lid-mapping.js.map +0 -1
  133. package/lib/Socket/Client/index.d.ts.map +0 -1
  134. package/lib/Socket/Client/index.js.map +0 -1
  135. package/lib/Socket/Client/types.d.ts.map +0 -1
  136. package/lib/Socket/Client/types.js.map +0 -1
  137. package/lib/Socket/Client/websocket.d.ts.map +0 -1
  138. package/lib/Socket/Client/websocket.js.map +0 -1
  139. package/lib/Socket/business.d.ts.map +0 -1
  140. package/lib/Socket/business.js.map +0 -1
  141. package/lib/Socket/chats.d.ts.map +0 -1
  142. package/lib/Socket/chats.js.map +0 -1
  143. package/lib/Socket/communities.d.ts.map +0 -1
  144. package/lib/Socket/communities.js.map +0 -1
  145. package/lib/Socket/groups.d.ts.map +0 -1
  146. package/lib/Socket/groups.js.map +0 -1
  147. package/lib/Socket/index.d.ts.map +0 -1
  148. package/lib/Socket/index.js.map +0 -1
  149. package/lib/Socket/messages-recv.d.ts.map +0 -1
  150. package/lib/Socket/messages-recv.js.map +0 -1
  151. package/lib/Socket/messages-send.d.ts.map +0 -1
  152. package/lib/Socket/messages-send.js.map +0 -1
  153. package/lib/Socket/mex.d.ts.map +0 -1
  154. package/lib/Socket/mex.js.map +0 -1
  155. package/lib/Socket/newsletter.d.ts.map +0 -1
  156. package/lib/Socket/newsletter.js.map +0 -1
  157. package/lib/Socket/smgss.d.ts +0 -119
  158. package/lib/Socket/smgss.d.ts.map +0 -1
  159. package/lib/Socket/smgss.js +0 -453
  160. package/lib/Socket/smgss.js.map +0 -1
  161. package/lib/Socket/socket.d.ts.map +0 -1
  162. package/lib/Socket/socket.js.map +0 -1
  163. package/lib/Store/index.d.ts +0 -4
  164. package/lib/Store/index.d.ts.map +0 -1
  165. package/lib/Store/index.js +0 -4
  166. package/lib/Store/index.js.map +0 -1
  167. package/lib/Store/make-in-memory-store.d.ts +0 -132
  168. package/lib/Store/make-in-memory-store.d.ts.map +0 -1
  169. package/lib/Store/make-in-memory-store.js +0 -450
  170. package/lib/Store/make-in-memory-store.js.map +0 -1
  171. package/lib/Store/make-ordered-dictionary.d.ts +0 -14
  172. package/lib/Store/make-ordered-dictionary.d.ts.map +0 -1
  173. package/lib/Store/make-ordered-dictionary.js +0 -80
  174. package/lib/Store/make-ordered-dictionary.js.map +0 -1
  175. package/lib/Store/object-repository.d.ts +0 -13
  176. package/lib/Store/object-repository.d.ts.map +0 -1
  177. package/lib/Store/object-repository.js +0 -24
  178. package/lib/Store/object-repository.js.map +0 -1
  179. package/lib/Types/Auth.d.ts.map +0 -1
  180. package/lib/Types/Auth.js.map +0 -1
  181. package/lib/Types/Bussines.d.ts.map +0 -1
  182. package/lib/Types/Bussines.js.map +0 -1
  183. package/lib/Types/Call.d.ts.map +0 -1
  184. package/lib/Types/Call.js.map +0 -1
  185. package/lib/Types/Chat.d.ts.map +0 -1
  186. package/lib/Types/Chat.js.map +0 -1
  187. package/lib/Types/Contact.d.ts.map +0 -1
  188. package/lib/Types/Contact.js.map +0 -1
  189. package/lib/Types/Events.d.ts.map +0 -1
  190. package/lib/Types/Events.js.map +0 -1
  191. package/lib/Types/GroupMetadata.d.ts.map +0 -1
  192. package/lib/Types/GroupMetadata.js.map +0 -1
  193. package/lib/Types/Label.d.ts.map +0 -1
  194. package/lib/Types/Label.js.map +0 -1
  195. package/lib/Types/LabelAssociation.d.ts.map +0 -1
  196. package/lib/Types/LabelAssociation.js.map +0 -1
  197. package/lib/Types/Message.d.ts.map +0 -1
  198. package/lib/Types/Message.js.map +0 -1
  199. package/lib/Types/Mex.d.ts.map +0 -1
  200. package/lib/Types/Mex.js.map +0 -1
  201. package/lib/Types/Product.d.ts.map +0 -1
  202. package/lib/Types/Product.js.map +0 -1
  203. package/lib/Types/Signal.d.ts.map +0 -1
  204. package/lib/Types/Signal.js.map +0 -1
  205. package/lib/Types/Socket.d.ts.map +0 -1
  206. package/lib/Types/Socket.js.map +0 -1
  207. package/lib/Types/State.d.ts.map +0 -1
  208. package/lib/Types/State.js.map +0 -1
  209. package/lib/Types/USync.d.ts.map +0 -1
  210. package/lib/Types/USync.js.map +0 -1
  211. package/lib/Types/index.d.ts.map +0 -1
  212. package/lib/Types/index.js.map +0 -1
  213. package/lib/Utils/auth-utils.d.ts.map +0 -1
  214. package/lib/Utils/auth-utils.js.map +0 -1
  215. package/lib/Utils/browser-utils.d.ts.map +0 -1
  216. package/lib/Utils/browser-utils.js.map +0 -1
  217. package/lib/Utils/business.d.ts.map +0 -1
  218. package/lib/Utils/business.js.map +0 -1
  219. package/lib/Utils/button-handler.d.ts +0 -28
  220. package/lib/Utils/button-handler.d.ts.map +0 -1
  221. package/lib/Utils/button-handler.js +0 -140
  222. package/lib/Utils/button-handler.js.map +0 -1
  223. package/lib/Utils/chat-utils.d.ts.map +0 -1
  224. package/lib/Utils/chat-utils.js.map +0 -1
  225. package/lib/Utils/companion-reg-client-utils.d.ts.map +0 -1
  226. package/lib/Utils/companion-reg-client-utils.js.map +0 -1
  227. package/lib/Utils/crypto.d.ts.map +0 -1
  228. package/lib/Utils/crypto.js.map +0 -1
  229. package/lib/Utils/decode-wa-message.d.ts.map +0 -1
  230. package/lib/Utils/decode-wa-message.js.map +0 -1
  231. package/lib/Utils/event-buffer.d.ts.map +0 -1
  232. package/lib/Utils/event-buffer.js.map +0 -1
  233. package/lib/Utils/generics.d.ts.map +0 -1
  234. package/lib/Utils/generics.js.map +0 -1
  235. package/lib/Utils/history.d.ts.map +0 -1
  236. package/lib/Utils/history.js.map +0 -1
  237. package/lib/Utils/identity-change-handler.d.ts.map +0 -1
  238. package/lib/Utils/identity-change-handler.js.map +0 -1
  239. package/lib/Utils/index.d.ts.map +0 -1
  240. package/lib/Utils/index.js.map +0 -1
  241. package/lib/Utils/interactive.d.ts +0 -60
  242. package/lib/Utils/interactive.d.ts.map +0 -1
  243. package/lib/Utils/interactive.js +0 -224
  244. package/lib/Utils/interactive.js.map +0 -1
  245. package/lib/Utils/link-preview.d.ts.map +0 -1
  246. package/lib/Utils/link-preview.js.map +0 -1
  247. package/lib/Utils/logger.d.ts.map +0 -1
  248. package/lib/Utils/logger.js.map +0 -1
  249. package/lib/Utils/lt-hash.d.ts.map +0 -1
  250. package/lib/Utils/lt-hash.js.map +0 -1
  251. package/lib/Utils/make-mutex.d.ts.map +0 -1
  252. package/lib/Utils/make-mutex.js.map +0 -1
  253. package/lib/Utils/message-composer.d.ts +0 -93
  254. package/lib/Utils/message-composer.d.ts.map +0 -1
  255. package/lib/Utils/message-composer.js +0 -311
  256. package/lib/Utils/message-composer.js.map +0 -1
  257. package/lib/Utils/message-retry-manager.d.ts.map +0 -1
  258. package/lib/Utils/message-retry-manager.js.map +0 -1
  259. package/lib/Utils/messages-media.d.ts.map +0 -1
  260. package/lib/Utils/messages-media.js.map +0 -1
  261. package/lib/Utils/messages-newsletter.d.ts +0 -74
  262. package/lib/Utils/messages-newsletter.d.ts.map +0 -1
  263. package/lib/Utils/messages-newsletter.js +0 -128
  264. package/lib/Utils/messages-newsletter.js.map +0 -1
  265. package/lib/Utils/messages.d.ts.map +0 -1
  266. package/lib/Utils/messages.js.map +0 -1
  267. package/lib/Utils/noise-handler.d.ts.map +0 -1
  268. package/lib/Utils/noise-handler.js.map +0 -1
  269. package/lib/Utils/offline-node-processor.d.ts.map +0 -1
  270. package/lib/Utils/offline-node-processor.js.map +0 -1
  271. package/lib/Utils/pre-key-manager.d.ts.map +0 -1
  272. package/lib/Utils/pre-key-manager.js.map +0 -1
  273. package/lib/Utils/process-message.d.ts.map +0 -1
  274. package/lib/Utils/process-message.js.map +0 -1
  275. package/lib/Utils/reporting-utils.d.ts.map +0 -1
  276. package/lib/Utils/reporting-utils.js.map +0 -1
  277. package/lib/Utils/shortcake-crypto.d.ts +0 -36
  278. package/lib/Utils/shortcake-crypto.d.ts.map +0 -1
  279. package/lib/Utils/shortcake-crypto.js +0 -71
  280. package/lib/Utils/shortcake-crypto.js.map +0 -1
  281. package/lib/Utils/shortcake.d.ts +0 -36
  282. package/lib/Utils/shortcake.d.ts.map +0 -1
  283. package/lib/Utils/shortcake.js +0 -162
  284. package/lib/Utils/shortcake.js.map +0 -1
  285. package/lib/Utils/signal.d.ts.map +0 -1
  286. package/lib/Utils/signal.js.map +0 -1
  287. package/lib/Utils/stanza-ack.d.ts.map +0 -1
  288. package/lib/Utils/stanza-ack.js.map +0 -1
  289. package/lib/Utils/sync-action-utils.d.ts.map +0 -1
  290. package/lib/Utils/sync-action-utils.js.map +0 -1
  291. package/lib/Utils/tc-token-utils.d.ts.map +0 -1
  292. package/lib/Utils/tc-token-utils.js.map +0 -1
  293. package/lib/Utils/use-multi-file-auth-state.d.ts.map +0 -1
  294. package/lib/Utils/use-multi-file-auth-state.js.map +0 -1
  295. package/lib/Utils/use-single-file-auth-state.d.ts +0 -6
  296. package/lib/Utils/use-single-file-auth-state.d.ts.map +0 -1
  297. package/lib/Utils/use-single-file-auth-state.js +0 -111
  298. package/lib/Utils/use-single-file-auth-state.js.map +0 -1
  299. package/lib/Utils/use-sqlite-auth-state.d.ts +0 -14
  300. package/lib/Utils/use-sqlite-auth-state.d.ts.map +0 -1
  301. package/lib/Utils/use-sqlite-auth-state.js +0 -107
  302. package/lib/Utils/use-sqlite-auth-state.js.map +0 -1
  303. package/lib/Utils/validate-connection.d.ts.map +0 -1
  304. package/lib/Utils/validate-connection.js.map +0 -1
  305. package/lib/WABinary/constants.d.ts.map +0 -1
  306. package/lib/WABinary/constants.js.map +0 -1
  307. package/lib/WABinary/decode.d.ts.map +0 -1
  308. package/lib/WABinary/decode.js.map +0 -1
  309. package/lib/WABinary/encode.d.ts.map +0 -1
  310. package/lib/WABinary/encode.js.map +0 -1
  311. package/lib/WABinary/generic-utils.d.ts.map +0 -1
  312. package/lib/WABinary/generic-utils.js.map +0 -1
  313. package/lib/WABinary/index.d.ts.map +0 -1
  314. package/lib/WABinary/index.js.map +0 -1
  315. package/lib/WABinary/jid-utils.d.ts.map +0 -1
  316. package/lib/WABinary/jid-utils.js.map +0 -1
  317. package/lib/WABinary/types.d.ts.map +0 -1
  318. package/lib/WABinary/types.js.map +0 -1
  319. package/lib/WAM/BinaryInfo.d.ts.map +0 -1
  320. package/lib/WAM/BinaryInfo.js.map +0 -1
  321. package/lib/WAM/constants.d.ts.map +0 -1
  322. package/lib/WAM/constants.js.map +0 -1
  323. package/lib/WAM/encode.d.ts.map +0 -1
  324. package/lib/WAM/encode.js.map +0 -1
  325. package/lib/WAM/index.d.ts.map +0 -1
  326. package/lib/WAM/index.js.map +0 -1
  327. package/lib/WAUSync/Protocols/USyncContactProtocol.d.ts.map +0 -1
  328. package/lib/WAUSync/Protocols/USyncContactProtocol.js.map +0 -1
  329. package/lib/WAUSync/Protocols/USyncDeviceProtocol.d.ts.map +0 -1
  330. package/lib/WAUSync/Protocols/USyncDeviceProtocol.js.map +0 -1
  331. package/lib/WAUSync/Protocols/USyncDisappearingModeProtocol.d.ts.map +0 -1
  332. package/lib/WAUSync/Protocols/USyncDisappearingModeProtocol.js.map +0 -1
  333. package/lib/WAUSync/Protocols/USyncStatusProtocol.d.ts.map +0 -1
  334. package/lib/WAUSync/Protocols/USyncStatusProtocol.js.map +0 -1
  335. package/lib/WAUSync/Protocols/USyncUsernameProtocol.d.ts.map +0 -1
  336. package/lib/WAUSync/Protocols/USyncUsernameProtocol.js.map +0 -1
  337. package/lib/WAUSync/Protocols/UsyncBotProfileProtocol.d.ts.map +0 -1
  338. package/lib/WAUSync/Protocols/UsyncBotProfileProtocol.js.map +0 -1
  339. package/lib/WAUSync/Protocols/UsyncLIDProtocol.d.ts.map +0 -1
  340. package/lib/WAUSync/Protocols/UsyncLIDProtocol.js.map +0 -1
  341. package/lib/WAUSync/Protocols/index.d.ts.map +0 -1
  342. package/lib/WAUSync/Protocols/index.js.map +0 -1
  343. package/lib/WAUSync/USyncQuery.d.ts.map +0 -1
  344. package/lib/WAUSync/USyncQuery.js.map +0 -1
  345. package/lib/WAUSync/USyncUser.d.ts.map +0 -1
  346. package/lib/WAUSync/USyncUser.js.map +0 -1
  347. package/lib/WAUSync/index.d.ts.map +0 -1
  348. package/lib/WAUSync/index.js.map +0 -1
  349. package/lib/index.d.ts.map +0 -1
  350. package/lib/index.js.map +0 -1
@@ -1,66 +1,66 @@
1
- export * from './Auth.js';
2
- export * from './GroupMetadata.js';
3
- export * from './Chat.js';
4
- export * from './Contact.js';
5
- export * from './State.js';
6
- export * from './Message.js';
7
- export * from './Socket.js';
8
- export * from './Events.js';
9
- export * from './Product.js';
10
- export * from './Call.js';
11
- export * from './Signal.js';
12
- export * from './Mex.js';
13
- import type { AuthenticationState } from './Auth.js';
14
- import type { SocketConfig } from './Socket.js';
1
+ export * from "./Auth.js";
2
+ export * from "./GroupMetadata.js";
3
+ export * from "./Chat.js";
4
+ export * from "./Contact.js";
5
+ export * from "./State.js";
6
+ export * from "./Message.js";
7
+ export * from "./Socket.js";
8
+ export * from "./Events.js";
9
+ export * from "./Product.js";
10
+ export * from "./Call.js";
11
+ export * from "./Signal.js";
12
+ export * from "./Bussines.js";
13
+ export * from "./Newsletter.js";
14
+ import type { AuthenticationState } from "./Auth.js";
15
+ import type { SocketConfig } from "./Socket.js";
15
16
  export type UserFacingSocketConfig = Partial<SocketConfig> & {
16
- auth: AuthenticationState;
17
+ auth: AuthenticationState;
17
18
  };
18
19
  export type BrowsersMap = {
19
- ubuntu(browser: string): [string, string, string];
20
- macOS(browser: string): [string, string, string];
21
- baileys(browser: string): [string, string, string];
22
- windows(browser: string): [string, string, string];
23
- android(browser: string): [string, string, string];
24
- appropriate(browser: string): [string, string, string];
20
+ ubuntu(browser: string): [string, string, string];
21
+ macOS(browser: string): [string, string, string];
22
+ baileys(browser: string): [string, string, string];
23
+ windows(browser: string): [string, string, string];
24
+ appropriate(browser: string): [string, string, string];
25
25
  };
26
26
  export declare enum DisconnectReason {
27
- connectionClosed = 428,
28
- connectionLost = 408,
29
- connectionReplaced = 440,
30
- timedOut = 408,
31
- loggedOut = 401,
32
- badSession = 500,
33
- restartRequired = 515,
34
- multideviceMismatch = 411,
35
- forbidden = 403,
36
- unavailableService = 503
27
+ connectionClosed = 428,
28
+ connectionLost = 408,
29
+ connectionReplaced = 440,
30
+ timedOut = 408,
31
+ loggedOut = 401,
32
+ badSession = 500,
33
+ restartRequired = 515,
34
+ multideviceMismatch = 411,
35
+ forbidden = 403,
36
+ unavailableService = 503,
37
37
  }
38
38
  export type WAInitResponse = {
39
- ref: string;
40
- ttl: number;
41
- status: 200;
39
+ ref: string;
40
+ ttl: number;
41
+ status: 200;
42
42
  };
43
43
  export type WABusinessHoursConfig = {
44
- day_of_week: string;
45
- mode: string;
46
- open_time?: number;
47
- close_time?: number;
44
+ day_of_week: string;
45
+ mode: string;
46
+ open_time?: number;
47
+ close_time?: number;
48
48
  };
49
49
  export type WABusinessProfile = {
50
- description: string;
51
- email: string | undefined;
52
- business_hours: {
53
- timezone?: string;
54
- config?: WABusinessHoursConfig[];
55
- business_config?: WABusinessHoursConfig[];
56
- };
57
- website: string[];
58
- category?: string;
59
- wid?: string;
60
- address?: string;
50
+ description: string;
51
+ email: string | undefined;
52
+ business_hours: {
53
+ timezone?: string;
54
+ config?: WABusinessHoursConfig[];
55
+ business_config?: WABusinessHoursConfig[];
56
+ };
57
+ website: string[];
58
+ category?: string;
59
+ wid?: string;
60
+ address?: string;
61
61
  };
62
62
  export type CurveKeyPair = {
63
- private: Uint8Array;
64
- public: Uint8Array;
63
+ private: Uint8Array;
64
+ public: Uint8Array;
65
65
  };
66
- //# sourceMappingURL=index.d.ts.map
66
+ //# sourceMappingURL=index.d.ts.map
@@ -1,26 +1,33 @@
1
- export * from './Auth.js';
2
- export * from './GroupMetadata.js';
3
- export * from './Chat.js';
4
- export * from './Contact.js';
5
- export * from './State.js';
6
- export * from './Message.js';
7
- export * from './Socket.js';
8
- export * from './Events.js';
9
- export * from './Product.js';
10
- export * from './Call.js';
11
- export * from './Signal.js';
12
- export * from './Mex.js';
1
+ export * from "./Auth.js";
2
+ export * from "./GroupMetadata.js";
3
+ export * from "./Chat.js";
4
+ export * from "./Contact.js";
5
+ export * from "./State.js";
6
+ export * from "./Message.js";
7
+ export * from "./Socket.js";
8
+ export * from "./Events.js";
9
+ export * from "./Product.js";
10
+ export * from "./Call.js";
11
+ export * from "./Signal.js";
12
+ export * from "./Bussines.js";
13
+ export * from "./Newsletter.js";
13
14
  export var DisconnectReason;
14
15
  (function (DisconnectReason) {
15
- DisconnectReason[DisconnectReason["connectionClosed"] = 428] = "connectionClosed";
16
- DisconnectReason[DisconnectReason["connectionLost"] = 408] = "connectionLost";
17
- DisconnectReason[DisconnectReason["connectionReplaced"] = 440] = "connectionReplaced";
18
- DisconnectReason[DisconnectReason["timedOut"] = 408] = "timedOut";
19
- DisconnectReason[DisconnectReason["loggedOut"] = 401] = "loggedOut";
20
- DisconnectReason[DisconnectReason["badSession"] = 500] = "badSession";
21
- DisconnectReason[DisconnectReason["restartRequired"] = 515] = "restartRequired";
22
- DisconnectReason[DisconnectReason["multideviceMismatch"] = 411] = "multideviceMismatch";
23
- DisconnectReason[DisconnectReason["forbidden"] = 403] = "forbidden";
24
- DisconnectReason[DisconnectReason["unavailableService"] = 503] = "unavailableService";
16
+ DisconnectReason[(DisconnectReason["connectionClosed"] = 428)] =
17
+ "connectionClosed";
18
+ DisconnectReason[(DisconnectReason["connectionLost"] = 408)] =
19
+ "connectionLost";
20
+ DisconnectReason[(DisconnectReason["connectionReplaced"] = 440)] =
21
+ "connectionReplaced";
22
+ DisconnectReason[(DisconnectReason["timedOut"] = 408)] = "timedOut";
23
+ DisconnectReason[(DisconnectReason["loggedOut"] = 401)] = "loggedOut";
24
+ DisconnectReason[(DisconnectReason["badSession"] = 500)] = "badSession";
25
+ DisconnectReason[(DisconnectReason["restartRequired"] = 515)] =
26
+ "restartRequired";
27
+ DisconnectReason[(DisconnectReason["multideviceMismatch"] = 411)] =
28
+ "multideviceMismatch";
29
+ DisconnectReason[(DisconnectReason["forbidden"] = 403)] = "forbidden";
30
+ DisconnectReason[(DisconnectReason["unavailableService"] = 503)] =
31
+ "unavailableService";
25
32
  })(DisconnectReason || (DisconnectReason = {}));
26
- //# sourceMappingURL=index.js.map
33
+ //# sourceMappingURL=index.js.map
@@ -15,10 +15,5 @@ export declare function makeCacheableSignalKeyStore(store: SignalKeyStore, logge
15
15
  * @returns SignalKeyStore with transaction capability
16
16
  */
17
17
  export declare const addTransactionCapability: (state: SignalKeyStore, logger: ILogger, { maxCommitRetries, delayBetweenTriesMs }: TransactionCapabilityOptions) => SignalKeyStoreWithTransaction;
18
- /**
19
- * Returns the authenticated user's JID, or throws a Boom-401 if creds are not yet authenticated.
20
- * Use this anywhere we'd otherwise reach for `creds.me!.id` to fail fast with a descriptive error.
21
- */
22
- export declare const assertMeId: (creds: AuthenticationCreds) => string;
23
18
  export declare const initAuthCreds: () => AuthenticationCreds;
24
19
  //# sourceMappingURL=auth-utils.d.ts.map
@@ -1,5 +1,4 @@
1
1
  import NodeCache from '@cacheable/node-cache';
2
- import { Boom } from '@hapi/boom';
3
2
  import { AsyncLocalStorage } from 'async_hooks';
4
3
  import { Mutex } from 'async-mutex';
5
4
  import { randomBytes } from 'crypto';
@@ -265,17 +264,6 @@ export const addTransactionCapability = (state, logger, { maxCommitRetries, dela
265
264
  }
266
265
  };
267
266
  };
268
- /**
269
- * Returns the authenticated user's JID, or throws a Boom-401 if creds are not yet authenticated.
270
- * Use this anywhere we'd otherwise reach for `creds.me!.id` to fail fast with a descriptive error.
271
- */
272
- export const assertMeId = (creds) => {
273
- const id = creds.me?.id;
274
- if (!id) {
275
- throw new Boom('Cannot proceed: socket is not authenticated yet (creds.me.id is missing)', { statusCode: 401 });
276
- }
277
- return id;
278
- };
279
267
  export const initAuthCreds = () => {
280
268
  const identityKey = Curve.generateKeyPair();
281
269
  return {
@@ -18,7 +18,6 @@ export const Browsers = {
18
18
  macOS: browser => ['Mac OS', browser, '14.4.1'],
19
19
  baileys: browser => ['Baileys', browser, '6.5.0'],
20
20
  windows: browser => ['Windows', browser, '10.0.22631'],
21
- android: browser => [browser, 'Android', ''],
22
21
  /** The appropriate browser based on your OS & release */
23
22
  appropriate: browser => [PLATFORM_MAP[platform()] || 'Ubuntu', browser, release()]
24
23
  };
@@ -1,10 +1,10 @@
1
1
  import type { KeyPair } from '../Types/index.js';
2
2
  export { md5, hkdf } from 'whatsapp-rust-bridge';
3
3
  /** prefix version byte to the pub keys, required for some curve crypto functions */
4
- export declare const generateSignalPubKey: (pubKey: Uint8Array | Buffer) => Uint8Array<ArrayBufferLike> | Buffer<ArrayBufferLike>;
4
+ export declare const generateSignalPubKey: (pubKey: Uint8Array | Buffer) => Uint8Array<ArrayBufferLike> | Buffer;
5
5
  export declare const Curve: {
6
6
  generateKeyPair: () => KeyPair;
7
- sharedKey: (privateKey: Uint8Array, publicKey: Uint8Array) => Buffer<ArrayBuffer>;
7
+ sharedKey: (privateKey: Uint8Array, publicKey: Uint8Array) => Buffer;
8
8
  sign: (privateKey: Uint8Array, buf: Uint8Array) => Uint8Array<ArrayBufferLike>;
9
9
  verify: (pubKey: Uint8Array, message: Uint8Array, signature: Uint8Array) => boolean;
10
10
  };
@@ -17,21 +17,21 @@ export declare const signedKeyPair: (identityKeyPair: KeyPair, keyId: number) =>
17
17
  * encrypt AES 256 GCM;
18
18
  * where the tag tag is suffixed to the ciphertext
19
19
  * */
20
- export declare function aesEncryptGCM(plaintext: Uint8Array, key: Uint8Array, iv: Uint8Array, additionalData: Uint8Array): Buffer<ArrayBuffer>;
20
+ export declare function aesEncryptGCM(plaintext: Uint8Array, key: Uint8Array, iv: Uint8Array, additionalData: Uint8Array): Buffer;
21
21
  /**
22
22
  * decrypt AES 256 GCM;
23
23
  * where the auth tag is suffixed to the ciphertext
24
24
  * */
25
- export declare function aesDecryptGCM(ciphertext: Uint8Array, key: Uint8Array, iv: Uint8Array, additionalData: Uint8Array): Buffer<ArrayBuffer>;
26
- export declare function aesEncryptCTR(plaintext: Uint8Array, key: Uint8Array, iv: Uint8Array): Buffer<ArrayBuffer>;
27
- export declare function aesDecryptCTR(ciphertext: Uint8Array, key: Uint8Array, iv: Uint8Array): Buffer<ArrayBuffer>;
25
+ export declare function aesDecryptGCM(ciphertext: Uint8Array, key: Uint8Array, iv: Uint8Array, additionalData: Uint8Array): Buffer;
26
+ export declare function aesEncryptCTR(plaintext: Uint8Array, key: Uint8Array, iv: Uint8Array): Buffer;
27
+ export declare function aesDecryptCTR(ciphertext: Uint8Array, key: Uint8Array, iv: Uint8Array): Buffer;
28
28
  /** decrypt AES 256 CBC; where the IV is prefixed to the buffer */
29
- export declare function aesDecrypt(buffer: Uint8Array, key: Uint8Array): Buffer<ArrayBuffer>;
29
+ export declare function aesDecrypt(buffer: Uint8Array, key: Uint8Array): Buffer;
30
30
  /** decrypt AES 256 CBC */
31
- export declare function aesDecryptWithIV(buffer: Uint8Array, key: Uint8Array, IV: Uint8Array): Buffer<ArrayBuffer>;
32
- export declare function aesEncrypt(buffer: Uint8Array, key: Uint8Array): Buffer<ArrayBuffer>;
33
- export declare function aesEncrypWithIV(buffer: Buffer, key: Buffer, IV: Buffer): Buffer<ArrayBuffer>;
34
- export declare function hmacSign(buffer: Buffer | Uint8Array, key: Buffer | Uint8Array, variant?: 'sha256' | 'sha512'): NonSharedBuffer;
35
- export declare function sha256(buffer: Buffer): NonSharedBuffer;
31
+ export declare function aesDecryptWithIV(buffer: Uint8Array, key: Uint8Array, IV: Uint8Array): Buffer;
32
+ export declare function aesEncrypt(buffer: Uint8Array, key: Uint8Array): Buffer;
33
+ export declare function aesEncrypWithIV(buffer: Buffer, key: Buffer, IV: Buffer): Buffer;
34
+ export declare function hmacSign(buffer: Buffer | Uint8Array, key: Buffer | Uint8Array, variant?: 'sha256' | 'sha512'): Buffer;
35
+ export declare function sha256(buffer: Buffer): Buffer;
36
36
  export declare function derivePairingCodeKey(pairingCode: string, salt: Buffer): Promise<Buffer>;
37
37
  //# sourceMappingURL=crypto.d.ts.map
@@ -5,15 +5,12 @@ import type { ILogger } from './logger.js';
5
5
  export declare const getDecryptionJid: (sender: string, repository: SignalRepositoryWithLIDStore) => Promise<string>;
6
6
  export declare const NO_MESSAGE_FOUND_ERROR_TEXT = "Message absent from node";
7
7
  export declare const MISSING_KEYS_ERROR_TEXT = "Key used already or never filled";
8
- export declare const ACCOUNT_RESTRICTED_TEXT = "Your account has been restricted";
9
8
  export declare const DECRYPTION_RETRY_CONFIG: {
10
9
  maxRetries: number;
11
10
  baseDelayMs: number;
12
11
  sessionRecordErrors: string[];
13
12
  };
14
- /** NACK reason codes we send to the server (client → server) */
15
13
  export declare const NACK_REASONS: {
16
- SenderReachoutTimelocked: number;
17
14
  ParsingError: number;
18
15
  UnrecognizedStanza: number;
19
16
  UnrecognizedStanzaClass: number;
@@ -28,21 +25,6 @@ export declare const NACK_REASONS: {
28
25
  UnsupportedLIDGroup: number;
29
26
  DBOperationFailed: number;
30
27
  };
31
- /**
32
- * Server-side error codes returned in ack stanzas (server → client) that we
33
- * currently have dedicated handlers for. Extend as more handlers are added.
34
- * Distinct from the client-side NackReason enum (WAWebCreateNackFromStanza).
35
- */
36
- export declare const SERVER_ERROR_CODES: {
37
- /**
38
- * 1:1 message missing privacy token (tctoken). Usually means the account is
39
- * restricted: WhatsApp blocks starting new chats but preserves existing ones,
40
- * since established chats already carry a tctoken.
41
- */
42
- readonly MessageAccountRestriction: "463";
43
- /** Stanza validation failure (SMAX_INVALID) — likely stale device session */
44
- readonly SmaxInvalid: "479";
45
- };
46
28
  export declare const extractAddressingContext: (stanza: BinaryNode) => {
47
29
  addressingMode: string;
48
30
  senderAlt: string | undefined;
@@ -27,16 +27,13 @@ const storeMappingFromEnvelope = async (stanza, sender, repository, decryptionJi
27
27
  };
28
28
  export const NO_MESSAGE_FOUND_ERROR_TEXT = 'Message absent from node';
29
29
  export const MISSING_KEYS_ERROR_TEXT = 'Key used already or never filled';
30
- export const ACCOUNT_RESTRICTED_TEXT = 'Your account has been restricted';
31
30
  // Retry configuration for failed decryption
32
31
  export const DECRYPTION_RETRY_CONFIG = {
33
32
  maxRetries: 3,
34
33
  baseDelayMs: 100,
35
34
  sessionRecordErrors: ['No session record', 'SessionError: No session record']
36
35
  };
37
- /** NACK reason codes we send to the server (client → server) */
38
36
  export const NACK_REASONS = {
39
- SenderReachoutTimelocked: 463,
40
37
  ParsingError: 487,
41
38
  UnrecognizedStanza: 488,
42
39
  UnrecognizedStanzaClass: 489,
@@ -51,21 +48,6 @@ export const NACK_REASONS = {
51
48
  UnsupportedLIDGroup: 551,
52
49
  DBOperationFailed: 552
53
50
  };
54
- /**
55
- * Server-side error codes returned in ack stanzas (server → client) that we
56
- * currently have dedicated handlers for. Extend as more handlers are added.
57
- * Distinct from the client-side NackReason enum (WAWebCreateNackFromStanza).
58
- */
59
- export const SERVER_ERROR_CODES = {
60
- /**
61
- * 1:1 message missing privacy token (tctoken). Usually means the account is
62
- * restricted: WhatsApp blocks starting new chats but preserves existing ones,
63
- * since established chats already carry a tctoken.
64
- */
65
- MessageAccountRestriction: '463',
66
- /** Stanza validation failure (SMAX_INVALID) — likely stale device session */
67
- SmaxInvalid: '479'
68
- };
69
51
  export const extractAddressingContext = (stanza) => {
70
52
  let senderAlt;
71
53
  let recipientAlt;
@@ -106,12 +88,6 @@ export function decodeMessageNode(stanza, meId, meLid) {
106
88
  const from = stanza.attrs.from;
107
89
  const participant = stanza.attrs.participant;
108
90
  const recipient = stanza.attrs.recipient;
109
- if (!msgId) {
110
- throw new Boom('Invalid message stanza: missing id attribute', { data: stanza });
111
- }
112
- if (!from) {
113
- throw new Boom('Invalid message stanza: missing from attribute', { data: stanza });
114
- }
115
91
  const addressingContext = extractAddressingContext(stanza);
116
92
  const isMe = (jid) => areJidsSameUser(jid, meId);
117
93
  const isMeLid = (jid) => areJidsSameUser(jid, meLid);
@@ -126,12 +102,6 @@ export function decodeMessageNode(stanza, meId, meLid) {
126
102
  chatId = recipient;
127
103
  }
128
104
  else {
129
- // Peer-routed self stanzas (history sync, app-state sync, etc.) arrive
130
- // with `from` set to our own device but no `recipient` attribute —
131
- // still mark as fromMe so self-only protocolMessage handlers run.
132
- if (isMe(from) || isMeLid(from)) {
133
- fromMe = true;
134
- }
135
105
  chatId = from;
136
106
  }
137
107
  msgType = 'chat';
@@ -178,14 +148,10 @@ export function decodeMessageNode(stanza, meId, meLid) {
178
148
  const key = {
179
149
  remoteJid: chatId,
180
150
  remoteJidAlt: !isJidGroup(chatId) ? addressingContext.senderAlt : undefined,
181
- remoteJidUsername: !isJidGroup(chatId)
182
- ? stanza.attrs.peer_recipient_username || stanza.attrs.recipient_username
183
- : undefined,
184
151
  fromMe,
185
152
  id: msgId,
186
153
  participant,
187
154
  participantAlt: isJidGroup(chatId) ? addressingContext.senderAlt : undefined,
188
- participantUsername: stanza.attrs.participant ? stanza.attrs.participant_username : undefined,
189
155
  addressingMode: addressingContext.addressingMode,
190
156
  ...(msgType === 'newsletter' && stanza.attrs.server_id ? { server_id: stanza.attrs.server_id } : {})
191
157
  };
@@ -24,8 +24,6 @@ type BaileysBufferableEventEmitter = BaileysEventEmitter & {
24
24
  flush(): boolean;
25
25
  /** is there an ongoing buffer */
26
26
  isBuffering(): boolean;
27
- /** destroy the event buffer, clearing all resources */
28
- destroy(): void;
29
27
  };
30
28
  /**
31
29
  * The event buffer logically consolidates different events into a single event
@@ -1,4 +1,3 @@
1
- import type Long from 'long';
2
1
  import { proto } from '../../WAProto/index.js';
3
2
  import type { BaileysEventEmitter, BaileysEventMap, ConnectionState, WACallUpdateType, WAMessageKey, WAVersion } from '../Types/index.js';
4
3
  import { type BinaryNode } from '../WABinary/index.js';
@@ -8,10 +7,10 @@ export declare const BufferJSON: {
8
7
  };
9
8
  export declare const getKeyAuthor: (key: WAMessageKey | undefined | null, meId?: string) => string;
10
9
  export declare const isStringNullOrEmpty: (value: string | null | undefined) => value is null | undefined | "";
11
- export declare const writeRandomPadMax16: (msg: Uint8Array) => Buffer<ArrayBuffer>;
10
+ export declare const writeRandomPadMax16: (msg: Uint8Array) => Buffer;
12
11
  export declare const unpadRandomMax16: (e: Uint8Array | Buffer) => Uint8Array<ArrayBuffer>;
13
12
  export declare const generateParticipantHashV2: (participants: string[]) => string;
14
- export declare const encodeWAMessage: (message: proto.IMessage) => Buffer<ArrayBuffer>;
13
+ export declare const encodeWAMessage: (message: proto.IMessage) => Buffer;
15
14
  export declare const generateRegistrationId: () => number;
16
15
  export declare const encodeBigEndian: (e: number, t?: number) => Uint8Array<ArrayBuffer>;
17
16
  export declare const toNumber: (t: Long | number | null | undefined) => number;
@@ -1,7 +1,7 @@
1
1
  import { Boom } from '@hapi/boom';
2
2
  import { createHash, randomBytes } from 'crypto';
3
3
  import { proto } from '../../WAProto/index.js';
4
- const baileysVersion = [2, 3000, 1042637586];
4
+ const baileysVersion = [2, 3000, 1035194821];
5
5
  import { DisconnectReason } from '../Types/index.js';
6
6
  import { getAllBinaryNodeChildren, jidDecode } from '../WABinary/index.js';
7
7
  import { sha256 } from './crypto.js';
@@ -314,15 +314,6 @@ export const getCallStatusFromNode = ({ tag, attrs }) => {
314
314
  status = 'terminate';
315
315
  }
316
316
  break;
317
- case 'preaccept':
318
- status = 'preaccept';
319
- break;
320
- case 'transport':
321
- status = 'transport';
322
- break;
323
- case 'relaylatency':
324
- status = 'relaylatency';
325
- break;
326
317
  case 'reject':
327
318
  status = 'reject';
328
319
  break;
@@ -7,7 +7,6 @@ export declare const processHistoryMessage: (item: proto.IHistorySync, logger?:
7
7
  contacts: Contact[];
8
8
  messages: WAMessage[];
9
9
  lidPnMappings: LIDMapping[];
10
- pastParticipants: proto.IPastParticipants[] | null | undefined;
11
10
  syncType: proto.HistorySync.HistorySyncType | null | undefined;
12
11
  progress: number | null | undefined;
13
12
  };
@@ -16,7 +15,6 @@ export declare const downloadAndProcessHistorySyncNotification: (msg: proto.Mess
16
15
  contacts: Contact[];
17
16
  messages: WAMessage[];
18
17
  lidPnMappings: LIDMapping[];
19
- pastParticipants: proto.IPastParticipants[] | null | undefined;
20
18
  syncType: proto.HistorySync.HistorySyncType | null | undefined;
21
19
  progress: number | null | undefined;
22
20
  }>;
@@ -1,6 +1,5 @@
1
- import { pipeline } from 'stream/promises';
2
1
  import { promisify } from 'util';
3
- import { createInflate, inflate } from 'zlib';
2
+ import { inflate } from 'zlib';
4
3
  import { proto } from '../../WAProto/index.js';
5
4
  import { WAMessageStubType } from '../Types/index.js';
6
5
  import { isHostedLidUser, isHostedPnUser, isLidUser, isPnUser } from '../WABinary/index.js';
@@ -25,13 +24,13 @@ const extractPnFromMessages = (messages) => {
25
24
  };
26
25
  export const downloadHistory = async (msg, options) => {
27
26
  const stream = await downloadContentFromMessage(msg, 'md-msg-hist', { options });
28
- // Pipe decrypted stream directly through zlib inflate
29
- // This avoids allocating an intermediate buffer for the compressed data
30
- const inflater = createInflate();
31
- const chunks = [];
32
- inflater.on('data', (chunk) => chunks.push(chunk));
33
- await pipeline(stream, inflater);
34
- const buffer = Buffer.concat(chunks);
27
+ const bufferArray = [];
28
+ for await (const chunk of stream) {
29
+ bufferArray.push(chunk);
30
+ }
31
+ let buffer = Buffer.concat(bufferArray);
32
+ // decompress buffer
33
+ buffer = await inflatePromise(buffer);
35
34
  const syncData = proto.HistorySync.decode(buffer);
36
35
  return syncData;
37
36
  };
@@ -56,7 +55,6 @@ export const processHistoryMessage = (item, logger) => {
56
55
  contacts.push({
57
56
  id: chat.id,
58
57
  name: chat.displayName || chat.name || chat.username || undefined,
59
- username: chat.username || undefined,
60
58
  lid: chat.lidJid || chat.accountLid || undefined,
61
59
  phoneNumber: chat.pnJid || undefined
62
60
  });
@@ -97,7 +95,7 @@ export const processHistoryMessage = (item, logger) => {
97
95
  });
98
96
  }
99
97
  }
100
- chats.push(chat);
98
+ chats.push({ ...chat });
101
99
  }
102
100
  break;
103
101
  case proto.HistorySync.HistorySyncType.PUSH_NAME:
@@ -111,7 +109,6 @@ export const processHistoryMessage = (item, logger) => {
111
109
  contacts,
112
110
  messages,
113
111
  lidPnMappings,
114
- pastParticipants: item.pastParticipants,
115
112
  syncType: item.syncType,
116
113
  progress: item.progress
117
114
  };
@@ -32,13 +32,6 @@ export type IdentityChangeContext = {
32
32
  assertSessions: (jids: string[], force?: boolean) => Promise<boolean>;
33
33
  debounceCache: NodeCache<boolean>;
34
34
  logger: ILogger;
35
- /**
36
- * Invoked right before `assertSessions` is called for an existing-session identity change.
37
- * Used to kick off fire-and-forget side effects (e.g. tctoken re-issuance) in the same
38
- * order WA Web does — i.e. before the E2E session is re-established.
39
- * Must not throw; implementations are responsible for their own error handling.
40
- */
41
- onBeforeSessionRefresh?: (jid: string) => void;
42
35
  };
43
36
  export declare function handleIdentityChange(node: BinaryNode, ctx: IdentityChangeContext): Promise<IdentityChangeResult>;
44
37
  //# sourceMappingURL=identity-change-handler.d.ts.map
@@ -37,7 +37,6 @@ export async function handleIdentityChange(node, ctx) {
37
37
  ctx.logger.debug({ jid: from }, 'skipping session refresh during offline processing');
38
38
  return { action: 'skipped_offline' };
39
39
  }
40
- ctx.onBeforeSessionRefresh?.(from);
41
40
  try {
42
41
  await ctx.assertSessions([from], true);
43
42
  return { action: 'session_refreshed' };
@@ -1,30 +1,23 @@
1
- export * from './generics.js';
2
- export * from './decode-wa-message.js';
3
- export * from './messages.js';
4
- export * from './messages-media.js';
5
- export * from './validate-connection.js';
6
- export * from './crypto.js';
7
- export * from './signal.js';
8
- export * from './noise-handler.js';
9
- export * from './history.js';
10
- export * from './chat-utils.js';
11
- export * from './lt-hash.js';
12
- export * from './auth-utils.js';
13
- export * from './use-multi-file-auth-state.js';
14
- export * from './use-single-file-auth-state.js';
15
- export * from './use-sqlite-auth-state.js';
16
- export * from './link-preview.js';
17
- export * from './event-buffer.js';
18
- export * from './process-message.js';
19
- export * from './message-retry-manager.js';
20
- export * from './browser-utils.js';
21
- export * from './companion-reg-client-utils.js';
22
- export * from './identity-change-handler.js';
23
- export * from './stanza-ack.js';
24
- export * from './message-composer.js';
25
- export * from './messages-newsletter.js';
26
- export * from './shortcake-crypto.js';
27
- export * from './shortcake.js';
28
- export * from './interactive.js';
29
- export * from './button-handler.js';
30
- //# sourceMappingURL=index.d.ts.map
1
+ export * from "./generics.js";
2
+ export * from "./decode-wa-message.js";
3
+ export * from "./messages.js";
4
+ export * from "./messages-media.js";
5
+ export * from "./validate-connection.js";
6
+ export * from "./crypto.js";
7
+ export * from "./signal.js";
8
+ export * from "./noise-handler.js";
9
+ export * from "./history.js";
10
+ export * from "./chat-utils.js";
11
+ export * from "./lt-hash.js";
12
+ export * from "./auth-utils.js";
13
+ export * from "./use-multi-file-auth-state.js";
14
+ export * from "./link-preview.js";
15
+ export * from "./event-buffer.js";
16
+ export * from "./process-message.js";
17
+ export * from "./message-retry-manager.js";
18
+ export * from "./browser-utils.js";
19
+ export * from "./identity-change-handler.js";
20
+ export * from "./stanza-ack.js";
21
+ export * from "./rich-messages.js";
22
+ export * from "./sticker-pack.js";
23
+ //# sourceMappingURL=index.d.ts.map
@@ -11,20 +11,14 @@ export * from './chat-utils.js';
11
11
  export * from './lt-hash.js';
12
12
  export * from './auth-utils.js';
13
13
  export * from './use-multi-file-auth-state.js';
14
- export * from './use-single-file-auth-state.js';
15
- export * from './use-sqlite-auth-state.js';
16
14
  export * from './link-preview.js';
17
15
  export * from './event-buffer.js';
18
16
  export * from './process-message.js';
19
17
  export * from './message-retry-manager.js';
20
18
  export * from './browser-utils.js';
21
- export * from './companion-reg-client-utils.js';
22
19
  export * from './identity-change-handler.js';
23
20
  export * from './stanza-ack.js';
24
- export * from './message-composer.js';
25
- export * from './messages-newsletter.js';
26
- export * from './shortcake-crypto.js';
27
- export * from './shortcake.js';
28
- export * from './interactive.js';
29
- export * from './button-handler.js';
21
+ export * from './companion-reg-client-utils.js';
22
+ export * from './rich-messages.js';
23
+ export * from './sticker-pack.js';
30
24
  //# sourceMappingURL=index.js.map
@@ -19,7 +19,7 @@ export const getUrlInfo = async (text, opts = {
19
19
  }) => {
20
20
  try {
21
21
  // retries
22
- let retries = 0;
22
+ const retries = 0;
23
23
  const maxRetry = 5;
24
24
  const { getLinkPreview } = await import('link-preview-js');
25
25
  let previewLink = text;
@@ -38,7 +38,7 @@ export const getUrlInfo = async (text, opts = {
38
38
  if (forwardedURLObj.hostname === urlObj.hostname ||
39
39
  forwardedURLObj.hostname === 'www.' + urlObj.hostname ||
40
40
  'www.' + forwardedURLObj.hostname === urlObj.hostname) {
41
- retries += 1;
41
+ retries + 1;
42
42
  return true;
43
43
  }
44
44
  else {