@lynovratech/baileys 1.0.0

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 (787) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +1312 -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 +14017 -0
  7. package/WAProto/index.js +97687 -0
  8. package/engine-requirements.js +10 -0
  9. package/lib/cjs/Defaults/index.d.ts +74 -0
  10. package/lib/cjs/Defaults/index.d.ts.map +1 -0
  11. package/lib/cjs/Defaults/index.js +134 -0
  12. package/lib/cjs/Defaults/index.js.map +1 -0
  13. package/lib/cjs/Signal/Group/ciphertext-message.d.ts +10 -0
  14. package/lib/cjs/Signal/Group/ciphertext-message.d.ts.map +1 -0
  15. package/lib/cjs/Signal/Group/ciphertext-message.js +16 -0
  16. package/lib/cjs/Signal/Group/ciphertext-message.js.map +1 -0
  17. package/lib/cjs/Signal/Group/group-session-builder.d.ts +15 -0
  18. package/lib/cjs/Signal/Group/group-session-builder.d.ts.map +1 -0
  19. package/lib/cjs/Signal/Group/group-session-builder.js +65 -0
  20. package/lib/cjs/Signal/Group/group-session-builder.js.map +1 -0
  21. package/lib/cjs/Signal/Group/group_cipher.d.ts +17 -0
  22. package/lib/cjs/Signal/Group/group_cipher.d.ts.map +1 -0
  23. package/lib/cjs/Signal/Group/group_cipher.js +83 -0
  24. package/lib/cjs/Signal/Group/group_cipher.js.map +1 -0
  25. package/lib/cjs/Signal/Group/index.d.ts +12 -0
  26. package/lib/cjs/Signal/Group/index.d.ts.map +1 -0
  27. package/lib/cjs/Signal/Group/index.js +58 -0
  28. package/lib/cjs/Signal/Group/index.js.map +1 -0
  29. package/lib/cjs/Signal/Group/keyhelper.d.ts +11 -0
  30. package/lib/cjs/Signal/Group/keyhelper.d.ts.map +1 -0
  31. package/lib/cjs/Signal/Group/keyhelper.js +56 -0
  32. package/lib/cjs/Signal/Group/keyhelper.js.map +1 -0
  33. package/lib/cjs/Signal/Group/sender-chain-key.d.ts +14 -0
  34. package/lib/cjs/Signal/Group/sender-chain-key.d.ts.map +1 -0
  35. package/lib/cjs/Signal/Group/sender-chain-key.js +30 -0
  36. package/lib/cjs/Signal/Group/sender-chain-key.js.map +1 -0
  37. package/lib/cjs/Signal/Group/sender-key-distribution-message.d.ts +17 -0
  38. package/lib/cjs/Signal/Group/sender-key-distribution-message.d.ts.map +1 -0
  39. package/lib/cjs/Signal/Group/sender-key-distribution-message.js +67 -0
  40. package/lib/cjs/Signal/Group/sender-key-distribution-message.js.map +1 -0
  41. package/lib/cjs/Signal/Group/sender-key-message.d.ts +19 -0
  42. package/lib/cjs/Signal/Group/sender-key-message.d.ts.map +1 -0
  43. package/lib/cjs/Signal/Group/sender-key-message.js +70 -0
  44. package/lib/cjs/Signal/Group/sender-key-message.js.map +1 -0
  45. package/lib/cjs/Signal/Group/sender-key-name.d.ts +18 -0
  46. package/lib/cjs/Signal/Group/sender-key-name.d.ts.map +1 -0
  47. package/lib/cjs/Signal/Group/sender-key-name.js +52 -0
  48. package/lib/cjs/Signal/Group/sender-key-name.js.map +1 -0
  49. package/lib/cjs/Signal/Group/sender-key-record.d.ts +31 -0
  50. package/lib/cjs/Signal/Group/sender-key-record.d.ts.map +1 -0
  51. package/lib/cjs/Signal/Group/sender-key-record.js +45 -0
  52. package/lib/cjs/Signal/Group/sender-key-record.js.map +1 -0
  53. package/lib/cjs/Signal/Group/sender-key-state.d.ts +39 -0
  54. package/lib/cjs/Signal/Group/sender-key-state.d.ts.map +1 -0
  55. package/lib/cjs/Signal/Group/sender-key-state.js +88 -0
  56. package/lib/cjs/Signal/Group/sender-key-state.js.map +1 -0
  57. package/lib/cjs/Signal/Group/sender-message-key.d.ts +12 -0
  58. package/lib/cjs/Signal/Group/sender-message-key.d.ts.map +1 -0
  59. package/lib/cjs/Signal/Group/sender-message-key.js +30 -0
  60. package/lib/cjs/Signal/Group/sender-message-key.js.map +1 -0
  61. package/lib/cjs/Signal/jid-mapping.d.ts +50 -0
  62. package/lib/cjs/Signal/jid-mapping.d.ts.map +1 -0
  63. package/lib/cjs/Signal/jid-mapping.js +218 -0
  64. package/lib/cjs/Signal/jid-mapping.js.map +1 -0
  65. package/lib/cjs/Signal/libsignal.d.ts +7 -0
  66. package/lib/cjs/Signal/libsignal.d.ts.map +1 -0
  67. package/lib/cjs/Signal/libsignal.js +447 -0
  68. package/lib/cjs/Signal/libsignal.js.map +1 -0
  69. package/lib/cjs/Signal/lid-mapping.d.ts +6 -0
  70. package/lib/cjs/Signal/lid-mapping.d.ts.map +1 -0
  71. package/lib/cjs/Signal/lid-mapping.js +10 -0
  72. package/lib/cjs/Signal/lid-mapping.js.map +1 -0
  73. package/lib/cjs/Socket/Client/index.d.ts +3 -0
  74. package/lib/cjs/Socket/Client/index.d.ts.map +1 -0
  75. package/lib/cjs/Socket/Client/index.js +19 -0
  76. package/lib/cjs/Socket/Client/index.js.map +1 -0
  77. package/lib/cjs/Socket/Client/types.d.ts +16 -0
  78. package/lib/cjs/Socket/Client/types.d.ts.map +1 -0
  79. package/lib/cjs/Socket/Client/types.js +14 -0
  80. package/lib/cjs/Socket/Client/types.js.map +1 -0
  81. package/lib/cjs/Socket/Client/websocket.d.ts +13 -0
  82. package/lib/cjs/Socket/Client/websocket.d.ts.map +1 -0
  83. package/lib/cjs/Socket/Client/websocket.js +61 -0
  84. package/lib/cjs/Socket/Client/websocket.js.map +1 -0
  85. package/lib/cjs/Socket/business.d.ts +202 -0
  86. package/lib/cjs/Socket/business.d.ts.map +1 -0
  87. package/lib/cjs/Socket/business.js +383 -0
  88. package/lib/cjs/Socket/business.js.map +1 -0
  89. package/lib/cjs/Socket/chats.d.ts +111 -0
  90. package/lib/cjs/Socket/chats.d.ts.map +1 -0
  91. package/lib/cjs/Socket/chats.js +1006 -0
  92. package/lib/cjs/Socket/chats.js.map +1 -0
  93. package/lib/cjs/Socket/communities.d.ts +258 -0
  94. package/lib/cjs/Socket/communities.d.ts.map +1 -0
  95. package/lib/cjs/Socket/communities.js +439 -0
  96. package/lib/cjs/Socket/communities.js.map +1 -0
  97. package/lib/cjs/Socket/groups.d.ts +150 -0
  98. package/lib/cjs/Socket/groups.d.ts.map +1 -0
  99. package/lib/cjs/Socket/groups.js +335 -0
  100. package/lib/cjs/Socket/groups.js.map +1 -0
  101. package/lib/cjs/Socket/index.d.ts +245 -0
  102. package/lib/cjs/Socket/index.d.ts.map +1 -0
  103. package/lib/cjs/Socket/index.js +14 -0
  104. package/lib/cjs/Socket/index.js.map +1 -0
  105. package/lib/cjs/Socket/messages-recv.d.ts +187 -0
  106. package/lib/cjs/Socket/messages-recv.d.ts.map +1 -0
  107. package/lib/cjs/Socket/messages-recv.js +1325 -0
  108. package/lib/cjs/Socket/messages-recv.js.map +1 -0
  109. package/lib/cjs/Socket/messages-send.d.ts +183 -0
  110. package/lib/cjs/Socket/messages-send.d.ts.map +1 -0
  111. package/lib/cjs/Socket/messages-send.js +1046 -0
  112. package/lib/cjs/Socket/messages-send.js.map +1 -0
  113. package/lib/cjs/Socket/mex.d.ts +3 -0
  114. package/lib/cjs/Socket/mex.d.ts.map +1 -0
  115. package/lib/cjs/Socket/mex.js +46 -0
  116. package/lib/cjs/Socket/mex.js.map +1 -0
  117. package/lib/cjs/Socket/newsletter.d.ts +160 -0
  118. package/lib/cjs/Socket/newsletter.d.ts.map +1 -0
  119. package/lib/cjs/Socket/newsletter.js +185 -0
  120. package/lib/cjs/Socket/newsletter.js.map +1 -0
  121. package/lib/cjs/Socket/socket.d.ts +55 -0
  122. package/lib/cjs/Socket/socket.d.ts.map +1 -0
  123. package/lib/cjs/Socket/socket.js +940 -0
  124. package/lib/cjs/Socket/socket.js.map +1 -0
  125. package/lib/cjs/Types/Auth.d.ts +126 -0
  126. package/lib/cjs/Types/Auth.d.ts.map +1 -0
  127. package/lib/cjs/Types/Auth.js +3 -0
  128. package/lib/cjs/Types/Auth.js.map +1 -0
  129. package/lib/cjs/Types/Bussines.d.ts +25 -0
  130. package/lib/cjs/Types/Bussines.d.ts.map +1 -0
  131. package/lib/cjs/Types/Bussines.js +3 -0
  132. package/lib/cjs/Types/Bussines.js.map +1 -0
  133. package/lib/cjs/Types/Call.d.ts +15 -0
  134. package/lib/cjs/Types/Call.d.ts.map +1 -0
  135. package/lib/cjs/Types/Call.js +3 -0
  136. package/lib/cjs/Types/Call.js.map +1 -0
  137. package/lib/cjs/Types/Chat.d.ts +123 -0
  138. package/lib/cjs/Types/Chat.d.ts.map +1 -0
  139. package/lib/cjs/Types/Chat.js +11 -0
  140. package/lib/cjs/Types/Chat.js.map +1 -0
  141. package/lib/cjs/Types/Contact.d.ts +24 -0
  142. package/lib/cjs/Types/Contact.d.ts.map +1 -0
  143. package/lib/cjs/Types/Contact.js +3 -0
  144. package/lib/cjs/Types/Contact.js.map +1 -0
  145. package/lib/cjs/Types/Events.d.ts +241 -0
  146. package/lib/cjs/Types/Events.d.ts.map +1 -0
  147. package/lib/cjs/Types/Events.js +3 -0
  148. package/lib/cjs/Types/Events.js.map +1 -0
  149. package/lib/cjs/Types/GroupMetadata.d.ts +67 -0
  150. package/lib/cjs/Types/GroupMetadata.d.ts.map +1 -0
  151. package/lib/cjs/Types/GroupMetadata.js +3 -0
  152. package/lib/cjs/Types/GroupMetadata.js.map +1 -0
  153. package/lib/cjs/Types/Label.d.ts +47 -0
  154. package/lib/cjs/Types/Label.d.ts.map +1 -0
  155. package/lib/cjs/Types/Label.js +28 -0
  156. package/lib/cjs/Types/Label.js.map +1 -0
  157. package/lib/cjs/Types/LabelAssociation.d.ts +30 -0
  158. package/lib/cjs/Types/LabelAssociation.d.ts.map +1 -0
  159. package/lib/cjs/Types/LabelAssociation.js +10 -0
  160. package/lib/cjs/Types/LabelAssociation.js.map +1 -0
  161. package/lib/cjs/Types/Message.d.ts +310 -0
  162. package/lib/cjs/Types/Message.d.ts.map +1 -0
  163. package/lib/cjs/Types/Message.js +16 -0
  164. package/lib/cjs/Types/Message.js.map +1 -0
  165. package/lib/cjs/Types/Newsletter.d.ts +135 -0
  166. package/lib/cjs/Types/Newsletter.d.ts.map +1 -0
  167. package/lib/cjs/Types/Newsletter.js +34 -0
  168. package/lib/cjs/Types/Newsletter.js.map +1 -0
  169. package/lib/cjs/Types/Product.d.ts +79 -0
  170. package/lib/cjs/Types/Product.d.ts.map +1 -0
  171. package/lib/cjs/Types/Product.js +3 -0
  172. package/lib/cjs/Types/Product.js.map +1 -0
  173. package/lib/cjs/Types/Signal.d.ts +76 -0
  174. package/lib/cjs/Types/Signal.d.ts.map +1 -0
  175. package/lib/cjs/Types/Signal.js +3 -0
  176. package/lib/cjs/Types/Signal.js.map +1 -0
  177. package/lib/cjs/Types/Socket.d.ts +135 -0
  178. package/lib/cjs/Types/Socket.d.ts.map +1 -0
  179. package/lib/cjs/Types/Socket.js +3 -0
  180. package/lib/cjs/Types/Socket.js.map +1 -0
  181. package/lib/cjs/Types/State.d.ts +39 -0
  182. package/lib/cjs/Types/State.d.ts.map +1 -0
  183. package/lib/cjs/Types/State.js +15 -0
  184. package/lib/cjs/Types/State.js.map +1 -0
  185. package/lib/cjs/Types/USync.d.ts +26 -0
  186. package/lib/cjs/Types/USync.d.ts.map +1 -0
  187. package/lib/cjs/Types/USync.js +3 -0
  188. package/lib/cjs/Types/USync.js.map +1 -0
  189. package/lib/cjs/Types/index.d.ts +65 -0
  190. package/lib/cjs/Types/index.d.ts.map +1 -0
  191. package/lib/cjs/Types/index.js +43 -0
  192. package/lib/cjs/Types/index.js.map +1 -0
  193. package/lib/cjs/Utils/auth-utils.d.ts +19 -0
  194. package/lib/cjs/Utils/auth-utils.d.ts.map +1 -0
  195. package/lib/cjs/Utils/auth-utils.js +299 -0
  196. package/lib/cjs/Utils/auth-utils.js.map +1 -0
  197. package/lib/cjs/Utils/browser-utils.d.ts +4 -0
  198. package/lib/cjs/Utils/browser-utils.d.ts.map +1 -0
  199. package/lib/cjs/Utils/browser-utils.js +32 -0
  200. package/lib/cjs/Utils/browser-utils.js.map +1 -0
  201. package/lib/cjs/Utils/business.d.ts +23 -0
  202. package/lib/cjs/Utils/business.d.ts.map +1 -0
  203. package/lib/cjs/Utils/business.js +241 -0
  204. package/lib/cjs/Utils/business.js.map +1 -0
  205. package/lib/cjs/Utils/chat-utils.d.ts +70 -0
  206. package/lib/cjs/Utils/chat-utils.d.ts.map +1 -0
  207. package/lib/cjs/Utils/chat-utils.js +826 -0
  208. package/lib/cjs/Utils/chat-utils.js.map +1 -0
  209. package/lib/cjs/Utils/crypto.d.ts +37 -0
  210. package/lib/cjs/Utils/crypto.d.ts.map +1 -0
  211. package/lib/cjs/Utils/crypto.js +169 -0
  212. package/lib/cjs/Utils/crypto.js.map +1 -0
  213. package/lib/cjs/Utils/decode-wa-message.d.ts +48 -0
  214. package/lib/cjs/Utils/decode-wa-message.d.ts.map +1 -0
  215. package/lib/cjs/Utils/decode-wa-message.js +291 -0
  216. package/lib/cjs/Utils/decode-wa-message.js.map +1 -0
  217. package/lib/cjs/Utils/event-buffer.d.ts +34 -0
  218. package/lib/cjs/Utils/event-buffer.d.ts.map +1 -0
  219. package/lib/cjs/Utils/event-buffer.js +581 -0
  220. package/lib/cjs/Utils/event-buffer.js.map +1 -0
  221. package/lib/cjs/Utils/generics.d.ts +91 -0
  222. package/lib/cjs/Utils/generics.d.ts.map +1 -0
  223. package/lib/cjs/Utils/generics.js +416 -0
  224. package/lib/cjs/Utils/generics.js.map +1 -0
  225. package/lib/cjs/Utils/history.d.ts +22 -0
  226. package/lib/cjs/Utils/history.d.ts.map +1 -0
  227. package/lib/cjs/Utils/history.js +138 -0
  228. package/lib/cjs/Utils/history.js.map +1 -0
  229. package/lib/cjs/Utils/identity-change-handler.d.ts +38 -0
  230. package/lib/cjs/Utils/identity-change-handler.d.ts.map +1 -0
  231. package/lib/cjs/Utils/identity-change-handler.js +52 -0
  232. package/lib/cjs/Utils/identity-change-handler.js.map +1 -0
  233. package/lib/cjs/Utils/index.d.ts +21 -0
  234. package/lib/cjs/Utils/index.d.ts.map +1 -0
  235. package/lib/cjs/Utils/index.js +37 -0
  236. package/lib/cjs/Utils/index.js.map +1 -0
  237. package/lib/cjs/Utils/link-preview.d.ts +21 -0
  238. package/lib/cjs/Utils/link-preview.d.ts.map +1 -0
  239. package/lib/cjs/Utils/link-preview.js +122 -0
  240. package/lib/cjs/Utils/link-preview.js.map +1 -0
  241. package/lib/cjs/Utils/logger.d.ts +13 -0
  242. package/lib/cjs/Utils/logger.d.ts.map +1 -0
  243. package/lib/cjs/Utils/logger.js +8 -0
  244. package/lib/cjs/Utils/logger.js.map +1 -0
  245. package/lib/cjs/Utils/lt-hash.d.ts +8 -0
  246. package/lib/cjs/Utils/lt-hash.d.ts.map +1 -0
  247. package/lib/cjs/Utils/lt-hash.js +11 -0
  248. package/lib/cjs/Utils/lt-hash.js.map +1 -0
  249. package/lib/cjs/Utils/make-mutex.d.ts +9 -0
  250. package/lib/cjs/Utils/make-mutex.d.ts.map +1 -0
  251. package/lib/cjs/Utils/make-mutex.js +38 -0
  252. package/lib/cjs/Utils/make-mutex.js.map +1 -0
  253. package/lib/cjs/Utils/message-retry-manager.d.ts +110 -0
  254. package/lib/cjs/Utils/message-retry-manager.d.ts.map +1 -0
  255. package/lib/cjs/Utils/message-retry-manager.js +229 -0
  256. package/lib/cjs/Utils/message-retry-manager.js.map +1 -0
  257. package/lib/cjs/Utils/messages-media.d.ts +130 -0
  258. package/lib/cjs/Utils/messages-media.d.ts.map +1 -0
  259. package/lib/cjs/Utils/messages-media.js +835 -0
  260. package/lib/cjs/Utils/messages-media.js.map +1 -0
  261. package/lib/cjs/Utils/messages.d.ts +91 -0
  262. package/lib/cjs/Utils/messages.d.ts.map +1 -0
  263. package/lib/cjs/Utils/messages.js +902 -0
  264. package/lib/cjs/Utils/messages.js.map +1 -0
  265. package/lib/cjs/Utils/noise-handler.d.ts +20 -0
  266. package/lib/cjs/Utils/noise-handler.d.ts.map +1 -0
  267. package/lib/cjs/Utils/noise-handler.js +205 -0
  268. package/lib/cjs/Utils/noise-handler.js.map +1 -0
  269. package/lib/cjs/Utils/offline-node-processor.d.ts +17 -0
  270. package/lib/cjs/Utils/offline-node-processor.d.ts.map +1 -0
  271. package/lib/cjs/Utils/offline-node-processor.js +43 -0
  272. package/lib/cjs/Utils/offline-node-processor.js.map +1 -0
  273. package/lib/cjs/Utils/pre-key-manager.d.ts +28 -0
  274. package/lib/cjs/Utils/pre-key-manager.d.ts.map +1 -0
  275. package/lib/cjs/Utils/pre-key-manager.js +113 -0
  276. package/lib/cjs/Utils/pre-key-manager.js.map +1 -0
  277. package/lib/cjs/Utils/process-message.d.ts +60 -0
  278. package/lib/cjs/Utils/process-message.d.ts.map +1 -0
  279. package/lib/cjs/Utils/process-message.js +539 -0
  280. package/lib/cjs/Utils/process-message.js.map +1 -0
  281. package/lib/cjs/Utils/reporting-utils.d.ts +11 -0
  282. package/lib/cjs/Utils/reporting-utils.d.ts.map +1 -0
  283. package/lib/cjs/Utils/reporting-utils.js +262 -0
  284. package/lib/cjs/Utils/reporting-utils.js.map +1 -0
  285. package/lib/cjs/Utils/signal.d.ts +34 -0
  286. package/lib/cjs/Utils/signal.d.ts.map +1 -0
  287. package/lib/cjs/Utils/signal.js +171 -0
  288. package/lib/cjs/Utils/signal.js.map +1 -0
  289. package/lib/cjs/Utils/stanza-ack.d.ts +11 -0
  290. package/lib/cjs/Utils/stanza-ack.d.ts.map +1 -0
  291. package/lib/cjs/Utils/stanza-ack.js +41 -0
  292. package/lib/cjs/Utils/stanza-ack.js.map +1 -0
  293. package/lib/cjs/Utils/sync-action-utils.d.ts +19 -0
  294. package/lib/cjs/Utils/sync-action-utils.d.ts.map +1 -0
  295. package/lib/cjs/Utils/sync-action-utils.js +52 -0
  296. package/lib/cjs/Utils/sync-action-utils.js.map +1 -0
  297. package/lib/cjs/Utils/tc-token-utils.d.ts +12 -0
  298. package/lib/cjs/Utils/tc-token-utils.d.ts.map +1 -0
  299. package/lib/cjs/Utils/tc-token-utils.js +21 -0
  300. package/lib/cjs/Utils/tc-token-utils.js.map +1 -0
  301. package/lib/cjs/Utils/use-multi-file-auth-state.d.ts +13 -0
  302. package/lib/cjs/Utils/use-multi-file-auth-state.d.ts.map +1 -0
  303. package/lib/cjs/Utils/use-multi-file-auth-state.js +125 -0
  304. package/lib/cjs/Utils/use-multi-file-auth-state.js.map +1 -0
  305. package/lib/cjs/Utils/validate-connection.d.ts +11 -0
  306. package/lib/cjs/Utils/validate-connection.d.ts.map +1 -0
  307. package/lib/cjs/Utils/validate-connection.js +209 -0
  308. package/lib/cjs/Utils/validate-connection.js.map +1 -0
  309. package/lib/cjs/WABinary/constants.d.ts +28 -0
  310. package/lib/cjs/WABinary/constants.d.ts.map +1 -0
  311. package/lib/cjs/WABinary/constants.js +1304 -0
  312. package/lib/cjs/WABinary/constants.js.map +1 -0
  313. package/lib/cjs/WABinary/decode.d.ts +7 -0
  314. package/lib/cjs/WABinary/decode.d.ts.map +1 -0
  315. package/lib/cjs/WABinary/decode.js +301 -0
  316. package/lib/cjs/WABinary/decode.js.map +1 -0
  317. package/lib/cjs/WABinary/encode.d.ts +3 -0
  318. package/lib/cjs/WABinary/encode.d.ts.map +1 -0
  319. package/lib/cjs/WABinary/encode.js +257 -0
  320. package/lib/cjs/WABinary/encode.js.map +1 -0
  321. package/lib/cjs/WABinary/generic-utils.d.ts +15 -0
  322. package/lib/cjs/WABinary/generic-utils.d.ts.map +1 -0
  323. package/lib/cjs/WABinary/generic-utils.js +125 -0
  324. package/lib/cjs/WABinary/generic-utils.js.map +1 -0
  325. package/lib/cjs/WABinary/index.d.ts +6 -0
  326. package/lib/cjs/WABinary/index.d.ts.map +1 -0
  327. package/lib/cjs/WABinary/index.js +22 -0
  328. package/lib/cjs/WABinary/index.js.map +1 -0
  329. package/lib/cjs/WABinary/jid-utils.d.ts +48 -0
  330. package/lib/cjs/WABinary/jid-utils.d.ts.map +1 -0
  331. package/lib/cjs/WABinary/jid-utils.js +115 -0
  332. package/lib/cjs/WABinary/jid-utils.js.map +1 -0
  333. package/lib/cjs/WABinary/types.d.ts +19 -0
  334. package/lib/cjs/WABinary/types.d.ts.map +1 -0
  335. package/lib/cjs/WABinary/types.js +3 -0
  336. package/lib/cjs/WABinary/types.js.map +1 -0
  337. package/lib/cjs/WAM/BinaryInfo.d.ts +9 -0
  338. package/lib/cjs/WAM/BinaryInfo.d.ts.map +1 -0
  339. package/lib/cjs/WAM/BinaryInfo.js +14 -0
  340. package/lib/cjs/WAM/BinaryInfo.js.map +1 -0
  341. package/lib/cjs/WAM/constants.d.ts +40 -0
  342. package/lib/cjs/WAM/constants.d.ts.map +1 -0
  343. package/lib/cjs/WAM/constants.js +22856 -0
  344. package/lib/cjs/WAM/constants.js.map +1 -0
  345. package/lib/cjs/WAM/encode.d.ts +3 -0
  346. package/lib/cjs/WAM/encode.d.ts.map +1 -0
  347. package/lib/cjs/WAM/encode.js +153 -0
  348. package/lib/cjs/WAM/encode.js.map +1 -0
  349. package/lib/cjs/WAM/index.d.ts +4 -0
  350. package/lib/cjs/WAM/index.d.ts.map +1 -0
  351. package/lib/cjs/WAM/index.js +20 -0
  352. package/lib/cjs/WAM/index.js.map +1 -0
  353. package/lib/cjs/WAUSync/Protocols/USyncContactProtocol.d.ts +10 -0
  354. package/lib/cjs/WAUSync/Protocols/USyncContactProtocol.d.ts.map +1 -0
  355. package/lib/cjs/WAUSync/Protocols/USyncContactProtocol.js +32 -0
  356. package/lib/cjs/WAUSync/Protocols/USyncContactProtocol.js.map +1 -0
  357. package/lib/cjs/WAUSync/Protocols/USyncDeviceProtocol.d.ts +23 -0
  358. package/lib/cjs/WAUSync/Protocols/USyncDeviceProtocol.d.ts.map +1 -0
  359. package/lib/cjs/WAUSync/Protocols/USyncDeviceProtocol.js +58 -0
  360. package/lib/cjs/WAUSync/Protocols/USyncDeviceProtocol.js.map +1 -0
  361. package/lib/cjs/WAUSync/Protocols/USyncDisappearingModeProtocol.d.ts +13 -0
  362. package/lib/cjs/WAUSync/Protocols/USyncDisappearingModeProtocol.d.ts.map +1 -0
  363. package/lib/cjs/WAUSync/Protocols/USyncDisappearingModeProtocol.js +31 -0
  364. package/lib/cjs/WAUSync/Protocols/USyncDisappearingModeProtocol.js.map +1 -0
  365. package/lib/cjs/WAUSync/Protocols/USyncStatusProtocol.d.ts +13 -0
  366. package/lib/cjs/WAUSync/Protocols/USyncStatusProtocol.d.ts.map +1 -0
  367. package/lib/cjs/WAUSync/Protocols/USyncStatusProtocol.js +42 -0
  368. package/lib/cjs/WAUSync/Protocols/USyncStatusProtocol.js.map +1 -0
  369. package/lib/cjs/WAUSync/Protocols/UsyncBotProfileProtocol.d.ts +26 -0
  370. package/lib/cjs/WAUSync/Protocols/UsyncBotProfileProtocol.d.ts.map +1 -0
  371. package/lib/cjs/WAUSync/Protocols/UsyncBotProfileProtocol.js +54 -0
  372. package/lib/cjs/WAUSync/Protocols/UsyncBotProfileProtocol.js.map +1 -0
  373. package/lib/cjs/WAUSync/Protocols/UsyncLIDProtocol.d.ts +17 -0
  374. package/lib/cjs/WAUSync/Protocols/UsyncLIDProtocol.d.ts.map +1 -0
  375. package/lib/cjs/WAUSync/Protocols/UsyncLIDProtocol.js +33 -0
  376. package/lib/cjs/WAUSync/Protocols/UsyncLIDProtocol.js.map +1 -0
  377. package/lib/cjs/WAUSync/Protocols/index.d.ts +5 -0
  378. package/lib/cjs/WAUSync/Protocols/index.d.ts.map +1 -0
  379. package/lib/cjs/WAUSync/Protocols/index.js +21 -0
  380. package/lib/cjs/WAUSync/Protocols/index.js.map +1 -0
  381. package/lib/cjs/WAUSync/USyncQuery.d.ts +29 -0
  382. package/lib/cjs/WAUSync/USyncQuery.d.ts.map +1 -0
  383. package/lib/cjs/WAUSync/USyncQuery.js +97 -0
  384. package/lib/cjs/WAUSync/USyncQuery.js.map +1 -0
  385. package/lib/cjs/WAUSync/USyncUser.d.ts +13 -0
  386. package/lib/cjs/WAUSync/USyncUser.d.ts.map +1 -0
  387. package/lib/cjs/WAUSync/USyncUser.js +27 -0
  388. package/lib/cjs/WAUSync/USyncUser.js.map +1 -0
  389. package/lib/cjs/WAUSync/index.d.ts +4 -0
  390. package/lib/cjs/WAUSync/index.d.ts.map +1 -0
  391. package/lib/cjs/WAUSync/index.js +20 -0
  392. package/lib/cjs/WAUSync/index.js.map +1 -0
  393. package/lib/cjs/index.d.ts +12 -0
  394. package/lib/cjs/index.d.ts.map +1 -0
  395. package/lib/cjs/index.js +31 -0
  396. package/lib/cjs/index.js.map +1 -0
  397. package/lib/cjs/package.json +3 -0
  398. package/lib/esm/Defaults/index.d.ts +74 -0
  399. package/lib/esm/Defaults/index.d.ts.map +1 -0
  400. package/lib/esm/Defaults/index.js +128 -0
  401. package/lib/esm/Defaults/index.js.map +1 -0
  402. package/lib/esm/Signal/Group/ciphertext-message.d.ts +10 -0
  403. package/lib/esm/Signal/Group/ciphertext-message.d.ts.map +1 -0
  404. package/lib/esm/Signal/Group/ciphertext-message.js +12 -0
  405. package/lib/esm/Signal/Group/ciphertext-message.js.map +1 -0
  406. package/lib/esm/Signal/Group/group-session-builder.d.ts +15 -0
  407. package/lib/esm/Signal/Group/group-session-builder.d.ts.map +1 -0
  408. package/lib/esm/Signal/Group/group-session-builder.js +30 -0
  409. package/lib/esm/Signal/Group/group-session-builder.js.map +1 -0
  410. package/lib/esm/Signal/Group/group_cipher.d.ts +17 -0
  411. package/lib/esm/Signal/Group/group_cipher.d.ts.map +1 -0
  412. package/lib/esm/Signal/Group/group_cipher.js +82 -0
  413. package/lib/esm/Signal/Group/group_cipher.js.map +1 -0
  414. package/lib/esm/Signal/Group/index.d.ts +12 -0
  415. package/lib/esm/Signal/Group/index.d.ts.map +1 -0
  416. package/lib/esm/Signal/Group/index.js +12 -0
  417. package/lib/esm/Signal/Group/index.js.map +1 -0
  418. package/lib/esm/Signal/Group/keyhelper.d.ts +11 -0
  419. package/lib/esm/Signal/Group/keyhelper.d.ts.map +1 -0
  420. package/lib/esm/Signal/Group/keyhelper.js +18 -0
  421. package/lib/esm/Signal/Group/keyhelper.js.map +1 -0
  422. package/lib/esm/Signal/Group/sender-chain-key.d.ts +14 -0
  423. package/lib/esm/Signal/Group/sender-chain-key.d.ts.map +1 -0
  424. package/lib/esm/Signal/Group/sender-chain-key.js +26 -0
  425. package/lib/esm/Signal/Group/sender-chain-key.js.map +1 -0
  426. package/lib/esm/Signal/Group/sender-key-distribution-message.d.ts +17 -0
  427. package/lib/esm/Signal/Group/sender-key-distribution-message.d.ts.map +1 -0
  428. package/lib/esm/Signal/Group/sender-key-distribution-message.js +63 -0
  429. package/lib/esm/Signal/Group/sender-key-distribution-message.js.map +1 -0
  430. package/lib/esm/Signal/Group/sender-key-message.d.ts +19 -0
  431. package/lib/esm/Signal/Group/sender-key-message.d.ts.map +1 -0
  432. package/lib/esm/Signal/Group/sender-key-message.js +66 -0
  433. package/lib/esm/Signal/Group/sender-key-message.js.map +1 -0
  434. package/lib/esm/Signal/Group/sender-key-name.d.ts +18 -0
  435. package/lib/esm/Signal/Group/sender-key-name.d.ts.map +1 -0
  436. package/lib/esm/Signal/Group/sender-key-name.js +48 -0
  437. package/lib/esm/Signal/Group/sender-key-name.js.map +1 -0
  438. package/lib/esm/Signal/Group/sender-key-record.d.ts +31 -0
  439. package/lib/esm/Signal/Group/sender-key-record.d.ts.map +1 -0
  440. package/lib/esm/Signal/Group/sender-key-record.js +41 -0
  441. package/lib/esm/Signal/Group/sender-key-record.js.map +1 -0
  442. package/lib/esm/Signal/Group/sender-key-state.d.ts +39 -0
  443. package/lib/esm/Signal/Group/sender-key-state.d.ts.map +1 -0
  444. package/lib/esm/Signal/Group/sender-key-state.js +84 -0
  445. package/lib/esm/Signal/Group/sender-key-state.js.map +1 -0
  446. package/lib/esm/Signal/Group/sender-message-key.d.ts +12 -0
  447. package/lib/esm/Signal/Group/sender-message-key.d.ts.map +1 -0
  448. package/lib/esm/Signal/Group/sender-message-key.js +26 -0
  449. package/lib/esm/Signal/Group/sender-message-key.js.map +1 -0
  450. package/lib/esm/Signal/jid-mapping.d.ts +50 -0
  451. package/lib/esm/Signal/jid-mapping.d.ts.map +1 -0
  452. package/lib/esm/Signal/jid-mapping.js +214 -0
  453. package/lib/esm/Signal/jid-mapping.js.map +1 -0
  454. package/lib/esm/Signal/libsignal.d.ts +7 -0
  455. package/lib/esm/Signal/libsignal.d.ts.map +1 -0
  456. package/lib/esm/Signal/libsignal.js +413 -0
  457. package/lib/esm/Signal/libsignal.js.map +1 -0
  458. package/lib/esm/Signal/lid-mapping.d.ts +6 -0
  459. package/lib/esm/Signal/lid-mapping.d.ts.map +1 -0
  460. package/lib/esm/Signal/lid-mapping.js +6 -0
  461. package/lib/esm/Signal/lid-mapping.js.map +1 -0
  462. package/lib/esm/Socket/Client/index.d.ts +3 -0
  463. package/lib/esm/Socket/Client/index.d.ts.map +1 -0
  464. package/lib/esm/Socket/Client/index.js +3 -0
  465. package/lib/esm/Socket/Client/index.js.map +1 -0
  466. package/lib/esm/Socket/Client/types.d.ts +16 -0
  467. package/lib/esm/Socket/Client/types.d.ts.map +1 -0
  468. package/lib/esm/Socket/Client/types.js +11 -0
  469. package/lib/esm/Socket/Client/types.js.map +1 -0
  470. package/lib/esm/Socket/Client/websocket.d.ts +13 -0
  471. package/lib/esm/Socket/Client/websocket.d.ts.map +1 -0
  472. package/lib/esm/Socket/Client/websocket.js +54 -0
  473. package/lib/esm/Socket/Client/websocket.js.map +1 -0
  474. package/lib/esm/Socket/business.d.ts +202 -0
  475. package/lib/esm/Socket/business.d.ts.map +1 -0
  476. package/lib/esm/Socket/business.js +379 -0
  477. package/lib/esm/Socket/business.js.map +1 -0
  478. package/lib/esm/Socket/chats.d.ts +111 -0
  479. package/lib/esm/Socket/chats.d.ts.map +1 -0
  480. package/lib/esm/Socket/chats.js +999 -0
  481. package/lib/esm/Socket/chats.js.map +1 -0
  482. package/lib/esm/Socket/communities.d.ts +258 -0
  483. package/lib/esm/Socket/communities.d.ts.map +1 -0
  484. package/lib/esm/Socket/communities.js +431 -0
  485. package/lib/esm/Socket/communities.js.map +1 -0
  486. package/lib/esm/Socket/groups.d.ts +150 -0
  487. package/lib/esm/Socket/groups.d.ts.map +1 -0
  488. package/lib/esm/Socket/groups.js +330 -0
  489. package/lib/esm/Socket/groups.js.map +1 -0
  490. package/lib/esm/Socket/index.d.ts +245 -0
  491. package/lib/esm/Socket/index.d.ts.map +1 -0
  492. package/lib/esm/Socket/index.js +12 -0
  493. package/lib/esm/Socket/index.js.map +1 -0
  494. package/lib/esm/Socket/messages-recv.d.ts +187 -0
  495. package/lib/esm/Socket/messages-recv.d.ts.map +1 -0
  496. package/lib/esm/Socket/messages-recv.js +1319 -0
  497. package/lib/esm/Socket/messages-recv.js.map +1 -0
  498. package/lib/esm/Socket/messages-send.d.ts +183 -0
  499. package/lib/esm/Socket/messages-send.d.ts.map +1 -0
  500. package/lib/esm/Socket/messages-send.js +1039 -0
  501. package/lib/esm/Socket/messages-send.js.map +1 -0
  502. package/lib/esm/Socket/mex.d.ts +3 -0
  503. package/lib/esm/Socket/mex.d.ts.map +1 -0
  504. package/lib/esm/Socket/mex.js +42 -0
  505. package/lib/esm/Socket/mex.js.map +1 -0
  506. package/lib/esm/Socket/newsletter.d.ts +160 -0
  507. package/lib/esm/Socket/newsletter.d.ts.map +1 -0
  508. package/lib/esm/Socket/newsletter.js +181 -0
  509. package/lib/esm/Socket/newsletter.js.map +1 -0
  510. package/lib/esm/Socket/socket.d.ts +55 -0
  511. package/lib/esm/Socket/socket.d.ts.map +1 -0
  512. package/lib/esm/Socket/socket.js +936 -0
  513. package/lib/esm/Socket/socket.js.map +1 -0
  514. package/lib/esm/Types/Auth.d.ts +126 -0
  515. package/lib/esm/Types/Auth.d.ts.map +1 -0
  516. package/lib/esm/Types/Auth.js +2 -0
  517. package/lib/esm/Types/Auth.js.map +1 -0
  518. package/lib/esm/Types/Bussines.d.ts +25 -0
  519. package/lib/esm/Types/Bussines.d.ts.map +1 -0
  520. package/lib/esm/Types/Bussines.js +2 -0
  521. package/lib/esm/Types/Bussines.js.map +1 -0
  522. package/lib/esm/Types/Call.d.ts +15 -0
  523. package/lib/esm/Types/Call.d.ts.map +1 -0
  524. package/lib/esm/Types/Call.js +2 -0
  525. package/lib/esm/Types/Call.js.map +1 -0
  526. package/lib/esm/Types/Chat.d.ts +123 -0
  527. package/lib/esm/Types/Chat.d.ts.map +1 -0
  528. package/lib/esm/Types/Chat.js +8 -0
  529. package/lib/esm/Types/Chat.js.map +1 -0
  530. package/lib/esm/Types/Contact.d.ts +24 -0
  531. package/lib/esm/Types/Contact.d.ts.map +1 -0
  532. package/lib/esm/Types/Contact.js +2 -0
  533. package/lib/esm/Types/Contact.js.map +1 -0
  534. package/lib/esm/Types/Events.d.ts +241 -0
  535. package/lib/esm/Types/Events.d.ts.map +1 -0
  536. package/lib/esm/Types/Events.js +2 -0
  537. package/lib/esm/Types/Events.js.map +1 -0
  538. package/lib/esm/Types/GroupMetadata.d.ts +67 -0
  539. package/lib/esm/Types/GroupMetadata.d.ts.map +1 -0
  540. package/lib/esm/Types/GroupMetadata.js +2 -0
  541. package/lib/esm/Types/GroupMetadata.js.map +1 -0
  542. package/lib/esm/Types/Label.d.ts +47 -0
  543. package/lib/esm/Types/Label.d.ts.map +1 -0
  544. package/lib/esm/Types/Label.js +25 -0
  545. package/lib/esm/Types/Label.js.map +1 -0
  546. package/lib/esm/Types/LabelAssociation.d.ts +30 -0
  547. package/lib/esm/Types/LabelAssociation.d.ts.map +1 -0
  548. package/lib/esm/Types/LabelAssociation.js +7 -0
  549. package/lib/esm/Types/LabelAssociation.js.map +1 -0
  550. package/lib/esm/Types/Message.d.ts +310 -0
  551. package/lib/esm/Types/Message.d.ts.map +1 -0
  552. package/lib/esm/Types/Message.js +14 -0
  553. package/lib/esm/Types/Message.js.map +1 -0
  554. package/lib/esm/Types/Newsletter.d.ts +135 -0
  555. package/lib/esm/Types/Newsletter.d.ts.map +1 -0
  556. package/lib/esm/Types/Newsletter.js +31 -0
  557. package/lib/esm/Types/Newsletter.js.map +1 -0
  558. package/lib/esm/Types/Product.d.ts +79 -0
  559. package/lib/esm/Types/Product.d.ts.map +1 -0
  560. package/lib/esm/Types/Product.js +2 -0
  561. package/lib/esm/Types/Product.js.map +1 -0
  562. package/lib/esm/Types/Signal.d.ts +76 -0
  563. package/lib/esm/Types/Signal.d.ts.map +1 -0
  564. package/lib/esm/Types/Signal.js +2 -0
  565. package/lib/esm/Types/Signal.js.map +1 -0
  566. package/lib/esm/Types/Socket.d.ts +135 -0
  567. package/lib/esm/Types/Socket.d.ts.map +1 -0
  568. package/lib/esm/Types/Socket.js +3 -0
  569. package/lib/esm/Types/Socket.js.map +1 -0
  570. package/lib/esm/Types/State.d.ts +39 -0
  571. package/lib/esm/Types/State.d.ts.map +1 -0
  572. package/lib/esm/Types/State.js +13 -0
  573. package/lib/esm/Types/State.js.map +1 -0
  574. package/lib/esm/Types/USync.d.ts +26 -0
  575. package/lib/esm/Types/USync.d.ts.map +1 -0
  576. package/lib/esm/Types/USync.js +2 -0
  577. package/lib/esm/Types/USync.js.map +1 -0
  578. package/lib/esm/Types/index.d.ts +65 -0
  579. package/lib/esm/Types/index.d.ts.map +1 -0
  580. package/lib/esm/Types/index.js +26 -0
  581. package/lib/esm/Types/index.js.map +1 -0
  582. package/lib/esm/Utils/auth-utils.d.ts +19 -0
  583. package/lib/esm/Utils/auth-utils.d.ts.map +1 -0
  584. package/lib/esm/Utils/auth-utils.js +290 -0
  585. package/lib/esm/Utils/auth-utils.js.map +1 -0
  586. package/lib/esm/Utils/browser-utils.d.ts +4 -0
  587. package/lib/esm/Utils/browser-utils.d.ts.map +1 -0
  588. package/lib/esm/Utils/browser-utils.js +28 -0
  589. package/lib/esm/Utils/browser-utils.js.map +1 -0
  590. package/lib/esm/Utils/business.d.ts +23 -0
  591. package/lib/esm/Utils/business.d.ts.map +1 -0
  592. package/lib/esm/Utils/business.js +231 -0
  593. package/lib/esm/Utils/business.js.map +1 -0
  594. package/lib/esm/Utils/chat-utils.d.ts +70 -0
  595. package/lib/esm/Utils/chat-utils.d.ts.map +1 -0
  596. package/lib/esm/Utils/chat-utils.js +812 -0
  597. package/lib/esm/Utils/chat-utils.js.map +1 -0
  598. package/lib/esm/Utils/crypto.d.ts +37 -0
  599. package/lib/esm/Utils/crypto.d.ts.map +1 -0
  600. package/lib/esm/Utils/crypto.js +118 -0
  601. package/lib/esm/Utils/crypto.js.map +1 -0
  602. package/lib/esm/Utils/decode-wa-message.d.ts +48 -0
  603. package/lib/esm/Utils/decode-wa-message.d.ts.map +1 -0
  604. package/lib/esm/Utils/decode-wa-message.js +286 -0
  605. package/lib/esm/Utils/decode-wa-message.js.map +1 -0
  606. package/lib/esm/Utils/event-buffer.d.ts +34 -0
  607. package/lib/esm/Utils/event-buffer.d.ts.map +1 -0
  608. package/lib/esm/Utils/event-buffer.js +574 -0
  609. package/lib/esm/Utils/event-buffer.js.map +1 -0
  610. package/lib/esm/Utils/generics.d.ts +91 -0
  611. package/lib/esm/Utils/generics.d.ts.map +1 -0
  612. package/lib/esm/Utils/generics.js +384 -0
  613. package/lib/esm/Utils/generics.js.map +1 -0
  614. package/lib/esm/Utils/history.d.ts +22 -0
  615. package/lib/esm/Utils/history.d.ts.map +1 -0
  616. package/lib/esm/Utils/history.js +131 -0
  617. package/lib/esm/Utils/history.js.map +1 -0
  618. package/lib/esm/Utils/identity-change-handler.d.ts +38 -0
  619. package/lib/esm/Utils/identity-change-handler.d.ts.map +1 -0
  620. package/lib/esm/Utils/identity-change-handler.js +50 -0
  621. package/lib/esm/Utils/identity-change-handler.js.map +1 -0
  622. package/lib/esm/Utils/index.d.ts +21 -0
  623. package/lib/esm/Utils/index.d.ts.map +1 -0
  624. package/lib/esm/Utils/index.js +21 -0
  625. package/lib/esm/Utils/index.js.map +1 -0
  626. package/lib/esm/Utils/link-preview.d.ts +21 -0
  627. package/lib/esm/Utils/link-preview.d.ts.map +1 -0
  628. package/lib/esm/Utils/link-preview.js +85 -0
  629. package/lib/esm/Utils/link-preview.js.map +1 -0
  630. package/lib/esm/Utils/logger.d.ts +13 -0
  631. package/lib/esm/Utils/logger.d.ts.map +1 -0
  632. package/lib/esm/Utils/logger.js +3 -0
  633. package/lib/esm/Utils/logger.js.map +1 -0
  634. package/lib/esm/Utils/lt-hash.d.ts +8 -0
  635. package/lib/esm/Utils/lt-hash.d.ts.map +1 -0
  636. package/lib/esm/Utils/lt-hash.js +8 -0
  637. package/lib/esm/Utils/lt-hash.js.map +1 -0
  638. package/lib/esm/Utils/make-mutex.d.ts +9 -0
  639. package/lib/esm/Utils/make-mutex.d.ts.map +1 -0
  640. package/lib/esm/Utils/make-mutex.js +33 -0
  641. package/lib/esm/Utils/make-mutex.js.map +1 -0
  642. package/lib/esm/Utils/message-retry-manager.d.ts +110 -0
  643. package/lib/esm/Utils/message-retry-manager.d.ts.map +1 -0
  644. package/lib/esm/Utils/message-retry-manager.js +225 -0
  645. package/lib/esm/Utils/message-retry-manager.js.map +1 -0
  646. package/lib/esm/Utils/messages-media.d.ts +130 -0
  647. package/lib/esm/Utils/messages-media.d.ts.map +1 -0
  648. package/lib/esm/Utils/messages-media.js +774 -0
  649. package/lib/esm/Utils/messages-media.js.map +1 -0
  650. package/lib/esm/Utils/messages.d.ts +91 -0
  651. package/lib/esm/Utils/messages.d.ts.map +1 -0
  652. package/lib/esm/Utils/messages.js +878 -0
  653. package/lib/esm/Utils/messages.js.map +1 -0
  654. package/lib/esm/Utils/noise-handler.d.ts +20 -0
  655. package/lib/esm/Utils/noise-handler.d.ts.map +1 -0
  656. package/lib/esm/Utils/noise-handler.js +201 -0
  657. package/lib/esm/Utils/noise-handler.js.map +1 -0
  658. package/lib/esm/Utils/offline-node-processor.d.ts +17 -0
  659. package/lib/esm/Utils/offline-node-processor.d.ts.map +1 -0
  660. package/lib/esm/Utils/offline-node-processor.js +40 -0
  661. package/lib/esm/Utils/offline-node-processor.js.map +1 -0
  662. package/lib/esm/Utils/pre-key-manager.d.ts +28 -0
  663. package/lib/esm/Utils/pre-key-manager.d.ts.map +1 -0
  664. package/lib/esm/Utils/pre-key-manager.js +106 -0
  665. package/lib/esm/Utils/pre-key-manager.js.map +1 -0
  666. package/lib/esm/Utils/process-message.d.ts +60 -0
  667. package/lib/esm/Utils/process-message.d.ts.map +1 -0
  668. package/lib/esm/Utils/process-message.js +530 -0
  669. package/lib/esm/Utils/process-message.js.map +1 -0
  670. package/lib/esm/Utils/reporting-utils.d.ts +11 -0
  671. package/lib/esm/Utils/reporting-utils.d.ts.map +1 -0
  672. package/lib/esm/Utils/reporting-utils.js +258 -0
  673. package/lib/esm/Utils/reporting-utils.js.map +1 -0
  674. package/lib/esm/Utils/signal.d.ts +34 -0
  675. package/lib/esm/Utils/signal.d.ts.map +1 -0
  676. package/lib/esm/Utils/signal.js +159 -0
  677. package/lib/esm/Utils/signal.js.map +1 -0
  678. package/lib/esm/Utils/stanza-ack.d.ts +11 -0
  679. package/lib/esm/Utils/stanza-ack.d.ts.map +1 -0
  680. package/lib/esm/Utils/stanza-ack.js +38 -0
  681. package/lib/esm/Utils/stanza-ack.js.map +1 -0
  682. package/lib/esm/Utils/sync-action-utils.d.ts +19 -0
  683. package/lib/esm/Utils/sync-action-utils.d.ts.map +1 -0
  684. package/lib/esm/Utils/sync-action-utils.js +48 -0
  685. package/lib/esm/Utils/sync-action-utils.js.map +1 -0
  686. package/lib/esm/Utils/tc-token-utils.d.ts +12 -0
  687. package/lib/esm/Utils/tc-token-utils.d.ts.map +1 -0
  688. package/lib/esm/Utils/tc-token-utils.js +18 -0
  689. package/lib/esm/Utils/tc-token-utils.js.map +1 -0
  690. package/lib/esm/Utils/use-multi-file-auth-state.d.ts +13 -0
  691. package/lib/esm/Utils/use-multi-file-auth-state.d.ts.map +1 -0
  692. package/lib/esm/Utils/use-multi-file-auth-state.js +121 -0
  693. package/lib/esm/Utils/use-multi-file-auth-state.js.map +1 -0
  694. package/lib/esm/Utils/validate-connection.d.ts +11 -0
  695. package/lib/esm/Utils/validate-connection.d.ts.map +1 -0
  696. package/lib/esm/Utils/validate-connection.js +202 -0
  697. package/lib/esm/Utils/validate-connection.js.map +1 -0
  698. package/lib/esm/WABinary/constants.d.ts +28 -0
  699. package/lib/esm/WABinary/constants.d.ts.map +1 -0
  700. package/lib/esm/WABinary/constants.js +1301 -0
  701. package/lib/esm/WABinary/constants.js.map +1 -0
  702. package/lib/esm/WABinary/decode.d.ts +7 -0
  703. package/lib/esm/WABinary/decode.d.ts.map +1 -0
  704. package/lib/esm/WABinary/decode.js +262 -0
  705. package/lib/esm/WABinary/decode.js.map +1 -0
  706. package/lib/esm/WABinary/encode.d.ts +3 -0
  707. package/lib/esm/WABinary/encode.d.ts.map +1 -0
  708. package/lib/esm/WABinary/encode.js +220 -0
  709. package/lib/esm/WABinary/encode.js.map +1 -0
  710. package/lib/esm/WABinary/generic-utils.d.ts +15 -0
  711. package/lib/esm/WABinary/generic-utils.d.ts.map +1 -0
  712. package/lib/esm/WABinary/generic-utils.js +113 -0
  713. package/lib/esm/WABinary/generic-utils.js.map +1 -0
  714. package/lib/esm/WABinary/index.d.ts +6 -0
  715. package/lib/esm/WABinary/index.d.ts.map +1 -0
  716. package/lib/esm/WABinary/index.js +6 -0
  717. package/lib/esm/WABinary/index.js.map +1 -0
  718. package/lib/esm/WABinary/jid-utils.d.ts +48 -0
  719. package/lib/esm/WABinary/jid-utils.d.ts.map +1 -0
  720. package/lib/esm/WABinary/jid-utils.js +96 -0
  721. package/lib/esm/WABinary/jid-utils.js.map +1 -0
  722. package/lib/esm/WABinary/types.d.ts +19 -0
  723. package/lib/esm/WABinary/types.d.ts.map +1 -0
  724. package/lib/esm/WABinary/types.js +2 -0
  725. package/lib/esm/WABinary/types.js.map +1 -0
  726. package/lib/esm/WAM/BinaryInfo.d.ts +9 -0
  727. package/lib/esm/WAM/BinaryInfo.d.ts.map +1 -0
  728. package/lib/esm/WAM/BinaryInfo.js +10 -0
  729. package/lib/esm/WAM/BinaryInfo.js.map +1 -0
  730. package/lib/esm/WAM/constants.d.ts +40 -0
  731. package/lib/esm/WAM/constants.d.ts.map +1 -0
  732. package/lib/esm/WAM/constants.js +22853 -0
  733. package/lib/esm/WAM/constants.js.map +1 -0
  734. package/lib/esm/WAM/encode.d.ts +3 -0
  735. package/lib/esm/WAM/encode.d.ts.map +1 -0
  736. package/lib/esm/WAM/encode.js +150 -0
  737. package/lib/esm/WAM/encode.js.map +1 -0
  738. package/lib/esm/WAM/index.d.ts +4 -0
  739. package/lib/esm/WAM/index.d.ts.map +1 -0
  740. package/lib/esm/WAM/index.js +4 -0
  741. package/lib/esm/WAM/index.js.map +1 -0
  742. package/lib/esm/WAUSync/Protocols/USyncContactProtocol.d.ts +10 -0
  743. package/lib/esm/WAUSync/Protocols/USyncContactProtocol.d.ts.map +1 -0
  744. package/lib/esm/WAUSync/Protocols/USyncContactProtocol.js +29 -0
  745. package/lib/esm/WAUSync/Protocols/USyncContactProtocol.js.map +1 -0
  746. package/lib/esm/WAUSync/Protocols/USyncDeviceProtocol.d.ts +23 -0
  747. package/lib/esm/WAUSync/Protocols/USyncDeviceProtocol.d.ts.map +1 -0
  748. package/lib/esm/WAUSync/Protocols/USyncDeviceProtocol.js +54 -0
  749. package/lib/esm/WAUSync/Protocols/USyncDeviceProtocol.js.map +1 -0
  750. package/lib/esm/WAUSync/Protocols/USyncDisappearingModeProtocol.d.ts +13 -0
  751. package/lib/esm/WAUSync/Protocols/USyncDisappearingModeProtocol.d.ts.map +1 -0
  752. package/lib/esm/WAUSync/Protocols/USyncDisappearingModeProtocol.js +27 -0
  753. package/lib/esm/WAUSync/Protocols/USyncDisappearingModeProtocol.js.map +1 -0
  754. package/lib/esm/WAUSync/Protocols/USyncStatusProtocol.d.ts +13 -0
  755. package/lib/esm/WAUSync/Protocols/USyncStatusProtocol.d.ts.map +1 -0
  756. package/lib/esm/WAUSync/Protocols/USyncStatusProtocol.js +38 -0
  757. package/lib/esm/WAUSync/Protocols/USyncStatusProtocol.js.map +1 -0
  758. package/lib/esm/WAUSync/Protocols/UsyncBotProfileProtocol.d.ts +26 -0
  759. package/lib/esm/WAUSync/Protocols/UsyncBotProfileProtocol.d.ts.map +1 -0
  760. package/lib/esm/WAUSync/Protocols/UsyncBotProfileProtocol.js +51 -0
  761. package/lib/esm/WAUSync/Protocols/UsyncBotProfileProtocol.js.map +1 -0
  762. package/lib/esm/WAUSync/Protocols/UsyncLIDProtocol.d.ts +17 -0
  763. package/lib/esm/WAUSync/Protocols/UsyncLIDProtocol.d.ts.map +1 -0
  764. package/lib/esm/WAUSync/Protocols/UsyncLIDProtocol.js +29 -0
  765. package/lib/esm/WAUSync/Protocols/UsyncLIDProtocol.js.map +1 -0
  766. package/lib/esm/WAUSync/Protocols/index.d.ts +5 -0
  767. package/lib/esm/WAUSync/Protocols/index.d.ts.map +1 -0
  768. package/lib/esm/WAUSync/Protocols/index.js +5 -0
  769. package/lib/esm/WAUSync/Protocols/index.js.map +1 -0
  770. package/lib/esm/WAUSync/USyncQuery.d.ts +29 -0
  771. package/lib/esm/WAUSync/USyncQuery.d.ts.map +1 -0
  772. package/lib/esm/WAUSync/USyncQuery.js +94 -0
  773. package/lib/esm/WAUSync/USyncQuery.js.map +1 -0
  774. package/lib/esm/WAUSync/USyncUser.d.ts +13 -0
  775. package/lib/esm/WAUSync/USyncUser.d.ts.map +1 -0
  776. package/lib/esm/WAUSync/USyncUser.js +23 -0
  777. package/lib/esm/WAUSync/USyncUser.js.map +1 -0
  778. package/lib/esm/WAUSync/index.d.ts +4 -0
  779. package/lib/esm/WAUSync/index.d.ts.map +1 -0
  780. package/lib/esm/WAUSync/index.js +4 -0
  781. package/lib/esm/WAUSync/index.js.map +1 -0
  782. package/lib/esm/index.d.ts +12 -0
  783. package/lib/esm/index.d.ts.map +1 -0
  784. package/lib/esm/index.js +11 -0
  785. package/lib/esm/index.js.map +1 -0
  786. package/lib/esm/package.json +3 -0
  787. package/package.json +129 -0
@@ -0,0 +1,1006 @@
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.makeChatsSocket = void 0;
7
+ const node_cache_1 = __importDefault(require("@cacheable/node-cache"));
8
+ const boom_1 = require("@hapi/boom");
9
+ const index_js_1 = require("../../WAProto/index.js");
10
+ const Defaults_1 = require("../Defaults");
11
+ const Types_1 = require("../Types");
12
+ const State_1 = require("../Types/State");
13
+ const Utils_1 = require("../Utils");
14
+ const make_mutex_1 = require("../Utils/make-mutex");
15
+ const process_message_1 = __importDefault(require("../Utils/process-message"));
16
+ const tc_token_utils_1 = require("../Utils/tc-token-utils");
17
+ const WABinary_1 = require("../WABinary");
18
+ const WAUSync_1 = require("../WAUSync");
19
+ const socket_js_1 = require("./socket.js");
20
+ const MAX_SYNC_ATTEMPTS = 2;
21
+ const makeChatsSocket = (config) => {
22
+ const { logger, markOnlineOnConnect, fireInitQueries, appStateMacVerification, shouldIgnoreJid, shouldSyncHistoryMessage, getMessage } = config;
23
+ const sock = (0, socket_js_1.makeSocket)(config);
24
+ const { ev, ws, authState, generateMessageTag, sendNode, query, signalRepository, onUnexpectedError, sendUnifiedSession } = sock;
25
+ let privacySettings;
26
+ let syncState = State_1.SyncState.Connecting;
27
+ /** this mutex ensures that messages are processed in order */
28
+ const messageMutex = (0, make_mutex_1.makeMutex)();
29
+ /** this mutex ensures that receipts are processed in order */
30
+ const receiptMutex = (0, make_mutex_1.makeMutex)();
31
+ /** this mutex ensures that app state patches are processed in order */
32
+ const appStatePatchMutex = (0, make_mutex_1.makeMutex)();
33
+ /** this mutex ensures that notifications are processed in order */
34
+ const notificationMutex = (0, make_mutex_1.makeMutex)();
35
+ // Timeout for AwaitingInitialSync state
36
+ let awaitingSyncTimeout;
37
+ const placeholderResendCache = config.placeholderResendCache ||
38
+ new node_cache_1.default({
39
+ stdTTL: Defaults_1.DEFAULT_CACHE_TTLS.MSG_RETRY, // 1 hour
40
+ useClones: false
41
+ });
42
+ if (!config.placeholderResendCache) {
43
+ config.placeholderResendCache = placeholderResendCache;
44
+ }
45
+ /** helper function to fetch the given app state sync key */
46
+ const getAppStateSyncKey = async (keyId) => {
47
+ const { [keyId]: key } = await authState.keys.get('app-state-sync-key', [keyId]);
48
+ return key;
49
+ };
50
+ const fetchPrivacySettings = async (force = false) => {
51
+ if (!privacySettings || force) {
52
+ const { content } = await query({
53
+ tag: 'iq',
54
+ attrs: {
55
+ xmlns: 'privacy',
56
+ to: WABinary_1.S_WHATSAPP_NET,
57
+ type: 'get'
58
+ },
59
+ content: [{ tag: 'privacy', attrs: {} }]
60
+ });
61
+ privacySettings = (0, WABinary_1.reduceBinaryNodeToDictionary)(content?.[0], 'category');
62
+ }
63
+ return privacySettings;
64
+ };
65
+ /** helper function to run a privacy IQ query */
66
+ const privacyQuery = async (name, value) => {
67
+ await query({
68
+ tag: 'iq',
69
+ attrs: {
70
+ xmlns: 'privacy',
71
+ to: WABinary_1.S_WHATSAPP_NET,
72
+ type: 'set'
73
+ },
74
+ content: [
75
+ {
76
+ tag: 'privacy',
77
+ attrs: {},
78
+ content: [
79
+ {
80
+ tag: 'category',
81
+ attrs: { name, value }
82
+ }
83
+ ]
84
+ }
85
+ ]
86
+ });
87
+ };
88
+ const updateMessagesPrivacy = async (value) => {
89
+ await privacyQuery('messages', value);
90
+ };
91
+ const updateCallPrivacy = async (value) => {
92
+ await privacyQuery('calladd', value);
93
+ };
94
+ const updateLastSeenPrivacy = async (value) => {
95
+ await privacyQuery('last', value);
96
+ };
97
+ const updateOnlinePrivacy = async (value) => {
98
+ await privacyQuery('online', value);
99
+ };
100
+ const updateProfilePicturePrivacy = async (value) => {
101
+ await privacyQuery('profile', value);
102
+ };
103
+ const updateStatusPrivacy = async (value) => {
104
+ await privacyQuery('status', value);
105
+ };
106
+ const updateReadReceiptsPrivacy = async (value) => {
107
+ await privacyQuery('readreceipts', value);
108
+ };
109
+ const updateGroupsAddPrivacy = async (value) => {
110
+ await privacyQuery('groupadd', value);
111
+ };
112
+ const updateDefaultDisappearingMode = async (duration) => {
113
+ await query({
114
+ tag: 'iq',
115
+ attrs: {
116
+ xmlns: 'disappearing_mode',
117
+ to: WABinary_1.S_WHATSAPP_NET,
118
+ type: 'set'
119
+ },
120
+ content: [
121
+ {
122
+ tag: 'disappearing_mode',
123
+ attrs: {
124
+ duration: duration.toString()
125
+ }
126
+ }
127
+ ]
128
+ });
129
+ };
130
+ const getBotListV2 = async () => {
131
+ const resp = await query({
132
+ tag: 'iq',
133
+ attrs: {
134
+ xmlns: 'bot',
135
+ to: WABinary_1.S_WHATSAPP_NET,
136
+ type: 'get'
137
+ },
138
+ content: [
139
+ {
140
+ tag: 'bot',
141
+ attrs: {
142
+ v: '2'
143
+ }
144
+ }
145
+ ]
146
+ });
147
+ const botNode = (0, WABinary_1.getBinaryNodeChild)(resp, 'bot');
148
+ const botList = [];
149
+ for (const section of (0, WABinary_1.getBinaryNodeChildren)(botNode, 'section')) {
150
+ if (section.attrs.type === 'all') {
151
+ for (const bot of (0, WABinary_1.getBinaryNodeChildren)(section, 'bot')) {
152
+ botList.push({
153
+ jid: bot.attrs.jid,
154
+ personaId: bot.attrs['persona_id']
155
+ });
156
+ }
157
+ }
158
+ }
159
+ return botList;
160
+ };
161
+ const fetchStatus = async (...jids) => {
162
+ const usyncQuery = new WAUSync_1.USyncQuery().withStatusProtocol();
163
+ for (const jid of jids) {
164
+ usyncQuery.withUser(new WAUSync_1.USyncUser().withId(jid));
165
+ }
166
+ const result = await sock.executeUSyncQuery(usyncQuery);
167
+ if (result) {
168
+ return result.list;
169
+ }
170
+ };
171
+ const fetchDisappearingDuration = async (...jids) => {
172
+ const usyncQuery = new WAUSync_1.USyncQuery().withDisappearingModeProtocol();
173
+ for (const jid of jids) {
174
+ usyncQuery.withUser(new WAUSync_1.USyncUser().withId(jid));
175
+ }
176
+ const result = await sock.executeUSyncQuery(usyncQuery);
177
+ if (result) {
178
+ return result.list;
179
+ }
180
+ };
181
+ /** update the profile picture for yourself or a group */
182
+ const updateProfilePicture = async (jid, content, dimensions) => {
183
+ let targetJid;
184
+ if (!jid) {
185
+ throw new boom_1.Boom('Illegal no-jid profile update. Please specify either your ID or the ID of the chat you wish to update');
186
+ }
187
+ if ((0, WABinary_1.jidNormalizedUser)(jid) !== (0, WABinary_1.jidNormalizedUser)(authState.creds.me.id)) {
188
+ targetJid = (0, WABinary_1.jidNormalizedUser)(jid); // in case it is someone other than us
189
+ }
190
+ else {
191
+ targetJid = undefined;
192
+ }
193
+ const { img } = await (0, Utils_1.generateProfilePicture)(content, dimensions);
194
+ await query({
195
+ tag: 'iq',
196
+ attrs: {
197
+ to: WABinary_1.S_WHATSAPP_NET,
198
+ type: 'set',
199
+ xmlns: 'w:profile:picture',
200
+ ...(targetJid ? { target: targetJid } : {})
201
+ },
202
+ content: [
203
+ {
204
+ tag: 'picture',
205
+ attrs: { type: 'image' },
206
+ content: img
207
+ }
208
+ ]
209
+ });
210
+ };
211
+ /** remove the profile picture for yourself or a group */
212
+ const removeProfilePicture = async (jid) => {
213
+ let targetJid;
214
+ if (!jid) {
215
+ throw new boom_1.Boom('Illegal no-jid profile update. Please specify either your ID or the ID of the chat you wish to update');
216
+ }
217
+ if ((0, WABinary_1.jidNormalizedUser)(jid) !== (0, WABinary_1.jidNormalizedUser)(authState.creds.me.id)) {
218
+ targetJid = (0, WABinary_1.jidNormalizedUser)(jid); // in case it is someone other than us
219
+ }
220
+ else {
221
+ targetJid = undefined;
222
+ }
223
+ await query({
224
+ tag: 'iq',
225
+ attrs: {
226
+ to: WABinary_1.S_WHATSAPP_NET,
227
+ type: 'set',
228
+ xmlns: 'w:profile:picture',
229
+ ...(targetJid ? { target: targetJid } : {})
230
+ }
231
+ });
232
+ };
233
+ /** update the profile status for yourself */
234
+ const updateProfileStatus = async (status) => {
235
+ await query({
236
+ tag: 'iq',
237
+ attrs: {
238
+ to: WABinary_1.S_WHATSAPP_NET,
239
+ type: 'set',
240
+ xmlns: 'status'
241
+ },
242
+ content: [
243
+ {
244
+ tag: 'status',
245
+ attrs: {},
246
+ content: Buffer.from(status, 'utf-8')
247
+ }
248
+ ]
249
+ });
250
+ };
251
+ const updateProfileName = async (name) => {
252
+ await chatModify({ pushNameSetting: name }, '');
253
+ };
254
+ const fetchBlocklist = async () => {
255
+ const result = await query({
256
+ tag: 'iq',
257
+ attrs: {
258
+ xmlns: 'blocklist',
259
+ to: WABinary_1.S_WHATSAPP_NET,
260
+ type: 'get'
261
+ }
262
+ });
263
+ const listNode = (0, WABinary_1.getBinaryNodeChild)(result, 'list');
264
+ return (0, WABinary_1.getBinaryNodeChildren)(listNode, 'item').map(n => n.attrs.jid);
265
+ };
266
+ const updateBlockStatus = async (jid, action) => {
267
+ await query({
268
+ tag: 'iq',
269
+ attrs: {
270
+ xmlns: 'blocklist',
271
+ to: WABinary_1.S_WHATSAPP_NET,
272
+ type: 'set'
273
+ },
274
+ content: [
275
+ {
276
+ tag: 'item',
277
+ attrs: {
278
+ action,
279
+ jid
280
+ }
281
+ }
282
+ ]
283
+ });
284
+ };
285
+ const getBusinessProfile = async (jid) => {
286
+ const results = await query({
287
+ tag: 'iq',
288
+ attrs: {
289
+ to: 's.whatsapp.net',
290
+ xmlns: 'w:biz',
291
+ type: 'get'
292
+ },
293
+ content: [
294
+ {
295
+ tag: 'business_profile',
296
+ attrs: { v: '244' },
297
+ content: [
298
+ {
299
+ tag: 'profile',
300
+ attrs: { jid }
301
+ }
302
+ ]
303
+ }
304
+ ]
305
+ });
306
+ const profileNode = (0, WABinary_1.getBinaryNodeChild)(results, 'business_profile');
307
+ const profiles = (0, WABinary_1.getBinaryNodeChild)(profileNode, 'profile');
308
+ if (profiles) {
309
+ const address = (0, WABinary_1.getBinaryNodeChild)(profiles, 'address');
310
+ const description = (0, WABinary_1.getBinaryNodeChild)(profiles, 'description');
311
+ const website = (0, WABinary_1.getBinaryNodeChild)(profiles, 'website');
312
+ const email = (0, WABinary_1.getBinaryNodeChild)(profiles, 'email');
313
+ const category = (0, WABinary_1.getBinaryNodeChild)((0, WABinary_1.getBinaryNodeChild)(profiles, 'categories'), 'category');
314
+ const businessHours = (0, WABinary_1.getBinaryNodeChild)(profiles, 'business_hours');
315
+ const businessHoursConfig = businessHours
316
+ ? (0, WABinary_1.getBinaryNodeChildren)(businessHours, 'business_hours_config')
317
+ : undefined;
318
+ const websiteStr = website?.content?.toString();
319
+ return {
320
+ wid: profiles.attrs?.jid,
321
+ address: address?.content?.toString(),
322
+ description: description?.content?.toString() || '',
323
+ website: websiteStr ? [websiteStr] : [],
324
+ email: email?.content?.toString(),
325
+ category: category?.content?.toString(),
326
+ business_hours: {
327
+ timezone: businessHours?.attrs?.timezone,
328
+ business_config: businessHoursConfig?.map(({ attrs }) => attrs)
329
+ }
330
+ };
331
+ }
332
+ };
333
+ const cleanDirtyBits = async (type, fromTimestamp) => {
334
+ logger.info({ fromTimestamp }, 'clean dirty bits ' + type);
335
+ await sendNode({
336
+ tag: 'iq',
337
+ attrs: {
338
+ to: WABinary_1.S_WHATSAPP_NET,
339
+ type: 'set',
340
+ xmlns: 'urn:xmpp:whatsapp:dirty',
341
+ id: generateMessageTag()
342
+ },
343
+ content: [
344
+ {
345
+ tag: 'clean',
346
+ attrs: {
347
+ type,
348
+ ...(fromTimestamp ? { timestamp: fromTimestamp.toString() } : null)
349
+ }
350
+ }
351
+ ]
352
+ });
353
+ };
354
+ const newAppStateChunkHandler = (isInitialSync) => {
355
+ return {
356
+ onMutation(mutation) {
357
+ (0, Utils_1.processSyncAction)(mutation, ev, authState.creds.me, isInitialSync ? { accountSettings: authState.creds.accountSettings } : undefined, logger);
358
+ }
359
+ };
360
+ };
361
+ const resyncAppState = ev.createBufferedFunction(async (collections, isInitialSync) => {
362
+ const appStateSyncKeyCache = new Map();
363
+ const getCachedAppStateSyncKey = async (keyId) => {
364
+ if (appStateSyncKeyCache.has(keyId)) {
365
+ return appStateSyncKeyCache.get(keyId) ?? undefined;
366
+ }
367
+ const key = await getAppStateSyncKey(keyId);
368
+ appStateSyncKeyCache.set(keyId, key ?? null);
369
+ return key;
370
+ };
371
+ // we use this to determine which events to fire
372
+ // otherwise when we resync from scratch -- all notifications will fire
373
+ const initialVersionMap = {};
374
+ const globalMutationMap = {};
375
+ await authState.keys.transaction(async () => {
376
+ const collectionsToHandle = new Set(collections);
377
+ // in case something goes wrong -- ensure we don't enter a loop that cannot be exited from
378
+ const attemptsMap = {};
379
+ // keep executing till all collections are done
380
+ // sometimes a single patch request will not return all the patches (God knows why)
381
+ // so we fetch till they're all done (this is determined by the "has_more_patches" flag)
382
+ while (collectionsToHandle.size) {
383
+ const states = {};
384
+ const nodes = [];
385
+ for (const name of collectionsToHandle) {
386
+ const result = await authState.keys.get('app-state-sync-version', [name]);
387
+ let state = result[name];
388
+ if (state) {
389
+ if (typeof initialVersionMap[name] === 'undefined') {
390
+ initialVersionMap[name] = state.version;
391
+ }
392
+ }
393
+ else {
394
+ state = (0, Utils_1.newLTHashState)();
395
+ }
396
+ states[name] = state;
397
+ logger.info(`resyncing ${name} from v${state.version}`);
398
+ nodes.push({
399
+ tag: 'collection',
400
+ attrs: {
401
+ name,
402
+ version: state.version.toString(),
403
+ // return snapshot if being synced from scratch
404
+ return_snapshot: (!state.version).toString()
405
+ }
406
+ });
407
+ }
408
+ const result = await query({
409
+ tag: 'iq',
410
+ attrs: {
411
+ to: WABinary_1.S_WHATSAPP_NET,
412
+ xmlns: 'w:sync:app:state',
413
+ type: 'set'
414
+ },
415
+ content: [
416
+ {
417
+ tag: 'sync',
418
+ attrs: {},
419
+ content: nodes
420
+ }
421
+ ]
422
+ });
423
+ // extract from binary node
424
+ const decoded = await (0, Utils_1.extractSyncdPatches)(result, config?.options);
425
+ for (const key in decoded) {
426
+ const name = key;
427
+ const { patches, hasMorePatches, snapshot } = decoded[name];
428
+ try {
429
+ if (snapshot) {
430
+ const { state: newState, mutationMap } = await (0, Utils_1.decodeSyncdSnapshot)(name, snapshot, getCachedAppStateSyncKey, initialVersionMap[name], appStateMacVerification.snapshot);
431
+ states[name] = newState;
432
+ Object.assign(globalMutationMap, mutationMap);
433
+ logger.info(`restored state of ${name} from snapshot to v${newState.version} with mutations`);
434
+ await authState.keys.set({ 'app-state-sync-version': { [name]: newState } });
435
+ }
436
+ // only process if there are syncd patches
437
+ if (patches.length) {
438
+ const { state: newState, mutationMap } = await (0, Utils_1.decodePatches)(name, patches, states[name], getCachedAppStateSyncKey, config.options, initialVersionMap[name], logger, appStateMacVerification.patch);
439
+ await authState.keys.set({ 'app-state-sync-version': { [name]: newState } });
440
+ logger.info(`synced ${name} to v${newState.version}`);
441
+ initialVersionMap[name] = newState.version;
442
+ Object.assign(globalMutationMap, mutationMap);
443
+ }
444
+ if (hasMorePatches) {
445
+ logger.info(`${name} has more patches...`);
446
+ }
447
+ else {
448
+ // collection is done with sync
449
+ collectionsToHandle.delete(name);
450
+ }
451
+ }
452
+ catch (error) {
453
+ // if retry attempts overshoot
454
+ // or key not found
455
+ const isIrrecoverableError = attemptsMap[name] >= MAX_SYNC_ATTEMPTS ||
456
+ error.output?.statusCode === 404 ||
457
+ error.name === 'TypeError';
458
+ logger.info({ name, error: error.stack }, `failed to sync state from version${isIrrecoverableError ? '' : ', removing and trying from scratch'}`);
459
+ await authState.keys.set({ 'app-state-sync-version': { [name]: null } });
460
+ // increment number of retries
461
+ attemptsMap[name] = (attemptsMap[name] || 0) + 1;
462
+ if (isIrrecoverableError) {
463
+ // stop retrying
464
+ collectionsToHandle.delete(name);
465
+ }
466
+ }
467
+ }
468
+ }
469
+ }, authState?.creds?.me?.id || 'resync-app-state');
470
+ const { onMutation } = newAppStateChunkHandler(isInitialSync);
471
+ for (const key in globalMutationMap) {
472
+ onMutation(globalMutationMap[key]);
473
+ }
474
+ });
475
+ /**
476
+ * fetch the profile picture of a user/group
477
+ * type = "preview" for a low res picture
478
+ * type = "image for the high res picture"
479
+ */
480
+ const profilePictureUrl = async (jid, type = 'preview', timeoutMs) => {
481
+ const baseContent = [{ tag: 'picture', attrs: { type, query: 'url' } }];
482
+ const tcTokenContent = await (0, tc_token_utils_1.buildTcTokenFromJid)({ authState, jid, baseContent });
483
+ jid = (0, WABinary_1.jidNormalizedUser)(jid);
484
+ const result = await query({
485
+ tag: 'iq',
486
+ attrs: {
487
+ target: jid,
488
+ to: WABinary_1.S_WHATSAPP_NET,
489
+ type: 'get',
490
+ xmlns: 'w:profile:picture'
491
+ },
492
+ content: tcTokenContent
493
+ }, timeoutMs);
494
+ const child = (0, WABinary_1.getBinaryNodeChild)(result, 'picture');
495
+ return child?.attrs?.url;
496
+ };
497
+ const createCallLink = async (type, event, timeoutMs) => {
498
+ const result = await query({
499
+ tag: 'call',
500
+ attrs: {
501
+ id: generateMessageTag(),
502
+ to: '@call'
503
+ },
504
+ content: [
505
+ {
506
+ tag: 'link_create',
507
+ attrs: { media: type },
508
+ content: event ? [{ tag: 'event', attrs: { start_time: String(event.startTime) } }] : undefined
509
+ }
510
+ ]
511
+ }, timeoutMs);
512
+ const child = (0, WABinary_1.getBinaryNodeChild)(result, 'link_create');
513
+ return child?.attrs?.token;
514
+ };
515
+ const sendPresenceUpdate = async (type, toJid) => {
516
+ const me = authState.creds.me;
517
+ const isAvailableType = type === 'available';
518
+ if (isAvailableType || type === 'unavailable') {
519
+ if (!me.name) {
520
+ logger.warn('no name present, ignoring presence update request...');
521
+ return;
522
+ }
523
+ ev.emit('connection.update', { isOnline: isAvailableType });
524
+ if (isAvailableType) {
525
+ void sendUnifiedSession();
526
+ }
527
+ await sendNode({
528
+ tag: 'presence',
529
+ attrs: {
530
+ name: me.name.replace(/@/g, ''),
531
+ type
532
+ }
533
+ });
534
+ }
535
+ else {
536
+ // JID-first: isLid check removed — always address from phone JID
537
+ await sendNode({
538
+ tag: 'chatstate',
539
+ attrs: {
540
+ from: me.id, // JID-first: always use phone number JID
541
+ to: toJid
542
+ },
543
+ content: [
544
+ {
545
+ tag: type === 'recording' ? 'composing' : type,
546
+ attrs: type === 'recording' ? { media: 'audio' } : {}
547
+ }
548
+ ]
549
+ });
550
+ }
551
+ };
552
+ /**
553
+ * @param toJid the jid to subscribe to
554
+ * @param tcToken token for subscription, use if present
555
+ */
556
+ const presenceSubscribe = async (toJid) => {
557
+ const tcTokenContent = await (0, tc_token_utils_1.buildTcTokenFromJid)({ authState, jid: toJid });
558
+ return sendNode({
559
+ tag: 'presence',
560
+ attrs: {
561
+ to: toJid,
562
+ id: generateMessageTag(),
563
+ type: 'subscribe'
564
+ },
565
+ content: tcTokenContent
566
+ });
567
+ };
568
+ const handlePresenceUpdate = ({ tag, attrs, content }) => {
569
+ let presence;
570
+ const jid = attrs.from;
571
+ const participant = attrs.participant || attrs.from;
572
+ if (shouldIgnoreJid(jid) && jid !== WABinary_1.S_WHATSAPP_NET) {
573
+ return;
574
+ }
575
+ if (tag === 'presence') {
576
+ presence = {
577
+ lastKnownPresence: attrs.type === 'unavailable' ? 'unavailable' : 'available',
578
+ lastSeen: attrs.last && attrs.last !== 'deny' ? +attrs.last : undefined
579
+ };
580
+ }
581
+ else if (Array.isArray(content)) {
582
+ const [firstChild] = content;
583
+ let type = firstChild.tag;
584
+ if (type === 'paused') {
585
+ type = 'available';
586
+ }
587
+ if (firstChild.attrs?.media === 'audio') {
588
+ type = 'recording';
589
+ }
590
+ presence = { lastKnownPresence: type };
591
+ }
592
+ else {
593
+ logger.error({ tag, attrs, content }, 'recv invalid presence node');
594
+ }
595
+ if (presence) {
596
+ ev.emit('presence.update', { id: jid, presences: { [participant]: presence } });
597
+ }
598
+ };
599
+ const appPatch = async (patchCreate) => {
600
+ const name = patchCreate.type;
601
+ const myAppStateKeyId = authState.creds.myAppStateKeyId;
602
+ if (!myAppStateKeyId) {
603
+ throw new boom_1.Boom('App state key not present!', { statusCode: 400 });
604
+ }
605
+ let initial;
606
+ let encodeResult;
607
+ await appStatePatchMutex.mutex(async () => {
608
+ await authState.keys.transaction(async () => {
609
+ logger.debug({ patch: patchCreate }, 'applying app patch');
610
+ await resyncAppState([name], false);
611
+ const { [name]: currentSyncVersion } = await authState.keys.get('app-state-sync-version', [name]);
612
+ initial = currentSyncVersion || (0, Utils_1.newLTHashState)();
613
+ encodeResult = await (0, Utils_1.encodeSyncdPatch)(patchCreate, myAppStateKeyId, initial, getAppStateSyncKey);
614
+ const { patch, state } = encodeResult;
615
+ const node = {
616
+ tag: 'iq',
617
+ attrs: {
618
+ to: WABinary_1.S_WHATSAPP_NET,
619
+ type: 'set',
620
+ xmlns: 'w:sync:app:state'
621
+ },
622
+ content: [
623
+ {
624
+ tag: 'sync',
625
+ attrs: {},
626
+ content: [
627
+ {
628
+ tag: 'collection',
629
+ attrs: {
630
+ name,
631
+ version: (state.version - 1).toString(),
632
+ return_snapshot: 'false'
633
+ },
634
+ content: [
635
+ {
636
+ tag: 'patch',
637
+ attrs: {},
638
+ content: index_js_1.proto.SyncdPatch.encode(patch).finish()
639
+ }
640
+ ]
641
+ }
642
+ ]
643
+ }
644
+ ]
645
+ };
646
+ await query(node);
647
+ await authState.keys.set({ 'app-state-sync-version': { [name]: state } });
648
+ }, authState?.creds?.me?.id || 'app-patch');
649
+ });
650
+ if (config.emitOwnEvents) {
651
+ const { onMutation } = newAppStateChunkHandler(false);
652
+ const { mutationMap } = await (0, Utils_1.decodePatches)(name, [{ ...encodeResult.patch, version: { version: encodeResult.state.version } }], initial, getAppStateSyncKey, config.options, undefined, logger);
653
+ for (const key in mutationMap) {
654
+ onMutation(mutationMap[key]);
655
+ }
656
+ }
657
+ };
658
+ /** sending non-abt props may fix QR scan fail if server expects */
659
+ const fetchProps = async () => {
660
+ //TODO: implement both protocol 1 and protocol 2 prop fetching, specially for abKey for WM
661
+ const resultNode = await query({
662
+ tag: 'iq',
663
+ attrs: {
664
+ to: WABinary_1.S_WHATSAPP_NET,
665
+ xmlns: 'w',
666
+ type: 'get'
667
+ },
668
+ content: [
669
+ {
670
+ tag: 'props',
671
+ attrs: {
672
+ protocol: '2',
673
+ hash: authState?.creds?.lastPropHash || ''
674
+ }
675
+ }
676
+ ]
677
+ });
678
+ const propsNode = (0, WABinary_1.getBinaryNodeChild)(resultNode, 'props');
679
+ let props = {};
680
+ if (propsNode) {
681
+ if (propsNode.attrs?.hash) {
682
+ // on some clients, the hash is returning as undefined
683
+ authState.creds.lastPropHash = propsNode?.attrs?.hash;
684
+ ev.emit('creds.update', authState.creds);
685
+ }
686
+ props = (0, WABinary_1.reduceBinaryNodeToDictionary)(propsNode, 'prop');
687
+ }
688
+ logger.debug('fetched props');
689
+ return props;
690
+ };
691
+ /**
692
+ * modify a chat -- mark unread, read etc.
693
+ * lastMessages must be sorted in reverse chronologically
694
+ * requires the last messages till the last message received; required for archive & unread
695
+ */
696
+ const chatModify = (mod, jid) => {
697
+ const patch = (0, Utils_1.chatModificationToAppPatch)(mod, jid);
698
+ return appPatch(patch);
699
+ };
700
+ /**
701
+ * Enable/Disable link preview privacy, not related to baileys link preview generation
702
+ */
703
+ const updateDisableLinkPreviewsPrivacy = (isPreviewsDisabled) => {
704
+ return chatModify({
705
+ disableLinkPreviews: { isPreviewsDisabled }
706
+ }, '');
707
+ };
708
+ /**
709
+ * Star or Unstar a message
710
+ */
711
+ const star = (jid, messages, star) => {
712
+ return chatModify({
713
+ star: {
714
+ messages,
715
+ star
716
+ }
717
+ }, jid);
718
+ };
719
+ /**
720
+ * Add or Edit Contact
721
+ */
722
+ const addOrEditContact = (jid, contact) => {
723
+ return chatModify({
724
+ contact
725
+ }, jid);
726
+ };
727
+ /**
728
+ * Remove Contact
729
+ */
730
+ const removeContact = (jid) => {
731
+ return chatModify({
732
+ contact: null
733
+ }, jid);
734
+ };
735
+ /**
736
+ * Adds label
737
+ */
738
+ const addLabel = (jid, labels) => {
739
+ return chatModify({
740
+ addLabel: {
741
+ ...labels
742
+ }
743
+ }, jid);
744
+ };
745
+ /**
746
+ * Adds label for the chats
747
+ */
748
+ const addChatLabel = (jid, labelId) => {
749
+ return chatModify({
750
+ addChatLabel: {
751
+ labelId
752
+ }
753
+ }, jid);
754
+ };
755
+ /**
756
+ * Removes label for the chat
757
+ */
758
+ const removeChatLabel = (jid, labelId) => {
759
+ return chatModify({
760
+ removeChatLabel: {
761
+ labelId
762
+ }
763
+ }, jid);
764
+ };
765
+ /**
766
+ * Adds label for the message
767
+ */
768
+ const addMessageLabel = (jid, messageId, labelId) => {
769
+ return chatModify({
770
+ addMessageLabel: {
771
+ messageId,
772
+ labelId
773
+ }
774
+ }, jid);
775
+ };
776
+ /**
777
+ * Removes label for the message
778
+ */
779
+ const removeMessageLabel = (jid, messageId, labelId) => {
780
+ return chatModify({
781
+ removeMessageLabel: {
782
+ messageId,
783
+ labelId
784
+ }
785
+ }, jid);
786
+ };
787
+ /**
788
+ * Add or Edit Quick Reply
789
+ */
790
+ const addOrEditQuickReply = (quickReply) => {
791
+ return chatModify({
792
+ quickReply
793
+ }, '');
794
+ };
795
+ /**
796
+ * Remove Quick Reply
797
+ */
798
+ const removeQuickReply = (timestamp) => {
799
+ return chatModify({
800
+ quickReply: { timestamp, deleted: true }
801
+ }, '');
802
+ };
803
+ /**
804
+ * queries need to be fired on connection open
805
+ * help ensure parity with WA Web
806
+ * */
807
+ const executeInitQueries = async () => {
808
+ await Promise.all([fetchProps(), fetchBlocklist(), fetchPrivacySettings()]);
809
+ };
810
+ const upsertMessage = ev.createBufferedFunction(async (msg, type) => {
811
+ ev.emit('messages.upsert', { messages: [msg], type });
812
+ if (!!msg.pushName) {
813
+ let jid = msg.key.fromMe ? authState.creds.me.id : msg.key.participant || msg.key.remoteJid;
814
+ jid = (0, WABinary_1.jidNormalizedUser)(jid);
815
+ if (!msg.key.fromMe) {
816
+ ev.emit('contacts.update', [{ id: jid, notify: msg.pushName, verifiedName: msg.verifiedBizName }]);
817
+ }
818
+ // update our pushname too
819
+ if (msg.key.fromMe && msg.pushName && authState.creds.me?.name !== msg.pushName) {
820
+ ev.emit('creds.update', { me: { ...authState.creds.me, name: msg.pushName } });
821
+ }
822
+ }
823
+ const historyMsg = (0, Utils_1.getHistoryMsg)(msg.message);
824
+ const shouldProcessHistoryMsg = historyMsg
825
+ ? shouldSyncHistoryMessage(historyMsg) &&
826
+ Defaults_1.PROCESSABLE_HISTORY_TYPES.includes(historyMsg.syncType)
827
+ : false;
828
+ // State machine: decide on sync and flush
829
+ if (historyMsg && syncState === State_1.SyncState.AwaitingInitialSync) {
830
+ if (awaitingSyncTimeout) {
831
+ clearTimeout(awaitingSyncTimeout);
832
+ awaitingSyncTimeout = undefined;
833
+ }
834
+ if (shouldProcessHistoryMsg) {
835
+ syncState = State_1.SyncState.Syncing;
836
+ logger.info('Transitioned to Syncing state');
837
+ // Let doAppStateSync handle the final flush after it's done
838
+ }
839
+ else {
840
+ syncState = State_1.SyncState.Online;
841
+ logger.info('History sync skipped, transitioning to Online state and flushing buffer');
842
+ ev.flush();
843
+ }
844
+ }
845
+ const doAppStateSync = async () => {
846
+ if (syncState === State_1.SyncState.Syncing) {
847
+ logger.info('Doing app state sync');
848
+ await resyncAppState(Types_1.ALL_WA_PATCH_NAMES, true);
849
+ // Sync is complete, go online and flush everything
850
+ syncState = State_1.SyncState.Online;
851
+ logger.info('App state sync complete, transitioning to Online state and flushing buffer');
852
+ ev.flush();
853
+ const accountSyncCounter = (authState.creds.accountSyncCounter || 0) + 1;
854
+ ev.emit('creds.update', { accountSyncCounter });
855
+ }
856
+ };
857
+ await Promise.all([
858
+ (async () => {
859
+ if (shouldProcessHistoryMsg) {
860
+ await doAppStateSync();
861
+ }
862
+ })(),
863
+ (0, process_message_1.default)(msg, {
864
+ signalRepository,
865
+ shouldProcessHistoryMsg,
866
+ placeholderResendCache,
867
+ ev,
868
+ creds: authState.creds,
869
+ keyStore: authState.keys,
870
+ logger,
871
+ options: config.options,
872
+ getMessage
873
+ })
874
+ ]);
875
+ // If the app state key arrives and we are waiting to sync, trigger the sync now.
876
+ if (msg.message?.protocolMessage?.appStateSyncKeyShare && syncState === State_1.SyncState.Syncing) {
877
+ logger.info('App state sync key arrived, triggering app state sync');
878
+ await doAppStateSync();
879
+ }
880
+ });
881
+ ws.on('CB:presence', handlePresenceUpdate);
882
+ ws.on('CB:chatstate', handlePresenceUpdate);
883
+ ws.on('CB:ib,,dirty', async (node) => {
884
+ const { attrs } = (0, WABinary_1.getBinaryNodeChild)(node, 'dirty');
885
+ const type = attrs.type;
886
+ switch (type) {
887
+ case 'account_sync':
888
+ if (attrs.timestamp) {
889
+ let { lastAccountSyncTimestamp } = authState.creds;
890
+ if (lastAccountSyncTimestamp) {
891
+ await cleanDirtyBits('account_sync', lastAccountSyncTimestamp);
892
+ }
893
+ lastAccountSyncTimestamp = +attrs.timestamp;
894
+ ev.emit('creds.update', { lastAccountSyncTimestamp });
895
+ }
896
+ break;
897
+ case 'groups':
898
+ // handled in groups.ts
899
+ break;
900
+ default:
901
+ logger.info({ node }, 'received unknown sync');
902
+ break;
903
+ }
904
+ });
905
+ ev.on('connection.update', ({ connection, receivedPendingNotifications }) => {
906
+ if (connection === 'open') {
907
+ if (fireInitQueries) {
908
+ executeInitQueries().catch(error => onUnexpectedError(error, 'init queries'));
909
+ }
910
+ sendPresenceUpdate(markOnlineOnConnect ? 'available' : 'unavailable').catch(error => onUnexpectedError(error, 'presence update requests'));
911
+ }
912
+ if (!receivedPendingNotifications || syncState !== State_1.SyncState.Connecting) {
913
+ return;
914
+ }
915
+ syncState = State_1.SyncState.AwaitingInitialSync;
916
+ logger.info('Connection is now AwaitingInitialSync, buffering events');
917
+ ev.buffer();
918
+ const willSyncHistory = shouldSyncHistoryMessage(index_js_1.proto.Message.HistorySyncNotification.create({
919
+ syncType: index_js_1.proto.HistorySync.HistorySyncType.RECENT
920
+ }));
921
+ if (!willSyncHistory) {
922
+ logger.info('History sync is disabled by config, not waiting for notification. Transitioning to Online.');
923
+ syncState = State_1.SyncState.Online;
924
+ setTimeout(() => ev.flush(), 0);
925
+ return;
926
+ }
927
+ logger.info('History sync is enabled, awaiting notification with a 20s timeout.');
928
+ if (awaitingSyncTimeout) {
929
+ clearTimeout(awaitingSyncTimeout);
930
+ }
931
+ awaitingSyncTimeout = setTimeout(() => {
932
+ if (syncState === State_1.SyncState.AwaitingInitialSync) {
933
+ // TODO: investigate
934
+ logger.warn('Timeout in AwaitingInitialSync, forcing state to Online and flushing buffer');
935
+ syncState = State_1.SyncState.Online;
936
+ ev.flush();
937
+ }
938
+ }, 20000);
939
+ });
940
+ ev.on('lid-mapping.update', async ({ jid: lid, pn }) => {
941
+ try {
942
+ // JID-first: store LID→JID mapping for resolution
943
+ await signalRepository.jidMapping.storeLIDPNMappings([{ lid, pn }]);
944
+ }
945
+ catch (error) {
946
+ logger.warn({ lid, pn, error }, 'Failed to store LID→JID mapping');
947
+ }
948
+ });
949
+ ev.on('jid-mapping.update', async ({ jid, pn }) => {
950
+ try {
951
+ await signalRepository.jidMapping.storeJIDPNMappings([{ jid, pn }]);
952
+ }
953
+ catch (error) {
954
+ logger.warn({ jid, pn, error }, 'Failed to store JID-PN mapping');
955
+ }
956
+ });
957
+ return {
958
+ ...sock,
959
+ createCallLink,
960
+ getBotListV2,
961
+ messageMutex,
962
+ receiptMutex,
963
+ appStatePatchMutex,
964
+ notificationMutex,
965
+ fetchPrivacySettings,
966
+ upsertMessage,
967
+ appPatch,
968
+ sendPresenceUpdate,
969
+ presenceSubscribe,
970
+ profilePictureUrl,
971
+ fetchBlocklist,
972
+ fetchStatus,
973
+ fetchDisappearingDuration,
974
+ updateProfilePicture,
975
+ removeProfilePicture,
976
+ updateProfileStatus,
977
+ updateProfileName,
978
+ updateBlockStatus,
979
+ updateDisableLinkPreviewsPrivacy,
980
+ updateCallPrivacy,
981
+ updateMessagesPrivacy,
982
+ updateLastSeenPrivacy,
983
+ updateOnlinePrivacy,
984
+ updateProfilePicturePrivacy,
985
+ updateStatusPrivacy,
986
+ updateReadReceiptsPrivacy,
987
+ updateGroupsAddPrivacy,
988
+ updateDefaultDisappearingMode,
989
+ getBusinessProfile,
990
+ resyncAppState,
991
+ chatModify,
992
+ cleanDirtyBits,
993
+ addOrEditContact,
994
+ removeContact,
995
+ addLabel,
996
+ addChatLabel,
997
+ removeChatLabel,
998
+ addMessageLabel,
999
+ removeMessageLabel,
1000
+ star,
1001
+ addOrEditQuickReply,
1002
+ removeQuickReply
1003
+ };
1004
+ };
1005
+ exports.makeChatsSocket = makeChatsSocket;
1006
+ //# sourceMappingURL=chats.js.map