zalo-agent-cli 1.0.3 → 1.0.4

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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/src/index.js +7 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "zalo-agent-cli",
3
- "version": "1.0.3",
3
+ "version": "1.0.4",
4
4
  "description": "CLI tool for Zalo automation — multi-account, proxy support, bank transfers, QR payments",
5
5
  "type": "module",
6
6
  "bin": {
package/src/index.js CHANGED
@@ -5,8 +5,14 @@
5
5
  * Entry point: registers all command groups via Commander.js.
6
6
  */
7
7
 
8
+ import { readFileSync } from "node:fs";
9
+ import { fileURLToPath } from "node:url";
10
+ import { dirname, join } from "node:path";
8
11
  import { Command } from "commander";
9
12
  import { registerLoginCommands } from "./commands/login.js";
13
+
14
+ const __dirname = dirname(fileURLToPath(import.meta.url));
15
+ const pkg = JSON.parse(readFileSync(join(__dirname, "..", "package.json"), "utf8"));
10
16
  import { registerMsgCommands } from "./commands/msg.js";
11
17
  import { registerFriendCommands } from "./commands/friend.js";
12
18
  import { registerGroupCommands } from "./commands/group.js";
@@ -19,7 +25,7 @@ const program = new Command();
19
25
  program
20
26
  .name("zalo-agent")
21
27
  .description("CLI tool for Zalo automation — multi-account, proxy, bank transfers, QR payments")
22
- .version("1.0.0")
28
+ .version(pkg.version)
23
29
  .option("--json", "Output results as JSON (machine-readable)")
24
30
  .hook("preAction", async (thisCommand) => {
25
31
  // Suppress zca-js internal logs in JSON mode to keep stdout clean for piping