@hbmodsofc/baileys 1.7.7 → 2.0.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 (155) hide show
  1. package/LICENSE +1 -1
  2. package/WAProto/index.js +157084 -24729
  3. package/lib/Defaults/baileys-version.json +3 -0
  4. package/lib/Defaults/index.d.ts +8 -12
  5. package/lib/Defaults/index.js +124 -90
  6. package/lib/Defaults/phonenumber-mcc.json +223 -0
  7. package/lib/Signal/Group/group_cipher.d.ts +1 -0
  8. package/lib/Signal/Group/group_cipher.js +39 -28
  9. package/lib/Signal/Group/queue-job.d.ts +1 -0
  10. package/lib/Signal/Group/queue-job.js +57 -0
  11. package/lib/Signal/Group/sender-chain-key.d.ts +1 -1
  12. package/lib/Signal/Group/sender-chain-key.js +2 -9
  13. package/lib/Signal/Group/sender-key-distribution-message.js +3 -3
  14. package/lib/Signal/Group/sender-key-message.js +3 -3
  15. package/lib/Signal/Group/sender-key-state.d.ts +4 -4
  16. package/lib/Signal/Group/sender-key-state.js +16 -47
  17. package/lib/Signal/libsignal.d.ts +3 -7
  18. package/lib/Signal/libsignal.js +39 -224
  19. package/lib/Socket/Client/{types.d.ts → abstract-socket-client.d.ts} +3 -1
  20. package/lib/Socket/Client/index.d.ts +3 -2
  21. package/lib/Socket/Client/index.js +3 -2
  22. package/lib/Socket/Client/mobile-socket-client.d.ts +13 -0
  23. package/lib/Socket/Client/mobile-socket-client.js +65 -0
  24. package/lib/Socket/Client/{websocket.d.ts → web-socket-client.d.ts} +1 -1
  25. package/lib/Socket/Client/{websocket.js → web-socket-client.js} +16 -10
  26. package/lib/Socket/business.d.ts +78 -94
  27. package/lib/Socket/business.js +11 -130
  28. package/lib/Socket/chats.d.ts +233 -63
  29. package/lib/Socket/chats.js +184 -234
  30. package/lib/Socket/groups.d.ts +41 -62
  31. package/lib/Socket/groups.js +64 -76
  32. package/lib/Socket/hbmods.d.ts +253 -0
  33. package/lib/Socket/hbmods.js +1 -0
  34. package/lib/Socket/index.d.ts +83 -129
  35. package/lib/Socket/index.js +6 -13
  36. package/lib/Socket/messages-recv.d.ts +48 -59
  37. package/lib/Socket/messages-recv.js +371 -516
  38. package/lib/Socket/messages-send.d.ts +67 -86
  39. package/lib/Socket/messages-send.js +1 -1091
  40. package/lib/Socket/newsletter.d.ts +64 -76
  41. package/lib/Socket/newsletter.js +1 -184
  42. package/lib/Socket/registration.d.ts +267 -0
  43. package/lib/Socket/registration.js +166 -0
  44. package/lib/Socket/socket.d.ts +13 -19
  45. package/lib/Socket/socket.js +1 -805
  46. package/lib/Socket/usync.d.ts +36 -0
  47. package/lib/Socket/usync.js +70 -0
  48. package/lib/Types/Auth.d.ts +10 -4
  49. package/lib/Types/Call.d.ts +1 -1
  50. package/lib/Types/Chat.d.ts +9 -29
  51. package/lib/Types/Chat.js +1 -7
  52. package/lib/Types/Contact.d.ts +1 -5
  53. package/lib/Types/Events.d.ts +14 -55
  54. package/lib/Types/GroupMetadata.d.ts +5 -15
  55. package/lib/Types/Label.d.ts +0 -11
  56. package/lib/Types/Label.js +1 -1
  57. package/lib/Types/LabelAssociation.js +1 -1
  58. package/lib/Types/Message.d.ts +49 -75
  59. package/lib/Types/Message.js +7 -10
  60. package/lib/Types/Newsletter.d.ts +98 -129
  61. package/lib/Types/Newsletter.js +38 -33
  62. package/lib/Types/Product.d.ts +1 -1
  63. package/lib/Types/Signal.d.ts +1 -29
  64. package/lib/Types/Socket.d.ts +22 -48
  65. package/lib/Types/State.d.ts +2 -13
  66. package/lib/Types/State.js +0 -12
  67. package/lib/Types/USync.d.ts +1 -1
  68. package/lib/Types/index.d.ts +3 -10
  69. package/lib/Types/index.js +2 -2
  70. package/lib/Utils/auth-utils.d.ts +3 -3
  71. package/lib/Utils/auth-utils.js +102 -378
  72. package/lib/Utils/baileys-event-stream.js +1 -1
  73. package/lib/Utils/business.d.ts +2 -2
  74. package/lib/Utils/business.js +13 -19
  75. package/lib/Utils/chat-utils.d.ts +22 -21
  76. package/lib/Utils/chat-utils.js +154 -201
  77. package/lib/Utils/crypto.d.ts +19 -18
  78. package/lib/Utils/crypto.js +37 -78
  79. package/lib/Utils/decode-wa-message.d.ts +7 -34
  80. package/lib/Utils/decode-wa-message.js +66 -138
  81. package/lib/Utils/event-buffer.d.ts +8 -6
  82. package/lib/Utils/event-buffer.js +43 -81
  83. package/lib/Utils/generics.d.ts +27 -27
  84. package/lib/Utils/generics.js +133 -128
  85. package/lib/Utils/history.d.ts +5 -9
  86. package/lib/Utils/history.js +23 -17
  87. package/lib/Utils/index.d.ts +0 -2
  88. package/lib/Utils/index.js +0 -2
  89. package/lib/Utils/link-preview.d.ts +4 -4
  90. package/lib/Utils/link-preview.js +12 -40
  91. package/lib/Utils/logger.d.ts +3 -11
  92. package/lib/Utils/lt-hash.d.ts +8 -8
  93. package/lib/Utils/lt-hash.js +24 -23
  94. package/lib/Utils/make-mutex.d.ts +2 -2
  95. package/lib/Utils/make-mutex.js +2 -3
  96. package/lib/Utils/messages-media.d.ts +41 -37
  97. package/lib/Utils/messages-media.js +368 -252
  98. package/lib/Utils/messages.d.ts +15 -13
  99. package/lib/Utils/messages.js +261 -274
  100. package/lib/Utils/noise-handler.d.ts +15 -13
  101. package/lib/Utils/noise-handler.js +26 -20
  102. package/lib/Utils/process-message.d.ts +8 -9
  103. package/lib/Utils/process-message.js +93 -157
  104. package/lib/Utils/signal.d.ts +5 -6
  105. package/lib/Utils/signal.js +29 -37
  106. package/lib/Utils/use-multi-file-auth-state.d.ts +2 -1
  107. package/lib/Utils/use-multi-file-auth-state.js +7 -12
  108. package/lib/Utils/validate-connection.d.ts +6 -5
  109. package/lib/Utils/validate-connection.js +97 -39
  110. package/lib/WABinary/constants.d.ts +27 -24
  111. package/lib/WABinary/constants.js +13 -1276
  112. package/lib/WABinary/decode.d.ts +4 -3
  113. package/lib/WABinary/decode.js +14 -28
  114. package/lib/WABinary/encode.d.ts +2 -1
  115. package/lib/WABinary/encode.js +147 -134
  116. package/lib/WABinary/generic-utils.d.ts +7 -4
  117. package/lib/WABinary/generic-utils.js +125 -40
  118. package/lib/WABinary/jid-utils.d.ts +8 -13
  119. package/lib/WABinary/jid-utils.js +16 -27
  120. package/lib/WAM/BinaryInfo.d.ts +11 -2
  121. package/lib/WAM/constants.d.ts +2 -3
  122. package/lib/WAM/constants.js +2359 -2252
  123. package/lib/WAM/encode.d.ts +2 -1
  124. package/lib/WAM/encode.js +11 -8
  125. package/lib/WAUSync/Protocols/USyncContactProtocol.d.ts +2 -2
  126. package/lib/WAUSync/Protocols/USyncContactProtocol.js +4 -3
  127. package/lib/WAUSync/Protocols/USyncDeviceProtocol.d.ts +2 -2
  128. package/lib/WAUSync/Protocols/USyncDeviceProtocol.js +5 -5
  129. package/lib/WAUSync/Protocols/USyncDisappearingModeProtocol.d.ts +2 -2
  130. package/lib/WAUSync/Protocols/USyncDisappearingModeProtocol.js +5 -5
  131. package/lib/WAUSync/Protocols/USyncStatusProtocol.d.ts +2 -2
  132. package/lib/WAUSync/Protocols/USyncStatusProtocol.js +6 -5
  133. package/lib/WAUSync/Protocols/UsyncBotProfileProtocol.d.ts +2 -2
  134. package/lib/WAUSync/Protocols/UsyncBotProfileProtocol.js +1 -1
  135. package/lib/WAUSync/Protocols/UsyncLIDProtocol.d.ts +3 -4
  136. package/lib/WAUSync/Protocols/UsyncLIDProtocol.js +3 -11
  137. package/lib/WAUSync/USyncQuery.d.ts +2 -2
  138. package/lib/WAUSync/USyncQuery.js +15 -19
  139. package/lib/WAUSync/USyncUser.d.ts +5 -5
  140. package/lib/WAUSync/index.d.ts +1 -1
  141. package/lib/WAUSync/index.js +1 -1
  142. package/package.json +102 -102
  143. package/lib/Signal/lid-mapping.d.ts +0 -26
  144. package/lib/Signal/lid-mapping.js +0 -146
  145. package/lib/Socket/communities.d.ts +0 -232
  146. package/lib/Socket/communities.js +0 -402
  147. package/lib/Socket/mex.d.ts +0 -2
  148. package/lib/Socket/mex.js +0 -45
  149. package/lib/Types/Bussines.d.ts +0 -24
  150. package/lib/Types/Bussines.js +0 -2
  151. package/lib/Utils/lidToJid-test.d.ts +0 -11
  152. package/lib/Utils/lidToJid-test.js +0 -27
  153. package/lib/Utils/message-retry-manager.d.ts +0 -81
  154. package/lib/Utils/message-retry-manager.js +0 -152
  155. /package/lib/Socket/Client/{types.js → abstract-socket-client.js} +0 -0
@@ -1,146 +0,0 @@
1
- "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.LIDMappingStore = void 0;
7
- const lru_cache_1 = require("lru-cache");
8
- const logger_1 = __importDefault(require("../Utils/logger"));
9
- const WABinary_1 = require("../WABinary");
10
- class LIDMappingStore {
11
- constructor(keys, onWhatsAppFunc) {
12
- this.mappingCache = new lru_cache_1.LRUCache({
13
- ttl: 7 * 24 * 60 * 60 * 1000, // 7 days
14
- ttlAutopurge: true,
15
- updateAgeOnGet: true
16
- });
17
- this.keys = keys;
18
- this.onWhatsAppFunc = onWhatsAppFunc; // needed to get LID from PN if not found
19
- }
20
- /**
21
- * Store LID-PN mapping - USER LEVEL
22
- */
23
- async storeLIDPNMappings(pairs) {
24
- // Validate inputs
25
- const pairMap = {};
26
- for (const { lid, pn } of pairs) {
27
- if (!(((0, WABinary_1.isLidUser)(lid) && (0, WABinary_1.isPnUser)(pn)) || ((0, WABinary_1.isPnUser)(lid) && (0, WABinary_1.isLidUser)(pn)))) {
28
- logger_1.default.warn(`Invalid LID-PN mapping: ${lid}, ${pn}`);
29
- continue;
30
- }
31
- const [lidJid, pnJid] = (0, WABinary_1.isLidUser)(lid) ? [lid, pn] : [pn, lid];
32
- const lidDecoded = (0, WABinary_1.jidDecode)(lidJid);
33
- const pnDecoded = (0, WABinary_1.jidDecode)(pnJid);
34
- if (!lidDecoded || !pnDecoded)
35
- return;
36
- const pnUser = pnDecoded.user;
37
- const lidUser = lidDecoded.user;
38
- // Check if mapping already exists (cache first, then database)
39
- let existingLidUser = this.mappingCache.get(`pn:${pnUser}`);
40
- if (!existingLidUser) {
41
- // Cache miss - check database
42
- const stored = await this.keys.get('lid-mapping', [pnUser]);
43
- existingLidUser = stored[pnUser];
44
- if (existingLidUser) {
45
- // Update cache with database value
46
- this.mappingCache.set(`pn:${pnUser}`, existingLidUser);
47
- this.mappingCache.set(`lid:${existingLidUser}`, pnUser);
48
- }
49
- }
50
- if (existingLidUser === lidUser) {
51
- logger_1.default.debug({ pnUser, lidUser }, 'LID mapping already exists, skipping');
52
- continue;
53
- }
54
- pairMap[pnUser] = lidUser;
55
- }
56
- logger_1.default.trace({ pairMap }, `Storing ${Object.keys(pairMap).length} pn mappings`);
57
- await this.keys.transaction(async () => {
58
- for (const [pnUser, lidUser] of Object.entries(pairMap)) {
59
- await this.keys.set({
60
- 'lid-mapping': {
61
- [pnUser]: lidUser, // "554396160286" -> "102765716062358"
62
- [`${lidUser}_reverse`]: pnUser // "102765716062358_reverse" -> "554396160286"
63
- }
64
- });
65
- // Update cache with both directions
66
- this.mappingCache.set(`pn:${pnUser}`, lidUser);
67
- this.mappingCache.set(`lid:${lidUser}`, pnUser);
68
- }
69
- }, 'lid-mapping');
70
- }
71
- /**
72
- * Get LID for PN - Returns device-specific LID based on user mapping
73
- */
74
- async getLIDForPN(pn) {
75
- if (!(0, WABinary_1.isPnUser)(pn))
76
- return null;
77
- const decoded = (0, WABinary_1.jidDecode)(pn);
78
- if (!decoded)
79
- return null;
80
- // Check cache first for PN → LID mapping
81
- const pnUser = decoded.user;
82
- let lidUser = this.mappingCache.get(`pn:${pnUser}`);
83
- if (!lidUser) {
84
- // Cache miss - check database
85
- const stored = await this.keys.get('lid-mapping', [pnUser]);
86
- lidUser = stored[pnUser];
87
- if (lidUser) {
88
- // Cache the database result
89
- this.mappingCache.set(`pn:${pnUser}`, lidUser);
90
- }
91
- else {
92
- // Not in database - try USync
93
- logger_1.default.trace(`No LID mapping found for PN user ${pnUser}; getting from USync`);
94
- const { exists, lid } = (await this.onWhatsAppFunc?.(pn))?.[0]; // this function already adds LIDs to mapping
95
- if (exists && lid) {
96
- lidUser = (0, WABinary_1.jidDecode)(lid)?.user;
97
- if (lidUser) {
98
- // Cache the USync result
99
- this.mappingCache.set(`pn:${pnUser}`, lidUser);
100
- }
101
- }
102
- else {
103
- return null;
104
- }
105
- }
106
- }
107
- if (typeof lidUser !== 'string' || !lidUser) {
108
- logger_1.default.warn(`Invalid or empty LID user for PN ${pn}: lidUser = "${lidUser}"`);
109
- return null;
110
- }
111
- // Push the PN device ID to the LID to maintain device separation
112
- const pnDevice = decoded.device !== undefined ? decoded.device : 0;
113
- const deviceSpecificLid = `${lidUser}:${pnDevice}@lid`;
114
- logger_1.default.trace(`getLIDForPN: ${pn} → ${deviceSpecificLid} (user mapping with device ${pnDevice})`);
115
- return deviceSpecificLid;
116
- }
117
- /**
118
- * Get PN for LID - USER LEVEL with device construction
119
- */
120
- async getPNForLID(lid) {
121
- if (!(0, WABinary_1.isLidUser)(lid))
122
- return null;
123
- const decoded = (0, WABinary_1.jidDecode)(lid);
124
- if (!decoded)
125
- return null;
126
- // Check cache first for LID → PN mapping
127
- const lidUser = decoded.user;
128
- let pnUser = this.mappingCache.get(`lid:${lidUser}`);
129
- if (!pnUser || typeof pnUser !== 'string') {
130
- // Cache miss - check database
131
- const stored = await this.keys.get('lid-mapping', [`${lidUser}_reverse`]);
132
- pnUser = stored[`${lidUser}_reverse`];
133
- if (!pnUser || typeof pnUser !== 'string') {
134
- logger_1.default.trace(`No reverse mapping found for LID user: ${lidUser}`);
135
- return null;
136
- }
137
- this.mappingCache.set(`lid:${lidUser}`, pnUser);
138
- }
139
- // Construct device-specific PN JID
140
- const lidDevice = decoded.device !== undefined ? decoded.device : 0;
141
- const pnJid = `${pnUser}:${lidDevice}@s.whatsapp.net`;
142
- logger_1.default.trace(`Found reverse mapping: ${lid} → ${pnJid}`);
143
- return pnJid;
144
- }
145
- }
146
- exports.LIDMappingStore = LIDMappingStore;
@@ -1,232 +0,0 @@
1
- import { proto } from '../../WAProto/index.js';
2
- import { type GroupMetadata, type ParticipantAction, type SocketConfig, type WAMessageKey } from '../Types';
3
- import { type BinaryNode } from '../WABinary';
4
- export declare const makeCommunitiesSocket: (config: SocketConfig) => {
5
- communityMetadata: (jid: string) => Promise<GroupMetadata>;
6
- communityCreate: (subject: string, body: string) => Promise<GroupMetadata | null>;
7
- communityCreateGroup: (subject: string, participants: string[], parentCommunityJid: string) => Promise<GroupMetadata | null>;
8
- communityLeave: (id: string) => Promise<void>;
9
- communityUpdateSubject: (jid: string, subject: string) => Promise<void>;
10
- communityLinkGroup: (groupJid: string, parentCommunityJid: string) => Promise<void>;
11
- communityUnlinkGroup: (groupJid: string, parentCommunityJid: string) => Promise<void>;
12
- communityRequestParticipantsList: (jid: string) => Promise<{
13
- [key: string]: string;
14
- }[]>;
15
- communityRequestParticipantsUpdate: (jid: string, participants: string[], action: "approve" | "reject") => Promise<{
16
- status: string;
17
- jid: string;
18
- }[]>;
19
- communityParticipantsUpdate: (jid: string, participants: string[], action: ParticipantAction) => Promise<{
20
- status: string;
21
- jid: string;
22
- content: BinaryNode;
23
- }[]>;
24
- communityUpdateDescription: (jid: string, description?: string) => Promise<void>;
25
- communityInviteCode: (jid: string) => Promise<string | undefined>;
26
- communityRevokeInvite: (jid: string) => Promise<string | undefined>;
27
- communityAcceptInvite: (code: string) => Promise<string | undefined>;
28
- /**
29
- * revoke a v4 invite for someone
30
- * @param communityJid community jid
31
- * @param invitedJid jid of person you invited
32
- * @returns true if successful
33
- */
34
- communityRevokeInviteV4: (communityJid: string, invitedJid: string) => Promise<boolean>;
35
- /**
36
- * accept a CommunityInviteMessage
37
- * @param key the key of the invite message, or optionally only provide the jid of the person who sent the invite
38
- * @param inviteMessage the message to accept
39
- */
40
- communityAcceptInviteV4: (key: string | WAMessageKey, inviteMessage: proto.Message.IGroupInviteMessage) => Promise<any>;
41
- communityGetInviteInfo: (code: string) => Promise<GroupMetadata>;
42
- communityToggleEphemeral: (jid: string, ephemeralExpiration: number) => Promise<void>;
43
- communitySettingUpdate: (jid: string, setting: "announcement" | "not_announcement" | "locked" | "unlocked") => Promise<void>;
44
- communityMemberAddMode: (jid: string, mode: "admin_add" | "all_member_add") => Promise<void>;
45
- communityJoinApprovalMode: (jid: string, mode: "on" | "off") => Promise<void>;
46
- communityFetchAllParticipating: () => Promise<{
47
- [_: string]: GroupMetadata;
48
- }>;
49
- logger: import("../Utils/logger").ILogger;
50
- getOrderDetails: (orderId: string, tokenBase64: string) => Promise<import("../Types").OrderDetails>;
51
- getCatalog: ({ jid, limit, cursor }: import("../Types").GetCatalogOptions) => Promise<{
52
- products: import("../Types").Product[];
53
- nextPageCursor: string | undefined;
54
- }>;
55
- getCollections: (jid?: string, limit?: number) => Promise<{
56
- collections: import("../Types").CatalogCollection[];
57
- }>;
58
- productCreate: (create: import("../Types").ProductCreate) => Promise<import("../Types").Product>;
59
- productDelete: (productIds: string[]) => Promise<{
60
- deleted: number;
61
- }>;
62
- productUpdate: (productId: string, update: import("../Types").ProductUpdate) => Promise<import("../Types").Product>;
63
- updateBussinesProfile: (args: import("../Types/Bussines.js").UpdateBussinesProfileProps) => Promise<any>;
64
- updateCoverPhoto: (photo: import("../Types").WAMediaUpload) => Promise<number>;
65
- removeCoverPhoto: (id: string) => Promise<any>;
66
- sendMessageAck: ({ tag, attrs, content }: BinaryNode, errorCode?: number) => Promise<void>;
67
- sendRetryRequest: (node: BinaryNode, forceIncludeKeys?: boolean) => Promise<void>;
68
- rejectCall: (callId: string, callFrom: string) => Promise<void>;
69
- fetchMessageHistory: (count: number, oldestMsgKey: WAMessageKey, oldestMsgTimestamp: number | Long) => Promise<string>;
70
- requestPlaceholderResend: (messageKey: WAMessageKey) => Promise<string | undefined>;
71
- messageRetryManager: import("../Utils").MessageRetryManager | null;
72
- getPrivacyTokens: (jids: string[]) => Promise<any>;
73
- assertSessions: (jids: string[], force: boolean) => Promise<boolean>;
74
- relayMessage: (jid: string, message: proto.IMessage, { messageId: msgId, participant, additionalAttributes, additionalNodes, useUserDevicesCache, useCachedGroupMetadata, statusJidList }: import("../Types").MessageRelayOptions) => Promise<string>;
75
- sendReceipt: (jid: string, participant: string | undefined, messageIds: string[], type: import("../Types").MessageReceiptType) => Promise<void>;
76
- sendReceipts: (keys: WAMessageKey[], type: import("../Types").MessageReceiptType) => Promise<void>;
77
- readMessages: (keys: WAMessageKey[]) => Promise<void>;
78
- refreshMediaConn: (forceGet?: boolean) => Promise<import("../Types").MediaConnInfo>;
79
- waUploadToServer: import("../Types").WAMediaUploadFunction;
80
- fetchPrivacySettings: (force?: boolean) => Promise<{
81
- [_: string]: string;
82
- }>;
83
- sendPeerDataOperationMessage: (pdoMessage: proto.Message.IPeerDataOperationRequestMessage) => Promise<string>;
84
- createParticipantNodes: (jids: string[], message: proto.IMessage, extraAttrs?: BinaryNode["attrs"], dsmMessage?: proto.IMessage) => Promise<{
85
- nodes: BinaryNode[];
86
- shouldIncludeDeviceIdentity: boolean;
87
- }>;
88
- getUSyncDevices: (jids: string[], useCache: boolean, ignoreZeroDevices: boolean) => Promise<(import("../WABinary").JidWithDevice & {
89
- wireJid: string;
90
- })[]>;
91
- updateMediaMessage: (message: proto.IWebMessageInfo) => Promise<proto.IWebMessageInfo>;
92
- sendMessage: (jid: string, content: import("../Types").AnyMessageContent, options?: import("../Types").MiscMessageGenerationOptions) => Promise<proto.WebMessageInfo | undefined>;
93
- newsletterCreate: (name: string, description?: string) => Promise<import("../Types").NewsletterMetadata>;
94
- newsletterUpdate: (jid: string, updates: import("../Types").NewsletterUpdate) => Promise<unknown>;
95
- newsletterSubscribers: (jid: string) => Promise<{
96
- subscribers: number;
97
- }>;
98
- newsletterMetadata: (type: "invite" | "jid", key: string) => Promise<import("../Types").NewsletterMetadata | null>;
99
- newsletterFollow: (jid: string) => Promise<unknown>;
100
- newsletterUnfollow: (jid: string) => Promise<unknown>;
101
- newsletterMute: (jid: string) => Promise<unknown>;
102
- newsletterUnmute: (jid: string) => Promise<unknown>;
103
- newsletterUpdateName: (jid: string, name: string) => Promise<unknown>;
104
- newsletterUpdateDescription: (jid: string, description: string) => Promise<unknown>;
105
- newsletterUpdatePicture: (jid: string, content: import("../Types").WAMediaUpload) => Promise<unknown>;
106
- newsletterRemovePicture: (jid: string) => Promise<unknown>;
107
- newsletterReactMessage: (jid: string, serverId: string, reaction?: string) => Promise<void>;
108
- newsletterFetchMessages: (jid: string, count: number, since: number, after: number) => Promise<any>;
109
- subscribeNewsletterUpdates: (jid: string) => Promise<{
110
- duration: string;
111
- } | null>;
112
- newsletterAdminCount: (jid: string) => Promise<number>;
113
- newsletterChangeOwner: (jid: string, newOwnerJid: string) => Promise<void>;
114
- newsletterDemote: (jid: string, userJid: string) => Promise<void>;
115
- newsletterDelete: (jid: string) => Promise<void>;
116
- groupMetadata: (jid: string) => Promise<GroupMetadata>;
117
- groupCreate: (subject: string, participants: string[]) => Promise<GroupMetadata>;
118
- groupLeave: (id: string) => Promise<void>;
119
- groupUpdateSubject: (jid: string, subject: string) => Promise<void>;
120
- groupRequestParticipantsList: (jid: string) => Promise<{
121
- [key: string]: string;
122
- }[]>;
123
- groupRequestParticipantsUpdate: (jid: string, participants: string[], action: "approve" | "reject") => Promise<{
124
- status: string;
125
- jid: string;
126
- }[]>;
127
- groupParticipantsUpdate: (jid: string, participants: string[], action: ParticipantAction) => Promise<{
128
- status: string;
129
- jid: string;
130
- content: BinaryNode;
131
- }[]>;
132
- groupUpdateDescription: (jid: string, description?: string) => Promise<void>;
133
- groupInviteCode: (jid: string) => Promise<string | undefined>;
134
- groupRevokeInvite: (jid: string) => Promise<string | undefined>;
135
- groupAcceptInvite: (code: string) => Promise<string | undefined>;
136
- groupRevokeInviteV4: (groupJid: string, invitedJid: string) => Promise<boolean>;
137
- groupAcceptInviteV4: (key: string | WAMessageKey, inviteMessage: proto.Message.IGroupInviteMessage) => Promise<any>;
138
- groupGetInviteInfo: (code: string) => Promise<GroupMetadata>;
139
- groupToggleEphemeral: (jid: string, ephemeralExpiration: number) => Promise<void>;
140
- groupSettingUpdate: (jid: string, setting: "announcement" | "not_announcement" | "locked" | "unlocked") => Promise<void>;
141
- groupMemberAddMode: (jid: string, mode: "admin_add" | "all_member_add") => Promise<void>;
142
- groupJoinApprovalMode: (jid: string, mode: "on" | "off") => Promise<void>;
143
- groupFetchAllParticipating: () => Promise<{
144
- [_: string]: GroupMetadata;
145
- }>;
146
- createCallLink: (type: "audio" | "video", event?: {
147
- startTime: number;
148
- }, timeoutMs?: number) => Promise<string | undefined>;
149
- getBotListV2: () => Promise<import("../Types").BotListInfo[]>;
150
- processingMutex: {
151
- mutex<T>(code: () => Promise<T> | T): Promise<T>;
152
- };
153
- upsertMessage: (msg: import("../Types").WAMessage, type: import("../Types").MessageUpsertType) => Promise<void>;
154
- appPatch: (patchCreate: import("../Types").WAPatchCreate) => Promise<void>;
155
- sendPresenceUpdate: (type: import("../Types").WAPresence, toJid?: string) => Promise<void>;
156
- presenceSubscribe: (toJid: string, tcToken?: Buffer) => Promise<void>;
157
- profilePictureUrl: (jid: string, type?: "preview" | "image", timeoutMs?: number) => Promise<string | undefined>;
158
- fetchBlocklist: () => Promise<string[]>;
159
- fetchStatus: (...jids: string[]) => Promise<import("../index.js").USyncQueryResultList[] | undefined>;
160
- fetchDisappearingDuration: (...jids: string[]) => Promise<import("../index.js").USyncQueryResultList[] | undefined>;
161
- updateProfilePicture: (jid: string, content: import("../Types").WAMediaUpload, dimensions?: {
162
- width: number;
163
- height: number;
164
- }) => Promise<void>;
165
- removeProfilePicture: (jid: string) => Promise<void>;
166
- updateProfileStatus: (status: string) => Promise<void>;
167
- updateProfileName: (name: string) => Promise<void>;
168
- updateBlockStatus: (jid: string, action: "block" | "unblock") => Promise<void>;
169
- updateDisableLinkPreviewsPrivacy: (isPreviewsDisabled: boolean) => Promise<void>;
170
- updateCallPrivacy: (value: import("../Types").WAPrivacyCallValue) => Promise<void>;
171
- updateMessagesPrivacy: (value: import("../Types").WAPrivacyMessagesValue) => Promise<void>;
172
- updateLastSeenPrivacy: (value: import("../Types").WAPrivacyValue) => Promise<void>;
173
- updateOnlinePrivacy: (value: import("../Types").WAPrivacyOnlineValue) => Promise<void>;
174
- updateProfilePicturePrivacy: (value: import("../Types").WAPrivacyValue) => Promise<void>;
175
- updateStatusPrivacy: (value: import("../Types").WAPrivacyValue) => Promise<void>;
176
- updateReadReceiptsPrivacy: (value: import("../Types").WAReadReceiptsValue) => Promise<void>;
177
- updateGroupsAddPrivacy: (value: import("../Types").WAPrivacyGroupAddValue) => Promise<void>;
178
- updateDefaultDisappearingMode: (duration: number) => Promise<void>;
179
- getBusinessProfile: (jid: string) => Promise<import("../Types").WABusinessProfile | void>;
180
- resyncAppState: (collections: readonly ("critical_unblock_low" | "regular_high" | "regular_low" | "critical_block" | "regular")[], isInitialSync: boolean) => Promise<void>;
181
- chatModify: (mod: import("../Types").ChatModification, jid: string) => Promise<void>;
182
- cleanDirtyBits: (type: "account_sync" | "groups", fromTimestamp?: number | string) => Promise<void>;
183
- addOrEditContact: (jid: string, contact: proto.SyncActionValue.IContactAction) => Promise<void>;
184
- removeContact: (jid: string) => Promise<void>;
185
- addLabel: (jid: string, labels: import("../Types/Label.js").LabelActionBody) => Promise<void>;
186
- addChatLabel: (jid: string, labelId: string) => Promise<void>;
187
- removeChatLabel: (jid: string, labelId: string) => Promise<void>;
188
- addMessageLabel: (jid: string, messageId: string, labelId: string) => Promise<void>;
189
- removeMessageLabel: (jid: string, messageId: string, labelId: string) => Promise<void>;
190
- star: (jid: string, messages: {
191
- id: string;
192
- fromMe?: boolean;
193
- }[], star: boolean) => Promise<void>;
194
- addOrEditQuickReply: (quickReply: import("../Types/Bussines.js").QuickReplyAction) => Promise<void>;
195
- removeQuickReply: (timestamp: string) => Promise<void>;
196
- type: "md";
197
- ws: import("./Client/websocket.js").WebSocketClient;
198
- ev: import("../Types").BaileysEventEmitter & {
199
- process(handler: (events: Partial<import("../Types").BaileysEventMap>) => void | Promise<void>): () => void;
200
- buffer(): void;
201
- createBufferedFunction<A extends any[], T>(work: (...args: A) => Promise<T>): (...args: A) => Promise<T>;
202
- flush(): boolean;
203
- isBuffering(): boolean;
204
- };
205
- authState: {
206
- creds: import("../Types").AuthenticationCreds;
207
- keys: import("../Types").SignalKeyStoreWithTransaction;
208
- };
209
- signalRepository: import("../Types").SignalRepositoryWithLIDStore;
210
- user: import("../Types").Contact | undefined;
211
- generateMessageTag: () => string;
212
- query: (node: BinaryNode, timeoutMs?: number) => Promise<any>;
213
- waitForMessage: <T>(msgId: string, timeoutMs?: number | undefined) => Promise<T | undefined>;
214
- waitForSocketOpen: () => Promise<void>;
215
- sendRawMessage: (data: Uint8Array | Buffer) => Promise<void>;
216
- sendNode: (frame: BinaryNode) => Promise<void>;
217
- logout: (msg?: string) => Promise<void>;
218
- end: (error: Error | undefined) => void;
219
- onUnexpectedError: (err: Error | import("@hapi/boom").Boom, msg: string) => void;
220
- uploadPreKeys: (count?: number, retryCount?: number) => Promise<void>;
221
- uploadPreKeysToServerIfRequired: () => Promise<void>;
222
- requestPairingCode: (phoneNumber: string, customPairingCode?: string) => Promise<string>;
223
- waitForConnectionUpdate: (check: (u: Partial<import("../Types").ConnectionState>) => Promise<boolean | undefined>, timeoutMs?: number) => Promise<void>;
224
- sendWAMBuffer: (wamBuffer: Buffer) => Promise<any>;
225
- executeUSyncQuery: (usyncQuery: import("../index.js").USyncQuery) => Promise<import("../index.js").USyncQueryResult | undefined>;
226
- onWhatsApp: (...jids: string[]) => Promise<{
227
- jid: string;
228
- exists: boolean;
229
- lid: string;
230
- }[] | undefined>;
231
- };
232
- export declare const extractCommunityMetadata: (result: BinaryNode) => GroupMetadata;