@vanzxy/baileys 1.3.6 → 1.3.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 (335) hide show
  1. package/README.md +1 -1
  2. package/WAProto/index.d.ts +9 -15871
  3. package/lib/Defaults/index.d.ts +7 -5
  4. package/lib/Defaults/index.js +4 -1
  5. package/lib/Signal/Group/ciphertext-message.d.ts +0 -1
  6. package/lib/Signal/Group/group-session-builder.d.ts +0 -1
  7. package/lib/Signal/Group/group_cipher.d.ts +0 -1
  8. package/lib/Signal/Group/index.d.ts +0 -1
  9. package/lib/Signal/Group/keyhelper.d.ts +0 -1
  10. package/lib/Signal/Group/sender-chain-key.d.ts +0 -1
  11. package/lib/Signal/Group/sender-key-distribution-message.d.ts +0 -1
  12. package/lib/Signal/Group/sender-key-message.d.ts +0 -1
  13. package/lib/Signal/Group/sender-key-name.d.ts +0 -1
  14. package/lib/Signal/Group/sender-key-record.d.ts +0 -1
  15. package/lib/Signal/Group/sender-key-state.d.ts +0 -1
  16. package/lib/Signal/Group/sender-message-key.d.ts +0 -1
  17. package/lib/Signal/libsignal.d.ts +0 -1
  18. package/lib/Signal/lid-mapping.d.ts +0 -1
  19. package/lib/Socket/Client/index.d.ts +0 -1
  20. package/lib/Socket/Client/types.d.ts +0 -1
  21. package/lib/Socket/Client/websocket.d.ts +0 -1
  22. package/lib/Socket/business.d.ts +7 -7
  23. package/lib/Socket/chats.d.ts +0 -1
  24. package/lib/Socket/communities.d.ts +7 -8
  25. package/lib/Socket/communities.js +4 -2
  26. package/lib/Socket/dugong.d.ts +117 -0
  27. package/lib/Socket/dugong.js +26 -1
  28. package/lib/Socket/groups.d.ts +1 -2
  29. package/lib/Socket/index.d.ts +7 -6
  30. package/lib/Socket/messages-recv.d.ts +7 -8
  31. package/lib/Socket/messages-send.d.ts +6 -7
  32. package/lib/Socket/mex.d.ts +0 -1
  33. package/lib/Socket/newsletter.d.ts +3 -5
  34. package/lib/Socket/newsletter.js +19 -19
  35. package/lib/Socket/socket.d.ts +0 -1
  36. package/lib/Store/index.d.ts +0 -1
  37. package/lib/Store/make-in-memory-store.d.ts +0 -1
  38. package/lib/Store/make-ordered-dictionary.d.ts +0 -1
  39. package/lib/Store/object-repository.d.ts +0 -1
  40. package/lib/Types/Auth.d.ts +115 -0
  41. package/lib/Types/Bussines.d.ts +24 -1
  42. package/lib/Types/Call.d.ts +14 -1
  43. package/lib/Types/Chat.d.ts +123 -1
  44. package/lib/Types/Contact.d.ts +25 -1
  45. package/lib/Types/Events.d.ts +255 -1
  46. package/lib/Types/GroupMetadata.d.ts +70 -1
  47. package/lib/Types/Label.d.ts +0 -1
  48. package/lib/Types/LabelAssociation.d.ts +0 -1
  49. package/lib/Types/Message.d.ts +8 -9
  50. package/lib/Types/Mex.d.ts +0 -1
  51. package/lib/Types/Product.d.ts +78 -1
  52. package/lib/Types/RichType.d.ts +0 -1
  53. package/lib/Types/Signal.d.ts +85 -0
  54. package/lib/Types/Socket.d.ts +135 -1
  55. package/lib/Types/State.d.ts +0 -1
  56. package/lib/Types/USync.d.ts +25 -1
  57. package/lib/Types/index.d.ts +65 -13
  58. package/lib/Utils/auth-utils.d.ts +0 -1
  59. package/lib/Utils/browser-utils.d.ts +1 -2
  60. package/lib/Utils/business.d.ts +0 -1
  61. package/lib/Utils/business.js +2 -1
  62. package/lib/Utils/chat-utils.d.ts +15 -17
  63. package/lib/Utils/chat-utils.js +15 -1
  64. package/lib/Utils/companion-reg-client-utils.d.ts +0 -1
  65. package/lib/Utils/crypto.d.ts +2 -1
  66. package/lib/Utils/decode-wa-message.d.ts +0 -1
  67. package/lib/Utils/decode-wa-message.js +1 -3
  68. package/lib/Utils/event-buffer.d.ts +1 -2
  69. package/lib/Utils/generics.d.ts +0 -1
  70. package/lib/Utils/generics.js +11 -9
  71. package/lib/Utils/history.d.ts +17 -3
  72. package/lib/Utils/identity-change-handler.d.ts +0 -1
  73. package/lib/Utils/index.d.ts +0 -1
  74. package/lib/Utils/link-preview.d.ts +0 -1
  75. package/lib/Utils/logger.d.ts +0 -1
  76. package/lib/Utils/lt-hash.d.ts +7 -2
  77. package/lib/Utils/lt-hash.js +21 -2
  78. package/lib/Utils/make-mutex.d.ts +0 -1
  79. package/lib/Utils/message-retry-manager.d.ts +0 -1
  80. package/lib/Utils/messages-media.d.ts +2 -4
  81. package/lib/Utils/messages.d.ts +5 -7
  82. package/lib/Utils/messages.js +30 -26
  83. package/lib/Utils/noise-handler.d.ts +0 -1
  84. package/lib/Utils/offline-node-processor.d.ts +0 -1
  85. package/lib/Utils/pre-key-manager.d.ts +0 -1
  86. package/lib/Utils/process-message.d.ts +3 -5
  87. package/lib/Utils/reporting-utils.d.ts +0 -1
  88. package/lib/Utils/rich-message-utils.d.ts +1 -2
  89. package/lib/Utils/signal.d.ts +0 -1
  90. package/lib/Utils/stanza-ack.d.ts +0 -1
  91. package/lib/Utils/sync-action-utils.d.ts +0 -1
  92. package/lib/Utils/tc-token-utils.d.ts +0 -1
  93. package/lib/Utils/use-multi-file-auth-state.d.ts +0 -1
  94. package/lib/Utils/use-single-file-auth-state.d.ts +0 -1
  95. package/lib/Utils/use-single-file-auth-state.js +6 -1
  96. package/lib/Utils/use-sqlite-auth-state.d.ts +1 -1
  97. package/lib/Utils/use-sqlite-auth-state.js +12 -0
  98. package/lib/Utils/validate-connection.d.ts +4 -6
  99. package/lib/WABinary/constants.d.ts +0 -1
  100. package/lib/WABinary/decode.d.ts +0 -1
  101. package/lib/WABinary/encode.d.ts +0 -1
  102. package/lib/WABinary/generic-utils.d.ts +1 -4
  103. package/lib/WABinary/index.d.ts +0 -1
  104. package/lib/WABinary/jid-utils.d.ts +0 -1
  105. package/lib/WABinary/types.d.ts +18 -1
  106. package/lib/WAM/BinaryInfo.d.ts +0 -1
  107. package/lib/WAM/constants.d.ts +0 -1
  108. package/lib/WAM/encode.d.ts +0 -1
  109. package/lib/WAM/index.d.ts +0 -1
  110. package/lib/WAUSync/Protocols/USyncContactProtocol.d.ts +0 -1
  111. package/lib/WAUSync/Protocols/USyncDeviceProtocol.d.ts +8 -2
  112. package/lib/WAUSync/Protocols/USyncDisappearingModeProtocol.d.ts +0 -1
  113. package/lib/WAUSync/Protocols/USyncStatusProtocol.d.ts +0 -1
  114. package/lib/WAUSync/Protocols/USyncUsernameProtocol.d.ts +0 -1
  115. package/lib/WAUSync/Protocols/UsyncBotProfileProtocol.d.ts +0 -1
  116. package/lib/WAUSync/Protocols/UsyncLIDProtocol.d.ts +0 -1
  117. package/lib/WAUSync/Protocols/index.d.ts +2 -1
  118. package/lib/WAUSync/USyncQuery.d.ts +0 -1
  119. package/lib/WAUSync/USyncUser.d.ts +0 -1
  120. package/lib/WAUSync/index.d.ts +0 -1
  121. package/lib/index.d.ts +1 -1
  122. package/package.json +12 -7
  123. package/postinstall-banner.js +23 -0
  124. package/lib/Defaults/index.d.ts.map +0 -1
  125. package/lib/Defaults/index.js.map +0 -1
  126. package/lib/Signal/Group/ciphertext-message.d.ts.map +0 -1
  127. package/lib/Signal/Group/ciphertext-message.js.map +0 -1
  128. package/lib/Signal/Group/group-session-builder.d.ts.map +0 -1
  129. package/lib/Signal/Group/group-session-builder.js.map +0 -1
  130. package/lib/Signal/Group/group_cipher.d.ts.map +0 -1
  131. package/lib/Signal/Group/group_cipher.js.map +0 -1
  132. package/lib/Signal/Group/index.d.ts.map +0 -1
  133. package/lib/Signal/Group/index.js.map +0 -1
  134. package/lib/Signal/Group/keyhelper.d.ts.map +0 -1
  135. package/lib/Signal/Group/keyhelper.js.map +0 -1
  136. package/lib/Signal/Group/sender-chain-key.d.ts.map +0 -1
  137. package/lib/Signal/Group/sender-chain-key.js.map +0 -1
  138. package/lib/Signal/Group/sender-key-distribution-message.d.ts.map +0 -1
  139. package/lib/Signal/Group/sender-key-distribution-message.js.map +0 -1
  140. package/lib/Signal/Group/sender-key-message.d.ts.map +0 -1
  141. package/lib/Signal/Group/sender-key-message.js.map +0 -1
  142. package/lib/Signal/Group/sender-key-name.d.ts.map +0 -1
  143. package/lib/Signal/Group/sender-key-name.js.map +0 -1
  144. package/lib/Signal/Group/sender-key-record.d.ts.map +0 -1
  145. package/lib/Signal/Group/sender-key-record.js.map +0 -1
  146. package/lib/Signal/Group/sender-key-state.d.ts.map +0 -1
  147. package/lib/Signal/Group/sender-key-state.js.map +0 -1
  148. package/lib/Signal/Group/sender-message-key.d.ts.map +0 -1
  149. package/lib/Signal/Group/sender-message-key.js.map +0 -1
  150. package/lib/Signal/libsignal.d.ts.map +0 -1
  151. package/lib/Signal/libsignal.js.map +0 -1
  152. package/lib/Signal/lid-mapping.d.ts.map +0 -1
  153. package/lib/Signal/lid-mapping.js.map +0 -1
  154. package/lib/Socket/Client/index.d.ts.map +0 -1
  155. package/lib/Socket/Client/index.js.map +0 -1
  156. package/lib/Socket/Client/types.d.ts.map +0 -1
  157. package/lib/Socket/Client/types.js.map +0 -1
  158. package/lib/Socket/Client/websocket.d.ts.map +0 -1
  159. package/lib/Socket/Client/websocket.js.map +0 -1
  160. package/lib/Socket/business.d.ts.map +0 -1
  161. package/lib/Socket/business.js.map +0 -1
  162. package/lib/Socket/chats.d.ts.map +0 -1
  163. package/lib/Socket/chats.js.map +0 -1
  164. package/lib/Socket/communities.d.ts.map +0 -1
  165. package/lib/Socket/communities.js.map +0 -1
  166. package/lib/Socket/groups.d.ts.map +0 -1
  167. package/lib/Socket/groups.js.map +0 -1
  168. package/lib/Socket/index.d.ts.map +0 -1
  169. package/lib/Socket/index.js.map +0 -1
  170. package/lib/Socket/messages-recv.d.ts.map +0 -1
  171. package/lib/Socket/messages-recv.js.map +0 -1
  172. package/lib/Socket/messages-send.d.ts.map +0 -1
  173. package/lib/Socket/messages-send.js.map +0 -1
  174. package/lib/Socket/mex.d.ts.map +0 -1
  175. package/lib/Socket/mex.js.map +0 -1
  176. package/lib/Socket/newsletter.d.ts.map +0 -1
  177. package/lib/Socket/newsletter.js.map +0 -1
  178. package/lib/Socket/socket.d.ts.map +0 -1
  179. package/lib/Socket/socket.js.map +0 -1
  180. package/lib/Store/index.d.ts.map +0 -1
  181. package/lib/Store/index.js.map +0 -1
  182. package/lib/Store/make-in-memory-store.d.ts.map +0 -1
  183. package/lib/Store/make-in-memory-store.js.map +0 -1
  184. package/lib/Store/make-ordered-dictionary.d.ts.map +0 -1
  185. package/lib/Store/make-ordered-dictionary.js.map +0 -1
  186. package/lib/Store/object-repository.d.ts.map +0 -1
  187. package/lib/Store/object-repository.js.map +0 -1
  188. package/lib/Types/Auth.d.ts.map +0 -1
  189. package/lib/Types/Auth.js.map +0 -1
  190. package/lib/Types/Bussines.d.ts.map +0 -1
  191. package/lib/Types/Bussines.js.map +0 -1
  192. package/lib/Types/Call.d.ts.map +0 -1
  193. package/lib/Types/Call.js.map +0 -1
  194. package/lib/Types/Chat.d.ts.map +0 -1
  195. package/lib/Types/Chat.js.map +0 -1
  196. package/lib/Types/Contact.d.ts.map +0 -1
  197. package/lib/Types/Contact.js.map +0 -1
  198. package/lib/Types/Events.d.ts.map +0 -1
  199. package/lib/Types/Events.js.map +0 -1
  200. package/lib/Types/GroupMetadata.d.ts.map +0 -1
  201. package/lib/Types/GroupMetadata.js.map +0 -1
  202. package/lib/Types/Label.d.ts.map +0 -1
  203. package/lib/Types/Label.js.map +0 -1
  204. package/lib/Types/LabelAssociation.d.ts.map +0 -1
  205. package/lib/Types/LabelAssociation.js.map +0 -1
  206. package/lib/Types/Message.d.ts.map +0 -1
  207. package/lib/Types/Message.js.map +0 -1
  208. package/lib/Types/Mex.d.ts.map +0 -1
  209. package/lib/Types/Mex.js.map +0 -1
  210. package/lib/Types/Product.d.ts.map +0 -1
  211. package/lib/Types/Product.js.map +0 -1
  212. package/lib/Types/RichType.d.ts.map +0 -1
  213. package/lib/Types/RichType.js.map +0 -1
  214. package/lib/Types/Signal.d.ts.map +0 -1
  215. package/lib/Types/Signal.js.map +0 -1
  216. package/lib/Types/Socket.d.ts.map +0 -1
  217. package/lib/Types/Socket.js.map +0 -1
  218. package/lib/Types/State.d.ts.map +0 -1
  219. package/lib/Types/State.js.map +0 -1
  220. package/lib/Types/USync.d.ts.map +0 -1
  221. package/lib/Types/USync.js.map +0 -1
  222. package/lib/Types/index.d.ts.map +0 -1
  223. package/lib/Types/index.js.map +0 -1
  224. package/lib/Utils/auth-utils.d.ts.map +0 -1
  225. package/lib/Utils/auth-utils.js.map +0 -1
  226. package/lib/Utils/browser-utils.d.ts.map +0 -1
  227. package/lib/Utils/browser-utils.js.map +0 -1
  228. package/lib/Utils/business.d.ts.map +0 -1
  229. package/lib/Utils/business.js.map +0 -1
  230. package/lib/Utils/chat-utils.d.ts.map +0 -1
  231. package/lib/Utils/chat-utils.js.map +0 -1
  232. package/lib/Utils/companion-reg-client-utils.d.ts.map +0 -1
  233. package/lib/Utils/companion-reg-client-utils.js.map +0 -1
  234. package/lib/Utils/crypto.d.ts.map +0 -1
  235. package/lib/Utils/crypto.js.map +0 -1
  236. package/lib/Utils/decode-wa-message.d.ts.map +0 -1
  237. package/lib/Utils/decode-wa-message.js.map +0 -1
  238. package/lib/Utils/event-buffer.d.ts.map +0 -1
  239. package/lib/Utils/event-buffer.js.map +0 -1
  240. package/lib/Utils/generics.d.ts.map +0 -1
  241. package/lib/Utils/generics.js.map +0 -1
  242. package/lib/Utils/history.d.ts.map +0 -1
  243. package/lib/Utils/history.js.map +0 -1
  244. package/lib/Utils/identity-change-handler.d.ts.map +0 -1
  245. package/lib/Utils/identity-change-handler.js.map +0 -1
  246. package/lib/Utils/index.d.ts.map +0 -1
  247. package/lib/Utils/index.js.map +0 -1
  248. package/lib/Utils/link-preview.d.ts.map +0 -1
  249. package/lib/Utils/link-preview.js.map +0 -1
  250. package/lib/Utils/logger.d.ts.map +0 -1
  251. package/lib/Utils/logger.js.map +0 -1
  252. package/lib/Utils/lt-hash.d.ts.map +0 -1
  253. package/lib/Utils/lt-hash.js.map +0 -1
  254. package/lib/Utils/make-mutex.d.ts.map +0 -1
  255. package/lib/Utils/make-mutex.js.map +0 -1
  256. package/lib/Utils/message-retry-manager.d.ts.map +0 -1
  257. package/lib/Utils/message-retry-manager.js.map +0 -1
  258. package/lib/Utils/messages-media.d.ts.map +0 -1
  259. package/lib/Utils/messages-media.js.map +0 -1
  260. package/lib/Utils/messages.d.ts.map +0 -1
  261. package/lib/Utils/messages.js.map +0 -1
  262. package/lib/Utils/noise-handler.d.ts.map +0 -1
  263. package/lib/Utils/noise-handler.js.map +0 -1
  264. package/lib/Utils/offline-node-processor.d.ts.map +0 -1
  265. package/lib/Utils/offline-node-processor.js.map +0 -1
  266. package/lib/Utils/pre-key-manager.d.ts.map +0 -1
  267. package/lib/Utils/pre-key-manager.js.map +0 -1
  268. package/lib/Utils/process-message.d.ts.map +0 -1
  269. package/lib/Utils/process-message.js.map +0 -1
  270. package/lib/Utils/reporting-utils.d.ts.map +0 -1
  271. package/lib/Utils/reporting-utils.js.map +0 -1
  272. package/lib/Utils/rich-message-utils.d.ts.map +0 -1
  273. package/lib/Utils/rich-message-utils.js.map +0 -1
  274. package/lib/Utils/signal.d.ts.map +0 -1
  275. package/lib/Utils/signal.js.map +0 -1
  276. package/lib/Utils/stanza-ack.d.ts.map +0 -1
  277. package/lib/Utils/stanza-ack.js.map +0 -1
  278. package/lib/Utils/sync-action-utils.d.ts.map +0 -1
  279. package/lib/Utils/sync-action-utils.js.map +0 -1
  280. package/lib/Utils/tc-token-utils.d.ts.map +0 -1
  281. package/lib/Utils/tc-token-utils.js.map +0 -1
  282. package/lib/Utils/use-multi-file-auth-state.d.ts.map +0 -1
  283. package/lib/Utils/use-multi-file-auth-state.js.map +0 -1
  284. package/lib/Utils/use-single-file-auth-state.d.ts.map +0 -1
  285. package/lib/Utils/use-single-file-auth-state.js.map +0 -1
  286. package/lib/Utils/use-sqlite-auth-state.d.ts.map +0 -1
  287. package/lib/Utils/use-sqlite-auth-state.js.map +0 -1
  288. package/lib/Utils/validate-connection.d.ts.map +0 -1
  289. package/lib/Utils/validate-connection.js.map +0 -1
  290. package/lib/WABinary/constants.d.ts.map +0 -1
  291. package/lib/WABinary/constants.js.map +0 -1
  292. package/lib/WABinary/decode.d.ts.map +0 -1
  293. package/lib/WABinary/decode.js.map +0 -1
  294. package/lib/WABinary/encode.d.ts.map +0 -1
  295. package/lib/WABinary/encode.js.map +0 -1
  296. package/lib/WABinary/generic-utils.d.ts.map +0 -1
  297. package/lib/WABinary/generic-utils.js.map +0 -1
  298. package/lib/WABinary/index.d.ts.map +0 -1
  299. package/lib/WABinary/index.js.map +0 -1
  300. package/lib/WABinary/jid-utils.d.ts.map +0 -1
  301. package/lib/WABinary/jid-utils.js.map +0 -1
  302. package/lib/WABinary/types.d.ts.map +0 -1
  303. package/lib/WABinary/types.js.map +0 -1
  304. package/lib/WAM/BinaryInfo.d.ts.map +0 -1
  305. package/lib/WAM/BinaryInfo.js.map +0 -1
  306. package/lib/WAM/constants.d.ts.map +0 -1
  307. package/lib/WAM/constants.js.map +0 -1
  308. package/lib/WAM/encode.d.ts.map +0 -1
  309. package/lib/WAM/encode.js.map +0 -1
  310. package/lib/WAM/index.d.ts.map +0 -1
  311. package/lib/WAM/index.js.map +0 -1
  312. package/lib/WAUSync/Protocols/USyncContactProtocol.d.ts.map +0 -1
  313. package/lib/WAUSync/Protocols/USyncContactProtocol.js.map +0 -1
  314. package/lib/WAUSync/Protocols/USyncDeviceProtocol.d.ts.map +0 -1
  315. package/lib/WAUSync/Protocols/USyncDeviceProtocol.js.map +0 -1
  316. package/lib/WAUSync/Protocols/USyncDisappearingModeProtocol.d.ts.map +0 -1
  317. package/lib/WAUSync/Protocols/USyncDisappearingModeProtocol.js.map +0 -1
  318. package/lib/WAUSync/Protocols/USyncStatusProtocol.d.ts.map +0 -1
  319. package/lib/WAUSync/Protocols/USyncStatusProtocol.js.map +0 -1
  320. package/lib/WAUSync/Protocols/USyncUsernameProtocol.d.ts.map +0 -1
  321. package/lib/WAUSync/Protocols/USyncUsernameProtocol.js.map +0 -1
  322. package/lib/WAUSync/Protocols/UsyncBotProfileProtocol.d.ts.map +0 -1
  323. package/lib/WAUSync/Protocols/UsyncBotProfileProtocol.js.map +0 -1
  324. package/lib/WAUSync/Protocols/UsyncLIDProtocol.d.ts.map +0 -1
  325. package/lib/WAUSync/Protocols/UsyncLIDProtocol.js.map +0 -1
  326. package/lib/WAUSync/Protocols/index.d.ts.map +0 -1
  327. package/lib/WAUSync/Protocols/index.js.map +0 -1
  328. package/lib/WAUSync/USyncQuery.d.ts.map +0 -1
  329. package/lib/WAUSync/USyncQuery.js.map +0 -1
  330. package/lib/WAUSync/USyncUser.d.ts.map +0 -1
  331. package/lib/WAUSync/USyncUser.js.map +0 -1
  332. package/lib/WAUSync/index.d.ts.map +0 -1
  333. package/lib/WAUSync/index.js.map +0 -1
  334. package/lib/index.d.ts.map +0 -1
  335. package/lib/index.js.map +0 -1
@@ -1,2 +1,71 @@
1
- export {};
1
+ import type { Contact } from './Contact.js';
2
+ import type { WAMessageAddressingMode } from './Message.js';
3
+ export type GroupParticipant = Contact & {
4
+ isAdmin?: boolean;
5
+ isSuperAdmin?: boolean;
6
+ admin?: 'admin' | 'superadmin' | null;
7
+ };
8
+ export type ParticipantAction = 'add' | 'remove' | 'promote' | 'demote' | 'modify';
9
+ export type RequestJoinAction = 'created' | 'revoked' | 'rejected';
10
+ export type RequestJoinMethod = 'invite_link' | 'linked_group_join' | 'non_admin_add' | undefined;
11
+ export interface GroupMetadata {
12
+ id: string;
13
+ notify?: string;
14
+ /** group uses 'lid' or 'pn' to send messages */
15
+ addressingMode?: WAMessageAddressingMode;
16
+ owner: string | undefined;
17
+ ownerPn?: string | undefined;
18
+ ownerUsername?: string | undefined;
19
+ owner_country_code?: string | undefined;
20
+ subject: string;
21
+ /** group subject owner */
22
+ subjectOwner?: string;
23
+ subjectOwnerPn?: string;
24
+ subjectOwnerUsername?: string;
25
+ /** group subject modification date */
26
+ subjectTime?: number;
27
+ creation?: number;
28
+ desc?: string;
29
+ descOwner?: string;
30
+ descOwnerPn?: string;
31
+ descOwnerUsername?: string;
32
+ descId?: string;
33
+ descTime?: number;
34
+ /** if this group is part of a community, it returns the jid of the community to which it belongs */
35
+ linkedParent?: string;
36
+ /** is set when the group only allows admins to change group settings */
37
+ restrict?: boolean;
38
+ /** is set when the group only allows admins to write messages */
39
+ announce?: boolean;
40
+ /** is set when the group also allows members to add participants */
41
+ memberAddMode?: boolean;
42
+ /** Request approval to join the group */
43
+ joinApprovalMode?: boolean;
44
+ /** is this a community */
45
+ isCommunity?: boolean;
46
+ /** is this the announce of a community */
47
+ isCommunityAnnounce?: boolean;
48
+ /** number of group participants */
49
+ size?: number;
50
+ participants: GroupParticipant[];
51
+ ephemeralDuration?: number;
52
+ inviteCode?: string;
53
+ /** the person who added you to group or changed some setting in group */
54
+ author?: string;
55
+ authorPn?: string;
56
+ authorUsername?: string;
57
+ }
58
+ export interface WAGroupCreateResponse {
59
+ status: number;
60
+ gid?: string;
61
+ participants?: [{
62
+ [key: string]: {};
63
+ }];
64
+ }
65
+ export interface GroupModificationResponse {
66
+ status: number;
67
+ participants?: {
68
+ [key: string]: {};
69
+ };
70
+ }
2
71
  //# sourceMappingURL=GroupMetadata.d.ts.map
@@ -1,3 +1,2 @@
1
1
  /** WhatsApp has 20 predefined colors */
2
2
  export const LabelColor: any;
3
- //# sourceMappingURL=Label.d.ts.map
@@ -1,3 +1,2 @@
1
1
  /** Association type */
2
2
  export const LabelAssociationType: any;
3
- //# sourceMappingURL=LabelAssociation.d.ts.map
@@ -1,12 +1,11 @@
1
1
  export { proto as WAProto };
2
- export const AssociationType: typeof proto.MessageAssociation.AssociationType;
3
- export const ButtonHeaderType: typeof proto.Message.ButtonsMessage.HeaderType;
4
- export const ButtonType: typeof proto.Message.ButtonsMessage.Button.Type;
5
- export const CarouselCardType: typeof proto.Message.InteractiveMessage.CarouselMessage.CarouselCardType;
6
- export const ListType: typeof proto.Message.ListMessage.ListType;
7
- export const ProtocolType: typeof proto.Message.ProtocolMessage.Type;
8
- export const WAMessageStubType: typeof proto.WebMessageInfo.StubType;
9
- export const WAMessageStatus: typeof proto.WebMessageInfo.Status;
2
+ export const AssociationType: any;
3
+ export const ButtonHeaderType: any;
4
+ export const ButtonType: any;
5
+ export const CarouselCardType: any;
6
+ export const ListType: any;
7
+ export const ProtocolType: any;
8
+ export const WAMessageStubType: any;
9
+ export const WAMessageStatus: any;
10
10
  export const WAMessageAddressingMode: any;
11
11
  import { proto } from '../../WAProto/index.js';
12
- //# sourceMappingURL=Message.d.ts.map
@@ -1,3 +1,2 @@
1
1
  export const XWAPaths: any;
2
2
  export const QueryIds: any;
3
- //# sourceMappingURL=Mex.d.ts.map
@@ -1,2 +1,79 @@
1
- export {};
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
+ };
2
79
  //# sourceMappingURL=Product.d.ts.map
@@ -1,3 +1,2 @@
1
1
  export const CodeHighlightType: any;
2
2
  export const RichSubMessageType: any;
3
- //# sourceMappingURL=RichType.d.ts.map
@@ -1,2 +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: proto.Message.ISenderKeyDistributionMessage;
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
+ }
1
86
  export {};
2
87
  //# sourceMappingURL=Signal.d.ts.map
@@ -1,2 +1,136 @@
1
- export {};
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 = proto.IMessage & {
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
+ /** should the QR be printed in the terminal
59
+ * @deprecated This feature has been removed
60
+ */
61
+ printQRInTerminal?: boolean;
62
+ /** should events be emitted for actions done by this socket connection */
63
+ emitOwnEvents: boolean;
64
+ /** custom upload hosts to upload media to */
65
+ customUploadHosts: MediaConnInfo['hosts'];
66
+ /** time to wait between sending new retry requests */
67
+ retryRequestDelayMs: number;
68
+ /** max retry count */
69
+ maxMsgRetryCount: number;
70
+ /** time to wait for the generation of the next QR in ms */
71
+ qrTimeout?: number;
72
+ /** provide an auth state object to maintain the auth state */
73
+ auth: AuthenticationState;
74
+ /** manage history processing with this control; by default will sync up everything */
75
+ shouldSyncHistoryMessage: (msg: proto.Message.IHistorySyncNotification) => boolean;
76
+ /** transaction capability options for SignalKeyStore */
77
+ transactionOpts: TransactionCapabilityOptions;
78
+ /** marks the client as online whenever the socket successfully connects */
79
+ markOnlineOnConnect: boolean;
80
+ /** alphanumeric country code (USA -> US) for the number used */
81
+ countryCode: string;
82
+ /** provide a cache to store media, so does not have to be re-uploaded */
83
+ mediaCache?: CacheStore;
84
+ /**
85
+ * map to store the retry counts for failed messages;
86
+ * used to determine whether to retry a message or not */
87
+ msgRetryCounterCache?: CacheStore;
88
+ /** provide a cache to store a user's device list */
89
+ userDevicesCache?: PossiblyExtendedCacheStore;
90
+ /** cache to store call offers */
91
+ callOfferCache?: CacheStore;
92
+ /** cache to track placeholder resends */
93
+ placeholderResendCache?: CacheStore;
94
+ /** width for link preview images */
95
+ linkPreviewImageThumbnailWidth: number;
96
+ /** Should Baileys ask the phone for full history, will be received async */
97
+ syncFullHistory: boolean;
98
+ /** Should baileys fire init queries automatically, default true */
99
+ fireInitQueries: boolean;
100
+ /**
101
+ * generate a high quality link preview,
102
+ * entails uploading the jpegThumbnail to WA
103
+ * */
104
+ generateHighQualityLinkPreview: boolean;
105
+ /** Enable automatic session recreation for failed messages */
106
+ enableAutoSessionRecreation: boolean;
107
+ /** Enable recent message caching for retry handling */
108
+ enableRecentMessageCache: boolean;
109
+ /**
110
+ * Returns if a jid should be ignored,
111
+ * no event for that jid will be triggered.
112
+ * Messages from that jid will also not be decrypted
113
+ * */
114
+ shouldIgnoreJid: (jid: string) => boolean | undefined;
115
+ /**
116
+ * Optionally patch the message before sending out
117
+ * */
118
+ patchMessageBeforeSending: (msg: proto.IMessage, recipientJids?: string[]) => Promise<PatchedMessageWithRecipientJID[] | PatchedMessageWithRecipientJID> | PatchedMessageWithRecipientJID[] | PatchedMessageWithRecipientJID;
119
+ /** verify app state MACs */
120
+ appStateMacVerification: {
121
+ patch: boolean;
122
+ snapshot: boolean;
123
+ };
124
+ /** options for HTTP fetch requests */
125
+ options: RequestInit;
126
+ /**
127
+ * fetch a message from your store
128
+ * implement this so that messages failed to send
129
+ * (solves the "this message can take a while" issue) can be retried
130
+ * */
131
+ getMessage: (key: WAMessageKey) => Promise<proto.IMessage | undefined>;
132
+ /** cached group metadata, use to prevent redundant requests to WA & speed up msg sending */
133
+ cachedGroupMetadata: (jid: string) => Promise<GroupMetadata | undefined>;
134
+ makeSignalRepository: (auth: SignalAuthState, logger: ILogger, pnToLIDFunc?: (jids: string[]) => Promise<LIDMapping[] | undefined>) => SignalRepositoryWithLIDStore;
135
+ };
2
136
  //# sourceMappingURL=Socket.d.ts.map
@@ -3,4 +3,3 @@ export const ReachoutTimelockEnforcementType: any;
3
3
  export const NewChatMessageCappingStatusType: any;
4
4
  export const NewChatMessageCappingMVStatusType: any;
5
5
  export const NewChatMessageCappingOTEStatusType: any;
6
- //# sourceMappingURL=State.d.ts.map
@@ -1,2 +1,26 @@
1
- export {};
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
+ }
2
26
  //# sourceMappingURL=USync.d.ts.map
@@ -1,14 +1,66 @@
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 const DisconnectReason: any;
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
+ import type { AuthenticationState } from './Auth.js';
14
+ import type { SocketConfig } from './Socket.js';
15
+ export type UserFacingSocketConfig = Partial<SocketConfig> & {
16
+ auth: AuthenticationState;
17
+ };
18
+ export type BrowsersMap = {
19
+ ubuntu(browser: string): [string, string, string];
20
+ macOS(browser: string): [string, string, string];
21
+ baileys(browser: string): [string, string, string];
22
+ windows(browser: string): [string, string, string];
23
+ android(browser: string): [string, string, string];
24
+ appropriate(browser: string): [string, string, string];
25
+ };
26
+ export declare enum DisconnectReason {
27
+ connectionClosed = 428,
28
+ connectionLost = 408,
29
+ connectionReplaced = 440,
30
+ timedOut = 408,
31
+ loggedOut = 401,
32
+ badSession = 500,
33
+ restartRequired = 515,
34
+ multideviceMismatch = 411,
35
+ forbidden = 403,
36
+ unavailableService = 503
37
+ }
38
+ export type WAInitResponse = {
39
+ ref: string;
40
+ ttl: number;
41
+ status: 200;
42
+ };
43
+ export type WABusinessHoursConfig = {
44
+ day_of_week: string;
45
+ mode: string;
46
+ open_time?: number;
47
+ close_time?: number;
48
+ };
49
+ export type WABusinessProfile = {
50
+ description: string;
51
+ email: string | undefined;
52
+ business_hours: {
53
+ timezone?: string;
54
+ config?: WABusinessHoursConfig[];
55
+ business_config?: WABusinessHoursConfig[];
56
+ };
57
+ website: string[];
58
+ category?: string;
59
+ wid?: string;
60
+ address?: string;
61
+ };
62
+ export type CurveKeyPair = {
63
+ private: Uint8Array;
64
+ public: Uint8Array;
65
+ };
14
66
  //# sourceMappingURL=index.d.ts.map
@@ -55,4 +55,3 @@ export function initAuthCreds(): {
55
55
  routingInfo: undefined;
56
56
  additionalData: undefined;
57
57
  };
58
- //# sourceMappingURL=auth-utils.d.ts.map
@@ -5,5 +5,4 @@ export namespace Browsers {
5
5
  function windows(browser: any): any[];
6
6
  function appropriate(browser: any): any[];
7
7
  }
8
- export function getPlatformId(browser: any): string;
9
- //# sourceMappingURL=browser-utils.d.ts.map
8
+ export function getPlatformId(browser: any): any;
@@ -47,4 +47,3 @@ export function parseProductNode(productNode: any): {
47
47
  isHidden: boolean;
48
48
  };
49
49
  export function uploadingNecessaryImages(images: any, waUploadToServer: any, timeoutMs?: number): Promise<any[]>;
50
- //# sourceMappingURL=business.d.ts.map
@@ -5,6 +5,7 @@ import { tmpdir } from 'os';
5
5
  import { join } from 'path';
6
6
  import { getBinaryNodeChild, getBinaryNodeChildren, getBinaryNodeChildString } from '../WABinary/index.js';
7
7
  import { generateMessageIDV2 } from './generics.js';
8
+ import logger from './logger.js';
8
9
  import { getStream, getUrlFromDirectPath } from './messages-media.js';
9
10
  export const parseCatalogNode = (node) => {
10
11
  const catalogNode = getBinaryNodeChild(node, 'product_catalog');
@@ -209,7 +210,7 @@ export const uploadingNecessaryImages = async (images, waUploadToServer, timeout
209
210
  fileEncSha256B64: sha,
210
211
  timeoutMs
211
212
  });
212
- await fs.unlink(filePath).catch(err => console.log('Error deleting temp file ', err));
213
+ await fs.unlink(filePath).catch(err => logger.warn({ err, filePath }, 'Vanz@Fix (bug 57): error deleting temp file')); // was console.log
213
214
  return { url: getUrlFromDirectPath(directPath) };
214
215
  }));
215
216
  return results;