lordceaser-baileys 1.0.16 → 1.0.18
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/lib/Defaults/baileys-version.json +3 -0
- package/lib/Defaults/index.d.ts +10 -32
- package/lib/Defaults/index.js +34 -64
- package/lib/Signal/libsignal.d.ts +3 -4
- package/lib/Signal/libsignal.js +51 -360
- package/lib/Socket/Client/index.js +0 -1
- package/lib/Socket/Client/types.d.ts +3 -3
- package/lib/Socket/Client/types.js +0 -1
- package/lib/Socket/Client/websocket.d.ts +1 -1
- package/lib/Socket/Client/websocket.js +15 -14
- package/lib/Socket/business.d.ts +40 -110
- package/lib/Socket/business.js +11 -133
- package/lib/Socket/chats.d.ts +27 -66
- package/lib/Socket/chats.js +186 -512
- package/lib/Socket/groups.d.ts +32 -68
- package/lib/Socket/groups.js +38 -75
- package/lib/Socket/index.d.ts +39 -146
- package/lib/Socket/index.js +5 -9
- package/lib/Socket/messages-recv.d.ts +40 -107
- package/lib/Socket/messages-recv.js +344 -1201
- package/lib/Socket/messages-send.d.ts +37 -105
- package/lib/Socket/messages-send.js +186 -649
- package/lib/Socket/socket.d.ts +10 -26
- package/lib/Socket/socket.js +146 -496
- package/lib/Socket/usync.d.ts +36 -0
- package/lib/Socket/usync.js +70 -0
- package/lib/Types/Auth.d.ts +3 -16
- package/lib/Types/Call.d.ts +1 -2
- package/lib/Types/Chat.d.ts +2 -13
- package/lib/Types/Chat.js +1 -7
- package/lib/Types/Contact.d.ts +0 -6
- package/lib/Types/Events.d.ts +17 -100
- package/lib/Types/GroupMetadata.d.ts +4 -16
- package/lib/Types/LabelAssociation.js +0 -1
- package/lib/Types/Message.d.ts +21 -73
- package/lib/Types/Message.js +5 -10
- package/lib/Types/Product.d.ts +1 -1
- package/lib/Types/Signal.d.ts +2 -31
- package/lib/Types/Socket.d.ts +19 -33
- package/lib/Types/State.d.ts +2 -71
- package/lib/Types/State.js +0 -55
- package/lib/Types/USync.d.ts +1 -1
- package/lib/Types/index.d.ts +2 -4
- package/lib/Types/index.js +0 -2
- package/lib/Utils/auth-utils.d.ts +3 -8
- package/lib/Utils/auth-utils.js +116 -228
- package/lib/Utils/baileys-event-stream.d.ts +16 -0
- package/lib/Utils/baileys-event-stream.js +63 -0
- package/lib/Utils/business.d.ts +3 -3
- package/lib/Utils/business.js +13 -12
- package/lib/Utils/chat-utils.d.ts +14 -43
- package/lib/Utils/chat-utils.js +178 -323
- package/lib/Utils/crypto.d.ts +11 -7
- package/lib/Utils/crypto.js +40 -16
- package/lib/Utils/decode-wa-message.d.ts +7 -35
- package/lib/Utils/decode-wa-message.js +22 -152
- package/lib/Utils/event-buffer.d.ts +7 -7
- package/lib/Utils/event-buffer.js +47 -156
- package/lib/Utils/generics.d.ts +11 -12
- package/lib/Utils/generics.js +81 -108
- package/lib/Utils/history.d.ts +15 -19
- package/lib/Utils/history.js +34 -81
- package/lib/Utils/index.d.ts +1 -5
- package/lib/Utils/index.js +1 -6
- package/lib/Utils/link-preview.d.ts +4 -3
- package/lib/Utils/link-preview.js +14 -9
- package/lib/Utils/logger.d.ts +6 -6
- package/lib/Utils/logger.js +0 -1
- package/lib/Utils/lt-hash.d.ts +12 -6
- package/lib/Utils/lt-hash.js +43 -3
- package/lib/Utils/make-mutex.d.ts +0 -1
- package/lib/Utils/make-mutex.js +28 -22
- package/lib/Utils/messages-media.d.ts +27 -55
- package/lib/Utils/messages-media.js +147 -319
- package/lib/Utils/messages.d.ts +21 -32
- package/lib/Utils/messages.js +158 -317
- package/lib/Utils/noise-handler.d.ts +8 -8
- package/lib/Utils/noise-handler.js +86 -141
- package/lib/Utils/process-message.d.ts +11 -29
- package/lib/Utils/process-message.js +94 -351
- package/lib/Utils/signal.d.ts +6 -19
- package/lib/Utils/signal.js +22 -83
- package/lib/Utils/use-multi-file-auth-state.d.ts +1 -1
- package/lib/Utils/use-multi-file-auth-state.js +7 -7
- package/lib/Utils/validate-connection.d.ts +4 -4
- package/lib/Utils/validate-connection.js +43 -85
- package/lib/WABinary/constants.d.ts +4 -4
- package/lib/WABinary/constants.js +8 -1272
- package/lib/WABinary/decode.js +2 -38
- package/lib/WABinary/encode.js +3 -8
- package/lib/WABinary/generic-utils.d.ts +7 -6
- package/lib/WABinary/generic-utils.js +18 -33
- package/lib/WABinary/index.js +0 -1
- package/lib/WABinary/jid-utils.d.ts +11 -23
- package/lib/WABinary/jid-utils.js +20 -66
- package/lib/WAM/BinaryInfo.d.ts +1 -1
- package/lib/WAM/constants.d.ts +1 -1
- package/lib/WAM/constants.js +11951 -19457
- package/lib/WAM/encode.js +10 -7
- package/lib/WAM/index.js +0 -1
- package/lib/WAUSync/Protocols/USyncContactProtocol.d.ts +2 -2
- package/lib/WAUSync/Protocols/USyncContactProtocol.js +6 -28
- package/lib/WAUSync/Protocols/USyncDeviceProtocol.d.ts +2 -2
- package/lib/WAUSync/Protocols/USyncDeviceProtocol.js +5 -5
- package/lib/WAUSync/Protocols/USyncDisappearingModeProtocol.d.ts +2 -2
- package/lib/WAUSync/Protocols/USyncDisappearingModeProtocol.js +5 -5
- package/lib/WAUSync/Protocols/USyncStatusProtocol.d.ts +2 -2
- package/lib/WAUSync/Protocols/USyncStatusProtocol.js +6 -5
- package/lib/WAUSync/Protocols/UsyncBotProfileProtocol.d.ts +2 -2
- package/lib/WAUSync/Protocols/UsyncBotProfileProtocol.js +1 -1
- package/lib/WAUSync/Protocols/UsyncLIDProtocol.d.ts +3 -4
- package/lib/WAUSync/Protocols/UsyncLIDProtocol.js +3 -11
- package/lib/WAUSync/Protocols/index.d.ts +0 -1
- package/lib/WAUSync/Protocols/index.js +0 -2
- package/lib/WAUSync/USyncQuery.d.ts +3 -4
- package/lib/WAUSync/USyncQuery.js +19 -30
- package/lib/WAUSync/USyncUser.d.ts +5 -9
- package/lib/WAUSync/USyncUser.js +0 -9
- package/lib/WAUSync/index.d.ts +1 -1
- package/lib/WAUSync/index.js +1 -2
- package/lib/index.d.ts +8 -8
- package/lib/index.js +10 -11
- package/package.json +11 -34
- package/lib/Signal/Group/ciphertext-message.d.ts +0 -9
- package/lib/Signal/Group/ciphertext-message.js +0 -16
- package/lib/Signal/Group/group-session-builder.d.ts +0 -14
- package/lib/Signal/Group/group-session-builder.js +0 -65
- package/lib/Signal/Group/group_cipher.d.ts +0 -16
- package/lib/Signal/Group/group_cipher.js +0 -83
- package/lib/Signal/Group/index.d.ts +0 -11
- package/lib/Signal/Group/index.js +0 -58
- package/lib/Signal/Group/keyhelper.d.ts +0 -10
- package/lib/Signal/Group/keyhelper.js +0 -56
- package/lib/Signal/Group/sender-chain-key.d.ts +0 -13
- package/lib/Signal/Group/sender-chain-key.js +0 -30
- package/lib/Signal/Group/sender-key-distribution-message.d.ts +0 -16
- package/lib/Signal/Group/sender-key-distribution-message.js +0 -67
- package/lib/Signal/Group/sender-key-message.d.ts +0 -18
- package/lib/Signal/Group/sender-key-message.js +0 -70
- package/lib/Signal/Group/sender-key-name.d.ts +0 -17
- package/lib/Signal/Group/sender-key-name.js +0 -51
- package/lib/Signal/Group/sender-key-record.d.ts +0 -30
- package/lib/Signal/Group/sender-key-record.js +0 -45
- package/lib/Signal/Group/sender-key-state.d.ts +0 -38
- package/lib/Signal/Group/sender-key-state.js +0 -88
- package/lib/Signal/Group/sender-message-key.d.ts +0 -11
- package/lib/Signal/Group/sender-message-key.js +0 -30
- package/lib/Signal/lid-mapping.d.ts +0 -22
- package/lib/Signal/lid-mapping.js +0 -284
- package/lib/Socket/communities.d.ts +0 -266
- package/lib/Socket/communities.js +0 -439
- package/lib/Socket/mex.d.ts +0 -2
- package/lib/Socket/mex.js +0 -46
- package/lib/Socket/newsletter.d.ts +0 -169
- package/lib/Socket/newsletter.js +0 -184
- package/lib/Types/Bussines.d.ts +0 -24
- package/lib/Types/Bussines.js +0 -2
- package/lib/Types/Mex.d.ts +0 -140
- package/lib/Types/Mex.js +0 -40
- package/lib/Utils/browser-utils.d.ts +0 -3
- package/lib/Utils/browser-utils.js +0 -33
- package/lib/Utils/companion-reg-client-utils.d.ts +0 -16
- package/lib/Utils/companion-reg-client-utils.js +0 -40
- package/lib/Utils/identity-change-handler.d.ts +0 -43
- package/lib/Utils/identity-change-handler.js +0 -51
- package/lib/Utils/message-retry-manager.d.ts +0 -114
- package/lib/Utils/message-retry-manager.js +0 -272
- package/lib/Utils/offline-node-processor.d.ts +0 -16
- package/lib/Utils/offline-node-processor.js +0 -42
- package/lib/Utils/pre-key-manager.d.ts +0 -27
- package/lib/Utils/pre-key-manager.js +0 -113
- package/lib/Utils/reporting-utils.d.ts +0 -10
- package/lib/Utils/reporting-utils.js +0 -262
- package/lib/Utils/stanza-ack.d.ts +0 -10
- package/lib/Utils/stanza-ack.js +0 -40
- package/lib/Utils/sync-action-utils.d.ts +0 -18
- package/lib/Utils/sync-action-utils.js +0 -52
- package/lib/Utils/tc-token-utils.d.ts +0 -36
- package/lib/Utils/tc-token-utils.js +0 -174
- package/lib/WAUSync/Protocols/USyncUsernameProtocol.d.ts +0 -9
- package/lib/WAUSync/Protocols/USyncUsernameProtocol.js +0 -27
package/lib/Defaults/index.d.ts
CHANGED
|
@@ -1,38 +1,21 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { proto } from '../../WAProto';
|
|
2
|
+
import type { MediaType, SocketConfig } from '../Types';
|
|
2
3
|
export declare const UNAUTHORIZED_CODES: number[];
|
|
3
4
|
export declare const DEFAULT_ORIGIN = "https://web.whatsapp.com";
|
|
4
|
-
export declare const CALL_VIDEO_PREFIX = "https://call.whatsapp.com/video/";
|
|
5
|
-
export declare const CALL_AUDIO_PREFIX = "https://call.whatsapp.com/voice/";
|
|
6
5
|
export declare const DEF_CALLBACK_PREFIX = "CB:";
|
|
7
6
|
export declare const DEF_TAG_PREFIX = "TAG:";
|
|
8
7
|
export declare const PHONE_CONNECTION_CB = "CB:Pong";
|
|
9
|
-
export declare const WA_ADV_ACCOUNT_SIG_PREFIX: Buffer<ArrayBuffer>;
|
|
10
|
-
export declare const WA_ADV_DEVICE_SIG_PREFIX: Buffer<ArrayBuffer>;
|
|
11
|
-
export declare const WA_ADV_HOSTED_ACCOUNT_SIG_PREFIX: Buffer<ArrayBuffer>;
|
|
12
|
-
export declare const WA_ADV_HOSTED_DEVICE_SIG_PREFIX: Buffer<ArrayBuffer>;
|
|
13
8
|
export declare const WA_DEFAULT_EPHEMERAL: number;
|
|
14
|
-
/** Status messages older than 24 hours are considered expired */
|
|
15
|
-
export declare const STATUS_EXPIRY_SECONDS: number;
|
|
16
|
-
/** WA Web enforces a 14-day maximum age for placeholder resend requests */
|
|
17
|
-
export declare const PLACEHOLDER_MAX_AGE_SECONDS: number;
|
|
18
9
|
export declare const NOISE_MODE = "Noise_XX_25519_AESGCM_SHA256\0\0\0\0";
|
|
19
|
-
export declare const DICT_VERSION =
|
|
10
|
+
export declare const DICT_VERSION = 2;
|
|
20
11
|
export declare const KEY_BUNDLE_TYPE: Buffer<ArrayBuffer>;
|
|
21
12
|
export declare const NOISE_WA_HEADER: Buffer<ArrayBuffer>;
|
|
22
13
|
/** from: https://stackoverflow.com/questions/3809401/what-is-a-good-regular-expression-to-match-a-url */
|
|
23
14
|
export declare const URL_REGEX: RegExp;
|
|
24
15
|
export declare const WA_CERT_DETAILS: {
|
|
25
16
|
SERIAL: number;
|
|
26
|
-
ISSUER: string;
|
|
27
|
-
PUBLIC_KEY: Buffer<ArrayBuffer>;
|
|
28
|
-
};
|
|
29
|
-
export declare const PROCESSABLE_HISTORY_TYPES: any[];
|
|
30
|
-
export declare const DEFAULT_CACHE_TTLS: {
|
|
31
|
-
SIGNAL_STORE: number;
|
|
32
|
-
MSG_RETRY: number;
|
|
33
|
-
CALL_OFFER: number;
|
|
34
|
-
USER_DEVICES: number;
|
|
35
17
|
};
|
|
18
|
+
export declare const PROCESSABLE_HISTORY_TYPES: proto.Message.HistorySyncNotification.HistorySyncType[];
|
|
36
19
|
export declare const DEFAULT_CONNECTION_CONFIG: SocketConfig;
|
|
37
20
|
export declare const MEDIA_PATH_MAP: {
|
|
38
21
|
[T in MediaType]?: string;
|
|
@@ -56,18 +39,13 @@ export declare const MEDIA_HKDF_KEY_MAPPING: {
|
|
|
56
39
|
'product-catalog-image': string;
|
|
57
40
|
'payment-bg-image': string;
|
|
58
41
|
ptv: string;
|
|
59
|
-
'biz-cover-photo': string;
|
|
60
42
|
};
|
|
61
|
-
export type MediaType = keyof typeof MEDIA_HKDF_KEY_MAPPING;
|
|
62
43
|
export declare const MEDIA_KEYS: MediaType[];
|
|
63
|
-
/** 120s timeout for history sync stall detection, same as WA Web's handleChunkProgress / restartPausedTimer (g = 120) */
|
|
64
|
-
export declare const HISTORY_SYNC_PAUSED_TIMEOUT_MS = 120000;
|
|
65
44
|
export declare const MIN_PREKEY_COUNT = 5;
|
|
66
|
-
export declare const INITIAL_PREKEY_COUNT =
|
|
67
|
-
export declare const
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
Week: number;
|
|
45
|
+
export declare const INITIAL_PREKEY_COUNT = 30;
|
|
46
|
+
export declare const DEFAULT_CACHE_TTLS: {
|
|
47
|
+
SIGNAL_STORE: number;
|
|
48
|
+
MSG_RETRY: number;
|
|
49
|
+
CALL_OFFER: number;
|
|
50
|
+
USER_DEVICES: number;
|
|
73
51
|
};
|
package/lib/Defaults/index.js
CHANGED
|
@@ -3,85 +3,60 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.
|
|
7
|
-
|
|
8
|
-
const index_js_1 = require('../WAProto/index.js');
|
|
6
|
+
exports.DEFAULT_CACHE_TTLS = exports.INITIAL_PREKEY_COUNT = exports.MIN_PREKEY_COUNT = exports.MEDIA_KEYS = exports.MEDIA_HKDF_KEY_MAPPING = exports.MEDIA_PATH_MAP = exports.DEFAULT_CONNECTION_CONFIG = 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.WA_DEFAULT_EPHEMERAL = exports.PHONE_CONNECTION_CB = exports.DEF_TAG_PREFIX = exports.DEF_CALLBACK_PREFIX = exports.DEFAULT_ORIGIN = exports.UNAUTHORIZED_CODES = void 0;
|
|
7
|
+
const WAProto_1 = require("../../WAProto");
|
|
9
8
|
const libsignal_1 = require("../Signal/libsignal");
|
|
10
|
-
const
|
|
9
|
+
const Utils_1 = require("../Utils");
|
|
11
10
|
const logger_1 = __importDefault(require("../Utils/logger"));
|
|
12
|
-
const
|
|
11
|
+
const baileys_version_json_1 = require("./baileys-version.json");
|
|
13
12
|
exports.UNAUTHORIZED_CODES = [401, 403, 419];
|
|
14
13
|
exports.DEFAULT_ORIGIN = 'https://web.whatsapp.com';
|
|
15
|
-
exports.CALL_VIDEO_PREFIX = 'https://call.whatsapp.com/video/';
|
|
16
|
-
exports.CALL_AUDIO_PREFIX = 'https://call.whatsapp.com/voice/';
|
|
17
14
|
exports.DEF_CALLBACK_PREFIX = 'CB:';
|
|
18
15
|
exports.DEF_TAG_PREFIX = 'TAG:';
|
|
19
16
|
exports.PHONE_CONNECTION_CB = 'CB:Pong';
|
|
20
|
-
exports.WA_ADV_ACCOUNT_SIG_PREFIX = Buffer.from([6, 0]);
|
|
21
|
-
exports.WA_ADV_DEVICE_SIG_PREFIX = Buffer.from([6, 1]);
|
|
22
|
-
exports.WA_ADV_HOSTED_ACCOUNT_SIG_PREFIX = Buffer.from([6, 5]);
|
|
23
|
-
exports.WA_ADV_HOSTED_DEVICE_SIG_PREFIX = Buffer.from([6, 6]);
|
|
24
17
|
exports.WA_DEFAULT_EPHEMERAL = 7 * 24 * 60 * 60;
|
|
25
|
-
/** Status messages older than 24 hours are considered expired */
|
|
26
|
-
exports.STATUS_EXPIRY_SECONDS = 24 * 60 * 60;
|
|
27
|
-
/** WA Web enforces a 14-day maximum age for placeholder resend requests */
|
|
28
|
-
exports.PLACEHOLDER_MAX_AGE_SECONDS = 14 * 24 * 60 * 60;
|
|
29
18
|
exports.NOISE_MODE = 'Noise_XX_25519_AESGCM_SHA256\0\0\0\0';
|
|
30
|
-
exports.DICT_VERSION =
|
|
19
|
+
exports.DICT_VERSION = 2;
|
|
31
20
|
exports.KEY_BUNDLE_TYPE = Buffer.from([5]);
|
|
32
21
|
exports.NOISE_WA_HEADER = Buffer.from([87, 65, 6, exports.DICT_VERSION]); // last is "DICT_VERSION"
|
|
33
22
|
/** from: https://stackoverflow.com/questions/3809401/what-is-a-good-regular-expression-to-match-a-url */
|
|
34
23
|
exports.URL_REGEX = /https:\/\/(?![^:@\/\s]+:[^:@\/\s]+@)[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}(:\d+)?(\/[^\s]*)?/g;
|
|
35
24
|
exports.WA_CERT_DETAILS = {
|
|
36
25
|
SERIAL: 0,
|
|
37
|
-
ISSUER: 'WhatsAppLongTerm1',
|
|
38
|
-
PUBLIC_KEY: Buffer.from('142375574d0a587166aae71ebe516437c4a28b73e3695c6ce1f7f9545da8ee6b', 'hex')
|
|
39
26
|
};
|
|
40
27
|
exports.PROCESSABLE_HISTORY_TYPES = [
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
index_js_1.proto.HistorySync.HistorySyncType.NON_BLOCKING_DATA,
|
|
47
|
-
index_js_1.proto.HistorySync.HistorySyncType.INITIAL_STATUS_V3
|
|
28
|
+
WAProto_1.proto.Message.HistorySyncNotification.HistorySyncType.INITIAL_BOOTSTRAP,
|
|
29
|
+
WAProto_1.proto.Message.HistorySyncNotification.HistorySyncType.PUSH_NAME,
|
|
30
|
+
WAProto_1.proto.Message.HistorySyncNotification.HistorySyncType.RECENT,
|
|
31
|
+
WAProto_1.proto.Message.HistorySyncNotification.HistorySyncType.FULL,
|
|
32
|
+
WAProto_1.proto.Message.HistorySyncNotification.HistorySyncType.ON_DEMAND,
|
|
48
33
|
];
|
|
49
|
-
exports.DEFAULT_CACHE_TTLS = {
|
|
50
|
-
SIGNAL_STORE: 5 * 60, // 5 minutes
|
|
51
|
-
MSG_RETRY: 60 * 60, // 1 hour
|
|
52
|
-
CALL_OFFER: 5 * 60, // 5 minutes
|
|
53
|
-
USER_DEVICES: 5 * 60 // 5 minutes
|
|
54
|
-
};
|
|
55
34
|
exports.DEFAULT_CONNECTION_CONFIG = {
|
|
56
|
-
version: version,
|
|
57
|
-
browser:
|
|
35
|
+
version: baileys_version_json_1.version,
|
|
36
|
+
browser: Utils_1.Browsers.ubuntu('Chrome'),
|
|
58
37
|
waWebSocketUrl: 'wss://web.whatsapp.com/ws/chat',
|
|
59
|
-
connectTimeoutMs:
|
|
60
|
-
keepAliveIntervalMs:
|
|
38
|
+
connectTimeoutMs: 20000,
|
|
39
|
+
keepAliveIntervalMs: 30000,
|
|
61
40
|
logger: logger_1.default.child({ class: 'baileys' }),
|
|
62
41
|
emitOwnEvents: true,
|
|
63
|
-
defaultQueryTimeoutMs:
|
|
42
|
+
defaultQueryTimeoutMs: 60000,
|
|
64
43
|
customUploadHosts: [],
|
|
65
44
|
retryRequestDelayMs: 250,
|
|
66
45
|
maxMsgRetryCount: 5,
|
|
67
46
|
fireInitQueries: true,
|
|
68
47
|
auth: undefined,
|
|
69
48
|
markOnlineOnConnect: true,
|
|
70
|
-
syncFullHistory:
|
|
49
|
+
syncFullHistory: false,
|
|
71
50
|
patchMessageBeforeSending: msg => msg,
|
|
72
|
-
shouldSyncHistoryMessage: (
|
|
73
|
-
return syncType !== index_js_1.proto.HistorySync.HistorySyncType.FULL;
|
|
74
|
-
},
|
|
51
|
+
shouldSyncHistoryMessage: () => true,
|
|
75
52
|
shouldIgnoreJid: () => false,
|
|
76
53
|
linkPreviewImageThumbnailWidth: 192,
|
|
77
54
|
transactionOpts: { maxCommitRetries: 10, delayBetweenTriesMs: 3000 },
|
|
78
55
|
generateHighQualityLinkPreview: false,
|
|
79
|
-
enableAutoSessionRecreation: true,
|
|
80
|
-
enableRecentMessageCache: true,
|
|
81
56
|
options: {},
|
|
82
57
|
appStateMacVerification: {
|
|
83
58
|
patch: false,
|
|
84
|
-
snapshot: false
|
|
59
|
+
snapshot: false,
|
|
85
60
|
},
|
|
86
61
|
countryCode: 'US',
|
|
87
62
|
getMessage: async () => undefined,
|
|
@@ -98,18 +73,17 @@ exports.MEDIA_PATH_MAP = {
|
|
|
98
73
|
'product-catalog-image': '/product/image',
|
|
99
74
|
'md-app-state': '',
|
|
100
75
|
'md-msg-hist': '/mms/md-app-state',
|
|
101
|
-
'biz-cover-photo': '/pps/biz-cover-photo'
|
|
102
76
|
};
|
|
103
77
|
exports.MEDIA_HKDF_KEY_MAPPING = {
|
|
104
|
-
audio: 'Audio',
|
|
105
|
-
document: 'Document',
|
|
106
|
-
gif: 'Video',
|
|
107
|
-
image: 'Image',
|
|
108
|
-
ppic: '',
|
|
109
|
-
product: 'Image',
|
|
110
|
-
ptt: 'Audio',
|
|
111
|
-
sticker: 'Image',
|
|
112
|
-
video: 'Video',
|
|
78
|
+
'audio': 'Audio',
|
|
79
|
+
'document': 'Document',
|
|
80
|
+
'gif': 'Video',
|
|
81
|
+
'image': 'Image',
|
|
82
|
+
'ppic': '',
|
|
83
|
+
'product': 'Image',
|
|
84
|
+
'ptt': 'Audio',
|
|
85
|
+
'sticker': 'Image',
|
|
86
|
+
'video': 'Video',
|
|
113
87
|
'thumbnail-document': 'Document Thumbnail',
|
|
114
88
|
'thumbnail-image': 'Image Thumbnail',
|
|
115
89
|
'thumbnail-video': 'Video Thumbnail',
|
|
@@ -118,18 +92,14 @@ exports.MEDIA_HKDF_KEY_MAPPING = {
|
|
|
118
92
|
'md-app-state': 'App State',
|
|
119
93
|
'product-catalog-image': '',
|
|
120
94
|
'payment-bg-image': 'Payment Background',
|
|
121
|
-
ptv: 'Video'
|
|
122
|
-
'biz-cover-photo': 'Image'
|
|
95
|
+
'ptv': 'Video'
|
|
123
96
|
};
|
|
124
97
|
exports.MEDIA_KEYS = Object.keys(exports.MEDIA_PATH_MAP);
|
|
125
|
-
/** 120s timeout for history sync stall detection, same as WA Web's handleChunkProgress / restartPausedTimer (g = 120) */
|
|
126
|
-
exports.HISTORY_SYNC_PAUSED_TIMEOUT_MS = 120_000;
|
|
127
98
|
exports.MIN_PREKEY_COUNT = 5;
|
|
128
|
-
exports.INITIAL_PREKEY_COUNT =
|
|
129
|
-
exports.
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
Week: 7 * 24 * 60 * 60 * 1000
|
|
99
|
+
exports.INITIAL_PREKEY_COUNT = 30;
|
|
100
|
+
exports.DEFAULT_CACHE_TTLS = {
|
|
101
|
+
SIGNAL_STORE: 5 * 60, // 5 minutes
|
|
102
|
+
MSG_RETRY: 60 * 60, // 1 hour
|
|
103
|
+
CALL_OFFER: 5 * 60, // 5 minutes
|
|
104
|
+
USER_DEVICES: 5 * 60, // 5 minutes
|
|
135
105
|
};
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
|
|
4
|
-
export declare function makeLibSignalRepository(auth: SignalAuthState, logger: ILogger, pnToLIDFunc?: (jids: string[]) => Promise<LIDMapping[] | undefined>): SignalRepositoryWithLIDStore;
|
|
1
|
+
import { SignalAuthState } from '../Types';
|
|
2
|
+
import { SignalRepository } from '../Types/Signal';
|
|
3
|
+
export declare function makeLibSignalRepository(auth: SignalAuthState): SignalRepository;
|