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