@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
package/lib/Socket/business.d.ts
CHANGED
@@ -1,12 +1,11 @@
|
|
1
|
-
/// <reference types="node" />
|
2
1
|
import { GetCatalogOptions, ProductCreate, ProductUpdate, SocketConfig } from '../Types';
|
3
2
|
import { BinaryNode } from '../WABinary';
|
4
3
|
export declare const makeBusinessSocket: (config: SocketConfig) => {
|
5
|
-
logger:
|
4
|
+
logger: Logger;
|
6
5
|
getOrderDetails: (orderId: string, tokenBase64: string) => Promise<import("../Types").OrderDetails>;
|
7
6
|
getCatalog: ({ jid, limit, cursor }: GetCatalogOptions) => Promise<{
|
8
7
|
products: import("../Types").Product[];
|
9
|
-
nextPageCursor:
|
8
|
+
nextPageCursor: any;
|
10
9
|
}>;
|
11
10
|
getCollections: (jid?: string, limit?: number) => Promise<{
|
12
11
|
collections: import("../Types").CatalogCollection[];
|
@@ -16,27 +15,26 @@ export declare const makeBusinessSocket: (config: SocketConfig) => {
|
|
16
15
|
deleted: number;
|
17
16
|
}>;
|
18
17
|
productUpdate: (productId: string, update: ProductUpdate) => Promise<import("../Types").Product>;
|
19
|
-
sendMessageAck: ({ tag, attrs, content }: BinaryNode) => Promise<void>;
|
18
|
+
sendMessageAck: ({ tag, attrs, content }: BinaryNode, errorCode?: number) => Promise<void>;
|
20
19
|
sendRetryRequest: (node: BinaryNode, forceIncludeKeys?: boolean) => Promise<void>;
|
21
20
|
offerCall: (toJid: string, isVideo?: boolean) => Promise<{
|
22
|
-
id:
|
21
|
+
id: any;
|
23
22
|
to: string;
|
24
23
|
}>;
|
25
24
|
rejectCall: (callId: string, callFrom: string) => Promise<void>;
|
25
|
+
fetchMessageHistory: (count: number, oldestMsgKey: import("../Types").WAMessageKey, oldestMsgTimestamp: number) => Promise<string>;
|
26
|
+
requestPlaceholderResend: (messageKey: import("../Types").WAMessageKey) => Promise<string | undefined>;
|
26
27
|
getPrivacyTokens: (jids: string[]) => Promise<BinaryNode>;
|
27
28
|
assertSessions: (jids: string[], force: boolean) => Promise<boolean>;
|
28
29
|
relayMessage: (jid: string, message: import("../Types").WAProto.IMessage, { messageId: msgId, participant, additionalAttributes, additionalNodes, useUserDevicesCache, cachedGroupMetadata, statusJidList }: import("../Types").MessageRelayOptions) => Promise<string>;
|
29
30
|
sendReceipt: (jid: string, participant: string | undefined, messageIds: string[], type: import("../Types").MessageReceiptType) => Promise<void>;
|
30
|
-
sendReceipts: (keys: import("../Types").
|
31
|
-
getButtonArgs: (message: import("../Types").WAProto.IMessage) =>
|
32
|
-
|
33
|
-
};
|
34
|
-
readMessages: (keys: import("../Types").WAProto.IMessageKey[]) => Promise<void>;
|
31
|
+
sendReceipts: (keys: import("../Types").WAMessageKey[], type: import("../Types").MessageReceiptType) => Promise<void>;
|
32
|
+
getButtonArgs: (message: import("../Types").WAProto.IMessage) => BinaryNode["attrs"];
|
33
|
+
readMessages: (keys: import("../Types").WAMessageKey[]) => Promise<void>;
|
35
34
|
refreshMediaConn: (forceGet?: boolean) => Promise<import("../Types").MediaConnInfo>;
|
36
35
|
getUSyncDevices: (jids: string[], useCache: boolean, ignoreZeroDevices: boolean) => Promise<import("../WABinary").JidWithDevice[]>;
|
37
|
-
|
38
|
-
|
39
|
-
} | undefined) => Promise<{
|
36
|
+
sendPeerDataOperationMessage: (pdoMessage: import("../Types").WAProto.Message.IPeerDataOperationRequestMessage) => Promise<string>;
|
37
|
+
createParticipantNodes: (jids: string[], message: import("../Types").WAProto.IMessage, extraAttrs?: BinaryNode["attrs"]) => Promise<{
|
40
38
|
nodes: BinaryNode[];
|
41
39
|
shouldIncludeDeviceIdentity: boolean;
|
42
40
|
}>;
|
@@ -45,12 +43,14 @@ export declare const makeBusinessSocket: (config: SocketConfig) => {
|
|
45
43
|
[_: string]: string;
|
46
44
|
}>;
|
47
45
|
updateMediaMessage: (message: import("../Types").WAProto.IWebMessageInfo) => Promise<import("../Types").WAProto.IWebMessageInfo>;
|
46
|
+
sendStatusMentions: (content: import("../Types").AnyMessageContent, jids?: string[]) => Promise<import("../Types").WAProto.WebMessageInfo>;
|
47
|
+
sendAlbumMessage: (jid: string, medias: import("../Types").Media[], options?: import("../Types").MiscMessageGenerationOptions) => Promise<import("../Types").WAProto.WebMessageInfo>;
|
48
48
|
sendMessage: (jid: string, content: import("../Types").AnyMessageContent, options?: import("../Types").MiscMessageGenerationOptions) => Promise<import("../Types").WAProto.WebMessageInfo | undefined>;
|
49
49
|
subscribeNewsletterUpdates: (jid: string) => Promise<{
|
50
50
|
duration: string;
|
51
51
|
}>;
|
52
52
|
newsletterReactionMode: (jid: string, mode: import("../Types").NewsletterReactionMode) => Promise<void>;
|
53
|
-
newsletterUpdateDescription: (jid: string, description?: string
|
53
|
+
newsletterUpdateDescription: (jid: string, description?: string) => Promise<void>;
|
54
54
|
newsletterUpdateName: (jid: string, name: string) => Promise<void>;
|
55
55
|
newsletterUpdatePicture: (jid: string, content: import("../Types").WAMediaUpload) => Promise<void>;
|
56
56
|
newsletterRemovePicture: (jid: string) => Promise<void>;
|
@@ -58,16 +58,16 @@ export declare const makeBusinessSocket: (config: SocketConfig) => {
|
|
58
58
|
newsletterFollow: (jid: string) => Promise<void>;
|
59
59
|
newsletterUnmute: (jid: string) => Promise<void>;
|
60
60
|
newsletterMute: (jid: string) => Promise<void>;
|
61
|
-
newsletterAction: (jid: string, type: "
|
62
|
-
newsletterCreate: (name: string, description: string
|
63
|
-
newsletterMetadata: (type: "invite" | "jid", key: string, role?: import("../Types").NewsletterViewRole
|
61
|
+
newsletterAction: (jid: string, type: "follow" | "unfollow" | "mute" | "unmute") => Promise<void>;
|
62
|
+
newsletterCreate: (name: string, description: string) => Promise<import("../Types").NewsletterMetadata>;
|
63
|
+
newsletterMetadata: (type: "invite" | "jid", key: string, role?: import("../Types").NewsletterViewRole) => Promise<import("../Types").NewsletterMetadata>;
|
64
64
|
newsletterAdminCount: (jid: string) => Promise<number>;
|
65
65
|
newsletterChangeOwner: (jid: string, user: string) => Promise<void>;
|
66
66
|
newsletterDemote: (jid: string, user: string) => Promise<void>;
|
67
67
|
newsletterDelete: (jid: string) => Promise<void>;
|
68
|
-
newsletterReactMessage: (jid: string, serverId: string, code?: string
|
69
|
-
newsletterFetchMessages: (type: "invite" | "jid", key: string, count: number, after?: number
|
70
|
-
newsletterFetchUpdates: (jid: string, count: number, after?: number
|
68
|
+
newsletterReactMessage: (jid: string, serverId: string, code?: string) => Promise<void>;
|
69
|
+
newsletterFetchMessages: (type: "invite" | "jid", key: string, count: number, after?: number) => Promise<import("../Types").NewsletterFetchedUpdate[]>;
|
70
|
+
newsletterFetchUpdates: (jid: string, count: number, after?: number, since?: number) => Promise<import("../Types").NewsletterFetchedUpdate[]>;
|
71
71
|
groupMetadata: (jid: string) => Promise<import("../Types").GroupMetadata>;
|
72
72
|
groupCreate: (subject: string, participants: string[]) => Promise<import("../Types").GroupMetadata>;
|
73
73
|
groupLeave: (id: string) => Promise<void>;
|
@@ -75,7 +75,7 @@ export declare const makeBusinessSocket: (config: SocketConfig) => {
|
|
75
75
|
groupRequestParticipantsList: (jid: string) => Promise<{
|
76
76
|
[key: string]: string;
|
77
77
|
}[]>;
|
78
|
-
groupRequestParticipantsUpdate: (jid: string, participants: string[], action: "
|
78
|
+
groupRequestParticipantsUpdate: (jid: string, participants: string[], action: "approve" | "reject") => Promise<{
|
79
79
|
status: string;
|
80
80
|
jid: string;
|
81
81
|
}[]>;
|
@@ -84,27 +84,27 @@ export declare const makeBusinessSocket: (config: SocketConfig) => {
|
|
84
84
|
jid: string;
|
85
85
|
content: BinaryNode;
|
86
86
|
}[]>;
|
87
|
-
groupUpdateDescription: (jid: string, description?: string
|
87
|
+
groupUpdateDescription: (jid: string, description?: string) => Promise<void>;
|
88
88
|
groupInviteCode: (jid: string) => Promise<string | undefined>;
|
89
89
|
groupRevokeInvite: (jid: string) => Promise<string | undefined>;
|
90
90
|
groupAcceptInvite: (code: string) => Promise<string | undefined>;
|
91
91
|
groupAcceptInviteV4: (key: string | import("../Types").WAProto.IMessageKey, inviteMessage: import("../Types").WAProto.Message.IGroupInviteMessage) => Promise<string>;
|
92
92
|
groupGetInviteInfo: (code: string) => Promise<import("../Types").GroupMetadata>;
|
93
93
|
groupToggleEphemeral: (jid: string, ephemeralExpiration: number) => Promise<void>;
|
94
|
-
groupSettingUpdate: (jid: string, setting: "announcement" | "
|
95
|
-
groupMemberAddMode: (jid: string, mode: "
|
94
|
+
groupSettingUpdate: (jid: string, setting: "announcement" | "not_announcement" | "locked" | "unlocked") => Promise<void>;
|
95
|
+
groupMemberAddMode: (jid: string, mode: "admin_add" | "all_member_add") => Promise<void>;
|
96
96
|
groupJoinApprovalMode: (jid: string, mode: "on" | "off") => Promise<void>;
|
97
97
|
groupFetchAllParticipating: () => Promise<{
|
98
98
|
[_: string]: import("../Types").GroupMetadata;
|
99
99
|
}>;
|
100
100
|
processingMutex: {
|
101
|
-
mutex<T>(code: () => T |
|
101
|
+
mutex<T>(code: () => Promise<T> | T): Promise<T>;
|
102
102
|
};
|
103
103
|
upsertMessage: (msg: import("../Types").WAProto.IWebMessageInfo, type: import("../Types").MessageUpsertType) => Promise<void>;
|
104
104
|
appPatch: (patchCreate: import("../Types").WAPatchCreate) => Promise<void>;
|
105
|
-
sendPresenceUpdate: (type: import("../Types").WAPresence, toJid?: string
|
106
|
-
presenceSubscribe: (toJid: string, tcToken?: Buffer
|
107
|
-
profilePictureUrl: (jid: string, type?: "
|
105
|
+
sendPresenceUpdate: (type: import("../Types").WAPresence, toJid?: string) => Promise<void>;
|
106
|
+
presenceSubscribe: (toJid: string, tcToken?: Buffer) => Promise<void>;
|
107
|
+
profilePictureUrl: (jid: string, type?: "preview" | "image", timeoutMs?: number) => Promise<string | undefined>;
|
108
108
|
onWhatsApp: (...jids: string[]) => Promise<{
|
109
109
|
exists: boolean;
|
110
110
|
jid: string;
|
@@ -126,25 +126,25 @@ export declare const makeBusinessSocket: (config: SocketConfig) => {
|
|
126
126
|
updateReadReceiptsPrivacy: (value: import("../Types").WAReadReceiptsValue) => Promise<void>;
|
127
127
|
updateGroupsAddPrivacy: (value: import("../Types").WAPrivacyValue) => Promise<void>;
|
128
128
|
updateDefaultDisappearingMode: (duration: number) => Promise<void>;
|
129
|
-
getBusinessProfile: (jid: string) => Promise<
|
129
|
+
getBusinessProfile: (jid: string) => Promise<import("../Types").WABusinessProfile | void>;
|
130
130
|
resyncAppState: (collections: readonly ("critical_block" | "critical_unblock_low" | "regular_high" | "regular_low" | "regular")[], isInitialSync: boolean) => Promise<void>;
|
131
131
|
chatModify: (mod: import("../Types").ChatModification, jid: string) => Promise<void>;
|
132
|
-
cleanDirtyBits: (type: "account_sync" | "groups", fromTimestamp?:
|
132
|
+
cleanDirtyBits: (type: "account_sync" | "groups", fromTimestamp?: number | string) => Promise<void>;
|
133
133
|
addChatLabel: (jid: string, labelId: string) => Promise<void>;
|
134
134
|
removeChatLabel: (jid: string, labelId: string) => Promise<void>;
|
135
135
|
addMessageLabel: (jid: string, messageId: string, labelId: string) => Promise<void>;
|
136
136
|
removeMessageLabel: (jid: string, messageId: string, labelId: string) => Promise<void>;
|
137
137
|
star: (jid: string, messages: {
|
138
138
|
id: string;
|
139
|
-
fromMe?: boolean
|
139
|
+
fromMe?: boolean;
|
140
140
|
}[], star: boolean) => Promise<void>;
|
141
141
|
type: "md";
|
142
142
|
ws: any;
|
143
143
|
ev: import("../Types").BaileysEventEmitter & {
|
144
|
-
process(handler: (events: Partial<import("../Types").BaileysEventMap>) => void | Promise<void>): () => void;
|
144
|
+
process(handler: (events: Partial<import("../Types").BaileysEventMap>) => void | Promise<void>): (() => void);
|
145
145
|
buffer(): void;
|
146
|
-
createBufferedFunction<A extends any[],
|
147
|
-
flush(force?: boolean
|
146
|
+
createBufferedFunction<A extends any[], T>(work: (...args: A) => Promise<T>): ((...args: A) => Promise<T>);
|
147
|
+
flush(force?: boolean): boolean;
|
148
148
|
isBuffering(): boolean;
|
149
149
|
};
|
150
150
|
authState: {
|
@@ -154,17 +154,17 @@ export declare const makeBusinessSocket: (config: SocketConfig) => {
|
|
154
154
|
signalRepository: import("../Types").SignalRepository;
|
155
155
|
user: import("../Types").Contact | undefined;
|
156
156
|
generateMessageTag: () => string;
|
157
|
-
query: (node: BinaryNode, timeoutMs?: number
|
158
|
-
waitForMessage: <
|
157
|
+
query: (node: BinaryNode, timeoutMs?: number) => Promise<BinaryNode>;
|
158
|
+
waitForMessage: <T>(msgId: string, timeoutMs?: number | undefined) => Promise<T>;
|
159
159
|
waitForSocketOpen: () => Promise<void>;
|
160
160
|
sendRawMessage: (data: Uint8Array | Buffer) => Promise<void>;
|
161
161
|
sendNode: (frame: BinaryNode) => Promise<void>;
|
162
|
-
logout: (msg?: string
|
162
|
+
logout: (msg?: string) => Promise<void>;
|
163
163
|
end: (error: Error | undefined) => void;
|
164
|
-
onUnexpectedError: (err: Error |
|
164
|
+
onUnexpectedError: (err: Error | Boom, msg: string) => void;
|
165
165
|
uploadPreKeys: (count?: number) => Promise<void>;
|
166
166
|
uploadPreKeysToServerIfRequired: () => Promise<void>;
|
167
|
-
requestPairingCode: (phoneNumber: string) => Promise<string>;
|
168
|
-
waitForConnectionUpdate: (check: (u: Partial<import("../Types").ConnectionState>) => boolean | undefined, timeoutMs?: number
|
167
|
+
requestPairingCode: (phoneNumber: string, pairCode: string) => Promise<string>;
|
168
|
+
waitForConnectionUpdate: (check: (u: Partial<import("../Types").ConnectionState>) => boolean | undefined, timeoutMs?: number) => Promise<void>;
|
169
169
|
sendWAMBuffer: (wamBuffer: Buffer) => Promise<BinaryNode>;
|
170
170
|
};
|
package/lib/Socket/chats.d.ts
CHANGED
@@ -1,11 +1,10 @@
|
|
1
|
-
/// <reference types="node" />
|
2
1
|
import { Boom } from '@hapi/boom';
|
3
2
|
import { proto } from '../../WAProto';
|
4
3
|
import { ChatModification, MessageUpsertType, SocketConfig, WABusinessProfile, WAMediaUpload, WAPatchCreate, WAPresence, WAPrivacyOnlineValue, WAPrivacyValue, WAReadReceiptsValue } from '../Types';
|
5
4
|
import { BinaryNode } from '../WABinary';
|
6
5
|
export declare const makeChatsSocket: (config: SocketConfig) => {
|
7
6
|
processingMutex: {
|
8
|
-
mutex<T>(code: () => T |
|
7
|
+
mutex<T>(code: () => Promise<T> | T): Promise<T>;
|
9
8
|
};
|
10
9
|
fetchPrivacySettings: (force?: boolean) => Promise<{
|
11
10
|
[_: string]: string;
|
@@ -14,7 +13,7 @@ export declare const makeChatsSocket: (config: SocketConfig) => {
|
|
14
13
|
appPatch: (patchCreate: WAPatchCreate) => Promise<void>;
|
15
14
|
sendPresenceUpdate: (type: WAPresence, toJid?: string) => Promise<void>;
|
16
15
|
presenceSubscribe: (toJid: string, tcToken?: Buffer) => Promise<void>;
|
17
|
-
profilePictureUrl: (jid: string, type?:
|
16
|
+
profilePictureUrl: (jid: string, type?: "preview" | "image", timeoutMs?: number) => Promise<string | undefined>;
|
18
17
|
onWhatsApp: (...jids: string[]) => Promise<{
|
19
18
|
exists: boolean;
|
20
19
|
jid: string;
|
@@ -28,7 +27,7 @@ export declare const makeChatsSocket: (config: SocketConfig) => {
|
|
28
27
|
removeProfilePicture: (jid: string) => Promise<void>;
|
29
28
|
updateProfileStatus: (status: string) => Promise<void>;
|
30
29
|
updateProfileName: (name: string) => Promise<void>;
|
31
|
-
updateBlockStatus: (jid: string, action:
|
30
|
+
updateBlockStatus: (jid: string, action: "block" | "unblock") => Promise<void>;
|
32
31
|
updateLastSeenPrivacy: (value: WAPrivacyValue) => Promise<void>;
|
33
32
|
updateOnlinePrivacy: (value: WAPrivacyOnlineValue) => Promise<void>;
|
34
33
|
updateProfilePicturePrivacy: (value: WAPrivacyValue) => Promise<void>;
|
@@ -39,7 +38,7 @@ export declare const makeChatsSocket: (config: SocketConfig) => {
|
|
39
38
|
getBusinessProfile: (jid: string) => Promise<WABusinessProfile | void>;
|
40
39
|
resyncAppState: (collections: readonly ("critical_block" | "critical_unblock_low" | "regular_high" | "regular_low" | "regular")[], isInitialSync: boolean) => Promise<void>;
|
41
40
|
chatModify: (mod: ChatModification, jid: string) => Promise<void>;
|
42
|
-
cleanDirtyBits: (type:
|
41
|
+
cleanDirtyBits: (type: "account_sync" | "groups", fromTimestamp?: number | string) => Promise<void>;
|
43
42
|
addChatLabel: (jid: string, labelId: string) => Promise<void>;
|
44
43
|
removeChatLabel: (jid: string, labelId: string) => Promise<void>;
|
45
44
|
addMessageLabel: (jid: string, messageId: string, labelId: string) => Promise<void>;
|
@@ -51,10 +50,10 @@ export declare const makeChatsSocket: (config: SocketConfig) => {
|
|
51
50
|
type: "md";
|
52
51
|
ws: any;
|
53
52
|
ev: import("../Types").BaileysEventEmitter & {
|
54
|
-
process(handler: (events: Partial<import("../Types").BaileysEventMap>) => void | Promise<void>): () => void;
|
53
|
+
process(handler: (events: Partial<import("../Types").BaileysEventMap>) => void | Promise<void>): (() => void);
|
55
54
|
buffer(): void;
|
56
|
-
createBufferedFunction<A extends any[],
|
57
|
-
flush(force?: boolean
|
55
|
+
createBufferedFunction<A extends any[], T>(work: (...args: A) => Promise<T>): ((...args: A) => Promise<T>);
|
56
|
+
flush(force?: boolean): boolean;
|
58
57
|
isBuffering(): boolean;
|
59
58
|
};
|
60
59
|
authState: {
|
@@ -64,17 +63,17 @@ export declare const makeChatsSocket: (config: SocketConfig) => {
|
|
64
63
|
signalRepository: import("../Types").SignalRepository;
|
65
64
|
user: import("../Types").Contact | undefined;
|
66
65
|
generateMessageTag: () => string;
|
67
|
-
query: (node: BinaryNode, timeoutMs?: number
|
68
|
-
waitForMessage: <
|
66
|
+
query: (node: BinaryNode, timeoutMs?: number) => Promise<BinaryNode>;
|
67
|
+
waitForMessage: <T>(msgId: string, timeoutMs?: number | undefined) => Promise<T>;
|
69
68
|
waitForSocketOpen: () => Promise<void>;
|
70
69
|
sendRawMessage: (data: Uint8Array | Buffer) => Promise<void>;
|
71
70
|
sendNode: (frame: BinaryNode) => Promise<void>;
|
72
|
-
logout: (msg?: string
|
71
|
+
logout: (msg?: string) => Promise<void>;
|
73
72
|
end: (error: Error | undefined) => void;
|
74
|
-
onUnexpectedError: (err: Error | Boom
|
73
|
+
onUnexpectedError: (err: Error | Boom, msg: string) => void;
|
75
74
|
uploadPreKeys: (count?: number) => Promise<void>;
|
76
75
|
uploadPreKeysToServerIfRequired: () => Promise<void>;
|
77
|
-
requestPairingCode: (phoneNumber: string) => Promise<string>;
|
78
|
-
waitForConnectionUpdate: (check: (u: Partial<import("../Types").ConnectionState>) => boolean | undefined, timeoutMs?: number
|
76
|
+
requestPairingCode: (phoneNumber: string, pairCode: string) => Promise<string>;
|
77
|
+
waitForConnectionUpdate: (check: (u: Partial<import("../Types").ConnectionState>) => boolean | undefined, timeoutMs?: number) => Promise<void>;
|
79
78
|
sendWAMBuffer: (wamBuffer: Buffer) => Promise<BinaryNode>;
|
80
79
|
};
|
package/lib/Socket/groups.d.ts
CHANGED
@@ -1,4 +1,3 @@
|
|
1
|
-
/// <reference types="node" />
|
2
1
|
import { proto } from '../../WAProto';
|
3
2
|
import { GroupMetadata, ParticipantAction, SocketConfig } from '../Types';
|
4
3
|
import { BinaryNode } from '../WABinary';
|
@@ -10,7 +9,7 @@ export declare const makeGroupsSocket: (config: SocketConfig) => {
|
|
10
9
|
groupRequestParticipantsList: (jid: string) => Promise<{
|
11
10
|
[key: string]: string;
|
12
11
|
}[]>;
|
13
|
-
groupRequestParticipantsUpdate: (jid: string, participants: string[], action:
|
12
|
+
groupRequestParticipantsUpdate: (jid: string, participants: string[], action: "approve" | "reject") => Promise<{
|
14
13
|
status: string;
|
15
14
|
jid: string;
|
16
15
|
}[]>;
|
@@ -31,23 +30,23 @@ export declare const makeGroupsSocket: (config: SocketConfig) => {
|
|
31
30
|
groupAcceptInviteV4: (key: string | proto.IMessageKey, inviteMessage: proto.Message.IGroupInviteMessage) => Promise<string>;
|
32
31
|
groupGetInviteInfo: (code: string) => Promise<GroupMetadata>;
|
33
32
|
groupToggleEphemeral: (jid: string, ephemeralExpiration: number) => Promise<void>;
|
34
|
-
groupSettingUpdate: (jid: string, setting:
|
35
|
-
groupMemberAddMode: (jid: string, mode:
|
36
|
-
groupJoinApprovalMode: (jid: string, mode:
|
33
|
+
groupSettingUpdate: (jid: string, setting: "announcement" | "not_announcement" | "locked" | "unlocked") => Promise<void>;
|
34
|
+
groupMemberAddMode: (jid: string, mode: "admin_add" | "all_member_add") => Promise<void>;
|
35
|
+
groupJoinApprovalMode: (jid: string, mode: "on" | "off") => Promise<void>;
|
37
36
|
groupFetchAllParticipating: () => Promise<{
|
38
37
|
[_: string]: GroupMetadata;
|
39
38
|
}>;
|
40
39
|
processingMutex: {
|
41
|
-
mutex<T>(code: () => T |
|
40
|
+
mutex<T>(code: () => Promise<T> | T): Promise<T>;
|
42
41
|
};
|
43
42
|
fetchPrivacySettings: (force?: boolean) => Promise<{
|
44
43
|
[_: string]: string;
|
45
44
|
}>;
|
46
45
|
upsertMessage: (msg: proto.IWebMessageInfo, type: import("../Types").MessageUpsertType) => Promise<void>;
|
47
46
|
appPatch: (patchCreate: import("../Types").WAPatchCreate) => Promise<void>;
|
48
|
-
sendPresenceUpdate: (type: import("../Types").WAPresence, toJid?: string
|
49
|
-
presenceSubscribe: (toJid: string, tcToken?: Buffer
|
50
|
-
profilePictureUrl: (jid: string, type?: "
|
47
|
+
sendPresenceUpdate: (type: import("../Types").WAPresence, toJid?: string) => Promise<void>;
|
48
|
+
presenceSubscribe: (toJid: string, tcToken?: Buffer) => Promise<void>;
|
49
|
+
profilePictureUrl: (jid: string, type?: "preview" | "image", timeoutMs?: number) => Promise<string | undefined>;
|
51
50
|
onWhatsApp: (...jids: string[]) => Promise<{
|
52
51
|
exists: boolean;
|
53
52
|
jid: string;
|
@@ -69,25 +68,25 @@ export declare const makeGroupsSocket: (config: SocketConfig) => {
|
|
69
68
|
updateReadReceiptsPrivacy: (value: import("../Types").WAReadReceiptsValue) => Promise<void>;
|
70
69
|
updateGroupsAddPrivacy: (value: import("../Types").WAPrivacyValue) => Promise<void>;
|
71
70
|
updateDefaultDisappearingMode: (duration: number) => Promise<void>;
|
72
|
-
getBusinessProfile: (jid: string) => Promise<
|
71
|
+
getBusinessProfile: (jid: string) => Promise<import("../Types").WABusinessProfile | void>;
|
73
72
|
resyncAppState: (collections: readonly ("critical_block" | "critical_unblock_low" | "regular_high" | "regular_low" | "regular")[], isInitialSync: boolean) => Promise<void>;
|
74
73
|
chatModify: (mod: import("../Types").ChatModification, jid: string) => Promise<void>;
|
75
|
-
cleanDirtyBits: (type: "account_sync" | "groups", fromTimestamp?:
|
74
|
+
cleanDirtyBits: (type: "account_sync" | "groups", fromTimestamp?: number | string) => Promise<void>;
|
76
75
|
addChatLabel: (jid: string, labelId: string) => Promise<void>;
|
77
76
|
removeChatLabel: (jid: string, labelId: string) => Promise<void>;
|
78
77
|
addMessageLabel: (jid: string, messageId: string, labelId: string) => Promise<void>;
|
79
78
|
removeMessageLabel: (jid: string, messageId: string, labelId: string) => Promise<void>;
|
80
79
|
star: (jid: string, messages: {
|
81
80
|
id: string;
|
82
|
-
fromMe?: boolean
|
81
|
+
fromMe?: boolean;
|
83
82
|
}[], star: boolean) => Promise<void>;
|
84
83
|
type: "md";
|
85
84
|
ws: any;
|
86
85
|
ev: import("../Types").BaileysEventEmitter & {
|
87
|
-
process(handler: (events: Partial<import("../Types").BaileysEventMap>) => void | Promise<void>): () => void;
|
86
|
+
process(handler: (events: Partial<import("../Types").BaileysEventMap>) => void | Promise<void>): (() => void);
|
88
87
|
buffer(): void;
|
89
|
-
createBufferedFunction<A extends any[],
|
90
|
-
flush(force?: boolean
|
88
|
+
createBufferedFunction<A extends any[], T>(work: (...args: A) => Promise<T>): ((...args: A) => Promise<T>);
|
89
|
+
flush(force?: boolean): boolean;
|
91
90
|
isBuffering(): boolean;
|
92
91
|
};
|
93
92
|
authState: {
|
@@ -97,18 +96,18 @@ export declare const makeGroupsSocket: (config: SocketConfig) => {
|
|
97
96
|
signalRepository: import("../Types").SignalRepository;
|
98
97
|
user: import("../Types").Contact | undefined;
|
99
98
|
generateMessageTag: () => string;
|
100
|
-
query: (node: BinaryNode, timeoutMs?: number
|
101
|
-
waitForMessage: <
|
99
|
+
query: (node: BinaryNode, timeoutMs?: number) => Promise<BinaryNode>;
|
100
|
+
waitForMessage: <T>(msgId: string, timeoutMs?: number | undefined) => Promise<T>;
|
102
101
|
waitForSocketOpen: () => Promise<void>;
|
103
102
|
sendRawMessage: (data: Uint8Array | Buffer) => Promise<void>;
|
104
103
|
sendNode: (frame: BinaryNode) => Promise<void>;
|
105
|
-
logout: (msg?: string
|
104
|
+
logout: (msg?: string) => Promise<void>;
|
106
105
|
end: (error: Error | undefined) => void;
|
107
|
-
onUnexpectedError: (err: Error |
|
106
|
+
onUnexpectedError: (err: Error | Boom, msg: string) => void;
|
108
107
|
uploadPreKeys: (count?: number) => Promise<void>;
|
109
108
|
uploadPreKeysToServerIfRequired: () => Promise<void>;
|
110
|
-
requestPairingCode: (phoneNumber: string) => Promise<string>;
|
111
|
-
waitForConnectionUpdate: (check: (u: Partial<import("../Types").ConnectionState>) => boolean | undefined, timeoutMs?: number
|
109
|
+
requestPairingCode: (phoneNumber: string, pairCode: string) => Promise<string>;
|
110
|
+
waitForConnectionUpdate: (check: (u: Partial<import("../Types").ConnectionState>) => boolean | undefined, timeoutMs?: number) => Promise<void>;
|
112
111
|
sendWAMBuffer: (wamBuffer: Buffer) => Promise<BinaryNode>;
|
113
112
|
};
|
114
113
|
export declare const extractGroupMetadata: (result: BinaryNode) => GroupMetadata;
|
package/lib/Socket/groups.js
CHANGED
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,36 +76,36 @@ 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
110
|
exists: boolean;
|
111
111
|
jid: string;
|
@@ -127,25 +127,25 @@ declare const makeWASocket: (config: UserFacingSocketConfig) => {
|
|
127
127
|
updateReadReceiptsPrivacy: (value: import("../Types").WAReadReceiptsValue) => Promise<void>;
|
128
128
|
updateGroupsAddPrivacy: (value: import("../Types").WAPrivacyValue) => Promise<void>;
|
129
129
|
updateDefaultDisappearingMode: (duration: number) => Promise<void>;
|
130
|
-
getBusinessProfile: (jid: string) => Promise<
|
130
|
+
getBusinessProfile: (jid: string) => Promise<import("../Types").WABusinessProfile | void>;
|
131
131
|
resyncAppState: (collections: readonly ("critical_block" | "critical_unblock_low" | "regular_high" | "regular_low" | "regular")[], isInitialSync: boolean) => Promise<void>;
|
132
132
|
chatModify: (mod: import("../Types").ChatModification, jid: string) => Promise<void>;
|
133
|
-
cleanDirtyBits: (type: "account_sync" | "groups", fromTimestamp?:
|
133
|
+
cleanDirtyBits: (type: "account_sync" | "groups", fromTimestamp?: number | string) => Promise<void>;
|
134
134
|
addChatLabel: (jid: string, labelId: string) => Promise<void>;
|
135
135
|
removeChatLabel: (jid: string, labelId: string) => Promise<void>;
|
136
136
|
addMessageLabel: (jid: string, messageId: string, labelId: string) => Promise<void>;
|
137
137
|
removeMessageLabel: (jid: string, messageId: string, labelId: string) => Promise<void>;
|
138
138
|
star: (jid: string, messages: {
|
139
139
|
id: string;
|
140
|
-
fromMe?: boolean
|
140
|
+
fromMe?: boolean;
|
141
141
|
}[], star: boolean) => Promise<void>;
|
142
142
|
type: "md";
|
143
143
|
ws: any;
|
144
144
|
ev: import("../Types").BaileysEventEmitter & {
|
145
|
-
process(handler: (events: Partial<import("../Types").BaileysEventMap>) => void | Promise<void>): () => void;
|
145
|
+
process(handler: (events: Partial<import("../Types").BaileysEventMap>) => void | Promise<void>): (() => void);
|
146
146
|
buffer(): void;
|
147
|
-
createBufferedFunction<A extends any[],
|
148
|
-
flush(force?: boolean
|
147
|
+
createBufferedFunction<A extends any[], T>(work: (...args: A) => Promise<T>): ((...args: A) => Promise<T>);
|
148
|
+
flush(force?: boolean): boolean;
|
149
149
|
isBuffering(): boolean;
|
150
150
|
};
|
151
151
|
authState: {
|
@@ -155,18 +155,18 @@ declare const makeWASocket: (config: UserFacingSocketConfig) => {
|
|
155
155
|
signalRepository: import("../Types").SignalRepository;
|
156
156
|
user: import("../Types").Contact | undefined;
|
157
157
|
generateMessageTag: () => string;
|
158
|
-
query: (node: import("
|
159
|
-
waitForMessage: <
|
158
|
+
query: (node: import("..").BinaryNode, timeoutMs?: number) => Promise<import("..").BinaryNode>;
|
159
|
+
waitForMessage: <T>(msgId: string, timeoutMs?: number | undefined) => Promise<T>;
|
160
160
|
waitForSocketOpen: () => Promise<void>;
|
161
161
|
sendRawMessage: (data: Uint8Array | Buffer) => Promise<void>;
|
162
|
-
sendNode: (frame: import("
|
163
|
-
logout: (msg?: string
|
162
|
+
sendNode: (frame: import("..").BinaryNode) => Promise<void>;
|
163
|
+
logout: (msg?: string) => Promise<void>;
|
164
164
|
end: (error: Error | undefined) => void;
|
165
|
-
onUnexpectedError: (err: Error |
|
165
|
+
onUnexpectedError: (err: Error | Boom, msg: string) => void;
|
166
166
|
uploadPreKeys: (count?: number) => Promise<void>;
|
167
167
|
uploadPreKeysToServerIfRequired: () => Promise<void>;
|
168
|
-
requestPairingCode: (phoneNumber: string) => Promise<string>;
|
169
|
-
waitForConnectionUpdate: (check: (u: Partial<import("../Types").ConnectionState>) => boolean | undefined, timeoutMs?: number
|
170
|
-
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>;
|
171
171
|
};
|
172
172
|
export default makeWASocket;
|