@hbmodsofc/baileys 1.5.2 → 1.7.6
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/WAProto/index.js +19671 -152026
- package/engine-requirements.js +4 -4
- package/lib/Defaults/index.d.ts +12 -8
- package/lib/Defaults/index.js +90 -124
- package/lib/Signal/Group/group_cipher.d.ts +0 -1
- package/lib/Signal/Group/group_cipher.js +28 -39
- package/lib/Signal/Group/sender-chain-key.d.ts +1 -1
- package/lib/Signal/Group/sender-chain-key.js +9 -2
- package/lib/Signal/Group/sender-key-distribution-message.js +3 -3
- package/lib/Signal/Group/sender-key-message.js +3 -3
- package/lib/Signal/Group/sender-key-state.d.ts +4 -4
- package/lib/Signal/Group/sender-key-state.js +47 -16
- package/lib/Signal/libsignal.d.ts +7 -3
- package/lib/Signal/libsignal.js +224 -39
- package/lib/Signal/lid-mapping.d.ts +26 -0
- package/lib/Signal/lid-mapping.js +146 -0
- package/lib/Socket/Client/index.d.ts +2 -3
- package/lib/Socket/Client/index.js +2 -3
- package/lib/Socket/Client/{abstract-socket-client.d.ts → types.d.ts} +1 -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} +10 -16
- package/lib/Socket/business.d.ts +94 -78
- package/lib/Socket/business.js +130 -11
- package/lib/Socket/chats.d.ts +63 -233
- package/lib/Socket/chats.js +234 -184
- package/lib/Socket/communities.d.ts +232 -0
- package/lib/Socket/communities.js +402 -0
- package/lib/Socket/groups.d.ts +62 -41
- package/lib/Socket/groups.js +76 -64
- package/lib/Socket/index.d.ts +129 -83
- package/lib/Socket/index.js +13 -6
- package/lib/Socket/messages-recv.d.ts +59 -48
- package/lib/Socket/messages-recv.js +516 -371
- package/lib/Socket/messages-send.d.ts +86 -67
- package/lib/Socket/messages-send.js +1091 -1
- package/lib/Socket/mex.d.ts +2 -0
- package/lib/Socket/mex.js +45 -0
- package/lib/Socket/newsletter.d.ts +76 -64
- package/lib/Socket/newsletter.js +184 -1
- package/lib/Socket/socket.d.ts +19 -13
- package/lib/Socket/socket.js +805 -1
- package/lib/Types/Auth.d.ts +4 -10
- package/lib/Types/Bussines.d.ts +24 -0
- package/lib/Types/Bussines.js +2 -0
- package/lib/Types/Call.d.ts +1 -1
- package/lib/Types/Chat.d.ts +29 -9
- package/lib/Types/Chat.js +7 -1
- package/lib/Types/Contact.d.ts +5 -1
- package/lib/Types/Events.d.ts +55 -14
- package/lib/Types/GroupMetadata.d.ts +15 -5
- 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 +75 -49
- package/lib/Types/Message.js +10 -7
- package/lib/Types/Newsletter.d.ts +129 -98
- package/lib/Types/Newsletter.js +33 -38
- package/lib/Types/Product.d.ts +1 -1
- package/lib/Types/Signal.d.ts +29 -1
- package/lib/Types/Socket.d.ts +48 -22
- package/lib/Types/State.d.ts +13 -2
- package/lib/Types/State.js +12 -0
- package/lib/Types/USync.d.ts +1 -1
- package/lib/Types/index.d.ts +10 -3
- package/lib/Types/index.js +2 -2
- package/lib/Utils/auth-utils.d.ts +3 -3
- package/lib/Utils/auth-utils.js +378 -102
- package/lib/Utils/baileys-event-stream.js +1 -1
- package/lib/Utils/business.d.ts +2 -2
- package/lib/Utils/business.js +19 -13
- package/lib/Utils/chat-utils.d.ts +21 -22
- package/lib/Utils/chat-utils.js +201 -154
- package/lib/Utils/crypto.d.ts +18 -19
- package/lib/Utils/crypto.js +78 -37
- package/lib/Utils/decode-wa-message.d.ts +34 -7
- package/lib/Utils/decode-wa-message.js +138 -66
- package/lib/Utils/event-buffer.d.ts +6 -8
- package/lib/Utils/event-buffer.js +81 -43
- package/lib/Utils/generics.d.ts +27 -27
- package/lib/Utils/generics.js +128 -133
- package/lib/Utils/history.d.ts +9 -5
- package/lib/Utils/history.js +17 -23
- package/lib/Utils/index.d.ts +2 -0
- package/lib/Utils/index.js +2 -0
- package/lib/Utils/lidToJid-test.d.ts +11 -0
- package/lib/Utils/lidToJid-test.js +27 -0
- package/lib/Utils/link-preview.d.ts +4 -4
- package/lib/Utils/link-preview.js +40 -12
- package/lib/Utils/logger.d.ts +11 -3
- package/lib/Utils/lt-hash.d.ts +8 -8
- package/lib/Utils/lt-hash.js +23 -24
- package/lib/Utils/make-mutex.d.ts +2 -2
- package/lib/Utils/make-mutex.js +3 -2
- package/lib/Utils/message-retry-manager.d.ts +81 -0
- package/lib/Utils/message-retry-manager.js +152 -0
- package/lib/Utils/messages-media.d.ts +37 -41
- package/lib/Utils/messages-media.js +252 -368
- package/lib/Utils/messages.d.ts +13 -15
- package/lib/Utils/messages.js +274 -261
- package/lib/Utils/noise-handler.d.ts +13 -15
- package/lib/Utils/noise-handler.js +20 -26
- package/lib/Utils/process-message.d.ts +9 -8
- package/lib/Utils/process-message.js +157 -93
- package/lib/Utils/signal.d.ts +6 -5
- package/lib/Utils/signal.js +37 -29
- package/lib/Utils/use-multi-file-auth-state.d.ts +1 -2
- package/lib/Utils/use-multi-file-auth-state.js +12 -7
- package/lib/Utils/validate-connection.d.ts +5 -6
- package/lib/Utils/validate-connection.js +39 -97
- package/lib/WABinary/constants.d.ts +24 -27
- package/lib/WABinary/constants.js +1276 -13
- package/lib/WABinary/decode.d.ts +3 -4
- package/lib/WABinary/decode.js +28 -14
- package/lib/WABinary/encode.d.ts +1 -2
- package/lib/WABinary/encode.js +134 -147
- package/lib/WABinary/generic-utils.d.ts +4 -7
- package/lib/WABinary/generic-utils.js +40 -125
- package/lib/WABinary/jid-utils.d.ts +13 -8
- package/lib/WABinary/jid-utils.js +27 -16
- package/lib/WAM/BinaryInfo.d.ts +2 -11
- package/lib/WAM/constants.d.ts +3 -2
- package/lib/WAM/constants.js +2252 -2359
- package/lib/WAM/encode.d.ts +1 -2
- package/lib/WAM/encode.js +8 -11
- package/lib/WAUSync/Protocols/USyncContactProtocol.d.ts +2 -2
- package/lib/WAUSync/Protocols/USyncContactProtocol.js +3 -4
- package/lib/WAUSync/Protocols/USyncDeviceProtocol.d.ts +2 -2
- package/lib/WAUSync/Protocols/USyncDeviceProtocol.js +5 -5
- package/lib/WAUSync/Protocols/USyncDisappearingModeProtocol.d.ts +2 -2
- package/lib/WAUSync/Protocols/USyncDisappearingModeProtocol.js +5 -5
- package/lib/WAUSync/Protocols/USyncStatusProtocol.d.ts +2 -2
- package/lib/WAUSync/Protocols/USyncStatusProtocol.js +5 -6
- package/lib/WAUSync/Protocols/UsyncBotProfileProtocol.d.ts +2 -2
- package/lib/WAUSync/Protocols/UsyncBotProfileProtocol.js +1 -1
- package/lib/WAUSync/Protocols/UsyncLIDProtocol.d.ts +4 -3
- package/lib/WAUSync/Protocols/UsyncLIDProtocol.js +11 -3
- package/lib/WAUSync/USyncQuery.d.ts +2 -2
- package/lib/WAUSync/USyncQuery.js +19 -15
- package/lib/WAUSync/USyncUser.d.ts +5 -5
- package/lib/WAUSync/index.d.ts +1 -1
- package/lib/WAUSync/index.js +1 -1
- package/package.json +102 -102
- package/lib/Defaults/baileys-version.json +0 -3
- package/lib/Defaults/phonenumber-mcc.json +0 -223
- package/lib/Signal/Group/queue-job.d.ts +0 -1
- package/lib/Signal/Group/queue-job.js +0 -57
- package/lib/Socket/Client/mobile-socket-client.d.ts +0 -13
- package/lib/Socket/Client/mobile-socket-client.js +0 -65
- package/lib/Socket/hbmods.d.ts +0 -253
- package/lib/Socket/hbmods.js +0 -1
- package/lib/Socket/registration.d.ts +0 -267
- package/lib/Socket/registration.js +0 -166
- package/lib/Socket/usync.d.ts +0 -36
- package/lib/Socket/usync.js +0 -70
- /package/lib/Socket/Client/{abstract-socket-client.js → types.js} +0 -0
package/lib/Socket/index.d.ts
CHANGED
|
@@ -1,15 +1,45 @@
|
|
|
1
|
-
|
|
2
|
-
import { UserFacingSocketConfig } from '../Types';
|
|
1
|
+
import type { UserFacingSocketConfig } from '../Types';
|
|
3
2
|
declare const makeWASocket: (config: UserFacingSocketConfig) => {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
3
|
+
communityMetadata: (jid: string) => Promise<import("../Types").GroupMetadata>;
|
|
4
|
+
communityCreate: (subject: string, body: string) => Promise<import("../Types").GroupMetadata | null>;
|
|
5
|
+
communityCreateGroup: (subject: string, participants: string[], parentCommunityJid: string) => Promise<import("../Types").GroupMetadata | null>;
|
|
6
|
+
communityLeave: (id: string) => Promise<void>;
|
|
7
|
+
communityUpdateSubject: (jid: string, subject: string) => Promise<void>;
|
|
8
|
+
communityLinkGroup: (groupJid: string, parentCommunityJid: string) => Promise<void>;
|
|
9
|
+
communityUnlinkGroup: (groupJid: string, parentCommunityJid: string) => Promise<void>;
|
|
10
|
+
communityRequestParticipantsList: (jid: string) => Promise<{
|
|
11
|
+
[key: string]: string;
|
|
12
|
+
}[]>;
|
|
13
|
+
communityRequestParticipantsUpdate: (jid: string, participants: string[], action: "approve" | "reject") => 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) => 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<any>;
|
|
28
|
+
communityGetInviteInfo: (code: string) => Promise<import("../Types").GroupMetadata>;
|
|
29
|
+
communityToggleEphemeral: (jid: string, ephemeralExpiration: number) => Promise<void>;
|
|
30
|
+
communitySettingUpdate: (jid: string, setting: "announcement" | "not_announcement" | "locked" | "unlocked") => Promise<void>;
|
|
31
|
+
communityMemberAddMode: (jid: string, mode: "admin_add" | "all_member_add") => Promise<void>;
|
|
32
|
+
communityJoinApprovalMode: (jid: string, mode: "on" | "off") => Promise<void>;
|
|
33
|
+
communityFetchAllParticipating: () => Promise<{
|
|
34
|
+
[_: string]: import("../Types").GroupMetadata;
|
|
35
|
+
}>;
|
|
36
|
+
logger: import("../Utils/logger").ILogger;
|
|
7
37
|
getOrderDetails: (orderId: string, tokenBase64: string) => Promise<import("../Types").OrderDetails>;
|
|
8
38
|
getCatalog: ({ jid, limit, cursor }: import("../Types").GetCatalogOptions) => Promise<{
|
|
9
39
|
products: import("../Types").Product[];
|
|
10
40
|
nextPageCursor: string | undefined;
|
|
11
41
|
}>;
|
|
12
|
-
getCollections: (jid?: string
|
|
42
|
+
getCollections: (jid?: string, limit?: number) => Promise<{
|
|
13
43
|
collections: import("../Types").CatalogCollection[];
|
|
14
44
|
}>;
|
|
15
45
|
productCreate: (create: import("../Types").ProductCreate) => Promise<import("../Types").Product>;
|
|
@@ -17,58 +47,59 @@ declare const makeWASocket: (config: UserFacingSocketConfig) => {
|
|
|
17
47
|
deleted: number;
|
|
18
48
|
}>;
|
|
19
49
|
productUpdate: (productId: string, update: import("../Types").ProductUpdate) => Promise<import("../Types").Product>;
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
}>;
|
|
50
|
+
updateBussinesProfile: (args: import("../Types/Bussines").UpdateBussinesProfileProps) => Promise<any>;
|
|
51
|
+
updateCoverPhoto: (photo: import("../Types").WAMediaUpload) => Promise<number>;
|
|
52
|
+
removeCoverPhoto: (id: string) => Promise<any>;
|
|
53
|
+
sendMessageAck: ({ tag, attrs, content }: import("..").BinaryNode, errorCode?: number) => Promise<void>;
|
|
54
|
+
sendRetryRequest: (node: import("..").BinaryNode, forceIncludeKeys?: boolean) => Promise<void>;
|
|
26
55
|
rejectCall: (callId: string, callFrom: string) => Promise<void>;
|
|
27
|
-
|
|
56
|
+
fetchMessageHistory: (count: number, oldestMsgKey: import("../Types").WAMessageKey, oldestMsgTimestamp: number | Long) => Promise<string>;
|
|
57
|
+
requestPlaceholderResend: (messageKey: import("../Types").WAMessageKey) => Promise<string | undefined>;
|
|
58
|
+
messageRetryManager: import("..").MessageRetryManager | null;
|
|
59
|
+
getPrivacyTokens: (jids: string[]) => Promise<any>;
|
|
28
60
|
assertSessions: (jids: string[], force: boolean) => Promise<boolean>;
|
|
29
|
-
relayMessage: (jid: string, message: import("../Types").WAProto.IMessage, { messageId: msgId, participant, additionalAttributes, additionalNodes, useUserDevicesCache,
|
|
61
|
+
relayMessage: (jid: string, message: import("../Types").WAProto.IMessage, { messageId: msgId, participant, additionalAttributes, additionalNodes, useUserDevicesCache, useCachedGroupMetadata, statusJidList }: import("../Types").MessageRelayOptions) => Promise<string>;
|
|
30
62
|
sendReceipt: (jid: string, participant: string | undefined, messageIds: string[], type: import("../Types").MessageReceiptType) => Promise<void>;
|
|
31
|
-
sendReceipts: (keys: import("../Types").
|
|
32
|
-
|
|
33
|
-
[key: string]: string;
|
|
34
|
-
};
|
|
35
|
-
readMessages: (keys: import("../Types").WAProto.IMessageKey[]) => Promise<void>;
|
|
63
|
+
sendReceipts: (keys: import("../Types").WAMessageKey[], type: import("../Types").MessageReceiptType) => Promise<void>;
|
|
64
|
+
readMessages: (keys: import("../Types").WAMessageKey[]) => Promise<void>;
|
|
36
65
|
refreshMediaConn: (forceGet?: boolean) => Promise<import("../Types").MediaConnInfo>;
|
|
37
|
-
getUSyncDevices: (jids: string[], useCache: boolean, ignoreZeroDevices: boolean) => Promise<import("../index").JidWithDevice[]>;
|
|
38
|
-
createParticipantNodes: (jids: string[], message: import("../Types").WAProto.IMessage, extraAttrs?: {
|
|
39
|
-
[key: string]: string;
|
|
40
|
-
} | undefined) => Promise<{
|
|
41
|
-
nodes: import("../index").BinaryNode[];
|
|
42
|
-
shouldIncludeDeviceIdentity: boolean;
|
|
43
|
-
}>;
|
|
44
66
|
waUploadToServer: import("../Types").WAMediaUploadFunction;
|
|
45
67
|
fetchPrivacySettings: (force?: boolean) => Promise<{
|
|
46
68
|
[_: string]: string;
|
|
47
69
|
}>;
|
|
70
|
+
sendPeerDataOperationMessage: (pdoMessage: import("../Types").WAProto.Message.IPeerDataOperationRequestMessage) => Promise<string>;
|
|
71
|
+
createParticipantNodes: (jids: string[], message: import("../Types").WAProto.IMessage, extraAttrs?: import("..").BinaryNode["attrs"], dsmMessage?: import("../Types").WAProto.IMessage) => Promise<{
|
|
72
|
+
nodes: import("..").BinaryNode[];
|
|
73
|
+
shouldIncludeDeviceIdentity: boolean;
|
|
74
|
+
}>;
|
|
75
|
+
getUSyncDevices: (jids: string[], useCache: boolean, ignoreZeroDevices: boolean) => Promise<(import("..").JidWithDevice & {
|
|
76
|
+
wireJid: string;
|
|
77
|
+
})[]>;
|
|
48
78
|
updateMediaMessage: (message: import("../Types").WAProto.IWebMessageInfo) => Promise<import("../Types").WAProto.IWebMessageInfo>;
|
|
49
79
|
sendMessage: (jid: string, content: import("../Types").AnyMessageContent, options?: import("../Types").MiscMessageGenerationOptions) => Promise<import("../Types").WAProto.WebMessageInfo | undefined>;
|
|
80
|
+
newsletterCreate: (name: string, description?: string) => Promise<import("../Types").NewsletterMetadata>;
|
|
81
|
+
newsletterUpdate: (jid: string, updates: import("../Types").NewsletterUpdate) => Promise<unknown>;
|
|
82
|
+
newsletterSubscribers: (jid: string) => Promise<{
|
|
83
|
+
subscribers: number;
|
|
84
|
+
}>;
|
|
85
|
+
newsletterMetadata: (type: "invite" | "jid", key: string) => Promise<import("../Types").NewsletterMetadata | null>;
|
|
86
|
+
newsletterFollow: (jid: string) => Promise<unknown>;
|
|
87
|
+
newsletterUnfollow: (jid: string) => Promise<unknown>;
|
|
88
|
+
newsletterMute: (jid: string) => Promise<unknown>;
|
|
89
|
+
newsletterUnmute: (jid: string) => Promise<unknown>;
|
|
90
|
+
newsletterUpdateName: (jid: string, name: string) => Promise<unknown>;
|
|
91
|
+
newsletterUpdateDescription: (jid: string, description: string) => Promise<unknown>;
|
|
92
|
+
newsletterUpdatePicture: (jid: string, content: import("../Types").WAMediaUpload) => Promise<unknown>;
|
|
93
|
+
newsletterRemovePicture: (jid: string) => Promise<unknown>;
|
|
94
|
+
newsletterReactMessage: (jid: string, serverId: string, reaction?: string) => Promise<void>;
|
|
95
|
+
newsletterFetchMessages: (jid: string, count: number, since: number, after: number) => Promise<any>;
|
|
50
96
|
subscribeNewsletterUpdates: (jid: string) => Promise<{
|
|
51
97
|
duration: string;
|
|
52
|
-
}>;
|
|
53
|
-
newsletterReactionMode: (jid: string, mode: import("../Types").NewsletterReactionMode) => Promise<void>;
|
|
54
|
-
newsletterUpdateDescription: (jid: string, description?: string | undefined) => Promise<void>;
|
|
55
|
-
newsletterUpdateName: (jid: string, name: string) => Promise<void>;
|
|
56
|
-
newsletterUpdatePicture: (jid: string, content: import("../Types").WAMediaUpload) => Promise<void>;
|
|
57
|
-
newsletterRemovePicture: (jid: string) => Promise<void>;
|
|
58
|
-
newsletterUnfollow: (jid: string) => Promise<void>;
|
|
59
|
-
newsletterFollow: (jid: string) => Promise<void>;
|
|
60
|
-
newsletterUnmute: (jid: string) => Promise<void>;
|
|
61
|
-
newsletterMute: (jid: string) => Promise<void>;
|
|
62
|
-
newsletterAction: (jid: string, type: "mute" | "follow" | "unfollow" | "unmute") => Promise<void>;
|
|
63
|
-
newsletterCreate: (name: string, description: string, reaction_codes: string) => Promise<import("../Types").NewsletterMetadata>;
|
|
64
|
-
newsletterMetadata: (type: "invite" | "jid", key: string, role?: import("../Types").NewsletterViewRole | undefined) => Promise<import("../Types").NewsletterMetadata>;
|
|
98
|
+
} | null>;
|
|
65
99
|
newsletterAdminCount: (jid: string) => Promise<number>;
|
|
66
|
-
newsletterChangeOwner: (jid: string,
|
|
67
|
-
newsletterDemote: (jid: string,
|
|
100
|
+
newsletterChangeOwner: (jid: string, newOwnerJid: string) => Promise<void>;
|
|
101
|
+
newsletterDemote: (jid: string, userJid: string) => Promise<void>;
|
|
68
102
|
newsletterDelete: (jid: string) => Promise<void>;
|
|
69
|
-
newsletterReactMessage: (jid: string, serverId: string, code?: string | undefined) => Promise<void>;
|
|
70
|
-
newsletterFetchMessages: (type: "invite" | "jid", key: string, count: number, after?: number | undefined) => Promise<import("../Types").NewsletterFetchedUpdate[]>;
|
|
71
|
-
newsletterFetchUpdates: (jid: string, count: number, after?: number | undefined, since?: number | undefined) => Promise<import("../Types").NewsletterFetchedUpdate[]>;
|
|
72
103
|
groupMetadata: (jid: string) => Promise<import("../Types").GroupMetadata>;
|
|
73
104
|
groupCreate: (subject: string, participants: string[]) => Promise<import("../Types").GroupMetadata>;
|
|
74
105
|
groupLeave: (id: string) => Promise<void>;
|
|
@@ -76,98 +107,113 @@ declare const makeWASocket: (config: UserFacingSocketConfig) => {
|
|
|
76
107
|
groupRequestParticipantsList: (jid: string) => Promise<{
|
|
77
108
|
[key: string]: string;
|
|
78
109
|
}[]>;
|
|
79
|
-
groupRequestParticipantsUpdate: (jid: string, participants: string[], action: "
|
|
110
|
+
groupRequestParticipantsUpdate: (jid: string, participants: string[], action: "approve" | "reject") => Promise<{
|
|
80
111
|
status: string;
|
|
81
112
|
jid: string;
|
|
82
113
|
}[]>;
|
|
83
114
|
groupParticipantsUpdate: (jid: string, participants: string[], action: import("../Types").ParticipantAction) => Promise<{
|
|
84
115
|
status: string;
|
|
85
116
|
jid: string;
|
|
86
|
-
content: import("
|
|
117
|
+
content: import("..").BinaryNode;
|
|
87
118
|
}[]>;
|
|
88
|
-
groupUpdateDescription: (jid: string, description?: string
|
|
119
|
+
groupUpdateDescription: (jid: string, description?: string) => Promise<void>;
|
|
89
120
|
groupInviteCode: (jid: string) => Promise<string | undefined>;
|
|
90
121
|
groupRevokeInvite: (jid: string) => Promise<string | undefined>;
|
|
91
122
|
groupAcceptInvite: (code: string) => Promise<string | undefined>;
|
|
92
|
-
|
|
123
|
+
groupRevokeInviteV4: (groupJid: string, invitedJid: string) => Promise<boolean>;
|
|
124
|
+
groupAcceptInviteV4: (key: string | import("../Types").WAMessageKey, inviteMessage: import("../Types").WAProto.Message.IGroupInviteMessage) => Promise<any>;
|
|
93
125
|
groupGetInviteInfo: (code: string) => Promise<import("../Types").GroupMetadata>;
|
|
94
126
|
groupToggleEphemeral: (jid: string, ephemeralExpiration: number) => Promise<void>;
|
|
95
|
-
groupSettingUpdate: (jid: string, setting: "announcement" | "
|
|
96
|
-
groupMemberAddMode: (jid: string, mode: "
|
|
127
|
+
groupSettingUpdate: (jid: string, setting: "announcement" | "not_announcement" | "locked" | "unlocked") => Promise<void>;
|
|
128
|
+
groupMemberAddMode: (jid: string, mode: "admin_add" | "all_member_add") => Promise<void>;
|
|
97
129
|
groupJoinApprovalMode: (jid: string, mode: "on" | "off") => Promise<void>;
|
|
98
130
|
groupFetchAllParticipating: () => Promise<{
|
|
99
131
|
[_: string]: import("../Types").GroupMetadata;
|
|
100
132
|
}>;
|
|
133
|
+
createCallLink: (type: "audio" | "video", event?: {
|
|
134
|
+
startTime: number;
|
|
135
|
+
}, timeoutMs?: number) => Promise<string | undefined>;
|
|
136
|
+
getBotListV2: () => Promise<import("../Types").BotListInfo[]>;
|
|
101
137
|
processingMutex: {
|
|
102
|
-
mutex<T>(code: () => T |
|
|
138
|
+
mutex<T>(code: () => Promise<T> | T): Promise<T>;
|
|
103
139
|
};
|
|
104
|
-
upsertMessage: (msg: import("../Types").
|
|
140
|
+
upsertMessage: (msg: import("../Types").WAMessage, type: import("../Types").MessageUpsertType) => Promise<void>;
|
|
105
141
|
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?: "
|
|
109
|
-
onWhatsApp: (...jids: string[]) => Promise<{
|
|
110
|
-
jid: string;
|
|
111
|
-
exists: unknown;
|
|
112
|
-
lid: unknown;
|
|
113
|
-
}[] | undefined>;
|
|
142
|
+
sendPresenceUpdate: (type: import("../Types").WAPresence, toJid?: string) => Promise<void>;
|
|
143
|
+
presenceSubscribe: (toJid: string, tcToken?: Buffer) => Promise<void>;
|
|
144
|
+
profilePictureUrl: (jid: string, type?: "preview" | "image", timeoutMs?: number) => Promise<string | undefined>;
|
|
114
145
|
fetchBlocklist: () => Promise<string[]>;
|
|
115
|
-
fetchStatus: (
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
146
|
+
fetchStatus: (...jids: string[]) => Promise<import("..").USyncQueryResultList[] | undefined>;
|
|
147
|
+
fetchDisappearingDuration: (...jids: string[]) => Promise<import("..").USyncQueryResultList[] | undefined>;
|
|
148
|
+
updateProfilePicture: (jid: string, content: import("../Types").WAMediaUpload, dimensions?: {
|
|
149
|
+
width: number;
|
|
150
|
+
height: number;
|
|
151
|
+
}) => Promise<void>;
|
|
120
152
|
removeProfilePicture: (jid: string) => Promise<void>;
|
|
121
153
|
updateProfileStatus: (status: string) => Promise<void>;
|
|
122
154
|
updateProfileName: (name: string) => Promise<void>;
|
|
123
155
|
updateBlockStatus: (jid: string, action: "block" | "unblock") => Promise<void>;
|
|
156
|
+
updateDisableLinkPreviewsPrivacy: (isPreviewsDisabled: boolean) => Promise<void>;
|
|
157
|
+
updateCallPrivacy: (value: import("../Types").WAPrivacyCallValue) => Promise<void>;
|
|
158
|
+
updateMessagesPrivacy: (value: import("../Types").WAPrivacyMessagesValue) => Promise<void>;
|
|
124
159
|
updateLastSeenPrivacy: (value: import("../Types").WAPrivacyValue) => Promise<void>;
|
|
125
160
|
updateOnlinePrivacy: (value: import("../Types").WAPrivacyOnlineValue) => Promise<void>;
|
|
126
161
|
updateProfilePicturePrivacy: (value: import("../Types").WAPrivacyValue) => Promise<void>;
|
|
127
162
|
updateStatusPrivacy: (value: import("../Types").WAPrivacyValue) => Promise<void>;
|
|
128
163
|
updateReadReceiptsPrivacy: (value: import("../Types").WAReadReceiptsValue) => Promise<void>;
|
|
129
|
-
updateGroupsAddPrivacy: (value: import("../Types").
|
|
164
|
+
updateGroupsAddPrivacy: (value: import("../Types").WAPrivacyGroupAddValue) => Promise<void>;
|
|
130
165
|
updateDefaultDisappearingMode: (duration: number) => Promise<void>;
|
|
131
|
-
getBusinessProfile: (jid: string) => Promise<
|
|
132
|
-
resyncAppState: (collections: readonly ("
|
|
166
|
+
getBusinessProfile: (jid: string) => Promise<import("../Types").WABusinessProfile | void>;
|
|
167
|
+
resyncAppState: (collections: readonly ("critical_unblock_low" | "regular_high" | "regular_low" | "critical_block" | "regular")[], isInitialSync: boolean) => Promise<void>;
|
|
133
168
|
chatModify: (mod: import("../Types").ChatModification, jid: string) => Promise<void>;
|
|
134
|
-
cleanDirtyBits: (type: "account_sync" | "groups", fromTimestamp?:
|
|
169
|
+
cleanDirtyBits: (type: "account_sync" | "groups", fromTimestamp?: number | string) => Promise<void>;
|
|
170
|
+
addOrEditContact: (jid: string, contact: import("../Types").WAProto.SyncActionValue.IContactAction) => Promise<void>;
|
|
171
|
+
removeContact: (jid: string) => Promise<void>;
|
|
172
|
+
addLabel: (jid: string, labels: import("../Types/Label").LabelActionBody) => Promise<void>;
|
|
135
173
|
addChatLabel: (jid: string, labelId: string) => Promise<void>;
|
|
136
174
|
removeChatLabel: (jid: string, labelId: string) => Promise<void>;
|
|
137
175
|
addMessageLabel: (jid: string, messageId: string, labelId: string) => Promise<void>;
|
|
138
176
|
removeMessageLabel: (jid: string, messageId: string, labelId: string) => Promise<void>;
|
|
139
177
|
star: (jid: string, messages: {
|
|
140
178
|
id: string;
|
|
141
|
-
fromMe?: boolean
|
|
179
|
+
fromMe?: boolean;
|
|
142
180
|
}[], star: boolean) => Promise<void>;
|
|
181
|
+
addOrEditQuickReply: (quickReply: import("../Types/Bussines").QuickReplyAction) => Promise<void>;
|
|
182
|
+
removeQuickReply: (timestamp: string) => Promise<void>;
|
|
143
183
|
type: "md";
|
|
144
|
-
ws:
|
|
184
|
+
ws: import("./Client").WebSocketClient;
|
|
145
185
|
ev: import("../Types").BaileysEventEmitter & {
|
|
146
186
|
process(handler: (events: Partial<import("../Types").BaileysEventMap>) => void | Promise<void>): () => void;
|
|
147
187
|
buffer(): void;
|
|
148
|
-
createBufferedFunction<A extends any[],
|
|
149
|
-
flush(
|
|
188
|
+
createBufferedFunction<A extends any[], T>(work: (...args: A) => Promise<T>): (...args: A) => Promise<T>;
|
|
189
|
+
flush(): boolean;
|
|
150
190
|
isBuffering(): boolean;
|
|
151
191
|
};
|
|
152
192
|
authState: {
|
|
153
193
|
creds: import("../Types").AuthenticationCreds;
|
|
154
194
|
keys: import("../Types").SignalKeyStoreWithTransaction;
|
|
155
195
|
};
|
|
156
|
-
signalRepository: import("../Types").
|
|
196
|
+
signalRepository: import("../Types").SignalRepositoryWithLIDStore;
|
|
157
197
|
user: import("../Types").Contact | undefined;
|
|
158
198
|
generateMessageTag: () => string;
|
|
159
|
-
query: (node: import("
|
|
160
|
-
waitForMessage: <
|
|
199
|
+
query: (node: import("..").BinaryNode, timeoutMs?: number) => Promise<any>;
|
|
200
|
+
waitForMessage: <T>(msgId: string, timeoutMs?: number | undefined) => Promise<T | undefined>;
|
|
161
201
|
waitForSocketOpen: () => Promise<void>;
|
|
162
202
|
sendRawMessage: (data: Uint8Array | Buffer) => Promise<void>;
|
|
163
|
-
sendNode: (frame: import("
|
|
164
|
-
logout: (msg?: string
|
|
203
|
+
sendNode: (frame: import("..").BinaryNode) => Promise<void>;
|
|
204
|
+
logout: (msg?: string) => Promise<void>;
|
|
165
205
|
end: (error: Error | undefined) => void;
|
|
166
|
-
onUnexpectedError: (err: Error | import("@hapi/boom").Boom
|
|
167
|
-
uploadPreKeys: (count?: number) => Promise<void>;
|
|
206
|
+
onUnexpectedError: (err: Error | import("@hapi/boom").Boom, msg: string) => void;
|
|
207
|
+
uploadPreKeys: (count?: number, retryCount?: number) => Promise<void>;
|
|
168
208
|
uploadPreKeysToServerIfRequired: () => Promise<void>;
|
|
169
|
-
requestPairingCode: (phoneNumber: string) => Promise<string>;
|
|
170
|
-
waitForConnectionUpdate: (check: (u: Partial<import("../Types").ConnectionState>) => boolean | undefined
|
|
171
|
-
sendWAMBuffer: (wamBuffer: Buffer) => Promise<
|
|
209
|
+
requestPairingCode: (phoneNumber: string, customPairingCode?: string) => Promise<string>;
|
|
210
|
+
waitForConnectionUpdate: (check: (u: Partial<import("../Types").ConnectionState>) => Promise<boolean | undefined>, timeoutMs?: number) => Promise<void>;
|
|
211
|
+
sendWAMBuffer: (wamBuffer: Buffer) => Promise<any>;
|
|
212
|
+
executeUSyncQuery: (usyncQuery: import("..").USyncQuery) => Promise<import("..").USyncQueryResult | undefined>;
|
|
213
|
+
onWhatsApp: (...jids: string[]) => Promise<{
|
|
214
|
+
jid: string;
|
|
215
|
+
exists: boolean;
|
|
216
|
+
lid: string;
|
|
217
|
+
}[] | undefined>;
|
|
172
218
|
};
|
|
173
219
|
export default makeWASocket;
|
package/lib/Socket/index.js
CHANGED
|
@@ -1,11 +1,18 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const Defaults_1 = require("../Defaults");
|
|
4
|
-
const
|
|
4
|
+
const communities_1 = require("./communities");
|
|
5
5
|
// export the last socket layer
|
|
6
|
-
const makeWASocket = (config) =>
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
6
|
+
const makeWASocket = (config) => {
|
|
7
|
+
const newConfig = {
|
|
8
|
+
...Defaults_1.DEFAULT_CONNECTION_CONFIG,
|
|
9
|
+
...config
|
|
10
|
+
};
|
|
11
|
+
// If the user hasn't provided their own history sync function,
|
|
12
|
+
// let's create a default one that respects the syncFullHistory flag.
|
|
13
|
+
if (config.shouldSyncHistoryMessage === undefined) {
|
|
14
|
+
newConfig.shouldSyncHistoryMessage = () => !!newConfig.syncFullHistory;
|
|
15
|
+
}
|
|
16
|
+
return (0, communities_1.makeCommunitiesSocket)(newConfig);
|
|
17
|
+
};
|
|
10
18
|
exports.default = makeWASocket;
|
|
11
|
-
exports.makeWASocket = makeWASocket;
|
|
@@ -1,19 +1,15 @@
|
|
|
1
|
-
import Long = require('long');
|
|
2
1
|
import { Boom } from '@hapi/boom';
|
|
3
|
-
import
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
2
|
+
import Long from 'long';
|
|
3
|
+
import { proto } from '../../WAProto/index.js';
|
|
4
|
+
import type { MessageReceiptType, MessageRelayOptions, SocketConfig, WAMessageKey } from '../Types';
|
|
5
|
+
import { type BinaryNode } from '../WABinary';
|
|
6
6
|
export declare const makeMessagesRecvSocket: (config: SocketConfig) => {
|
|
7
7
|
sendMessageAck: ({ tag, attrs, content }: BinaryNode, errorCode?: number) => Promise<void>;
|
|
8
8
|
sendRetryRequest: (node: BinaryNode, forceIncludeKeys?: boolean) => Promise<void>;
|
|
9
9
|
rejectCall: (callId: string, callFrom: string) => Promise<void>;
|
|
10
|
-
offerCall: (toJid: string, isVideo?: boolean) => Promise<{
|
|
11
|
-
callId: string;
|
|
12
|
-
toJid: string;
|
|
13
|
-
isVideo: boolean;
|
|
14
|
-
}>;
|
|
15
10
|
fetchMessageHistory: (count: number, oldestMsgKey: WAMessageKey, oldestMsgTimestamp: number | Long) => Promise<string>;
|
|
16
11
|
requestPlaceholderResend: (messageKey: WAMessageKey) => Promise<string | undefined>;
|
|
12
|
+
messageRetryManager: import("../Utils").MessageRetryManager | null;
|
|
17
13
|
getPrivacyTokens: (jids: string[]) => Promise<any>;
|
|
18
14
|
assertSessions: (jids: string[], force: boolean) => Promise<boolean>;
|
|
19
15
|
relayMessage: (jid: string, message: proto.IMessage, { messageId: msgId, participant, additionalAttributes, additionalNodes, useUserDevicesCache, useCachedGroupMetadata, statusJidList }: MessageRelayOptions) => Promise<string>;
|
|
@@ -25,36 +21,39 @@ export declare const makeMessagesRecvSocket: (config: SocketConfig) => {
|
|
|
25
21
|
fetchPrivacySettings: (force?: boolean) => Promise<{
|
|
26
22
|
[_: string]: string;
|
|
27
23
|
}>;
|
|
28
|
-
|
|
29
|
-
createParticipantNodes: (jids: string[], message: proto.IMessage, extraAttrs?: BinaryNode["attrs"]) => Promise<{
|
|
24
|
+
sendPeerDataOperationMessage: (pdoMessage: proto.Message.IPeerDataOperationRequestMessage) => Promise<string>;
|
|
25
|
+
createParticipantNodes: (jids: string[], message: proto.IMessage, extraAttrs?: BinaryNode["attrs"], dsmMessage?: proto.IMessage) => Promise<{
|
|
30
26
|
nodes: BinaryNode[];
|
|
31
27
|
shouldIncludeDeviceIdentity: boolean;
|
|
32
28
|
}>;
|
|
33
|
-
|
|
29
|
+
getUSyncDevices: (jids: string[], useCache: boolean, ignoreZeroDevices: boolean) => Promise<(import("../WABinary").JidWithDevice & {
|
|
30
|
+
wireJid: string;
|
|
31
|
+
})[]>;
|
|
34
32
|
updateMediaMessage: (message: proto.IWebMessageInfo) => Promise<proto.IWebMessageInfo>;
|
|
35
|
-
sendMessage: (jid: string, content: import("../Types").AnyMessageContent, options?: import("../Types").MiscMessageGenerationOptions) => Promise<proto.WebMessageInfo>;
|
|
33
|
+
sendMessage: (jid: string, content: import("../Types").AnyMessageContent, options?: import("../Types").MiscMessageGenerationOptions) => Promise<proto.WebMessageInfo | undefined>;
|
|
34
|
+
newsletterCreate: (name: string, description?: string) => Promise<import("../Types").NewsletterMetadata>;
|
|
35
|
+
newsletterUpdate: (jid: string, updates: import("../Types").NewsletterUpdate) => Promise<unknown>;
|
|
36
|
+
newsletterSubscribers: (jid: string) => Promise<{
|
|
37
|
+
subscribers: number;
|
|
38
|
+
}>;
|
|
39
|
+
newsletterMetadata: (type: "invite" | "jid", key: string) => Promise<import("../Types").NewsletterMetadata | null>;
|
|
40
|
+
newsletterFollow: (jid: string) => Promise<unknown>;
|
|
41
|
+
newsletterUnfollow: (jid: string) => Promise<unknown>;
|
|
42
|
+
newsletterMute: (jid: string) => Promise<unknown>;
|
|
43
|
+
newsletterUnmute: (jid: string) => Promise<unknown>;
|
|
44
|
+
newsletterUpdateName: (jid: string, name: string) => Promise<unknown>;
|
|
45
|
+
newsletterUpdateDescription: (jid: string, description: string) => Promise<unknown>;
|
|
46
|
+
newsletterUpdatePicture: (jid: string, content: import("../Types").WAMediaUpload) => Promise<unknown>;
|
|
47
|
+
newsletterRemovePicture: (jid: string) => Promise<unknown>;
|
|
48
|
+
newsletterReactMessage: (jid: string, serverId: string, reaction?: string) => Promise<void>;
|
|
49
|
+
newsletterFetchMessages: (jid: string, count: number, since: number, after: number) => Promise<any>;
|
|
36
50
|
subscribeNewsletterUpdates: (jid: string) => Promise<{
|
|
37
51
|
duration: string;
|
|
38
|
-
}>;
|
|
39
|
-
newsletterReactionMode: (jid: string, mode: import("../Types").NewsletterReactionMode) => Promise<void>;
|
|
40
|
-
newsletterUpdateDescription: (jid: string, description?: string) => Promise<void>;
|
|
41
|
-
newsletterUpdateName: (jid: string, name: string) => Promise<void>;
|
|
42
|
-
newsletterUpdatePicture: (jid: string, content: import("../Types").WAMediaUpload) => Promise<void>;
|
|
43
|
-
newsletterRemovePicture: (jid: string) => Promise<void>;
|
|
44
|
-
newsletterUnfollow: (jid: string) => Promise<void>;
|
|
45
|
-
newsletterFollow: (jid: string) => Promise<void>;
|
|
46
|
-
newsletterUnmute: (jid: string) => Promise<void>;
|
|
47
|
-
newsletterMute: (jid: string) => Promise<void>;
|
|
48
|
-
newsletterCreate: (name: string, description?: string, picture?: import("../Types").WAMediaUpload) => Promise<import("../Types").NewsletterMetadata>;
|
|
49
|
-
newsletterMetadata: (type: "invite" | "jid", key: string, role?: import("../Types").NewsletterViewRole) => Promise<import("../Types").NewsletterMetadata>;
|
|
52
|
+
} | null>;
|
|
50
53
|
newsletterAdminCount: (jid: string) => Promise<number>;
|
|
51
|
-
newsletterChangeOwner: (jid: string,
|
|
52
|
-
newsletterDemote: (jid: string,
|
|
54
|
+
newsletterChangeOwner: (jid: string, newOwnerJid: string) => Promise<void>;
|
|
55
|
+
newsletterDemote: (jid: string, userJid: string) => Promise<void>;
|
|
53
56
|
newsletterDelete: (jid: string) => Promise<void>;
|
|
54
|
-
newsletterReactMessage: (jid: string, server_id: string, code?: string) => Promise<void>;
|
|
55
|
-
newsletterFetchMessages: (type: "invite" | "jid", key: string, count: number, after?: number) => Promise<import("../Types").NewsletterFetchedUpdate[]>;
|
|
56
|
-
newsletterFetchUpdates: (jid: string, count: number, after?: number, since?: number) => Promise<import("../Types").NewsletterFetchedUpdate[]>;
|
|
57
|
-
groupQuery: (jid: string, type: "get" | "set", content: BinaryNode[]) => Promise<any>;
|
|
58
57
|
groupMetadata: (jid: string) => Promise<import("../Types").GroupMetadata>;
|
|
59
58
|
groupCreate: (subject: string, participants: string[]) => Promise<import("../Types").GroupMetadata>;
|
|
60
59
|
groupLeave: (id: string) => Promise<void>;
|
|
@@ -85,6 +84,9 @@ export declare const makeMessagesRecvSocket: (config: SocketConfig) => {
|
|
|
85
84
|
groupFetchAllParticipating: () => Promise<{
|
|
86
85
|
[_: string]: import("../Types").GroupMetadata;
|
|
87
86
|
}>;
|
|
87
|
+
createCallLink: (type: "audio" | "video", event?: {
|
|
88
|
+
startTime: number;
|
|
89
|
+
}, timeoutMs?: number) => Promise<string | undefined>;
|
|
88
90
|
getBotListV2: () => Promise<import("../Types").BotListInfo[]>;
|
|
89
91
|
processingMutex: {
|
|
90
92
|
mutex<T>(code: () => Promise<T> | T): Promise<T>;
|
|
@@ -94,19 +96,18 @@ export declare const makeMessagesRecvSocket: (config: SocketConfig) => {
|
|
|
94
96
|
sendPresenceUpdate: (type: import("../Types").WAPresence, toJid?: string) => Promise<void>;
|
|
95
97
|
presenceSubscribe: (toJid: string, tcToken?: Buffer) => Promise<void>;
|
|
96
98
|
profilePictureUrl: (jid: string, type?: "preview" | "image", timeoutMs?: number) => Promise<string | undefined>;
|
|
97
|
-
onWhatsApp: (...jids: string[]) => Promise<{
|
|
98
|
-
jid: string;
|
|
99
|
-
exists: unknown;
|
|
100
|
-
lid: unknown;
|
|
101
|
-
}[] | undefined>;
|
|
102
99
|
fetchBlocklist: () => Promise<string[]>;
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
updateProfilePicture: (jid: string, content: import("../Types").WAMediaUpload
|
|
100
|
+
fetchStatus: (...jids: string[]) => Promise<import("../index.js").USyncQueryResultList[] | undefined>;
|
|
101
|
+
fetchDisappearingDuration: (...jids: string[]) => Promise<import("../index.js").USyncQueryResultList[] | undefined>;
|
|
102
|
+
updateProfilePicture: (jid: string, content: import("../Types").WAMediaUpload, dimensions?: {
|
|
103
|
+
width: number;
|
|
104
|
+
height: number;
|
|
105
|
+
}) => Promise<void>;
|
|
106
106
|
removeProfilePicture: (jid: string) => Promise<void>;
|
|
107
107
|
updateProfileStatus: (status: string) => Promise<void>;
|
|
108
108
|
updateProfileName: (name: string) => Promise<void>;
|
|
109
109
|
updateBlockStatus: (jid: string, action: "block" | "unblock") => Promise<void>;
|
|
110
|
+
updateDisableLinkPreviewsPrivacy: (isPreviewsDisabled: boolean) => Promise<void>;
|
|
110
111
|
updateCallPrivacy: (value: import("../Types").WAPrivacyCallValue) => Promise<void>;
|
|
111
112
|
updateMessagesPrivacy: (value: import("../Types").WAPrivacyMessagesValue) => Promise<void>;
|
|
112
113
|
updateLastSeenPrivacy: (value: import("../Types").WAPrivacyValue) => Promise<void>;
|
|
@@ -120,6 +121,9 @@ export declare const makeMessagesRecvSocket: (config: SocketConfig) => {
|
|
|
120
121
|
resyncAppState: (collections: readonly ("critical_unblock_low" | "regular_high" | "regular_low" | "critical_block" | "regular")[], isInitialSync: boolean) => Promise<void>;
|
|
121
122
|
chatModify: (mod: import("../Types").ChatModification, jid: string) => Promise<void>;
|
|
122
123
|
cleanDirtyBits: (type: "account_sync" | "groups", fromTimestamp?: number | string) => Promise<void>;
|
|
124
|
+
addOrEditContact: (jid: string, contact: proto.SyncActionValue.IContactAction) => Promise<void>;
|
|
125
|
+
removeContact: (jid: string) => Promise<void>;
|
|
126
|
+
addLabel: (jid: string, labels: import("../Types/Label.js").LabelActionBody) => Promise<void>;
|
|
123
127
|
addChatLabel: (jid: string, labelId: string) => Promise<void>;
|
|
124
128
|
removeChatLabel: (jid: string, labelId: string) => Promise<void>;
|
|
125
129
|
addMessageLabel: (jid: string, messageId: string, labelId: string) => Promise<void>;
|
|
@@ -128,34 +132,41 @@ export declare const makeMessagesRecvSocket: (config: SocketConfig) => {
|
|
|
128
132
|
id: string;
|
|
129
133
|
fromMe?: boolean;
|
|
130
134
|
}[], star: boolean) => Promise<void>;
|
|
131
|
-
|
|
135
|
+
addOrEditQuickReply: (quickReply: import("../Types/Bussines.js").QuickReplyAction) => Promise<void>;
|
|
136
|
+
removeQuickReply: (timestamp: string) => Promise<void>;
|
|
132
137
|
type: "md";
|
|
133
|
-
ws: import("./Client").WebSocketClient;
|
|
138
|
+
ws: import("./Client/websocket.js").WebSocketClient;
|
|
134
139
|
ev: import("../Types").BaileysEventEmitter & {
|
|
135
|
-
process(handler: (events: Partial<import("../Types").BaileysEventMap>) => void | Promise<void>): (
|
|
140
|
+
process(handler: (events: Partial<import("../Types").BaileysEventMap>) => void | Promise<void>): () => void;
|
|
136
141
|
buffer(): void;
|
|
137
|
-
createBufferedFunction<A extends any[], T>(work: (...args: A) => Promise<T>): (
|
|
138
|
-
flush(
|
|
142
|
+
createBufferedFunction<A extends any[], T>(work: (...args: A) => Promise<T>): (...args: A) => Promise<T>;
|
|
143
|
+
flush(): boolean;
|
|
139
144
|
isBuffering(): boolean;
|
|
140
145
|
};
|
|
141
146
|
authState: {
|
|
142
147
|
creds: import("../Types").AuthenticationCreds;
|
|
143
148
|
keys: import("../Types").SignalKeyStoreWithTransaction;
|
|
144
149
|
};
|
|
145
|
-
signalRepository: import("../Types").
|
|
150
|
+
signalRepository: import("../Types").SignalRepositoryWithLIDStore;
|
|
146
151
|
user: import("../Types").Contact | undefined;
|
|
147
152
|
generateMessageTag: () => string;
|
|
148
153
|
query: (node: BinaryNode, timeoutMs?: number) => Promise<any>;
|
|
149
|
-
waitForMessage: <T>(msgId: string, timeoutMs?: number | undefined) => Promise<
|
|
154
|
+
waitForMessage: <T>(msgId: string, timeoutMs?: number | undefined) => Promise<T | undefined>;
|
|
150
155
|
waitForSocketOpen: () => Promise<void>;
|
|
151
156
|
sendRawMessage: (data: Uint8Array | Buffer) => Promise<void>;
|
|
152
157
|
sendNode: (frame: BinaryNode) => Promise<void>;
|
|
153
158
|
logout: (msg?: string) => Promise<void>;
|
|
154
159
|
end: (error: Error | undefined) => void;
|
|
155
160
|
onUnexpectedError: (err: Error | Boom, msg: string) => void;
|
|
156
|
-
uploadPreKeys: (count?: number) => Promise<void>;
|
|
161
|
+
uploadPreKeys: (count?: number, retryCount?: number) => Promise<void>;
|
|
157
162
|
uploadPreKeysToServerIfRequired: () => Promise<void>;
|
|
158
|
-
requestPairingCode: (phoneNumber:
|
|
163
|
+
requestPairingCode: (phoneNumber: string, customPairingCode?: string) => Promise<string>;
|
|
159
164
|
waitForConnectionUpdate: (check: (u: Partial<import("../Types").ConnectionState>) => Promise<boolean | undefined>, timeoutMs?: number) => Promise<void>;
|
|
160
165
|
sendWAMBuffer: (wamBuffer: Buffer) => Promise<any>;
|
|
166
|
+
executeUSyncQuery: (usyncQuery: import("../index.js").USyncQuery) => Promise<import("../index.js").USyncQueryResult | undefined>;
|
|
167
|
+
onWhatsApp: (...jids: string[]) => Promise<{
|
|
168
|
+
jid: string;
|
|
169
|
+
exists: boolean;
|
|
170
|
+
lid: string;
|
|
171
|
+
}[] | undefined>;
|
|
161
172
|
};
|