phantom-baileys 0.0.9 → 0.1.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (441) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +592 -0
  3. package/WAProto/GenerateStatics.sh +3 -0
  4. package/WAProto/WAProto.proto +5479 -0
  5. package/WAProto/fix-imports.js +81 -0
  6. package/WAProto/index.d.ts +5147 -41513
  7. package/WAProto/index.js +84008 -142014
  8. package/lib/Defaults/index.d.ts +29 -8
  9. package/lib/Defaults/index.d.ts.map +1 -0
  10. package/lib/Defaults/index.js +80 -60
  11. package/lib/Defaults/index.js.map +1 -0
  12. package/lib/Signal/Group/ciphertext-message.d.ts +10 -0
  13. package/lib/Signal/Group/ciphertext-message.d.ts.map +1 -0
  14. package/lib/Signal/Group/ciphertext-message.js +12 -0
  15. package/lib/Signal/Group/ciphertext-message.js.map +1 -0
  16. package/lib/Signal/Group/group-session-builder.d.ts +15 -0
  17. package/lib/Signal/Group/group-session-builder.d.ts.map +1 -0
  18. package/lib/Signal/Group/group-session-builder.js +30 -0
  19. package/lib/Signal/Group/group-session-builder.js.map +1 -0
  20. package/lib/Signal/Group/group_cipher.d.ts +17 -0
  21. package/lib/Signal/Group/group_cipher.d.ts.map +1 -0
  22. package/lib/Signal/Group/group_cipher.js +82 -0
  23. package/lib/Signal/Group/group_cipher.js.map +1 -0
  24. package/lib/Signal/Group/index.d.ts +12 -0
  25. package/lib/Signal/Group/index.d.ts.map +1 -0
  26. package/lib/Signal/Group/index.js +12 -0
  27. package/lib/Signal/Group/index.js.map +1 -0
  28. package/lib/Signal/Group/keyhelper.d.ts +11 -0
  29. package/lib/Signal/Group/keyhelper.d.ts.map +1 -0
  30. package/lib/Signal/Group/keyhelper.js +18 -0
  31. package/lib/Signal/Group/keyhelper.js.map +1 -0
  32. package/lib/Signal/Group/sender-chain-key.d.ts +14 -0
  33. package/lib/Signal/Group/sender-chain-key.d.ts.map +1 -0
  34. package/lib/Signal/Group/sender-chain-key.js +26 -0
  35. package/lib/Signal/Group/sender-chain-key.js.map +1 -0
  36. package/lib/Signal/Group/sender-key-distribution-message.d.ts +17 -0
  37. package/lib/Signal/Group/sender-key-distribution-message.d.ts.map +1 -0
  38. package/lib/Signal/Group/sender-key-distribution-message.js +63 -0
  39. package/lib/Signal/Group/sender-key-distribution-message.js.map +1 -0
  40. package/lib/Signal/Group/sender-key-message.d.ts +19 -0
  41. package/lib/Signal/Group/sender-key-message.d.ts.map +1 -0
  42. package/lib/Signal/Group/sender-key-message.js +66 -0
  43. package/lib/Signal/Group/sender-key-message.js.map +1 -0
  44. package/lib/Signal/Group/sender-key-name.d.ts +18 -0
  45. package/lib/Signal/Group/sender-key-name.d.ts.map +1 -0
  46. package/lib/Signal/Group/sender-key-name.js +48 -0
  47. package/lib/Signal/Group/sender-key-name.js.map +1 -0
  48. package/lib/Signal/Group/sender-key-record.d.ts +31 -0
  49. package/lib/Signal/Group/sender-key-record.d.ts.map +1 -0
  50. package/lib/Signal/Group/sender-key-record.js +41 -0
  51. package/lib/Signal/Group/sender-key-record.js.map +1 -0
  52. package/lib/Signal/Group/sender-key-state.d.ts +39 -0
  53. package/lib/Signal/Group/sender-key-state.d.ts.map +1 -0
  54. package/lib/Signal/Group/sender-key-state.js +84 -0
  55. package/lib/Signal/Group/sender-key-state.js.map +1 -0
  56. package/lib/Signal/Group/sender-message-key.d.ts +12 -0
  57. package/lib/Signal/Group/sender-message-key.d.ts.map +1 -0
  58. package/{WASignalGroup/sender_message_key.js → lib/Signal/Group/sender-message-key.js} +3 -16
  59. package/lib/Signal/Group/sender-message-key.js.map +1 -0
  60. package/lib/Signal/libsignal.d.ts +5 -3
  61. package/lib/Signal/libsignal.d.ts.map +1 -0
  62. package/lib/Signal/libsignal.js +331 -80
  63. package/lib/Signal/libsignal.js.map +1 -0
  64. package/lib/Signal/lid-mapping.d.ts +19 -0
  65. package/lib/Signal/lid-mapping.d.ts.map +1 -0
  66. package/lib/Signal/lid-mapping.js +271 -0
  67. package/lib/Signal/lid-mapping.js.map +1 -0
  68. package/lib/Socket/Client/index.d.ts +3 -3
  69. package/lib/Socket/Client/index.d.ts.map +1 -0
  70. package/lib/Socket/Client/index.js +3 -19
  71. package/lib/Socket/Client/index.js.map +1 -0
  72. package/lib/Socket/Client/{abstract-socket-client.d.ts → types.d.ts} +4 -5
  73. package/lib/Socket/Client/types.d.ts.map +1 -0
  74. package/lib/Socket/Client/types.js +11 -0
  75. package/lib/Socket/Client/types.js.map +1 -0
  76. package/lib/Socket/Client/{web-socket-client.d.ts → websocket.d.ts} +3 -2
  77. package/lib/Socket/Client/websocket.d.ts.map +1 -0
  78. package/lib/Socket/Client/websocket.js +54 -0
  79. package/lib/Socket/Client/websocket.js.map +1 -0
  80. package/lib/Socket/business.d.ts +184 -101
  81. package/lib/Socket/business.d.ts.map +1 -0
  82. package/lib/Socket/business.js +162 -43
  83. package/lib/Socket/business.js.map +1 -0
  84. package/lib/Socket/chats.d.ts +72 -42
  85. package/lib/Socket/chats.d.ts.map +1 -0
  86. package/lib/Socket/chats.js +340 -299
  87. package/lib/Socket/chats.js.map +1 -0
  88. package/lib/Socket/communities.d.ts +309 -0
  89. package/lib/Socket/communities.d.ts.map +1 -0
  90. package/lib/Socket/communities.js +431 -0
  91. package/lib/Socket/communities.js.map +1 -0
  92. package/lib/Socket/dugong.d.ts +79 -0
  93. package/lib/Socket/dugong.d.ts.map +1 -0
  94. package/lib/Socket/dugong.js +527 -0
  95. package/lib/Socket/dugong.js.map +1 -0
  96. package/lib/Socket/groups.d.ts +93 -58
  97. package/lib/Socket/groups.d.ts.map +1 -0
  98. package/lib/Socket/groups.js +96 -84
  99. package/lib/Socket/groups.js.map +1 -0
  100. package/lib/Socket/index.d.ts +232 -107
  101. package/lib/Socket/index.d.ts.map +1 -0
  102. package/lib/Socket/index.js +13 -10
  103. package/lib/Socket/index.js.map +1 -0
  104. package/lib/Socket/messages-recv.d.ts +170 -90
  105. package/lib/Socket/messages-recv.d.ts.map +1 -0
  106. package/lib/Socket/messages-recv.js +798 -462
  107. package/lib/Socket/messages-recv.js.map +1 -0
  108. package/lib/Socket/messages-send.d.ts +180 -99
  109. package/lib/Socket/messages-send.d.ts.map +1 -0
  110. package/lib/Socket/messages-send.js +833 -709
  111. package/lib/Socket/messages-send.js.map +1 -0
  112. package/lib/Socket/mex.d.ts +3 -0
  113. package/lib/Socket/mex.d.ts.map +1 -0
  114. package/lib/Socket/mex.js +42 -0
  115. package/lib/Socket/mex.js.map +1 -0
  116. package/lib/Socket/newsletter.d.ts +120 -75
  117. package/lib/Socket/newsletter.d.ts.map +1 -0
  118. package/lib/Socket/newsletter.js +227 -198
  119. package/lib/Socket/newsletter.js.map +1 -0
  120. package/lib/Socket/socket.d.ts +31 -20
  121. package/lib/Socket/socket.d.ts.map +1 -0
  122. package/lib/Socket/socket.js +508 -215
  123. package/lib/Socket/socket.js.map +1 -0
  124. package/lib/Types/Auth.d.ts +18 -11
  125. package/lib/Types/Auth.d.ts.map +1 -0
  126. package/lib/Types/Auth.js +2 -2
  127. package/lib/Types/Auth.js.map +1 -0
  128. package/lib/Types/Bussines.d.ts +25 -0
  129. package/lib/Types/Bussines.d.ts.map +1 -0
  130. package/lib/Types/Bussines.js +2 -0
  131. package/lib/Types/Bussines.js.map +1 -0
  132. package/lib/Types/Call.d.ts +2 -0
  133. package/lib/Types/Call.d.ts.map +1 -0
  134. package/lib/Types/Call.js +2 -2
  135. package/lib/Types/Call.js.map +1 -0
  136. package/lib/Types/Chat.d.ts +24 -8
  137. package/lib/Types/Chat.d.ts.map +1 -0
  138. package/lib/Types/Chat.js +8 -4
  139. package/lib/Types/Chat.js.map +1 -0
  140. package/lib/Types/Contact.d.ts +6 -1
  141. package/lib/Types/Contact.d.ts.map +1 -0
  142. package/lib/Types/Contact.js +2 -2
  143. package/lib/Types/Contact.js.map +1 -0
  144. package/lib/Types/Events.d.ts +82 -17
  145. package/lib/Types/Events.d.ts.map +1 -0
  146. package/lib/Types/Events.js +2 -2
  147. package/lib/Types/Events.js.map +1 -0
  148. package/lib/Types/GroupMetadata.d.ts +15 -3
  149. package/lib/Types/GroupMetadata.d.ts.map +1 -0
  150. package/lib/Types/GroupMetadata.js +2 -2
  151. package/lib/Types/GroupMetadata.js.map +1 -0
  152. package/lib/Types/Label.d.ts +1 -0
  153. package/lib/Types/Label.d.ts.map +1 -0
  154. package/lib/Types/Label.js +3 -5
  155. package/lib/Types/Label.js.map +1 -0
  156. package/lib/Types/LabelAssociation.d.ts +1 -0
  157. package/lib/Types/LabelAssociation.d.ts.map +1 -0
  158. package/lib/Types/LabelAssociation.js +3 -5
  159. package/lib/Types/LabelAssociation.js.map +1 -0
  160. package/lib/Types/Message.d.ts +77 -202
  161. package/lib/Types/Message.d.ts.map +1 -0
  162. package/lib/Types/Message.js +11 -9
  163. package/lib/Types/Message.js.map +1 -0
  164. package/lib/Types/Newsletter.d.ts +128 -85
  165. package/lib/Types/Newsletter.d.ts.map +1 -0
  166. package/lib/Types/Newsletter.js +25 -26
  167. package/lib/Types/Newsletter.js.map +1 -0
  168. package/lib/Types/Product.d.ts +2 -1
  169. package/lib/Types/Product.d.ts.map +1 -0
  170. package/lib/Types/Product.js +2 -2
  171. package/lib/Types/Product.js.map +1 -0
  172. package/lib/Types/Signal.d.ts +20 -1
  173. package/lib/Types/Signal.d.ts.map +1 -0
  174. package/lib/Types/Signal.js +2 -2
  175. package/lib/Types/Signal.js.map +1 -0
  176. package/lib/Types/Socket.d.ts +41 -24
  177. package/lib/Types/Socket.d.ts.map +1 -0
  178. package/lib/Types/Socket.js +3 -2
  179. package/lib/Types/Socket.js.map +1 -0
  180. package/lib/Types/State.d.ts +14 -2
  181. package/lib/Types/State.d.ts.map +1 -0
  182. package/lib/Types/State.js +13 -2
  183. package/lib/Types/State.js.map +1 -0
  184. package/lib/Types/USync.d.ts +3 -2
  185. package/lib/Types/USync.d.ts.map +1 -0
  186. package/lib/Types/USync.js +2 -2
  187. package/lib/Types/USync.js.map +1 -0
  188. package/lib/Types/index.d.ts +15 -16
  189. package/lib/Types/index.d.ts.map +1 -0
  190. package/lib/Types/index.js +15 -31
  191. package/lib/Types/index.js.map +1 -0
  192. package/lib/Utils/auth-utils.d.ts +7 -6
  193. package/lib/Utils/auth-utils.d.ts.map +1 -0
  194. package/lib/Utils/auth-utils.js +228 -165
  195. package/lib/Utils/auth-utils.js.map +1 -0
  196. package/lib/Utils/browser-utils.d.ts +4 -0
  197. package/lib/Utils/browser-utils.d.ts.map +1 -0
  198. package/lib/Utils/browser-utils.js +28 -0
  199. package/lib/Utils/browser-utils.js.map +1 -0
  200. package/lib/Utils/business.d.ts +4 -3
  201. package/lib/Utils/business.d.ts.map +1 -0
  202. package/lib/Utils/business.js +66 -69
  203. package/lib/Utils/business.js.map +1 -0
  204. package/lib/Utils/chat-utils.d.ts +16 -16
  205. package/lib/Utils/chat-utils.d.ts.map +1 -0
  206. package/lib/Utils/chat-utils.js +299 -232
  207. package/lib/Utils/chat-utils.js.map +1 -0
  208. package/lib/Utils/crypto.d.ts +18 -21
  209. package/lib/Utils/crypto.d.ts.map +1 -0
  210. package/lib/Utils/crypto.js +44 -125
  211. package/lib/Utils/crypto.js.map +1 -0
  212. package/lib/Utils/decode-wa-message.d.ts +20 -8
  213. package/lib/Utils/decode-wa-message.d.ts.map +1 -0
  214. package/lib/Utils/decode-wa-message.js +139 -90
  215. package/lib/Utils/decode-wa-message.js.map +1 -0
  216. package/lib/Utils/event-buffer.d.ts +7 -8
  217. package/lib/Utils/event-buffer.d.ts.map +1 -0
  218. package/lib/Utils/event-buffer.js +129 -72
  219. package/lib/Utils/event-buffer.js.map +1 -0
  220. package/lib/Utils/generics.d.ts +25 -22
  221. package/lib/Utils/generics.d.ts.map +1 -0
  222. package/lib/Utils/generics.js +157 -175
  223. package/lib/Utils/generics.js.map +1 -0
  224. package/lib/Utils/history.d.ts +14 -11
  225. package/lib/Utils/history.d.ts.map +1 -0
  226. package/lib/Utils/history.js +83 -46
  227. package/lib/Utils/history.js.map +1 -0
  228. package/lib/Utils/identity-change-handler.d.ts +37 -0
  229. package/lib/Utils/identity-change-handler.d.ts.map +1 -0
  230. package/lib/Utils/identity-change-handler.js +49 -0
  231. package/lib/Utils/identity-change-handler.js.map +1 -0
  232. package/lib/Utils/index.d.ts +22 -17
  233. package/lib/Utils/index.d.ts.map +1 -0
  234. package/lib/Utils/index.js +22 -33
  235. package/lib/Utils/index.js.map +1 -0
  236. package/lib/Utils/link-preview.d.ts +5 -5
  237. package/lib/Utils/link-preview.d.ts.map +1 -0
  238. package/lib/Utils/link-preview.js +14 -22
  239. package/lib/Utils/link-preview.js.map +1 -0
  240. package/lib/Utils/logger.d.ts +12 -1
  241. package/lib/Utils/logger.d.ts.map +1 -0
  242. package/lib/Utils/logger.js +3 -7
  243. package/lib/Utils/logger.js.map +1 -0
  244. package/lib/Utils/lt-hash.d.ts +8 -12
  245. package/lib/Utils/lt-hash.d.ts.map +1 -0
  246. package/lib/Utils/lt-hash.js +3 -46
  247. package/lib/Utils/lt-hash.js.map +1 -0
  248. package/lib/Utils/make-mutex.d.ts +2 -0
  249. package/lib/Utils/make-mutex.d.ts.map +1 -0
  250. package/lib/Utils/make-mutex.js +24 -34
  251. package/lib/Utils/make-mutex.js.map +1 -0
  252. package/lib/Utils/message-retry-manager.d.ts +110 -0
  253. package/lib/Utils/message-retry-manager.d.ts.map +1 -0
  254. package/lib/Utils/message-retry-manager.js +225 -0
  255. package/lib/Utils/message-retry-manager.js.map +1 -0
  256. package/lib/Utils/messages-media.d.ts +59 -42
  257. package/lib/Utils/messages-media.d.ts.map +1 -0
  258. package/lib/Utils/messages-media.js +411 -356
  259. package/lib/Utils/messages-media.js.map +1 -0
  260. package/lib/Utils/messages.d.ts +32 -18
  261. package/lib/Utils/messages.d.ts.map +1 -0
  262. package/lib/Utils/messages.js +412 -723
  263. package/lib/Utils/messages.js.map +1 -0
  264. package/lib/Utils/noise-handler.d.ts +13 -13
  265. package/lib/Utils/noise-handler.d.ts.map +1 -0
  266. package/lib/Utils/noise-handler.js +149 -108
  267. package/lib/Utils/noise-handler.js.map +1 -0
  268. package/lib/Utils/offline-node-processor.d.ts +17 -0
  269. package/lib/Utils/offline-node-processor.d.ts.map +1 -0
  270. package/lib/Utils/offline-node-processor.js +40 -0
  271. package/lib/Utils/offline-node-processor.js.map +1 -0
  272. package/lib/Utils/pre-key-manager.d.ts +28 -0
  273. package/lib/Utils/pre-key-manager.d.ts.map +1 -0
  274. package/lib/Utils/pre-key-manager.js +106 -0
  275. package/lib/Utils/pre-key-manager.js.map +1 -0
  276. package/lib/Utils/process-message.d.ts +30 -11
  277. package/lib/Utils/process-message.d.ts.map +1 -0
  278. package/lib/Utils/process-message.js +321 -166
  279. package/lib/Utils/process-message.js.map +1 -0
  280. package/lib/Utils/reporting-utils.d.ts +11 -0
  281. package/lib/Utils/reporting-utils.d.ts.map +1 -0
  282. package/lib/Utils/reporting-utils.js +258 -0
  283. package/lib/Utils/reporting-utils.js.map +1 -0
  284. package/lib/Utils/rich-messages.d.ts +129 -0
  285. package/lib/Utils/rich-messages.d.ts.map +1 -0
  286. package/lib/Utils/rich-messages.js +455 -0
  287. package/lib/Utils/rich-messages.js.map +1 -0
  288. package/lib/Utils/signal.d.ts +7 -6
  289. package/lib/Utils/signal.d.ts.map +1 -0
  290. package/lib/Utils/signal.js +65 -65
  291. package/lib/Utils/signal.js.map +1 -0
  292. package/lib/Utils/stanza-ack.d.ts +11 -0
  293. package/lib/Utils/stanza-ack.d.ts.map +1 -0
  294. package/lib/Utils/stanza-ack.js +38 -0
  295. package/lib/Utils/stanza-ack.js.map +1 -0
  296. package/lib/Utils/sync-action-utils.d.ts +19 -0
  297. package/lib/Utils/sync-action-utils.d.ts.map +1 -0
  298. package/lib/Utils/sync-action-utils.js +48 -0
  299. package/lib/Utils/sync-action-utils.js.map +1 -0
  300. package/lib/Utils/tc-token-utils.d.ts +12 -0
  301. package/lib/Utils/tc-token-utils.d.ts.map +1 -0
  302. package/lib/Utils/tc-token-utils.js +18 -0
  303. package/lib/Utils/tc-token-utils.js.map +1 -0
  304. package/lib/Utils/use-multi-file-auth-state.d.ts +2 -1
  305. package/lib/Utils/use-multi-file-auth-state.d.ts.map +1 -0
  306. package/lib/Utils/use-multi-file-auth-state.js +79 -253
  307. package/lib/Utils/use-multi-file-auth-state.js.map +1 -0
  308. package/lib/Utils/validate-connection.d.ts +6 -6
  309. package/lib/Utils/validate-connection.d.ts.map +1 -0
  310. package/lib/Utils/validate-connection.js +111 -116
  311. package/lib/Utils/validate-connection.js.map +1 -0
  312. package/lib/WABinary/constants.d.ts +5 -4
  313. package/lib/WABinary/constants.d.ts.map +1 -0
  314. package/lib/WABinary/constants.js +1281 -20
  315. package/lib/WABinary/constants.js.map +1 -0
  316. package/lib/WABinary/decode.d.ts +4 -3
  317. package/lib/WABinary/decode.d.ts.map +1 -0
  318. package/lib/WABinary/decode.js +51 -53
  319. package/lib/WABinary/decode.js.map +1 -0
  320. package/lib/WABinary/encode.d.ts +2 -1
  321. package/lib/WABinary/encode.d.ts.map +1 -0
  322. package/lib/WABinary/encode.js +12 -44
  323. package/lib/WABinary/encode.js.map +1 -0
  324. package/lib/WABinary/generic-utils.d.ts +9 -6
  325. package/lib/WABinary/generic-utils.d.ts.map +1 -0
  326. package/lib/WABinary/generic-utils.js +124 -43
  327. package/lib/WABinary/generic-utils.js.map +1 -0
  328. package/lib/WABinary/index.d.ts +6 -5
  329. package/lib/WABinary/index.d.ts.map +1 -0
  330. package/lib/WABinary/index.js +6 -21
  331. package/lib/WABinary/index.js.map +1 -0
  332. package/lib/WABinary/jid-utils.d.ts +24 -7
  333. package/lib/WABinary/jid-utils.d.ts.map +1 -0
  334. package/lib/WABinary/jid-utils.js +74 -40
  335. package/lib/WABinary/jid-utils.js.map +1 -0
  336. package/lib/WABinary/types.d.ts +2 -1
  337. package/lib/WABinary/types.d.ts.map +1 -0
  338. package/lib/WABinary/types.js +2 -2
  339. package/lib/WABinary/types.js.map +1 -0
  340. package/lib/WAM/BinaryInfo.d.ts +2 -1
  341. package/lib/WAM/BinaryInfo.d.ts.map +1 -0
  342. package/lib/WAM/BinaryInfo.js +2 -5
  343. package/lib/WAM/BinaryInfo.js.map +1 -0
  344. package/lib/WAM/constants.d.ts +5 -3
  345. package/lib/WAM/constants.d.ts.map +1 -0
  346. package/lib/WAM/constants.js +19071 -11568
  347. package/lib/WAM/constants.js.map +1 -0
  348. package/lib/WAM/encode.d.ts +3 -2
  349. package/lib/WAM/encode.d.ts.map +1 -0
  350. package/lib/WAM/encode.js +17 -22
  351. package/lib/WAM/encode.js.map +1 -0
  352. package/lib/WAM/index.d.ts +4 -3
  353. package/lib/WAM/index.d.ts.map +1 -0
  354. package/lib/WAM/index.js +4 -19
  355. package/lib/WAM/index.js.map +1 -0
  356. package/lib/WAProto/fix-imports.d.ts +1 -0
  357. package/lib/WAProto/fix-imports.js +71 -0
  358. package/lib/WAProto/index.js +89345 -0
  359. package/lib/WAUSync/Protocols/USyncContactProtocol.d.ts +4 -3
  360. package/lib/WAUSync/Protocols/USyncContactProtocol.d.ts.map +1 -0
  361. package/lib/WAUSync/Protocols/USyncContactProtocol.js +8 -11
  362. package/lib/WAUSync/Protocols/USyncContactProtocol.js.map +1 -0
  363. package/lib/WAUSync/Protocols/USyncDeviceProtocol.d.ts +3 -2
  364. package/lib/WAUSync/Protocols/USyncDeviceProtocol.d.ts.map +1 -0
  365. package/lib/WAUSync/Protocols/USyncDeviceProtocol.js +11 -14
  366. package/lib/WAUSync/Protocols/USyncDeviceProtocol.js.map +1 -0
  367. package/lib/WAUSync/Protocols/USyncDisappearingModeProtocol.d.ts +3 -2
  368. package/lib/WAUSync/Protocols/USyncDisappearingModeProtocol.d.ts.map +1 -0
  369. package/lib/WAUSync/Protocols/USyncDisappearingModeProtocol.js +9 -12
  370. package/lib/WAUSync/Protocols/USyncDisappearingModeProtocol.js.map +1 -0
  371. package/lib/WAUSync/Protocols/USyncStatusProtocol.d.ts +3 -2
  372. package/lib/WAUSync/Protocols/USyncStatusProtocol.d.ts.map +1 -0
  373. package/lib/WAUSync/Protocols/USyncStatusProtocol.js +9 -13
  374. package/lib/WAUSync/Protocols/USyncStatusProtocol.js.map +1 -0
  375. package/lib/WAUSync/Protocols/UsyncBotProfileProtocol.d.ts +4 -3
  376. package/lib/WAUSync/Protocols/UsyncBotProfileProtocol.d.ts.map +1 -0
  377. package/lib/WAUSync/Protocols/UsyncBotProfileProtocol.js +20 -22
  378. package/lib/WAUSync/Protocols/UsyncBotProfileProtocol.js.map +1 -0
  379. package/lib/WAUSync/Protocols/UsyncLIDProtocol.d.ts +5 -3
  380. package/lib/WAUSync/Protocols/UsyncLIDProtocol.d.ts.map +1 -0
  381. package/lib/WAUSync/Protocols/UsyncLIDProtocol.js +13 -8
  382. package/lib/WAUSync/Protocols/UsyncLIDProtocol.js.map +1 -0
  383. package/lib/WAUSync/Protocols/index.d.ts +5 -4
  384. package/lib/WAUSync/Protocols/index.d.ts.map +1 -0
  385. package/lib/WAUSync/Protocols/index.js +5 -20
  386. package/lib/WAUSync/Protocols/index.js.map +1 -0
  387. package/lib/WAUSync/USyncQuery.d.ts +5 -4
  388. package/lib/WAUSync/USyncQuery.d.ts.map +1 -0
  389. package/lib/WAUSync/USyncQuery.js +40 -35
  390. package/lib/WAUSync/USyncQuery.js.map +1 -0
  391. package/lib/WAUSync/USyncUser.d.ts +7 -4
  392. package/lib/WAUSync/USyncUser.d.ts.map +1 -0
  393. package/lib/WAUSync/USyncUser.js +2 -5
  394. package/lib/WAUSync/USyncUser.js.map +1 -0
  395. package/lib/WAUSync/index.d.ts +4 -3
  396. package/lib/WAUSync/index.d.ts.map +1 -0
  397. package/lib/WAUSync/index.js +4 -19
  398. package/lib/WAUSync/index.js.map +1 -0
  399. package/lib/index.d.ts +13 -0
  400. package/lib/index.d.ts.map +1 -0
  401. package/lib/index.js +16 -31
  402. package/lib/index.js.map +1 -0
  403. package/package.json +35 -75
  404. package/Readme.md +0 -1
  405. package/WASignalGroup/GroupProtocol.js +0 -1697
  406. package/WASignalGroup/ciphertext_message.js +0 -16
  407. package/WASignalGroup/group_cipher.js +0 -120
  408. package/WASignalGroup/group_session_builder.js +0 -46
  409. package/WASignalGroup/index.js +0 -5
  410. package/WASignalGroup/keyhelper.js +0 -21
  411. package/WASignalGroup/protobufs.js +0 -3
  412. package/WASignalGroup/queue_job.js +0 -69
  413. package/WASignalGroup/sender_chain_key.js +0 -50
  414. package/WASignalGroup/sender_key_distribution_message.js +0 -78
  415. package/WASignalGroup/sender_key_message.js +0 -92
  416. package/WASignalGroup/sender_key_name.js +0 -70
  417. package/WASignalGroup/sender_key_record.js +0 -56
  418. package/WASignalGroup/sender_key_state.js +0 -129
  419. package/lib/Defaults/baileys-version.json +0 -3
  420. package/lib/Socket/Client/abstract-socket-client.js +0 -13
  421. package/lib/Socket/Client/mobile-socket-client.d.ts +0 -13
  422. package/lib/Socket/Client/mobile-socket-client.js +0 -65
  423. package/lib/Socket/Client/web-socket-client.js +0 -62
  424. package/lib/Socket/registration.d.ts +0 -264
  425. package/lib/Socket/registration.js +0 -166
  426. package/lib/Socket/usync.d.ts +0 -37
  427. package/lib/Socket/usync.js +0 -70
  428. package/lib/Store/index.d.ts +0 -3
  429. package/lib/Store/index.js +0 -10
  430. package/lib/Store/make-cache-manager-store.d.ts +0 -14
  431. package/lib/Store/make-cache-manager-store.js +0 -83
  432. package/lib/Store/make-in-memory-store.d.ts +0 -118
  433. package/lib/Store/make-in-memory-store.js +0 -431
  434. package/lib/Store/make-ordered-dictionary.d.ts +0 -13
  435. package/lib/Store/make-ordered-dictionary.js +0 -81
  436. package/lib/Store/object-repository.d.ts +0 -10
  437. package/lib/Store/object-repository.js +0 -27
  438. package/lib/Utils/baileys-event-stream.d.ts +0 -16
  439. package/lib/Utils/baileys-event-stream.js +0 -63
  440. package/lib/Utils/use-single-file-auth-state.d.ts +0 -12
  441. package/lib/Utils/use-single-file-auth-state.js +0 -75
@@ -1,129 +0,0 @@
1
- const SenderChainKey = require('./sender_chain_key');
2
- const SenderMessageKey = require('./sender_message_key');
3
-
4
- const protobufs = require('./protobufs');
5
-
6
- class SenderKeyState {
7
- MAX_MESSAGE_KEYS = 2000;
8
-
9
- constructor(
10
- id = null,
11
- iteration = null,
12
- chainKey = null,
13
- signatureKeyPair = null,
14
- signatureKeyPublic = null,
15
- signatureKeyPrivate = null,
16
- senderKeyStateStructure = null
17
- ) {
18
- if (senderKeyStateStructure) {
19
- this.senderKeyStateStructure = senderKeyStateStructure;
20
- } else {
21
- if (signatureKeyPair) {
22
- signatureKeyPublic = signatureKeyPair.public;
23
- signatureKeyPrivate = signatureKeyPair.private;
24
- }
25
-
26
- chainKey = typeof chainKey === 'string' ? Buffer.from(chainKey, 'base64') : chainKey;
27
- this.senderKeyStateStructure = protobufs.SenderKeyStateStructure.create();
28
- const senderChainKeyStructure = protobufs.SenderChainKey.create();
29
- senderChainKeyStructure.iteration = iteration;
30
- senderChainKeyStructure.seed = chainKey;
31
- this.senderKeyStateStructure.senderChainKey = senderChainKeyStructure;
32
-
33
- const signingKeyStructure = protobufs.SenderSigningKey.create();
34
- signingKeyStructure.public =
35
- typeof signatureKeyPublic === 'string' ?
36
- Buffer.from(signatureKeyPublic, 'base64') :
37
- signatureKeyPublic;
38
- if (signatureKeyPrivate) {
39
- signingKeyStructure.private =
40
- typeof signatureKeyPrivate === 'string' ?
41
- Buffer.from(signatureKeyPrivate, 'base64') :
42
- signatureKeyPrivate;
43
- }
44
- this.senderKeyStateStructure.senderKeyId = id;
45
- this.senderChainKey = senderChainKeyStructure;
46
- this.senderKeyStateStructure.senderSigningKey = signingKeyStructure;
47
- }
48
- this.senderKeyStateStructure.senderMessageKeys =
49
- this.senderKeyStateStructure.senderMessageKeys || [];
50
- }
51
-
52
- SenderKeyState(senderKeyStateStructure) {
53
- this.senderKeyStateStructure = senderKeyStateStructure;
54
- }
55
-
56
- getKeyId() {
57
- return this.senderKeyStateStructure.senderKeyId;
58
- }
59
-
60
- getSenderChainKey() {
61
- return new SenderChainKey(
62
- this.senderKeyStateStructure.senderChainKey.iteration,
63
- this.senderKeyStateStructure.senderChainKey.seed
64
- );
65
- }
66
-
67
- setSenderChainKey(chainKey) {
68
- const senderChainKeyStructure = protobufs.SenderChainKey.create({
69
- iteration: chainKey.getIteration(),
70
- seed: chainKey.getSeed(),
71
- });
72
- this.senderKeyStateStructure.senderChainKey = senderChainKeyStructure;
73
- }
74
-
75
- getSigningKeyPublic() {
76
- return typeof this.senderKeyStateStructure.senderSigningKey.public === 'string' ?
77
- Buffer.from(this.senderKeyStateStructure.senderSigningKey.public, 'base64') :
78
- this.senderKeyStateStructure.senderSigningKey.public;
79
- }
80
-
81
- getSigningKeyPrivate() {
82
- return typeof this.senderKeyStateStructure.senderSigningKey.private === 'string' ?
83
- Buffer.from(this.senderKeyStateStructure.senderSigningKey.private, 'base64') :
84
- this.senderKeyStateStructure.senderSigningKey.private;
85
- }
86
-
87
- hasSenderMessageKey(iteration) {
88
- const list = this.senderKeyStateStructure.senderMessageKeys;
89
- for (let o = 0; o < list.length; o++) {
90
- const senderMessageKey = list[o];
91
- if (senderMessageKey.iteration === iteration) return true;
92
- }
93
- return false;
94
- }
95
-
96
- addSenderMessageKey(senderMessageKey) {
97
- const senderMessageKeyStructure = protobufs.SenderKeyStateStructure.create({
98
- iteration: senderMessageKey.getIteration(),
99
- seed: senderMessageKey.getSeed(),
100
- });
101
- this.senderKeyStateStructure.senderMessageKeys.push(senderMessageKeyStructure);
102
-
103
- if (this.senderKeyStateStructure.senderMessageKeys.length > this.MAX_MESSAGE_KEYS) {
104
- this.senderKeyStateStructure.senderMessageKeys.shift();
105
- }
106
- }
107
-
108
- removeSenderMessageKey(iteration) {
109
- let result = null;
110
-
111
- this.senderKeyStateStructure.senderMessageKeys = this.senderKeyStateStructure.senderMessageKeys.filter(
112
- senderMessageKey => {
113
- if (senderMessageKey.iteration === iteration) result = senderMessageKey;
114
- return senderMessageKey.iteration !== iteration;
115
- }
116
- );
117
-
118
- if (result != null) {
119
- return new SenderMessageKey(result.iteration, result.seed);
120
- }
121
- return null;
122
- }
123
-
124
- getStructure() {
125
- return this.senderKeyStateStructure;
126
- }
127
- }
128
-
129
- module.exports = SenderKeyState;
@@ -1,3 +0,0 @@
1
- {
2
- "version": [2, 3000, 1020608496]
3
- }
@@ -1,13 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.AbstractSocketClient = void 0;
4
- const events_1 = require("events");
5
- class AbstractSocketClient extends events_1.EventEmitter {
6
- constructor(url, config) {
7
- super();
8
- this.url = url;
9
- this.config = config;
10
- this.setMaxListeners(0);
11
- }
12
- }
13
- exports.AbstractSocketClient = AbstractSocketClient;
@@ -1,13 +0,0 @@
1
- /// <reference types="node" />
2
- import { Socket } from 'net';
3
- import { AbstractSocketClient } from './abstract-socket-client';
4
- export declare class MobileSocketClient extends AbstractSocketClient {
5
- protected socket: Socket | null;
6
- get isOpen(): boolean;
7
- get isClosed(): boolean;
8
- get isClosing(): boolean;
9
- get isConnecting(): boolean;
10
- connect(): Promise<void>;
11
- close(): Promise<void>;
12
- send(str: string | Uint8Array, cb?: (err?: Error) => void): boolean;
13
- }
@@ -1,65 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.MobileSocketClient = void 0;
4
- const net_1 = require("net");
5
- const abstract_socket_client_1 = require("./abstract-socket-client");
6
- class MobileSocketClient extends abstract_socket_client_1.AbstractSocketClient {
7
- constructor() {
8
- super(...arguments);
9
- this.socket = null;
10
- }
11
- get isOpen() {
12
- var _a;
13
- return ((_a = this.socket) === null || _a === void 0 ? void 0 : _a.readyState) === 'open';
14
- }
15
- get isClosed() {
16
- var _a;
17
- return this.socket === null || ((_a = this.socket) === null || _a === void 0 ? void 0 : _a.readyState) === 'closed';
18
- }
19
- get isClosing() {
20
- var _a;
21
- return this.socket === null || ((_a = this.socket) === null || _a === void 0 ? void 0 : _a.readyState) === 'closed';
22
- }
23
- get isConnecting() {
24
- var _a;
25
- return ((_a = this.socket) === null || _a === void 0 ? void 0 : _a.readyState) === 'opening';
26
- }
27
- async connect() {
28
- var _a;
29
- if (this.socket) {
30
- return;
31
- }
32
- if (this.config.agent) {
33
- throw new Error('There are not support for proxy agent for mobile connection');
34
- }
35
- else {
36
- this.socket = (0, net_1.connect)({
37
- host: this.url.hostname,
38
- port: Number(this.url.port) || 443
39
- });
40
- }
41
- this.socket.setMaxListeners(0);
42
- const events = ['close', 'connect', 'data', 'drain', 'end', 'error', 'lookup', 'ready', 'timeout'];
43
- for (const event of events) {
44
- (_a = this.socket) === null || _a === void 0 ? void 0 : _a.on(event, (...args) => this.emit(event, ...args));
45
- }
46
- this.socket.on('data', (...args) => this.emit('message', ...args));
47
- this.socket.on('ready', (...args) => this.emit('open', ...args));
48
- }
49
- async close() {
50
- if (!this.socket) {
51
- return;
52
- }
53
- return new Promise(resolve => {
54
- this.socket.end(resolve);
55
- this.socket = null;
56
- });
57
- }
58
- send(str, cb) {
59
- if (this.socket === null) {
60
- return false;
61
- }
62
- return this.socket.write(str, undefined, cb);
63
- }
64
- }
65
- exports.MobileSocketClient = MobileSocketClient;
@@ -1,62 +0,0 @@
1
- "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.WebSocketClient = void 0;
7
- const ws_1 = __importDefault(require("ws"));
8
- const Defaults_1 = require("../../Defaults");
9
- const abstract_socket_client_1 = require("./abstract-socket-client");
10
- class WebSocketClient extends abstract_socket_client_1.AbstractSocketClient {
11
- constructor() {
12
- super(...arguments);
13
- this.socket = null;
14
- }
15
- get isOpen() {
16
- var _a;
17
- return ((_a = this.socket) === null || _a === void 0 ? void 0 : _a.readyState) === ws_1.default.OPEN;
18
- }
19
- get isClosed() {
20
- var _a;
21
- return this.socket === null || ((_a = this.socket) === null || _a === void 0 ? void 0 : _a.readyState) === ws_1.default.CLOSED;
22
- }
23
- get isClosing() {
24
- var _a;
25
- return this.socket === null || ((_a = this.socket) === null || _a === void 0 ? void 0 : _a.readyState) === ws_1.default.CLOSING;
26
- }
27
- get isConnecting() {
28
- var _a;
29
- return ((_a = this.socket) === null || _a === void 0 ? void 0 : _a.readyState) === ws_1.default.CONNECTING;
30
- }
31
- async connect() {
32
- var _a, _b;
33
- if (this.socket) {
34
- return;
35
- }
36
- this.socket = new ws_1.default(this.url, {
37
- origin: Defaults_1.DEFAULT_ORIGIN,
38
- headers: (_a = this.config.options) === null || _a === void 0 ? void 0 : _a.headers,
39
- handshakeTimeout: this.config.connectTimeoutMs,
40
- timeout: this.config.connectTimeoutMs,
41
- agent: this.config.agent,
42
- });
43
- this.socket.setMaxListeners(0);
44
- const events = ['close', 'error', 'upgrade', 'message', 'open', 'ping', 'pong', 'unexpected-response'];
45
- for (const event of events) {
46
- (_b = this.socket) === null || _b === void 0 ? void 0 : _b.on(event, (...args) => this.emit(event, ...args));
47
- }
48
- }
49
- async close() {
50
- if (!this.socket) {
51
- return;
52
- }
53
- this.socket.close();
54
- this.socket = null;
55
- }
56
- send(str, cb) {
57
- var _a;
58
- (_a = this.socket) === null || _a === void 0 ? void 0 : _a.send(str, cb);
59
- return Boolean(this.socket);
60
- }
61
- }
62
- exports.WebSocketClient = WebSocketClient;
@@ -1,264 +0,0 @@
1
- import axios, { AxiosRequestConfig } from 'axios';
2
- import { KeyPair, SignedKeyPair, SocketConfig } from '../Types';
3
- export declare const makeRegistrationSocket: (config: SocketConfig) => {
4
- register: (code: string) => Promise<ExistsResponse>;
5
- requestRegistrationCode: (registrationOptions?: RegistrationOptions) => Promise<ExistsResponse>;
6
- logger: Logger;
7
- getOrderDetails: (orderId: string, tokenBase64: string) => Promise<import("../Types").OrderDetails>;
8
- getCatalog: ({ jid, limit, cursor }: import("../Types").GetCatalogOptions) => Promise<{
9
- products: import("../Types").Product[];
10
- nextPageCursor: any;
11
- }>;
12
- getCollections: (jid?: string, limit?: number) => Promise<{
13
- collections: import("../Types").CatalogCollection[];
14
- }>;
15
- productCreate: (create: import("../Types").ProductCreate) => Promise<import("../Types").Product>;
16
- productDelete: (productIds: string[]) => Promise<{
17
- deleted: number;
18
- }>;
19
- productUpdate: (productId: string, update: import("../Types").ProductUpdate) => Promise<import("../Types").Product>;
20
- sendMessageAck: ({ tag, attrs, content }: import("../WABinary").BinaryNode, errorCode?: number) => Promise<void>;
21
- sendRetryRequest: (node: import("../WABinary").BinaryNode, forceIncludeKeys?: boolean) => Promise<void>;
22
- offerCall: (toJid: string, isVideo?: boolean) => Promise<{
23
- id: any;
24
- to: string;
25
- }>;
26
- rejectCall: (callId: string, callFrom: string) => Promise<void>;
27
- fetchMessageHistory: (count: number, oldestMsgKey: import("../Types").WAMessageKey, oldestMsgTimestamp: number) => Promise<string>;
28
- requestPlaceholderResend: (messageKey: import("../Types").WAMessageKey) => Promise<string | undefined>;
29
- getPrivacyTokens: (jids: string[]) => Promise<import("../WABinary").BinaryNode>;
30
- assertSessions: (jids: string[], force: boolean) => Promise<boolean>;
31
- relayMessage: (jid: string, message: import("../Types").WAProto.IMessage, { messageId: msgId, participant, additionalAttributes, additionalNodes, useUserDevicesCache, cachedGroupMetadata, statusJidList }: import("../Types").MessageRelayOptions) => Promise<string>;
32
- sendReceipt: (jid: string, participant: string | undefined, messageIds: string[], type: import("../Types").MessageReceiptType) => Promise<void>;
33
- sendReceipts: (keys: import("../Types").WAMessageKey[], type: import("../Types").MessageReceiptType) => Promise<void>;
34
- getButtonArgs: (message: import("../Types").WAProto.IMessage) => import("../WABinary").BinaryNode["attrs"];
35
- readMessages: (keys: import("../Types").WAMessageKey[]) => Promise<void>;
36
- refreshMediaConn: (forceGet?: boolean) => Promise<import("../Types").MediaConnInfo>;
37
- getUSyncDevices: (jids: string[], useCache: boolean, ignoreZeroDevices: boolean) => Promise<import("../WABinary").JidWithDevice[]>;
38
- sendPeerDataOperationMessage: (pdoMessage: import("../Types").WAProto.Message.IPeerDataOperationRequestMessage) => Promise<string>;
39
- createParticipantNodes: (jids: string[], message: import("../Types").WAProto.IMessage, extraAttrs?: import("../WABinary").BinaryNode["attrs"]) => Promise<{
40
- nodes: import("../WABinary").BinaryNode[];
41
- shouldIncludeDeviceIdentity: boolean;
42
- }>;
43
- waUploadToServer: import("../Types").WAMediaUploadFunction;
44
- fetchPrivacySettings: (force?: boolean) => Promise<{
45
- [_: string]: string;
46
- }>;
47
- updateMediaMessage: (message: import("../Types").WAProto.IWebMessageInfo) => Promise<import("../Types").WAProto.IWebMessageInfo>;
48
- sendStatusMentions: (content: import("../Types").AnyMessageContent, jids?: string[]) => Promise<import("../Types").WAProto.WebMessageInfo>;
49
- sendAlbumMessage: (jid: string, medias: import("../Types").Media[], options?: import("../Types").MiscMessageGenerationOptions) => Promise<import("../Types").WAProto.WebMessageInfo>;
50
- sendMessage: (jid: string, content: import("../Types").AnyMessageContent, options?: import("../Types").MiscMessageGenerationOptions) => Promise<import("../Types").WAProto.WebMessageInfo | undefined>;
51
- subscribeNewsletterUpdates: (jid: string) => Promise<{
52
- duration: string;
53
- }>;
54
- newsletterReactionMode: (jid: string, mode: import("../Types").NewsletterReactionMode) => Promise<void>;
55
- newsletterUpdateDescription: (jid: string, description?: string) => Promise<void>;
56
- newsletterUpdateName: (jid: string, name: string) => Promise<void>;
57
- newsletterUpdatePicture: (jid: string, content: import("../Types").WAMediaUpload) => Promise<void>;
58
- newsletterRemovePicture: (jid: string) => Promise<void>;
59
- newsletterUnfollow: (jid: string) => Promise<void>;
60
- newsletterFollow: (jid: string) => Promise<void>;
61
- newsletterUnmute: (jid: string) => Promise<void>;
62
- newsletterMute: (jid: string) => Promise<void>;
63
- newsletterAction: (jid: string, type: "follow" | "unfollow" | "mute" | "unmute") => Promise<void>;
64
- newsletterCreate: (name: string, description: string) => Promise<import("../Types").NewsletterMetadata>;
65
- newsletterMetadata: (type: "invite" | "jid", key: string, role?: import("../Types").NewsletterViewRole) => Promise<import("../Types").NewsletterMetadata>;
66
- newsletterAdminCount: (jid: string) => Promise<number>;
67
- newsletterChangeOwner: (jid: string, user: string) => Promise<void>;
68
- newsletterDemote: (jid: string, user: string) => Promise<void>;
69
- newsletterDelete: (jid: string) => Promise<void>;
70
- newsletterReactMessage: (jid: string, serverId: string, code?: string) => Promise<void>;
71
- newsletterFetchMessages: (type: "invite" | "jid", key: string, count: number, after?: number) => Promise<import("../Types").NewsletterFetchedUpdate[]>;
72
- newsletterFetchUpdates: (jid: string, count: number, after?: number, since?: number) => Promise<import("../Types").NewsletterFetchedUpdate[]>;
73
- groupMetadata: (jid: string) => Promise<import("../Types").GroupMetadata>;
74
- groupCreate: (subject: string, participants: string[]) => Promise<import("../Types").GroupMetadata>;
75
- groupLeave: (id: string) => Promise<void>;
76
- groupUpdateSubject: (jid: string, subject: string) => Promise<void>;
77
- groupRequestParticipantsList: (jid: string) => Promise<{
78
- [key: string]: string;
79
- }[]>;
80
- groupRequestParticipantsUpdate: (jid: string, participants: string[], action: "approve" | "reject") => Promise<{
81
- status: string;
82
- jid: string;
83
- }[]>;
84
- groupParticipantsUpdate: (jid: string, participants: string[], action: import("../Types").ParticipantAction) => Promise<{
85
- status: string;
86
- jid: string;
87
- content: import("../WABinary").BinaryNode;
88
- }[]>;
89
- groupUpdateDescription: (jid: string, description?: string) => Promise<void>;
90
- groupInviteCode: (jid: string) => Promise<string | undefined>;
91
- groupRevokeInvite: (jid: string) => Promise<string | undefined>;
92
- groupAcceptInvite: (code: string) => Promise<string | undefined>;
93
- groupAcceptInviteV4: (key: string | import("../Types").WAProto.IMessageKey, inviteMessage: import("../Types").WAProto.Message.IGroupInviteMessage) => Promise<string>;
94
- groupGetInviteInfo: (code: string) => Promise<import("../Types").GroupMetadata>;
95
- groupToggleEphemeral: (jid: string, ephemeralExpiration: number) => Promise<void>;
96
- groupSettingUpdate: (jid: string, setting: "announcement" | "not_announcement" | "locked" | "unlocked") => Promise<void>;
97
- groupMemberAddMode: (jid: string, mode: "admin_add" | "all_member_add") => Promise<void>;
98
- groupJoinApprovalMode: (jid: string, mode: "on" | "off") => Promise<void>;
99
- groupFetchAllParticipating: () => Promise<{
100
- [_: string]: import("../Types").GroupMetadata;
101
- }>;
102
- processingMutex: {
103
- mutex<T>(code: () => Promise<T> | T): Promise<T>;
104
- };
105
- upsertMessage: (msg: import("../Types").WAProto.IWebMessageInfo, type: import("../Types").MessageUpsertType) => Promise<void>;
106
- appPatch: (patchCreate: import("../Types").WAPatchCreate) => Promise<void>;
107
- sendPresenceUpdate: (type: import("../Types").WAPresence, toJid?: string) => Promise<void>;
108
- presenceSubscribe: (toJid: string, tcToken?: Buffer) => Promise<void>;
109
- profilePictureUrl: (jid: string, type?: "preview" | "image", timeoutMs?: number) => Promise<string | undefined>;
110
- onWhatsApp: (...jids: string[]) => Promise<{
111
- exists: boolean;
112
- jid: string;
113
- }[]>;
114
- fetchBlocklist: () => Promise<string[]>;
115
- fetchStatus: (jid: string) => Promise<{
116
- status: string | undefined;
117
- setAt: Date;
118
- } | undefined>;
119
- updateProfilePicture: (jid: string, content: import("../Types").WAMediaUpload) => Promise<void>;
120
- removeProfilePicture: (jid: string) => Promise<void>;
121
- updateProfileStatus: (status: string) => Promise<void>;
122
- updateProfileName: (name: string) => Promise<void>;
123
- updateBlockStatus: (jid: string, action: "block" | "unblock") => Promise<void>;
124
- updateLastSeenPrivacy: (value: import("../Types").WAPrivacyValue) => Promise<void>;
125
- updateOnlinePrivacy: (value: import("../Types").WAPrivacyOnlineValue) => Promise<void>;
126
- updateProfilePicturePrivacy: (value: import("../Types").WAPrivacyValue) => Promise<void>;
127
- updateStatusPrivacy: (value: import("../Types").WAPrivacyValue) => Promise<void>;
128
- updateReadReceiptsPrivacy: (value: import("../Types").WAReadReceiptsValue) => Promise<void>;
129
- updateGroupsAddPrivacy: (value: import("../Types").WAPrivacyValue) => Promise<void>;
130
- updateDefaultDisappearingMode: (duration: number) => Promise<void>;
131
- getBusinessProfile: (jid: string) => Promise<import("../Types").WABusinessProfile | void>;
132
- resyncAppState: (collections: readonly ("critical_block" | "critical_unblock_low" | "regular_high" | "regular_low" | "regular")[], isInitialSync: boolean) => Promise<void>;
133
- chatModify: (mod: import("../Types").ChatModification, jid: string) => Promise<void>;
134
- cleanDirtyBits: (type: "account_sync" | "groups", fromTimestamp?: number | string) => Promise<void>;
135
- addChatLabel: (jid: string, labelId: string) => Promise<void>;
136
- removeChatLabel: (jid: string, labelId: string) => Promise<void>;
137
- addMessageLabel: (jid: string, messageId: string, labelId: string) => Promise<void>;
138
- removeMessageLabel: (jid: string, messageId: string, labelId: string) => Promise<void>;
139
- star: (jid: string, messages: {
140
- id: string;
141
- fromMe?: boolean;
142
- }[], star: boolean) => Promise<void>;
143
- type: "md";
144
- ws: any;
145
- ev: import("../Types").BaileysEventEmitter & {
146
- process(handler: (events: Partial<import("../Types").BaileysEventMap>) => void | Promise<void>): (() => void);
147
- buffer(): void;
148
- createBufferedFunction<A extends any[], T>(work: (...args: A) => Promise<T>): ((...args: A) => Promise<T>);
149
- flush(force?: boolean): boolean;
150
- isBuffering(): boolean;
151
- };
152
- authState: {
153
- creds: import("../Types").AuthenticationCreds;
154
- keys: import("../Types").SignalKeyStoreWithTransaction;
155
- };
156
- signalRepository: import("../Types").SignalRepository;
157
- user: import("../Types").Contact | undefined;
158
- generateMessageTag: () => string;
159
- query: (node: import("../WABinary").BinaryNode, timeoutMs?: number) => Promise<import("../WABinary").BinaryNode>;
160
- waitForMessage: <T>(msgId: string, timeoutMs?: number | undefined) => Promise<T>;
161
- waitForSocketOpen: () => Promise<void>;
162
- sendRawMessage: (data: Uint8Array | Buffer) => Promise<void>;
163
- sendNode: (frame: import("../WABinary").BinaryNode) => Promise<void>;
164
- logout: (msg?: string) => Promise<void>;
165
- end: (error: Error | undefined) => void;
166
- onUnexpectedError: (err: Error | axios, msg: string) => void;
167
- uploadPreKeys: (count?: number) => Promise<void>;
168
- uploadPreKeysToServerIfRequired: () => Promise<void>;
169
- requestPairingCode: (phoneNumber: string, pairCode: string) => Promise<string>;
170
- waitForConnectionUpdate: (check: (u: Partial<import("../Types").ConnectionState>) => boolean | undefined, timeoutMs?: number) => Promise<void>;
171
- sendWAMBuffer: (wamBuffer: Buffer) => Promise<import("../WABinary").BinaryNode>;
172
- };
173
- export interface RegistrationData {
174
- registrationId: number;
175
- signedPreKey: SignedKeyPair;
176
- noiseKey: KeyPair;
177
- signedIdentityKey: KeyPair;
178
- identityId: Buffer;
179
- phoneId: string;
180
- deviceId: string;
181
- backupToken: Buffer;
182
- }
183
- export interface RegistrationOptions {
184
- /** your phone number */
185
- phoneNumber?: string;
186
- /** the country code of your phone number */
187
- phoneNumberCountryCode: string;
188
- /** your phone number without country code */
189
- phoneNumberNationalNumber: string;
190
- /** the country code of your mobile network
191
- * @see {@link https://de.wikipedia.org/wiki/Mobile_Country_Code}
192
- */
193
- phoneNumberMobileCountryCode: string;
194
- /** the network code of your mobile network
195
- * @see {@link https://de.wikipedia.org/wiki/Mobile_Network_Code}
196
- */
197
- phoneNumberMobileNetworkCode: string;
198
- /**
199
- * How to send the one time code
200
- */
201
- method?: 'sms' | 'voice' | 'captcha';
202
- /**
203
- * The captcha code if it was requested
204
- */
205
- captcha?: string;
206
- }
207
- export type RegistrationParams = RegistrationData & RegistrationOptions;
208
- export declare function registrationParams(params: RegistrationParams): {
209
- cc: string;
210
- in: string;
211
- Rc: string;
212
- lg: string;
213
- lc: string;
214
- mistyped: string;
215
- authkey: any;
216
- e_regid: any;
217
- e_keytype: string;
218
- e_ident: any;
219
- e_skey_id: string;
220
- e_skey_val: any;
221
- e_skey_sig: any;
222
- fdid: string;
223
- network_ratio_type: string;
224
- expid: string;
225
- simnum: string;
226
- hasinrc: string;
227
- pid: string;
228
- id: string;
229
- backup_token: string;
230
- token: any;
231
- fraud_checkpoint_code: string | undefined;
232
- };
233
- /**
234
- * Requests a registration code for the given phone number.
235
- */
236
- export declare function mobileRegisterCode(params: RegistrationParams, fetchOptions?: AxiosRequestConfig): Promise<ExistsResponse>;
237
- export declare function mobileRegisterExists(params: RegistrationParams, fetchOptions?: AxiosRequestConfig): Promise<ExistsResponse>;
238
- /**
239
- * Registers the phone number on whatsapp with the received OTP code.
240
- */
241
- export declare function mobileRegister(params: RegistrationParams & {
242
- code: string;
243
- }, fetchOptions?: AxiosRequestConfig): Promise<ExistsResponse>;
244
- /**
245
- * Encrypts the given string as AEAD aes-256-gcm with the public whatsapp key and a random keypair.
246
- */
247
- export declare function mobileRegisterEncrypt(data: string): any;
248
- export declare function mobileRegisterFetch(path: string, opts?: AxiosRequestConfig): Promise<ExistsResponse>;
249
- export interface ExistsResponse {
250
- status: 'fail' | 'sent';
251
- voice_length?: number;
252
- voice_wait?: number;
253
- sms_length?: number;
254
- sms_wait?: number;
255
- reason?: 'incorrect' | 'missing_param' | 'code_checkpoint';
256
- login?: string;
257
- flash_type?: number;
258
- ab_hash?: string;
259
- ab_key?: string;
260
- exp_cfg?: string;
261
- lid?: string;
262
- image_blob?: string;
263
- audio_blob?: string;
264
- }