@neelegirl/baileys 1.5.6 → 1.5.8

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 (421) hide show
  1. package/README.md +24 -27
  2. package/WAProto/WAProto.proto +665 -291
  3. package/WAProto/index.d.ts +48037 -2294
  4. package/WAProto/index.js +139804 -45203
  5. package/lib/Defaults/baileys-version.json +3 -0
  6. package/lib/Defaults/index.d.ts +64 -58
  7. package/lib/Defaults/index.js +96 -74
  8. package/lib/Defaults/phonenumber-mcc.json +223 -0
  9. package/lib/Signal/WASignalGroup/GroupProtocol.js +1909 -0
  10. package/lib/Signal/WASignalGroup/ciphertext_message.js +16 -0
  11. package/lib/Signal/WASignalGroup/generate-proto.sh +1 -0
  12. package/lib/Signal/WASignalGroup/group.proto +42 -0
  13. package/lib/Signal/WASignalGroup/group_cipher.js +120 -0
  14. package/lib/Signal/WASignalGroup/group_session_builder.js +46 -0
  15. package/lib/Signal/WASignalGroup/index.js +6 -0
  16. package/lib/Signal/WASignalGroup/keyhelper.js +21 -0
  17. package/lib/Signal/WASignalGroup/protobufs.js +3 -0
  18. package/lib/Signal/WASignalGroup/queue_job.js +69 -0
  19. package/lib/Signal/WASignalGroup/readme.md +6 -0
  20. package/lib/Signal/WASignalGroup/sender_chain_key.js +50 -0
  21. package/lib/Signal/WASignalGroup/sender_key_distribution_message.js +78 -0
  22. package/lib/Signal/WASignalGroup/sender_key_message.js +92 -0
  23. package/lib/Signal/WASignalGroup/sender_key_name.js +70 -0
  24. package/lib/Signal/WASignalGroup/sender_key_record.js +56 -0
  25. package/lib/Signal/WASignalGroup/sender_key_state.js +129 -0
  26. package/lib/Signal/{Group/sender-message-key.js → WASignalGroup/sender_message_key.js} +16 -3
  27. package/lib/Signal/libsignal.d.ts +4 -5
  28. package/lib/Signal/libsignal.js +112 -292
  29. package/lib/Socket/Client/abstract-socket-client.d.ts +15 -0
  30. package/lib/Socket/Client/abstract-socket-client.js +13 -0
  31. package/lib/Socket/Client/index.d.ts +2 -3
  32. package/lib/Socket/Client/index.js +22 -3
  33. package/lib/Socket/Client/mobile-socket-client.d.ts +12 -0
  34. package/lib/Socket/Client/mobile-socket-client.js +65 -0
  35. package/lib/Socket/Client/types.d.ts +15 -15
  36. package/lib/Socket/Client/types.js +15 -8
  37. package/lib/Socket/Client/websocket.d.ts +12 -12
  38. package/lib/Socket/Client/websocket.js +36 -24
  39. package/lib/Socket/business.d.ts +177 -178
  40. package/lib/Socket/business.js +71 -179
  41. package/lib/Socket/chats.d.ts +93 -93
  42. package/lib/Socket/chats.js +625 -474
  43. package/lib/Socket/communities.d.ts +62 -83
  44. package/lib/Socket/communities.js +414 -412
  45. package/lib/Socket/groups.d.ts +112 -118
  46. package/lib/Socket/groups.js +171 -146
  47. package/lib/Socket/index.d.ts +182 -222
  48. package/lib/Socket/index.js +17 -12
  49. package/lib/Socket/messages-recv.d.ts +169 -165
  50. package/lib/Socket/messages-recv.js +1721 -1185
  51. package/lib/Socket/messages-send.d.ts +160 -161
  52. package/lib/Socket/messages-send.js +992 -642
  53. package/lib/Socket/mex.d.ts +0 -1
  54. package/lib/Socket/mex.js +9 -4
  55. package/lib/Socket/newsletter.d.ts +139 -139
  56. package/lib/Socket/newsletter.js +258 -153
  57. package/lib/Socket/registration.d.ts +266 -0
  58. package/lib/Socket/registration.js +166 -0
  59. package/lib/Socket/socket.d.ts +36 -42
  60. package/lib/Socket/socket.js +615 -533
  61. package/lib/Socket/usync.d.ts +37 -0
  62. package/lib/Socket/usync.js +83 -0
  63. package/lib/Store/index.d.ts +4 -0
  64. package/lib/Store/index.js +24 -0
  65. package/lib/Store/make-cache-manager-store.d.ts +14 -0
  66. package/lib/Store/make-cache-manager-store.js +90 -0
  67. package/lib/Store/make-in-memory-store.d.ts +123 -0
  68. package/lib/Store/make-in-memory-store.js +429 -0
  69. package/lib/Store/make-ordered-dictionary.d.ts +12 -0
  70. package/lib/Store/make-ordered-dictionary.js +86 -0
  71. package/lib/Store/object-repository.d.ts +10 -0
  72. package/lib/Store/object-repository.js +31 -0
  73. package/lib/Types/Auth.d.ts +96 -87
  74. package/lib/Types/Auth.js +3 -2
  75. package/lib/Types/Call.d.ts +13 -13
  76. package/lib/Types/Call.js +3 -2
  77. package/lib/Types/Chat.d.ts +94 -79
  78. package/lib/Types/Chat.js +9 -8
  79. package/lib/Types/Contact.d.ts +9 -13
  80. package/lib/Types/Contact.js +3 -2
  81. package/lib/Types/Events.d.ts +179 -152
  82. package/lib/Types/Events.js +3 -2
  83. package/lib/Types/GroupMetadata.d.ts +48 -49
  84. package/lib/Types/GroupMetadata.js +3 -2
  85. package/lib/Types/Label.d.ts +14 -13
  86. package/lib/Types/Label.js +30 -24
  87. package/lib/Types/LabelAssociation.d.ts +20 -15
  88. package/lib/Types/LabelAssociation.js +12 -6
  89. package/lib/Types/Message.d.ts +404 -234
  90. package/lib/Types/Message.js +13 -11
  91. package/lib/Types/MexUpdates.d.ts +9 -0
  92. package/lib/Types/MexUpdates.js +18 -0
  93. package/lib/Types/Newsletter.d.ts +104 -130
  94. package/lib/Types/Newsletter.js +40 -31
  95. package/lib/Types/Product.d.ts +71 -58
  96. package/lib/Types/Product.js +3 -2
  97. package/lib/Types/Signal.d.ts +55 -63
  98. package/lib/Types/Signal.js +3 -2
  99. package/lib/Types/Socket.d.ts +66 -77
  100. package/lib/Types/Socket.js +3 -3
  101. package/lib/Types/State.d.ts +19 -17
  102. package/lib/Types/State.js +14 -13
  103. package/lib/Types/USync.d.ts +8 -8
  104. package/lib/Types/USync.js +3 -2
  105. package/lib/Types/index.d.ts +61 -47
  106. package/lib/Types/index.js +48 -26
  107. package/lib/Utils/auth-utils.d.ts +10 -8
  108. package/lib/Utils/auth-utils.js +154 -206
  109. package/lib/Utils/baileys-event-stream.d.ts +7 -6
  110. package/lib/Utils/baileys-event-stream.js +43 -29
  111. package/lib/Utils/business.d.ts +20 -14
  112. package/lib/Utils/business.js +134 -110
  113. package/lib/Utils/chat-utils.d.ts +69 -57
  114. package/lib/Utils/chat-utils.js +380 -362
  115. package/lib/Utils/check-npm-version.d.ts +15 -0
  116. package/lib/Utils/check-npm-version.js +52 -0
  117. package/lib/Utils/crypto.d.ts +45 -30
  118. package/lib/Utils/crypto.js +178 -141
  119. package/lib/Utils/decode-wa-message.d.ts +35 -42
  120. package/lib/Utils/decode-wa-message.js +150 -176
  121. package/lib/Utils/event-buffer.d.ts +17 -12
  122. package/lib/Utils/event-buffer.js +286 -269
  123. package/lib/Utils/generics.d.ts +99 -60
  124. package/lib/Utils/generics.js +481 -244
  125. package/lib/Utils/history.d.ts +22 -18
  126. package/lib/Utils/history.js +80 -54
  127. package/lib/Utils/index.d.ts +19 -20
  128. package/lib/Utils/index.js +41 -19
  129. package/lib/Utils/link-preview.d.ts +14 -12
  130. package/lib/Utils/link-preview.js +75 -40
  131. package/lib/Utils/logger.d.ts +11 -10
  132. package/lib/Utils/logger.js +7 -3
  133. package/lib/Utils/lt-hash.d.ts +13 -12
  134. package/lib/Utils/lt-hash.js +37 -27
  135. package/lib/Utils/make-mutex.d.ts +7 -6
  136. package/lib/Utils/make-mutex.js +29 -20
  137. package/lib/Utils/message-retry-manager.d.ts +6 -6
  138. package/lib/Utils/message-retry-manager.js +36 -8
  139. package/lib/Utils/messages-media.d.ts +102 -87
  140. package/lib/Utils/messages-media.js +570 -427
  141. package/lib/Utils/messages.d.ts +64 -37
  142. package/lib/Utils/messages.js +1270 -511
  143. package/lib/Utils/noise-handler.d.ts +18 -18
  144. package/lib/Utils/noise-handler.js +109 -101
  145. package/lib/Utils/process-message.d.ts +32 -25
  146. package/lib/Utils/process-message.js +281 -266
  147. package/lib/Utils/signal.d.ts +32 -24
  148. package/lib/Utils/signal.js +105 -98
  149. package/lib/Utils/use-mongo-file-auth-state.d.ts +6 -0
  150. package/lib/Utils/use-mongo-file-auth-state.js +84 -0
  151. package/lib/Utils/use-multi-file-auth-state.d.ts +10 -5
  152. package/lib/Utils/use-multi-file-auth-state.js +186 -69
  153. package/lib/Utils/use-single-file-auth-state.d.ts +13 -0
  154. package/lib/Utils/use-single-file-auth-state.js +80 -0
  155. package/lib/Utils/validate-connection.d.ts +13 -11
  156. package/lib/Utils/validate-connection.js +116 -124
  157. package/lib/WABinary/constants.d.ts +27 -25
  158. package/lib/WABinary/constants.js +1292 -1277
  159. package/lib/WABinary/decode.d.ts +9 -7
  160. package/lib/WABinary/decode.js +189 -139
  161. package/lib/WABinary/encode.d.ts +3 -3
  162. package/lib/WABinary/encode.js +154 -105
  163. package/lib/WABinary/generic-utils.d.ts +27 -14
  164. package/lib/WABinary/generic-utils.js +102 -62
  165. package/lib/WABinary/index.d.ts +5 -6
  166. package/lib/WABinary/index.js +25 -6
  167. package/lib/WABinary/jid-utils.d.ts +46 -41
  168. package/lib/WABinary/jid-utils.js +80 -84
  169. package/lib/WABinary/types.d.ts +13 -10
  170. package/lib/WABinary/types.js +3 -2
  171. package/lib/WAM/BinaryInfo.d.ts +15 -8
  172. package/lib/WAM/BinaryInfo.js +14 -7
  173. package/lib/WAM/constants.d.ts +37 -30
  174. package/lib/WAM/constants.js +11983 -19465
  175. package/lib/WAM/encode.d.ts +3 -3
  176. package/lib/WAM/encode.js +110 -95
  177. package/lib/WAM/index.d.ts +3 -4
  178. package/lib/WAM/index.js +23 -4
  179. package/lib/WAUSync/Protocols/USyncBotProfileProtocol.d.ts +28 -0
  180. package/lib/WAUSync/Protocols/USyncBotProfileProtocol.js +69 -0
  181. package/lib/WAUSync/Protocols/USyncContactProtocol.d.ts +9 -9
  182. package/lib/WAUSync/Protocols/USyncContactProtocol.js +19 -12
  183. package/lib/WAUSync/Protocols/USyncDeviceProtocol.d.ts +22 -19
  184. package/lib/WAUSync/Protocols/USyncDeviceProtocol.js +26 -18
  185. package/lib/WAUSync/Protocols/USyncDisappearingModeProtocol.d.ts +12 -11
  186. package/lib/WAUSync/Protocols/USyncDisappearingModeProtocol.js +20 -12
  187. package/lib/WAUSync/Protocols/USyncLIDProtocol.d.ts +9 -0
  188. package/lib/WAUSync/Protocols/USyncLIDProtocol.js +30 -0
  189. package/lib/WAUSync/Protocols/USyncStatusProtocol.d.ts +12 -11
  190. package/lib/WAUSync/Protocols/USyncStatusProtocol.js +24 -16
  191. package/lib/WAUSync/Protocols/index.d.ts +6 -5
  192. package/lib/WAUSync/Protocols/index.js +26 -5
  193. package/lib/WAUSync/USyncQuery.d.ts +28 -26
  194. package/lib/WAUSync/USyncQuery.js +62 -64
  195. package/lib/WAUSync/USyncUser.d.ts +10 -11
  196. package/lib/WAUSync/USyncUser.js +19 -12
  197. package/lib/WAUSync/index.d.ts +3 -4
  198. package/lib/WAUSync/index.js +23 -4
  199. package/lib/index.d.ts +11 -10
  200. package/lib/index.js +33 -11
  201. package/package.json +43 -48
  202. package/WAProto/GenerateStatics.sh +0 -3
  203. package/WAProto/fix-imports.js +0 -29
  204. package/engine-requirements.js +0 -10
  205. package/lib/Defaults/index.d.ts.map +0 -1
  206. package/lib/Defaults/index.js.map +0 -1
  207. package/lib/Signal/Group/ciphertext-message.d.ts +0 -10
  208. package/lib/Signal/Group/ciphertext-message.d.ts.map +0 -1
  209. package/lib/Signal/Group/ciphertext-message.js +0 -12
  210. package/lib/Signal/Group/ciphertext-message.js.map +0 -1
  211. package/lib/Signal/Group/group-session-builder.d.ts +0 -15
  212. package/lib/Signal/Group/group-session-builder.d.ts.map +0 -1
  213. package/lib/Signal/Group/group-session-builder.js +0 -30
  214. package/lib/Signal/Group/group-session-builder.js.map +0 -1
  215. package/lib/Signal/Group/group_cipher.d.ts +0 -17
  216. package/lib/Signal/Group/group_cipher.d.ts.map +0 -1
  217. package/lib/Signal/Group/group_cipher.js +0 -82
  218. package/lib/Signal/Group/group_cipher.js.map +0 -1
  219. package/lib/Signal/Group/index.d.ts +0 -12
  220. package/lib/Signal/Group/index.d.ts.map +0 -1
  221. package/lib/Signal/Group/index.js +0 -12
  222. package/lib/Signal/Group/index.js.map +0 -1
  223. package/lib/Signal/Group/keyhelper.d.ts +0 -11
  224. package/lib/Signal/Group/keyhelper.d.ts.map +0 -1
  225. package/lib/Signal/Group/keyhelper.js +0 -18
  226. package/lib/Signal/Group/keyhelper.js.map +0 -1
  227. package/lib/Signal/Group/sender-chain-key.d.ts +0 -14
  228. package/lib/Signal/Group/sender-chain-key.d.ts.map +0 -1
  229. package/lib/Signal/Group/sender-chain-key.js +0 -26
  230. package/lib/Signal/Group/sender-chain-key.js.map +0 -1
  231. package/lib/Signal/Group/sender-key-distribution-message.d.ts +0 -17
  232. package/lib/Signal/Group/sender-key-distribution-message.d.ts.map +0 -1
  233. package/lib/Signal/Group/sender-key-distribution-message.js +0 -63
  234. package/lib/Signal/Group/sender-key-distribution-message.js.map +0 -1
  235. package/lib/Signal/Group/sender-key-message.d.ts +0 -19
  236. package/lib/Signal/Group/sender-key-message.d.ts.map +0 -1
  237. package/lib/Signal/Group/sender-key-message.js +0 -66
  238. package/lib/Signal/Group/sender-key-message.js.map +0 -1
  239. package/lib/Signal/Group/sender-key-name.d.ts +0 -18
  240. package/lib/Signal/Group/sender-key-name.d.ts.map +0 -1
  241. package/lib/Signal/Group/sender-key-name.js +0 -48
  242. package/lib/Signal/Group/sender-key-name.js.map +0 -1
  243. package/lib/Signal/Group/sender-key-record.d.ts +0 -31
  244. package/lib/Signal/Group/sender-key-record.d.ts.map +0 -1
  245. package/lib/Signal/Group/sender-key-record.js +0 -41
  246. package/lib/Signal/Group/sender-key-record.js.map +0 -1
  247. package/lib/Signal/Group/sender-key-state.d.ts +0 -39
  248. package/lib/Signal/Group/sender-key-state.d.ts.map +0 -1
  249. package/lib/Signal/Group/sender-key-state.js +0 -84
  250. package/lib/Signal/Group/sender-key-state.js.map +0 -1
  251. package/lib/Signal/Group/sender-message-key.d.ts +0 -12
  252. package/lib/Signal/Group/sender-message-key.d.ts.map +0 -1
  253. package/lib/Signal/Group/sender-message-key.js.map +0 -1
  254. package/lib/Signal/libsignal.d.ts.map +0 -1
  255. package/lib/Signal/libsignal.js.map +0 -1
  256. package/lib/Signal/lid-mapping.d.ts +0 -23
  257. package/lib/Signal/lid-mapping.d.ts.map +0 -1
  258. package/lib/Signal/lid-mapping.js +0 -171
  259. package/lib/Signal/lid-mapping.js.map +0 -1
  260. package/lib/Socket/Client/index.d.ts.map +0 -1
  261. package/lib/Socket/Client/index.js.map +0 -1
  262. package/lib/Socket/Client/types.d.ts.map +0 -1
  263. package/lib/Socket/Client/types.js.map +0 -1
  264. package/lib/Socket/Client/websocket.d.ts.map +0 -1
  265. package/lib/Socket/Client/websocket.js.map +0 -1
  266. package/lib/Socket/business.d.ts.map +0 -1
  267. package/lib/Socket/business.js.map +0 -1
  268. package/lib/Socket/chats.d.ts.map +0 -1
  269. package/lib/Socket/chats.js.map +0 -1
  270. package/lib/Socket/communities.d.ts.map +0 -1
  271. package/lib/Socket/communities.js.map +0 -1
  272. package/lib/Socket/groups.d.ts.map +0 -1
  273. package/lib/Socket/groups.js.map +0 -1
  274. package/lib/Socket/index.d.ts.map +0 -1
  275. package/lib/Socket/index.js.map +0 -1
  276. package/lib/Socket/messages-recv.d.ts.map +0 -1
  277. package/lib/Socket/messages-recv.js.map +0 -1
  278. package/lib/Socket/messages-send.d.ts.map +0 -1
  279. package/lib/Socket/messages-send.js.map +0 -1
  280. package/lib/Socket/mex.d.ts.map +0 -1
  281. package/lib/Socket/mex.js.map +0 -1
  282. package/lib/Socket/newsletter.d.ts.map +0 -1
  283. package/lib/Socket/newsletter.js.map +0 -1
  284. package/lib/Socket/socket.d.ts.map +0 -1
  285. package/lib/Socket/socket.js.map +0 -1
  286. package/lib/Types/Auth.d.ts.map +0 -1
  287. package/lib/Types/Auth.js.map +0 -1
  288. package/lib/Types/Bussines.d.ts +0 -25
  289. package/lib/Types/Bussines.d.ts.map +0 -1
  290. package/lib/Types/Bussines.js +0 -2
  291. package/lib/Types/Bussines.js.map +0 -1
  292. package/lib/Types/Call.d.ts.map +0 -1
  293. package/lib/Types/Call.js.map +0 -1
  294. package/lib/Types/Chat.d.ts.map +0 -1
  295. package/lib/Types/Chat.js.map +0 -1
  296. package/lib/Types/Contact.d.ts.map +0 -1
  297. package/lib/Types/Contact.js.map +0 -1
  298. package/lib/Types/Events.d.ts.map +0 -1
  299. package/lib/Types/Events.js.map +0 -1
  300. package/lib/Types/GroupMetadata.d.ts.map +0 -1
  301. package/lib/Types/GroupMetadata.js.map +0 -1
  302. package/lib/Types/Label.d.ts.map +0 -1
  303. package/lib/Types/Label.js.map +0 -1
  304. package/lib/Types/LabelAssociation.d.ts.map +0 -1
  305. package/lib/Types/LabelAssociation.js.map +0 -1
  306. package/lib/Types/Message.d.ts.map +0 -1
  307. package/lib/Types/Message.js.map +0 -1
  308. package/lib/Types/Newsletter.d.ts.map +0 -1
  309. package/lib/Types/Newsletter.js.map +0 -1
  310. package/lib/Types/Product.d.ts.map +0 -1
  311. package/lib/Types/Product.js.map +0 -1
  312. package/lib/Types/Signal.d.ts.map +0 -1
  313. package/lib/Types/Signal.js.map +0 -1
  314. package/lib/Types/Socket.d.ts.map +0 -1
  315. package/lib/Types/Socket.js.map +0 -1
  316. package/lib/Types/State.d.ts.map +0 -1
  317. package/lib/Types/State.js.map +0 -1
  318. package/lib/Types/USync.d.ts.map +0 -1
  319. package/lib/Types/USync.js.map +0 -1
  320. package/lib/Types/index.d.ts.map +0 -1
  321. package/lib/Types/index.js.map +0 -1
  322. package/lib/Utils/auth-utils.d.ts.map +0 -1
  323. package/lib/Utils/auth-utils.js.map +0 -1
  324. package/lib/Utils/baileys-event-stream.d.ts.map +0 -1
  325. package/lib/Utils/baileys-event-stream.js.map +0 -1
  326. package/lib/Utils/browser-utils.d.ts +0 -4
  327. package/lib/Utils/browser-utils.d.ts.map +0 -1
  328. package/lib/Utils/browser-utils.js +0 -28
  329. package/lib/Utils/browser-utils.js.map +0 -1
  330. package/lib/Utils/business.d.ts.map +0 -1
  331. package/lib/Utils/business.js.map +0 -1
  332. package/lib/Utils/chat-utils.d.ts.map +0 -1
  333. package/lib/Utils/chat-utils.js.map +0 -1
  334. package/lib/Utils/crypto.d.ts.map +0 -1
  335. package/lib/Utils/crypto.js.map +0 -1
  336. package/lib/Utils/decode-wa-message.d.ts.map +0 -1
  337. package/lib/Utils/decode-wa-message.js.map +0 -1
  338. package/lib/Utils/event-buffer.d.ts.map +0 -1
  339. package/lib/Utils/event-buffer.js.map +0 -1
  340. package/lib/Utils/generics.d.ts.map +0 -1
  341. package/lib/Utils/generics.js.map +0 -1
  342. package/lib/Utils/history.d.ts.map +0 -1
  343. package/lib/Utils/history.js.map +0 -1
  344. package/lib/Utils/index.d.ts.map +0 -1
  345. package/lib/Utils/index.js.map +0 -1
  346. package/lib/Utils/link-preview.d.ts.map +0 -1
  347. package/lib/Utils/link-preview.js.map +0 -1
  348. package/lib/Utils/logger.d.ts.map +0 -1
  349. package/lib/Utils/logger.js.map +0 -1
  350. package/lib/Utils/lt-hash.d.ts.map +0 -1
  351. package/lib/Utils/lt-hash.js.map +0 -1
  352. package/lib/Utils/make-mutex.d.ts.map +0 -1
  353. package/lib/Utils/make-mutex.js.map +0 -1
  354. package/lib/Utils/message-retry-manager.d.ts.map +0 -1
  355. package/lib/Utils/message-retry-manager.js.map +0 -1
  356. package/lib/Utils/messages-media.d.ts.map +0 -1
  357. package/lib/Utils/messages-media.js.map +0 -1
  358. package/lib/Utils/messages.d.ts.map +0 -1
  359. package/lib/Utils/messages.js.map +0 -1
  360. package/lib/Utils/noise-handler.d.ts.map +0 -1
  361. package/lib/Utils/noise-handler.js.map +0 -1
  362. package/lib/Utils/pre-key-manager.d.ts +0 -28
  363. package/lib/Utils/pre-key-manager.d.ts.map +0 -1
  364. package/lib/Utils/pre-key-manager.js +0 -106
  365. package/lib/Utils/pre-key-manager.js.map +0 -1
  366. package/lib/Utils/process-message.d.ts.map +0 -1
  367. package/lib/Utils/process-message.js.map +0 -1
  368. package/lib/Utils/signal.d.ts.map +0 -1
  369. package/lib/Utils/signal.js.map +0 -1
  370. package/lib/Utils/use-multi-file-auth-state.d.ts.map +0 -1
  371. package/lib/Utils/use-multi-file-auth-state.js.map +0 -1
  372. package/lib/Utils/validate-connection.d.ts.map +0 -1
  373. package/lib/Utils/validate-connection.js.map +0 -1
  374. package/lib/WABinary/constants.d.ts.map +0 -1
  375. package/lib/WABinary/constants.js.map +0 -1
  376. package/lib/WABinary/decode.d.ts.map +0 -1
  377. package/lib/WABinary/decode.js.map +0 -1
  378. package/lib/WABinary/encode.d.ts.map +0 -1
  379. package/lib/WABinary/encode.js.map +0 -1
  380. package/lib/WABinary/generic-utils.d.ts.map +0 -1
  381. package/lib/WABinary/generic-utils.js.map +0 -1
  382. package/lib/WABinary/index.d.ts.map +0 -1
  383. package/lib/WABinary/index.js.map +0 -1
  384. package/lib/WABinary/jid-utils.d.ts.map +0 -1
  385. package/lib/WABinary/jid-utils.js.map +0 -1
  386. package/lib/WABinary/types.d.ts.map +0 -1
  387. package/lib/WABinary/types.js.map +0 -1
  388. package/lib/WAM/BinaryInfo.d.ts.map +0 -1
  389. package/lib/WAM/BinaryInfo.js.map +0 -1
  390. package/lib/WAM/constants.d.ts.map +0 -1
  391. package/lib/WAM/constants.js.map +0 -1
  392. package/lib/WAM/encode.d.ts.map +0 -1
  393. package/lib/WAM/encode.js.map +0 -1
  394. package/lib/WAM/index.d.ts.map +0 -1
  395. package/lib/WAM/index.js.map +0 -1
  396. package/lib/WAUSync/Protocols/USyncContactProtocol.d.ts.map +0 -1
  397. package/lib/WAUSync/Protocols/USyncContactProtocol.js.map +0 -1
  398. package/lib/WAUSync/Protocols/USyncDeviceProtocol.d.ts.map +0 -1
  399. package/lib/WAUSync/Protocols/USyncDeviceProtocol.js.map +0 -1
  400. package/lib/WAUSync/Protocols/USyncDisappearingModeProtocol.d.ts.map +0 -1
  401. package/lib/WAUSync/Protocols/USyncDisappearingModeProtocol.js.map +0 -1
  402. package/lib/WAUSync/Protocols/USyncStatusProtocol.d.ts.map +0 -1
  403. package/lib/WAUSync/Protocols/USyncStatusProtocol.js.map +0 -1
  404. package/lib/WAUSync/Protocols/UsyncBotProfileProtocol.d.ts +0 -26
  405. package/lib/WAUSync/Protocols/UsyncBotProfileProtocol.d.ts.map +0 -1
  406. package/lib/WAUSync/Protocols/UsyncBotProfileProtocol.js +0 -51
  407. package/lib/WAUSync/Protocols/UsyncBotProfileProtocol.js.map +0 -1
  408. package/lib/WAUSync/Protocols/UsyncLIDProtocol.d.ts +0 -10
  409. package/lib/WAUSync/Protocols/UsyncLIDProtocol.d.ts.map +0 -1
  410. package/lib/WAUSync/Protocols/UsyncLIDProtocol.js +0 -29
  411. package/lib/WAUSync/Protocols/UsyncLIDProtocol.js.map +0 -1
  412. package/lib/WAUSync/Protocols/index.d.ts.map +0 -1
  413. package/lib/WAUSync/Protocols/index.js.map +0 -1
  414. package/lib/WAUSync/USyncQuery.d.ts.map +0 -1
  415. package/lib/WAUSync/USyncQuery.js.map +0 -1
  416. package/lib/WAUSync/USyncUser.d.ts.map +0 -1
  417. package/lib/WAUSync/USyncUser.js.map +0 -1
  418. package/lib/WAUSync/index.d.ts.map +0 -1
  419. package/lib/WAUSync/index.js.map +0 -1
  420. package/lib/index.d.ts.map +0 -1
  421. package/lib/index.js.map +0 -1
@@ -1,48 +1,53 @@
1
- export declare const S_WHATSAPP_NET = "@s.whatsapp.net";
2
- export declare const OFFICIAL_BIZ_JID = "16505361212@c.us";
3
- export declare const SERVER_JID = "server@c.us";
4
- export declare const PSA_WID = "0@c.us";
5
- export declare const STORIES_JID = "status@broadcast";
6
- export declare const META_AI_JID = "13135550002@c.us";
7
- export type JidServer = 'c.us' | 'g.us' | 'broadcast' | 's.whatsapp.net' | 'call' | 'lid' | 'newsletter' | 'bot' | 'hosted' | 'hosted.lid';
8
- export declare enum WAJIDDomains {
9
- WHATSAPP = 0,
10
- LID = 1,
11
- HOSTED = 128,
12
- HOSTED_LID = 129
13
- }
1
+ export declare const S_WHATSAPP_NET = "@s.whatsapp.net"
2
+
3
+ export declare const OFFICIAL_BIZ_JID = "16505361212@c.us"
4
+
5
+ export declare const SERVER_JID = "server@c.us"
6
+
7
+ export declare const PSA_WID = "0@c.us"
8
+
9
+ export declare const STORIES_JID = "status@broadcast"
10
+
11
+ export declare const META_AI_JID = '13135550002@c.us'
12
+
13
+ export type JidServer = 'c.us' | 'g.us' | 'broadcast' | 's.whatsapp.net' | 'call' | 'lid' | 'newsletter' | 'bot'
14
+
14
15
  export type JidWithDevice = {
15
- user: string;
16
- device?: number;
17
- };
16
+ user: string
17
+ device?: number
18
+ }
19
+
18
20
  export type FullJid = JidWithDevice & {
19
- server: JidServer;
20
- domainType?: number;
21
- };
22
- export declare const getServerFromDomainType: (initialServer: string, domainType?: WAJIDDomains) => JidServer;
23
- export declare const jidEncode: (user: string | number | null, server: JidServer, device?: number, agent?: number) => string;
24
- export declare const jidDecode: (jid: string | undefined) => FullJid | undefined;
21
+ server: JidServer
22
+ domainType?: number
23
+ }
24
+
25
+ export declare const jidEncode: (user: string | number | null, server: JidServer, device?: number, agent?: number) => string
26
+
27
+ export declare const jidDecode: (jid: string | undefined) => FullJid | undefined
28
+
25
29
  /** is the jid a user */
26
- export declare const areJidsSameUser: (jid1: string | undefined, jid2: string | undefined) => boolean;
27
- /** is the jid Meta AI */
28
- export declare const isJidMetaAI: (jid: string | undefined) => boolean | undefined;
29
- /** is the jid a PN user */
30
- export declare const isPnUser: (jid: string | undefined) => boolean | undefined;
31
- /** is the jid a LID */
32
- export declare const isLidUser: (jid: string | undefined) => boolean | undefined;
30
+ export declare const areJidsSameUser: (jid1: string | undefined, jid2: string | undefined) => boolean
31
+
32
+ /** is the lid a user */
33
+ export declare const isJidUser: (jid: string | undefined) => boolean | undefined
34
+
35
+ /** is the jid a group */
36
+ export declare const isLidUser: (jid: string | undefined) => boolean | undefined
37
+
33
38
  /** is the jid a broadcast */
34
- export declare const isJidBroadcast: (jid: string | undefined) => boolean | undefined;
39
+ export declare const isJidBroadcast: (jid: string | undefined) => boolean | undefined
40
+
35
41
  /** is the jid a group */
36
- export declare const isJidGroup: (jid: string | undefined) => boolean | undefined;
42
+ export declare const isJidGroup: (jid: string | undefined) => boolean | undefined
43
+
37
44
  /** is the jid the status broadcast */
38
- export declare const isJidStatusBroadcast: (jid: string) => jid is "status@broadcast";
45
+ export declare const isJidStatusBroadcast: (jid: string) => boolean
46
+
39
47
  /** is the jid a newsletter */
40
- export declare const isJidNewsletter: (jid: string | undefined) => boolean | undefined;
41
- /** is the jid a hosted PN */
42
- export declare const isHostedPnUser: (jid: string | undefined) => boolean | undefined;
43
- /** is the jid a hosted LID */
44
- export declare const isHostedLidUser: (jid: string | undefined) => boolean | undefined;
45
- export declare const isJidBot: (jid: string | undefined) => boolean | "" | undefined;
46
- export declare const jidNormalizedUser: (jid: string | undefined) => string;
47
- export declare const transferDevice: (fromJid: string, toJid: string) => string;
48
- //# sourceMappingURL=jid-utils.d.ts.map
48
+ export declare const isJidNewsletter: (jid: string | undefined) => boolean | undefined
49
+
50
+ /** is the jid a bot */
51
+ export declare const isJidBot: (jid: string | undefined) => boolean | undefined
52
+
53
+ export declare const jidNormalizedUser: (jid: string | undefined) => string
@@ -1,96 +1,92 @@
1
- export const S_WHATSAPP_NET = '@s.whatsapp.net';
2
- export const OFFICIAL_BIZ_JID = '16505361212@c.us';
3
- export const SERVER_JID = 'server@c.us';
4
- export const PSA_WID = '0@c.us';
5
- export const STORIES_JID = 'status@broadcast';
6
- export const META_AI_JID = '13135550002@c.us';
7
- export var WAJIDDomains;
8
- (function (WAJIDDomains) {
9
- WAJIDDomains[WAJIDDomains["WHATSAPP"] = 0] = "WHATSAPP";
10
- WAJIDDomains[WAJIDDomains["LID"] = 1] = "LID";
11
- WAJIDDomains[WAJIDDomains["HOSTED"] = 128] = "HOSTED";
12
- WAJIDDomains[WAJIDDomains["HOSTED_LID"] = 129] = "HOSTED_LID";
13
- })(WAJIDDomains || (WAJIDDomains = {}));
14
- export const getServerFromDomainType = (initialServer, domainType) => {
15
- switch (domainType) {
16
- case WAJIDDomains.LID:
17
- return 'lid';
18
- case WAJIDDomains.HOSTED:
19
- return 'hosted';
20
- case WAJIDDomains.HOSTED_LID:
21
- return 'hosted.lid';
22
- case WAJIDDomains.WHATSAPP:
23
- default:
24
- return initialServer;
25
- }
26
- };
27
- export const jidEncode = (user, server, device, agent) => {
28
- return `${user || ''}${!!agent ? `_${agent}` : ''}${!!device ? `:${device}` : ''}@${server}`;
29
- };
30
- export const jidDecode = (jid) => {
31
- // todo: investigate how to implement hosted ids in this case
32
- const sepIdx = typeof jid === 'string' ? jid.indexOf('@') : -1;
1
+ "use strict"
2
+
3
+ Object.defineProperty(exports, "__esModule", { value: true })
4
+
5
+ const S_WHATSAPP_NET = '@s.whatsapp.net'
6
+
7
+ const OFFICIAL_BIZ_JID = '16505361212@c.us'
8
+
9
+ const SERVER_JID = 'server@c.us'
10
+
11
+ const PSA_WID = '0@c.us'
12
+
13
+ const STORIES_JID = 'status@broadcast'
14
+
15
+ const META_AI_JID = '13135550002@c.us'
16
+
17
+ const jidEncode = (user, server, device, agent) => {
18
+ return `${user || ''}${!!agent ? `_${agent}` : ''}${!!device ? `:${device}` : ''}@${server}`
19
+ }
20
+
21
+ const jidDecode = (jid) => {
22
+ const sepIdx = typeof jid === 'string' ? jid.indexOf('@') : -1
33
23
  if (sepIdx < 0) {
34
- return undefined;
35
- }
36
- const server = jid.slice(sepIdx + 1);
37
- const userCombined = jid.slice(0, sepIdx);
38
- const [userAgent, device] = userCombined.split(':');
39
- const [user, agent] = userAgent.split('_');
40
- let domainType = WAJIDDomains.WHATSAPP;
41
- if (server === 'lid') {
42
- domainType = WAJIDDomains.LID;
43
- }
44
- else if (server === 'hosted') {
45
- domainType = WAJIDDomains.HOSTED;
46
- }
47
- else if (server === 'hosted.lid') {
48
- domainType = WAJIDDomains.HOSTED_LID;
49
- }
50
- else if (agent) {
51
- domainType = parseInt(agent);
24
+ return undefined
52
25
  }
26
+ const server = jid.slice(sepIdx + 1)
27
+ const userCombined = jid.slice(0, sepIdx)
28
+ const [userAgent, device] = userCombined.split(':')
29
+ const user = userAgent.split('_')[0]
53
30
  return {
54
31
  server: server,
55
- user: user,
56
- domainType,
32
+ user,
33
+ domainType: server === 'lid' ? 1 : 0,
57
34
  device: device ? +device : undefined
58
- };
59
- };
35
+ }
36
+ }
37
+
38
+ /** is the jid a user */
39
+ const areJidsSameUser = (jid1, jid2) => {
40
+ return jidDecode(jid1)?.user === jidDecode(jid2)?.user
41
+ }
42
+
60
43
  /** is the jid a user */
61
- export const areJidsSameUser = (jid1, jid2) => jidDecode(jid1)?.user === jidDecode(jid2)?.user;
62
- /** is the jid Meta AI */
63
- export const isJidMetaAI = (jid) => jid?.endsWith('@bot');
64
- /** is the jid a PN user */
65
- export const isPnUser = (jid) => jid?.endsWith('@s.whatsapp.net');
66
- /** is the jid a LID */
67
- export const isLidUser = (jid) => jid?.endsWith('@lid');
44
+ const isJidUser = (jid) => jid?.endsWith('@s.whatsapp.net')
45
+
46
+ /** is the lid a user */
47
+ const isLidUser = (jid) => jid?.endsWith('@lid')
48
+
68
49
  /** is the jid a broadcast */
69
- export const isJidBroadcast = (jid) => jid?.endsWith('@broadcast');
50
+ const isJidBroadcast = (jid) => jid?.endsWith('@broadcast')
51
+
70
52
  /** is the jid a group */
71
- export const isJidGroup = (jid) => jid?.endsWith('@g.us');
53
+ const isJidGroup = (jid) => jid?.endsWith('@g.us')
54
+
72
55
  /** is the jid the status broadcast */
73
- export const isJidStatusBroadcast = (jid) => jid === 'status@broadcast';
56
+ const isJidStatusBroadcast = (jid) => jid === 'status@broadcast'
57
+
74
58
  /** is the jid a newsletter */
75
- export const isJidNewsletter = (jid) => jid?.endsWith('@newsletter');
76
- /** is the jid a hosted PN */
77
- export const isHostedPnUser = (jid) => jid?.endsWith('@hosted');
78
- /** is the jid a hosted LID */
79
- export const isHostedLidUser = (jid) => jid?.endsWith('@hosted.lid');
80
- const botRegexp = /^1313555\d{4}$|^131655500\d{2}$/;
81
- export const isJidBot = (jid) => jid && botRegexp.test(jid.split('@')[0]) && jid.endsWith('@c.us');
82
- export const jidNormalizedUser = (jid) => {
83
- const result = jidDecode(jid);
59
+ const isJidNewsletter = (jid) => jid?.endsWith('@newsletter')
60
+
61
+ /** is the jid a bot */
62
+ const botRegexp = /^1313555\d{4}$|^131655500\d{2}$/
63
+ const isJidBot = (jid) => (jid && botRegexp.test(jid.split('@')[0]) && jid.endsWith('@c.us'))
64
+
65
+ const jidNormalizedUser = (jid) => {
66
+ const result = jidDecode(jid)
84
67
  if (!result) {
85
- return '';
68
+ return ''
86
69
  }
87
- const { user, server } = result;
88
- return jidEncode(user, server === 'c.us' ? 's.whatsapp.net' : server);
89
- };
90
- export const transferDevice = (fromJid, toJid) => {
91
- const fromDecoded = jidDecode(fromJid);
92
- const deviceId = fromDecoded?.device || 0;
93
- const { server, user } = jidDecode(toJid);
94
- return jidEncode(user, server, deviceId);
95
- };
96
- //# sourceMappingURL=jid-utils.js.map
70
+ const { user, server } = result
71
+ return jidEncode(user, server === 'c.us' ? 's.whatsapp.net' : server)
72
+ }
73
+
74
+ module.exports = {
75
+ S_WHATSAPP_NET,
76
+ OFFICIAL_BIZ_JID,
77
+ SERVER_JID,
78
+ PSA_WID,
79
+ STORIES_JID,
80
+ META_AI_JID,
81
+ jidEncode,
82
+ jidDecode,
83
+ areJidsSameUser,
84
+ isJidUser,
85
+ isLidUser,
86
+ isJidBroadcast,
87
+ isJidGroup,
88
+ isJidStatusBroadcast,
89
+ isJidNewsletter,
90
+ isJidBot,
91
+ jidNormalizedUser
92
+ }
@@ -1,4 +1,5 @@
1
- import * as constants from './constants.js';
1
+ import * as constants from './constants'
2
+
2
3
  /**
3
4
  * the binary node WA uses internally for communication
4
5
  *
@@ -7,13 +8,15 @@ import * as constants from './constants.js';
7
8
  * to maintain functional code structure
8
9
  * */
9
10
  export type BinaryNode = {
10
- tag: string;
11
+ tag: string
11
12
  attrs: {
12
- [key: string]: string;
13
- };
14
- content?: BinaryNode[] | string | Uint8Array;
15
- };
16
- export type BinaryNodeAttributes = BinaryNode['attrs'];
17
- export type BinaryNodeData = BinaryNode['content'];
18
- export type BinaryNodeCodingOptions = typeof constants;
19
- //# sourceMappingURL=types.d.ts.map
13
+ [key: string]: string
14
+ }
15
+ content?: BinaryNode[] | string | Uint8Array
16
+ }
17
+
18
+ export type BinaryNodeAttributes = BinaryNode['attrs']
19
+
20
+ export type BinaryNodeData = BinaryNode['content']
21
+
22
+ export type BinaryNodeCodingOptions = typeof constants
@@ -1,2 +1,3 @@
1
- import * as constants from './constants.js';
2
- //# sourceMappingURL=types.js.map
1
+ "use strict"
2
+
3
+ Object.defineProperty(exports, "__esModule", { value: true })
@@ -1,9 +1,16 @@
1
- import type { EventInputType } from './constants.js';
2
1
  export declare class BinaryInfo {
3
- protocolVersion: number;
4
- sequence: number;
5
- events: EventInputType[];
6
- buffer: Buffer[];
7
- constructor(options?: Partial<BinaryInfo>);
8
- }
9
- //# sourceMappingURL=BinaryInfo.d.ts.map
2
+ protocolVersion: number
3
+ sequence: number
4
+ events: {
5
+ [x: string]: {
6
+ props: {
7
+ [x: string]: import("./constants").Value
8
+ }
9
+ globals: {
10
+ [x: string]: import("./constants").Value
11
+ }
12
+ }
13
+ }[]
14
+ buffer: Buffer[]
15
+ constructor(options?: Partial<BinaryInfo>)
16
+ }
@@ -1,10 +1,17 @@
1
- export class BinaryInfo {
1
+ "use strict"
2
+
3
+ Object.defineProperty(exports, "__esModule", { value: true })
4
+
5
+ class BinaryInfo {
2
6
  constructor(options = {}) {
3
- this.protocolVersion = 5;
4
- this.sequence = 0;
5
- this.events = [];
6
- this.buffer = [];
7
- Object.assign(this, options);
7
+ this.protocolVersion = 5
8
+ this.sequence = 0
9
+ this.events = []
10
+ this.buffer = []
11
+ Object.assign(this, options)
8
12
  }
9
13
  }
10
- //# sourceMappingURL=BinaryInfo.js.map
14
+
15
+ module.exports = {
16
+ BinaryInfo
17
+ }
@@ -1,40 +1,47 @@
1
- export declare const WEB_EVENTS: Event[];
2
- export declare const WEB_GLOBALS: Global[];
3
- export declare const FLAG_BYTE = 8, FLAG_GLOBAL = 0, FLAG_EVENT = 1, FLAG_FIELD = 2, FLAG_EXTENDED = 4;
1
+ export declare const WEB_EVENTS: Event[]
2
+
3
+ export declare const WEB_GLOBALS: Global[]
4
+
5
+ export declare const FLAG_BYTE = 8, FLAG_GLOBAL = 0, FLAG_EVENT = 1, FLAG_FIELD = 2, FLAG_EXTENDED = 4
6
+
4
7
  export type Event = {
5
- name: string;
6
- id: number;
8
+ name: string
9
+ id: number
7
10
  props: {
8
11
  [key: string]: [number, string | {
9
- [key: string]: number;
10
- }];
11
- };
12
- weight: number;
13
- wamChannel: string;
14
- privateStatsIdInt?: number;
15
- };
12
+ [key: string]: number
13
+ }]
14
+ }
15
+ weight: number
16
+ wamChannel: string
17
+ privateStatsIdInt: number
18
+ }
19
+
16
20
  export type Global = {
17
- name: string;
18
- id: number;
21
+ name: string
22
+ id: number
19
23
  type: string | {
20
- [key: string]: number;
21
- };
22
- validator?: string;
23
- channels: string[];
24
- };
24
+ [key: string]: number
25
+ }
26
+ validator?: string
27
+ channels: string[]
28
+ }
29
+
25
30
  type EventByName<T extends Event['name']> = Extract<Event, {
26
- name: T;
27
- }>;
31
+ name: T
32
+ }>
33
+
28
34
  export type EventInputType = {
29
35
  [key in Event['name']]: {
30
36
  props: {
31
- [k in keyof EventByName<key>['props']]: Value;
32
- };
37
+ [k in keyof EventByName<key>['props']]: Value
38
+ }
33
39
  globals: {
34
- [x: string]: Value;
35
- };
36
- };
37
- } & {};
38
- export type Value = number | null | string;
39
- export {};
40
- //# sourceMappingURL=constants.d.ts.map
40
+ [x: string]: Value
41
+ }
42
+ }
43
+ } & {}
44
+
45
+ export type Value = number | null | string
46
+
47
+ export {}