@vanzxy/baileys 2.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (281) hide show
  1. package/NOTICE.md +111 -0
  2. package/README.md +830 -0
  3. package/WAProto/index.d.ts +9 -0
  4. package/WAProto/index.js +142036 -0
  5. package/engine-requirements.js +13 -0
  6. package/lib/Defaults/index.d.ts +152 -0
  7. package/lib/Defaults/index.js +179 -0
  8. package/lib/Framework/Bot.js +209 -0
  9. package/lib/Framework/Context.js +90 -0
  10. package/lib/Framework/MediaManager.js +152 -0
  11. package/lib/Framework/SessionManager.js +34 -0
  12. package/lib/Framework/StatsManager.js +120 -0
  13. package/lib/Framework/Store/SQLiteStore.js +74 -0
  14. package/lib/Framework/index.js +11 -0
  15. package/lib/Signal/Group/ciphertext-message.d.ts +9 -0
  16. package/lib/Signal/Group/ciphertext-message.js +12 -0
  17. package/lib/Signal/Group/group-session-builder.d.ts +7 -0
  18. package/lib/Signal/Group/group-session-builder.js +30 -0
  19. package/lib/Signal/Group/group_cipher.d.ts +10 -0
  20. package/lib/Signal/Group/group_cipher.js +82 -0
  21. package/lib/Signal/Group/index.d.ts +11 -0
  22. package/lib/Signal/Group/index.js +12 -0
  23. package/lib/Signal/Group/keyhelper.d.ts +6 -0
  24. package/lib/Signal/Group/keyhelper.js +18 -0
  25. package/lib/Signal/Group/sender-chain-key.d.ts +13 -0
  26. package/lib/Signal/Group/sender-chain-key.js +26 -0
  27. package/lib/Signal/Group/sender-key-distribution-message.d.ts +16 -0
  28. package/lib/Signal/Group/sender-key-distribution-message.js +63 -0
  29. package/lib/Signal/Group/sender-key-message.d.ts +18 -0
  30. package/lib/Signal/Group/sender-key-message.js +66 -0
  31. package/lib/Signal/Group/sender-key-name.d.ts +11 -0
  32. package/lib/Signal/Group/sender-key-name.js +48 -0
  33. package/lib/Signal/Group/sender-key-record.d.ts +12 -0
  34. package/lib/Signal/Group/sender-key-record.js +41 -0
  35. package/lib/Signal/Group/sender-key-state.d.ts +16 -0
  36. package/lib/Signal/Group/sender-key-state.js +84 -0
  37. package/lib/Signal/Group/sender-message-key.d.ts +11 -0
  38. package/lib/Signal/Group/sender-message-key.js +26 -0
  39. package/lib/Signal/libsignal.d.ts +54 -0
  40. package/lib/Signal/libsignal.js +431 -0
  41. package/lib/Signal/lid-mapping.d.ts +20 -0
  42. package/lib/Signal/lid-mapping.js +277 -0
  43. package/lib/Socket/Client/index.d.ts +2 -0
  44. package/lib/Socket/Client/index.js +3 -0
  45. package/lib/Socket/Client/types.d.ts +5 -0
  46. package/lib/Socket/Client/types.js +11 -0
  47. package/lib/Socket/Client/websocket.d.ts +12 -0
  48. package/lib/Socket/Client/websocket.js +54 -0
  49. package/lib/Socket/business.d.ts +395 -0
  50. package/lib/Socket/business.js +380 -0
  51. package/lib/Socket/chats.d.ts +136 -0
  52. package/lib/Socket/chats.js +1328 -0
  53. package/lib/Socket/communities.d.ts +561 -0
  54. package/lib/Socket/communities.js +434 -0
  55. package/lib/Socket/dugong.d.ts +117 -0
  56. package/lib/Socket/dugong.js +799 -0
  57. package/lib/Socket/groups.d.ts +285 -0
  58. package/lib/Socket/groups.js +355 -0
  59. package/lib/Socket/index.d.ts +531 -0
  60. package/lib/Socket/index.js +34 -0
  61. package/lib/Socket/messages-recv.d.ts +333 -0
  62. package/lib/Socket/messages-recv.js +1782 -0
  63. package/lib/Socket/messages-send.d.ts +329 -0
  64. package/lib/Socket/messages-send.js +1383 -0
  65. package/lib/Socket/mex.d.ts +1 -0
  66. package/lib/Socket/mex.js +42 -0
  67. package/lib/Socket/newsletter.d.ts +281 -0
  68. package/lib/Socket/newsletter.js +321 -0
  69. package/lib/Socket/socket.d.ts +60 -0
  70. package/lib/Socket/socket.js +1001 -0
  71. package/lib/Socket/username.js +153 -0
  72. package/lib/Store/index.d.ts +3 -0
  73. package/lib/Store/index.js +4 -0
  74. package/lib/Store/make-in-memory-store.d.ts +62 -0
  75. package/lib/Store/make-in-memory-store.js +429 -0
  76. package/lib/Store/make-ordered-dictionary.d.ts +12 -0
  77. package/lib/Store/make-ordered-dictionary.js +79 -0
  78. package/lib/Store/object-repository.d.ts +10 -0
  79. package/lib/Store/object-repository.js +24 -0
  80. package/lib/Types/Auth.d.ts +117 -0
  81. package/lib/Types/Auth.js +2 -0
  82. package/lib/Types/Bussines.d.ts +25 -0
  83. package/lib/Types/Bussines.js +2 -0
  84. package/lib/Types/Call.d.ts +15 -0
  85. package/lib/Types/Call.js +2 -0
  86. package/lib/Types/Chat.d.ts +124 -0
  87. package/lib/Types/Chat.js +8 -0
  88. package/lib/Types/Contact.d.ts +26 -0
  89. package/lib/Types/Contact.js +2 -0
  90. package/lib/Types/Events.d.ts +256 -0
  91. package/lib/Types/Events.js +2 -0
  92. package/lib/Types/GroupMetadata.d.ts +71 -0
  93. package/lib/Types/GroupMetadata.js +2 -0
  94. package/lib/Types/Label.d.ts +2 -0
  95. package/lib/Types/Label.js +25 -0
  96. package/lib/Types/LabelAssociation.d.ts +2 -0
  97. package/lib/Types/LabelAssociation.js +7 -0
  98. package/lib/Types/Message.d.ts +11 -0
  99. package/lib/Types/Message.js +18 -0
  100. package/lib/Types/Mex.d.ts +2 -0
  101. package/lib/Types/Mex.js +39 -0
  102. package/lib/Types/Product.d.ts +79 -0
  103. package/lib/Types/Product.js +2 -0
  104. package/lib/Types/RichType.d.ts +2 -0
  105. package/lib/Types/RichType.js +23 -0
  106. package/lib/Types/Signal.d.ts +87 -0
  107. package/lib/Types/Signal.js +2 -0
  108. package/lib/Types/Socket.d.ts +136 -0
  109. package/lib/Types/Socket.js +2 -0
  110. package/lib/Types/State.d.ts +5 -0
  111. package/lib/Types/State.js +56 -0
  112. package/lib/Types/USync.d.ts +26 -0
  113. package/lib/Types/USync.js +2 -0
  114. package/lib/Types/index.d.ts +66 -0
  115. package/lib/Types/index.js +26 -0
  116. package/lib/Utils/A2UI.js +277 -0
  117. package/lib/Utils/MessageBuilder.js +4405 -0
  118. package/lib/Utils/MessageBuilder_d.ts +411 -0
  119. package/lib/Utils/PersistentStore.js +592 -0
  120. package/lib/Utils/PersistentStore_d.ts +60 -0
  121. package/lib/Utils/anti-delete.d.ts +74 -0
  122. package/lib/Utils/anti-delete.js +222 -0
  123. package/lib/Utils/auth-utils.d.ts +57 -0
  124. package/lib/Utils/auth-utils.js +307 -0
  125. package/lib/Utils/auto-reply.d.ts +47 -0
  126. package/lib/Utils/auto-reply.js +158 -0
  127. package/lib/Utils/baileys-event-stream.d.ts +8 -0
  128. package/lib/Utils/baileys-event-stream.js +62 -0
  129. package/lib/Utils/browser-utils.d.ts +8 -0
  130. package/lib/Utils/browser-utils.js +28 -0
  131. package/lib/Utils/business.d.ts +49 -0
  132. package/lib/Utils/business.js +240 -0
  133. package/lib/Utils/button-helper-utils.js +314 -0
  134. package/lib/Utils/button-sender.js +824 -0
  135. package/lib/Utils/chat-control.d.ts +159 -0
  136. package/lib/Utils/chat-control.js +232 -0
  137. package/lib/Utils/chat-history-helpers.d.ts +21 -0
  138. package/lib/Utils/chat-history-helpers.js +71 -0
  139. package/lib/Utils/chat-utils.d.ts +407 -0
  140. package/lib/Utils/chat-utils.js +886 -0
  141. package/lib/Utils/companion-reg-client-utils.d.ts +4 -0
  142. package/lib/Utils/companion-reg-client-utils.js +40 -0
  143. package/lib/Utils/crypto.d.ts +41 -0
  144. package/lib/Utils/crypto.js +148 -0
  145. package/lib/Utils/decode-wa-message.d.ts +83 -0
  146. package/lib/Utils/decode-wa-message.js +317 -0
  147. package/lib/Utils/event-buffer.d.ts +12 -0
  148. package/lib/Utils/event-buffer.js +636 -0
  149. package/lib/Utils/generics.d.ts +69 -0
  150. package/lib/Utils/generics.js +439 -0
  151. package/lib/Utils/history.d.ts +90 -0
  152. package/lib/Utils/history.js +147 -0
  153. package/lib/Utils/identity-change-handler.d.ts +13 -0
  154. package/lib/Utils/identity-change-handler.js +50 -0
  155. package/lib/Utils/index.d.ts +39 -0
  156. package/lib/Utils/index.js +46 -0
  157. package/lib/Utils/link-preview.d.ts +12 -0
  158. package/lib/Utils/link-preview.js +85 -0
  159. package/lib/Utils/logger.d.ts +2 -0
  160. package/lib/Utils/logger.js +3 -0
  161. package/lib/Utils/lt-hash.d.ts +12 -0
  162. package/lib/Utils/lt-hash.js +27 -0
  163. package/lib/Utils/make-mutex.d.ts +6 -0
  164. package/lib/Utils/make-mutex.js +33 -0
  165. package/lib/Utils/media-messages.d.ts +18 -0
  166. package/lib/Utils/media-messages.js +71 -0
  167. package/lib/Utils/media-set.d.ts +13 -0
  168. package/lib/Utils/media-set.js +172 -0
  169. package/lib/Utils/message-kind.js +139 -0
  170. package/lib/Utils/message-retry-manager.d.ts +79 -0
  171. package/lib/Utils/message-retry-manager.js +265 -0
  172. package/lib/Utils/message-search.d.ts +44 -0
  173. package/lib/Utils/message-search.js +189 -0
  174. package/lib/Utils/messages-media.d.ts +135 -0
  175. package/lib/Utils/messages-media.js +869 -0
  176. package/lib/Utils/messages.d.ts +44 -0
  177. package/lib/Utils/messages.js +2155 -0
  178. package/lib/Utils/noise-handler.d.ts +20 -0
  179. package/lib/Utils/noise-handler.js +201 -0
  180. package/lib/Utils/offline-node-processor.d.ts +9 -0
  181. package/lib/Utils/offline-node-processor.js +40 -0
  182. package/lib/Utils/past-participants.d.ts +14 -0
  183. package/lib/Utils/past-participants.js +40 -0
  184. package/lib/Utils/pre-key-manager.d.ts +25 -0
  185. package/lib/Utils/pre-key-manager.js +106 -0
  186. package/lib/Utils/process-message.d.ts +82 -0
  187. package/lib/Utils/process-message.js +809 -0
  188. package/lib/Utils/reporting-utils.d.ts +12 -0
  189. package/lib/Utils/reporting-utils.js +258 -0
  190. package/lib/Utils/rich-message-utils.d.ts +48 -0
  191. package/lib/Utils/rich-message-utils.js +445 -0
  192. package/lib/Utils/scheduling.d.ts +42 -0
  193. package/lib/Utils/scheduling.js +140 -0
  194. package/lib/Utils/signal.d.ts +82 -0
  195. package/lib/Utils/signal.js +201 -0
  196. package/lib/Utils/stanza-ack.d.ts +16 -0
  197. package/lib/Utils/stanza-ack.js +38 -0
  198. package/lib/Utils/status.d.ts +50 -0
  199. package/lib/Utils/status.js +108 -0
  200. package/lib/Utils/stickerpack.d.ts +51 -0
  201. package/lib/Utils/stickerpack.js +275 -0
  202. package/lib/Utils/sync-action-utils.d.ts +2 -0
  203. package/lib/Utils/sync-action-utils.js +49 -0
  204. package/lib/Utils/tc-token-utils.d.ts +29 -0
  205. package/lib/Utils/tc-token-utils.js +163 -0
  206. package/lib/Utils/templates.d.ts +76 -0
  207. package/lib/Utils/templates.js +151 -0
  208. package/lib/Utils/use-cache-manager-auth-state.d.ts +13 -0
  209. package/lib/Utils/use-cache-manager-auth-state.js +82 -0
  210. package/lib/Utils/use-multi-file-auth-state.d.ts +10 -0
  211. package/lib/Utils/use-multi-file-auth-state.js +167 -0
  212. package/lib/Utils/use-single-file-auth-state.d.ts +10 -0
  213. package/lib/Utils/use-single-file-auth-state.js +114 -0
  214. package/lib/Utils/use-sqlite-auth-state.d.ts +11 -0
  215. package/lib/Utils/use-sqlite-auth-state.js +170 -0
  216. package/lib/Utils/validate-connection.d.ts +42 -0
  217. package/lib/Utils/validate-connection.js +199 -0
  218. package/lib/Utils/vcard.d.ts +58 -0
  219. package/lib/Utils/vcard.js +105 -0
  220. package/lib/VoIP/audio-feeder.d.ts +15 -0
  221. package/lib/VoIP/audio-feeder.js +132 -0
  222. package/lib/VoIP/index.js +277 -0
  223. package/lib/VoIP/relay-transport.d.ts +43 -0
  224. package/lib/VoIP/relay-transport.js +559 -0
  225. package/lib/VoIP/signaling.js +624 -0
  226. package/lib/VoIP/types.d.ts +69 -0
  227. package/lib/VoIP/types.js +17 -0
  228. package/lib/VoIP/wasm-engine.d.ts +103 -0
  229. package/lib/VoIP/wasm-engine.js +1214 -0
  230. package/lib/VoIP/worker-bootstrap.js +1042 -0
  231. package/lib/WABinary/constants.d.ts +61 -0
  232. package/lib/WABinary/constants.js +1467 -0
  233. package/lib/WABinary/decode.d.ts +9 -0
  234. package/lib/WABinary/decode.js +262 -0
  235. package/lib/WABinary/encode.d.ts +2 -0
  236. package/lib/WABinary/encode.js +220 -0
  237. package/lib/WABinary/generic-utils.d.ts +74 -0
  238. package/lib/WABinary/generic-utils.js +277 -0
  239. package/lib/WABinary/index.d.ts +5 -0
  240. package/lib/WABinary/index.js +6 -0
  241. package/lib/WABinary/jid-utils.d.ts +28 -0
  242. package/lib/WABinary/jid-utils.js +96 -0
  243. package/lib/WABinary/types.d.ts +19 -0
  244. package/lib/WABinary/types.js +2 -0
  245. package/lib/WAM/BinaryInfo.d.ts +7 -0
  246. package/lib/WAM/BinaryInfo.js +10 -0
  247. package/lib/WAM/constants.d.ts +34926 -0
  248. package/lib/WAM/constants.js +22853 -0
  249. package/lib/WAM/encode.d.ts +1 -0
  250. package/lib/WAM/encode.js +150 -0
  251. package/lib/WAM/index.d.ts +3 -0
  252. package/lib/WAM/index.js +4 -0
  253. package/lib/WAUSync/Protocols/USyncContactProtocol.d.ts +36 -0
  254. package/lib/WAUSync/Protocols/USyncContactProtocol.js +52 -0
  255. package/lib/WAUSync/Protocols/USyncDeviceProtocol.d.ts +29 -0
  256. package/lib/WAUSync/Protocols/USyncDeviceProtocol.js +63 -0
  257. package/lib/WAUSync/Protocols/USyncDisappearingModeProtocol.d.ts +12 -0
  258. package/lib/WAUSync/Protocols/USyncDisappearingModeProtocol.js +27 -0
  259. package/lib/WAUSync/Protocols/USyncStatusProtocol.d.ts +12 -0
  260. package/lib/WAUSync/Protocols/USyncStatusProtocol.js +38 -0
  261. package/lib/WAUSync/Protocols/USyncUsernameProtocol.d.ts +9 -0
  262. package/lib/WAUSync/Protocols/USyncUsernameProtocol.js +25 -0
  263. package/lib/WAUSync/Protocols/UsyncBotProfileProtocol.d.ts +38 -0
  264. package/lib/WAUSync/Protocols/UsyncBotProfileProtocol.js +51 -0
  265. package/lib/WAUSync/Protocols/UsyncLIDProtocol.d.ts +14 -0
  266. package/lib/WAUSync/Protocols/UsyncLIDProtocol.js +29 -0
  267. package/lib/WAUSync/Protocols/index.d.ts +7 -0
  268. package/lib/WAUSync/Protocols/index.js +8 -0
  269. package/lib/WAUSync/USyncQuery.d.ts +20 -0
  270. package/lib/WAUSync/USyncQuery.js +122 -0
  271. package/lib/WAUSync/USyncUser.d.ts +16 -0
  272. package/lib/WAUSync/USyncUser.js +31 -0
  273. package/lib/WAUSync/index.d.ts +3 -0
  274. package/lib/WAUSync/index.js +4 -0
  275. package/lib/assets/wasm/loader.js +5 -0
  276. package/lib/assets/wasm/whatsapp.wasm +0 -0
  277. package/lib/assets/wasm/worker-modules.js +273 -0
  278. package/lib/index.d.ts +12 -0
  279. package/lib/index.js +20 -0
  280. package/package.json +175 -0
  281. package/postinstall-banner.js +56 -0
@@ -0,0 +1,561 @@
1
+ export function makeCommunitiesSocket(config: any): {
2
+ communityQuery: (jid: any, type: any, content: any) => Promise<any>;
3
+ communityMetadata: (jid: any) => Promise<{
4
+ id: any;
5
+ subject: any;
6
+ subjectOwner: any;
7
+ subjectTime: number;
8
+ size: any;
9
+ creation: number;
10
+ owner: string | undefined;
11
+ desc: any;
12
+ descId: any;
13
+ linkedParent: any;
14
+ restrict: boolean;
15
+ announce: boolean;
16
+ isCommunity: boolean;
17
+ isCommunityAnnounce: boolean;
18
+ joinApprovalMode: boolean;
19
+ memberAddMode: boolean;
20
+ participants: any;
21
+ ephemeralDuration: number | undefined;
22
+ addressingMode: any;
23
+ }>;
24
+ communityCreate: (subject: any, body: any) => Promise<{
25
+ id: any;
26
+ notify: any;
27
+ addressingMode: any;
28
+ subject: any;
29
+ subjectOwner: any;
30
+ subjectOwnerPn: any;
31
+ subjectOwnerUsername: any;
32
+ subjectTime: number;
33
+ size: any;
34
+ creation: number;
35
+ owner: string | undefined;
36
+ ownerPn: string | undefined;
37
+ ownerUsername: any;
38
+ owner_country_code: any;
39
+ desc: any;
40
+ descId: any;
41
+ descOwner: string | undefined;
42
+ descOwnerPn: string | undefined;
43
+ descOwnerUsername: any;
44
+ descTime: number | undefined;
45
+ linkedParent: any;
46
+ restrict: boolean;
47
+ announce: boolean;
48
+ isCommunity: boolean;
49
+ isCommunityAnnounce: boolean;
50
+ joinApprovalMode: boolean;
51
+ memberAddMode: boolean;
52
+ participants: any;
53
+ ephemeralDuration: number | undefined;
54
+ } | null>;
55
+ communityCreateGroup: (subject: any, participants: any, parentCommunityJid: any) => Promise<{
56
+ id: any;
57
+ notify: any;
58
+ addressingMode: any;
59
+ subject: any;
60
+ subjectOwner: any;
61
+ subjectOwnerPn: any;
62
+ subjectOwnerUsername: any;
63
+ subjectTime: number;
64
+ size: any;
65
+ creation: number;
66
+ owner: string | undefined;
67
+ ownerPn: string | undefined;
68
+ ownerUsername: any;
69
+ owner_country_code: any;
70
+ desc: any;
71
+ descId: any;
72
+ descOwner: string | undefined;
73
+ descOwnerPn: string | undefined;
74
+ descOwnerUsername: any;
75
+ descTime: number | undefined;
76
+ linkedParent: any;
77
+ restrict: boolean;
78
+ announce: boolean;
79
+ isCommunity: boolean;
80
+ isCommunityAnnounce: boolean;
81
+ joinApprovalMode: boolean;
82
+ memberAddMode: boolean;
83
+ participants: any;
84
+ ephemeralDuration: number | undefined;
85
+ } | null>;
86
+ communityLeave: (id: any) => Promise<void>;
87
+ communityUpdateSubject: (jid: any, subject: any) => Promise<void>;
88
+ communityLinkGroup: (groupJid: any, parentCommunityJid: any) => Promise<void>;
89
+ communityUnlinkGroup: (groupJid: any, parentCommunityJid: any) => Promise<void>;
90
+ communityFetchLinkedGroups: (jid: any) => Promise<{
91
+ communityJid: any;
92
+ isCommunity: boolean;
93
+ linkedGroups: {
94
+ id: string | undefined;
95
+ subject: any;
96
+ creation: number | undefined;
97
+ owner: string | undefined;
98
+ size: number | undefined;
99
+ }[];
100
+ }>;
101
+ communityRequestParticipantsList: (jid: any) => Promise<any>;
102
+ communityRequestParticipantsUpdate: (jid: any, participants: any, action: any) => Promise<any>;
103
+ communityParticipantsUpdate: (jid: any, participants: any, action: any) => Promise<any>;
104
+ communityUpdateDescription: (jid: any, description: any) => Promise<void>;
105
+ communityInviteCode: (jid: any) => Promise<any>;
106
+ communityRevokeInvite: (jid: any) => Promise<any>;
107
+ communityAcceptInvite: (code: any) => Promise<any>;
108
+ /**
109
+ * revoke a v4 invite for someone
110
+ * @param communityJid community jid
111
+ * @param invitedJid jid of person you invited
112
+ * @returns true if successful
113
+ */
114
+ communityRevokeInviteV4: (communityJid: any, invitedJid: any) => Promise<boolean>;
115
+ /**
116
+ * accept a CommunityInviteMessage
117
+ * @param key the key of the invite message, or optionally only provide the jid of the person who sent the invite
118
+ * @param inviteMessage the message to accept
119
+ */
120
+ communityAcceptInviteV4: (...args: any[]) => Promise<any>;
121
+ communityGetInviteInfo: (code: any) => Promise<{
122
+ id: any;
123
+ subject: any;
124
+ subjectOwner: any;
125
+ subjectTime: number;
126
+ size: any;
127
+ creation: number;
128
+ owner: string | undefined;
129
+ desc: any;
130
+ descId: any;
131
+ linkedParent: any;
132
+ restrict: boolean;
133
+ announce: boolean;
134
+ isCommunity: boolean;
135
+ isCommunityAnnounce: boolean;
136
+ joinApprovalMode: boolean;
137
+ memberAddMode: boolean;
138
+ participants: any;
139
+ ephemeralDuration: number | undefined;
140
+ addressingMode: any;
141
+ }>;
142
+ communityToggleEphemeral: (jid: any, ephemeralExpiration: any) => Promise<void>;
143
+ communitySettingUpdate: (jid: any, setting: any) => Promise<void>;
144
+ communityMemberAddMode: (jid: any, mode: any) => Promise<void>;
145
+ communityJoinApprovalMode: (jid: any, mode: any) => Promise<void>;
146
+ communityFetchAllParticipating: () => Promise<{}>;
147
+ logger: any;
148
+ getOrderDetails: (orderId: any, tokenBase64: any) => Promise<{
149
+ price: {
150
+ total: number;
151
+ currency: any;
152
+ };
153
+ products: any;
154
+ }>;
155
+ getCatalog: ({ jid, limit, cursor }: {
156
+ jid: any;
157
+ limit: any;
158
+ cursor: any;
159
+ }) => Promise<{
160
+ products: any;
161
+ nextPageCursor: any;
162
+ }>;
163
+ getCollections: (jid: any, limit?: number) => Promise<{
164
+ collections: any;
165
+ }>;
166
+ productCreate: (create: any) => Promise<{
167
+ id: any;
168
+ imageUrls: {
169
+ requested: any;
170
+ original: any;
171
+ };
172
+ reviewStatus: {
173
+ whatsapp: any;
174
+ };
175
+ availability: string;
176
+ name: any;
177
+ retailerId: any;
178
+ url: any;
179
+ description: any;
180
+ price: number;
181
+ currency: any;
182
+ isHidden: boolean;
183
+ }>;
184
+ productDelete: (productIds: any) => Promise<{
185
+ deleted: number;
186
+ }>;
187
+ productUpdate: (productId: any, update: any) => Promise<{
188
+ id: any;
189
+ imageUrls: {
190
+ requested: any;
191
+ original: any;
192
+ };
193
+ reviewStatus: {
194
+ whatsapp: any;
195
+ };
196
+ availability: string;
197
+ name: any;
198
+ retailerId: any;
199
+ url: any;
200
+ description: any;
201
+ price: number;
202
+ currency: any;
203
+ isHidden: boolean;
204
+ }>;
205
+ updateBussinesProfile: (args: any) => Promise<any>;
206
+ updateBusinessProfile: (args: any) => Promise<any>;
207
+ updateCoverPhoto: (photo: any) => Promise<any>;
208
+ removeCoverPhoto: (id: any) => Promise<any>;
209
+ sendMessageAck: (node: any, errorCode: any) => Promise<void>;
210
+ sendRetryRequest: (node: any, forceIncludeKeys?: boolean) => Promise<void>;
211
+ rejectCall: (callId: any, callFrom: any) => Promise<void>;
212
+ fetchMessageHistory: (count: any, oldestMsgKey: any, oldestMsgTimestamp: any) => Promise<any>;
213
+ requestPlaceholderResend: (messageKey: any, msgData: any) => Promise<any>;
214
+ messageRetryManager: import("../index.js").MessageRetryManager | null;
215
+ userDevicesCache: any;
216
+ devicesMutex: {
217
+ mutex(code: any): any;
218
+ };
219
+ issuePrivacyTokens: (jids: any, timestamp: any) => Promise<any>;
220
+ assertSessions: (jids: any, force: any) => Promise<boolean>;
221
+ relayMessage: (jid: any, message: any, { messageId: msgId, participant, additionalAttributes, additionalNodes, useUserDevicesCache, useCachedGroupMetadata, addBizAttributes, statusJidList }: {
222
+ messageId: any;
223
+ participant: any;
224
+ additionalAttributes: any;
225
+ additionalNodes: any;
226
+ useUserDevicesCache: any;
227
+ useCachedGroupMetadata: any;
228
+ addBizAttributes: any;
229
+ statusJidList: any;
230
+ }) => Promise<any>;
231
+ sendReceipt: (jid: any, participant: any, messageIds: any, type: any) => Promise<void>;
232
+ sendReceipts: (keys: any, type: any) => Promise<void>;
233
+ readMessages: (keys: any) => Promise<void>;
234
+ refreshMediaConn: (forceGet?: boolean) => Promise<any>;
235
+ getMediaHost: () => string;
236
+ waUploadToServer: (filePath: any, { mediaType, fileEncSha256B64, timeoutMs, newsletter }: {
237
+ mediaType: any;
238
+ fileEncSha256B64: any;
239
+ timeoutMs: any;
240
+ newsletter: any;
241
+ }) => Promise<{
242
+ mediaUrl: any;
243
+ directPath: any;
244
+ meta_hmac: any;
245
+ fbid: any;
246
+ ts: any;
247
+ thumbnailDirectPath: any;
248
+ thumbnailSha256: any;
249
+ }>;
250
+ fetchPrivacySettings: (force?: boolean) => Promise<any>;
251
+ sendPeerDataOperationMessage: (pdoMessage: any) => Promise<any>;
252
+ createParticipantNodes: (recipientJids: any, message: any, extraAttrs: any, dsmMessage: any) => Promise<{
253
+ nodes: any[];
254
+ shouldIncludeDeviceIdentity: boolean;
255
+ }>;
256
+ getUSyncDevices: (jids: any, useCache: any, ignoreZeroDevices: any) => Promise<any[]>;
257
+ updateMemberLabel: (jid: any, memberLabel: any) => Promise<any>;
258
+ updateMediaMessage: (message: any) => Promise<any>;
259
+ sendMessage: (jid: any, content: any, options?: {}) => Promise<any>;
260
+ sendReaction: (jid: any, reaction: any, key: any) => Promise<any>;
261
+ downloadMedia: (message: any, type?: string, options?: {}) => Promise<any>;
262
+ copyNForward: (jid: any, message: any, forceForward?: boolean, options?: {}) => Promise<any>;
263
+ executeWMexQuery: (variables: any, queryId: any, dataPath: any) => Promise<any>;
264
+ newsletterCreate: (name: any, description: any) => Promise<{
265
+ id: any;
266
+ owner: undefined;
267
+ name: any;
268
+ creation_time: number;
269
+ description: any;
270
+ invite: any;
271
+ subscribers: number;
272
+ verification: any;
273
+ picture: {
274
+ id: any;
275
+ directPath: any;
276
+ };
277
+ mute_state: any;
278
+ }>;
279
+ newsletterUpdate: (jid: any, updates: any) => Promise<any>;
280
+ newsletterSubscribers: (jid: any) => Promise<any>;
281
+ newsletterSubscribed: () => Promise<any>;
282
+ newsletterMetadata: (type: any, key: any) => Promise<any>;
283
+ newsletterFollow: (jid: any) => Promise<any>;
284
+ newsletterUnfollow: (jid: any) => Promise<any>;
285
+ newsletterMute: (jid: any) => Promise<any>;
286
+ newsletterUnmute: (jid: any) => Promise<any>;
287
+ newsletterUpdateName: (jid: any, name: any) => Promise<any>;
288
+ newsletterUpdateDescription: (jid: any, description: any) => Promise<any>;
289
+ newsletterUpdatePicture: (jid: any, content: any) => Promise<any>;
290
+ newsletterRemovePicture: (jid: any) => Promise<any>;
291
+ newsletterReactMessage: (jid: any, serverId: any, reaction: any) => Promise<void>;
292
+ newsletterFetchMessages: (type: any, key: any, count: any, after: any, before: any) => Promise<any[]>;
293
+ subscribeNewsletterUpdates: (jid: any) => Promise<{
294
+ duration: any;
295
+ } | null>;
296
+ newsletterAdminCount: (jid: any) => Promise<any>;
297
+ newsletterChangeOwner: (jid: any, newOwnerJid: any) => Promise<void>;
298
+ newsletterDemote: (jid: any, userJid: any) => Promise<void>;
299
+ newsletterDelete: (jid: any) => Promise<void>;
300
+ groupQuery: (jid: any, type: any, content: any) => Promise<any>;
301
+ groupMetadata: (jid: any) => Promise<{
302
+ id: any;
303
+ notify: any;
304
+ addressingMode: any;
305
+ subject: any;
306
+ subjectOwner: any;
307
+ subjectOwnerPn: any;
308
+ subjectOwnerUsername: any;
309
+ subjectTime: number;
310
+ size: any;
311
+ creation: number;
312
+ owner: string | undefined;
313
+ ownerPn: string | undefined;
314
+ ownerUsername: any;
315
+ owner_country_code: any;
316
+ desc: any;
317
+ descId: any;
318
+ descOwner: string | undefined;
319
+ descOwnerPn: string | undefined;
320
+ descOwnerUsername: any;
321
+ descTime: number | undefined;
322
+ linkedParent: any;
323
+ restrict: boolean;
324
+ announce: boolean;
325
+ isCommunity: boolean;
326
+ isCommunityAnnounce: boolean;
327
+ joinApprovalMode: boolean;
328
+ memberAddMode: boolean;
329
+ participants: any;
330
+ ephemeralDuration: number | undefined;
331
+ }>;
332
+ groupCreate: (subject: any, participants: any) => Promise<{
333
+ id: any;
334
+ notify: any;
335
+ addressingMode: any;
336
+ subject: any;
337
+ subjectOwner: any;
338
+ subjectOwnerPn: any;
339
+ subjectOwnerUsername: any;
340
+ subjectTime: number;
341
+ size: any;
342
+ creation: number;
343
+ owner: string | undefined;
344
+ ownerPn: string | undefined;
345
+ ownerUsername: any;
346
+ owner_country_code: any;
347
+ desc: any;
348
+ descId: any;
349
+ descOwner: string | undefined;
350
+ descOwnerPn: string | undefined;
351
+ descOwnerUsername: any;
352
+ descTime: number | undefined;
353
+ linkedParent: any;
354
+ restrict: boolean;
355
+ announce: boolean;
356
+ isCommunity: boolean;
357
+ isCommunityAnnounce: boolean;
358
+ joinApprovalMode: boolean;
359
+ memberAddMode: boolean;
360
+ participants: any;
361
+ ephemeralDuration: number | undefined;
362
+ }>;
363
+ groupLeave: (id: any) => Promise<void>;
364
+ groupUpdateSubject: (jid: any, subject: any) => Promise<void>;
365
+ groupRequestParticipantsList: (jid: any) => Promise<any>;
366
+ groupRequestParticipantsUpdate: (jid: any, participants: any, action: any) => Promise<any>;
367
+ groupParticipantsUpdate: (jid: any, participants: any, action: any) => Promise<any[]>;
368
+ groupUpdateDescription: (jid: any, description: any) => Promise<void>;
369
+ groupInviteCode: (jid: any) => Promise<any>;
370
+ groupRevokeInvite: (jid: any) => Promise<any>;
371
+ groupAcceptInvite: (code: any) => Promise<any>;
372
+ groupRevokeInviteV4: (groupJid: any, invitedJid: any) => Promise<boolean>;
373
+ groupAcceptInviteV4: (...args: any[]) => Promise<any>;
374
+ groupGetInviteInfo: (code: any) => Promise<{
375
+ id: any;
376
+ notify: any;
377
+ addressingMode: any;
378
+ subject: any;
379
+ subjectOwner: any;
380
+ subjectOwnerPn: any;
381
+ subjectOwnerUsername: any;
382
+ subjectTime: number;
383
+ size: any;
384
+ creation: number;
385
+ owner: string | undefined;
386
+ ownerPn: string | undefined;
387
+ ownerUsername: any;
388
+ owner_country_code: any;
389
+ desc: any;
390
+ descId: any;
391
+ descOwner: string | undefined;
392
+ descOwnerPn: string | undefined;
393
+ descOwnerUsername: any;
394
+ descTime: number | undefined;
395
+ linkedParent: any;
396
+ restrict: boolean;
397
+ announce: boolean;
398
+ isCommunity: boolean;
399
+ isCommunityAnnounce: boolean;
400
+ joinApprovalMode: boolean;
401
+ memberAddMode: boolean;
402
+ participants: any;
403
+ ephemeralDuration: number | undefined;
404
+ }>;
405
+ groupToggleEphemeral: (jid: any, ephemeralExpiration: any) => Promise<void>;
406
+ groupSettingUpdate: (jid: any, setting: any) => Promise<void>;
407
+ groupMemberAddMode: (jid: any, mode: any) => Promise<void>;
408
+ groupJoinApprovalMode: (jid: any, mode: any) => Promise<void>;
409
+ groupFetchAllParticipating: () => Promise<{}>;
410
+ findUserId: (pnLid: any) => Promise<{
411
+ lid: undefined;
412
+ phoneNumber: undefined;
413
+ }>;
414
+ serverProps: {
415
+ privacyTokenOn1to1: boolean;
416
+ profilePicPrivacyToken: boolean;
417
+ lidTrustedTokenIssueToLid: boolean;
418
+ };
419
+ createCallLink: (type: any, event: any, timeoutMs: any) => Promise<any>;
420
+ getBotListV2: () => Promise<{
421
+ jid: any;
422
+ personaId: any;
423
+ }[]>;
424
+ messageMutex: {
425
+ mutex(code: any): any;
426
+ };
427
+ receiptMutex: {
428
+ mutex(code: any): any;
429
+ };
430
+ appStatePatchMutex: {
431
+ mutex(code: any): any;
432
+ };
433
+ notificationMutex: {
434
+ mutex(code: any): any;
435
+ };
436
+ upsertMessage: (...args: any[]) => Promise<any>;
437
+ appPatch: (patchCreate: any) => Promise<void>;
438
+ sendPresenceUpdate: (type: any, toJid: any) => Promise<void>;
439
+ presenceSubscribe: (toJid: any) => Promise<void>;
440
+ profilePictureUrl: (jid: any, type?: string, timeoutMs?: number, shouldIncludeTcToken?: boolean) => Promise<any>;
441
+ fetchBlocklist: () => Promise<any>;
442
+ fetchStatus: (...jids: any[]) => Promise<any>;
443
+ fetchDisappearingDuration: (...jids: any[]) => Promise<any>;
444
+ updateProfilePicture: (jid: any, content: any, dimensions: any) => Promise<void>;
445
+ removeProfilePicture: (jid: any) => Promise<void>;
446
+ updateProfileStatus: (status: any) => Promise<void>;
447
+ updateProfileName: (name: any) => Promise<void>;
448
+ updateBlockStatus: (jid: any, action: any) => Promise<void>;
449
+ updateDisableLinkPreviewsPrivacy: (isPreviewsDisabled: any) => Promise<void>;
450
+ updateCallPrivacy: (value: any) => Promise<void>;
451
+ updateMessagesPrivacy: (value: any) => Promise<void>;
452
+ updateLastSeenPrivacy: (value: any) => Promise<void>;
453
+ updateOnlinePrivacy: (value: any) => Promise<void>;
454
+ updateProfilePicturePrivacy: (value: any) => Promise<void>;
455
+ updateStatusPrivacy: (value: any) => Promise<void>;
456
+ updateReadReceiptsPrivacy: (value: any) => Promise<void>;
457
+ updateGroupsAddPrivacy: (value: any) => Promise<void>;
458
+ updateDefaultDisappearingMode: (duration: any) => Promise<void>;
459
+ getBusinessProfile: (jid: any) => Promise<{
460
+ wid: any;
461
+ address: any;
462
+ description: any;
463
+ website: any[];
464
+ email: any;
465
+ category: any;
466
+ business_hours: {
467
+ timezone: any;
468
+ business_config: any;
469
+ };
470
+ } | undefined>;
471
+ resyncAppState: (...args: any[]) => Promise<any>;
472
+ chatModify: (mod: any, jid: any) => Promise<void>;
473
+ cleanDirtyBits: (type: any, fromTimestamp: any) => Promise<void>;
474
+ addOrEditContact: (jid: any, contact: any) => Promise<void>;
475
+ removeContact: (jid: any) => Promise<void>;
476
+ placeholderResendCache: any;
477
+ addLabel: (jid: any, labels: any) => Promise<void>;
478
+ addChatLabel: (jid: any, labelId: any) => Promise<void>;
479
+ removeChatLabel: (jid: any, labelId: any) => Promise<void>;
480
+ addMessageLabel: (jid: any, messageId: any, labelId: any) => Promise<void>;
481
+ removeMessageLabel: (jid: any, messageId: any, labelId: any) => Promise<void>;
482
+ star: (jid: any, messages: any, star: any) => Promise<void>;
483
+ addOrEditQuickReply: (quickReply: any) => Promise<void>;
484
+ removeQuickReply: (timestamp: any) => Promise<void>;
485
+ type: string;
486
+ ws: import("./Client/websocket.js").WebSocketClient;
487
+ ev: {
488
+ process(handler: any): () => void;
489
+ emit(event: any, evData: any): any;
490
+ isBuffering(): boolean;
491
+ buffer: () => void;
492
+ flush: () => boolean;
493
+ createBufferedFunction(work: any): (...args: any[]) => Promise<any>;
494
+ on: (...args: any[]) => any;
495
+ off: (...args: any[]) => any;
496
+ removeAllListeners: (...args: any[]) => any;
497
+ destroy(): void;
498
+ };
499
+ authState: {
500
+ creds: any;
501
+ keys: {
502
+ get: (type: any, ids: any) => Promise<any>;
503
+ set: (data: any) => Promise<void>;
504
+ isInTransaction: () => boolean;
505
+ transaction: (work: any, key: any) => Promise<any>;
506
+ };
507
+ };
508
+ signalRepository: any;
509
+ user: any;
510
+ generateMessageTag: () => string;
511
+ query: (node: any, timeoutMs: any) => Promise<any>;
512
+ waitForMessage: (msgId: any, timeoutMs?: any) => Promise<any>;
513
+ waitForSocketOpen: () => Promise<void>;
514
+ sendRawMessage: (data: any) => Promise<void>;
515
+ sendNode: (frame: any) => Promise<void>;
516
+ logout: (msg: any) => Promise<void>;
517
+ end: (error: any) => Promise<void>;
518
+ registerSocketEndHandler: (handler: any) => void;
519
+ onUnexpectedError: (err: any, msg: any) => void;
520
+ uploadPreKeys: (count?: number) => Promise<void>;
521
+ uploadPreKeysToServerIfRequired: () => Promise<void>;
522
+ digestKeyBundle: () => Promise<void>;
523
+ rotateSignedPreKey: () => Promise<void>;
524
+ requestPairingCode: (phoneNumber: any, customPairingCode: any) => Promise<any>;
525
+ updateServerTimeOffset: ({ attrs }: {
526
+ attrs: any;
527
+ }) => void;
528
+ sendUnifiedSession: () => Promise<void>;
529
+ wamBuffer: import("../index.js").BinaryInfo;
530
+ waitForConnectionUpdate: (check: any, timeoutMs: any) => Promise<void>;
531
+ sendWAMBuffer: (wamBuffer: any) => Promise<any>;
532
+ executeUSyncQuery: (usyncQuery: any) => Promise<any>;
533
+ onWhatsApp: (...phoneNumber: any[]) => Promise<any>;
534
+ fetchAccountReachoutTimelock: () => Promise<{
535
+ isActive: boolean;
536
+ timeEnforcementEnds: Date | undefined;
537
+ enforcementType: any;
538
+ }>;
539
+ fetchNewChatMessageCap: () => Promise<any>;
540
+ };
541
+ export function extractCommunityMetadata(result: any): {
542
+ id: any;
543
+ subject: any;
544
+ subjectOwner: any;
545
+ subjectTime: number;
546
+ size: any;
547
+ creation: number;
548
+ owner: string | undefined;
549
+ desc: any;
550
+ descId: any;
551
+ linkedParent: any;
552
+ restrict: boolean;
553
+ announce: boolean;
554
+ isCommunity: boolean;
555
+ isCommunityAnnounce: boolean;
556
+ joinApprovalMode: boolean;
557
+ memberAddMode: boolean;
558
+ participants: any;
559
+ ephemeralDuration: number | undefined;
560
+ addressingMode: any;
561
+ };