@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,561 @@
1
+ export function makeCommunitiesSocket(config: any): {
2
+ communityQuery: (jid: any, type: any, content: any) => Promise<any>;
3
+ communityMetadata: (jid: any) => Promise<{
4
+ id: any;
5
+ subject: any;
6
+ subjectOwner: any;
7
+ subjectTime: number;
8
+ size: any;
9
+ creation: number;
10
+ owner: string | undefined;
11
+ desc: any;
12
+ descId: any;
13
+ linkedParent: any;
14
+ restrict: boolean;
15
+ announce: boolean;
16
+ isCommunity: boolean;
17
+ isCommunityAnnounce: boolean;
18
+ joinApprovalMode: boolean;
19
+ memberAddMode: boolean;
20
+ participants: any;
21
+ ephemeralDuration: number | undefined;
22
+ addressingMode: any;
23
+ }>;
24
+ communityCreate: (subject: any, body: any) => Promise<{
25
+ id: any;
26
+ notify: any;
27
+ addressingMode: any;
28
+ subject: any;
29
+ subjectOwner: any;
30
+ subjectOwnerPn: any;
31
+ subjectOwnerUsername: any;
32
+ subjectTime: number;
33
+ size: any;
34
+ creation: number;
35
+ owner: string | undefined;
36
+ ownerPn: string | undefined;
37
+ ownerUsername: any;
38
+ owner_country_code: any;
39
+ desc: any;
40
+ descId: any;
41
+ descOwner: string | undefined;
42
+ descOwnerPn: string | undefined;
43
+ descOwnerUsername: any;
44
+ descTime: number | undefined;
45
+ linkedParent: any;
46
+ restrict: boolean;
47
+ announce: boolean;
48
+ isCommunity: boolean;
49
+ isCommunityAnnounce: boolean;
50
+ joinApprovalMode: boolean;
51
+ memberAddMode: boolean;
52
+ participants: any;
53
+ ephemeralDuration: number | undefined;
54
+ } | null>;
55
+ communityCreateGroup: (subject: any, participants: any, parentCommunityJid: any) => Promise<{
56
+ id: any;
57
+ notify: any;
58
+ addressingMode: any;
59
+ subject: any;
60
+ subjectOwner: any;
61
+ subjectOwnerPn: any;
62
+ subjectOwnerUsername: any;
63
+ subjectTime: number;
64
+ size: any;
65
+ creation: number;
66
+ owner: string | undefined;
67
+ ownerPn: string | undefined;
68
+ ownerUsername: any;
69
+ owner_country_code: any;
70
+ desc: any;
71
+ descId: any;
72
+ descOwner: string | undefined;
73
+ descOwnerPn: string | undefined;
74
+ descOwnerUsername: any;
75
+ descTime: number | undefined;
76
+ linkedParent: any;
77
+ restrict: boolean;
78
+ announce: boolean;
79
+ isCommunity: boolean;
80
+ isCommunityAnnounce: boolean;
81
+ joinApprovalMode: boolean;
82
+ memberAddMode: boolean;
83
+ participants: any;
84
+ ephemeralDuration: number | undefined;
85
+ } | null>;
86
+ communityLeave: (id: any) => Promise<void>;
87
+ communityUpdateSubject: (jid: any, subject: any) => Promise<void>;
88
+ communityLinkGroup: (groupJid: any, parentCommunityJid: any) => Promise<void>;
89
+ communityUnlinkGroup: (groupJid: any, parentCommunityJid: any) => Promise<void>;
90
+ communityFetchLinkedGroups: (jid: any) => Promise<{
91
+ communityJid: any;
92
+ isCommunity: boolean;
93
+ linkedGroups: {
94
+ id: string | undefined;
95
+ subject: any;
96
+ creation: number | undefined;
97
+ owner: string | undefined;
98
+ size: number | undefined;
99
+ }[];
100
+ }>;
101
+ communityRequestParticipantsList: (jid: any) => Promise<any>;
102
+ communityRequestParticipantsUpdate: (jid: any, participants: any, action: any) => Promise<any>;
103
+ communityParticipantsUpdate: (jid: any, participants: any, action: any) => Promise<any>;
104
+ communityUpdateDescription: (jid: any, description: any) => Promise<void>;
105
+ communityInviteCode: (jid: any) => Promise<any>;
106
+ communityRevokeInvite: (jid: any) => Promise<any>;
107
+ communityAcceptInvite: (code: any) => Promise<any>;
108
+ /**
109
+ * revoke a v4 invite for someone
110
+ * @param communityJid community jid
111
+ * @param invitedJid jid of person you invited
112
+ * @returns true if successful
113
+ */
114
+ communityRevokeInviteV4: (communityJid: any, invitedJid: any) => Promise<boolean>;
115
+ /**
116
+ * accept a CommunityInviteMessage
117
+ * @param key the key of the invite message, or optionally only provide the jid of the person who sent the invite
118
+ * @param inviteMessage the message to accept
119
+ */
120
+ communityAcceptInviteV4: (...args: any[]) => Promise<any>;
121
+ communityGetInviteInfo: (code: any) => Promise<{
122
+ id: any;
123
+ subject: any;
124
+ subjectOwner: any;
125
+ subjectTime: number;
126
+ size: any;
127
+ creation: number;
128
+ owner: string | undefined;
129
+ desc: any;
130
+ descId: any;
131
+ linkedParent: any;
132
+ restrict: boolean;
133
+ announce: boolean;
134
+ isCommunity: boolean;
135
+ isCommunityAnnounce: boolean;
136
+ joinApprovalMode: boolean;
137
+ memberAddMode: boolean;
138
+ participants: any;
139
+ ephemeralDuration: number | undefined;
140
+ addressingMode: any;
141
+ }>;
142
+ communityToggleEphemeral: (jid: any, ephemeralExpiration: any) => Promise<void>;
143
+ communitySettingUpdate: (jid: any, setting: any) => Promise<void>;
144
+ communityMemberAddMode: (jid: any, mode: any) => Promise<void>;
145
+ communityJoinApprovalMode: (jid: any, mode: any) => Promise<void>;
146
+ communityFetchAllParticipating: () => Promise<{}>;
147
+ logger: any;
148
+ getOrderDetails: (orderId: any, tokenBase64: any) => Promise<{
149
+ price: {
150
+ total: number;
151
+ currency: any;
152
+ };
153
+ products: any;
154
+ }>;
155
+ getCatalog: ({ jid, limit, cursor }: {
156
+ jid: any;
157
+ limit: any;
158
+ cursor: any;
159
+ }) => Promise<{
160
+ products: any;
161
+ nextPageCursor: any;
162
+ }>;
163
+ getCollections: (jid: any, limit?: number) => Promise<{
164
+ collections: any;
165
+ }>;
166
+ productCreate: (create: any) => Promise<{
167
+ id: any;
168
+ imageUrls: {
169
+ requested: any;
170
+ original: any;
171
+ };
172
+ reviewStatus: {
173
+ whatsapp: any;
174
+ };
175
+ availability: string;
176
+ name: any;
177
+ retailerId: any;
178
+ url: any;
179
+ description: any;
180
+ price: number;
181
+ currency: any;
182
+ isHidden: boolean;
183
+ }>;
184
+ productDelete: (productIds: any) => Promise<{
185
+ deleted: number;
186
+ }>;
187
+ productUpdate: (productId: any, update: any) => Promise<{
188
+ id: any;
189
+ imageUrls: {
190
+ requested: any;
191
+ original: any;
192
+ };
193
+ reviewStatus: {
194
+ whatsapp: any;
195
+ };
196
+ availability: string;
197
+ name: any;
198
+ retailerId: any;
199
+ url: any;
200
+ description: any;
201
+ price: number;
202
+ currency: any;
203
+ isHidden: boolean;
204
+ }>;
205
+ updateBussinesProfile: (args: any) => Promise<any>;
206
+ updateBusinessProfile: (args: any) => Promise<any>;
207
+ updateCoverPhoto: (photo: any) => Promise<any>;
208
+ removeCoverPhoto: (id: any) => Promise<any>;
209
+ sendMessageAck: (node: any, errorCode: any) => Promise<void>;
210
+ sendRetryRequest: (node: any, forceIncludeKeys?: boolean) => Promise<void>;
211
+ rejectCall: (callId: any, callFrom: any) => Promise<void>;
212
+ fetchMessageHistory: (count: any, oldestMsgKey: any, oldestMsgTimestamp: any) => Promise<any>;
213
+ requestPlaceholderResend: (messageKey: any, msgData: any) => Promise<any>;
214
+ messageRetryManager: import("../index.js").MessageRetryManager | null;
215
+ userDevicesCache: any;
216
+ devicesMutex: {
217
+ mutex(code: any): any;
218
+ };
219
+ issuePrivacyTokens: (jids: any, timestamp: any) => Promise<any>;
220
+ assertSessions: (jids: any, force: any) => Promise<boolean>;
221
+ relayMessage: (jid: any, message: any, { messageId: msgId, participant, additionalAttributes, additionalNodes, useUserDevicesCache, useCachedGroupMetadata, addBizAttributes, statusJidList }: {
222
+ messageId: any;
223
+ participant: any;
224
+ additionalAttributes: any;
225
+ additionalNodes: any;
226
+ useUserDevicesCache: any;
227
+ useCachedGroupMetadata: any;
228
+ addBizAttributes: any;
229
+ statusJidList: any;
230
+ }) => Promise<any>;
231
+ sendReceipt: (jid: any, participant: any, messageIds: any, type: any) => Promise<void>;
232
+ sendReceipts: (keys: any, type: any) => Promise<void>;
233
+ readMessages: (keys: any) => Promise<void>;
234
+ refreshMediaConn: (forceGet?: boolean) => Promise<any>;
235
+ getMediaHost: () => string;
236
+ waUploadToServer: (filePath: any, { mediaType, fileEncSha256B64, timeoutMs, newsletter }: {
237
+ mediaType: any;
238
+ fileEncSha256B64: any;
239
+ timeoutMs: any;
240
+ newsletter: any;
241
+ }) => Promise<{
242
+ mediaUrl: any;
243
+ directPath: any;
244
+ meta_hmac: any;
245
+ fbid: any;
246
+ ts: any;
247
+ thumbnailDirectPath: any;
248
+ thumbnailSha256: any;
249
+ }>;
250
+ fetchPrivacySettings: (force?: boolean) => Promise<any>;
251
+ sendPeerDataOperationMessage: (pdoMessage: any) => Promise<any>;
252
+ createParticipantNodes: (recipientJids: any, message: any, extraAttrs: any, dsmMessage: any) => Promise<{
253
+ nodes: any[];
254
+ shouldIncludeDeviceIdentity: boolean;
255
+ }>;
256
+ getUSyncDevices: (jids: any, useCache: any, ignoreZeroDevices: any) => Promise<any[]>;
257
+ updateMemberLabel: (jid: any, memberLabel: any) => Promise<any>;
258
+ updateMediaMessage: (message: any) => Promise<any>;
259
+ sendMessage: (jid: any, content: any, options?: {}) => Promise<any>;
260
+ sendReaction: (jid: any, reaction: any, key: any) => Promise<any>;
261
+ downloadMedia: (message: any, type?: string, options?: {}) => Promise<any>;
262
+ copyNForward: (jid: any, message: any, forceForward?: boolean, options?: {}) => Promise<any>;
263
+ executeWMexQuery: (variables: any, queryId: any, dataPath: any) => Promise<any>;
264
+ newsletterCreate: (name: any, description: any) => Promise<{
265
+ id: any;
266
+ owner: undefined;
267
+ name: any;
268
+ creation_time: number;
269
+ description: any;
270
+ invite: any;
271
+ subscribers: number;
272
+ verification: any;
273
+ picture: {
274
+ id: any;
275
+ directPath: any;
276
+ };
277
+ mute_state: any;
278
+ }>;
279
+ newsletterUpdate: (jid: any, updates: any) => Promise<any>;
280
+ newsletterSubscribers: (jid: any) => Promise<any>;
281
+ newsletterSubscribed: () => Promise<any>;
282
+ newsletterMetadata: (type: any, key: any) => Promise<any>;
283
+ newsletterFollow: (jid: any) => Promise<any>;
284
+ newsletterUnfollow: (jid: any) => Promise<any>;
285
+ newsletterMute: (jid: any) => Promise<any>;
286
+ newsletterUnmute: (jid: any) => Promise<any>;
287
+ newsletterUpdateName: (jid: any, name: any) => Promise<any>;
288
+ newsletterUpdateDescription: (jid: any, description: any) => Promise<any>;
289
+ newsletterUpdatePicture: (jid: any, content: any) => Promise<any>;
290
+ newsletterRemovePicture: (jid: any) => Promise<any>;
291
+ newsletterReactMessage: (jid: any, serverId: any, reaction: any) => Promise<void>;
292
+ newsletterFetchMessages: (type: any, key: any, count: any, after: any, before: any) => Promise<any[]>;
293
+ subscribeNewsletterUpdates: (jid: any) => Promise<{
294
+ duration: any;
295
+ } | null>;
296
+ newsletterAdminCount: (jid: any) => Promise<any>;
297
+ newsletterChangeOwner: (jid: any, newOwnerJid: any) => Promise<void>;
298
+ newsletterDemote: (jid: any, userJid: any) => Promise<void>;
299
+ newsletterDelete: (jid: any) => Promise<void>;
300
+ groupQuery: (jid: any, type: any, content: any) => Promise<any>;
301
+ groupMetadata: (jid: any) => Promise<{
302
+ id: any;
303
+ notify: any;
304
+ addressingMode: any;
305
+ subject: any;
306
+ subjectOwner: any;
307
+ subjectOwnerPn: any;
308
+ subjectOwnerUsername: any;
309
+ subjectTime: number;
310
+ size: any;
311
+ creation: number;
312
+ owner: string | undefined;
313
+ ownerPn: string | undefined;
314
+ ownerUsername: any;
315
+ owner_country_code: any;
316
+ desc: any;
317
+ descId: any;
318
+ descOwner: string | undefined;
319
+ descOwnerPn: string | undefined;
320
+ descOwnerUsername: any;
321
+ descTime: number | undefined;
322
+ linkedParent: any;
323
+ restrict: boolean;
324
+ announce: boolean;
325
+ isCommunity: boolean;
326
+ isCommunityAnnounce: boolean;
327
+ joinApprovalMode: boolean;
328
+ memberAddMode: boolean;
329
+ participants: any;
330
+ ephemeralDuration: number | undefined;
331
+ }>;
332
+ groupCreate: (subject: any, participants: any) => Promise<{
333
+ id: any;
334
+ notify: any;
335
+ addressingMode: any;
336
+ subject: any;
337
+ subjectOwner: any;
338
+ subjectOwnerPn: any;
339
+ subjectOwnerUsername: any;
340
+ subjectTime: number;
341
+ size: any;
342
+ creation: number;
343
+ owner: string | undefined;
344
+ ownerPn: string | undefined;
345
+ ownerUsername: any;
346
+ owner_country_code: any;
347
+ desc: any;
348
+ descId: any;
349
+ descOwner: string | undefined;
350
+ descOwnerPn: string | undefined;
351
+ descOwnerUsername: any;
352
+ descTime: number | undefined;
353
+ linkedParent: any;
354
+ restrict: boolean;
355
+ announce: boolean;
356
+ isCommunity: boolean;
357
+ isCommunityAnnounce: boolean;
358
+ joinApprovalMode: boolean;
359
+ memberAddMode: boolean;
360
+ participants: any;
361
+ ephemeralDuration: number | undefined;
362
+ }>;
363
+ groupLeave: (id: any) => Promise<void>;
364
+ groupUpdateSubject: (jid: any, subject: any) => Promise<void>;
365
+ groupRequestParticipantsList: (jid: any) => Promise<any>;
366
+ groupRequestParticipantsUpdate: (jid: any, participants: any, action: any) => Promise<any>;
367
+ groupParticipantsUpdate: (jid: any, participants: any, action: any) => Promise<any[]>;
368
+ groupUpdateDescription: (jid: any, description: any) => Promise<void>;
369
+ groupInviteCode: (jid: any) => Promise<any>;
370
+ groupRevokeInvite: (jid: any) => Promise<any>;
371
+ groupAcceptInvite: (code: any) => Promise<any>;
372
+ groupRevokeInviteV4: (groupJid: any, invitedJid: any) => Promise<boolean>;
373
+ groupAcceptInviteV4: (...args: any[]) => Promise<any>;
374
+ groupGetInviteInfo: (code: any) => Promise<{
375
+ id: any;
376
+ notify: any;
377
+ addressingMode: any;
378
+ subject: any;
379
+ subjectOwner: any;
380
+ subjectOwnerPn: any;
381
+ subjectOwnerUsername: any;
382
+ subjectTime: number;
383
+ size: any;
384
+ creation: number;
385
+ owner: string | undefined;
386
+ ownerPn: string | undefined;
387
+ ownerUsername: any;
388
+ owner_country_code: any;
389
+ desc: any;
390
+ descId: any;
391
+ descOwner: string | undefined;
392
+ descOwnerPn: string | undefined;
393
+ descOwnerUsername: any;
394
+ descTime: number | undefined;
395
+ linkedParent: any;
396
+ restrict: boolean;
397
+ announce: boolean;
398
+ isCommunity: boolean;
399
+ isCommunityAnnounce: boolean;
400
+ joinApprovalMode: boolean;
401
+ memberAddMode: boolean;
402
+ participants: any;
403
+ ephemeralDuration: number | undefined;
404
+ }>;
405
+ groupToggleEphemeral: (jid: any, ephemeralExpiration: any) => Promise<void>;
406
+ groupSettingUpdate: (jid: any, setting: any) => Promise<void>;
407
+ groupMemberAddMode: (jid: any, mode: any) => Promise<void>;
408
+ groupJoinApprovalMode: (jid: any, mode: any) => Promise<void>;
409
+ groupFetchAllParticipating: () => Promise<{}>;
410
+ findUserId: (pnLid: any) => Promise<{
411
+ lid: undefined;
412
+ phoneNumber: undefined;
413
+ }>;
414
+ serverProps: {
415
+ privacyTokenOn1to1: boolean;
416
+ profilePicPrivacyToken: boolean;
417
+ lidTrustedTokenIssueToLid: boolean;
418
+ };
419
+ createCallLink: (type: any, event: any, timeoutMs: any) => Promise<any>;
420
+ getBotListV2: () => Promise<{
421
+ jid: any;
422
+ personaId: any;
423
+ }[]>;
424
+ messageMutex: {
425
+ mutex(code: any): any;
426
+ };
427
+ receiptMutex: {
428
+ mutex(code: any): any;
429
+ };
430
+ appStatePatchMutex: {
431
+ mutex(code: any): any;
432
+ };
433
+ notificationMutex: {
434
+ mutex(code: any): any;
435
+ };
436
+ upsertMessage: (...args: any[]) => Promise<any>;
437
+ appPatch: (patchCreate: any) => Promise<void>;
438
+ sendPresenceUpdate: (type: any, toJid: any) => Promise<void>;
439
+ presenceSubscribe: (toJid: any) => Promise<void>;
440
+ profilePictureUrl: (jid: any, type?: string, timeoutMs?: number, shouldIncludeTcToken?: boolean) => Promise<any>;
441
+ fetchBlocklist: () => Promise<any>;
442
+ fetchStatus: (...jids: any[]) => Promise<any>;
443
+ fetchDisappearingDuration: (...jids: any[]) => Promise<any>;
444
+ updateProfilePicture: (jid: any, content: any, dimensions: any) => Promise<void>;
445
+ removeProfilePicture: (jid: any) => Promise<void>;
446
+ updateProfileStatus: (status: any) => Promise<void>;
447
+ updateProfileName: (name: any) => Promise<void>;
448
+ updateBlockStatus: (jid: any, action: any) => Promise<void>;
449
+ updateDisableLinkPreviewsPrivacy: (isPreviewsDisabled: any) => Promise<void>;
450
+ updateCallPrivacy: (value: any) => Promise<void>;
451
+ updateMessagesPrivacy: (value: any) => Promise<void>;
452
+ updateLastSeenPrivacy: (value: any) => Promise<void>;
453
+ updateOnlinePrivacy: (value: any) => Promise<void>;
454
+ updateProfilePicturePrivacy: (value: any) => Promise<void>;
455
+ updateStatusPrivacy: (value: any) => Promise<void>;
456
+ updateReadReceiptsPrivacy: (value: any) => Promise<void>;
457
+ updateGroupsAddPrivacy: (value: any) => Promise<void>;
458
+ updateDefaultDisappearingMode: (duration: any) => Promise<void>;
459
+ getBusinessProfile: (jid: any) => Promise<{
460
+ wid: any;
461
+ address: any;
462
+ description: any;
463
+ website: any[];
464
+ email: any;
465
+ category: any;
466
+ business_hours: {
467
+ timezone: any;
468
+ business_config: any;
469
+ };
470
+ } | undefined>;
471
+ resyncAppState: (...args: any[]) => Promise<any>;
472
+ chatModify: (mod: any, jid: any) => Promise<void>;
473
+ cleanDirtyBits: (type: any, fromTimestamp: any) => Promise<void>;
474
+ addOrEditContact: (jid: any, contact: any) => Promise<void>;
475
+ removeContact: (jid: any) => Promise<void>;
476
+ placeholderResendCache: any;
477
+ addLabel: (jid: any, labels: any) => Promise<void>;
478
+ addChatLabel: (jid: any, labelId: any) => Promise<void>;
479
+ removeChatLabel: (jid: any, labelId: any) => Promise<void>;
480
+ addMessageLabel: (jid: any, messageId: any, labelId: any) => Promise<void>;
481
+ removeMessageLabel: (jid: any, messageId: any, labelId: any) => Promise<void>;
482
+ star: (jid: any, messages: any, star: any) => Promise<void>;
483
+ addOrEditQuickReply: (quickReply: any) => Promise<void>;
484
+ removeQuickReply: (timestamp: any) => Promise<void>;
485
+ type: string;
486
+ ws: import("./Client/websocket.js").WebSocketClient;
487
+ ev: {
488
+ process(handler: any): () => void;
489
+ emit(event: any, evData: any): any;
490
+ isBuffering(): boolean;
491
+ buffer: () => void;
492
+ flush: () => boolean;
493
+ createBufferedFunction(work: any): (...args: any[]) => Promise<any>;
494
+ on: (...args: any[]) => any;
495
+ off: (...args: any[]) => any;
496
+ removeAllListeners: (...args: any[]) => any;
497
+ destroy(): void;
498
+ };
499
+ authState: {
500
+ creds: any;
501
+ keys: {
502
+ get: (type: any, ids: any) => Promise<any>;
503
+ set: (data: any) => Promise<void>;
504
+ isInTransaction: () => boolean;
505
+ transaction: (work: any, key: any) => Promise<any>;
506
+ };
507
+ };
508
+ signalRepository: any;
509
+ user: any;
510
+ generateMessageTag: () => string;
511
+ query: (node: any, timeoutMs: any) => Promise<any>;
512
+ waitForMessage: (msgId: any, timeoutMs?: any) => Promise<any>;
513
+ waitForSocketOpen: () => Promise<void>;
514
+ sendRawMessage: (data: any) => Promise<void>;
515
+ sendNode: (frame: any) => Promise<void>;
516
+ logout: (msg: any) => Promise<void>;
517
+ end: (error: any) => Promise<void>;
518
+ registerSocketEndHandler: (handler: any) => void;
519
+ onUnexpectedError: (err: any, msg: any) => void;
520
+ uploadPreKeys: (count?: number) => Promise<void>;
521
+ uploadPreKeysToServerIfRequired: () => Promise<void>;
522
+ digestKeyBundle: () => Promise<void>;
523
+ rotateSignedPreKey: () => Promise<void>;
524
+ requestPairingCode: (phoneNumber: any, customPairingCode: any) => Promise<any>;
525
+ updateServerTimeOffset: ({ attrs }: {
526
+ attrs: any;
527
+ }) => void;
528
+ sendUnifiedSession: () => Promise<void>;
529
+ wamBuffer: import("../index.js").BinaryInfo;
530
+ waitForConnectionUpdate: (check: any, timeoutMs: any) => Promise<void>;
531
+ sendWAMBuffer: (wamBuffer: any) => Promise<any>;
532
+ executeUSyncQuery: (usyncQuery: any) => Promise<any>;
533
+ onWhatsApp: (...phoneNumber: any[]) => Promise<any>;
534
+ fetchAccountReachoutTimelock: () => Promise<{
535
+ isActive: boolean;
536
+ timeEnforcementEnds: Date | undefined;
537
+ enforcementType: any;
538
+ }>;
539
+ fetchNewChatMessageCap: () => Promise<any>;
540
+ };
541
+ export function extractCommunityMetadata(result: any): {
542
+ id: any;
543
+ subject: any;
544
+ subjectOwner: any;
545
+ subjectTime: number;
546
+ size: any;
547
+ creation: number;
548
+ owner: string | undefined;
549
+ desc: any;
550
+ descId: any;
551
+ linkedParent: any;
552
+ restrict: boolean;
553
+ announce: boolean;
554
+ isCommunity: boolean;
555
+ isCommunityAnnounce: boolean;
556
+ joinApprovalMode: boolean;
557
+ memberAddMode: boolean;
558
+ participants: any;
559
+ ephemeralDuration: number | undefined;
560
+ addressingMode: any;
561
+ };
@@ -2,7 +2,7 @@ import { proto } from '../../WAProto/index.js';
2
2
  import { WAMessageStubType } from '../Types/index.js';
3
3
  import { generateMessageID, generateMessageIDV2, unixTimestampSeconds } from '../Utils/index.js';
4
4
  import logger from '../Utils/logger.js';
5
- import { getBinaryNodeChild, getBinaryNodeChildren, getBinaryNodeChildString, jidEncode, jidNormalizedUser } from '../WABinary/index.js';
5
+ import { getBinaryNodeChild, getBinaryNodeChildren, getBinaryNodeChildString, isLidUser, isPnUser, jidEncode, jidNormalizedUser } from '../WABinary/index.js';
6
6
  import { makeBusinessSocket } from './business.js';
7
7
  export const makeCommunitiesSocket = (config) => {
8
8
  const sock = makeBusinessSocket(config);
@@ -418,9 +418,11 @@ export const extractCommunityMetadata = (result) => {
418
418
  joinApprovalMode: !!getBinaryNodeChild(community, 'membership_approval_mode'),
419
419
  memberAddMode,
420
420
  participants: getBinaryNodeChildren(community, 'participant').map(({ attrs }) => {
421
+ // Vanz@Fix (bug 59): ported PN/LID field population from groups.js — was previously TODO/unset
421
422
  return {
422
- // TODO: IMPLEMENT THE PN/LID FIELDS HERE!!
423
423
  id: attrs.jid,
424
+ phoneNumber: isLidUser(attrs.jid) && isPnUser(attrs.phone_number) ? attrs.phone_number : undefined,
425
+ lid: isPnUser(attrs.jid) && isLidUser(attrs.lid) ? attrs.lid : undefined,
424
426
  admin: (attrs.type || null)
425
427
  };
426
428
  }),
@@ -0,0 +1,117 @@
1
+ export class Dugong {
2
+ constructor(waUploadToServer: any, relayMessageFn: any, config: any, sock: any);
3
+ relayMessage: any;
4
+ waUploadToServer: any;
5
+ config: any;
6
+ sock: any;
7
+ detectType(content: any): "PAYMENT" | "PRODUCT" | "GROUP_INVITE" | "INTERACTIVE_BUTTONS" | "CAROUSEL" | "INTERACTIVE" | "ALBUM" | "EVENT" | "POLL_RESULT" | "GROUP_STORY" | null;
8
+ handlePayment(content: any, quoted: any): Promise<{
9
+ requestPaymentMessage: any;
10
+ }>;
11
+ handleProduct(content: any, _jid: any, _quoted: any): Promise<{
12
+ viewOnceMessage: {
13
+ message: {
14
+ interactiveMessage: {
15
+ body: {
16
+ text: any;
17
+ };
18
+ footer: {
19
+ text: any;
20
+ };
21
+ header: {
22
+ title: any;
23
+ hasMediaAttachment: boolean;
24
+ productMessage: {
25
+ product: {
26
+ productImage: any;
27
+ productId: any;
28
+ title: any;
29
+ description: any;
30
+ currencyCode: any;
31
+ priceAmount1000: any;
32
+ retailerId: any;
33
+ url: any;
34
+ productImageCount: number;
35
+ };
36
+ businessOwnerJid: string;
37
+ };
38
+ };
39
+ nativeFlowMessage: {
40
+ buttons: any;
41
+ };
42
+ };
43
+ };
44
+ };
45
+ }>;
46
+ handleInteractive(content: any, _jid: any, _quoted: any): Promise<{
47
+ interactiveMessage: {
48
+ body: {
49
+ text: any;
50
+ };
51
+ footer: {
52
+ text: any;
53
+ };
54
+ };
55
+ }>;
56
+ handleInteractiveButtons(content: any, _jid: any, _quoted: any): Promise<{
57
+ viewOnceMessage: {
58
+ message: {
59
+ messageContextInfo: {
60
+ deviceListMetadata: {};
61
+ deviceListMetadataVersion: number;
62
+ messageSecret: any;
63
+ };
64
+ interactiveMessage: {
65
+ body: {
66
+ text: any;
67
+ };
68
+ footer: {
69
+ text: any;
70
+ };
71
+ header: {
72
+ title: any;
73
+ subtitle: any;
74
+ hasMediaAttachment: boolean;
75
+ };
76
+ nativeFlowMessage: {
77
+ buttons: any;
78
+ };
79
+ };
80
+ };
81
+ };
82
+ }>;
83
+ handleCarousel(content: any, _jid: any, _quoted: any): Promise<{
84
+ viewOnceMessage: {
85
+ message: {
86
+ messageContextInfo: {
87
+ deviceListMetadata: {};
88
+ deviceListMetadataVersion: number;
89
+ messageSecret: any;
90
+ };
91
+ interactiveMessage: {
92
+ body: any;
93
+ footer: any;
94
+ header: any;
95
+ carouselMessage: {
96
+ cards: {
97
+ body: any;
98
+ footer: any;
99
+ header: {
100
+ title: any;
101
+ hasMediaAttachment: boolean;
102
+ };
103
+ }[];
104
+ messageVersion: any;
105
+ carouselCardType: any;
106
+ };
107
+ };
108
+ };
109
+ };
110
+ }>;
111
+ handleAlbum(content: any, jid: any, quoted: any): Promise<any>;
112
+ handleEvent(content: any, jid: any, quoted: any): Promise<any>;
113
+ handlePollResult(content: any, jid: any, quoted: any): Promise<any>;
114
+ handleGroupInvite(content: any, jid: any, quoted: any): Promise<any>;
115
+ handleGroupStory(content: any, jid: any, _quoted: any, options?: {}): Promise<any>;
116
+ sendStatusWhatsApp(content: any, jids?: any[]): Promise<any>;
117
+ }