cuki-bailx 1.2.4 → 1.2.6

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 (157) hide show
  1. package/LICENSE +21 -0
  2. package/WAProto/GenerateStatics.sh +4 -0
  3. package/WAProto/WAProto.proto +4775 -0
  4. package/WAProto/index.js +56886 -17506
  5. package/engine-requirements.js +1 -1
  6. package/lib/Defaults/index.js +98 -108
  7. package/lib/Defaults/vyzen-baileysx-version.json +3 -0
  8. package/lib/Signal/libsignal.js +2 -0
  9. package/lib/Socket/Client/index.js +2 -3
  10. package/lib/Socket/Client/{web-socket-client.js → websocket.js} +54 -5
  11. package/lib/Socket/chats.js +224 -173
  12. package/lib/Socket/groups.js +20 -5
  13. package/lib/Socket/index.js +2 -2
  14. package/lib/Socket/messages-recv.js +10 -66
  15. package/lib/Socket/messages-send.js +379 -312
  16. package/lib/Socket/newsletter.js +54 -40
  17. package/lib/Socket/socket.js +58 -32
  18. package/lib/Store/index.js +1 -3
  19. package/lib/Store/make-in-memory-store.js +27 -15
  20. package/lib/Store/make-ordered-dictionary.js +2 -2
  21. package/lib/Types/Label.js +1 -1
  22. package/lib/Types/LabelAssociation.js +1 -1
  23. package/lib/Types/Message.js +0 -2
  24. package/lib/Types/Newsletter.js +3 -17
  25. package/lib/Types/index.js +2 -2
  26. package/lib/Utils/auth-utils.js +6 -13
  27. package/lib/Utils/baileys-event-stream.js +1 -1
  28. package/lib/Utils/browser-utils.js +35 -0
  29. package/lib/Utils/business.js +2 -2
  30. package/lib/Utils/chat-utils.js +36 -35
  31. package/lib/Utils/crypto.js +71 -29
  32. package/lib/Utils/decode-wa-message.js +65 -56
  33. package/lib/Utils/event-buffer.js +13 -9
  34. package/lib/Utils/generics.js +107 -29
  35. package/lib/Utils/history.js +4 -6
  36. package/lib/Utils/index.js +2 -0
  37. package/lib/Utils/link-preview.js +34 -1
  38. package/lib/Utils/lt-hash.js +6 -6
  39. package/lib/Utils/message-retry-manager.js +128 -0
  40. package/lib/Utils/messages-media.js +263 -115
  41. package/lib/Utils/messages.js +500 -93
  42. package/lib/Utils/noise-handler.js +18 -23
  43. package/lib/Utils/process-message.js +108 -25
  44. package/lib/Utils/signal.js +37 -35
  45. package/lib/Utils/use-multi-file-auth-state.js +51 -6
  46. package/lib/Utils/validate-connection.js +90 -66
  47. package/lib/WABinary/constants.js +1276 -13
  48. package/lib/WABinary/decode.js +26 -13
  49. package/lib/WABinary/encode.js +39 -17
  50. package/lib/WABinary/generic-utils.js +2 -85
  51. package/lib/WABinary/jid-utils.js +28 -5
  52. package/lib/WAUSync/Protocols/USyncDisappearingModeProtocol.js +1 -1
  53. package/lib/index.js +18 -5
  54. package/package.json +109 -104
  55. package/lib/Defaults/baileys-version.json +0 -3
  56. package/lib/Defaults/index.d.ts +0 -53
  57. package/lib/Defaults/phonenumber-mcc.json +0 -223
  58. package/lib/Signal/Group/ciphertext-message.d.ts +0 -9
  59. package/lib/Signal/Group/group-session-builder.d.ts +0 -14
  60. package/lib/Signal/Group/group_cipher.d.ts +0 -17
  61. package/lib/Signal/Group/index.d.ts +0 -11
  62. package/lib/Signal/Group/keyhelper.d.ts +0 -10
  63. package/lib/Signal/Group/queue-job.d.ts +0 -1
  64. package/lib/Signal/Group/sender-chain-key.d.ts +0 -13
  65. package/lib/Signal/Group/sender-key-distribution-message.d.ts +0 -16
  66. package/lib/Signal/Group/sender-key-message.d.ts +0 -18
  67. package/lib/Signal/Group/sender-key-name.d.ts +0 -17
  68. package/lib/Signal/Group/sender-key-record.d.ts +0 -30
  69. package/lib/Signal/Group/sender-key-state.d.ts +0 -38
  70. package/lib/Signal/Group/sender-message-key.d.ts +0 -11
  71. package/lib/Signal/libsignal.d.ts +0 -3
  72. package/lib/Socket/Client/abstract-socket-client.d.ts +0 -17
  73. package/lib/Socket/Client/index.d.ts +0 -3
  74. package/lib/Socket/Client/mobile-socket-client.d.ts +0 -13
  75. package/lib/Socket/Client/mobile-socket-client.js +0 -65
  76. package/lib/Socket/Client/web-socket-client.d.ts +0 -12
  77. package/lib/Socket/business.d.ts +0 -171
  78. package/lib/Socket/chats.d.ts +0 -80
  79. package/lib/Socket/dugong.d.ts +0 -219
  80. package/lib/Socket/dugong.js +0 -441
  81. package/lib/Socket/groups.d.ts +0 -115
  82. package/lib/Socket/index.d.ts +0 -173
  83. package/lib/Socket/messages-recv.d.ts +0 -161
  84. package/lib/Socket/messages-send.d.ts +0 -149
  85. package/lib/Socket/newsletter.d.ts +0 -134
  86. package/lib/Socket/registration.d.ts +0 -267
  87. package/lib/Socket/registration.js +0 -166
  88. package/lib/Socket/socket.d.ts +0 -43
  89. package/lib/Socket/socket.js.bak +0 -630
  90. package/lib/Socket/usync.d.ts +0 -36
  91. package/lib/Store/index.d.ts +0 -3
  92. package/lib/Store/make-cache-manager-store.d.ts +0 -13
  93. package/lib/Store/make-cache-manager-store.js +0 -83
  94. package/lib/Store/make-in-memory-store.d.ts +0 -118
  95. package/lib/Store/make-ordered-dictionary.d.ts +0 -13
  96. package/lib/Store/object-repository.d.ts +0 -10
  97. package/lib/Types/Auth.d.ts +0 -110
  98. package/lib/Types/Call.d.ts +0 -13
  99. package/lib/Types/Chat.d.ts +0 -102
  100. package/lib/Types/Contact.d.ts +0 -19
  101. package/lib/Types/Events.d.ts +0 -157
  102. package/lib/Types/GroupMetadata.d.ts +0 -55
  103. package/lib/Types/Label.d.ts +0 -35
  104. package/lib/Types/LabelAssociation.d.ts +0 -29
  105. package/lib/Types/Message.d.ts +0 -273
  106. package/lib/Types/Newsletter.d.ts +0 -92
  107. package/lib/Types/Product.d.ts +0 -78
  108. package/lib/Types/Signal.d.ts +0 -57
  109. package/lib/Types/Socket.d.ts +0 -111
  110. package/lib/Types/State.d.ts +0 -27
  111. package/lib/Types/USync.d.ts +0 -25
  112. package/lib/Types/index.d.ts +0 -57
  113. package/lib/Utils/auth-utils.d.ts +0 -18
  114. package/lib/Utils/baileys-event-stream.d.ts +0 -16
  115. package/lib/Utils/business.d.ts +0 -22
  116. package/lib/Utils/chat-utils.d.ts +0 -71
  117. package/lib/Utils/crypto.d.ts +0 -41
  118. package/lib/Utils/decode-wa-message.d.ts +0 -19
  119. package/lib/Utils/event-buffer.d.ts +0 -35
  120. package/lib/Utils/generics.d.ts +0 -92
  121. package/lib/Utils/history.d.ts +0 -15
  122. package/lib/Utils/index.d.ts +0 -17
  123. package/lib/Utils/link-preview.d.ts +0 -21
  124. package/lib/Utils/logger.d.ts +0 -4
  125. package/lib/Utils/lt-hash.d.ts +0 -12
  126. package/lib/Utils/make-mutex.d.ts +0 -7
  127. package/lib/Utils/messages-media.d.ts +0 -116
  128. package/lib/Utils/messages.d.ts +0 -77
  129. package/lib/Utils/noise-handler.d.ts +0 -21
  130. package/lib/Utils/process-message.d.ts +0 -41
  131. package/lib/Utils/signal.d.ts +0 -32
  132. package/lib/Utils/use-multi-file-auth-state.d.ts +0 -13
  133. package/lib/Utils/validate-connection.d.ts +0 -11
  134. package/lib/WABinary/constants.d.ts +0 -27
  135. package/lib/WABinary/decode.d.ts +0 -7
  136. package/lib/WABinary/encode.d.ts +0 -3
  137. package/lib/WABinary/generic-utils.d.ts +0 -16
  138. package/lib/WABinary/index.d.ts +0 -5
  139. package/lib/WABinary/jid-utils.d.ts +0 -31
  140. package/lib/WABinary/types.d.ts +0 -18
  141. package/lib/WAM/BinaryInfo.d.ts +0 -17
  142. package/lib/WAM/constants.d.ts +0 -38
  143. package/lib/WAM/encode.d.ts +0 -3
  144. package/lib/WAM/index.d.ts +0 -3
  145. package/lib/WAUSync/Protocols/USyncContactProtocol.d.ts +0 -9
  146. package/lib/WAUSync/Protocols/USyncDeviceProtocol.d.ts +0 -22
  147. package/lib/WAUSync/Protocols/USyncDisappearingModeProtocol.d.ts +0 -12
  148. package/lib/WAUSync/Protocols/USyncStatusProtocol.d.ts +0 -12
  149. package/lib/WAUSync/Protocols/UsyncBotProfileProtocol.d.ts +0 -25
  150. package/lib/WAUSync/Protocols/UsyncLIDProtocol.d.ts +0 -8
  151. package/lib/WAUSync/Protocols/index.d.ts +0 -4
  152. package/lib/WAUSync/USyncQuery.d.ts +0 -28
  153. package/lib/WAUSync/USyncUser.d.ts +0 -12
  154. package/lib/WAUSync/index.d.ts +0 -3
  155. package/lib/index.d.ts +0 -12
  156. package/lib/index.js.bak +0 -48
  157. /package/lib/Socket/Client/{abstract-socket-client.js → types.js} +0 -0
@@ -1,441 +0,0 @@
1
- // "kikyy dugonggg", ah dejavu (r)
2
- // tanggal 14 agustus 2025 makassar
3
- // telegram: @tskiofc & @kyuucode
4
-
5
- const WAProto = require('../../WAProto').proto;
6
- const crypto = require('crypto');
7
-
8
- class kikyy {
9
- constructor(utils, waUploadToServer, relayMessageFn) {
10
- this.utils = utils;
11
- this.relayMessage = relayMessageFn
12
- this.waUploadToServer = waUploadToServer;
13
- }
14
-
15
- detectType(content) {
16
- if (content.requestPaymentMessage) return 'PAYMENT';
17
- if (content.productMessage) return 'PRODUCT';
18
- if (content.interactiveMessage) return 'INTERACTIVE';
19
- if (content.albumMessage) return 'ALBUM';
20
- if (content.eventMessage) return 'EVENT';
21
- if (content.pollResultMessage) return 'POLL_RESULT'
22
- return null;
23
- }
24
-
25
- async handlePayment(content, quoted) {
26
- const data = content.requestPaymentMessage;
27
- let notes = {};
28
-
29
- if (data.sticker?.stickerMessage) {
30
- notes = {
31
- stickerMessage: {
32
- ...data.sticker.stickerMessage,
33
- contextInfo: {
34
- stanzaId: quoted?.key?.id,
35
- participant: quoted?.key?.participant || content.sender,
36
- quotedMessage: quoted?.message
37
- }
38
- }
39
- };
40
- } else if (data.note) {
41
- notes = {
42
- extendedTextMessage: {
43
- text: data.note,
44
- contextInfo: {
45
- stanzaId: quoted?.key?.id,
46
- participant: quoted?.key?.participant || content.sender,
47
- quotedMessage: quoted?.message
48
- }
49
- }
50
- };
51
- }
52
-
53
- return {
54
- requestPaymentMessage: WAProto.Message.RequestPaymentMessage.fromObject({
55
- expiryTimestamp: data.expiry || 0,
56
- amount1000: data.amount || 0,
57
- currencyCodeIso4217: data.currency || "IDR",
58
- requestFrom: data.from || "0@s.whatsapp.net",
59
- noteMessage: notes,
60
- background: data.background ?? {
61
- id: "DEFAULT",
62
- placeholderArgb: 0xFFF0F0F0
63
- }
64
- })
65
- };
66
- }
67
-
68
- async handleProduct(content, jid, quoted) {
69
- const {
70
- title,
71
- description,
72
- thumbnail,
73
- productId,
74
- retailerId,
75
- url,
76
- body = "",
77
- footer = "",
78
- buttons = [],
79
- priceAmount1000 = null,
80
- currencyCode = "IDR"
81
- } = content.productMessage;
82
-
83
- let productImage;
84
-
85
- if (Buffer.isBuffer(thumbnail)) {
86
- const { imageMessage } = await this.utils.generateWAMessageContent(
87
- { image: thumbnail },
88
- { upload: this.waUploadToServer }
89
- );
90
- productImage = imageMessage;
91
- } else if (typeof thumbnail === 'object' && thumbnail.url) {
92
- const { imageMessage } = await this.utils.generateWAMessageContent(
93
- { image: { url: thumbnail.url }},
94
- { upload: this.waUploadToServer }
95
- );
96
- productImage = imageMessage;
97
- }
98
-
99
- return {
100
- viewOnceMessage: {
101
- message: {
102
- interactiveMessage: {
103
- body: { text: body },
104
- footer: { text: footer },
105
- header: {
106
- title,
107
- hasMediaAttachment: true,
108
- productMessage: {
109
- product: {
110
- productImage,
111
- productId,
112
- title,
113
- description,
114
- currencyCode,
115
- priceAmount1000,
116
- retailerId,
117
- url,
118
- productImageCount: 1
119
- },
120
- businessOwnerJid: "0@s.whatsapp.net"
121
- }
122
- },
123
- nativeFlowMessage: { buttons }
124
- }
125
- }
126
- }
127
- };
128
- }
129
-
130
- async handleInteractive(content, jid, quoted) {
131
- const {
132
- title,
133
- footer,
134
- thumbnail,
135
- image,
136
- video,
137
- document,
138
- mimetype,
139
- fileName,
140
- jpegThumbnail,
141
- contextInfo,
142
- externalAdReply,
143
- buttons = [],
144
- nativeFlowMessage
145
- } = content.interactiveMessage;
146
-
147
- let media = null;
148
- let mediaType = null;
149
-
150
- if (thumbnail) {
151
- media = await this.utils.prepareWAMessageMedia(
152
- { image: { url: thumbnail } },
153
- { upload: this.waUploadToServer }
154
- );
155
- mediaType = 'image';
156
- } else if (image) {
157
- if (typeof image === 'object' && image.url) {
158
- media = await this.utils.prepareWAMessageMedia(
159
- { image: { url: image.url } },
160
- { upload: this.waUploadToServer }
161
- );
162
- } else {
163
- media = await this.utils.prepareWAMessageMedia(
164
- { image: image },
165
- { upload: this.waUploadToServer }
166
- );
167
- }
168
- mediaType = 'image';
169
- } else if (video) {
170
- if (typeof video === 'object' && video.url) {
171
- media = await this.utils.prepareWAMessageMedia(
172
- { video: { url: video.url } },
173
- { upload: this.waUploadToServer }
174
- );
175
- } else {
176
- media = await this.utils.prepareWAMessageMedia(
177
- { video: video },
178
- { upload: this.waUploadToServer }
179
- );
180
- }
181
- mediaType = 'video';
182
- } else if (document) {
183
- let documentPayload = { document: document };
184
-
185
- if (jpegThumbnail) {
186
- if (typeof jpegThumbnail === 'object' && jpegThumbnail.url) {
187
- documentPayload.jpegThumbnail = { url: jpegThumbnail.url };
188
- } else {
189
- documentPayload.jpegThumbnail = jpegThumbnail;
190
- }
191
- }
192
-
193
- media = await this.utils.prepareWAMessageMedia(
194
- documentPayload,
195
- { upload: this.waUploadToServer }
196
- );
197
-
198
- if (fileName) {
199
- media.documentMessage.fileName = fileName;
200
- }
201
- if (mimetype) {
202
- media.documentMessage.mimetype = mimetype;
203
- }
204
- mediaType = 'document';
205
- }
206
-
207
- let interactiveMessage = {
208
- body: { text: title || "" },
209
- footer: { text: footer || "" }
210
- };
211
-
212
- if (buttons && buttons.length > 0) {
213
- interactiveMessage.nativeFlowMessage = {
214
- buttons: buttons
215
- };
216
-
217
- if (nativeFlowMessage) {
218
- interactiveMessage.nativeFlowMessage = {
219
- ...interactiveMessage.nativeFlowMessage,
220
- ...nativeFlowMessage
221
- };
222
- }
223
- } else if (nativeFlowMessage) {
224
- interactiveMessage.nativeFlowMessage = nativeFlowMessage;
225
- }
226
-
227
- if (media) {
228
- interactiveMessage.header = {
229
- title: "",
230
- hasMediaAttachment: true,
231
- ...media
232
- };
233
- } else {
234
- interactiveMessage.header = {
235
- title: "",
236
- hasMediaAttachment: false
237
- };
238
- }
239
-
240
- let finalContextInfo = {};
241
-
242
- if (contextInfo) {
243
- finalContextInfo = {
244
- mentionedJid: contextInfo.mentionedJid || [],
245
- forwardingScore: contextInfo.forwardingScore || 0,
246
- isForwarded: contextInfo.isForwarded || false,
247
- ...contextInfo
248
- };
249
- }
250
-
251
- if (externalAdReply) {
252
- finalContextInfo.externalAdReply = {
253
- title: externalAdReply.title || "",
254
- body: externalAdReply.body || "",
255
- mediaType: externalAdReply.mediaType || 1,
256
- thumbnailUrl: externalAdReply.thumbnailUrl || "",
257
- mediaUrl: externalAdReply.mediaUrl || "",
258
- sourceUrl: externalAdReply.sourceUrl || "",
259
- showAdAttribution: externalAdReply.showAdAttribution || false,
260
- renderLargerThumbnail: externalAdReply.renderLargerThumbnail || false,
261
- ...externalAdReply
262
- };
263
- }
264
-
265
- if (Object.keys(finalContextInfo).length > 0) {
266
- interactiveMessage.contextInfo = finalContextInfo;
267
- }
268
-
269
- return {
270
- interactiveMessage: interactiveMessage
271
- };
272
- }
273
-
274
- async handleAlbum(content, jid, quoted) {
275
- const array = content.albumMessage;
276
- const album = await this.utils.generateWAMessageFromContent(jid, {
277
- messageContextInfo: {
278
- messageSecret: crypto.randomBytes(32),
279
- },
280
- albumMessage: {
281
- expectedImageCount: array.filter((a) => a.hasOwnProperty("image")).length,
282
- expectedVideoCount: array.filter((a) => a.hasOwnProperty("video")).length,
283
- },
284
- }, {
285
- userJid: this.utils.generateMessageID().split('@')[0] + '@s.whatsapp.net',
286
- quoted,
287
- upload: this.waUploadToServer
288
- });
289
-
290
- await this.relayMessage(jid, album.message, {
291
- messageId: album.key.id,
292
- });
293
-
294
- for (let content of array) {
295
- const img = await this.utils.generateWAMessage(jid, content, {
296
- upload: this.waUploadToServer,
297
- });
298
-
299
- img.message.messageContextInfo = {
300
- messageSecret: crypto.randomBytes(32),
301
- messageAssociation: {
302
- associationType: 1,
303
- parentMessageKey: album.key,
304
- },
305
- participant: "0@s.whatsapp.net",
306
- remoteJid: "status@broadcast",
307
- forwardingScore: 99999,
308
- isForwarded: true,
309
- mentionedJid: [jid],
310
- starred: true,
311
- labels: ["Y", "Important"],
312
- isHighlighted: true,
313
- businessMessageForwardInfo: {
314
- businessOwnerJid: jid,
315
- },
316
- dataSharingContext: {
317
- showMmDisclosure: true,
318
- },
319
- };
320
-
321
- img.message.forwardedNewsletterMessageInfo = {
322
- newsletterJid: "0@newsletter",
323
- serverMessageId: 1,
324
- newsletterName: `WhatsApp`,
325
- contentType: 1,
326
- timestamp: new Date().toISOString(),
327
- senderName: "kikyy dugonggg",
328
- content: "Text Message",
329
- priority: "high",
330
- status: "sent",
331
- };
332
-
333
- img.message.disappearingMode = {
334
- initiator: 3,
335
- trigger: 4,
336
- initiatorDeviceJid: jid,
337
- initiatedByExternalService: true,
338
- initiatedByUserDevice: true,
339
- initiatedBySystem: true,
340
- initiatedByServer: true,
341
- initiatedByAdmin: true,
342
- initiatedByUser: true,
343
- initiatedByApp: true,
344
- initiatedByBot: true,
345
- initiatedByMe: true,
346
- };
347
-
348
- await this.relayMessage(jid, img.message, {
349
- messageId: img.key.id,
350
- quoted: {
351
- key: {
352
- remoteJid: album.key.remoteJid,
353
- id: album.key.id,
354
- fromMe: true,
355
- participant: this.utils.generateMessageID().split('@')[0] + '@s.whatsapp.net',
356
- },
357
- message: album.message,
358
- },
359
- });
360
- }
361
- return album;
362
- }
363
-
364
- async handleEvent(content, jid, quoted) {
365
- const eventData = content.eventMessage;
366
-
367
- const msg = await this.utils.generateWAMessageFromContent(jid, {
368
- viewOnceMessage: {
369
- message: {
370
- messageContextInfo: {
371
- deviceListMetadata: {},
372
- deviceListMetadataVersion: 2,
373
- messageSecret: crypto.randomBytes(32),
374
- supportPayload: JSON.stringify({
375
- version: 2,
376
- is_ai_message: true,
377
- should_show_system_message: true,
378
- ticket_id: crypto.randomBytes(16).toString('hex')
379
- })
380
- },
381
- eventMessage: {
382
- contextInfo: {
383
- mentionedJid: [jid],
384
- participant: jid,
385
- remoteJid: "status@broadcast",
386
- forwardedNewsletterMessageInfo: {
387
- newsletterName: "shenvn.",
388
- newsletterJid: "120363297591152843@newsletter",
389
- serverMessageId: 1
390
- }
391
- },
392
- isCanceled: eventData.isCanceled || false,
393
- name: eventData.name,
394
- description: eventData.description,
395
- location: eventData.location || {
396
- degreesLatitude: 0,
397
- degreesLongitude: 0,
398
- name: "Location"
399
- },
400
- joinLink: eventData.joinLink || '',
401
- startTime: typeof eventData.startTime === 'string' ? parseInt(eventData.startTime) : eventData.startTime || Date.now(),
402
- endTime: typeof eventData.endTime === 'string' ? parseInt(eventData.endTime) : eventData.endTime || Date.now() + 3600000,
403
- extraGuestsAllowed: eventData.extraGuestsAllowed !== false
404
- }
405
- }
406
- }
407
- }, { quoted });
408
-
409
- await this.relayMessage(jid, msg.message, {
410
- messageId: msg.key.id
411
- });
412
- return msg;
413
- }
414
-
415
- async handlePollResult(content, jid, quoted) {
416
- const pollData = content.pollResultMessage;
417
-
418
- const msg = await this.utils.generateWAMessageFromContent(jid, {
419
- pollResultSnapshotMessage: {
420
- name: pollData.name,
421
- pollVotes: pollData.pollVotes.map(vote => ({
422
- optionName: vote.optionName,
423
- optionVoteCount: typeof vote.optionVoteCount === 'number'
424
- ? vote.optionVoteCount.toString()
425
- : vote.optionVoteCount
426
- }))
427
- }
428
- }, {
429
- userJid: this.utils.generateMessageID().split('@')[0] + '@s.whatsapp.net',
430
- quoted
431
- });
432
-
433
- await this.relayMessage(jid, msg.message, {
434
- messageId: msg.key.id
435
- });
436
-
437
- return msg;
438
- }
439
- }
440
-
441
- module.exports = kikyy;
@@ -1,115 +0,0 @@
1
- /// <reference types="node" />
2
- import { proto } from '../../WAProto';
3
- import { GroupMetadata, ParticipantAction, SocketConfig } from '../Types';
4
- import { BinaryNode } from '../WABinary';
5
- export declare const makeGroupsSocket: (config: SocketConfig) => {
6
- groupMetadata: (jid: string) => Promise<GroupMetadata>;
7
- groupCreate: (subject: string, participants: string[]) => Promise<GroupMetadata>;
8
- groupLeave: (id: string) => Promise<void>;
9
- groupUpdateSubject: (jid: string, subject: string) => Promise<void>;
10
- groupRequestParticipantsList: (jid: string) => Promise<{
11
- [key: string]: string;
12
- }[]>;
13
- groupRequestParticipantsUpdate: (jid: string, participants: string[], action: 'approve' | 'reject') => Promise<{
14
- status: string;
15
- jid: string;
16
- }[]>;
17
- groupParticipantsUpdate: (jid: string, participants: string[], action: ParticipantAction) => Promise<{
18
- status: string;
19
- jid: string;
20
- content: BinaryNode;
21
- }[]>;
22
- groupUpdateDescription: (jid: string, description?: string) => Promise<void>;
23
- groupInviteCode: (jid: string) => Promise<string | undefined>;
24
- groupRevokeInvite: (jid: string) => Promise<string | undefined>;
25
- groupAcceptInvite: (code: string) => Promise<string | undefined>;
26
- /**
27
- * accept a GroupInviteMessage
28
- * @param key the key of the invite message, or optionally only provide the jid of the person who sent the invite
29
- * @param inviteMessage the message to accept
30
- */
31
- groupAcceptInviteV4: (key: string | proto.IMessageKey, inviteMessage: proto.Message.IGroupInviteMessage) => Promise<string>;
32
- groupGetInviteInfo: (code: string) => Promise<GroupMetadata>;
33
- groupToggleEphemeral: (jid: string, ephemeralExpiration: number) => Promise<void>;
34
- groupSettingUpdate: (jid: string, setting: 'announcement' | 'not_announcement' | 'locked' | 'unlocked') => Promise<void>;
35
- groupMemberAddMode: (jid: string, mode: 'admin_add' | 'all_member_add') => Promise<void>;
36
- groupJoinApprovalMode: (jid: string, mode: 'on' | 'off') => Promise<void>;
37
- groupFetchAllParticipating: () => Promise<{
38
- [_: string]: GroupMetadata;
39
- }>;
40
- processingMutex: {
41
- mutex<T>(code: () => T | Promise<T>): Promise<T>;
42
- };
43
- fetchPrivacySettings: (force?: boolean) => Promise<{
44
- [_: string]: string;
45
- }>;
46
- upsertMessage: (msg: proto.IWebMessageInfo, type: import("../Types").MessageUpsertType) => Promise<void>;
47
- appPatch: (patchCreate: import("../Types").WAPatchCreate) => Promise<void>;
48
- sendPresenceUpdate: (type: import("../Types").WAPresence, toJid?: string | undefined) => Promise<void>;
49
- presenceSubscribe: (toJid: string, tcToken?: Buffer | undefined) => Promise<void>;
50
- profilePictureUrl: (jid: string, type?: "image" | "preview", timeoutMs?: number | undefined) => Promise<string | undefined>;
51
- onWhatsApp: (...jids: string[]) => Promise<{
52
- jid: string;
53
- exists: unknown;
54
- lid: unknown;
55
- }[] | undefined>;
56
- fetchBlocklist: () => Promise<string[]>;
57
- fetchStatus: (jid: string) => Promise<{
58
- status: string | undefined;
59
- setAt: Date;
60
- } | undefined>;
61
- updateProfilePicture: (jid: string, content: import("../Types").WAMediaUpload) => Promise<void>;
62
- removeProfilePicture: (jid: string) => Promise<void>;
63
- updateProfileStatus: (status: string) => Promise<void>;
64
- updateProfileName: (name: string) => Promise<void>;
65
- updateBlockStatus: (jid: string, action: "block" | "unblock") => Promise<void>;
66
- updateLastSeenPrivacy: (value: import("../Types").WAPrivacyValue) => Promise<void>;
67
- updateOnlinePrivacy: (value: import("../Types").WAPrivacyOnlineValue) => Promise<void>;
68
- updateProfilePicturePrivacy: (value: import("../Types").WAPrivacyValue) => Promise<void>;
69
- updateStatusPrivacy: (value: import("../Types").WAPrivacyValue) => Promise<void>;
70
- updateReadReceiptsPrivacy: (value: import("../Types").WAReadReceiptsValue) => Promise<void>;
71
- updateGroupsAddPrivacy: (value: import("../Types").WAPrivacyValue) => Promise<void>;
72
- updateDefaultDisappearingMode: (duration: number) => Promise<void>;
73
- getBusinessProfile: (jid: string) => Promise<void | import("../Types").WABusinessProfile>;
74
- resyncAppState: (collections: readonly ("critical_block" | "critical_unblock_low" | "regular_high" | "regular_low" | "regular")[], isInitialSync: boolean) => Promise<void>;
75
- chatModify: (mod: import("../Types").ChatModification, jid: string) => Promise<void>;
76
- cleanDirtyBits: (type: "account_sync" | "groups", fromTimestamp?: string | number | undefined) => Promise<void>;
77
- addChatLabel: (jid: string, labelId: string) => Promise<void>;
78
- removeChatLabel: (jid: string, labelId: string) => Promise<void>;
79
- addMessageLabel: (jid: string, messageId: string, labelId: string) => Promise<void>;
80
- removeMessageLabel: (jid: string, messageId: string, labelId: string) => Promise<void>;
81
- star: (jid: string, messages: {
82
- id: string;
83
- fromMe?: boolean | undefined;
84
- }[], star: boolean) => Promise<void>;
85
- type: "md";
86
- ws: any;
87
- ev: import("../Types").BaileysEventEmitter & {
88
- process(handler: (events: Partial<import("../Types").BaileysEventMap>) => void | Promise<void>): () => void;
89
- buffer(): void;
90
- createBufferedFunction<A extends any[], T_1>(work: (...args: A) => Promise<T_1>): (...args: A) => Promise<T_1>;
91
- flush(force?: boolean | undefined): boolean;
92
- isBuffering(): boolean;
93
- };
94
- authState: {
95
- creds: import("../Types").AuthenticationCreds;
96
- keys: import("../Types").SignalKeyStoreWithTransaction;
97
- };
98
- signalRepository: import("../Types").SignalRepository;
99
- user: import("../Types").Contact | undefined;
100
- generateMessageTag: () => string;
101
- query: (node: BinaryNode, timeoutMs?: number | undefined) => Promise<BinaryNode>;
102
- waitForMessage: <T_2>(msgId: string, timeoutMs?: number | undefined) => Promise<T_2>;
103
- waitForSocketOpen: () => Promise<void>;
104
- sendRawMessage: (data: Uint8Array | Buffer) => Promise<void>;
105
- sendNode: (frame: BinaryNode) => Promise<void>;
106
- logout: (msg?: string | undefined) => Promise<void>;
107
- end: (error: Error | undefined) => void;
108
- onUnexpectedError: (err: Error | import("@hapi/boom").Boom<any>, msg: string) => void;
109
- uploadPreKeys: (count?: number) => Promise<void>;
110
- uploadPreKeysToServerIfRequired: () => Promise<void>;
111
- requestPairingCode: (phoneNumber: string) => Promise<string>;
112
- waitForConnectionUpdate: (check: (u: Partial<import("../Types").ConnectionState>) => boolean | undefined, timeoutMs?: number | undefined) => Promise<void>;
113
- sendWAMBuffer: (wamBuffer: Buffer) => Promise<BinaryNode>;
114
- };
115
- export declare const extractGroupMetadata: (result: BinaryNode) => GroupMetadata;