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
package/lib/Socket/business.d.ts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { GetCatalogOptions, ProductCreate, ProductUpdate, SocketConfig } from '../Types';
|
|
2
2
|
import { BinaryNode } from '../WABinary';
|
|
3
3
|
export declare const makeBusinessSocket: (config: SocketConfig) => {
|
|
4
|
-
logger:
|
|
4
|
+
logger: import("../Utils/logger").ILogger;
|
|
5
5
|
getOrderDetails: (orderId: string, tokenBase64: string) => Promise<import("../Types").OrderDetails>;
|
|
6
6
|
getCatalog: ({ jid, limit, cursor }: GetCatalogOptions) => Promise<{
|
|
7
7
|
products: import("../Types").Product[];
|
|
8
|
-
nextPageCursor:
|
|
8
|
+
nextPageCursor: string | undefined;
|
|
9
9
|
}>;
|
|
10
10
|
getCollections: (jid?: string, limit?: number) => Promise<{
|
|
11
11
|
collections: import("../Types").CatalogCollection[];
|
|
@@ -17,35 +17,33 @@ export declare const makeBusinessSocket: (config: SocketConfig) => {
|
|
|
17
17
|
productUpdate: (productId: string, update: ProductUpdate) => Promise<import("../Types").Product>;
|
|
18
18
|
sendMessageAck: ({ tag, attrs, content }: BinaryNode, errorCode?: number) => Promise<void>;
|
|
19
19
|
sendRetryRequest: (node: BinaryNode, forceIncludeKeys?: boolean) => Promise<void>;
|
|
20
|
+
rejectCall: (callId: string, callFrom: string) => Promise<void>;
|
|
20
21
|
offerCall: (toJid: string, isVideo?: boolean) => Promise<{
|
|
21
|
-
|
|
22
|
-
|
|
22
|
+
callId: string;
|
|
23
|
+
toJid: string;
|
|
24
|
+
isVideo: boolean;
|
|
23
25
|
}>;
|
|
24
|
-
|
|
25
|
-
fetchMessageHistory: (count: number, oldestMsgKey: import("../Types").WAMessageKey, oldestMsgTimestamp: number) => Promise<string>;
|
|
26
|
+
fetchMessageHistory: (count: number, oldestMsgKey: import("../Types").WAMessageKey, oldestMsgTimestamp: number | Long) => Promise<string>;
|
|
26
27
|
requestPlaceholderResend: (messageKey: import("../Types").WAMessageKey) => Promise<string | undefined>;
|
|
27
|
-
getPrivacyTokens: (jids: string[]) => Promise<
|
|
28
|
+
getPrivacyTokens: (jids: string[]) => Promise<any>;
|
|
28
29
|
assertSessions: (jids: string[], force: boolean) => Promise<boolean>;
|
|
29
|
-
relayMessage: (jid: string, message: import("../Types").WAProto.IMessage, { messageId: msgId, participant, additionalAttributes, additionalNodes, useUserDevicesCache,
|
|
30
|
+
relayMessage: (jid: string, message: import("../Types").WAProto.IMessage, { messageId: msgId, participant, additionalAttributes, additionalNodes, useUserDevicesCache, useCachedGroupMetadata, statusJidList }: import("../Types").MessageRelayOptions) => Promise<string>;
|
|
30
31
|
sendReceipt: (jid: string, participant: string | undefined, messageIds: string[], type: import("../Types").MessageReceiptType) => Promise<void>;
|
|
31
32
|
sendReceipts: (keys: import("../Types").WAMessageKey[], type: import("../Types").MessageReceiptType) => Promise<void>;
|
|
32
|
-
getButtonArgs: (message: import("../Types").WAProto.IMessage) => BinaryNode["attrs"];
|
|
33
33
|
readMessages: (keys: import("../Types").WAMessageKey[]) => Promise<void>;
|
|
34
34
|
refreshMediaConn: (forceGet?: boolean) => Promise<import("../Types").MediaConnInfo>;
|
|
35
|
+
waUploadToServer: import("../Types").WAMediaUploadFunction;
|
|
36
|
+
fetchPrivacySettings: (force?: boolean) => Promise<{
|
|
37
|
+
[_: string]: string;
|
|
38
|
+
}>;
|
|
35
39
|
getUSyncDevices: (jids: string[], useCache: boolean, ignoreZeroDevices: boolean) => Promise<import("../WABinary").JidWithDevice[]>;
|
|
36
|
-
sendPeerDataOperationMessage: (pdoMessage: import("../Types").WAProto.Message.IPeerDataOperationRequestMessage) => Promise<string>;
|
|
37
40
|
createParticipantNodes: (jids: string[], message: import("../Types").WAProto.IMessage, extraAttrs?: BinaryNode["attrs"]) => Promise<{
|
|
38
41
|
nodes: BinaryNode[];
|
|
39
42
|
shouldIncludeDeviceIdentity: boolean;
|
|
40
43
|
}>;
|
|
41
|
-
|
|
42
|
-
fetchPrivacySettings: (force?: boolean) => Promise<{
|
|
43
|
-
[_: string]: string;
|
|
44
|
-
}>;
|
|
44
|
+
sendPeerDataOperationMessage: (pdoMessage: import("../Types").WAProto.Message.IPeerDataOperationRequestMessage) => Promise<string>;
|
|
45
45
|
updateMediaMessage: (message: import("../Types").WAProto.IWebMessageInfo) => Promise<import("../Types").WAProto.IWebMessageInfo>;
|
|
46
|
-
|
|
47
|
-
sendAlbumMessage: (jid: string, medias: import("../Types").Media[], options?: import("../Types").MiscMessageGenerationOptions) => Promise<import("../Types").WAProto.WebMessageInfo>;
|
|
48
|
-
sendMessage: (jid: string, content: import("../Types").AnyMessageContent, options?: import("../Types").MiscMessageGenerationOptions) => Promise<import("../Types").WAProto.WebMessageInfo | undefined>;
|
|
46
|
+
sendMessage: (jid: string, content: import("../Types").AnyMessageContent, options?: import("../Types").MiscMessageGenerationOptions) => Promise<import("../Types").WAProto.WebMessageInfo>;
|
|
49
47
|
subscribeNewsletterUpdates: (jid: string) => Promise<{
|
|
50
48
|
duration: string;
|
|
51
49
|
}>;
|
|
@@ -58,16 +56,16 @@ export declare const makeBusinessSocket: (config: SocketConfig) => {
|
|
|
58
56
|
newsletterFollow: (jid: string) => Promise<void>;
|
|
59
57
|
newsletterUnmute: (jid: string) => Promise<void>;
|
|
60
58
|
newsletterMute: (jid: string) => Promise<void>;
|
|
61
|
-
|
|
62
|
-
newsletterCreate: (name: string, description: string) => Promise<import("../Types").NewsletterMetadata>;
|
|
59
|
+
newsletterCreate: (name: string, description?: string, picture?: import("../Types").WAMediaUpload) => Promise<import("../Types").NewsletterMetadata>;
|
|
63
60
|
newsletterMetadata: (type: "invite" | "jid", key: string, role?: import("../Types").NewsletterViewRole) => Promise<import("../Types").NewsletterMetadata>;
|
|
64
61
|
newsletterAdminCount: (jid: string) => Promise<number>;
|
|
65
62
|
newsletterChangeOwner: (jid: string, user: string) => Promise<void>;
|
|
66
63
|
newsletterDemote: (jid: string, user: string) => Promise<void>;
|
|
67
64
|
newsletterDelete: (jid: string) => Promise<void>;
|
|
68
|
-
newsletterReactMessage: (jid: string,
|
|
65
|
+
newsletterReactMessage: (jid: string, server_id: string, code?: string) => Promise<void>;
|
|
69
66
|
newsletterFetchMessages: (type: "invite" | "jid", key: string, count: number, after?: number) => Promise<import("../Types").NewsletterFetchedUpdate[]>;
|
|
70
67
|
newsletterFetchUpdates: (jid: string, count: number, after?: number, since?: number) => Promise<import("../Types").NewsletterFetchedUpdate[]>;
|
|
68
|
+
groupQuery: (jid: string, type: "get" | "set", content: BinaryNode[]) => Promise<any>;
|
|
71
69
|
groupMetadata: (jid: string) => Promise<import("../Types").GroupMetadata>;
|
|
72
70
|
groupCreate: (subject: string, participants: string[]) => Promise<import("../Types").GroupMetadata>;
|
|
73
71
|
groupLeave: (id: string) => Promise<void>;
|
|
@@ -88,7 +86,8 @@ export declare const makeBusinessSocket: (config: SocketConfig) => {
|
|
|
88
86
|
groupInviteCode: (jid: string) => Promise<string | undefined>;
|
|
89
87
|
groupRevokeInvite: (jid: string) => Promise<string | undefined>;
|
|
90
88
|
groupAcceptInvite: (code: string) => Promise<string | undefined>;
|
|
91
|
-
|
|
89
|
+
groupRevokeInviteV4: (groupJid: string, invitedJid: string) => Promise<boolean>;
|
|
90
|
+
groupAcceptInviteV4: (key: string | import("../Types").WAMessageKey, inviteMessage: import("../Types").WAProto.Message.IGroupInviteMessage) => Promise<any>;
|
|
92
91
|
groupGetInviteInfo: (code: string) => Promise<import("../Types").GroupMetadata>;
|
|
93
92
|
groupToggleEphemeral: (jid: string, ephemeralExpiration: number) => Promise<void>;
|
|
94
93
|
groupSettingUpdate: (jid: string, setting: "announcement" | "not_announcement" | "locked" | "unlocked") => Promise<void>;
|
|
@@ -97,37 +96,39 @@ export declare const makeBusinessSocket: (config: SocketConfig) => {
|
|
|
97
96
|
groupFetchAllParticipating: () => Promise<{
|
|
98
97
|
[_: string]: import("../Types").GroupMetadata;
|
|
99
98
|
}>;
|
|
99
|
+
getBotListV2: () => Promise<import("../Types").BotListInfo[]>;
|
|
100
100
|
processingMutex: {
|
|
101
101
|
mutex<T>(code: () => Promise<T> | T): Promise<T>;
|
|
102
102
|
};
|
|
103
|
-
upsertMessage: (msg: import("../Types").
|
|
103
|
+
upsertMessage: (msg: import("../Types").WAMessage, type: import("../Types").MessageUpsertType) => Promise<void>;
|
|
104
104
|
appPatch: (patchCreate: import("../Types").WAPatchCreate) => Promise<void>;
|
|
105
105
|
sendPresenceUpdate: (type: import("../Types").WAPresence, toJid?: string) => Promise<void>;
|
|
106
106
|
presenceSubscribe: (toJid: string, tcToken?: Buffer) => Promise<void>;
|
|
107
107
|
profilePictureUrl: (jid: string, type?: "preview" | "image", timeoutMs?: number) => Promise<string | undefined>;
|
|
108
108
|
onWhatsApp: (...jids: string[]) => Promise<{
|
|
109
|
-
exists: boolean;
|
|
110
109
|
jid: string;
|
|
111
|
-
|
|
110
|
+
exists: unknown;
|
|
111
|
+
lid: unknown;
|
|
112
|
+
}[] | undefined>;
|
|
112
113
|
fetchBlocklist: () => Promise<string[]>;
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
setAt: Date;
|
|
116
|
-
} | undefined>;
|
|
114
|
+
fetchDisappearingDuration: (...jids: string[]) => Promise<import("..").USyncQueryResultList[] | undefined>;
|
|
115
|
+
fetchStatus: (...jids: string[]) => Promise<import("..").USyncQueryResultList[] | undefined>;
|
|
117
116
|
updateProfilePicture: (jid: string, content: import("../Types").WAMediaUpload) => Promise<void>;
|
|
118
117
|
removeProfilePicture: (jid: string) => Promise<void>;
|
|
119
118
|
updateProfileStatus: (status: string) => Promise<void>;
|
|
120
119
|
updateProfileName: (name: string) => Promise<void>;
|
|
121
120
|
updateBlockStatus: (jid: string, action: "block" | "unblock") => Promise<void>;
|
|
121
|
+
updateCallPrivacy: (value: import("../Types").WAPrivacyCallValue) => Promise<void>;
|
|
122
|
+
updateMessagesPrivacy: (value: import("../Types").WAPrivacyMessagesValue) => Promise<void>;
|
|
122
123
|
updateLastSeenPrivacy: (value: import("../Types").WAPrivacyValue) => Promise<void>;
|
|
123
124
|
updateOnlinePrivacy: (value: import("../Types").WAPrivacyOnlineValue) => Promise<void>;
|
|
124
125
|
updateProfilePicturePrivacy: (value: import("../Types").WAPrivacyValue) => Promise<void>;
|
|
125
126
|
updateStatusPrivacy: (value: import("../Types").WAPrivacyValue) => Promise<void>;
|
|
126
127
|
updateReadReceiptsPrivacy: (value: import("../Types").WAReadReceiptsValue) => Promise<void>;
|
|
127
|
-
updateGroupsAddPrivacy: (value: import("../Types").
|
|
128
|
+
updateGroupsAddPrivacy: (value: import("../Types").WAPrivacyGroupAddValue) => Promise<void>;
|
|
128
129
|
updateDefaultDisappearingMode: (duration: number) => Promise<void>;
|
|
129
130
|
getBusinessProfile: (jid: string) => Promise<import("../Types").WABusinessProfile | void>;
|
|
130
|
-
resyncAppState: (collections: readonly ("
|
|
131
|
+
resyncAppState: (collections: readonly ("critical_unblock_low" | "regular_high" | "regular_low" | "critical_block" | "regular")[], isInitialSync: boolean) => Promise<void>;
|
|
131
132
|
chatModify: (mod: import("../Types").ChatModification, jid: string) => Promise<void>;
|
|
132
133
|
cleanDirtyBits: (type: "account_sync" | "groups", fromTimestamp?: number | string) => Promise<void>;
|
|
133
134
|
addChatLabel: (jid: string, labelId: string) => Promise<void>;
|
|
@@ -138,8 +139,9 @@ export declare const makeBusinessSocket: (config: SocketConfig) => {
|
|
|
138
139
|
id: string;
|
|
139
140
|
fromMe?: boolean;
|
|
140
141
|
}[], star: boolean) => Promise<void>;
|
|
142
|
+
executeUSyncQuery: (usyncQuery: import("..").USyncQuery) => Promise<import("..").USyncQueryResult | undefined>;
|
|
141
143
|
type: "md";
|
|
142
|
-
ws:
|
|
144
|
+
ws: import("./Client").WebSocketClient;
|
|
143
145
|
ev: import("../Types").BaileysEventEmitter & {
|
|
144
146
|
process(handler: (events: Partial<import("../Types").BaileysEventMap>) => void | Promise<void>): (() => void);
|
|
145
147
|
buffer(): void;
|
|
@@ -154,17 +156,17 @@ export declare const makeBusinessSocket: (config: SocketConfig) => {
|
|
|
154
156
|
signalRepository: import("../Types").SignalRepository;
|
|
155
157
|
user: import("../Types").Contact | undefined;
|
|
156
158
|
generateMessageTag: () => string;
|
|
157
|
-
query: (node: BinaryNode, timeoutMs?: number) => Promise<
|
|
158
|
-
waitForMessage: <T>(msgId: string, timeoutMs?: number | undefined) => Promise<
|
|
159
|
+
query: (node: BinaryNode, timeoutMs?: number) => Promise<any>;
|
|
160
|
+
waitForMessage: <T>(msgId: string, timeoutMs?: number | undefined) => Promise<any>;
|
|
159
161
|
waitForSocketOpen: () => Promise<void>;
|
|
160
162
|
sendRawMessage: (data: Uint8Array | Buffer) => Promise<void>;
|
|
161
163
|
sendNode: (frame: BinaryNode) => Promise<void>;
|
|
162
164
|
logout: (msg?: string) => Promise<void>;
|
|
163
165
|
end: (error: Error | undefined) => void;
|
|
164
|
-
onUnexpectedError: (err: Error | Boom, msg: string) => void;
|
|
166
|
+
onUnexpectedError: (err: Error | import("@hapi/boom").Boom, msg: string) => void;
|
|
165
167
|
uploadPreKeys: (count?: number) => Promise<void>;
|
|
166
168
|
uploadPreKeysToServerIfRequired: () => Promise<void>;
|
|
167
|
-
requestPairingCode: (phoneNumber:
|
|
168
|
-
waitForConnectionUpdate: (check: (u: Partial<import("../Types").ConnectionState>) => boolean | undefined
|
|
169
|
-
sendWAMBuffer: (wamBuffer: Buffer) => Promise<
|
|
169
|
+
requestPairingCode: (phoneNumber: any, pairKey?: string) => Promise<string>;
|
|
170
|
+
waitForConnectionUpdate: (check: (u: Partial<import("../Types").ConnectionState>) => Promise<boolean | undefined>, timeoutMs?: number) => Promise<void>;
|
|
171
|
+
sendWAMBuffer: (wamBuffer: Buffer) => Promise<any>;
|
|
170
172
|
};
|
package/lib/Socket/chats.d.ts
CHANGED
|
@@ -1,45 +1,46 @@
|
|
|
1
|
-
/// <reference types="node" />
|
|
2
1
|
import { Boom } from '@hapi/boom';
|
|
3
|
-
import {
|
|
4
|
-
import { ChatModification, MessageUpsertType, SocketConfig, WABusinessProfile, WAMediaUpload, WAPatchCreate, WAPresence, WAPrivacyOnlineValue, WAPrivacyValue, WAReadReceiptsValue } from '../Types';
|
|
2
|
+
import { BotListInfo, ChatModification, MessageUpsertType, SocketConfig, WABusinessProfile, WAMediaUpload, WAMessage, WAPatchCreate, WAPresence, WAPrivacyCallValue, WAPrivacyGroupAddValue, WAPrivacyMessagesValue, WAPrivacyOnlineValue, WAPrivacyValue, WAReadReceiptsValue } from '../Types';
|
|
5
3
|
import { BinaryNode } from '../WABinary';
|
|
6
4
|
import { USyncQuery } from '../WAUSync';
|
|
7
5
|
export declare const makeChatsSocket: (config: SocketConfig) => {
|
|
8
|
-
|
|
6
|
+
getBotListV2: () => Promise<BotListInfo[]>;
|
|
9
7
|
processingMutex: {
|
|
10
|
-
mutex<T>(code: () => T |
|
|
8
|
+
mutex<T>(code: () => Promise<T> | T): Promise<T>;
|
|
11
9
|
};
|
|
12
10
|
fetchPrivacySettings: (force?: boolean) => Promise<{
|
|
13
11
|
[_: string]: string;
|
|
14
12
|
}>;
|
|
15
|
-
upsertMessage: (msg:
|
|
13
|
+
upsertMessage: (msg: WAMessage, type: MessageUpsertType) => Promise<void>;
|
|
16
14
|
appPatch: (patchCreate: WAPatchCreate) => Promise<void>;
|
|
17
|
-
fetchUserLid: (jid: string) => Promise<string | undefined>;
|
|
18
15
|
sendPresenceUpdate: (type: WAPresence, toJid?: string) => Promise<void>;
|
|
19
16
|
presenceSubscribe: (toJid: string, tcToken?: Buffer) => Promise<void>;
|
|
17
|
+
profilePictureUrl: (jid: string, type?: "preview" | "image", timeoutMs?: number) => Promise<string | undefined>;
|
|
20
18
|
onWhatsApp: (...jids: string[]) => Promise<{
|
|
21
19
|
jid: string;
|
|
22
20
|
exists: unknown;
|
|
21
|
+
lid: unknown;
|
|
23
22
|
}[] | undefined>;
|
|
24
23
|
fetchBlocklist: () => Promise<string[]>;
|
|
25
|
-
fetchStatus: (...jids: string[]) => Promise<import("../WAUSync").USyncQueryResultList[] | undefined>;
|
|
26
24
|
fetchDisappearingDuration: (...jids: string[]) => Promise<import("../WAUSync").USyncQueryResultList[] | undefined>;
|
|
25
|
+
fetchStatus: (...jids: string[]) => Promise<import("../WAUSync").USyncQueryResultList[] | undefined>;
|
|
27
26
|
updateProfilePicture: (jid: string, content: WAMediaUpload) => Promise<void>;
|
|
28
27
|
removeProfilePicture: (jid: string) => Promise<void>;
|
|
29
28
|
updateProfileStatus: (status: string) => Promise<void>;
|
|
30
29
|
updateProfileName: (name: string) => Promise<void>;
|
|
31
|
-
updateBlockStatus: (jid: string, action:
|
|
30
|
+
updateBlockStatus: (jid: string, action: "block" | "unblock") => Promise<void>;
|
|
31
|
+
updateCallPrivacy: (value: WAPrivacyCallValue) => Promise<void>;
|
|
32
|
+
updateMessagesPrivacy: (value: WAPrivacyMessagesValue) => Promise<void>;
|
|
32
33
|
updateLastSeenPrivacy: (value: WAPrivacyValue) => Promise<void>;
|
|
33
34
|
updateOnlinePrivacy: (value: WAPrivacyOnlineValue) => Promise<void>;
|
|
34
35
|
updateProfilePicturePrivacy: (value: WAPrivacyValue) => Promise<void>;
|
|
35
36
|
updateStatusPrivacy: (value: WAPrivacyValue) => Promise<void>;
|
|
36
37
|
updateReadReceiptsPrivacy: (value: WAReadReceiptsValue) => Promise<void>;
|
|
37
|
-
updateGroupsAddPrivacy: (value:
|
|
38
|
+
updateGroupsAddPrivacy: (value: WAPrivacyGroupAddValue) => Promise<void>;
|
|
38
39
|
updateDefaultDisappearingMode: (duration: number) => Promise<void>;
|
|
39
40
|
getBusinessProfile: (jid: string) => Promise<WABusinessProfile | void>;
|
|
40
|
-
resyncAppState: (collections: readonly ("
|
|
41
|
+
resyncAppState: (collections: readonly ("critical_unblock_low" | "regular_high" | "regular_low" | "critical_block" | "regular")[], isInitialSync: boolean) => Promise<void>;
|
|
41
42
|
chatModify: (mod: ChatModification, jid: string) => Promise<void>;
|
|
42
|
-
cleanDirtyBits: (type:
|
|
43
|
+
cleanDirtyBits: (type: "account_sync" | "groups", fromTimestamp?: number | string) => Promise<void>;
|
|
43
44
|
addChatLabel: (jid: string, labelId: string) => Promise<void>;
|
|
44
45
|
removeChatLabel: (jid: string, labelId: string) => Promise<void>;
|
|
45
46
|
addMessageLabel: (jid: string, messageId: string, labelId: string) => Promise<void>;
|
|
@@ -48,14 +49,26 @@ export declare const makeChatsSocket: (config: SocketConfig) => {
|
|
|
48
49
|
id: string;
|
|
49
50
|
fromMe?: boolean;
|
|
50
51
|
}[], star: boolean) => Promise<void>;
|
|
52
|
+
/**
|
|
53
|
+
* Custom: checkStatusWA (for legacy Baileys)
|
|
54
|
+
* - Mengecek apakah nomor WA aktif / dibanned
|
|
55
|
+
* - Mengambil bio/status jika masih aktif
|
|
56
|
+
*/
|
|
57
|
+
checkStatusWA: (numberOrJid: string) => Promise<{
|
|
58
|
+
jid: string
|
|
59
|
+
IsBanned: boolean
|
|
60
|
+
Statusbio: string | null
|
|
61
|
+
setAt: Date | null
|
|
62
|
+
error?: string
|
|
63
|
+
}>,
|
|
51
64
|
executeUSyncQuery: (usyncQuery: USyncQuery) => Promise<import("../WAUSync").USyncQueryResult | undefined>;
|
|
52
65
|
type: "md";
|
|
53
|
-
ws:
|
|
66
|
+
ws: import("./Client").WebSocketClient;
|
|
54
67
|
ev: import("../Types").BaileysEventEmitter & {
|
|
55
|
-
process(handler: (events: Partial<import("../Types").BaileysEventMap>) => void | Promise<void>): () => void;
|
|
68
|
+
process(handler: (events: Partial<import("../Types").BaileysEventMap>) => void | Promise<void>): (() => void);
|
|
56
69
|
buffer(): void;
|
|
57
|
-
createBufferedFunction<A extends any[],
|
|
58
|
-
flush(force?: boolean
|
|
70
|
+
createBufferedFunction<A extends any[], T>(work: (...args: A) => Promise<T>): ((...args: A) => Promise<T>);
|
|
71
|
+
flush(force?: boolean): boolean;
|
|
59
72
|
isBuffering(): boolean;
|
|
60
73
|
};
|
|
61
74
|
authState: {
|
|
@@ -65,17 +78,17 @@ export declare const makeChatsSocket: (config: SocketConfig) => {
|
|
|
65
78
|
signalRepository: import("../Types").SignalRepository;
|
|
66
79
|
user: import("../Types").Contact | undefined;
|
|
67
80
|
generateMessageTag: () => string;
|
|
68
|
-
query: (node: BinaryNode, timeoutMs?: number
|
|
69
|
-
waitForMessage: <
|
|
81
|
+
query: (node: BinaryNode, timeoutMs?: number) => Promise<any>;
|
|
82
|
+
waitForMessage: <T>(msgId: string, timeoutMs?: number | undefined) => Promise<any>;
|
|
70
83
|
waitForSocketOpen: () => Promise<void>;
|
|
71
84
|
sendRawMessage: (data: Uint8Array | Buffer) => Promise<void>;
|
|
72
85
|
sendNode: (frame: BinaryNode) => Promise<void>;
|
|
73
|
-
logout: (msg?: string
|
|
86
|
+
logout: (msg?: string) => Promise<void>;
|
|
74
87
|
end: (error: Error | undefined) => void;
|
|
75
|
-
onUnexpectedError: (err: Error | Boom
|
|
88
|
+
onUnexpectedError: (err: Error | Boom, msg: string) => void;
|
|
76
89
|
uploadPreKeys: (count?: number) => Promise<void>;
|
|
77
90
|
uploadPreKeysToServerIfRequired: () => Promise<void>;
|
|
78
|
-
requestPairingCode: (phoneNumber:
|
|
79
|
-
waitForConnectionUpdate: (check: (u: Partial<import("../Types").ConnectionState>) => boolean | undefined
|
|
80
|
-
sendWAMBuffer: (wamBuffer: Buffer) => Promise<
|
|
91
|
+
requestPairingCode: (phoneNumber: any, pairKey?: string) => Promise<string>;
|
|
92
|
+
waitForConnectionUpdate: (check: (u: Partial<import("../Types").ConnectionState>) => Promise<boolean | undefined>, timeoutMs?: number) => Promise<void>;
|
|
93
|
+
sendWAMBuffer: (wamBuffer: Buffer) => Promise<any>;
|
|
81
94
|
};
|