@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,245 +1,189 @@
1
- import NodeCache from '@cacheable/node-cache';
2
- import { AsyncLocalStorage } from 'async_hooks';
3
- import { Mutex } from 'async-mutex';
4
- import { randomBytes } from 'crypto';
5
- import PQueue from 'p-queue';
6
- import { DEFAULT_CACHE_TTLS } from '../Defaults/index.js';
7
- import { Curve, signedKeyPair } from './crypto.js';
8
- import { delay, generateRegistrationId } from './generics.js';
9
- import { PreKeyManager } from './pre-key-manager.js';
1
+ "use strict"
2
+
3
+ var __importDefault = (this && this.__importDefault) || function (mod) {
4
+ return (mod && mod.__esModule) ? mod : { "default": mod }
5
+ }
6
+
7
+ Object.defineProperty(exports, "__esModule", { value: true })
8
+
9
+ const crypto_1 = require("crypto")
10
+ const node_cache_1 = __importDefault(require("@cacheable/node-cache"))
11
+ const Defaults_1 = require("../Defaults")
12
+ const crypto_2 = require("./crypto")
13
+ const generics_1 = require("./generics")
14
+
10
15
  /**
11
16
  * Adds caching capability to a SignalKeyStore
12
17
  * @param store the store to add caching to
13
18
  * @param logger to log trace events
14
19
  * @param _cache cache store to use
15
20
  */
16
- export function makeCacheableSignalKeyStore(store, logger, _cache) {
17
- const cache = _cache ||
18
- new NodeCache({
19
- stdTTL: DEFAULT_CACHE_TTLS.SIGNAL_STORE, // 5 minutes
20
- useClones: false,
21
- deleteOnExpire: true
22
- });
23
- // Mutex for protecting cache operations
24
- const cacheMutex = new Mutex();
21
+ function makeCacheableSignalKeyStore(store, logger, _cache) {
22
+ const cache = _cache || new node_cache_1.default({
23
+ stdTTL: Defaults_1.DEFAULT_CACHE_TTLS.SIGNAL_STORE,
24
+ useClones: false,
25
+ deleteOnExpire: true,
26
+ })
25
27
  function getUniqueId(type, id) {
26
- return `${type}.${id}`;
28
+ return `${type}.${id}`
27
29
  }
28
30
  return {
29
31
  async get(type, ids) {
30
- return cacheMutex.runExclusive(async () => {
31
- const data = {};
32
- const idsToFetch = [];
33
- for (const id of ids) {
34
- const item = (await cache.get(getUniqueId(type, id)));
35
- if (typeof item !== 'undefined') {
36
- data[id] = item;
37
- }
38
- else {
39
- idsToFetch.push(id);
40
- }
32
+ const data = {}
33
+ const idsToFetch = []
34
+ for (const id of ids) {
35
+ const item = cache.get(getUniqueId(type, id))
36
+ if (typeof item !== 'undefined') {
37
+ data[id] = item
41
38
  }
42
- if (idsToFetch.length) {
43
- logger?.trace({ items: idsToFetch.length }, 'loading from store');
44
- const fetched = await store.get(type, idsToFetch);
45
- for (const id of idsToFetch) {
46
- const item = fetched[id];
47
- if (item) {
48
- data[id] = item;
49
- cache.set(getUniqueId(type, id), item);
50
- }
39
+ else {
40
+ idsToFetch.push(id)
41
+ }
42
+ }
43
+ if (idsToFetch.length) {
44
+ logger?.trace({ items: idsToFetch.length }, 'loading from store')
45
+ const fetched = await store.get(type, idsToFetch)
46
+ for (const id of idsToFetch) {
47
+ const item = fetched[id]
48
+ if (item) {
49
+ data[id] = item
50
+ cache.set(getUniqueId(type, id), item)
51
51
  }
52
52
  }
53
- return data;
54
- });
53
+ }
54
+ return data
55
55
  },
56
56
  async set(data) {
57
- return cacheMutex.runExclusive(async () => {
58
- let keys = 0;
59
- for (const type in data) {
60
- for (const id in data[type]) {
61
- await cache.set(getUniqueId(type, id), data[type][id]);
62
- keys += 1;
63
- }
57
+ let keys = 0
58
+ for (const type in data) {
59
+ for (const id in data[type]) {
60
+ cache.set(getUniqueId(type, id), data[type][id])
61
+ keys += 1
64
62
  }
65
- logger?.trace({ keys }, 'updated cache');
66
- await store.set(data);
67
- });
63
+ }
64
+ logger?.trace({ keys }, 'updated cache')
65
+ await store.set(data)
68
66
  },
69
67
  async clear() {
70
- await cache.flushAll();
71
- await store.clear?.();
68
+ cache.flushAll()
69
+ await store.clear?.call(store)
72
70
  }
73
- };
71
+ }
74
72
  }
73
+
75
74
  /**
76
- * Adds DB-like transaction capability to the SignalKeyStore
77
- * Uses AsyncLocalStorage for automatic context management
75
+ * Adds DB like transaction capability (https://en.wikipedia.org/wiki/Database_transaction) to the SignalKeyStore,
76
+ * this allows batch read & write operations & improves the performance of the lib
78
77
  * @param state the key store to apply this capability to
79
78
  * @param logger logger to log events
80
79
  * @returns SignalKeyStore with transaction capability
81
80
  */
82
- export const addTransactionCapability = (state, logger, { maxCommitRetries, delayBetweenTriesMs }) => {
83
- const txStorage = new AsyncLocalStorage();
84
- // Queues for concurrency control
85
- const keyQueues = new Map();
86
- const txMutexes = new Map();
87
- // Pre-key manager for specialized operations
88
- const preKeyManager = new PreKeyManager(state, logger);
89
- /**
90
- * Get or create a queue for a specific key type
91
- */
92
- function getQueue(key) {
93
- if (!keyQueues.has(key)) {
94
- keyQueues.set(key, new PQueue({ concurrency: 1 }));
95
- }
96
- return keyQueues.get(key);
97
- }
98
- /**
99
- * Get or create a transaction mutex
100
- */
101
- function getTxMutex(key) {
102
- if (!txMutexes.has(key)) {
103
- txMutexes.set(key, new Mutex());
104
- }
105
- return txMutexes.get(key);
106
- }
107
- /**
108
- * Check if currently in a transaction
109
- */
110
- function isInTransaction() {
111
- return !!txStorage.getStore();
112
- }
113
- /**
114
- * Commit transaction with retries
115
- */
116
- async function commitWithRetry(mutations) {
117
- if (Object.keys(mutations).length === 0) {
118
- logger.trace('no mutations in transaction');
119
- return;
120
- }
121
- logger.trace('committing transaction');
122
- for (let attempt = 0; attempt < maxCommitRetries; attempt++) {
123
- try {
124
- await state.set(mutations);
125
- logger.trace({ mutationCount: Object.keys(mutations).length }, 'committed transaction');
126
- return;
127
- }
128
- catch (error) {
129
- const retriesLeft = maxCommitRetries - attempt - 1;
130
- logger.warn(`failed to commit mutations, retries left=${retriesLeft}`);
131
- if (retriesLeft === 0) {
132
- throw error;
133
- }
134
- await delay(delayBetweenTriesMs);
135
- }
136
- }
137
- }
81
+ const addTransactionCapability = (state, logger, { maxCommitRetries, delayBetweenTriesMs }) => {
82
+ // number of queries made to the DB during the transaction
83
+ // only there for logging purposes
84
+ let dbQueriesInTransaction = 0
85
+ let transactionCache = {}
86
+ let mutations = {}
87
+ let transactionsInProgress = 0
138
88
  return {
139
89
  get: async (type, ids) => {
140
- const ctx = txStorage.getStore();
141
- if (!ctx) {
142
- // No transaction - direct read without exclusive lock for concurrency
143
- return state.get(type, ids);
144
- }
145
- // In transaction - check cache first
146
- const cached = ctx.cache[type] || {};
147
- const missing = ids.filter(id => !(id in cached));
148
- if (missing.length > 0) {
149
- ctx.dbQueries++;
150
- logger.trace({ type, count: missing.length }, 'fetching missing keys in transaction');
151
- const fetched = await getTxMutex(type).runExclusive(() => state.get(type, missing));
152
- // Update cache
153
- ctx.cache[type] = ctx.cache[type] || {};
154
- Object.assign(ctx.cache[type], fetched);
155
- }
156
- // Return requested ids from cache
157
- const result = {};
158
- for (const id of ids) {
159
- const value = ctx.cache[type]?.[id];
160
- if (value !== undefined && value !== null) {
161
- result[id] = value;
90
+ if (isInTransaction()) {
91
+ const dict = transactionCache[type]
92
+ const idsRequiringFetch = dict
93
+ ? ids.filter(item => typeof dict[item] === 'undefined')
94
+ : ids
95
+ // only fetch if there are any items to fetch
96
+ if (idsRequiringFetch.length) {
97
+ dbQueriesInTransaction += 1
98
+ const result = await state.get(type, idsRequiringFetch)
99
+ transactionCache[type] || (transactionCache[type] = {})
100
+ Object.assign(transactionCache[type], result)
162
101
  }
102
+ return ids.reduce((dict, id) => {
103
+ const value = transactionCache[type]?.[id]
104
+ if (value) {
105
+ dict[id] = value
106
+ }
107
+ return dict
108
+ }, {})
109
+ }
110
+ else {
111
+ return state.get(type, ids)
163
112
  }
164
- return result;
165
113
  },
166
- set: async (data) => {
167
- const ctx = txStorage.getStore();
168
- if (!ctx) {
169
- // No transaction - direct write with queue protection
170
- const types = Object.keys(data);
171
- // Process pre-keys with validation
172
- for (const type_ of types) {
173
- const type = type_;
174
- if (type === 'pre-key') {
175
- await preKeyManager.validateDeletions(data, type);
176
- }
114
+ set: data => {
115
+ if (isInTransaction()) {
116
+ logger.trace({ types: Object.keys(data) }, 'caching in transaction')
117
+ for (const key in data) {
118
+ transactionCache[key] = transactionCache[key] || {}
119
+ Object.assign(transactionCache[key], data[key])
120
+ mutations[key] = mutations[key] || {}
121
+ Object.assign(mutations[key], data[key])
177
122
  }
178
- // Write all data in parallel
179
- await Promise.all(types.map(type => getQueue(type).add(async () => {
180
- const typeData = { [type]: data[type] };
181
- await state.set(typeData);
182
- })));
183
- return;
184
123
  }
185
- // In transaction - update cache and mutations
186
- logger.trace({ types: Object.keys(data) }, 'caching in transaction');
187
- for (const key_ in data) {
188
- const key = key_;
189
- // Ensure structures exist
190
- ctx.cache[key] = ctx.cache[key] || {};
191
- ctx.mutations[key] = ctx.mutations[key] || {};
192
- // Special handling for pre-keys
193
- if (key === 'pre-key') {
194
- await preKeyManager.processOperations(data, key, ctx.cache, ctx.mutations, true);
195
- }
196
- else {
197
- // Normal key types
198
- Object.assign(ctx.cache[key], data[key]);
199
- Object.assign(ctx.mutations[key], data[key]);
200
- }
124
+ else {
125
+ return state.set(data)
201
126
  }
202
127
  },
203
128
  isInTransaction,
204
- transaction: async (work, key) => {
205
- const existing = txStorage.getStore();
206
- // Nested transaction - reuse existing context
207
- if (existing) {
208
- logger.trace('reusing existing transaction context');
209
- return work();
129
+ async transaction(work) {
130
+ let result
131
+ transactionsInProgress += 1
132
+ if (transactionsInProgress === 1) {
133
+ logger.trace('entering transaction')
210
134
  }
211
- // New transaction - acquire mutex and create context
212
- return getTxMutex(key).runExclusive(async () => {
213
- const ctx = {
214
- cache: {},
215
- mutations: {},
216
- dbQueries: 0
217
- };
218
- logger.trace('entering transaction');
219
- try {
220
- const result = await txStorage.run(ctx, work);
221
- // Commit mutations
222
- await commitWithRetry(ctx.mutations);
223
- logger.trace({ dbQueries: ctx.dbQueries }, 'transaction completed');
224
- return result;
135
+ try {
136
+ result = await work()
137
+ // commit if this is the outermost transaction
138
+ if (transactionsInProgress === 1) {
139
+ if (Object.keys(mutations).length) {
140
+ logger.trace('committing transaction')
141
+ // retry mechanism to ensure we've some recovery
142
+ // in case a transaction fails in the first attempt
143
+ let tries = maxCommitRetries
144
+ while (tries) {
145
+ tries -= 1
146
+ try {
147
+ await state.set(mutations)
148
+ logger.trace({ dbQueriesInTransaction }, 'committed transaction')
149
+ break
150
+ }
151
+ catch (error) {
152
+ logger.warn(`failed to commit ${Object.keys(mutations).length} mutations, tries left=${tries}`)
153
+ await generics_1.delay(delayBetweenTriesMs)
154
+ }
155
+ }
156
+ }
157
+ else {
158
+ logger.trace('no mutations in transaction')
159
+ }
225
160
  }
226
- catch (error) {
227
- logger.error({ error }, 'transaction failed, rolling back');
228
- throw error;
161
+ }
162
+ finally {
163
+ transactionsInProgress -= 1
164
+ if (transactionsInProgress === 0) {
165
+ transactionCache = {}
166
+ mutations = {}
167
+ dbQueriesInTransaction = 0
229
168
  }
230
- });
169
+ }
170
+ return result
231
171
  }
232
- };
233
- };
234
- export const initAuthCreds = () => {
235
- const identityKey = Curve.generateKeyPair();
172
+ }
173
+ function isInTransaction() {
174
+ return transactionsInProgress > 0
175
+ }
176
+ }
177
+
178
+ const initAuthCreds = () => {
179
+ const identityKey = crypto_2.Curve.generateKeyPair()
236
180
  return {
237
- noiseKey: Curve.generateKeyPair(),
238
- pairingEphemeralKeyPair: Curve.generateKeyPair(),
181
+ noiseKey: crypto_2.Curve.generateKeyPair(),
182
+ pairingEphemeralKeyPair: crypto_2.Curve.generateKeyPair(),
239
183
  signedIdentityKey: identityKey,
240
- signedPreKey: signedKeyPair(identityKey, 1),
241
- registrationId: generateRegistrationId(),
242
- advSecretKey: randomBytes(32).toString('base64'),
184
+ signedPreKey: crypto_2.signedKeyPair(identityKey, 1),
185
+ registrationId: generics_1.generateRegistrationId(),
186
+ advSecretKey: crypto_1.randomBytes(32).toString('base64'),
243
187
  processedHistoryMessages: [],
244
188
  nextPreKeyId: 1,
245
189
  firstUnuploadedPreKeyId: 1,
@@ -250,8 +194,12 @@ export const initAuthCreds = () => {
250
194
  registered: false,
251
195
  pairingCode: undefined,
252
196
  lastPropHash: undefined,
253
- routingInfo: undefined,
254
- additionalData: undefined
255
- };
256
- };
257
- //# sourceMappingURL=auth-utils.js.map
197
+ routingInfo: undefined
198
+ }
199
+ }
200
+
201
+ module.exports = {
202
+ makeCacheableSignalKeyStore,
203
+ addTransactionCapability,
204
+ initAuthCreds
205
+ }
@@ -1,17 +1,18 @@
1
- import type { BaileysEventEmitter } from '../Types/index.js';
1
+ import type { BaileysEventEmitter } from '../Types'
2
+
2
3
  /**
3
4
  * Captures events from a baileys event emitter & stores them in a file
4
5
  * @param ev The event emitter to read events from
5
6
  * @param filename File to save to
6
7
  */
7
- export declare const captureEventStream: (ev: BaileysEventEmitter, filename: string) => void;
8
+ export declare const captureEventStream: (ev: BaileysEventEmitter, filename: string) => void
9
+
8
10
  /**
9
11
  * Read event file and emit events from there
10
12
  * @param filename filename containing event data
11
13
  * @param delayIntervalMs delay between each event emit
12
14
  */
13
15
  export declare const readAndEmitEventStream: (filename: string, delayIntervalMs?: number) => {
14
- ev: BaileysEventEmitter;
15
- task: Promise<void>;
16
- };
17
- //# sourceMappingURL=baileys-event-stream.d.ts.map
16
+ ev: BaileysEventEmitter
17
+ task: Promise<void>
18
+ }
@@ -1,56 +1,70 @@
1
- import EventEmitter from 'events';
2
- import { createReadStream } from 'fs';
3
- import { writeFile } from 'fs/promises';
4
- import { createInterface } from 'readline';
5
- import { delay } from './generics.js';
6
- import { makeMutex } from './make-mutex.js';
1
+ "use strict"
2
+
3
+ var __importDefault = (this && this.__importDefault) || function (mod) {
4
+ return (mod && mod.__esModule) ? mod : { "default": mod }
5
+ }
6
+
7
+ Object.defineProperty(exports, "__esModule", { value: true })
8
+
9
+ const events_1 = __importDefault(require("events"))
10
+ const fs_1 = require("fs")
11
+ const promises_1 = require("fs/promises")
12
+ const readline_1 = require("readline")
13
+ const generics_1 = require("./generics")
14
+ const make_mutex_1 = require("./make-mutex")
15
+
7
16
  /**
8
17
  * Captures events from a baileys event emitter & stores them in a file
9
18
  * @param ev The event emitter to read events from
10
19
  * @param filename File to save to
11
20
  */
12
- export const captureEventStream = (ev, filename) => {
13
- const oldEmit = ev.emit;
21
+ const captureEventStream = (ev, filename) => {
22
+ const oldEmit = ev.emit
14
23
  // write mutex so data is appended in order
15
- const writeMutex = makeMutex();
24
+ const writeMutex = make_mutex_1.makeMutex()
16
25
  // monkey patch eventemitter to capture all events
17
26
  ev.emit = function (...args) {
18
- const content = JSON.stringify({ timestamp: Date.now(), event: args[0], data: args[1] }) + '\n';
19
- const result = oldEmit.apply(ev, args);
27
+ const content = JSON.stringify({ timestamp: Date.now(), event: args[0], data: args[1] }) + '\n'
28
+ const result = oldEmit.apply(ev, args)
20
29
  writeMutex.mutex(async () => {
21
- await writeFile(filename, content, { flag: 'a' });
22
- });
23
- return result;
24
- };
25
- };
30
+ await promises_1.writeFile(filename, content, { flag: 'a' })
31
+ })
32
+ return result
33
+ }
34
+ }
35
+
26
36
  /**
27
37
  * Read event file and emit events from there
28
38
  * @param filename filename containing event data
29
39
  * @param delayIntervalMs delay between each event emit
30
40
  */
31
- export const readAndEmitEventStream = (filename, delayIntervalMs = 0) => {
32
- const ev = new EventEmitter();
41
+ const readAndEmitEventStream = (filename, delayIntervalMs = 0) => {
42
+ const ev = new events_1.default()
33
43
  const fireEvents = async () => {
34
44
  // from: https://stackoverflow.com/questions/6156501/read-a-file-one-line-at-a-time-in-node-js
35
- const fileStream = createReadStream(filename);
36
- const rl = createInterface({
45
+ const fileStream = fs_1.createReadStream(filename)
46
+ const rl = readline_1.createInterface({
37
47
  input: fileStream,
38
48
  crlfDelay: Infinity
39
- });
49
+ })
40
50
  // Note: we use the crlfDelay option to recognize all instances of CR LF
41
51
  // ('\r\n') in input.txt as a single line break.
42
52
  for await (const line of rl) {
43
53
  if (line) {
44
- const { event, data } = JSON.parse(line);
45
- ev.emit(event, data);
46
- delayIntervalMs && (await delay(delayIntervalMs));
54
+ const { event, data } = JSON.parse(line)
55
+ ev.emit(event, data)
56
+ delayIntervalMs && await generics_1.delay(delayIntervalMs)
47
57
  }
48
58
  }
49
- fileStream.close();
50
- };
59
+ fileStream.close()
60
+ }
51
61
  return {
52
62
  ev,
53
63
  task: fireEvents()
54
- };
55
- };
56
- //# sourceMappingURL=baileys-event-stream.js.map
64
+ }
65
+ }
66
+
67
+ module.exports = {
68
+ captureEventStream,
69
+ readAndEmitEventStream
70
+ }
@@ -1,23 +1,29 @@
1
- import type { CatalogCollection, OrderDetails, Product, ProductCreate, ProductUpdate, WAMediaUpload, WAMediaUploadFunction } from '../Types/index.js';
2
- import { type BinaryNode } from '../WABinary/index.js';
1
+ import { CatalogCollection, OrderDetails, Product, ProductCreate, ProductUpdate, WAMediaUpload, WAMediaUploadFunction } from '../Types'
2
+ import { BinaryNode } from '../WABinary'
3
+
3
4
  export declare const parseCatalogNode: (node: BinaryNode) => {
4
- products: Product[];
5
- nextPageCursor: string | undefined;
6
- };
5
+ products: Product[]
6
+ nextPageCursor: string | undefined
7
+ }
8
+
7
9
  export declare const parseCollectionsNode: (node: BinaryNode) => {
8
- collections: CatalogCollection[];
9
- };
10
- export declare const parseOrderDetailsNode: (node: BinaryNode) => OrderDetails;
11
- export declare const toProductNode: (productId: string | undefined, product: ProductCreate | ProductUpdate) => BinaryNode;
12
- export declare const parseProductNode: (productNode: BinaryNode) => Product;
10
+ collections: CatalogCollection[]
11
+ }
12
+
13
+ export declare const parseOrderDetailsNode: (node: BinaryNode) => OrderDetails
14
+
15
+ export declare const toProductNode: (productId: string | undefined, product: ProductCreate | ProductUpdate) => BinaryNode
16
+
17
+ export declare const parseProductNode: (productNode: BinaryNode) => Product
18
+
13
19
  /**
14
20
  * Uploads images not already uploaded to WA's servers
15
21
  */
16
- export declare function uploadingNecessaryImagesOfProduct<T extends ProductUpdate | ProductCreate>(product: T, waUploadToServer: WAMediaUploadFunction, timeoutMs?: number): Promise<T>;
22
+ export declare function uploadingNecessaryImagesOfProduct<T extends ProductUpdate | ProductCreate>(product: T, waUploadToServer: WAMediaUploadFunction, timeoutMs?: number): Promise<T>
23
+
17
24
  /**
18
25
  * Uploads images not already uploaded to WA's servers
19
26
  */
20
27
  export declare const uploadingNecessaryImages: (images: WAMediaUpload[], waUploadToServer: WAMediaUploadFunction, timeoutMs?: number) => Promise<{
21
- url: string;
22
- }[]>;
23
- //# sourceMappingURL=business.d.ts.map
28
+ url: string
29
+ }[]>