dibosockets 1.0.1 → 1.0.3

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.
@@ -5,7 +5,7 @@ console.error(
5
5
  ` Diperlukan Node.js V20 atau lebih tinggi.\n` +
6
6
  ` Saat ini: v${process.versions.node}\n\n` +
7
7
  ` 🚀 Ayo upgrade sekarang biar gak ketinggalan zaman!\n` +
8
- ` © Kriszz Hayanasi - Khayzuu.\n`
8
+ ` ©Dibo.\n`
9
9
  )
10
10
  process.exit(1)
11
11
  }
@@ -1,3 +1,3 @@
1
- {
2
- "version": [2, 3000, 1027934701]
3
- }
1
+ {
2
+ "version": [2, 3000, 1027934701]
3
+ }
@@ -1,106 +1,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 = 3;
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
- printQRInTerminal: false,
42
- emitOwnEvents: true,
43
- defaultQueryTimeoutMs: 60000,
44
- customUploadHosts: [],
45
- retryRequestDelayMs: 250,
46
- maxMsgRetryCount: 5,
47
- fireInitQueries: true,
48
- auth: undefined,
49
- markOnlineOnConnect: true,
50
- syncFullHistory: false,
51
- patchMessageBeforeSending: msg => msg,
52
- shouldSyncHistoryMessage: () => true,
53
- shouldIgnoreJid: () => false,
54
- linkPreviewImageThumbnailWidth: 192,
55
- transactionOpts: { maxCommitRetries: 10, delayBetweenTriesMs: 3000 },
56
- generateHighQualityLinkPreview: false,
57
- options: {},
58
- appStateMacVerification: {
59
- patch: false,
60
- snapshot: false,
61
- },
62
- countryCode: 'US',
63
- getMessage: async () => undefined,
64
- cachedGroupMetadata: async () => undefined,
65
- makeSignalRepository: libsignal_1.makeLibSignalRepository
66
- };
67
- exports.MEDIA_PATH_MAP = {
68
- image: '/mms/image',
69
- video: '/mms/video',
70
- document: '/mms/document',
71
- audio: '/mms/audio',
72
- sticker: '/mms/image',
73
- 'thumbnail-link': '/mms/image',
74
- 'product-catalog-image': '/product/image',
75
- 'md-app-state': '',
76
- 'md-msg-hist': '/mms/md-app-state',
77
- };
78
- exports.MEDIA_HKDF_KEY_MAPPING = {
79
- 'audio': 'Audio',
80
- 'document': 'Document',
81
- 'gif': 'Video',
82
- 'image': 'Image',
83
- 'ppic': '',
84
- 'product': 'Image',
85
- 'ptt': 'Audio',
86
- 'sticker': 'Image',
87
- 'video': 'Video',
88
- 'thumbnail-document': 'Document Thumbnail',
89
- 'thumbnail-image': 'Image Thumbnail',
90
- 'thumbnail-video': 'Video Thumbnail',
91
- 'thumbnail-link': 'Link Thumbnail',
92
- 'md-msg-hist': 'History',
93
- 'md-app-state': 'App State',
94
- 'product-catalog-image': '',
95
- 'payment-bg-image': 'Payment Background',
96
- 'ptv': 'Video'
97
- };
98
- exports.MEDIA_KEYS = Object.keys(exports.MEDIA_PATH_MAP);
99
- exports.MIN_PREKEY_COUNT = 5;
100
- exports.INITIAL_PREKEY_COUNT = 30;
101
- exports.DEFAULT_CACHE_TTLS = {
102
- SIGNAL_STORE: 5 * 60, // 5 minutes
103
- MSG_RETRY: 60 * 60, // 1 hour
104
- CALL_OFFER: 5 * 60, // 5 minutes
105
- USER_DEVICES: 5 * 60, // 5 minutes
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 = 3;
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
+ printQRInTerminal: false,
42
+ emitOwnEvents: true,
43
+ defaultQueryTimeoutMs: 60000,
44
+ customUploadHosts: [],
45
+ retryRequestDelayMs: 250,
46
+ maxMsgRetryCount: 5,
47
+ fireInitQueries: true,
48
+ auth: undefined,
49
+ markOnlineOnConnect: true,
50
+ syncFullHistory: false,
51
+ patchMessageBeforeSending: msg => msg,
52
+ shouldSyncHistoryMessage: () => true,
53
+ shouldIgnoreJid: () => false,
54
+ linkPreviewImageThumbnailWidth: 192,
55
+ transactionOpts: { maxCommitRetries: 10, delayBetweenTriesMs: 3000 },
56
+ generateHighQualityLinkPreview: false,
57
+ options: {},
58
+ appStateMacVerification: {
59
+ patch: false,
60
+ snapshot: false,
61
+ },
62
+ countryCode: 'US',
63
+ getMessage: async () => undefined,
64
+ cachedGroupMetadata: async () => undefined,
65
+ makeSignalRepository: libsignal_1.makeLibSignalRepository
66
+ };
67
+ exports.MEDIA_PATH_MAP = {
68
+ image: '/mms/image',
69
+ video: '/mms/video',
70
+ document: '/mms/document',
71
+ audio: '/mms/audio',
72
+ sticker: '/mms/image',
73
+ 'thumbnail-link': '/mms/image',
74
+ 'product-catalog-image': '/product/image',
75
+ 'md-app-state': '',
76
+ 'md-msg-hist': '/mms/md-app-state',
77
+ };
78
+ exports.MEDIA_HKDF_KEY_MAPPING = {
79
+ 'audio': 'Audio',
80
+ 'document': 'Document',
81
+ 'gif': 'Video',
82
+ 'image': 'Image',
83
+ 'ppic': '',
84
+ 'product': 'Image',
85
+ 'ptt': 'Audio',
86
+ 'sticker': 'Image',
87
+ 'video': 'Video',
88
+ 'thumbnail-document': 'Document Thumbnail',
89
+ 'thumbnail-image': 'Image Thumbnail',
90
+ 'thumbnail-video': 'Video Thumbnail',
91
+ 'thumbnail-link': 'Link Thumbnail',
92
+ 'md-msg-hist': 'History',
93
+ 'md-app-state': 'App State',
94
+ 'product-catalog-image': '',
95
+ 'payment-bg-image': 'Payment Background',
96
+ 'ptv': 'Video'
97
+ };
98
+ exports.MEDIA_KEYS = Object.keys(exports.MEDIA_PATH_MAP);
99
+ exports.MIN_PREKEY_COUNT = 5;
100
+ exports.INITIAL_PREKEY_COUNT = 30;
101
+ exports.DEFAULT_CACHE_TTLS = {
102
+ SIGNAL_STORE: 5 * 60, // 5 minutes
103
+ MSG_RETRY: 60 * 60, // 1 hour
104
+ CALL_OFFER: 5 * 60, // 5 minutes
105
+ USER_DEVICES: 5 * 60, // 5 minutes
106
+ };