@queenanya/baileys 7.4.10 → 7.4.14
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 +26 -26
- package/WAProto/index.js +97194 -67957
- package/lib/Defaults/baileys-version.json +1 -1
- package/lib/Defaults/index.d.ts +231 -1
- package/lib/Defaults/index.js +23 -11
- package/lib/Defaults/phonenumber-mcc.json +223 -0
- package/lib/Socket/Client/index.d.ts +3 -2
- package/lib/Socket/Client/index.js +3 -2
- package/lib/Socket/Client/mobile-socket-client.d.ts +13 -0
- package/lib/Socket/Client/mobile-socket-client.js +65 -0
- package/lib/Socket/Client/{websocket.d.ts → web-socket-client.d.ts} +1 -1
- package/lib/Socket/Client/{websocket.js → web-socket-client.js} +2 -2
- package/lib/Socket/business.d.ts +28 -31
- package/lib/Socket/chats.d.ts +9 -17
- package/lib/Socket/chats.js +116 -115
- package/lib/Socket/groups.d.ts +10 -23
- package/lib/Socket/groups.js +1 -12
- package/lib/Socket/index.d.ts +38 -69
- package/lib/Socket/index.js +2 -2
- package/lib/Socket/messages-recv.d.ts +28 -30
- package/lib/Socket/messages-recv.js +180 -291
- package/lib/Socket/messages-send.d.ts +19 -25
- package/lib/Socket/messages-send.js +76 -110
- package/lib/Socket/newsletter.d.ts +13 -19
- package/lib/Socket/newsletter.js +54 -67
- package/lib/Socket/{communities.d.ts → registration.d.ts} +145 -94
- package/lib/Socket/registration.js +166 -0
- package/lib/Socket/socket.d.ts +1 -3
- package/lib/Socket/socket.js +17 -15
- package/lib/Store/make-cache-manager-store.d.ts +1 -2
- package/lib/Store/make-in-memory-store.js +11 -13
- package/lib/Store/make-ordered-dictionary.js +2 -2
- package/lib/Types/Auth.d.ts +6 -1
- package/lib/Types/Call.d.ts +1 -1
- package/lib/Types/Chat.d.ts +7 -15
- package/lib/Types/Contact.d.ts +1 -6
- package/lib/Types/Events.d.ts +2 -44
- package/lib/Types/GroupMetadata.d.ts +1 -3
- package/lib/Types/Label.d.ts +0 -11
- package/lib/Types/Message.d.ts +30 -37
- package/lib/Types/Newsletter.d.ts +13 -0
- package/lib/Types/Newsletter.js +15 -1
- package/lib/Types/Socket.d.ts +3 -10
- package/lib/Types/index.d.ts +0 -8
- package/lib/Utils/auth-utils.js +7 -1
- package/lib/Utils/chat-utils.d.ts +4 -5
- package/lib/Utils/chat-utils.js +20 -52
- package/lib/Utils/crypto.d.ts +1 -2
- package/lib/Utils/crypto.js +2 -4
- package/lib/Utils/decode-wa-message.d.ts +0 -1
- package/lib/Utils/decode-wa-message.js +14 -34
- package/lib/Utils/event-buffer.js +8 -14
- package/lib/Utils/generics.d.ts +13 -37
- package/lib/Utils/generics.js +18 -103
- package/lib/Utils/history.d.ts +2 -6
- package/lib/Utils/history.js +0 -3
- package/lib/Utils/index.d.ts +0 -1
- package/lib/Utils/index.js +0 -1
- package/lib/Utils/link-preview.js +1 -24
- package/lib/Utils/logger.d.ts +3 -1
- package/lib/Utils/make-mutex.js +0 -1
- package/lib/Utils/messages-media.d.ts +2 -3
- package/lib/Utils/messages-media.js +32 -17
- package/lib/Utils/messages.d.ts +0 -1
- package/lib/Utils/messages.js +72 -67
- package/lib/Utils/noise-handler.d.ts +3 -3
- package/lib/Utils/noise-handler.js +12 -7
- package/lib/Utils/process-message.d.ts +2 -3
- package/lib/Utils/process-message.js +21 -55
- package/lib/Utils/signal.js +16 -23
- package/lib/Utils/use-multi-file-auth-state.js +3 -17
- package/lib/Utils/validate-connection.d.ts +1 -0
- package/lib/Utils/validate-connection.js +44 -10
- package/lib/WABinary/constants.js +5 -5
- package/lib/WABinary/decode.d.ts +2 -3
- package/lib/WABinary/decode.js +4 -6
- package/lib/WABinary/encode.d.ts +2 -1
- package/lib/WABinary/encode.js +6 -8
- package/lib/WABinary/generic-utils.d.ts +0 -1
- package/lib/WABinary/jid-utils.d.ts +3 -3
- package/lib/WABinary/jid-utils.js +5 -5
- package/lib/WAM/BinaryInfo.d.ts +2 -3
- package/lib/WAM/constants.d.ts +2 -3
- package/lib/WAM/encode.d.ts +0 -1
- package/lib/WAM/encode.js +2 -2
- package/lib/index.d.ts +0 -1
- package/lib/index.js +0 -1
- package/package.json +36 -38
- package/lib/Socket/communities.js +0 -354
- package/lib/Socket/usync.d.ts +0 -38
- package/lib/Socket/usync.js +0 -70
- package/lib/Types/USync.d.ts +0 -25
- package/lib/Types/USync.js +0 -2
- package/lib/WAUSync/Protocols/USyncContactProtocol.d.ts +0 -9
- package/lib/WAUSync/Protocols/USyncContactProtocol.js +0 -32
- package/lib/WAUSync/Protocols/USyncDeviceProtocol.d.ts +0 -22
- package/lib/WAUSync/Protocols/USyncDeviceProtocol.js +0 -57
- package/lib/WAUSync/Protocols/USyncDisappearingModeProtocol.d.ts +0 -12
- package/lib/WAUSync/Protocols/USyncDisappearingModeProtocol.js +0 -30
- package/lib/WAUSync/Protocols/USyncStatusProtocol.d.ts +0 -12
- package/lib/WAUSync/Protocols/USyncStatusProtocol.js +0 -42
- package/lib/WAUSync/Protocols/index.d.ts +0 -4
- package/lib/WAUSync/Protocols/index.js +0 -20
- package/lib/WAUSync/USyncQuery.d.ts +0 -26
- package/lib/WAUSync/USyncQuery.js +0 -79
- package/lib/WAUSync/USyncUser.d.ts +0 -10
- package/lib/WAUSync/USyncUser.js +0 -22
- package/lib/WAUSync/index.d.ts +0 -3
- package/lib/WAUSync/index.js +0 -19
- /package/lib/Socket/Client/{types.d.ts → abstract-socket-client.d.ts} +0 -0
- /package/lib/Socket/Client/{types.js → abstract-socket-client.js} +0 -0
package/lib/Socket/groups.d.ts
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
/// <reference types="node" />
|
|
2
|
-
/// <reference types="node" />
|
|
3
2
|
import { proto } from '../../WAProto';
|
|
4
|
-
import { GroupMetadata, ParticipantAction, SocketConfig
|
|
3
|
+
import { GroupMetadata, ParticipantAction, SocketConfig } from '../Types';
|
|
5
4
|
import { BinaryNode } from '../WABinary';
|
|
6
5
|
export declare const makeGroupsSocket: (config: SocketConfig) => {
|
|
7
6
|
groupMetadata: (jid: string) => Promise<GroupMetadata>;
|
|
@@ -24,19 +23,12 @@ export declare const makeGroupsSocket: (config: SocketConfig) => {
|
|
|
24
23
|
groupInviteCode: (jid: string) => Promise<string | undefined>;
|
|
25
24
|
groupRevokeInvite: (jid: string) => Promise<string | undefined>;
|
|
26
25
|
groupAcceptInvite: (code: string) => Promise<string | undefined>;
|
|
27
|
-
/**
|
|
28
|
-
* revoke a v4 invite for someone
|
|
29
|
-
* @param groupJid group jid
|
|
30
|
-
* @param invitedJid jid of person you invited
|
|
31
|
-
* @returns true if successful
|
|
32
|
-
*/
|
|
33
|
-
groupRevokeInviteV4: (groupJid: string, invitedJid: string) => Promise<boolean>;
|
|
34
26
|
/**
|
|
35
27
|
* accept a GroupInviteMessage
|
|
36
28
|
* @param key the key of the invite message, or optionally only provide the jid of the person who sent the invite
|
|
37
29
|
* @param inviteMessage the message to accept
|
|
38
30
|
*/
|
|
39
|
-
groupAcceptInviteV4: (key: string |
|
|
31
|
+
groupAcceptInviteV4: (key: string | proto.IMessageKey, inviteMessage: proto.Message.IGroupInviteMessage) => Promise<string>;
|
|
40
32
|
groupGetInviteInfo: (code: string) => Promise<GroupMetadata>;
|
|
41
33
|
groupToggleEphemeral: (jid: string, ephemeralExpiration: number) => Promise<void>;
|
|
42
34
|
groupSettingUpdate: (jid: string, setting: 'announcement' | 'not_announcement' | 'locked' | 'unlocked') => Promise<void>;
|
|
@@ -57,34 +49,30 @@ export declare const makeGroupsSocket: (config: SocketConfig) => {
|
|
|
57
49
|
presenceSubscribe: (toJid: string, tcToken?: Buffer | undefined) => Promise<void>;
|
|
58
50
|
profilePictureUrl: (jid: string, type?: "image" | "preview", timeoutMs?: number | undefined) => Promise<string | undefined>;
|
|
59
51
|
onWhatsApp: (...jids: string[]) => Promise<{
|
|
52
|
+
exists: boolean;
|
|
60
53
|
jid: string;
|
|
61
|
-
|
|
62
|
-
}[] | undefined>;
|
|
54
|
+
}[]>;
|
|
63
55
|
fetchBlocklist: () => Promise<string[]>;
|
|
64
|
-
fetchStatus: (
|
|
65
|
-
|
|
56
|
+
fetchStatus: (jid: string) => Promise<{
|
|
57
|
+
status: string | undefined;
|
|
58
|
+
setAt: Date;
|
|
59
|
+
} | undefined>;
|
|
66
60
|
updateProfilePicture: (jid: string, content: import("../Types").WAMediaUpload) => Promise<void>;
|
|
67
|
-
updateProfilePictureFull: (jid: any, content: any) => Promise<void>;
|
|
68
|
-
updateProfilePictureFull2: (jid: any, content: any) => Promise<void>;
|
|
69
61
|
removeProfilePicture: (jid: string) => Promise<void>;
|
|
70
62
|
updateProfileStatus: (status: string) => Promise<void>;
|
|
71
63
|
updateProfileName: (name: string) => Promise<void>;
|
|
72
64
|
updateBlockStatus: (jid: string, action: "block" | "unblock") => Promise<void>;
|
|
73
|
-
updateCallPrivacy: (value: import("../Types").WAPrivacyCallValue) => Promise<void>;
|
|
74
65
|
updateLastSeenPrivacy: (value: import("../Types").WAPrivacyValue) => Promise<void>;
|
|
75
66
|
updateOnlinePrivacy: (value: import("../Types").WAPrivacyOnlineValue) => Promise<void>;
|
|
76
67
|
updateProfilePicturePrivacy: (value: import("../Types").WAPrivacyValue) => Promise<void>;
|
|
77
68
|
updateStatusPrivacy: (value: import("../Types").WAPrivacyValue) => Promise<void>;
|
|
78
69
|
updateReadReceiptsPrivacy: (value: import("../Types").WAReadReceiptsValue) => Promise<void>;
|
|
79
|
-
updateGroupsAddPrivacy: (value: import("../Types").
|
|
70
|
+
updateGroupsAddPrivacy: (value: import("../Types").WAPrivacyValue) => Promise<void>;
|
|
80
71
|
updateDefaultDisappearingMode: (duration: number) => Promise<void>;
|
|
81
72
|
getBusinessProfile: (jid: string) => Promise<void | import("../Types").WABusinessProfile>;
|
|
82
73
|
resyncAppState: (collections: readonly ("critical_block" | "critical_unblock_low" | "regular_high" | "regular_low" | "regular")[], isInitialSync: boolean) => Promise<void>;
|
|
83
74
|
chatModify: (mod: import("../Types").ChatModification, jid: string) => Promise<void>;
|
|
84
75
|
cleanDirtyBits: (type: "account_sync" | "groups", fromTimestamp?: string | number | undefined) => Promise<void>;
|
|
85
|
-
addOrEditContact: (jid: string, contact: import("../Types").ContactAction) => Promise<void>;
|
|
86
|
-
removeContact: (jid: string) => Promise<void>;
|
|
87
|
-
addLabel: (jid: string, labels: import("../Types/Label").LabelActionBody) => Promise<void>;
|
|
88
76
|
addChatLabel: (jid: string, labelId: string) => Promise<void>;
|
|
89
77
|
removeChatLabel: (jid: string, labelId: string) => Promise<void>;
|
|
90
78
|
addMessageLabel: (jid: string, messageId: string, labelId: string) => Promise<void>;
|
|
@@ -93,9 +81,8 @@ export declare const makeGroupsSocket: (config: SocketConfig) => {
|
|
|
93
81
|
id: string;
|
|
94
82
|
fromMe?: boolean | undefined;
|
|
95
83
|
}[], star: boolean) => Promise<void>;
|
|
96
|
-
executeUSyncQuery: (usyncQuery: import("..").USyncQuery) => Promise<import("..").USyncQueryResult | undefined>;
|
|
97
84
|
type: "md";
|
|
98
|
-
ws:
|
|
85
|
+
ws: any;
|
|
99
86
|
ev: import("../Types").BaileysEventEmitter & {
|
|
100
87
|
process(handler: (events: Partial<import("../Types").BaileysEventMap>) => void | Promise<void>): () => void;
|
|
101
88
|
buffer(): void;
|
package/lib/Socket/groups.js
CHANGED
|
@@ -187,23 +187,12 @@ const makeGroupsSocket = (config) => {
|
|
|
187
187
|
const result = (0, WABinary_1.getBinaryNodeChild)(results, 'group');
|
|
188
188
|
return result === null || result === void 0 ? void 0 : result.attrs.jid;
|
|
189
189
|
},
|
|
190
|
-
/**
|
|
191
|
-
* revoke a v4 invite for someone
|
|
192
|
-
* @param groupJid group jid
|
|
193
|
-
* @param invitedJid jid of person you invited
|
|
194
|
-
* @returns true if successful
|
|
195
|
-
*/
|
|
196
|
-
groupRevokeInviteV4: async (groupJid, invitedJid) => {
|
|
197
|
-
const result = await groupQuery(groupJid, 'set', [{ tag: 'revoke', attrs: {}, content: [{ tag: 'participant', attrs: { jid: invitedJid } }] }]);
|
|
198
|
-
return !!result;
|
|
199
|
-
},
|
|
200
190
|
/**
|
|
201
191
|
* accept a GroupInviteMessage
|
|
202
192
|
* @param key the key of the invite message, or optionally only provide the jid of the person who sent the invite
|
|
203
193
|
* @param inviteMessage the message to accept
|
|
204
194
|
*/
|
|
205
195
|
groupAcceptInviteV4: ev.createBufferedFunction(async (key, inviteMessage) => {
|
|
206
|
-
var _a;
|
|
207
196
|
key = typeof key === 'string' ? { remoteJid: key } : key;
|
|
208
197
|
const results = await groupQuery(inviteMessage.groupJid, 'set', [{
|
|
209
198
|
tag: 'accept',
|
|
@@ -235,7 +224,7 @@ const makeGroupsSocket = (config) => {
|
|
|
235
224
|
await upsertMessage({
|
|
236
225
|
key: {
|
|
237
226
|
remoteJid: inviteMessage.groupJid,
|
|
238
|
-
id: (0, Utils_1.
|
|
227
|
+
id: (0, Utils_1.generateMessageID)(),
|
|
239
228
|
fromMe: false,
|
|
240
229
|
participant: key.remoteJid,
|
|
241
230
|
},
|
package/lib/Socket/index.d.ts
CHANGED
|
@@ -1,39 +1,9 @@
|
|
|
1
|
-
/// <reference types="long" />
|
|
2
|
-
/// <reference types="node" />
|
|
3
1
|
/// <reference types="node" />
|
|
4
2
|
import { UserFacingSocketConfig } from '../Types';
|
|
5
3
|
declare const makeWASocket: (config: UserFacingSocketConfig) => {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
communityUpdateSubject: (jid: string, subject: string) => Promise<void>;
|
|
10
|
-
communityRequestParticipantsList: (jid: string) => Promise<{
|
|
11
|
-
[key: string]: string;
|
|
12
|
-
}[]>;
|
|
13
|
-
communityRequestParticipantsUpdate: (jid: string, participants: string[], action: "reject" | "approve") => Promise<{
|
|
14
|
-
status: string;
|
|
15
|
-
jid: string;
|
|
16
|
-
}[]>;
|
|
17
|
-
communityParticipantsUpdate: (jid: string, participants: string[], action: import("../Types").ParticipantAction) => Promise<{
|
|
18
|
-
status: string;
|
|
19
|
-
jid: string;
|
|
20
|
-
content: import("..").BinaryNode;
|
|
21
|
-
}[]>;
|
|
22
|
-
communityUpdateDescription: (jid: string, description?: string | undefined) => Promise<void>;
|
|
23
|
-
communityInviteCode: (jid: string) => Promise<string | undefined>;
|
|
24
|
-
communityRevokeInvite: (jid: string) => Promise<string | undefined>;
|
|
25
|
-
communityAcceptInvite: (code: string) => Promise<string | undefined>;
|
|
26
|
-
communityRevokeInviteV4: (communityJid: string, invitedJid: string) => Promise<boolean>;
|
|
27
|
-
communityAcceptInviteV4: (key: string | import("../Types").WAMessageKey, inviteMessage: import("../Types").WAProto.Message.IGroupInviteMessage) => Promise<string>;
|
|
28
|
-
communityGetInviteInfo: (code: string) => Promise<import("../Types").GroupMetadata>;
|
|
29
|
-
communityToggleEphemeral: (jid: string, ephemeralExpiration: number) => Promise<void>;
|
|
30
|
-
communitySettingUpdate: (jid: string, setting: "announcement" | "locked" | "not_announcement" | "unlocked") => Promise<void>;
|
|
31
|
-
communityMemberAddMode: (jid: string, mode: "all_member_add" | "admin_add") => Promise<void>;
|
|
32
|
-
communityJoinApprovalMode: (jid: string, mode: "on" | "off") => Promise<void>;
|
|
33
|
-
communityFetchAllParticipating: () => Promise<{
|
|
34
|
-
[_: string]: import("../Types").GroupMetadata;
|
|
35
|
-
}>;
|
|
36
|
-
logger: import("pino").Logger<never, boolean>;
|
|
4
|
+
register: (code: string) => Promise<import("./registration").ExistsResponse>;
|
|
5
|
+
requestRegistrationCode: (registrationOptions?: import("./registration").RegistrationOptions | undefined) => Promise<import("./registration").ExistsResponse>;
|
|
6
|
+
logger: import("pino").Logger<import("pino").LoggerOptions>;
|
|
37
7
|
getOrderDetails: (orderId: string, tokenBase64: string) => Promise<import("../Types").OrderDetails>;
|
|
38
8
|
getCatalog: ({ jid, limit, cursor }: import("../Types").GetCatalogOptions) => Promise<{
|
|
39
9
|
products: import("../Types").Product[];
|
|
@@ -47,30 +17,34 @@ declare const makeWASocket: (config: UserFacingSocketConfig) => {
|
|
|
47
17
|
deleted: number;
|
|
48
18
|
}>;
|
|
49
19
|
productUpdate: (productId: string, update: import("../Types").ProductUpdate) => Promise<import("../Types").Product>;
|
|
50
|
-
sendMessageAck: ({ tag, attrs, content }: import("
|
|
51
|
-
sendRetryRequest: (node: import("
|
|
20
|
+
sendMessageAck: ({ tag, attrs, content }: import("../index").BinaryNode) => Promise<void>;
|
|
21
|
+
sendRetryRequest: (node: import("../index").BinaryNode, forceIncludeKeys?: boolean) => Promise<void>;
|
|
22
|
+
offerCall: (toJid: string, isVideo?: boolean) => Promise<{
|
|
23
|
+
id: string;
|
|
24
|
+
to: string;
|
|
25
|
+
}>;
|
|
52
26
|
rejectCall: (callId: string, callFrom: string) => Promise<void>;
|
|
53
|
-
|
|
54
|
-
requestPlaceholderResend: (messageKey: import("../Types").WAMessageKey) => Promise<string | undefined>;
|
|
55
|
-
getPrivacyTokens: (jids: string[]) => Promise<import("..").BinaryNode>;
|
|
27
|
+
getPrivacyTokens: (jids: string[]) => Promise<import("../index").BinaryNode>;
|
|
56
28
|
assertSessions: (jids: string[], force: boolean) => Promise<boolean>;
|
|
57
|
-
relayMessage: (jid: string, message: import("../Types").WAProto.IMessage, { messageId: msgId, participant, additionalAttributes, additionalNodes, useUserDevicesCache,
|
|
29
|
+
relayMessage: (jid: string, message: import("../Types").WAProto.IMessage, { messageId: msgId, participant, additionalAttributes, additionalNodes, useUserDevicesCache, cachedGroupMetadata, statusJidList }: import("../Types").MessageRelayOptions) => Promise<string>;
|
|
58
30
|
sendReceipt: (jid: string, participant: string | undefined, messageIds: string[], type: import("../Types").MessageReceiptType) => Promise<void>;
|
|
59
|
-
sendReceipts: (keys: import("../Types").
|
|
60
|
-
|
|
31
|
+
sendReceipts: (keys: import("../Types").WAProto.IMessageKey[], type: import("../Types").MessageReceiptType) => Promise<void>;
|
|
32
|
+
getButtonArgs: (message: import("../Types").WAProto.IMessage) => {
|
|
33
|
+
[key: string]: string;
|
|
34
|
+
};
|
|
35
|
+
readMessages: (keys: import("../Types").WAProto.IMessageKey[]) => Promise<void>;
|
|
61
36
|
refreshMediaConn: (forceGet?: boolean) => Promise<import("../Types").MediaConnInfo>;
|
|
62
|
-
|
|
63
|
-
fetchPrivacySettings: (force?: boolean) => Promise<{
|
|
64
|
-
[_: string]: string;
|
|
65
|
-
}>;
|
|
66
|
-
sendPeerDataOperationMessage: (pdoMessage: import("../Types").WAProto.Message.IPeerDataOperationRequestMessage) => Promise<string>;
|
|
37
|
+
getUSyncDevices: (jids: string[], useCache: boolean, ignoreZeroDevices: boolean) => Promise<import("../index").JidWithDevice[]>;
|
|
67
38
|
createParticipantNodes: (jids: string[], message: import("../Types").WAProto.IMessage, extraAttrs?: {
|
|
68
39
|
[key: string]: string;
|
|
69
40
|
} | undefined) => Promise<{
|
|
70
|
-
nodes: import("
|
|
41
|
+
nodes: import("../index").BinaryNode[];
|
|
71
42
|
shouldIncludeDeviceIdentity: boolean;
|
|
72
43
|
}>;
|
|
73
|
-
|
|
44
|
+
waUploadToServer: import("../Types").WAMediaUploadFunction;
|
|
45
|
+
fetchPrivacySettings: (force?: boolean) => Promise<{
|
|
46
|
+
[_: string]: string;
|
|
47
|
+
}>;
|
|
74
48
|
updateMediaMessage: (message: import("../Types").WAProto.IWebMessageInfo) => Promise<import("../Types").WAProto.IWebMessageInfo>;
|
|
75
49
|
sendMessage: (jid: string, content: import("../Types").AnyMessageContent, options?: import("../Types").MiscMessageGenerationOptions) => Promise<import("../Types").WAProto.WebMessageInfo | undefined>;
|
|
76
50
|
subscribeNewsletterUpdates: (jid: string) => Promise<{
|
|
@@ -85,13 +59,14 @@ declare const makeWASocket: (config: UserFacingSocketConfig) => {
|
|
|
85
59
|
newsletterFollow: (jid: string) => Promise<void>;
|
|
86
60
|
newsletterUnmute: (jid: string) => Promise<void>;
|
|
87
61
|
newsletterMute: (jid: string) => Promise<void>;
|
|
88
|
-
|
|
62
|
+
newsletterAction: (jid: string, type: "mute" | "follow" | "unfollow" | "unmute") => Promise<void>;
|
|
63
|
+
newsletterCreate: (name: string, description: string, reaction_codes: string) => Promise<import("../Types").NewsletterMetadata>;
|
|
89
64
|
newsletterMetadata: (type: "invite" | "jid", key: string, role?: import("../Types").NewsletterViewRole | undefined) => Promise<import("../Types").NewsletterMetadata>;
|
|
90
65
|
newsletterAdminCount: (jid: string) => Promise<number>;
|
|
91
66
|
newsletterChangeOwner: (jid: string, user: string) => Promise<void>;
|
|
92
67
|
newsletterDemote: (jid: string, user: string) => Promise<void>;
|
|
93
68
|
newsletterDelete: (jid: string) => Promise<void>;
|
|
94
|
-
newsletterReactMessage: (jid: string,
|
|
69
|
+
newsletterReactMessage: (jid: string, serverId: string, code?: string | undefined) => Promise<void>;
|
|
95
70
|
newsletterFetchMessages: (type: "invite" | "jid", key: string, count: number, after?: number | undefined) => Promise<import("../Types").NewsletterFetchedUpdate[]>;
|
|
96
71
|
newsletterFetchUpdates: (jid: string, count: number, after?: number | undefined, since?: number | undefined) => Promise<import("../Types").NewsletterFetchedUpdate[]>;
|
|
97
72
|
groupMetadata: (jid: string) => Promise<import("../Types").GroupMetadata>;
|
|
@@ -108,14 +83,13 @@ declare const makeWASocket: (config: UserFacingSocketConfig) => {
|
|
|
108
83
|
groupParticipantsUpdate: (jid: string, participants: string[], action: import("../Types").ParticipantAction) => Promise<{
|
|
109
84
|
status: string;
|
|
110
85
|
jid: string;
|
|
111
|
-
content: import("
|
|
86
|
+
content: import("../index").BinaryNode;
|
|
112
87
|
}[]>;
|
|
113
88
|
groupUpdateDescription: (jid: string, description?: string | undefined) => Promise<void>;
|
|
114
89
|
groupInviteCode: (jid: string) => Promise<string | undefined>;
|
|
115
90
|
groupRevokeInvite: (jid: string) => Promise<string | undefined>;
|
|
116
91
|
groupAcceptInvite: (code: string) => Promise<string | undefined>;
|
|
117
|
-
|
|
118
|
-
groupAcceptInviteV4: (key: string | import("../Types").WAMessageKey, inviteMessage: import("../Types").WAProto.Message.IGroupInviteMessage) => Promise<string>;
|
|
92
|
+
groupAcceptInviteV4: (key: string | import("../Types").WAProto.IMessageKey, inviteMessage: import("../Types").WAProto.Message.IGroupInviteMessage) => Promise<string>;
|
|
119
93
|
groupGetInviteInfo: (code: string) => Promise<import("../Types").GroupMetadata>;
|
|
120
94
|
groupToggleEphemeral: (jid: string, ephemeralExpiration: number) => Promise<void>;
|
|
121
95
|
groupSettingUpdate: (jid: string, setting: "announcement" | "locked" | "not_announcement" | "unlocked") => Promise<void>;
|
|
@@ -133,34 +107,30 @@ declare const makeWASocket: (config: UserFacingSocketConfig) => {
|
|
|
133
107
|
presenceSubscribe: (toJid: string, tcToken?: Buffer | undefined) => Promise<void>;
|
|
134
108
|
profilePictureUrl: (jid: string, type?: "image" | "preview", timeoutMs?: number | undefined) => Promise<string | undefined>;
|
|
135
109
|
onWhatsApp: (...jids: string[]) => Promise<{
|
|
110
|
+
exists: boolean;
|
|
136
111
|
jid: string;
|
|
137
|
-
|
|
138
|
-
}[] | undefined>;
|
|
112
|
+
}[]>;
|
|
139
113
|
fetchBlocklist: () => Promise<string[]>;
|
|
140
|
-
fetchStatus: (
|
|
141
|
-
|
|
114
|
+
fetchStatus: (jid: string) => Promise<{
|
|
115
|
+
status: string | undefined;
|
|
116
|
+
setAt: Date;
|
|
117
|
+
} | undefined>;
|
|
142
118
|
updateProfilePicture: (jid: string, content: import("../Types").WAMediaUpload) => Promise<void>;
|
|
143
|
-
updateProfilePictureFull: (jid: any, content: any) => Promise<void>;
|
|
144
|
-
updateProfilePictureFull2: (jid: any, content: any) => Promise<void>;
|
|
145
119
|
removeProfilePicture: (jid: string) => Promise<void>;
|
|
146
120
|
updateProfileStatus: (status: string) => Promise<void>;
|
|
147
121
|
updateProfileName: (name: string) => Promise<void>;
|
|
148
122
|
updateBlockStatus: (jid: string, action: "block" | "unblock") => Promise<void>;
|
|
149
|
-
updateCallPrivacy: (value: import("../Types").WAPrivacyCallValue) => Promise<void>;
|
|
150
123
|
updateLastSeenPrivacy: (value: import("../Types").WAPrivacyValue) => Promise<void>;
|
|
151
124
|
updateOnlinePrivacy: (value: import("../Types").WAPrivacyOnlineValue) => Promise<void>;
|
|
152
125
|
updateProfilePicturePrivacy: (value: import("../Types").WAPrivacyValue) => Promise<void>;
|
|
153
126
|
updateStatusPrivacy: (value: import("../Types").WAPrivacyValue) => Promise<void>;
|
|
154
127
|
updateReadReceiptsPrivacy: (value: import("../Types").WAReadReceiptsValue) => Promise<void>;
|
|
155
|
-
updateGroupsAddPrivacy: (value: import("../Types").
|
|
128
|
+
updateGroupsAddPrivacy: (value: import("../Types").WAPrivacyValue) => Promise<void>;
|
|
156
129
|
updateDefaultDisappearingMode: (duration: number) => Promise<void>;
|
|
157
130
|
getBusinessProfile: (jid: string) => Promise<void | import("../Types").WABusinessProfile>;
|
|
158
131
|
resyncAppState: (collections: readonly ("critical_block" | "critical_unblock_low" | "regular_high" | "regular_low" | "regular")[], isInitialSync: boolean) => Promise<void>;
|
|
159
132
|
chatModify: (mod: import("../Types").ChatModification, jid: string) => Promise<void>;
|
|
160
133
|
cleanDirtyBits: (type: "account_sync" | "groups", fromTimestamp?: string | number | undefined) => Promise<void>;
|
|
161
|
-
addOrEditContact: (jid: string, contact: import("../Types").ContactAction) => Promise<void>;
|
|
162
|
-
removeContact: (jid: string) => Promise<void>;
|
|
163
|
-
addLabel: (jid: string, labels: import("../Types/Label").LabelActionBody) => Promise<void>;
|
|
164
134
|
addChatLabel: (jid: string, labelId: string) => Promise<void>;
|
|
165
135
|
removeChatLabel: (jid: string, labelId: string) => Promise<void>;
|
|
166
136
|
addMessageLabel: (jid: string, messageId: string, labelId: string) => Promise<void>;
|
|
@@ -169,9 +139,8 @@ declare const makeWASocket: (config: UserFacingSocketConfig) => {
|
|
|
169
139
|
id: string;
|
|
170
140
|
fromMe?: boolean | undefined;
|
|
171
141
|
}[], star: boolean) => Promise<void>;
|
|
172
|
-
executeUSyncQuery: (usyncQuery: import("..").USyncQuery) => Promise<import("..").USyncQueryResult | undefined>;
|
|
173
142
|
type: "md";
|
|
174
|
-
ws:
|
|
143
|
+
ws: any;
|
|
175
144
|
ev: import("../Types").BaileysEventEmitter & {
|
|
176
145
|
process(handler: (events: Partial<import("../Types").BaileysEventMap>) => void | Promise<void>): () => void;
|
|
177
146
|
buffer(): void;
|
|
@@ -186,11 +155,11 @@ declare const makeWASocket: (config: UserFacingSocketConfig) => {
|
|
|
186
155
|
signalRepository: import("../Types").SignalRepository;
|
|
187
156
|
user: import("../Types").Contact | undefined;
|
|
188
157
|
generateMessageTag: () => string;
|
|
189
|
-
query: (node: import("
|
|
158
|
+
query: (node: import("../index").BinaryNode, timeoutMs?: number | undefined) => Promise<import("../index").BinaryNode>;
|
|
190
159
|
waitForMessage: <T_2>(msgId: string, timeoutMs?: number | undefined) => Promise<T_2>;
|
|
191
160
|
waitForSocketOpen: () => Promise<void>;
|
|
192
161
|
sendRawMessage: (data: Uint8Array | Buffer) => Promise<void>;
|
|
193
|
-
sendNode: (frame: import("
|
|
162
|
+
sendNode: (frame: import("../index").BinaryNode) => Promise<void>;
|
|
194
163
|
logout: (msg?: string | undefined) => Promise<void>;
|
|
195
164
|
end: (error: Error | undefined) => void;
|
|
196
165
|
onUnexpectedError: (err: Error | import("@hapi/boom").Boom<any>, msg: string) => void;
|
|
@@ -198,6 +167,6 @@ declare const makeWASocket: (config: UserFacingSocketConfig) => {
|
|
|
198
167
|
uploadPreKeysToServerIfRequired: () => Promise<void>;
|
|
199
168
|
requestPairingCode: (phoneNumber: string) => Promise<string>;
|
|
200
169
|
waitForConnectionUpdate: (check: (u: Partial<import("../Types").ConnectionState>) => boolean | undefined, timeoutMs?: number | undefined) => Promise<void>;
|
|
201
|
-
sendWAMBuffer: (wamBuffer: Buffer) => Promise<import("
|
|
170
|
+
sendWAMBuffer: (wamBuffer: Buffer) => Promise<import("../index").BinaryNode>;
|
|
202
171
|
};
|
|
203
172
|
export default makeWASocket;
|
package/lib/Socket/index.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const Defaults_1 = require("../Defaults");
|
|
4
|
-
const
|
|
4
|
+
const registration_1 = require("./registration");
|
|
5
5
|
// export the last socket layer
|
|
6
|
-
const makeWASocket = (config) => ((0,
|
|
6
|
+
const makeWASocket = (config) => ((0, registration_1.makeRegistrationSocket)({
|
|
7
7
|
...Defaults_1.DEFAULT_CONNECTION_CONFIG,
|
|
8
8
|
...config
|
|
9
9
|
}));
|
|
@@ -1,34 +1,37 @@
|
|
|
1
1
|
/// <reference types="node" />
|
|
2
|
-
/// <reference types="node" />
|
|
3
2
|
import { Boom } from '@hapi/boom';
|
|
4
3
|
import { proto } from '../../WAProto';
|
|
5
|
-
import { MessageReceiptType, MessageRelayOptions, SocketConfig
|
|
4
|
+
import { MessageReceiptType, MessageRelayOptions, SocketConfig } from '../Types';
|
|
6
5
|
import { BinaryNode } from '../WABinary';
|
|
7
6
|
export declare const makeMessagesRecvSocket: (config: SocketConfig) => {
|
|
8
7
|
sendMessageAck: ({ tag, attrs, content }: BinaryNode) => Promise<void>;
|
|
9
8
|
sendRetryRequest: (node: BinaryNode, forceIncludeKeys?: boolean) => Promise<void>;
|
|
9
|
+
offerCall: (toJid: string, isVideo?: boolean) => Promise<{
|
|
10
|
+
id: string;
|
|
11
|
+
to: string;
|
|
12
|
+
}>;
|
|
10
13
|
rejectCall: (callId: string, callFrom: string) => Promise<void>;
|
|
11
|
-
fetchMessageHistory: (count: number, oldestMsgKey: WAMessageKey, oldestMsgTimestamp: number | Long) => Promise<string>;
|
|
12
|
-
requestPlaceholderResend: (messageKey: WAMessageKey) => Promise<string | undefined>;
|
|
13
14
|
getPrivacyTokens: (jids: string[]) => Promise<BinaryNode>;
|
|
14
15
|
assertSessions: (jids: string[], force: boolean) => Promise<boolean>;
|
|
15
|
-
relayMessage: (jid: string, message: proto.IMessage, { messageId: msgId, participant, additionalAttributes, additionalNodes, useUserDevicesCache,
|
|
16
|
+
relayMessage: (jid: string, message: proto.IMessage, { messageId: msgId, participant, additionalAttributes, additionalNodes, useUserDevicesCache, cachedGroupMetadata, statusJidList }: MessageRelayOptions) => Promise<string>;
|
|
16
17
|
sendReceipt: (jid: string, participant: string | undefined, messageIds: string[], type: MessageReceiptType) => Promise<void>;
|
|
17
|
-
sendReceipts: (keys:
|
|
18
|
-
|
|
18
|
+
sendReceipts: (keys: proto.IMessageKey[], type: MessageReceiptType) => Promise<void>;
|
|
19
|
+
getButtonArgs: (message: proto.IMessage) => {
|
|
20
|
+
[key: string]: string;
|
|
21
|
+
};
|
|
22
|
+
readMessages: (keys: proto.IMessageKey[]) => Promise<void>;
|
|
19
23
|
refreshMediaConn: (forceGet?: boolean) => Promise<import("../Types").MediaConnInfo>;
|
|
20
|
-
|
|
21
|
-
fetchPrivacySettings: (force?: boolean) => Promise<{
|
|
22
|
-
[_: string]: string;
|
|
23
|
-
}>;
|
|
24
|
-
sendPeerDataOperationMessage: (pdoMessage: proto.Message.IPeerDataOperationRequestMessage) => Promise<string>;
|
|
24
|
+
getUSyncDevices: (jids: string[], useCache: boolean, ignoreZeroDevices: boolean) => Promise<import("../WABinary").JidWithDevice[]>;
|
|
25
25
|
createParticipantNodes: (jids: string[], message: proto.IMessage, extraAttrs?: {
|
|
26
26
|
[key: string]: string;
|
|
27
27
|
} | undefined) => Promise<{
|
|
28
28
|
nodes: BinaryNode[];
|
|
29
29
|
shouldIncludeDeviceIdentity: boolean;
|
|
30
30
|
}>;
|
|
31
|
-
|
|
31
|
+
waUploadToServer: import("../Types").WAMediaUploadFunction;
|
|
32
|
+
fetchPrivacySettings: (force?: boolean) => Promise<{
|
|
33
|
+
[_: string]: string;
|
|
34
|
+
}>;
|
|
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>;
|
|
34
37
|
subscribeNewsletterUpdates: (jid: string) => Promise<{
|
|
@@ -43,13 +46,14 @@ export declare const makeMessagesRecvSocket: (config: SocketConfig) => {
|
|
|
43
46
|
newsletterFollow: (jid: string) => Promise<void>;
|
|
44
47
|
newsletterUnmute: (jid: string) => Promise<void>;
|
|
45
48
|
newsletterMute: (jid: string) => Promise<void>;
|
|
46
|
-
|
|
49
|
+
newsletterAction: (jid: string, type: "mute" | "follow" | "unfollow" | "unmute") => Promise<void>;
|
|
50
|
+
newsletterCreate: (name: string, description: string, reaction_codes: string) => Promise<import("../Types").NewsletterMetadata>;
|
|
47
51
|
newsletterMetadata: (type: "invite" | "jid", key: string, role?: import("../Types").NewsletterViewRole | undefined) => Promise<import("../Types").NewsletterMetadata>;
|
|
48
52
|
newsletterAdminCount: (jid: string) => Promise<number>;
|
|
49
53
|
newsletterChangeOwner: (jid: string, user: string) => Promise<void>;
|
|
50
54
|
newsletterDemote: (jid: string, user: string) => Promise<void>;
|
|
51
55
|
newsletterDelete: (jid: string) => Promise<void>;
|
|
52
|
-
newsletterReactMessage: (jid: string,
|
|
56
|
+
newsletterReactMessage: (jid: string, serverId: string, code?: string | undefined) => Promise<void>;
|
|
53
57
|
newsletterFetchMessages: (type: "invite" | "jid", key: string, count: number, after?: number | undefined) => Promise<import("../Types").NewsletterFetchedUpdate[]>;
|
|
54
58
|
newsletterFetchUpdates: (jid: string, count: number, after?: number | undefined, since?: number | undefined) => Promise<import("../Types").NewsletterFetchedUpdate[]>;
|
|
55
59
|
groupMetadata: (jid: string) => Promise<import("../Types").GroupMetadata>;
|
|
@@ -72,8 +76,7 @@ export declare const makeMessagesRecvSocket: (config: SocketConfig) => {
|
|
|
72
76
|
groupInviteCode: (jid: string) => Promise<string | undefined>;
|
|
73
77
|
groupRevokeInvite: (jid: string) => Promise<string | undefined>;
|
|
74
78
|
groupAcceptInvite: (code: string) => Promise<string | undefined>;
|
|
75
|
-
|
|
76
|
-
groupAcceptInviteV4: (key: string | WAMessageKey, inviteMessage: proto.Message.IGroupInviteMessage) => Promise<string>;
|
|
79
|
+
groupAcceptInviteV4: (key: string | proto.IMessageKey, inviteMessage: proto.Message.IGroupInviteMessage) => Promise<string>;
|
|
77
80
|
groupGetInviteInfo: (code: string) => Promise<import("../Types").GroupMetadata>;
|
|
78
81
|
groupToggleEphemeral: (jid: string, ephemeralExpiration: number) => Promise<void>;
|
|
79
82
|
groupSettingUpdate: (jid: string, setting: "announcement" | "locked" | "not_announcement" | "unlocked") => Promise<void>;
|
|
@@ -91,34 +94,30 @@ export declare const makeMessagesRecvSocket: (config: SocketConfig) => {
|
|
|
91
94
|
presenceSubscribe: (toJid: string, tcToken?: Buffer | undefined) => Promise<void>;
|
|
92
95
|
profilePictureUrl: (jid: string, type?: "image" | "preview", timeoutMs?: number | undefined) => Promise<string | undefined>;
|
|
93
96
|
onWhatsApp: (...jids: string[]) => Promise<{
|
|
97
|
+
exists: boolean;
|
|
94
98
|
jid: string;
|
|
95
|
-
|
|
96
|
-
}[] | undefined>;
|
|
99
|
+
}[]>;
|
|
97
100
|
fetchBlocklist: () => Promise<string[]>;
|
|
98
|
-
fetchStatus: (
|
|
99
|
-
|
|
101
|
+
fetchStatus: (jid: string) => Promise<{
|
|
102
|
+
status: string | undefined;
|
|
103
|
+
setAt: Date;
|
|
104
|
+
} | undefined>;
|
|
100
105
|
updateProfilePicture: (jid: string, content: import("../Types").WAMediaUpload) => Promise<void>;
|
|
101
|
-
updateProfilePictureFull: (jid: any, content: any) => Promise<void>;
|
|
102
|
-
updateProfilePictureFull2: (jid: any, content: any) => Promise<void>;
|
|
103
106
|
removeProfilePicture: (jid: string) => Promise<void>;
|
|
104
107
|
updateProfileStatus: (status: string) => Promise<void>;
|
|
105
108
|
updateProfileName: (name: string) => Promise<void>;
|
|
106
109
|
updateBlockStatus: (jid: string, action: "block" | "unblock") => Promise<void>;
|
|
107
|
-
updateCallPrivacy: (value: import("../Types").WAPrivacyCallValue) => Promise<void>;
|
|
108
110
|
updateLastSeenPrivacy: (value: import("../Types").WAPrivacyValue) => Promise<void>;
|
|
109
111
|
updateOnlinePrivacy: (value: import("../Types").WAPrivacyOnlineValue) => Promise<void>;
|
|
110
112
|
updateProfilePicturePrivacy: (value: import("../Types").WAPrivacyValue) => Promise<void>;
|
|
111
113
|
updateStatusPrivacy: (value: import("../Types").WAPrivacyValue) => Promise<void>;
|
|
112
114
|
updateReadReceiptsPrivacy: (value: import("../Types").WAReadReceiptsValue) => Promise<void>;
|
|
113
|
-
updateGroupsAddPrivacy: (value: import("../Types").
|
|
115
|
+
updateGroupsAddPrivacy: (value: import("../Types").WAPrivacyValue) => Promise<void>;
|
|
114
116
|
updateDefaultDisappearingMode: (duration: number) => Promise<void>;
|
|
115
117
|
getBusinessProfile: (jid: string) => Promise<void | import("../Types").WABusinessProfile>;
|
|
116
118
|
resyncAppState: (collections: readonly ("critical_block" | "critical_unblock_low" | "regular_high" | "regular_low" | "regular")[], isInitialSync: boolean) => Promise<void>;
|
|
117
119
|
chatModify: (mod: import("../Types").ChatModification, jid: string) => Promise<void>;
|
|
118
120
|
cleanDirtyBits: (type: "account_sync" | "groups", fromTimestamp?: string | number | undefined) => Promise<void>;
|
|
119
|
-
addOrEditContact: (jid: string, contact: import("../Types").ContactAction) => Promise<void>;
|
|
120
|
-
removeContact: (jid: string) => Promise<void>;
|
|
121
|
-
addLabel: (jid: string, labels: import("../Types/Label").LabelActionBody) => Promise<void>;
|
|
122
121
|
addChatLabel: (jid: string, labelId: string) => Promise<void>;
|
|
123
122
|
removeChatLabel: (jid: string, labelId: string) => Promise<void>;
|
|
124
123
|
addMessageLabel: (jid: string, messageId: string, labelId: string) => Promise<void>;
|
|
@@ -127,9 +126,8 @@ export declare const makeMessagesRecvSocket: (config: SocketConfig) => {
|
|
|
127
126
|
id: string;
|
|
128
127
|
fromMe?: boolean | undefined;
|
|
129
128
|
}[], star: boolean) => Promise<void>;
|
|
130
|
-
executeUSyncQuery: (usyncQuery: import("..").USyncQuery) => Promise<import("..").USyncQueryResult | undefined>;
|
|
131
129
|
type: "md";
|
|
132
|
-
ws:
|
|
130
|
+
ws: any;
|
|
133
131
|
ev: import("../Types").BaileysEventEmitter & {
|
|
134
132
|
process(handler: (events: Partial<import("../Types").BaileysEventMap>) => void | Promise<void>): () => void;
|
|
135
133
|
buffer(): void;
|