naya-flore 4.7.2 → 4.7.4
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 +0 -104
- package/WAProto/WAProto.proto +89 -1195
- package/WAProto/index.d.ts +1256 -13195
- package/WAProto/index.js +11405 -32544
- package/lib/Defaults/baileys-version.json +1 -1
- package/lib/Defaults/index.d.ts +0 -231
- package/lib/Defaults/index.js +102 -92
- package/lib/Defaults/phonenumber-mcc.json +221 -221
- package/lib/Signal/libsignal.js +9 -18
- package/lib/Socket/Client/abstract-socket-client.d.ts +2 -0
- 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 +1 -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} +2 -2
- package/lib/Socket/business.d.ts +43 -42
- package/lib/Socket/chats.d.ts +8 -9
- package/lib/Socket/chats.js +34 -41
- package/lib/Socket/groups.d.ts +7 -7
- package/lib/Socket/groups.js +4 -2
- package/lib/Socket/index.d.ts +52 -51
- package/lib/Socket/messages-recv.d.ts +42 -41
- package/lib/Socket/messages-recv.js +127 -190
- package/lib/Socket/messages-send.d.ts +9 -16
- package/lib/Socket/messages-send.js +316 -467
- package/lib/Socket/newsletter.d.ts +28 -26
- package/lib/Socket/newsletter.js +3 -3
- package/lib/Socket/registration.d.ts +52 -49
- package/lib/Socket/registration.js +7 -7
- package/lib/Socket/socket.d.ts +0 -1
- package/lib/Socket/socket.js +23 -49
- package/lib/Socket/usync.d.ts +10 -11
- package/lib/Store/index.d.ts +2 -2
- package/lib/Store/index.js +2 -2
- package/lib/Store/make-cache-manager-store.d.ts +0 -1
- package/lib/Store/make-in-memory-store.js +1 -5
- package/lib/Store/make-ordered-dictionary.d.ts +1 -1
- package/lib/Types/Auth.d.ts +1 -0
- package/lib/Types/Call.d.ts +1 -1
- package/lib/Types/Chat.d.ts +7 -12
- package/lib/Types/Events.d.ts +2 -17
- package/lib/Types/GroupMetadata.d.ts +2 -3
- 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 +10 -170
- package/lib/Types/Newsletter.js +3 -3
- package/lib/Types/Socket.d.ts +4 -7
- package/lib/Types/index.d.ts +0 -9
- package/lib/Types/index.js +1 -1
- package/lib/Utils/auth-utils.js +3 -3
- package/lib/Utils/business.d.ts +1 -1
- package/lib/Utils/business.js +2 -2
- package/lib/Utils/chat-utils.d.ts +12 -11
- package/lib/Utils/chat-utils.js +26 -42
- package/lib/Utils/crypto.d.ts +16 -15
- package/lib/Utils/crypto.js +23 -35
- package/lib/Utils/decode-wa-message.d.ts +0 -17
- package/lib/Utils/decode-wa-message.js +15 -43
- package/lib/Utils/generics.d.ts +17 -13
- package/lib/Utils/generics.js +15 -25
- package/lib/Utils/history.d.ts +2 -6
- package/lib/Utils/history.js +6 -4
- package/lib/Utils/logger.d.ts +3 -1
- package/lib/Utils/make-mutex.d.ts +2 -2
- package/lib/Utils/messages-media.d.ts +28 -25
- package/lib/Utils/messages-media.js +47 -38
- package/lib/Utils/messages.js +41 -454
- package/lib/Utils/noise-handler.d.ts +5 -4
- package/lib/Utils/process-message.js +2 -2
- package/lib/Utils/signal.d.ts +1 -2
- package/lib/Utils/signal.js +19 -11
- package/lib/Utils/use-multi-file-auth-state.d.ts +1 -0
- package/lib/Utils/use-multi-file-auth-state.js +3 -11
- package/lib/Utils/validate-connection.d.ts +1 -1
- package/lib/Utils/validate-connection.js +1 -1
- package/lib/WABinary/decode.d.ts +2 -1
- package/lib/WABinary/decode.js +7 -17
- package/lib/WABinary/encode.d.ts +2 -1
- package/lib/WABinary/encode.js +17 -33
- package/lib/WABinary/generic-utils.d.ts +3 -2
- package/lib/WABinary/generic-utils.js +2 -2
- package/lib/WABinary/jid-utils.d.ts +1 -1
- package/lib/WAM/BinaryInfo.d.ts +11 -2
- package/lib/WAM/encode.d.ts +2 -1
- package/lib/WAUSync/Protocols/USyncStatusProtocol.js +3 -3
- package/lib/WAUSync/Protocols/UsyncBotProfileProtocol.d.ts +25 -0
- package/lib/WAUSync/Protocols/UsyncBotProfileProtocol.js +53 -0
- package/lib/WAUSync/Protocols/UsyncLIDProtocol.d.ts +8 -0
- package/lib/WAUSync/Protocols/UsyncLIDProtocol.js +24 -0
- package/lib/WAUSync/USyncQuery.d.ts +2 -0
- package/lib/WAUSync/USyncQuery.js +10 -0
- package/lib/WAUSync/USyncUser.d.ts +2 -0
- package/lib/WAUSync/USyncUser.js +4 -0
- package/lib/index.d.ts +0 -1
- package/lib/index.js +0 -1
- package/package.json +20 -32
- package/lib/Socket/Client/types.d.ts +0 -17
- package/lib/Socket/Client/types.js +0 -13
package/lib/Socket/index.d.ts
CHANGED
@@ -1,14 +1,15 @@
|
|
1
|
+
/// <reference types="node" />
|
1
2
|
import { UserFacingSocketConfig } from '../Types';
|
2
3
|
declare const makeWASocket: (config: UserFacingSocketConfig) => {
|
3
4
|
register: (code: string) => Promise<import("./registration").ExistsResponse>;
|
4
|
-
requestRegistrationCode: (registrationOptions?: import("./registration").RegistrationOptions) => Promise<import("./registration").ExistsResponse>;
|
5
|
-
logger: Logger
|
5
|
+
requestRegistrationCode: (registrationOptions?: import("./registration").RegistrationOptions | undefined) => Promise<import("./registration").ExistsResponse>;
|
6
|
+
logger: import("pino").Logger<import("pino").LoggerOptions>;
|
6
7
|
getOrderDetails: (orderId: string, tokenBase64: string) => Promise<import("../Types").OrderDetails>;
|
7
8
|
getCatalog: ({ jid, limit, cursor }: import("../Types").GetCatalogOptions) => Promise<{
|
8
9
|
products: import("../Types").Product[];
|
9
|
-
nextPageCursor:
|
10
|
+
nextPageCursor: string | undefined;
|
10
11
|
}>;
|
11
|
-
getCollections: (jid?: string, limit?: number) => Promise<{
|
12
|
+
getCollections: (jid?: string | undefined, limit?: number) => Promise<{
|
12
13
|
collections: import("../Types").CatalogCollection[];
|
13
14
|
}>;
|
14
15
|
productCreate: (create: import("../Types").ProductCreate) => Promise<import("../Types").Product>;
|
@@ -16,27 +17,28 @@ declare const makeWASocket: (config: UserFacingSocketConfig) => {
|
|
16
17
|
deleted: number;
|
17
18
|
}>;
|
18
19
|
productUpdate: (productId: string, update: import("../Types").ProductUpdate) => Promise<import("../Types").Product>;
|
19
|
-
sendMessageAck: ({ tag, attrs, content }: import("
|
20
|
-
sendRetryRequest: (node: import("
|
20
|
+
sendMessageAck: ({ tag, attrs, content }: import("../index").BinaryNode) => Promise<void>;
|
21
|
+
sendRetryRequest: (node: import("../index").BinaryNode, forceIncludeKeys?: boolean) => Promise<void>;
|
21
22
|
offerCall: (toJid: string, isVideo?: boolean) => Promise<{
|
22
|
-
id:
|
23
|
+
id: string;
|
23
24
|
to: string;
|
24
25
|
}>;
|
25
26
|
rejectCall: (callId: string, callFrom: string) => Promise<void>;
|
26
|
-
|
27
|
-
requestPlaceholderResend: (messageKey: import("../Types").WAMessageKey) => Promise<string | undefined>;
|
28
|
-
getPrivacyTokens: (jids: string[]) => Promise<import("..").BinaryNode>;
|
27
|
+
getPrivacyTokens: (jids: string[]) => Promise<import("../index").BinaryNode>;
|
29
28
|
assertSessions: (jids: string[], force: boolean) => Promise<boolean>;
|
30
29
|
relayMessage: (jid: string, message: import("../Types").WAProto.IMessage, { messageId: msgId, participant, additionalAttributes, additionalNodes, useUserDevicesCache, cachedGroupMetadata, statusJidList }: import("../Types").MessageRelayOptions) => Promise<string>;
|
31
30
|
sendReceipt: (jid: string, participant: string | undefined, messageIds: string[], type: import("../Types").MessageReceiptType) => Promise<void>;
|
32
|
-
sendReceipts: (keys: import("../Types").
|
33
|
-
getButtonArgs: (message: import("../Types").WAProto.IMessage) =>
|
34
|
-
|
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>;
|
35
36
|
refreshMediaConn: (forceGet?: boolean) => Promise<import("../Types").MediaConnInfo>;
|
36
|
-
getUSyncDevices: (jids: string[], useCache: boolean, ignoreZeroDevices: boolean) => Promise<import("
|
37
|
-
|
38
|
-
|
39
|
-
|
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[];
|
40
42
|
shouldIncludeDeviceIdentity: boolean;
|
41
43
|
}>;
|
42
44
|
waUploadToServer: import("../Types").WAMediaUploadFunction;
|
@@ -44,14 +46,12 @@ declare const makeWASocket: (config: UserFacingSocketConfig) => {
|
|
44
46
|
[_: string]: string;
|
45
47
|
}>;
|
46
48
|
updateMediaMessage: (message: import("../Types").WAProto.IWebMessageInfo) => Promise<import("../Types").WAProto.IWebMessageInfo>;
|
47
|
-
sendStatusMentions: (content: import("../Types").AnyMessageContent, jids?: string[]) => Promise<import("../Types").WAProto.WebMessageInfo>;
|
48
|
-
sendAlbumMessage: (jid: string, medias: import("../Types").Media[], options?: import("../Types").MiscMessageGenerationOptions) => Promise<import("../Types").WAProto.WebMessageInfo>;
|
49
49
|
sendMessage: (jid: string, content: import("../Types").AnyMessageContent, options?: import("../Types").MiscMessageGenerationOptions) => Promise<import("../Types").WAProto.WebMessageInfo | undefined>;
|
50
50
|
subscribeNewsletterUpdates: (jid: string) => Promise<{
|
51
51
|
duration: string;
|
52
52
|
}>;
|
53
53
|
newsletterReactionMode: (jid: string, mode: import("../Types").NewsletterReactionMode) => Promise<void>;
|
54
|
-
newsletterUpdateDescription: (jid: string, description?: string) => Promise<void>;
|
54
|
+
newsletterUpdateDescription: (jid: string, description?: string | undefined) => Promise<void>;
|
55
55
|
newsletterUpdateName: (jid: string, name: string) => Promise<void>;
|
56
56
|
newsletterUpdatePicture: (jid: string, content: import("../Types").WAMediaUpload) => Promise<void>;
|
57
57
|
newsletterRemovePicture: (jid: string) => Promise<void>;
|
@@ -59,16 +59,16 @@ declare const makeWASocket: (config: UserFacingSocketConfig) => {
|
|
59
59
|
newsletterFollow: (jid: string) => Promise<void>;
|
60
60
|
newsletterUnmute: (jid: string) => Promise<void>;
|
61
61
|
newsletterMute: (jid: string) => Promise<void>;
|
62
|
-
newsletterAction: (jid: string, type: "
|
63
|
-
newsletterCreate: (name: string, description: string) => Promise<import("../Types").NewsletterMetadata>;
|
64
|
-
newsletterMetadata: (type: "invite" | "jid", key: string, role?: import("../Types").NewsletterViewRole) => Promise<import("../Types").NewsletterMetadata>;
|
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>;
|
65
65
|
newsletterAdminCount: (jid: string) => Promise<number>;
|
66
66
|
newsletterChangeOwner: (jid: string, user: string) => Promise<void>;
|
67
67
|
newsletterDemote: (jid: string, user: string) => Promise<void>;
|
68
68
|
newsletterDelete: (jid: string) => Promise<void>;
|
69
|
-
newsletterReactMessage: (jid: string, serverId: string, code?: string) => Promise<void>;
|
70
|
-
newsletterFetchMessages: (type: "invite" | "jid", key: string, count: number, after?: number) => Promise<import("../Types").NewsletterFetchedUpdate[]>;
|
71
|
-
newsletterFetchUpdates: (jid: string, count: number, after?: number, since?: number) => Promise<import("../Types").NewsletterFetchedUpdate[]>;
|
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
72
|
groupMetadata: (jid: string) => Promise<import("../Types").GroupMetadata>;
|
73
73
|
groupCreate: (subject: string, participants: string[]) => Promise<import("../Types").GroupMetadata>;
|
74
74
|
groupLeave: (id: string) => Promise<void>;
|
@@ -76,40 +76,41 @@ declare const makeWASocket: (config: UserFacingSocketConfig) => {
|
|
76
76
|
groupRequestParticipantsList: (jid: string) => Promise<{
|
77
77
|
[key: string]: string;
|
78
78
|
}[]>;
|
79
|
-
groupRequestParticipantsUpdate: (jid: string, participants: string[], action: "
|
79
|
+
groupRequestParticipantsUpdate: (jid: string, participants: string[], action: "reject" | "approve") => Promise<{
|
80
80
|
status: string;
|
81
81
|
jid: string;
|
82
82
|
}[]>;
|
83
83
|
groupParticipantsUpdate: (jid: string, participants: string[], action: import("../Types").ParticipantAction) => Promise<{
|
84
84
|
status: string;
|
85
85
|
jid: string;
|
86
|
-
content: import("
|
86
|
+
content: import("../index").BinaryNode;
|
87
87
|
}[]>;
|
88
|
-
groupUpdateDescription: (jid: string, description?: string) => Promise<void>;
|
88
|
+
groupUpdateDescription: (jid: string, description?: string | undefined) => Promise<void>;
|
89
89
|
groupInviteCode: (jid: string) => Promise<string | undefined>;
|
90
90
|
groupRevokeInvite: (jid: string) => Promise<string | undefined>;
|
91
91
|
groupAcceptInvite: (code: string) => Promise<string | undefined>;
|
92
92
|
groupAcceptInviteV4: (key: string | import("../Types").WAProto.IMessageKey, inviteMessage: import("../Types").WAProto.Message.IGroupInviteMessage) => Promise<string>;
|
93
93
|
groupGetInviteInfo: (code: string) => Promise<import("../Types").GroupMetadata>;
|
94
94
|
groupToggleEphemeral: (jid: string, ephemeralExpiration: number) => Promise<void>;
|
95
|
-
groupSettingUpdate: (jid: string, setting: "announcement" | "
|
96
|
-
groupMemberAddMode: (jid: string, mode: "
|
95
|
+
groupSettingUpdate: (jid: string, setting: "announcement" | "locked" | "not_announcement" | "unlocked") => Promise<void>;
|
96
|
+
groupMemberAddMode: (jid: string, mode: "all_member_add" | "admin_add") => Promise<void>;
|
97
97
|
groupJoinApprovalMode: (jid: string, mode: "on" | "off") => Promise<void>;
|
98
98
|
groupFetchAllParticipating: () => Promise<{
|
99
99
|
[_: string]: import("../Types").GroupMetadata;
|
100
100
|
}>;
|
101
101
|
processingMutex: {
|
102
|
-
mutex<T>(code: () =>
|
102
|
+
mutex<T>(code: () => T | Promise<T>): Promise<T>;
|
103
103
|
};
|
104
104
|
upsertMessage: (msg: import("../Types").WAProto.IWebMessageInfo, type: import("../Types").MessageUpsertType) => Promise<void>;
|
105
105
|
appPatch: (patchCreate: import("../Types").WAPatchCreate) => Promise<void>;
|
106
|
-
sendPresenceUpdate: (type: import("../Types").WAPresence, toJid?: string) => Promise<void>;
|
107
|
-
presenceSubscribe: (toJid: string, tcToken?: Buffer) => Promise<void>;
|
108
|
-
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
109
|
onWhatsApp: (...jids: string[]) => Promise<{
|
110
|
-
exists: boolean;
|
111
110
|
jid: string;
|
112
|
-
|
111
|
+
exists: unknown;
|
112
|
+
lid: unknown;
|
113
|
+
}[] | undefined>;
|
113
114
|
fetchBlocklist: () => Promise<string[]>;
|
114
115
|
fetchStatus: (jid: string) => Promise<{
|
115
116
|
status: string | undefined;
|
@@ -127,25 +128,25 @@ declare const makeWASocket: (config: UserFacingSocketConfig) => {
|
|
127
128
|
updateReadReceiptsPrivacy: (value: import("../Types").WAReadReceiptsValue) => Promise<void>;
|
128
129
|
updateGroupsAddPrivacy: (value: import("../Types").WAPrivacyValue) => Promise<void>;
|
129
130
|
updateDefaultDisappearingMode: (duration: number) => Promise<void>;
|
130
|
-
getBusinessProfile: (jid: string) => Promise<import("../Types").WABusinessProfile
|
131
|
+
getBusinessProfile: (jid: string) => Promise<void | import("../Types").WABusinessProfile>;
|
131
132
|
resyncAppState: (collections: readonly ("critical_block" | "critical_unblock_low" | "regular_high" | "regular_low" | "regular")[], isInitialSync: boolean) => Promise<void>;
|
132
133
|
chatModify: (mod: import("../Types").ChatModification, jid: string) => Promise<void>;
|
133
|
-
cleanDirtyBits: (type: "account_sync" | "groups", fromTimestamp?: number |
|
134
|
+
cleanDirtyBits: (type: "account_sync" | "groups", fromTimestamp?: string | number | undefined) => Promise<void>;
|
134
135
|
addChatLabel: (jid: string, labelId: string) => Promise<void>;
|
135
136
|
removeChatLabel: (jid: string, labelId: string) => Promise<void>;
|
136
137
|
addMessageLabel: (jid: string, messageId: string, labelId: string) => Promise<void>;
|
137
138
|
removeMessageLabel: (jid: string, messageId: string, labelId: string) => Promise<void>;
|
138
139
|
star: (jid: string, messages: {
|
139
140
|
id: string;
|
140
|
-
fromMe?: boolean;
|
141
|
+
fromMe?: boolean | undefined;
|
141
142
|
}[], star: boolean) => Promise<void>;
|
142
143
|
type: "md";
|
143
144
|
ws: any;
|
144
145
|
ev: import("../Types").BaileysEventEmitter & {
|
145
|
-
process(handler: (events: Partial<import("../Types").BaileysEventMap>) => void | Promise<void>): (
|
146
|
+
process(handler: (events: Partial<import("../Types").BaileysEventMap>) => void | Promise<void>): () => void;
|
146
147
|
buffer(): void;
|
147
|
-
createBufferedFunction<A extends any[],
|
148
|
-
flush(force?: boolean): 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;
|
149
150
|
isBuffering(): boolean;
|
150
151
|
};
|
151
152
|
authState: {
|
@@ -155,18 +156,18 @@ declare const makeWASocket: (config: UserFacingSocketConfig) => {
|
|
155
156
|
signalRepository: import("../Types").SignalRepository;
|
156
157
|
user: import("../Types").Contact | undefined;
|
157
158
|
generateMessageTag: () => string;
|
158
|
-
query: (node: import("
|
159
|
-
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>;
|
160
161
|
waitForSocketOpen: () => Promise<void>;
|
161
162
|
sendRawMessage: (data: Uint8Array | Buffer) => Promise<void>;
|
162
|
-
sendNode: (frame: import("
|
163
|
-
logout: (msg?: string) => Promise<void>;
|
163
|
+
sendNode: (frame: import("../index").BinaryNode) => Promise<void>;
|
164
|
+
logout: (msg?: string | undefined) => Promise<void>;
|
164
165
|
end: (error: Error | undefined) => void;
|
165
|
-
onUnexpectedError: (err: Error | Boom
|
166
|
+
onUnexpectedError: (err: Error | import("@hapi/boom").Boom<any>, msg: string) => void;
|
166
167
|
uploadPreKeys: (count?: number) => Promise<void>;
|
167
168
|
uploadPreKeysToServerIfRequired: () => Promise<void>;
|
168
|
-
requestPairingCode: (phoneNumber: string
|
169
|
-
waitForConnectionUpdate: (check: (u: Partial<import("../Types").ConnectionState>) => boolean | undefined, timeoutMs?: number) => Promise<void>;
|
170
|
-
sendWAMBuffer: (wamBuffer: Buffer) => Promise<import("
|
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>;
|
171
172
|
};
|
172
173
|
export default makeWASocket;
|
@@ -1,28 +1,30 @@
|
|
1
|
+
/// <reference types="node" />
|
1
2
|
import { Boom } from '@hapi/boom';
|
2
3
|
import { proto } from '../../WAProto';
|
3
|
-
import { MessageReceiptType, MessageRelayOptions, SocketConfig
|
4
|
+
import { MessageReceiptType, MessageRelayOptions, SocketConfig } from '../Types';
|
4
5
|
import { BinaryNode } from '../WABinary';
|
5
6
|
export declare const makeMessagesRecvSocket: (config: SocketConfig) => {
|
6
|
-
sendMessageAck: ({ tag, attrs, content }: BinaryNode
|
7
|
+
sendMessageAck: ({ tag, attrs, content }: BinaryNode) => Promise<void>;
|
7
8
|
sendRetryRequest: (node: BinaryNode, forceIncludeKeys?: boolean) => Promise<void>;
|
8
9
|
offerCall: (toJid: string, isVideo?: boolean) => Promise<{
|
9
|
-
id:
|
10
|
+
id: string;
|
10
11
|
to: string;
|
11
12
|
}>;
|
12
13
|
rejectCall: (callId: string, callFrom: string) => Promise<void>;
|
13
|
-
fetchMessageHistory: (count: number, oldestMsgKey: WAMessageKey, oldestMsgTimestamp: number) => Promise<string>;
|
14
|
-
requestPlaceholderResend: (messageKey: WAMessageKey) => Promise<string | undefined>;
|
15
14
|
getPrivacyTokens: (jids: string[]) => Promise<BinaryNode>;
|
16
15
|
assertSessions: (jids: string[], force: boolean) => Promise<boolean>;
|
17
16
|
relayMessage: (jid: string, message: proto.IMessage, { messageId: msgId, participant, additionalAttributes, additionalNodes, useUserDevicesCache, cachedGroupMetadata, statusJidList }: MessageRelayOptions) => Promise<string>;
|
18
17
|
sendReceipt: (jid: string, participant: string | undefined, messageIds: string[], type: MessageReceiptType) => Promise<void>;
|
19
|
-
sendReceipts: (keys:
|
20
|
-
getButtonArgs: (message: proto.IMessage) =>
|
21
|
-
|
18
|
+
sendReceipts: (keys: proto.IMessageKey[], type: MessageReceiptType) => Promise<void>;
|
19
|
+
getButtonArgs: (message: proto.IMessage) => {
|
20
|
+
[key: string]: string;
|
21
|
+
};
|
22
|
+
readMessages: (keys: proto.IMessageKey[]) => Promise<void>;
|
22
23
|
refreshMediaConn: (forceGet?: boolean) => Promise<import("../Types").MediaConnInfo>;
|
23
24
|
getUSyncDevices: (jids: string[], useCache: boolean, ignoreZeroDevices: boolean) => Promise<import("../WABinary").JidWithDevice[]>;
|
24
|
-
|
25
|
-
|
25
|
+
createParticipantNodes: (jids: string[], message: proto.IMessage, extraAttrs?: {
|
26
|
+
[key: string]: string;
|
27
|
+
} | undefined) => Promise<{
|
26
28
|
nodes: BinaryNode[];
|
27
29
|
shouldIncludeDeviceIdentity: boolean;
|
28
30
|
}>;
|
@@ -31,14 +33,12 @@ export declare const makeMessagesRecvSocket: (config: SocketConfig) => {
|
|
31
33
|
[_: string]: string;
|
32
34
|
}>;
|
33
35
|
updateMediaMessage: (message: proto.IWebMessageInfo) => Promise<proto.IWebMessageInfo>;
|
34
|
-
sendStatusMentions: (content: import("../Types").AnyMessageContent, jids?: string[]) => Promise<proto.WebMessageInfo>;
|
35
|
-
sendAlbumMessage: (jid: string, medias: import("../Types").Media[], options?: import("../Types").MiscMessageGenerationOptions) => Promise<proto.WebMessageInfo>;
|
36
36
|
sendMessage: (jid: string, content: import("../Types").AnyMessageContent, options?: import("../Types").MiscMessageGenerationOptions) => Promise<proto.WebMessageInfo | undefined>;
|
37
37
|
subscribeNewsletterUpdates: (jid: string) => Promise<{
|
38
38
|
duration: string;
|
39
39
|
}>;
|
40
40
|
newsletterReactionMode: (jid: string, mode: import("../Types").NewsletterReactionMode) => Promise<void>;
|
41
|
-
newsletterUpdateDescription: (jid: string, description?: string) => Promise<void>;
|
41
|
+
newsletterUpdateDescription: (jid: string, description?: string | undefined) => Promise<void>;
|
42
42
|
newsletterUpdateName: (jid: string, name: string) => Promise<void>;
|
43
43
|
newsletterUpdatePicture: (jid: string, content: import("../Types").WAMediaUpload) => Promise<void>;
|
44
44
|
newsletterRemovePicture: (jid: string) => Promise<void>;
|
@@ -46,16 +46,16 @@ export declare const makeMessagesRecvSocket: (config: SocketConfig) => {
|
|
46
46
|
newsletterFollow: (jid: string) => Promise<void>;
|
47
47
|
newsletterUnmute: (jid: string) => Promise<void>;
|
48
48
|
newsletterMute: (jid: string) => Promise<void>;
|
49
|
-
newsletterAction: (jid: string, type: "
|
50
|
-
newsletterCreate: (name: string, description: string) => Promise<import("../Types").NewsletterMetadata>;
|
51
|
-
newsletterMetadata: (type: "invite" | "jid", key: string, role?: import("../Types").NewsletterViewRole) => Promise<import("../Types").NewsletterMetadata>;
|
49
|
+
newsletterAction: (jid: string, type: "mute" | "follow" | "unfollow" | "unmute") => Promise<void>;
|
50
|
+
newsletterCreate: (name: string, description: string, reaction_codes: string) => Promise<import("../Types").NewsletterMetadata>;
|
51
|
+
newsletterMetadata: (type: "invite" | "jid", key: string, role?: import("../Types").NewsletterViewRole | undefined) => Promise<import("../Types").NewsletterMetadata>;
|
52
52
|
newsletterAdminCount: (jid: string) => Promise<number>;
|
53
53
|
newsletterChangeOwner: (jid: string, user: string) => Promise<void>;
|
54
54
|
newsletterDemote: (jid: string, user: string) => Promise<void>;
|
55
55
|
newsletterDelete: (jid: string) => Promise<void>;
|
56
|
-
newsletterReactMessage: (jid: string, serverId: string, code?: string) => Promise<void>;
|
57
|
-
newsletterFetchMessages: (type: "invite" | "jid", key: string, count: number, after?: number) => Promise<import("../Types").NewsletterFetchedUpdate[]>;
|
58
|
-
newsletterFetchUpdates: (jid: string, count: number, after?: number, since?: number) => Promise<import("../Types").NewsletterFetchedUpdate[]>;
|
56
|
+
newsletterReactMessage: (jid: string, serverId: string, code?: string | undefined) => Promise<void>;
|
57
|
+
newsletterFetchMessages: (type: "invite" | "jid", key: string, count: number, after?: number | undefined) => Promise<import("../Types").NewsletterFetchedUpdate[]>;
|
58
|
+
newsletterFetchUpdates: (jid: string, count: number, after?: number | undefined, since?: number | undefined) => Promise<import("../Types").NewsletterFetchedUpdate[]>;
|
59
59
|
groupMetadata: (jid: string) => Promise<import("../Types").GroupMetadata>;
|
60
60
|
groupCreate: (subject: string, participants: string[]) => Promise<import("../Types").GroupMetadata>;
|
61
61
|
groupLeave: (id: string) => Promise<void>;
|
@@ -63,7 +63,7 @@ export declare const makeMessagesRecvSocket: (config: SocketConfig) => {
|
|
63
63
|
groupRequestParticipantsList: (jid: string) => Promise<{
|
64
64
|
[key: string]: string;
|
65
65
|
}[]>;
|
66
|
-
groupRequestParticipantsUpdate: (jid: string, participants: string[], action: "
|
66
|
+
groupRequestParticipantsUpdate: (jid: string, participants: string[], action: "reject" | "approve") => Promise<{
|
67
67
|
status: string;
|
68
68
|
jid: string;
|
69
69
|
}[]>;
|
@@ -72,31 +72,32 @@ export declare const makeMessagesRecvSocket: (config: SocketConfig) => {
|
|
72
72
|
jid: string;
|
73
73
|
content: BinaryNode;
|
74
74
|
}[]>;
|
75
|
-
groupUpdateDescription: (jid: string, description?: string) => Promise<void>;
|
75
|
+
groupUpdateDescription: (jid: string, description?: string | undefined) => Promise<void>;
|
76
76
|
groupInviteCode: (jid: string) => Promise<string | undefined>;
|
77
77
|
groupRevokeInvite: (jid: string) => Promise<string | undefined>;
|
78
78
|
groupAcceptInvite: (code: string) => Promise<string | undefined>;
|
79
79
|
groupAcceptInviteV4: (key: string | proto.IMessageKey, inviteMessage: proto.Message.IGroupInviteMessage) => Promise<string>;
|
80
80
|
groupGetInviteInfo: (code: string) => Promise<import("../Types").GroupMetadata>;
|
81
81
|
groupToggleEphemeral: (jid: string, ephemeralExpiration: number) => Promise<void>;
|
82
|
-
groupSettingUpdate: (jid: string, setting: "announcement" | "
|
83
|
-
groupMemberAddMode: (jid: string, mode: "
|
82
|
+
groupSettingUpdate: (jid: string, setting: "announcement" | "locked" | "not_announcement" | "unlocked") => Promise<void>;
|
83
|
+
groupMemberAddMode: (jid: string, mode: "all_member_add" | "admin_add") => Promise<void>;
|
84
84
|
groupJoinApprovalMode: (jid: string, mode: "on" | "off") => Promise<void>;
|
85
85
|
groupFetchAllParticipating: () => Promise<{
|
86
86
|
[_: string]: import("../Types").GroupMetadata;
|
87
87
|
}>;
|
88
88
|
processingMutex: {
|
89
|
-
mutex<T>(code: () =>
|
89
|
+
mutex<T>(code: () => T | Promise<T>): Promise<T>;
|
90
90
|
};
|
91
91
|
upsertMessage: (msg: proto.IWebMessageInfo, type: import("../Types").MessageUpsertType) => Promise<void>;
|
92
92
|
appPatch: (patchCreate: import("../Types").WAPatchCreate) => Promise<void>;
|
93
|
-
sendPresenceUpdate: (type: import("../Types").WAPresence, toJid?: string) => Promise<void>;
|
94
|
-
presenceSubscribe: (toJid: string, tcToken?: Buffer) => Promise<void>;
|
95
|
-
profilePictureUrl: (jid: string, type?: "
|
93
|
+
sendPresenceUpdate: (type: import("../Types").WAPresence, toJid?: string | undefined) => Promise<void>;
|
94
|
+
presenceSubscribe: (toJid: string, tcToken?: Buffer | undefined) => Promise<void>;
|
95
|
+
profilePictureUrl: (jid: string, type?: "image" | "preview", timeoutMs?: number | undefined) => Promise<string | undefined>;
|
96
96
|
onWhatsApp: (...jids: string[]) => Promise<{
|
97
|
-
exists: boolean;
|
98
97
|
jid: string;
|
99
|
-
|
98
|
+
exists: unknown;
|
99
|
+
lid: unknown;
|
100
|
+
}[] | undefined>;
|
100
101
|
fetchBlocklist: () => Promise<string[]>;
|
101
102
|
fetchStatus: (jid: string) => Promise<{
|
102
103
|
status: string | undefined;
|
@@ -114,25 +115,25 @@ export declare const makeMessagesRecvSocket: (config: SocketConfig) => {
|
|
114
115
|
updateReadReceiptsPrivacy: (value: import("../Types").WAReadReceiptsValue) => Promise<void>;
|
115
116
|
updateGroupsAddPrivacy: (value: import("../Types").WAPrivacyValue) => Promise<void>;
|
116
117
|
updateDefaultDisappearingMode: (duration: number) => Promise<void>;
|
117
|
-
getBusinessProfile: (jid: string) => Promise<import("../Types").WABusinessProfile
|
118
|
+
getBusinessProfile: (jid: string) => Promise<void | import("../Types").WABusinessProfile>;
|
118
119
|
resyncAppState: (collections: readonly ("critical_block" | "critical_unblock_low" | "regular_high" | "regular_low" | "regular")[], isInitialSync: boolean) => Promise<void>;
|
119
120
|
chatModify: (mod: import("../Types").ChatModification, jid: string) => Promise<void>;
|
120
|
-
cleanDirtyBits: (type: "account_sync" | "groups", fromTimestamp?: number |
|
121
|
+
cleanDirtyBits: (type: "account_sync" | "groups", fromTimestamp?: string | number | undefined) => 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>;
|
124
125
|
removeMessageLabel: (jid: string, messageId: string, labelId: string) => Promise<void>;
|
125
126
|
star: (jid: string, messages: {
|
126
127
|
id: string;
|
127
|
-
fromMe?: boolean;
|
128
|
+
fromMe?: boolean | undefined;
|
128
129
|
}[], star: boolean) => Promise<void>;
|
129
130
|
type: "md";
|
130
131
|
ws: any;
|
131
132
|
ev: import("../Types").BaileysEventEmitter & {
|
132
|
-
process(handler: (events: Partial<import("../Types").BaileysEventMap>) => void | Promise<void>): (
|
133
|
+
process(handler: (events: Partial<import("../Types").BaileysEventMap>) => void | Promise<void>): () => void;
|
133
134
|
buffer(): void;
|
134
|
-
createBufferedFunction<A extends any[],
|
135
|
-
flush(force?: boolean): boolean;
|
135
|
+
createBufferedFunction<A extends any[], T_1>(work: (...args: A) => Promise<T_1>): (...args: A) => Promise<T_1>;
|
136
|
+
flush(force?: boolean | undefined): boolean;
|
136
137
|
isBuffering(): boolean;
|
137
138
|
};
|
138
139
|
authState: {
|
@@ -142,17 +143,17 @@ export declare const makeMessagesRecvSocket: (config: SocketConfig) => {
|
|
142
143
|
signalRepository: import("../Types").SignalRepository;
|
143
144
|
user: import("../Types").Contact | undefined;
|
144
145
|
generateMessageTag: () => string;
|
145
|
-
query: (node: BinaryNode, timeoutMs?: number) => Promise<BinaryNode>;
|
146
|
-
waitForMessage: <
|
146
|
+
query: (node: BinaryNode, timeoutMs?: number | undefined) => Promise<BinaryNode>;
|
147
|
+
waitForMessage: <T_2>(msgId: string, timeoutMs?: number | undefined) => Promise<T_2>;
|
147
148
|
waitForSocketOpen: () => Promise<void>;
|
148
149
|
sendRawMessage: (data: Uint8Array | Buffer) => Promise<void>;
|
149
150
|
sendNode: (frame: BinaryNode) => Promise<void>;
|
150
|
-
logout: (msg?: string) => Promise<void>;
|
151
|
+
logout: (msg?: string | undefined) => Promise<void>;
|
151
152
|
end: (error: Error | undefined) => void;
|
152
|
-
onUnexpectedError: (err: Error | Boom
|
153
|
+
onUnexpectedError: (err: Error | Boom<any>, msg: string) => void;
|
153
154
|
uploadPreKeys: (count?: number) => Promise<void>;
|
154
155
|
uploadPreKeysToServerIfRequired: () => Promise<void>;
|
155
|
-
requestPairingCode: (phoneNumber: string
|
156
|
-
waitForConnectionUpdate: (check: (u: Partial<import("../Types").ConnectionState>) => boolean | undefined, timeoutMs?: number) => Promise<void>;
|
156
|
+
requestPairingCode: (phoneNumber: string) => Promise<string>;
|
157
|
+
waitForConnectionUpdate: (check: (u: Partial<import("../Types").ConnectionState>) => boolean | undefined, timeoutMs?: number | undefined) => Promise<void>;
|
157
158
|
sendWAMBuffer: (wamBuffer: Buffer) => Promise<BinaryNode>;
|
158
159
|
};
|