@japofc/baileys 2.1.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 (342) hide show
  1. package/NOTICE.md +111 -0
  2. package/README.md +1254 -0
  3. package/WAProto/index.d.ts +9 -0
  4. package/WAProto/index.js +142276 -0
  5. package/engine-requirements.js +13 -0
  6. package/lib/Builders/A2UI.d.ts +242 -0
  7. package/lib/Builders/A2UI.js +308 -0
  8. package/lib/Builders/AIRich.d.ts +105 -0
  9. package/lib/Builders/AIRich.js +2286 -0
  10. package/lib/Builders/Button.d.ts +103 -0
  11. package/lib/Builders/Button.js +883 -0
  12. package/lib/Builders/ButtonV2.d.ts +28 -0
  13. package/lib/Builders/ButtonV2.js +144 -0
  14. package/lib/Builders/ButtonV3.d.ts +25 -0
  15. package/lib/Builders/ButtonV3.js +184 -0
  16. package/lib/Builders/Carousel.d.ts +22 -0
  17. package/lib/Builders/Carousel.js +111 -0
  18. package/lib/Builders/JapBaileys.d.ts +34 -0
  19. package/lib/Builders/JapBaileys.js +108 -0
  20. package/lib/Builders/Poll.d.ts +25 -0
  21. package/lib/Builders/Poll.js +128 -0
  22. package/lib/Builders/index.d.ts +17 -0
  23. package/lib/Builders/index.js +11 -0
  24. package/lib/Builders/shared.d.ts +67 -0
  25. package/lib/Builders/shared.js +652 -0
  26. package/lib/Defaults/index.d.ts +154 -0
  27. package/lib/Defaults/index.js +178 -0
  28. package/lib/Framework/Bot.d.ts +61 -0
  29. package/lib/Framework/Bot.js +248 -0
  30. package/lib/Framework/Context.d.ts +21 -0
  31. package/lib/Framework/Context.js +89 -0
  32. package/lib/Framework/MediaManager.d.ts +17 -0
  33. package/lib/Framework/MediaManager.js +151 -0
  34. package/lib/Framework/SessionManager.d.ts +13 -0
  35. package/lib/Framework/SessionManager.js +33 -0
  36. package/lib/Framework/StatsManager.d.ts +26 -0
  37. package/lib/Framework/StatsManager.js +119 -0
  38. package/lib/Framework/Store/SQLiteStore.d.ts +11 -0
  39. package/lib/Framework/Store/SQLiteStore.js +73 -0
  40. package/lib/Framework/index.d.ts +9 -0
  41. package/lib/Framework/index.js +10 -0
  42. package/lib/Signal/Group/ciphertext-message.d.ts +9 -0
  43. package/lib/Signal/Group/ciphertext-message.js +11 -0
  44. package/lib/Signal/Group/group-session-builder.d.ts +7 -0
  45. package/lib/Signal/Group/group-session-builder.js +29 -0
  46. package/lib/Signal/Group/group_cipher.d.ts +10 -0
  47. package/lib/Signal/Group/group_cipher.js +81 -0
  48. package/lib/Signal/Group/index.d.ts +11 -0
  49. package/lib/Signal/Group/index.js +11 -0
  50. package/lib/Signal/Group/keyhelper.d.ts +6 -0
  51. package/lib/Signal/Group/keyhelper.js +17 -0
  52. package/lib/Signal/Group/sender-chain-key.d.ts +13 -0
  53. package/lib/Signal/Group/sender-chain-key.js +25 -0
  54. package/lib/Signal/Group/sender-key-distribution-message.d.ts +16 -0
  55. package/lib/Signal/Group/sender-key-distribution-message.js +62 -0
  56. package/lib/Signal/Group/sender-key-message.d.ts +18 -0
  57. package/lib/Signal/Group/sender-key-message.js +65 -0
  58. package/lib/Signal/Group/sender-key-name.d.ts +11 -0
  59. package/lib/Signal/Group/sender-key-name.js +47 -0
  60. package/lib/Signal/Group/sender-key-record.d.ts +12 -0
  61. package/lib/Signal/Group/sender-key-record.js +40 -0
  62. package/lib/Signal/Group/sender-key-state.d.ts +16 -0
  63. package/lib/Signal/Group/sender-key-state.js +83 -0
  64. package/lib/Signal/Group/sender-message-key.d.ts +11 -0
  65. package/lib/Signal/Group/sender-message-key.js +25 -0
  66. package/lib/Signal/libsignal.d.ts +54 -0
  67. package/lib/Signal/libsignal.js +430 -0
  68. package/lib/Signal/lid-mapping.d.ts +20 -0
  69. package/lib/Signal/lid-mapping.js +276 -0
  70. package/lib/Socket/Client/index.d.ts +2 -0
  71. package/lib/Socket/Client/index.js +2 -0
  72. package/lib/Socket/Client/types.d.ts +5 -0
  73. package/lib/Socket/Client/types.js +10 -0
  74. package/lib/Socket/Client/websocket.d.ts +12 -0
  75. package/lib/Socket/Client/websocket.js +53 -0
  76. package/lib/Socket/business.d.ts +395 -0
  77. package/lib/Socket/business.js +379 -0
  78. package/lib/Socket/chats.d.ts +136 -0
  79. package/lib/Socket/chats.js +1327 -0
  80. package/lib/Socket/communities.d.ts +562 -0
  81. package/lib/Socket/communities.js +439 -0
  82. package/lib/Socket/dugong.d.ts +117 -0
  83. package/lib/Socket/dugong.js +798 -0
  84. package/lib/Socket/groups.d.ts +285 -0
  85. package/lib/Socket/groups.js +354 -0
  86. package/lib/Socket/index.d.ts +585 -0
  87. package/lib/Socket/index.js +52 -0
  88. package/lib/Socket/messages-recv.d.ts +333 -0
  89. package/lib/Socket/messages-recv.js +1781 -0
  90. package/lib/Socket/messages-send.d.ts +353 -0
  91. package/lib/Socket/messages-send.js +1524 -0
  92. package/lib/Socket/mex.d.ts +1 -0
  93. package/lib/Socket/mex.js +41 -0
  94. package/lib/Socket/newsletter.d.ts +286 -0
  95. package/lib/Socket/newsletter.js +364 -0
  96. package/lib/Socket/socket.d.ts +60 -0
  97. package/lib/Socket/socket.js +1012 -0
  98. package/lib/Socket/username.d.ts +82 -0
  99. package/lib/Socket/username.js +159 -0
  100. package/lib/Store/index.d.ts +3 -0
  101. package/lib/Store/index.js +3 -0
  102. package/lib/Store/make-in-memory-store.d.ts +62 -0
  103. package/lib/Store/make-in-memory-store.js +428 -0
  104. package/lib/Store/make-ordered-dictionary.d.ts +12 -0
  105. package/lib/Store/make-ordered-dictionary.js +78 -0
  106. package/lib/Store/object-repository.d.ts +10 -0
  107. package/lib/Store/object-repository.js +23 -0
  108. package/lib/Types/Auth.d.ts +117 -0
  109. package/lib/Types/Auth.js +1 -0
  110. package/lib/Types/Bussines.d.ts +25 -0
  111. package/lib/Types/Call.d.ts +15 -0
  112. package/lib/Types/Call.js +1 -0
  113. package/lib/Types/Chat.d.ts +124 -0
  114. package/lib/Types/Chat.js +7 -0
  115. package/lib/Types/Contact.d.ts +26 -0
  116. package/lib/Types/Contact.js +1 -0
  117. package/lib/Types/Events.d.ts +256 -0
  118. package/lib/Types/Events.js +1 -0
  119. package/lib/Types/GroupMetadata.d.ts +71 -0
  120. package/lib/Types/GroupMetadata.js +1 -0
  121. package/lib/Types/Label.d.ts +5 -0
  122. package/lib/Types/Label.js +24 -0
  123. package/lib/Types/LabelAssociation.d.ts +6 -0
  124. package/lib/Types/LabelAssociation.js +6 -0
  125. package/lib/Types/Message.d.ts +62 -0
  126. package/lib/Types/Message.js +17 -0
  127. package/lib/Types/Mex.d.ts +2 -0
  128. package/lib/Types/Mex.js +38 -0
  129. package/lib/Types/Product.d.ts +79 -0
  130. package/lib/Types/Product.js +1 -0
  131. package/lib/Types/RichType.d.ts +2 -0
  132. package/lib/Types/RichType.js +22 -0
  133. package/lib/Types/Signal.d.ts +87 -0
  134. package/lib/Types/Signal.js +1 -0
  135. package/lib/Types/Socket.d.ts +138 -0
  136. package/lib/Types/Socket.js +1 -0
  137. package/lib/Types/State.d.ts +8 -0
  138. package/lib/Types/State.js +55 -0
  139. package/lib/Types/USync.d.ts +26 -0
  140. package/lib/Types/index.d.ts +68 -0
  141. package/lib/Types/index.js +27 -0
  142. package/lib/Utils/MessageBuilder.d.ts +2 -0
  143. package/lib/Utils/MessageBuilder.js +2 -0
  144. package/lib/Utils/PersistentStore.d.ts +60 -0
  145. package/lib/Utils/PersistentStore.js +592 -0
  146. package/lib/Utils/anti-delete.d.ts +74 -0
  147. package/lib/Utils/anti-delete.js +221 -0
  148. package/lib/Utils/auth-secure.d.ts +86 -0
  149. package/lib/Utils/auth-secure.js +764 -0
  150. package/lib/Utils/auth-utils.d.ts +57 -0
  151. package/lib/Utils/auth-utils.js +306 -0
  152. package/lib/Utils/auto-reply.d.ts +47 -0
  153. package/lib/Utils/auto-reply.js +157 -0
  154. package/lib/Utils/baileys-event-stream.d.ts +8 -0
  155. package/lib/Utils/baileys-event-stream.js +62 -0
  156. package/lib/Utils/browser-utils.d.ts +8 -0
  157. package/lib/Utils/browser-utils.js +27 -0
  158. package/lib/Utils/business.d.ts +49 -0
  159. package/lib/Utils/business.js +239 -0
  160. package/lib/Utils/button-helper-utils.d.ts +53 -0
  161. package/lib/Utils/button-helper-utils.js +312 -0
  162. package/lib/Utils/button-sender.d.ts +54 -0
  163. package/lib/Utils/button-sender.js +822 -0
  164. package/lib/Utils/chat-control.d.ts +159 -0
  165. package/lib/Utils/chat-control.js +230 -0
  166. package/lib/Utils/chat-history-helpers.d.ts +21 -0
  167. package/lib/Utils/chat-history-helpers.js +70 -0
  168. package/lib/Utils/chat-utils.d.ts +407 -0
  169. package/lib/Utils/chat-utils.js +885 -0
  170. package/lib/Utils/companion-reg-client-utils.d.ts +4 -0
  171. package/lib/Utils/companion-reg-client-utils.js +39 -0
  172. package/lib/Utils/crypto.d.ts +41 -0
  173. package/lib/Utils/crypto.js +147 -0
  174. package/lib/Utils/decode-wa-message.d.ts +83 -0
  175. package/lib/Utils/decode-wa-message.js +316 -0
  176. package/lib/Utils/event-buffer.d.ts +12 -0
  177. package/lib/Utils/event-buffer.js +635 -0
  178. package/lib/Utils/generics.d.ts +69 -0
  179. package/lib/Utils/generics.js +438 -0
  180. package/lib/Utils/history-share.d.ts +11 -0
  181. package/lib/Utils/history-share.js +70 -0
  182. package/lib/Utils/history.d.ts +90 -0
  183. package/lib/Utils/history.js +146 -0
  184. package/lib/Utils/humanizer.d.ts +12 -0
  185. package/lib/Utils/humanizer.js +73 -0
  186. package/lib/Utils/identity-change-handler.d.ts +13 -0
  187. package/lib/Utils/identity-change-handler.js +49 -0
  188. package/lib/Utils/index.d.ts +57 -0
  189. package/lib/Utils/index.js +56 -0
  190. package/lib/Utils/jid-tools.d.ts +6 -0
  191. package/lib/Utils/jid-tools.js +77 -0
  192. package/lib/Utils/link-preview.d.ts +12 -0
  193. package/lib/Utils/link-preview.js +84 -0
  194. package/lib/Utils/logger.d.ts +4 -0
  195. package/lib/Utils/logger.js +2 -0
  196. package/lib/Utils/lt-hash.d.ts +12 -0
  197. package/lib/Utils/lt-hash.js +26 -0
  198. package/lib/Utils/make-mutex.d.ts +6 -0
  199. package/lib/Utils/make-mutex.js +32 -0
  200. package/lib/Utils/media-messages.d.ts +18 -0
  201. package/lib/Utils/media-messages.js +70 -0
  202. package/lib/Utils/media-set.d.ts +13 -0
  203. package/lib/Utils/media-set.js +171 -0
  204. package/lib/Utils/message-kind.d.ts +32 -0
  205. package/lib/Utils/message-kind.js +136 -0
  206. package/lib/Utils/message-retry-manager.d.ts +79 -0
  207. package/lib/Utils/message-retry-manager.js +264 -0
  208. package/lib/Utils/message-search.d.ts +44 -0
  209. package/lib/Utils/message-search.js +188 -0
  210. package/lib/Utils/messages-media.d.ts +135 -0
  211. package/lib/Utils/messages-media.js +868 -0
  212. package/lib/Utils/messages.d.ts +44 -0
  213. package/lib/Utils/messages.js +2326 -0
  214. package/lib/Utils/meta-ai.d.ts +13 -0
  215. package/lib/Utils/meta-ai.js +74 -0
  216. package/lib/Utils/mini-app.d.ts +35 -0
  217. package/lib/Utils/mini-app.js +213 -0
  218. package/lib/Utils/noise-handler.d.ts +20 -0
  219. package/lib/Utils/noise-handler.js +200 -0
  220. package/lib/Utils/offline-node-processor.d.ts +9 -0
  221. package/lib/Utils/offline-node-processor.js +39 -0
  222. package/lib/Utils/past-participants.d.ts +14 -0
  223. package/lib/Utils/past-participants.js +40 -0
  224. package/lib/Utils/pre-key-manager.d.ts +25 -0
  225. package/lib/Utils/pre-key-manager.js +105 -0
  226. package/lib/Utils/process-message.d.ts +82 -0
  227. package/lib/Utils/process-message.js +808 -0
  228. package/lib/Utils/qr-render.d.ts +59 -0
  229. package/lib/Utils/qr-render.js +179 -0
  230. package/lib/Utils/qrcodegen.d.ts +79 -0
  231. package/lib/Utils/qrcodegen.js +848 -0
  232. package/lib/Utils/reporting-utils.d.ts +12 -0
  233. package/lib/Utils/reporting-utils.js +257 -0
  234. package/lib/Utils/rich-message-utils.d.ts +48 -0
  235. package/lib/Utils/rich-message-utils.js +444 -0
  236. package/lib/Utils/router.d.ts +37 -0
  237. package/lib/Utils/router.js +165 -0
  238. package/lib/Utils/scheduled-posts.d.ts +30 -0
  239. package/lib/Utils/scheduled-posts.js +110 -0
  240. package/lib/Utils/scheduling.d.ts +42 -0
  241. package/lib/Utils/scheduling.js +139 -0
  242. package/lib/Utils/signal.d.ts +82 -0
  243. package/lib/Utils/signal.js +200 -0
  244. package/lib/Utils/stanza-ack.d.ts +16 -0
  245. package/lib/Utils/stanza-ack.js +37 -0
  246. package/lib/Utils/status.d.ts +50 -0
  247. package/lib/Utils/status.js +107 -0
  248. package/lib/Utils/stickerpack.d.ts +51 -0
  249. package/lib/Utils/stickerpack.js +274 -0
  250. package/lib/Utils/sync-action-utils.d.ts +2 -0
  251. package/lib/Utils/sync-action-utils.js +48 -0
  252. package/lib/Utils/tag.d.ts +12 -0
  253. package/lib/Utils/tag.js +44 -0
  254. package/lib/Utils/tc-token-utils.d.ts +29 -0
  255. package/lib/Utils/tc-token-utils.js +162 -0
  256. package/lib/Utils/templates.d.ts +76 -0
  257. package/lib/Utils/templates.js +150 -0
  258. package/lib/Utils/transcribe.d.ts +12 -0
  259. package/lib/Utils/transcribe.js +107 -0
  260. package/lib/Utils/use-cache-manager-auth-state.d.ts +13 -0
  261. package/lib/Utils/use-cache-manager-auth-state.js +81 -0
  262. package/lib/Utils/use-multi-file-auth-state.d.ts +10 -0
  263. package/lib/Utils/use-multi-file-auth-state.js +166 -0
  264. package/lib/Utils/use-single-file-auth-state.d.ts +10 -0
  265. package/lib/Utils/use-single-file-auth-state.js +113 -0
  266. package/lib/Utils/use-sqlite-auth-state.d.ts +11 -0
  267. package/lib/Utils/use-sqlite-auth-state.js +169 -0
  268. package/lib/Utils/validate-connection.d.ts +42 -0
  269. package/lib/Utils/validate-connection.js +198 -0
  270. package/lib/Utils/vcard.d.ts +58 -0
  271. package/lib/Utils/vcard.js +104 -0
  272. package/lib/Utils/voice-note.d.ts +15 -0
  273. package/lib/Utils/voice-note.js +63 -0
  274. package/lib/VoIP/audio-feeder.d.ts +18 -0
  275. package/lib/VoIP/audio-feeder.js +160 -0
  276. package/lib/VoIP/call-recorder.d.ts +13 -0
  277. package/lib/VoIP/call-recorder.js +73 -0
  278. package/lib/VoIP/index.d.ts +86 -0
  279. package/lib/VoIP/index.js +611 -0
  280. package/lib/VoIP/relay-transport.d.ts +43 -0
  281. package/lib/VoIP/relay-transport.js +563 -0
  282. package/lib/VoIP/signaling.d.ts +26 -0
  283. package/lib/VoIP/signaling.js +662 -0
  284. package/lib/VoIP/types.d.ts +69 -0
  285. package/lib/VoIP/types.js +17 -0
  286. package/lib/VoIP/wasm-engine.d.ts +120 -0
  287. package/lib/VoIP/wasm-engine.js +1358 -0
  288. package/lib/VoIP/worker-bootstrap.d.ts +4 -0
  289. package/lib/VoIP/worker-bootstrap.js +1046 -0
  290. package/lib/WABinary/constants.d.ts +61 -0
  291. package/lib/WABinary/constants.js +1466 -0
  292. package/lib/WABinary/decode.d.ts +9 -0
  293. package/lib/WABinary/decode.js +261 -0
  294. package/lib/WABinary/encode.d.ts +2 -0
  295. package/lib/WABinary/encode.js +219 -0
  296. package/lib/WABinary/generic-utils.d.ts +74 -0
  297. package/lib/WABinary/generic-utils.js +276 -0
  298. package/lib/WABinary/index.d.ts +5 -0
  299. package/lib/WABinary/index.js +5 -0
  300. package/lib/WABinary/jid-utils.d.ts +28 -0
  301. package/lib/WABinary/jid-utils.js +95 -0
  302. package/lib/WABinary/types.d.ts +19 -0
  303. package/lib/WABinary/types.js +1 -0
  304. package/lib/WAM/BinaryInfo.d.ts +7 -0
  305. package/lib/WAM/BinaryInfo.js +9 -0
  306. package/lib/WAM/constants.d.ts +34926 -0
  307. package/lib/WAM/constants.js +22852 -0
  308. package/lib/WAM/encode.d.ts +1 -0
  309. package/lib/WAM/encode.js +149 -0
  310. package/lib/WAM/index.d.ts +3 -0
  311. package/lib/WAM/index.js +3 -0
  312. package/lib/WAUSync/Protocols/USyncContactProtocol.d.ts +36 -0
  313. package/lib/WAUSync/Protocols/USyncContactProtocol.js +51 -0
  314. package/lib/WAUSync/Protocols/USyncDeviceProtocol.d.ts +29 -0
  315. package/lib/WAUSync/Protocols/USyncDeviceProtocol.js +62 -0
  316. package/lib/WAUSync/Protocols/USyncDisappearingModeProtocol.d.ts +12 -0
  317. package/lib/WAUSync/Protocols/USyncDisappearingModeProtocol.js +26 -0
  318. package/lib/WAUSync/Protocols/USyncStatusProtocol.d.ts +12 -0
  319. package/lib/WAUSync/Protocols/USyncStatusProtocol.js +37 -0
  320. package/lib/WAUSync/Protocols/USyncUsernameProtocol.d.ts +9 -0
  321. package/lib/WAUSync/Protocols/USyncUsernameProtocol.js +24 -0
  322. package/lib/WAUSync/Protocols/UsyncBotProfileProtocol.d.ts +38 -0
  323. package/lib/WAUSync/Protocols/UsyncBotProfileProtocol.js +50 -0
  324. package/lib/WAUSync/Protocols/UsyncLIDProtocol.d.ts +14 -0
  325. package/lib/WAUSync/Protocols/UsyncLIDProtocol.js +28 -0
  326. package/lib/WAUSync/Protocols/index.d.ts +7 -0
  327. package/lib/WAUSync/Protocols/index.js +7 -0
  328. package/lib/WAUSync/USyncQuery.d.ts +20 -0
  329. package/lib/WAUSync/USyncQuery.js +121 -0
  330. package/lib/WAUSync/USyncUser.d.ts +16 -0
  331. package/lib/WAUSync/USyncUser.js +30 -0
  332. package/lib/WAUSync/index.d.ts +3 -0
  333. package/lib/WAUSync/index.js +3 -0
  334. package/lib/assets/wasm/loader.d.ts +5 -0
  335. package/lib/assets/wasm/loader.js +5 -0
  336. package/lib/assets/wasm/whatsapp.wasm +0 -0
  337. package/lib/assets/wasm/worker-modules.d.ts +5 -0
  338. package/lib/assets/wasm/worker-modules.js +273 -0
  339. package/lib/index.d.ts +18 -0
  340. package/lib/index.js +23 -0
  341. package/package.json +180 -0
  342. package/postinstall-banner.js +82 -0
@@ -0,0 +1,38 @@
1
+ export var XWAPaths;
2
+ (function (XWAPaths) {
3
+ XWAPaths["xwa2_newsletter_create"] = "xwa2_newsletter_create";
4
+ XWAPaths["xwa2_newsletter_subscribers"] = "xwa2_newsletter_subscribers";
5
+ XWAPaths["xwa2_newsletter_subscribed"] = "xwa2_newsletter_subscribed";
6
+ XWAPaths["xwa2_newsletter_view"] = "xwa2_newsletter_view";
7
+ XWAPaths["xwa2_newsletter_metadata"] = "xwa2_newsletter";
8
+ XWAPaths["xwa2_newsletter_admin_count"] = "xwa2_newsletter_admin";
9
+ XWAPaths["xwa2_newsletter_mute_v2"] = "xwa2_newsletter_mute_v2";
10
+ XWAPaths["xwa2_newsletter_unmute_v2"] = "xwa2_newsletter_unmute_v2";
11
+ XWAPaths["xwa2_newsletter_follow"] = "xwa2_newsletter_follow";
12
+ XWAPaths["xwa2_newsletter_unfollow"] = "xwa2_newsletter_unfollow";
13
+ XWAPaths["xwa2_newsletter_join_v2"] = "xwa2_newsletter_join_v2";
14
+ XWAPaths["xwa2_newsletter_leave_v2"] = "xwa2_newsletter_leave_v2";
15
+ XWAPaths["xwa2_newsletter_change_owner"] = "xwa2_newsletter_change_owner";
16
+ XWAPaths["xwa2_newsletter_demote"] = "xwa2_newsletter_demote";
17
+ XWAPaths["xwa2_newsletter_delete_v2"] = "xwa2_newsletter_delete_v2";
18
+ XWAPaths["xwa2_fetch_account_reachout_timelock"] = "xwa2_fetch_account_reachout_timelock";
19
+ XWAPaths["xwa2_message_capping_info"] = "xwa2_message_capping_info";
20
+ })(XWAPaths || (XWAPaths = {}));
21
+ export var QueryIds;
22
+ (function (QueryIds) {
23
+ QueryIds["CREATE"] = "8823471724422422";
24
+ QueryIds["UPDATE_METADATA"] = "24250201037901610";
25
+ QueryIds["METADATA"] = "6563316087068696";
26
+ QueryIds["SUBSCRIBERS"] = "9783111038412085";
27
+ QueryIds["SUBSCRIBED"] = "6388546374527196";
28
+ QueryIds["FOLLOW"] = "24404358912487870";
29
+ QueryIds["UNFOLLOW"] = "9767147403369991";
30
+ QueryIds["MUTE"] = "29766401636284406";
31
+ QueryIds["UNMUTE"] = "9864994326891137";
32
+ QueryIds["ADMIN_COUNT"] = "7130823597031706";
33
+ QueryIds["CHANGE_OWNER"] = "7341777602580933";
34
+ QueryIds["DEMOTE"] = "6551828931592903";
35
+ QueryIds["DELETE"] = "30062808666639665";
36
+ QueryIds["REACHOUT_TIMELOCK"] = "23983697327930364";
37
+ QueryIds["MESSAGE_CAPPING_INFO"] = "24503548349331633";
38
+ })(QueryIds || (QueryIds = {}));
@@ -0,0 +1,79 @@
1
+ import type { WAMediaUpload } from './Message.js';
2
+ export type CatalogResult = {
3
+ data: {
4
+ paging: {
5
+ cursors: {
6
+ before: string;
7
+ after: string;
8
+ };
9
+ };
10
+ data: any[];
11
+ };
12
+ };
13
+ export type ProductCreateResult = {
14
+ data: {
15
+ product: {};
16
+ };
17
+ };
18
+ export type CatalogStatus = {
19
+ status: string;
20
+ canAppeal: boolean;
21
+ };
22
+ export type CatalogCollection = {
23
+ id: string;
24
+ name: string;
25
+ products: Product[];
26
+ status: CatalogStatus;
27
+ };
28
+ export type ProductAvailability = 'in stock';
29
+ export type ProductBase = {
30
+ name: string;
31
+ retailerId?: string;
32
+ url?: string;
33
+ description: string;
34
+ price: number;
35
+ currency: string;
36
+ isHidden?: boolean;
37
+ };
38
+ export type ProductCreate = ProductBase & {
39
+ /** ISO country code for product origin. Set to undefined for no country */
40
+ originCountryCode: string | undefined;
41
+ /** images of the product */
42
+ images: WAMediaUpload[];
43
+ };
44
+ export type ProductUpdate = Omit<ProductCreate, 'originCountryCode'>;
45
+ export type Product = ProductBase & {
46
+ id: string;
47
+ imageUrls: {
48
+ [_: string]: string;
49
+ };
50
+ reviewStatus: {
51
+ [_: string]: string;
52
+ };
53
+ availability: ProductAvailability;
54
+ };
55
+ export type OrderPrice = {
56
+ currency: string;
57
+ total: number;
58
+ };
59
+ export type OrderProduct = {
60
+ id: string;
61
+ imageUrl: string;
62
+ name: string;
63
+ quantity: number;
64
+ currency: string;
65
+ price: number;
66
+ };
67
+ export type OrderDetails = {
68
+ price: OrderPrice;
69
+ products: OrderProduct[];
70
+ };
71
+ export type CatalogCursor = string;
72
+ export type GetCatalogOptions = {
73
+ /** cursor to start from */
74
+ cursor?: CatalogCursor;
75
+ /** number of products to fetch */
76
+ limit?: number;
77
+ jid?: string;
78
+ };
79
+ //# sourceMappingURL=Product.d.ts.map
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,2 @@
1
+ export const CodeHighlightType: any;
2
+ export const RichSubMessageType: any;
@@ -0,0 +1,22 @@
1
+ export var CodeHighlightType;
2
+ (function (CodeHighlightType) {
3
+ CodeHighlightType[CodeHighlightType["DEFAULT"] = 0] = "DEFAULT";
4
+ CodeHighlightType[CodeHighlightType["KEYWORD"] = 1] = "KEYWORD";
5
+ CodeHighlightType[CodeHighlightType["METHOD"] = 2] = "METHOD";
6
+ CodeHighlightType[CodeHighlightType["STRING"] = 3] = "STRING";
7
+ CodeHighlightType[CodeHighlightType["NUMBER"] = 4] = "NUMBER";
8
+ CodeHighlightType[CodeHighlightType["COMMENT"] = 5] = "COMMENT";
9
+ })(CodeHighlightType || (CodeHighlightType = {}));
10
+ export var RichSubMessageType;
11
+ (function (RichSubMessageType) {
12
+ RichSubMessageType[RichSubMessageType["UNKNOWN"] = 0] = "UNKNOWN";
13
+ RichSubMessageType[RichSubMessageType["GRID_IMAGE"] = 1] = "GRID_IMAGE";
14
+ RichSubMessageType[RichSubMessageType["TEXT"] = 2] = "TEXT";
15
+ RichSubMessageType[RichSubMessageType["INLINE_IMAGE"] = 3] = "INLINE_IMAGE";
16
+ RichSubMessageType[RichSubMessageType["TABLE"] = 4] = "TABLE";
17
+ RichSubMessageType[RichSubMessageType["CODE"] = 5] = "CODE";
18
+ RichSubMessageType[RichSubMessageType["DYNAMIC"] = 6] = "DYNAMIC";
19
+ RichSubMessageType[RichSubMessageType["MAP"] = 7] = "MAP";
20
+ RichSubMessageType[RichSubMessageType["LATEX"] = 8] = "LATEX";
21
+ RichSubMessageType[RichSubMessageType["CONTENT_ITEMS"] = 9] = "CONTENT_ITEMS";
22
+ })(RichSubMessageType || (RichSubMessageType = {}));
@@ -0,0 +1,87 @@
1
+ import { proto } from '../../WAProto/index.js';
2
+ import type { LIDMappingStore } from '../Signal/lid-mapping.js';
3
+ type DecryptGroupSignalOpts = {
4
+ group: string;
5
+ authorJid: string;
6
+ msg: Uint8Array;
7
+ };
8
+ type ProcessSenderKeyDistributionMessageOpts = {
9
+ item: any;
10
+ authorJid: string;
11
+ };
12
+ type DecryptSignalProtoOpts = {
13
+ jid: string;
14
+ type: 'pkmsg' | 'msg';
15
+ ciphertext: Uint8Array;
16
+ };
17
+ type EncryptMessageOpts = {
18
+ jid: string;
19
+ data: Uint8Array;
20
+ };
21
+ type EncryptGroupMessageOpts = {
22
+ group: string;
23
+ data: Uint8Array;
24
+ meId: string;
25
+ };
26
+ type GetSenderKeyDistributionMessageOpts = {
27
+ group: string;
28
+ meId: string;
29
+ };
30
+ type PreKey = {
31
+ keyId: number;
32
+ publicKey: Uint8Array;
33
+ };
34
+ type SignedPreKey = PreKey & {
35
+ signature: Uint8Array;
36
+ };
37
+ type E2ESession = {
38
+ registrationId: number;
39
+ identityKey: Uint8Array;
40
+ signedPreKey: SignedPreKey;
41
+ preKey?: PreKey;
42
+ };
43
+ type E2ESessionOpts = {
44
+ jid: string;
45
+ session: E2ESession;
46
+ };
47
+ export type SignalRepository = {
48
+ decryptGroupMessage(opts: DecryptGroupSignalOpts): Promise<Uint8Array>;
49
+ processSenderKeyDistributionMessage(opts: ProcessSenderKeyDistributionMessageOpts): Promise<void>;
50
+ decryptMessage(opts: DecryptSignalProtoOpts): Promise<Uint8Array>;
51
+ encryptMessage(opts: EncryptMessageOpts): Promise<{
52
+ type: 'pkmsg' | 'msg';
53
+ ciphertext: Uint8Array;
54
+ }>;
55
+ encryptGroupMessage(opts: EncryptGroupMessageOpts): Promise<{
56
+ senderKeyDistributionMessage: Uint8Array;
57
+ ciphertext: Uint8Array;
58
+ }>;
59
+ getSenderKeyDistributionMessage(opts: GetSenderKeyDistributionMessageOpts): Promise<Uint8Array>;
60
+ hasSenderKey(opts: GetSenderKeyDistributionMessageOpts): Promise<boolean>;
61
+ getSessionInfo(jid: string): Promise<{
62
+ baseKey: Uint8Array;
63
+ registrationId: number;
64
+ } | null>;
65
+ injectE2ESession(opts: E2ESessionOpts): Promise<void>;
66
+ validateSession(jid: string): Promise<{
67
+ exists: boolean;
68
+ reason?: string;
69
+ }>;
70
+ jidToSignalProtocolAddress(jid: string): string;
71
+ migrateSession(fromJid: string, toJid: string): Promise<{
72
+ migrated: number;
73
+ skipped: number;
74
+ total: number;
75
+ }>;
76
+ validateSession(jid: string): Promise<{
77
+ exists: boolean;
78
+ reason?: string;
79
+ }>;
80
+ deleteSession(jids: string[]): Promise<void>;
81
+ };
82
+ export interface SignalRepositoryWithLIDStore extends SignalRepository {
83
+ lidMapping: LIDMappingStore;
84
+ close?: () => void;
85
+ }
86
+ export {};
87
+ //# sourceMappingURL=Signal.d.ts.map
@@ -0,0 +1 @@
1
+ import { proto } from '../../WAProto/index.js';
@@ -0,0 +1,138 @@
1
+ import type { Agent } from 'https';
2
+ import type { URL } from 'url';
3
+ import { proto } from '../../WAProto/index.js';
4
+ import type { ILogger } from '../Utils/logger.js';
5
+ import type { AuthenticationState, LIDMapping, SignalAuthState, TransactionCapabilityOptions } from './Auth.js';
6
+ import type { GroupMetadata } from './GroupMetadata.js';
7
+ import { type MediaConnInfo, type WAMessageKey } from './Message.js';
8
+ import type { SignalRepositoryWithLIDStore } from './Signal.js';
9
+ export type WAVersion = [number, number, number];
10
+ export type WABrowserDescription = [string, string, string];
11
+ export type CacheStore = {
12
+ /** get a cached key and change the stats */
13
+ get<T>(key: string): Promise<T> | T | undefined;
14
+ /** set a key in the cache */
15
+ set<T>(key: string, value: T): Promise<void> | void | number | boolean;
16
+ /** delete a key from the cache */
17
+ del(key: string): void | Promise<void> | number | boolean;
18
+ /** flush all data */
19
+ flushAll(): void | Promise<void>;
20
+ close?: () => void;
21
+ };
22
+ export type PossiblyExtendedCacheStore = CacheStore & {
23
+ mget?: <T>(keys: string[]) => Promise<Record<string, T | undefined>>;
24
+ mset?: <T>(entries: {
25
+ key: string;
26
+ value: T;
27
+ }[]) => Promise<void> | void | number | boolean;
28
+ mdel?: (keys: string[]) => void | Promise<void> | number | boolean;
29
+ };
30
+ export type PatchedMessageWithRecipientJID = any & {
31
+ recipientJid?: string;
32
+ };
33
+ export type SocketConfig = {
34
+ /** the WS url to connect to WA */
35
+ waWebSocketUrl: string | URL;
36
+ /** Fails the connection if the socket times out in this interval */
37
+ connectTimeoutMs: number;
38
+ /** Default timeout for queries, undefined for no timeout */
39
+ defaultQueryTimeoutMs: number | undefined;
40
+ /** ping-pong interval for WS connection */
41
+ keepAliveIntervalMs: number;
42
+ /** should baileys use the mobile api instead of the multi device api
43
+ * @deprecated This feature has been removed
44
+ */
45
+ mobile?: boolean;
46
+ /** proxy agent */
47
+ agent?: Agent;
48
+ /** logger */
49
+ logger: ILogger;
50
+ /** version to connect with */
51
+ version: WAVersion;
52
+ /** override browser config */
53
+ browser: WABrowserDescription;
54
+ /** Initial pushName carried in the registration ClientPayload (used by mock servers for deterministic phone assignment). */
55
+ pushName?: string;
56
+ /** agent used for fetch requests -- uploading/downloading media */
57
+ fetchAgent?: Agent;
58
+ /**
59
+ * Print pairing QRs to the terminal automatically on `connection.update`
60
+ * (rendered with the built-in zero-dependency engine — see
61
+ * `renderQRToTerminal` in Utils for manual/custom rendering).
62
+ */
63
+ printQRInTerminal?: boolean;
64
+ /** should events be emitted for actions done by this socket connection */
65
+ emitOwnEvents: boolean;
66
+ /** custom upload hosts to upload media to */
67
+ customUploadHosts: MediaConnInfo['hosts'];
68
+ /** time to wait between sending new retry requests */
69
+ retryRequestDelayMs: number;
70
+ /** max retry count */
71
+ maxMsgRetryCount: number;
72
+ /** time to wait for the generation of the next QR in ms */
73
+ qrTimeout?: number;
74
+ /** provide an auth state object to maintain the auth state */
75
+ auth: AuthenticationState;
76
+ /** manage history processing with this control; by default will sync up everything */
77
+ shouldSyncHistoryMessage: (msg: any) => boolean;
78
+ /** transaction capability options for SignalKeyStore */
79
+ transactionOpts: TransactionCapabilityOptions;
80
+ /** marks the client as online whenever the socket successfully connects */
81
+ markOnlineOnConnect: boolean;
82
+ /** alphanumeric country code (USA -> US) for the number used */
83
+ countryCode: string;
84
+ /** provide a cache to store media, so does not have to be re-uploaded */
85
+ mediaCache?: CacheStore;
86
+ /**
87
+ * map to store the retry counts for failed messages;
88
+ * used to determine whether to retry a message or not */
89
+ msgRetryCounterCache?: CacheStore;
90
+ /** provide a cache to store a user's device list */
91
+ userDevicesCache?: PossiblyExtendedCacheStore;
92
+ /** cache to store call offers */
93
+ callOfferCache?: CacheStore;
94
+ /** cache to track placeholder resends */
95
+ placeholderResendCache?: CacheStore;
96
+ /** width for link preview images */
97
+ linkPreviewImageThumbnailWidth: number;
98
+ /** Should Baileys ask the phone for full history, will be received async */
99
+ syncFullHistory: boolean;
100
+ /** Should baileys fire init queries automatically, default true */
101
+ fireInitQueries: boolean;
102
+ /**
103
+ * generate a high quality link preview,
104
+ * entails uploading the jpegThumbnail to WA
105
+ * */
106
+ generateHighQualityLinkPreview: boolean;
107
+ /** Enable automatic session recreation for failed messages */
108
+ enableAutoSessionRecreation: boolean;
109
+ /** Enable recent message caching for retry handling */
110
+ enableRecentMessageCache: boolean;
111
+ /**
112
+ * Returns if a jid should be ignored,
113
+ * no event for that jid will be triggered.
114
+ * Messages from that jid will also not be decrypted
115
+ * */
116
+ shouldIgnoreJid: (jid: string) => boolean | undefined;
117
+ /**
118
+ * Optionally patch the message before sending out
119
+ * */
120
+ patchMessageBeforeSending: (msg: any, recipientJids?: string[]) => Promise<PatchedMessageWithRecipientJID[] | PatchedMessageWithRecipientJID> | PatchedMessageWithRecipientJID[] | PatchedMessageWithRecipientJID;
121
+ /** verify app state MACs */
122
+ appStateMacVerification: {
123
+ patch: boolean;
124
+ snapshot: boolean;
125
+ };
126
+ /** options for HTTP fetch requests */
127
+ options: RequestInit;
128
+ /**
129
+ * fetch a message from your store
130
+ * implement this so that messages failed to send
131
+ * (solves the "this message can take a while" issue) can be retried
132
+ * */
133
+ getMessage: (key: WAMessageKey) => Promise<any | undefined>;
134
+ /** cached group metadata, use to prevent redundant requests to WA & speed up msg sending */
135
+ cachedGroupMetadata: (jid: string) => Promise<GroupMetadata | undefined>;
136
+ makeSignalRepository: (auth: SignalAuthState, logger: ILogger, pnToLIDFunc?: (jids: string[]) => Promise<LIDMapping[] | undefined>) => SignalRepositoryWithLIDStore;
137
+ };
138
+ //# sourceMappingURL=Socket.d.ts.map
@@ -0,0 +1 @@
1
+ import { proto } from '../../WAProto/index.js';
@@ -0,0 +1,8 @@
1
+ export const SyncState: any;
2
+ export const ReachoutTimelockEnforcementType: any;
3
+ export const NewChatMessageCappingStatusType: any;
4
+ export const NewChatMessageCappingMVStatusType: any;
5
+ export const NewChatMessageCappingOTEStatusType: any;
6
+ // JAP@Types: loose aliases (see Message.d.ts note).
7
+ export type ConnectionState = any;
8
+ export type NewChatMessageCapInfo = any;
@@ -0,0 +1,55 @@
1
+ import { Boom } from '@hapi/boom';
2
+ export var SyncState;
3
+ (function (SyncState) {
4
+ /** The socket is connecting, but we haven't received pending notifications yet. */
5
+ SyncState[SyncState["Connecting"] = 0] = "Connecting";
6
+ /** Pending notifications received. Buffering events until we decide whether to sync or not. */
7
+ SyncState[SyncState["AwaitingInitialSync"] = 1] = "AwaitingInitialSync";
8
+ /** The initial app state sync (history, etc.) is in progress. Buffering continues. */
9
+ SyncState[SyncState["Syncing"] = 2] = "Syncing";
10
+ /** Initial sync is complete, or was skipped. The socket is fully operational and events are processed in real-time. */
11
+ SyncState[SyncState["Online"] = 3] = "Online";
12
+ })(SyncState || (SyncState = {}));
13
+ export var ReachoutTimelockEnforcementType;
14
+ (function (ReachoutTimelockEnforcementType) {
15
+ ReachoutTimelockEnforcementType["BIZ_COMMERCE_VIOLATION_ALCOHOL"] = "BIZ_COMMERCE_VIOLATION_ALCOHOL";
16
+ ReachoutTimelockEnforcementType["BIZ_COMMERCE_VIOLATION_ADULT"] = "BIZ_COMMERCE_VIOLATION_ADULT";
17
+ ReachoutTimelockEnforcementType["BIZ_COMMERCE_VIOLATION_ANIMALS"] = "BIZ_COMMERCE_VIOLATION_ANIMALS";
18
+ ReachoutTimelockEnforcementType["BIZ_COMMERCE_VIOLATION_BODY_PARTS_FLUIDS"] = "BIZ_COMMERCE_VIOLATION_BODY_PARTS_FLUIDS";
19
+ ReachoutTimelockEnforcementType["BIZ_COMMERCE_VIOLATION_DATING"] = "BIZ_COMMERCE_VIOLATION_DATING";
20
+ ReachoutTimelockEnforcementType["BIZ_COMMERCE_VIOLATION_DIGITAL_SERVICES_PRODUCTS"] = "BIZ_COMMERCE_VIOLATION_DIGITAL_SERVICES_PRODUCTS";
21
+ ReachoutTimelockEnforcementType["BIZ_COMMERCE_VIOLATION_DRUGS"] = "BIZ_COMMERCE_VIOLATION_DRUGS";
22
+ ReachoutTimelockEnforcementType["BIZ_COMMERCE_VIOLATION_DRUGS_ONLY_OTC"] = "BIZ_COMMERCE_VIOLATION_DRUGS_ONLY_OTC";
23
+ ReachoutTimelockEnforcementType["BIZ_COMMERCE_VIOLATION_GAMBLING"] = "BIZ_COMMERCE_VIOLATION_GAMBLING";
24
+ ReachoutTimelockEnforcementType["BIZ_COMMERCE_VIOLATION_HEALTHCARE"] = "BIZ_COMMERCE_VIOLATION_HEALTHCARE";
25
+ ReachoutTimelockEnforcementType["BIZ_COMMERCE_VIOLATION_REAL_FAKE_CURRENCY"] = "BIZ_COMMERCE_VIOLATION_REAL_FAKE_CURRENCY";
26
+ ReachoutTimelockEnforcementType["BIZ_COMMERCE_VIOLATION_SUPPLEMENTS"] = "BIZ_COMMERCE_VIOLATION_SUPPLEMENTS";
27
+ ReachoutTimelockEnforcementType["BIZ_COMMERCE_VIOLATION_TOBACCO"] = "BIZ_COMMERCE_VIOLATION_TOBACCO";
28
+ ReachoutTimelockEnforcementType["BIZ_COMMERCE_VIOLATION_VIOLENT_CONTENT"] = "BIZ_COMMERCE_VIOLATION_VIOLENT_CONTENT";
29
+ ReachoutTimelockEnforcementType["BIZ_COMMERCE_VIOLATION_WEAPONS"] = "BIZ_COMMERCE_VIOLATION_WEAPONS";
30
+ ReachoutTimelockEnforcementType["BIZ_QUALITY"] = "BIZ_QUALITY";
31
+ /** This means there is no restriction */
32
+ ReachoutTimelockEnforcementType["DEFAULT"] = "DEFAULT";
33
+ ReachoutTimelockEnforcementType["WEB_COMPANION_ONLY"] = "WEB_COMPANION_ONLY";
34
+ })(ReachoutTimelockEnforcementType || (ReachoutTimelockEnforcementType = {}));
35
+ export var NewChatMessageCappingStatusType;
36
+ (function (NewChatMessageCappingStatusType) {
37
+ NewChatMessageCappingStatusType["NONE"] = "NONE";
38
+ NewChatMessageCappingStatusType["FIRST_WARNING"] = "FIRST_WARNING";
39
+ NewChatMessageCappingStatusType["SECOND_WARNING"] = "SECOND_WARNING";
40
+ NewChatMessageCappingStatusType["CAPPED"] = "CAPPED";
41
+ })(NewChatMessageCappingStatusType || (NewChatMessageCappingStatusType = {}));
42
+ export var NewChatMessageCappingMVStatusType;
43
+ (function (NewChatMessageCappingMVStatusType) {
44
+ NewChatMessageCappingMVStatusType["NOT_ELIGIBLE"] = "NOT_ELIGIBLE";
45
+ NewChatMessageCappingMVStatusType["NOT_ACTIVE"] = "NOT_ACTIVE";
46
+ NewChatMessageCappingMVStatusType["ACTIVE"] = "ACTIVE";
47
+ NewChatMessageCappingMVStatusType["ACTIVE_UPGRADE_AVAILABLE"] = "ACTIVE_UPGRADE_AVAILABLE";
48
+ })(NewChatMessageCappingMVStatusType || (NewChatMessageCappingMVStatusType = {}));
49
+ export var NewChatMessageCappingOTEStatusType;
50
+ (function (NewChatMessageCappingOTEStatusType) {
51
+ NewChatMessageCappingOTEStatusType["NOT_ELIGIBLE"] = "NOT_ELIGIBLE";
52
+ NewChatMessageCappingOTEStatusType["ELIGIBLE"] = "ELIGIBLE";
53
+ NewChatMessageCappingOTEStatusType["ACTIVE_IN_CURRENT_CYCLE"] = "ACTIVE_IN_CURRENT_CYCLE";
54
+ NewChatMessageCappingOTEStatusType["EXHAUSTED"] = "EXHAUSTED";
55
+ })(NewChatMessageCappingOTEStatusType || (NewChatMessageCappingOTEStatusType = {}));
@@ -0,0 +1,26 @@
1
+ import type { BinaryNode } from '../WABinary/index.js';
2
+ import { USyncUser } from '../WAUSync/index.js';
3
+ /**
4
+ * Defines the interface for a USyncQuery protocol
5
+ */
6
+ export interface USyncQueryProtocol {
7
+ /**
8
+ * The name of the protocol
9
+ */
10
+ name: string;
11
+ /**
12
+ * Defines what goes inside the query part of a USyncQuery
13
+ */
14
+ getQueryElement: () => BinaryNode;
15
+ /**
16
+ * Defines what goes inside the user part of a USyncQuery
17
+ */
18
+ getUserElement: (user: USyncUser) => BinaryNode | null;
19
+ /**
20
+ * Parse the result of the query
21
+ * @param data Data from the result
22
+ * @returns Whatever the protocol is supposed to return
23
+ */
24
+ parser: (data: BinaryNode) => unknown;
25
+ }
26
+ //# sourceMappingURL=USync.d.ts.map
@@ -0,0 +1,68 @@
1
+ export * from './Auth.js';
2
+ export * from './GroupMetadata.js';
3
+ export * from './Chat.js';
4
+ export * from './Contact.js';
5
+ export * from './State.js';
6
+ export * from './Message.js';
7
+ export * from './Socket.js';
8
+ export * from './Events.js';
9
+ export * from './Product.js';
10
+ export * from './Call.js';
11
+ export * from './Signal.js';
12
+ export * from './Mex.js';
13
+ export * from './Label.js';
14
+ export * from './LabelAssociation.js';
15
+ import type { AuthenticationState } from './Auth.js';
16
+ import type { SocketConfig } from './Socket.js';
17
+ export type UserFacingSocketConfig = Partial<SocketConfig> & {
18
+ auth: AuthenticationState;
19
+ };
20
+ export type BrowsersMap = {
21
+ ubuntu(browser: string): [string, string, string];
22
+ macOS(browser: string): [string, string, string];
23
+ baileys(browser: string): [string, string, string];
24
+ windows(browser: string): [string, string, string];
25
+ android(browser: string): [string, string, string];
26
+ appropriate(browser: string): [string, string, string];
27
+ };
28
+ export declare enum DisconnectReason {
29
+ connectionClosed = 428,
30
+ connectionLost = 408,
31
+ connectionReplaced = 440,
32
+ timedOut = 408,
33
+ loggedOut = 401,
34
+ badSession = 500,
35
+ restartRequired = 515,
36
+ multideviceMismatch = 411,
37
+ forbidden = 403,
38
+ unavailableService = 503
39
+ }
40
+ export type WAInitResponse = {
41
+ ref: string;
42
+ ttl: number;
43
+ status: 200;
44
+ };
45
+ export type WABusinessHoursConfig = {
46
+ day_of_week: string;
47
+ mode: string;
48
+ open_time?: number;
49
+ close_time?: number;
50
+ };
51
+ export type WABusinessProfile = {
52
+ description: string;
53
+ email: string | undefined;
54
+ business_hours: {
55
+ timezone?: string;
56
+ config?: WABusinessHoursConfig[];
57
+ business_config?: WABusinessHoursConfig[];
58
+ };
59
+ website: string[];
60
+ category?: string;
61
+ wid?: string;
62
+ address?: string;
63
+ };
64
+ export type CurveKeyPair = {
65
+ private: Uint8Array;
66
+ public: Uint8Array;
67
+ };
68
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1,27 @@
1
+ export * from './Auth.js';
2
+ export * from './GroupMetadata.js';
3
+ export * from './Chat.js';
4
+ export * from './Contact.js';
5
+ export * from './State.js';
6
+ export * from './Message.js';
7
+ export * from './Socket.js';
8
+ export * from './Events.js';
9
+ export * from './Product.js';
10
+ export * from './Call.js';
11
+ export * from './Signal.js';
12
+ export * from './Mex.js';
13
+ export * from './Label.js';
14
+ export * from './LabelAssociation.js';
15
+ export var DisconnectReason;
16
+ (function (DisconnectReason) {
17
+ DisconnectReason[DisconnectReason["connectionClosed"] = 428] = "connectionClosed";
18
+ DisconnectReason[DisconnectReason["connectionLost"] = 408] = "connectionLost";
19
+ DisconnectReason[DisconnectReason["connectionReplaced"] = 440] = "connectionReplaced";
20
+ DisconnectReason[DisconnectReason["timedOut"] = 408] = "timedOut";
21
+ DisconnectReason[DisconnectReason["loggedOut"] = 401] = "loggedOut";
22
+ DisconnectReason[DisconnectReason["badSession"] = 500] = "badSession";
23
+ DisconnectReason[DisconnectReason["restartRequired"] = 515] = "restartRequired";
24
+ DisconnectReason[DisconnectReason["multideviceMismatch"] = 411] = "multideviceMismatch";
25
+ DisconnectReason[DisconnectReason["forbidden"] = 403] = "forbidden";
26
+ DisconnectReason[DisconnectReason["unavailableService"] = 503] = "unavailableService";
27
+ })(DisconnectReason || (DisconnectReason = {}));
@@ -0,0 +1,2 @@
1
+ // Compatibility shim types: mirrors MessageBuilder.js (re-exports Builders).
2
+ export * from '../Builders/index.js';
@@ -0,0 +1,2 @@
1
+ // Compatibility shim: legacy relative imports continue to work.
2
+ export * from '../Builders/index.js';
@@ -0,0 +1,60 @@
1
+ /**
2
+ * Common contract every backend below implements. A flat (domain, id) -> value
3
+ * KV store — the same shape useSqliteAuthState() uses for its `signal_keys`
4
+ * table. Query semantics (ordering, pagination) stay owned by
5
+ * makeInMemoryStore() in JS; adapters are pure storage.
6
+ */
7
+ export interface StoreAdapter {
8
+ /** Create tables/collections/indexes if missing. Idempotent. */
9
+ init(): Promise<void>;
10
+ get(domain: string, id: string): Promise<unknown | undefined>;
11
+ set(domain: string, id: string, value: unknown): Promise<void>;
12
+ delete(domain: string, id: string): Promise<void>;
13
+ /** All (id, value) pairs currently stored under `domain`. */
14
+ list(domain: string): Promise<Array<[string, unknown]>>;
15
+ /** All distinct domain names, optionally filtered by prefix (e.g. `messages:`). */
16
+ listDomains(prefix?: string): Promise<string[]>;
17
+ /** Remove every row under `domain`. */
18
+ clear(domain: string): Promise<void>;
19
+ close(): Promise<void>;
20
+ }
21
+
22
+ export function createSqliteStoreAdapter(opts?: { dbPath?: string; database?: any /* import('better-sqlite3').Database — optional peer */ }): Promise<StoreAdapter>;
23
+
24
+ export function createMongoStoreAdapter(opts?: {
25
+ url?: string;
26
+ dbName?: string;
27
+ client?: any /* import('mongodb').MongoClient — optional peer */;
28
+ collectionName?: string;
29
+ }): Promise<StoreAdapter>;
30
+
31
+ export function createMysqlStoreAdapter(
32
+ opts?: { pool?: any /* import('mysql2/promise').Pool — optional peer */ } & Record<string, any> /* PoolOptions */
33
+ ): Promise<StoreAdapter>;
34
+
35
+ export function createPostgresStoreAdapter(opts?: { pool?: any /* import('pg').Pool — optional peer */ } & Record<string, any> /* PoolConfig */): Promise<StoreAdapter>;
36
+
37
+ export function createRedisStoreAdapter(
38
+ opts?: { url?: string; client?: any /* import('ioredis').Redis — optional peer */ } & Record<string, any> /* RedisOptions */
39
+ ): Promise<StoreAdapter>;
40
+
41
+ export interface MakePersistentStoreConfig {
42
+ adapter: StoreAdapter;
43
+ socket?: any;
44
+ logger?: any;
45
+ chatKey?: any;
46
+ labelAssociationKey?: any;
47
+ }
48
+
49
+ /**
50
+ * Persisted counterpart to makeInMemoryStore(). Same return shape (chats,
51
+ * contacts, messages, groupMetadata, labels, bind, loadMessages, ...) plus
52
+ * `adapter` and an async `close()`. Hydrates from `adapter` on creation, then
53
+ * write-throughs every mutating event alongside the normal in-memory update.
54
+ */
55
+ export function makePersistentStore(config: MakePersistentStoreConfig): Promise<
56
+ ReturnType<typeof import('../Store/make-in-memory-store.js').makeInMemoryStore> & {
57
+ adapter: StoreAdapter;
58
+ close(): Promise<void>;
59
+ }
60
+ >;