lordceaser-baileys 2.0.37 → 2.0.39

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 (439) hide show
  1. package/LICENSE +1 -1
  2. package/README.md +660 -1073
  3. package/WAProto/GenerateStatics.sh +4 -3
  4. package/WAProto/WAProto.proto +359 -2494
  5. package/WAProto/index.d.ts +31460 -8461
  6. package/WAProto/index.js +96236 -92883
  7. package/WASignalGroup/GroupProtocol.js +1697 -0
  8. package/WASignalGroup/ciphertext_message.js +16 -0
  9. package/WASignalGroup/group_cipher.js +120 -0
  10. package/WASignalGroup/group_session_builder.js +46 -0
  11. package/WASignalGroup/index.js +5 -0
  12. package/WASignalGroup/keyhelper.js +21 -0
  13. package/WASignalGroup/protobufs.js +3 -0
  14. package/WASignalGroup/queue_job.js +69 -0
  15. package/WASignalGroup/sender_chain_key.js +50 -0
  16. package/WASignalGroup/sender_key_distribution_message.js +78 -0
  17. package/WASignalGroup/sender_key_message.js +92 -0
  18. package/WASignalGroup/sender_key_name.js +70 -0
  19. package/WASignalGroup/sender_key_record.js +56 -0
  20. package/WASignalGroup/sender_key_state.js +129 -0
  21. package/{lib/Signal/Group/sender-message-key.js → WASignalGroup/sender_message_key.js} +16 -3
  22. package/lib/Defaults/baileys-version.json +3 -0
  23. package/lib/Defaults/index.d.ts +245 -37
  24. package/lib/Defaults/index.js +74 -82
  25. package/lib/Defaults/phonenumber-mcc.json +223 -0
  26. package/lib/Signal/libsignal.d.ts +3 -5
  27. package/lib/Signal/libsignal.js +80 -359
  28. package/lib/Socket/Client/{types.d.ts → abstract-socket-client.d.ts} +5 -4
  29. package/lib/Socket/Client/abstract-socket-client.js +13 -0
  30. package/lib/Socket/Client/index.d.ts +3 -3
  31. package/lib/Socket/Client/index.js +19 -3
  32. package/lib/Socket/Client/mobile-socket-client.d.ts +13 -0
  33. package/lib/Socket/Client/mobile-socket-client.js +65 -0
  34. package/lib/Socket/Client/{websocket.d.ts → web-socket-client.d.ts} +2 -3
  35. package/lib/Socket/Client/web-socket-client.js +62 -0
  36. package/lib/Socket/business.d.ts +87 -156
  37. package/lib/Socket/business.js +43 -162
  38. package/lib/Socket/chats.d.ts +40 -82
  39. package/lib/Socket/chats.js +284 -603
  40. package/lib/Socket/groups.d.ts +58 -96
  41. package/lib/Socket/groups.js +82 -115
  42. package/lib/Socket/index.d.ts +94 -204
  43. package/lib/Socket/index.js +9 -11
  44. package/lib/Socket/messages-recv.d.ts +77 -145
  45. package/lib/Socket/messages-recv.js +400 -1305
  46. package/lib/Socket/messages-send.d.ts +70 -141
  47. package/lib/Socket/messages-send.js +249 -717
  48. package/lib/Socket/registration.d.ts +242 -0
  49. package/lib/Socket/registration.js +166 -0
  50. package/lib/Socket/socket.d.ts +18 -34
  51. package/lib/Socket/socket.js +206 -557
  52. package/lib/Store/index.d.ts +3 -0
  53. package/lib/Store/index.js +10 -0
  54. package/lib/Store/make-cache-manager-store.d.ts +14 -0
  55. package/lib/Store/make-cache-manager-store.js +83 -0
  56. package/lib/Store/make-in-memory-store.d.ts +118 -0
  57. package/lib/Store/make-in-memory-store.js +422 -0
  58. package/lib/Store/make-ordered-dictionary.d.ts +13 -0
  59. package/lib/Store/make-ordered-dictionary.js +81 -0
  60. package/lib/Store/object-repository.d.ts +10 -0
  61. package/lib/Store/object-repository.js +27 -0
  62. package/lib/Types/Auth.d.ts +12 -19
  63. package/lib/Types/Auth.js +2 -2
  64. package/lib/Types/Call.d.ts +1 -3
  65. package/lib/Types/Call.js +2 -2
  66. package/lib/Types/Chat.d.ts +14 -31
  67. package/lib/Types/Chat.js +4 -8
  68. package/lib/Types/Contact.d.ts +1 -8
  69. package/lib/Types/Contact.js +2 -2
  70. package/lib/Types/Events.d.ts +17 -101
  71. package/lib/Types/Events.js +2 -2
  72. package/lib/Types/GroupMetadata.d.ts +3 -18
  73. package/lib/Types/GroupMetadata.js +2 -2
  74. package/lib/Types/Label.d.ts +0 -1
  75. package/lib/Types/Label.js +5 -3
  76. package/lib/Types/LabelAssociation.d.ts +0 -1
  77. package/lib/Types/LabelAssociation.js +5 -3
  78. package/lib/Types/Message.d.ts +29 -81
  79. package/lib/Types/Message.js +9 -11
  80. package/lib/Types/Product.d.ts +1 -2
  81. package/lib/Types/Product.js +2 -2
  82. package/lib/Types/Signal.d.ts +2 -32
  83. package/lib/Types/Signal.js +2 -2
  84. package/lib/Types/Socket.d.ts +26 -46
  85. package/lib/Types/Socket.js +2 -3
  86. package/lib/Types/State.d.ts +2 -72
  87. package/lib/Types/State.js +2 -56
  88. package/lib/Types/index.d.ts +13 -16
  89. package/lib/Types/index.js +30 -15
  90. package/lib/Utils/auth-utils.d.ts +6 -12
  91. package/lib/Utils/auth-utils.js +143 -239
  92. package/lib/Utils/baileys-event-stream.d.ts +16 -0
  93. package/lib/Utils/baileys-event-stream.js +63 -0
  94. package/lib/Utils/business.d.ts +2 -3
  95. package/lib/Utils/business.js +69 -66
  96. package/lib/Utils/chat-utils.d.ts +23 -52
  97. package/lib/Utils/chat-utils.js +248 -380
  98. package/lib/Utils/crypto.d.ts +21 -17
  99. package/lib/Utils/crypto.js +92 -57
  100. package/lib/Utils/decode-wa-message.d.ts +8 -54
  101. package/lib/Utils/decode-wa-message.js +57 -186
  102. package/lib/Utils/event-buffer.d.ts +8 -9
  103. package/lib/Utils/event-buffer.js +76 -178
  104. package/lib/Utils/generics.d.ts +23 -26
  105. package/lib/Utils/generics.js +166 -165
  106. package/lib/Utils/history.d.ts +11 -16
  107. package/lib/Utils/history.js +53 -93
  108. package/lib/Utils/index.d.ts +17 -22
  109. package/lib/Utils/index.js +33 -22
  110. package/lib/Utils/link-preview.d.ts +5 -5
  111. package/lib/Utils/link-preview.js +24 -16
  112. package/lib/Utils/logger.d.ts +3 -11
  113. package/lib/Utils/logger.js +7 -3
  114. package/lib/Utils/lt-hash.d.ts +12 -8
  115. package/lib/Utils/lt-hash.js +46 -3
  116. package/lib/Utils/make-mutex.d.ts +2 -4
  117. package/lib/Utils/make-mutex.js +34 -24
  118. package/lib/Utils/messages-media.d.ts +35 -61
  119. package/lib/Utils/messages-media.js +301 -415
  120. package/lib/Utils/messages.d.ts +18 -32
  121. package/lib/Utils/messages.js +261 -396
  122. package/lib/Utils/noise-handler.d.ts +13 -12
  123. package/lib/Utils/noise-handler.js +98 -144
  124. package/lib/Utils/process-message.d.ts +12 -30
  125. package/lib/Utils/process-message.js +163 -439
  126. package/lib/Utils/signal.d.ts +5 -20
  127. package/lib/Utils/signal.js +74 -114
  128. package/lib/Utils/use-multi-file-auth-state.d.ts +1 -2
  129. package/lib/Utils/use-multi-file-auth-state.js +33 -61
  130. package/lib/Utils/validate-connection.d.ts +6 -6
  131. package/lib/Utils/validate-connection.js +114 -119
  132. package/lib/WABinary/constants.d.ts +4 -5
  133. package/lib/WABinary/constants.js +20 -1281
  134. package/lib/WABinary/decode.d.ts +4 -4
  135. package/lib/WABinary/decode.js +43 -51
  136. package/lib/WABinary/encode.d.ts +3 -3
  137. package/lib/WABinary/encode.js +44 -32
  138. package/lib/WABinary/generic-utils.d.ts +6 -6
  139. package/lib/WABinary/generic-utils.js +43 -46
  140. package/lib/WABinary/index.d.ts +5 -6
  141. package/lib/WABinary/index.js +21 -6
  142. package/lib/WABinary/jid-utils.d.ts +6 -23
  143. package/lib/WABinary/jid-utils.js +39 -73
  144. package/lib/WABinary/types.d.ts +1 -2
  145. package/lib/WABinary/types.js +2 -2
  146. package/lib/WAM/BinaryInfo.d.ts +11 -3
  147. package/lib/WAM/BinaryInfo.js +5 -2
  148. package/lib/WAM/constants.d.ts +3 -5
  149. package/lib/WAM/constants.js +11958 -19461
  150. package/lib/WAM/encode.d.ts +3 -3
  151. package/lib/WAM/encode.js +22 -17
  152. package/lib/WAM/index.d.ts +3 -4
  153. package/lib/WAM/index.js +19 -4
  154. package/lib/index.d.ts +8 -9
  155. package/lib/index.js +30 -11
  156. package/package.json +2 -2
  157. package/WAProto/WAProto/GenerateStatics.sh +0 -3
  158. package/WAProto/WAProto/WAProto.proto +0 -5479
  159. package/WAProto/WAProto/fix-imports.js +0 -85
  160. package/WAProto/WAProto/index.d.ts +0 -14017
  161. package/WAProto/WAProto/index.js +0 -97691
  162. package/WAProto/fix-imports.js +0 -85
  163. package/lib/Defaults/index.d.ts.map +0 -1
  164. package/lib/Defaults/index.js.map +0 -1
  165. package/lib/Signal/Group/ciphertext-message.d.ts +0 -10
  166. package/lib/Signal/Group/ciphertext-message.d.ts.map +0 -1
  167. package/lib/Signal/Group/ciphertext-message.js +0 -12
  168. package/lib/Signal/Group/ciphertext-message.js.map +0 -1
  169. package/lib/Signal/Group/group-session-builder.d.ts +0 -15
  170. package/lib/Signal/Group/group-session-builder.d.ts.map +0 -1
  171. package/lib/Signal/Group/group-session-builder.js +0 -30
  172. package/lib/Signal/Group/group-session-builder.js.map +0 -1
  173. package/lib/Signal/Group/group_cipher.d.ts +0 -17
  174. package/lib/Signal/Group/group_cipher.d.ts.map +0 -1
  175. package/lib/Signal/Group/group_cipher.js +0 -82
  176. package/lib/Signal/Group/group_cipher.js.map +0 -1
  177. package/lib/Signal/Group/index.d.ts +0 -12
  178. package/lib/Signal/Group/index.d.ts.map +0 -1
  179. package/lib/Signal/Group/index.js +0 -12
  180. package/lib/Signal/Group/index.js.map +0 -1
  181. package/lib/Signal/Group/keyhelper.d.ts +0 -11
  182. package/lib/Signal/Group/keyhelper.d.ts.map +0 -1
  183. package/lib/Signal/Group/keyhelper.js +0 -18
  184. package/lib/Signal/Group/keyhelper.js.map +0 -1
  185. package/lib/Signal/Group/sender-chain-key.d.ts +0 -14
  186. package/lib/Signal/Group/sender-chain-key.d.ts.map +0 -1
  187. package/lib/Signal/Group/sender-chain-key.js +0 -26
  188. package/lib/Signal/Group/sender-chain-key.js.map +0 -1
  189. package/lib/Signal/Group/sender-key-distribution-message.d.ts +0 -17
  190. package/lib/Signal/Group/sender-key-distribution-message.d.ts.map +0 -1
  191. package/lib/Signal/Group/sender-key-distribution-message.js +0 -63
  192. package/lib/Signal/Group/sender-key-distribution-message.js.map +0 -1
  193. package/lib/Signal/Group/sender-key-message.d.ts +0 -19
  194. package/lib/Signal/Group/sender-key-message.d.ts.map +0 -1
  195. package/lib/Signal/Group/sender-key-message.js +0 -66
  196. package/lib/Signal/Group/sender-key-message.js.map +0 -1
  197. package/lib/Signal/Group/sender-key-name.d.ts +0 -18
  198. package/lib/Signal/Group/sender-key-name.d.ts.map +0 -1
  199. package/lib/Signal/Group/sender-key-name.js +0 -48
  200. package/lib/Signal/Group/sender-key-name.js.map +0 -1
  201. package/lib/Signal/Group/sender-key-record.d.ts +0 -31
  202. package/lib/Signal/Group/sender-key-record.d.ts.map +0 -1
  203. package/lib/Signal/Group/sender-key-record.js +0 -41
  204. package/lib/Signal/Group/sender-key-record.js.map +0 -1
  205. package/lib/Signal/Group/sender-key-state.d.ts +0 -39
  206. package/lib/Signal/Group/sender-key-state.d.ts.map +0 -1
  207. package/lib/Signal/Group/sender-key-state.js +0 -84
  208. package/lib/Signal/Group/sender-key-state.js.map +0 -1
  209. package/lib/Signal/Group/sender-message-key.d.ts +0 -12
  210. package/lib/Signal/Group/sender-message-key.d.ts.map +0 -1
  211. package/lib/Signal/Group/sender-message-key.js.map +0 -1
  212. package/lib/Signal/libsignal.d.ts.map +0 -1
  213. package/lib/Signal/libsignal.js.map +0 -1
  214. package/lib/Signal/lid-mapping.d.ts +0 -23
  215. package/lib/Signal/lid-mapping.d.ts.map +0 -1
  216. package/lib/Signal/lid-mapping.js +0 -277
  217. package/lib/Signal/lid-mapping.js.map +0 -1
  218. package/lib/Socket/Client/index.d.ts.map +0 -1
  219. package/lib/Socket/Client/index.js.map +0 -1
  220. package/lib/Socket/Client/types.d.ts.map +0 -1
  221. package/lib/Socket/Client/types.js +0 -11
  222. package/lib/Socket/Client/types.js.map +0 -1
  223. package/lib/Socket/Client/websocket.d.ts.map +0 -1
  224. package/lib/Socket/Client/websocket.js +0 -54
  225. package/lib/Socket/Client/websocket.js.map +0 -1
  226. package/lib/Socket/business.d.ts.map +0 -1
  227. package/lib/Socket/business.js.map +0 -1
  228. package/lib/Socket/chats.d.ts.map +0 -1
  229. package/lib/Socket/chats.js.map +0 -1
  230. package/lib/Socket/communities.d.ts +0 -273
  231. package/lib/Socket/communities.d.ts.map +0 -1
  232. package/lib/Socket/communities.js +0 -431
  233. package/lib/Socket/communities.js.map +0 -1
  234. package/lib/Socket/groups.d.ts.map +0 -1
  235. package/lib/Socket/groups.js.map +0 -1
  236. package/lib/Socket/index.d.ts.map +0 -1
  237. package/lib/Socket/index.js.map +0 -1
  238. package/lib/Socket/messages-recv.d.ts.map +0 -1
  239. package/lib/Socket/messages-recv.js.map +0 -1
  240. package/lib/Socket/messages-send.d.ts.map +0 -1
  241. package/lib/Socket/messages-send.js.map +0 -1
  242. package/lib/Socket/mex.d.ts +0 -3
  243. package/lib/Socket/mex.d.ts.map +0 -1
  244. package/lib/Socket/mex.js +0 -42
  245. package/lib/Socket/mex.js.map +0 -1
  246. package/lib/Socket/newsletter.d.ts +0 -170
  247. package/lib/Socket/newsletter.d.ts.map +0 -1
  248. package/lib/Socket/newsletter.js +0 -181
  249. package/lib/Socket/newsletter.js.map +0 -1
  250. package/lib/Socket/socket.d.ts.map +0 -1
  251. package/lib/Socket/socket.js.map +0 -1
  252. package/lib/Types/Auth.d.ts.map +0 -1
  253. package/lib/Types/Auth.js.map +0 -1
  254. package/lib/Types/Bussines.d.ts +0 -25
  255. package/lib/Types/Bussines.d.ts.map +0 -1
  256. package/lib/Types/Bussines.js +0 -2
  257. package/lib/Types/Bussines.js.map +0 -1
  258. package/lib/Types/Call.d.ts.map +0 -1
  259. package/lib/Types/Call.js.map +0 -1
  260. package/lib/Types/Chat.d.ts.map +0 -1
  261. package/lib/Types/Chat.js.map +0 -1
  262. package/lib/Types/Contact.d.ts.map +0 -1
  263. package/lib/Types/Contact.js.map +0 -1
  264. package/lib/Types/Events.d.ts.map +0 -1
  265. package/lib/Types/Events.js.map +0 -1
  266. package/lib/Types/GroupMetadata.d.ts.map +0 -1
  267. package/lib/Types/GroupMetadata.js.map +0 -1
  268. package/lib/Types/Label.d.ts.map +0 -1
  269. package/lib/Types/Label.js.map +0 -1
  270. package/lib/Types/LabelAssociation.d.ts.map +0 -1
  271. package/lib/Types/LabelAssociation.js.map +0 -1
  272. package/lib/Types/Message.d.ts.map +0 -1
  273. package/lib/Types/Message.js.map +0 -1
  274. package/lib/Types/Mex.d.ts +0 -141
  275. package/lib/Types/Mex.d.ts.map +0 -1
  276. package/lib/Types/Mex.js +0 -37
  277. package/lib/Types/Mex.js.map +0 -1
  278. package/lib/Types/Product.d.ts.map +0 -1
  279. package/lib/Types/Product.js.map +0 -1
  280. package/lib/Types/Signal.d.ts.map +0 -1
  281. package/lib/Types/Signal.js.map +0 -1
  282. package/lib/Types/Socket.d.ts.map +0 -1
  283. package/lib/Types/Socket.js.map +0 -1
  284. package/lib/Types/State.d.ts.map +0 -1
  285. package/lib/Types/State.js.map +0 -1
  286. package/lib/Types/USync.d.ts +0 -26
  287. package/lib/Types/USync.d.ts.map +0 -1
  288. package/lib/Types/USync.js +0 -2
  289. package/lib/Types/USync.js.map +0 -1
  290. package/lib/Types/index.d.ts.map +0 -1
  291. package/lib/Types/index.js.map +0 -1
  292. package/lib/Utils/auth-utils.d.ts.map +0 -1
  293. package/lib/Utils/auth-utils.js.map +0 -1
  294. package/lib/Utils/browser-utils.d.ts +0 -4
  295. package/lib/Utils/browser-utils.d.ts.map +0 -1
  296. package/lib/Utils/browser-utils.js +0 -29
  297. package/lib/Utils/browser-utils.js.map +0 -1
  298. package/lib/Utils/business.d.ts.map +0 -1
  299. package/lib/Utils/business.js.map +0 -1
  300. package/lib/Utils/chat-utils.d.ts.map +0 -1
  301. package/lib/Utils/chat-utils.js.map +0 -1
  302. package/lib/Utils/companion-reg-client-utils.d.ts +0 -17
  303. package/lib/Utils/companion-reg-client-utils.d.ts.map +0 -1
  304. package/lib/Utils/companion-reg-client-utils.js +0 -35
  305. package/lib/Utils/companion-reg-client-utils.js.map +0 -1
  306. package/lib/Utils/crypto.d.ts.map +0 -1
  307. package/lib/Utils/crypto.js.map +0 -1
  308. package/lib/Utils/decode-wa-message.d.ts.map +0 -1
  309. package/lib/Utils/decode-wa-message.js.map +0 -1
  310. package/lib/Utils/event-buffer.d.ts.map +0 -1
  311. package/lib/Utils/event-buffer.js.map +0 -1
  312. package/lib/Utils/generics.d.ts.map +0 -1
  313. package/lib/Utils/generics.js.map +0 -1
  314. package/lib/Utils/history.d.ts.map +0 -1
  315. package/lib/Utils/history.js.map +0 -1
  316. package/lib/Utils/identity-change-handler.d.ts +0 -44
  317. package/lib/Utils/identity-change-handler.d.ts.map +0 -1
  318. package/lib/Utils/identity-change-handler.js +0 -50
  319. package/lib/Utils/identity-change-handler.js.map +0 -1
  320. package/lib/Utils/index.d.ts.map +0 -1
  321. package/lib/Utils/index.js.map +0 -1
  322. package/lib/Utils/link-preview.d.ts.map +0 -1
  323. package/lib/Utils/link-preview.js.map +0 -1
  324. package/lib/Utils/logger.d.ts.map +0 -1
  325. package/lib/Utils/logger.js.map +0 -1
  326. package/lib/Utils/lt-hash.d.ts.map +0 -1
  327. package/lib/Utils/lt-hash.js.map +0 -1
  328. package/lib/Utils/make-mutex.d.ts.map +0 -1
  329. package/lib/Utils/make-mutex.js.map +0 -1
  330. package/lib/Utils/message-retry-manager.d.ts +0 -115
  331. package/lib/Utils/message-retry-manager.d.ts.map +0 -1
  332. package/lib/Utils/message-retry-manager.js +0 -265
  333. package/lib/Utils/message-retry-manager.js.map +0 -1
  334. package/lib/Utils/messages-media.d.ts.map +0 -1
  335. package/lib/Utils/messages-media.js.map +0 -1
  336. package/lib/Utils/messages.d.ts.map +0 -1
  337. package/lib/Utils/messages.js.map +0 -1
  338. package/lib/Utils/noise-handler.d.ts.map +0 -1
  339. package/lib/Utils/noise-handler.js.map +0 -1
  340. package/lib/Utils/offline-node-processor.d.ts +0 -17
  341. package/lib/Utils/offline-node-processor.d.ts.map +0 -1
  342. package/lib/Utils/offline-node-processor.js +0 -40
  343. package/lib/Utils/offline-node-processor.js.map +0 -1
  344. package/lib/Utils/pre-key-manager.d.ts +0 -28
  345. package/lib/Utils/pre-key-manager.d.ts.map +0 -1
  346. package/lib/Utils/pre-key-manager.js +0 -106
  347. package/lib/Utils/pre-key-manager.js.map +0 -1
  348. package/lib/Utils/process-message.d.ts.map +0 -1
  349. package/lib/Utils/process-message.js.map +0 -1
  350. package/lib/Utils/reporting-utils.d.ts +0 -11
  351. package/lib/Utils/reporting-utils.d.ts.map +0 -1
  352. package/lib/Utils/reporting-utils.js +0 -258
  353. package/lib/Utils/reporting-utils.js.map +0 -1
  354. package/lib/Utils/signal.d.ts.map +0 -1
  355. package/lib/Utils/signal.js.map +0 -1
  356. package/lib/Utils/stanza-ack.d.ts +0 -11
  357. package/lib/Utils/stanza-ack.d.ts.map +0 -1
  358. package/lib/Utils/stanza-ack.js +0 -38
  359. package/lib/Utils/stanza-ack.js.map +0 -1
  360. package/lib/Utils/sync-action-utils.d.ts +0 -19
  361. package/lib/Utils/sync-action-utils.d.ts.map +0 -1
  362. package/lib/Utils/sync-action-utils.js +0 -49
  363. package/lib/Utils/sync-action-utils.js.map +0 -1
  364. package/lib/Utils/tc-token-utils.d.ts +0 -37
  365. package/lib/Utils/tc-token-utils.d.ts.map +0 -1
  366. package/lib/Utils/tc-token-utils.js +0 -164
  367. package/lib/Utils/tc-token-utils.js.map +0 -1
  368. package/lib/Utils/use-multi-file-auth-state.d.ts.map +0 -1
  369. package/lib/Utils/use-multi-file-auth-state.js.map +0 -1
  370. package/lib/Utils/validate-connection.d.ts.map +0 -1
  371. package/lib/Utils/validate-connection.js.map +0 -1
  372. package/lib/WABinary/constants.d.ts.map +0 -1
  373. package/lib/WABinary/constants.js.map +0 -1
  374. package/lib/WABinary/decode.d.ts.map +0 -1
  375. package/lib/WABinary/decode.js.map +0 -1
  376. package/lib/WABinary/encode.d.ts.map +0 -1
  377. package/lib/WABinary/encode.js.map +0 -1
  378. package/lib/WABinary/generic-utils.d.ts.map +0 -1
  379. package/lib/WABinary/generic-utils.js.map +0 -1
  380. package/lib/WABinary/index.d.ts.map +0 -1
  381. package/lib/WABinary/index.js.map +0 -1
  382. package/lib/WABinary/jid-utils.d.ts.map +0 -1
  383. package/lib/WABinary/jid-utils.js.map +0 -1
  384. package/lib/WABinary/types.d.ts.map +0 -1
  385. package/lib/WABinary/types.js.map +0 -1
  386. package/lib/WAM/BinaryInfo.d.ts.map +0 -1
  387. package/lib/WAM/BinaryInfo.js.map +0 -1
  388. package/lib/WAM/constants.d.ts.map +0 -1
  389. package/lib/WAM/constants.js.map +0 -1
  390. package/lib/WAM/encode.d.ts.map +0 -1
  391. package/lib/WAM/encode.js.map +0 -1
  392. package/lib/WAM/index.d.ts.map +0 -1
  393. package/lib/WAM/index.js.map +0 -1
  394. package/lib/WAUSync/Protocols/USyncContactProtocol.d.ts +0 -10
  395. package/lib/WAUSync/Protocols/USyncContactProtocol.d.ts.map +0 -1
  396. package/lib/WAUSync/Protocols/USyncContactProtocol.js +0 -52
  397. package/lib/WAUSync/Protocols/USyncContactProtocol.js.map +0 -1
  398. package/lib/WAUSync/Protocols/USyncDeviceProtocol.d.ts +0 -23
  399. package/lib/WAUSync/Protocols/USyncDeviceProtocol.d.ts.map +0 -1
  400. package/lib/WAUSync/Protocols/USyncDeviceProtocol.js +0 -54
  401. package/lib/WAUSync/Protocols/USyncDeviceProtocol.js.map +0 -1
  402. package/lib/WAUSync/Protocols/USyncDisappearingModeProtocol.d.ts +0 -13
  403. package/lib/WAUSync/Protocols/USyncDisappearingModeProtocol.d.ts.map +0 -1
  404. package/lib/WAUSync/Protocols/USyncDisappearingModeProtocol.js +0 -27
  405. package/lib/WAUSync/Protocols/USyncDisappearingModeProtocol.js.map +0 -1
  406. package/lib/WAUSync/Protocols/USyncStatusProtocol.d.ts +0 -13
  407. package/lib/WAUSync/Protocols/USyncStatusProtocol.d.ts.map +0 -1
  408. package/lib/WAUSync/Protocols/USyncStatusProtocol.js +0 -38
  409. package/lib/WAUSync/Protocols/USyncStatusProtocol.js.map +0 -1
  410. package/lib/WAUSync/Protocols/USyncUsernameProtocol.d.ts +0 -10
  411. package/lib/WAUSync/Protocols/USyncUsernameProtocol.d.ts.map +0 -1
  412. package/lib/WAUSync/Protocols/USyncUsernameProtocol.js +0 -25
  413. package/lib/WAUSync/Protocols/USyncUsernameProtocol.js.map +0 -1
  414. package/lib/WAUSync/Protocols/UsyncBotProfileProtocol.d.ts +0 -26
  415. package/lib/WAUSync/Protocols/UsyncBotProfileProtocol.d.ts.map +0 -1
  416. package/lib/WAUSync/Protocols/UsyncBotProfileProtocol.js +0 -51
  417. package/lib/WAUSync/Protocols/UsyncBotProfileProtocol.js.map +0 -1
  418. package/lib/WAUSync/Protocols/UsyncLIDProtocol.d.ts +0 -10
  419. package/lib/WAUSync/Protocols/UsyncLIDProtocol.d.ts.map +0 -1
  420. package/lib/WAUSync/Protocols/UsyncLIDProtocol.js +0 -29
  421. package/lib/WAUSync/Protocols/UsyncLIDProtocol.js.map +0 -1
  422. package/lib/WAUSync/Protocols/index.d.ts +0 -6
  423. package/lib/WAUSync/Protocols/index.d.ts.map +0 -1
  424. package/lib/WAUSync/Protocols/index.js +0 -6
  425. package/lib/WAUSync/Protocols/index.js.map +0 -1
  426. package/lib/WAUSync/USyncQuery.d.ts +0 -30
  427. package/lib/WAUSync/USyncQuery.d.ts.map +0 -1
  428. package/lib/WAUSync/USyncQuery.js +0 -98
  429. package/lib/WAUSync/USyncQuery.js.map +0 -1
  430. package/lib/WAUSync/USyncUser.d.ts +0 -17
  431. package/lib/WAUSync/USyncUser.d.ts.map +0 -1
  432. package/lib/WAUSync/USyncUser.js +0 -31
  433. package/lib/WAUSync/USyncUser.js.map +0 -1
  434. package/lib/WAUSync/index.d.ts +0 -4
  435. package/lib/WAUSync/index.d.ts.map +0 -1
  436. package/lib/WAUSync/index.js +0 -4
  437. package/lib/WAUSync/index.js.map +0 -1
  438. package/lib/index.d.ts.map +0 -1
  439. package/lib/index.js.map +0 -1
@@ -1,37 +1,41 @@
1
- import type { KeyPair } from '../Types/index.js';
2
- export { md5, hkdf } from 'whatsapp-rust-bridge';
1
+ /// <reference types="node" />
2
+ import { KeyPair } from '../Types';
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 | Buffer;
5
5
  export declare const Curve: {
6
6
  generateKeyPair: () => KeyPair;
7
- sharedKey: (privateKey: Uint8Array, publicKey: Uint8Array) => Buffer<ArrayBuffer>;
8
- sign: (privateKey: Uint8Array, buf: Uint8Array) => Uint8Array<ArrayBufferLike>;
7
+ sharedKey: (privateKey: Uint8Array, publicKey: Uint8Array) => Buffer;
8
+ sign: (privateKey: Uint8Array, buf: Uint8Array) => any;
9
9
  verify: (pubKey: Uint8Array, message: Uint8Array, signature: Uint8Array) => boolean;
10
10
  };
11
11
  export declare const signedKeyPair: (identityKeyPair: KeyPair, keyId: number) => {
12
12
  keyPair: KeyPair;
13
- signature: Uint8Array<ArrayBufferLike>;
13
+ signature: any;
14
14
  keyId: number;
15
15
  };
16
16
  /**
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: Buffer, key: Buffer): 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'): Buffer<ArrayBufferLike>;
35
- export declare function sha256(buffer: Buffer): Buffer<ArrayBufferLike>;
31
+ export declare function aesDecryptWithIV(buffer: Buffer, key: Buffer, IV: Buffer): Buffer;
32
+ export declare function aesEncrypt(buffer: Buffer | Uint8Array, key: Buffer): 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
+ export declare function md5(buffer: Buffer): Buffer;
37
+ export declare function hkdf(buffer: Uint8Array | Buffer, expandedLength: number, info: {
38
+ salt?: Buffer;
39
+ info?: string;
40
+ }): Buffer;
36
41
  export declare function derivePairingCodeKey(pairingCode: string, salt: Buffer): Promise<Buffer>;
37
- //# sourceMappingURL=crypto.d.ts.map
@@ -1,14 +1,46 @@
1
- import { createCipheriv, createDecipheriv, createHash, createHmac, randomBytes } from 'crypto';
2
- import * as curve from 'libsignal/src/curve.js';
3
- import { KEY_BUNDLE_TYPE } from '../Defaults/index.js';
4
- export { md5, hkdf } from 'whatsapp-rust-bridge';
5
- // insure browser & node compatibility
6
- const { subtle } = globalThis.crypto;
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || function (mod) {
19
+ if (mod && mod.__esModule) return mod;
20
+ var result = {};
21
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
+ __setModuleDefault(result, mod);
23
+ return result;
24
+ };
25
+ var __importDefault = (this && this.__importDefault) || function (mod) {
26
+ return (mod && mod.__esModule) ? mod : { "default": mod };
27
+ };
28
+ Object.defineProperty(exports, "__esModule", { value: true });
29
+ exports.derivePairingCodeKey = exports.hkdf = exports.md5 = exports.sha256 = exports.hmacSign = exports.aesEncrypWithIV = exports.aesEncrypt = exports.aesDecryptWithIV = exports.aesDecrypt = exports.aesDecryptCTR = exports.aesEncryptCTR = exports.aesDecryptGCM = exports.aesEncryptGCM = exports.signedKeyPair = exports.Curve = exports.generateSignalPubKey = void 0;
30
+ const crypto_1 = require("crypto");
31
+ const futoin_hkdf_1 = __importDefault(require("futoin-hkdf"));
32
+ const libsignal = __importStar(require("libsignal"));
33
+ const util_1 = require("util");
34
+ const Defaults_1 = require("../Defaults");
35
+ const pbkdf2Promise = (0, util_1.promisify)(crypto_1.pbkdf2);
7
36
  /** prefix version byte to the pub keys, required for some curve crypto functions */
8
- export const generateSignalPubKey = (pubKey) => pubKey.length === 33 ? pubKey : Buffer.concat([KEY_BUNDLE_TYPE, pubKey]);
9
- export const Curve = {
37
+ const generateSignalPubKey = (pubKey) => (pubKey.length === 33
38
+ ? pubKey
39
+ : Buffer.concat([Defaults_1.KEY_BUNDLE_TYPE, pubKey]));
40
+ exports.generateSignalPubKey = generateSignalPubKey;
41
+ exports.Curve = {
10
42
  generateKeyPair: () => {
11
- const { pubKey, privKey } = curve.generateKeyPair();
43
+ const { pubKey, privKey } = libsignal.curve.generateKeyPair();
12
44
  return {
13
45
  private: Buffer.from(privKey),
14
46
  // remove version byte
@@ -16,13 +48,13 @@ export const Curve = {
16
48
  };
17
49
  },
18
50
  sharedKey: (privateKey, publicKey) => {
19
- const shared = curve.calculateAgreement(generateSignalPubKey(publicKey), privateKey);
51
+ const shared = libsignal.curve.calculateAgreement((0, exports.generateSignalPubKey)(publicKey), privateKey);
20
52
  return Buffer.from(shared);
21
53
  },
22
- sign: (privateKey, buf) => curve.calculateSignature(privateKey, buf),
54
+ sign: (privateKey, buf) => (libsignal.curve.calculateSignature(privateKey, buf)),
23
55
  verify: (pubKey, message, signature) => {
24
56
  try {
25
- curve.verifySignature(generateSignalPubKey(pubKey), message, signature);
57
+ libsignal.curve.verifySignature((0, exports.generateSignalPubKey)(pubKey), message, signature);
26
58
  return true;
27
59
  }
28
60
  catch (error) {
@@ -30,28 +62,30 @@ export const Curve = {
30
62
  }
31
63
  }
32
64
  };
33
- export const signedKeyPair = (identityKeyPair, keyId) => {
34
- const preKey = Curve.generateKeyPair();
35
- const pubKey = generateSignalPubKey(preKey.public);
36
- const signature = Curve.sign(identityKeyPair.private, pubKey);
65
+ const signedKeyPair = (identityKeyPair, keyId) => {
66
+ const preKey = exports.Curve.generateKeyPair();
67
+ const pubKey = (0, exports.generateSignalPubKey)(preKey.public);
68
+ const signature = exports.Curve.sign(identityKeyPair.private, pubKey);
37
69
  return { keyPair: preKey, signature, keyId };
38
70
  };
71
+ exports.signedKeyPair = signedKeyPair;
39
72
  const GCM_TAG_LENGTH = 128 >> 3;
40
73
  /**
41
74
  * encrypt AES 256 GCM;
42
75
  * where the tag tag is suffixed to the ciphertext
43
76
  * */
44
- export function aesEncryptGCM(plaintext, key, iv, additionalData) {
45
- const cipher = createCipheriv('aes-256-gcm', key, iv);
77
+ function aesEncryptGCM(plaintext, key, iv, additionalData) {
78
+ const cipher = (0, crypto_1.createCipheriv)('aes-256-gcm', key, iv);
46
79
  cipher.setAAD(additionalData);
47
80
  return Buffer.concat([cipher.update(plaintext), cipher.final(), cipher.getAuthTag()]);
48
81
  }
82
+ exports.aesEncryptGCM = aesEncryptGCM;
49
83
  /**
50
84
  * decrypt AES 256 GCM;
51
85
  * where the auth tag is suffixed to the ciphertext
52
86
  * */
53
- export function aesDecryptGCM(ciphertext, key, iv, additionalData) {
54
- const decipher = createDecipheriv('aes-256-gcm', key, iv);
87
+ function aesDecryptGCM(ciphertext, key, iv, additionalData) {
88
+ const decipher = (0, crypto_1.createDecipheriv)('aes-256-gcm', key, iv);
55
89
  // decrypt additional adata
56
90
  const enc = ciphertext.slice(0, ciphertext.length - GCM_TAG_LENGTH);
57
91
  const tag = ciphertext.slice(ciphertext.length - GCM_TAG_LENGTH);
@@ -60,59 +94,60 @@ export function aesDecryptGCM(ciphertext, key, iv, additionalData) {
60
94
  decipher.setAuthTag(tag);
61
95
  return Buffer.concat([decipher.update(enc), decipher.final()]);
62
96
  }
63
- export function aesEncryptCTR(plaintext, key, iv) {
64
- const cipher = createCipheriv('aes-256-ctr', key, iv);
97
+ exports.aesDecryptGCM = aesDecryptGCM;
98
+ function aesEncryptCTR(plaintext, key, iv) {
99
+ const cipher = (0, crypto_1.createCipheriv)('aes-256-ctr', key, iv);
65
100
  return Buffer.concat([cipher.update(plaintext), cipher.final()]);
66
101
  }
67
- export function aesDecryptCTR(ciphertext, key, iv) {
68
- const decipher = createDecipheriv('aes-256-ctr', key, iv);
102
+ exports.aesEncryptCTR = aesEncryptCTR;
103
+ function aesDecryptCTR(ciphertext, key, iv) {
104
+ const decipher = (0, crypto_1.createDecipheriv)('aes-256-ctr', key, iv);
69
105
  return Buffer.concat([decipher.update(ciphertext), decipher.final()]);
70
106
  }
107
+ exports.aesDecryptCTR = aesDecryptCTR;
71
108
  /** decrypt AES 256 CBC; where the IV is prefixed to the buffer */
72
- export function aesDecrypt(buffer, key) {
73
- return aesDecryptWithIV(buffer.subarray(16), key, buffer.subarray(0, 16));
109
+ function aesDecrypt(buffer, key) {
110
+ return aesDecryptWithIV(buffer.slice(16, buffer.length), key, buffer.slice(0, 16));
74
111
  }
112
+ exports.aesDecrypt = aesDecrypt;
75
113
  /** decrypt AES 256 CBC */
76
- export function aesDecryptWithIV(buffer, key, IV) {
77
- const aes = createDecipheriv('aes-256-cbc', key, IV);
114
+ function aesDecryptWithIV(buffer, key, IV) {
115
+ const aes = (0, crypto_1.createDecipheriv)('aes-256-cbc', key, IV);
78
116
  return Buffer.concat([aes.update(buffer), aes.final()]);
79
117
  }
118
+ exports.aesDecryptWithIV = aesDecryptWithIV;
80
119
  // encrypt AES 256 CBC; where a random IV is prefixed to the buffer
81
- export function aesEncrypt(buffer, key) {
82
- const IV = randomBytes(16);
83
- const aes = createCipheriv('aes-256-cbc', key, IV);
120
+ function aesEncrypt(buffer, key) {
121
+ const IV = (0, crypto_1.randomBytes)(16);
122
+ const aes = (0, crypto_1.createCipheriv)('aes-256-cbc', key, IV);
84
123
  return Buffer.concat([IV, aes.update(buffer), aes.final()]); // prefix IV to the buffer
85
124
  }
125
+ exports.aesEncrypt = aesEncrypt;
86
126
  // encrypt AES 256 CBC with a given IV
87
- export function aesEncrypWithIV(buffer, key, IV) {
88
- const aes = createCipheriv('aes-256-cbc', key, IV);
127
+ function aesEncrypWithIV(buffer, key, IV) {
128
+ const aes = (0, crypto_1.createCipheriv)('aes-256-cbc', key, IV);
89
129
  return Buffer.concat([aes.update(buffer), aes.final()]); // prefix IV to the buffer
90
130
  }
131
+ exports.aesEncrypWithIV = aesEncrypWithIV;
91
132
  // sign HMAC using SHA 256
92
- export function hmacSign(buffer, key, variant = 'sha256') {
93
- return createHmac(variant, key).update(buffer).digest();
133
+ function hmacSign(buffer, key, variant = 'sha256') {
134
+ return (0, crypto_1.createHmac)(variant, key).update(buffer).digest();
135
+ }
136
+ exports.hmacSign = hmacSign;
137
+ function sha256(buffer) {
138
+ return (0, crypto_1.createHash)('sha256').update(buffer).digest();
139
+ }
140
+ exports.sha256 = sha256;
141
+ function md5(buffer) {
142
+ return (0, crypto_1.createHash)('md5').update(buffer).digest();
94
143
  }
95
- export function sha256(buffer) {
96
- return createHash('sha256').update(buffer).digest();
144
+ exports.md5 = md5;
145
+ // HKDF key expansion
146
+ function hkdf(buffer, expandedLength, info) {
147
+ return (0, futoin_hkdf_1.default)(!Buffer.isBuffer(buffer) ? Buffer.from(buffer) : buffer, expandedLength, info);
97
148
  }
98
- export async function derivePairingCodeKey(pairingCode, salt) {
99
- // Convert inputs to formats Web Crypto API can work with
100
- const encoder = new TextEncoder();
101
- const pairingCodeBuffer = encoder.encode(pairingCode);
102
- const saltBuffer = new Uint8Array(salt instanceof Uint8Array ? salt : new Uint8Array(salt));
103
- // Import the pairing code as key material
104
- const keyMaterial = await subtle.importKey('raw', pairingCodeBuffer, { name: 'PBKDF2' }, false, [
105
- 'deriveBits'
106
- ]);
107
- // Derive bits using PBKDF2 with the same parameters
108
- // 2 << 16 = 131,072 iterations
109
- const derivedBits = await subtle.deriveBits({
110
- name: 'PBKDF2',
111
- salt: saltBuffer,
112
- iterations: 2 << 16,
113
- hash: 'SHA-256'
114
- }, keyMaterial, 32 * 8 // 32 bytes * 8 = 256 bits
115
- );
116
- return Buffer.from(derivedBits);
149
+ exports.hkdf = hkdf;
150
+ async function derivePairingCodeKey(pairingCode, salt) {
151
+ return await pbkdf2Promise(pairingCode, salt, 2 << 16, 32, 'sha256');
117
152
  }
118
- //# sourceMappingURL=crypto.js.map
153
+ exports.derivePairingCodeKey = derivePairingCodeKey;
@@ -1,66 +1,20 @@
1
- import type { WAMessage } from '../Types/index.js';
2
- import type { SignalRepositoryWithLIDStore } from '../Types/Signal.js';
3
- import { type BinaryNode } from '../WABinary/index.js';
4
- import type { ILogger } from './logger.js';
5
- export declare const getDecryptionJid: (sender: string, repository: SignalRepositoryWithLIDStore) => Promise<string>;
1
+ import { Logger } from 'pino';
2
+ import { proto } from '../../WAProto';
3
+ import { SignalRepository } from '../Types';
4
+ import { BinaryNode } from '../WABinary';
6
5
  export declare const NO_MESSAGE_FOUND_ERROR_TEXT = "Message absent from node";
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
- export declare const DECRYPTION_RETRY_CONFIG: {
10
- maxRetries: number;
11
- baseDelayMs: number;
12
- sessionRecordErrors: string[];
13
- };
14
- /** NACK reason codes we send to the server (client → server) */
15
- export declare const NACK_REASONS: {
16
- SenderReachoutTimelocked: number;
17
- ParsingError: number;
18
- UnrecognizedStanza: number;
19
- UnrecognizedStanzaClass: number;
20
- UnrecognizedStanzaType: number;
21
- InvalidProtobuf: number;
22
- InvalidHostedCompanionStanza: number;
23
- MissingMessageSecret: number;
24
- SignalErrorOldCounter: number;
25
- MessageDeletedOnPeer: number;
26
- UnhandledError: number;
27
- UnsupportedAdminRevoke: number;
28
- UnsupportedLIDGroup: number;
29
- DBOperationFailed: number;
30
- };
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
- export declare const extractAddressingContext: (stanza: BinaryNode) => {
47
- addressingMode: string;
48
- senderAlt: string | undefined;
49
- recipientAlt: string | undefined;
50
- };
51
6
  /**
52
7
  * Decode the received node as a message.
53
8
  * @note this will only parse the message, not decrypt it
54
9
  */
55
10
  export declare function decodeMessageNode(stanza: BinaryNode, meId: string, meLid: string): {
56
- fullMessage: WAMessage;
11
+ fullMessage: proto.IWebMessageInfo;
57
12
  author: string;
58
13
  sender: string;
59
14
  };
60
- export declare const decryptMessageNode: (stanza: BinaryNode, meId: string, meLid: string, repository: SignalRepositoryWithLIDStore, logger: ILogger) => {
61
- fullMessage: WAMessage;
62
- category: string | undefined;
15
+ export declare const decryptMessageNode: (stanza: BinaryNode, meId: string, meLid: string, repository: SignalRepository, logger: Logger) => {
16
+ fullMessage: proto.IWebMessageInfo;
17
+ category: string;
63
18
  author: string;
64
19
  decrypt(): Promise<void>;
65
20
  };
66
- //# sourceMappingURL=decode-wa-message.d.ts.map