lordceaser-baileys 1.0.20 → 1.0.21
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/Defaults/index.d.ts +235 -3
- package/lib/Defaults/index.js +22 -6
- package/lib/Defaults/phonenumber-mcc.json +223 -0
- package/lib/Signal/libsignal.js +9 -18
- package/lib/Socket/Client/{types.d.ts → abstract-socket-client.d.ts} +2 -0
- package/lib/Socket/Client/index.d.ts +3 -2
- package/lib/Socket/Client/index.js +3 -2
- package/lib/Socket/Client/mobile-socket-client.d.ts +13 -0
- package/lib/Socket/Client/mobile-socket-client.js +65 -0
- package/lib/Socket/Client/{websocket.d.ts → web-socket-client.d.ts} +1 -1
- package/lib/Socket/Client/{websocket.js → web-socket-client.js} +2 -2
- package/lib/Socket/business.d.ts +40 -38
- package/lib/Socket/chats.d.ts +23 -25
- package/lib/Socket/chats.js +78 -79
- package/lib/Socket/groups.d.ts +29 -30
- package/lib/Socket/groups.js +3 -4
- package/lib/Socket/index.d.ts +48 -44
- package/lib/Socket/index.js +2 -2
- package/lib/Socket/messages-recv.d.ts +37 -37
- package/lib/Socket/messages-recv.js +44 -98
- package/lib/Socket/messages-send.d.ts +31 -33
- package/lib/Socket/messages-send.js +70 -82
- package/lib/Socket/registration.d.ts +242 -0
- package/lib/Socket/registration.js +166 -0
- package/lib/Socket/socket.d.ts +10 -9
- package/lib/Socket/socket.js +23 -28
- package/lib/Store/index.d.ts +3 -0
- package/lib/Store/index.js +10 -0
- package/lib/Store/make-cache-manager-store.d.ts +14 -0
- package/lib/Store/make-cache-manager-store.js +83 -0
- package/lib/Store/make-in-memory-store.d.ts +118 -0
- package/lib/Store/make-in-memory-store.js +422 -0
- package/lib/Store/make-ordered-dictionary.d.ts +13 -0
- package/lib/Store/make-ordered-dictionary.js +81 -0
- package/lib/Store/object-repository.d.ts +10 -0
- package/lib/Store/object-repository.js +27 -0
- package/lib/Types/Auth.d.ts +7 -0
- package/lib/Types/Chat.d.ts +7 -12
- package/lib/Types/Contact.d.ts +1 -1
- package/lib/Types/GroupMetadata.d.ts +0 -2
- package/lib/Types/Label.js +1 -1
- package/lib/Types/LabelAssociation.js +1 -1
- package/lib/Types/Message.d.ts +10 -9
- package/lib/Types/Message.js +3 -1
- package/lib/Types/Socket.d.ts +11 -16
- package/lib/Types/index.js +1 -1
- package/lib/Utils/auth-utils.d.ts +3 -3
- package/lib/Utils/auth-utils.js +13 -7
- package/lib/Utils/business.js +5 -13
- package/lib/Utils/chat-utils.d.ts +14 -13
- package/lib/Utils/chat-utils.js +31 -36
- package/lib/Utils/crypto.d.ts +15 -14
- package/lib/Utils/crypto.js +30 -70
- package/lib/Utils/decode-wa-message.d.ts +2 -18
- package/lib/Utils/decode-wa-message.js +19 -23
- package/lib/Utils/event-buffer.d.ts +2 -2
- package/lib/Utils/event-buffer.js +7 -7
- package/lib/Utils/generics.d.ts +14 -15
- package/lib/Utils/generics.js +29 -33
- package/lib/Utils/history.d.ts +2 -2
- package/lib/Utils/history.js +1 -1
- package/lib/Utils/link-preview.d.ts +2 -2
- package/lib/Utils/link-preview.js +1 -34
- package/lib/Utils/logger.d.ts +3 -10
- 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/make-mutex.js +0 -1
- package/lib/Utils/messages-media.d.ts +24 -20
- package/lib/Utils/messages-media.js +76 -79
- package/lib/Utils/messages.d.ts +9 -7
- package/lib/Utils/messages.js +30 -29
- package/lib/Utils/noise-handler.d.ts +11 -9
- package/lib/Utils/noise-handler.js +22 -17
- package/lib/Utils/process-message.d.ts +5 -4
- package/lib/Utils/process-message.js +40 -68
- package/lib/Utils/signal.d.ts +1 -2
- package/lib/Utils/signal.js +19 -11
- package/lib/Utils/use-multi-file-auth-state.js +14 -46
- package/lib/Utils/validate-connection.d.ts +3 -2
- package/lib/Utils/validate-connection.js +46 -16
- package/lib/WABinary/constants.js +5 -5
- package/lib/WABinary/decode.d.ts +3 -2
- package/lib/WABinary/decode.js +9 -20
- package/lib/WABinary/encode.d.ts +2 -1
- package/lib/WABinary/encode.js +18 -38
- package/lib/WABinary/generic-utils.d.ts +2 -1
- package/lib/WABinary/generic-utils.js +3 -3
- package/lib/WABinary/jid-utils.d.ts +3 -7
- package/lib/WABinary/jid-utils.js +2 -9
- package/lib/WAM/BinaryInfo.d.ts +11 -2
- package/lib/WAM/constants.d.ts +2 -3
- package/lib/WAM/encode.d.ts +2 -1
- package/lib/WAM/encode.js +2 -2
- package/lib/index.d.ts +1 -1
- package/lib/index.js +1 -1
- package/package.json +2 -2
- package/lib/Socket/usync.d.ts +0 -36
- package/lib/Socket/usync.js +0 -70
- package/lib/Types/USync.d.ts +0 -25
- package/lib/Types/USync.js +0 -2
- package/lib/WAUSync/Protocols/USyncContactProtocol.d.ts +0 -9
- package/lib/WAUSync/Protocols/USyncContactProtocol.js +0 -32
- package/lib/WAUSync/Protocols/USyncDeviceProtocol.d.ts +0 -22
- package/lib/WAUSync/Protocols/USyncDeviceProtocol.js +0 -57
- package/lib/WAUSync/Protocols/USyncDisappearingModeProtocol.d.ts +0 -12
- package/lib/WAUSync/Protocols/USyncDisappearingModeProtocol.js +0 -30
- package/lib/WAUSync/Protocols/USyncStatusProtocol.d.ts +0 -12
- package/lib/WAUSync/Protocols/USyncStatusProtocol.js +0 -42
- package/lib/WAUSync/Protocols/UsyncBotProfileProtocol.d.ts +0 -25
- package/lib/WAUSync/Protocols/UsyncBotProfileProtocol.js +0 -53
- package/lib/WAUSync/Protocols/UsyncLIDProtocol.d.ts +0 -8
- package/lib/WAUSync/Protocols/UsyncLIDProtocol.js +0 -24
- package/lib/WAUSync/Protocols/index.d.ts +0 -4
- package/lib/WAUSync/Protocols/index.js +0 -20
- package/lib/WAUSync/USyncQuery.d.ts +0 -28
- package/lib/WAUSync/USyncQuery.js +0 -89
- package/lib/WAUSync/USyncUser.d.ts +0 -12
- package/lib/WAUSync/USyncUser.js +0 -26
- package/lib/WAUSync/index.d.ts +0 -3
- package/lib/WAUSync/index.js +0 -19
- /package/lib/Socket/Client/{types.js → abstract-socket-client.js} +0 -0
package/lib/Socket/groups.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
/// <reference types="node" />
|
|
1
2
|
import { proto } from '../../WAProto';
|
|
2
3
|
import { GroupMetadata, ParticipantAction, SocketConfig } from '../Types';
|
|
3
4
|
import { BinaryNode } from '../WABinary';
|
|
@@ -9,7 +10,7 @@ export declare const makeGroupsSocket: (config: SocketConfig) => {
|
|
|
9
10
|
groupRequestParticipantsList: (jid: string) => Promise<{
|
|
10
11
|
[key: string]: string;
|
|
11
12
|
}[]>;
|
|
12
|
-
groupRequestParticipantsUpdate: (jid: string, participants: string[], action:
|
|
13
|
+
groupRequestParticipantsUpdate: (jid: string, participants: string[], action: 'approve' | 'reject') => Promise<{
|
|
13
14
|
status: string;
|
|
14
15
|
jid: string;
|
|
15
16
|
}[]>;
|
|
@@ -34,42 +35,41 @@ export declare const makeGroupsSocket: (config: SocketConfig) => {
|
|
|
34
35
|
* @param key the key of the invite message, or optionally only provide the jid of the person who sent the invite
|
|
35
36
|
* @param inviteMessage the message to accept
|
|
36
37
|
*/
|
|
37
|
-
groupAcceptInviteV4: (key: string | proto.IMessageKey, inviteMessage: proto.Message.IGroupInviteMessage) => Promise<
|
|
38
|
+
groupAcceptInviteV4: (key: string | proto.IMessageKey, inviteMessage: proto.Message.IGroupInviteMessage) => Promise<string>;
|
|
38
39
|
groupGetInviteInfo: (code: string) => Promise<GroupMetadata>;
|
|
39
40
|
groupToggleEphemeral: (jid: string, ephemeralExpiration: number) => Promise<void>;
|
|
40
|
-
groupSettingUpdate: (jid: string, setting:
|
|
41
|
-
groupMemberAddMode: (jid: string, mode:
|
|
42
|
-
groupJoinApprovalMode: (jid: string, mode:
|
|
41
|
+
groupSettingUpdate: (jid: string, setting: 'announcement' | 'not_announcement' | 'locked' | 'unlocked') => Promise<void>;
|
|
42
|
+
groupMemberAddMode: (jid: string, mode: 'admin_add' | 'all_member_add') => Promise<void>;
|
|
43
|
+
groupJoinApprovalMode: (jid: string, mode: 'on' | 'off') => Promise<void>;
|
|
43
44
|
groupFetchAllParticipating: () => Promise<{
|
|
44
45
|
[_: string]: GroupMetadata;
|
|
45
46
|
}>;
|
|
46
|
-
getBotListV2: () => Promise<import("../Types").BotListInfo[]>;
|
|
47
47
|
processingMutex: {
|
|
48
|
-
mutex<T>(code: () =>
|
|
48
|
+
mutex<T>(code: () => T | Promise<T>): Promise<T>;
|
|
49
49
|
};
|
|
50
50
|
fetchPrivacySettings: (force?: boolean) => Promise<{
|
|
51
51
|
[_: string]: string;
|
|
52
52
|
}>;
|
|
53
53
|
upsertMessage: (msg: proto.IWebMessageInfo, type: import("../Types").MessageUpsertType) => Promise<void>;
|
|
54
54
|
appPatch: (patchCreate: import("../Types").WAPatchCreate) => Promise<void>;
|
|
55
|
-
sendPresenceUpdate: (type: import("../Types").WAPresence, toJid?: string) => Promise<void>;
|
|
56
|
-
presenceSubscribe: (toJid: string, tcToken?: Buffer) => Promise<void>;
|
|
57
|
-
profilePictureUrl: (jid: string, type?: "
|
|
55
|
+
sendPresenceUpdate: (type: import("../Types").WAPresence, toJid?: string | undefined) => Promise<void>;
|
|
56
|
+
presenceSubscribe: (toJid: string, tcToken?: Buffer | undefined) => Promise<void>;
|
|
57
|
+
profilePictureUrl: (jid: string, type?: "image" | "preview", timeoutMs?: number | undefined) => Promise<string | undefined>;
|
|
58
58
|
onWhatsApp: (...jids: string[]) => Promise<{
|
|
59
|
+
exists: boolean;
|
|
59
60
|
jid: string;
|
|
60
|
-
|
|
61
|
-
lid: unknown;
|
|
62
|
-
}[] | undefined>;
|
|
61
|
+
}[]>;
|
|
63
62
|
fetchBlocklist: () => Promise<string[]>;
|
|
64
|
-
fetchStatus: (
|
|
65
|
-
|
|
63
|
+
fetchStatus: (jid: string) => Promise<{
|
|
64
|
+
status: string | undefined;
|
|
65
|
+
setAt: Date;
|
|
66
|
+
} | undefined>;
|
|
66
67
|
updateProfilePicture: (jid: string, content: import("../Types").WAMediaUpload) => Promise<void>;
|
|
67
68
|
removeProfilePicture: (jid: string) => Promise<void>;
|
|
68
69
|
updateProfileStatus: (status: string) => Promise<void>;
|
|
69
70
|
updateProfileName: (name: string) => Promise<void>;
|
|
70
71
|
updateBlockStatus: (jid: string, action: "block" | "unblock") => Promise<void>;
|
|
71
72
|
updateCallPrivacy: (value: import("../Types").WAPrivacyCallValue) => Promise<void>;
|
|
72
|
-
updateMessagesPrivacy: (value: import("../Types").WAPrivacyMessagesValue) => Promise<void>;
|
|
73
73
|
updateLastSeenPrivacy: (value: import("../Types").WAPrivacyValue) => Promise<void>;
|
|
74
74
|
updateOnlinePrivacy: (value: import("../Types").WAPrivacyOnlineValue) => Promise<void>;
|
|
75
75
|
updateProfilePicturePrivacy: (value: import("../Types").WAPrivacyValue) => Promise<void>;
|
|
@@ -77,10 +77,10 @@ export declare const makeGroupsSocket: (config: SocketConfig) => {
|
|
|
77
77
|
updateReadReceiptsPrivacy: (value: import("../Types").WAReadReceiptsValue) => Promise<void>;
|
|
78
78
|
updateGroupsAddPrivacy: (value: import("../Types").WAPrivacyGroupAddValue) => Promise<void>;
|
|
79
79
|
updateDefaultDisappearingMode: (duration: number) => Promise<void>;
|
|
80
|
-
getBusinessProfile: (jid: string) => Promise<import("../Types").WABusinessProfile
|
|
80
|
+
getBusinessProfile: (jid: string) => Promise<void | import("../Types").WABusinessProfile>;
|
|
81
81
|
resyncAppState: (collections: readonly ("critical_block" | "critical_unblock_low" | "regular_high" | "regular_low" | "regular")[], isInitialSync: boolean) => Promise<void>;
|
|
82
82
|
chatModify: (mod: import("../Types").ChatModification, jid: string) => Promise<void>;
|
|
83
|
-
cleanDirtyBits: (type: "account_sync" | "groups", fromTimestamp?: number |
|
|
83
|
+
cleanDirtyBits: (type: "account_sync" | "groups", fromTimestamp?: string | number | undefined) => Promise<void>;
|
|
84
84
|
addLabel: (jid: string, labels: import("../Types/Label").LabelActionBody) => Promise<void>;
|
|
85
85
|
addChatLabel: (jid: string, labelId: string) => Promise<void>;
|
|
86
86
|
removeChatLabel: (jid: string, labelId: string) => Promise<void>;
|
|
@@ -88,16 +88,15 @@ export declare const makeGroupsSocket: (config: SocketConfig) => {
|
|
|
88
88
|
removeMessageLabel: (jid: string, messageId: string, labelId: string) => Promise<void>;
|
|
89
89
|
star: (jid: string, messages: {
|
|
90
90
|
id: string;
|
|
91
|
-
fromMe?: boolean;
|
|
91
|
+
fromMe?: boolean | undefined;
|
|
92
92
|
}[], star: boolean) => Promise<void>;
|
|
93
|
-
executeUSyncQuery: (usyncQuery: import("..").USyncQuery) => Promise<import("..").USyncQueryResult | undefined>;
|
|
94
93
|
type: "md";
|
|
95
|
-
ws:
|
|
94
|
+
ws: any;
|
|
96
95
|
ev: import("../Types").BaileysEventEmitter & {
|
|
97
|
-
process(handler: (events: Partial<import("../Types").BaileysEventMap>) => void | Promise<void>): (
|
|
96
|
+
process(handler: (events: Partial<import("../Types").BaileysEventMap>) => void | Promise<void>): () => void;
|
|
98
97
|
buffer(): void;
|
|
99
|
-
createBufferedFunction<A extends any[],
|
|
100
|
-
flush(force?: boolean): boolean;
|
|
98
|
+
createBufferedFunction<A extends any[], T_1>(work: (...args: A) => Promise<T_1>): (...args: A) => Promise<T_1>;
|
|
99
|
+
flush(force?: boolean | undefined): boolean;
|
|
101
100
|
isBuffering(): boolean;
|
|
102
101
|
};
|
|
103
102
|
authState: {
|
|
@@ -107,18 +106,18 @@ export declare const makeGroupsSocket: (config: SocketConfig) => {
|
|
|
107
106
|
signalRepository: import("../Types").SignalRepository;
|
|
108
107
|
user: import("../Types").Contact | undefined;
|
|
109
108
|
generateMessageTag: () => string;
|
|
110
|
-
query: (node: BinaryNode, timeoutMs?: number) => Promise<
|
|
111
|
-
waitForMessage: <
|
|
109
|
+
query: (node: BinaryNode, timeoutMs?: number | undefined) => Promise<BinaryNode>;
|
|
110
|
+
waitForMessage: <T_2>(msgId: string, timeoutMs?: number | undefined) => Promise<T_2>;
|
|
112
111
|
waitForSocketOpen: () => Promise<void>;
|
|
113
112
|
sendRawMessage: (data: Uint8Array | Buffer) => Promise<void>;
|
|
114
113
|
sendNode: (frame: BinaryNode) => Promise<void>;
|
|
115
|
-
logout: (msg?: string) => Promise<void>;
|
|
114
|
+
logout: (msg?: string | undefined) => Promise<void>;
|
|
116
115
|
end: (error: Error | undefined) => void;
|
|
117
|
-
onUnexpectedError: (err: Error | import("@hapi/boom").Boom
|
|
116
|
+
onUnexpectedError: (err: Error | import("@hapi/boom").Boom<any>, msg: string) => void;
|
|
118
117
|
uploadPreKeys: (count?: number) => Promise<void>;
|
|
119
118
|
uploadPreKeysToServerIfRequired: () => Promise<void>;
|
|
120
119
|
requestPairingCode: (phoneNumber: string) => Promise<string>;
|
|
121
|
-
waitForConnectionUpdate: (check: (u: Partial<import("../Types").ConnectionState>) =>
|
|
122
|
-
sendWAMBuffer: (wamBuffer: Buffer) => Promise<
|
|
120
|
+
waitForConnectionUpdate: (check: (u: Partial<import("../Types").ConnectionState>) => boolean | undefined, timeoutMs?: number | undefined) => Promise<void>;
|
|
121
|
+
sendWAMBuffer: (wamBuffer: Buffer) => Promise<BinaryNode>;
|
|
123
122
|
};
|
|
124
123
|
export declare const extractGroupMetadata: (result: BinaryNode) => GroupMetadata;
|
package/lib/Socket/groups.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.extractGroupMetadata = exports.makeGroupsSocket = void 0;
|
|
4
|
-
const WAProto_1 = require("
|
|
4
|
+
const WAProto_1 = require("../../WAProto");
|
|
5
5
|
const Types_1 = require("../Types");
|
|
6
6
|
const Utils_1 = require("../Utils");
|
|
7
7
|
const WABinary_1 = require("../WABinary");
|
|
@@ -69,7 +69,7 @@ const makeGroupsSocket = (config) => {
|
|
|
69
69
|
...sock,
|
|
70
70
|
groupMetadata,
|
|
71
71
|
groupCreate: async (subject, participants) => {
|
|
72
|
-
const key = (0, Utils_1.
|
|
72
|
+
const key = (0, Utils_1.generateMessageID)();
|
|
73
73
|
const result = await groupQuery('@g.us', 'set', [
|
|
74
74
|
{
|
|
75
75
|
tag: 'create',
|
|
@@ -163,7 +163,7 @@ const makeGroupsSocket = (config) => {
|
|
|
163
163
|
{
|
|
164
164
|
tag: 'description',
|
|
165
165
|
attrs: {
|
|
166
|
-
...(description ? { id: (0, Utils_1.
|
|
166
|
+
...(description ? { id: (0, Utils_1.generateMessageID)() } : { delete: 'true' }),
|
|
167
167
|
...(prev ? { prev } : {})
|
|
168
168
|
},
|
|
169
169
|
content: description ? [
|
|
@@ -286,7 +286,6 @@ const extractGroupMetadata = (result) => {
|
|
|
286
286
|
const memberAddMode = (0, WABinary_1.getBinaryNodeChildString)(group, 'member_add_mode') === 'all_member_add';
|
|
287
287
|
const metadata = {
|
|
288
288
|
id: groupId,
|
|
289
|
-
addressingMode: group.attrs.addressing_mode,
|
|
290
289
|
subject: group.attrs.subject,
|
|
291
290
|
subjectOwner: group.attrs.s_o,
|
|
292
291
|
subjectTime: +group.attrs.s_t,
|
package/lib/Socket/index.d.ts
CHANGED
|
@@ -1,12 +1,16 @@
|
|
|
1
|
+
/// <reference types="long" />
|
|
2
|
+
/// <reference types="node" />
|
|
1
3
|
import { UserFacingSocketConfig } from '../Types';
|
|
2
4
|
declare const makeWASocket: (config: UserFacingSocketConfig) => {
|
|
3
|
-
|
|
5
|
+
register: (code: string) => Promise<import("./registration").ExistsResponse>;
|
|
6
|
+
requestRegistrationCode: (registrationOptions?: import("./registration").RegistrationOptions | undefined) => Promise<import("./registration").ExistsResponse>;
|
|
7
|
+
logger: import("pino").Logger<import("pino").LoggerOptions>;
|
|
4
8
|
getOrderDetails: (orderId: string, tokenBase64: string) => Promise<import("../Types").OrderDetails>;
|
|
5
9
|
getCatalog: ({ jid, limit, cursor }: import("../Types").GetCatalogOptions) => Promise<{
|
|
6
10
|
products: import("../Types").Product[];
|
|
7
11
|
nextPageCursor: string | undefined;
|
|
8
12
|
}>;
|
|
9
|
-
getCollections: (jid?: string, limit?: number) => Promise<{
|
|
13
|
+
getCollections: (jid?: string | undefined, limit?: number) => Promise<{
|
|
10
14
|
collections: import("../Types").CatalogCollection[];
|
|
11
15
|
}>;
|
|
12
16
|
productCreate: (create: import("../Types").ProductCreate) => Promise<import("../Types").Product>;
|
|
@@ -14,28 +18,30 @@ declare const makeWASocket: (config: UserFacingSocketConfig) => {
|
|
|
14
18
|
deleted: number;
|
|
15
19
|
}>;
|
|
16
20
|
productUpdate: (productId: string, update: import("../Types").ProductUpdate) => Promise<import("../Types").Product>;
|
|
17
|
-
sendMessageAck: ({ tag, attrs, content }: import("
|
|
18
|
-
sendRetryRequest: (node: import("
|
|
21
|
+
sendMessageAck: ({ tag, attrs, content }: import("../index").BinaryNode) => Promise<void>;
|
|
22
|
+
sendRetryRequest: (node: import("../index").BinaryNode, forceIncludeKeys?: boolean) => Promise<void>;
|
|
19
23
|
rejectCall: (callId: string, callFrom: string) => Promise<void>;
|
|
20
|
-
fetchMessageHistory: (count: number, oldestMsgKey: import("../Types").
|
|
21
|
-
requestPlaceholderResend: (messageKey: import("../Types").
|
|
22
|
-
getPrivacyTokens: (jids: string[]) => Promise<
|
|
24
|
+
fetchMessageHistory: (count: number, oldestMsgKey: import("../Types").WAProto.IMessageKey, oldestMsgTimestamp: number | import("long").Long) => Promise<string>;
|
|
25
|
+
requestPlaceholderResend: (messageKey: import("../Types").WAProto.IMessageKey) => Promise<string | undefined>;
|
|
26
|
+
getPrivacyTokens: (jids: string[]) => Promise<import("../index").BinaryNode>;
|
|
23
27
|
assertSessions: (jids: string[], force: boolean) => Promise<boolean>;
|
|
24
28
|
relayMessage: (jid: string, message: import("../Types").WAProto.IMessage, { messageId: msgId, participant, additionalAttributes, additionalNodes, useUserDevicesCache, useCachedGroupMetadata, statusJidList }: import("../Types").MessageRelayOptions) => Promise<string>;
|
|
25
29
|
sendReceipt: (jid: string, participant: string | undefined, messageIds: string[], type: import("../Types").MessageReceiptType) => Promise<void>;
|
|
26
|
-
sendReceipts: (keys: import("../Types").
|
|
27
|
-
readMessages: (keys: import("../Types").
|
|
30
|
+
sendReceipts: (keys: import("../Types").WAProto.IMessageKey[], type: import("../Types").MessageReceiptType) => Promise<void>;
|
|
31
|
+
readMessages: (keys: import("../Types").WAProto.IMessageKey[]) => Promise<void>;
|
|
28
32
|
refreshMediaConn: (forceGet?: boolean) => Promise<import("../Types").MediaConnInfo>;
|
|
29
33
|
waUploadToServer: import("../Types").WAMediaUploadFunction;
|
|
30
34
|
fetchPrivacySettings: (force?: boolean) => Promise<{
|
|
31
35
|
[_: string]: string;
|
|
32
36
|
}>;
|
|
33
37
|
sendPeerDataOperationMessage: (pdoMessage: import("../Types").WAProto.Message.IPeerDataOperationRequestMessage) => Promise<string>;
|
|
34
|
-
createParticipantNodes: (jids: string[], message: import("../Types").WAProto.IMessage, extraAttrs?:
|
|
35
|
-
|
|
38
|
+
createParticipantNodes: (jids: string[], message: import("../Types").WAProto.IMessage, extraAttrs?: {
|
|
39
|
+
[key: string]: string;
|
|
40
|
+
} | undefined) => Promise<{
|
|
41
|
+
nodes: import("../index").BinaryNode[];
|
|
36
42
|
shouldIncludeDeviceIdentity: boolean;
|
|
37
43
|
}>;
|
|
38
|
-
getUSyncDevices: (jids: string[], useCache: boolean, ignoreZeroDevices: boolean) => Promise<import("
|
|
44
|
+
getUSyncDevices: (jids: string[], useCache: boolean, ignoreZeroDevices: boolean) => Promise<import("../index").JidWithDevice[]>;
|
|
39
45
|
updateMediaMessage: (message: import("../Types").WAProto.IWebMessageInfo) => Promise<import("../Types").WAProto.IWebMessageInfo>;
|
|
40
46
|
sendMessage: (jid: string, content: import("../Types").AnyMessageContent, options?: import("../Types").MiscMessageGenerationOptions) => Promise<import("../Types").WAProto.WebMessageInfo | undefined>;
|
|
41
47
|
groupMetadata: (jid: string) => Promise<import("../Types").GroupMetadata>;
|
|
@@ -45,53 +51,52 @@ declare const makeWASocket: (config: UserFacingSocketConfig) => {
|
|
|
45
51
|
groupRequestParticipantsList: (jid: string) => Promise<{
|
|
46
52
|
[key: string]: string;
|
|
47
53
|
}[]>;
|
|
48
|
-
groupRequestParticipantsUpdate: (jid: string, participants: string[], action: "
|
|
54
|
+
groupRequestParticipantsUpdate: (jid: string, participants: string[], action: "reject" | "approve") => Promise<{
|
|
49
55
|
status: string;
|
|
50
56
|
jid: string;
|
|
51
57
|
}[]>;
|
|
52
58
|
groupParticipantsUpdate: (jid: string, participants: string[], action: import("../Types").ParticipantAction) => Promise<{
|
|
53
59
|
status: string;
|
|
54
60
|
jid: string;
|
|
55
|
-
content: import("
|
|
61
|
+
content: import("../index").BinaryNode;
|
|
56
62
|
}[]>;
|
|
57
|
-
groupUpdateDescription: (jid: string, description?: string) => Promise<void>;
|
|
63
|
+
groupUpdateDescription: (jid: string, description?: string | undefined) => Promise<void>;
|
|
58
64
|
groupInviteCode: (jid: string) => Promise<string | undefined>;
|
|
59
65
|
groupRevokeInvite: (jid: string) => Promise<string | undefined>;
|
|
60
66
|
groupAcceptInvite: (code: string) => Promise<string | undefined>;
|
|
61
67
|
groupRevokeInviteV4: (groupJid: string, invitedJid: string) => Promise<boolean>;
|
|
62
|
-
groupAcceptInviteV4: (key: string | import("../Types").WAProto.IMessageKey, inviteMessage: import("../Types").WAProto.Message.IGroupInviteMessage) => Promise<
|
|
68
|
+
groupAcceptInviteV4: (key: string | import("../Types").WAProto.IMessageKey, inviteMessage: import("../Types").WAProto.Message.IGroupInviteMessage) => Promise<string>;
|
|
63
69
|
groupGetInviteInfo: (code: string) => Promise<import("../Types").GroupMetadata>;
|
|
64
70
|
groupToggleEphemeral: (jid: string, ephemeralExpiration: number) => Promise<void>;
|
|
65
|
-
groupSettingUpdate: (jid: string, setting: "announcement" | "
|
|
66
|
-
groupMemberAddMode: (jid: string, mode: "
|
|
71
|
+
groupSettingUpdate: (jid: string, setting: "announcement" | "locked" | "not_announcement" | "unlocked") => Promise<void>;
|
|
72
|
+
groupMemberAddMode: (jid: string, mode: "all_member_add" | "admin_add") => Promise<void>;
|
|
67
73
|
groupJoinApprovalMode: (jid: string, mode: "on" | "off") => Promise<void>;
|
|
68
74
|
groupFetchAllParticipating: () => Promise<{
|
|
69
75
|
[_: string]: import("../Types").GroupMetadata;
|
|
70
76
|
}>;
|
|
71
|
-
getBotListV2: () => Promise<import("../Types").BotListInfo[]>;
|
|
72
77
|
processingMutex: {
|
|
73
|
-
mutex<T>(code: () =>
|
|
78
|
+
mutex<T>(code: () => T | Promise<T>): Promise<T>;
|
|
74
79
|
};
|
|
75
80
|
upsertMessage: (msg: import("../Types").WAProto.IWebMessageInfo, type: import("../Types").MessageUpsertType) => Promise<void>;
|
|
76
81
|
appPatch: (patchCreate: import("../Types").WAPatchCreate) => Promise<void>;
|
|
77
|
-
sendPresenceUpdate: (type: import("../Types").WAPresence, toJid?: string) => Promise<void>;
|
|
78
|
-
presenceSubscribe: (toJid: string, tcToken?: Buffer) => Promise<void>;
|
|
79
|
-
profilePictureUrl: (jid: string, type?: "
|
|
82
|
+
sendPresenceUpdate: (type: import("../Types").WAPresence, toJid?: string | undefined) => Promise<void>;
|
|
83
|
+
presenceSubscribe: (toJid: string, tcToken?: Buffer | undefined) => Promise<void>;
|
|
84
|
+
profilePictureUrl: (jid: string, type?: "image" | "preview", timeoutMs?: number | undefined) => Promise<string | undefined>;
|
|
80
85
|
onWhatsApp: (...jids: string[]) => Promise<{
|
|
86
|
+
exists: boolean;
|
|
81
87
|
jid: string;
|
|
82
|
-
|
|
83
|
-
lid: unknown;
|
|
84
|
-
}[] | undefined>;
|
|
88
|
+
}[]>;
|
|
85
89
|
fetchBlocklist: () => Promise<string[]>;
|
|
86
|
-
fetchStatus: (
|
|
87
|
-
|
|
90
|
+
fetchStatus: (jid: string) => Promise<{
|
|
91
|
+
status: string | undefined;
|
|
92
|
+
setAt: Date;
|
|
93
|
+
} | undefined>;
|
|
88
94
|
updateProfilePicture: (jid: string, content: import("../Types").WAMediaUpload) => Promise<void>;
|
|
89
95
|
removeProfilePicture: (jid: string) => Promise<void>;
|
|
90
96
|
updateProfileStatus: (status: string) => Promise<void>;
|
|
91
97
|
updateProfileName: (name: string) => Promise<void>;
|
|
92
98
|
updateBlockStatus: (jid: string, action: "block" | "unblock") => Promise<void>;
|
|
93
99
|
updateCallPrivacy: (value: import("../Types").WAPrivacyCallValue) => Promise<void>;
|
|
94
|
-
updateMessagesPrivacy: (value: import("../Types").WAPrivacyMessagesValue) => Promise<void>;
|
|
95
100
|
updateLastSeenPrivacy: (value: import("../Types").WAPrivacyValue) => Promise<void>;
|
|
96
101
|
updateOnlinePrivacy: (value: import("../Types").WAPrivacyOnlineValue) => Promise<void>;
|
|
97
102
|
updateProfilePicturePrivacy: (value: import("../Types").WAPrivacyValue) => Promise<void>;
|
|
@@ -99,10 +104,10 @@ declare const makeWASocket: (config: UserFacingSocketConfig) => {
|
|
|
99
104
|
updateReadReceiptsPrivacy: (value: import("../Types").WAReadReceiptsValue) => Promise<void>;
|
|
100
105
|
updateGroupsAddPrivacy: (value: import("../Types").WAPrivacyGroupAddValue) => Promise<void>;
|
|
101
106
|
updateDefaultDisappearingMode: (duration: number) => Promise<void>;
|
|
102
|
-
getBusinessProfile: (jid: string) => Promise<import("../Types").WABusinessProfile
|
|
107
|
+
getBusinessProfile: (jid: string) => Promise<void | import("../Types").WABusinessProfile>;
|
|
103
108
|
resyncAppState: (collections: readonly ("critical_block" | "critical_unblock_low" | "regular_high" | "regular_low" | "regular")[], isInitialSync: boolean) => Promise<void>;
|
|
104
109
|
chatModify: (mod: import("../Types").ChatModification, jid: string) => Promise<void>;
|
|
105
|
-
cleanDirtyBits: (type: "account_sync" | "groups", fromTimestamp?: number |
|
|
110
|
+
cleanDirtyBits: (type: "account_sync" | "groups", fromTimestamp?: string | number | undefined) => Promise<void>;
|
|
106
111
|
addLabel: (jid: string, labels: import("../Types/Label").LabelActionBody) => Promise<void>;
|
|
107
112
|
addChatLabel: (jid: string, labelId: string) => Promise<void>;
|
|
108
113
|
removeChatLabel: (jid: string, labelId: string) => Promise<void>;
|
|
@@ -110,16 +115,15 @@ declare const makeWASocket: (config: UserFacingSocketConfig) => {
|
|
|
110
115
|
removeMessageLabel: (jid: string, messageId: string, labelId: string) => Promise<void>;
|
|
111
116
|
star: (jid: string, messages: {
|
|
112
117
|
id: string;
|
|
113
|
-
fromMe?: boolean;
|
|
118
|
+
fromMe?: boolean | undefined;
|
|
114
119
|
}[], star: boolean) => Promise<void>;
|
|
115
|
-
executeUSyncQuery: (usyncQuery: import("..").USyncQuery) => Promise<import("..").USyncQueryResult | undefined>;
|
|
116
120
|
type: "md";
|
|
117
|
-
ws:
|
|
121
|
+
ws: any;
|
|
118
122
|
ev: import("../Types").BaileysEventEmitter & {
|
|
119
|
-
process(handler: (events: Partial<import("../Types").BaileysEventMap>) => void | Promise<void>): (
|
|
123
|
+
process(handler: (events: Partial<import("../Types").BaileysEventMap>) => void | Promise<void>): () => void;
|
|
120
124
|
buffer(): void;
|
|
121
|
-
createBufferedFunction<A extends any[],
|
|
122
|
-
flush(force?: boolean): boolean;
|
|
125
|
+
createBufferedFunction<A extends any[], T_1>(work: (...args: A) => Promise<T_1>): (...args: A) => Promise<T_1>;
|
|
126
|
+
flush(force?: boolean | undefined): boolean;
|
|
123
127
|
isBuffering(): boolean;
|
|
124
128
|
};
|
|
125
129
|
authState: {
|
|
@@ -129,18 +133,18 @@ declare const makeWASocket: (config: UserFacingSocketConfig) => {
|
|
|
129
133
|
signalRepository: import("../Types").SignalRepository;
|
|
130
134
|
user: import("../Types").Contact | undefined;
|
|
131
135
|
generateMessageTag: () => string;
|
|
132
|
-
query: (node: import("
|
|
133
|
-
waitForMessage: <
|
|
136
|
+
query: (node: import("../index").BinaryNode, timeoutMs?: number | undefined) => Promise<import("../index").BinaryNode>;
|
|
137
|
+
waitForMessage: <T_2>(msgId: string, timeoutMs?: number | undefined) => Promise<T_2>;
|
|
134
138
|
waitForSocketOpen: () => Promise<void>;
|
|
135
139
|
sendRawMessage: (data: Uint8Array | Buffer) => Promise<void>;
|
|
136
|
-
sendNode: (frame: import("
|
|
137
|
-
logout: (msg?: string) => Promise<void>;
|
|
140
|
+
sendNode: (frame: import("../index").BinaryNode) => Promise<void>;
|
|
141
|
+
logout: (msg?: string | undefined) => Promise<void>;
|
|
138
142
|
end: (error: Error | undefined) => void;
|
|
139
|
-
onUnexpectedError: (err: Error | import("@hapi/boom").Boom
|
|
143
|
+
onUnexpectedError: (err: Error | import("@hapi/boom").Boom<any>, msg: string) => void;
|
|
140
144
|
uploadPreKeys: (count?: number) => Promise<void>;
|
|
141
145
|
uploadPreKeysToServerIfRequired: () => Promise<void>;
|
|
142
146
|
requestPairingCode: (phoneNumber: string) => Promise<string>;
|
|
143
|
-
waitForConnectionUpdate: (check: (u: Partial<import("../Types").ConnectionState>) =>
|
|
144
|
-
sendWAMBuffer: (wamBuffer: Buffer) => Promise<
|
|
147
|
+
waitForConnectionUpdate: (check: (u: Partial<import("../Types").ConnectionState>) => boolean | undefined, timeoutMs?: number | undefined) => Promise<void>;
|
|
148
|
+
sendWAMBuffer: (wamBuffer: Buffer) => Promise<import("../index").BinaryNode>;
|
|
145
149
|
};
|
|
146
150
|
export default makeWASocket;
|
package/lib/Socket/index.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const Defaults_1 = require("../Defaults");
|
|
4
|
-
const
|
|
4
|
+
const registration_1 = require("./registration");
|
|
5
5
|
// export the last socket layer
|
|
6
|
-
const makeWASocket = (config) => ((0,
|
|
6
|
+
const makeWASocket = (config) => ((0, registration_1.makeRegistrationSocket)({
|
|
7
7
|
...Defaults_1.DEFAULT_CONNECTION_CONFIG,
|
|
8
8
|
...config
|
|
9
9
|
}));
|
|
@@ -1,27 +1,29 @@
|
|
|
1
|
+
/// <reference types="node" />
|
|
1
2
|
import { Boom } from '@hapi/boom';
|
|
2
|
-
import Long = require('long');
|
|
3
3
|
import { proto } from '../../WAProto';
|
|
4
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
|
|
7
|
+
sendMessageAck: ({ tag, attrs, content }: BinaryNode) => Promise<void>;
|
|
8
8
|
sendRetryRequest: (node: BinaryNode, forceIncludeKeys?: boolean) => Promise<void>;
|
|
9
9
|
rejectCall: (callId: string, callFrom: string) => Promise<void>;
|
|
10
10
|
fetchMessageHistory: (count: number, oldestMsgKey: WAMessageKey, oldestMsgTimestamp: number | Long) => Promise<string>;
|
|
11
|
-
requestPlaceholderResend: (messageKey: WAMessageKey) => Promise<string | undefined>;
|
|
12
|
-
getPrivacyTokens: (jids: string[]) => Promise<
|
|
11
|
+
requestPlaceholderResend: (messageKey: WAMessageKey) => Promise<'RESOLVED' | string | undefined>;
|
|
12
|
+
getPrivacyTokens: (jids: string[]) => Promise<BinaryNode>;
|
|
13
13
|
assertSessions: (jids: string[], force: boolean) => Promise<boolean>;
|
|
14
14
|
relayMessage: (jid: string, message: proto.IMessage, { messageId: msgId, participant, additionalAttributes, additionalNodes, useUserDevicesCache, useCachedGroupMetadata, statusJidList }: MessageRelayOptions) => Promise<string>;
|
|
15
15
|
sendReceipt: (jid: string, participant: string | undefined, messageIds: string[], type: MessageReceiptType) => Promise<void>;
|
|
16
|
-
sendReceipts: (keys:
|
|
17
|
-
readMessages: (keys:
|
|
16
|
+
sendReceipts: (keys: proto.IMessageKey[], type: MessageReceiptType) => Promise<void>;
|
|
17
|
+
readMessages: (keys: proto.IMessageKey[]) => Promise<void>;
|
|
18
18
|
refreshMediaConn: (forceGet?: boolean) => Promise<import("../Types").MediaConnInfo>;
|
|
19
19
|
waUploadToServer: import("../Types").WAMediaUploadFunction;
|
|
20
20
|
fetchPrivacySettings: (force?: boolean) => Promise<{
|
|
21
21
|
[_: string]: string;
|
|
22
22
|
}>;
|
|
23
23
|
sendPeerDataOperationMessage: (pdoMessage: proto.Message.IPeerDataOperationRequestMessage) => Promise<string>;
|
|
24
|
-
createParticipantNodes: (jids: string[], message: proto.IMessage, extraAttrs?:
|
|
24
|
+
createParticipantNodes: (jids: string[], message: proto.IMessage, extraAttrs?: {
|
|
25
|
+
[key: string]: string;
|
|
26
|
+
} | undefined) => Promise<{
|
|
25
27
|
nodes: BinaryNode[];
|
|
26
28
|
shouldIncludeDeviceIdentity: boolean;
|
|
27
29
|
}>;
|
|
@@ -35,7 +37,7 @@ export declare const makeMessagesRecvSocket: (config: SocketConfig) => {
|
|
|
35
37
|
groupRequestParticipantsList: (jid: string) => Promise<{
|
|
36
38
|
[key: string]: string;
|
|
37
39
|
}[]>;
|
|
38
|
-
groupRequestParticipantsUpdate: (jid: string, participants: string[], action: "
|
|
40
|
+
groupRequestParticipantsUpdate: (jid: string, participants: string[], action: "reject" | "approve") => Promise<{
|
|
39
41
|
status: string;
|
|
40
42
|
jid: string;
|
|
41
43
|
}[]>;
|
|
@@ -44,44 +46,43 @@ export declare const makeMessagesRecvSocket: (config: SocketConfig) => {
|
|
|
44
46
|
jid: string;
|
|
45
47
|
content: BinaryNode;
|
|
46
48
|
}[]>;
|
|
47
|
-
groupUpdateDescription: (jid: string, description?: string) => Promise<void>;
|
|
49
|
+
groupUpdateDescription: (jid: string, description?: string | undefined) => Promise<void>;
|
|
48
50
|
groupInviteCode: (jid: string) => Promise<string | undefined>;
|
|
49
51
|
groupRevokeInvite: (jid: string) => Promise<string | undefined>;
|
|
50
52
|
groupAcceptInvite: (code: string) => Promise<string | undefined>;
|
|
51
53
|
groupRevokeInviteV4: (groupJid: string, invitedJid: string) => Promise<boolean>;
|
|
52
|
-
groupAcceptInviteV4: (key: string | proto.IMessageKey, inviteMessage: proto.Message.IGroupInviteMessage) => Promise<
|
|
54
|
+
groupAcceptInviteV4: (key: string | proto.IMessageKey, inviteMessage: proto.Message.IGroupInviteMessage) => Promise<string>;
|
|
53
55
|
groupGetInviteInfo: (code: string) => Promise<import("../Types").GroupMetadata>;
|
|
54
56
|
groupToggleEphemeral: (jid: string, ephemeralExpiration: number) => Promise<void>;
|
|
55
|
-
groupSettingUpdate: (jid: string, setting: "announcement" | "
|
|
56
|
-
groupMemberAddMode: (jid: string, mode: "
|
|
57
|
+
groupSettingUpdate: (jid: string, setting: "announcement" | "locked" | "not_announcement" | "unlocked") => Promise<void>;
|
|
58
|
+
groupMemberAddMode: (jid: string, mode: "all_member_add" | "admin_add") => Promise<void>;
|
|
57
59
|
groupJoinApprovalMode: (jid: string, mode: "on" | "off") => Promise<void>;
|
|
58
60
|
groupFetchAllParticipating: () => Promise<{
|
|
59
61
|
[_: string]: import("../Types").GroupMetadata;
|
|
60
62
|
}>;
|
|
61
|
-
getBotListV2: () => Promise<import("../Types").BotListInfo[]>;
|
|
62
63
|
processingMutex: {
|
|
63
|
-
mutex<T>(code: () =>
|
|
64
|
+
mutex<T>(code: () => T | Promise<T>): Promise<T>;
|
|
64
65
|
};
|
|
65
66
|
upsertMessage: (msg: proto.IWebMessageInfo, type: import("../Types").MessageUpsertType) => Promise<void>;
|
|
66
67
|
appPatch: (patchCreate: import("../Types").WAPatchCreate) => Promise<void>;
|
|
67
|
-
sendPresenceUpdate: (type: import("../Types").WAPresence, toJid?: string) => Promise<void>;
|
|
68
|
-
presenceSubscribe: (toJid: string, tcToken?: Buffer) => Promise<void>;
|
|
69
|
-
profilePictureUrl: (jid: string, type?: "
|
|
68
|
+
sendPresenceUpdate: (type: import("../Types").WAPresence, toJid?: string | undefined) => Promise<void>;
|
|
69
|
+
presenceSubscribe: (toJid: string, tcToken?: Buffer | undefined) => Promise<void>;
|
|
70
|
+
profilePictureUrl: (jid: string, type?: "image" | "preview", timeoutMs?: number | undefined) => Promise<string | undefined>;
|
|
70
71
|
onWhatsApp: (...jids: string[]) => Promise<{
|
|
72
|
+
exists: boolean;
|
|
71
73
|
jid: string;
|
|
72
|
-
|
|
73
|
-
lid: unknown;
|
|
74
|
-
}[] | undefined>;
|
|
74
|
+
}[]>;
|
|
75
75
|
fetchBlocklist: () => Promise<string[]>;
|
|
76
|
-
fetchStatus: (
|
|
77
|
-
|
|
76
|
+
fetchStatus: (jid: string) => Promise<{
|
|
77
|
+
status: string | undefined;
|
|
78
|
+
setAt: Date;
|
|
79
|
+
} | undefined>;
|
|
78
80
|
updateProfilePicture: (jid: string, content: import("../Types").WAMediaUpload) => Promise<void>;
|
|
79
81
|
removeProfilePicture: (jid: string) => Promise<void>;
|
|
80
82
|
updateProfileStatus: (status: string) => Promise<void>;
|
|
81
83
|
updateProfileName: (name: string) => Promise<void>;
|
|
82
84
|
updateBlockStatus: (jid: string, action: "block" | "unblock") => Promise<void>;
|
|
83
85
|
updateCallPrivacy: (value: import("../Types").WAPrivacyCallValue) => Promise<void>;
|
|
84
|
-
updateMessagesPrivacy: (value: import("../Types").WAPrivacyMessagesValue) => Promise<void>;
|
|
85
86
|
updateLastSeenPrivacy: (value: import("../Types").WAPrivacyValue) => Promise<void>;
|
|
86
87
|
updateOnlinePrivacy: (value: import("../Types").WAPrivacyOnlineValue) => Promise<void>;
|
|
87
88
|
updateProfilePicturePrivacy: (value: import("../Types").WAPrivacyValue) => Promise<void>;
|
|
@@ -89,10 +90,10 @@ export declare const makeMessagesRecvSocket: (config: SocketConfig) => {
|
|
|
89
90
|
updateReadReceiptsPrivacy: (value: import("../Types").WAReadReceiptsValue) => Promise<void>;
|
|
90
91
|
updateGroupsAddPrivacy: (value: import("../Types").WAPrivacyGroupAddValue) => Promise<void>;
|
|
91
92
|
updateDefaultDisappearingMode: (duration: number) => Promise<void>;
|
|
92
|
-
getBusinessProfile: (jid: string) => Promise<import("../Types").WABusinessProfile
|
|
93
|
+
getBusinessProfile: (jid: string) => Promise<void | import("../Types").WABusinessProfile>;
|
|
93
94
|
resyncAppState: (collections: readonly ("critical_block" | "critical_unblock_low" | "regular_high" | "regular_low" | "regular")[], isInitialSync: boolean) => Promise<void>;
|
|
94
95
|
chatModify: (mod: import("../Types").ChatModification, jid: string) => Promise<void>;
|
|
95
|
-
cleanDirtyBits: (type: "account_sync" | "groups", fromTimestamp?: number |
|
|
96
|
+
cleanDirtyBits: (type: "account_sync" | "groups", fromTimestamp?: string | number | undefined) => Promise<void>;
|
|
96
97
|
addLabel: (jid: string, labels: import("../Types/Label").LabelActionBody) => Promise<void>;
|
|
97
98
|
addChatLabel: (jid: string, labelId: string) => Promise<void>;
|
|
98
99
|
removeChatLabel: (jid: string, labelId: string) => Promise<void>;
|
|
@@ -100,16 +101,15 @@ export declare const makeMessagesRecvSocket: (config: SocketConfig) => {
|
|
|
100
101
|
removeMessageLabel: (jid: string, messageId: string, labelId: string) => Promise<void>;
|
|
101
102
|
star: (jid: string, messages: {
|
|
102
103
|
id: string;
|
|
103
|
-
fromMe?: boolean;
|
|
104
|
+
fromMe?: boolean | undefined;
|
|
104
105
|
}[], star: boolean) => Promise<void>;
|
|
105
|
-
executeUSyncQuery: (usyncQuery: import("..").USyncQuery) => Promise<import("..").USyncQueryResult | undefined>;
|
|
106
106
|
type: "md";
|
|
107
|
-
ws:
|
|
107
|
+
ws: any;
|
|
108
108
|
ev: import("../Types").BaileysEventEmitter & {
|
|
109
|
-
process(handler: (events: Partial<import("../Types").BaileysEventMap>) => void | Promise<void>): (
|
|
109
|
+
process(handler: (events: Partial<import("../Types").BaileysEventMap>) => void | Promise<void>): () => void;
|
|
110
110
|
buffer(): void;
|
|
111
|
-
createBufferedFunction<A extends any[],
|
|
112
|
-
flush(force?: boolean): boolean;
|
|
111
|
+
createBufferedFunction<A extends any[], T_1>(work: (...args: A) => Promise<T_1>): (...args: A) => Promise<T_1>;
|
|
112
|
+
flush(force?: boolean | undefined): boolean;
|
|
113
113
|
isBuffering(): boolean;
|
|
114
114
|
};
|
|
115
115
|
authState: {
|
|
@@ -119,17 +119,17 @@ export declare const makeMessagesRecvSocket: (config: SocketConfig) => {
|
|
|
119
119
|
signalRepository: import("../Types").SignalRepository;
|
|
120
120
|
user: import("../Types").Contact | undefined;
|
|
121
121
|
generateMessageTag: () => string;
|
|
122
|
-
query: (node: BinaryNode, timeoutMs?: number) => Promise<
|
|
123
|
-
waitForMessage: <
|
|
122
|
+
query: (node: BinaryNode, timeoutMs?: number | undefined) => Promise<BinaryNode>;
|
|
123
|
+
waitForMessage: <T_2>(msgId: string, timeoutMs?: number | undefined) => Promise<T_2>;
|
|
124
124
|
waitForSocketOpen: () => Promise<void>;
|
|
125
125
|
sendRawMessage: (data: Uint8Array | Buffer) => Promise<void>;
|
|
126
126
|
sendNode: (frame: BinaryNode) => Promise<void>;
|
|
127
|
-
logout: (msg?: string) => Promise<void>;
|
|
127
|
+
logout: (msg?: string | undefined) => Promise<void>;
|
|
128
128
|
end: (error: Error | undefined) => void;
|
|
129
|
-
onUnexpectedError: (err: Error | Boom
|
|
129
|
+
onUnexpectedError: (err: Error | Boom<any>, msg: string) => void;
|
|
130
130
|
uploadPreKeys: (count?: number) => Promise<void>;
|
|
131
131
|
uploadPreKeysToServerIfRequired: () => Promise<void>;
|
|
132
132
|
requestPairingCode: (phoneNumber: string) => Promise<string>;
|
|
133
|
-
waitForConnectionUpdate: (check: (u: Partial<import("../Types").ConnectionState>) =>
|
|
134
|
-
sendWAMBuffer: (wamBuffer: Buffer) => Promise<
|
|
133
|
+
waitForConnectionUpdate: (check: (u: Partial<import("../Types").ConnectionState>) => boolean | undefined, timeoutMs?: number | undefined) => Promise<void>;
|
|
134
|
+
sendWAMBuffer: (wamBuffer: Buffer) => Promise<BinaryNode>;
|
|
135
135
|
};
|