shurainc 3.0.4

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 (369) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +405 -0
  3. package/WAProto/GenerateStatics.sh +3 -0
  4. package/WAProto/WAProto.proto +5479 -0
  5. package/WAProto/fix-imports.js +29 -0
  6. package/WAProto/index.d.ts +14017 -0
  7. package/WAProto/index.js +97650 -0
  8. package/engine-requirements.js +10 -0
  9. package/lib/Defaults/index.d.ts +62 -0
  10. package/lib/Defaults/index.d.ts.map +1 -0
  11. package/lib/Defaults/index.js +115 -0
  12. package/lib/Defaults/index.js.map +1 -0
  13. package/lib/Signal/Group/ciphertext-message.d.ts +10 -0
  14. package/lib/Signal/Group/ciphertext-message.d.ts.map +1 -0
  15. package/lib/Signal/Group/ciphertext-message.js +12 -0
  16. package/lib/Signal/Group/ciphertext-message.js.map +1 -0
  17. package/lib/Signal/Group/group-session-builder.d.ts +15 -0
  18. package/lib/Signal/Group/group-session-builder.d.ts.map +1 -0
  19. package/lib/Signal/Group/group-session-builder.js +30 -0
  20. package/lib/Signal/Group/group-session-builder.js.map +1 -0
  21. package/lib/Signal/Group/group_cipher.d.ts +17 -0
  22. package/lib/Signal/Group/group_cipher.d.ts.map +1 -0
  23. package/lib/Signal/Group/group_cipher.js +82 -0
  24. package/lib/Signal/Group/group_cipher.js.map +1 -0
  25. package/lib/Signal/Group/index.d.ts +12 -0
  26. package/lib/Signal/Group/index.d.ts.map +1 -0
  27. package/lib/Signal/Group/index.js +12 -0
  28. package/lib/Signal/Group/index.js.map +1 -0
  29. package/lib/Signal/Group/keyhelper.d.ts +11 -0
  30. package/lib/Signal/Group/keyhelper.d.ts.map +1 -0
  31. package/lib/Signal/Group/keyhelper.js +18 -0
  32. package/lib/Signal/Group/keyhelper.js.map +1 -0
  33. package/lib/Signal/Group/sender-chain-key.d.ts +14 -0
  34. package/lib/Signal/Group/sender-chain-key.d.ts.map +1 -0
  35. package/lib/Signal/Group/sender-chain-key.js +26 -0
  36. package/lib/Signal/Group/sender-chain-key.js.map +1 -0
  37. package/lib/Signal/Group/sender-key-distribution-message.d.ts +17 -0
  38. package/lib/Signal/Group/sender-key-distribution-message.d.ts.map +1 -0
  39. package/lib/Signal/Group/sender-key-distribution-message.js +63 -0
  40. package/lib/Signal/Group/sender-key-distribution-message.js.map +1 -0
  41. package/lib/Signal/Group/sender-key-message.d.ts +19 -0
  42. package/lib/Signal/Group/sender-key-message.d.ts.map +1 -0
  43. package/lib/Signal/Group/sender-key-message.js +66 -0
  44. package/lib/Signal/Group/sender-key-message.js.map +1 -0
  45. package/lib/Signal/Group/sender-key-name.d.ts +18 -0
  46. package/lib/Signal/Group/sender-key-name.d.ts.map +1 -0
  47. package/lib/Signal/Group/sender-key-name.js +48 -0
  48. package/lib/Signal/Group/sender-key-name.js.map +1 -0
  49. package/lib/Signal/Group/sender-key-record.d.ts +31 -0
  50. package/lib/Signal/Group/sender-key-record.d.ts.map +1 -0
  51. package/lib/Signal/Group/sender-key-record.js +41 -0
  52. package/lib/Signal/Group/sender-key-record.js.map +1 -0
  53. package/lib/Signal/Group/sender-key-state.d.ts +39 -0
  54. package/lib/Signal/Group/sender-key-state.d.ts.map +1 -0
  55. package/lib/Signal/Group/sender-key-state.js +84 -0
  56. package/lib/Signal/Group/sender-key-state.js.map +1 -0
  57. package/lib/Signal/Group/sender-message-key.d.ts +12 -0
  58. package/lib/Signal/Group/sender-message-key.d.ts.map +1 -0
  59. package/lib/Signal/Group/sender-message-key.js +26 -0
  60. package/lib/Signal/Group/sender-message-key.js.map +1 -0
  61. package/lib/Signal/libsignal.d.ts +5 -0
  62. package/lib/Signal/libsignal.d.ts.map +1 -0
  63. package/lib/Signal/libsignal.js +342 -0
  64. package/lib/Signal/libsignal.js.map +1 -0
  65. package/lib/Signal/lid-mapping.d.ts +23 -0
  66. package/lib/Signal/lid-mapping.d.ts.map +1 -0
  67. package/lib/Signal/lid-mapping.js +171 -0
  68. package/lib/Signal/lid-mapping.js.map +1 -0
  69. package/lib/Socket/Client/index.d.ts +3 -0
  70. package/lib/Socket/Client/index.d.ts.map +1 -0
  71. package/lib/Socket/Client/index.js +3 -0
  72. package/lib/Socket/Client/index.js.map +1 -0
  73. package/lib/Socket/Client/types.d.ts +16 -0
  74. package/lib/Socket/Client/types.d.ts.map +1 -0
  75. package/lib/Socket/Client/types.js +11 -0
  76. package/lib/Socket/Client/types.js.map +1 -0
  77. package/lib/Socket/Client/websocket.d.ts +13 -0
  78. package/lib/Socket/Client/websocket.d.ts.map +1 -0
  79. package/lib/Socket/Client/websocket.js +50 -0
  80. package/lib/Socket/Client/websocket.js.map +1 -0
  81. package/lib/Socket/business.d.ts +190 -0
  82. package/lib/Socket/business.d.ts.map +1 -0
  83. package/lib/Socket/business.js +376 -0
  84. package/lib/Socket/business.js.map +1 -0
  85. package/lib/Socket/chats.d.ts +100 -0
  86. package/lib/Socket/chats.d.ts.map +1 -0
  87. package/lib/Socket/chats.js +964 -0
  88. package/lib/Socket/chats.js.map +1 -0
  89. package/lib/Socket/communities.d.ts +246 -0
  90. package/lib/Socket/communities.d.ts.map +1 -0
  91. package/lib/Socket/communities.js +431 -0
  92. package/lib/Socket/communities.js.map +1 -0
  93. package/lib/Socket/groups.d.ts +139 -0
  94. package/lib/Socket/groups.d.ts.map +1 -0
  95. package/lib/Socket/groups.js +327 -0
  96. package/lib/Socket/groups.js.map +1 -0
  97. package/lib/Socket/index.d.ts +233 -0
  98. package/lib/Socket/index.d.ts.map +1 -0
  99. package/lib/Socket/index.js +18 -0
  100. package/lib/Socket/index.js.map +1 -0
  101. package/lib/Socket/messages-recv.d.ts +175 -0
  102. package/lib/Socket/messages-recv.d.ts.map +1 -0
  103. package/lib/Socket/messages-recv.js +1292 -0
  104. package/lib/Socket/messages-recv.js.map +1 -0
  105. package/lib/Socket/messages-send.d.ts +171 -0
  106. package/lib/Socket/messages-send.d.ts.map +1 -0
  107. package/lib/Socket/messages-send.js +1292 -0
  108. package/lib/Socket/messages-send.js.map +1 -0
  109. package/lib/Socket/mex.d.ts +3 -0
  110. package/lib/Socket/mex.d.ts.map +1 -0
  111. package/lib/Socket/mex.js +42 -0
  112. package/lib/Socket/mex.js.map +1 -0
  113. package/lib/Socket/newsletter.d.ts +149 -0
  114. package/lib/Socket/newsletter.d.ts.map +1 -0
  115. package/lib/Socket/newsletter.js +181 -0
  116. package/lib/Socket/newsletter.js.map +1 -0
  117. package/lib/Socket/socket.d.ts +53 -0
  118. package/lib/Socket/socket.d.ts.map +1 -0
  119. package/lib/Socket/socket.js +900 -0
  120. package/lib/Socket/socket.js.map +1 -0
  121. package/lib/Types/Auth.d.ts +115 -0
  122. package/lib/Types/Auth.d.ts.map +1 -0
  123. package/lib/Types/Auth.js +2 -0
  124. package/lib/Types/Auth.js.map +1 -0
  125. package/lib/Types/Bussines.d.ts +25 -0
  126. package/lib/Types/Bussines.d.ts.map +1 -0
  127. package/lib/Types/Bussines.js +2 -0
  128. package/lib/Types/Bussines.js.map +1 -0
  129. package/lib/Types/Call.d.ts +14 -0
  130. package/lib/Types/Call.d.ts.map +1 -0
  131. package/lib/Types/Call.js +2 -0
  132. package/lib/Types/Call.js.map +1 -0
  133. package/lib/Types/Chat.d.ts +123 -0
  134. package/lib/Types/Chat.d.ts.map +1 -0
  135. package/lib/Types/Chat.js +8 -0
  136. package/lib/Types/Chat.js.map +1 -0
  137. package/lib/Types/Contact.d.ts +24 -0
  138. package/lib/Types/Contact.d.ts.map +1 -0
  139. package/lib/Types/Contact.js +2 -0
  140. package/lib/Types/Contact.js.map +1 -0
  141. package/lib/Types/Events.d.ts +202 -0
  142. package/lib/Types/Events.d.ts.map +1 -0
  143. package/lib/Types/Events.js +2 -0
  144. package/lib/Types/Events.js.map +1 -0
  145. package/lib/Types/GroupMetadata.d.ts +67 -0
  146. package/lib/Types/GroupMetadata.d.ts.map +1 -0
  147. package/lib/Types/GroupMetadata.js +2 -0
  148. package/lib/Types/GroupMetadata.js.map +1 -0
  149. package/lib/Types/Label.d.ts +47 -0
  150. package/lib/Types/Label.d.ts.map +1 -0
  151. package/lib/Types/Label.js +25 -0
  152. package/lib/Types/Label.js.map +1 -0
  153. package/lib/Types/LabelAssociation.d.ts +30 -0
  154. package/lib/Types/LabelAssociation.d.ts.map +1 -0
  155. package/lib/Types/LabelAssociation.js +7 -0
  156. package/lib/Types/LabelAssociation.js.map +1 -0
  157. package/lib/Types/Message.d.ts +342 -0
  158. package/lib/Types/Message.d.ts.map +1 -0
  159. package/lib/Types/Message.js +11 -0
  160. package/lib/Types/Message.js.map +1 -0
  161. package/lib/Types/Newsletter.d.ts +135 -0
  162. package/lib/Types/Newsletter.d.ts.map +1 -0
  163. package/lib/Types/Newsletter.js +31 -0
  164. package/lib/Types/Newsletter.js.map +1 -0
  165. package/lib/Types/Product.d.ts +79 -0
  166. package/lib/Types/Product.d.ts.map +1 -0
  167. package/lib/Types/Product.js +2 -0
  168. package/lib/Types/Product.js.map +1 -0
  169. package/lib/Types/Signal.d.ts +76 -0
  170. package/lib/Types/Signal.d.ts.map +1 -0
  171. package/lib/Types/Signal.js +2 -0
  172. package/lib/Types/Signal.js.map +1 -0
  173. package/lib/Types/Socket.d.ts +133 -0
  174. package/lib/Types/Socket.d.ts.map +1 -0
  175. package/lib/Types/Socket.js +3 -0
  176. package/lib/Types/Socket.js.map +1 -0
  177. package/lib/Types/State.d.ts +39 -0
  178. package/lib/Types/State.d.ts.map +1 -0
  179. package/lib/Types/State.js +13 -0
  180. package/lib/Types/State.js.map +1 -0
  181. package/lib/Types/USync.d.ts +26 -0
  182. package/lib/Types/USync.d.ts.map +1 -0
  183. package/lib/Types/USync.js +2 -0
  184. package/lib/Types/USync.js.map +1 -0
  185. package/lib/Types/index.d.ts +65 -0
  186. package/lib/Types/index.d.ts.map +1 -0
  187. package/lib/Types/index.js +26 -0
  188. package/lib/Types/index.js.map +1 -0
  189. package/lib/Utils/auth-utils.d.ts +19 -0
  190. package/lib/Utils/auth-utils.d.ts.map +1 -0
  191. package/lib/Utils/auth-utils.js +257 -0
  192. package/lib/Utils/auth-utils.js.map +1 -0
  193. package/lib/Utils/browser-utils.d.ts +4 -0
  194. package/lib/Utils/browser-utils.d.ts.map +1 -0
  195. package/lib/Utils/browser-utils.js +28 -0
  196. package/lib/Utils/browser-utils.js.map +1 -0
  197. package/lib/Utils/business.d.ts +23 -0
  198. package/lib/Utils/business.d.ts.map +1 -0
  199. package/lib/Utils/business.js +231 -0
  200. package/lib/Utils/business.js.map +1 -0
  201. package/lib/Utils/chat-utils.d.ts +70 -0
  202. package/lib/Utils/chat-utils.d.ts.map +1 -0
  203. package/lib/Utils/chat-utils.js +763 -0
  204. package/lib/Utils/chat-utils.js.map +1 -0
  205. package/lib/Utils/crypto.d.ts +41 -0
  206. package/lib/Utils/crypto.d.ts.map +1 -0
  207. package/lib/Utils/crypto.js +142 -0
  208. package/lib/Utils/crypto.js.map +1 -0
  209. package/lib/Utils/decode-wa-message.d.ts +48 -0
  210. package/lib/Utils/decode-wa-message.d.ts.map +1 -0
  211. package/lib/Utils/decode-wa-message.js +283 -0
  212. package/lib/Utils/decode-wa-message.js.map +1 -0
  213. package/lib/Utils/event-buffer.d.ts +34 -0
  214. package/lib/Utils/event-buffer.d.ts.map +1 -0
  215. package/lib/Utils/event-buffer.js +548 -0
  216. package/lib/Utils/event-buffer.js.map +1 -0
  217. package/lib/Utils/generics.d.ts +90 -0
  218. package/lib/Utils/generics.d.ts.map +1 -0
  219. package/lib/Utils/generics.js +381 -0
  220. package/lib/Utils/generics.js.map +1 -0
  221. package/lib/Utils/history.d.ts +19 -0
  222. package/lib/Utils/history.d.ts.map +1 -0
  223. package/lib/Utils/history.js +90 -0
  224. package/lib/Utils/history.js.map +1 -0
  225. package/lib/Utils/index.d.ts +19 -0
  226. package/lib/Utils/index.d.ts.map +1 -0
  227. package/lib/Utils/index.js +19 -0
  228. package/lib/Utils/index.js.map +1 -0
  229. package/lib/Utils/link-preview.d.ts +21 -0
  230. package/lib/Utils/link-preview.d.ts.map +1 -0
  231. package/lib/Utils/link-preview.js +85 -0
  232. package/lib/Utils/link-preview.js.map +1 -0
  233. package/lib/Utils/logger.d.ts +12 -0
  234. package/lib/Utils/logger.d.ts.map +1 -0
  235. package/lib/Utils/logger.js +3 -0
  236. package/lib/Utils/logger.js.map +1 -0
  237. package/lib/Utils/lt-hash.d.ts +13 -0
  238. package/lib/Utils/lt-hash.d.ts.map +1 -0
  239. package/lib/Utils/lt-hash.js +48 -0
  240. package/lib/Utils/lt-hash.js.map +1 -0
  241. package/lib/Utils/make-mutex.d.ts +8 -0
  242. package/lib/Utils/make-mutex.d.ts.map +1 -0
  243. package/lib/Utils/make-mutex.js +40 -0
  244. package/lib/Utils/make-mutex.js.map +1 -0
  245. package/lib/Utils/message-retry-manager.d.ts +82 -0
  246. package/lib/Utils/message-retry-manager.d.ts.map +1 -0
  247. package/lib/Utils/message-retry-manager.js +172 -0
  248. package/lib/Utils/message-retry-manager.js.map +1 -0
  249. package/lib/Utils/messages-media.d.ts +114 -0
  250. package/lib/Utils/messages-media.d.ts.map +1 -0
  251. package/lib/Utils/messages-media.js +667 -0
  252. package/lib/Utils/messages-media.js.map +1 -0
  253. package/lib/Utils/messages.d.ts +89 -0
  254. package/lib/Utils/messages.d.ts.map +1 -0
  255. package/lib/Utils/messages.js +1132 -0
  256. package/lib/Utils/messages.js.map +1 -0
  257. package/lib/Utils/noise-handler.d.ts +20 -0
  258. package/lib/Utils/noise-handler.d.ts.map +1 -0
  259. package/lib/Utils/noise-handler.js +147 -0
  260. package/lib/Utils/noise-handler.js.map +1 -0
  261. package/lib/Utils/pre-key-manager.d.ts +28 -0
  262. package/lib/Utils/pre-key-manager.d.ts.map +1 -0
  263. package/lib/Utils/pre-key-manager.js +106 -0
  264. package/lib/Utils/pre-key-manager.js.map +1 -0
  265. package/lib/Utils/process-message.d.ts +60 -0
  266. package/lib/Utils/process-message.d.ts.map +1 -0
  267. package/lib/Utils/process-message.js +485 -0
  268. package/lib/Utils/process-message.js.map +1 -0
  269. package/lib/Utils/signal.d.ts +34 -0
  270. package/lib/Utils/signal.d.ts.map +1 -0
  271. package/lib/Utils/signal.js +159 -0
  272. package/lib/Utils/signal.js.map +1 -0
  273. package/lib/Utils/use-multi-file-auth-state.d.ts +13 -0
  274. package/lib/Utils/use-multi-file-auth-state.d.ts.map +1 -0
  275. package/lib/Utils/use-multi-file-auth-state.js +121 -0
  276. package/lib/Utils/use-multi-file-auth-state.js.map +1 -0
  277. package/lib/Utils/validate-connection.d.ts +11 -0
  278. package/lib/Utils/validate-connection.d.ts.map +1 -0
  279. package/lib/Utils/validate-connection.js +200 -0
  280. package/lib/Utils/validate-connection.js.map +1 -0
  281. package/lib/WABinary/constants.d.ts +28 -0
  282. package/lib/WABinary/constants.d.ts.map +1 -0
  283. package/lib/WABinary/constants.js +1301 -0
  284. package/lib/WABinary/constants.js.map +1 -0
  285. package/lib/WABinary/decode.d.ts +7 -0
  286. package/lib/WABinary/decode.d.ts.map +1 -0
  287. package/lib/WABinary/decode.js +238 -0
  288. package/lib/WABinary/decode.js.map +1 -0
  289. package/lib/WABinary/encode.d.ts +3 -0
  290. package/lib/WABinary/encode.d.ts.map +1 -0
  291. package/lib/WABinary/encode.js +216 -0
  292. package/lib/WABinary/encode.js.map +1 -0
  293. package/lib/WABinary/generic-utils.d.ts +17 -0
  294. package/lib/WABinary/generic-utils.d.ts.map +1 -0
  295. package/lib/WABinary/generic-utils.js +233 -0
  296. package/lib/WABinary/generic-utils.js.map +1 -0
  297. package/lib/WABinary/index.d.ts +6 -0
  298. package/lib/WABinary/index.d.ts.map +1 -0
  299. package/lib/WABinary/index.js +6 -0
  300. package/lib/WABinary/index.js.map +1 -0
  301. package/lib/WABinary/jid-utils.d.ts +48 -0
  302. package/lib/WABinary/jid-utils.d.ts.map +1 -0
  303. package/lib/WABinary/jid-utils.js +96 -0
  304. package/lib/WABinary/jid-utils.js.map +1 -0
  305. package/lib/WABinary/types.d.ts +19 -0
  306. package/lib/WABinary/types.d.ts.map +1 -0
  307. package/lib/WABinary/types.js +2 -0
  308. package/lib/WABinary/types.js.map +1 -0
  309. package/lib/WAM/BinaryInfo.d.ts +9 -0
  310. package/lib/WAM/BinaryInfo.d.ts.map +1 -0
  311. package/lib/WAM/BinaryInfo.js +10 -0
  312. package/lib/WAM/BinaryInfo.js.map +1 -0
  313. package/lib/WAM/constants.d.ts +40 -0
  314. package/lib/WAM/constants.d.ts.map +1 -0
  315. package/lib/WAM/constants.js +22853 -0
  316. package/lib/WAM/constants.js.map +1 -0
  317. package/lib/WAM/encode.d.ts +3 -0
  318. package/lib/WAM/encode.d.ts.map +1 -0
  319. package/lib/WAM/encode.js +150 -0
  320. package/lib/WAM/encode.js.map +1 -0
  321. package/lib/WAM/index.d.ts +4 -0
  322. package/lib/WAM/index.d.ts.map +1 -0
  323. package/lib/WAM/index.js +4 -0
  324. package/lib/WAM/index.js.map +1 -0
  325. package/lib/WAUSync/Protocols/USyncContactProtocol.d.ts +10 -0
  326. package/lib/WAUSync/Protocols/USyncContactProtocol.d.ts.map +1 -0
  327. package/lib/WAUSync/Protocols/USyncContactProtocol.js +29 -0
  328. package/lib/WAUSync/Protocols/USyncContactProtocol.js.map +1 -0
  329. package/lib/WAUSync/Protocols/USyncDeviceProtocol.d.ts +23 -0
  330. package/lib/WAUSync/Protocols/USyncDeviceProtocol.d.ts.map +1 -0
  331. package/lib/WAUSync/Protocols/USyncDeviceProtocol.js +54 -0
  332. package/lib/WAUSync/Protocols/USyncDeviceProtocol.js.map +1 -0
  333. package/lib/WAUSync/Protocols/USyncDisappearingModeProtocol.d.ts +13 -0
  334. package/lib/WAUSync/Protocols/USyncDisappearingModeProtocol.d.ts.map +1 -0
  335. package/lib/WAUSync/Protocols/USyncDisappearingModeProtocol.js +27 -0
  336. package/lib/WAUSync/Protocols/USyncDisappearingModeProtocol.js.map +1 -0
  337. package/lib/WAUSync/Protocols/USyncStatusProtocol.d.ts +13 -0
  338. package/lib/WAUSync/Protocols/USyncStatusProtocol.d.ts.map +1 -0
  339. package/lib/WAUSync/Protocols/USyncStatusProtocol.js +38 -0
  340. package/lib/WAUSync/Protocols/USyncStatusProtocol.js.map +1 -0
  341. package/lib/WAUSync/Protocols/UsyncBotProfileProtocol.d.ts +26 -0
  342. package/lib/WAUSync/Protocols/UsyncBotProfileProtocol.d.ts.map +1 -0
  343. package/lib/WAUSync/Protocols/UsyncBotProfileProtocol.js +51 -0
  344. package/lib/WAUSync/Protocols/UsyncBotProfileProtocol.js.map +1 -0
  345. package/lib/WAUSync/Protocols/UsyncLIDProtocol.d.ts +10 -0
  346. package/lib/WAUSync/Protocols/UsyncLIDProtocol.d.ts.map +1 -0
  347. package/lib/WAUSync/Protocols/UsyncLIDProtocol.js +29 -0
  348. package/lib/WAUSync/Protocols/UsyncLIDProtocol.js.map +1 -0
  349. package/lib/WAUSync/Protocols/index.d.ts +5 -0
  350. package/lib/WAUSync/Protocols/index.d.ts.map +1 -0
  351. package/lib/WAUSync/Protocols/index.js +5 -0
  352. package/lib/WAUSync/Protocols/index.js.map +1 -0
  353. package/lib/WAUSync/USyncQuery.d.ts +29 -0
  354. package/lib/WAUSync/USyncQuery.d.ts.map +1 -0
  355. package/lib/WAUSync/USyncQuery.js +94 -0
  356. package/lib/WAUSync/USyncQuery.js.map +1 -0
  357. package/lib/WAUSync/USyncUser.d.ts +13 -0
  358. package/lib/WAUSync/USyncUser.d.ts.map +1 -0
  359. package/lib/WAUSync/USyncUser.js +23 -0
  360. package/lib/WAUSync/USyncUser.js.map +1 -0
  361. package/lib/WAUSync/index.d.ts +4 -0
  362. package/lib/WAUSync/index.d.ts.map +1 -0
  363. package/lib/WAUSync/index.js +4 -0
  364. package/lib/WAUSync/index.js.map +1 -0
  365. package/lib/index.d.ts +12 -0
  366. package/lib/index.d.ts.map +1 -0
  367. package/lib/index.js +11 -0
  368. package/lib/index.js.map +1 -0
  369. package/package.json +119 -0
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2025 Rajeh Taher/WhiskeySockets
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,405 @@
1
+ # shura-baileys
2
+
3
+ `shura-baileys` is a maintained fork of `@whiskeysockets/baileys`, modified for the shurainc bot. The goal is stable production flows, practical copy-paste examples, and a few extra helper message types while staying close to the upstream API.
4
+
5
+ **Update channel (changelog and notices)**
6
+ - All updates, behavior changes, and breaking changes are posted here: https://whatsapp.com/channel/0029Vb8IWc3FSAsy4xaX991n
7
+
8
+
9
+ ## Install
10
+
11
+ This repo is published as an NPM alias for `@whiskeysockets/baileys`.
12
+
13
+ # `package.json`
14
+
15
+ ```json
16
+ @whiskeysockets/baileys
17
+ "dependencies": {
18
+ "@whiskeysockets/baileys": "npm:shurainc/baileys"
19
+ }
20
+ ```
21
+
22
+ ## Custom pairing code
23
+
24
+ ```js
25
+ const code = await sock.requestPairingCode('628xxx', 'SHURAINC');
26
+ console.log('Your pairing code:', code);
27
+ ```
28
+
29
+ ## Getting started
30
+
31
+ Below are practical `sock.sendMessage()` examples you can copy into your bot. this fork also includes a few extra helper message types (like `albumMessage`, `eventMessage`, `pollResultMessage`, and `groupStatusMessage`) to match shurainc production flows while keeping the upstream Baileys API familiar.
32
+
33
+
34
+ ### Status group message V2
35
+ Send group status with version 2
36
+
37
+ ```javascript
38
+ await sock.sendMessage(jid, {
39
+ groupStatusMessage: {
40
+ text: "shurainc baileys"
41
+ }
42
+ });
43
+ ```
44
+
45
+ ### Album message (multiple Images)
46
+ Send multiple images in a single album message:
47
+
48
+ ```javascript
49
+ await sock.sendMessage(jid, {
50
+ albumMessage: [
51
+ { image: { url: "https://example.com/image1.jpg" }, caption: "image 1" },
52
+ { image: { url: "https://example.com/image2.jpg" }, caption: "image 2" }
53
+ ]
54
+ }, { quoted: m });
55
+ ```
56
+
57
+ ### Event message
58
+ Create and send WhatsApp event invitations:
59
+
60
+ ```javascript
61
+ await sock.sendMessage(jid, {
62
+ eventMessage: {
63
+ isCanceled: false,
64
+ name: "hello",
65
+ description: "hello",
66
+ location: {
67
+ degreesLatitude: 0,
68
+ degreesLongitude: 0,
69
+ name: "shurainc baileys"
70
+ },
71
+ joinLink: "https://call.whatsapp.com/video/shurainc",
72
+ startTime: "1763019000",
73
+ endTime: "1763026200",
74
+ extraGuestsAllowed: false
75
+ }
76
+ }, { quoted: m });
77
+ ```
78
+
79
+ ### Poll result message
80
+ Display poll results with vote counts:
81
+
82
+ ```javascript
83
+ await sock.sendMessage(jid, {
84
+ pollResultMessage: {
85
+ name: "Where are you from?",
86
+ pollVotes: [
87
+ {
88
+ optionName: "🇮🇩",
89
+ optionVoteCount: "25000"
90
+ },
91
+ {
92
+ optionName: "🇷🇺",
93
+ optionVoteCount: "20000"
94
+ }
95
+ ]
96
+ }
97
+ }, { quoted: m });
98
+ ```
99
+
100
+ ### Location message
101
+ Send a location message with an interactive quick reply button:
102
+
103
+ ```javascript
104
+ await sock.sendMessage(jid, {
105
+ location: {
106
+ degreesLatitude: 0,
107
+ degreesLongitude: 0,
108
+ name: 'shurainc baileys',
109
+ },
110
+ caption: 'hello',
111
+ title: 'hello',
112
+ footer: 'shuraincbaileys',
113
+ interactiveButtons: [
114
+ {
115
+ name: 'quick_reply',
116
+ buttonParamsJson: JSON.stringify({
117
+ display_text: 'hello',
118
+ id: '.hello',
119
+ }),
120
+ },
121
+ ],
122
+ hasMediaAttachment: false, // or true
123
+ });
124
+ ```
125
+
126
+ ### Buttons message
127
+ Send a basic buttons message (2 quick reply buttons):
128
+
129
+ ```javascript
130
+ await sock.sendMessage(jid, {
131
+ text: 'hello',
132
+ footer: 'shuraincbaileys',
133
+ buttons: [
134
+ { buttonId: '.btn1', buttonText: { displayText: 'button 1' } },
135
+ { buttonId: '.btn2', buttonText: { displayText: 'button 2' } },
136
+ ],
137
+ });
138
+ ```
139
+
140
+ ### Buttons message with media header
141
+ Send a buttons message with an image header:
142
+
143
+ ```javascript
144
+ await sock.sendMessage(jid, {
145
+ image: { url: 'https://example.com/image.jpg' },
146
+ caption: 'hello',
147
+ footer: 'shuraincbaileys',
148
+ buttons: [
149
+ { buttonId: '.btn1', buttonText: { displayText: 'button 1' } },
150
+ { buttonId: '.btn2', buttonText: { displayText: 'button 2' } },
151
+ ],
152
+ });
153
+ ```
154
+
155
+ ### List message (sections)
156
+ Send a list message with sections and rows:
157
+
158
+ ```javascript
159
+ await sock.sendMessage(jid, {
160
+ text: 'hello',
161
+ footer: 'shuraincbaileys',
162
+ buttonText: 'hello',
163
+ title: 'hello',
164
+ sections: [
165
+ {
166
+ title: 'shurainc baileys',
167
+ rows: [
168
+ { title: 'hello', rowId: '.rowId1', description: 'shurainc baileys' },
169
+ { title: 'hello', rowId: '.rowId2', description: 'shurainc baileys' },
170
+ ],
171
+ },
172
+ ],
173
+ });
174
+ ```
175
+
176
+ ### Simple interactive message
177
+ Send basic interactive messages with copy button functionality:
178
+
179
+ ```javascript
180
+ await sock.sendMessage(jid, {
181
+ interactiveMessage: {
182
+ header: "hello",
183
+ title: "hello",
184
+ footer: "shuraincbaileys",
185
+ buttons: [
186
+ {
187
+ name: "cta_copy",
188
+ buttonParamsJson: JSON.stringify({
189
+ display_text: "copy code",
190
+ id: "123",
191
+ copy_code: "123"
192
+ })
193
+ }
194
+ ]
195
+ }
196
+ }, { quoted: m });
197
+ ```
198
+
199
+ ### Interactive Message with Native Flow
200
+ Send interactive messages with buttons, copy actions, and native flow features:
201
+
202
+ ```javascript
203
+ await sock.sendMessage(jid, {
204
+ interactiveMessage: {
205
+ header: "hello",
206
+ title: "hello",
207
+ footer: "shuraincbaileys",
208
+ image: { url: "https://example.com/image.jpg" },
209
+ nativeFlowMessage: {
210
+ messageParamsJson: JSON.stringify({
211
+ limited_time_offer: {
212
+ text: "hello",
213
+ url: "https://whatsapp.com/channel/0029Vb8IWc3FSAsy4xaX991n",
214
+ copy_code: "shuraincbaileys",
215
+ expiration_time: Date.now() * 999
216
+ },
217
+ bottom_sheet: {
218
+ in_thread_buttons_limit: 2,
219
+ divider_indices: [1, 2, 3, 4, 5, 999],
220
+ list_title: "hello",
221
+ button_title: "hello"
222
+ },
223
+ tap_target_configuration: {
224
+ title: "hello",
225
+ description: "shuraincbaileys",
226
+ canonical_url: "https://whatsapp.com/channel/0029Vb8IWc3FSAsy4xaX991n",
227
+ domain: "shop.example.com",
228
+ button_index: 0
229
+ }
230
+ }),
231
+ buttons: [
232
+ {
233
+ name: "single_select",
234
+ buttonParamsJson: JSON.stringify({
235
+ has_multiple_buttons: true
236
+ })
237
+ },
238
+ {
239
+ name: "call_permission_request",
240
+ buttonParamsJson: JSON.stringify({
241
+ has_multiple_buttons: true
242
+ })
243
+ },
244
+ {
245
+ name: "single_select",
246
+ buttonParamsJson: JSON.stringify({
247
+ title: "hello",
248
+ sections: [
249
+ {
250
+ title: "hello",
251
+ highlight_label: "shuraincbaileys",
252
+ rows: [
253
+ {
254
+ title: "shuraincbaileys",
255
+ description: "shurainc baileys",
256
+ id: "row_2"
257
+ }
258
+ ]
259
+ }
260
+ ],
261
+ has_multiple_buttons: true
262
+ })
263
+ },
264
+ {
265
+ name: "cta_copy",
266
+ buttonParamsJson: JSON.stringify({
267
+ display_text: "copy code",
268
+ id: "123",
269
+ copy_code: "123"
270
+ })
271
+ }
272
+ ]
273
+ }
274
+ }
275
+ }, { quoted: m });
276
+ ```
277
+
278
+ ### Interactive message with thumbnail
279
+ Send interactive messages with thumbnail image and copy button:
280
+
281
+ ```javascript
282
+ await sock.sendMessage(jid, {
283
+ interactiveMessage: {
284
+ header: "hello",
285
+ title: "hello",
286
+ footer: "shuraincbaileys",
287
+ image: { url: "https://example.com/image.jpg" },
288
+ buttons: [
289
+ {
290
+ name: "cta_copy",
291
+ buttonParamsJson: JSON.stringify({
292
+ display_text: "copy code",
293
+ id: "123",
294
+ copy_code: "123"
295
+ })
296
+ }
297
+ ]
298
+ }
299
+ }, { quoted: m });
300
+ ```
301
+
302
+ ### Product message
303
+ Send product catalog messages with buttons and merchant information:
304
+
305
+ ```javascript
306
+ await sock.sendMessage(jid, {
307
+ productMessage: {
308
+ title: "sample products",
309
+ description: "product description",
310
+ thumbnail: { url: "https://example.com/image.jpg" },
311
+ productId: "P12345",
312
+ retailerId: "R12345",
313
+ url: "https://example.com/product",
314
+ body: "product details",
315
+ footer: "special price",
316
+ priceAmount1000: 30000,
317
+ currencyCode: "USD",
318
+ buttons: [
319
+ {
320
+ name: "cta_url",
321
+ buttonParamsJson: JSON.stringify({
322
+ display_text: "buy now",
323
+ url: "https://example.com/buy"
324
+ })
325
+ }
326
+ ]
327
+ }
328
+ }, { quoted: m });
329
+ ```
330
+
331
+
332
+
333
+ ## Groups (usage)
334
+
335
+ ```js
336
+ // create group
337
+ const group = await sock.groupCreate('My Group', ['628xxx@s.whatsapp.net']);
338
+
339
+ // fetch metadata
340
+ const meta = await sock.groupMetadata(group.id);
341
+
342
+ // update subject/description
343
+ await sock.groupUpdateSubject(group.id, 'My Group v2');
344
+ await sock.groupUpdateDescription(group.id, 'group description');
345
+
346
+ // participants
347
+ await sock.groupParticipantsUpdate(group.id, ['628xxx@s.whatsapp.net'], 'add');
348
+ await sock.groupParticipantsUpdate(group.id, ['628xxx@s.whatsapp.net'], 'remove');
349
+
350
+ // join requests
351
+ const requests = await sock.groupRequestParticipantsList(group.id);
352
+ // approve/reject by jid from the list
353
+ // await sock.groupRequestParticipantsUpdate(group.id, [requests[0]?.jid], 'approve');
354
+
355
+ // invite links
356
+ const inviteCode = await sock.groupInviteCode(group.id);
357
+ const inviteInfo = await sock.groupGetInviteInfo(inviteCode);
358
+ await sock.groupRevokeInvite(group.id);
359
+
360
+ // settings
361
+ await sock.groupToggleEphemeral(group.id, 86400);
362
+ await sock.groupSettingUpdate(group.id, 'announcement');
363
+ await sock.groupMemberAddMode(group.id, 'all_member_add');
364
+ await sock.groupJoinApprovalMode(group.id, 'on');
365
+
366
+ // list & leave
367
+ const allGroups = await sock.groupFetchAllParticipating();
368
+ await sock.groupLeave(group.id);
369
+ ```
370
+
371
+ ## Newsletter (channel) usage
372
+
373
+ ```js
374
+ // create newsletter
375
+ const created = await sock.newsletterCreate('shura updates', 'baileys updates');
376
+
377
+ // update metadata
378
+ await sock.newsletterUpdateName(channelJid, 'shura updates');
379
+ await sock.newsletterUpdateDescription(channelJid, 'baileys updates');
380
+ await sock.newsletterUpdatePicture(channelJid, fs.readFileSync('./image.png'));
381
+ await sock.newsletterRemovePicture(channelJid);
382
+
383
+ // metadata & subscribers
384
+ const metadata = await sock.newsletterMetadata('jid', channelJid);
385
+ const subs = await sock.newsletterSubscribers(channelJid);
386
+
387
+ // follow / mute
388
+ await sock.newsletterFollow(channelJid);
389
+ await sock.newsletterUnfollow(channelJid);
390
+ await sock.newsletterMute(channelJid);
391
+ await sock.newsletterUnmute(channelJid);
392
+
393
+ // react & fetch messages
394
+ await sock.newsletterReactMessage(channelJid, '300', '💙');
395
+ const messages = await sock.newsletterFetchMessages(channelJid, 20, 0, 0);
396
+ const live = await sock.subscribeNewsletterUpdates(channelJid);
397
+
398
+ // admin actions
399
+ const adminCount = await sock.newsletterAdminCount(channelJid);
400
+ await sock.newsletterChangeOwner(channelJid, '628xxx@s.whatsapp.net');
401
+ await sock.newsletterDemote(channelJid, '628xxx@s.whatsapp.net');
402
+
403
+ // delete
404
+ await sock.newsletterDelete(channelJid);
405
+ ```
@@ -0,0 +1,3 @@
1
+ yarn pbjs -t static-module --no-beautify -w es6 --no-bundle --no-delimited --no-verify --no-comments -o ./index.js ./WAProto.proto;
2
+ yarn pbjs -t static-module --no-beautify -w es6 --no-bundle --no-delimited --no-verify ./WAProto.proto | yarn pbts --no-comments -o ./index.d.ts -;
3
+ node ./fix-imports.js