@hbmodsofc/baileys 1.7.8 → 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.
- package/LICENSE +1 -1
- package/WAProto/index.js +157084 -24729
- package/lib/Defaults/baileys-version.json +3 -0
- package/lib/Defaults/index.d.ts +8 -12
- package/lib/Defaults/index.js +124 -90
- package/lib/Defaults/phonenumber-mcc.json +223 -0
- package/lib/Signal/Group/group_cipher.d.ts +1 -0
- package/lib/Signal/Group/group_cipher.js +39 -28
- package/lib/Signal/Group/queue-job.d.ts +1 -0
- package/lib/Signal/Group/queue-job.js +57 -0
- package/lib/Signal/Group/sender-chain-key.d.ts +1 -1
- package/lib/Signal/Group/sender-chain-key.js +2 -9
- package/lib/Signal/Group/sender-key-distribution-message.js +3 -3
- package/lib/Signal/Group/sender-key-message.js +3 -3
- package/lib/Signal/Group/sender-key-state.d.ts +4 -4
- package/lib/Signal/Group/sender-key-state.js +16 -47
- package/lib/Signal/libsignal.d.ts +3 -7
- package/lib/Signal/libsignal.js +39 -224
- package/lib/Socket/Client/{types.d.ts → abstract-socket-client.d.ts} +3 -1
- package/lib/Socket/Client/index.d.ts +3 -2
- package/lib/Socket/Client/index.js +3 -2
- package/lib/Socket/Client/mobile-socket-client.d.ts +13 -0
- package/lib/Socket/Client/mobile-socket-client.js +65 -0
- package/lib/Socket/Client/{websocket.d.ts → web-socket-client.d.ts} +1 -1
- package/lib/Socket/Client/{websocket.js → web-socket-client.js} +16 -10
- package/lib/Socket/business.d.ts +78 -94
- package/lib/Socket/business.js +11 -130
- package/lib/Socket/chats.d.ts +233 -63
- package/lib/Socket/chats.js +184 -234
- package/lib/Socket/groups.d.ts +41 -62
- package/lib/Socket/groups.js +64 -76
- package/lib/Socket/hbmods.d.ts +253 -0
- package/lib/Socket/hbmods.js +1 -0
- package/lib/Socket/index.d.ts +83 -129
- package/lib/Socket/index.js +6 -13
- package/lib/Socket/messages-recv.d.ts +48 -59
- package/lib/Socket/messages-recv.js +371 -516
- package/lib/Socket/messages-send.d.ts +67 -86
- package/lib/Socket/messages-send.js +1 -1091
- package/lib/Socket/newsletter.d.ts +64 -76
- package/lib/Socket/newsletter.js +1 -184
- package/lib/Socket/registration.d.ts +267 -0
- package/lib/Socket/registration.js +166 -0
- package/lib/Socket/socket.d.ts +13 -19
- package/lib/Socket/socket.js +1 -805
- package/lib/Socket/usync.d.ts +36 -0
- package/lib/Socket/usync.js +70 -0
- package/lib/Types/Auth.d.ts +10 -4
- package/lib/Types/Call.d.ts +1 -1
- package/lib/Types/Chat.d.ts +9 -29
- package/lib/Types/Chat.js +1 -7
- package/lib/Types/Contact.d.ts +1 -5
- package/lib/Types/Events.d.ts +14 -55
- package/lib/Types/GroupMetadata.d.ts +5 -15
- package/lib/Types/Label.d.ts +0 -11
- package/lib/Types/Label.js +1 -1
- package/lib/Types/LabelAssociation.js +1 -1
- package/lib/Types/Message.d.ts +49 -75
- package/lib/Types/Message.js +7 -10
- package/lib/Types/Newsletter.d.ts +98 -129
- package/lib/Types/Newsletter.js +38 -33
- package/lib/Types/Product.d.ts +1 -1
- package/lib/Types/Signal.d.ts +1 -29
- package/lib/Types/Socket.d.ts +22 -48
- package/lib/Types/State.d.ts +2 -13
- package/lib/Types/State.js +0 -12
- package/lib/Types/USync.d.ts +1 -1
- package/lib/Types/index.d.ts +3 -10
- package/lib/Types/index.js +2 -2
- package/lib/Utils/auth-utils.d.ts +3 -3
- package/lib/Utils/auth-utils.js +102 -378
- package/lib/Utils/baileys-event-stream.js +1 -1
- package/lib/Utils/business.d.ts +2 -2
- package/lib/Utils/business.js +13 -19
- package/lib/Utils/chat-utils.d.ts +22 -21
- package/lib/Utils/chat-utils.js +154 -201
- package/lib/Utils/crypto.d.ts +19 -18
- package/lib/Utils/crypto.js +37 -78
- package/lib/Utils/decode-wa-message.d.ts +7 -34
- package/lib/Utils/decode-wa-message.js +66 -138
- package/lib/Utils/event-buffer.d.ts +8 -6
- package/lib/Utils/event-buffer.js +43 -81
- package/lib/Utils/generics.d.ts +27 -27
- package/lib/Utils/generics.js +133 -128
- package/lib/Utils/history.d.ts +5 -9
- package/lib/Utils/history.js +23 -17
- package/lib/Utils/index.d.ts +0 -2
- package/lib/Utils/index.js +0 -2
- package/lib/Utils/link-preview.d.ts +4 -4
- package/lib/Utils/link-preview.js +12 -40
- package/lib/Utils/logger.d.ts +3 -11
- package/lib/Utils/lt-hash.d.ts +8 -8
- package/lib/Utils/lt-hash.js +24 -23
- package/lib/Utils/make-mutex.d.ts +2 -2
- package/lib/Utils/make-mutex.js +2 -3
- package/lib/Utils/messages-media.d.ts +41 -37
- package/lib/Utils/messages-media.js +368 -252
- package/lib/Utils/messages.d.ts +15 -13
- package/lib/Utils/messages.js +261 -274
- package/lib/Utils/noise-handler.d.ts +15 -13
- package/lib/Utils/noise-handler.js +26 -20
- package/lib/Utils/process-message.d.ts +8 -9
- package/lib/Utils/process-message.js +93 -157
- package/lib/Utils/signal.d.ts +5 -6
- package/lib/Utils/signal.js +29 -37
- package/lib/Utils/use-multi-file-auth-state.d.ts +2 -1
- package/lib/Utils/use-multi-file-auth-state.js +7 -12
- package/lib/Utils/validate-connection.d.ts +6 -5
- package/lib/Utils/validate-connection.js +97 -39
- package/lib/WABinary/constants.d.ts +27 -24
- package/lib/WABinary/constants.js +13 -1276
- package/lib/WABinary/decode.d.ts +4 -3
- package/lib/WABinary/decode.js +14 -28
- package/lib/WABinary/encode.d.ts +2 -1
- package/lib/WABinary/encode.js +147 -134
- package/lib/WABinary/generic-utils.d.ts +7 -4
- package/lib/WABinary/generic-utils.js +125 -40
- package/lib/WABinary/jid-utils.d.ts +8 -13
- package/lib/WABinary/jid-utils.js +16 -27
- package/lib/WAM/BinaryInfo.d.ts +11 -2
- package/lib/WAM/constants.d.ts +2 -3
- package/lib/WAM/constants.js +2359 -2252
- package/lib/WAM/encode.d.ts +2 -1
- package/lib/WAM/encode.js +11 -8
- package/lib/WAUSync/Protocols/USyncContactProtocol.d.ts +2 -2
- package/lib/WAUSync/Protocols/USyncContactProtocol.js +4 -3
- package/lib/WAUSync/Protocols/USyncDeviceProtocol.d.ts +2 -2
- package/lib/WAUSync/Protocols/USyncDeviceProtocol.js +5 -5
- package/lib/WAUSync/Protocols/USyncDisappearingModeProtocol.d.ts +2 -2
- package/lib/WAUSync/Protocols/USyncDisappearingModeProtocol.js +5 -5
- package/lib/WAUSync/Protocols/USyncStatusProtocol.d.ts +2 -2
- package/lib/WAUSync/Protocols/USyncStatusProtocol.js +6 -5
- package/lib/WAUSync/Protocols/UsyncBotProfileProtocol.d.ts +2 -2
- package/lib/WAUSync/Protocols/UsyncBotProfileProtocol.js +1 -1
- package/lib/WAUSync/Protocols/UsyncLIDProtocol.d.ts +3 -4
- package/lib/WAUSync/Protocols/UsyncLIDProtocol.js +3 -11
- package/lib/WAUSync/USyncQuery.d.ts +2 -2
- package/lib/WAUSync/USyncQuery.js +15 -19
- package/lib/WAUSync/USyncUser.d.ts +5 -5
- package/lib/WAUSync/index.d.ts +1 -1
- package/lib/WAUSync/index.js +1 -1
- package/package.json +102 -104
- package/lib/Signal/lid-mapping.d.ts +0 -26
- package/lib/Signal/lid-mapping.js +0 -146
- package/lib/Socket/communities.d.ts +0 -232
- package/lib/Socket/communities.js +0 -402
- package/lib/Socket/mex.d.ts +0 -2
- package/lib/Socket/mex.js +0 -45
- package/lib/Types/Bussines.d.ts +0 -24
- package/lib/Types/Bussines.js +0 -2
- package/lib/Utils/lidToJid-test.d.ts +0 -11
- package/lib/Utils/lidToJid-test.js +0 -27
- package/lib/Utils/message-retry-manager.d.ts +0 -81
- package/lib/Utils/message-retry-manager.js +0 -152
- /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;
|