@crysnovax/baileys 2.5.2 → 2.5.6

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.
@@ -1348,94 +1348,11 @@ export const PYTHON_KEYWORDS = new Set([
1348
1348
  'self', 'print'
1349
1349
  ]);
1350
1350
  export const RUST_KEYWORDS = new Set([
1351
- 'as', 'break', 'const', 'continue', 'crate', 'else', 'enum', 'extern',
1352
- 'false', 'fn', 'for', 'if', 'impl', 'in', 'let', 'loop', 'match',
1353
- 'mod', 'move', 'mut', 'pub', 'ref', 'return', 'self', 'Self',
1354
- 'static', 'struct', 'super', 'trait', 'true', 'type', 'unsafe',
1355
- 'use', 'where', 'while', 'async', 'await', 'dyn',
1356
- 'abstract', 'become', 'box', 'do', 'final', 'macro',
1357
- 'override', 'priv', 'typeof', 'unsized', 'virtual', 'yield',
1358
- 'try'
1359
- ]);
1360
- export const C_KEYWORDS = new Set([
1361
- 'auto', 'break', 'case', 'char', 'const', 'continue',
1362
- 'default', 'do', 'double', 'else', 'enum', 'extern',
1363
- 'float', 'for', 'goto', 'if', 'inline', 'int',
1364
- 'long', 'register', 'restrict', 'return', 'short',
1365
- 'signed', 'sizeof', 'static', 'struct', 'switch',
1366
- 'typedef', 'union', 'unsigned', 'void', 'volatile',
1367
- 'while',
1368
- '_Alignas', '_Alignof', '_Atomic', '_Bool',
1369
- '_Complex', '_Generic', '_Imaginary',
1370
- '_Noreturn', '_Static_assert', '_Thread_local'
1371
- ]);
1372
- export const CSHARP_KEYWORDS = new Set([
1373
- 'abstract', 'as', 'base', 'bool', 'break', 'byte',
1374
- 'case', 'catch', 'char', 'checked', 'class',
1375
- 'const', 'continue', 'decimal', 'default',
1376
- 'delegate', 'do', 'double', 'else', 'enum',
1377
- 'event', 'explicit', 'extern', 'false', 'finally',
1378
- 'fixed', 'float', 'for', 'foreach', 'goto',
1379
- 'if', 'implicit', 'in', 'int', 'interface',
1380
- 'internal', 'is', 'lock', 'long', 'namespace',
1381
- 'new', 'null', 'object', 'operator', 'out',
1382
- 'override', 'params', 'private', 'protected',
1383
- 'public', 'readonly', 'ref', 'return', 'sbyte',
1384
- 'sealed', 'short', 'sizeof', 'stackalloc',
1385
- 'static', 'string', 'struct', 'switch',
1386
- 'this', 'throw', 'true', 'try', 'typeof',
1387
- 'uint', 'ulong', 'unchecked', 'unsafe',
1388
- 'ushort', 'using', 'virtual', 'void',
1389
- 'volatile', 'while',
1390
- 'async', 'await', 'record', 'init',
1391
- 'required', 'file', 'global', 'nameof',
1392
- 'var', 'dynamic', 'partial', 'yield',
1393
- 'from', 'where', 'select', 'group',
1394
- 'orderby', 'join', 'let', 'into',
1395
- 'equals', 'by', 'ascending', 'descending'
1396
- ]);
1397
- export const BASH_KEYWORDS = new Set([
1398
- 'if', 'then', 'else', 'elif', 'fi',
1399
- 'case', 'esac', 'for', 'while',
1400
- 'until', 'do', 'done', 'in',
1401
- 'function', 'select', 'time',
1402
- 'coproc',
1403
- 'echo', 'printf', 'read', 'cd',
1404
- 'pwd', 'exit', 'export', 'unset',
1405
- 'alias', 'unalias', 'source',
1406
- 'exec', 'eval', 'test', 'shift',
1407
- 'trap', 'wait', 'jobs', 'kill',
1408
- 'bg', 'fg', 'history', 'type',
1409
- 'ulimit', 'umask', 'set',
1410
- 'true', 'false'
1411
- ]);
1412
- export const CMD_KEYWORDS = new Set([
1413
- 'echo', 'set', 'if', 'else',
1414
- 'for', 'in', 'do', 'goto',
1415
- 'call', 'exit', 'shift',
1416
- 'pause', 'start', 'title',
1417
- 'cls', 'rem',
1418
- 'dir', 'copy', 'move', 'del',
1419
- 'mkdir', 'rmdir', 'type',
1420
- 'ren', 'tasklist', 'taskkill',
1421
- 'ping', 'ipconfig', 'netstat',
1422
- 'shutdown'
1423
- ]);
1424
- export const POWERSHELL_KEYWORDS = new Set([
1425
- 'function', 'filter', 'param',
1426
- 'begin', 'process', 'end',
1427
- 'if', 'else', 'elseif',
1428
- 'switch', 'foreach', 'for',
1429
- 'while', 'do', 'until',
1430
- 'break', 'continue', 'return',
1431
- 'throw', 'trap', 'try',
1432
- 'catch', 'finally',
1433
- '$true', '$false', '$null',
1434
- 'Write-Host', 'Write-Output',
1435
- 'Get-Item', 'Set-Item',
1436
- 'Get-ChildItem', 'Remove-Item',
1437
- 'Copy-Item', 'Move-Item',
1438
- 'Test-Path', 'Invoke-Command'
1351
+ 'as', 'break', 'const', 'continue', 'crate', 'else', 'enum', 'extern', 'false', 'fn', 'for',
1352
+ 'if', 'impl', 'in', 'let', 'loop', 'match', 'mod', 'move', 'mut', 'pub', 'ref', 'return',
1353
+ 'self', 'Self', 'static', 'struct', 'super', 'trait', 'true', 'type', 'unsafe', 'use',
1354
+ 'where', 'while', 'async', 'await', 'dyn', 'abstract', 'become', 'box', 'do', 'final',
1355
+ 'macro', 'override', 'priv', 'typeof', 'unsized', 'virtual', 'yield'
1439
1356
  ]);
1440
1357
  export const LANGUAGE_KEYWORDS = {
1441
1358
  css: CSS_KEYWORDS,
@@ -1452,15 +1369,4 @@ export const LANGUAGE_KEYWORDS = {
1452
1369
  'c++': CPP_KEYWORDS,
1453
1370
  rust: RUST_KEYWORDS,
1454
1371
  rs: RUST_KEYWORDS,
1455
- c: C_KEYWORDS,
1456
- h: C_KEYWORDS,
1457
- csharp: CSHARP_KEYWORDS,
1458
- cs: CSHARP_KEYWORDS,
1459
- bash: BASH_KEYWORDS,
1460
- sh: BASH_KEYWORDS,
1461
- zsh: BASH_KEYWORDS,
1462
- cmd: CMD_KEYWORDS,
1463
- bat: CMD_KEYWORDS,
1464
- powershell: POWERSHELL_KEYWORDS,
1465
- ps1: POWERSHELL_KEYWORDS
1466
1372
  };
package/package.json CHANGED
@@ -1,9 +1,8 @@
1
1
  {
2
2
  "name": "@crysnovax/baileys",
3
- "version": "2.5.2",
4
- "description": "Premium Baileys fork — Meta compositing, bot planning replay, welcome flow, rich messages (code, table, LaTeX, reels), interactive messages, albums, and more.",
3
+ "version": "2.5.6",
4
+ "description": "Premium Baileys fork — Meta compositing, bot planning replay, welcome flow, rich messages (code, table, LaTeX, reels), interactive messages, albums, and more.",
5
5
  "main": "lib/index.js",
6
- "types": "lib/index.d.ts",
7
6
  "type": "module",
8
7
  "scripts": {
9
8
  "preinstall": "node ./engine-requirements.js"
@@ -41,8 +40,8 @@
41
40
  "whatsapp-group",
42
41
  "whatsapp-web"
43
42
  ],
44
- "homepage": "https://www.npmjs.com/package/@crysnovax/baileys/",
45
- "author": "crysnovax",
43
+ "homepage": "https://web.crysnovax.link",
44
+ "author": "crysnovax",
46
45
  "license": "MIT",
47
46
  "dependencies": {
48
47
  "@adiwajshing/keyed-db": "^0.2.4",
@@ -50,20 +49,19 @@
50
49
  "@hapi/boom": "^9.1.3",
51
50
  "async-mutex": "^0.5.0",
52
51
  "fflate": "^0.8.2",
53
- "libsignal": "^6.0.0",
52
+ "libsignal": "github:WhiskeySockets/libsignal-wasm#master",
54
53
  "lru-cache": "^11.2.6",
55
- "music-metadata": "^11.12.3",
54
+ "music-metadata": "^11.7.0",
56
55
  "p-queue": "^9.1.0",
57
56
  "pino": "^9.6.0",
58
- "protobufjs": "^7.5.6",
59
- "whatsapp-rust-bridge": "0.5.5",
57
+ "protobufjs": "^7.5.4",
58
+ "whatsapp-rust-bridge": "0.5.3",
60
59
  "ws": "^8.19.0"
61
60
  },
62
61
  "peerDependencies": {
63
62
  "@napi-rs/image": "~1.12.0",
64
63
  "audio-decode": "^2.2.3",
65
- "better-sqlite3": "^11.0.0",
66
- "jimp": "^1.6.1",
64
+ "jimp": "^1.6.0",
67
65
  "link-preview-js": "^3.0.0",
68
66
  "sharp": "*"
69
67
  },
@@ -74,9 +72,6 @@
74
72
  "audio-decode": {
75
73
  "optional": true
76
74
  },
77
- "better-sqlite3": {
78
- "optional": true
79
- },
80
75
  "jimp": {
81
76
  "optional": true
82
77
  },
@@ -84,34 +79,5 @@
84
79
  "optional": true
85
80
  }
86
81
  },
87
- "resolutions": {
88
- "ajv@npm:^6.12.4": "^6.14.0",
89
- "basic-ftp": "^5.2.4",
90
- "brace-expansion@npm:^1.1.7": "^1.1.13",
91
- "brace-expansion@npm:^2.0.1": "^2.0.3",
92
- "flatted": "^3.4.2",
93
- "glob@npm:^10.2.2": "^10.5.0",
94
- "glob@npm:^10.3.10": "^10.5.0",
95
- "glob@npm:^10.5.0": "^10.5.0",
96
- "handlebars": "^4.7.9",
97
- "ip-address": "^10.1.1",
98
- "js-yaml@npm:^3.13.1": "^3.14.2",
99
- "js-yaml@npm:^4.1.0": "^4.1.1",
100
- "markdown-it": "^14.1.1",
101
- "minimatch@npm:^3.0.4": "^3.1.5",
102
- "minimatch@npm:^3.1.2": "^3.1.5",
103
- "minimatch@npm:^5.0.1": "^5.1.8",
104
- "minimatch@npm:^9.0.4": "^9.0.9",
105
- "minimatch@npm:^9.0.5": "^9.0.9",
106
- "picomatch@npm:^2.0.4": "^2.3.2",
107
- "picomatch@npm:^2.3.1": "^2.3.2",
108
- "picomatch@npm:^4.0.0": "^4.0.4",
109
- "picomatch@npm:^4.0.2": "^4.0.4",
110
- "socks": "^2.8.8",
111
- "tar": "^7.5.11",
112
- "tmp": "^0.2.5",
113
- "underscore": "^1.13.8",
114
- "yaml@npm:^2.6.1": "^2.8.4"
115
- },
116
82
  "packageManager": "yarn@4.9.2"
117
83
  }
@@ -1 +0,0 @@
1
-
@@ -1 +0,0 @@
1
-
package/lib/Types/Mex.js DELETED
@@ -1,39 +0,0 @@
1
- export var XWAPaths;
2
- (function (XWAPaths) {
3
- XWAPaths["xwa2_newsletter_create"] = "xwa2_newsletter_create";
4
- XWAPaths["xwa2_newsletter_subscribers"] = "xwa2_newsletter_subscribers";
5
- XWAPaths["xwa2_newsletter_subscribed"] = "xwa2_newsletter_subscribed";
6
- XWAPaths["xwa2_newsletter_view"] = "xwa2_newsletter_view";
7
- XWAPaths["xwa2_newsletter_metadata"] = "xwa2_newsletter";
8
- XWAPaths["xwa2_newsletter_admin_count"] = "xwa2_newsletter_admin";
9
- XWAPaths["xwa2_newsletter_mute_v2"] = "xwa2_newsletter_mute_v2";
10
- XWAPaths["xwa2_newsletter_unmute_v2"] = "xwa2_newsletter_unmute_v2";
11
- XWAPaths["xwa2_newsletter_follow"] = "xwa2_newsletter_follow";
12
- XWAPaths["xwa2_newsletter_unfollow"] = "xwa2_newsletter_unfollow";
13
- XWAPaths["xwa2_newsletter_join_v2"] = "xwa2_newsletter_join_v2";
14
- XWAPaths["xwa2_newsletter_leave_v2"] = "xwa2_newsletter_leave_v2";
15
- XWAPaths["xwa2_newsletter_change_owner"] = "xwa2_newsletter_change_owner";
16
- XWAPaths["xwa2_newsletter_demote"] = "xwa2_newsletter_demote";
17
- XWAPaths["xwa2_newsletter_delete_v2"] = "xwa2_newsletter_delete_v2";
18
- XWAPaths["xwa2_fetch_account_reachout_timelock"] = "xwa2_fetch_account_reachout_timelock";
19
- XWAPaths["xwa2_message_capping_info"] = "xwa2_message_capping_info";
20
- })(XWAPaths || (XWAPaths = {}));
21
- export var QueryIds;
22
- (function (QueryIds) {
23
- QueryIds["CREATE"] = "8823471724422422";
24
- QueryIds["UPDATE_METADATA"] = "24250201037901610";
25
- QueryIds["METADATA"] = "6563316087068696";
26
- QueryIds["SUBSCRIBERS"] = "9783111038412085";
27
- QueryIds["SUBSCRIBED"] = "6388546374527196";
28
- QueryIds["FOLLOW"] = "24404358912487870";
29
- QueryIds["UNFOLLOW"] = "9767147403369991";
30
- QueryIds["MUTE"] = "29766401636284406";
31
- QueryIds["UNMUTE"] = "9864994326891137";
32
- QueryIds["ADMIN_COUNT"] = "7130823597031706";
33
- QueryIds["CHANGE_OWNER"] = "7341777602580933";
34
- QueryIds["DEMOTE"] = "6551828931592903";
35
- QueryIds["DELETE"] = "30062808666639665";
36
- QueryIds["REACHOUT_TIMELOCK"] = "23983697327930364";
37
- QueryIds["MESSAGE_CAPPING_INFO"] = "24503548349331633";
38
- })(QueryIds || (QueryIds = {}));
39
- //# sourceMappingURL=Mex.js.map
@@ -1 +0,0 @@
1
-
@@ -1,109 +0,0 @@
1
- import { mkdir, readFile, stat, unlink, writeFile } from 'fs/promises';
2
- import { join } from 'path';
3
- import { proto } from '../../WAProto/index.js';
4
- import { initAuthCreds } from './auth-utils.js';
5
- import { BufferJSON } from './generics.js';
6
- async function loadBetterSqlite3() {
7
- try {
8
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
9
- const mod = (await import('better-sqlite3'));
10
- return mod.default ?? mod;
11
- }
12
- catch (err) {
13
- const helpful = new Error('`better-sqlite3` is required for `useSqliteAuthState`. Install it as a peer dependency: `npm install better-sqlite3` (or `yarn add better-sqlite3`).');
14
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
15
- helpful.cause = err;
16
- throw helpful;
17
- }
18
- }
19
- const CREDS_ROW_KEY = '__creds__';
20
- const CREATE_SCHEMA_SQL = `
21
- CREATE TABLE IF NOT EXISTS creds (
22
- key TEXT PRIMARY KEY,
23
- value TEXT NOT NULL
24
- );
25
- CREATE TABLE IF NOT EXISTS signal_keys (
26
- type TEXT NOT NULL,
27
- id TEXT NOT NULL,
28
- value TEXT NOT NULL,
29
- PRIMARY KEY (type, id)
30
- );
31
- CREATE INDEX IF NOT EXISTS signal_keys_type_idx ON signal_keys(type);
32
- `;
33
- export async function useSqliteAuthState(opts) {
34
- let db;
35
- if (opts.database) {
36
- db = opts.database;
37
- }
38
- else {
39
- const Database = await loadBetterSqlite3();
40
- db = new Database(opts.dbPath);
41
- }
42
- // WAL mode allows concurrent reads alongside a single writer; matches
43
- // what SQLite recommends for read-heavy workloads with sporadic writes.
44
- db.pragma('journal_mode = WAL');
45
- db.pragma('synchronous = NORMAL');
46
- db.exec(CREATE_SCHEMA_SQL);
47
- const stmts = {
48
- credsSelect: db.prepare('SELECT value FROM creds WHERE key = ?'),
49
- credsUpsert: db.prepare('INSERT INTO creds (key, value) VALUES (?, ?) ON CONFLICT(key) DO UPDATE SET value = excluded.value'),
50
- keySelect: db.prepare('SELECT value FROM signal_keys WHERE type = ? AND id = ?'),
51
- keyUpsert: db.prepare('INSERT INTO signal_keys (type, id, value) VALUES (?, ?, ?) ON CONFLICT(type, id) DO UPDATE SET value = excluded.value'),
52
- keyDelete: db.prepare('DELETE FROM signal_keys WHERE type = ? AND id = ?'),
53
- keyListIds: db.prepare('SELECT id FROM signal_keys WHERE type = ?'),
54
- keyList: db.prepare('SELECT id, value FROM signal_keys WHERE type = ?'),
55
- clearKeys: db.prepare('DELETE FROM signal_keys')
56
- };
57
- const loadCreds = () => {
58
- const row = stmts.credsSelect.get(CREDS_ROW_KEY);
59
- if (!row)
60
- return initAuthCreds();
61
- return JSON.parse(row.value, BufferJSON.reviver);
62
- };
63
- const persistCreds = (creds) => {
64
- stmts.credsUpsert.run(CREDS_ROW_KEY, JSON.stringify(creds, BufferJSON.replacer));
65
- };
66
- const creds = loadCreds();
67
- return {
68
- state: {
69
- creds,
70
- keys: {
71
- get: async (type, ids) => {
72
- const data = {};
73
- for (const id of ids) {
74
- const row = stmts.keySelect.get(type, id);
75
- if (row) {
76
- let value = JSON.parse(row.value, BufferJSON.reviver);
77
- if (type === 'app-state-sync-key' && value) {
78
- value = proto.Message.AppStateSyncKeyData.fromObject(value);
79
- }
80
- data[id] = value;
81
- }
82
- }
83
- return data;
84
- },
85
- set: async (data) => {
86
- const writeTx = db.transaction(() => {
87
- for (const category in data) {
88
- for (const id in data[category]) {
89
- const value = data[category][id];
90
- if (value) {
91
- const stringified = JSON.stringify(value, BufferJSON.replacer);
92
- stmts.keyUpsert.run(category, id, stringified);
93
- }
94
- else {
95
- stmts.keyDelete.run(category, id);
96
- }
97
- }
98
- }
99
- });
100
- writeTx();
101
- }
102
- }
103
- },
104
- saveCreds: async () => {
105
- persistCreds(creds);
106
- }
107
- };
108
- }
109
- //# sourceMappingURL=use-sqlite-auth-state.js.map
@@ -1 +0,0 @@
1
-
@@ -1 +0,0 @@
1
-