@yemo-dev/yebail 1.1.0 → 1.1.2
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/index.js
CHANGED
|
@@ -9,7 +9,7 @@ const WAProto_1 = require("../../WAProto");
|
|
|
9
9
|
const libsignal_1 = require("../Signal/libsignal");
|
|
10
10
|
const browser_utils_1 = require("../Utils/browser-utils");
|
|
11
11
|
const logger_1 = __importDefault(require("../Utils/logger"));
|
|
12
|
-
exports.version = [2, 3000,
|
|
12
|
+
exports.version = [2, 3000, 1036173230];
|
|
13
13
|
exports.PHONENUMBER_MCC = require("./phonenumber-mcc.json");
|
|
14
14
|
const getMccForCountryIso2 = (iso3166Alpha2) => {
|
|
15
15
|
const alpha = (iso3166Alpha2 || 'US').toString().toUpperCase();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":[2,3000,
|
|
1
|
+
{"version":[2,3000,1036173230]}
|
|
@@ -378,9 +378,12 @@ const makeMessagesRecvSocket = (config) => {
|
|
|
378
378
|
msg.messageStubType = Types_1.WAMessageStubType.GROUP_MEMBERSHIP_JOIN_APPROVAL_REQUEST_NON_ADMIN_ADD;
|
|
379
379
|
msg.messageStubParameters = [participantJid, isDenied ? 'revoked' : 'rejected'];
|
|
380
380
|
break;
|
|
381
|
-
break;
|
|
382
381
|
default:
|
|
383
|
-
|
|
382
|
+
const participant = (0, WABinary_1.assertJid)((_h = child.attrs.participant) !== null && _h !== void 0 ? _h : child.attrs.from);
|
|
383
|
+
// console.log("YEBAIL-DEBUG:", JSON.stringify({ ...child, content: Buffer.isBuffer(child.content) ? child.content.toString() : child.content, participant }, null, 2))
|
|
384
|
+
return {
|
|
385
|
+
stanzaId: child.attrs.id
|
|
386
|
+
};
|
|
384
387
|
}
|
|
385
388
|
};
|
|
386
389
|
const handleNewsletterNotification = (id, node) => {
|
package/lib/Utils/generics.js
CHANGED
|
@@ -293,7 +293,7 @@ const fetchLatestBaileysVersion = async (options = {}) => {
|
|
|
293
293
|
};
|
|
294
294
|
} catch (error) {
|
|
295
295
|
return {
|
|
296
|
-
version:
|
|
296
|
+
version: yebail_version_json_1.version,
|
|
297
297
|
isLatest: false,
|
|
298
298
|
error
|
|
299
299
|
};
|
|
@@ -308,18 +308,18 @@ const fetchLatestWaWebVersion = async (options) => {
|
|
|
308
308
|
...options,
|
|
309
309
|
responseType: 'text'
|
|
310
310
|
});
|
|
311
|
-
const regex = /
|
|
311
|
+
const regex = /client_revision[^\d]+(\d+)|__spin_r[^\d]+(\d+)/;
|
|
312
312
|
const match = data.match(regex);
|
|
313
|
-
if (!(match === null || match === void 0 ? void 0 : match[1])) {
|
|
313
|
+
if (!(match === null || match === void 0 ? void 0 : (match[1] || match[2]))) {
|
|
314
314
|
return {
|
|
315
|
-
version:
|
|
315
|
+
version: yebail_version_json_1.version,
|
|
316
316
|
isLatest: false,
|
|
317
317
|
error: {
|
|
318
318
|
message: 'Could not find client revision in the fetched content'
|
|
319
319
|
}
|
|
320
320
|
};
|
|
321
321
|
}
|
|
322
|
-
const clientRevision = match[1];
|
|
322
|
+
const clientRevision = match[1] || match[2];
|
|
323
323
|
return {
|
|
324
324
|
version: [2, 3000, +clientRevision],
|
|
325
325
|
isLatest: true
|
|
@@ -327,7 +327,7 @@ const fetchLatestWaWebVersion = async (options) => {
|
|
|
327
327
|
}
|
|
328
328
|
catch (error) {
|
|
329
329
|
return {
|
|
330
|
-
version:
|
|
330
|
+
version: yebail_version_json_1.version,
|
|
331
331
|
isLatest: false,
|
|
332
332
|
error
|
|
333
333
|
};
|
package/lib/Utils/index.js
CHANGED
|
@@ -26,7 +26,7 @@ __exportStar(require("./history"), exports);
|
|
|
26
26
|
__exportStar(require("./chat-utils"), exports);
|
|
27
27
|
__exportStar(require("./lt-hash"), exports);
|
|
28
28
|
__exportStar(require("./auth-utils"), exports);
|
|
29
|
-
__exportStar(require("./
|
|
29
|
+
__exportStar(require("./yebail-event-stream"), exports);
|
|
30
30
|
__exportStar(require("./use-multi-file-auth-state"), exports);
|
|
31
31
|
__exportStar(require("./use-custom-auth-state"), exports);
|
|
32
32
|
__exportStar(require("./use-sqlite-auth-state"), exports);
|
|
@@ -16,13 +16,13 @@ const useSqliteAuthState = async (databaseFilePath) => {
|
|
|
16
16
|
}
|
|
17
17
|
const db = new Database(databaseFilePath);
|
|
18
18
|
db.exec(`
|
|
19
|
-
CREATE TABLE IF NOT EXISTS
|
|
19
|
+
CREATE TABLE IF NOT EXISTS yebail_auth_kv (
|
|
20
20
|
k TEXT PRIMARY KEY NOT NULL,
|
|
21
21
|
v TEXT NOT NULL
|
|
22
22
|
)`);
|
|
23
|
-
const sel = db.prepare('SELECT v FROM
|
|
24
|
-
const upsert = db.prepare('INSERT OR REPLACE INTO
|
|
25
|
-
const del = db.prepare('DELETE FROM
|
|
23
|
+
const sel = db.prepare('SELECT v FROM yebail_auth_kv WHERE k = ?');
|
|
24
|
+
const upsert = db.prepare('INSERT OR REPLACE INTO yebail_auth_kv (k, v) VALUES (?, ?)');
|
|
25
|
+
const del = db.prepare('DELETE FROM yebail_auth_kv WHERE k = ?');
|
|
26
26
|
return (0, use_custom_auth_state_1.useCustomAuthState)({
|
|
27
27
|
get: async (key) => {
|
|
28
28
|
const row = sel.get(key);
|