angularsockets 1.0.1 → 1.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1880 -36
- package/WAProto/index.d.ts +50383 -0
- package/WAProto/index.js +37203 -11791
- package/WASignalGroup/GroupProtocol.js +1697 -0
- package/WASignalGroup/ciphertext_message.js +16 -0
- package/WASignalGroup/group_cipher.js +120 -0
- package/WASignalGroup/group_session_builder.js +46 -0
- package/WASignalGroup/index.js +5 -0
- package/WASignalGroup/keyhelper.js +21 -0
- package/WASignalGroup/protobufs.js +3 -0
- package/WASignalGroup/queue_job.js +69 -0
- package/WASignalGroup/sender_chain_key.js +50 -0
- package/WASignalGroup/sender_key_distribution_message.js +78 -0
- package/WASignalGroup/sender_key_message.js +92 -0
- package/WASignalGroup/sender_key_name.js +70 -0
- package/WASignalGroup/sender_key_record.js +56 -0
- package/WASignalGroup/sender_key_state.js +129 -0
- package/{lib/Signal/Group/sender-message-key.js → WASignalGroup/sender_message_key.js} +16 -6
- package/lib/Defaults/baileys-version.json +1 -1
- package/lib/Defaults/index.js +79 -101
- package/lib/Signal/libsignal.js +29 -51
- package/lib/Socket/Client/web-socket-client.js +0 -2
- package/lib/Socket/business.d.ts +42 -43
- package/lib/Socket/chats.d.ts +9 -8
- package/lib/Socket/chats.js +107 -21
- package/lib/Socket/groups.d.ts +7 -7
- package/lib/Socket/groups.js +24 -25
- package/lib/Socket/index.d.ts +51 -52
- package/lib/Socket/messages-recv.d.ts +34 -37
- package/lib/Socket/messages-recv.js +37 -175
- package/lib/Socket/messages-send.d.ts +16 -10
- package/lib/Socket/messages-send.js +540 -346
- package/lib/Socket/newsletter.d.ts +26 -28
- package/lib/Socket/newsletter.js +4 -4
- package/lib/Socket/registration.d.ts +49 -52
- package/lib/Socket/registration.js +7 -7
- package/lib/Socket/socket.d.ts +1 -0
- package/lib/Socket/socket.js +36 -23
- package/lib/Socket/usync.d.ts +11 -10
- package/lib/Store/make-cache-manager-store.d.ts +2 -1
- package/lib/Store/make-in-memory-store.d.ts +2 -2
- package/lib/Store/make-in-memory-store.js +5 -1
- package/lib/Store/make-ordered-dictionary.js +2 -2
- package/lib/Types/Auth.d.ts +0 -1
- package/lib/Types/Call.d.ts +1 -1
- package/lib/Types/Chat.d.ts +12 -7
- package/lib/Types/Events.d.ts +17 -2
- package/lib/Types/GroupMetadata.d.ts +3 -2
- package/lib/Types/Label.d.ts +11 -0
- package/lib/Types/Label.js +1 -1
- package/lib/Types/LabelAssociation.js +1 -1
- package/lib/Types/Message.d.ts +170 -10
- package/lib/Types/Newsletter.js +3 -3
- package/lib/Types/Socket.d.ts +7 -2
- package/lib/Types/index.d.ts +9 -0
- package/lib/Types/index.js +1 -1
- package/lib/Utils/auth-utils.js +35 -14
- package/lib/Utils/business.d.ts +1 -1
- package/lib/Utils/business.js +2 -2
- package/lib/Utils/chat-utils.d.ts +11 -12
- package/lib/Utils/chat-utils.js +52 -36
- package/lib/Utils/crypto.d.ts +15 -16
- package/lib/Utils/crypto.js +74 -26
- package/lib/Utils/decode-wa-message.d.ts +17 -0
- package/lib/Utils/decode-wa-message.js +53 -17
- package/lib/Utils/event-buffer.js +10 -7
- package/lib/Utils/generics.d.ts +13 -17
- package/lib/Utils/generics.js +26 -15
- package/lib/Utils/history.d.ts +6 -2
- package/lib/Utils/history.js +4 -6
- package/lib/Utils/logger.d.ts +1 -3
- package/lib/Utils/lt-hash.js +12 -12
- package/lib/Utils/make-mutex.d.ts +2 -2
- package/lib/Utils/messages-media.d.ts +25 -28
- package/lib/Utils/messages-media.js +47 -57
- package/lib/Utils/messages.js +461 -44
- package/lib/Utils/noise-handler.d.ts +4 -5
- package/lib/Utils/noise-handler.js +19 -14
- package/lib/Utils/process-message.d.ts +5 -5
- package/lib/Utils/process-message.js +75 -23
- package/lib/Utils/signal.d.ts +2 -1
- package/lib/Utils/signal.js +43 -35
- package/lib/Utils/use-multi-file-auth-state.d.ts +0 -1
- package/lib/Utils/use-multi-file-auth-state.js +251 -36
- package/lib/Utils/use-single-file-auth-state.d.ts +12 -0
- package/lib/Utils/use-single-file-auth-state.js +75 -0
- package/lib/Utils/validate-connection.d.ts +1 -1
- package/lib/Utils/validate-connection.js +1 -1
- package/lib/WABinary/decode.d.ts +1 -2
- package/lib/WABinary/decode.js +23 -11
- package/lib/WABinary/encode.d.ts +1 -2
- package/lib/WABinary/encode.js +46 -22
- package/lib/WABinary/generic-utils.d.ts +2 -4
- package/lib/WABinary/generic-utils.js +2 -10
- package/lib/WABinary/jid-utils.d.ts +1 -1
- package/lib/WAM/BinaryInfo.d.ts +2 -11
- package/lib/WAM/encode.d.ts +1 -2
- package/lib/WAUSync/Protocols/USyncStatusProtocol.js +3 -3
- package/lib/WAUSync/USyncUser.d.ts +0 -2
- package/lib/index.js +0 -6
- package/package.json +96 -104
- package/engine-requirements.js +0 -10
- package/lib/Defaults/phonenumber-mcc.json +0 -223
- package/lib/Signal/Group/ciphertext-message.d.ts +0 -9
- package/lib/Signal/Group/ciphertext-message.js +0 -15
- package/lib/Signal/Group/group-session-builder.d.ts +0 -14
- package/lib/Signal/Group/group-session-builder.js +0 -64
- package/lib/Signal/Group/group_cipher.d.ts +0 -17
- package/lib/Signal/Group/group_cipher.js +0 -96
- package/lib/Signal/Group/index.d.ts +0 -11
- package/lib/Signal/Group/index.js +0 -57
- package/lib/Signal/Group/keyhelper.d.ts +0 -10
- package/lib/Signal/Group/keyhelper.js +0 -55
- package/lib/Signal/Group/queue-job.d.ts +0 -1
- package/lib/Signal/Group/queue-job.js +0 -57
- package/lib/Signal/Group/sender-chain-key.d.ts +0 -13
- package/lib/Signal/Group/sender-chain-key.js +0 -34
- package/lib/Signal/Group/sender-key-distribution-message.d.ts +0 -16
- package/lib/Signal/Group/sender-key-distribution-message.js +0 -66
- package/lib/Signal/Group/sender-key-message.d.ts +0 -18
- package/lib/Signal/Group/sender-key-message.js +0 -69
- package/lib/Signal/Group/sender-key-name.d.ts +0 -17
- package/lib/Signal/Group/sender-key-name.js +0 -51
- package/lib/Signal/Group/sender-key-record.d.ts +0 -30
- package/lib/Signal/Group/sender-key-record.js +0 -53
- package/lib/Signal/Group/sender-key-state.d.ts +0 -38
- package/lib/Signal/Group/sender-key-state.js +0 -99
- package/lib/Signal/Group/sender-message-key.d.ts +0 -11
- package/lib/Socket/dugong.d.ts +0 -175
- package/lib/Socket/dugong.js +0 -342
- package/lib/index.d.ts +0 -12
package/lib/Socket/groups.js
CHANGED
|
@@ -6,7 +6,6 @@ const Types_1 = require("../Types");
|
|
|
6
6
|
const Utils_1 = require("../Utils");
|
|
7
7
|
const WABinary_1 = require("../WABinary");
|
|
8
8
|
const chats_1 = require("./chats");
|
|
9
|
-
const WAUSync_1 = require("../WAUSync");
|
|
10
9
|
const makeGroupsSocket = (config) => {
|
|
11
10
|
const sock = (0, chats_1.makeChatsSocket)(config);
|
|
12
11
|
const { authState, ev, query, upsertMessage } = sock;
|
|
@@ -68,9 +67,10 @@ const makeGroupsSocket = (config) => {
|
|
|
68
67
|
});
|
|
69
68
|
return {
|
|
70
69
|
...sock,
|
|
70
|
+
groupQuery,
|
|
71
71
|
groupMetadata,
|
|
72
72
|
groupCreate: async (subject, participants) => {
|
|
73
|
-
const key = (0, Utils_1.generateMessageID)();
|
|
73
|
+
const key = await config.generateMessageID() ?? (0, Utils_1.generateMessageID)();
|
|
74
74
|
const result = await groupQuery('@g.us', 'set', [
|
|
75
75
|
{
|
|
76
76
|
tag: 'create',
|
|
@@ -164,7 +164,7 @@ const makeGroupsSocket = (config) => {
|
|
|
164
164
|
{
|
|
165
165
|
tag: 'description',
|
|
166
166
|
attrs: {
|
|
167
|
-
...(description ? { id: (0, Utils_1.generateMessageID)() } : { delete: 'true' }),
|
|
167
|
+
...(description ? { id: await config.generateMessageID() ?? (0, Utils_1.generateMessageID)() } : { delete: 'true' }),
|
|
168
168
|
...(prev ? { prev } : {})
|
|
169
169
|
},
|
|
170
170
|
content: description ? [
|
|
@@ -188,12 +188,23 @@ const makeGroupsSocket = (config) => {
|
|
|
188
188
|
const result = (0, WABinary_1.getBinaryNodeChild)(results, 'group');
|
|
189
189
|
return result === null || result === void 0 ? void 0 : result.attrs.jid;
|
|
190
190
|
},
|
|
191
|
+
/**
|
|
192
|
+
* revoke a v4 invite for someone
|
|
193
|
+
* @param groupJid group jid
|
|
194
|
+
* @param invitedJid jid of person you invited
|
|
195
|
+
* @returns true if successful
|
|
196
|
+
*/
|
|
197
|
+
groupRevokeInviteV4: async (groupJid, invitedJid) => {
|
|
198
|
+
const result = await groupQuery(groupJid, 'set', [{ tag: 'revoke', attrs: {}, content: [{ tag: 'participant', attrs: { jid: invitedJid } }] }]);
|
|
199
|
+
return !!result;
|
|
200
|
+
},
|
|
191
201
|
/**
|
|
192
202
|
* accept a GroupInviteMessage
|
|
193
203
|
* @param key the key of the invite message, or optionally only provide the jid of the person who sent the invite
|
|
194
204
|
* @param inviteMessage the message to accept
|
|
195
205
|
*/
|
|
196
206
|
groupAcceptInviteV4: ev.createBufferedFunction(async (key, inviteMessage) => {
|
|
207
|
+
var _a;
|
|
197
208
|
key = typeof key === 'string' ? { remoteJid: key } : key;
|
|
198
209
|
const results = await groupQuery(inviteMessage.groupJid, 'set', [{
|
|
199
210
|
tag: 'accept',
|
|
@@ -225,7 +236,7 @@ const makeGroupsSocket = (config) => {
|
|
|
225
236
|
await upsertMessage({
|
|
226
237
|
key: {
|
|
227
238
|
remoteJid: inviteMessage.groupJid,
|
|
228
|
-
id: (0, Utils_1.
|
|
239
|
+
id: await config.generateMessageIDV2((_a = sock.user) === null || _a === void 0 ? void 0 : _a.id) ?? (0, Utils_1.generateMessageIDV2)((_a = sock.user) === null || _a === void 0 ? void 0 : _a.id),
|
|
229
240
|
fromMe: false,
|
|
230
241
|
participant: key.remoteJid,
|
|
231
242
|
},
|
|
@@ -267,35 +278,24 @@ const extractGroupMetadata = (result) => {
|
|
|
267
278
|
const descChild = (0, WABinary_1.getBinaryNodeChild)(group, 'description');
|
|
268
279
|
let desc;
|
|
269
280
|
let descId;
|
|
270
|
-
let descOwner;
|
|
271
|
-
let descOwnerLid;
|
|
272
|
-
let descTime;
|
|
273
281
|
if (descChild) {
|
|
274
282
|
desc = (0, WABinary_1.getBinaryNodeChildString)(descChild, 'body');
|
|
275
|
-
descOwner = (0, WABinary_1.jidNormalizedUser)(descChild.attrs.participant_pn || descChild.attrs.participant);
|
|
276
|
-
if (group.attrs.addressing_mode === 'lid') {
|
|
277
|
-
descOwnerLid = (0, WABinary_1.jidNormalizedUser)(descChild.attrs.participant);
|
|
278
|
-
}
|
|
279
283
|
descId = descChild.attrs.id;
|
|
280
|
-
descTime = descChild.attrs.t ? +descChild.attrs.t : undefined;
|
|
281
284
|
}
|
|
282
|
-
const groupSize = group.attrs.size ? Number(group.attrs.size) : undefined;
|
|
283
285
|
const groupId = group.attrs.id.includes('@') ? group.attrs.id : (0, WABinary_1.jidEncode)(group.attrs.id, 'g.us');
|
|
284
286
|
const eph = (_a = (0, WABinary_1.getBinaryNodeChild)(group, 'ephemeral')) === null || _a === void 0 ? void 0 : _a.attrs.expiration;
|
|
285
287
|
const memberAddMode = (0, WABinary_1.getBinaryNodeChildString)(group, 'member_add_mode') === 'all_member_add';
|
|
286
288
|
const metadata = {
|
|
287
289
|
id: groupId,
|
|
288
|
-
addressingMode: group.attrs.addressing_mode,
|
|
289
290
|
subject: group.attrs.subject,
|
|
290
|
-
subjectOwner:
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
descOwnerLid,
|
|
291
|
+
subjectOwner: group.attrs.s_o,
|
|
292
|
+
subjectTime: +group.attrs.s_t,
|
|
293
|
+
size: (0, WABinary_1.getBinaryNodeChildren)(group, 'participant').length,
|
|
294
|
+
creation: +group.attrs.creation,
|
|
295
|
+
owner: group.attrs.creator ? (0, WABinary_1.jidNormalizedUser)(group.attrs.creator) : undefined,
|
|
296
|
+
desc,
|
|
297
|
+
descId,
|
|
298
|
+
linkedParent: ((_b = (0, WABinary_1.getBinaryNodeChild)(group, 'linked_parent')) === null || _b === void 0 ? void 0 : _b.attrs.jid) || undefined,
|
|
299
299
|
restrict: !!(0, WABinary_1.getBinaryNodeChild)(group, 'locked'),
|
|
300
300
|
announce: !!(0, WABinary_1.getBinaryNodeChild)(group, 'announcement'),
|
|
301
301
|
isCommunity: !!(0, WABinary_1.getBinaryNodeChild)(group, 'parent'),
|
|
@@ -304,7 +304,7 @@ const extractGroupMetadata = (result) => {
|
|
|
304
304
|
memberAddMode,
|
|
305
305
|
participants: (0, WABinary_1.getBinaryNodeChildren)(group, 'participant').map(({ attrs }) => {
|
|
306
306
|
return {
|
|
307
|
-
id: attrs.jid,
|
|
307
|
+
id: attrs.phone_number ?? attrs.jid,
|
|
308
308
|
admin: (attrs.type || null),
|
|
309
309
|
};
|
|
310
310
|
}),
|
|
@@ -313,4 +313,3 @@ const extractGroupMetadata = (result) => {
|
|
|
313
313
|
return metadata;
|
|
314
314
|
};
|
|
315
315
|
exports.extractGroupMetadata = extractGroupMetadata;
|
|
316
|
-
|
package/lib/Socket/index.d.ts
CHANGED
|
@@ -1,15 +1,14 @@
|
|
|
1
|
-
/// <reference types="node" />
|
|
2
1
|
import { UserFacingSocketConfig } from '../Types';
|
|
3
2
|
declare const makeWASocket: (config: UserFacingSocketConfig) => {
|
|
4
3
|
register: (code: string) => Promise<import("./registration").ExistsResponse>;
|
|
5
|
-
requestRegistrationCode: (registrationOptions?: import("./registration").RegistrationOptions
|
|
6
|
-
logger:
|
|
4
|
+
requestRegistrationCode: (registrationOptions?: import("./registration").RegistrationOptions) => Promise<import("./registration").ExistsResponse>;
|
|
5
|
+
logger: Logger;
|
|
7
6
|
getOrderDetails: (orderId: string, tokenBase64: string) => Promise<import("../Types").OrderDetails>;
|
|
8
7
|
getCatalog: ({ jid, limit, cursor }: import("../Types").GetCatalogOptions) => Promise<{
|
|
9
8
|
products: import("../Types").Product[];
|
|
10
|
-
nextPageCursor:
|
|
9
|
+
nextPageCursor: any;
|
|
11
10
|
}>;
|
|
12
|
-
getCollections: (jid?: string
|
|
11
|
+
getCollections: (jid?: string, limit?: number) => Promise<{
|
|
13
12
|
collections: import("../Types").CatalogCollection[];
|
|
14
13
|
}>;
|
|
15
14
|
productCreate: (create: import("../Types").ProductCreate) => Promise<import("../Types").Product>;
|
|
@@ -17,28 +16,27 @@ declare const makeWASocket: (config: UserFacingSocketConfig) => {
|
|
|
17
16
|
deleted: number;
|
|
18
17
|
}>;
|
|
19
18
|
productUpdate: (productId: string, update: import("../Types").ProductUpdate) => Promise<import("../Types").Product>;
|
|
20
|
-
sendMessageAck: ({ tag, attrs, content }: import("
|
|
21
|
-
sendRetryRequest: (node: import("
|
|
19
|
+
sendMessageAck: ({ tag, attrs, content }: import("..").BinaryNode, errorCode?: number) => Promise<void>;
|
|
20
|
+
sendRetryRequest: (node: import("..").BinaryNode, forceIncludeKeys?: boolean) => Promise<void>;
|
|
22
21
|
offerCall: (toJid: string, isVideo?: boolean) => Promise<{
|
|
23
|
-
id:
|
|
22
|
+
id: any;
|
|
24
23
|
to: string;
|
|
25
24
|
}>;
|
|
26
25
|
rejectCall: (callId: string, callFrom: string) => Promise<void>;
|
|
27
|
-
|
|
26
|
+
fetchMessageHistory: (count: number, oldestMsgKey: import("../Types").WAMessageKey, oldestMsgTimestamp: number) => Promise<string>;
|
|
27
|
+
requestPlaceholderResend: (messageKey: import("../Types").WAMessageKey) => Promise<string | undefined>;
|
|
28
|
+
getPrivacyTokens: (jids: string[]) => Promise<import("..").BinaryNode>;
|
|
28
29
|
assertSessions: (jids: string[], force: boolean) => Promise<boolean>;
|
|
29
30
|
relayMessage: (jid: string, message: import("../Types").WAProto.IMessage, { messageId: msgId, participant, additionalAttributes, additionalNodes, useUserDevicesCache, cachedGroupMetadata, statusJidList }: import("../Types").MessageRelayOptions) => Promise<string>;
|
|
30
31
|
sendReceipt: (jid: string, participant: string | undefined, messageIds: string[], type: import("../Types").MessageReceiptType) => Promise<void>;
|
|
31
|
-
sendReceipts: (keys: import("../Types").
|
|
32
|
-
getButtonArgs: (message: import("../Types").WAProto.IMessage) =>
|
|
33
|
-
|
|
34
|
-
};
|
|
35
|
-
readMessages: (keys: import("../Types").WAProto.IMessageKey[]) => Promise<void>;
|
|
32
|
+
sendReceipts: (keys: import("../Types").WAMessageKey[], type: import("../Types").MessageReceiptType) => Promise<void>;
|
|
33
|
+
getButtonArgs: (message: import("../Types").WAProto.IMessage) => import("..").BinaryNode["attrs"];
|
|
34
|
+
readMessages: (keys: import("../Types").WAMessageKey[]) => Promise<void>;
|
|
36
35
|
refreshMediaConn: (forceGet?: boolean) => Promise<import("../Types").MediaConnInfo>;
|
|
37
|
-
getUSyncDevices: (jids: string[], useCache: boolean, ignoreZeroDevices: boolean) => Promise<import("
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
nodes: import("../index").BinaryNode[];
|
|
36
|
+
getUSyncDevices: (jids: string[], useCache: boolean, ignoreZeroDevices: boolean) => Promise<import("..").JidWithDevice[]>;
|
|
37
|
+
sendPeerDataOperationMessage: (pdoMessage: import("../Types").WAProto.Message.IPeerDataOperationRequestMessage) => Promise<string>;
|
|
38
|
+
createParticipantNodes: (jids: string[], message: import("../Types").WAProto.IMessage, extraAttrs?: import("..").BinaryNode["attrs"]) => Promise<{
|
|
39
|
+
nodes: import("..").BinaryNode[];
|
|
42
40
|
shouldIncludeDeviceIdentity: boolean;
|
|
43
41
|
}>;
|
|
44
42
|
waUploadToServer: import("../Types").WAMediaUploadFunction;
|
|
@@ -46,12 +44,14 @@ declare const makeWASocket: (config: UserFacingSocketConfig) => {
|
|
|
46
44
|
[_: string]: string;
|
|
47
45
|
}>;
|
|
48
46
|
updateMediaMessage: (message: import("../Types").WAProto.IWebMessageInfo) => Promise<import("../Types").WAProto.IWebMessageInfo>;
|
|
47
|
+
sendStatusMentions: (content: import("../Types").AnyMessageContent, jids?: string[]) => Promise<import("../Types").WAProto.WebMessageInfo>;
|
|
48
|
+
sendAlbumMessage: (jid: string, medias: import("../Types").Media[], options?: import("../Types").MiscMessageGenerationOptions) => Promise<import("../Types").WAProto.WebMessageInfo>;
|
|
49
49
|
sendMessage: (jid: string, content: import("../Types").AnyMessageContent, options?: import("../Types").MiscMessageGenerationOptions) => Promise<import("../Types").WAProto.WebMessageInfo | undefined>;
|
|
50
50
|
subscribeNewsletterUpdates: (jid: string) => Promise<{
|
|
51
51
|
duration: string;
|
|
52
52
|
}>;
|
|
53
53
|
newsletterReactionMode: (jid: string, mode: import("../Types").NewsletterReactionMode) => Promise<void>;
|
|
54
|
-
newsletterUpdateDescription: (jid: string, description?: string
|
|
54
|
+
newsletterUpdateDescription: (jid: string, description?: string) => Promise<void>;
|
|
55
55
|
newsletterUpdateName: (jid: string, name: string) => Promise<void>;
|
|
56
56
|
newsletterUpdatePicture: (jid: string, content: import("../Types").WAMediaUpload) => Promise<void>;
|
|
57
57
|
newsletterRemovePicture: (jid: string) => Promise<void>;
|
|
@@ -59,16 +59,16 @@ declare const makeWASocket: (config: UserFacingSocketConfig) => {
|
|
|
59
59
|
newsletterFollow: (jid: string) => Promise<void>;
|
|
60
60
|
newsletterUnmute: (jid: string) => Promise<void>;
|
|
61
61
|
newsletterMute: (jid: string) => Promise<void>;
|
|
62
|
-
newsletterAction: (jid: string, type: "
|
|
63
|
-
newsletterCreate: (name: string, description: string
|
|
64
|
-
newsletterMetadata: (type: "invite" | "jid", key: string, role?: import("../Types").NewsletterViewRole
|
|
62
|
+
newsletterAction: (jid: string, type: "follow" | "unfollow" | "mute" | "unmute") => Promise<void>;
|
|
63
|
+
newsletterCreate: (name: string, description: string) => Promise<import("../Types").NewsletterMetadata>;
|
|
64
|
+
newsletterMetadata: (type: "invite" | "jid", key: string, role?: import("../Types").NewsletterViewRole) => Promise<import("../Types").NewsletterMetadata>;
|
|
65
65
|
newsletterAdminCount: (jid: string) => Promise<number>;
|
|
66
66
|
newsletterChangeOwner: (jid: string, user: string) => Promise<void>;
|
|
67
67
|
newsletterDemote: (jid: string, user: string) => Promise<void>;
|
|
68
68
|
newsletterDelete: (jid: string) => Promise<void>;
|
|
69
|
-
newsletterReactMessage: (jid: string, serverId: string, code?: string
|
|
70
|
-
newsletterFetchMessages: (type: "invite" | "jid", key: string, count: number, after?: number
|
|
71
|
-
newsletterFetchUpdates: (jid: string, count: number, after?: number
|
|
69
|
+
newsletterReactMessage: (jid: string, serverId: string, code?: string) => Promise<void>;
|
|
70
|
+
newsletterFetchMessages: (type: "invite" | "jid", key: string, count: number, after?: number) => Promise<import("../Types").NewsletterFetchedUpdate[]>;
|
|
71
|
+
newsletterFetchUpdates: (jid: string, count: number, after?: number, since?: number) => Promise<import("../Types").NewsletterFetchedUpdate[]>;
|
|
72
72
|
groupMetadata: (jid: string) => Promise<import("../Types").GroupMetadata>;
|
|
73
73
|
groupCreate: (subject: string, participants: string[]) => Promise<import("../Types").GroupMetadata>;
|
|
74
74
|
groupLeave: (id: string) => Promise<void>;
|
|
@@ -76,41 +76,40 @@ declare const makeWASocket: (config: UserFacingSocketConfig) => {
|
|
|
76
76
|
groupRequestParticipantsList: (jid: string) => Promise<{
|
|
77
77
|
[key: string]: string;
|
|
78
78
|
}[]>;
|
|
79
|
-
groupRequestParticipantsUpdate: (jid: string, participants: string[], action: "
|
|
79
|
+
groupRequestParticipantsUpdate: (jid: string, participants: string[], action: "approve" | "reject") => Promise<{
|
|
80
80
|
status: string;
|
|
81
81
|
jid: string;
|
|
82
82
|
}[]>;
|
|
83
83
|
groupParticipantsUpdate: (jid: string, participants: string[], action: import("../Types").ParticipantAction) => Promise<{
|
|
84
84
|
status: string;
|
|
85
85
|
jid: string;
|
|
86
|
-
content: import("
|
|
86
|
+
content: import("..").BinaryNode;
|
|
87
87
|
}[]>;
|
|
88
|
-
groupUpdateDescription: (jid: string, description?: string
|
|
88
|
+
groupUpdateDescription: (jid: string, description?: string) => Promise<void>;
|
|
89
89
|
groupInviteCode: (jid: string) => Promise<string | undefined>;
|
|
90
90
|
groupRevokeInvite: (jid: string) => Promise<string | undefined>;
|
|
91
91
|
groupAcceptInvite: (code: string) => Promise<string | undefined>;
|
|
92
92
|
groupAcceptInviteV4: (key: string | import("../Types").WAProto.IMessageKey, inviteMessage: import("../Types").WAProto.Message.IGroupInviteMessage) => Promise<string>;
|
|
93
93
|
groupGetInviteInfo: (code: string) => Promise<import("../Types").GroupMetadata>;
|
|
94
94
|
groupToggleEphemeral: (jid: string, ephemeralExpiration: number) => Promise<void>;
|
|
95
|
-
groupSettingUpdate: (jid: string, setting: "announcement" | "
|
|
96
|
-
groupMemberAddMode: (jid: string, mode: "
|
|
95
|
+
groupSettingUpdate: (jid: string, setting: "announcement" | "not_announcement" | "locked" | "unlocked") => Promise<void>;
|
|
96
|
+
groupMemberAddMode: (jid: string, mode: "admin_add" | "all_member_add") => Promise<void>;
|
|
97
97
|
groupJoinApprovalMode: (jid: string, mode: "on" | "off") => Promise<void>;
|
|
98
98
|
groupFetchAllParticipating: () => Promise<{
|
|
99
99
|
[_: string]: import("../Types").GroupMetadata;
|
|
100
100
|
}>;
|
|
101
101
|
processingMutex: {
|
|
102
|
-
mutex<T>(code: () => T |
|
|
102
|
+
mutex<T>(code: () => Promise<T> | T): Promise<T>;
|
|
103
103
|
};
|
|
104
104
|
upsertMessage: (msg: import("../Types").WAProto.IWebMessageInfo, type: import("../Types").MessageUpsertType) => Promise<void>;
|
|
105
105
|
appPatch: (patchCreate: import("../Types").WAPatchCreate) => Promise<void>;
|
|
106
|
-
sendPresenceUpdate: (type: import("../Types").WAPresence, toJid?: string
|
|
107
|
-
presenceSubscribe: (toJid: string, tcToken?: Buffer
|
|
108
|
-
profilePictureUrl: (jid: string, type?: "
|
|
106
|
+
sendPresenceUpdate: (type: import("../Types").WAPresence, toJid?: string) => Promise<void>;
|
|
107
|
+
presenceSubscribe: (toJid: string, tcToken?: Buffer) => Promise<void>;
|
|
108
|
+
profilePictureUrl: (jid: string, type?: "preview" | "image", timeoutMs?: number) => Promise<string | undefined>;
|
|
109
109
|
onWhatsApp: (...jids: string[]) => Promise<{
|
|
110
|
+
exists: boolean;
|
|
110
111
|
jid: string;
|
|
111
|
-
|
|
112
|
-
lid: unknown;
|
|
113
|
-
}[] | undefined>;
|
|
112
|
+
}[]>;
|
|
114
113
|
fetchBlocklist: () => Promise<string[]>;
|
|
115
114
|
fetchStatus: (jid: string) => Promise<{
|
|
116
115
|
status: string | undefined;
|
|
@@ -128,25 +127,25 @@ declare const makeWASocket: (config: UserFacingSocketConfig) => {
|
|
|
128
127
|
updateReadReceiptsPrivacy: (value: import("../Types").WAReadReceiptsValue) => Promise<void>;
|
|
129
128
|
updateGroupsAddPrivacy: (value: import("../Types").WAPrivacyValue) => Promise<void>;
|
|
130
129
|
updateDefaultDisappearingMode: (duration: number) => Promise<void>;
|
|
131
|
-
getBusinessProfile: (jid: string) => Promise<
|
|
130
|
+
getBusinessProfile: (jid: string) => Promise<import("../Types").WABusinessProfile | void>;
|
|
132
131
|
resyncAppState: (collections: readonly ("critical_block" | "critical_unblock_low" | "regular_high" | "regular_low" | "regular")[], isInitialSync: boolean) => Promise<void>;
|
|
133
132
|
chatModify: (mod: import("../Types").ChatModification, jid: string) => Promise<void>;
|
|
134
|
-
cleanDirtyBits: (type: "account_sync" | "groups", fromTimestamp?:
|
|
133
|
+
cleanDirtyBits: (type: "account_sync" | "groups", fromTimestamp?: number | string) => Promise<void>;
|
|
135
134
|
addChatLabel: (jid: string, labelId: string) => Promise<void>;
|
|
136
135
|
removeChatLabel: (jid: string, labelId: string) => Promise<void>;
|
|
137
136
|
addMessageLabel: (jid: string, messageId: string, labelId: string) => Promise<void>;
|
|
138
137
|
removeMessageLabel: (jid: string, messageId: string, labelId: string) => Promise<void>;
|
|
139
138
|
star: (jid: string, messages: {
|
|
140
139
|
id: string;
|
|
141
|
-
fromMe?: boolean
|
|
140
|
+
fromMe?: boolean;
|
|
142
141
|
}[], star: boolean) => Promise<void>;
|
|
143
142
|
type: "md";
|
|
144
143
|
ws: any;
|
|
145
144
|
ev: import("../Types").BaileysEventEmitter & {
|
|
146
|
-
process(handler: (events: Partial<import("../Types").BaileysEventMap>) => void | Promise<void>): () => void;
|
|
145
|
+
process(handler: (events: Partial<import("../Types").BaileysEventMap>) => void | Promise<void>): (() => void);
|
|
147
146
|
buffer(): void;
|
|
148
|
-
createBufferedFunction<A extends any[],
|
|
149
|
-
flush(force?: boolean
|
|
147
|
+
createBufferedFunction<A extends any[], T>(work: (...args: A) => Promise<T>): ((...args: A) => Promise<T>);
|
|
148
|
+
flush(force?: boolean): boolean;
|
|
150
149
|
isBuffering(): boolean;
|
|
151
150
|
};
|
|
152
151
|
authState: {
|
|
@@ -156,18 +155,18 @@ declare const makeWASocket: (config: UserFacingSocketConfig) => {
|
|
|
156
155
|
signalRepository: import("../Types").SignalRepository;
|
|
157
156
|
user: import("../Types").Contact | undefined;
|
|
158
157
|
generateMessageTag: () => string;
|
|
159
|
-
query: (node: import("
|
|
160
|
-
waitForMessage: <
|
|
158
|
+
query: (node: import("..").BinaryNode, timeoutMs?: number) => Promise<import("..").BinaryNode>;
|
|
159
|
+
waitForMessage: <T>(msgId: string, timeoutMs?: number | undefined) => Promise<T>;
|
|
161
160
|
waitForSocketOpen: () => Promise<void>;
|
|
162
161
|
sendRawMessage: (data: Uint8Array | Buffer) => Promise<void>;
|
|
163
|
-
sendNode: (frame: import("
|
|
164
|
-
logout: (msg?: string
|
|
162
|
+
sendNode: (frame: import("..").BinaryNode) => Promise<void>;
|
|
163
|
+
logout: (msg?: string) => Promise<void>;
|
|
165
164
|
end: (error: Error | undefined) => void;
|
|
166
|
-
onUnexpectedError: (err: Error |
|
|
165
|
+
onUnexpectedError: (err: Error | Boom, msg: string) => void;
|
|
167
166
|
uploadPreKeys: (count?: number) => Promise<void>;
|
|
168
167
|
uploadPreKeysToServerIfRequired: () => Promise<void>;
|
|
169
|
-
requestPairingCode: (phoneNumber: string) => Promise<string>;
|
|
170
|
-
waitForConnectionUpdate: (check: (u: Partial<import("../Types").ConnectionState>) => boolean | undefined, timeoutMs?: number
|
|
171
|
-
sendWAMBuffer: (wamBuffer: Buffer) => Promise<import("
|
|
168
|
+
requestPairingCode: (phoneNumber: string, pairCode: string) => Promise<string>;
|
|
169
|
+
waitForConnectionUpdate: (check: (u: Partial<import("../Types").ConnectionState>) => boolean | undefined, timeoutMs?: number) => Promise<void>;
|
|
170
|
+
sendWAMBuffer: (wamBuffer: Buffer) => Promise<import("..").BinaryNode>;
|
|
172
171
|
};
|
|
173
172
|
export default makeWASocket;
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import Long = require('long');
|
|
2
1
|
import { Boom } from '@hapi/boom';
|
|
3
2
|
import { proto } from '../../WAProto';
|
|
4
3
|
import { MessageReceiptType, MessageRelayOptions, SocketConfig, WAMessageKey } from '../Types';
|
|
@@ -6,33 +5,35 @@ import { BinaryNode } from '../WABinary';
|
|
|
6
5
|
export declare const makeMessagesRecvSocket: (config: SocketConfig) => {
|
|
7
6
|
sendMessageAck: ({ tag, attrs, content }: BinaryNode, errorCode?: number) => Promise<void>;
|
|
8
7
|
sendRetryRequest: (node: BinaryNode, forceIncludeKeys?: boolean) => Promise<void>;
|
|
9
|
-
rejectCall: (callId: string, callFrom: string) => Promise<void>;
|
|
10
8
|
offerCall: (toJid: string, isVideo?: boolean) => Promise<{
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
isVideo: boolean;
|
|
9
|
+
id: any;
|
|
10
|
+
to: string;
|
|
14
11
|
}>;
|
|
15
|
-
|
|
12
|
+
rejectCall: (callId: string, callFrom: string) => Promise<void>;
|
|
13
|
+
fetchMessageHistory: (count: number, oldestMsgKey: WAMessageKey, oldestMsgTimestamp: number) => Promise<string>;
|
|
16
14
|
requestPlaceholderResend: (messageKey: WAMessageKey) => Promise<string | undefined>;
|
|
17
|
-
getPrivacyTokens: (jids: string[]) => Promise<
|
|
15
|
+
getPrivacyTokens: (jids: string[]) => Promise<BinaryNode>;
|
|
18
16
|
assertSessions: (jids: string[], force: boolean) => Promise<boolean>;
|
|
19
|
-
relayMessage: (jid: string, message: proto.IMessage, { messageId: msgId, participant, additionalAttributes, additionalNodes, useUserDevicesCache,
|
|
17
|
+
relayMessage: (jid: string, message: proto.IMessage, { messageId: msgId, participant, additionalAttributes, additionalNodes, useUserDevicesCache, cachedGroupMetadata, statusJidList }: MessageRelayOptions) => Promise<string>;
|
|
20
18
|
sendReceipt: (jid: string, participant: string | undefined, messageIds: string[], type: MessageReceiptType) => Promise<void>;
|
|
21
19
|
sendReceipts: (keys: WAMessageKey[], type: MessageReceiptType) => Promise<void>;
|
|
20
|
+
getButtonArgs: (message: proto.IMessage) => BinaryNode["attrs"];
|
|
22
21
|
readMessages: (keys: WAMessageKey[]) => Promise<void>;
|
|
23
22
|
refreshMediaConn: (forceGet?: boolean) => Promise<import("../Types").MediaConnInfo>;
|
|
24
|
-
waUploadToServer: import("../Types").WAMediaUploadFunction;
|
|
25
|
-
fetchPrivacySettings: (force?: boolean) => Promise<{
|
|
26
|
-
[_: string]: string;
|
|
27
|
-
}>;
|
|
28
23
|
getUSyncDevices: (jids: string[], useCache: boolean, ignoreZeroDevices: boolean) => Promise<import("../WABinary").JidWithDevice[]>;
|
|
24
|
+
sendPeerDataOperationMessage: (pdoMessage: proto.Message.IPeerDataOperationRequestMessage) => Promise<string>;
|
|
29
25
|
createParticipantNodes: (jids: string[], message: proto.IMessage, extraAttrs?: BinaryNode["attrs"]) => Promise<{
|
|
30
26
|
nodes: BinaryNode[];
|
|
31
27
|
shouldIncludeDeviceIdentity: boolean;
|
|
32
28
|
}>;
|
|
33
|
-
|
|
29
|
+
waUploadToServer: import("../Types").WAMediaUploadFunction;
|
|
30
|
+
fetchPrivacySettings: (force?: boolean) => Promise<{
|
|
31
|
+
[_: string]: string;
|
|
32
|
+
}>;
|
|
34
33
|
updateMediaMessage: (message: proto.IWebMessageInfo) => Promise<proto.IWebMessageInfo>;
|
|
35
|
-
|
|
34
|
+
sendStatusMentions: (content: import("../Types").AnyMessageContent, jids?: string[]) => Promise<proto.WebMessageInfo>;
|
|
35
|
+
sendAlbumMessage: (jid: string, medias: import("../Types").Media[], options?: import("../Types").MiscMessageGenerationOptions) => Promise<proto.WebMessageInfo>;
|
|
36
|
+
sendMessage: (jid: string, content: import("../Types").AnyMessageContent, options?: import("../Types").MiscMessageGenerationOptions) => Promise<proto.WebMessageInfo | undefined>;
|
|
36
37
|
subscribeNewsletterUpdates: (jid: string) => Promise<{
|
|
37
38
|
duration: string;
|
|
38
39
|
}>;
|
|
@@ -45,16 +46,16 @@ export declare const makeMessagesRecvSocket: (config: SocketConfig) => {
|
|
|
45
46
|
newsletterFollow: (jid: string) => Promise<void>;
|
|
46
47
|
newsletterUnmute: (jid: string) => Promise<void>;
|
|
47
48
|
newsletterMute: (jid: string) => Promise<void>;
|
|
48
|
-
|
|
49
|
+
newsletterAction: (jid: string, type: "follow" | "unfollow" | "mute" | "unmute") => Promise<void>;
|
|
50
|
+
newsletterCreate: (name: string, description: string) => Promise<import("../Types").NewsletterMetadata>;
|
|
49
51
|
newsletterMetadata: (type: "invite" | "jid", key: string, role?: import("../Types").NewsletterViewRole) => Promise<import("../Types").NewsletterMetadata>;
|
|
50
52
|
newsletterAdminCount: (jid: string) => Promise<number>;
|
|
51
53
|
newsletterChangeOwner: (jid: string, user: string) => Promise<void>;
|
|
52
54
|
newsletterDemote: (jid: string, user: string) => Promise<void>;
|
|
53
55
|
newsletterDelete: (jid: string) => Promise<void>;
|
|
54
|
-
newsletterReactMessage: (jid: string,
|
|
56
|
+
newsletterReactMessage: (jid: string, serverId: string, code?: string) => Promise<void>;
|
|
55
57
|
newsletterFetchMessages: (type: "invite" | "jid", key: string, count: number, after?: number) => Promise<import("../Types").NewsletterFetchedUpdate[]>;
|
|
56
58
|
newsletterFetchUpdates: (jid: string, count: number, after?: number, since?: number) => Promise<import("../Types").NewsletterFetchedUpdate[]>;
|
|
57
|
-
groupQuery: (jid: string, type: "get" | "set", content: BinaryNode[]) => Promise<any>;
|
|
58
59
|
groupMetadata: (jid: string) => Promise<import("../Types").GroupMetadata>;
|
|
59
60
|
groupCreate: (subject: string, participants: string[]) => Promise<import("../Types").GroupMetadata>;
|
|
60
61
|
groupLeave: (id: string) => Promise<void>;
|
|
@@ -75,8 +76,7 @@ export declare const makeMessagesRecvSocket: (config: SocketConfig) => {
|
|
|
75
76
|
groupInviteCode: (jid: string) => Promise<string | undefined>;
|
|
76
77
|
groupRevokeInvite: (jid: string) => Promise<string | undefined>;
|
|
77
78
|
groupAcceptInvite: (code: string) => Promise<string | undefined>;
|
|
78
|
-
|
|
79
|
-
groupAcceptInviteV4: (key: string | WAMessageKey, inviteMessage: proto.Message.IGroupInviteMessage) => Promise<any>;
|
|
79
|
+
groupAcceptInviteV4: (key: string | proto.IMessageKey, inviteMessage: proto.Message.IGroupInviteMessage) => Promise<string>;
|
|
80
80
|
groupGetInviteInfo: (code: string) => Promise<import("../Types").GroupMetadata>;
|
|
81
81
|
groupToggleEphemeral: (jid: string, ephemeralExpiration: number) => Promise<void>;
|
|
82
82
|
groupSettingUpdate: (jid: string, setting: "announcement" | "not_announcement" | "locked" | "unlocked") => Promise<void>;
|
|
@@ -85,39 +85,37 @@ export declare const makeMessagesRecvSocket: (config: SocketConfig) => {
|
|
|
85
85
|
groupFetchAllParticipating: () => Promise<{
|
|
86
86
|
[_: string]: import("../Types").GroupMetadata;
|
|
87
87
|
}>;
|
|
88
|
-
getBotListV2: () => Promise<import("../Types").BotListInfo[]>;
|
|
89
88
|
processingMutex: {
|
|
90
89
|
mutex<T>(code: () => Promise<T> | T): Promise<T>;
|
|
91
90
|
};
|
|
92
|
-
upsertMessage: (msg:
|
|
91
|
+
upsertMessage: (msg: proto.IWebMessageInfo, type: import("../Types").MessageUpsertType) => Promise<void>;
|
|
93
92
|
appPatch: (patchCreate: import("../Types").WAPatchCreate) => Promise<void>;
|
|
94
93
|
sendPresenceUpdate: (type: import("../Types").WAPresence, toJid?: string) => Promise<void>;
|
|
95
94
|
presenceSubscribe: (toJid: string, tcToken?: Buffer) => Promise<void>;
|
|
96
95
|
profilePictureUrl: (jid: string, type?: "preview" | "image", timeoutMs?: number) => Promise<string | undefined>;
|
|
97
96
|
onWhatsApp: (...jids: string[]) => Promise<{
|
|
97
|
+
exists: boolean;
|
|
98
98
|
jid: string;
|
|
99
|
-
|
|
100
|
-
lid: unknown;
|
|
101
|
-
}[] | undefined>;
|
|
99
|
+
}[]>;
|
|
102
100
|
fetchBlocklist: () => Promise<string[]>;
|
|
103
|
-
|
|
104
|
-
|
|
101
|
+
fetchStatus: (jid: string) => Promise<{
|
|
102
|
+
status: string | undefined;
|
|
103
|
+
setAt: Date;
|
|
104
|
+
} | undefined>;
|
|
105
105
|
updateProfilePicture: (jid: string, content: import("../Types").WAMediaUpload) => Promise<void>;
|
|
106
106
|
removeProfilePicture: (jid: string) => Promise<void>;
|
|
107
107
|
updateProfileStatus: (status: string) => Promise<void>;
|
|
108
108
|
updateProfileName: (name: string) => Promise<void>;
|
|
109
109
|
updateBlockStatus: (jid: string, action: "block" | "unblock") => Promise<void>;
|
|
110
|
-
updateCallPrivacy: (value: import("../Types").WAPrivacyCallValue) => Promise<void>;
|
|
111
|
-
updateMessagesPrivacy: (value: import("../Types").WAPrivacyMessagesValue) => Promise<void>;
|
|
112
110
|
updateLastSeenPrivacy: (value: import("../Types").WAPrivacyValue) => Promise<void>;
|
|
113
111
|
updateOnlinePrivacy: (value: import("../Types").WAPrivacyOnlineValue) => Promise<void>;
|
|
114
112
|
updateProfilePicturePrivacy: (value: import("../Types").WAPrivacyValue) => Promise<void>;
|
|
115
113
|
updateStatusPrivacy: (value: import("../Types").WAPrivacyValue) => Promise<void>;
|
|
116
114
|
updateReadReceiptsPrivacy: (value: import("../Types").WAReadReceiptsValue) => Promise<void>;
|
|
117
|
-
updateGroupsAddPrivacy: (value: import("../Types").
|
|
115
|
+
updateGroupsAddPrivacy: (value: import("../Types").WAPrivacyValue) => Promise<void>;
|
|
118
116
|
updateDefaultDisappearingMode: (duration: number) => Promise<void>;
|
|
119
117
|
getBusinessProfile: (jid: string) => Promise<import("../Types").WABusinessProfile | void>;
|
|
120
|
-
resyncAppState: (collections: readonly ("
|
|
118
|
+
resyncAppState: (collections: readonly ("critical_block" | "critical_unblock_low" | "regular_high" | "regular_low" | "regular")[], isInitialSync: boolean) => Promise<void>;
|
|
121
119
|
chatModify: (mod: import("../Types").ChatModification, jid: string) => Promise<void>;
|
|
122
120
|
cleanDirtyBits: (type: "account_sync" | "groups", fromTimestamp?: number | string) => Promise<void>;
|
|
123
121
|
addChatLabel: (jid: string, labelId: string) => Promise<void>;
|
|
@@ -128,9 +126,8 @@ export declare const makeMessagesRecvSocket: (config: SocketConfig) => {
|
|
|
128
126
|
id: string;
|
|
129
127
|
fromMe?: boolean;
|
|
130
128
|
}[], star: boolean) => Promise<void>;
|
|
131
|
-
executeUSyncQuery: (usyncQuery: import("..").USyncQuery) => Promise<import("..").USyncQueryResult | undefined>;
|
|
132
129
|
type: "md";
|
|
133
|
-
ws:
|
|
130
|
+
ws: any;
|
|
134
131
|
ev: import("../Types").BaileysEventEmitter & {
|
|
135
132
|
process(handler: (events: Partial<import("../Types").BaileysEventMap>) => void | Promise<void>): (() => void);
|
|
136
133
|
buffer(): void;
|
|
@@ -145,8 +142,8 @@ export declare const makeMessagesRecvSocket: (config: SocketConfig) => {
|
|
|
145
142
|
signalRepository: import("../Types").SignalRepository;
|
|
146
143
|
user: import("../Types").Contact | undefined;
|
|
147
144
|
generateMessageTag: () => string;
|
|
148
|
-
query: (node: BinaryNode, timeoutMs?: number) => Promise<
|
|
149
|
-
waitForMessage: <T>(msgId: string, timeoutMs?: number | undefined) => Promise<
|
|
145
|
+
query: (node: BinaryNode, timeoutMs?: number) => Promise<BinaryNode>;
|
|
146
|
+
waitForMessage: <T>(msgId: string, timeoutMs?: number | undefined) => Promise<T>;
|
|
150
147
|
waitForSocketOpen: () => Promise<void>;
|
|
151
148
|
sendRawMessage: (data: Uint8Array | Buffer) => Promise<void>;
|
|
152
149
|
sendNode: (frame: BinaryNode) => Promise<void>;
|
|
@@ -155,7 +152,7 @@ export declare const makeMessagesRecvSocket: (config: SocketConfig) => {
|
|
|
155
152
|
onUnexpectedError: (err: Error | Boom, msg: string) => void;
|
|
156
153
|
uploadPreKeys: (count?: number) => Promise<void>;
|
|
157
154
|
uploadPreKeysToServerIfRequired: () => Promise<void>;
|
|
158
|
-
requestPairingCode: (phoneNumber:
|
|
159
|
-
waitForConnectionUpdate: (check: (u: Partial<import("../Types").ConnectionState>) =>
|
|
160
|
-
sendWAMBuffer: (wamBuffer: Buffer) => Promise<
|
|
155
|
+
requestPairingCode: (phoneNumber: string, pairCode: string) => Promise<string>;
|
|
156
|
+
waitForConnectionUpdate: (check: (u: Partial<import("../Types").ConnectionState>) => boolean | undefined, timeoutMs?: number) => Promise<void>;
|
|
157
|
+
sendWAMBuffer: (wamBuffer: Buffer) => Promise<BinaryNode>;
|
|
161
158
|
};
|