cuki-bailx 1.2.6 → 2.0.8

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.
@@ -0,0 +1,295 @@
1
+ /*eslint-disable block-scoped-var, id-length, no-control-regex, no-magic-numbers, no-prototype-builtins, no-redeclare, no-shadow, no-var, sort-vars*/
2
+ "use strict";
3
+
4
+ var $protobuf = require("protobufjs/minimal");
5
+
6
+ // Common aliases
7
+ var $Reader = $protobuf.Reader, $Writer = $protobuf.Writer, $util = $protobuf.util;
8
+
9
+ // Exported root namespace
10
+ var $root = $protobuf.roots["default"] || ($protobuf.roots["default"] = {});
11
+
12
+ $root.Ephemeral = (function() {
13
+
14
+ /**
15
+ * Namespace Ephemeral.
16
+ * @exports Ephemeral
17
+ * @namespace
18
+ */
19
+ var Ephemeral = {};
20
+
21
+ Ephemeral.EphemeralSetting = (function() {
22
+
23
+ /**
24
+ * Properties of an EphemeralSetting.
25
+ * @memberof Ephemeral
26
+ * @interface IEphemeralSetting
27
+ * @property {number|null} [duration] EphemeralSetting duration
28
+ * @property {number|Long|null} [timestamp] EphemeralSetting timestamp
29
+ */
30
+
31
+ /**
32
+ * Constructs a new EphemeralSetting.
33
+ * @memberof Ephemeral
34
+ * @classdesc Represents an EphemeralSetting.
35
+ * @implements IEphemeralSetting
36
+ * @constructor
37
+ * @param {Ephemeral.IEphemeralSetting=} [properties] Properties to set
38
+ */
39
+ function EphemeralSetting(properties) {
40
+ if (properties)
41
+ for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
42
+ if (properties[keys[i]] != null)
43
+ this[keys[i]] = properties[keys[i]];
44
+ }
45
+
46
+ /**
47
+ * EphemeralSetting duration.
48
+ * @member {number|null|undefined} duration
49
+ * @memberof Ephemeral.EphemeralSetting
50
+ * @instance
51
+ */
52
+ EphemeralSetting.prototype.duration = null;
53
+
54
+ /**
55
+ * EphemeralSetting timestamp.
56
+ * @member {number|Long|null|undefined} timestamp
57
+ * @memberof Ephemeral.EphemeralSetting
58
+ * @instance
59
+ */
60
+ EphemeralSetting.prototype.timestamp = null;
61
+
62
+ // OneOf field names bound to virtual getters and setters
63
+ var $oneOfFields;
64
+
65
+ /**
66
+ * EphemeralSetting _duration.
67
+ * @member {"duration"|undefined} _duration
68
+ * @memberof Ephemeral.EphemeralSetting
69
+ * @instance
70
+ */
71
+ Object.defineProperty(EphemeralSetting.prototype, "_duration", {
72
+ get: $util.oneOfGetter($oneOfFields = ["duration"]),
73
+ set: $util.oneOfSetter($oneOfFields)
74
+ });
75
+
76
+ /**
77
+ * EphemeralSetting _timestamp.
78
+ * @member {"timestamp"|undefined} _timestamp
79
+ * @memberof Ephemeral.EphemeralSetting
80
+ * @instance
81
+ */
82
+ Object.defineProperty(EphemeralSetting.prototype, "_timestamp", {
83
+ get: $util.oneOfGetter($oneOfFields = ["timestamp"]),
84
+ set: $util.oneOfSetter($oneOfFields)
85
+ });
86
+
87
+ /**
88
+ * Creates a new EphemeralSetting instance using the specified properties.
89
+ * @function create
90
+ * @memberof Ephemeral.EphemeralSetting
91
+ * @static
92
+ * @param {Ephemeral.IEphemeralSetting=} [properties] Properties to set
93
+ * @returns {Ephemeral.EphemeralSetting} EphemeralSetting instance
94
+ */
95
+ EphemeralSetting.create = function create(properties) {
96
+ return new EphemeralSetting(properties);
97
+ };
98
+
99
+ /**
100
+ * Encodes the specified EphemeralSetting message. Does not implicitly {@link Ephemeral.EphemeralSetting.verify|verify} messages.
101
+ * @function encode
102
+ * @memberof Ephemeral.EphemeralSetting
103
+ * @static
104
+ * @param {Ephemeral.IEphemeralSetting} message EphemeralSetting message or plain object to encode
105
+ * @param {$protobuf.Writer} [writer] Writer to encode to
106
+ * @returns {$protobuf.Writer} Writer
107
+ */
108
+ EphemeralSetting.encode = function encode(message, writer) {
109
+ if (!writer)
110
+ writer = $Writer.create();
111
+ if (message.duration != null && Object.hasOwnProperty.call(message, "duration"))
112
+ writer.uint32(/* id 1, wireType 5 =*/13).sfixed32(message.duration);
113
+ if (message.timestamp != null && Object.hasOwnProperty.call(message, "timestamp"))
114
+ writer.uint32(/* id 2, wireType 1 =*/17).sfixed64(message.timestamp);
115
+ return writer;
116
+ };
117
+
118
+ /**
119
+ * Encodes the specified EphemeralSetting message, length delimited. Does not implicitly {@link Ephemeral.EphemeralSetting.verify|verify} messages.
120
+ * @function encodeDelimited
121
+ * @memberof Ephemeral.EphemeralSetting
122
+ * @static
123
+ * @param {Ephemeral.IEphemeralSetting} message EphemeralSetting message or plain object to encode
124
+ * @param {$protobuf.Writer} [writer] Writer to encode to
125
+ * @returns {$protobuf.Writer} Writer
126
+ */
127
+ EphemeralSetting.encodeDelimited = function encodeDelimited(message, writer) {
128
+ return this.encode(message, writer).ldelim();
129
+ };
130
+
131
+ /**
132
+ * Decodes an EphemeralSetting message from the specified reader or buffer.
133
+ * @function decode
134
+ * @memberof Ephemeral.EphemeralSetting
135
+ * @static
136
+ * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
137
+ * @param {number} [length] Message length if known beforehand
138
+ * @returns {Ephemeral.EphemeralSetting} EphemeralSetting
139
+ * @throws {Error} If the payload is not a reader or valid buffer
140
+ * @throws {$protobuf.util.ProtocolError} If required fields are missing
141
+ */
142
+ EphemeralSetting.decode = function decode(reader, length, error) {
143
+ if (!(reader instanceof $Reader))
144
+ reader = $Reader.create(reader);
145
+ var end = length === undefined ? reader.len : reader.pos + length, message = new $root.Ephemeral.EphemeralSetting();
146
+ while (reader.pos < end) {
147
+ var tag = reader.uint32();
148
+ if (tag === error)
149
+ break;
150
+ switch (tag >>> 3) {
151
+ case 1: {
152
+ message.duration = reader.sfixed32();
153
+ break;
154
+ }
155
+ case 2: {
156
+ message.timestamp = reader.sfixed64();
157
+ break;
158
+ }
159
+ default:
160
+ reader.skipType(tag & 7);
161
+ break;
162
+ }
163
+ }
164
+ return message;
165
+ };
166
+
167
+ /**
168
+ * Decodes an EphemeralSetting message from the specified reader or buffer, length delimited.
169
+ * @function decodeDelimited
170
+ * @memberof Ephemeral.EphemeralSetting
171
+ * @static
172
+ * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
173
+ * @returns {Ephemeral.EphemeralSetting} EphemeralSetting
174
+ * @throws {Error} If the payload is not a reader or valid buffer
175
+ * @throws {$protobuf.util.ProtocolError} If required fields are missing
176
+ */
177
+ EphemeralSetting.decodeDelimited = function decodeDelimited(reader) {
178
+ if (!(reader instanceof $Reader))
179
+ reader = new $Reader(reader);
180
+ return this.decode(reader, reader.uint32());
181
+ };
182
+
183
+ /**
184
+ * Verifies an EphemeralSetting message.
185
+ * @function verify
186
+ * @memberof Ephemeral.EphemeralSetting
187
+ * @static
188
+ * @param {Object.<string,*>} message Plain object to verify
189
+ * @returns {string|null} `null` if valid, otherwise the reason why it is not
190
+ */
191
+ EphemeralSetting.verify = function verify(message) {
192
+ if (typeof message !== "object" || message === null)
193
+ return "object expected";
194
+ var properties = {};
195
+ if (message.duration != null && message.hasOwnProperty("duration")) {
196
+ properties._duration = 1;
197
+ if (!$util.isInteger(message.duration))
198
+ return "duration: integer expected";
199
+ }
200
+ if (message.timestamp != null && message.hasOwnProperty("timestamp")) {
201
+ properties._timestamp = 1;
202
+ if (!$util.isInteger(message.timestamp) && !(message.timestamp && $util.isInteger(message.timestamp.low) && $util.isInteger(message.timestamp.high)))
203
+ return "timestamp: integer|Long expected";
204
+ }
205
+ return null;
206
+ };
207
+
208
+ /**
209
+ * Creates an EphemeralSetting message from a plain object. Also converts values to their respective internal types.
210
+ * @function fromObject
211
+ * @memberof Ephemeral.EphemeralSetting
212
+ * @static
213
+ * @param {Object.<string,*>} object Plain object
214
+ * @returns {Ephemeral.EphemeralSetting} EphemeralSetting
215
+ */
216
+ EphemeralSetting.fromObject = function fromObject(object) {
217
+ if (object instanceof $root.Ephemeral.EphemeralSetting)
218
+ return object;
219
+ var message = new $root.Ephemeral.EphemeralSetting();
220
+ if (object.duration != null)
221
+ message.duration = object.duration | 0;
222
+ if (object.timestamp != null)
223
+ if ($util.Long)
224
+ (message.timestamp = $util.Long.fromValue(object.timestamp)).unsigned = false;
225
+ else if (typeof object.timestamp === "string")
226
+ message.timestamp = parseInt(object.timestamp, 10);
227
+ else if (typeof object.timestamp === "number")
228
+ message.timestamp = object.timestamp;
229
+ else if (typeof object.timestamp === "object")
230
+ message.timestamp = new $util.LongBits(object.timestamp.low >>> 0, object.timestamp.high >>> 0).toNumber();
231
+ return message;
232
+ };
233
+
234
+ /**
235
+ * Creates a plain object from an EphemeralSetting message. Also converts values to other types if specified.
236
+ * @function toObject
237
+ * @memberof Ephemeral.EphemeralSetting
238
+ * @static
239
+ * @param {Ephemeral.EphemeralSetting} message EphemeralSetting
240
+ * @param {$protobuf.IConversionOptions} [options] Conversion options
241
+ * @returns {Object.<string,*>} Plain object
242
+ */
243
+ EphemeralSetting.toObject = function toObject(message, options) {
244
+ if (!options)
245
+ options = {};
246
+ var object = {};
247
+ if (message.duration != null && message.hasOwnProperty("duration")) {
248
+ object.duration = message.duration;
249
+ if (options.oneofs)
250
+ object._duration = "duration";
251
+ }
252
+ if (message.timestamp != null && message.hasOwnProperty("timestamp")) {
253
+ if (typeof message.timestamp === "number")
254
+ object.timestamp = options.longs === String ? String(message.timestamp) : message.timestamp;
255
+ else
256
+ object.timestamp = options.longs === String ? $util.Long.prototype.toString.call(message.timestamp) : options.longs === Number ? new $util.LongBits(message.timestamp.low >>> 0, message.timestamp.high >>> 0).toNumber() : message.timestamp;
257
+ if (options.oneofs)
258
+ object._timestamp = "timestamp";
259
+ }
260
+ return object;
261
+ };
262
+
263
+ /**
264
+ * Converts this EphemeralSetting to JSON.
265
+ * @function toJSON
266
+ * @memberof Ephemeral.EphemeralSetting
267
+ * @instance
268
+ * @returns {Object.<string,*>} JSON object
269
+ */
270
+ EphemeralSetting.prototype.toJSON = function toJSON() {
271
+ return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
272
+ };
273
+
274
+ /**
275
+ * Gets the default type url for EphemeralSetting
276
+ * @function getTypeUrl
277
+ * @memberof Ephemeral.EphemeralSetting
278
+ * @static
279
+ * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
280
+ * @returns {string} The default type url
281
+ */
282
+ EphemeralSetting.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
283
+ if (typeUrlPrefix === undefined) {
284
+ typeUrlPrefix = "type.googleapis.com";
285
+ }
286
+ return typeUrlPrefix + "/Ephemeral.EphemeralSetting";
287
+ };
288
+
289
+ return EphemeralSetting;
290
+ })();
291
+
292
+ return Ephemeral;
293
+ })();
294
+
295
+ module.exports = $root;
@@ -0,0 +1,7 @@
1
+ syntax = "proto3";
2
+ package Ephemeral;
3
+
4
+ message EphemeralSetting {
5
+ optional sfixed32 duration = 1;
6
+ optional sfixed64 timestamp = 2;
7
+ }
@@ -0,0 +1,7 @@
1
+ const proto = {
2
+ ...require('./AICommon/AICommon').AICommon,
3
+ ...require('./Ephemeral/Ephemeral').Ephemeral
4
+ }
5
+ module.exports = {
6
+ proto
7
+ }
@@ -0,0 +1,3 @@
1
+ {
2
+ "version": [2, 3000, 1027934701]
3
+ }
@@ -1,16 +1,42 @@
1
- // BAILEYS BY VYZEN MAU APA LU?
2
-
3
1
  "use strict";
4
2
  var __importDefault = (this && this.__importDefault) || function (mod) {
5
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
6
4
  };
7
5
  Object.defineProperty(exports, "__esModule", { value: true });
8
- exports.DEFAULT_CACHE_TTLS = exports.MIN_UPLOAD_INTERVAL = exports.UPLOAD_TIMEOUT = 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.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.UNAUTHORIZED_CODES = exports.version = void 0;
6
+ exports.DEFAULT_CACHE_TTLS =
7
+ exports.MIN_UPLOAD_INTERVAL =
8
+ exports.UPLOAD_TIMEOUT =
9
+ exports.INITIAL_PREKEY_COUNT =
10
+ exports.MIN_PREKEY_COUNT =
11
+ exports.MEDIA_KEYS =
12
+ exports.MEDIA_HKDF_KEY_MAPPING =
13
+ exports.MEDIA_PATH_MAP =
14
+ exports.DEFAULT_CONNECTION_CONFIG =
15
+ exports.PROCESSABLE_HISTORY_TYPES =
16
+ exports.WA_CERT_DETAILS =
17
+ exports.URL_REGEX =
18
+ exports.NOISE_WA_HEADER =
19
+ exports.KEY_BUNDLE_TYPE =
20
+ exports.DICT_VERSION =
21
+ exports.NOISE_MODE =
22
+ exports.WA_DEFAULT_EPHEMERAL =
23
+ exports.PHONE_CONNECTION_CB =
24
+ exports.DEF_TAG_PREFIX =
25
+ exports.DEF_CALLBACK_PREFIX =
26
+ exports.CALL_AUDIO_PREFIX =
27
+ exports.CALL_VIDEO_PREFIX =
28
+ exports.DEFAULT_ORIGIN =
29
+ exports.WA_ADV_HOSTED_DEVICE_SIG_PREFIX =
30
+ exports.WA_ADV_HOSTED_ACCOUNT_SIG_PREFIX =
31
+ exports.WA_ADV_DEVICE_SIG_PREFIX =
32
+ exports.WA_ADV_ACCOUNT_SIG_PREFIX =
33
+ exports.UNAUTHORIZED_CODES = void 0;
34
+ // Baileys Kazumarii
9
35
  const WAProto_1 = require("../../WAProto");
10
36
  const libsignal_1 = require("../Signal/libsignal");
11
- const browser_utils_1 = require("../Utils/browser-utils");
37
+ const Utils_1 = require("../Utils");
12
38
  const logger_1 = __importDefault(require("../Utils/logger"));
13
- exports.version = [2, 3000, 1027934701];
39
+ const version = [2, 3000, 1027934701];
14
40
  exports.UNAUTHORIZED_CODES = [401, 403, 419];
15
41
  exports.DEFAULT_ORIGIN = 'https://web.whatsapp.com';
16
42
  exports.CALL_VIDEO_PREFIX = 'https://call.whatsapp.com/video/';
@@ -29,26 +55,25 @@ exports.KEY_BUNDLE_TYPE = Buffer.from([5]);
29
55
  exports.NOISE_WA_HEADER = Buffer.from([87, 65, 6, exports.DICT_VERSION]);
30
56
  exports.URL_REGEX = /https:\/\/(?![^:@\/\s]+:[^:@\/\s]+@)[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}(:\d+)?(\/[^\s]*)?/g;
31
57
  exports.WA_CERT_DETAILS = {
32
- SERIAL: 0
58
+ SERIAL: 0,
33
59
  };
34
60
  exports.PROCESSABLE_HISTORY_TYPES = [
35
- WAProto_1.proto.HistorySync.HistorySyncType.INITIAL_BOOTSTRAP,
36
- WAProto_1.proto.HistorySync.HistorySyncType.PUSH_NAME,
37
- WAProto_1.proto.HistorySync.HistorySyncType.RECENT,
38
- WAProto_1.proto.HistorySync.HistorySyncType.FULL,
39
- WAProto_1.proto.HistorySync.HistorySyncType.ON_DEMAND,
40
- WAProto_1.proto.HistorySync.HistorySyncType.NON_BLOCKING_DATA,
41
- WAProto_1.proto.HistorySync.HistorySyncType.INITIAL_STATUS_V3,
61
+ WAProto_1.proto.Message.HistorySyncNotification.HistorySyncType.INITIAL_BOOTSTRAP,
62
+ WAProto_1.proto.Message.HistorySyncNotification.HistorySyncType.PUSH_NAME,
63
+ WAProto_1.proto.Message.HistorySyncNotification.HistorySyncType.RECENT,
64
+ WAProto_1.proto.Message.HistorySyncNotification.HistorySyncType.FULL,
65
+ WAProto_1.proto.Message.HistorySyncNotification.HistorySyncType.ON_DEMAND,
42
66
  ];
43
67
  exports.DEFAULT_CONNECTION_CONFIG = {
44
- version: exports.version,
45
- browser: (0, browser_utils_1.Browsers)('Chrome'),
68
+ version: version,
69
+ browser: Utils_1.Browsers.ubuntu('Chrome'),
46
70
  waWebSocketUrl: 'wss://web.whatsapp.com/ws/chat',
47
- connectTimeoutMs: 20_000,
48
- keepAliveIntervalMs: 30_000,
71
+ connectTimeoutMs: 20000,
72
+ keepAliveIntervalMs: 30000,
49
73
  logger: logger_1.default.child({ class: 'baileys' }),
74
+ printQRInTerminal: false,
50
75
  emitOwnEvents: true,
51
- defaultQueryTimeoutMs: 60_000,
76
+ defaultQueryTimeoutMs: 60000,
52
77
  customUploadHosts: [],
53
78
  retryRequestDelayMs: 250,
54
79
  maxMsgRetryCount: 5,
@@ -67,7 +92,7 @@ exports.DEFAULT_CONNECTION_CONFIG = {
67
92
  options: {},
68
93
  appStateMacVerification: {
69
94
  patch: false,
70
- snapshot: false
95
+ snapshot: false,
71
96
  },
72
97
  countryCode: 'US',
73
98
  getMessage: async () => undefined,
@@ -87,15 +112,15 @@ exports.MEDIA_PATH_MAP = {
87
112
  'biz-cover-photo': '/pps/biz-cover-photo'
88
113
  };
89
114
  exports.MEDIA_HKDF_KEY_MAPPING = {
90
- audio: 'Audio',
91
- document: 'Document',
92
- gif: 'Video',
93
- image: 'Image',
94
- ppic: '',
95
- product: 'Image',
96
- ptt: 'Audio',
97
- sticker: 'Image',
98
- video: 'Video',
115
+ 'audio': 'Audio',
116
+ 'document': 'Document',
117
+ 'gif': 'Video',
118
+ 'image': 'Image',
119
+ 'ppic': '',
120
+ 'product': 'Image',
121
+ 'ptt': 'Audio',
122
+ 'sticker': 'Image',
123
+ 'video': 'Video',
99
124
  'thumbnail-document': 'Document Thumbnail',
100
125
  'thumbnail-image': 'Image Thumbnail',
101
126
  'thumbnail-video': 'Video Thumbnail',
@@ -104,7 +129,7 @@ exports.MEDIA_HKDF_KEY_MAPPING = {
104
129
  'md-app-state': 'App State',
105
130
  'product-catalog-image': '',
106
131
  'payment-bg-image': 'Payment Background',
107
- ptv: 'Video',
132
+ 'ptv': 'Video',
108
133
  'biz-cover-photo': 'Image'
109
134
  };
110
135
  exports.MEDIA_KEYS = Object.keys(exports.MEDIA_PATH_MAP);
@@ -116,5 +141,5 @@ exports.DEFAULT_CACHE_TTLS = {
116
141
  SIGNAL_STORE: 5 * 60,
117
142
  MSG_RETRY: 60 * 60,
118
143
  CALL_OFFER: 5 * 60,
119
- USER_DEVICES: 5 * 60
120
- };
144
+ USER_DEVICES: 5 * 60,
145
+ };
@@ -1,5 +1,3 @@
1
- // BAILEYS BY VYZEN MAU APA LU?
2
-
3
1
  "use strict";
4
2
  var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
5
3
  if (k2 === undefined) k2 = k;