@d0v3riz/baileys 6.7.12 → 6.7.17
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 +1 -1
- package/README.md +35 -1267
- package/WAProto/index.d.ts +16106 -2739
- package/WAProto/index.js +128593 -73944
- package/engine-requirements.js +10 -0
- package/lib/Defaults/baileys-version.json +3 -3
- package/lib/Defaults/index.d.ts +51 -53
- package/lib/Defaults/index.js +105 -106
- package/lib/Signal/libsignal.d.ts +3 -3
- package/lib/Signal/libsignal.js +161 -152
- package/lib/Socket/Client/index.d.ts +2 -2
- package/lib/Socket/Client/index.js +18 -18
- package/lib/Socket/Client/types.d.ts +15 -17
- package/lib/Socket/Client/types.js +13 -13
- package/lib/Socket/Client/websocket.d.ts +12 -12
- package/lib/Socket/Client/websocket.js +62 -62
- package/lib/Socket/business.d.ts +146 -148
- package/lib/Socket/business.js +260 -260
- package/lib/Socket/chats.d.ts +85 -84
- package/lib/Socket/chats.js +880 -846
- package/lib/Socket/groups.d.ts +124 -123
- package/lib/Socket/groups.js +314 -314
- package/lib/Socket/index.d.ts +146 -148
- package/lib/Socket/index.js +10 -10
- package/lib/Socket/messages-recv.d.ts +135 -135
- package/lib/Socket/messages-recv.js +920 -913
- package/lib/Socket/messages-send.d.ts +130 -129
- package/lib/Socket/messages-send.js +683 -673
- package/lib/Socket/socket.d.ts +42 -45
- package/lib/Socket/socket.js +622 -622
- package/lib/Socket/usync.d.ts +36 -38
- package/lib/Socket/usync.js +70 -70
- package/lib/Types/Auth.d.ts +103 -105
- 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 +112 -107
- 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 +172 -172
- package/lib/Types/Events.js +2 -2
- package/lib/Types/GroupMetadata.d.ts +56 -56
- package/lib/Types/GroupMetadata.js +2 -2
- package/lib/Types/Label.d.ts +46 -46
- 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 +269 -273
- package/lib/Types/Message.js +7 -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 +121 -118
- 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/USync.d.ts +25 -25
- package/lib/Types/USync.js +2 -2
- package/lib/Types/index.d.ts +63 -63
- package/lib/Types/index.js +41 -41
- package/lib/Utils/auth-utils.d.ts +18 -18
- package/lib/Utils/auth-utils.js +200 -200
- 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 +70 -72
- package/lib/Utils/chat-utils.js +745 -745
- package/lib/Utils/crypto.d.ts +40 -42
- package/lib/Utils/crypto.js +193 -153
- package/lib/Utils/decode-wa-message.d.ts +36 -36
- package/lib/Utils/decode-wa-message.js +205 -205
- package/lib/Utils/event-buffer.d.ts +35 -35
- package/lib/Utils/event-buffer.js +520 -520
- package/lib/Utils/generics.d.ts +90 -94
- package/lib/Utils/generics.js +398 -421
- package/lib/Utils/history.d.ts +19 -19
- package/lib/Utils/history.js +94 -94
- 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 +126 -116
- package/lib/Utils/logger.d.ts +11 -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 +44 -44
- package/lib/Utils/messages-media.d.ts +104 -108
- package/lib/Utils/messages-media.js +677 -667
- package/lib/Utils/messages.d.ts +75 -78
- package/lib/Utils/messages.js +765 -762
- package/lib/Utils/noise-handler.d.ts +19 -21
- package/lib/Utils/noise-handler.js +150 -150
- package/lib/Utils/process-message.d.ts +41 -42
- package/lib/Utils/process-message.js +382 -371
- package/lib/Utils/signal.d.ts +33 -33
- package/lib/Utils/signal.js +153 -153
- package/lib/Utils/use-multi-file-auth-state.d.ts +12 -12
- package/lib/Utils/use-multi-file-auth-state.js +125 -94
- package/lib/Utils/validate-connection.d.ts +10 -10
- package/lib/Utils/validate-connection.js +175 -175
- package/lib/WABinary/constants.d.ts +27 -27
- package/lib/WABinary/constants.js +40 -40
- package/lib/WABinary/decode.d.ts +6 -8
- package/lib/WABinary/decode.js +264 -254
- package/lib/WABinary/encode.d.ts +2 -4
- package/lib/WABinary/encode.js +252 -234
- package/lib/WABinary/generic-utils.d.ts +14 -16
- 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 +33 -31
- package/lib/WABinary/jid-utils.js +66 -62
- package/lib/WABinary/types.d.ts +18 -18
- package/lib/WABinary/types.js +2 -2
- package/lib/WAM/BinaryInfo.d.ts +8 -18
- package/lib/WAM/BinaryInfo.js +13 -13
- package/lib/WAM/constants.d.ts +39 -39
- package/lib/WAM/constants.js +15350 -15350
- package/lib/WAM/encode.d.ts +2 -4
- package/lib/WAM/encode.js +155 -155
- package/lib/WAM/index.d.ts +3 -3
- package/lib/WAM/index.js +19 -19
- package/lib/WAUSync/Protocols/USyncContactProtocol.d.ts +9 -9
- package/lib/WAUSync/Protocols/USyncContactProtocol.js +32 -32
- package/lib/WAUSync/Protocols/USyncDeviceProtocol.d.ts +22 -22
- package/lib/WAUSync/Protocols/USyncDeviceProtocol.js +57 -57
- package/lib/WAUSync/Protocols/USyncDisappearingModeProtocol.d.ts +12 -12
- package/lib/WAUSync/Protocols/USyncDisappearingModeProtocol.js +30 -30
- package/lib/WAUSync/Protocols/USyncStatusProtocol.d.ts +12 -12
- package/lib/WAUSync/Protocols/USyncStatusProtocol.js +42 -42
- package/lib/WAUSync/Protocols/UsyncBotProfileProtocol.d.ts +25 -0
- package/lib/WAUSync/Protocols/UsyncBotProfileProtocol.js +53 -0
- package/lib/WAUSync/Protocols/UsyncLIDProtocol.d.ts +8 -0
- package/lib/WAUSync/Protocols/UsyncLIDProtocol.js +24 -0
- package/lib/WAUSync/Protocols/index.d.ts +4 -4
- package/lib/WAUSync/Protocols/index.js +20 -20
- package/lib/WAUSync/USyncQuery.d.ts +28 -26
- package/lib/WAUSync/USyncQuery.js +89 -79
- package/lib/WAUSync/USyncUser.d.ts +12 -10
- package/lib/WAUSync/USyncUser.js +26 -22
- package/lib/WAUSync/index.d.ts +3 -3
- package/lib/WAUSync/index.js +19 -19
- package/lib/index.d.ts +11 -12
- package/lib/index.js +30 -31
- package/package.json +27 -35
- package/WAProto/GenerateStatics.sh +0 -4
- package/WAProto/WAProto.proto +0 -3344
- package/lib/Store/index.d.ts +0 -3
- package/lib/Store/index.js +0 -10
- package/lib/Store/make-cache-manager-store.d.ts +0 -14
- package/lib/Store/make-cache-manager-store.js +0 -83
- package/lib/Store/make-in-memory-store.d.ts +0 -118
- package/lib/Store/make-in-memory-store.js +0 -420
- package/lib/Store/make-ordered-dictionary.d.ts +0 -13
- package/lib/Store/make-ordered-dictionary.js +0 -81
- package/lib/Store/object-repository.d.ts +0 -10
- package/lib/Store/object-repository.js +0 -27
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
const major = parseInt(process.versions.node.split('.')[0], 10);
|
|
2
|
+
|
|
3
|
+
if (major < 20) {
|
|
4
|
+
console.error(
|
|
5
|
+
`\n❌ This package requires Node.js 20+ to run reliably.\n` +
|
|
6
|
+
` You are using Node.js ${process.versions.node}.\n` +
|
|
7
|
+
` Please upgrade to Node.js 20+ to proceed.\n`
|
|
8
|
+
);
|
|
9
|
+
process.exit(1);
|
|
10
|
+
}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": [2, 3000,
|
|
3
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"version": [2, 3000, 1020608496]
|
|
3
|
+
}
|
package/lib/Defaults/index.d.ts
CHANGED
|
@@ -1,53 +1,51 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
export declare const
|
|
6
|
-
export declare const
|
|
7
|
-
export declare const
|
|
8
|
-
export declare const
|
|
9
|
-
export declare const
|
|
10
|
-
export declare const
|
|
11
|
-
export declare const
|
|
12
|
-
export declare const
|
|
13
|
-
|
|
14
|
-
export declare const
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
export declare const
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
'thumbnail-
|
|
36
|
-
'thumbnail-
|
|
37
|
-
'
|
|
38
|
-
'
|
|
39
|
-
'
|
|
40
|
-
'
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
export declare const
|
|
46
|
-
export declare const
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
USER_DEVICES: number;
|
|
53
|
-
};
|
|
1
|
+
import { proto } from '../../WAProto';
|
|
2
|
+
import type { MediaType, SocketConfig } from '../Types';
|
|
3
|
+
export declare const UNAUTHORIZED_CODES: number[];
|
|
4
|
+
export declare const DEFAULT_ORIGIN = "https://web.whatsapp.com";
|
|
5
|
+
export declare const DEF_CALLBACK_PREFIX = "CB:";
|
|
6
|
+
export declare const DEF_TAG_PREFIX = "TAG:";
|
|
7
|
+
export declare const PHONE_CONNECTION_CB = "CB:Pong";
|
|
8
|
+
export declare const WA_DEFAULT_EPHEMERAL: number;
|
|
9
|
+
export declare const NOISE_MODE = "Noise_XX_25519_AESGCM_SHA256\0\0\0\0";
|
|
10
|
+
export declare const DICT_VERSION = 2;
|
|
11
|
+
export declare const KEY_BUNDLE_TYPE: Buffer<ArrayBuffer>;
|
|
12
|
+
export declare const NOISE_WA_HEADER: Buffer<ArrayBuffer>;
|
|
13
|
+
/** from: https://stackoverflow.com/questions/3809401/what-is-a-good-regular-expression-to-match-a-url */
|
|
14
|
+
export declare const URL_REGEX: RegExp;
|
|
15
|
+
export declare const WA_CERT_DETAILS: {
|
|
16
|
+
SERIAL: number;
|
|
17
|
+
};
|
|
18
|
+
export declare const PROCESSABLE_HISTORY_TYPES: proto.Message.HistorySyncNotification.HistorySyncType[];
|
|
19
|
+
export declare const DEFAULT_CONNECTION_CONFIG: SocketConfig;
|
|
20
|
+
export declare const MEDIA_PATH_MAP: {
|
|
21
|
+
[T in MediaType]?: string;
|
|
22
|
+
};
|
|
23
|
+
export declare const MEDIA_HKDF_KEY_MAPPING: {
|
|
24
|
+
audio: string;
|
|
25
|
+
document: string;
|
|
26
|
+
gif: string;
|
|
27
|
+
image: string;
|
|
28
|
+
ppic: string;
|
|
29
|
+
product: string;
|
|
30
|
+
ptt: string;
|
|
31
|
+
sticker: string;
|
|
32
|
+
video: string;
|
|
33
|
+
'thumbnail-document': string;
|
|
34
|
+
'thumbnail-image': string;
|
|
35
|
+
'thumbnail-video': string;
|
|
36
|
+
'thumbnail-link': string;
|
|
37
|
+
'md-msg-hist': string;
|
|
38
|
+
'md-app-state': string;
|
|
39
|
+
'product-catalog-image': string;
|
|
40
|
+
'payment-bg-image': string;
|
|
41
|
+
ptv: string;
|
|
42
|
+
};
|
|
43
|
+
export declare const MEDIA_KEYS: MediaType[];
|
|
44
|
+
export declare const MIN_PREKEY_COUNT = 5;
|
|
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;
|
|
51
|
+
};
|
package/lib/Defaults/index.js
CHANGED
|
@@ -1,106 +1,105 @@
|
|
|
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_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");
|
|
8
|
-
const libsignal_1 = require("../Signal/libsignal");
|
|
9
|
-
const Utils_1 = require("../Utils");
|
|
10
|
-
const logger_1 = __importDefault(require("../Utils/logger"));
|
|
11
|
-
const baileys_version_json_1 = require("./baileys-version.json");
|
|
12
|
-
exports.UNAUTHORIZED_CODES = [401, 403, 419];
|
|
13
|
-
exports.DEFAULT_ORIGIN = 'https://web.whatsapp.com';
|
|
14
|
-
exports.DEF_CALLBACK_PREFIX = 'CB:';
|
|
15
|
-
exports.DEF_TAG_PREFIX = 'TAG:';
|
|
16
|
-
exports.PHONE_CONNECTION_CB = 'CB:Pong';
|
|
17
|
-
exports.WA_DEFAULT_EPHEMERAL = 7 * 24 * 60 * 60;
|
|
18
|
-
exports.NOISE_MODE = 'Noise_XX_25519_AESGCM_SHA256\0\0\0\0';
|
|
19
|
-
exports.DICT_VERSION = 2;
|
|
20
|
-
exports.KEY_BUNDLE_TYPE = Buffer.from([5]);
|
|
21
|
-
exports.NOISE_WA_HEADER = Buffer.from([87, 65, 6, exports.DICT_VERSION]); // last is "DICT_VERSION"
|
|
22
|
-
/** from: https://stackoverflow.com/questions/3809401/what-is-a-good-regular-expression-to-match-a-url */
|
|
23
|
-
exports.URL_REGEX = /(
|
|
24
|
-
exports.WA_CERT_DETAILS = {
|
|
25
|
-
SERIAL: 0,
|
|
26
|
-
};
|
|
27
|
-
exports.PROCESSABLE_HISTORY_TYPES = [
|
|
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,
|
|
33
|
-
];
|
|
34
|
-
exports.DEFAULT_CONNECTION_CONFIG = {
|
|
35
|
-
version: baileys_version_json_1.version,
|
|
36
|
-
browser: Utils_1.Browsers.ubuntu('Chrome'),
|
|
37
|
-
waWebSocketUrl: 'wss://web.whatsapp.com/ws/chat',
|
|
38
|
-
connectTimeoutMs: 20000,
|
|
39
|
-
keepAliveIntervalMs: 30000,
|
|
40
|
-
logger: logger_1.default.child({ class: 'baileys' }),
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
'
|
|
74
|
-
'
|
|
75
|
-
'md-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
'
|
|
80
|
-
'
|
|
81
|
-
'
|
|
82
|
-
'
|
|
83
|
-
'
|
|
84
|
-
'
|
|
85
|
-
'
|
|
86
|
-
'
|
|
87
|
-
'
|
|
88
|
-
'thumbnail-
|
|
89
|
-
'thumbnail-
|
|
90
|
-
'thumbnail-
|
|
91
|
-
'
|
|
92
|
-
'md-
|
|
93
|
-
'
|
|
94
|
-
'
|
|
95
|
-
'
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
exports.
|
|
99
|
-
exports.
|
|
100
|
-
exports.
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
};
|
|
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_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");
|
|
8
|
+
const libsignal_1 = require("../Signal/libsignal");
|
|
9
|
+
const Utils_1 = require("../Utils");
|
|
10
|
+
const logger_1 = __importDefault(require("../Utils/logger"));
|
|
11
|
+
const baileys_version_json_1 = require("./baileys-version.json");
|
|
12
|
+
exports.UNAUTHORIZED_CODES = [401, 403, 419];
|
|
13
|
+
exports.DEFAULT_ORIGIN = 'https://web.whatsapp.com';
|
|
14
|
+
exports.DEF_CALLBACK_PREFIX = 'CB:';
|
|
15
|
+
exports.DEF_TAG_PREFIX = 'TAG:';
|
|
16
|
+
exports.PHONE_CONNECTION_CB = 'CB:Pong';
|
|
17
|
+
exports.WA_DEFAULT_EPHEMERAL = 7 * 24 * 60 * 60;
|
|
18
|
+
exports.NOISE_MODE = 'Noise_XX_25519_AESGCM_SHA256\0\0\0\0';
|
|
19
|
+
exports.DICT_VERSION = 2;
|
|
20
|
+
exports.KEY_BUNDLE_TYPE = Buffer.from([5]);
|
|
21
|
+
exports.NOISE_WA_HEADER = Buffer.from([87, 65, 6, exports.DICT_VERSION]); // last is "DICT_VERSION"
|
|
22
|
+
/** from: https://stackoverflow.com/questions/3809401/what-is-a-good-regular-expression-to-match-a-url */
|
|
23
|
+
exports.URL_REGEX = /https:\/\/(?![^:@\/\s]+:[^:@\/\s]+@)[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}(:\d+)?(\/[^\s]*)?/g;
|
|
24
|
+
exports.WA_CERT_DETAILS = {
|
|
25
|
+
SERIAL: 0,
|
|
26
|
+
};
|
|
27
|
+
exports.PROCESSABLE_HISTORY_TYPES = [
|
|
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,
|
|
33
|
+
];
|
|
34
|
+
exports.DEFAULT_CONNECTION_CONFIG = {
|
|
35
|
+
version: baileys_version_json_1.version,
|
|
36
|
+
browser: Utils_1.Browsers.ubuntu('Chrome'),
|
|
37
|
+
waWebSocketUrl: 'wss://web.whatsapp.com/ws/chat',
|
|
38
|
+
connectTimeoutMs: 20000,
|
|
39
|
+
keepAliveIntervalMs: 30000,
|
|
40
|
+
logger: logger_1.default.child({ class: 'baileys' }),
|
|
41
|
+
emitOwnEvents: true,
|
|
42
|
+
defaultQueryTimeoutMs: 60000,
|
|
43
|
+
customUploadHosts: [],
|
|
44
|
+
retryRequestDelayMs: 250,
|
|
45
|
+
maxMsgRetryCount: 5,
|
|
46
|
+
fireInitQueries: true,
|
|
47
|
+
auth: undefined,
|
|
48
|
+
markOnlineOnConnect: true,
|
|
49
|
+
syncFullHistory: false,
|
|
50
|
+
patchMessageBeforeSending: msg => msg,
|
|
51
|
+
shouldSyncHistoryMessage: () => true,
|
|
52
|
+
shouldIgnoreJid: () => false,
|
|
53
|
+
linkPreviewImageThumbnailWidth: 192,
|
|
54
|
+
transactionOpts: { maxCommitRetries: 10, delayBetweenTriesMs: 3000 },
|
|
55
|
+
generateHighQualityLinkPreview: false,
|
|
56
|
+
options: {},
|
|
57
|
+
appStateMacVerification: {
|
|
58
|
+
patch: false,
|
|
59
|
+
snapshot: false,
|
|
60
|
+
},
|
|
61
|
+
countryCode: 'US',
|
|
62
|
+
getMessage: async () => undefined,
|
|
63
|
+
cachedGroupMetadata: async () => undefined,
|
|
64
|
+
makeSignalRepository: libsignal_1.makeLibSignalRepository
|
|
65
|
+
};
|
|
66
|
+
exports.MEDIA_PATH_MAP = {
|
|
67
|
+
image: '/mms/image',
|
|
68
|
+
video: '/mms/video',
|
|
69
|
+
document: '/mms/document',
|
|
70
|
+
audio: '/mms/audio',
|
|
71
|
+
sticker: '/mms/image',
|
|
72
|
+
'thumbnail-link': '/mms/image',
|
|
73
|
+
'product-catalog-image': '/product/image',
|
|
74
|
+
'md-app-state': '',
|
|
75
|
+
'md-msg-hist': '/mms/md-app-state',
|
|
76
|
+
};
|
|
77
|
+
exports.MEDIA_HKDF_KEY_MAPPING = {
|
|
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',
|
|
87
|
+
'thumbnail-document': 'Document Thumbnail',
|
|
88
|
+
'thumbnail-image': 'Image Thumbnail',
|
|
89
|
+
'thumbnail-video': 'Video Thumbnail',
|
|
90
|
+
'thumbnail-link': 'Link Thumbnail',
|
|
91
|
+
'md-msg-hist': 'History',
|
|
92
|
+
'md-app-state': 'App State',
|
|
93
|
+
'product-catalog-image': '',
|
|
94
|
+
'payment-bg-image': 'Payment Background',
|
|
95
|
+
'ptv': 'Video'
|
|
96
|
+
};
|
|
97
|
+
exports.MEDIA_KEYS = Object.keys(exports.MEDIA_PATH_MAP);
|
|
98
|
+
exports.MIN_PREKEY_COUNT = 5;
|
|
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
|
|
105
|
+
};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { SignalAuthState } from '../Types';
|
|
2
|
-
import { SignalRepository } from '../Types/Signal';
|
|
3
|
-
export declare function makeLibSignalRepository(auth: SignalAuthState): SignalRepository;
|
|
1
|
+
import { SignalAuthState } from '../Types';
|
|
2
|
+
import { SignalRepository } from '../Types/Signal';
|
|
3
|
+
export declare function makeLibSignalRepository(auth: SignalAuthState): SignalRepository;
|