@dhilzzkz/baileys 0.0.0-stage → 0.1.0

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