@zetagoaurum-socket/decagramton 3.2.5 → 3.2.7
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/README.md +91 -91
- package/WAProto/index.js +56886 -17506
- package/engine-requirements.js +91 -0
- package/lib/Defaults/index.js +47 -2
- package/lib/Signal/Group/ciphertext-message.d.ts +9 -0
- package/lib/Signal/Group/ciphertext-message.js +15 -0
- package/lib/Signal/Group/group-session-builder.d.ts +14 -0
- package/lib/Signal/Group/group-session-builder.js +64 -0
- package/lib/Signal/Group/group_cipher.d.ts +17 -0
- package/lib/Signal/Group/group_cipher.js +96 -0
- package/lib/Signal/Group/index.d.ts +11 -0
- package/lib/Signal/Group/index.js +57 -0
- package/lib/Signal/Group/keyhelper.d.ts +10 -0
- package/lib/Signal/Group/keyhelper.js +55 -0
- 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 +13 -0
- package/lib/Signal/Group/sender-chain-key.js +34 -0
- package/lib/Signal/Group/sender-key-distribution-message.d.ts +16 -0
- package/lib/Signal/Group/sender-key-distribution-message.js +66 -0
- package/lib/Signal/Group/sender-key-message.d.ts +18 -0
- package/lib/Signal/Group/sender-key-message.js +69 -0
- package/lib/Signal/Group/sender-key-name.d.ts +17 -0
- package/lib/Signal/Group/sender-key-name.js +51 -0
- package/lib/Signal/Group/sender-key-record.d.ts +30 -0
- package/lib/Signal/Group/sender-key-record.js +53 -0
- package/lib/Signal/Group/sender-key-state.d.ts +38 -0
- package/lib/Signal/Group/sender-key-state.js +99 -0
- package/lib/Signal/Group/sender-message-key.d.ts +11 -0
- package/{WASignalGroup/sender_message_key.js → lib/Signal/Group/sender-message-key.js} +6 -16
- package/lib/Signal/libsignal.js +51 -29
- package/lib/Socket/business.d.ts +3 -2
- package/lib/Socket/chats.d.ts +215 -28
- package/lib/Socket/chats.js +166 -70
- package/lib/Socket/dugong.d.ts +254 -0
- package/lib/Socket/dugong.js +432 -141
- package/lib/Socket/groups.js +20 -23
- package/lib/Socket/index.js +2 -15
- package/lib/Socket/messages-recv.d.ts +56 -55
- package/lib/Socket/messages-recv.js +367 -131
- package/lib/Socket/messages-send.d.ts +3 -2
- package/lib/Socket/messages-send.js +423 -380
- package/lib/Socket/newsletter.js +147 -21
- package/lib/Socket/socket.js +156 -148
- package/lib/Socket/usync.d.ts +3 -3
- package/lib/Types/GroupMetadata.d.ts +1 -0
- package/lib/Types/Newsletter.d.ts +97 -86
- package/lib/Types/Newsletter.js +38 -32
- package/lib/Types/USync.d.ts +25 -0
- package/lib/Types/USync.js +2 -0
- package/lib/Utils/anti-crash.js +31 -0
- package/lib/Utils/chat-utils.js +6 -1
- package/lib/Utils/generics.js +66 -34
- package/lib/Utils/history.js +6 -1
- package/lib/Utils/index.js +0 -1
- package/lib/Utils/link-preview.js +1 -1
- package/lib/Utils/messages-media.js +145 -57
- package/lib/Utils/messages.js +92 -306
- package/lib/Utils/signal.js +48 -46
- package/lib/Utils/use-multi-file-auth-state.js +45 -6
- package/lib/Utils/validate-connection.js +89 -65
- package/lib/WABinary/constants.d.ts +27 -24
- package/lib/WABinary/encode.js +160 -123
- package/lib/WABinary/generic-utils.d.ts +2 -0
- package/lib/WABinary/generic-utils.js +124 -36
- package/lib/WABinary/jid-utils.js +5 -26
- package/lib/WAUSync/Protocols/USyncDisappearingModeProtocol.js +1 -1
- package/lib/index.d.ts +1 -0
- package/lib/index.js +56 -0
- package/package.json +107 -101
- package/LICENSE +0 -21
- package/WAProto/GenerateStatics.sh +0 -4
- package/WAProto/WAProto.proto +0 -3344
- package/WAProto/index.d.ts +0 -37016
- package/WASignalGroup/GroupProtocol.js +0 -1697
- package/WASignalGroup/ciphertext_message.js +0 -16
- package/WASignalGroup/group_cipher.js +0 -120
- package/WASignalGroup/group_session_builder.js +0 -46
- package/WASignalGroup/index.js +0 -5
- package/WASignalGroup/keyhelper.js +0 -21
- package/WASignalGroup/protobufs.js +0 -3
- package/WASignalGroup/queue_job.js +0 -69
- package/WASignalGroup/sender_chain_key.js +0 -50
- package/WASignalGroup/sender_key_distribution_message.js +0 -78
- package/WASignalGroup/sender_key_message.js +0 -92
- package/WASignalGroup/sender_key_name.js +0 -70
- package/WASignalGroup/sender_key_record.js +0 -56
- package/WASignalGroup/sender_key_state.js +0 -129
- package/decagramton.jpg +0 -0
- package/lib/Utils/rate-limiter.js +0 -55
- package/lib/WAUSync/Fall +0 -1
- package/lib/WAUSync/Protocols/Fal +0 -1
package/lib/Socket/groups.js
CHANGED
|
@@ -6,6 +6,7 @@ const Types_1 = require("../Types");
|
|
|
6
6
|
const Utils_1 = require("../Utils");
|
|
7
7
|
const WABinary_1 = require("../WABinary");
|
|
8
8
|
const chats_1 = require("./chats");
|
|
9
|
+
const WAUSync_1 = require("../WAUSync");
|
|
9
10
|
const makeGroupsSocket = (config) => {
|
|
10
11
|
const sock = (0, chats_1.makeChatsSocket)(config);
|
|
11
12
|
const { authState, ev, query, upsertMessage } = sock;
|
|
@@ -262,54 +263,49 @@ const makeGroupsSocket = (config) => {
|
|
|
262
263
|
exports.makeGroupsSocket = makeGroupsSocket;
|
|
263
264
|
const extractGroupMetadata = (result) => {
|
|
264
265
|
var _a, _b;
|
|
265
|
-
const group =
|
|
266
|
-
const descChild =
|
|
266
|
+
const group = WABinary_1.getBinaryNodeChild(result, 'group');
|
|
267
|
+
const descChild = WABinary_1.getBinaryNodeChild(group, 'description');
|
|
267
268
|
let desc;
|
|
268
269
|
let descId;
|
|
269
270
|
let descOwner;
|
|
270
271
|
let descOwnerLid;
|
|
271
272
|
let descTime;
|
|
272
273
|
if (descChild) {
|
|
273
|
-
desc =
|
|
274
|
-
descOwner =
|
|
274
|
+
desc = WABinary_1.getBinaryNodeChildString(descChild, 'body');
|
|
275
|
+
descOwner = WABinary_1.jidNormalizedUser(descChild.attrs.participant_pn || descChild.attrs.participant);
|
|
275
276
|
if (group.attrs.addressing_mode === 'lid') {
|
|
276
|
-
descOwnerLid =
|
|
277
|
+
descOwnerLid = WABinary_1.jidNormalizedUser(descChild.attrs.participant);
|
|
277
278
|
}
|
|
278
279
|
descId = descChild.attrs.id;
|
|
279
280
|
descTime = descChild.attrs.t ? +descChild.attrs.t : undefined;
|
|
280
281
|
}
|
|
281
282
|
const groupSize = group.attrs.size ? Number(group.attrs.size) : undefined;
|
|
282
283
|
const groupId = group.attrs.id.includes('@') ? group.attrs.id : (0, WABinary_1.jidEncode)(group.attrs.id, 'g.us');
|
|
283
|
-
const eph =
|
|
284
|
-
const memberAddMode =
|
|
284
|
+
const eph = WABinary_1.getBinaryNodeChild(group, 'ephemeral')?.attrs.expiration
|
|
285
|
+
const memberAddMode = WABinary_1.getBinaryNodeChildString(group, 'member_add_mode') === 'all_member_add';
|
|
285
286
|
const metadata = {
|
|
286
287
|
id: groupId,
|
|
287
288
|
addressingMode: group.attrs.addressing_mode,
|
|
288
289
|
subject: group.attrs.subject,
|
|
289
|
-
subjectOwner:
|
|
290
|
-
...(group.attrs.addressing_mode === 'lid' ? { subjectOwnerLid:
|
|
290
|
+
subjectOwner: WABinary_1.jidNormalizedUser(group.attrs.s_o_pn || group.attrs.s_o),
|
|
291
|
+
...(group.attrs.addressing_mode === 'lid' ? { subjectOwnerLid: WABinary_1.jidNormalizedUser(group.attrs.s_o) } : {}),
|
|
291
292
|
subjectTime: group.attrs.s_t ? +group.attrs.s_t : undefined,
|
|
292
|
-
size: groupSize ||
|
|
293
|
+
size: groupSize || WABinary_1.getBinaryNodeChildren(group, 'participant').length,
|
|
293
294
|
creation: group.attrs.creation ? +group.attrs.creation : undefined,
|
|
294
|
-
owner:
|
|
295
|
-
...(group.attrs.addressing_mode === 'lid' ? { ownerLid:
|
|
296
|
-
desc,
|
|
297
|
-
descId,
|
|
295
|
+
owner: WABinary_1.jidNormalizedUser(group.attrs.creator_pn || group.attrs.creator),
|
|
296
|
+
...(group.attrs.addressing_mode === 'lid' ? { ownerLid: WABinary_1.jidNormalizedUser(group.attrs.creator) } : {}),
|
|
298
297
|
descOwner,
|
|
299
298
|
descOwnerLid,
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
isCommunityAnnounce: !!(0, WABinary_1.getBinaryNodeChild)(group, 'default_sub_group'),
|
|
306
|
-
joinApprovalMode: !!(0, WABinary_1.getBinaryNodeChild)(group, 'membership_approval_mode'),
|
|
299
|
+
restrict: !!WABinary_1.getBinaryNodeChild(group, 'locked'),
|
|
300
|
+
announce: !!WABinary_1.getBinaryNodeChild(group, 'announcement'),
|
|
301
|
+
isCommunity: !!WABinary_1.getBinaryNodeChild(group, 'parent'),
|
|
302
|
+
isCommunityAnnounce: !!WABinary_1.getBinaryNodeChild(group, 'default_sub_group'),
|
|
303
|
+
joinApprovalMode: !!WABinary_1.getBinaryNodeChild(group, 'membership_approval_mode'),
|
|
307
304
|
memberAddMode,
|
|
308
|
-
participants:
|
|
305
|
+
participants: WABinary_1.getBinaryNodeChildren(group, 'participant').map(({ attrs }) => {
|
|
309
306
|
return {
|
|
310
307
|
id: attrs.jid,
|
|
311
308
|
jid: attrs.phone_number || attrs.jid,
|
|
312
|
-
lid: attrs.lid || attrs.jid,
|
|
313
309
|
admin: (attrs.type || null),
|
|
314
310
|
};
|
|
315
311
|
}),
|
|
@@ -318,3 +314,4 @@ const extractGroupMetadata = (result) => {
|
|
|
318
314
|
return metadata;
|
|
319
315
|
};
|
|
320
316
|
exports.extractGroupMetadata = extractGroupMetadata;
|
|
317
|
+
|
package/lib/Socket/index.js
CHANGED
|
@@ -1,19 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
if (k2 === undefined) k2 = k;
|
|
3
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
4
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
5
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
6
|
-
}
|
|
7
|
-
Object.defineProperty(o, k2, desc);
|
|
8
|
-
}) : (function(o, m, k, k2) {
|
|
9
|
-
if (k2 === undefined) k2 = k;
|
|
10
|
-
o[k2] = m[k];
|
|
11
|
-
}));
|
|
12
|
-
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
13
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
14
|
-
};
|
|
1
|
+
"use strict";
|
|
15
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
16
|
-
__exportStar(require("./dugong"), exports);
|
|
17
3
|
const Defaults_1 = require("../Defaults");
|
|
18
4
|
const registration_1 = require("./registration");
|
|
19
5
|
// export the last socket layer
|
|
@@ -22,3 +8,4 @@ const makeWASocket = (config) => ((0, registration_1.makeRegistrationSocket)({
|
|
|
22
8
|
...config
|
|
23
9
|
}));
|
|
24
10
|
exports.default = makeWASocket;
|
|
11
|
+
exports.makeWASocket = makeWASocket;
|
|
@@ -1,45 +1,43 @@
|
|
|
1
|
-
|
|
1
|
+
import Long = require('long');
|
|
2
2
|
import { Boom } from '@hapi/boom';
|
|
3
3
|
import { proto } from '../../WAProto';
|
|
4
|
-
import { MessageReceiptType, MessageRelayOptions, SocketConfig } from '../Types';
|
|
4
|
+
import { MessageReceiptType, MessageRelayOptions, SocketConfig, WAMessageKey } from '../Types';
|
|
5
5
|
import { BinaryNode } from '../WABinary';
|
|
6
6
|
export declare const makeMessagesRecvSocket: (config: SocketConfig) => {
|
|
7
|
-
sendMessageAck: ({ tag, attrs, content }: BinaryNode) => Promise<void>;
|
|
7
|
+
sendMessageAck: ({ tag, attrs, content }: BinaryNode, errorCode?: number) => Promise<void>;
|
|
8
8
|
sendRetryRequest: (node: BinaryNode, forceIncludeKeys?: boolean) => Promise<void>;
|
|
9
|
+
rejectCall: (callId: string, callFrom: string) => Promise<void>;
|
|
9
10
|
offerCall: (toJid: string, isVideo?: boolean) => Promise<{
|
|
10
11
|
callId: string;
|
|
11
12
|
toJid: string;
|
|
12
13
|
isVideo: boolean;
|
|
13
14
|
}>;
|
|
14
|
-
|
|
15
|
-
|
|
15
|
+
fetchMessageHistory: (count: number, oldestMsgKey: WAMessageKey, oldestMsgTimestamp: number | Long) => Promise<string>;
|
|
16
|
+
requestPlaceholderResend: (messageKey: WAMessageKey) => Promise<string | undefined>;
|
|
17
|
+
getPrivacyTokens: (jids: string[]) => Promise<any>;
|
|
16
18
|
assertSessions: (jids: string[], force: boolean) => Promise<boolean>;
|
|
17
|
-
relayMessage: (jid: string, message: proto.IMessage, { messageId: msgId, participant, additionalAttributes, additionalNodes, useUserDevicesCache,
|
|
19
|
+
relayMessage: (jid: string, message: proto.IMessage, { messageId: msgId, participant, additionalAttributes, additionalNodes, useUserDevicesCache, useCachedGroupMetadata, statusJidList }: MessageRelayOptions) => Promise<string>;
|
|
18
20
|
sendReceipt: (jid: string, participant: string | undefined, messageIds: string[], type: MessageReceiptType) => Promise<void>;
|
|
19
|
-
sendReceipts: (keys:
|
|
20
|
-
|
|
21
|
-
[key: string]: string;
|
|
22
|
-
};
|
|
23
|
-
readMessages: (keys: proto.IMessageKey[]) => Promise<void>;
|
|
21
|
+
sendReceipts: (keys: WAMessageKey[], type: MessageReceiptType) => Promise<void>;
|
|
22
|
+
readMessages: (keys: WAMessageKey[]) => Promise<void>;
|
|
24
23
|
refreshMediaConn: (forceGet?: boolean) => Promise<import("../Types").MediaConnInfo>;
|
|
25
|
-
getUSyncDevices: (jids: string[], useCache: boolean, ignoreZeroDevices: boolean) => Promise<import("../WABinary").JidWithDevice[]>;
|
|
26
|
-
createParticipantNodes: (jids: string[], message: proto.IMessage, extraAttrs?: {
|
|
27
|
-
[key: string]: string;
|
|
28
|
-
} | undefined) => Promise<{
|
|
29
|
-
nodes: BinaryNode[];
|
|
30
|
-
shouldIncludeDeviceIdentity: boolean;
|
|
31
|
-
}>;
|
|
32
24
|
waUploadToServer: import("../Types").WAMediaUploadFunction;
|
|
33
25
|
fetchPrivacySettings: (force?: boolean) => Promise<{
|
|
34
26
|
[_: string]: string;
|
|
35
27
|
}>;
|
|
28
|
+
getUSyncDevices: (jids: string[], useCache: boolean, ignoreZeroDevices: boolean) => Promise<import("../WABinary").JidWithDevice[]>;
|
|
29
|
+
createParticipantNodes: (jids: string[], message: proto.IMessage, extraAttrs?: BinaryNode["attrs"]) => Promise<{
|
|
30
|
+
nodes: BinaryNode[];
|
|
31
|
+
shouldIncludeDeviceIdentity: boolean;
|
|
32
|
+
}>;
|
|
33
|
+
sendPeerDataOperationMessage: (pdoMessage: proto.Message.IPeerDataOperationRequestMessage) => Promise<string>;
|
|
36
34
|
updateMediaMessage: (message: proto.IWebMessageInfo) => Promise<proto.IWebMessageInfo>;
|
|
37
|
-
sendMessage: (jid: string, content: import("../Types").AnyMessageContent, options?: import("../Types").MiscMessageGenerationOptions) => Promise<proto.WebMessageInfo
|
|
35
|
+
sendMessage: (jid: string, content: import("../Types").AnyMessageContent, options?: import("../Types").MiscMessageGenerationOptions) => Promise<proto.WebMessageInfo>;
|
|
38
36
|
subscribeNewsletterUpdates: (jid: string) => Promise<{
|
|
39
37
|
duration: string;
|
|
40
38
|
}>;
|
|
41
39
|
newsletterReactionMode: (jid: string, mode: import("../Types").NewsletterReactionMode) => Promise<void>;
|
|
42
|
-
newsletterUpdateDescription: (jid: string, description?: string
|
|
40
|
+
newsletterUpdateDescription: (jid: string, description?: string) => Promise<void>;
|
|
43
41
|
newsletterUpdateName: (jid: string, name: string) => Promise<void>;
|
|
44
42
|
newsletterUpdatePicture: (jid: string, content: import("../Types").WAMediaUpload) => Promise<void>;
|
|
45
43
|
newsletterRemovePicture: (jid: string) => Promise<void>;
|
|
@@ -47,16 +45,16 @@ export declare const makeMessagesRecvSocket: (config: SocketConfig) => {
|
|
|
47
45
|
newsletterFollow: (jid: string) => Promise<void>;
|
|
48
46
|
newsletterUnmute: (jid: string) => Promise<void>;
|
|
49
47
|
newsletterMute: (jid: string) => Promise<void>;
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
newsletterMetadata: (type: "invite" | "jid", key: string, role?: import("../Types").NewsletterViewRole | undefined) => Promise<import("../Types").NewsletterMetadata>;
|
|
48
|
+
newsletterCreate: (name: string, description?: string, picture?: import("../Types").WAMediaUpload) => Promise<import("../Types").NewsletterMetadata>;
|
|
49
|
+
newsletterMetadata: (type: "invite" | "jid", key: string, role?: import("../Types").NewsletterViewRole) => Promise<import("../Types").NewsletterMetadata>;
|
|
53
50
|
newsletterAdminCount: (jid: string) => Promise<number>;
|
|
54
51
|
newsletterChangeOwner: (jid: string, user: string) => Promise<void>;
|
|
55
52
|
newsletterDemote: (jid: string, user: string) => Promise<void>;
|
|
56
53
|
newsletterDelete: (jid: string) => Promise<void>;
|
|
57
|
-
newsletterReactMessage: (jid: string,
|
|
58
|
-
newsletterFetchMessages: (type: "invite" | "jid", key: string, count: number, after?: number
|
|
59
|
-
newsletterFetchUpdates: (jid: string, count: number, after?: number
|
|
54
|
+
newsletterReactMessage: (jid: string, server_id: string, code?: string) => Promise<void>;
|
|
55
|
+
newsletterFetchMessages: (type: "invite" | "jid", key: string, count: number, after?: number) => Promise<import("../Types").NewsletterFetchedUpdate[]>;
|
|
56
|
+
newsletterFetchUpdates: (jid: string, count: number, after?: number, since?: number) => Promise<import("../Types").NewsletterFetchedUpdate[]>;
|
|
57
|
+
groupQuery: (jid: string, type: "get" | "set", content: BinaryNode[]) => Promise<any>;
|
|
60
58
|
groupMetadata: (jid: string) => Promise<import("../Types").GroupMetadata>;
|
|
61
59
|
groupCreate: (subject: string, participants: string[]) => Promise<import("../Types").GroupMetadata>;
|
|
62
60
|
groupLeave: (id: string) => Promise<void>;
|
|
@@ -64,7 +62,7 @@ export declare const makeMessagesRecvSocket: (config: SocketConfig) => {
|
|
|
64
62
|
groupRequestParticipantsList: (jid: string) => Promise<{
|
|
65
63
|
[key: string]: string;
|
|
66
64
|
}[]>;
|
|
67
|
-
groupRequestParticipantsUpdate: (jid: string, participants: string[], action: "
|
|
65
|
+
groupRequestParticipantsUpdate: (jid: string, participants: string[], action: "approve" | "reject") => Promise<{
|
|
68
66
|
status: string;
|
|
69
67
|
jid: string;
|
|
70
68
|
}[]>;
|
|
@@ -73,53 +71,55 @@ export declare const makeMessagesRecvSocket: (config: SocketConfig) => {
|
|
|
73
71
|
jid: string;
|
|
74
72
|
content: BinaryNode;
|
|
75
73
|
}[]>;
|
|
76
|
-
groupUpdateDescription: (jid: string, description?: string
|
|
74
|
+
groupUpdateDescription: (jid: string, description?: string) => Promise<void>;
|
|
77
75
|
groupInviteCode: (jid: string) => Promise<string | undefined>;
|
|
78
76
|
groupRevokeInvite: (jid: string) => Promise<string | undefined>;
|
|
79
77
|
groupAcceptInvite: (code: string) => Promise<string | undefined>;
|
|
80
|
-
|
|
78
|
+
groupRevokeInviteV4: (groupJid: string, invitedJid: string) => Promise<boolean>;
|
|
79
|
+
groupAcceptInviteV4: (key: string | WAMessageKey, inviteMessage: proto.Message.IGroupInviteMessage) => Promise<any>;
|
|
81
80
|
groupGetInviteInfo: (code: string) => Promise<import("../Types").GroupMetadata>;
|
|
82
81
|
groupToggleEphemeral: (jid: string, ephemeralExpiration: number) => Promise<void>;
|
|
83
|
-
groupSettingUpdate: (jid: string, setting: "announcement" | "
|
|
84
|
-
groupMemberAddMode: (jid: string, mode: "
|
|
82
|
+
groupSettingUpdate: (jid: string, setting: "announcement" | "not_announcement" | "locked" | "unlocked") => Promise<void>;
|
|
83
|
+
groupMemberAddMode: (jid: string, mode: "admin_add" | "all_member_add") => Promise<void>;
|
|
85
84
|
groupJoinApprovalMode: (jid: string, mode: "on" | "off") => Promise<void>;
|
|
86
85
|
groupFetchAllParticipating: () => Promise<{
|
|
87
86
|
[_: string]: import("../Types").GroupMetadata;
|
|
88
87
|
}>;
|
|
88
|
+
getBotListV2: () => Promise<import("../Types").BotListInfo[]>;
|
|
89
89
|
processingMutex: {
|
|
90
|
-
mutex<T>(code: () => T |
|
|
90
|
+
mutex<T>(code: () => Promise<T> | T): Promise<T>;
|
|
91
91
|
};
|
|
92
|
-
upsertMessage: (msg:
|
|
92
|
+
upsertMessage: (msg: import("../Types").WAMessage, type: import("../Types").MessageUpsertType) => Promise<void>;
|
|
93
93
|
appPatch: (patchCreate: import("../Types").WAPatchCreate) => Promise<void>;
|
|
94
|
-
sendPresenceUpdate: (type: import("../Types").WAPresence, toJid?: string
|
|
95
|
-
presenceSubscribe: (toJid: string, tcToken?: Buffer
|
|
96
|
-
profilePictureUrl: (jid: string, type?: "
|
|
94
|
+
sendPresenceUpdate: (type: import("../Types").WAPresence, toJid?: string) => Promise<void>;
|
|
95
|
+
presenceSubscribe: (toJid: string, tcToken?: Buffer) => Promise<void>;
|
|
96
|
+
profilePictureUrl: (jid: string, type?: "preview" | "image", timeoutMs?: number) => Promise<string | undefined>;
|
|
97
97
|
onWhatsApp: (...jids: string[]) => Promise<{
|
|
98
98
|
jid: string;
|
|
99
99
|
exists: unknown;
|
|
100
100
|
lid: unknown;
|
|
101
101
|
}[] | undefined>;
|
|
102
102
|
fetchBlocklist: () => Promise<string[]>;
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
setAt: Date;
|
|
106
|
-
} | undefined>;
|
|
103
|
+
fetchDisappearingDuration: (...jids: string[]) => Promise<import("..").USyncQueryResultList[] | undefined>;
|
|
104
|
+
fetchStatus: (...jids: string[]) => Promise<import("..").USyncQueryResultList[] | undefined>;
|
|
107
105
|
updateProfilePicture: (jid: string, content: import("../Types").WAMediaUpload) => Promise<void>;
|
|
108
106
|
removeProfilePicture: (jid: string) => Promise<void>;
|
|
109
107
|
updateProfileStatus: (status: string) => Promise<void>;
|
|
110
108
|
updateProfileName: (name: string) => Promise<void>;
|
|
111
109
|
updateBlockStatus: (jid: string, action: "block" | "unblock") => Promise<void>;
|
|
110
|
+
updateCallPrivacy: (value: import("../Types").WAPrivacyCallValue) => Promise<void>;
|
|
111
|
+
updateMessagesPrivacy: (value: import("../Types").WAPrivacyMessagesValue) => Promise<void>;
|
|
112
112
|
updateLastSeenPrivacy: (value: import("../Types").WAPrivacyValue) => Promise<void>;
|
|
113
113
|
updateOnlinePrivacy: (value: import("../Types").WAPrivacyOnlineValue) => Promise<void>;
|
|
114
114
|
updateProfilePicturePrivacy: (value: import("../Types").WAPrivacyValue) => Promise<void>;
|
|
115
115
|
updateStatusPrivacy: (value: import("../Types").WAPrivacyValue) => Promise<void>;
|
|
116
116
|
updateReadReceiptsPrivacy: (value: import("../Types").WAReadReceiptsValue) => Promise<void>;
|
|
117
|
-
updateGroupsAddPrivacy: (value: import("../Types").
|
|
117
|
+
updateGroupsAddPrivacy: (value: import("../Types").WAPrivacyGroupAddValue) => Promise<void>;
|
|
118
118
|
updateDefaultDisappearingMode: (duration: number) => Promise<void>;
|
|
119
|
-
getBusinessProfile: (jid: string) => Promise<
|
|
120
|
-
resyncAppState: (collections: readonly ("
|
|
119
|
+
getBusinessProfile: (jid: string) => Promise<import("../Types").WABusinessProfile | void>;
|
|
120
|
+
resyncAppState: (collections: readonly ("critical_unblock_low" | "regular_high" | "regular_low" | "critical_block" | "regular")[], isInitialSync: boolean) => Promise<void>;
|
|
121
121
|
chatModify: (mod: import("../Types").ChatModification, jid: string) => Promise<void>;
|
|
122
|
-
cleanDirtyBits: (type: "account_sync" | "groups", fromTimestamp?:
|
|
122
|
+
cleanDirtyBits: (type: "account_sync" | "groups", fromTimestamp?: number | string) => Promise<void>;
|
|
123
123
|
addChatLabel: (jid: string, labelId: string) => Promise<void>;
|
|
124
124
|
removeChatLabel: (jid: string, labelId: string) => Promise<void>;
|
|
125
125
|
addMessageLabel: (jid: string, messageId: string, labelId: string) => Promise<void>;
|
|
@@ -128,13 +128,14 @@ export declare const makeMessagesRecvSocket: (config: SocketConfig) => {
|
|
|
128
128
|
id: string;
|
|
129
129
|
fromMe?: boolean;
|
|
130
130
|
}[], star: boolean) => Promise<void>;
|
|
131
|
+
executeUSyncQuery: (usyncQuery: import("..").USyncQuery) => Promise<import("..").USyncQueryResult | undefined>;
|
|
131
132
|
type: "md";
|
|
132
|
-
ws:
|
|
133
|
+
ws: import("./Client").WebSocketClient;
|
|
133
134
|
ev: import("../Types").BaileysEventEmitter & {
|
|
134
|
-
process(handler: (events: Partial<import("../Types").BaileysEventMap>) => void | Promise<void>): () => void;
|
|
135
|
+
process(handler: (events: Partial<import("../Types").BaileysEventMap>) => void | Promise<void>): (() => void);
|
|
135
136
|
buffer(): void;
|
|
136
|
-
createBufferedFunction<A extends any[],
|
|
137
|
-
flush(force?: boolean
|
|
137
|
+
createBufferedFunction<A extends any[], T>(work: (...args: A) => Promise<T>): ((...args: A) => Promise<T>);
|
|
138
|
+
flush(force?: boolean): boolean;
|
|
138
139
|
isBuffering(): boolean;
|
|
139
140
|
};
|
|
140
141
|
authState: {
|
|
@@ -144,17 +145,17 @@ export declare const makeMessagesRecvSocket: (config: SocketConfig) => {
|
|
|
144
145
|
signalRepository: import("../Types").SignalRepository;
|
|
145
146
|
user: import("../Types").Contact | undefined;
|
|
146
147
|
generateMessageTag: () => string;
|
|
147
|
-
query: (node: BinaryNode, timeoutMs?: number
|
|
148
|
-
waitForMessage: <
|
|
148
|
+
query: (node: BinaryNode, timeoutMs?: number) => Promise<any>;
|
|
149
|
+
waitForMessage: <T>(msgId: string, timeoutMs?: number | undefined) => Promise<any>;
|
|
149
150
|
waitForSocketOpen: () => Promise<void>;
|
|
150
151
|
sendRawMessage: (data: Uint8Array | Buffer) => Promise<void>;
|
|
151
152
|
sendNode: (frame: BinaryNode) => Promise<void>;
|
|
152
|
-
logout: (msg?: string
|
|
153
|
+
logout: (msg?: string) => Promise<void>;
|
|
153
154
|
end: (error: Error | undefined) => void;
|
|
154
|
-
onUnexpectedError: (err: Error | Boom
|
|
155
|
+
onUnexpectedError: (err: Error | Boom, msg: string) => void;
|
|
155
156
|
uploadPreKeys: (count?: number) => Promise<void>;
|
|
156
157
|
uploadPreKeysToServerIfRequired: () => Promise<void>;
|
|
157
|
-
requestPairingCode: (phoneNumber: string) => Promise<string>;
|
|
158
|
-
waitForConnectionUpdate: (check: (u: Partial<import("../Types").ConnectionState>) => boolean | undefined
|
|
159
|
-
sendWAMBuffer: (wamBuffer: Buffer) => Promise<
|
|
158
|
+
requestPairingCode: (phoneNumber: any, pairKey?: string) => Promise<string>;
|
|
159
|
+
waitForConnectionUpdate: (check: (u: Partial<import("../Types").ConnectionState>) => Promise<boolean | undefined>, timeoutMs?: number) => Promise<void>;
|
|
160
|
+
sendWAMBuffer: (wamBuffer: Buffer) => Promise<any>;
|
|
160
161
|
};
|