@queenanya/baileys 7.4.14 → 7.5.3-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/README.md +26 -26
- package/lib/Defaults/baileys-version.json +1 -1
- package/lib/Defaults/index.d.ts +1 -231
- package/lib/Defaults/index.js +11 -23
- package/lib/Socket/Client/index.d.ts +2 -3
- package/lib/Socket/Client/index.js +2 -3
- package/lib/Socket/Client/{web-socket-client.d.ts → websocket.d.ts} +1 -1
- package/lib/Socket/Client/{web-socket-client.js → websocket.js} +2 -2
- package/lib/Socket/business.d.ts +31 -28
- package/lib/Socket/chats.d.ts +17 -9
- package/lib/Socket/chats.js +115 -116
- package/lib/Socket/{registration.d.ts → communities.d.ts} +94 -145
- package/lib/Socket/communities.js +354 -0
- package/lib/Socket/groups.d.ts +23 -10
- package/lib/Socket/groups.js +12 -1
- package/lib/Socket/index.d.ts +69 -38
- package/lib/Socket/index.js +2 -2
- package/lib/Socket/messages-recv.d.ts +30 -28
- package/lib/Socket/messages-recv.js +291 -180
- package/lib/Socket/messages-send.d.ts +25 -19
- package/lib/Socket/messages-send.js +110 -76
- package/lib/Socket/newsletter.d.ts +19 -13
- package/lib/Socket/newsletter.js +67 -54
- package/lib/Socket/socket.d.ts +3 -1
- package/lib/Socket/socket.js +15 -17
- package/lib/Socket/usync.d.ts +38 -0
- package/lib/Socket/usync.js +70 -0
- package/lib/Store/make-cache-manager-store.d.ts +2 -1
- package/lib/Store/make-in-memory-store.js +13 -11
- package/lib/Store/make-ordered-dictionary.js +2 -2
- package/lib/Types/Auth.d.ts +1 -6
- package/lib/Types/Call.d.ts +1 -1
- package/lib/Types/Chat.d.ts +15 -7
- package/lib/Types/Contact.d.ts +6 -1
- package/lib/Types/Events.d.ts +44 -2
- package/lib/Types/GroupMetadata.d.ts +3 -1
- package/lib/Types/Label.d.ts +11 -0
- package/lib/Types/Message.d.ts +37 -30
- package/lib/Types/Newsletter.d.ts +0 -13
- package/lib/Types/Newsletter.js +1 -15
- package/lib/Types/Socket.d.ts +10 -3
- package/lib/Types/USync.d.ts +25 -0
- package/lib/Types/USync.js +2 -0
- package/lib/Types/index.d.ts +8 -0
- package/lib/Utils/auth-utils.js +1 -7
- package/lib/Utils/chat-utils.d.ts +5 -4
- package/lib/Utils/chat-utils.js +52 -20
- package/lib/Utils/crypto.d.ts +2 -1
- package/lib/Utils/crypto.js +4 -2
- package/lib/Utils/decode-wa-message.d.ts +1 -0
- package/lib/Utils/decode-wa-message.js +34 -14
- package/lib/Utils/event-buffer.js +14 -8
- package/lib/Utils/generics.d.ts +37 -13
- package/lib/Utils/generics.js +103 -18
- package/lib/Utils/history.d.ts +6 -2
- package/lib/Utils/history.js +3 -0
- package/lib/Utils/index.d.ts +1 -0
- package/lib/Utils/index.js +1 -0
- package/lib/Utils/link-preview.js +24 -1
- package/lib/Utils/logger.d.ts +1 -3
- package/lib/Utils/make-mutex.js +1 -0
- package/lib/Utils/messages-media.d.ts +3 -2
- package/lib/Utils/messages-media.js +17 -32
- package/lib/Utils/messages.d.ts +1 -0
- package/lib/Utils/messages.js +67 -72
- package/lib/Utils/noise-handler.d.ts +3 -3
- package/lib/Utils/noise-handler.js +7 -12
- package/lib/Utils/process-message.d.ts +3 -2
- package/lib/Utils/process-message.js +55 -21
- package/lib/Utils/signal.js +23 -16
- package/lib/Utils/use-multi-file-auth-state.js +17 -3
- package/lib/Utils/validate-connection.d.ts +0 -1
- package/lib/Utils/validate-connection.js +10 -44
- package/lib/WABinary/constants.js +5 -5
- package/lib/WABinary/decode.d.ts +3 -2
- package/lib/WABinary/decode.js +6 -4
- package/lib/WABinary/encode.d.ts +1 -2
- package/lib/WABinary/encode.js +8 -6
- package/lib/WABinary/generic-utils.d.ts +1 -0
- package/lib/WABinary/jid-utils.d.ts +3 -3
- package/lib/WABinary/jid-utils.js +5 -5
- package/lib/WAM/BinaryInfo.d.ts +3 -2
- package/lib/WAM/constants.d.ts +3 -2
- package/lib/WAM/encode.d.ts +1 -0
- package/lib/WAM/encode.js +2 -2
- package/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.d.ts +1 -0
- package/lib/index.js +1 -0
- package/package.json +36 -34
- package/lib/Defaults/phonenumber-mcc.json +0 -223
- package/lib/Socket/Client/mobile-socket-client.d.ts +0 -13
- package/lib/Socket/Client/mobile-socket-client.js +0 -65
- package/lib/Socket/registration.js +0 -166
- /package/lib/Socket/Client/{abstract-socket-client.d.ts → types.d.ts} +0 -0
- /package/lib/Socket/Client/{abstract-socket-client.js → types.js} +0 -0
package/lib/Socket/index.d.ts
CHANGED
|
@@ -1,9 +1,39 @@
|
|
|
1
|
+
/// <reference types="long" />
|
|
2
|
+
/// <reference types="node" />
|
|
1
3
|
/// <reference types="node" />
|
|
2
4
|
import { UserFacingSocketConfig } from '../Types';
|
|
3
5
|
declare const makeWASocket: (config: UserFacingSocketConfig) => {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
6
|
+
communityMetadata: (jid: string) => Promise<import("../Types").GroupMetadata>;
|
|
7
|
+
communityCreate: (subject: any, body: any) => Promise<import("../Types").GroupMetadata | null>;
|
|
8
|
+
communityLeave: (id: string) => Promise<void>;
|
|
9
|
+
communityUpdateSubject: (jid: string, subject: string) => Promise<void>;
|
|
10
|
+
communityRequestParticipantsList: (jid: string) => Promise<{
|
|
11
|
+
[key: string]: string;
|
|
12
|
+
}[]>;
|
|
13
|
+
communityRequestParticipantsUpdate: (jid: string, participants: string[], action: "reject" | "approve") => 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 | undefined) => 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<string>;
|
|
28
|
+
communityGetInviteInfo: (code: string) => Promise<import("../Types").GroupMetadata>;
|
|
29
|
+
communityToggleEphemeral: (jid: string, ephemeralExpiration: number) => Promise<void>;
|
|
30
|
+
communitySettingUpdate: (jid: string, setting: "announcement" | "locked" | "not_announcement" | "unlocked") => Promise<void>;
|
|
31
|
+
communityMemberAddMode: (jid: string, mode: "all_member_add" | "admin_add") => Promise<void>;
|
|
32
|
+
communityJoinApprovalMode: (jid: string, mode: "on" | "off") => Promise<void>;
|
|
33
|
+
communityFetchAllParticipating: () => Promise<{
|
|
34
|
+
[_: string]: import("../Types").GroupMetadata;
|
|
35
|
+
}>;
|
|
36
|
+
logger: import("pino").Logger<never, boolean>;
|
|
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[];
|
|
@@ -17,34 +47,30 @@ 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
|
-
sendMessageAck: ({ tag, attrs, content }: import("
|
|
21
|
-
sendRetryRequest: (node: import("
|
|
22
|
-
offerCall: (toJid: string, isVideo?: boolean) => Promise<{
|
|
23
|
-
id: string;
|
|
24
|
-
to: string;
|
|
25
|
-
}>;
|
|
50
|
+
sendMessageAck: ({ tag, attrs, content }: import("..").BinaryNode) => Promise<void>;
|
|
51
|
+
sendRetryRequest: (node: import("..").BinaryNode, forceIncludeKeys?: boolean) => Promise<void>;
|
|
26
52
|
rejectCall: (callId: string, callFrom: string) => Promise<void>;
|
|
27
|
-
|
|
53
|
+
fetchMessageHistory: (count: number, oldestMsgKey: import("../Types").WAMessageKey, oldestMsgTimestamp: number | import("long").Long) => Promise<string>;
|
|
54
|
+
requestPlaceholderResend: (messageKey: import("../Types").WAMessageKey) => Promise<string | undefined>;
|
|
55
|
+
getPrivacyTokens: (jids: string[]) => Promise<import("..").BinaryNode>;
|
|
28
56
|
assertSessions: (jids: string[], force: boolean) => Promise<boolean>;
|
|
29
|
-
relayMessage: (jid: string, message: import("../Types").WAProto.IMessage, { messageId: msgId, participant, additionalAttributes, additionalNodes, useUserDevicesCache,
|
|
57
|
+
relayMessage: (jid: string, message: import("../Types").WAProto.IMessage, { messageId: msgId, participant, additionalAttributes, additionalNodes, useUserDevicesCache, useCachedGroupMetadata, statusJidList }: import("../Types").MessageRelayOptions) => Promise<string>;
|
|
30
58
|
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>;
|
|
59
|
+
sendReceipts: (keys: import("../Types").WAMessageKey[], type: import("../Types").MessageReceiptType) => Promise<void>;
|
|
60
|
+
readMessages: (keys: import("../Types").WAMessageKey[]) => Promise<void>;
|
|
36
61
|
refreshMediaConn: (forceGet?: boolean) => Promise<import("../Types").MediaConnInfo>;
|
|
37
|
-
|
|
62
|
+
waUploadToServer: import("../Types").WAMediaUploadFunction;
|
|
63
|
+
fetchPrivacySettings: (force?: boolean) => Promise<{
|
|
64
|
+
[_: string]: string;
|
|
65
|
+
}>;
|
|
66
|
+
sendPeerDataOperationMessage: (pdoMessage: import("../Types").WAProto.Message.IPeerDataOperationRequestMessage) => Promise<string>;
|
|
38
67
|
createParticipantNodes: (jids: string[], message: import("../Types").WAProto.IMessage, extraAttrs?: {
|
|
39
68
|
[key: string]: string;
|
|
40
69
|
} | undefined) => Promise<{
|
|
41
|
-
nodes: import("
|
|
70
|
+
nodes: import("..").BinaryNode[];
|
|
42
71
|
shouldIncludeDeviceIdentity: boolean;
|
|
43
72
|
}>;
|
|
44
|
-
|
|
45
|
-
fetchPrivacySettings: (force?: boolean) => Promise<{
|
|
46
|
-
[_: string]: string;
|
|
47
|
-
}>;
|
|
73
|
+
getUSyncDevices: (jids: string[], useCache: boolean, ignoreZeroDevices: boolean) => Promise<import("..").JidWithDevice[]>;
|
|
48
74
|
updateMediaMessage: (message: import("../Types").WAProto.IWebMessageInfo) => Promise<import("../Types").WAProto.IWebMessageInfo>;
|
|
49
75
|
sendMessage: (jid: string, content: import("../Types").AnyMessageContent, options?: import("../Types").MiscMessageGenerationOptions) => Promise<import("../Types").WAProto.WebMessageInfo | undefined>;
|
|
50
76
|
subscribeNewsletterUpdates: (jid: string) => Promise<{
|
|
@@ -59,14 +85,13 @@ declare const makeWASocket: (config: UserFacingSocketConfig) => {
|
|
|
59
85
|
newsletterFollow: (jid: string) => Promise<void>;
|
|
60
86
|
newsletterUnmute: (jid: string) => Promise<void>;
|
|
61
87
|
newsletterMute: (jid: string) => Promise<void>;
|
|
62
|
-
|
|
63
|
-
newsletterCreate: (name: string, description: string, reaction_codes: string) => Promise<import("../Types").NewsletterMetadata>;
|
|
88
|
+
newsletterCreate: (name: string, description: string) => Promise<import("../Types").NewsletterMetadata>;
|
|
64
89
|
newsletterMetadata: (type: "invite" | "jid", key: string, role?: import("../Types").NewsletterViewRole | undefined) => Promise<import("../Types").NewsletterMetadata>;
|
|
65
90
|
newsletterAdminCount: (jid: string) => Promise<number>;
|
|
66
91
|
newsletterChangeOwner: (jid: string, user: string) => Promise<void>;
|
|
67
92
|
newsletterDemote: (jid: string, user: string) => Promise<void>;
|
|
68
93
|
newsletterDelete: (jid: string) => Promise<void>;
|
|
69
|
-
newsletterReactMessage: (jid: string,
|
|
94
|
+
newsletterReactMessage: (jid: string, server_id: string, code?: string | undefined) => Promise<void>;
|
|
70
95
|
newsletterFetchMessages: (type: "invite" | "jid", key: string, count: number, after?: number | undefined) => Promise<import("../Types").NewsletterFetchedUpdate[]>;
|
|
71
96
|
newsletterFetchUpdates: (jid: string, count: number, after?: number | undefined, since?: number | undefined) => Promise<import("../Types").NewsletterFetchedUpdate[]>;
|
|
72
97
|
groupMetadata: (jid: string) => Promise<import("../Types").GroupMetadata>;
|
|
@@ -83,13 +108,14 @@ declare const makeWASocket: (config: UserFacingSocketConfig) => {
|
|
|
83
108
|
groupParticipantsUpdate: (jid: string, participants: string[], action: import("../Types").ParticipantAction) => Promise<{
|
|
84
109
|
status: string;
|
|
85
110
|
jid: string;
|
|
86
|
-
content: import("
|
|
111
|
+
content: import("..").BinaryNode;
|
|
87
112
|
}[]>;
|
|
88
113
|
groupUpdateDescription: (jid: string, description?: string | undefined) => Promise<void>;
|
|
89
114
|
groupInviteCode: (jid: string) => Promise<string | undefined>;
|
|
90
115
|
groupRevokeInvite: (jid: string) => Promise<string | undefined>;
|
|
91
116
|
groupAcceptInvite: (code: string) => Promise<string | undefined>;
|
|
92
|
-
|
|
117
|
+
groupRevokeInviteV4: (groupJid: string, invitedJid: string) => Promise<boolean>;
|
|
118
|
+
groupAcceptInviteV4: (key: string | import("../Types").WAMessageKey, inviteMessage: import("../Types").WAProto.Message.IGroupInviteMessage) => Promise<string>;
|
|
93
119
|
groupGetInviteInfo: (code: string) => Promise<import("../Types").GroupMetadata>;
|
|
94
120
|
groupToggleEphemeral: (jid: string, ephemeralExpiration: number) => Promise<void>;
|
|
95
121
|
groupSettingUpdate: (jid: string, setting: "announcement" | "locked" | "not_announcement" | "unlocked") => Promise<void>;
|
|
@@ -107,30 +133,34 @@ declare const makeWASocket: (config: UserFacingSocketConfig) => {
|
|
|
107
133
|
presenceSubscribe: (toJid: string, tcToken?: Buffer | undefined) => Promise<void>;
|
|
108
134
|
profilePictureUrl: (jid: string, type?: "image" | "preview", timeoutMs?: number | undefined) => Promise<string | undefined>;
|
|
109
135
|
onWhatsApp: (...jids: string[]) => Promise<{
|
|
110
|
-
exists: boolean;
|
|
111
136
|
jid: string;
|
|
112
|
-
|
|
137
|
+
exists: unknown;
|
|
138
|
+
}[] | undefined>;
|
|
113
139
|
fetchBlocklist: () => Promise<string[]>;
|
|
114
|
-
fetchStatus: (
|
|
115
|
-
|
|
116
|
-
setAt: Date;
|
|
117
|
-
} | undefined>;
|
|
140
|
+
fetchStatus: (...jids: string[]) => Promise<import("..").USyncQueryResultList[] | undefined>;
|
|
141
|
+
fetchDisappearingDuration: (...jids: string[]) => Promise<import("..").USyncQueryResultList[] | undefined>;
|
|
118
142
|
updateProfilePicture: (jid: string, content: import("../Types").WAMediaUpload) => Promise<void>;
|
|
143
|
+
updateProfilePictureFull: (jid: any, content: any) => Promise<void>;
|
|
144
|
+
updateProfilePictureFull2: (jid: any, content: any) => Promise<void>;
|
|
119
145
|
removeProfilePicture: (jid: string) => Promise<void>;
|
|
120
146
|
updateProfileStatus: (status: string) => Promise<void>;
|
|
121
147
|
updateProfileName: (name: string) => Promise<void>;
|
|
122
148
|
updateBlockStatus: (jid: string, action: "block" | "unblock") => Promise<void>;
|
|
149
|
+
updateCallPrivacy: (value: import("../Types").WAPrivacyCallValue) => Promise<void>;
|
|
123
150
|
updateLastSeenPrivacy: (value: import("../Types").WAPrivacyValue) => Promise<void>;
|
|
124
151
|
updateOnlinePrivacy: (value: import("../Types").WAPrivacyOnlineValue) => Promise<void>;
|
|
125
152
|
updateProfilePicturePrivacy: (value: import("../Types").WAPrivacyValue) => Promise<void>;
|
|
126
153
|
updateStatusPrivacy: (value: import("../Types").WAPrivacyValue) => Promise<void>;
|
|
127
154
|
updateReadReceiptsPrivacy: (value: import("../Types").WAReadReceiptsValue) => Promise<void>;
|
|
128
|
-
updateGroupsAddPrivacy: (value: import("../Types").
|
|
155
|
+
updateGroupsAddPrivacy: (value: import("../Types").WAPrivacyGroupAddValue) => Promise<void>;
|
|
129
156
|
updateDefaultDisappearingMode: (duration: number) => Promise<void>;
|
|
130
157
|
getBusinessProfile: (jid: string) => Promise<void | import("../Types").WABusinessProfile>;
|
|
131
158
|
resyncAppState: (collections: readonly ("critical_block" | "critical_unblock_low" | "regular_high" | "regular_low" | "regular")[], isInitialSync: boolean) => Promise<void>;
|
|
132
159
|
chatModify: (mod: import("../Types").ChatModification, jid: string) => Promise<void>;
|
|
133
160
|
cleanDirtyBits: (type: "account_sync" | "groups", fromTimestamp?: string | number | undefined) => Promise<void>;
|
|
161
|
+
addOrEditContact: (jid: string, contact: import("../Types").ContactAction) => Promise<void>;
|
|
162
|
+
removeContact: (jid: string) => Promise<void>;
|
|
163
|
+
addLabel: (jid: string, labels: import("../Types/Label").LabelActionBody) => Promise<void>;
|
|
134
164
|
addChatLabel: (jid: string, labelId: string) => Promise<void>;
|
|
135
165
|
removeChatLabel: (jid: string, labelId: string) => Promise<void>;
|
|
136
166
|
addMessageLabel: (jid: string, messageId: string, labelId: string) => Promise<void>;
|
|
@@ -139,8 +169,9 @@ declare const makeWASocket: (config: UserFacingSocketConfig) => {
|
|
|
139
169
|
id: string;
|
|
140
170
|
fromMe?: boolean | undefined;
|
|
141
171
|
}[], star: boolean) => Promise<void>;
|
|
172
|
+
executeUSyncQuery: (usyncQuery: import("..").USyncQuery) => Promise<import("..").USyncQueryResult | undefined>;
|
|
142
173
|
type: "md";
|
|
143
|
-
ws:
|
|
174
|
+
ws: import("./Client").WebSocketClient;
|
|
144
175
|
ev: import("../Types").BaileysEventEmitter & {
|
|
145
176
|
process(handler: (events: Partial<import("../Types").BaileysEventMap>) => void | Promise<void>): () => void;
|
|
146
177
|
buffer(): void;
|
|
@@ -155,11 +186,11 @@ declare const makeWASocket: (config: UserFacingSocketConfig) => {
|
|
|
155
186
|
signalRepository: import("../Types").SignalRepository;
|
|
156
187
|
user: import("../Types").Contact | undefined;
|
|
157
188
|
generateMessageTag: () => string;
|
|
158
|
-
query: (node: import("
|
|
189
|
+
query: (node: import("..").BinaryNode, timeoutMs?: number | undefined) => Promise<import("..").BinaryNode>;
|
|
159
190
|
waitForMessage: <T_2>(msgId: string, timeoutMs?: number | undefined) => Promise<T_2>;
|
|
160
191
|
waitForSocketOpen: () => Promise<void>;
|
|
161
192
|
sendRawMessage: (data: Uint8Array | Buffer) => Promise<void>;
|
|
162
|
-
sendNode: (frame: import("
|
|
193
|
+
sendNode: (frame: import("..").BinaryNode) => Promise<void>;
|
|
163
194
|
logout: (msg?: string | undefined) => Promise<void>;
|
|
164
195
|
end: (error: Error | undefined) => void;
|
|
165
196
|
onUnexpectedError: (err: Error | import("@hapi/boom").Boom<any>, msg: string) => void;
|
|
@@ -167,6 +198,6 @@ declare const makeWASocket: (config: UserFacingSocketConfig) => {
|
|
|
167
198
|
uploadPreKeysToServerIfRequired: () => Promise<void>;
|
|
168
199
|
requestPairingCode: (phoneNumber: string) => Promise<string>;
|
|
169
200
|
waitForConnectionUpdate: (check: (u: Partial<import("../Types").ConnectionState>) => boolean | undefined, timeoutMs?: number | undefined) => Promise<void>;
|
|
170
|
-
sendWAMBuffer: (wamBuffer: Buffer) => Promise<import("
|
|
201
|
+
sendWAMBuffer: (wamBuffer: Buffer) => Promise<import("..").BinaryNode>;
|
|
171
202
|
};
|
|
172
203
|
export default makeWASocket;
|
package/lib/Socket/index.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
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) => ((0,
|
|
6
|
+
const makeWASocket = (config) => ((0, communities_1.makeCommunitiesSocket)({
|
|
7
7
|
...Defaults_1.DEFAULT_CONNECTION_CONFIG,
|
|
8
8
|
...config
|
|
9
9
|
}));
|
|
@@ -1,37 +1,34 @@
|
|
|
1
1
|
/// <reference types="node" />
|
|
2
|
+
/// <reference types="node" />
|
|
2
3
|
import { Boom } from '@hapi/boom';
|
|
3
4
|
import { proto } from '../../WAProto';
|
|
4
|
-
import { MessageReceiptType, MessageRelayOptions, SocketConfig } from '../Types';
|
|
5
|
+
import { MessageReceiptType, MessageRelayOptions, SocketConfig, WAMessageKey } from '../Types';
|
|
5
6
|
import { BinaryNode } from '../WABinary';
|
|
6
7
|
export declare const makeMessagesRecvSocket: (config: SocketConfig) => {
|
|
7
8
|
sendMessageAck: ({ tag, attrs, content }: BinaryNode) => Promise<void>;
|
|
8
9
|
sendRetryRequest: (node: BinaryNode, forceIncludeKeys?: boolean) => Promise<void>;
|
|
9
|
-
offerCall: (toJid: string, isVideo?: boolean) => Promise<{
|
|
10
|
-
id: string;
|
|
11
|
-
to: string;
|
|
12
|
-
}>;
|
|
13
10
|
rejectCall: (callId: string, callFrom: string) => Promise<void>;
|
|
11
|
+
fetchMessageHistory: (count: number, oldestMsgKey: WAMessageKey, oldestMsgTimestamp: number | Long) => Promise<string>;
|
|
12
|
+
requestPlaceholderResend: (messageKey: WAMessageKey) => Promise<string | undefined>;
|
|
14
13
|
getPrivacyTokens: (jids: string[]) => Promise<BinaryNode>;
|
|
15
14
|
assertSessions: (jids: string[], force: boolean) => Promise<boolean>;
|
|
16
|
-
relayMessage: (jid: string, message: proto.IMessage, { messageId: msgId, participant, additionalAttributes, additionalNodes, useUserDevicesCache,
|
|
15
|
+
relayMessage: (jid: string, message: proto.IMessage, { messageId: msgId, participant, additionalAttributes, additionalNodes, useUserDevicesCache, useCachedGroupMetadata, statusJidList }: MessageRelayOptions) => Promise<string>;
|
|
17
16
|
sendReceipt: (jid: string, participant: string | undefined, messageIds: string[], type: MessageReceiptType) => Promise<void>;
|
|
18
|
-
sendReceipts: (keys:
|
|
19
|
-
|
|
20
|
-
[key: string]: string;
|
|
21
|
-
};
|
|
22
|
-
readMessages: (keys: proto.IMessageKey[]) => Promise<void>;
|
|
17
|
+
sendReceipts: (keys: WAMessageKey[], type: MessageReceiptType) => Promise<void>;
|
|
18
|
+
readMessages: (keys: WAMessageKey[]) => Promise<void>;
|
|
23
19
|
refreshMediaConn: (forceGet?: boolean) => Promise<import("../Types").MediaConnInfo>;
|
|
24
|
-
|
|
20
|
+
waUploadToServer: import("../Types").WAMediaUploadFunction;
|
|
21
|
+
fetchPrivacySettings: (force?: boolean) => Promise<{
|
|
22
|
+
[_: string]: string;
|
|
23
|
+
}>;
|
|
24
|
+
sendPeerDataOperationMessage: (pdoMessage: proto.Message.IPeerDataOperationRequestMessage) => Promise<string>;
|
|
25
25
|
createParticipantNodes: (jids: string[], message: proto.IMessage, extraAttrs?: {
|
|
26
26
|
[key: string]: string;
|
|
27
27
|
} | undefined) => Promise<{
|
|
28
28
|
nodes: BinaryNode[];
|
|
29
29
|
shouldIncludeDeviceIdentity: boolean;
|
|
30
30
|
}>;
|
|
31
|
-
|
|
32
|
-
fetchPrivacySettings: (force?: boolean) => Promise<{
|
|
33
|
-
[_: string]: string;
|
|
34
|
-
}>;
|
|
31
|
+
getUSyncDevices: (jids: string[], useCache: boolean, ignoreZeroDevices: boolean) => Promise<import("../WABinary").JidWithDevice[]>;
|
|
35
32
|
updateMediaMessage: (message: proto.IWebMessageInfo) => Promise<proto.IWebMessageInfo>;
|
|
36
33
|
sendMessage: (jid: string, content: import("../Types").AnyMessageContent, options?: import("../Types").MiscMessageGenerationOptions) => Promise<proto.WebMessageInfo | undefined>;
|
|
37
34
|
subscribeNewsletterUpdates: (jid: string) => Promise<{
|
|
@@ -46,14 +43,13 @@ export declare const makeMessagesRecvSocket: (config: SocketConfig) => {
|
|
|
46
43
|
newsletterFollow: (jid: string) => Promise<void>;
|
|
47
44
|
newsletterUnmute: (jid: string) => Promise<void>;
|
|
48
45
|
newsletterMute: (jid: string) => Promise<void>;
|
|
49
|
-
|
|
50
|
-
newsletterCreate: (name: string, description: string, reaction_codes: string) => Promise<import("../Types").NewsletterMetadata>;
|
|
46
|
+
newsletterCreate: (name: string, description: string) => Promise<import("../Types").NewsletterMetadata>;
|
|
51
47
|
newsletterMetadata: (type: "invite" | "jid", key: string, role?: import("../Types").NewsletterViewRole | undefined) => Promise<import("../Types").NewsletterMetadata>;
|
|
52
48
|
newsletterAdminCount: (jid: string) => Promise<number>;
|
|
53
49
|
newsletterChangeOwner: (jid: string, user: string) => Promise<void>;
|
|
54
50
|
newsletterDemote: (jid: string, user: string) => Promise<void>;
|
|
55
51
|
newsletterDelete: (jid: string) => Promise<void>;
|
|
56
|
-
newsletterReactMessage: (jid: string,
|
|
52
|
+
newsletterReactMessage: (jid: string, server_id: string, code?: string | undefined) => Promise<void>;
|
|
57
53
|
newsletterFetchMessages: (type: "invite" | "jid", key: string, count: number, after?: number | undefined) => Promise<import("../Types").NewsletterFetchedUpdate[]>;
|
|
58
54
|
newsletterFetchUpdates: (jid: string, count: number, after?: number | undefined, since?: number | undefined) => Promise<import("../Types").NewsletterFetchedUpdate[]>;
|
|
59
55
|
groupMetadata: (jid: string) => Promise<import("../Types").GroupMetadata>;
|
|
@@ -76,7 +72,8 @@ export declare const makeMessagesRecvSocket: (config: SocketConfig) => {
|
|
|
76
72
|
groupInviteCode: (jid: string) => Promise<string | undefined>;
|
|
77
73
|
groupRevokeInvite: (jid: string) => Promise<string | undefined>;
|
|
78
74
|
groupAcceptInvite: (code: string) => Promise<string | undefined>;
|
|
79
|
-
|
|
75
|
+
groupRevokeInviteV4: (groupJid: string, invitedJid: string) => Promise<boolean>;
|
|
76
|
+
groupAcceptInviteV4: (key: string | WAMessageKey, inviteMessage: proto.Message.IGroupInviteMessage) => Promise<string>;
|
|
80
77
|
groupGetInviteInfo: (code: string) => Promise<import("../Types").GroupMetadata>;
|
|
81
78
|
groupToggleEphemeral: (jid: string, ephemeralExpiration: number) => Promise<void>;
|
|
82
79
|
groupSettingUpdate: (jid: string, setting: "announcement" | "locked" | "not_announcement" | "unlocked") => Promise<void>;
|
|
@@ -94,30 +91,34 @@ export declare const makeMessagesRecvSocket: (config: SocketConfig) => {
|
|
|
94
91
|
presenceSubscribe: (toJid: string, tcToken?: Buffer | undefined) => Promise<void>;
|
|
95
92
|
profilePictureUrl: (jid: string, type?: "image" | "preview", timeoutMs?: number | undefined) => Promise<string | undefined>;
|
|
96
93
|
onWhatsApp: (...jids: string[]) => Promise<{
|
|
97
|
-
exists: boolean;
|
|
98
94
|
jid: string;
|
|
99
|
-
|
|
95
|
+
exists: unknown;
|
|
96
|
+
}[] | undefined>;
|
|
100
97
|
fetchBlocklist: () => Promise<string[]>;
|
|
101
|
-
fetchStatus: (
|
|
102
|
-
|
|
103
|
-
setAt: Date;
|
|
104
|
-
} | undefined>;
|
|
98
|
+
fetchStatus: (...jids: string[]) => Promise<import("..").USyncQueryResultList[] | undefined>;
|
|
99
|
+
fetchDisappearingDuration: (...jids: string[]) => Promise<import("..").USyncQueryResultList[] | undefined>;
|
|
105
100
|
updateProfilePicture: (jid: string, content: import("../Types").WAMediaUpload) => Promise<void>;
|
|
101
|
+
updateProfilePictureFull: (jid: any, content: any) => Promise<void>;
|
|
102
|
+
updateProfilePictureFull2: (jid: any, content: any) => Promise<void>;
|
|
106
103
|
removeProfilePicture: (jid: string) => Promise<void>;
|
|
107
104
|
updateProfileStatus: (status: string) => Promise<void>;
|
|
108
105
|
updateProfileName: (name: string) => Promise<void>;
|
|
109
106
|
updateBlockStatus: (jid: string, action: "block" | "unblock") => Promise<void>;
|
|
107
|
+
updateCallPrivacy: (value: import("../Types").WAPrivacyCallValue) => Promise<void>;
|
|
110
108
|
updateLastSeenPrivacy: (value: import("../Types").WAPrivacyValue) => Promise<void>;
|
|
111
109
|
updateOnlinePrivacy: (value: import("../Types").WAPrivacyOnlineValue) => Promise<void>;
|
|
112
110
|
updateProfilePicturePrivacy: (value: import("../Types").WAPrivacyValue) => Promise<void>;
|
|
113
111
|
updateStatusPrivacy: (value: import("../Types").WAPrivacyValue) => Promise<void>;
|
|
114
112
|
updateReadReceiptsPrivacy: (value: import("../Types").WAReadReceiptsValue) => Promise<void>;
|
|
115
|
-
updateGroupsAddPrivacy: (value: import("../Types").
|
|
113
|
+
updateGroupsAddPrivacy: (value: import("../Types").WAPrivacyGroupAddValue) => Promise<void>;
|
|
116
114
|
updateDefaultDisappearingMode: (duration: number) => Promise<void>;
|
|
117
115
|
getBusinessProfile: (jid: string) => Promise<void | import("../Types").WABusinessProfile>;
|
|
118
116
|
resyncAppState: (collections: readonly ("critical_block" | "critical_unblock_low" | "regular_high" | "regular_low" | "regular")[], isInitialSync: boolean) => Promise<void>;
|
|
119
117
|
chatModify: (mod: import("../Types").ChatModification, jid: string) => Promise<void>;
|
|
120
118
|
cleanDirtyBits: (type: "account_sync" | "groups", fromTimestamp?: string | number | undefined) => Promise<void>;
|
|
119
|
+
addOrEditContact: (jid: string, contact: import("../Types").ContactAction) => Promise<void>;
|
|
120
|
+
removeContact: (jid: string) => Promise<void>;
|
|
121
|
+
addLabel: (jid: string, labels: import("../Types/Label").LabelActionBody) => Promise<void>;
|
|
121
122
|
addChatLabel: (jid: string, labelId: string) => Promise<void>;
|
|
122
123
|
removeChatLabel: (jid: string, labelId: string) => Promise<void>;
|
|
123
124
|
addMessageLabel: (jid: string, messageId: string, labelId: string) => Promise<void>;
|
|
@@ -126,8 +127,9 @@ export declare const makeMessagesRecvSocket: (config: SocketConfig) => {
|
|
|
126
127
|
id: string;
|
|
127
128
|
fromMe?: boolean | undefined;
|
|
128
129
|
}[], star: boolean) => Promise<void>;
|
|
130
|
+
executeUSyncQuery: (usyncQuery: import("..").USyncQuery) => Promise<import("..").USyncQueryResult | undefined>;
|
|
129
131
|
type: "md";
|
|
130
|
-
ws:
|
|
132
|
+
ws: import("./Client").WebSocketClient;
|
|
131
133
|
ev: import("../Types").BaileysEventEmitter & {
|
|
132
134
|
process(handler: (events: Partial<import("../Types").BaileysEventMap>) => void | Promise<void>): () => void;
|
|
133
135
|
buffer(): void;
|