@vanzxy/baileys 1.3.7 → 1.3.9

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 (127) hide show
  1. package/NOTICE.md +41 -0
  2. package/README.md +1 -1
  3. package/WAProto/index.d.ts +9 -0
  4. package/lib/Defaults/index.d.ts +147 -0
  5. package/lib/Defaults/index.js +2 -2
  6. package/lib/Signal/Group/ciphertext-message.d.ts +9 -0
  7. package/lib/Signal/Group/group-session-builder.d.ts +7 -0
  8. package/lib/Signal/Group/group_cipher.d.ts +10 -0
  9. package/lib/Signal/Group/index.d.ts +11 -0
  10. package/lib/Signal/Group/keyhelper.d.ts +6 -0
  11. package/lib/Signal/Group/sender-chain-key.d.ts +13 -0
  12. package/lib/Signal/Group/sender-key-distribution-message.d.ts +16 -0
  13. package/lib/Signal/Group/sender-key-message.d.ts +18 -0
  14. package/lib/Signal/Group/sender-key-name.d.ts +11 -0
  15. package/lib/Signal/Group/sender-key-record.d.ts +12 -0
  16. package/lib/Signal/Group/sender-key-state.d.ts +16 -0
  17. package/lib/Signal/Group/sender-message-key.d.ts +11 -0
  18. package/lib/Signal/libsignal.d.ts +54 -0
  19. package/lib/Signal/lid-mapping.d.ts +20 -0
  20. package/lib/Socket/Client/index.d.ts +2 -0
  21. package/lib/Socket/Client/types.d.ts +5 -0
  22. package/lib/Socket/Client/websocket.d.ts +12 -0
  23. package/lib/Socket/business.d.ts +395 -0
  24. package/lib/Socket/chats.d.ts +136 -0
  25. package/lib/Socket/communities.d.ts +561 -0
  26. package/lib/Socket/communities.js +4 -2
  27. package/lib/Socket/dugong.d.ts +117 -0
  28. package/lib/Socket/dugong.js +26 -1
  29. package/lib/Socket/groups.d.ts +285 -0
  30. package/lib/Socket/index.d.ts +531 -0
  31. package/lib/Socket/messages-recv.d.ts +333 -0
  32. package/lib/Socket/messages-send.d.ts +329 -0
  33. package/lib/Socket/mex.d.ts +1 -0
  34. package/lib/Socket/newsletter.d.ts +281 -0
  35. package/lib/Socket/newsletter.js +19 -19
  36. package/lib/Socket/socket.d.ts +60 -0
  37. package/lib/Store/index.d.ts +3 -0
  38. package/lib/Store/make-in-memory-store.d.ts +62 -0
  39. package/lib/Store/make-ordered-dictionary.d.ts +12 -0
  40. package/lib/Store/object-repository.d.ts +10 -0
  41. package/lib/Types/Auth.d.ts +117 -0
  42. package/lib/Types/Bussines.d.ts +25 -0
  43. package/lib/Types/Call.d.ts +15 -0
  44. package/lib/Types/Chat.d.ts +124 -0
  45. package/lib/Types/Contact.d.ts +26 -0
  46. package/lib/Types/Events.d.ts +256 -0
  47. package/lib/Types/GroupMetadata.d.ts +71 -0
  48. package/lib/Types/Label.d.ts +2 -0
  49. package/lib/Types/LabelAssociation.d.ts +2 -0
  50. package/lib/Types/Message.d.ts +11 -0
  51. package/lib/Types/Mex.d.ts +2 -0
  52. package/lib/Types/Product.d.ts +79 -0
  53. package/lib/Types/RichType.d.ts +2 -0
  54. package/lib/Types/Signal.d.ts +87 -0
  55. package/lib/Types/Socket.d.ts +136 -0
  56. package/lib/Types/State.d.ts +5 -0
  57. package/lib/Types/USync.d.ts +26 -0
  58. package/lib/Types/index.d.ts +66 -0
  59. package/lib/Utils/MessageBuilder.js +2297 -0
  60. package/lib/Utils/auth-utils.d.ts +57 -0
  61. package/lib/Utils/browser-utils.d.ts +8 -0
  62. package/lib/Utils/business.d.ts +49 -0
  63. package/lib/Utils/business.js +2 -1
  64. package/lib/Utils/chat-utils.d.ts +407 -0
  65. package/lib/Utils/chat-utils.js +15 -1
  66. package/lib/Utils/companion-reg-client-utils.d.ts +4 -0
  67. package/lib/Utils/crypto.d.ts +41 -0
  68. package/lib/Utils/decode-wa-message.d.ts +83 -0
  69. package/lib/Utils/decode-wa-message.js +1 -3
  70. package/lib/Utils/event-buffer.d.ts +12 -0
  71. package/lib/Utils/generics.d.ts +63 -0
  72. package/lib/Utils/generics.js +2 -4
  73. package/lib/Utils/history.d.ts +90 -0
  74. package/lib/Utils/identity-change-handler.d.ts +13 -0
  75. package/lib/Utils/index.d.ts +24 -0
  76. package/lib/Utils/index.js +1 -0
  77. package/lib/Utils/link-preview.d.ts +12 -0
  78. package/lib/Utils/logger.d.ts +2 -0
  79. package/lib/Utils/lt-hash.d.ts +12 -0
  80. package/lib/Utils/lt-hash.js +21 -2
  81. package/lib/Utils/make-mutex.d.ts +6 -0
  82. package/lib/Utils/message-retry-manager.d.ts +79 -0
  83. package/lib/Utils/messages-media.d.ts +135 -0
  84. package/lib/Utils/messages.d.ts +44 -0
  85. package/lib/Utils/noise-handler.d.ts +20 -0
  86. package/lib/Utils/offline-node-processor.d.ts +9 -0
  87. package/lib/Utils/pre-key-manager.d.ts +25 -0
  88. package/lib/Utils/process-message.d.ts +82 -0
  89. package/lib/Utils/reporting-utils.d.ts +12 -0
  90. package/lib/Utils/rich-message-utils.d.ts +48 -0
  91. package/lib/Utils/rich-message-utils.js +32 -7
  92. package/lib/Utils/signal.d.ts +82 -0
  93. package/lib/Utils/stanza-ack.d.ts +16 -0
  94. package/lib/Utils/sync-action-utils.d.ts +2 -0
  95. package/lib/Utils/tc-token-utils.d.ts +29 -0
  96. package/lib/Utils/use-multi-file-auth-state.d.ts +10 -0
  97. package/lib/Utils/use-single-file-auth-state.d.ts +10 -0
  98. package/lib/Utils/use-single-file-auth-state.js +6 -1
  99. package/lib/Utils/use-sqlite-auth-state.d.ts +11 -0
  100. package/lib/Utils/use-sqlite-auth-state.js +12 -0
  101. package/lib/Utils/validate-connection.d.ts +42 -0
  102. package/lib/WABinary/constants.d.ts +61 -0
  103. package/lib/WABinary/decode.d.ts +9 -0
  104. package/lib/WABinary/encode.d.ts +2 -0
  105. package/lib/WABinary/generic-utils.d.ts +74 -0
  106. package/lib/WABinary/index.d.ts +5 -0
  107. package/lib/WABinary/jid-utils.d.ts +28 -0
  108. package/lib/WABinary/types.d.ts +19 -0
  109. package/lib/WAM/BinaryInfo.d.ts +7 -0
  110. package/lib/WAM/constants.d.ts +34926 -0
  111. package/lib/WAM/encode.d.ts +1 -0
  112. package/lib/WAM/index.d.ts +3 -0
  113. package/lib/WAUSync/Protocols/USyncContactProtocol.d.ts +36 -0
  114. package/lib/WAUSync/Protocols/USyncDeviceProtocol.d.ts +29 -0
  115. package/lib/WAUSync/Protocols/USyncDisappearingModeProtocol.d.ts +12 -0
  116. package/lib/WAUSync/Protocols/USyncStatusProtocol.d.ts +12 -0
  117. package/lib/WAUSync/Protocols/USyncUsernameProtocol.d.ts +9 -0
  118. package/lib/WAUSync/Protocols/UsyncBotProfileProtocol.d.ts +38 -0
  119. package/lib/WAUSync/Protocols/UsyncLIDProtocol.d.ts +14 -0
  120. package/lib/WAUSync/Protocols/index.d.ts +7 -0
  121. package/lib/WAUSync/USyncQuery.d.ts +20 -0
  122. package/lib/WAUSync/USyncUser.d.ts +16 -0
  123. package/lib/WAUSync/index.d.ts +3 -0
  124. package/lib/index.d.ts +12 -0
  125. package/package.json +17 -7
  126. package/postinstall-banner.js +23 -0
  127. package/LICENSE +0 -23
@@ -0,0 +1,395 @@
1
+ export function makeBusinessSocket(config: any): {
2
+ logger: any;
3
+ getOrderDetails: (orderId: any, tokenBase64: any) => Promise<{
4
+ price: {
5
+ total: number;
6
+ currency: any;
7
+ };
8
+ products: any;
9
+ }>;
10
+ getCatalog: ({ jid, limit, cursor }: {
11
+ jid: any;
12
+ limit: any;
13
+ cursor: any;
14
+ }) => Promise<{
15
+ products: any;
16
+ nextPageCursor: any;
17
+ }>;
18
+ getCollections: (jid: any, limit?: number) => Promise<{
19
+ collections: any;
20
+ }>;
21
+ productCreate: (create: any) => Promise<{
22
+ id: any;
23
+ imageUrls: {
24
+ requested: any;
25
+ original: any;
26
+ };
27
+ reviewStatus: {
28
+ whatsapp: any;
29
+ };
30
+ availability: string;
31
+ name: any;
32
+ retailerId: any;
33
+ url: any;
34
+ description: any;
35
+ price: number;
36
+ currency: any;
37
+ isHidden: boolean;
38
+ }>;
39
+ productDelete: (productIds: any) => Promise<{
40
+ deleted: number;
41
+ }>;
42
+ productUpdate: (productId: any, update: any) => Promise<{
43
+ id: any;
44
+ imageUrls: {
45
+ requested: any;
46
+ original: any;
47
+ };
48
+ reviewStatus: {
49
+ whatsapp: any;
50
+ };
51
+ availability: string;
52
+ name: any;
53
+ retailerId: any;
54
+ url: any;
55
+ description: any;
56
+ price: number;
57
+ currency: any;
58
+ isHidden: boolean;
59
+ }>;
60
+ updateBussinesProfile: (args: any) => Promise<any>;
61
+ updateBusinessProfile: (args: any) => Promise<any>;
62
+ updateCoverPhoto: (photo: any) => Promise<any>;
63
+ removeCoverPhoto: (id: any) => Promise<any>;
64
+ sendMessageAck: (node: any, errorCode: any) => Promise<void>;
65
+ sendRetryRequest: (node: any, forceIncludeKeys?: boolean) => Promise<void>;
66
+ rejectCall: (callId: any, callFrom: any) => Promise<void>;
67
+ fetchMessageHistory: (count: any, oldestMsgKey: any, oldestMsgTimestamp: any) => Promise<any>;
68
+ requestPlaceholderResend: (messageKey: any, msgData: any) => Promise<any>;
69
+ messageRetryManager: import("../index.js").MessageRetryManager | null;
70
+ userDevicesCache: any;
71
+ devicesMutex: {
72
+ mutex(code: any): any;
73
+ };
74
+ issuePrivacyTokens: (jids: any, timestamp: any) => Promise<any>;
75
+ assertSessions: (jids: any, force: any) => Promise<boolean>;
76
+ relayMessage: (jid: any, message: any, { messageId: msgId, participant, additionalAttributes, additionalNodes, useUserDevicesCache, useCachedGroupMetadata, addBizAttributes, statusJidList }: {
77
+ messageId: any;
78
+ participant: any;
79
+ additionalAttributes: any;
80
+ additionalNodes: any;
81
+ useUserDevicesCache: any;
82
+ useCachedGroupMetadata: any;
83
+ addBizAttributes: any;
84
+ statusJidList: any;
85
+ }) => Promise<any>;
86
+ sendReceipt: (jid: any, participant: any, messageIds: any, type: any) => Promise<void>;
87
+ sendReceipts: (keys: any, type: any) => Promise<void>;
88
+ readMessages: (keys: any) => Promise<void>;
89
+ refreshMediaConn: (forceGet?: boolean) => Promise<any>;
90
+ getMediaHost: () => string;
91
+ waUploadToServer: (filePath: any, { mediaType, fileEncSha256B64, timeoutMs, newsletter }: {
92
+ mediaType: any;
93
+ fileEncSha256B64: any;
94
+ timeoutMs: any;
95
+ newsletter: any;
96
+ }) => Promise<{
97
+ mediaUrl: any;
98
+ directPath: any;
99
+ meta_hmac: any;
100
+ fbid: any;
101
+ ts: any;
102
+ thumbnailDirectPath: any;
103
+ thumbnailSha256: any;
104
+ }>;
105
+ fetchPrivacySettings: (force?: boolean) => Promise<any>;
106
+ sendPeerDataOperationMessage: (pdoMessage: any) => Promise<any>;
107
+ createParticipantNodes: (recipientJids: any, message: any, extraAttrs: any, dsmMessage: any) => Promise<{
108
+ nodes: any[];
109
+ shouldIncludeDeviceIdentity: boolean;
110
+ }>;
111
+ getUSyncDevices: (jids: any, useCache: any, ignoreZeroDevices: any) => Promise<any[]>;
112
+ updateMemberLabel: (jid: any, memberLabel: any) => Promise<any>;
113
+ updateMediaMessage: (message: any) => Promise<any>;
114
+ sendMessage: (jid: any, content: any, options?: {}) => Promise<any>;
115
+ sendReaction: (jid: any, reaction: any, key: any) => Promise<any>;
116
+ downloadMedia: (message: any, type?: string, options?: {}) => Promise<any>;
117
+ copyNForward: (jid: any, message: any, forceForward?: boolean, options?: {}) => Promise<any>;
118
+ executeWMexQuery: (variables: any, queryId: any, dataPath: any) => Promise<any>;
119
+ newsletterCreate: (name: any, description: any) => Promise<{
120
+ id: any;
121
+ owner: undefined;
122
+ name: any;
123
+ creation_time: number;
124
+ description: any;
125
+ invite: any;
126
+ subscribers: number;
127
+ verification: any;
128
+ picture: {
129
+ id: any;
130
+ directPath: any;
131
+ };
132
+ mute_state: any;
133
+ }>;
134
+ newsletterUpdate: (jid: any, updates: any) => Promise<any>;
135
+ newsletterSubscribers: (jid: any) => Promise<any>;
136
+ newsletterSubscribed: () => Promise<any>;
137
+ newsletterMetadata: (type: any, key: any) => Promise<any>;
138
+ newsletterFollow: (jid: any) => Promise<any>;
139
+ newsletterUnfollow: (jid: any) => Promise<any>;
140
+ newsletterMute: (jid: any) => Promise<any>;
141
+ newsletterUnmute: (jid: any) => Promise<any>;
142
+ newsletterUpdateName: (jid: any, name: any) => Promise<any>;
143
+ newsletterUpdateDescription: (jid: any, description: any) => Promise<any>;
144
+ newsletterUpdatePicture: (jid: any, content: any) => Promise<any>;
145
+ newsletterRemovePicture: (jid: any) => Promise<any>;
146
+ newsletterReactMessage: (jid: any, serverId: any, reaction: any) => Promise<void>;
147
+ newsletterFetchMessages: (type: any, key: any, count: any, after: any, before: any) => Promise<any[]>;
148
+ subscribeNewsletterUpdates: (jid: any) => Promise<{
149
+ duration: any;
150
+ } | null>;
151
+ newsletterAdminCount: (jid: any) => Promise<any>;
152
+ newsletterChangeOwner: (jid: any, newOwnerJid: any) => Promise<void>;
153
+ newsletterDemote: (jid: any, userJid: any) => Promise<void>;
154
+ newsletterDelete: (jid: any) => Promise<void>;
155
+ groupQuery: (jid: any, type: any, content: any) => Promise<any>;
156
+ groupMetadata: (jid: any) => Promise<{
157
+ id: any;
158
+ notify: any;
159
+ addressingMode: any;
160
+ subject: any;
161
+ subjectOwner: any;
162
+ subjectOwnerPn: any;
163
+ subjectOwnerUsername: any;
164
+ subjectTime: number;
165
+ size: any;
166
+ creation: number;
167
+ owner: string | undefined;
168
+ ownerPn: string | undefined;
169
+ ownerUsername: any;
170
+ owner_country_code: any;
171
+ desc: any;
172
+ descId: any;
173
+ descOwner: string | undefined;
174
+ descOwnerPn: string | undefined;
175
+ descOwnerUsername: any;
176
+ descTime: number | undefined;
177
+ linkedParent: any;
178
+ restrict: boolean;
179
+ announce: boolean;
180
+ isCommunity: boolean;
181
+ isCommunityAnnounce: boolean;
182
+ joinApprovalMode: boolean;
183
+ memberAddMode: boolean;
184
+ participants: any;
185
+ ephemeralDuration: number | undefined;
186
+ }>;
187
+ groupCreate: (subject: any, participants: any) => Promise<{
188
+ id: any;
189
+ notify: any;
190
+ addressingMode: any;
191
+ subject: any;
192
+ subjectOwner: any;
193
+ subjectOwnerPn: any;
194
+ subjectOwnerUsername: any;
195
+ subjectTime: number;
196
+ size: any;
197
+ creation: number;
198
+ owner: string | undefined;
199
+ ownerPn: string | undefined;
200
+ ownerUsername: any;
201
+ owner_country_code: any;
202
+ desc: any;
203
+ descId: any;
204
+ descOwner: string | undefined;
205
+ descOwnerPn: string | undefined;
206
+ descOwnerUsername: any;
207
+ descTime: number | undefined;
208
+ linkedParent: any;
209
+ restrict: boolean;
210
+ announce: boolean;
211
+ isCommunity: boolean;
212
+ isCommunityAnnounce: boolean;
213
+ joinApprovalMode: boolean;
214
+ memberAddMode: boolean;
215
+ participants: any;
216
+ ephemeralDuration: number | undefined;
217
+ }>;
218
+ groupLeave: (id: any) => Promise<void>;
219
+ groupUpdateSubject: (jid: any, subject: any) => Promise<void>;
220
+ groupRequestParticipantsList: (jid: any) => Promise<any>;
221
+ groupRequestParticipantsUpdate: (jid: any, participants: any, action: any) => Promise<any>;
222
+ groupParticipantsUpdate: (jid: any, participants: any, action: any) => Promise<any[]>;
223
+ groupUpdateDescription: (jid: any, description: any) => Promise<void>;
224
+ groupInviteCode: (jid: any) => Promise<any>;
225
+ groupRevokeInvite: (jid: any) => Promise<any>;
226
+ groupAcceptInvite: (code: any) => Promise<any>;
227
+ groupRevokeInviteV4: (groupJid: any, invitedJid: any) => Promise<boolean>;
228
+ groupAcceptInviteV4: (...args: any[]) => Promise<any>;
229
+ groupGetInviteInfo: (code: any) => Promise<{
230
+ id: any;
231
+ notify: any;
232
+ addressingMode: any;
233
+ subject: any;
234
+ subjectOwner: any;
235
+ subjectOwnerPn: any;
236
+ subjectOwnerUsername: any;
237
+ subjectTime: number;
238
+ size: any;
239
+ creation: number;
240
+ owner: string | undefined;
241
+ ownerPn: string | undefined;
242
+ ownerUsername: any;
243
+ owner_country_code: any;
244
+ desc: any;
245
+ descId: any;
246
+ descOwner: string | undefined;
247
+ descOwnerPn: string | undefined;
248
+ descOwnerUsername: any;
249
+ descTime: number | undefined;
250
+ linkedParent: any;
251
+ restrict: boolean;
252
+ announce: boolean;
253
+ isCommunity: boolean;
254
+ isCommunityAnnounce: boolean;
255
+ joinApprovalMode: boolean;
256
+ memberAddMode: boolean;
257
+ participants: any;
258
+ ephemeralDuration: number | undefined;
259
+ }>;
260
+ groupToggleEphemeral: (jid: any, ephemeralExpiration: any) => Promise<void>;
261
+ groupSettingUpdate: (jid: any, setting: any) => Promise<void>;
262
+ groupMemberAddMode: (jid: any, mode: any) => Promise<void>;
263
+ groupJoinApprovalMode: (jid: any, mode: any) => Promise<void>;
264
+ groupFetchAllParticipating: () => Promise<{}>;
265
+ findUserId: (pnLid: any) => Promise<{
266
+ lid: undefined;
267
+ phoneNumber: undefined;
268
+ }>;
269
+ serverProps: {
270
+ privacyTokenOn1to1: boolean;
271
+ profilePicPrivacyToken: boolean;
272
+ lidTrustedTokenIssueToLid: boolean;
273
+ };
274
+ createCallLink: (type: any, event: any, timeoutMs: any) => Promise<any>;
275
+ getBotListV2: () => Promise<{
276
+ jid: any;
277
+ personaId: any;
278
+ }[]>;
279
+ messageMutex: {
280
+ mutex(code: any): any;
281
+ };
282
+ receiptMutex: {
283
+ mutex(code: any): any;
284
+ };
285
+ appStatePatchMutex: {
286
+ mutex(code: any): any;
287
+ };
288
+ notificationMutex: {
289
+ mutex(code: any): any;
290
+ };
291
+ upsertMessage: (...args: any[]) => Promise<any>;
292
+ appPatch: (patchCreate: any) => Promise<void>;
293
+ sendPresenceUpdate: (type: any, toJid: any) => Promise<void>;
294
+ presenceSubscribe: (toJid: any) => Promise<void>;
295
+ profilePictureUrl: (jid: any, type?: string, timeoutMs?: number, shouldIncludeTcToken?: boolean) => Promise<any>;
296
+ fetchBlocklist: () => Promise<any>;
297
+ fetchStatus: (...jids: any[]) => Promise<any>;
298
+ fetchDisappearingDuration: (...jids: any[]) => Promise<any>;
299
+ updateProfilePicture: (jid: any, content: any, dimensions: any) => Promise<void>;
300
+ removeProfilePicture: (jid: any) => Promise<void>;
301
+ updateProfileStatus: (status: any) => Promise<void>;
302
+ updateProfileName: (name: any) => Promise<void>;
303
+ updateBlockStatus: (jid: any, action: any) => Promise<void>;
304
+ updateDisableLinkPreviewsPrivacy: (isPreviewsDisabled: any) => Promise<void>;
305
+ updateCallPrivacy: (value: any) => Promise<void>;
306
+ updateMessagesPrivacy: (value: any) => Promise<void>;
307
+ updateLastSeenPrivacy: (value: any) => Promise<void>;
308
+ updateOnlinePrivacy: (value: any) => Promise<void>;
309
+ updateProfilePicturePrivacy: (value: any) => Promise<void>;
310
+ updateStatusPrivacy: (value: any) => Promise<void>;
311
+ updateReadReceiptsPrivacy: (value: any) => Promise<void>;
312
+ updateGroupsAddPrivacy: (value: any) => Promise<void>;
313
+ updateDefaultDisappearingMode: (duration: any) => Promise<void>;
314
+ getBusinessProfile: (jid: any) => Promise<{
315
+ wid: any;
316
+ address: any;
317
+ description: any;
318
+ website: any[];
319
+ email: any;
320
+ category: any;
321
+ business_hours: {
322
+ timezone: any;
323
+ business_config: any;
324
+ };
325
+ } | undefined>;
326
+ resyncAppState: (...args: any[]) => Promise<any>;
327
+ chatModify: (mod: any, jid: any) => Promise<void>;
328
+ cleanDirtyBits: (type: any, fromTimestamp: any) => Promise<void>;
329
+ addOrEditContact: (jid: any, contact: any) => Promise<void>;
330
+ removeContact: (jid: any) => Promise<void>;
331
+ placeholderResendCache: any;
332
+ addLabel: (jid: any, labels: any) => Promise<void>;
333
+ addChatLabel: (jid: any, labelId: any) => Promise<void>;
334
+ removeChatLabel: (jid: any, labelId: any) => Promise<void>;
335
+ addMessageLabel: (jid: any, messageId: any, labelId: any) => Promise<void>;
336
+ removeMessageLabel: (jid: any, messageId: any, labelId: any) => Promise<void>;
337
+ star: (jid: any, messages: any, star: any) => Promise<void>;
338
+ addOrEditQuickReply: (quickReply: any) => Promise<void>;
339
+ removeQuickReply: (timestamp: any) => Promise<void>;
340
+ type: string;
341
+ ws: import("./Client/websocket.js").WebSocketClient;
342
+ ev: {
343
+ process(handler: any): () => void;
344
+ emit(event: any, evData: any): any;
345
+ isBuffering(): boolean;
346
+ buffer: () => void;
347
+ flush: () => boolean;
348
+ createBufferedFunction(work: any): (...args: any[]) => Promise<any>;
349
+ on: (...args: any[]) => any;
350
+ off: (...args: any[]) => any;
351
+ removeAllListeners: (...args: any[]) => any;
352
+ destroy(): void;
353
+ };
354
+ authState: {
355
+ creds: any;
356
+ keys: {
357
+ get: (type: any, ids: any) => Promise<any>;
358
+ set: (data: any) => Promise<void>;
359
+ isInTransaction: () => boolean;
360
+ transaction: (work: any, key: any) => Promise<any>;
361
+ };
362
+ };
363
+ signalRepository: any;
364
+ user: any;
365
+ generateMessageTag: () => string;
366
+ query: (node: any, timeoutMs: any) => Promise<any>;
367
+ waitForMessage: (msgId: any, timeoutMs?: any) => Promise<any>;
368
+ waitForSocketOpen: () => Promise<void>;
369
+ sendRawMessage: (data: any) => Promise<void>;
370
+ sendNode: (frame: any) => Promise<void>;
371
+ logout: (msg: any) => Promise<void>;
372
+ end: (error: any) => Promise<void>;
373
+ registerSocketEndHandler: (handler: any) => void;
374
+ onUnexpectedError: (err: any, msg: any) => void;
375
+ uploadPreKeys: (count?: number) => Promise<void>;
376
+ uploadPreKeysToServerIfRequired: () => Promise<void>;
377
+ digestKeyBundle: () => Promise<void>;
378
+ rotateSignedPreKey: () => Promise<void>;
379
+ requestPairingCode: (phoneNumber: any, customPairingCode: any) => Promise<any>;
380
+ updateServerTimeOffset: ({ attrs }: {
381
+ attrs: any;
382
+ }) => void;
383
+ sendUnifiedSession: () => Promise<void>;
384
+ wamBuffer: import("../index.js").BinaryInfo;
385
+ waitForConnectionUpdate: (check: any, timeoutMs: any) => Promise<void>;
386
+ sendWAMBuffer: (wamBuffer: any) => Promise<any>;
387
+ executeUSyncQuery: (usyncQuery: any) => Promise<any>;
388
+ onWhatsApp: (...phoneNumber: any[]) => Promise<any>;
389
+ fetchAccountReachoutTimelock: () => Promise<{
390
+ isActive: boolean;
391
+ timeEnforcementEnds: Date | undefined;
392
+ enforcementType: any;
393
+ }>;
394
+ fetchNewChatMessageCap: () => Promise<any>;
395
+ };
@@ -0,0 +1,136 @@
1
+ export function makeChatsSocket(config: any): {
2
+ findUserId: (pnLid: any) => Promise<{
3
+ lid: undefined;
4
+ phoneNumber: undefined;
5
+ }>;
6
+ serverProps: {
7
+ /** AB prop 10518: gate tctoken on 1:1 messages. Default true (safe: avoids 463). */
8
+ privacyTokenOn1to1: boolean;
9
+ /** AB prop 9666: gate tctoken on profile picture IQs. WA Web default: true. */
10
+ profilePicPrivacyToken: boolean;
11
+ /** AB prop 14303: issue tctokens to LID instead of PN. WA Web default: false. */
12
+ lidTrustedTokenIssueToLid: boolean;
13
+ };
14
+ createCallLink: (type: any, event: any, timeoutMs: any) => Promise<any>;
15
+ getBotListV2: () => Promise<{
16
+ jid: any;
17
+ personaId: any;
18
+ }[]>;
19
+ messageMutex: {
20
+ mutex(code: any): any;
21
+ };
22
+ receiptMutex: {
23
+ mutex(code: any): any;
24
+ };
25
+ appStatePatchMutex: {
26
+ mutex(code: any): any;
27
+ };
28
+ notificationMutex: {
29
+ mutex(code: any): any;
30
+ };
31
+ fetchPrivacySettings: (force?: boolean) => Promise<any>;
32
+ upsertMessage: (...args: any[]) => Promise<any>;
33
+ appPatch: (patchCreate: any) => Promise<void>;
34
+ sendPresenceUpdate: (type: any, toJid: any) => Promise<void>;
35
+ presenceSubscribe: (toJid: any) => Promise<void>;
36
+ profilePictureUrl: (jid: any, type?: string, timeoutMs?: number, shouldIncludeTcToken?: boolean) => Promise<any>;
37
+ fetchBlocklist: () => Promise<any>;
38
+ fetchStatus: (...jids: any[]) => Promise<any>;
39
+ fetchDisappearingDuration: (...jids: any[]) => Promise<any>;
40
+ updateProfilePicture: (jid: any, content: any, dimensions: any) => Promise<void>;
41
+ removeProfilePicture: (jid: any) => Promise<void>;
42
+ updateProfileStatus: (status: any) => Promise<void>;
43
+ updateProfileName: (name: any) => Promise<void>;
44
+ updateBlockStatus: (jid: any, action: any) => Promise<void>;
45
+ updateDisableLinkPreviewsPrivacy: (isPreviewsDisabled: any) => Promise<void>;
46
+ updateCallPrivacy: (value: any) => Promise<void>;
47
+ updateMessagesPrivacy: (value: any) => Promise<void>;
48
+ updateLastSeenPrivacy: (value: any) => Promise<void>;
49
+ updateOnlinePrivacy: (value: any) => Promise<void>;
50
+ updateProfilePicturePrivacy: (value: any) => Promise<void>;
51
+ updateStatusPrivacy: (value: any) => Promise<void>;
52
+ updateReadReceiptsPrivacy: (value: any) => Promise<void>;
53
+ updateGroupsAddPrivacy: (value: any) => Promise<void>;
54
+ updateDefaultDisappearingMode: (duration: any) => Promise<void>;
55
+ getBusinessProfile: (jid: any) => Promise<{
56
+ wid: any;
57
+ address: any;
58
+ description: any;
59
+ website: any[];
60
+ email: any;
61
+ category: any;
62
+ business_hours: {
63
+ timezone: any;
64
+ business_config: any;
65
+ };
66
+ } | undefined>;
67
+ resyncAppState: (...args: any[]) => Promise<any>;
68
+ chatModify: (mod: any, jid: any) => Promise<void>;
69
+ cleanDirtyBits: (type: any, fromTimestamp: any) => Promise<void>;
70
+ addOrEditContact: (jid: any, contact: any) => Promise<void>;
71
+ removeContact: (jid: any) => Promise<void>;
72
+ placeholderResendCache: any;
73
+ addLabel: (jid: any, labels: any) => Promise<void>;
74
+ addChatLabel: (jid: any, labelId: any) => Promise<void>;
75
+ removeChatLabel: (jid: any, labelId: any) => Promise<void>;
76
+ addMessageLabel: (jid: any, messageId: any, labelId: any) => Promise<void>;
77
+ removeMessageLabel: (jid: any, messageId: any, labelId: any) => Promise<void>;
78
+ star: (jid: any, messages: any, star: any) => Promise<void>;
79
+ addOrEditQuickReply: (quickReply: any) => Promise<void>;
80
+ removeQuickReply: (timestamp: any) => Promise<void>;
81
+ type: string;
82
+ ws: import("./Client/websocket.js").WebSocketClient;
83
+ ev: {
84
+ process(handler: any): () => void;
85
+ emit(event: any, evData: any): any;
86
+ isBuffering(): boolean;
87
+ buffer: () => void;
88
+ flush: () => boolean;
89
+ createBufferedFunction(work: any): (...args: any[]) => Promise<any>;
90
+ on: (...args: any[]) => any;
91
+ off: (...args: any[]) => any;
92
+ removeAllListeners: (...args: any[]) => any;
93
+ destroy(): void;
94
+ };
95
+ authState: {
96
+ creds: any;
97
+ keys: {
98
+ get: (type: any, ids: any) => Promise<any>;
99
+ set: (data: any) => Promise<void>;
100
+ isInTransaction: () => boolean;
101
+ transaction: (work: any, key: any) => Promise<any>;
102
+ };
103
+ };
104
+ signalRepository: any;
105
+ user: any;
106
+ generateMessageTag: () => string;
107
+ query: (node: any, timeoutMs: any) => Promise<any>;
108
+ waitForMessage: (msgId: any, timeoutMs?: any) => Promise<any>;
109
+ waitForSocketOpen: () => Promise<void>;
110
+ sendRawMessage: (data: any) => Promise<void>;
111
+ sendNode: (frame: any) => Promise<void>;
112
+ logout: (msg: any) => Promise<void>;
113
+ end: (error: any) => Promise<void>;
114
+ registerSocketEndHandler: (handler: any) => void;
115
+ onUnexpectedError: (err: any, msg: any) => void;
116
+ uploadPreKeys: (count?: number) => Promise<void>;
117
+ uploadPreKeysToServerIfRequired: () => Promise<void>;
118
+ digestKeyBundle: () => Promise<void>;
119
+ rotateSignedPreKey: () => Promise<void>;
120
+ requestPairingCode: (phoneNumber: any, customPairingCode: any) => Promise<any>;
121
+ updateServerTimeOffset: ({ attrs }: {
122
+ attrs: any;
123
+ }) => void;
124
+ sendUnifiedSession: () => Promise<void>;
125
+ wamBuffer: import("../index.js").BinaryInfo;
126
+ waitForConnectionUpdate: (check: any, timeoutMs: any) => Promise<void>;
127
+ sendWAMBuffer: (wamBuffer: any) => Promise<any>;
128
+ executeUSyncQuery: (usyncQuery: any) => Promise<any>;
129
+ onWhatsApp: (...phoneNumber: any[]) => Promise<any>;
130
+ fetchAccountReachoutTimelock: () => Promise<{
131
+ isActive: boolean;
132
+ timeEnforcementEnds: Date | undefined;
133
+ enforcementType: any;
134
+ }>;
135
+ fetchNewChatMessageCap: () => Promise<any>;
136
+ };