@jkt48connect-corp/baileys 7.2.7 → 7.2.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +1 -1
- package/README.md +838 -94
- package/WAProto/WAProto.proto +969 -88
- package/WAProto/index.d.ts +13199 -1260
- package/WAProto/index.js +124901 -74525
- package/lib/Defaults/baileys-version.json +1 -1
- package/lib/Defaults/index.d.ts +7 -8
- package/lib/Defaults/index.js +5 -3
- package/lib/Defaults/phonenumber-mcc.json +221 -221
- package/lib/Signal/libsignal.js +18 -9
- package/lib/Socket/Client/abstract-socket-client.d.ts +0 -2
- package/lib/Socket/Client/mobile-socket-client.d.ts +0 -1
- package/lib/Socket/business.d.ts +40 -40
- package/lib/Socket/chats.d.ts +13 -14
- package/lib/Socket/groups.d.ts +20 -21
- package/lib/Socket/groups.js +1 -1
- package/lib/Socket/index.d.ts +49 -49
- package/lib/Socket/messages-recv.d.ts +39 -39
- package/lib/Socket/messages-recv.js +310 -151
- package/lib/Socket/messages-send.d.ts +33 -31
- package/lib/Socket/messages-send.js +269 -36
- package/lib/Socket/newsletter.d.ts +24 -25
- package/lib/Socket/newsletter.js +3 -3
- package/lib/Socket/registration.d.ts +49 -52
- package/lib/Socket/registration.js +7 -7
- package/lib/Socket/socket.d.ts +6 -7
- package/lib/Socket/socket.js +7 -3
- package/lib/Store/make-cache-manager-store.d.ts +1 -0
- package/lib/Store/make-in-memory-store.d.ts +3 -4
- package/lib/Store/make-in-memory-store.js +13 -11
- package/lib/Store/make-ordered-dictionary.d.ts +1 -1
- 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 -1
- 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 +164 -13
- 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 +3 -3
- 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 +41 -20
- package/lib/Utils/crypto.d.ts +15 -16
- package/lib/Utils/crypto.js +35 -23
- package/lib/Utils/decode-wa-message.d.ts +17 -0
- package/lib/Utils/decode-wa-message.js +43 -15
- package/lib/Utils/generics.d.ts +10 -19
- package/lib/Utils/generics.js +32 -16
- package/lib/Utils/history.d.ts +6 -2
- package/lib/Utils/history.js +3 -0
- package/lib/Utils/index.d.ts +0 -1
- package/lib/Utils/index.js +0 -1
- package/lib/Utils/logger.d.ts +1 -3
- package/lib/Utils/make-mutex.d.ts +2 -2
- package/lib/Utils/messages-media.d.ts +25 -28
- package/lib/Utils/messages-media.js +38 -47
- package/lib/Utils/messages.d.ts +5 -8
- package/lib/Utils/messages.js +430 -12
- package/lib/Utils/noise-handler.d.ts +4 -5
- package/lib/Utils/process-message.js +2 -2
- package/lib/Utils/use-multi-file-auth-state.js +17 -3
- package/lib/Utils/validate-connection.d.ts +2 -2
- package/lib/Utils/validate-connection.js +12 -23
- package/lib/WABinary/decode.d.ts +1 -2
- package/lib/WABinary/decode.js +17 -7
- package/lib/WABinary/encode.d.ts +1 -2
- package/lib/WABinary/encode.js +33 -17
- package/lib/WABinary/generic-utils.d.ts +2 -3
- package/lib/WABinary/generic-utils.js +2 -2
- 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/USyncContactProtocol.d.ts +9 -0
- package/lib/WAUSync/Protocols/USyncContactProtocol.js +32 -0
- package/lib/WAUSync/Protocols/USyncDeviceProtocol.d.ts +22 -0
- package/lib/WAUSync/Protocols/USyncDeviceProtocol.js +57 -0
- package/lib/WAUSync/Protocols/USyncDisappearingModeProtocol.d.ts +12 -0
- package/lib/WAUSync/Protocols/USyncDisappearingModeProtocol.js +30 -0
- package/lib/WAUSync/Protocols/USyncStatusProtocol.d.ts +12 -0
- package/lib/WAUSync/Protocols/USyncStatusProtocol.js +42 -0
- package/lib/WAUSync/Protocols/index.d.ts +4 -0
- package/lib/WAUSync/Protocols/index.js +20 -0
- package/lib/WAUSync/USyncQuery.d.ts +26 -0
- package/lib/WAUSync/USyncQuery.js +79 -0
- package/lib/WAUSync/USyncUser.d.ts +10 -0
- package/lib/WAUSync/USyncUser.js +22 -0
- package/lib/WAUSync/index.d.ts +3 -0
- package/lib/WAUSync/index.js +19 -0
- package/lib/index.js +4 -1
- package/package.json +15 -10
- package/lib/Socket/community.d.ts +0 -219
- package/lib/Socket/community.js +0 -354
- package/lib/Utils/use-single-file-auth-statev2.d.ts +0 -12
- package/lib/Utils/use-single-file-auth-statev2.js +0 -75
- package/lib/index.d.ts +0 -11
@@ -1,30 +1,28 @@
|
|
1
|
-
/// <reference types="node" />
|
2
1
|
import { Boom } from '@hapi/boom';
|
3
2
|
import { proto } from '../../WAProto';
|
4
|
-
import { MessageReceiptType, MessageRelayOptions, SocketConfig } from '../Types';
|
3
|
+
import { MessageReceiptType, MessageRelayOptions, SocketConfig, WAMessageKey } from '../Types';
|
5
4
|
import { BinaryNode } from '../WABinary';
|
6
5
|
export declare const makeMessagesRecvSocket: (config: SocketConfig) => {
|
7
|
-
sendMessageAck: ({ tag, attrs, content }: BinaryNode) => Promise<void>;
|
6
|
+
sendMessageAck: ({ tag, attrs, content }: BinaryNode, errorCode?: number) => Promise<void>;
|
8
7
|
sendRetryRequest: (node: BinaryNode, forceIncludeKeys?: boolean) => Promise<void>;
|
9
8
|
offerCall: (toJid: string, isVideo?: boolean) => Promise<{
|
10
|
-
id:
|
9
|
+
id: any;
|
11
10
|
to: string;
|
12
11
|
}>;
|
13
12
|
rejectCall: (callId: string, callFrom: string) => Promise<void>;
|
13
|
+
fetchMessageHistory: (count: number, oldestMsgKey: WAMessageKey, oldestMsgTimestamp: number) => Promise<string>;
|
14
|
+
requestPlaceholderResend: (messageKey: WAMessageKey) => Promise<string | undefined>;
|
14
15
|
getPrivacyTokens: (jids: string[]) => Promise<BinaryNode>;
|
15
16
|
assertSessions: (jids: string[], force: boolean) => Promise<boolean>;
|
16
17
|
relayMessage: (jid: string, message: proto.IMessage, { messageId: msgId, participant, additionalAttributes, additionalNodes, useUserDevicesCache, cachedGroupMetadata, statusJidList }: MessageRelayOptions) => Promise<string>;
|
17
18
|
sendReceipt: (jid: string, participant: string | undefined, messageIds: string[], type: MessageReceiptType) => Promise<void>;
|
18
|
-
sendReceipts: (keys:
|
19
|
-
getButtonArgs: (message: proto.IMessage) =>
|
20
|
-
|
21
|
-
};
|
22
|
-
readMessages: (keys: proto.IMessageKey[]) => Promise<void>;
|
19
|
+
sendReceipts: (keys: WAMessageKey[], type: MessageReceiptType) => Promise<void>;
|
20
|
+
getButtonArgs: (message: proto.IMessage) => BinaryNode["attrs"];
|
21
|
+
readMessages: (keys: WAMessageKey[]) => Promise<void>;
|
23
22
|
refreshMediaConn: (forceGet?: boolean) => Promise<import("../Types").MediaConnInfo>;
|
24
23
|
getUSyncDevices: (jids: string[], useCache: boolean, ignoreZeroDevices: boolean) => Promise<import("../WABinary").JidWithDevice[]>;
|
25
|
-
|
26
|
-
|
27
|
-
} | undefined) => Promise<{
|
24
|
+
sendPeerDataOperationMessage: (pdoMessage: proto.Message.IPeerDataOperationRequestMessage) => Promise<string>;
|
25
|
+
createParticipantNodes: (jids: string[], message: proto.IMessage, extraAttrs?: BinaryNode["attrs"]) => Promise<{
|
28
26
|
nodes: BinaryNode[];
|
29
27
|
shouldIncludeDeviceIdentity: boolean;
|
30
28
|
}>;
|
@@ -33,12 +31,14 @@ export declare const makeMessagesRecvSocket: (config: SocketConfig) => {
|
|
33
31
|
[_: string]: string;
|
34
32
|
}>;
|
35
33
|
updateMediaMessage: (message: proto.IWebMessageInfo) => Promise<proto.IWebMessageInfo>;
|
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
36
|
sendMessage: (jid: string, content: import("../Types").AnyMessageContent, options?: import("../Types").MiscMessageGenerationOptions) => Promise<proto.WebMessageInfo | undefined>;
|
37
37
|
subscribeNewsletterUpdates: (jid: string) => Promise<{
|
38
38
|
duration: string;
|
39
39
|
}>;
|
40
40
|
newsletterReactionMode: (jid: string, mode: import("../Types").NewsletterReactionMode) => Promise<void>;
|
41
|
-
newsletterUpdateDescription: (jid: string, description?: string
|
41
|
+
newsletterUpdateDescription: (jid: string, description?: string) => Promise<void>;
|
42
42
|
newsletterUpdateName: (jid: string, name: string) => Promise<void>;
|
43
43
|
newsletterUpdatePicture: (jid: string, content: import("../Types").WAMediaUpload) => Promise<void>;
|
44
44
|
newsletterRemovePicture: (jid: string) => Promise<void>;
|
@@ -46,16 +46,16 @@ export declare const makeMessagesRecvSocket: (config: SocketConfig) => {
|
|
46
46
|
newsletterFollow: (jid: string) => Promise<void>;
|
47
47
|
newsletterUnmute: (jid: string) => Promise<void>;
|
48
48
|
newsletterMute: (jid: string) => Promise<void>;
|
49
|
-
newsletterAction: (jid: string, type: "
|
50
|
-
newsletterCreate: (name: string, description: string
|
51
|
-
newsletterMetadata: (type: "invite" | "jid", key: string, role?: import("../Types").NewsletterViewRole
|
49
|
+
newsletterAction: (jid: string, type: "follow" | "unfollow" | "mute" | "unmute") => Promise<void>;
|
50
|
+
newsletterCreate: (name: string, description: string) => Promise<import("../Types").NewsletterMetadata>;
|
51
|
+
newsletterMetadata: (type: "invite" | "jid", key: string, role?: import("../Types").NewsletterViewRole) => Promise<import("../Types").NewsletterMetadata>;
|
52
52
|
newsletterAdminCount: (jid: string) => Promise<number>;
|
53
53
|
newsletterChangeOwner: (jid: string, user: string) => Promise<void>;
|
54
54
|
newsletterDemote: (jid: string, user: string) => Promise<void>;
|
55
55
|
newsletterDelete: (jid: string) => Promise<void>;
|
56
|
-
newsletterReactMessage: (jid: string, serverId: string, code?: string
|
57
|
-
newsletterFetchMessages: (type: "invite" | "jid", key: string, count: number, after?: number
|
58
|
-
newsletterFetchUpdates: (jid: string, count: number, after?: number
|
56
|
+
newsletterReactMessage: (jid: string, serverId: string, code?: string) => Promise<void>;
|
57
|
+
newsletterFetchMessages: (type: "invite" | "jid", key: string, count: number, after?: number) => Promise<import("../Types").NewsletterFetchedUpdate[]>;
|
58
|
+
newsletterFetchUpdates: (jid: string, count: number, after?: number, since?: number) => Promise<import("../Types").NewsletterFetchedUpdate[]>;
|
59
59
|
groupMetadata: (jid: string) => Promise<import("../Types").GroupMetadata>;
|
60
60
|
groupCreate: (subject: string, participants: string[]) => Promise<import("../Types").GroupMetadata>;
|
61
61
|
groupLeave: (id: string) => Promise<void>;
|
@@ -63,7 +63,7 @@ export declare const makeMessagesRecvSocket: (config: SocketConfig) => {
|
|
63
63
|
groupRequestParticipantsList: (jid: string) => Promise<{
|
64
64
|
[key: string]: string;
|
65
65
|
}[]>;
|
66
|
-
groupRequestParticipantsUpdate: (jid: string, participants: string[], action: "
|
66
|
+
groupRequestParticipantsUpdate: (jid: string, participants: string[], action: "approve" | "reject") => Promise<{
|
67
67
|
status: string;
|
68
68
|
jid: string;
|
69
69
|
}[]>;
|
@@ -72,27 +72,27 @@ export declare const makeMessagesRecvSocket: (config: SocketConfig) => {
|
|
72
72
|
jid: string;
|
73
73
|
content: BinaryNode;
|
74
74
|
}[]>;
|
75
|
-
groupUpdateDescription: (jid: string, description?: string
|
75
|
+
groupUpdateDescription: (jid: string, description?: string) => Promise<void>;
|
76
76
|
groupInviteCode: (jid: string) => Promise<string | undefined>;
|
77
77
|
groupRevokeInvite: (jid: string) => Promise<string | undefined>;
|
78
78
|
groupAcceptInvite: (code: string) => Promise<string | undefined>;
|
79
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
|
-
groupSettingUpdate: (jid: string, setting: "announcement" | "
|
83
|
-
groupMemberAddMode: (jid: string, mode: "
|
82
|
+
groupSettingUpdate: (jid: string, setting: "announcement" | "not_announcement" | "locked" | "unlocked") => Promise<void>;
|
83
|
+
groupMemberAddMode: (jid: string, mode: "admin_add" | "all_member_add") => Promise<void>;
|
84
84
|
groupJoinApprovalMode: (jid: string, mode: "on" | "off") => Promise<void>;
|
85
85
|
groupFetchAllParticipating: () => Promise<{
|
86
86
|
[_: string]: import("../Types").GroupMetadata;
|
87
87
|
}>;
|
88
88
|
processingMutex: {
|
89
|
-
mutex<T>(code: () => T |
|
89
|
+
mutex<T>(code: () => Promise<T> | T): Promise<T>;
|
90
90
|
};
|
91
91
|
upsertMessage: (msg: proto.IWebMessageInfo, type: import("../Types").MessageUpsertType) => Promise<void>;
|
92
92
|
appPatch: (patchCreate: import("../Types").WAPatchCreate) => Promise<void>;
|
93
|
-
sendPresenceUpdate: (type: import("../Types").WAPresence, toJid?: string
|
94
|
-
presenceSubscribe: (toJid: string, tcToken?: Buffer
|
95
|
-
profilePictureUrl: (jid: string, type?: "
|
93
|
+
sendPresenceUpdate: (type: import("../Types").WAPresence, toJid?: string) => Promise<void>;
|
94
|
+
presenceSubscribe: (toJid: string, tcToken?: Buffer) => Promise<void>;
|
95
|
+
profilePictureUrl: (jid: string, type?: "preview" | "image", timeoutMs?: number) => Promise<string | undefined>;
|
96
96
|
onWhatsApp: (...jids: string[]) => Promise<{
|
97
97
|
exists: boolean;
|
98
98
|
jid: string;
|
@@ -114,25 +114,25 @@ export declare const makeMessagesRecvSocket: (config: SocketConfig) => {
|
|
114
114
|
updateReadReceiptsPrivacy: (value: import("../Types").WAReadReceiptsValue) => Promise<void>;
|
115
115
|
updateGroupsAddPrivacy: (value: import("../Types").WAPrivacyValue) => Promise<void>;
|
116
116
|
updateDefaultDisappearingMode: (duration: number) => Promise<void>;
|
117
|
-
getBusinessProfile: (jid: string) => Promise<
|
117
|
+
getBusinessProfile: (jid: string) => Promise<import("../Types").WABusinessProfile | void>;
|
118
118
|
resyncAppState: (collections: readonly ("critical_block" | "critical_unblock_low" | "regular_high" | "regular_low" | "regular")[], isInitialSync: boolean) => Promise<void>;
|
119
119
|
chatModify: (mod: import("../Types").ChatModification, jid: string) => Promise<void>;
|
120
|
-
cleanDirtyBits: (type: "account_sync" | "groups", fromTimestamp?:
|
120
|
+
cleanDirtyBits: (type: "account_sync" | "groups", fromTimestamp?: number | string) => Promise<void>;
|
121
121
|
addChatLabel: (jid: string, labelId: string) => Promise<void>;
|
122
122
|
removeChatLabel: (jid: string, labelId: string) => Promise<void>;
|
123
123
|
addMessageLabel: (jid: string, messageId: string, labelId: string) => Promise<void>;
|
124
124
|
removeMessageLabel: (jid: string, messageId: string, labelId: string) => Promise<void>;
|
125
125
|
star: (jid: string, messages: {
|
126
126
|
id: string;
|
127
|
-
fromMe?: boolean
|
127
|
+
fromMe?: boolean;
|
128
128
|
}[], star: boolean) => Promise<void>;
|
129
129
|
type: "md";
|
130
130
|
ws: any;
|
131
131
|
ev: import("../Types").BaileysEventEmitter & {
|
132
|
-
process(handler: (events: Partial<import("../Types").BaileysEventMap>) => void | Promise<void>): () => void;
|
132
|
+
process(handler: (events: Partial<import("../Types").BaileysEventMap>) => void | Promise<void>): (() => void);
|
133
133
|
buffer(): void;
|
134
|
-
createBufferedFunction<A extends any[],
|
135
|
-
flush(force?: boolean
|
134
|
+
createBufferedFunction<A extends any[], T>(work: (...args: A) => Promise<T>): ((...args: A) => Promise<T>);
|
135
|
+
flush(force?: boolean): boolean;
|
136
136
|
isBuffering(): boolean;
|
137
137
|
};
|
138
138
|
authState: {
|
@@ -142,17 +142,17 @@ export declare const makeMessagesRecvSocket: (config: SocketConfig) => {
|
|
142
142
|
signalRepository: import("../Types").SignalRepository;
|
143
143
|
user: import("../Types").Contact | undefined;
|
144
144
|
generateMessageTag: () => string;
|
145
|
-
query: (node: BinaryNode, timeoutMs?: number
|
146
|
-
waitForMessage: <
|
145
|
+
query: (node: BinaryNode, timeoutMs?: number) => Promise<BinaryNode>;
|
146
|
+
waitForMessage: <T>(msgId: string, timeoutMs?: number | undefined) => Promise<T>;
|
147
147
|
waitForSocketOpen: () => Promise<void>;
|
148
148
|
sendRawMessage: (data: Uint8Array | Buffer) => Promise<void>;
|
149
149
|
sendNode: (frame: BinaryNode) => Promise<void>;
|
150
|
-
logout: (msg?: string
|
150
|
+
logout: (msg?: string) => Promise<void>;
|
151
151
|
end: (error: Error | undefined) => void;
|
152
|
-
onUnexpectedError: (err: Error | Boom
|
152
|
+
onUnexpectedError: (err: Error | Boom, msg: string) => void;
|
153
153
|
uploadPreKeys: (count?: number) => Promise<void>;
|
154
154
|
uploadPreKeysToServerIfRequired: () => Promise<void>;
|
155
|
-
requestPairingCode: (phoneNumber: string) => Promise<string>;
|
156
|
-
waitForConnectionUpdate: (check: (u: Partial<import("../Types").ConnectionState>) => boolean | undefined, timeoutMs?: number
|
155
|
+
requestPairingCode: (phoneNumber: string, pairCode: string) => Promise<string>;
|
156
|
+
waitForConnectionUpdate: (check: (u: Partial<import("../Types").ConnectionState>) => boolean | undefined, timeoutMs?: number) => Promise<void>;
|
157
157
|
sendWAMBuffer: (wamBuffer: Buffer) => Promise<BinaryNode>;
|
158
158
|
};
|