angularsockets 1.0.2 → 1.4.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 +21 -0
- package/README.MD +170 -0
- package/README.md +1 -1900
- package/WAProto/GenerateStatics.sh +4 -0
- package/WAProto/WAProto.proto +4775 -0
- package/WAProto/index.d.ts +4798 -124
- package/WAProto/index.js +14270 -302
- package/WAProto/index.ts.ts +53473 -0
- package/engine-requirements.js +10 -0
- package/lib/Defaults/baileys-version.json +1 -1
- package/lib/Defaults/index.d.ts +4 -6
- package/lib/Defaults/index.js +4 -6
- package/lib/Signal/Group/ciphertext-message.d.ts +9 -0
- package/lib/Signal/Group/ciphertext-message.js +15 -0
- package/lib/Signal/Group/group-session-builder.d.ts +14 -0
- package/lib/Signal/Group/group-session-builder.js +64 -0
- package/lib/Signal/Group/group_cipher.d.ts +17 -0
- package/lib/Signal/Group/group_cipher.js +96 -0
- package/lib/Signal/Group/index.d.ts +11 -0
- package/lib/Signal/Group/index.js +57 -0
- package/lib/Signal/Group/keyhelper.d.ts +10 -0
- package/lib/Signal/Group/keyhelper.js +55 -0
- 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 +13 -0
- package/lib/Signal/Group/sender-chain-key.js +34 -0
- package/lib/Signal/Group/sender-key-distribution-message.d.ts +16 -0
- package/lib/Signal/Group/sender-key-distribution-message.js +66 -0
- package/lib/Signal/Group/sender-key-message.d.ts +18 -0
- package/lib/Signal/Group/sender-key-message.js +69 -0
- package/lib/Signal/Group/sender-key-name.d.ts +17 -0
- package/lib/Signal/Group/sender-key-name.js +51 -0
- package/lib/Signal/Group/sender-key-record.d.ts +30 -0
- package/lib/Signal/Group/sender-key-record.js +53 -0
- package/lib/Signal/Group/sender-key-state.d.ts +38 -0
- package/lib/Signal/Group/sender-key-state.js +99 -0
- package/lib/Signal/Group/sender-message-key.d.ts +11 -0
- package/{WASignalGroup/sender_message_key.js → lib/Signal/Group/sender-message-key.js} +6 -16
- package/lib/Signal/libsignal.js +51 -29
- package/lib/Socket/Client/index.d.ts +2 -3
- package/lib/Socket/Client/index.js +2 -3
- package/lib/Socket/Client/{abstract-socket-client.d.ts → types.d.ts} +1 -2
- package/lib/Socket/Client/{web-socket-client.d.ts → websocket.d.ts} +2 -1
- package/lib/Socket/Client/{web-socket-client.js → websocket.js} +54 -5
- package/lib/Socket/RHandler.d.ts +416 -0
- package/lib/Socket/RHandler.js +530 -0
- package/lib/Socket/business.d.ts +39 -37
- package/lib/Socket/chats.d.ts +36 -23
- package/lib/Socket/chats.js +74 -116
- package/lib/Socket/groups.d.ts +42 -33
- package/lib/Socket/groups.js +26 -9
- package/lib/Socket/index.d.ts +39 -39
- package/lib/Socket/index.js +2 -2
- package/lib/Socket/messages-recv.d.ts +37 -34
- package/lib/Socket/messages-recv.js +111 -29
- package/lib/Socket/messages-send.d.ts +50 -53
- package/lib/Socket/messages-send.js +213 -397
- package/lib/Socket/newsletter.d.ts +25 -21
- package/lib/Socket/newsletter.js +92 -25
- package/lib/Socket/socket.d.ts +10 -11
- package/lib/Socket/socket.js +34 -23
- package/lib/Socket/usync.d.ts +11 -12
- package/lib/Store/index.d.ts +1 -2
- package/lib/Store/index.js +1 -3
- package/lib/Store/make-in-memory-store.d.ts +22 -22
- package/lib/Store/make-in-memory-store.js +21 -13
- package/lib/Store/make-ordered-dictionary.d.ts +1 -1
- package/lib/Types/Auth.d.ts +0 -6
- package/lib/Types/Chat.d.ts +6 -4
- package/lib/Types/Contact.d.ts +5 -1
- package/lib/Types/Events.d.ts +27 -0
- package/lib/Types/GroupMetadata.d.ts +8 -0
- package/lib/Types/Label.d.ts +0 -11
- package/lib/Types/Message.d.ts +59 -90
- package/lib/Types/Message.js +0 -2
- package/lib/Types/Newsletter.d.ts +97 -86
- package/lib/Types/Newsletter.js +38 -32
- package/lib/Types/Socket.d.ts +10 -7
- package/lib/Types/index.d.ts +1 -3
- package/lib/Types/index.js +1 -1
- package/lib/Utils/audioToBuffer.js +29 -0
- package/lib/Utils/auth-utils.d.ts +3 -3
- package/lib/Utils/auth-utils.js +13 -41
- package/lib/Utils/business.d.ts +1 -1
- package/lib/Utils/chat-utils.d.ts +12 -12
- package/lib/Utils/chat-utils.js +4 -19
- package/lib/Utils/crypto.d.ts +15 -15
- package/lib/Utils/crypto.js +6 -12
- package/lib/Utils/decode-wa-message.d.ts +5 -6
- package/lib/Utils/decode-wa-message.js +28 -55
- package/lib/Utils/event-buffer.d.ts +2 -2
- package/lib/Utils/event-buffer.js +2 -1
- package/lib/Utils/generics.d.ts +12 -11
- package/lib/Utils/generics.js +64 -38
- package/lib/Utils/history.d.ts +2 -2
- package/lib/Utils/history.js +1 -1
- package/lib/Utils/index.d.ts +2 -0
- package/lib/Utils/index.js +3 -0
- package/lib/Utils/link-preview.d.ts +2 -2
- package/lib/Utils/link-preview.js +34 -1
- package/lib/Utils/logger.d.ts +10 -1
- package/lib/Utils/lt-hash.d.ts +2 -2
- package/lib/Utils/lt-hash.js +6 -6
- package/lib/Utils/messages-media.d.ts +40 -29
- package/lib/Utils/messages-media.js +276 -110
- package/lib/Utils/messages.d.ts +8 -10
- package/lib/Utils/messages.js +126 -317
- package/lib/Utils/noise-handler.d.ts +10 -11
- package/lib/Utils/noise-handler.js +3 -13
- package/lib/Utils/process-message.d.ts +3 -2
- package/lib/Utils/process-message.js +17 -5
- package/lib/Utils/signal.js +2 -8
- package/lib/Utils/streamToBuffer.js +15 -0
- package/lib/Utils/use-multi-file-auth-state.js +72 -242
- package/lib/Utils/validate-connection.d.ts +2 -3
- package/lib/Utils/validate-connection.js +19 -51
- package/lib/WABinary/constants.d.ts +4 -4
- package/lib/WABinary/constants.js +1276 -13
- package/lib/WABinary/decode.d.ts +2 -2
- package/lib/WABinary/decode.js +3 -2
- package/lib/WABinary/encode.js +5 -7
- package/lib/WABinary/generic-utils.d.ts +2 -2
- package/lib/WABinary/jid-utils.d.ts +9 -4
- package/lib/WABinary/jid-utils.js +26 -5
- package/lib/WABinary/jid-utils.js.bak +83 -0
- package/lib/WAM/encode.d.ts +1 -1
- package/lib/WAUSync/Protocols/USyncDisappearingModeProtocol.js +1 -1
- package/lib/WAUSync/Protocols/USyncStatusProtocol.js +3 -3
- package/lib/WAUSync/USyncUser.d.ts +2 -0
- package/lib/index.d.ts +16 -0
- package/lib/index.js +48 -4
- package/lib/index.js.bak +56 -0
- package/package.json +43 -35
- package/WASignalGroup/GroupProtocol.js +0 -1697
- package/WASignalGroup/ciphertext_message.js +0 -16
- package/WASignalGroup/group_cipher.js +0 -120
- package/WASignalGroup/group_session_builder.js +0 -46
- package/WASignalGroup/index.js +0 -5
- package/WASignalGroup/keyhelper.js +0 -21
- package/WASignalGroup/protobufs.js +0 -3
- package/WASignalGroup/queue_job.js +0 -69
- package/WASignalGroup/sender_chain_key.js +0 -50
- package/WASignalGroup/sender_key_distribution_message.js +0 -78
- package/WASignalGroup/sender_key_message.js +0 -92
- package/WASignalGroup/sender_key_name.js +0 -70
- package/WASignalGroup/sender_key_record.js +0 -56
- package/WASignalGroup/sender_key_state.js +0 -129
- 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.d.ts +0 -264
- package/lib/Socket/registration.js +0 -166
- package/lib/Store/make-cache-manager-store.d.ts +0 -14
- package/lib/Store/make-cache-manager-store.js +0 -83
- package/lib/Utils/use-single-file-auth-state.d.ts +0 -12
- package/lib/Utils/use-single-file-auth-state.js +0 -75
- /package/lib/Socket/Client/{abstract-socket-client.js → types.js} +0 -0
|
@@ -1,40 +1,34 @@
|
|
|
1
|
-
/// <reference types="node" />
|
|
2
1
|
import { Boom } from '@hapi/boom';
|
|
3
2
|
import { proto } from '../../WAProto';
|
|
4
|
-
import { AnyMessageContent,
|
|
3
|
+
import { AnyMessageContent, MediaConnInfo, MessageReceiptType, MessageRelayOptions, MiscMessageGenerationOptions, SocketConfig, WAMessageKey } from '../Types';
|
|
5
4
|
import { BinaryNode, JidWithDevice } from '../WABinary';
|
|
6
5
|
import { USyncQuery } from '../WAUSync';
|
|
7
6
|
export declare const makeMessagesSocket: (config: SocketConfig) => {
|
|
8
|
-
getPrivacyTokens: (jids: string[]) => Promise<
|
|
7
|
+
getPrivacyTokens: (jids: string[]) => Promise<any>;
|
|
9
8
|
assertSessions: (jids: string[], force: boolean) => Promise<boolean>;
|
|
10
|
-
relayMessage: (jid: string, message: proto.IMessage, { messageId: msgId, participant, additionalAttributes, additionalNodes, useUserDevicesCache,
|
|
9
|
+
relayMessage: (jid: string, message: proto.IMessage, { messageId: msgId, participant, additionalAttributes, additionalNodes, useUserDevicesCache, useCachedGroupMetadata, statusJidList }: MessageRelayOptions) => Promise<string>;
|
|
11
10
|
sendReceipt: (jid: string, participant: string | undefined, messageIds: string[], type: MessageReceiptType) => Promise<void>;
|
|
12
11
|
sendReceipts: (keys: WAMessageKey[], type: MessageReceiptType) => Promise<void>;
|
|
13
|
-
getButtonArgs: (message: proto.IMessage) => BinaryNode['attrs'];
|
|
14
12
|
readMessages: (keys: WAMessageKey[]) => Promise<void>;
|
|
15
13
|
refreshMediaConn: (forceGet?: boolean) => Promise<MediaConnInfo>;
|
|
16
|
-
getUSyncDevices: (jids: string[], useCache: boolean, ignoreZeroDevices: boolean) => Promise<JidWithDevice[]>;
|
|
17
|
-
sendPeerDataOperationMessage: (pdoMessage: proto.Message.IPeerDataOperationRequestMessage) => Promise<string>;
|
|
18
|
-
createParticipantNodes: (jids: string[], message: proto.IMessage, extraAttrs?: BinaryNode['attrs']) => Promise<{
|
|
19
|
-
nodes: BinaryNode[];
|
|
20
|
-
shouldIncludeDeviceIdentity: boolean;
|
|
21
|
-
}>;
|
|
22
|
-
profilePictureUrl: (jid: string, type?: 'preview' | 'image', timeoutMs?: number) => Promise<string | null | undefined>;
|
|
23
14
|
waUploadToServer: import("../Types").WAMediaUploadFunction;
|
|
24
15
|
fetchPrivacySettings: (force?: boolean) => Promise<{
|
|
25
16
|
[_: string]: string;
|
|
26
17
|
}>;
|
|
18
|
+
getUSyncDevices: (jids: string[], useCache: boolean, ignoreZeroDevices: boolean) => Promise<JidWithDevice[]>;
|
|
19
|
+
createParticipantNodes: (jids: string[], message: proto.IMessage, extraAttrs?: BinaryNode["attrs"]) => Promise<{
|
|
20
|
+
nodes: BinaryNode[];
|
|
21
|
+
shouldIncludeDeviceIdentity: boolean;
|
|
22
|
+
}>;
|
|
23
|
+
sendPeerDataOperationMessage: (pdoMessage: proto.Message.IPeerDataOperationRequestMessage) => Promise<string>;
|
|
27
24
|
updateMediaMessage: (message: proto.IWebMessageInfo) => Promise<proto.IWebMessageInfo>;
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
sendMessage: (jid: string, content: AnyMessageContent, options?: MiscMessageGenerationOptions) => Promise<proto.WebMessageInfo | undefined>;
|
|
31
|
-
newsletterQuery: (jid: string, type: "get" | "set", content: BinaryNode[]) => Promise<BinaryNode>;
|
|
32
|
-
newsletterWMexQuery: (jid: string | undefined, queryId: QueryIds, content?: object | undefined) => Promise<BinaryNode>;
|
|
25
|
+
sendMessage: (jid: string, content: AnyMessageContent, options?: MiscMessageGenerationOptions) => Promise<proto.WebMessageInfo>;
|
|
26
|
+
rex: any;
|
|
33
27
|
subscribeNewsletterUpdates: (jid: string) => Promise<{
|
|
34
28
|
duration: string;
|
|
35
29
|
}>;
|
|
36
30
|
newsletterReactionMode: (jid: string, mode: import("../Types").NewsletterReactionMode) => Promise<void>;
|
|
37
|
-
newsletterUpdateDescription: (jid: string, description?: string
|
|
31
|
+
newsletterUpdateDescription: (jid: string, description?: string) => Promise<void>;
|
|
38
32
|
newsletterUpdateName: (jid: string, name: string) => Promise<void>;
|
|
39
33
|
newsletterUpdatePicture: (jid: string, content: import("../Types").WAMediaUpload) => Promise<void>;
|
|
40
34
|
newsletterRemovePicture: (jid: string) => Promise<void>;
|
|
@@ -42,17 +36,16 @@ export declare const makeMessagesSocket: (config: SocketConfig) => {
|
|
|
42
36
|
newsletterFollow: (jid: string) => Promise<void>;
|
|
43
37
|
newsletterUnmute: (jid: string) => Promise<void>;
|
|
44
38
|
newsletterMute: (jid: string) => Promise<void>;
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
newsletterMetadata: (type: "invite" | "jid", key: string, role?: import("../Types").NewsletterViewRole | undefined) => Promise<import("../Types").NewsletterMetadata>;
|
|
39
|
+
newsletterCreate: (name: string, description?: string, picture?: import("../Types").WAMediaUpload) => Promise<import("../Types").NewsletterMetadata>;
|
|
40
|
+
newsletterMetadata: (type: "invite" | "jid", key: string, role?: import("../Types").NewsletterViewRole) => Promise<import("../Types").NewsletterMetadata>;
|
|
48
41
|
newsletterAdminCount: (jid: string) => Promise<number>;
|
|
49
42
|
newsletterChangeOwner: (jid: string, user: string) => Promise<void>;
|
|
50
43
|
newsletterDemote: (jid: string, user: string) => Promise<void>;
|
|
51
44
|
newsletterDelete: (jid: string) => Promise<void>;
|
|
52
|
-
newsletterReactMessage: (jid: string,
|
|
53
|
-
newsletterFetchMessages: (type: "invite" | "jid", key: string, count: number, after?: number
|
|
54
|
-
newsletterFetchUpdates: (jid: string, count: number, after?: number
|
|
55
|
-
groupQuery: (jid: string, type: "get" | "set", content: BinaryNode[]) => Promise<
|
|
45
|
+
newsletterReactMessage: (jid: string, server_id: string, code?: string) => Promise<void>;
|
|
46
|
+
newsletterFetchMessages: (type: "invite" | "jid", key: string, count: number, after?: number) => Promise<import("../Types").NewsletterFetchedUpdate[]>;
|
|
47
|
+
newsletterFetchUpdates: (jid: string, count: number, after?: number, since?: number) => Promise<import("../Types").NewsletterFetchedUpdate[]>;
|
|
48
|
+
groupQuery: (jid: string, type: "get" | "set", content: BinaryNode[]) => Promise<any>;
|
|
56
49
|
groupMetadata: (jid: string) => Promise<import("../Types").GroupMetadata>;
|
|
57
50
|
groupCreate: (subject: string, participants: string[]) => Promise<import("../Types").GroupMetadata>;
|
|
58
51
|
groupLeave: (id: string) => Promise<void>;
|
|
@@ -60,7 +53,7 @@ export declare const makeMessagesSocket: (config: SocketConfig) => {
|
|
|
60
53
|
groupRequestParticipantsList: (jid: string) => Promise<{
|
|
61
54
|
[key: string]: string;
|
|
62
55
|
}[]>;
|
|
63
|
-
groupRequestParticipantsUpdate: (jid: string, participants: string[], action: "
|
|
56
|
+
groupRequestParticipantsUpdate: (jid: string, participants: string[], action: "approve" | "reject") => Promise<{
|
|
64
57
|
status: string;
|
|
65
58
|
jid: string;
|
|
66
59
|
}[]>;
|
|
@@ -69,67 +62,71 @@ export declare const makeMessagesSocket: (config: SocketConfig) => {
|
|
|
69
62
|
jid: string;
|
|
70
63
|
content: BinaryNode;
|
|
71
64
|
}[]>;
|
|
72
|
-
groupUpdateDescription: (jid: string, description?: string
|
|
65
|
+
groupUpdateDescription: (jid: string, description?: string) => Promise<void>;
|
|
73
66
|
groupInviteCode: (jid: string) => Promise<string | undefined>;
|
|
74
67
|
groupRevokeInvite: (jid: string) => Promise<string | undefined>;
|
|
75
68
|
groupAcceptInvite: (code: string) => Promise<string | undefined>;
|
|
76
|
-
|
|
69
|
+
groupRevokeInviteV4: (groupJid: string, invitedJid: string) => Promise<boolean>;
|
|
70
|
+
groupAcceptInviteV4: (key: string | WAMessageKey, inviteMessage: proto.Message.IGroupInviteMessage) => Promise<any>;
|
|
77
71
|
groupGetInviteInfo: (code: string) => Promise<import("../Types").GroupMetadata>;
|
|
78
72
|
groupToggleEphemeral: (jid: string, ephemeralExpiration: number) => Promise<void>;
|
|
79
|
-
groupSettingUpdate: (jid: string, setting: "announcement" | "
|
|
80
|
-
groupMemberAddMode: (jid: string, mode: "
|
|
73
|
+
groupSettingUpdate: (jid: string, setting: "announcement" | "not_announcement" | "locked" | "unlocked") => Promise<void>;
|
|
74
|
+
groupMemberAddMode: (jid: string, mode: "admin_add" | "all_member_add") => Promise<void>;
|
|
81
75
|
groupJoinApprovalMode: (jid: string, mode: "on" | "off") => Promise<void>;
|
|
82
76
|
groupFetchAllParticipating: () => Promise<{
|
|
83
77
|
[_: string]: import("../Types").GroupMetadata;
|
|
84
78
|
}>;
|
|
85
|
-
|
|
79
|
+
getBotListV2: () => Promise<import("../Types").BotListInfo[]>;
|
|
86
80
|
processingMutex: {
|
|
87
|
-
mutex<T>(code: () => T |
|
|
81
|
+
mutex<T>(code: () => Promise<T> | T): Promise<T>;
|
|
88
82
|
};
|
|
89
|
-
upsertMessage: (msg:
|
|
83
|
+
upsertMessage: (msg: import("../Types").WAMessage, type: import("../Types").MessageUpsertType) => Promise<void>;
|
|
90
84
|
appPatch: (patchCreate: import("../Types").WAPatchCreate) => Promise<void>;
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
85
|
+
sendPresenceUpdate: (type: import("../Types").WAPresence, toJid?: string) => Promise<void>;
|
|
86
|
+
presenceSubscribe: (toJid: string, tcToken?: Buffer) => Promise<void>;
|
|
87
|
+
profilePictureUrl: (jid: string, type?: "preview" | "image", timeoutMs?: number) => Promise<string | undefined>;
|
|
94
88
|
onWhatsApp: (...jids: string[]) => Promise<{
|
|
95
89
|
jid: string;
|
|
96
90
|
exists: unknown;
|
|
91
|
+
lid: unknown;
|
|
97
92
|
}[] | undefined>;
|
|
98
93
|
fetchBlocklist: () => Promise<string[]>;
|
|
99
|
-
fetchStatus: (...jids: string[]) => Promise<import("../WAUSync").USyncQueryResultList[] | undefined>;
|
|
100
94
|
fetchDisappearingDuration: (...jids: string[]) => Promise<import("../WAUSync").USyncQueryResultList[] | undefined>;
|
|
95
|
+
fetchStatus: (...jids: string[]) => Promise<import("../WAUSync").USyncQueryResultList[] | undefined>;
|
|
101
96
|
updateProfilePicture: (jid: string, content: import("../Types").WAMediaUpload) => Promise<void>;
|
|
102
97
|
removeProfilePicture: (jid: string) => Promise<void>;
|
|
103
98
|
updateProfileStatus: (status: string) => Promise<void>;
|
|
104
99
|
updateProfileName: (name: string) => Promise<void>;
|
|
105
100
|
updateBlockStatus: (jid: string, action: "block" | "unblock") => Promise<void>;
|
|
101
|
+
updateCallPrivacy: (value: import("../Types").WAPrivacyCallValue) => Promise<void>;
|
|
102
|
+
updateMessagesPrivacy: (value: import("../Types").WAPrivacyMessagesValue) => Promise<void>;
|
|
106
103
|
updateLastSeenPrivacy: (value: import("../Types").WAPrivacyValue) => Promise<void>;
|
|
107
104
|
updateOnlinePrivacy: (value: import("../Types").WAPrivacyOnlineValue) => Promise<void>;
|
|
108
105
|
updateProfilePicturePrivacy: (value: import("../Types").WAPrivacyValue) => Promise<void>;
|
|
109
106
|
updateStatusPrivacy: (value: import("../Types").WAPrivacyValue) => Promise<void>;
|
|
110
107
|
updateReadReceiptsPrivacy: (value: import("../Types").WAReadReceiptsValue) => Promise<void>;
|
|
111
|
-
updateGroupsAddPrivacy: (value: import("../Types").
|
|
108
|
+
updateGroupsAddPrivacy: (value: import("../Types").WAPrivacyGroupAddValue) => Promise<void>;
|
|
112
109
|
updateDefaultDisappearingMode: (duration: number) => Promise<void>;
|
|
113
|
-
getBusinessProfile: (jid: string) => Promise<
|
|
114
|
-
resyncAppState: (collections: readonly ("
|
|
110
|
+
getBusinessProfile: (jid: string) => Promise<import("../Types").WABusinessProfile | void>;
|
|
111
|
+
resyncAppState: (collections: readonly ("critical_unblock_low" | "regular_high" | "regular_low" | "critical_block" | "regular")[], isInitialSync: boolean) => Promise<void>;
|
|
115
112
|
chatModify: (mod: import("../Types").ChatModification, jid: string) => Promise<void>;
|
|
116
|
-
cleanDirtyBits: (type: "account_sync" | "groups", fromTimestamp?:
|
|
113
|
+
cleanDirtyBits: (type: "account_sync" | "groups", fromTimestamp?: number | string) => Promise<void>;
|
|
117
114
|
addChatLabel: (jid: string, labelId: string) => Promise<void>;
|
|
118
115
|
removeChatLabel: (jid: string, labelId: string) => Promise<void>;
|
|
119
116
|
addMessageLabel: (jid: string, messageId: string, labelId: string) => Promise<void>;
|
|
120
117
|
removeMessageLabel: (jid: string, messageId: string, labelId: string) => Promise<void>;
|
|
121
118
|
star: (jid: string, messages: {
|
|
122
119
|
id: string;
|
|
123
|
-
fromMe?: boolean
|
|
120
|
+
fromMe?: boolean;
|
|
124
121
|
}[], star: boolean) => Promise<void>;
|
|
125
122
|
executeUSyncQuery: (usyncQuery: USyncQuery) => Promise<import("../WAUSync").USyncQueryResult | undefined>;
|
|
126
123
|
type: "md";
|
|
127
|
-
ws:
|
|
124
|
+
ws: import("./Client").WebSocketClient;
|
|
128
125
|
ev: import("../Types").BaileysEventEmitter & {
|
|
129
|
-
process(handler: (events: Partial<import("../Types").BaileysEventMap>) => void | Promise<void>): () => void;
|
|
126
|
+
process(handler: (events: Partial<import("../Types").BaileysEventMap>) => void | Promise<void>): (() => void);
|
|
130
127
|
buffer(): void;
|
|
131
|
-
createBufferedFunction<A extends any[],
|
|
132
|
-
flush(force?: boolean
|
|
128
|
+
createBufferedFunction<A extends any[], T>(work: (...args: A) => Promise<T>): ((...args: A) => Promise<T>);
|
|
129
|
+
flush(force?: boolean): boolean;
|
|
133
130
|
isBuffering(): boolean;
|
|
134
131
|
};
|
|
135
132
|
authState: {
|
|
@@ -139,17 +136,17 @@ export declare const makeMessagesSocket: (config: SocketConfig) => {
|
|
|
139
136
|
signalRepository: import("../Types").SignalRepository;
|
|
140
137
|
user: import("../Types").Contact | undefined;
|
|
141
138
|
generateMessageTag: () => string;
|
|
142
|
-
query: (node: BinaryNode, timeoutMs?: number
|
|
143
|
-
waitForMessage: <
|
|
139
|
+
query: (node: BinaryNode, timeoutMs?: number) => Promise<any>;
|
|
140
|
+
waitForMessage: <T>(msgId: string, timeoutMs?: number | undefined) => Promise<any>;
|
|
144
141
|
waitForSocketOpen: () => Promise<void>;
|
|
145
142
|
sendRawMessage: (data: Uint8Array | Buffer) => Promise<void>;
|
|
146
143
|
sendNode: (frame: BinaryNode) => Promise<void>;
|
|
147
|
-
logout: (msg?: string
|
|
144
|
+
logout: (msg?: string) => Promise<void>;
|
|
148
145
|
end: (error: Error | undefined) => void;
|
|
149
|
-
onUnexpectedError: (err: Error | Boom
|
|
146
|
+
onUnexpectedError: (err: Error | Boom, msg: string) => void;
|
|
150
147
|
uploadPreKeys: (count?: number) => Promise<void>;
|
|
151
148
|
uploadPreKeysToServerIfRequired: () => Promise<void>;
|
|
152
|
-
requestPairingCode: (phoneNumber:
|
|
153
|
-
waitForConnectionUpdate: (check: (u: Partial<import("../Types").ConnectionState>) => boolean | undefined
|
|
154
|
-
sendWAMBuffer: (wamBuffer: Buffer) => Promise<
|
|
149
|
+
requestPairingCode: (phoneNumber: any, pairKey?: string) => Promise<string>;
|
|
150
|
+
waitForConnectionUpdate: (check: (u: Partial<import("../Types").ConnectionState>) => Promise<boolean | undefined>, timeoutMs?: number) => Promise<void>;
|
|
151
|
+
sendWAMBuffer: (wamBuffer: Buffer) => Promise<any>;
|
|
155
152
|
};
|