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