@queenanya/baileys 7.4.14 → 7.5.11
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 +66875 -96112
- package/lib/Defaults/baileys-version.json +1 -1
- package/lib/Defaults/index.d.ts +1 -231
- package/lib/Defaults/index.js +11 -23
- package/lib/Socket/Client/index.d.ts +2 -3
- package/lib/Socket/Client/index.js +2 -3
- package/lib/Socket/Client/{web-socket-client.d.ts → websocket.d.ts} +1 -1
- package/lib/Socket/Client/{web-socket-client.js → websocket.js} +2 -2
- package/lib/Socket/business.d.ts +29 -22
- package/lib/Socket/chats.d.ts +14 -3
- package/lib/Socket/chats.js +76 -48
- package/lib/Socket/groups.d.ts +21 -4
- package/lib/Socket/groups.js +12 -1
- package/lib/Socket/index.d.ts +37 -32
- package/lib/Socket/index.js +2 -2
- package/lib/Socket/messages-recv.d.ts +28 -22
- package/lib/Socket/messages-recv.js +291 -180
- package/lib/Socket/messages-send.d.ts +23 -13
- package/lib/Socket/messages-send.js +110 -76
- package/lib/Socket/newsletter.d.ts +17 -7
- package/lib/Socket/newsletter.js +67 -54
- package/lib/Socket/socket.d.ts +3 -1
- package/lib/Socket/socket.js +15 -17
- package/lib/Store/make-cache-manager-store.d.ts +2 -1
- package/lib/Store/make-in-memory-store.js +13 -11
- package/lib/Store/make-ordered-dictionary.js +2 -2
- package/lib/Types/Auth.d.ts +1 -6
- package/lib/Types/Call.d.ts +1 -1
- package/lib/Types/Chat.d.ts +12 -7
- package/lib/Types/Contact.d.ts +1 -1
- package/lib/Types/Events.d.ts +44 -2
- package/lib/Types/GroupMetadata.d.ts +3 -1
- package/lib/Types/Label.d.ts +11 -0
- package/lib/Types/Message.d.ts +37 -30
- package/lib/Types/Newsletter.d.ts +0 -13
- package/lib/Types/Newsletter.js +1 -15
- package/lib/Types/Socket.d.ts +10 -3
- package/lib/Types/index.d.ts +8 -0
- package/lib/Utils/auth-utils.js +1 -7
- package/lib/Utils/chat-utils.d.ts +5 -4
- package/lib/Utils/chat-utils.js +41 -20
- package/lib/Utils/crypto.d.ts +2 -1
- package/lib/Utils/crypto.js +4 -2
- package/lib/Utils/decode-wa-message.d.ts +1 -0
- package/lib/Utils/decode-wa-message.js +34 -14
- package/lib/Utils/event-buffer.js +14 -8
- package/lib/Utils/generics.d.ts +37 -13
- package/lib/Utils/generics.js +102 -18
- package/lib/Utils/history.d.ts +6 -2
- package/lib/Utils/history.js +3 -0
- package/lib/Utils/index.d.ts +1 -0
- package/lib/Utils/index.js +1 -0
- package/lib/Utils/link-preview.js +24 -1
- package/lib/Utils/logger.d.ts +1 -3
- package/lib/Utils/make-mutex.js +1 -0
- package/lib/Utils/messages-media.d.ts +3 -2
- package/lib/Utils/messages-media.js +17 -32
- package/lib/Utils/messages.d.ts +1 -0
- package/lib/Utils/messages.js +67 -72
- package/lib/Utils/noise-handler.d.ts +3 -3
- package/lib/Utils/noise-handler.js +7 -12
- package/lib/Utils/process-message.d.ts +3 -2
- package/lib/Utils/process-message.js +55 -21
- package/lib/Utils/signal.js +23 -16
- package/lib/Utils/use-multi-file-auth-state.js +17 -3
- package/lib/Utils/validate-connection.d.ts +0 -1
- package/lib/Utils/validate-connection.js +10 -44
- package/lib/WABinary/constants.js +5 -5
- package/lib/WABinary/decode.d.ts +3 -2
- package/lib/WABinary/decode.js +6 -4
- package/lib/WABinary/encode.d.ts +1 -2
- package/lib/WABinary/encode.js +8 -6
- package/lib/WABinary/generic-utils.d.ts +1 -0
- package/lib/WABinary/jid-utils.d.ts +3 -3
- package/lib/WABinary/jid-utils.js +5 -5
- package/lib/WAM/BinaryInfo.d.ts +3 -2
- package/lib/WAM/constants.d.ts +3 -2
- package/lib/WAM/encode.d.ts +1 -0
- package/lib/WAM/encode.js +2 -2
- package/package.json +37 -35
- package/lib/Defaults/phonenumber-mcc.json +0 -223
- package/lib/Socket/Client/mobile-socket-client.d.ts +0 -13
- package/lib/Socket/Client/mobile-socket-client.js +0 -65
- package/lib/Socket/registration.d.ts +0 -267
- package/lib/Socket/registration.js +0 -166
- /package/lib/Socket/Client/{abstract-socket-client.d.ts → types.d.ts} +0 -0
- /package/lib/Socket/Client/{abstract-socket-client.js → types.js} +0 -0
|
@@ -1,37 +1,34 @@
|
|
|
1
1
|
/// <reference types="node" />
|
|
2
|
+
/// <reference types="node" />
|
|
2
3
|
import { Boom } from '@hapi/boom';
|
|
3
4
|
import { proto } from '../../WAProto';
|
|
4
|
-
import { MessageReceiptType, MessageRelayOptions, SocketConfig } from '../Types';
|
|
5
|
+
import { MessageReceiptType, MessageRelayOptions, SocketConfig, WAMessageKey } from '../Types';
|
|
5
6
|
import { BinaryNode } from '../WABinary';
|
|
6
7
|
export declare const makeMessagesRecvSocket: (config: SocketConfig) => {
|
|
7
8
|
sendMessageAck: ({ tag, attrs, content }: BinaryNode) => Promise<void>;
|
|
8
9
|
sendRetryRequest: (node: BinaryNode, forceIncludeKeys?: boolean) => Promise<void>;
|
|
9
|
-
offerCall: (toJid: string, isVideo?: boolean) => Promise<{
|
|
10
|
-
id: string;
|
|
11
|
-
to: string;
|
|
12
|
-
}>;
|
|
13
10
|
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>;
|
|
14
13
|
getPrivacyTokens: (jids: string[]) => Promise<BinaryNode>;
|
|
15
14
|
assertSessions: (jids: string[], force: boolean) => Promise<boolean>;
|
|
16
|
-
relayMessage: (jid: string, message: proto.IMessage, { messageId: msgId, participant, additionalAttributes, additionalNodes, useUserDevicesCache,
|
|
15
|
+
relayMessage: (jid: string, message: proto.IMessage, { messageId: msgId, participant, additionalAttributes, additionalNodes, useUserDevicesCache, useCachedGroupMetadata, statusJidList }: MessageRelayOptions) => Promise<string>;
|
|
17
16
|
sendReceipt: (jid: string, participant: string | undefined, messageIds: string[], type: MessageReceiptType) => Promise<void>;
|
|
18
|
-
sendReceipts: (keys:
|
|
19
|
-
|
|
20
|
-
[key: string]: string;
|
|
21
|
-
};
|
|
22
|
-
readMessages: (keys: proto.IMessageKey[]) => Promise<void>;
|
|
17
|
+
sendReceipts: (keys: WAMessageKey[], type: MessageReceiptType) => Promise<void>;
|
|
18
|
+
readMessages: (keys: WAMessageKey[]) => Promise<void>;
|
|
23
19
|
refreshMediaConn: (forceGet?: boolean) => Promise<import("../Types").MediaConnInfo>;
|
|
24
|
-
|
|
20
|
+
waUploadToServer: import("../Types").WAMediaUploadFunction;
|
|
21
|
+
fetchPrivacySettings: (force?: boolean) => Promise<{
|
|
22
|
+
[_: string]: string;
|
|
23
|
+
}>;
|
|
24
|
+
sendPeerDataOperationMessage: (pdoMessage: proto.Message.IPeerDataOperationRequestMessage) => Promise<string>;
|
|
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
|
-
|
|
32
|
-
fetchPrivacySettings: (force?: boolean) => Promise<{
|
|
33
|
-
[_: string]: string;
|
|
34
|
-
}>;
|
|
31
|
+
getUSyncDevices: (jids: string[], useCache: boolean, ignoreZeroDevices: boolean) => Promise<import("../WABinary").JidWithDevice[]>;
|
|
35
32
|
updateMediaMessage: (message: proto.IWebMessageInfo) => Promise<proto.IWebMessageInfo>;
|
|
36
33
|
sendMessage: (jid: string, content: import("../Types").AnyMessageContent, options?: import("../Types").MiscMessageGenerationOptions) => Promise<proto.WebMessageInfo | undefined>;
|
|
37
34
|
subscribeNewsletterUpdates: (jid: string) => Promise<{
|
|
@@ -46,14 +43,13 @@ export declare const makeMessagesRecvSocket: (config: SocketConfig) => {
|
|
|
46
43
|
newsletterFollow: (jid: string) => Promise<void>;
|
|
47
44
|
newsletterUnmute: (jid: string) => Promise<void>;
|
|
48
45
|
newsletterMute: (jid: string) => Promise<void>;
|
|
49
|
-
|
|
50
|
-
newsletterCreate: (name: string, description: string, reaction_codes: string) => Promise<import("../Types").NewsletterMetadata>;
|
|
46
|
+
newsletterCreate: (name: string, description: string) => Promise<import("../Types").NewsletterMetadata>;
|
|
51
47
|
newsletterMetadata: (type: "invite" | "jid", key: string, role?: import("../Types").NewsletterViewRole | undefined) => Promise<import("../Types").NewsletterMetadata>;
|
|
52
48
|
newsletterAdminCount: (jid: string) => Promise<number>;
|
|
53
49
|
newsletterChangeOwner: (jid: string, user: string) => Promise<void>;
|
|
54
50
|
newsletterDemote: (jid: string, user: string) => Promise<void>;
|
|
55
51
|
newsletterDelete: (jid: string) => Promise<void>;
|
|
56
|
-
newsletterReactMessage: (jid: string,
|
|
52
|
+
newsletterReactMessage: (jid: string, server_id: string, code?: string | undefined) => Promise<void>;
|
|
57
53
|
newsletterFetchMessages: (type: "invite" | "jid", key: string, count: number, after?: number | undefined) => Promise<import("../Types").NewsletterFetchedUpdate[]>;
|
|
58
54
|
newsletterFetchUpdates: (jid: string, count: number, after?: number | undefined, since?: number | undefined) => Promise<import("../Types").NewsletterFetchedUpdate[]>;
|
|
59
55
|
groupMetadata: (jid: string) => Promise<import("../Types").GroupMetadata>;
|
|
@@ -76,7 +72,8 @@ export declare const makeMessagesRecvSocket: (config: SocketConfig) => {
|
|
|
76
72
|
groupInviteCode: (jid: string) => Promise<string | undefined>;
|
|
77
73
|
groupRevokeInvite: (jid: string) => Promise<string | undefined>;
|
|
78
74
|
groupAcceptInvite: (code: string) => Promise<string | undefined>;
|
|
79
|
-
|
|
75
|
+
groupRevokeInviteV4: (groupJid: string, invitedJid: string) => Promise<boolean>;
|
|
76
|
+
groupAcceptInviteV4: (key: string | WAMessageKey, inviteMessage: proto.Message.IGroupInviteMessage) => Promise<string>;
|
|
80
77
|
groupGetInviteInfo: (code: string) => Promise<import("../Types").GroupMetadata>;
|
|
81
78
|
groupToggleEphemeral: (jid: string, ephemeralExpiration: number) => Promise<void>;
|
|
82
79
|
groupSettingUpdate: (jid: string, setting: "announcement" | "locked" | "not_announcement" | "unlocked") => Promise<void>;
|
|
@@ -98,26 +95,35 @@ export declare const makeMessagesRecvSocket: (config: SocketConfig) => {
|
|
|
98
95
|
jid: string;
|
|
99
96
|
}[]>;
|
|
100
97
|
fetchBlocklist: () => Promise<string[]>;
|
|
98
|
+
fetchDisappearingDuration: (...jids: string[]) => Promise<{
|
|
99
|
+
user: string;
|
|
100
|
+
duration: number;
|
|
101
|
+
setAt: Date;
|
|
102
|
+
}[]>;
|
|
101
103
|
fetchStatus: (jid: string) => Promise<{
|
|
102
104
|
status: string | undefined;
|
|
103
105
|
setAt: Date;
|
|
104
106
|
} | undefined>;
|
|
105
107
|
updateProfilePicture: (jid: string, content: import("../Types").WAMediaUpload) => Promise<void>;
|
|
108
|
+
updateProfilePictureFull: (jid: any, content: any) => Promise<void>;
|
|
109
|
+
updateProfilePictureFull2: (jid: any, content: any) => Promise<void>;
|
|
106
110
|
removeProfilePicture: (jid: string) => Promise<void>;
|
|
107
111
|
updateProfileStatus: (status: string) => Promise<void>;
|
|
108
112
|
updateProfileName: (name: string) => Promise<void>;
|
|
109
113
|
updateBlockStatus: (jid: string, action: "block" | "unblock") => Promise<void>;
|
|
114
|
+
updateCallPrivacy: (value: import("../Types").WAPrivacyCallValue) => Promise<void>;
|
|
110
115
|
updateLastSeenPrivacy: (value: import("../Types").WAPrivacyValue) => Promise<void>;
|
|
111
116
|
updateOnlinePrivacy: (value: import("../Types").WAPrivacyOnlineValue) => Promise<void>;
|
|
112
117
|
updateProfilePicturePrivacy: (value: import("../Types").WAPrivacyValue) => Promise<void>;
|
|
113
118
|
updateStatusPrivacy: (value: import("../Types").WAPrivacyValue) => Promise<void>;
|
|
114
119
|
updateReadReceiptsPrivacy: (value: import("../Types").WAReadReceiptsValue) => Promise<void>;
|
|
115
|
-
updateGroupsAddPrivacy: (value: import("../Types").
|
|
120
|
+
updateGroupsAddPrivacy: (value: import("../Types").WAPrivacyGroupAddValue) => Promise<void>;
|
|
116
121
|
updateDefaultDisappearingMode: (duration: number) => Promise<void>;
|
|
117
122
|
getBusinessProfile: (jid: string) => Promise<void | import("../Types").WABusinessProfile>;
|
|
118
123
|
resyncAppState: (collections: readonly ("critical_block" | "critical_unblock_low" | "regular_high" | "regular_low" | "regular")[], isInitialSync: boolean) => Promise<void>;
|
|
119
124
|
chatModify: (mod: import("../Types").ChatModification, jid: string) => Promise<void>;
|
|
120
125
|
cleanDirtyBits: (type: "account_sync" | "groups", fromTimestamp?: string | number | undefined) => Promise<void>;
|
|
126
|
+
addLabel: (jid: string, labels: import("../Types/Label").LabelActionBody) => Promise<void>;
|
|
121
127
|
addChatLabel: (jid: string, labelId: string) => Promise<void>;
|
|
122
128
|
removeChatLabel: (jid: string, labelId: string) => Promise<void>;
|
|
123
129
|
addMessageLabel: (jid: string, messageId: string, labelId: string) => Promise<void>;
|
|
@@ -127,7 +133,7 @@ export declare const makeMessagesRecvSocket: (config: SocketConfig) => {
|
|
|
127
133
|
fromMe?: boolean | undefined;
|
|
128
134
|
}[], star: boolean) => Promise<void>;
|
|
129
135
|
type: "md";
|
|
130
|
-
ws:
|
|
136
|
+
ws: import("./Client").WebSocketClient;
|
|
131
137
|
ev: import("../Types").BaileysEventEmitter & {
|
|
132
138
|
process(handler: (events: Partial<import("../Types").BaileysEventMap>) => void | Promise<void>): () => void;
|
|
133
139
|
buffer(): void;
|