alipclutch-baileys 8.3.0 → 8.4.1
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 +3 -1
- package/README.md +10 -9
- package/WAProto/GenerateStatics.sh +4 -0
- package/WAProto/WAProto.proto +4775 -0
- package/WAProto/index.d.ts +55057 -0
- package/WAProto/index.js +56887 -17535
- package/WAProto/index.ts.ts +53473 -0
- package/lib/Defaults/baileys-version.json +2 -2
- package/lib/Defaults/index.d.ts +16 -7
- package/lib/Defaults/index.js +90 -119
- package/lib/Socket/Client/index.d.ts +2 -3
- package/lib/Socket/Client/index.js +2 -3
- package/lib/Socket/Client/types.d.ts +0 -1
- package/lib/Socket/Client/types.js +0 -1
- package/lib/Socket/Client/websocket.d.ts +0 -1
- package/lib/Socket/Client/websocket.js +0 -1
- package/lib/Socket/business.d.ts +59 -58
- package/lib/Socket/chats.d.ts +45 -230
- package/lib/Socket/chats.js +139 -238
- package/lib/Socket/groups.d.ts +41 -32
- package/lib/Socket/groups.js +38 -23
- package/lib/Socket/index.d.ts +63 -64
- package/lib/Socket/index.js +2 -3
- package/lib/Socket/messages-recv.js +9 -65
- package/lib/Socket/messages-send.d.ts +49 -47
- package/lib/Socket/messages-send.js +584 -395
- package/lib/Socket/newsletter.d.ts +39 -37
- package/lib/Socket/newsletter.js +88 -123
- package/lib/Socket/setup.js +433 -0
- package/lib/Socket/{dugong.d.ts → setup.ts} +17 -52
- package/lib/Socket/socket.d.ts +10 -10
- package/lib/Socket/socket.js +62 -38
- package/lib/Socket/usync.d.ts +3 -4
- package/lib/Socket/usync.js +0 -1
- package/lib/Store/index.d.ts +1 -2
- package/lib/Store/index.js +1 -3
- package/lib/Store/make-in-memory-store.d.ts +24 -24
- package/lib/Store/make-in-memory-store.js +26 -14
- package/lib/Store/make-ordered-dictionary.d.ts +1 -1
- package/lib/Store/make-ordered-dictionary.js +2 -2
- package/lib/Types/Auth.d.ts +0 -7
- package/lib/Types/Call.d.ts +1 -1
- package/lib/Types/Chat.d.ts +14 -7
- package/lib/Types/Contact.d.ts +5 -1
- package/lib/Types/Events.d.ts +44 -2
- package/lib/Types/GroupMetadata.d.ts +11 -2
- package/lib/Types/Label.js +1 -1
- package/lib/Types/LabelAssociation.js +1 -1
- package/lib/Types/Message.d.ts +148 -21
- package/lib/Types/Message.js +0 -2
- package/lib/Types/Newsletter.d.ts +73 -97
- package/lib/Types/Newsletter.js +18 -38
- package/lib/Types/Socket.d.ts +17 -9
- package/lib/Types/index.d.ts +8 -1
- package/lib/Types/index.js +2 -2
- package/lib/Utils/auth-utils.d.ts +3 -3
- package/lib/Utils/auth-utils.js +6 -13
- package/lib/Utils/business.js +2 -2
- package/lib/Utils/chat-utils.d.ts +15 -16
- package/lib/Utils/chat-utils.js +36 -35
- package/lib/Utils/crypto.d.ts +15 -16
- package/lib/Utils/crypto.js +71 -29
- package/lib/Utils/decode-wa-message.d.ts +22 -6
- package/lib/Utils/decode-wa-message.js +65 -56
- package/lib/Utils/event-buffer.d.ts +2 -2
- package/lib/Utils/event-buffer.js +11 -7
- package/lib/Utils/generics.d.ts +17 -20
- package/lib/Utils/generics.js +95 -75
- package/lib/Utils/history.d.ts +4 -0
- package/lib/Utils/history.js +4 -6
- package/lib/Utils/link-preview.d.ts +2 -2
- package/lib/Utils/link-preview.js +34 -1
- package/lib/Utils/logger.d.ts +10 -3
- package/lib/Utils/lt-hash.d.ts +2 -2
- package/lib/Utils/lt-hash.js +6 -6
- package/lib/Utils/make-mutex.d.ts +2 -2
- package/lib/Utils/messages-media.d.ts +28 -24
- package/lib/Utils/messages-media.js +272 -111
- package/lib/Utils/messages.d.ts +13 -10
- package/lib/Utils/messages.js +323 -50
- package/lib/Utils/noise-handler.d.ts +10 -12
- package/lib/Utils/noise-handler.js +18 -23
- package/lib/Utils/process-message.d.ts +5 -4
- package/lib/Utils/process-message.js +108 -25
- package/lib/Utils/signal.d.ts +2 -1
- package/lib/Utils/signal.js +26 -26
- package/lib/Utils/use-multi-file-auth-state.d.ts +0 -1
- package/lib/Utils/use-multi-file-auth-state.js +51 -6
- package/lib/Utils/validate-connection.d.ts +3 -4
- package/lib/Utils/validate-connection.js +90 -66
- package/lib/WABinary/constants.d.ts +24 -27
- package/lib/WABinary/constants.js +1276 -13
- package/lib/WABinary/decode.d.ts +3 -4
- package/lib/WABinary/decode.js +26 -13
- package/lib/WABinary/encode.d.ts +1 -2
- package/lib/WABinary/encode.js +137 -152
- package/lib/WABinary/generic-utils.d.ts +1 -4
- package/lib/WABinary/generic-utils.js +37 -125
- package/lib/WABinary/jid-utils.d.ts +11 -5
- package/lib/WABinary/jid-utils.js +28 -5
- package/lib/WABinary/jid-utils.js.bak +83 -0
- package/lib/WAM/BinaryInfo.d.ts +2 -11
- package/lib/WAM/encode.d.ts +1 -2
- package/lib/WAUSync/Protocols/USyncDisappearingModeProtocol.js +1 -1
- package/lib/index.d.ts +0 -1
- package/lib/index.js +27 -15
- package/package.json +18 -31
- package/engine-requirements.js +0 -10
- package/lib/Defaults/phonenumber-mcc.json +0 -223
- package/lib/Socket/Client/abstract-socket-client.d.ts +0 -17
- package/lib/Socket/Client/abstract-socket-client.js +0 -13
- package/lib/Socket/Client/mobile-socket-client.d.ts +0 -13
- package/lib/Socket/Client/mobile-socket-client.js +0 -65
- package/lib/Socket/Client/web-socket-client.d.ts +0 -12
- package/lib/Socket/Client/web-socket-client.js +0 -62
- package/lib/Socket/dugong.js +0 -483
- package/lib/Socket/registration.d.ts +0 -267
- package/lib/Socket/registration.js +0 -166
- package/lib/Store/make-cache-manager-store.d.ts +0 -13
- package/lib/Store/make-cache-manager-store.js +0 -83
|
@@ -16,34 +16,9 @@ const WABinary_1 = require("../WABinary");
|
|
|
16
16
|
const groups_1 = require("./groups");
|
|
17
17
|
const messages_send_1 = require("./messages-send");
|
|
18
18
|
const makeMessagesRecvSocket = (config) => {
|
|
19
|
-
const {
|
|
20
|
-
logger,
|
|
21
|
-
retryRequestDelayMs,
|
|
22
|
-
maxMsgRetryCount,
|
|
23
|
-
getMessage,
|
|
24
|
-
shouldIgnoreJid
|
|
25
|
-
} = config;
|
|
19
|
+
const { logger, retryRequestDelayMs, maxMsgRetryCount, getMessage, shouldIgnoreJid } = config;
|
|
26
20
|
const sock = (0, messages_send_1.makeMessagesSocket)(config);
|
|
27
|
-
const {
|
|
28
|
-
ev,
|
|
29
|
-
authState,
|
|
30
|
-
ws,
|
|
31
|
-
processingMutex,
|
|
32
|
-
signalRepository,
|
|
33
|
-
query,
|
|
34
|
-
upsertMessage,
|
|
35
|
-
resyncAppState,
|
|
36
|
-
groupMetadata,
|
|
37
|
-
onUnexpectedError,
|
|
38
|
-
assertSessions,
|
|
39
|
-
sendNode,
|
|
40
|
-
relayMessage,
|
|
41
|
-
sendReceipt,
|
|
42
|
-
uploadPreKeys,
|
|
43
|
-
createParticipantNodes,
|
|
44
|
-
getUSyncDevices,
|
|
45
|
-
sendPeerDataOperationMessage
|
|
46
|
-
} = sock;
|
|
21
|
+
const { ev, authState, ws, processingMutex, signalRepository, query, upsertMessage, resyncAppState, groupMetadata, onUnexpectedError, assertSessions, sendNode, relayMessage, sendReceipt, uploadPreKeys, createParticipantNodes, getUSyncDevices, sendPeerDataOperationMessage, } = sock;
|
|
47
22
|
/** this mutex ensures that each retryRequest will wait for the previous one to finish */
|
|
48
23
|
const retryMutex = (0, make_mutex_1.makeMutex)();
|
|
49
24
|
const msgRetryCache = config.msgRetryCounterCache || new node_cache_1.default({
|
|
@@ -67,7 +42,7 @@ const makeMessagesRecvSocket = (config) => {
|
|
|
67
42
|
to: attrs.from,
|
|
68
43
|
class: tag
|
|
69
44
|
}
|
|
70
|
-
}
|
|
45
|
+
};
|
|
71
46
|
if (!!errorCode) {
|
|
72
47
|
stanza.attrs.error = errorCode.toString();
|
|
73
48
|
}
|
|
@@ -83,31 +58,14 @@ const makeMessagesRecvSocket = (config) => {
|
|
|
83
58
|
if (tag === 'message' && (0, WABinary_1.getBinaryNodeChild)({ tag, attrs, content }, 'unavailable')) {
|
|
84
59
|
stanza.attrs.from = authState.creds.me.id;
|
|
85
60
|
}
|
|
86
|
-
logger.debug({
|
|
87
|
-
recv: {
|
|
88
|
-
tag,
|
|
89
|
-
attrs
|
|
90
|
-
},
|
|
91
|
-
sent: stanza.attrs }, 'sent ack');
|
|
61
|
+
logger.debug({ recv: { tag, attrs }, sent: stanza.attrs }, 'sent ack');
|
|
92
62
|
await sendNode(stanza);
|
|
93
63
|
};
|
|
94
64
|
const offerCall = async (toJid, isVideo = false) => {
|
|
95
65
|
const callId = (0, crypto_1.randomBytes)(16).toString('hex').toUpperCase().substring(0, 64);
|
|
96
66
|
const offerContent = [];
|
|
97
|
-
offerContent.push({
|
|
98
|
-
|
|
99
|
-
attrs: {
|
|
100
|
-
enc: 'opus',
|
|
101
|
-
rate: '16000'
|
|
102
|
-
}, content: undefined
|
|
103
|
-
});
|
|
104
|
-
offerContent.push({
|
|
105
|
-
tag: 'audio',
|
|
106
|
-
attrs: {
|
|
107
|
-
enc: 'opus',
|
|
108
|
-
rate: '8000'
|
|
109
|
-
}, content: undefined
|
|
110
|
-
});
|
|
67
|
+
offerContent.push({ tag: 'audio', attrs: { enc: 'opus', rate: '16000' }, content: undefined });
|
|
68
|
+
offerContent.push({ tag: 'audio', attrs: { enc: 'opus', rate: '8000' }, content: undefined });
|
|
111
69
|
if (isVideo) {
|
|
112
70
|
offerContent.push({
|
|
113
71
|
tag: 'video',
|
|
@@ -121,23 +79,9 @@ const makeMessagesRecvSocket = (config) => {
|
|
|
121
79
|
}
|
|
122
80
|
});
|
|
123
81
|
}
|
|
124
|
-
offerContent.push({
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
medium: '3'
|
|
128
|
-
}, content: undefined
|
|
129
|
-
});
|
|
130
|
-
offerContent.push({
|
|
131
|
-
tag: 'capability',
|
|
132
|
-
attrs: {
|
|
133
|
-
ver: '1'
|
|
134
|
-
}, content: new Uint8Array([1, 4, 255, 131, 207, 4]) });
|
|
135
|
-
offerContent.push({
|
|
136
|
-
tag: 'encopt',
|
|
137
|
-
attrs: {
|
|
138
|
-
keygen: '2'
|
|
139
|
-
}, content: undefined
|
|
140
|
-
})
|
|
82
|
+
offerContent.push({ tag: 'net', attrs: { medium: '3' }, content: undefined });
|
|
83
|
+
offerContent.push({ tag: 'capability', attrs: { ver: '1' }, content: new Uint8Array([1, 4, 255, 131, 207, 4]) });
|
|
84
|
+
offerContent.push({ tag: 'encopt', attrs: { keygen: '2' }, content: undefined });
|
|
141
85
|
const encKey = (0, crypto_1.randomBytes)(32);
|
|
142
86
|
const devices = (await getUSyncDevices([toJid], true, false)).map(({ user, device }) => (0, WABinary_1.jidEncode)(user, 's.whatsapp.net', device));
|
|
143
87
|
await assertSessions(devices, true);
|
|
@@ -1,34 +1,33 @@
|
|
|
1
|
-
/// <reference types="node" />
|
|
2
1
|
import { Boom } from '@hapi/boom';
|
|
3
2
|
import { proto } from '../../WAProto';
|
|
4
3
|
import { AnyMessageContent, MediaConnInfo, MessageReceiptType, MessageRelayOptions, MiscMessageGenerationOptions, SocketConfig, WAMessageKey } from '../Types';
|
|
5
4
|
import { BinaryNode, JidWithDevice } from '../WABinary';
|
|
5
|
+
import { USyncQuery } from '../WAUSync';
|
|
6
6
|
export declare const makeMessagesSocket: (config: SocketConfig) => {
|
|
7
|
-
getPrivacyTokens: (jids: string[]) => Promise<
|
|
7
|
+
getPrivacyTokens: (jids: string[]) => Promise<any>;
|
|
8
8
|
assertSessions: (jids: string[], force: boolean) => Promise<boolean>;
|
|
9
|
-
relayMessage: (jid: string, message: proto.IMessage, { messageId, participant, additionalAttributes, additionalNodes, useUserDevicesCache,
|
|
9
|
+
relayMessage: (jid: string, message: proto.IMessage, { messageId: msgId, participant, additionalAttributes, additionalNodes, useUserDevicesCache, useCachedGroupMetadata, statusJidList }: MessageRelayOptions) => Promise<string>;
|
|
10
10
|
sendReceipt: (jid: string, participant: string | undefined, messageIds: string[], type: MessageReceiptType) => Promise<void>;
|
|
11
11
|
sendReceipts: (keys: WAMessageKey[], type: MessageReceiptType) => Promise<void>;
|
|
12
12
|
readMessages: (keys: WAMessageKey[]) => Promise<void>;
|
|
13
13
|
refreshMediaConn: (forceGet?: boolean) => Promise<MediaConnInfo>;
|
|
14
|
-
getUSyncDevices: (jids: string[], useCache: boolean, ignoreZeroDevices: boolean) => Promise<JidWithDevice[]>;
|
|
15
|
-
createParticipantNodes: (jids: string[], message: proto.IMessage, extraAttrs?: BinaryNode['attrs']) => Promise<{
|
|
16
|
-
nodes: BinaryNode[];
|
|
17
|
-
shouldIncludeDeviceIdentity: boolean;
|
|
18
|
-
}>;
|
|
19
14
|
waUploadToServer: import("../Types").WAMediaUploadFunction;
|
|
20
15
|
fetchPrivacySettings: (force?: boolean) => Promise<{
|
|
21
16
|
[_: string]: string;
|
|
22
17
|
}>;
|
|
18
|
+
getUSyncDevices: (jids: string[], useCache: boolean, ignoreZeroDevices: boolean) => Promise<JidWithDevice[]>;
|
|
19
|
+
createParticipantNodes: (jids: string[], message: proto.IMessage, extraAttrs?: BinaryNode["attrs"]) => Promise<{
|
|
20
|
+
nodes: BinaryNode[];
|
|
21
|
+
shouldIncludeDeviceIdentity: boolean;
|
|
22
|
+
}>;
|
|
23
23
|
sendPeerDataOperationMessage: (pdoMessage: proto.Message.IPeerDataOperationRequestMessage) => Promise<string>;
|
|
24
|
-
rahmi: any;
|
|
25
24
|
updateMediaMessage: (message: proto.IWebMessageInfo) => Promise<proto.IWebMessageInfo>;
|
|
26
|
-
sendMessage: (jid: string, content: AnyMessageContent, options?: MiscMessageGenerationOptions) => Promise<proto.WebMessageInfo
|
|
25
|
+
sendMessage: (jid: string, content: AnyMessageContent, options?: MiscMessageGenerationOptions) => Promise<proto.WebMessageInfo>;
|
|
27
26
|
subscribeNewsletterUpdates: (jid: string) => Promise<{
|
|
28
27
|
duration: string;
|
|
29
28
|
}>;
|
|
30
29
|
newsletterReactionMode: (jid: string, mode: import("../Types").NewsletterReactionMode) => Promise<void>;
|
|
31
|
-
newsletterUpdateDescription: (jid: string, description?: string
|
|
30
|
+
newsletterUpdateDescription: (jid: string, description?: string) => Promise<void>;
|
|
32
31
|
newsletterUpdateName: (jid: string, name: string) => Promise<void>;
|
|
33
32
|
newsletterUpdatePicture: (jid: string, content: import("../Types").WAMediaUpload) => Promise<void>;
|
|
34
33
|
newsletterRemovePicture: (jid: string) => Promise<void>;
|
|
@@ -36,16 +35,16 @@ export declare const makeMessagesSocket: (config: SocketConfig) => {
|
|
|
36
35
|
newsletterFollow: (jid: string) => Promise<void>;
|
|
37
36
|
newsletterUnmute: (jid: string) => Promise<void>;
|
|
38
37
|
newsletterMute: (jid: string) => Promise<void>;
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
newsletterMetadata: (type: "invite" | "jid", key: string, role?: import("../Types").NewsletterViewRole | undefined) => Promise<import("../Types").NewsletterMetadata>;
|
|
38
|
+
newsletterCreate: (name: string, description?: string, picture?: import("../Types").WAMediaUpload) => Promise<import("../Types").NewsletterMetadata>;
|
|
39
|
+
newsletterMetadata: (type: "invite" | "jid", key: string, role?: import("../Types").NewsletterViewRole) => Promise<import("../Types").NewsletterMetadata>;
|
|
42
40
|
newsletterAdminCount: (jid: string) => Promise<number>;
|
|
43
41
|
newsletterChangeOwner: (jid: string, user: string) => Promise<void>;
|
|
44
42
|
newsletterDemote: (jid: string, user: string) => Promise<void>;
|
|
45
43
|
newsletterDelete: (jid: string) => Promise<void>;
|
|
46
|
-
newsletterReactMessage: (jid: string,
|
|
47
|
-
newsletterFetchMessages: (type: "invite" | "jid", key: string, count: number, after?: number
|
|
48
|
-
newsletterFetchUpdates: (jid: string, count: number, after?: number
|
|
44
|
+
newsletterReactMessage: (jid: string, server_id: string, code?: string) => Promise<void>;
|
|
45
|
+
newsletterFetchMessages: (type: "invite" | "jid", key: string, count: number, after?: number) => Promise<import("../Types").NewsletterFetchedUpdate[]>;
|
|
46
|
+
newsletterFetchUpdates: (jid: string, count: number, after?: number, since?: number) => Promise<import("../Types").NewsletterFetchedUpdate[]>;
|
|
47
|
+
groupQuery: (jid: string, type: "get" | "set", content: BinaryNode[]) => Promise<any>;
|
|
49
48
|
groupMetadata: (jid: string) => Promise<import("../Types").GroupMetadata>;
|
|
50
49
|
groupCreate: (subject: string, participants: string[]) => Promise<import("../Types").GroupMetadata>;
|
|
51
50
|
groupLeave: (id: string) => Promise<void>;
|
|
@@ -53,7 +52,7 @@ export declare const makeMessagesSocket: (config: SocketConfig) => {
|
|
|
53
52
|
groupRequestParticipantsList: (jid: string) => Promise<{
|
|
54
53
|
[key: string]: string;
|
|
55
54
|
}[]>;
|
|
56
|
-
groupRequestParticipantsUpdate: (jid: string, participants: string[], action: "
|
|
55
|
+
groupRequestParticipantsUpdate: (jid: string, participants: string[], action: "approve" | "reject") => Promise<{
|
|
57
56
|
status: string;
|
|
58
57
|
jid: string;
|
|
59
58
|
}[]>;
|
|
@@ -62,68 +61,71 @@ export declare const makeMessagesSocket: (config: SocketConfig) => {
|
|
|
62
61
|
jid: string;
|
|
63
62
|
content: BinaryNode;
|
|
64
63
|
}[]>;
|
|
65
|
-
groupUpdateDescription: (jid: string, description?: string
|
|
64
|
+
groupUpdateDescription: (jid: string, description?: string) => Promise<void>;
|
|
66
65
|
groupInviteCode: (jid: string) => Promise<string | undefined>;
|
|
67
66
|
groupRevokeInvite: (jid: string) => Promise<string | undefined>;
|
|
68
67
|
groupAcceptInvite: (code: string) => Promise<string | undefined>;
|
|
69
|
-
|
|
68
|
+
groupRevokeInviteV4: (groupJid: string, invitedJid: string) => Promise<boolean>;
|
|
69
|
+
groupAcceptInviteV4: (key: string | WAMessageKey, inviteMessage: proto.Message.IGroupInviteMessage) => Promise<any>;
|
|
70
70
|
groupGetInviteInfo: (code: string) => Promise<import("../Types").GroupMetadata>;
|
|
71
71
|
groupToggleEphemeral: (jid: string, ephemeralExpiration: number) => Promise<void>;
|
|
72
|
-
groupSettingUpdate: (jid: string, setting: "announcement" | "
|
|
73
|
-
groupMemberAddMode: (jid: string, mode: "
|
|
72
|
+
groupSettingUpdate: (jid: string, setting: "announcement" | "not_announcement" | "locked" | "unlocked") => Promise<void>;
|
|
73
|
+
groupMemberAddMode: (jid: string, mode: "admin_add" | "all_member_add") => Promise<void>;
|
|
74
74
|
groupJoinApprovalMode: (jid: string, mode: "on" | "off") => Promise<void>;
|
|
75
75
|
groupFetchAllParticipating: () => Promise<{
|
|
76
76
|
[_: string]: import("../Types").GroupMetadata;
|
|
77
77
|
}>;
|
|
78
|
+
getBotListV2: () => Promise<import("../Types").BotListInfo[]>;
|
|
78
79
|
processingMutex: {
|
|
79
|
-
mutex<T>(code: () => T |
|
|
80
|
+
mutex<T>(code: () => Promise<T> | T): Promise<T>;
|
|
80
81
|
};
|
|
81
|
-
upsertMessage: (msg:
|
|
82
|
+
upsertMessage: (msg: import("../Types").WAMessage, type: import("../Types").MessageUpsertType) => Promise<void>;
|
|
82
83
|
appPatch: (patchCreate: import("../Types").WAPatchCreate) => Promise<void>;
|
|
83
|
-
sendPresenceUpdate: (type: import("../Types").WAPresence, toJid?: string
|
|
84
|
-
presenceSubscribe: (toJid: string, tcToken?: Buffer
|
|
85
|
-
profilePictureUrl: (jid: string, type?: "
|
|
84
|
+
sendPresenceUpdate: (type: import("../Types").WAPresence, toJid?: string) => Promise<void>;
|
|
85
|
+
presenceSubscribe: (toJid: string, tcToken?: Buffer) => Promise<void>;
|
|
86
|
+
profilePictureUrl: (jid: string, type?: "preview" | "image", timeoutMs?: number) => Promise<string | undefined>;
|
|
86
87
|
onWhatsApp: (...jids: string[]) => Promise<{
|
|
87
88
|
jid: string;
|
|
88
89
|
exists: unknown;
|
|
89
90
|
lid: unknown;
|
|
90
91
|
}[] | undefined>;
|
|
91
92
|
fetchBlocklist: () => Promise<string[]>;
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
setAt: Date;
|
|
95
|
-
} | undefined>;
|
|
93
|
+
fetchDisappearingDuration: (...jids: string[]) => Promise<import("../WAUSync").USyncQueryResultList[] | undefined>;
|
|
94
|
+
fetchStatus: (...jids: string[]) => Promise<import("../WAUSync").USyncQueryResultList[] | undefined>;
|
|
96
95
|
updateProfilePicture: (jid: string, content: import("../Types").WAMediaUpload) => Promise<void>;
|
|
97
96
|
removeProfilePicture: (jid: string) => Promise<void>;
|
|
98
97
|
updateProfileStatus: (status: string) => Promise<void>;
|
|
99
98
|
updateProfileName: (name: string) => Promise<void>;
|
|
100
99
|
updateBlockStatus: (jid: string, action: "block" | "unblock") => Promise<void>;
|
|
100
|
+
updateCallPrivacy: (value: import("../Types").WAPrivacyCallValue) => Promise<void>;
|
|
101
|
+
updateMessagesPrivacy: (value: import("../Types").WAPrivacyMessagesValue) => Promise<void>;
|
|
101
102
|
updateLastSeenPrivacy: (value: import("../Types").WAPrivacyValue) => Promise<void>;
|
|
102
103
|
updateOnlinePrivacy: (value: import("../Types").WAPrivacyOnlineValue) => Promise<void>;
|
|
103
104
|
updateProfilePicturePrivacy: (value: import("../Types").WAPrivacyValue) => Promise<void>;
|
|
104
105
|
updateStatusPrivacy: (value: import("../Types").WAPrivacyValue) => Promise<void>;
|
|
105
106
|
updateReadReceiptsPrivacy: (value: import("../Types").WAReadReceiptsValue) => Promise<void>;
|
|
106
|
-
updateGroupsAddPrivacy: (value: import("../Types").
|
|
107
|
+
updateGroupsAddPrivacy: (value: import("../Types").WAPrivacyGroupAddValue) => Promise<void>;
|
|
107
108
|
updateDefaultDisappearingMode: (duration: number) => Promise<void>;
|
|
108
|
-
getBusinessProfile: (jid: string) => Promise<
|
|
109
|
-
resyncAppState: (collections: readonly ("
|
|
109
|
+
getBusinessProfile: (jid: string) => Promise<import("../Types").WABusinessProfile | void>;
|
|
110
|
+
resyncAppState: (collections: readonly ("critical_unblock_low" | "regular_high" | "regular_low" | "critical_block" | "regular")[], isInitialSync: boolean) => Promise<void>;
|
|
110
111
|
chatModify: (mod: import("../Types").ChatModification, jid: string) => Promise<void>;
|
|
111
|
-
cleanDirtyBits: (type: "account_sync" | "groups", fromTimestamp?:
|
|
112
|
+
cleanDirtyBits: (type: "account_sync" | "groups", fromTimestamp?: number | string) => Promise<void>;
|
|
112
113
|
addChatLabel: (jid: string, labelId: string) => Promise<void>;
|
|
113
114
|
removeChatLabel: (jid: string, labelId: string) => Promise<void>;
|
|
114
115
|
addMessageLabel: (jid: string, messageId: string, labelId: string) => Promise<void>;
|
|
115
116
|
removeMessageLabel: (jid: string, messageId: string, labelId: string) => Promise<void>;
|
|
116
117
|
star: (jid: string, messages: {
|
|
117
118
|
id: string;
|
|
118
|
-
fromMe?: boolean
|
|
119
|
+
fromMe?: boolean;
|
|
119
120
|
}[], star: boolean) => Promise<void>;
|
|
121
|
+
executeUSyncQuery: (usyncQuery: USyncQuery) => Promise<import("../WAUSync").USyncQueryResult | undefined>;
|
|
120
122
|
type: "md";
|
|
121
|
-
ws:
|
|
123
|
+
ws: import("./Client").WebSocketClient;
|
|
122
124
|
ev: import("../Types").BaileysEventEmitter & {
|
|
123
|
-
process(handler: (events: Partial<import("../Types").BaileysEventMap>) => void | Promise<void>): () => void;
|
|
125
|
+
process(handler: (events: Partial<import("../Types").BaileysEventMap>) => void | Promise<void>): (() => void);
|
|
124
126
|
buffer(): void;
|
|
125
|
-
createBufferedFunction<A extends any[],
|
|
126
|
-
flush(force?: boolean
|
|
127
|
+
createBufferedFunction<A extends any[], T>(work: (...args: A) => Promise<T>): ((...args: A) => Promise<T>);
|
|
128
|
+
flush(force?: boolean): boolean;
|
|
127
129
|
isBuffering(): boolean;
|
|
128
130
|
};
|
|
129
131
|
authState: {
|
|
@@ -133,17 +135,17 @@ export declare const makeMessagesSocket: (config: SocketConfig) => {
|
|
|
133
135
|
signalRepository: import("../Types").SignalRepository;
|
|
134
136
|
user: import("../Types").Contact | undefined;
|
|
135
137
|
generateMessageTag: () => string;
|
|
136
|
-
query: (node: BinaryNode, timeoutMs?: number
|
|
137
|
-
waitForMessage: <
|
|
138
|
+
query: (node: BinaryNode, timeoutMs?: number) => Promise<any>;
|
|
139
|
+
waitForMessage: <T>(msgId: string, timeoutMs?: number | undefined) => Promise<any>;
|
|
138
140
|
waitForSocketOpen: () => Promise<void>;
|
|
139
141
|
sendRawMessage: (data: Uint8Array | Buffer) => Promise<void>;
|
|
140
142
|
sendNode: (frame: BinaryNode) => Promise<void>;
|
|
141
|
-
logout: (msg?: string
|
|
143
|
+
logout: (msg?: string) => Promise<void>;
|
|
142
144
|
end: (error: Error | undefined) => void;
|
|
143
|
-
onUnexpectedError: (err: Error | Boom
|
|
145
|
+
onUnexpectedError: (err: Error | Boom, msg: string) => void;
|
|
144
146
|
uploadPreKeys: (count?: number) => Promise<void>;
|
|
145
147
|
uploadPreKeysToServerIfRequired: () => Promise<void>;
|
|
146
|
-
requestPairingCode: (phoneNumber: string) => Promise<string>;
|
|
147
|
-
waitForConnectionUpdate: (check: (u: Partial<import("../Types").ConnectionState>) => boolean | undefined
|
|
148
|
-
sendWAMBuffer: (wamBuffer: Buffer) => Promise<
|
|
148
|
+
requestPairingCode: (phoneNumber: any, pairKey?: string) => Promise<string>;
|
|
149
|
+
waitForConnectionUpdate: (check: (u: Partial<import("../Types").ConnectionState>) => Promise<boolean | undefined>, timeoutMs?: number) => Promise<void>;
|
|
150
|
+
sendWAMBuffer: (wamBuffer: Buffer) => Promise<any>;
|
|
149
151
|
};
|