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