@genuxofficial/baileys 1.0.0 → 2.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 +5 -1
- package/WAProto/index.d.ts +19244 -2787
- package/WAProto/index.js +138202 -74217
- package/engine-requirements.js +10 -0
- package/lib/Defaults/baileys-version.json +1 -1
- package/lib/Defaults/index.d.ts +3 -5
- package/lib/Defaults/index.js +7 -6
- package/lib/Signal/libsignal.js +18 -9
- package/lib/Socket/Client/types.d.ts +0 -2
- package/lib/Socket/Client/websocket.js +1 -1
- package/lib/Socket/business.d.ts +65 -37
- package/lib/Socket/chats.d.ts +22 -18
- package/lib/Socket/chats.js +110 -6
- package/lib/Socket/groups.d.ts +30 -26
- package/lib/Socket/groups.js +20 -6
- package/lib/Socket/index.d.ts +66 -38
- package/lib/Socket/messages-recv.d.ts +63 -33
- package/lib/Socket/messages-recv.js +174 -27
- package/lib/Socket/messages-send.d.ts +55 -29
- package/lib/Socket/messages-send.js +190 -26
- package/lib/Socket/newsletter.d.ts +140 -0
- package/lib/Socket/newsletter.js +252 -0
- package/lib/Socket/socket.d.ts +8 -10
- package/lib/Socket/socket.js +26 -13
- package/lib/Socket/usync.d.ts +10 -12
- package/lib/Socket/usync.js +10 -15
- package/lib/Store/index.d.ts +1 -2
- package/lib/Store/index.js +1 -3
- package/lib/Store/make-in-memory-store.d.ts +1 -1
- package/lib/Store/make-in-memory-store.js +14 -5
- package/lib/Store/make-ordered-dictionary.d.ts +1 -1
- package/lib/Types/Auth.d.ts +0 -2
- package/lib/Types/Chat.d.ts +7 -0
- package/lib/Types/Contact.d.ts +5 -0
- package/lib/Types/Events.d.ts +27 -0
- package/lib/Types/GroupMetadata.d.ts +7 -0
- package/lib/Types/Label.js +1 -1
- package/lib/Types/LabelAssociation.js +1 -1
- package/lib/Types/Message.d.ts +129 -16
- package/lib/Types/Message.js +0 -2
- package/lib/Types/Newsletter.d.ts +79 -0
- package/lib/Types/Newsletter.js +18 -0
- package/lib/Types/Socket.d.ts +8 -5
- package/lib/Types/index.d.ts +1 -0
- package/lib/Types/index.js +2 -1
- package/lib/Utils/auth-utils.d.ts +1 -1
- package/lib/Utils/auth-utils.js +6 -7
- package/lib/Utils/business.js +2 -2
- package/lib/Utils/chat-utils.d.ts +8 -10
- package/lib/Utils/chat-utils.js +11 -0
- package/lib/Utils/crypto.d.ts +14 -16
- package/lib/Utils/crypto.js +40 -26
- package/lib/Utils/decode-wa-message.d.ts +5 -3
- package/lib/Utils/decode-wa-message.js +171 -29
- package/lib/Utils/event-buffer.js +1 -3
- package/lib/Utils/generics.d.ts +35 -9
- package/lib/Utils/generics.js +93 -27
- package/lib/Utils/history.d.ts +2 -2
- package/lib/Utils/link-preview.d.ts +1 -1
- package/lib/Utils/link-preview.js +17 -7
- package/lib/Utils/make-mutex.d.ts +2 -2
- package/lib/Utils/make-mutex.js +0 -1
- package/lib/Utils/messages-media.d.ts +35 -16
- package/lib/Utils/messages-media.js +168 -43
- package/lib/Utils/messages.d.ts +6 -9
- package/lib/Utils/messages.js +297 -37
- package/lib/Utils/noise-handler.d.ts +5 -7
- package/lib/Utils/process-message.js +2 -3
- package/lib/Utils/use-multi-file-auth-state.js +44 -13
- package/lib/Utils/validate-connection.d.ts +2 -2
- package/lib/Utils/validate-connection.js +1 -3
- package/lib/WABinary/decode.d.ts +2 -4
- package/lib/WABinary/decode.js +20 -9
- package/lib/WABinary/encode.d.ts +1 -3
- package/lib/WABinary/encode.js +30 -12
- package/lib/WABinary/generic-utils.d.ts +1 -3
- package/lib/WABinary/generic-utils.js +2 -2
- package/lib/WABinary/jid-utils.d.ts +9 -4
- package/lib/WABinary/jid-utils.js +25 -4
- package/lib/WAM/BinaryInfo.d.ts +2 -12
- package/lib/WAM/encode.d.ts +1 -3
- package/lib/WAUSync/Protocols/USyncContactProtocol.js +2 -2
- package/lib/WAUSync/Protocols/USyncDeviceProtocol.js +2 -2
- package/lib/WAUSync/Protocols/USyncDisappearingModeProtocol.js +2 -2
- package/lib/WAUSync/Protocols/USyncStatusProtocol.js +5 -5
- package/lib/WAUSync/Protocols/UsyncBotProfileProtocol.d.ts +25 -0
- package/lib/WAUSync/Protocols/UsyncBotProfileProtocol.js +53 -0
- package/lib/WAUSync/Protocols/UsyncLIDProtocol.d.ts +8 -0
- package/lib/WAUSync/Protocols/UsyncLIDProtocol.js +24 -0
- package/lib/WAUSync/USyncQuery.d.ts +2 -0
- package/lib/WAUSync/USyncQuery.js +27 -13
- package/lib/WAUSync/USyncUser.d.ts +2 -0
- package/lib/WAUSync/USyncUser.js +4 -0
- package/lib/index.d.ts +2 -1
- package/lib/index.js +3 -1
- package/package.json +59 -57
- package/WAProto/GenerateStatics.sh +0 -4
- package/WAProto/WAProto.proto +0 -3344
package/lib/Socket/groups.d.ts
CHANGED
@@ -1,7 +1,5 @@
|
|
1
|
-
/// <reference types="node" />
|
2
|
-
/// <reference types="node" />
|
3
1
|
import { proto } from '../../WAProto';
|
4
|
-
import { GroupMetadata, ParticipantAction, SocketConfig } from '../Types';
|
2
|
+
import { GroupMetadata, ParticipantAction, SocketConfig, WAMessageKey } from '../Types';
|
5
3
|
import { BinaryNode } from '../WABinary';
|
6
4
|
export declare const makeGroupsSocket: (config: SocketConfig) => {
|
7
5
|
groupMetadata: (jid: string) => Promise<GroupMetadata>;
|
@@ -11,7 +9,7 @@ export declare const makeGroupsSocket: (config: SocketConfig) => {
|
|
11
9
|
groupRequestParticipantsList: (jid: string) => Promise<{
|
12
10
|
[key: string]: string;
|
13
11
|
}[]>;
|
14
|
-
groupRequestParticipantsUpdate: (jid: string, participants: string[], action:
|
12
|
+
groupRequestParticipantsUpdate: (jid: string, participants: string[], action: "approve" | "reject") => Promise<{
|
15
13
|
status: string;
|
16
14
|
jid: string;
|
17
15
|
}[]>;
|
@@ -36,34 +34,38 @@ export declare const makeGroupsSocket: (config: SocketConfig) => {
|
|
36
34
|
* @param key the key of the invite message, or optionally only provide the jid of the person who sent the invite
|
37
35
|
* @param inviteMessage the message to accept
|
38
36
|
*/
|
39
|
-
groupAcceptInviteV4: (key: string |
|
37
|
+
groupAcceptInviteV4: (key: string | WAMessageKey, inviteMessage: proto.Message.IGroupInviteMessage) => Promise<any>;
|
40
38
|
groupGetInviteInfo: (code: string) => Promise<GroupMetadata>;
|
41
39
|
groupToggleEphemeral: (jid: string, ephemeralExpiration: number) => Promise<void>;
|
42
|
-
groupSettingUpdate: (jid: string, setting:
|
43
|
-
groupMemberAddMode: (jid: string, mode:
|
44
|
-
groupJoinApprovalMode: (jid: string, mode:
|
40
|
+
groupSettingUpdate: (jid: string, setting: "announcement" | "not_announcement" | "locked" | "unlocked") => Promise<void>;
|
41
|
+
groupMemberAddMode: (jid: string, mode: "admin_add" | "all_member_add") => Promise<void>;
|
42
|
+
groupJoinApprovalMode: (jid: string, mode: "on" | "off") => Promise<void>;
|
45
43
|
groupFetchAllParticipating: () => Promise<{
|
46
44
|
[_: string]: GroupMetadata;
|
47
45
|
}>;
|
46
|
+
getBotListV2: () => Promise<import("../Types").BotListInfo[]>;
|
48
47
|
processingMutex: {
|
49
|
-
mutex<T>(code: () => T |
|
48
|
+
mutex<T>(code: () => Promise<T> | T): Promise<T>;
|
50
49
|
};
|
51
50
|
fetchPrivacySettings: (force?: boolean) => Promise<{
|
52
51
|
[_: string]: string;
|
53
52
|
}>;
|
54
53
|
upsertMessage: (msg: proto.IWebMessageInfo, type: import("../Types").MessageUpsertType) => Promise<void>;
|
55
54
|
appPatch: (patchCreate: import("../Types").WAPatchCreate) => Promise<void>;
|
56
|
-
sendPresenceUpdate: (type: import("../Types").WAPresence, toJid?: string
|
57
|
-
presenceSubscribe: (toJid: string, tcToken?: Buffer
|
58
|
-
profilePictureUrl: (jid: string, type?: "
|
55
|
+
sendPresenceUpdate: (type: import("../Types").WAPresence, toJid?: string) => Promise<void>;
|
56
|
+
presenceSubscribe: (toJid: string, tcToken?: Buffer) => Promise<void>;
|
57
|
+
profilePictureUrl: (jid: string, type?: "preview" | "image", timeoutMs?: number) => Promise<string | undefined>;
|
59
58
|
onWhatsApp: (...jids: string[]) => Promise<{
|
60
59
|
jid: string;
|
61
60
|
exists: unknown;
|
61
|
+
lid: unknown;
|
62
62
|
}[] | undefined>;
|
63
63
|
fetchBlocklist: () => Promise<string[]>;
|
64
|
-
fetchStatus: (...jids: string[]) => Promise<import("..").USyncQueryResultList[] | undefined>;
|
65
64
|
fetchDisappearingDuration: (...jids: string[]) => Promise<import("..").USyncQueryResultList[] | undefined>;
|
65
|
+
fetchStatus: (...jids: string[]) => Promise<import("..").USyncQueryResultList[] | undefined>;
|
66
66
|
updateProfilePicture: (jid: string, content: import("../Types").WAMediaUpload) => Promise<void>;
|
67
|
+
updateProfilePictureFull: (jid: string, content: import("../Types").WAMediaUpload) => Promise<void>;
|
68
|
+
updateProfilePictureFull2: (jid: string, content: import("../Types").WAMediaUpload) => Promise<void>;
|
67
69
|
removeProfilePicture: (jid: string) => Promise<void>;
|
68
70
|
updateProfileStatus: (status: string) => Promise<void>;
|
69
71
|
updateProfileName: (name: string) => Promise<void>;
|
@@ -77,10 +79,12 @@ export declare const makeGroupsSocket: (config: SocketConfig) => {
|
|
77
79
|
updateReadReceiptsPrivacy: (value: import("../Types").WAReadReceiptsValue) => Promise<void>;
|
78
80
|
updateGroupsAddPrivacy: (value: import("../Types").WAPrivacyGroupAddValue) => Promise<void>;
|
79
81
|
updateDefaultDisappearingMode: (duration: number) => Promise<void>;
|
80
|
-
getBusinessProfile: (jid: string) => Promise<
|
82
|
+
getBusinessProfile: (jid: string) => Promise<import("../Types").WABusinessProfile | void>;
|
81
83
|
resyncAppState: (collections: readonly ("critical_block" | "critical_unblock_low" | "regular_high" | "regular_low" | "regular")[], isInitialSync: boolean) => Promise<void>;
|
82
84
|
chatModify: (mod: import("../Types").ChatModification, jid: string) => Promise<void>;
|
83
|
-
cleanDirtyBits: (type: "account_sync" | "groups", fromTimestamp?:
|
85
|
+
cleanDirtyBits: (type: "account_sync" | "groups", fromTimestamp?: number | string) => Promise<void>;
|
86
|
+
addOrEditContact: (jid: string, contact: import("../Types").ContactAction) => Promise<void>;
|
87
|
+
removeContact: (jid: string) => Promise<void>;
|
84
88
|
addLabel: (jid: string, labels: import("../Types/Label").LabelActionBody) => Promise<void>;
|
85
89
|
addChatLabel: (jid: string, labelId: string) => Promise<void>;
|
86
90
|
removeChatLabel: (jid: string, labelId: string) => Promise<void>;
|
@@ -88,16 +92,16 @@ export declare const makeGroupsSocket: (config: SocketConfig) => {
|
|
88
92
|
removeMessageLabel: (jid: string, messageId: string, labelId: string) => Promise<void>;
|
89
93
|
star: (jid: string, messages: {
|
90
94
|
id: string;
|
91
|
-
fromMe?: boolean
|
95
|
+
fromMe?: boolean;
|
92
96
|
}[], star: boolean) => Promise<void>;
|
93
97
|
executeUSyncQuery: (usyncQuery: import("..").USyncQuery) => Promise<import("..").USyncQueryResult | undefined>;
|
94
98
|
type: "md";
|
95
99
|
ws: import("./Client").WebSocketClient;
|
96
100
|
ev: import("../Types").BaileysEventEmitter & {
|
97
|
-
process(handler: (events: Partial<import("../Types").BaileysEventMap>) => void | Promise<void>): () => void;
|
101
|
+
process(handler: (events: Partial<import("../Types").BaileysEventMap>) => void | Promise<void>): (() => void);
|
98
102
|
buffer(): void;
|
99
|
-
createBufferedFunction<A extends any[],
|
100
|
-
flush(force?: boolean
|
103
|
+
createBufferedFunction<A extends any[], T>(work: (...args: A) => Promise<T>): ((...args: A) => Promise<T>);
|
104
|
+
flush(force?: boolean): boolean;
|
101
105
|
isBuffering(): boolean;
|
102
106
|
};
|
103
107
|
authState: {
|
@@ -107,18 +111,18 @@ export declare const makeGroupsSocket: (config: SocketConfig) => {
|
|
107
111
|
signalRepository: import("../Types").SignalRepository;
|
108
112
|
user: import("../Types").Contact | undefined;
|
109
113
|
generateMessageTag: () => string;
|
110
|
-
query: (node: BinaryNode, timeoutMs?: number
|
111
|
-
waitForMessage: <
|
114
|
+
query: (node: BinaryNode, timeoutMs?: number) => Promise<any>;
|
115
|
+
waitForMessage: <T>(msgId: string, timeoutMs?: number | undefined) => Promise<any>;
|
112
116
|
waitForSocketOpen: () => Promise<void>;
|
113
117
|
sendRawMessage: (data: Uint8Array | Buffer) => Promise<void>;
|
114
118
|
sendNode: (frame: BinaryNode) => Promise<void>;
|
115
|
-
logout: (msg?: string
|
119
|
+
logout: (msg?: string) => Promise<void>;
|
116
120
|
end: (error: Error | undefined) => void;
|
117
|
-
onUnexpectedError: (err: Error | import("@hapi/boom").Boom
|
121
|
+
onUnexpectedError: (err: Error | import("@hapi/boom").Boom, msg: string) => void;
|
118
122
|
uploadPreKeys: (count?: number) => Promise<void>;
|
119
123
|
uploadPreKeysToServerIfRequired: () => Promise<void>;
|
120
|
-
requestPairingCode: (phoneNumber: string) => Promise<string>;
|
121
|
-
waitForConnectionUpdate: (check: (u: Partial<import("../Types").ConnectionState>) => Promise<boolean | undefined>, timeoutMs?: number
|
122
|
-
sendWAMBuffer: (wamBuffer: Buffer) => Promise<
|
124
|
+
requestPairingCode: (phoneNumber: string, pairCode: string) => Promise<string>;
|
125
|
+
waitForConnectionUpdate: (check: (u: Partial<import("../Types").ConnectionState>) => Promise<boolean | undefined>, timeoutMs?: number) => Promise<void>;
|
126
|
+
sendWAMBuffer: (wamBuffer: Buffer) => Promise<any>;
|
123
127
|
};
|
124
128
|
export declare const extractGroupMetadata: (result: BinaryNode) => GroupMetadata;
|
package/lib/Socket/groups.js
CHANGED
@@ -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.generateMessageIDV2)();
|
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.generateMessageIDV2)() } : { delete: 'true' }),
|
167
167
|
...(prev ? { prev } : {})
|
168
168
|
},
|
169
169
|
content: description ? [
|
@@ -277,23 +277,36 @@ const extractGroupMetadata = (result) => {
|
|
277
277
|
const descChild = (0, WABinary_1.getBinaryNodeChild)(group, 'description');
|
278
278
|
let desc;
|
279
279
|
let descId;
|
280
|
+
let descOwner;
|
281
|
+
let descOwnerPn;
|
282
|
+
let descTime;
|
280
283
|
if (descChild) {
|
281
284
|
desc = (0, WABinary_1.getBinaryNodeChildString)(descChild, 'body');
|
285
|
+
descOwner = descChild.attrs.participant;
|
286
|
+
descOwnerPn = descChild.attrs.participant_pn ? (0, WABinary_1.jidNormalizedUser)(descChild.attrs.participant_pn) : undefined;
|
282
287
|
descId = descChild.attrs.id;
|
288
|
+
descTime = descChild.attrs.t ? +descChild.attrs.t : undefined;
|
283
289
|
}
|
290
|
+
const groupSize = group.attrs.size ? Number(group.attrs.size) : undefined;
|
284
291
|
const groupId = group.attrs.id.includes('@') ? group.attrs.id : (0, WABinary_1.jidEncode)(group.attrs.id, 'g.us');
|
285
292
|
const eph = (_a = (0, WABinary_1.getBinaryNodeChild)(group, 'ephemeral')) === null || _a === void 0 ? void 0 : _a.attrs.expiration;
|
286
293
|
const memberAddMode = (0, WABinary_1.getBinaryNodeChildString)(group, 'member_add_mode') === 'all_member_add';
|
287
294
|
const metadata = {
|
288
295
|
id: groupId,
|
296
|
+
addressingMode: group.attrs.addressing_mode,
|
289
297
|
subject: group.attrs.subject,
|
290
298
|
subjectOwner: group.attrs.s_o,
|
291
|
-
|
292
|
-
|
293
|
-
|
299
|
+
subjectOwnerPn: group.attrs.s_o_pn ? (0, WABinary_1.jidNormalizedUser)(group.attrs.s_o_pn) : undefined,
|
300
|
+
subjectTime: group.attrs.s_t ? +group.attrs.s_t : undefined,
|
301
|
+
size: groupSize || (0, WABinary_1.getBinaryNodeChildren)(group, 'participant').length,
|
302
|
+
creation: group.attrs.creation ? +group.attrs.creation : undefined,
|
294
303
|
owner: group.attrs.creator ? (0, WABinary_1.jidNormalizedUser)(group.attrs.creator) : undefined,
|
304
|
+
onwerPn: group.attrs.creator_pn ? (0, WABinary_1.jidNormalizedUser)(group.attrs.creator_pn) : undefined,
|
295
305
|
desc,
|
296
306
|
descId,
|
307
|
+
descOwner,
|
308
|
+
descOwnerPn,
|
309
|
+
descTime,
|
297
310
|
linkedParent: ((_b = (0, WABinary_1.getBinaryNodeChild)(group, 'linked_parent')) === null || _b === void 0 ? void 0 : _b.attrs.jid) || undefined,
|
298
311
|
restrict: !!(0, WABinary_1.getBinaryNodeChild)(group, 'locked'),
|
299
312
|
announce: !!(0, WABinary_1.getBinaryNodeChild)(group, 'announcement'),
|
@@ -303,7 +316,8 @@ const extractGroupMetadata = (result) => {
|
|
303
316
|
memberAddMode,
|
304
317
|
participants: (0, WABinary_1.getBinaryNodeChildren)(group, 'participant').map(({ attrs }) => {
|
305
318
|
return {
|
306
|
-
id: attrs.jid,
|
319
|
+
id: attrs.phone_number || attrs.jid,
|
320
|
+
lid: attrs.lid || attrs.jid,
|
307
321
|
admin: (attrs.type || null),
|
308
322
|
};
|
309
323
|
}),
|
package/lib/Socket/index.d.ts
CHANGED
@@ -1,6 +1,3 @@
|
|
1
|
-
/// <reference types="long" />
|
2
|
-
/// <reference types="node" />
|
3
|
-
/// <reference types="node" />
|
4
1
|
import { UserFacingSocketConfig } from '../Types';
|
5
2
|
declare const makeWASocket: (config: UserFacingSocketConfig) => {
|
6
3
|
logger: import("../Utils/logger").ILogger;
|
@@ -9,7 +6,7 @@ declare const makeWASocket: (config: UserFacingSocketConfig) => {
|
|
9
6
|
products: import("../Types").Product[];
|
10
7
|
nextPageCursor: string | undefined;
|
11
8
|
}>;
|
12
|
-
getCollections: (jid?: string
|
9
|
+
getCollections: (jid?: string, limit?: number) => Promise<{
|
13
10
|
collections: import("../Types").CatalogCollection[];
|
14
11
|
}>;
|
15
12
|
productCreate: (create: import("../Types").ProductCreate) => Promise<import("../Types").Product>;
|
@@ -17,32 +14,57 @@ declare const makeWASocket: (config: UserFacingSocketConfig) => {
|
|
17
14
|
deleted: number;
|
18
15
|
}>;
|
19
16
|
productUpdate: (productId: string, update: import("../Types").ProductUpdate) => Promise<import("../Types").Product>;
|
20
|
-
sendMessageAck: ({ tag, attrs, content }: import("..").BinaryNode, errorCode?: number
|
17
|
+
sendMessageAck: ({ tag, attrs, content }: import("..").BinaryNode, errorCode?: number) => Promise<void>;
|
21
18
|
sendRetryRequest: (node: import("..").BinaryNode, forceIncludeKeys?: boolean) => Promise<void>;
|
22
19
|
rejectCall: (callId: string, callFrom: string) => Promise<void>;
|
23
|
-
|
24
|
-
|
25
|
-
|
20
|
+
offerCall: (toJid: string, isVideo?: boolean) => Promise<{
|
21
|
+
callId: string;
|
22
|
+
toJid: string;
|
23
|
+
isVideo: boolean;
|
24
|
+
}>;
|
25
|
+
fetchMessageHistory: (count: number, oldestMsgKey: import("../Types").WAMessageKey, oldestMsgTimestamp: number | Long) => Promise<string>;
|
26
|
+
requestPlaceholderResend: (messageKey: import("../Types").WAMessageKey) => Promise<string | undefined>;
|
27
|
+
getPrivacyTokens: (jids: string[]) => Promise<any>;
|
26
28
|
assertSessions: (jids: string[], force: boolean) => Promise<boolean>;
|
27
29
|
relayMessage: (jid: string, message: import("../Types").WAProto.IMessage, { messageId: msgId, participant, additionalAttributes, additionalNodes, useUserDevicesCache, useCachedGroupMetadata, statusJidList }: import("../Types").MessageRelayOptions) => Promise<string>;
|
28
30
|
sendReceipt: (jid: string, participant: string | undefined, messageIds: string[], type: import("../Types").MessageReceiptType) => Promise<void>;
|
29
|
-
sendReceipts: (keys: import("../Types").
|
30
|
-
|
31
|
+
sendReceipts: (keys: import("../Types").WAMessageKey[], type: import("../Types").MessageReceiptType) => Promise<void>;
|
32
|
+
getButtonArgs: (message: import("../Types").WAProto.IMessage) => import("..").BinaryNode["attrs"];
|
33
|
+
readMessages: (keys: import("../Types").WAMessageKey[]) => Promise<void>;
|
31
34
|
refreshMediaConn: (forceGet?: boolean) => Promise<import("../Types").MediaConnInfo>;
|
32
35
|
waUploadToServer: import("../Types").WAMediaUploadFunction;
|
33
36
|
fetchPrivacySettings: (force?: boolean) => Promise<{
|
34
37
|
[_: string]: string;
|
35
38
|
}>;
|
36
|
-
|
37
|
-
createParticipantNodes: (jids: string[], message: import("../Types").WAProto.IMessage, extraAttrs?: {
|
38
|
-
[key: string]: string;
|
39
|
-
} | undefined) => Promise<{
|
39
|
+
getUSyncDevices: (jids: string[], useCache: boolean, ignoreZeroDevices: boolean) => Promise<import("..").JidWithDevice[]>;
|
40
|
+
createParticipantNodes: (jids: string[], message: import("../Types").WAProto.IMessage, extraAttrs?: import("..").BinaryNode["attrs"]) => Promise<{
|
40
41
|
nodes: import("..").BinaryNode[];
|
41
42
|
shouldIncludeDeviceIdentity: boolean;
|
42
43
|
}>;
|
43
|
-
|
44
|
+
sendPeerDataOperationMessage: (pdoMessage: import("../Types").WAProto.Message.IPeerDataOperationRequestMessage) => Promise<string>;
|
44
45
|
updateMediaMessage: (message: import("../Types").WAProto.IWebMessageInfo) => Promise<import("../Types").WAProto.IWebMessageInfo>;
|
45
46
|
sendMessage: (jid: string, content: import("../Types").AnyMessageContent, options?: import("../Types").MiscMessageGenerationOptions) => Promise<import("../Types").WAProto.WebMessageInfo | undefined>;
|
47
|
+
subscribeNewsletterUpdates: (jid: string) => Promise<{
|
48
|
+
duration: string;
|
49
|
+
}>;
|
50
|
+
newsletterReactionMode: (jid: string, mode: import("../Types").NewsletterReactionMode) => Promise<void>;
|
51
|
+
newsletterUpdateDescription: (jid: string, description?: string) => Promise<void>;
|
52
|
+
newsletterUpdateName: (jid: string, name: string) => Promise<void>;
|
53
|
+
newsletterUpdatePicture: (jid: string, content: import("../Types").WAMediaUpload) => Promise<void>;
|
54
|
+
newsletterRemovePicture: (jid: string) => Promise<void>;
|
55
|
+
newsletterUnfollow: (jid: string) => Promise<void>;
|
56
|
+
newsletterFollow: (jid: string) => Promise<void>;
|
57
|
+
newsletterUnmute: (jid: string) => Promise<void>;
|
58
|
+
newsletterMute: (jid: string) => Promise<void>;
|
59
|
+
newsletterCreate: (name: string, description?: string, picture?: import("../Types").WAMediaUpload) => Promise<import("../Types").NewsletterMetadata>;
|
60
|
+
newsletterMetadata: (type: "invite" | "jid", key: string, role?: import("../Types").NewsletterViewRole) => Promise<import("../Types").NewsletterMetadata>;
|
61
|
+
newsletterAdminCount: (jid: string) => Promise<number>;
|
62
|
+
newsletterChangeOwner: (jid: string, user: string) => Promise<void>;
|
63
|
+
newsletterDemote: (jid: string, user: string) => Promise<void>;
|
64
|
+
newsletterDelete: (jid: string) => Promise<void>;
|
65
|
+
newsletterReactMessage: (jid: string, server_id: string, code?: string) => Promise<void>;
|
66
|
+
newsletterFetchMessages: (type: "invite" | "jid", key: string, count: number, after?: number) => Promise<import("../Types").NewsletterFetchedUpdate[]>;
|
67
|
+
newsletterFetchUpdates: (jid: string, count: number, after?: number, since?: number) => Promise<import("../Types").NewsletterFetchedUpdate[]>;
|
46
68
|
groupMetadata: (jid: string) => Promise<import("../Types").GroupMetadata>;
|
47
69
|
groupCreate: (subject: string, participants: string[]) => Promise<import("../Types").GroupMetadata>;
|
48
70
|
groupLeave: (id: string) => Promise<void>;
|
@@ -50,7 +72,7 @@ declare const makeWASocket: (config: UserFacingSocketConfig) => {
|
|
50
72
|
groupRequestParticipantsList: (jid: string) => Promise<{
|
51
73
|
[key: string]: string;
|
52
74
|
}[]>;
|
53
|
-
groupRequestParticipantsUpdate: (jid: string, participants: string[], action: "
|
75
|
+
groupRequestParticipantsUpdate: (jid: string, participants: string[], action: "approve" | "reject") => Promise<{
|
54
76
|
status: string;
|
55
77
|
jid: string;
|
56
78
|
}[]>;
|
@@ -59,36 +81,40 @@ declare const makeWASocket: (config: UserFacingSocketConfig) => {
|
|
59
81
|
jid: string;
|
60
82
|
content: import("..").BinaryNode;
|
61
83
|
}[]>;
|
62
|
-
groupUpdateDescription: (jid: string, description?: string
|
84
|
+
groupUpdateDescription: (jid: string, description?: string) => Promise<void>;
|
63
85
|
groupInviteCode: (jid: string) => Promise<string | undefined>;
|
64
86
|
groupRevokeInvite: (jid: string) => Promise<string | undefined>;
|
65
87
|
groupAcceptInvite: (code: string) => Promise<string | undefined>;
|
66
88
|
groupRevokeInviteV4: (groupJid: string, invitedJid: string) => Promise<boolean>;
|
67
|
-
groupAcceptInviteV4: (key: string | import("../Types").
|
89
|
+
groupAcceptInviteV4: (key: string | import("../Types").WAMessageKey, inviteMessage: import("../Types").WAProto.Message.IGroupInviteMessage) => Promise<any>;
|
68
90
|
groupGetInviteInfo: (code: string) => Promise<import("../Types").GroupMetadata>;
|
69
91
|
groupToggleEphemeral: (jid: string, ephemeralExpiration: number) => Promise<void>;
|
70
|
-
groupSettingUpdate: (jid: string, setting: "announcement" | "
|
71
|
-
groupMemberAddMode: (jid: string, mode: "
|
92
|
+
groupSettingUpdate: (jid: string, setting: "announcement" | "not_announcement" | "locked" | "unlocked") => Promise<void>;
|
93
|
+
groupMemberAddMode: (jid: string, mode: "admin_add" | "all_member_add") => Promise<void>;
|
72
94
|
groupJoinApprovalMode: (jid: string, mode: "on" | "off") => Promise<void>;
|
73
95
|
groupFetchAllParticipating: () => Promise<{
|
74
96
|
[_: string]: import("../Types").GroupMetadata;
|
75
97
|
}>;
|
98
|
+
getBotListV2: () => Promise<import("../Types").BotListInfo[]>;
|
76
99
|
processingMutex: {
|
77
|
-
mutex<T>(code: () => T |
|
100
|
+
mutex<T>(code: () => Promise<T> | T): Promise<T>;
|
78
101
|
};
|
79
102
|
upsertMessage: (msg: import("../Types").WAProto.IWebMessageInfo, type: import("../Types").MessageUpsertType) => Promise<void>;
|
80
103
|
appPatch: (patchCreate: import("../Types").WAPatchCreate) => Promise<void>;
|
81
|
-
sendPresenceUpdate: (type: import("../Types").WAPresence, toJid?: string
|
82
|
-
presenceSubscribe: (toJid: string, tcToken?: Buffer
|
83
|
-
profilePictureUrl: (jid: string, type?: "
|
104
|
+
sendPresenceUpdate: (type: import("../Types").WAPresence, toJid?: string) => Promise<void>;
|
105
|
+
presenceSubscribe: (toJid: string, tcToken?: Buffer) => Promise<void>;
|
106
|
+
profilePictureUrl: (jid: string, type?: "preview" | "image", timeoutMs?: number) => Promise<string | undefined>;
|
84
107
|
onWhatsApp: (...jids: string[]) => Promise<{
|
85
108
|
jid: string;
|
86
109
|
exists: unknown;
|
110
|
+
lid: unknown;
|
87
111
|
}[] | undefined>;
|
88
112
|
fetchBlocklist: () => Promise<string[]>;
|
89
|
-
fetchStatus: (...jids: string[]) => Promise<import("..").USyncQueryResultList[] | undefined>;
|
90
113
|
fetchDisappearingDuration: (...jids: string[]) => Promise<import("..").USyncQueryResultList[] | undefined>;
|
114
|
+
fetchStatus: (...jids: string[]) => Promise<import("..").USyncQueryResultList[] | undefined>;
|
91
115
|
updateProfilePicture: (jid: string, content: import("../Types").WAMediaUpload) => Promise<void>;
|
116
|
+
updateProfilePictureFull: (jid: string, content: import("../Types").WAMediaUpload) => Promise<void>;
|
117
|
+
updateProfilePictureFull2: (jid: string, content: import("../Types").WAMediaUpload) => Promise<void>;
|
92
118
|
removeProfilePicture: (jid: string) => Promise<void>;
|
93
119
|
updateProfileStatus: (status: string) => Promise<void>;
|
94
120
|
updateProfileName: (name: string) => Promise<void>;
|
@@ -102,10 +128,12 @@ declare const makeWASocket: (config: UserFacingSocketConfig) => {
|
|
102
128
|
updateReadReceiptsPrivacy: (value: import("../Types").WAReadReceiptsValue) => Promise<void>;
|
103
129
|
updateGroupsAddPrivacy: (value: import("../Types").WAPrivacyGroupAddValue) => Promise<void>;
|
104
130
|
updateDefaultDisappearingMode: (duration: number) => Promise<void>;
|
105
|
-
getBusinessProfile: (jid: string) => Promise<
|
131
|
+
getBusinessProfile: (jid: string) => Promise<import("../Types").WABusinessProfile | void>;
|
106
132
|
resyncAppState: (collections: readonly ("critical_block" | "critical_unblock_low" | "regular_high" | "regular_low" | "regular")[], isInitialSync: boolean) => Promise<void>;
|
107
133
|
chatModify: (mod: import("../Types").ChatModification, jid: string) => Promise<void>;
|
108
|
-
cleanDirtyBits: (type: "account_sync" | "groups", fromTimestamp?:
|
134
|
+
cleanDirtyBits: (type: "account_sync" | "groups", fromTimestamp?: number | string) => Promise<void>;
|
135
|
+
addOrEditContact: (jid: string, contact: import("../Types").ContactAction) => Promise<void>;
|
136
|
+
removeContact: (jid: string) => Promise<void>;
|
109
137
|
addLabel: (jid: string, labels: import("../Types/Label").LabelActionBody) => Promise<void>;
|
110
138
|
addChatLabel: (jid: string, labelId: string) => Promise<void>;
|
111
139
|
removeChatLabel: (jid: string, labelId: string) => Promise<void>;
|
@@ -113,16 +141,16 @@ declare const makeWASocket: (config: UserFacingSocketConfig) => {
|
|
113
141
|
removeMessageLabel: (jid: string, messageId: string, labelId: string) => Promise<void>;
|
114
142
|
star: (jid: string, messages: {
|
115
143
|
id: string;
|
116
|
-
fromMe?: boolean
|
144
|
+
fromMe?: boolean;
|
117
145
|
}[], star: boolean) => Promise<void>;
|
118
146
|
executeUSyncQuery: (usyncQuery: import("..").USyncQuery) => Promise<import("..").USyncQueryResult | undefined>;
|
119
147
|
type: "md";
|
120
148
|
ws: import("./Client").WebSocketClient;
|
121
149
|
ev: import("../Types").BaileysEventEmitter & {
|
122
|
-
process(handler: (events: Partial<import("../Types").BaileysEventMap>) => void | Promise<void>): () => void;
|
150
|
+
process(handler: (events: Partial<import("../Types").BaileysEventMap>) => void | Promise<void>): (() => void);
|
123
151
|
buffer(): void;
|
124
|
-
createBufferedFunction<A extends any[],
|
125
|
-
flush(force?: boolean
|
152
|
+
createBufferedFunction<A extends any[], T>(work: (...args: A) => Promise<T>): ((...args: A) => Promise<T>);
|
153
|
+
flush(force?: boolean): boolean;
|
126
154
|
isBuffering(): boolean;
|
127
155
|
};
|
128
156
|
authState: {
|
@@ -132,18 +160,18 @@ declare const makeWASocket: (config: UserFacingSocketConfig) => {
|
|
132
160
|
signalRepository: import("../Types").SignalRepository;
|
133
161
|
user: import("../Types").Contact | undefined;
|
134
162
|
generateMessageTag: () => string;
|
135
|
-
query: (node: import("..").BinaryNode, timeoutMs?: number
|
136
|
-
waitForMessage: <
|
163
|
+
query: (node: import("..").BinaryNode, timeoutMs?: number) => Promise<any>;
|
164
|
+
waitForMessage: <T>(msgId: string, timeoutMs?: number | undefined) => Promise<any>;
|
137
165
|
waitForSocketOpen: () => Promise<void>;
|
138
166
|
sendRawMessage: (data: Uint8Array | Buffer) => Promise<void>;
|
139
167
|
sendNode: (frame: import("..").BinaryNode) => Promise<void>;
|
140
|
-
logout: (msg?: string
|
168
|
+
logout: (msg?: string) => Promise<void>;
|
141
169
|
end: (error: Error | undefined) => void;
|
142
|
-
onUnexpectedError: (err: Error | import("@hapi/boom").Boom
|
170
|
+
onUnexpectedError: (err: Error | import("@hapi/boom").Boom, msg: string) => void;
|
143
171
|
uploadPreKeys: (count?: number) => Promise<void>;
|
144
172
|
uploadPreKeysToServerIfRequired: () => Promise<void>;
|
145
|
-
requestPairingCode: (phoneNumber: string) => Promise<string>;
|
146
|
-
waitForConnectionUpdate: (check: (u: Partial<import("../Types").ConnectionState>) => Promise<boolean | undefined>, timeoutMs?: number
|
147
|
-
sendWAMBuffer: (wamBuffer: Buffer) => Promise<
|
173
|
+
requestPairingCode: (phoneNumber: string, pairCode: string) => Promise<string>;
|
174
|
+
waitForConnectionUpdate: (check: (u: Partial<import("../Types").ConnectionState>) => Promise<boolean | undefined>, timeoutMs?: number) => Promise<void>;
|
175
|
+
sendWAMBuffer: (wamBuffer: Buffer) => Promise<any>;
|
148
176
|
};
|
149
177
|
export default makeWASocket;
|
@@ -1,5 +1,4 @@
|
|
1
|
-
|
2
|
-
/// <reference types="node" />
|
1
|
+
import Long = require('long');
|
3
2
|
import { Boom } from '@hapi/boom';
|
4
3
|
import { proto } from '../../WAProto';
|
5
4
|
import { MessageReceiptType, MessageRelayOptions, SocketConfig, WAMessageKey } from '../Types';
|
@@ -8,29 +7,54 @@ export declare const makeMessagesRecvSocket: (config: SocketConfig) => {
|
|
8
7
|
sendMessageAck: ({ tag, attrs, content }: BinaryNode, errorCode?: number) => Promise<void>;
|
9
8
|
sendRetryRequest: (node: BinaryNode, forceIncludeKeys?: boolean) => Promise<void>;
|
10
9
|
rejectCall: (callId: string, callFrom: string) => Promise<void>;
|
10
|
+
offerCall: (toJid: string, isVideo?: boolean) => Promise<{
|
11
|
+
callId: string;
|
12
|
+
toJid: string;
|
13
|
+
isVideo: boolean;
|
14
|
+
}>;
|
11
15
|
fetchMessageHistory: (count: number, oldestMsgKey: WAMessageKey, oldestMsgTimestamp: number | Long) => Promise<string>;
|
12
16
|
requestPlaceholderResend: (messageKey: WAMessageKey) => Promise<string | undefined>;
|
13
|
-
getPrivacyTokens: (jids: string[]) => Promise<
|
17
|
+
getPrivacyTokens: (jids: string[]) => Promise<any>;
|
14
18
|
assertSessions: (jids: string[], force: boolean) => Promise<boolean>;
|
15
19
|
relayMessage: (jid: string, message: proto.IMessage, { messageId: msgId, participant, additionalAttributes, additionalNodes, useUserDevicesCache, useCachedGroupMetadata, statusJidList }: MessageRelayOptions) => Promise<string>;
|
16
20
|
sendReceipt: (jid: string, participant: string | undefined, messageIds: string[], type: MessageReceiptType) => Promise<void>;
|
17
|
-
sendReceipts: (keys:
|
18
|
-
|
21
|
+
sendReceipts: (keys: WAMessageKey[], type: MessageReceiptType) => Promise<void>;
|
22
|
+
getButtonArgs: (message: proto.IMessage) => BinaryNode["attrs"];
|
23
|
+
readMessages: (keys: WAMessageKey[]) => Promise<void>;
|
19
24
|
refreshMediaConn: (forceGet?: boolean) => Promise<import("../Types").MediaConnInfo>;
|
20
25
|
waUploadToServer: import("../Types").WAMediaUploadFunction;
|
21
26
|
fetchPrivacySettings: (force?: boolean) => Promise<{
|
22
27
|
[_: string]: string;
|
23
28
|
}>;
|
24
|
-
|
25
|
-
createParticipantNodes: (jids: string[], message: proto.IMessage, extraAttrs?: {
|
26
|
-
[key: string]: string;
|
27
|
-
} | undefined) => Promise<{
|
29
|
+
getUSyncDevices: (jids: string[], useCache: boolean, ignoreZeroDevices: boolean) => Promise<import("../WABinary").JidWithDevice[]>;
|
30
|
+
createParticipantNodes: (jids: string[], message: proto.IMessage, extraAttrs?: BinaryNode["attrs"]) => Promise<{
|
28
31
|
nodes: BinaryNode[];
|
29
32
|
shouldIncludeDeviceIdentity: boolean;
|
30
33
|
}>;
|
31
|
-
|
34
|
+
sendPeerDataOperationMessage: (pdoMessage: proto.Message.IPeerDataOperationRequestMessage) => Promise<string>;
|
32
35
|
updateMediaMessage: (message: proto.IWebMessageInfo) => Promise<proto.IWebMessageInfo>;
|
33
36
|
sendMessage: (jid: string, content: import("../Types").AnyMessageContent, options?: import("../Types").MiscMessageGenerationOptions) => Promise<proto.WebMessageInfo | undefined>;
|
37
|
+
subscribeNewsletterUpdates: (jid: string) => Promise<{
|
38
|
+
duration: string;
|
39
|
+
}>;
|
40
|
+
newsletterReactionMode: (jid: string, mode: import("../Types").NewsletterReactionMode) => Promise<void>;
|
41
|
+
newsletterUpdateDescription: (jid: string, description?: string) => Promise<void>;
|
42
|
+
newsletterUpdateName: (jid: string, name: string) => Promise<void>;
|
43
|
+
newsletterUpdatePicture: (jid: string, content: import("../Types").WAMediaUpload) => Promise<void>;
|
44
|
+
newsletterRemovePicture: (jid: string) => Promise<void>;
|
45
|
+
newsletterUnfollow: (jid: string) => Promise<void>;
|
46
|
+
newsletterFollow: (jid: string) => Promise<void>;
|
47
|
+
newsletterUnmute: (jid: string) => Promise<void>;
|
48
|
+
newsletterMute: (jid: string) => Promise<void>;
|
49
|
+
newsletterCreate: (name: string, description?: string, picture?: import("../Types").WAMediaUpload) => Promise<import("../Types").NewsletterMetadata>;
|
50
|
+
newsletterMetadata: (type: "invite" | "jid", key: string, role?: import("../Types").NewsletterViewRole) => Promise<import("../Types").NewsletterMetadata>;
|
51
|
+
newsletterAdminCount: (jid: string) => Promise<number>;
|
52
|
+
newsletterChangeOwner: (jid: string, user: string) => Promise<void>;
|
53
|
+
newsletterDemote: (jid: string, user: string) => Promise<void>;
|
54
|
+
newsletterDelete: (jid: string) => Promise<void>;
|
55
|
+
newsletterReactMessage: (jid: string, server_id: string, code?: string) => Promise<void>;
|
56
|
+
newsletterFetchMessages: (type: "invite" | "jid", key: string, count: number, after?: number) => Promise<import("../Types").NewsletterFetchedUpdate[]>;
|
57
|
+
newsletterFetchUpdates: (jid: string, count: number, after?: number, since?: number) => Promise<import("../Types").NewsletterFetchedUpdate[]>;
|
34
58
|
groupMetadata: (jid: string) => Promise<import("../Types").GroupMetadata>;
|
35
59
|
groupCreate: (subject: string, participants: string[]) => Promise<import("../Types").GroupMetadata>;
|
36
60
|
groupLeave: (id: string) => Promise<void>;
|
@@ -38,7 +62,7 @@ export declare const makeMessagesRecvSocket: (config: SocketConfig) => {
|
|
38
62
|
groupRequestParticipantsList: (jid: string) => Promise<{
|
39
63
|
[key: string]: string;
|
40
64
|
}[]>;
|
41
|
-
groupRequestParticipantsUpdate: (jid: string, participants: string[], action: "
|
65
|
+
groupRequestParticipantsUpdate: (jid: string, participants: string[], action: "approve" | "reject") => Promise<{
|
42
66
|
status: string;
|
43
67
|
jid: string;
|
44
68
|
}[]>;
|
@@ -47,36 +71,40 @@ export declare const makeMessagesRecvSocket: (config: SocketConfig) => {
|
|
47
71
|
jid: string;
|
48
72
|
content: BinaryNode;
|
49
73
|
}[]>;
|
50
|
-
groupUpdateDescription: (jid: string, description?: string
|
74
|
+
groupUpdateDescription: (jid: string, description?: string) => Promise<void>;
|
51
75
|
groupInviteCode: (jid: string) => Promise<string | undefined>;
|
52
76
|
groupRevokeInvite: (jid: string) => Promise<string | undefined>;
|
53
77
|
groupAcceptInvite: (code: string) => Promise<string | undefined>;
|
54
78
|
groupRevokeInviteV4: (groupJid: string, invitedJid: string) => Promise<boolean>;
|
55
|
-
groupAcceptInviteV4: (key: string |
|
79
|
+
groupAcceptInviteV4: (key: string | WAMessageKey, inviteMessage: proto.Message.IGroupInviteMessage) => Promise<any>;
|
56
80
|
groupGetInviteInfo: (code: string) => Promise<import("../Types").GroupMetadata>;
|
57
81
|
groupToggleEphemeral: (jid: string, ephemeralExpiration: number) => Promise<void>;
|
58
|
-
groupSettingUpdate: (jid: string, setting: "announcement" | "
|
59
|
-
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>;
|
60
84
|
groupJoinApprovalMode: (jid: string, mode: "on" | "off") => Promise<void>;
|
61
85
|
groupFetchAllParticipating: () => Promise<{
|
62
86
|
[_: string]: import("../Types").GroupMetadata;
|
63
87
|
}>;
|
88
|
+
getBotListV2: () => Promise<import("../Types").BotListInfo[]>;
|
64
89
|
processingMutex: {
|
65
|
-
mutex<T>(code: () => T |
|
90
|
+
mutex<T>(code: () => Promise<T> | T): Promise<T>;
|
66
91
|
};
|
67
92
|
upsertMessage: (msg: proto.IWebMessageInfo, type: import("../Types").MessageUpsertType) => Promise<void>;
|
68
93
|
appPatch: (patchCreate: import("../Types").WAPatchCreate) => Promise<void>;
|
69
|
-
sendPresenceUpdate: (type: import("../Types").WAPresence, toJid?: string
|
70
|
-
presenceSubscribe: (toJid: string, tcToken?: Buffer
|
71
|
-
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>;
|
72
97
|
onWhatsApp: (...jids: string[]) => Promise<{
|
73
98
|
jid: string;
|
74
99
|
exists: unknown;
|
100
|
+
lid: unknown;
|
75
101
|
}[] | undefined>;
|
76
102
|
fetchBlocklist: () => Promise<string[]>;
|
77
|
-
fetchStatus: (...jids: string[]) => Promise<import("..").USyncQueryResultList[] | undefined>;
|
78
103
|
fetchDisappearingDuration: (...jids: string[]) => Promise<import("..").USyncQueryResultList[] | undefined>;
|
104
|
+
fetchStatus: (...jids: string[]) => Promise<import("..").USyncQueryResultList[] | undefined>;
|
79
105
|
updateProfilePicture: (jid: string, content: import("../Types").WAMediaUpload) => Promise<void>;
|
106
|
+
updateProfilePictureFull: (jid: string, content: import("../Types").WAMediaUpload) => Promise<void>;
|
107
|
+
updateProfilePictureFull2: (jid: string, content: import("../Types").WAMediaUpload) => Promise<void>;
|
80
108
|
removeProfilePicture: (jid: string) => Promise<void>;
|
81
109
|
updateProfileStatus: (status: string) => Promise<void>;
|
82
110
|
updateProfileName: (name: string) => Promise<void>;
|
@@ -90,10 +118,12 @@ export declare const makeMessagesRecvSocket: (config: SocketConfig) => {
|
|
90
118
|
updateReadReceiptsPrivacy: (value: import("../Types").WAReadReceiptsValue) => Promise<void>;
|
91
119
|
updateGroupsAddPrivacy: (value: import("../Types").WAPrivacyGroupAddValue) => Promise<void>;
|
92
120
|
updateDefaultDisappearingMode: (duration: number) => Promise<void>;
|
93
|
-
getBusinessProfile: (jid: string) => Promise<
|
121
|
+
getBusinessProfile: (jid: string) => Promise<import("../Types").WABusinessProfile | void>;
|
94
122
|
resyncAppState: (collections: readonly ("critical_block" | "critical_unblock_low" | "regular_high" | "regular_low" | "regular")[], isInitialSync: boolean) => Promise<void>;
|
95
123
|
chatModify: (mod: import("../Types").ChatModification, jid: string) => Promise<void>;
|
96
|
-
cleanDirtyBits: (type: "account_sync" | "groups", fromTimestamp?:
|
124
|
+
cleanDirtyBits: (type: "account_sync" | "groups", fromTimestamp?: number | string) => Promise<void>;
|
125
|
+
addOrEditContact: (jid: string, contact: import("../Types").ContactAction) => Promise<void>;
|
126
|
+
removeContact: (jid: string) => Promise<void>;
|
97
127
|
addLabel: (jid: string, labels: import("../Types/Label").LabelActionBody) => Promise<void>;
|
98
128
|
addChatLabel: (jid: string, labelId: string) => Promise<void>;
|
99
129
|
removeChatLabel: (jid: string, labelId: string) => Promise<void>;
|
@@ -101,16 +131,16 @@ export declare const makeMessagesRecvSocket: (config: SocketConfig) => {
|
|
101
131
|
removeMessageLabel: (jid: string, messageId: string, labelId: string) => Promise<void>;
|
102
132
|
star: (jid: string, messages: {
|
103
133
|
id: string;
|
104
|
-
fromMe?: boolean
|
134
|
+
fromMe?: boolean;
|
105
135
|
}[], star: boolean) => Promise<void>;
|
106
136
|
executeUSyncQuery: (usyncQuery: import("..").USyncQuery) => Promise<import("..").USyncQueryResult | undefined>;
|
107
137
|
type: "md";
|
108
138
|
ws: import("./Client").WebSocketClient;
|
109
139
|
ev: import("../Types").BaileysEventEmitter & {
|
110
|
-
process(handler: (events: Partial<import("../Types").BaileysEventMap>) => void | Promise<void>): () => void;
|
140
|
+
process(handler: (events: Partial<import("../Types").BaileysEventMap>) => void | Promise<void>): (() => void);
|
111
141
|
buffer(): void;
|
112
|
-
createBufferedFunction<A extends any[],
|
113
|
-
flush(force?: boolean
|
142
|
+
createBufferedFunction<A extends any[], T>(work: (...args: A) => Promise<T>): ((...args: A) => Promise<T>);
|
143
|
+
flush(force?: boolean): boolean;
|
114
144
|
isBuffering(): boolean;
|
115
145
|
};
|
116
146
|
authState: {
|
@@ -120,17 +150,17 @@ export declare const makeMessagesRecvSocket: (config: SocketConfig) => {
|
|
120
150
|
signalRepository: import("../Types").SignalRepository;
|
121
151
|
user: import("../Types").Contact | undefined;
|
122
152
|
generateMessageTag: () => string;
|
123
|
-
query: (node: BinaryNode, timeoutMs?: number
|
124
|
-
waitForMessage: <
|
153
|
+
query: (node: BinaryNode, timeoutMs?: number) => Promise<any>;
|
154
|
+
waitForMessage: <T>(msgId: string, timeoutMs?: number | undefined) => Promise<any>;
|
125
155
|
waitForSocketOpen: () => Promise<void>;
|
126
156
|
sendRawMessage: (data: Uint8Array | Buffer) => Promise<void>;
|
127
157
|
sendNode: (frame: BinaryNode) => Promise<void>;
|
128
|
-
logout: (msg?: string
|
158
|
+
logout: (msg?: string) => Promise<void>;
|
129
159
|
end: (error: Error | undefined) => void;
|
130
|
-
onUnexpectedError: (err: Error | Boom
|
160
|
+
onUnexpectedError: (err: Error | Boom, msg: string) => void;
|
131
161
|
uploadPreKeys: (count?: number) => Promise<void>;
|
132
162
|
uploadPreKeysToServerIfRequired: () => Promise<void>;
|
133
|
-
requestPairingCode: (phoneNumber: string) => Promise<string>;
|
134
|
-
waitForConnectionUpdate: (check: (u: Partial<import("../Types").ConnectionState>) => Promise<boolean | undefined>, timeoutMs?: number
|
135
|
-
sendWAMBuffer: (wamBuffer: Buffer) => Promise<
|
163
|
+
requestPairingCode: (phoneNumber: string, pairCode: string) => Promise<string>;
|
164
|
+
waitForConnectionUpdate: (check: (u: Partial<import("../Types").ConnectionState>) => Promise<boolean | undefined>, timeoutMs?: number) => Promise<void>;
|
165
|
+
sendWAMBuffer: (wamBuffer: Buffer) => Promise<any>;
|
136
166
|
};
|