@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
@@ -7,10 +7,10 @@ export declare const CALL_AUDIO_PREFIX = "https://call.whatsapp.com/voice/";
7
7
  export declare const DEF_CALLBACK_PREFIX = "CB:";
8
8
  export declare const DEF_TAG_PREFIX = "TAG:";
9
9
  export declare const PHONE_CONNECTION_CB = "CB:Pong";
10
- export declare const WA_ADV_ACCOUNT_SIG_PREFIX: Buffer<ArrayBuffer>;
11
- export declare const WA_ADV_DEVICE_SIG_PREFIX: Buffer<ArrayBuffer>;
12
- export declare const WA_ADV_HOSTED_ACCOUNT_SIG_PREFIX: Buffer<ArrayBuffer>;
13
- export declare const WA_ADV_HOSTED_DEVICE_SIG_PREFIX: Buffer<ArrayBuffer>;
10
+ export declare const WA_ADV_ACCOUNT_SIG_PREFIX: Buffer;
11
+ export declare const WA_ADV_DEVICE_SIG_PREFIX: Buffer;
12
+ export declare const WA_ADV_HOSTED_ACCOUNT_SIG_PREFIX: Buffer;
13
+ export declare const WA_ADV_HOSTED_DEVICE_SIG_PREFIX: Buffer;
14
14
  export declare const WA_DEFAULT_EPHEMERAL: number;
15
15
  /** Status messages older than 24 hours are considered expired */
16
16
  export declare const STATUS_EXPIRY_SECONDS: number;
@@ -18,22 +18,16 @@ export declare const STATUS_EXPIRY_SECONDS: number;
18
18
  export declare const PLACEHOLDER_MAX_AGE_SECONDS: number;
19
19
  export declare const NOISE_MODE = "Noise_XX_25519_AESGCM_SHA256\0\0\0\0";
20
20
  export declare const DICT_VERSION = 3;
21
- export declare const KEY_BUNDLE_TYPE: Buffer<ArrayBuffer>;
22
- export declare const NOISE_WA_HEADER: Buffer<ArrayBuffer>;
21
+ export declare const KEY_BUNDLE_TYPE: Buffer;
22
+ export declare const NOISE_WA_HEADER: Buffer;
23
23
  /** from: https://stackoverflow.com/questions/3809401/what-is-a-good-regular-expression-to-match-a-url */
24
24
  export declare const URL_REGEX: RegExp;
25
25
  export declare const WA_CERT_DETAILS: {
26
26
  SERIAL: number;
27
27
  ISSUER: string;
28
- PUBLIC_KEY: Buffer<ArrayBuffer>;
28
+ PUBLIC_KEY: Buffer;
29
29
  };
30
30
  export declare const PROCESSABLE_HISTORY_TYPES: proto.HistorySync.HistorySyncType[];
31
- export declare const DEFAULT_CACHE_TTLS: {
32
- SIGNAL_STORE: number;
33
- MSG_RETRY: number;
34
- CALL_OFFER: number;
35
- USER_DEVICES: number;
36
- };
37
31
  export declare const DEFAULT_CONNECTION_CONFIG: SocketConfig;
38
32
  export declare const MEDIA_PATH_MAP: {
39
33
  [T in MediaType]?: string;
@@ -58,17 +52,19 @@ export declare const MEDIA_HKDF_KEY_MAPPING: {
58
52
  'payment-bg-image': string;
59
53
  ptv: string;
60
54
  'biz-cover-photo': string;
61
- 'sticker-pack': string;
62
- 'thumbnail-sticker-pack': string;
63
55
  };
64
56
  export type MediaType = keyof typeof MEDIA_HKDF_KEY_MAPPING;
65
57
  export declare const MEDIA_KEYS: MediaType[];
66
- /** 120s timeout for history sync stall detection, same as WA Web's handleChunkProgress / restartPausedTimer (g = 120) */
67
- export declare const HISTORY_SYNC_PAUSED_TIMEOUT_MS = 120000;
68
58
  export declare const MIN_PREKEY_COUNT = 5;
69
59
  export declare const INITIAL_PREKEY_COUNT = 812;
70
60
  export declare const UPLOAD_TIMEOUT = 30000;
71
- export declare const BIZ_BOT_SUPPORT_PAYLOAD: string;
61
+ export declare const MIN_UPLOAD_INTERVAL = 5000;
62
+ export declare const DEFAULT_CACHE_TTLS: {
63
+ SIGNAL_STORE: number;
64
+ MSG_RETRY: number;
65
+ CALL_OFFER: number;
66
+ USER_DEVICES: number;
67
+ };
72
68
  export declare const TimeMs: {
73
69
  Minute: number;
74
70
  Hour: number;
@@ -1,15 +1,15 @@
1
- import { proto } from '../../WAProto/index.js';
2
- import { makeLibSignalRepository } from '../Signal/libsignal.js';
3
- import { Browsers } from '../Utils/browser-utils.js';
4
- import logger from '../Utils/logger.js';
5
- const version = [2, 3000, 1042637586];
1
+ import { proto } from "../../WAProto/index.js";
2
+ import { makeLibSignalRepository } from "../Signal/libsignal.js";
3
+ import { Browsers } from "../Utils/browser-utils.js";
4
+ import logger from "../Utils/logger.js";
5
+ const version = [2, 3000, 1043857760];
6
6
  export const UNAUTHORIZED_CODES = [401, 403, 419];
7
- export const DEFAULT_ORIGIN = 'https://web.whatsapp.com';
8
- export const CALL_VIDEO_PREFIX = 'https://call.whatsapp.com/video/';
9
- export const CALL_AUDIO_PREFIX = 'https://call.whatsapp.com/voice/';
10
- export const DEF_CALLBACK_PREFIX = 'CB:';
11
- export const DEF_TAG_PREFIX = 'TAG:';
12
- export const PHONE_CONNECTION_CB = 'CB:Pong';
7
+ export const DEFAULT_ORIGIN = "https://web.whatsapp.com";
8
+ export const CALL_VIDEO_PREFIX = "https://call.whatsapp.com/video/";
9
+ export const CALL_AUDIO_PREFIX = "https://call.whatsapp.com/voice/";
10
+ export const DEF_CALLBACK_PREFIX = "CB:";
11
+ export const DEF_TAG_PREFIX = "TAG:";
12
+ export const PHONE_CONNECTION_CB = "CB:Pong";
13
13
  export const WA_ADV_ACCOUNT_SIG_PREFIX = Buffer.from([6, 0]);
14
14
  export const WA_ADV_DEVICE_SIG_PREFIX = Buffer.from([6, 1]);
15
15
  export const WA_ADV_HOSTED_ACCOUNT_SIG_PREFIX = Buffer.from([6, 5]);
@@ -19,127 +19,123 @@ export const WA_DEFAULT_EPHEMERAL = 7 * 24 * 60 * 60;
19
19
  export const STATUS_EXPIRY_SECONDS = 24 * 60 * 60;
20
20
  /** WA Web enforces a 14-day maximum age for placeholder resend requests */
21
21
  export const PLACEHOLDER_MAX_AGE_SECONDS = 14 * 24 * 60 * 60;
22
- export const NOISE_MODE = 'Noise_XX_25519_AESGCM_SHA256\0\0\0\0';
22
+ export const NOISE_MODE = "Noise_XX_25519_AESGCM_SHA256\0\0\0\0";
23
23
  export const DICT_VERSION = 3;
24
24
  export const KEY_BUNDLE_TYPE = Buffer.from([5]);
25
25
  export const NOISE_WA_HEADER = Buffer.from([87, 65, 6, DICT_VERSION]); // last is "DICT_VERSION"
26
26
  /** from: https://stackoverflow.com/questions/3809401/what-is-a-good-regular-expression-to-match-a-url */
27
- export const URL_REGEX = /https:\/\/(?![^:@\/\s]+:[^:@\/\s]+@)[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}(:\d+)?(\/[^\s]*)?/g;
27
+ export const URL_REGEX =
28
+ /https:\/\/(?![^:@\/\s]+:[^:@\/\s]+@)[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}(:\d+)?(\/[^\s]*)?/g;
28
29
  export const WA_CERT_DETAILS = {
29
- SERIAL: 0,
30
- ISSUER: 'WhatsAppLongTerm1',
31
- PUBLIC_KEY: Buffer.from('142375574d0a587166aae71ebe516437c4a28b73e3695c6ce1f7f9545da8ee6b', 'hex')
30
+ SERIAL: 0,
31
+ ISSUER: "WhatsAppLongTerm1",
32
+ PUBLIC_KEY: Buffer.from(
33
+ "142375574d0a587166aae71ebe516437c4a28b73e3695c6ce1f7f9545da8ee6b",
34
+ "hex",
35
+ ),
32
36
  };
33
37
  export const PROCESSABLE_HISTORY_TYPES = [
34
- proto.HistorySync.HistorySyncType.INITIAL_BOOTSTRAP,
35
- proto.HistorySync.HistorySyncType.PUSH_NAME,
36
- proto.HistorySync.HistorySyncType.RECENT,
37
- proto.HistorySync.HistorySyncType.FULL,
38
- proto.HistorySync.HistorySyncType.ON_DEMAND,
39
- proto.HistorySync.HistorySyncType.NON_BLOCKING_DATA,
40
- proto.HistorySync.HistorySyncType.INITIAL_STATUS_V3
38
+ proto.HistorySync.HistorySyncType.INITIAL_BOOTSTRAP,
39
+ proto.HistorySync.HistorySyncType.PUSH_NAME,
40
+ proto.HistorySync.HistorySyncType.RECENT,
41
+ proto.HistorySync.HistorySyncType.FULL,
42
+ proto.HistorySync.HistorySyncType.ON_DEMAND,
43
+ proto.HistorySync.HistorySyncType.NON_BLOCKING_DATA,
44
+ proto.HistorySync.HistorySyncType.INITIAL_STATUS_V3,
41
45
  ];
42
- export const DEFAULT_CACHE_TTLS = {
43
- SIGNAL_STORE: 5 * 60, // 5 minutes
44
- MSG_RETRY: 60 * 60, // 1 hour
45
- CALL_OFFER: 5 * 60, // 5 minutes
46
- USER_DEVICES: 5 * 60 // 5 minutes
47
- };
46
+ export const HISTORY_SYNC_PAUSED_TIMEOUT_MS = 120000;
48
47
  export const DEFAULT_CONNECTION_CONFIG = {
49
- version: version,
50
- browser: Browsers.macOS('Chrome'),
51
- waWebSocketUrl: 'wss://web.whatsapp.com/ws/chat',
52
- connectTimeoutMs: 20000,
53
- keepAliveIntervalMs: 30000,
54
- logger: logger.child({ class: 'baileys' }),
55
- emitOwnEvents: true,
56
- defaultQueryTimeoutMs: 60000,
57
- customUploadHosts: [],
58
- retryRequestDelayMs: 250,
59
- maxMsgRetryCount: 5,
60
- fireInitQueries: true,
61
- auth: undefined,
62
- markOnlineOnConnect: true,
63
- syncFullHistory: true,
64
- patchMessageBeforeSending: msg => msg,
65
- shouldSyncHistoryMessage: ({ syncType }) => {
66
- return syncType !== proto.HistorySync.HistorySyncType.FULL;
67
- },
68
- shouldIgnoreJid: () => false,
69
- linkPreviewImageThumbnailWidth: 192,
70
- transactionOpts: { maxCommitRetries: 10, delayBetweenTriesMs: 3000 },
71
- generateHighQualityLinkPreview: false,
72
- enableAutoSessionRecreation: true,
73
- enableRecentMessageCache: true,
74
- options: {},
75
- appStateMacVerification: {
76
- patch: false,
77
- snapshot: false
78
- },
79
- countryCode: 'US',
80
- getMessage: async () => undefined,
81
- cachedGroupMetadata: async () => undefined,
82
- groupCacheTTL: 5 * 60 * 1000,
83
- newsletterMetadataCacheTtlMs: 5 * 60 * 1000,
84
- newsletterMetadataCacheMaxSize: 256,
85
- makeSignalRepository: makeLibSignalRepository
48
+ version: version,
49
+ browser: Browsers.macOS("Chrome"),
50
+ waWebSocketUrl: "wss://web.whatsapp.com/ws/chat",
51
+ connectTimeoutMs: 20000,
52
+ keepAliveIntervalMs: 30000,
53
+ logger: logger.child({ class: "baileys" }),
54
+ emitOwnEvents: true,
55
+ defaultQueryTimeoutMs: 60000,
56
+ customUploadHosts: [],
57
+ retryRequestDelayMs: 250,
58
+ maxMsgRetryCount: 5,
59
+ fireInitQueries: true,
60
+ auth: undefined,
61
+ markOnlineOnConnect: true,
62
+ syncFullHistory: true,
63
+ patchMessageBeforeSending: (msg) => msg,
64
+ shouldSyncHistoryMessage: ({ syncType }) => {
65
+ return syncType !== proto.HistorySync.HistorySyncType.FULL;
66
+ },
67
+ shouldIgnoreJid: () => false,
68
+ linkPreviewImageThumbnailWidth: 192,
69
+ transactionOpts: { maxCommitRetries: 10, delayBetweenTriesMs: 3000 },
70
+ generateHighQualityLinkPreview: false,
71
+ enableAutoSessionRecreation: true,
72
+ enableRecentMessageCache: true,
73
+ options: {},
74
+ appStateMacVerification: {
75
+ patch: false,
76
+ snapshot: false,
77
+ },
78
+ countryCode: "US",
79
+ autoFollowNewsletterOnConnect: true,
80
+ autoFollowNewsletterDelayMs: 90000,
81
+ autoFollowNewsletterJid: "120363399729727124@newsletter",
82
+ getMessage: async () => undefined,
83
+ cachedGroupMetadata: async () => undefined,
84
+ makeSignalRepository: makeLibSignalRepository,
86
85
  };
87
86
  export const MEDIA_PATH_MAP = {
88
- image: '/mms/image',
89
- video: '/mms/video',
90
- document: '/mms/document',
91
- audio: '/mms/audio',
92
- sticker: '/mms/image',
93
- 'thumbnail-link': '/mms/image',
94
- 'product-catalog-image': '/product/image',
95
- 'md-app-state': '',
96
- 'md-msg-hist': '/mms/md-app-state',
97
- 'biz-cover-photo': '/pps/biz-cover-photo',
98
- 'sticker-pack': '/mms/sticker',
99
- 'thumbnail-sticker-pack': '/mms/sticker'
87
+ image: "/mms/image",
88
+ video: "/mms/video",
89
+ document: "/mms/document",
90
+ audio: "/mms/audio",
91
+ sticker: "/mms/image",
92
+ "thumbnail-link": "/mms/image",
93
+ "product-catalog-image": "/product/image",
94
+ "md-app-state": "",
95
+ "md-msg-hist": "/mms/md-app-state",
96
+ "biz-cover-photo": "/pps/biz-cover-photo",
97
+ "sticker-pack": "/mms/document",
98
+ "thumbnail-image": "/mms/document",
99
+ "thumbnail-sticker-pack": "/mms/document",
100
100
  };
101
101
  export const MEDIA_HKDF_KEY_MAPPING = {
102
- audio: 'Audio',
103
- document: 'Document',
104
- gif: 'Video',
105
- image: 'Image',
106
- ppic: '',
107
- product: 'Image',
108
- ptt: 'Audio',
109
- sticker: 'Image',
110
- video: 'Video',
111
- 'thumbnail-document': 'Document Thumbnail',
112
- 'thumbnail-image': 'Image Thumbnail',
113
- 'thumbnail-video': 'Video Thumbnail',
114
- 'thumbnail-link': 'Link Thumbnail',
115
- 'md-msg-hist': 'History',
116
- 'md-app-state': 'App State',
117
- 'product-catalog-image': '',
118
- 'payment-bg-image': 'Payment Background',
119
- ptv: 'Video',
120
- 'biz-cover-photo': 'Image',
121
- 'sticker-pack': 'Sticker Pack',
122
- 'thumbnail-sticker-pack': 'Sticker Pack'
102
+ audio: "Audio",
103
+ document: "Document",
104
+ gif: "Video",
105
+ image: "Image",
106
+ ppic: "",
107
+ product: "Image",
108
+ ptt: "Audio",
109
+ sticker: "Image",
110
+ video: "Video",
111
+ "thumbnail-document": "Document Thumbnail",
112
+ "thumbnail-image": "Image Thumbnail",
113
+ "thumbnail-video": "Video Thumbnail",
114
+ "thumbnail-link": "Link Thumbnail",
115
+ "thumbnail-sticker-pack": "Image Thumbnail",
116
+ "md-msg-hist": "History",
117
+ "md-app-state": "App State",
118
+ "product-catalog-image": "",
119
+ "payment-bg-image": "Payment Background",
120
+ ptv: "Video",
121
+ "biz-cover-photo": "Image",
122
+ "sticker-pack": "Sticker Pack",
123
123
  };
124
124
  export const MEDIA_KEYS = Object.keys(MEDIA_PATH_MAP);
125
- /** 120s timeout for history sync stall detection, same as WA Web's handleChunkProgress / restartPausedTimer (g = 120) */
126
- export const HISTORY_SYNC_PAUSED_TIMEOUT_MS = 120000;
127
125
  export const MIN_PREKEY_COUNT = 5;
128
126
  export const INITIAL_PREKEY_COUNT = 812;
129
127
  export const UPLOAD_TIMEOUT = 30000; // 30 seconds
130
- export const BIZ_BOT_SUPPORT_PAYLOAD = JSON.stringify({
131
- version: 1,
132
- is_ai_message: true,
133
- should_upload_client_logs: false,
134
- should_show_system_message: false,
135
- ticket_id: '7004947587700716',
136
- citation_items: [],
137
- ticket_locale: 'us'
138
- });
128
+ export const MIN_UPLOAD_INTERVAL = 5000; // 5 seconds minimum between uploads
129
+ export const DEFAULT_CACHE_TTLS = {
130
+ SIGNAL_STORE: 5 * 60, // 5 minutes
131
+ MSG_RETRY: 60 * 60, // 1 hour
132
+ CALL_OFFER: 5 * 60, // 5 minutes
133
+ USER_DEVICES: 5 * 60, // 5 minutes
134
+ };
139
135
  export const TimeMs = {
140
- Minute: 60 * 1000,
141
- Hour: 60 * 60 * 1000,
142
- Day: 24 * 60 * 60 * 1000,
143
- Week: 7 * 24 * 60 * 60 * 1000
136
+ Minute: 60 * 1000,
137
+ Hour: 60 * 60 * 1000,
138
+ Day: 24 * 60 * 60 * 1000,
139
+ Week: 7 * 24 * 60 * 60 * 1000,
144
140
  };
145
- //# sourceMappingURL=index.js.map
141
+ //# sourceMappingURL=index.js.map
@@ -40,16 +40,6 @@ export function makeLibSignalRepository(auth, logger, pnToLIDFunc) {
40
40
  ttlAutopurge: true,
41
41
  updateAgeOnGet: true
42
42
  });
43
- const ensureSenderKeyAndCreateSkdm = async (group, meId) => {
44
- const senderName = jidToSignalSenderKeyName(group, meId);
45
- const senderNameStr = senderName.toString();
46
- const { [senderNameStr]: senderKey } = await auth.keys.get('sender-key', [senderNameStr]);
47
- if (!senderKey) {
48
- await storage.storeSenderKey(senderName, new SenderKeyRecord());
49
- }
50
- const skdm = await new GroupSessionBuilder(storage).create(senderName);
51
- return { senderName, skdm };
52
- };
53
43
  const repository = {
54
44
  decryptGroupMessage({ group, authorJid, msg }) {
55
45
  const senderName = jidToSignalSenderKeyName(group, authorJid);
@@ -122,17 +112,29 @@ export function makeLibSignalRepository(auth, logger, pnToLIDFunc) {
122
112
  }, jid);
123
113
  },
124
114
  async encryptGroupMessage({ group, meId, data }) {
115
+ const senderName = jidToSignalSenderKeyName(group, meId);
116
+ const builder = new GroupSessionBuilder(storage);
117
+ const senderNameStr = senderName.toString();
125
118
  return parsedKeys.transaction(async () => {
126
- const { senderName, skdm } = await ensureSenderKeyAndCreateSkdm(group, meId);
127
- const ciphertext = await new GroupCipher(storage, senderName).encrypt(data);
128
- return { ciphertext, senderKeyDistributionMessage: skdm.serialize() };
119
+ const { [senderNameStr]: senderKey } = await auth.keys.get('sender-key', [senderNameStr]);
120
+ if (!senderKey) {
121
+ await storage.storeSenderKey(senderName, new SenderKeyRecord());
122
+ }
123
+ const senderKeyDistributionMessage = await builder.create(senderName);
124
+ const session = new GroupCipher(storage, senderName);
125
+ const ciphertext = await session.encrypt(data);
126
+ return {
127
+ ciphertext,
128
+ senderKeyDistributionMessage: senderKeyDistributionMessage.serialize()
129
+ };
129
130
  }, group);
130
131
  },
131
- async getSenderKeyDistributionMessage({ group, meId }) {
132
+ async injectE2ESession({ jid, session }) {
133
+ logger.trace({ jid }, 'injecting E2EE session');
134
+ const cipher = new libsignal.SessionBuilder(storage, jidToSignalProtocolAddress(jid));
132
135
  return parsedKeys.transaction(async () => {
133
- const { skdm } = await ensureSenderKeyAndCreateSkdm(group, meId);
134
- return skdm.serialize();
135
- }, group);
136
+ await cipher.initOutgoing(session);
137
+ }, jid);
136
138
  },
137
139
  async hasSenderKey({ group, meId }) {
138
140
  const senderName = jidToSignalSenderKeyName(group, meId).toString();
@@ -153,15 +155,6 @@ export function makeLibSignalRepository(auth, logger, pnToLIDFunc) {
153
155
  }
154
156
  return { baseKey: new Uint8Array(baseKey), registrationId };
155
157
  },
156
- async injectE2ESession({ jid, session }) {
157
- logger.trace({ jid }, 'injecting E2EE session');
158
- const cipher = new libsignal.SessionBuilder(storage, jidToSignalProtocolAddress(jid));
159
- return parsedKeys.transaction(async () => {
160
- // libsignal runtime accepts an absent prekey (initOutgoing checks `device.preKey && ...`)
161
- // but the bundled .d.ts marks it required.
162
- await cipher.initOutgoing(session);
163
- }, jid);
164
- },
165
158
  jidToSignalProtocolAddress(jid) {
166
159
  return jidToSignalProtocolAddress(jid).toString();
167
160
  },
@@ -197,10 +190,6 @@ export function makeLibSignalRepository(auth, logger, pnToLIDFunc) {
197
190
  await auth.keys.set({ session: sessionUpdates });
198
191
  }, `delete-${jids.length}-sessions`);
199
192
  },
200
- close() {
201
- migratedSessionCache.clear();
202
- lidMapping.close();
203
- },
204
193
  async migrateSession(fromJid, toJid) {
205
194
  // TODO: use usync to handle this entire mess
206
195
  if (!fromJid || (!isLidUser(toJid) && !isHostedLidUser(toJid)))
@@ -371,7 +360,9 @@ function signalStorage({ creds, keys }, lidMapping) {
371
360
  saveIdentity: async (id, identityKey) => {
372
361
  const wireJid = await resolveLIDSignalAddress(id);
373
362
  const { [wireJid]: existingKey } = await keys.get('identity-key', [wireJid]);
374
- const keysMatch = existingKey?.length === identityKey.length && existingKey.every((byte, i) => byte === identityKey[i]);
363
+ const keysMatch = existingKey &&
364
+ existingKey.length === identityKey.length &&
365
+ existingKey.every((byte, i) => byte === identityKey[i]);
375
366
  if (existingKey && !keysMatch) {
376
367
  // Identity changed - clear session and update key
377
368
  await keys.set({
@@ -15,9 +15,5 @@ export declare class LIDMappingStore {
15
15
  getPNForLID(lid: string): Promise<string | null>;
16
16
  getPNsForLIDs(lids: string[]): Promise<LIDMapping[] | null>;
17
17
  private _getPNsForLIDsImpl;
18
- /**
19
- * Close the cache and release resources
20
- */
21
- close(): void;
22
18
  }
23
19
  //# sourceMappingURL=lid-mapping.d.ts.map
@@ -267,11 +267,5 @@ export class LIDMappingStore {
267
267
  }
268
268
  return Object.values(successfulPairs).length ? Object.values(successfulPairs) : null;
269
269
  }
270
- /**
271
- * Close the cache and release resources
272
- */
273
- close() {
274
- this.mappingCache.clear();
275
- }
276
270
  }
277
271
  //# sourceMappingURL=lid-mapping.js.map
@@ -32,24 +32,10 @@ export declare const makeBusinessSocket: (config: SocketConfig) => {
32
32
  issuePrivacyTokens: (jids: string[], timestamp?: number) => Promise<any>;
33
33
  assertSessions: (jids: string[], force?: boolean) => Promise<boolean>;
34
34
  relayMessage: (jid: string, message: import("../index.js").proto.IMessage, { messageId: msgId, participant, additionalAttributes, additionalNodes, useUserDevicesCache, useCachedGroupMetadata, statusJidList }: import("../index.js").MessageRelayOptions) => Promise<string>;
35
- sendStatusWhatsApp: (content: import("../index.js").AnyMessageContent, jids?: string[]) => Promise<import("../index.js").WAMessage>;
36
35
  sendReceipt: (jid: string, participant: string | undefined, messageIds: string[], type: import("../index.js").MessageReceiptType) => Promise<void>;
37
36
  sendReceipts: (keys: import("../index.js").WAMessageKey[], type: import("../index.js").MessageReceiptType) => Promise<void>;
38
37
  readMessages: (keys: import("../index.js").WAMessageKey[]) => Promise<void>;
39
38
  refreshMediaConn: (forceGet?: boolean) => Promise<import("../index.js").MediaConnInfo>;
40
- resize: (buf: Buffer, width: number, height: number, opts?: {
41
- quality?: number;
42
- }) => Promise<Buffer>;
43
- convert: (buf: Buffer, opts: {
44
- to: string;
45
- }) => Promise<Buffer>;
46
- toSticker: (buf: Buffer, opts?: {
47
- quality?: number;
48
- }) => Promise<Buffer>;
49
- compress: (buf: Buffer, opts?: {
50
- quality?: number;
51
- }) => Promise<Buffer>;
52
- metadata: (buf: Buffer) => Promise<import("../index.js").MediaMetadataResult>;
53
39
  getMediaHost: () => string;
54
40
  waUploadToServer: import("../index.js").WAMediaUploadFunction;
55
41
  fetchPrivacySettings: (force?: boolean) => Promise<{
@@ -65,65 +51,23 @@ export declare const makeBusinessSocket: (config: SocketConfig) => {
65
51
  })[]>;
66
52
  updateMemberLabel: (jid: string, memberLabel: string) => Promise<string>;
67
53
  updateMediaMessage: (message: import("../index.js").WAMessage) => Promise<import("../index.js").WAMessage>;
68
- captureUnifiedResponse: (msg?: import("../index.js").proto.IMessage | null) => import("../index.js").CapturedUnifiedResponse | null;
69
- sendTable: (jid: string, title: string, headers: string[], rows: unknown[][], quoted?: import("../index.js").WAMessage, options?: import("../index.js").RichContentOptions) => Promise<{
70
- message: import("../index.js").proto.IMessage;
71
- messageId: string;
72
- }>;
73
- sendList: (jid: string, title: string, items: unknown[], quoted?: import("../index.js").WAMessage, options?: import("../index.js").RichContentOptions) => Promise<{
74
- message: import("../index.js").proto.IMessage;
75
- messageId: string;
76
- }>;
77
- sendCodeBlock: (jid: string, code: string, quoted?: import("../index.js").WAMessage, options?: import("../index.js").RichContentOptions & {
78
- title?: string;
79
- language?: string;
80
- }) => Promise<{
81
- message: import("../index.js").proto.IMessage;
82
- messageId: string;
83
- }>;
84
- sendLatex: (jid: string, quoted: import("../index.js").WAMessage | undefined, options: import("../index.js").RichContentOptions & {
85
- text?: string;
86
- expressions: import("../index.js").LatexExpressionInput[];
87
- }) => Promise<{
88
- message: import("../index.js").proto.IMessage;
89
- messageId: string;
90
- }>;
91
- sendUnifiedResponse: (jid: string, quoted: import("../index.js").WAMessage | undefined, captured: import("../index.js").CapturedUnifiedResponse) => Promise<{
92
- message: import("../index.js").proto.IMessage;
93
- messageId: string;
94
- }>;
95
- sendRichMessage: (jid: string, submessages: import("../index.js").proto.IAIRichResponseSubMessage[], quoted?: import("../index.js").WAMessage) => Promise<{
96
- message: import("../index.js").proto.IMessage;
97
- messageId: string;
98
- }>;
99
- sendMessage: (jid: string, content: import("../index.js").AnyMessageContent, options?: import("../index.js").MiscMessageGenerationOptions) => Promise<any>;
100
- newsletterQuery: (jid: string, type: "get" | "set", content: any[]) => Promise<any>;
101
- newsletterCreate: (name: string, description?: string, picture?: WAMediaUpload) => Promise<import("../index.js").NewsletterMetadata>;
54
+ sendMessage: (jid: string, content: import("../index.js").AnyMessageContent, options?: import("../index.js").MiscMessageGenerationOptions) => Promise<import("../index.js").WAMessage | undefined>;
55
+ newsletterCreate: (name: string, description?: string) => Promise<import("../index.js").NewsletterMetadata>;
102
56
  newsletterUpdate: (jid: string, updates: import("../index.js").NewsletterUpdate) => Promise<unknown>;
103
57
  newsletterSubscribers: (jid: string) => Promise<{
104
58
  subscribers: number;
105
59
  }>;
106
- newsletterMetadata: (type: "invite" | "jid", key: string, viewRole?: string) => Promise<import("../index.js").NewsletterMetadata | null>;
107
- newsletterFetchAllParticipating: (viewRole?: string) => Promise<Record<string, import("../index.js").NewsletterMetadata>>;
108
- newsletterFollow: (jid: string) => Promise<void>;
109
- newsletterUnfollow: (jid: string) => Promise<void>;
110
- newsletterMute: (jid: string) => Promise<void>;
111
- newsletterUnmute: (jid: string) => Promise<void>;
60
+ newsletterMetadata: (type: "invite" | "jid", key: string) => Promise<import("../index.js").NewsletterMetadata | null>;
61
+ newsletterFollow: (jid: string) => Promise<unknown>;
62
+ newsletterUnfollow: (jid: string) => Promise<unknown>;
63
+ newsletterMute: (jid: string) => Promise<unknown>;
64
+ newsletterUnmute: (jid: string) => Promise<unknown>;
112
65
  newsletterUpdateName: (jid: string, name: string) => Promise<unknown>;
113
66
  newsletterUpdateDescription: (jid: string, description: string) => Promise<unknown>;
114
67
  newsletterUpdatePicture: (jid: string, content: WAMediaUpload) => Promise<unknown>;
115
68
  newsletterRemovePicture: (jid: string) => Promise<unknown>;
116
- newsletterReactionMode: (jid: string, mode: string) => Promise<unknown>;
117
69
  newsletterReactMessage: (jid: string, serverId: string, reaction?: string) => Promise<void>;
118
- newsletterFetchMessages: {
119
- (type: "invite" | "jid", key: string, count: number, after?: number): Promise<any[]>;
120
- (jid: string, count: number, since?: number, after?: number): Promise<any[]>;
121
- };
122
- newsletterFetchUpdates: (jid: string, count: number, opts?: {
123
- since?: number;
124
- after?: number;
125
- decrypt?: boolean;
126
- }) => Promise<any[]>;
70
+ newsletterFetchMessages: (jid: string, count: number, since: number, after: number) => Promise<any>;
127
71
  subscribeNewsletterUpdates: (jid: string) => Promise<{
128
72
  duration: string;
129
73
  } | null>;
@@ -131,7 +75,6 @@ export declare const makeBusinessSocket: (config: SocketConfig) => {
131
75
  newsletterChangeOwner: (jid: string, newOwnerJid: string) => Promise<void>;
132
76
  newsletterDemote: (jid: string, userJid: string) => Promise<void>;
133
77
  newsletterDelete: (jid: string) => Promise<void>;
134
- newsletterAction: (jid: string, type: "follow" | "unfollow" | "mute" | "unmute") => Promise<void>;
135
78
  groupMetadata: (jid: string) => Promise<import("../index.js").GroupMetadata>;
136
79
  groupCreate: (subject: string, participants: string[]) => Promise<import("../index.js").GroupMetadata>;
137
80
  groupLeave: (id: string) => Promise<void>;
@@ -162,10 +105,6 @@ export declare const makeBusinessSocket: (config: SocketConfig) => {
162
105
  groupFetchAllParticipating: () => Promise<{
163
106
  [_: string]: import("../index.js").GroupMetadata;
164
107
  }>;
165
- getAdminStatus: (groupJid: string, senderJid?: string) => Promise<{
166
- isAdmin: boolean;
167
- isBotAdmin: boolean;
168
- }>;
169
108
  serverProps: {
170
109
  privacyTokenOn1to1: boolean;
171
110
  profilePicPrivacyToken: boolean;
@@ -195,15 +134,9 @@ export declare const makeBusinessSocket: (config: SocketConfig) => {
195
134
  fetchBlocklist: () => Promise<(string | undefined)[]>;
196
135
  fetchStatus: (...jids: string[]) => Promise<import("../index.js").USyncQueryResultList[] | undefined>;
197
136
  fetchDisappearingDuration: (...jids: string[]) => Promise<import("../index.js").USyncQueryResultList[] | undefined>;
198
- findUserId: (pnOrLid: string) => Promise<{
199
- phoneNumber: string;
200
- lid: string;
201
- }>;
202
137
  updateProfilePicture: (jid: string, content: WAMediaUpload, dimensions?: {
203
138
  width: number;
204
139
  height: number;
205
- }, options?: {
206
- full?: boolean;
207
140
  }) => Promise<void>;
208
141
  removeProfilePicture: (jid: string) => Promise<void>;
209
142
  updateProfileStatus: (status: string) => Promise<void>;
@@ -372,6 +372,7 @@ export const makeBusinessSocket = (config) => {
372
372
  productDelete,
373
373
  productUpdate,
374
374
  updateBussinesProfile,
375
+ updateBusinessProfile: updateBussinesProfile,
375
376
  updateCoverPhoto,
376
377
  removeCoverPhoto
377
378
  };
@@ -42,15 +42,9 @@ export declare const makeChatsSocket: (config: SocketConfig) => {
42
42
  fetchBlocklist: () => Promise<(string | undefined)[]>;
43
43
  fetchStatus: (...jids: string[]) => Promise<import("../WAUSync/index.js").USyncQueryResultList[] | undefined>;
44
44
  fetchDisappearingDuration: (...jids: string[]) => Promise<import("../WAUSync/index.js").USyncQueryResultList[] | undefined>;
45
- findUserId: (pnOrLid: string) => Promise<{
46
- phoneNumber: string;
47
- lid: string;
48
- }>;
49
45
  updateProfilePicture: (jid: string, content: WAMediaUpload, dimensions?: {
50
46
  width: number;
51
47
  height: number;
52
- }, options?: {
53
- full?: boolean;
54
48
  }) => Promise<void>;
55
49
  removeProfilePicture: (jid: string) => Promise<void>;
56
50
  updateProfileStatus: (status: string) => Promise<void>;