@queenanya/baileys 7.4.7 → 7.4.10
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/lib/Defaults/baileys-version.json +1 -1
- package/lib/Socket/business.d.ts +7 -11
- package/lib/Socket/chats.d.ts +9 -12
- package/lib/Socket/chats.js +50 -79
- package/lib/Socket/communities.d.ts +216 -0
- package/lib/Socket/communities.js +354 -0
- package/lib/Socket/groups.d.ts +7 -11
- package/lib/Socket/index.d.ts +37 -11
- package/lib/Socket/index.js +2 -2
- package/lib/Socket/messages-recv.d.ts +7 -11
- package/lib/Socket/messages-send.d.ts +7 -11
- package/lib/Socket/newsletter.d.ts +7 -11
- package/lib/Socket/usync.d.ts +38 -0
- package/lib/Socket/usync.js +70 -0
- package/lib/Types/Chat.d.ts +3 -0
- package/lib/Types/Contact.d.ts +5 -0
- package/lib/Types/USync.d.ts +25 -0
- package/lib/Types/USync.js +2 -0
- package/lib/Utils/chat-utils.js +11 -0
- package/lib/Utils/generics.js +3 -2
- package/lib/WAUSync/Protocols/USyncContactProtocol.d.ts +9 -0
- package/lib/WAUSync/Protocols/USyncContactProtocol.js +32 -0
- package/lib/WAUSync/Protocols/USyncDeviceProtocol.d.ts +22 -0
- package/lib/WAUSync/Protocols/USyncDeviceProtocol.js +57 -0
- package/lib/WAUSync/Protocols/USyncDisappearingModeProtocol.d.ts +12 -0
- package/lib/WAUSync/Protocols/USyncDisappearingModeProtocol.js +30 -0
- package/lib/WAUSync/Protocols/USyncStatusProtocol.d.ts +12 -0
- package/lib/WAUSync/Protocols/USyncStatusProtocol.js +42 -0
- package/lib/WAUSync/Protocols/index.d.ts +4 -0
- package/lib/WAUSync/Protocols/index.js +20 -0
- package/lib/WAUSync/USyncQuery.d.ts +26 -0
- package/lib/WAUSync/USyncQuery.js +79 -0
- package/lib/WAUSync/USyncUser.d.ts +10 -0
- package/lib/WAUSync/USyncUser.js +22 -0
- package/lib/WAUSync/index.d.ts +3 -0
- package/lib/WAUSync/index.js +19 -0
- package/lib/index.d.ts +1 -0
- package/lib/index.js +1 -0
- package/package.json +2 -2
package/lib/Socket/business.d.ts
CHANGED
|
@@ -104,19 +104,12 @@ export declare const makeBusinessSocket: (config: SocketConfig) => {
|
|
|
104
104
|
presenceSubscribe: (toJid: string, tcToken?: Buffer | undefined) => Promise<void>;
|
|
105
105
|
profilePictureUrl: (jid: string, type?: "image" | "preview", timeoutMs?: number | undefined) => Promise<string | undefined>;
|
|
106
106
|
onWhatsApp: (...jids: string[]) => Promise<{
|
|
107
|
-
exists: boolean;
|
|
108
107
|
jid: string;
|
|
109
|
-
|
|
108
|
+
exists: unknown;
|
|
109
|
+
}[] | undefined>;
|
|
110
110
|
fetchBlocklist: () => Promise<string[]>;
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
duration: number;
|
|
114
|
-
setAt: Date;
|
|
115
|
-
}[]>;
|
|
116
|
-
fetchStatus: (jid: string) => Promise<{
|
|
117
|
-
status: string | undefined;
|
|
118
|
-
setAt: Date;
|
|
119
|
-
} | undefined>;
|
|
111
|
+
fetchStatus: (...jids: string[]) => Promise<import("..").USyncQueryResultList[] | undefined>;
|
|
112
|
+
fetchDisappearingDuration: (...jids: string[]) => Promise<import("..").USyncQueryResultList[] | undefined>;
|
|
120
113
|
updateProfilePicture: (jid: string, content: import("../Types").WAMediaUpload) => Promise<void>;
|
|
121
114
|
updateProfilePictureFull: (jid: any, content: any) => Promise<void>;
|
|
122
115
|
updateProfilePictureFull2: (jid: any, content: any) => Promise<void>;
|
|
@@ -136,6 +129,8 @@ export declare const makeBusinessSocket: (config: SocketConfig) => {
|
|
|
136
129
|
resyncAppState: (collections: readonly ("critical_block" | "critical_unblock_low" | "regular_high" | "regular_low" | "regular")[], isInitialSync: boolean) => Promise<void>;
|
|
137
130
|
chatModify: (mod: import("../Types").ChatModification, jid: string) => Promise<void>;
|
|
138
131
|
cleanDirtyBits: (type: "account_sync" | "groups", fromTimestamp?: string | number | undefined) => Promise<void>;
|
|
132
|
+
addOrEditContact: (jid: string, contact: import("../Types").ContactAction) => Promise<void>;
|
|
133
|
+
removeContact: (jid: string) => Promise<void>;
|
|
139
134
|
addLabel: (jid: string, labels: import("../Types/Label").LabelActionBody) => Promise<void>;
|
|
140
135
|
addChatLabel: (jid: string, labelId: string) => Promise<void>;
|
|
141
136
|
removeChatLabel: (jid: string, labelId: string) => Promise<void>;
|
|
@@ -145,6 +140,7 @@ export declare const makeBusinessSocket: (config: SocketConfig) => {
|
|
|
145
140
|
id: string;
|
|
146
141
|
fromMe?: boolean | undefined;
|
|
147
142
|
}[], star: boolean) => Promise<void>;
|
|
143
|
+
executeUSyncQuery: (usyncQuery: import("..").USyncQuery) => Promise<import("..").USyncQueryResult | undefined>;
|
|
148
144
|
type: "md";
|
|
149
145
|
ws: import("./Client").WebSocketClient;
|
|
150
146
|
ev: import("../Types").BaileysEventEmitter & {
|
package/lib/Socket/chats.d.ts
CHANGED
|
@@ -2,9 +2,10 @@
|
|
|
2
2
|
/// <reference types="node" />
|
|
3
3
|
import { Boom } from '@hapi/boom';
|
|
4
4
|
import { proto } from '../../WAProto';
|
|
5
|
-
import { ChatModification, MessageUpsertType, SocketConfig, WABusinessProfile, WAMediaUpload, WAPatchCreate, WAPresence, WAPrivacyCallValue, WAPrivacyGroupAddValue, WAPrivacyOnlineValue, WAPrivacyValue, WAReadReceiptsValue } from '../Types';
|
|
5
|
+
import { ChatModification, ContactAction, MessageUpsertType, SocketConfig, WABusinessProfile, WAMediaUpload, WAPatchCreate, WAPresence, WAPrivacyCallValue, WAPrivacyGroupAddValue, WAPrivacyOnlineValue, WAPrivacyValue, WAReadReceiptsValue } from '../Types';
|
|
6
6
|
import { LabelActionBody } from '../Types/Label';
|
|
7
7
|
import { BinaryNode } from '../WABinary';
|
|
8
|
+
import { USyncQuery } from '../WAUSync';
|
|
8
9
|
export declare const makeChatsSocket: (config: SocketConfig) => {
|
|
9
10
|
processingMutex: {
|
|
10
11
|
mutex<T>(code: () => T | Promise<T>): Promise<T>;
|
|
@@ -18,19 +19,12 @@ export declare const makeChatsSocket: (config: SocketConfig) => {
|
|
|
18
19
|
presenceSubscribe: (toJid: string, tcToken?: Buffer) => Promise<void>;
|
|
19
20
|
profilePictureUrl: (jid: string, type?: 'preview' | 'image', timeoutMs?: number) => Promise<string | undefined>;
|
|
20
21
|
onWhatsApp: (...jids: string[]) => Promise<{
|
|
21
|
-
exists: boolean;
|
|
22
22
|
jid: string;
|
|
23
|
-
|
|
23
|
+
exists: unknown;
|
|
24
|
+
}[] | undefined>;
|
|
24
25
|
fetchBlocklist: () => Promise<string[]>;
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
duration: number;
|
|
28
|
-
setAt: Date;
|
|
29
|
-
}[]>;
|
|
30
|
-
fetchStatus: (jid: string) => Promise<{
|
|
31
|
-
status: string | undefined;
|
|
32
|
-
setAt: Date;
|
|
33
|
-
} | undefined>;
|
|
26
|
+
fetchStatus: (...jids: string[]) => Promise<import("../WAUSync").USyncQueryResultList[] | undefined>;
|
|
27
|
+
fetchDisappearingDuration: (...jids: string[]) => Promise<import("../WAUSync").USyncQueryResultList[] | undefined>;
|
|
34
28
|
updateProfilePicture: (jid: string, content: WAMediaUpload) => Promise<void>;
|
|
35
29
|
updateProfilePictureFull: (jid: any, content: any) => Promise<void>;
|
|
36
30
|
updateProfilePictureFull2: (jid: any, content: any) => Promise<void>;
|
|
@@ -50,6 +44,8 @@ export declare const makeChatsSocket: (config: SocketConfig) => {
|
|
|
50
44
|
resyncAppState: (collections: readonly ("critical_block" | "critical_unblock_low" | "regular_high" | "regular_low" | "regular")[], isInitialSync: boolean) => Promise<void>;
|
|
51
45
|
chatModify: (mod: ChatModification, jid: string) => Promise<void>;
|
|
52
46
|
cleanDirtyBits: (type: 'account_sync' | 'groups', fromTimestamp?: number | string) => Promise<void>;
|
|
47
|
+
addOrEditContact: (jid: string, contact: ContactAction) => Promise<void>;
|
|
48
|
+
removeContact: (jid: string) => Promise<void>;
|
|
53
49
|
addLabel: (jid: string, labels: LabelActionBody) => Promise<void>;
|
|
54
50
|
addChatLabel: (jid: string, labelId: string) => Promise<void>;
|
|
55
51
|
removeChatLabel: (jid: string, labelId: string) => Promise<void>;
|
|
@@ -59,6 +55,7 @@ export declare const makeChatsSocket: (config: SocketConfig) => {
|
|
|
59
55
|
id: string;
|
|
60
56
|
fromMe?: boolean;
|
|
61
57
|
}[], star: boolean) => Promise<void>;
|
|
58
|
+
executeUSyncQuery: (usyncQuery: USyncQuery) => Promise<import("../WAUSync").USyncQueryResult | undefined>;
|
|
62
59
|
type: "md";
|
|
63
60
|
ws: import("./Client").WebSocketClient;
|
|
64
61
|
ev: import("../Types").BaileysEventEmitter & {
|
package/lib/Socket/chats.js
CHANGED
|
@@ -13,11 +13,12 @@ const Utils_1 = require("../Utils");
|
|
|
13
13
|
const make_mutex_1 = require("../Utils/make-mutex");
|
|
14
14
|
const process_message_1 = __importDefault(require("../Utils/process-message"));
|
|
15
15
|
const WABinary_1 = require("../WABinary");
|
|
16
|
-
const
|
|
16
|
+
const WAUSync_1 = require("../WAUSync");
|
|
17
|
+
const usync_1 = require("./usync");
|
|
17
18
|
const MAX_SYNC_ATTEMPTS = 2;
|
|
18
19
|
const makeChatsSocket = (config) => {
|
|
19
20
|
const { logger, markOnlineOnConnect, fireInitQueries, appStateMacVerification, shouldIgnoreJid, shouldSyncHistoryMessage, } = config;
|
|
20
|
-
const sock = (0,
|
|
21
|
+
const sock = (0, usync_1.makeUSyncSocket)(config);
|
|
21
22
|
const { ev, ws, authState, generateMessageTag, sendNode, query, onUnexpectedError, } = sock;
|
|
22
23
|
let privacySettings;
|
|
23
24
|
let needToFlushWithAppStateSync = false;
|
|
@@ -111,88 +112,40 @@ const makeChatsSocket = (config) => {
|
|
|
111
112
|
}]
|
|
112
113
|
});
|
|
113
114
|
};
|
|
114
|
-
/** helper function to run a generic IQ query */
|
|
115
|
-
const interactiveQuery = async (userNodes, queryNode) => {
|
|
116
|
-
const result = await query({
|
|
117
|
-
tag: 'iq',
|
|
118
|
-
attrs: {
|
|
119
|
-
to: WABinary_1.S_WHATSAPP_NET,
|
|
120
|
-
type: 'get',
|
|
121
|
-
xmlns: 'usync',
|
|
122
|
-
},
|
|
123
|
-
content: [
|
|
124
|
-
{
|
|
125
|
-
tag: 'usync',
|
|
126
|
-
attrs: {
|
|
127
|
-
sid: generateMessageTag(),
|
|
128
|
-
mode: 'query',
|
|
129
|
-
last: 'true',
|
|
130
|
-
index: '0',
|
|
131
|
-
context: 'interactive',
|
|
132
|
-
},
|
|
133
|
-
content: [
|
|
134
|
-
{
|
|
135
|
-
tag: 'query',
|
|
136
|
-
attrs: {},
|
|
137
|
-
content: [queryNode]
|
|
138
|
-
},
|
|
139
|
-
{
|
|
140
|
-
tag: 'list',
|
|
141
|
-
attrs: {},
|
|
142
|
-
content: userNodes
|
|
143
|
-
}
|
|
144
|
-
]
|
|
145
|
-
}
|
|
146
|
-
],
|
|
147
|
-
});
|
|
148
|
-
const usyncNode = (0, WABinary_1.getBinaryNodeChild)(result, 'usync');
|
|
149
|
-
const listNode = (0, WABinary_1.getBinaryNodeChild)(usyncNode, 'list');
|
|
150
|
-
const users = (0, WABinary_1.getBinaryNodeChildren)(listNode, 'user');
|
|
151
|
-
return users;
|
|
152
|
-
};
|
|
153
115
|
const onWhatsApp = async (...jids) => {
|
|
154
|
-
const
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
const
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
const
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
}).filter(item => item.exists);
|
|
173
|
-
};
|
|
174
|
-
const fetchStatus = async (jid) => {
|
|
175
|
-
const [result] = await interactiveQuery([{ tag: 'user', attrs: { jid } }], { tag: 'status', attrs: {} });
|
|
116
|
+
const usyncQuery = new WAUSync_1.USyncQuery()
|
|
117
|
+
.withContactProtocol();
|
|
118
|
+
for (const jid of jids) {
|
|
119
|
+
const phone = `+${jid.replace('+', '').split('@')[0].split(':')[0]}`;
|
|
120
|
+
usyncQuery.withUser(new WAUSync_1.USyncUser().withPhone(phone));
|
|
121
|
+
}
|
|
122
|
+
const results = await sock.executeUSyncQuery(usyncQuery);
|
|
123
|
+
if (results) {
|
|
124
|
+
return results.list.filter((a) => !!a.contact).map(({ contact, id }) => ({ jid: id, exists: contact }));
|
|
125
|
+
}
|
|
126
|
+
};
|
|
127
|
+
const fetchStatus = async (...jids) => {
|
|
128
|
+
const usyncQuery = new WAUSync_1.USyncQuery()
|
|
129
|
+
.withStatusProtocol();
|
|
130
|
+
for (const jid of jids) {
|
|
131
|
+
usyncQuery.withUser(new WAUSync_1.USyncUser().withId(jid));
|
|
132
|
+
}
|
|
133
|
+
const result = await sock.executeUSyncQuery(usyncQuery);
|
|
176
134
|
if (result) {
|
|
177
|
-
|
|
178
|
-
return {
|
|
179
|
-
status: status === null || status === void 0 ? void 0 : status.content.toString(),
|
|
180
|
-
setAt: new Date(+((status === null || status === void 0 ? void 0 : status.attrs.t) || 0) * 1000)
|
|
181
|
-
};
|
|
135
|
+
return result.list;
|
|
182
136
|
}
|
|
183
137
|
};
|
|
184
138
|
/** Fetching The Disappearing Duration of a specific chats by their jids*/
|
|
185
139
|
const fetchDisappearingDuration = async (...jids) => {
|
|
186
|
-
const
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
});
|
|
140
|
+
const usyncQuery = new WAUSync_1.USyncQuery()
|
|
141
|
+
.withDisappearingModeProtocol();
|
|
142
|
+
for (const jid of jids) {
|
|
143
|
+
usyncQuery.withUser(new WAUSync_1.USyncUser().withId(jid));
|
|
144
|
+
}
|
|
145
|
+
const result = await sock.executeUSyncQuery(usyncQuery);
|
|
146
|
+
if (result) {
|
|
147
|
+
return result.list;
|
|
148
|
+
}
|
|
196
149
|
};
|
|
197
150
|
/** update the profile picture for yourself or a group */
|
|
198
151
|
const updateProfilePicture = async (jid, content) => {
|
|
@@ -740,6 +693,22 @@ const makeChatsSocket = (config) => {
|
|
|
740
693
|
}
|
|
741
694
|
}, jid);
|
|
742
695
|
};
|
|
696
|
+
/**
|
|
697
|
+
* Add or Edit Contact
|
|
698
|
+
*/
|
|
699
|
+
const addOrEditContact = (jid, contact) => {
|
|
700
|
+
return chatModify({
|
|
701
|
+
contact
|
|
702
|
+
}, jid);
|
|
703
|
+
};
|
|
704
|
+
/**
|
|
705
|
+
* Remove Contact
|
|
706
|
+
*/
|
|
707
|
+
const removeContact = (jid) => {
|
|
708
|
+
return chatModify({
|
|
709
|
+
contact: null
|
|
710
|
+
}, jid);
|
|
711
|
+
};
|
|
743
712
|
/**
|
|
744
713
|
* Adds label
|
|
745
714
|
*/
|
|
@@ -917,8 +886,8 @@ const makeChatsSocket = (config) => {
|
|
|
917
886
|
profilePictureUrl,
|
|
918
887
|
onWhatsApp,
|
|
919
888
|
fetchBlocklist,
|
|
920
|
-
fetchDisappearingDuration,
|
|
921
889
|
fetchStatus,
|
|
890
|
+
fetchDisappearingDuration,
|
|
922
891
|
updateProfilePicture,
|
|
923
892
|
updateProfilePictureFull,
|
|
924
893
|
updateProfilePictureFull2,
|
|
@@ -938,6 +907,8 @@ const makeChatsSocket = (config) => {
|
|
|
938
907
|
resyncAppState,
|
|
939
908
|
chatModify,
|
|
940
909
|
cleanDirtyBits,
|
|
910
|
+
addOrEditContact,
|
|
911
|
+
removeContact,
|
|
941
912
|
addLabel,
|
|
942
913
|
addChatLabel,
|
|
943
914
|
removeChatLabel,
|
|
@@ -0,0 +1,216 @@
|
|
|
1
|
+
/// <reference types="long" />
|
|
2
|
+
/// <reference types="node" />
|
|
3
|
+
/// <reference types="node" />
|
|
4
|
+
import { proto } from '../../WAProto';
|
|
5
|
+
import { GroupMetadata, ParticipantAction, SocketConfig, WAMessageKey } from '../Types';
|
|
6
|
+
import { BinaryNode } from '../WABinary';
|
|
7
|
+
export declare const makeCommunitiesSocket: (config: SocketConfig) => {
|
|
8
|
+
communityMetadata: (jid: string) => Promise<GroupMetadata>;
|
|
9
|
+
communityCreate: (subject: any, body: any) => Promise<GroupMetadata | null>;
|
|
10
|
+
communityLeave: (id: string) => Promise<void>;
|
|
11
|
+
communityUpdateSubject: (jid: string, subject: 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<string>;
|
|
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("pino").Logger<never, boolean>;
|
|
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 | undefined, 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
|
+
sendMessageAck: ({ tag, attrs, content }: BinaryNode) => Promise<void>;
|
|
64
|
+
sendRetryRequest: (node: BinaryNode, forceIncludeKeys?: boolean) => Promise<void>;
|
|
65
|
+
rejectCall: (callId: string, callFrom: string) => Promise<void>;
|
|
66
|
+
fetchMessageHistory: (count: number, oldestMsgKey: WAMessageKey, oldestMsgTimestamp: number | import("long").Long) => Promise<string>;
|
|
67
|
+
requestPlaceholderResend: (messageKey: WAMessageKey) => Promise<string | undefined>;
|
|
68
|
+
getPrivacyTokens: (jids: string[]) => Promise<BinaryNode>;
|
|
69
|
+
assertSessions: (jids: string[], force: boolean) => Promise<boolean>;
|
|
70
|
+
relayMessage: (jid: string, message: proto.IMessage, { messageId: msgId, participant, additionalAttributes, additionalNodes, useUserDevicesCache, useCachedGroupMetadata, statusJidList }: import("../Types").MessageRelayOptions) => Promise<string>;
|
|
71
|
+
sendReceipt: (jid: string, participant: string | undefined, messageIds: string[], type: import("../Types").MessageReceiptType) => Promise<void>;
|
|
72
|
+
sendReceipts: (keys: WAMessageKey[], type: import("../Types").MessageReceiptType) => Promise<void>;
|
|
73
|
+
readMessages: (keys: WAMessageKey[]) => Promise<void>;
|
|
74
|
+
refreshMediaConn: (forceGet?: boolean) => Promise<import("../Types").MediaConnInfo>;
|
|
75
|
+
waUploadToServer: import("../Types").WAMediaUploadFunction;
|
|
76
|
+
fetchPrivacySettings: (force?: boolean) => Promise<{
|
|
77
|
+
[_: string]: string;
|
|
78
|
+
}>;
|
|
79
|
+
sendPeerDataOperationMessage: (pdoMessage: proto.Message.IPeerDataOperationRequestMessage) => Promise<string>;
|
|
80
|
+
createParticipantNodes: (jids: string[], message: proto.IMessage, extraAttrs?: {
|
|
81
|
+
[key: string]: string;
|
|
82
|
+
} | undefined) => Promise<{
|
|
83
|
+
nodes: BinaryNode[];
|
|
84
|
+
shouldIncludeDeviceIdentity: boolean;
|
|
85
|
+
}>;
|
|
86
|
+
getUSyncDevices: (jids: string[], useCache: boolean, ignoreZeroDevices: boolean) => Promise<import("../WABinary").JidWithDevice[]>;
|
|
87
|
+
updateMediaMessage: (message: proto.IWebMessageInfo) => Promise<proto.IWebMessageInfo>;
|
|
88
|
+
sendMessage: (jid: string, content: import("../Types").AnyMessageContent, options?: import("../Types").MiscMessageGenerationOptions) => Promise<proto.WebMessageInfo | undefined>;
|
|
89
|
+
subscribeNewsletterUpdates: (jid: string) => Promise<{
|
|
90
|
+
duration: string;
|
|
91
|
+
}>;
|
|
92
|
+
newsletterReactionMode: (jid: string, mode: import("../Types").NewsletterReactionMode) => Promise<void>;
|
|
93
|
+
newsletterUpdateDescription: (jid: string, description?: string | undefined) => Promise<void>;
|
|
94
|
+
newsletterUpdateName: (jid: string, name: string) => Promise<void>;
|
|
95
|
+
newsletterUpdatePicture: (jid: string, content: import("../Types").WAMediaUpload) => Promise<void>;
|
|
96
|
+
newsletterRemovePicture: (jid: string) => Promise<void>;
|
|
97
|
+
newsletterUnfollow: (jid: string) => Promise<void>;
|
|
98
|
+
newsletterFollow: (jid: string) => Promise<void>;
|
|
99
|
+
newsletterUnmute: (jid: string) => Promise<void>;
|
|
100
|
+
newsletterMute: (jid: string) => Promise<void>;
|
|
101
|
+
newsletterCreate: (name: string, description: string) => Promise<import("../Types").NewsletterMetadata>;
|
|
102
|
+
newsletterMetadata: (type: "invite" | "jid", key: string, role?: import("../Types").NewsletterViewRole | undefined) => Promise<import("../Types").NewsletterMetadata>;
|
|
103
|
+
newsletterAdminCount: (jid: string) => Promise<number>;
|
|
104
|
+
newsletterChangeOwner: (jid: string, user: string) => Promise<void>;
|
|
105
|
+
newsletterDemote: (jid: string, user: string) => Promise<void>;
|
|
106
|
+
newsletterDelete: (jid: string) => Promise<void>;
|
|
107
|
+
newsletterReactMessage: (jid: string, server_id: string, code?: string | undefined) => Promise<void>;
|
|
108
|
+
newsletterFetchMessages: (type: "invite" | "jid", key: string, count: number, after?: number | undefined) => Promise<import("../Types").NewsletterFetchedUpdate[]>;
|
|
109
|
+
newsletterFetchUpdates: (jid: string, count: number, after?: number | undefined, since?: number | undefined) => Promise<import("../Types").NewsletterFetchedUpdate[]>;
|
|
110
|
+
groupMetadata: (jid: string) => Promise<GroupMetadata>;
|
|
111
|
+
groupCreate: (subject: string, participants: string[]) => Promise<GroupMetadata>;
|
|
112
|
+
groupLeave: (id: string) => Promise<void>;
|
|
113
|
+
groupUpdateSubject: (jid: string, subject: string) => Promise<void>;
|
|
114
|
+
groupRequestParticipantsList: (jid: string) => Promise<{
|
|
115
|
+
[key: string]: string;
|
|
116
|
+
}[]>;
|
|
117
|
+
groupRequestParticipantsUpdate: (jid: string, participants: string[], action: "reject" | "approve") => Promise<{
|
|
118
|
+
status: string;
|
|
119
|
+
jid: string;
|
|
120
|
+
}[]>;
|
|
121
|
+
groupParticipantsUpdate: (jid: string, participants: string[], action: ParticipantAction) => Promise<{
|
|
122
|
+
status: string;
|
|
123
|
+
jid: string;
|
|
124
|
+
content: BinaryNode;
|
|
125
|
+
}[]>;
|
|
126
|
+
groupUpdateDescription: (jid: string, description?: string | undefined) => Promise<void>;
|
|
127
|
+
groupInviteCode: (jid: string) => Promise<string | undefined>;
|
|
128
|
+
groupRevokeInvite: (jid: string) => Promise<string | undefined>;
|
|
129
|
+
groupAcceptInvite: (code: string) => Promise<string | undefined>;
|
|
130
|
+
groupRevokeInviteV4: (groupJid: string, invitedJid: string) => Promise<boolean>;
|
|
131
|
+
groupAcceptInviteV4: (key: string | WAMessageKey, inviteMessage: proto.Message.IGroupInviteMessage) => Promise<string>;
|
|
132
|
+
groupGetInviteInfo: (code: string) => Promise<GroupMetadata>;
|
|
133
|
+
groupToggleEphemeral: (jid: string, ephemeralExpiration: number) => Promise<void>;
|
|
134
|
+
groupSettingUpdate: (jid: string, setting: "announcement" | "locked" | "not_announcement" | "unlocked") => Promise<void>;
|
|
135
|
+
groupMemberAddMode: (jid: string, mode: "all_member_add" | "admin_add") => Promise<void>;
|
|
136
|
+
groupJoinApprovalMode: (jid: string, mode: "on" | "off") => Promise<void>;
|
|
137
|
+
groupFetchAllParticipating: () => Promise<{
|
|
138
|
+
[_: string]: GroupMetadata;
|
|
139
|
+
}>;
|
|
140
|
+
processingMutex: {
|
|
141
|
+
mutex<T>(code: () => T | Promise<T>): Promise<T>;
|
|
142
|
+
};
|
|
143
|
+
upsertMessage: (msg: proto.IWebMessageInfo, type: import("../Types").MessageUpsertType) => Promise<void>;
|
|
144
|
+
appPatch: (patchCreate: import("../Types").WAPatchCreate) => Promise<void>;
|
|
145
|
+
sendPresenceUpdate: (type: import("../Types").WAPresence, toJid?: string | undefined) => Promise<void>;
|
|
146
|
+
presenceSubscribe: (toJid: string, tcToken?: Buffer | undefined) => Promise<void>;
|
|
147
|
+
profilePictureUrl: (jid: string, type?: "image" | "preview", timeoutMs?: number | undefined) => Promise<string | undefined>;
|
|
148
|
+
onWhatsApp: (...jids: string[]) => Promise<{
|
|
149
|
+
jid: string;
|
|
150
|
+
exists: unknown;
|
|
151
|
+
}[] | undefined>;
|
|
152
|
+
fetchBlocklist: () => Promise<string[]>;
|
|
153
|
+
fetchStatus: (...jids: string[]) => Promise<import("..").USyncQueryResultList[] | undefined>;
|
|
154
|
+
fetchDisappearingDuration: (...jids: string[]) => Promise<import("..").USyncQueryResultList[] | undefined>;
|
|
155
|
+
updateProfilePicture: (jid: string, content: import("../Types").WAMediaUpload) => Promise<void>;
|
|
156
|
+
updateProfilePictureFull: (jid: any, content: any) => Promise<void>;
|
|
157
|
+
updateProfilePictureFull2: (jid: any, content: any) => Promise<void>;
|
|
158
|
+
removeProfilePicture: (jid: string) => Promise<void>;
|
|
159
|
+
updateProfileStatus: (status: string) => Promise<void>;
|
|
160
|
+
updateProfileName: (name: string) => Promise<void>;
|
|
161
|
+
updateBlockStatus: (jid: string, action: "block" | "unblock") => Promise<void>;
|
|
162
|
+
updateCallPrivacy: (value: import("../Types").WAPrivacyCallValue) => Promise<void>;
|
|
163
|
+
updateLastSeenPrivacy: (value: import("../Types").WAPrivacyValue) => Promise<void>;
|
|
164
|
+
updateOnlinePrivacy: (value: import("../Types").WAPrivacyOnlineValue) => Promise<void>;
|
|
165
|
+
updateProfilePicturePrivacy: (value: import("../Types").WAPrivacyValue) => Promise<void>;
|
|
166
|
+
updateStatusPrivacy: (value: import("../Types").WAPrivacyValue) => Promise<void>;
|
|
167
|
+
updateReadReceiptsPrivacy: (value: import("../Types").WAReadReceiptsValue) => Promise<void>;
|
|
168
|
+
updateGroupsAddPrivacy: (value: import("../Types").WAPrivacyGroupAddValue) => Promise<void>;
|
|
169
|
+
updateDefaultDisappearingMode: (duration: number) => Promise<void>;
|
|
170
|
+
getBusinessProfile: (jid: string) => Promise<void | import("../Types").WABusinessProfile>;
|
|
171
|
+
resyncAppState: (collections: readonly ("critical_block" | "critical_unblock_low" | "regular_high" | "regular_low" | "regular")[], isInitialSync: boolean) => Promise<void>;
|
|
172
|
+
chatModify: (mod: import("../Types").ChatModification, jid: string) => Promise<void>;
|
|
173
|
+
cleanDirtyBits: (type: "account_sync" | "groups", fromTimestamp?: string | number | undefined) => Promise<void>;
|
|
174
|
+
addOrEditContact: (jid: string, contact: import("../Types").ContactAction) => Promise<void>;
|
|
175
|
+
removeContact: (jid: string) => Promise<void>;
|
|
176
|
+
addLabel: (jid: string, labels: import("../Types/Label").LabelActionBody) => Promise<void>;
|
|
177
|
+
addChatLabel: (jid: string, labelId: string) => Promise<void>;
|
|
178
|
+
removeChatLabel: (jid: string, labelId: string) => Promise<void>;
|
|
179
|
+
addMessageLabel: (jid: string, messageId: string, labelId: string) => Promise<void>;
|
|
180
|
+
removeMessageLabel: (jid: string, messageId: string, labelId: string) => Promise<void>;
|
|
181
|
+
star: (jid: string, messages: {
|
|
182
|
+
id: string;
|
|
183
|
+
fromMe?: boolean | undefined;
|
|
184
|
+
}[], star: boolean) => Promise<void>;
|
|
185
|
+
executeUSyncQuery: (usyncQuery: import("..").USyncQuery) => Promise<import("..").USyncQueryResult | undefined>;
|
|
186
|
+
type: "md";
|
|
187
|
+
ws: import("./Client").WebSocketClient;
|
|
188
|
+
ev: import("../Types").BaileysEventEmitter & {
|
|
189
|
+
process(handler: (events: Partial<import("../Types").BaileysEventMap>) => void | Promise<void>): () => void;
|
|
190
|
+
buffer(): void;
|
|
191
|
+
createBufferedFunction<A extends any[], T_1>(work: (...args: A) => Promise<T_1>): (...args: A) => Promise<T_1>;
|
|
192
|
+
flush(force?: boolean | undefined): boolean;
|
|
193
|
+
isBuffering(): boolean;
|
|
194
|
+
};
|
|
195
|
+
authState: {
|
|
196
|
+
creds: import("../Types").AuthenticationCreds;
|
|
197
|
+
keys: import("../Types").SignalKeyStoreWithTransaction;
|
|
198
|
+
};
|
|
199
|
+
signalRepository: import("../Types").SignalRepository;
|
|
200
|
+
user: import("../Types").Contact | undefined;
|
|
201
|
+
generateMessageTag: () => string;
|
|
202
|
+
query: (node: BinaryNode, timeoutMs?: number | undefined) => Promise<BinaryNode>;
|
|
203
|
+
waitForMessage: <T_2>(msgId: string, timeoutMs?: number | undefined) => Promise<T_2>;
|
|
204
|
+
waitForSocketOpen: () => Promise<void>;
|
|
205
|
+
sendRawMessage: (data: Uint8Array | Buffer) => Promise<void>;
|
|
206
|
+
sendNode: (frame: BinaryNode) => Promise<void>;
|
|
207
|
+
logout: (msg?: string | undefined) => Promise<void>;
|
|
208
|
+
end: (error: Error | undefined) => void;
|
|
209
|
+
onUnexpectedError: (err: Error | import("@hapi/boom").Boom<any>, msg: string) => void;
|
|
210
|
+
uploadPreKeys: (count?: number) => Promise<void>;
|
|
211
|
+
uploadPreKeysToServerIfRequired: () => Promise<void>;
|
|
212
|
+
requestPairingCode: (phoneNumber: string) => Promise<string>;
|
|
213
|
+
waitForConnectionUpdate: (check: (u: Partial<import("../Types").ConnectionState>) => boolean | undefined, timeoutMs?: number | undefined) => Promise<void>;
|
|
214
|
+
sendWAMBuffer: (wamBuffer: Buffer) => Promise<BinaryNode>;
|
|
215
|
+
};
|
|
216
|
+
export declare const extractCommunityMetadata: (result: BinaryNode) => GroupMetadata;
|