jagproject 13.9.19 → 14.0.0
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 +3 -1
- package/lib/Defaults/update-wa-version.js +56 -0
- package/lib/index.js +6 -8
- package/package.json +2 -1
package/lib/Defaults/index.js
CHANGED
|
@@ -8,7 +8,9 @@ const WAProto_1 = require("../../WAProto");
|
|
|
8
8
|
const libsignal_1 = require("../Signal/libsignal");
|
|
9
9
|
const browser_utils_1 = require("../Utils/browser-utils");
|
|
10
10
|
const logger_1 = __importDefault(require("../Utils/logger"));
|
|
11
|
-
exports.version = [2, 3000, 1032562324];
|
|
11
|
+
//exports.version = [2, 3000, 1032562324];
|
|
12
|
+
const waVer = require("./wileys-version.json");
|
|
13
|
+
exports.version = waVer?.version || [2, 3000, 1032562324];
|
|
12
14
|
exports.UNAUTHORIZED_CODES = [401, 403, 419];
|
|
13
15
|
exports.DEFAULT_ORIGIN = 'https://web.whatsapp.com';
|
|
14
16
|
exports.CALL_VIDEO_PREFIX = 'https://call.whatsapp.com/video/';
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
const fs = require("fs");
|
|
4
|
+
const path = require("path");
|
|
5
|
+
const axios = require("axios");
|
|
6
|
+
|
|
7
|
+
const URL = "https://wppconnect.io/whatsapp-versions/";
|
|
8
|
+
const OUT_FILE = path.join(__dirname, "wileys-version.json");
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
function parseCurrentVersion(html) {
|
|
12
|
+
// cari "Current Version" lalu ambil versi setelahnya (format: 2.3000.1032562324-alpha)
|
|
13
|
+
const m = html.match(/Current Version[\s\S]{0,800}?\b(\d+\.\d+\.\d+(?:-[a-zA-Z0-9]+)?)\b/);
|
|
14
|
+
if (!m) return null;
|
|
15
|
+
|
|
16
|
+
const full = m[1]; // "2.3000.1032562324-alpha"
|
|
17
|
+
const numeric = full.split("-")[0]; // "2.3000.1032562324"
|
|
18
|
+
|
|
19
|
+
const parts = numeric.split(".").map((x) => Number(x));
|
|
20
|
+
if (parts.length !== 3 || parts.some((n) => !Number.isFinite(n))) return null;
|
|
21
|
+
|
|
22
|
+
return { full, parts };
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
async function main() {
|
|
26
|
+
try {
|
|
27
|
+
const res = await axios.get(URL, {
|
|
28
|
+
timeout: 15000,
|
|
29
|
+
headers: {
|
|
30
|
+
// biar gak gampang diblok
|
|
31
|
+
"User-Agent": "Mozilla/5.0 (Node.js) wileyss-wa-version-updater",
|
|
32
|
+
"Accept": "text/html,application/xhtml+xml",
|
|
33
|
+
},
|
|
34
|
+
});
|
|
35
|
+
|
|
36
|
+
const parsed = parseCurrentVersion(res.data);
|
|
37
|
+
if (!parsed) throw new Error("Gagal parse Current Version dari halaman.");
|
|
38
|
+
|
|
39
|
+
const payload = {
|
|
40
|
+
version: parsed.parts,
|
|
41
|
+
source: URL,
|
|
42
|
+
fetchedAt: new Date().toISOString(),
|
|
43
|
+
raw: parsed.full,
|
|
44
|
+
};
|
|
45
|
+
|
|
46
|
+
fs.writeFileSync(OUT_FILE, JSON.stringify(payload, null, 2), "utf8");
|
|
47
|
+
console.log("[wileyss] WA Web version updated:", parsed.full, "=>", parsed.parts);
|
|
48
|
+
} catch (err) {
|
|
49
|
+
console.log("[wileyss] Skip update WA Web version (offline / gagal fetch).");
|
|
50
|
+
console.log("[wileyss] Reason:", err?.message || err);
|
|
51
|
+
// jangan bikin install gagal
|
|
52
|
+
process.exit(0);
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
main();
|
package/lib/index.js
CHANGED
|
@@ -26,7 +26,7 @@ function padLine(text = "") {
|
|
|
26
26
|
// Potong teks kalau kepanjangan
|
|
27
27
|
const clean = text.length > boxInnerWidth - 2 ? text.slice(0, boxInnerWidth - 5) + "..." : text;
|
|
28
28
|
const spaces = " ".repeat(Math.max(0, boxInnerWidth - 2 - clean.length));
|
|
29
|
-
|
|
29
|
+
return `│ ${clean}${spaces}`;
|
|
30
30
|
}
|
|
31
31
|
|
|
32
32
|
function centerLine(text = "") {
|
|
@@ -34,7 +34,7 @@ function centerLine(text = "") {
|
|
|
34
34
|
const totalSpace = Math.max(0, boxInnerWidth - 2 - clean.length);
|
|
35
35
|
const left = Math.floor(totalSpace / 2);
|
|
36
36
|
const right = totalSpace - left;
|
|
37
|
-
|
|
37
|
+
return `│ ${" ".repeat(left)}${clean}${" ".repeat(right)}`;
|
|
38
38
|
}
|
|
39
39
|
|
|
40
40
|
function box(lines, colorFn = (x) => x) {
|
|
@@ -47,12 +47,12 @@ function box(lines, colorFn = (x) => x) {
|
|
|
47
47
|
|
|
48
48
|
function printBanner() {
|
|
49
49
|
// Header gradient
|
|
50
|
-
const title = `⚡
|
|
50
|
+
const title = `⚡ ${name.toUpperCase()} — Baileys Jagoan Project ⚡`;
|
|
51
51
|
const subtitle = "WhatsApp Web API Library (Multi-Device)";
|
|
52
52
|
|
|
53
53
|
console.log();
|
|
54
54
|
console.log(gradient.pastel.multiline(hr("═")));
|
|
55
|
-
|
|
55
|
+
console.log(chalk.redBright.bold(title));
|
|
56
56
|
console.log(chalk.gray(subtitle));
|
|
57
57
|
console.log(gradient.pastel.multiline(hr("═")));
|
|
58
58
|
console.log();
|
|
@@ -63,13 +63,11 @@ function printBanner() {
|
|
|
63
63
|
padLine(""),
|
|
64
64
|
padLine(`${chalk.greenBright("Version")} : ${chalk.whiteBright(version)}`),
|
|
65
65
|
padLine(`${chalk.cyanBright("Update")} : ${chalk.whiteBright(updateDate)}`),
|
|
66
|
-
padLine(""),
|
|
67
|
-
padLine(`${chalk.yellowBright("Status")} : ${chalk.whiteBright(STATUS)}`),
|
|
68
|
-
padLine(""),
|
|
66
|
+
padLine(`${chalk.yellowBright("Iklan")} : ${chalk.whiteBright(STATUS)}`),
|
|
69
67
|
padLine(`${chalk.magentaBright("Youtube")} : ${chalk.whiteBright(YOUTUBE)}`),
|
|
70
68
|
padLine(`${chalk.blueBright("Kontak")} : ${chalk.whiteBright(CONTACT)}`),
|
|
71
69
|
padLine(""),
|
|
72
|
-
padLine(chalk.gray("Tip:
|
|
70
|
+
padLine(chalk.gray("Tip: di bailyes ini jika kamu pakai canvas disarankan pakai Node >= 20.")),
|
|
73
71
|
];
|
|
74
72
|
|
|
75
73
|
box(infoLines, (s) => chalk.white(s));
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "jagproject",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "14.0.0",
|
|
4
4
|
"update": "28 Januari 2026",
|
|
5
5
|
"description": "WhatsApp Web API Library",
|
|
6
6
|
"keywords": [
|
|
@@ -40,6 +40,7 @@
|
|
|
40
40
|
"prepack": "echo 'jagoan WhatsApp Library'",
|
|
41
41
|
"prepare": "echo 'jagoan WhatsApp Library'",
|
|
42
42
|
"preinstall": "node ./engine-requirements.js",
|
|
43
|
+
"postinstall": "node ./lib/Defaults/update-wa-version.js",
|
|
43
44
|
"release": "release-it",
|
|
44
45
|
"test": "jest"
|
|
45
46
|
},
|