lordceaser-baileys 1.0.13 → 1.0.15
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 -21
- package/lib/Defaults/index.d.ts +1 -2
- package/lib/Defaults/index.js +5 -5
- package/lib/Socket/business.d.ts +8 -8
- package/lib/Socket/chats.d.ts +2 -2
- package/lib/Socket/chats.js +1 -1
- package/lib/Socket/communities.d.ts +5 -5
- package/lib/Socket/groups.d.ts +3 -3
- package/lib/Socket/index.d.ts +9 -9
- package/lib/Socket/messages-recv.d.ts +4 -4
- package/lib/Socket/messages-recv.js +3 -3
- package/lib/Socket/messages-send.d.ts +4 -4
- package/lib/Socket/messages-send.js +1 -1
- package/lib/Socket/newsletter.d.ts +3 -3
- package/lib/Socket/socket.js +2 -2
- package/lib/Types/Message.d.ts +2 -2
- package/lib/Utils/browser-utils.d.ts +1 -1
- package/lib/Utils/business.js +2 -2
- package/lib/Utils/chat-utils.d.ts +1 -1
- package/lib/Utils/crypto.d.ts +3 -3
- package/lib/Utils/decode-wa-message.d.ts +2 -3
- package/lib/Utils/generics.d.ts +2 -2
- package/lib/Utils/history.d.ts +13 -13
- package/lib/Utils/messages-media.d.ts +1 -2
- package/lib/Utils/messages.d.ts +8 -12
- package/lib/Utils/messages.js +3 -2
- package/lib/Utils/process-message.d.ts +2 -2
- package/lib/Utils/validate-connection.d.ts +2 -2
- package/lib/WABinary/generic-utils.d.ts +0 -1
- package/lib/WAM/encode.js +1 -1
- package/lib/lib/Defaults/index.d.ts +73 -0
- package/lib/lib/Defaults/index.js +135 -0
- package/lib/lib/Signal/Group/ciphertext-message.d.ts +9 -0
- package/lib/lib/Signal/Group/ciphertext-message.js +16 -0
- package/lib/lib/Signal/Group/group-session-builder.d.ts +14 -0
- package/lib/lib/Signal/Group/group-session-builder.js +65 -0
- package/lib/lib/Signal/Group/group_cipher.d.ts +16 -0
- package/lib/lib/Signal/Group/group_cipher.js +83 -0
- package/lib/lib/Signal/Group/index.d.ts +11 -0
- package/lib/lib/Signal/Group/index.js +58 -0
- package/lib/lib/Signal/Group/keyhelper.d.ts +10 -0
- package/lib/lib/Signal/Group/keyhelper.js +56 -0
- package/lib/lib/Signal/Group/sender-chain-key.d.ts +13 -0
- package/lib/lib/Signal/Group/sender-chain-key.js +30 -0
- package/lib/lib/Signal/Group/sender-key-distribution-message.d.ts +16 -0
- package/lib/lib/Signal/Group/sender-key-distribution-message.js +67 -0
- package/lib/lib/Signal/Group/sender-key-message.d.ts +18 -0
- package/lib/lib/Signal/Group/sender-key-message.js +70 -0
- package/lib/lib/Signal/Group/sender-key-name.d.ts +17 -0
- package/lib/lib/Signal/Group/sender-key-name.js +51 -0
- package/lib/lib/Signal/Group/sender-key-record.d.ts +30 -0
- package/lib/lib/Signal/Group/sender-key-record.js +45 -0
- package/lib/lib/Signal/Group/sender-key-state.d.ts +38 -0
- package/lib/lib/Signal/Group/sender-key-state.js +88 -0
- package/lib/lib/Signal/Group/sender-message-key.d.ts +11 -0
- package/lib/lib/Signal/Group/sender-message-key.js +30 -0
- package/lib/lib/Signal/libsignal.d.ts +4 -0
- package/lib/lib/Signal/libsignal.js +470 -0
- package/lib/lib/Signal/lid-mapping.d.ts +22 -0
- package/lib/lib/Signal/lid-mapping.js +284 -0
- package/lib/lib/Socket/Client/index.d.ts +2 -0
- package/lib/lib/Socket/Client/index.js +19 -0
- package/lib/lib/Socket/Client/types.d.ts +15 -0
- package/lib/lib/Socket/Client/types.js +14 -0
- package/lib/lib/Socket/Client/websocket.d.ts +12 -0
- package/lib/lib/Socket/Client/websocket.js +61 -0
- package/lib/lib/Socket/business.d.ts +216 -0
- package/lib/lib/Socket/business.js +382 -0
- package/lib/lib/Socket/chats.d.ts +124 -0
- package/lib/lib/Socket/chats.js +1206 -0
- package/lib/lib/Socket/communities.d.ts +266 -0
- package/lib/lib/Socket/communities.js +439 -0
- package/lib/lib/Socket/groups.d.ts +160 -0
- package/lib/lib/Socket/groups.js +352 -0
- package/lib/lib/Socket/index.d.ts +253 -0
- package/lib/lib/Socket/index.js +14 -0
- package/lib/lib/Socket/messages-recv.d.ts +202 -0
- package/lib/lib/Socket/messages-recv.js +1778 -0
- package/lib/lib/Socket/messages-send.d.ts +198 -0
- package/lib/lib/Socket/messages-send.js +1152 -0
- package/lib/lib/Socket/mex.d.ts +2 -0
- package/lib/lib/Socket/mex.js +46 -0
- package/lib/lib/Socket/newsletter.d.ts +169 -0
- package/lib/lib/Socket/newsletter.js +184 -0
- package/lib/lib/Socket/socket.d.ts +58 -0
- package/lib/lib/Socket/socket.js +974 -0
- package/lib/lib/Types/Auth.d.ts +116 -0
- package/lib/lib/Types/Auth.js +2 -0
- package/lib/lib/Types/Bussines.d.ts +24 -0
- package/lib/lib/Types/Bussines.js +2 -0
- package/lib/lib/Types/Call.d.ts +14 -0
- package/lib/lib/Types/Call.js +2 -0
- package/lib/lib/Types/Chat.d.ts +123 -0
- package/lib/lib/Types/Chat.js +10 -0
- package/lib/lib/Types/Contact.d.ts +25 -0
- package/lib/lib/Types/Contact.js +2 -0
- package/lib/lib/Types/Events.d.ts +255 -0
- package/lib/lib/Types/Events.js +2 -0
- package/lib/lib/Types/GroupMetadata.d.ts +70 -0
- package/lib/lib/Types/GroupMetadata.js +2 -0
- package/lib/lib/Types/Label.d.ts +46 -0
- package/lib/lib/Types/Label.js +27 -0
- package/lib/lib/Types/LabelAssociation.d.ts +29 -0
- package/lib/lib/Types/LabelAssociation.js +10 -0
- package/lib/lib/Types/Message.d.ts +319 -0
- package/lib/lib/Types/Message.js +12 -0
- package/lib/lib/Types/Mex.d.ts +140 -0
- package/lib/lib/Types/Mex.js +40 -0
- package/lib/lib/Types/Product.d.ts +78 -0
- package/lib/lib/Types/Product.js +2 -0
- package/lib/lib/Types/Signal.d.ts +86 -0
- package/lib/lib/Types/Signal.js +2 -0
- package/lib/lib/Types/Socket.d.ts +135 -0
- package/lib/lib/Types/Socket.js +2 -0
- package/lib/lib/Types/State.d.ts +96 -0
- package/lib/lib/Types/State.js +57 -0
- package/lib/lib/Types/USync.d.ts +25 -0
- package/lib/lib/Types/USync.js +2 -0
- package/lib/lib/Types/index.d.ts +65 -0
- package/lib/lib/Types/index.js +43 -0
- package/lib/lib/Utils/auth-utils.d.ts +23 -0
- package/lib/lib/Utils/auth-utils.js +312 -0
- package/lib/lib/Utils/browser-utils.d.ts +3 -0
- package/lib/lib/Utils/browser-utils.js +33 -0
- package/lib/lib/Utils/business.d.ts +22 -0
- package/lib/lib/Utils/business.js +241 -0
- package/lib/lib/Utils/chat-utils.d.ts +99 -0
- package/lib/lib/Utils/chat-utils.js +890 -0
- package/lib/lib/Utils/companion-reg-client-utils.d.ts +16 -0
- package/lib/lib/Utils/companion-reg-client-utils.js +40 -0
- package/lib/lib/Utils/crypto.d.ts +36 -0
- package/lib/lib/Utils/crypto.js +169 -0
- package/lib/lib/Utils/decode-wa-message.d.ts +64 -0
- package/lib/lib/Utils/decode-wa-message.js +322 -0
- package/lib/lib/Utils/event-buffer.d.ts +35 -0
- package/lib/lib/Utils/event-buffer.js +629 -0
- package/lib/lib/Utils/generics.d.ts +91 -0
- package/lib/lib/Utils/generics.js +425 -0
- package/lib/lib/Utils/history.d.ts +23 -0
- package/lib/lib/Utils/history.js +141 -0
- package/lib/lib/Utils/identity-change-handler.d.ts +43 -0
- package/lib/lib/Utils/identity-change-handler.js +51 -0
- package/lib/lib/Utils/index.d.ts +21 -0
- package/lib/lib/Utils/index.js +38 -0
- package/lib/lib/Utils/link-preview.d.ts +20 -0
- package/lib/lib/Utils/link-preview.js +121 -0
- package/lib/lib/Utils/logger.d.ts +11 -0
- package/lib/lib/Utils/logger.js +8 -0
- package/lib/lib/Utils/lt-hash.d.ts +6 -0
- package/lib/lib/Utils/lt-hash.js +11 -0
- package/lib/lib/Utils/make-mutex.d.ts +8 -0
- package/lib/lib/Utils/make-mutex.js +38 -0
- package/lib/lib/Utils/message-retry-manager.d.ts +114 -0
- package/lib/lib/Utils/message-retry-manager.js +272 -0
- package/lib/lib/Utils/messages-media.d.ts +131 -0
- package/lib/lib/Utils/messages-media.js +849 -0
- package/lib/lib/Utils/messages.d.ts +86 -0
- package/lib/lib/Utils/messages.js +916 -0
- package/lib/lib/Utils/noise-handler.d.ts +19 -0
- package/lib/lib/Utils/noise-handler.js +205 -0
- package/lib/lib/Utils/offline-node-processor.d.ts +16 -0
- package/lib/lib/Utils/offline-node-processor.js +42 -0
- package/lib/lib/Utils/pre-key-manager.d.ts +27 -0
- package/lib/lib/Utils/pre-key-manager.js +113 -0
- package/lib/lib/Utils/process-message.d.ts +59 -0
- package/lib/lib/Utils/process-message.js +639 -0
- package/lib/lib/Utils/reporting-utils.d.ts +10 -0
- package/lib/lib/Utils/reporting-utils.js +262 -0
- package/lib/lib/Utils/signal.d.ts +46 -0
- package/lib/lib/Utils/signal.js +214 -0
- package/lib/lib/Utils/stanza-ack.d.ts +10 -0
- package/lib/lib/Utils/stanza-ack.js +40 -0
- package/lib/lib/Utils/sync-action-utils.d.ts +18 -0
- package/lib/lib/Utils/sync-action-utils.js +52 -0
- package/lib/lib/Utils/tc-token-utils.d.ts +36 -0
- package/lib/lib/Utils/tc-token-utils.js +174 -0
- package/lib/lib/Utils/use-multi-file-auth-state.d.ts +12 -0
- package/lib/lib/Utils/use-multi-file-auth-state.js +125 -0
- package/lib/lib/Utils/validate-connection.d.ts +10 -0
- package/lib/lib/Utils/validate-connection.js +217 -0
- package/lib/lib/WABinary/constants.d.ts +27 -0
- package/lib/lib/WABinary/constants.js +1304 -0
- package/lib/lib/WABinary/decode.d.ts +6 -0
- package/lib/lib/WABinary/decode.js +301 -0
- package/lib/lib/WABinary/encode.d.ts +2 -0
- package/lib/lib/WABinary/encode.js +257 -0
- package/lib/lib/WABinary/generic-utils.d.ts +13 -0
- package/lib/lib/WABinary/generic-utils.js +125 -0
- package/lib/lib/WABinary/index.d.ts +5 -0
- package/lib/lib/WABinary/index.js +22 -0
- package/lib/lib/WABinary/jid-utils.d.ts +47 -0
- package/lib/lib/WABinary/jid-utils.js +115 -0
- package/lib/lib/WABinary/types.d.ts +18 -0
- package/lib/lib/WABinary/types.js +2 -0
- package/lib/lib/WAM/BinaryInfo.d.ts +8 -0
- package/lib/lib/WAM/BinaryInfo.js +13 -0
- package/lib/lib/WAM/constants.d.ts +39 -0
- package/lib/lib/WAM/constants.js +22856 -0
- package/lib/lib/WAM/encode.d.ts +2 -0
- package/lib/lib/WAM/encode.js +152 -0
- package/lib/lib/WAM/index.d.ts +3 -0
- package/lib/lib/WAM/index.js +20 -0
- package/lib/lib/WAUSync/Protocols/USyncContactProtocol.d.ts +9 -0
- package/lib/lib/WAUSync/Protocols/USyncContactProtocol.js +54 -0
- package/lib/lib/WAUSync/Protocols/USyncDeviceProtocol.d.ts +22 -0
- package/lib/lib/WAUSync/Protocols/USyncDeviceProtocol.js +57 -0
- package/lib/lib/WAUSync/Protocols/USyncDisappearingModeProtocol.d.ts +12 -0
- package/lib/lib/WAUSync/Protocols/USyncDisappearingModeProtocol.js +30 -0
- package/lib/lib/WAUSync/Protocols/USyncStatusProtocol.d.ts +12 -0
- package/lib/lib/WAUSync/Protocols/USyncStatusProtocol.js +41 -0
- package/lib/lib/WAUSync/Protocols/USyncUsernameProtocol.d.ts +9 -0
- package/lib/lib/WAUSync/Protocols/USyncUsernameProtocol.js +27 -0
- package/lib/lib/WAUSync/Protocols/UsyncBotProfileProtocol.d.ts +25 -0
- package/lib/lib/WAUSync/Protocols/UsyncBotProfileProtocol.js +53 -0
- package/lib/lib/WAUSync/Protocols/UsyncLIDProtocol.d.ts +9 -0
- package/lib/lib/WAUSync/Protocols/UsyncLIDProtocol.js +32 -0
- package/lib/lib/WAUSync/Protocols/index.d.ts +5 -0
- package/lib/lib/WAUSync/Protocols/index.js +22 -0
- package/lib/lib/WAUSync/USyncQuery.d.ts +29 -0
- package/lib/lib/WAUSync/USyncQuery.js +100 -0
- package/lib/lib/WAUSync/USyncUser.d.ts +16 -0
- package/lib/lib/WAUSync/USyncUser.js +35 -0
- package/lib/lib/WAUSync/index.d.ts +3 -0
- package/lib/lib/WAUSync/index.js +20 -0
- package/lib/lib/index.d.ts +11 -0
- package/lib/lib/index.js +31 -0
- package/package.json +9 -18
- package/WAProto/index.d.ts +0 -50384
- package/WAProto/index.js +0 -155693
- package/banner.png +0 -0
- package/lib/WAProto/index.d.ts +0 -50384
- package/lib/WAProto/index.js +0 -155693
- package/src/WAProto/index.d.ts +0 -50384
- package/src/WAProto/index.js +0 -155693
package/LICENSE
CHANGED
|
@@ -1,22 +1,22 @@
|
|
|
1
|
-
MIT License
|
|
2
|
-
|
|
3
|
-
Copyright (c) 2025 Rajeh Taher/WhiskeySockets
|
|
4
|
-
Copyright (c) 2026 Lia Wynn
|
|
5
|
-
|
|
6
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
7
|
-
of this software and associated documentation files (the "Software"), to deal
|
|
8
|
-
in the Software without restriction, including without limitation the rights
|
|
9
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
10
|
-
copies of the Software, and to permit persons to whom the Software is
|
|
11
|
-
furnished to do so, subject to the following conditions:
|
|
12
|
-
|
|
13
|
-
The above copyright notice and this permission notice shall be included in all
|
|
14
|
-
copies or substantial portions of the Software.
|
|
15
|
-
|
|
16
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
17
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
18
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
19
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
20
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
21
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025 Rajeh Taher/WhiskeySockets
|
|
4
|
+
Copyright (c) 2026 Lia Wynn
|
|
5
|
+
|
|
6
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
7
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
8
|
+
in the Software without restriction, including without limitation the rights
|
|
9
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
10
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
11
|
+
furnished to do so, subject to the following conditions:
|
|
12
|
+
|
|
13
|
+
The above copyright notice and this permission notice shall be included in all
|
|
14
|
+
copies or substantial portions of the Software.
|
|
15
|
+
|
|
16
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
17
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
18
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
19
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
20
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
21
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
22
22
|
SOFTWARE.
|
package/lib/Defaults/index.d.ts
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { proto } from '../../WAProto/index.js';
|
|
2
1
|
import type { SocketConfig } from '../Types';
|
|
3
2
|
export declare const UNAUTHORIZED_CODES: number[];
|
|
4
3
|
export declare const DEFAULT_ORIGIN = "https://web.whatsapp.com";
|
|
@@ -27,7 +26,7 @@ export declare const WA_CERT_DETAILS: {
|
|
|
27
26
|
ISSUER: string;
|
|
28
27
|
PUBLIC_KEY: Buffer<ArrayBuffer>;
|
|
29
28
|
};
|
|
30
|
-
export declare const PROCESSABLE_HISTORY_TYPES:
|
|
29
|
+
export declare const PROCESSABLE_HISTORY_TYPES: any[];
|
|
31
30
|
export declare const DEFAULT_CACHE_TTLS: {
|
|
32
31
|
SIGNAL_STORE: number;
|
|
33
32
|
MSG_RETRY: number;
|
package/lib/Defaults/index.js
CHANGED
|
@@ -5,7 +5,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.TimeMs = exports.UPLOAD_TIMEOUT = exports.INITIAL_PREKEY_COUNT = exports.MIN_PREKEY_COUNT = exports.HISTORY_SYNC_PAUSED_TIMEOUT_MS = exports.MEDIA_KEYS = exports.MEDIA_HKDF_KEY_MAPPING = exports.MEDIA_PATH_MAP = exports.DEFAULT_CONNECTION_CONFIG = exports.DEFAULT_CACHE_TTLS = exports.PROCESSABLE_HISTORY_TYPES = exports.WA_CERT_DETAILS = exports.URL_REGEX = exports.NOISE_WA_HEADER = exports.KEY_BUNDLE_TYPE = exports.DICT_VERSION = exports.NOISE_MODE = exports.PLACEHOLDER_MAX_AGE_SECONDS = exports.STATUS_EXPIRY_SECONDS = exports.WA_DEFAULT_EPHEMERAL = exports.WA_ADV_HOSTED_DEVICE_SIG_PREFIX = exports.WA_ADV_HOSTED_ACCOUNT_SIG_PREFIX = exports.WA_ADV_DEVICE_SIG_PREFIX = exports.WA_ADV_ACCOUNT_SIG_PREFIX = exports.PHONE_CONNECTION_CB = exports.DEF_TAG_PREFIX = exports.DEF_CALLBACK_PREFIX = exports.CALL_AUDIO_PREFIX = exports.CALL_VIDEO_PREFIX = exports.DEFAULT_ORIGIN = exports.UNAUTHORIZED_CODES = void 0;
|
|
7
7
|
// @ts-nocheck
|
|
8
|
-
const index_js_1 = require(
|
|
8
|
+
const index_js_1 = require("../../WAProto/index.js");
|
|
9
9
|
const libsignal_1 = require("../Signal/libsignal");
|
|
10
10
|
const browser_utils_1 = require("../Utils/browser-utils");
|
|
11
11
|
const logger_1 = __importDefault(require("../Utils/logger"));
|
|
@@ -56,11 +56,11 @@ exports.DEFAULT_CONNECTION_CONFIG = {
|
|
|
56
56
|
version: version,
|
|
57
57
|
browser: browser_utils_1.Browsers.macOS('Chrome'),
|
|
58
58
|
waWebSocketUrl: 'wss://web.whatsapp.com/ws/chat',
|
|
59
|
-
connectTimeoutMs:
|
|
60
|
-
keepAliveIntervalMs:
|
|
59
|
+
connectTimeoutMs: 20000,
|
|
60
|
+
keepAliveIntervalMs: 30000,
|
|
61
61
|
logger: logger_1.default.child({ class: 'baileys' }),
|
|
62
62
|
emitOwnEvents: true,
|
|
63
|
-
defaultQueryTimeoutMs:
|
|
63
|
+
defaultQueryTimeoutMs: 60000,
|
|
64
64
|
customUploadHosts: [],
|
|
65
65
|
retryRequestDelayMs: 250,
|
|
66
66
|
maxMsgRetryCount: 5,
|
|
@@ -123,7 +123,7 @@ exports.MEDIA_HKDF_KEY_MAPPING = {
|
|
|
123
123
|
};
|
|
124
124
|
exports.MEDIA_KEYS = Object.keys(exports.MEDIA_PATH_MAP);
|
|
125
125
|
/** 120s timeout for history sync stall detection, same as WA Web's handleChunkProgress / restartPausedTimer (g = 120) */
|
|
126
|
-
exports.HISTORY_SYNC_PAUSED_TIMEOUT_MS =
|
|
126
|
+
exports.HISTORY_SYNC_PAUSED_TIMEOUT_MS = 120000;
|
|
127
127
|
exports.MIN_PREKEY_COUNT = 5;
|
|
128
128
|
exports.INITIAL_PREKEY_COUNT = 812;
|
|
129
129
|
exports.UPLOAD_TIMEOUT = 30000; // 30 seconds
|
package/lib/Socket/business.d.ts
CHANGED
|
@@ -31,7 +31,7 @@ export declare const makeBusinessSocket: (config: SocketConfig) => {
|
|
|
31
31
|
};
|
|
32
32
|
issuePrivacyTokens: (jids: string[], timestamp?: number) => Promise<any>;
|
|
33
33
|
assertSessions: (jids: string[], force?: boolean) => Promise<boolean>;
|
|
34
|
-
relayMessage: (jid: string, message:
|
|
34
|
+
relayMessage: (jid: string, message: proto.IMessage, { messageId: msgId, participant, additionalAttributes, additionalNodes, useUserDevicesCache, useCachedGroupMetadata, statusJidList }: import("../Types").MessageRelayOptions) => Promise<string>;
|
|
35
35
|
sendReceipt: (jid: string, participant: string | undefined, messageIds: string[], type: import("../Types").MessageReceiptType) => Promise<void>;
|
|
36
36
|
sendReceipts: (keys: import("../Types").WAMessageKey[], type: import("../Types").MessageReceiptType) => Promise<void>;
|
|
37
37
|
readMessages: (keys: import("../Types").WAMessageKey[]) => Promise<void>;
|
|
@@ -41,8 +41,8 @@ export declare const makeBusinessSocket: (config: SocketConfig) => {
|
|
|
41
41
|
fetchPrivacySettings: (force?: boolean) => Promise<{
|
|
42
42
|
[_: string]: string;
|
|
43
43
|
}>;
|
|
44
|
-
sendPeerDataOperationMessage: (pdoMessage:
|
|
45
|
-
createParticipantNodes: (recipientJids: string[], message:
|
|
44
|
+
sendPeerDataOperationMessage: (pdoMessage: proto.Message.IPeerDataOperationRequestMessage) => Promise<string>;
|
|
45
|
+
createParticipantNodes: (recipientJids: string[], message: proto.IMessage, extraAttrs?: BinaryNode["attrs"], dsmMessage?: proto.IMessage) => Promise<{
|
|
46
46
|
nodes: BinaryNode[];
|
|
47
47
|
shouldIncludeDeviceIdentity: boolean;
|
|
48
48
|
}>;
|
|
@@ -50,8 +50,8 @@ export declare const makeBusinessSocket: (config: SocketConfig) => {
|
|
|
50
50
|
jid: string;
|
|
51
51
|
})[]>;
|
|
52
52
|
updateMemberLabel: (jid: string, memberLabel: string) => Promise<string>;
|
|
53
|
-
updateMediaMessage: (message: import("../Types").WAMessage) => Promise<
|
|
54
|
-
sendMessage: (jid: string, content: import("../Types").AnyMessageContent, options?: import("../Types").MiscMessageGenerationOptions) => Promise<
|
|
53
|
+
updateMediaMessage: (message: import("../Types").WAMessage) => Promise<any>;
|
|
54
|
+
sendMessage: (jid: string, content: import("../Types").AnyMessageContent, options?: import("../Types").MiscMessageGenerationOptions) => Promise<any>;
|
|
55
55
|
newsletterCreate: (name: string, description?: string) => Promise<import("../Types").NewsletterMetadata>;
|
|
56
56
|
newsletterUpdate: (jid: string, updates: import("../Types").NewsletterUpdate) => Promise<unknown>;
|
|
57
57
|
newsletterSubscribers: (jid: string) => Promise<{
|
|
@@ -96,7 +96,7 @@ export declare const makeBusinessSocket: (config: SocketConfig) => {
|
|
|
96
96
|
groupRevokeInvite: (jid: string) => Promise<string>;
|
|
97
97
|
groupAcceptInvite: (code: string) => Promise<string>;
|
|
98
98
|
groupRevokeInviteV4: (groupJid: string, invitedJid: string) => Promise<boolean>;
|
|
99
|
-
groupAcceptInviteV4: (key:
|
|
99
|
+
groupAcceptInviteV4: (key: any, inviteMessage: proto.Message.IGroupInviteMessage) => Promise<any>;
|
|
100
100
|
groupGetInviteInfo: (code: string) => Promise<import("../Types").GroupMetadata>;
|
|
101
101
|
groupToggleEphemeral: (jid: string, ephemeralExpiration: number) => Promise<void>;
|
|
102
102
|
groupSettingUpdate: (jid: string, setting: "announcement" | "not_announcement" | "locked" | "unlocked") => Promise<void>;
|
|
@@ -126,7 +126,7 @@ export declare const makeBusinessSocket: (config: SocketConfig) => {
|
|
|
126
126
|
notificationMutex: {
|
|
127
127
|
mutex<T>(code: () => Promise<T> | T): Promise<T>;
|
|
128
128
|
};
|
|
129
|
-
upsertMessage: (msg:
|
|
129
|
+
upsertMessage: (msg: any, type: import("../Types").MessageUpsertType) => Promise<void>;
|
|
130
130
|
appPatch: (patchCreate: import("../Types").WAPatchCreate) => Promise<void>;
|
|
131
131
|
sendPresenceUpdate: (type: import("../Types").WAPresence, toJid?: string) => Promise<void>;
|
|
132
132
|
presenceSubscribe: (toJid: string) => Promise<void>;
|
|
@@ -156,7 +156,7 @@ export declare const makeBusinessSocket: (config: SocketConfig) => {
|
|
|
156
156
|
resyncAppState: (collections: readonly ("critical_unblock_low" | "regular_high" | "regular_low" | "critical_block" | "regular")[], isInitialSync: boolean) => Promise<void>;
|
|
157
157
|
chatModify: (mod: import("../Types").ChatModification, jid: string) => Promise<void>;
|
|
158
158
|
cleanDirtyBits: (type: "account_sync" | "groups", fromTimestamp?: number | string) => Promise<void>;
|
|
159
|
-
addOrEditContact: (jid: string, contact:
|
|
159
|
+
addOrEditContact: (jid: string, contact: proto.SyncActionValue.IContactAction) => Promise<void>;
|
|
160
160
|
removeContact: (jid: string) => Promise<void>;
|
|
161
161
|
placeholderResendCache: import("../Types").CacheStore;
|
|
162
162
|
addLabel: (jid: string, labels: import("../Types/Label").LabelActionBody) => Promise<void>;
|
package/lib/Socket/chats.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Boom } from '@hapi/boom';
|
|
2
2
|
import { proto } from '../../WAProto/index.js';
|
|
3
|
-
import type { BotListInfo, CacheStore, ChatModification, MessageUpsertType, SocketConfig, WABusinessProfile, WAMediaUpload,
|
|
3
|
+
import type { BotListInfo, CacheStore, ChatModification, MessageUpsertType, SocketConfig, WABusinessProfile, WAMediaUpload, WAPatchCreate, WAPresence, WAPrivacyCallValue, WAPrivacyGroupAddValue, WAPrivacyMessagesValue, WAPrivacyOnlineValue, WAPrivacyValue, WAReadReceiptsValue } from '../Types';
|
|
4
4
|
import type { QuickReplyAction } from '../Types/Bussines.js';
|
|
5
5
|
import type { LabelActionBody } from '../Types/Label';
|
|
6
6
|
import { type BinaryNode } from '../WABinary';
|
|
@@ -34,7 +34,7 @@ export declare const makeChatsSocket: (config: SocketConfig) => {
|
|
|
34
34
|
fetchPrivacySettings: (force?: boolean) => Promise<{
|
|
35
35
|
[_: string]: string;
|
|
36
36
|
}>;
|
|
37
|
-
upsertMessage: (msg:
|
|
37
|
+
upsertMessage: (msg: any, type: MessageUpsertType) => Promise<void>;
|
|
38
38
|
appPatch: (patchCreate: WAPatchCreate) => Promise<void>;
|
|
39
39
|
sendPresenceUpdate: (type: WAPresence, toJid?: string) => Promise<void>;
|
|
40
40
|
presenceSubscribe: (toJid: string) => Promise<void>;
|
package/lib/Socket/chats.js
CHANGED
|
@@ -1115,7 +1115,7 @@ const makeChatsSocket = (config) => {
|
|
|
1115
1115
|
const accountSyncCounter = (authState.creds.accountSyncCounter || 0) + 1;
|
|
1116
1116
|
ev.emit('creds.update', { accountSyncCounter });
|
|
1117
1117
|
}
|
|
1118
|
-
},
|
|
1118
|
+
}, 20000);
|
|
1119
1119
|
});
|
|
1120
1120
|
// When an app state sync key arrives (myAppStateKeyId is set) and there are
|
|
1121
1121
|
// collections blocked on a missing key, trigger a re-sync for just those collections.
|
|
@@ -42,7 +42,7 @@ export declare const makeCommunitiesSocket: (config: SocketConfig) => {
|
|
|
42
42
|
* @param key the key of the invite message, or optionally only provide the jid of the person who sent the invite
|
|
43
43
|
* @param inviteMessage the message to accept
|
|
44
44
|
*/
|
|
45
|
-
communityAcceptInviteV4: (key:
|
|
45
|
+
communityAcceptInviteV4: (key: any, inviteMessage: proto.Message.IGroupInviteMessage) => Promise<any>;
|
|
46
46
|
communityGetInviteInfo: (code: string) => Promise<GroupMetadata>;
|
|
47
47
|
communityToggleEphemeral: (jid: string, ephemeralExpiration: number) => Promise<void>;
|
|
48
48
|
communitySettingUpdate: (jid: string, setting: "announcement" | "not_announcement" | "locked" | "unlocked") => Promise<void>;
|
|
@@ -99,8 +99,8 @@ export declare const makeCommunitiesSocket: (config: SocketConfig) => {
|
|
|
99
99
|
jid: string;
|
|
100
100
|
})[]>;
|
|
101
101
|
updateMemberLabel: (jid: string, memberLabel: string) => Promise<string>;
|
|
102
|
-
updateMediaMessage: (message: import("../Types").WAMessage) => Promise<
|
|
103
|
-
sendMessage: (jid: string, content: import("../Types").AnyMessageContent, options?: import("../Types").MiscMessageGenerationOptions) => Promise<
|
|
102
|
+
updateMediaMessage: (message: import("../Types").WAMessage) => Promise<any>;
|
|
103
|
+
sendMessage: (jid: string, content: import("../Types").AnyMessageContent, options?: import("../Types").MiscMessageGenerationOptions) => Promise<any>;
|
|
104
104
|
newsletterCreate: (name: string, description?: string) => Promise<import("../Types").NewsletterMetadata>;
|
|
105
105
|
newsletterUpdate: (jid: string, updates: import("../Types").NewsletterUpdate) => Promise<unknown>;
|
|
106
106
|
newsletterSubscribers: (jid: string) => Promise<{
|
|
@@ -145,7 +145,7 @@ export declare const makeCommunitiesSocket: (config: SocketConfig) => {
|
|
|
145
145
|
groupRevokeInvite: (jid: string) => Promise<string>;
|
|
146
146
|
groupAcceptInvite: (code: string) => Promise<string>;
|
|
147
147
|
groupRevokeInviteV4: (groupJid: string, invitedJid: string) => Promise<boolean>;
|
|
148
|
-
groupAcceptInviteV4: (key:
|
|
148
|
+
groupAcceptInviteV4: (key: any, inviteMessage: proto.Message.IGroupInviteMessage) => Promise<any>;
|
|
149
149
|
groupGetInviteInfo: (code: string) => Promise<GroupMetadata>;
|
|
150
150
|
groupToggleEphemeral: (jid: string, ephemeralExpiration: number) => Promise<void>;
|
|
151
151
|
groupSettingUpdate: (jid: string, setting: "announcement" | "not_announcement" | "locked" | "unlocked") => Promise<void>;
|
|
@@ -175,7 +175,7 @@ export declare const makeCommunitiesSocket: (config: SocketConfig) => {
|
|
|
175
175
|
notificationMutex: {
|
|
176
176
|
mutex<T>(code: () => Promise<T> | T): Promise<T>;
|
|
177
177
|
};
|
|
178
|
-
upsertMessage: (msg:
|
|
178
|
+
upsertMessage: (msg: any, type: import("../Types").MessageUpsertType) => Promise<void>;
|
|
179
179
|
appPatch: (patchCreate: import("../Types").WAPatchCreate) => Promise<void>;
|
|
180
180
|
sendPresenceUpdate: (type: import("../Types").WAPresence, toJid?: string) => Promise<void>;
|
|
181
181
|
presenceSubscribe: (toJid: string) => Promise<void>;
|
package/lib/Socket/groups.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Boom } from '@hapi/boom';
|
|
2
2
|
import { proto } from '../../WAProto/index.js';
|
|
3
|
-
import type { GroupMetadata, ParticipantAction, SocketConfig
|
|
3
|
+
import type { GroupMetadata, ParticipantAction, SocketConfig } from '../Types';
|
|
4
4
|
import { type BinaryNode } from '../WABinary';
|
|
5
5
|
export declare const makeGroupsSocket: (config: SocketConfig) => {
|
|
6
6
|
groupMetadata: (jid: string) => Promise<GroupMetadata>;
|
|
@@ -35,7 +35,7 @@ export declare const makeGroupsSocket: (config: SocketConfig) => {
|
|
|
35
35
|
* @param key the key of the invite message, or optionally only provide the jid of the person who sent the invite
|
|
36
36
|
* @param inviteMessage the message to accept
|
|
37
37
|
*/
|
|
38
|
-
groupAcceptInviteV4: (key:
|
|
38
|
+
groupAcceptInviteV4: (key: any, inviteMessage: proto.Message.IGroupInviteMessage) => Promise<any>;
|
|
39
39
|
groupGetInviteInfo: (code: string) => Promise<GroupMetadata>;
|
|
40
40
|
groupToggleEphemeral: (jid: string, ephemeralExpiration: number) => Promise<void>;
|
|
41
41
|
groupSettingUpdate: (jid: string, setting: "announcement" | "not_announcement" | "locked" | "unlocked") => Promise<void>;
|
|
@@ -68,7 +68,7 @@ export declare const makeGroupsSocket: (config: SocketConfig) => {
|
|
|
68
68
|
fetchPrivacySettings: (force?: boolean) => Promise<{
|
|
69
69
|
[_: string]: string;
|
|
70
70
|
}>;
|
|
71
|
-
upsertMessage: (msg:
|
|
71
|
+
upsertMessage: (msg: any, type: import("../Types").MessageUpsertType) => Promise<void>;
|
|
72
72
|
appPatch: (patchCreate: import("../Types").WAPatchCreate) => Promise<void>;
|
|
73
73
|
sendPresenceUpdate: (type: import("../Types").WAPresence, toJid?: string) => Promise<void>;
|
|
74
74
|
presenceSubscribe: (toJid: string) => Promise<void>;
|
package/lib/Socket/index.d.ts
CHANGED
|
@@ -29,7 +29,7 @@ declare const makeWASocket: (config: UserFacingSocketConfig) => {
|
|
|
29
29
|
communityRevokeInvite: (jid: string) => Promise<string>;
|
|
30
30
|
communityAcceptInvite: (code: string) => Promise<string>;
|
|
31
31
|
communityRevokeInviteV4: (communityJid: string, invitedJid: string) => Promise<boolean>;
|
|
32
|
-
communityAcceptInviteV4: (key:
|
|
32
|
+
communityAcceptInviteV4: (key: any, inviteMessage: proto.Message.IGroupInviteMessage) => Promise<any>;
|
|
33
33
|
communityGetInviteInfo: (code: string) => Promise<import("../Types").GroupMetadata>;
|
|
34
34
|
communityToggleEphemeral: (jid: string, ephemeralExpiration: number) => Promise<void>;
|
|
35
35
|
communitySettingUpdate: (jid: string, setting: "announcement" | "not_announcement" | "locked" | "unlocked") => Promise<void>;
|
|
@@ -67,7 +67,7 @@ declare const makeWASocket: (config: UserFacingSocketConfig) => {
|
|
|
67
67
|
};
|
|
68
68
|
issuePrivacyTokens: (jids: string[], timestamp?: number) => Promise<any>;
|
|
69
69
|
assertSessions: (jids: string[], force?: boolean) => Promise<boolean>;
|
|
70
|
-
relayMessage: (jid: string, message:
|
|
70
|
+
relayMessage: (jid: string, message: proto.IMessage, { messageId: msgId, participant, additionalAttributes, additionalNodes, useUserDevicesCache, useCachedGroupMetadata, statusJidList }: import("../Types").MessageRelayOptions) => Promise<string>;
|
|
71
71
|
sendReceipt: (jid: string, participant: string | undefined, messageIds: string[], type: import("../Types").MessageReceiptType) => Promise<void>;
|
|
72
72
|
sendReceipts: (keys: import("../Types").WAMessageKey[], type: import("../Types").MessageReceiptType) => Promise<void>;
|
|
73
73
|
readMessages: (keys: import("../Types").WAMessageKey[]) => Promise<void>;
|
|
@@ -77,8 +77,8 @@ declare const makeWASocket: (config: UserFacingSocketConfig) => {
|
|
|
77
77
|
fetchPrivacySettings: (force?: boolean) => Promise<{
|
|
78
78
|
[_: string]: string;
|
|
79
79
|
}>;
|
|
80
|
-
sendPeerDataOperationMessage: (pdoMessage:
|
|
81
|
-
createParticipantNodes: (recipientJids: string[], message:
|
|
80
|
+
sendPeerDataOperationMessage: (pdoMessage: proto.Message.IPeerDataOperationRequestMessage) => Promise<string>;
|
|
81
|
+
createParticipantNodes: (recipientJids: string[], message: proto.IMessage, extraAttrs?: import("..").BinaryNode["attrs"], dsmMessage?: proto.IMessage) => Promise<{
|
|
82
82
|
nodes: import("..").BinaryNode[];
|
|
83
83
|
shouldIncludeDeviceIdentity: boolean;
|
|
84
84
|
}>;
|
|
@@ -86,8 +86,8 @@ declare const makeWASocket: (config: UserFacingSocketConfig) => {
|
|
|
86
86
|
jid: string;
|
|
87
87
|
})[]>;
|
|
88
88
|
updateMemberLabel: (jid: string, memberLabel: string) => Promise<string>;
|
|
89
|
-
updateMediaMessage: (message: import("../Types").WAMessage) => Promise<
|
|
90
|
-
sendMessage: (jid: string, content: import("../Types").AnyMessageContent, options?: import("../Types").MiscMessageGenerationOptions) => Promise<
|
|
89
|
+
updateMediaMessage: (message: import("../Types").WAMessage) => Promise<any>;
|
|
90
|
+
sendMessage: (jid: string, content: import("../Types").AnyMessageContent, options?: import("../Types").MiscMessageGenerationOptions) => Promise<any>;
|
|
91
91
|
newsletterCreate: (name: string, description?: string) => Promise<import("../Types").NewsletterMetadata>;
|
|
92
92
|
newsletterUpdate: (jid: string, updates: import("../Types").NewsletterUpdate) => Promise<unknown>;
|
|
93
93
|
newsletterSubscribers: (jid: string) => Promise<{
|
|
@@ -132,7 +132,7 @@ declare const makeWASocket: (config: UserFacingSocketConfig) => {
|
|
|
132
132
|
groupRevokeInvite: (jid: string) => Promise<string>;
|
|
133
133
|
groupAcceptInvite: (code: string) => Promise<string>;
|
|
134
134
|
groupRevokeInviteV4: (groupJid: string, invitedJid: string) => Promise<boolean>;
|
|
135
|
-
groupAcceptInviteV4: (key:
|
|
135
|
+
groupAcceptInviteV4: (key: any, inviteMessage: proto.Message.IGroupInviteMessage) => Promise<any>;
|
|
136
136
|
groupGetInviteInfo: (code: string) => Promise<import("../Types").GroupMetadata>;
|
|
137
137
|
groupToggleEphemeral: (jid: string, ephemeralExpiration: number) => Promise<void>;
|
|
138
138
|
groupSettingUpdate: (jid: string, setting: "announcement" | "not_announcement" | "locked" | "unlocked") => Promise<void>;
|
|
@@ -162,7 +162,7 @@ declare const makeWASocket: (config: UserFacingSocketConfig) => {
|
|
|
162
162
|
notificationMutex: {
|
|
163
163
|
mutex<T>(code: () => Promise<T> | T): Promise<T>;
|
|
164
164
|
};
|
|
165
|
-
upsertMessage: (msg:
|
|
165
|
+
upsertMessage: (msg: any, type: import("../Types").MessageUpsertType) => Promise<void>;
|
|
166
166
|
appPatch: (patchCreate: import("../Types").WAPatchCreate) => Promise<void>;
|
|
167
167
|
sendPresenceUpdate: (type: import("../Types").WAPresence, toJid?: string) => Promise<void>;
|
|
168
168
|
presenceSubscribe: (toJid: string) => Promise<void>;
|
|
@@ -192,7 +192,7 @@ declare const makeWASocket: (config: UserFacingSocketConfig) => {
|
|
|
192
192
|
resyncAppState: (collections: readonly ("critical_unblock_low" | "regular_high" | "regular_low" | "critical_block" | "regular")[], isInitialSync: boolean) => Promise<void>;
|
|
193
193
|
chatModify: (mod: import("../Types").ChatModification, jid: string) => Promise<void>;
|
|
194
194
|
cleanDirtyBits: (type: "account_sync" | "groups", fromTimestamp?: number | string) => Promise<void>;
|
|
195
|
-
addOrEditContact: (jid: string, contact:
|
|
195
|
+
addOrEditContact: (jid: string, contact: proto.SyncActionValue.IContactAction) => Promise<void>;
|
|
196
196
|
removeContact: (jid: string) => Promise<void>;
|
|
197
197
|
placeholderResendCache: import("../Types").CacheStore;
|
|
198
198
|
addLabel: (jid: string, labels: import("../Types/Label").LabelActionBody) => Promise<void>;
|
|
@@ -36,8 +36,8 @@ export declare const makeMessagesRecvSocket: (config: SocketConfig) => {
|
|
|
36
36
|
jid: string;
|
|
37
37
|
})[]>;
|
|
38
38
|
updateMemberLabel: (jid: string, memberLabel: string) => Promise<string>;
|
|
39
|
-
updateMediaMessage: (message: WAMessage) => Promise<
|
|
40
|
-
sendMessage: (jid: string, content: import("../Types").AnyMessageContent, options?: import("../Types").MiscMessageGenerationOptions) => Promise<
|
|
39
|
+
updateMediaMessage: (message: WAMessage) => Promise<any>;
|
|
40
|
+
sendMessage: (jid: string, content: import("../Types").AnyMessageContent, options?: import("../Types").MiscMessageGenerationOptions) => Promise<any>;
|
|
41
41
|
newsletterCreate: (name: string, description?: string) => Promise<import("../Types").NewsletterMetadata>;
|
|
42
42
|
newsletterUpdate: (jid: string, updates: import("../Types").NewsletterUpdate) => Promise<unknown>;
|
|
43
43
|
newsletterSubscribers: (jid: string) => Promise<{
|
|
@@ -82,7 +82,7 @@ export declare const makeMessagesRecvSocket: (config: SocketConfig) => {
|
|
|
82
82
|
groupRevokeInvite: (jid: string) => Promise<string>;
|
|
83
83
|
groupAcceptInvite: (code: string) => Promise<string>;
|
|
84
84
|
groupRevokeInviteV4: (groupJid: string, invitedJid: string) => Promise<boolean>;
|
|
85
|
-
groupAcceptInviteV4: (key:
|
|
85
|
+
groupAcceptInviteV4: (key: any, inviteMessage: proto.Message.IGroupInviteMessage) => Promise<any>;
|
|
86
86
|
groupGetInviteInfo: (code: string) => Promise<import("../Types").GroupMetadata>;
|
|
87
87
|
groupToggleEphemeral: (jid: string, ephemeralExpiration: number) => Promise<void>;
|
|
88
88
|
groupSettingUpdate: (jid: string, setting: "announcement" | "not_announcement" | "locked" | "unlocked") => Promise<void>;
|
|
@@ -112,7 +112,7 @@ export declare const makeMessagesRecvSocket: (config: SocketConfig) => {
|
|
|
112
112
|
notificationMutex: {
|
|
113
113
|
mutex<T>(code: () => Promise<T> | T): Promise<T>;
|
|
114
114
|
};
|
|
115
|
-
upsertMessage: (msg:
|
|
115
|
+
upsertMessage: (msg: any, type: import("../Types").MessageUpsertType) => Promise<void>;
|
|
116
116
|
appPatch: (patchCreate: import("../Types").WAPatchCreate) => Promise<void>;
|
|
117
117
|
sendPresenceUpdate: (type: import("../Types").WAPresence, toJid?: string) => Promise<void>;
|
|
118
118
|
presenceSubscribe: (toJid: string) => Promise<void>;
|
|
@@ -90,7 +90,7 @@ const makeMessagesRecvSocket = (config) => {
|
|
|
90
90
|
logger.debug({ messageKey }, 'PDO message without response after 8 seconds. Phone possibly offline');
|
|
91
91
|
await placeholderResendCache.del(messageKey?.id);
|
|
92
92
|
}
|
|
93
|
-
},
|
|
93
|
+
}, 8000);
|
|
94
94
|
return sendPeerDataOperationMessage(pdoMessage);
|
|
95
95
|
};
|
|
96
96
|
const handleMexNotification = async (node) => {
|
|
@@ -173,7 +173,7 @@ const makeMessagesRecvSocket = (config) => {
|
|
|
173
173
|
// WA Web defaults to now+60s when the server omits the expiry
|
|
174
174
|
const timeEnforcementEnds = payload.time_enforcement_ends
|
|
175
175
|
? new Date(parseInt(payload.time_enforcement_ends, 10) * 1000)
|
|
176
|
-
: new Date(Date.now() +
|
|
176
|
+
: new Date(Date.now() + 60000);
|
|
177
177
|
const enforcementType = isValidEnforcementType(payload.enforcement_type)
|
|
178
178
|
? payload.enforcement_type
|
|
179
179
|
: Types_1.ReachoutTimelockEnforcementType.DEFAULT;
|
|
@@ -1257,7 +1257,7 @@ const makeMessagesRecvSocket = (config) => {
|
|
|
1257
1257
|
id: node.attrs.id,
|
|
1258
1258
|
...(msg.key || {})
|
|
1259
1259
|
};
|
|
1260
|
-
msg.participant
|
|
1260
|
+
msg.participant ?? (msg.participant = node.attrs.participant);
|
|
1261
1261
|
msg.messageTimestamp = +node.attrs.t;
|
|
1262
1262
|
const fullMsg = index_js_1.proto.WebMessageInfo.fromObject(msg);
|
|
1263
1263
|
await upsertMessage(fullMsg, 'append');
|
|
@@ -32,8 +32,8 @@ export declare const makeMessagesSocket: (config: SocketConfig) => {
|
|
|
32
32
|
})[]>;
|
|
33
33
|
messageRetryManager: MessageRetryManager;
|
|
34
34
|
updateMemberLabel: (jid: string, memberLabel: string) => Promise<string>;
|
|
35
|
-
updateMediaMessage: (message: WAMessage) => Promise<
|
|
36
|
-
sendMessage: (jid: string, content: AnyMessageContent, options?: MiscMessageGenerationOptions) => Promise<
|
|
35
|
+
updateMediaMessage: (message: WAMessage) => Promise<any>;
|
|
36
|
+
sendMessage: (jid: string, content: AnyMessageContent, options?: MiscMessageGenerationOptions) => Promise<any>;
|
|
37
37
|
newsletterCreate: (name: string, description?: string) => Promise<import("../Types").NewsletterMetadata>;
|
|
38
38
|
newsletterUpdate: (jid: string, updates: import("../Types").NewsletterUpdate) => Promise<unknown>;
|
|
39
39
|
newsletterSubscribers: (jid: string) => Promise<{
|
|
@@ -78,7 +78,7 @@ export declare const makeMessagesSocket: (config: SocketConfig) => {
|
|
|
78
78
|
groupRevokeInvite: (jid: string) => Promise<string>;
|
|
79
79
|
groupAcceptInvite: (code: string) => Promise<string>;
|
|
80
80
|
groupRevokeInviteV4: (groupJid: string, invitedJid: string) => Promise<boolean>;
|
|
81
|
-
groupAcceptInviteV4: (key:
|
|
81
|
+
groupAcceptInviteV4: (key: any, inviteMessage: proto.Message.IGroupInviteMessage) => Promise<any>;
|
|
82
82
|
groupGetInviteInfo: (code: string) => Promise<import("../Types").GroupMetadata>;
|
|
83
83
|
groupToggleEphemeral: (jid: string, ephemeralExpiration: number) => Promise<void>;
|
|
84
84
|
groupSettingUpdate: (jid: string, setting: "announcement" | "not_announcement" | "locked" | "unlocked") => Promise<void>;
|
|
@@ -108,7 +108,7 @@ export declare const makeMessagesSocket: (config: SocketConfig) => {
|
|
|
108
108
|
notificationMutex: {
|
|
109
109
|
mutex<T>(code: () => Promise<T> | T): Promise<T>;
|
|
110
110
|
};
|
|
111
|
-
upsertMessage: (msg:
|
|
111
|
+
upsertMessage: (msg: any, type: import("../Types").MessageUpsertType) => Promise<void>;
|
|
112
112
|
appPatch: (patchCreate: import("../Types").WAPatchCreate) => Promise<void>;
|
|
113
113
|
sendPresenceUpdate: (type: import("../Types").WAPresence, toJid?: string) => Promise<void>;
|
|
114
114
|
presenceSubscribe: (toJid: string) => Promise<void>;
|
|
@@ -1078,7 +1078,7 @@ const makeMessagesSocket = (config) => {
|
|
|
1078
1078
|
getUrlInfo: text => (0, link_preview_1.getUrlInfo)(text, {
|
|
1079
1079
|
thumbnailWidth: linkPreviewImageThumbnailWidth,
|
|
1080
1080
|
fetchOpts: {
|
|
1081
|
-
timeout:
|
|
1081
|
+
timeout: 3000,
|
|
1082
1082
|
...(httpRequestOptions || {})
|
|
1083
1083
|
},
|
|
1084
1084
|
logger,
|
|
@@ -45,7 +45,7 @@ export declare const makeNewsletterSocket: (config: SocketConfig) => {
|
|
|
45
45
|
groupRevokeInvite: (jid: string) => Promise<string>;
|
|
46
46
|
groupAcceptInvite: (code: string) => Promise<string>;
|
|
47
47
|
groupRevokeInviteV4: (groupJid: string, invitedJid: string) => Promise<boolean>;
|
|
48
|
-
groupAcceptInviteV4: (key:
|
|
48
|
+
groupAcceptInviteV4: (key: any, inviteMessage: proto.Message.IGroupInviteMessage) => Promise<any>;
|
|
49
49
|
groupGetInviteInfo: (code: string) => Promise<import("../Types").GroupMetadata>;
|
|
50
50
|
groupToggleEphemeral: (jid: string, ephemeralExpiration: number) => Promise<void>;
|
|
51
51
|
groupSettingUpdate: (jid: string, setting: "announcement" | "not_announcement" | "locked" | "unlocked") => Promise<void>;
|
|
@@ -78,7 +78,7 @@ export declare const makeNewsletterSocket: (config: SocketConfig) => {
|
|
|
78
78
|
fetchPrivacySettings: (force?: boolean) => Promise<{
|
|
79
79
|
[_: string]: string;
|
|
80
80
|
}>;
|
|
81
|
-
upsertMessage: (msg:
|
|
81
|
+
upsertMessage: (msg: any, type: import("../Types").MessageUpsertType) => Promise<void>;
|
|
82
82
|
appPatch: (patchCreate: import("../Types").WAPatchCreate) => Promise<void>;
|
|
83
83
|
sendPresenceUpdate: (type: import("../Types").WAPresence, toJid?: string) => Promise<void>;
|
|
84
84
|
presenceSubscribe: (toJid: string) => Promise<void>;
|
|
@@ -108,7 +108,7 @@ export declare const makeNewsletterSocket: (config: SocketConfig) => {
|
|
|
108
108
|
resyncAppState: (collections: readonly ("critical_unblock_low" | "regular_high" | "regular_low" | "critical_block" | "regular")[], isInitialSync: boolean) => Promise<void>;
|
|
109
109
|
chatModify: (mod: import("../Types").ChatModification, jid: string) => Promise<void>;
|
|
110
110
|
cleanDirtyBits: (type: "account_sync" | "groups", fromTimestamp?: number | string) => Promise<void>;
|
|
111
|
-
addOrEditContact: (jid: string, contact:
|
|
111
|
+
addOrEditContact: (jid: string, contact: proto.SyncActionValue.IContactAction) => Promise<void>;
|
|
112
112
|
removeContact: (jid: string) => Promise<void>;
|
|
113
113
|
placeholderResendCache: import("../Types").CacheStore;
|
|
114
114
|
addLabel: (jid: string, labels: import("../Types/Label").LabelActionBody) => Promise<void>;
|
package/lib/Socket/socket.js
CHANGED
|
@@ -710,7 +710,7 @@ const makeSocket = (config) => {
|
|
|
710
710
|
const noiseKeyB64 = Buffer.from(creds.noiseKey.public).toString('base64');
|
|
711
711
|
const identityKeyB64 = Buffer.from(creds.signedIdentityKey.public).toString('base64');
|
|
712
712
|
const advB64 = creds.advSecretKey;
|
|
713
|
-
let qrMs = qrTimeout ||
|
|
713
|
+
let qrMs = qrTimeout || 60000; // time to let a QR live
|
|
714
714
|
const genPairQR = () => {
|
|
715
715
|
if (!ws.isOpen) {
|
|
716
716
|
return;
|
|
@@ -724,7 +724,7 @@ const makeSocket = (config) => {
|
|
|
724
724
|
const qr = (0, Utils_1.buildPairingQRData)(ref, noiseKeyB64, identityKeyB64, advB64, browser);
|
|
725
725
|
ev.emit('connection.update', { qr });
|
|
726
726
|
qrTimer = setTimeout(genPairQR, qrMs);
|
|
727
|
-
qrMs = qrTimeout ||
|
|
727
|
+
qrMs = qrTimeout || 20000; // shorter subsequent qrs
|
|
728
728
|
};
|
|
729
729
|
genPairQR();
|
|
730
730
|
});
|
package/lib/Types/Message.d.ts
CHANGED
|
@@ -28,8 +28,8 @@ export type WATextMessage = proto.Message.IExtendedTextMessage;
|
|
|
28
28
|
export type WAContextInfo = proto.IContextInfo;
|
|
29
29
|
export type WALocationMessage = proto.Message.ILocationMessage;
|
|
30
30
|
export type WAGenericMediaMessage = proto.Message.IVideoMessage | proto.Message.IImageMessage | proto.Message.IAudioMessage | proto.Message.IDocumentMessage | proto.Message.IStickerMessage;
|
|
31
|
-
export declare const WAMessageStubType:
|
|
32
|
-
export declare const WAMessageStatus:
|
|
31
|
+
export declare const WAMessageStubType: any;
|
|
32
|
+
export declare const WAMessageStatus: any;
|
|
33
33
|
import type { ILogger } from '../Utils/logger';
|
|
34
34
|
export type WAMediaPayloadURL = {
|
|
35
35
|
url: URL | string;
|
package/lib/Utils/business.js
CHANGED
|
@@ -185,7 +185,7 @@ exports.parseProductNode = parseProductNode;
|
|
|
185
185
|
/**
|
|
186
186
|
* Uploads images not already uploaded to WA's servers
|
|
187
187
|
*/
|
|
188
|
-
async function uploadingNecessaryImagesOfProduct(product, waUploadToServer, timeoutMs =
|
|
188
|
+
async function uploadingNecessaryImagesOfProduct(product, waUploadToServer, timeoutMs = 30000) {
|
|
189
189
|
product = {
|
|
190
190
|
...product,
|
|
191
191
|
images: product.images
|
|
@@ -197,7 +197,7 @@ async function uploadingNecessaryImagesOfProduct(product, waUploadToServer, time
|
|
|
197
197
|
/**
|
|
198
198
|
* Uploads images not already uploaded to WA's servers
|
|
199
199
|
*/
|
|
200
|
-
const uploadingNecessaryImages = async (images, waUploadToServer, timeoutMs =
|
|
200
|
+
const uploadingNecessaryImages = async (images, waUploadToServer, timeoutMs = 30000) => {
|
|
201
201
|
const results = await Promise.all(images.map(async (img) => {
|
|
202
202
|
if ('url' in img) {
|
|
203
203
|
const url = img.url.toString();
|
|
@@ -85,7 +85,7 @@ export declare const extractSyncdPatches: (result: BinaryNode, options: RequestI
|
|
|
85
85
|
};
|
|
86
86
|
}>;
|
|
87
87
|
export declare const downloadExternalBlob: (blob: proto.IExternalBlobReference, options: RequestInit) => Promise<Buffer<ArrayBuffer>>;
|
|
88
|
-
export declare const downloadExternalPatch: (blob: proto.IExternalBlobReference, options: RequestInit) => Promise<
|
|
88
|
+
export declare const downloadExternalPatch: (blob: proto.IExternalBlobReference, options: RequestInit) => Promise<any>;
|
|
89
89
|
export declare const decodeSyncdSnapshot: (name: WAPatchName, snapshot: proto.ISyncdSnapshot, getAppStateSyncKey: FetchAppStateSyncKey, minimumVersionNumber: number | undefined, validateMacs?: boolean, logger?: ILogger) => Promise<{
|
|
90
90
|
state: LTHashState;
|
|
91
91
|
mutationMap: ChatMutationMap;
|
package/lib/Utils/crypto.d.ts
CHANGED
|
@@ -4,13 +4,13 @@ export { md5, hkdf } from 'whatsapp-rust-bridge';
|
|
|
4
4
|
export declare const generateSignalPubKey: (pubKey: Uint8Array | Buffer) => Uint8Array<ArrayBufferLike> | Buffer<ArrayBufferLike>;
|
|
5
5
|
export declare const Curve: {
|
|
6
6
|
generateKeyPair: () => KeyPair;
|
|
7
|
-
sharedKey: (privateKey: Uint8Array, publicKey: Uint8Array) => Buffer<
|
|
8
|
-
sign: (privateKey: Uint8Array, buf: Uint8Array) =>
|
|
7
|
+
sharedKey: (privateKey: Uint8Array, publicKey: Uint8Array) => Buffer<any>;
|
|
8
|
+
sign: (privateKey: Uint8Array, buf: Uint8Array) => any;
|
|
9
9
|
verify: (pubKey: Uint8Array, message: Uint8Array, signature: Uint8Array) => boolean;
|
|
10
10
|
};
|
|
11
11
|
export declare const signedKeyPair: (identityKeyPair: KeyPair, keyId: number) => {
|
|
12
12
|
keyPair: KeyPair;
|
|
13
|
-
signature:
|
|
13
|
+
signature: any;
|
|
14
14
|
keyId: number;
|
|
15
15
|
};
|
|
16
16
|
/**
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import type { WAMessage } from '../Types';
|
|
2
1
|
import type { SignalRepositoryWithLIDStore } from '../Types/Signal';
|
|
3
2
|
import { type BinaryNode } from '../WABinary';
|
|
4
3
|
import type { ILogger } from './logger';
|
|
@@ -53,12 +52,12 @@ export declare const extractAddressingContext: (stanza: BinaryNode) => {
|
|
|
53
52
|
* @note this will only parse the message, not decrypt it
|
|
54
53
|
*/
|
|
55
54
|
export declare function decodeMessageNode(stanza: BinaryNode, meId: string, meLid: string): {
|
|
56
|
-
fullMessage:
|
|
55
|
+
fullMessage: any;
|
|
57
56
|
author: string;
|
|
58
57
|
sender: string;
|
|
59
58
|
};
|
|
60
59
|
export declare const decryptMessageNode: (stanza: BinaryNode, meId: string, meLid: string, repository: SignalRepositoryWithLIDStore, logger: ILogger) => {
|
|
61
|
-
fullMessage:
|
|
60
|
+
fullMessage: any;
|
|
62
61
|
category: string;
|
|
63
62
|
author: string;
|
|
64
63
|
decrypt(): Promise<void>;
|
package/lib/Utils/generics.d.ts
CHANGED
|
@@ -6,7 +6,7 @@ export declare const BufferJSON: {
|
|
|
6
6
|
replacer: (k: any, value: any) => any;
|
|
7
7
|
reviver: (_: any, value: any) => any;
|
|
8
8
|
};
|
|
9
|
-
export declare const getKeyAuthor: (key: WAMessageKey | undefined | null, meId?: string) =>
|
|
9
|
+
export declare const getKeyAuthor: (key: WAMessageKey | undefined | null, meId?: string) => any;
|
|
10
10
|
export declare const isStringNullOrEmpty: (value: string | null | undefined) => value is null | undefined | "";
|
|
11
11
|
export declare const writeRandomPadMax16: (msg: Uint8Array) => Buffer<ArrayBuffer>;
|
|
12
12
|
export declare const unpadRandomMax16: (e: Uint8Array | Buffer) => Uint8Array<ArrayBuffer>;
|
|
@@ -66,7 +66,7 @@ export declare const generateMdTagPrefix: () => string;
|
|
|
66
66
|
* Given a type of receipt, returns what the new status of the message should be
|
|
67
67
|
* @param type type from receipt
|
|
68
68
|
*/
|
|
69
|
-
export declare const getStatusFromReceiptType: (type: string | undefined) =>
|
|
69
|
+
export declare const getStatusFromReceiptType: (type: string | undefined) => any;
|
|
70
70
|
/**
|
|
71
71
|
* Stream errors generally provide a reason, map that to a baileys DisconnectReason
|
|
72
72
|
* @param reason the string reason given, eg. "conflict"
|
package/lib/Utils/history.d.ts
CHANGED
|
@@ -1,23 +1,23 @@
|
|
|
1
1
|
import { proto } from '../../WAProto/index.js';
|
|
2
|
-
import type {
|
|
2
|
+
import type { Contact, LIDMapping } from '../Types';
|
|
3
3
|
import type { ILogger } from './logger.js';
|
|
4
|
-
export declare const downloadHistory: (msg: proto.Message.IHistorySyncNotification, options: RequestInit) => Promise<
|
|
4
|
+
export declare const downloadHistory: (msg: proto.Message.IHistorySyncNotification, options: RequestInit) => Promise<any>;
|
|
5
5
|
export declare const processHistoryMessage: (item: proto.IHistorySync, logger?: ILogger) => {
|
|
6
|
-
chats:
|
|
6
|
+
chats: any[];
|
|
7
7
|
contacts: Contact[];
|
|
8
|
-
messages:
|
|
8
|
+
messages: any[];
|
|
9
9
|
lidPnMappings: LIDMapping[];
|
|
10
|
-
pastParticipants:
|
|
11
|
-
syncType:
|
|
12
|
-
progress:
|
|
10
|
+
pastParticipants: any;
|
|
11
|
+
syncType: any;
|
|
12
|
+
progress: any;
|
|
13
13
|
};
|
|
14
14
|
export declare const downloadAndProcessHistorySyncNotification: (msg: proto.Message.IHistorySyncNotification, options: RequestInit, logger?: ILogger) => Promise<{
|
|
15
|
-
chats:
|
|
15
|
+
chats: any[];
|
|
16
16
|
contacts: Contact[];
|
|
17
|
-
messages:
|
|
17
|
+
messages: any[];
|
|
18
18
|
lidPnMappings: LIDMapping[];
|
|
19
|
-
pastParticipants:
|
|
20
|
-
syncType:
|
|
21
|
-
progress:
|
|
19
|
+
pastParticipants: any;
|
|
20
|
+
syncType: any;
|
|
21
|
+
progress: any;
|
|
22
22
|
}>;
|
|
23
|
-
export declare const getHistoryMsg: (message: proto.IMessage) =>
|
|
23
|
+
export declare const getHistoryMsg: (message: proto.IMessage) => any;
|