@queenanya/baileys 6.7.0 → 6.8.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/WASignalGroup/readme.md +6 -0
- package/lib/Defaults/baileys-version.json +3 -3
- package/lib/Defaults/index.d.ts +284 -284
- package/lib/Defaults/index.js +120 -120
- package/lib/Defaults/phonenumber-mcc.json +223 -223
- package/lib/Signal/libsignal.d.ts +3 -3
- package/lib/Signal/libsignal.js +152 -152
- package/lib/Socket/Client/abstract-socket-client.d.ts +17 -17
- package/lib/Socket/Client/abstract-socket-client.js +13 -13
- package/lib/Socket/Client/index.d.ts +3 -3
- package/lib/Socket/Client/index.js +19 -19
- package/lib/Socket/Client/mobile-socket-client.d.ts +13 -13
- package/lib/Socket/Client/mobile-socket-client.js +65 -65
- package/lib/Socket/Client/web-socket-client.d.ts +12 -12
- package/lib/Socket/Client/web-socket-client.js +62 -62
- package/lib/Socket/business.d.ts +135 -135
- package/lib/Socket/business.js +259 -259
- package/lib/Socket/chats.d.ts +79 -79
- package/lib/Socket/chats.js +854 -854
- package/lib/Socket/groups.d.ts +113 -113
- package/lib/Socket/groups.js +302 -302
- package/lib/Socket/index.d.ts +137 -137
- package/lib/Socket/index.js +10 -10
- package/lib/Socket/messages-recv.d.ts +124 -124
- package/lib/Socket/messages-recv.js +747 -747
- package/lib/Socket/messages-send.d.ts +119 -119
- package/lib/Socket/messages-send.js +663 -663
- package/lib/Socket/registration.d.ts +232 -232
- package/lib/Socket/registration.js +166 -166
- package/lib/Socket/socket.d.ts +42 -42
- package/lib/Socket/socket.js +588 -588
- package/lib/Store/index.d.ts +3 -3
- package/lib/Store/index.js +10 -10
- package/lib/Store/make-cache-manager-store.d.ts +13 -13
- package/lib/Store/make-cache-manager-store.js +83 -83
- package/lib/Store/make-in-memory-store.d.ts +117 -117
- package/lib/Store/make-in-memory-store.js +437 -437
- package/lib/Store/make-ordered-dictionary.d.ts +13 -13
- package/lib/Store/make-ordered-dictionary.js +81 -81
- package/lib/Store/object-repository.d.ts +10 -10
- package/lib/Store/object-repository.js +27 -27
- package/lib/Types/Auth.d.ts +108 -108
- package/lib/Types/Auth.js +2 -2
- package/lib/Types/Call.d.ts +13 -13
- package/lib/Types/Call.js +2 -2
- package/lib/Types/Chat.d.ts +102 -102
- package/lib/Types/Chat.js +4 -4
- package/lib/Types/Contact.d.ts +19 -19
- package/lib/Types/Contact.js +2 -2
- package/lib/Types/Events.d.ts +157 -157
- package/lib/Types/Events.js +2 -2
- package/lib/Types/GroupMetadata.d.ts +52 -52
- package/lib/Types/GroupMetadata.js +2 -2
- package/lib/Types/Label.d.ts +35 -35
- package/lib/Types/Label.js +27 -27
- package/lib/Types/LabelAssociation.d.ts +29 -29
- package/lib/Types/LabelAssociation.js +9 -9
- package/lib/Types/Message.d.ts +261 -261
- package/lib/Types/Message.js +9 -9
- package/lib/Types/Product.d.ts +78 -78
- package/lib/Types/Product.js +2 -2
- package/lib/Types/Signal.d.ts +57 -57
- package/lib/Types/Signal.js +2 -2
- package/lib/Types/Socket.d.ts +111 -111
- package/lib/Types/Socket.js +2 -2
- package/lib/Types/State.d.ts +27 -27
- package/lib/Types/State.js +2 -2
- package/lib/Types/index.d.ts +56 -56
- package/lib/Types/index.js +41 -41
- package/lib/Utils/auth-utils.d.ts +18 -18
- package/lib/Utils/auth-utils.js +204 -204
- package/lib/Utils/baileys-event-stream.d.ts +16 -16
- package/lib/Utils/baileys-event-stream.js +63 -63
- package/lib/Utils/business.d.ts +22 -22
- package/lib/Utils/business.js +234 -234
- package/lib/Utils/chat-utils.d.ts +71 -71
- package/lib/Utils/chat-utils.js +724 -724
- package/lib/Utils/crypto.d.ts +41 -41
- package/lib/Utils/crypto.js +151 -151
- package/lib/Utils/decode-wa-message.d.ts +19 -19
- package/lib/Utils/decode-wa-message.js +174 -174
- package/lib/Utils/event-buffer.d.ts +35 -35
- package/lib/Utils/event-buffer.js +514 -514
- package/lib/Utils/generics.d.ts +94 -94
- package/lib/Utils/generics.js +367 -367
- package/lib/Utils/history.d.ts +15 -15
- package/lib/Utils/history.js +91 -91
- package/lib/Utils/index.d.ts +17 -17
- package/lib/Utils/index.js +33 -33
- package/lib/Utils/link-preview.d.ts +21 -21
- package/lib/Utils/link-preview.js +93 -93
- package/lib/Utils/logger.d.ts +4 -4
- package/lib/Utils/logger.js +7 -7
- package/lib/Utils/lt-hash.d.ts +12 -12
- package/lib/Utils/lt-hash.js +51 -51
- package/lib/Utils/make-mutex.d.ts +7 -7
- package/lib/Utils/make-mutex.js +43 -43
- package/lib/Utils/messages-media.d.ts +107 -107
- package/lib/Utils/messages-media.js +680 -680
- package/lib/Utils/messages.d.ts +76 -76
- package/lib/Utils/messages.js +768 -768
- package/lib/Utils/noise-handler.d.ts +20 -20
- package/lib/Utils/noise-handler.js +142 -142
- package/lib/Utils/process-message.d.ts +41 -41
- package/lib/Utils/process-message.js +320 -320
- package/lib/Utils/signal.d.ts +32 -32
- package/lib/Utils/signal.js +151 -151
- package/lib/Utils/use-multi-file-auth-state.d.ts +12 -12
- package/lib/Utils/use-multi-file-auth-state.js +80 -80
- package/lib/Utils/validate-connection.d.ts +11 -11
- package/lib/Utils/validate-connection.js +191 -222
- package/lib/WABinary/constants.d.ts +27 -27
- package/lib/WABinary/constants.js +40 -40
- package/lib/WABinary/decode.d.ts +7 -7
- package/lib/WABinary/decode.js +252 -252
- package/lib/WABinary/encode.d.ts +3 -3
- package/lib/WABinary/encode.js +228 -228
- package/lib/WABinary/generic-utils.d.ts +15 -15
- package/lib/WABinary/generic-utils.js +110 -110
- package/lib/WABinary/index.d.ts +5 -5
- package/lib/WABinary/index.js +21 -21
- package/lib/WABinary/jid-utils.d.ts +29 -29
- package/lib/WABinary/jid-utils.js +59 -59
- package/lib/WABinary/types.d.ts +18 -18
- package/lib/WABinary/types.js +2 -2
- package/lib/index.d.ts +10 -10
- package/lib/index.js +29 -29
- package/package.json +1 -1
- package/CHANGELOG.md +0 -4
package/lib/Defaults/index.js
CHANGED
|
@@ -1,120 +1,120 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
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_EXCLUDE_REGEX = exports.URL_REGEX = exports.MOBILE_NOISE_HEADER = exports.PROTOCOL_VERSION = exports.NOISE_WA_HEADER = exports.KEY_BUNDLE_TYPE = exports.DICT_VERSION = exports.NOISE_MODE = exports.REGISTRATION_PUBLIC_KEY = exports.MOBILE_USERAGENT = exports.MOBILE_REGISTRATION_ENDPOINT = exports.MOBILE_TOKEN = exports.WA_DEFAULT_EPHEMERAL = exports.PHONE_CONNECTION_CB = exports.DEF_TAG_PREFIX = exports.DEF_CALLBACK_PREFIX = exports.MOBILE_PORT = exports.MOBILE_ENDPOINT = exports.DEFAULT_ORIGIN = exports.PHONENUMBER_MCC = exports.UNAUTHORIZED_CODES = void 0;
|
|
7
|
-
const crypto_1 = require("crypto");
|
|
8
|
-
const WAProto_1 = require("../../WAProto");
|
|
9
|
-
const libsignal_1 = require("../Signal/libsignal");
|
|
10
|
-
const Utils_1 = require("../Utils");
|
|
11
|
-
const logger_1 = __importDefault(require("../Utils/logger"));
|
|
12
|
-
const baileys_version_json_1 = require("./baileys-version.json");
|
|
13
|
-
const phonenumber_mcc_json_1 = __importDefault(require("./phonenumber-mcc.json"));
|
|
14
|
-
exports.UNAUTHORIZED_CODES = [401, 403, 419];
|
|
15
|
-
exports.PHONENUMBER_MCC = phonenumber_mcc_json_1.default;
|
|
16
|
-
exports.DEFAULT_ORIGIN = 'https://web.whatsapp.com';
|
|
17
|
-
exports.MOBILE_ENDPOINT = 'g.whatsapp.net';
|
|
18
|
-
exports.MOBILE_PORT = 443;
|
|
19
|
-
exports.DEF_CALLBACK_PREFIX = 'CB:';
|
|
20
|
-
exports.DEF_TAG_PREFIX = 'TAG:';
|
|
21
|
-
exports.PHONE_CONNECTION_CB = 'CB:Pong';
|
|
22
|
-
exports.WA_DEFAULT_EPHEMERAL = 7 * 24 * 60 * 60;
|
|
23
|
-
const WA_VERSION = '2.23.14.82';
|
|
24
|
-
const WA_VERSION_HASH = (0, crypto_1.createHash)('md5').update(WA_VERSION).digest('hex');
|
|
25
|
-
exports.MOBILE_TOKEN = Buffer.from('0a1mLfGUIBVrMKF1RdvLI5lkRBvof6vn0fD2QRSM' + WA_VERSION_HASH);
|
|
26
|
-
exports.MOBILE_REGISTRATION_ENDPOINT = 'https://v.whatsapp.net/v2';
|
|
27
|
-
exports.MOBILE_USERAGENT = `WhatsApp/${WA_VERSION} iOS/15.3.1 Device/Apple-iPhone_7`;
|
|
28
|
-
exports.REGISTRATION_PUBLIC_KEY = Buffer.from([
|
|
29
|
-
5, 142, 140, 15, 116, 195, 235, 197, 215, 166, 134, 92, 108, 60, 132, 56, 86, 176, 97, 33, 204, 232, 234, 119, 77,
|
|
30
|
-
34, 251, 111, 18, 37, 18, 48, 45,
|
|
31
|
-
]);
|
|
32
|
-
exports.NOISE_MODE = 'Noise_XX_25519_AESGCM_SHA256\0\0\0\0';
|
|
33
|
-
exports.DICT_VERSION = 2;
|
|
34
|
-
exports.KEY_BUNDLE_TYPE = Buffer.from([5]);
|
|
35
|
-
exports.NOISE_WA_HEADER = Buffer.from([87, 65, 6, exports.DICT_VERSION]); // last is "DICT_VERSION"
|
|
36
|
-
exports.PROTOCOL_VERSION = [5, 2];
|
|
37
|
-
exports.MOBILE_NOISE_HEADER = Buffer.concat([Buffer.from('WA'), Buffer.from(exports.PROTOCOL_VERSION)]);
|
|
38
|
-
/** from: https://stackoverflow.com/questions/3809401/what-is-a-good-regular-expression-to-match-a-url */
|
|
39
|
-
exports.URL_REGEX = /(http(s)?:\/\/.)?(www\.)?[-a-zA-Z0-9@:%._\+~#=]{2,256}\.[a-z]{2,6}\b([-a-zA-Z0-9@:%_\+.~#?&//=]*)/;
|
|
40
|
-
exports.URL_EXCLUDE_REGEX = /.*@.*/;
|
|
41
|
-
exports.WA_CERT_DETAILS = {
|
|
42
|
-
SERIAL: 0,
|
|
43
|
-
};
|
|
44
|
-
exports.PROCESSABLE_HISTORY_TYPES = [
|
|
45
|
-
WAProto_1.proto.Message.HistorySyncNotification.HistorySyncType.INITIAL_BOOTSTRAP,
|
|
46
|
-
WAProto_1.proto.Message.HistorySyncNotification.HistorySyncType.PUSH_NAME,
|
|
47
|
-
WAProto_1.proto.Message.HistorySyncNotification.HistorySyncType.RECENT,
|
|
48
|
-
WAProto_1.proto.Message.HistorySyncNotification.HistorySyncType.FULL
|
|
49
|
-
];
|
|
50
|
-
exports.DEFAULT_CONNECTION_CONFIG = {
|
|
51
|
-
version: baileys_version_json_1.version,
|
|
52
|
-
browser: Utils_1.Browsers.baileys('Firefox'),
|
|
53
|
-
waWebSocketUrl: 'wss://web.whatsapp.com/ws/chat',
|
|
54
|
-
connectTimeoutMs: 20000,
|
|
55
|
-
keepAliveIntervalMs: 30000,
|
|
56
|
-
logger: logger_1.default.child({ class: 'baileys' }),
|
|
57
|
-
printQRInTerminal: true,
|
|
58
|
-
emitOwnEvents: true,
|
|
59
|
-
defaultQueryTimeoutMs: 60000,
|
|
60
|
-
customUploadHosts: [],
|
|
61
|
-
retryRequestDelayMs: 250,
|
|
62
|
-
maxMsgRetryCount: 5,
|
|
63
|
-
fireInitQueries: true,
|
|
64
|
-
auth: undefined,
|
|
65
|
-
markOnlineOnConnect: true,
|
|
66
|
-
syncFullHistory: false,
|
|
67
|
-
patchMessageBeforeSending: msg => msg,
|
|
68
|
-
shouldSyncHistoryMessage: () => true,
|
|
69
|
-
shouldIgnoreJid: () => false,
|
|
70
|
-
linkPreviewImageThumbnailWidth: 192,
|
|
71
|
-
transactionOpts: { maxCommitRetries: 10, delayBetweenTriesMs: 3000 },
|
|
72
|
-
generateHighQualityLinkPreview: false,
|
|
73
|
-
options: {},
|
|
74
|
-
appStateMacVerification: {
|
|
75
|
-
patch: false,
|
|
76
|
-
snapshot: false,
|
|
77
|
-
},
|
|
78
|
-
getMessage: async () => undefined,
|
|
79
|
-
makeSignalRepository: libsignal_1.makeLibSignalRepository
|
|
80
|
-
};
|
|
81
|
-
exports.MEDIA_PATH_MAP = {
|
|
82
|
-
image: '/mms/image',
|
|
83
|
-
video: '/mms/video',
|
|
84
|
-
document: '/mms/document',
|
|
85
|
-
audio: '/mms/audio',
|
|
86
|
-
sticker: '/mms/image',
|
|
87
|
-
'thumbnail-link': '/mms/image',
|
|
88
|
-
'product-catalog-image': '/product/image',
|
|
89
|
-
'md-app-state': '',
|
|
90
|
-
'md-msg-hist': '/mms/md-app-state',
|
|
91
|
-
};
|
|
92
|
-
exports.MEDIA_HKDF_KEY_MAPPING = {
|
|
93
|
-
'audio': 'Audio',
|
|
94
|
-
'document': 'Document',
|
|
95
|
-
'gif': 'Video',
|
|
96
|
-
'image': 'Image',
|
|
97
|
-
'ppic': '',
|
|
98
|
-
'product': 'Image',
|
|
99
|
-
'ptt': 'Audio',
|
|
100
|
-
'sticker': 'Image',
|
|
101
|
-
'video': 'Video',
|
|
102
|
-
'thumbnail-document': 'Document Thumbnail',
|
|
103
|
-
'thumbnail-image': 'Image Thumbnail',
|
|
104
|
-
'thumbnail-video': 'Video Thumbnail',
|
|
105
|
-
'thumbnail-link': 'Link Thumbnail',
|
|
106
|
-
'md-msg-hist': 'History',
|
|
107
|
-
'md-app-state': 'App State',
|
|
108
|
-
'product-catalog-image': '',
|
|
109
|
-
'payment-bg-image': 'Payment Background',
|
|
110
|
-
'ptv': 'Video'
|
|
111
|
-
};
|
|
112
|
-
exports.MEDIA_KEYS = Object.keys(exports.MEDIA_PATH_MAP);
|
|
113
|
-
exports.MIN_PREKEY_COUNT = 5;
|
|
114
|
-
exports.INITIAL_PREKEY_COUNT = 30;
|
|
115
|
-
exports.DEFAULT_CACHE_TTLS = {
|
|
116
|
-
SIGNAL_STORE: 5 * 60,
|
|
117
|
-
MSG_RETRY: 60 * 60,
|
|
118
|
-
CALL_OFFER: 5 * 60,
|
|
119
|
-
USER_DEVICES: 5 * 60, // 5 minutes
|
|
120
|
-
};
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
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_EXCLUDE_REGEX = exports.URL_REGEX = exports.MOBILE_NOISE_HEADER = exports.PROTOCOL_VERSION = exports.NOISE_WA_HEADER = exports.KEY_BUNDLE_TYPE = exports.DICT_VERSION = exports.NOISE_MODE = exports.REGISTRATION_PUBLIC_KEY = exports.MOBILE_USERAGENT = exports.MOBILE_REGISTRATION_ENDPOINT = exports.MOBILE_TOKEN = exports.WA_DEFAULT_EPHEMERAL = exports.PHONE_CONNECTION_CB = exports.DEF_TAG_PREFIX = exports.DEF_CALLBACK_PREFIX = exports.MOBILE_PORT = exports.MOBILE_ENDPOINT = exports.DEFAULT_ORIGIN = exports.PHONENUMBER_MCC = exports.UNAUTHORIZED_CODES = void 0;
|
|
7
|
+
const crypto_1 = require("crypto");
|
|
8
|
+
const WAProto_1 = require("../../WAProto");
|
|
9
|
+
const libsignal_1 = require("../Signal/libsignal");
|
|
10
|
+
const Utils_1 = require("../Utils");
|
|
11
|
+
const logger_1 = __importDefault(require("../Utils/logger"));
|
|
12
|
+
const baileys_version_json_1 = require("./baileys-version.json");
|
|
13
|
+
const phonenumber_mcc_json_1 = __importDefault(require("./phonenumber-mcc.json"));
|
|
14
|
+
exports.UNAUTHORIZED_CODES = [401, 403, 419];
|
|
15
|
+
exports.PHONENUMBER_MCC = phonenumber_mcc_json_1.default;
|
|
16
|
+
exports.DEFAULT_ORIGIN = 'https://web.whatsapp.com';
|
|
17
|
+
exports.MOBILE_ENDPOINT = 'g.whatsapp.net';
|
|
18
|
+
exports.MOBILE_PORT = 443;
|
|
19
|
+
exports.DEF_CALLBACK_PREFIX = 'CB:';
|
|
20
|
+
exports.DEF_TAG_PREFIX = 'TAG:';
|
|
21
|
+
exports.PHONE_CONNECTION_CB = 'CB:Pong';
|
|
22
|
+
exports.WA_DEFAULT_EPHEMERAL = 7 * 24 * 60 * 60;
|
|
23
|
+
const WA_VERSION = '2.23.14.82';
|
|
24
|
+
const WA_VERSION_HASH = (0, crypto_1.createHash)('md5').update(WA_VERSION).digest('hex');
|
|
25
|
+
exports.MOBILE_TOKEN = Buffer.from('0a1mLfGUIBVrMKF1RdvLI5lkRBvof6vn0fD2QRSM' + WA_VERSION_HASH);
|
|
26
|
+
exports.MOBILE_REGISTRATION_ENDPOINT = 'https://v.whatsapp.net/v2';
|
|
27
|
+
exports.MOBILE_USERAGENT = `WhatsApp/${WA_VERSION} iOS/15.3.1 Device/Apple-iPhone_7`;
|
|
28
|
+
exports.REGISTRATION_PUBLIC_KEY = Buffer.from([
|
|
29
|
+
5, 142, 140, 15, 116, 195, 235, 197, 215, 166, 134, 92, 108, 60, 132, 56, 86, 176, 97, 33, 204, 232, 234, 119, 77,
|
|
30
|
+
34, 251, 111, 18, 37, 18, 48, 45,
|
|
31
|
+
]);
|
|
32
|
+
exports.NOISE_MODE = 'Noise_XX_25519_AESGCM_SHA256\0\0\0\0';
|
|
33
|
+
exports.DICT_VERSION = 2;
|
|
34
|
+
exports.KEY_BUNDLE_TYPE = Buffer.from([5]);
|
|
35
|
+
exports.NOISE_WA_HEADER = Buffer.from([87, 65, 6, exports.DICT_VERSION]); // last is "DICT_VERSION"
|
|
36
|
+
exports.PROTOCOL_VERSION = [5, 2];
|
|
37
|
+
exports.MOBILE_NOISE_HEADER = Buffer.concat([Buffer.from('WA'), Buffer.from(exports.PROTOCOL_VERSION)]);
|
|
38
|
+
/** from: https://stackoverflow.com/questions/3809401/what-is-a-good-regular-expression-to-match-a-url */
|
|
39
|
+
exports.URL_REGEX = /(http(s)?:\/\/.)?(www\.)?[-a-zA-Z0-9@:%._\+~#=]{2,256}\.[a-z]{2,6}\b([-a-zA-Z0-9@:%_\+.~#?&//=]*)/;
|
|
40
|
+
exports.URL_EXCLUDE_REGEX = /.*@.*/;
|
|
41
|
+
exports.WA_CERT_DETAILS = {
|
|
42
|
+
SERIAL: 0,
|
|
43
|
+
};
|
|
44
|
+
exports.PROCESSABLE_HISTORY_TYPES = [
|
|
45
|
+
WAProto_1.proto.Message.HistorySyncNotification.HistorySyncType.INITIAL_BOOTSTRAP,
|
|
46
|
+
WAProto_1.proto.Message.HistorySyncNotification.HistorySyncType.PUSH_NAME,
|
|
47
|
+
WAProto_1.proto.Message.HistorySyncNotification.HistorySyncType.RECENT,
|
|
48
|
+
WAProto_1.proto.Message.HistorySyncNotification.HistorySyncType.FULL
|
|
49
|
+
];
|
|
50
|
+
exports.DEFAULT_CONNECTION_CONFIG = {
|
|
51
|
+
version: baileys_version_json_1.version,
|
|
52
|
+
browser: Utils_1.Browsers.baileys('Firefox'),
|
|
53
|
+
waWebSocketUrl: 'wss://web.whatsapp.com/ws/chat',
|
|
54
|
+
connectTimeoutMs: 20000,
|
|
55
|
+
keepAliveIntervalMs: 30000,
|
|
56
|
+
logger: logger_1.default.child({ class: 'baileys' }),
|
|
57
|
+
printQRInTerminal: true,
|
|
58
|
+
emitOwnEvents: true,
|
|
59
|
+
defaultQueryTimeoutMs: 60000,
|
|
60
|
+
customUploadHosts: [],
|
|
61
|
+
retryRequestDelayMs: 250,
|
|
62
|
+
maxMsgRetryCount: 5,
|
|
63
|
+
fireInitQueries: true,
|
|
64
|
+
auth: undefined,
|
|
65
|
+
markOnlineOnConnect: true,
|
|
66
|
+
syncFullHistory: false,
|
|
67
|
+
patchMessageBeforeSending: msg => msg,
|
|
68
|
+
shouldSyncHistoryMessage: () => true,
|
|
69
|
+
shouldIgnoreJid: () => false,
|
|
70
|
+
linkPreviewImageThumbnailWidth: 192,
|
|
71
|
+
transactionOpts: { maxCommitRetries: 10, delayBetweenTriesMs: 3000 },
|
|
72
|
+
generateHighQualityLinkPreview: false,
|
|
73
|
+
options: {},
|
|
74
|
+
appStateMacVerification: {
|
|
75
|
+
patch: false,
|
|
76
|
+
snapshot: false,
|
|
77
|
+
},
|
|
78
|
+
getMessage: async () => undefined,
|
|
79
|
+
makeSignalRepository: libsignal_1.makeLibSignalRepository
|
|
80
|
+
};
|
|
81
|
+
exports.MEDIA_PATH_MAP = {
|
|
82
|
+
image: '/mms/image',
|
|
83
|
+
video: '/mms/video',
|
|
84
|
+
document: '/mms/document',
|
|
85
|
+
audio: '/mms/audio',
|
|
86
|
+
sticker: '/mms/image',
|
|
87
|
+
'thumbnail-link': '/mms/image',
|
|
88
|
+
'product-catalog-image': '/product/image',
|
|
89
|
+
'md-app-state': '',
|
|
90
|
+
'md-msg-hist': '/mms/md-app-state',
|
|
91
|
+
};
|
|
92
|
+
exports.MEDIA_HKDF_KEY_MAPPING = {
|
|
93
|
+
'audio': 'Audio',
|
|
94
|
+
'document': 'Document',
|
|
95
|
+
'gif': 'Video',
|
|
96
|
+
'image': 'Image',
|
|
97
|
+
'ppic': '',
|
|
98
|
+
'product': 'Image',
|
|
99
|
+
'ptt': 'Audio',
|
|
100
|
+
'sticker': 'Image',
|
|
101
|
+
'video': 'Video',
|
|
102
|
+
'thumbnail-document': 'Document Thumbnail',
|
|
103
|
+
'thumbnail-image': 'Image Thumbnail',
|
|
104
|
+
'thumbnail-video': 'Video Thumbnail',
|
|
105
|
+
'thumbnail-link': 'Link Thumbnail',
|
|
106
|
+
'md-msg-hist': 'History',
|
|
107
|
+
'md-app-state': 'App State',
|
|
108
|
+
'product-catalog-image': '',
|
|
109
|
+
'payment-bg-image': 'Payment Background',
|
|
110
|
+
'ptv': 'Video'
|
|
111
|
+
};
|
|
112
|
+
exports.MEDIA_KEYS = Object.keys(exports.MEDIA_PATH_MAP);
|
|
113
|
+
exports.MIN_PREKEY_COUNT = 5;
|
|
114
|
+
exports.INITIAL_PREKEY_COUNT = 30;
|
|
115
|
+
exports.DEFAULT_CACHE_TTLS = {
|
|
116
|
+
SIGNAL_STORE: 5 * 60,
|
|
117
|
+
MSG_RETRY: 60 * 60,
|
|
118
|
+
CALL_OFFER: 5 * 60,
|
|
119
|
+
USER_DEVICES: 5 * 60, // 5 minutes
|
|
120
|
+
};
|