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