@ardennguyen/zalo-agent-cli 2.5.1 → 2.5.3

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 (35) hide show
  1. package/README.md +41 -33
  2. package/node_modules/zca-js/dist/apis.js +0 -8
  3. package/node_modules/zca-js/dist/cjs/apis.cjs +0 -8
  4. package/package.json +3 -3
  5. package/patches/zca-js+2.2.0.patch +4 -236
  6. package/src/commands/bank.js +126 -0
  7. package/src/commands/catalog.js +14 -0
  8. package/src/commands/conv.js +19 -0
  9. package/src/commands/friend.js +66 -21
  10. package/src/commands/group.js +38 -2
  11. package/src/commands/listen.js +51 -2
  12. package/src/commands/mcp.js +232 -2
  13. package/src/commands/msg.js +60 -0
  14. package/src/commands/profile.js +39 -0
  15. package/src/commands/sync.js +1 -68
  16. package/src/core/bank-accounts.js +52 -0
  17. package/src/core/daemon-channel.js +191 -2
  18. package/src/core/friend-requests.js +142 -0
  19. package/src/core/friend-search.js +41 -0
  20. package/src/core/group-admin.js +116 -0
  21. package/src/core/group-invite.js +53 -0
  22. package/src/core/sync.js +4 -235
  23. package/src/index.js +2 -0
  24. package/src/mcp/mcp-config.js +1 -0
  25. package/src/mcp/mcp-tools.js +302 -2
  26. package/src/utils/cli-args.js +84 -0
  27. package/src/utils/secrets.js +69 -0
  28. package/node_modules/zca-js/dist/apis/deleteSnapshotMobileMsg.js +0 -18
  29. package/node_modules/zca-js/dist/apis/getCrossDB.js +0 -18
  30. package/node_modules/zca-js/dist/apis/pullMobileMsg.js +0 -22
  31. package/node_modules/zca-js/dist/apis/requestSyncMessage.js +0 -18
  32. package/node_modules/zca-js/dist/cjs/apis/deleteSnapshotMobileMsg.cjs +0 -22
  33. package/node_modules/zca-js/dist/cjs/apis/getCrossDB.cjs +0 -22
  34. package/node_modules/zca-js/dist/cjs/apis/pullMobileMsg.cjs +0 -26
  35. package/node_modules/zca-js/dist/cjs/apis/requestSyncMessage.cjs +0 -22
package/README.md CHANGED
@@ -28,7 +28,7 @@ Xây dựng trên [zca-js](https://github.com/RFS-ADRENO/zca-js).
28
28
  > clawhub install zalo-agent # OpenClaw (từ ClawHub registry)
29
29
  > cp -r skill/ ~/.claude/skills/zalo-agent/ # Claude Code
30
30
  > ```
31
- > 16 nhóm lệnh · 190 lệnh · listen mode + webhook · 55+ ngân hàng VN · đa tài khoản + proxy
31
+ > 17 nhóm lệnh · 212 lệnh · listen mode + webhook · 55+ ngân hàng VN · đa tài khoản + proxy
32
32
  > Xem [skill/SKILL.md](skill/SKILL.md) · [Tham chiếu lệnh đầy đủ](skill/references/command-reference.md) · [Eval scenarios](skill/evals/)
33
33
 
34
34
  > [!NOTE]
@@ -41,7 +41,7 @@ Xây dựng trên [zca-js](https://github.com/RFS-ADRENO/zca-js).
41
41
  > zalo-agent oa listen -p 3000 # Webhook listener
42
42
  > ```
43
43
  > OAuth login · gửi tin nhắn · follower · tag · bài viết · cửa hàng · webhook listener · multi-OA · VPS support
44
- > Xem [docs/official-account.md](docs/official-account.md)
44
+ > Xem [docs/official-account.vi.md](docs/official-account.vi.md) · [English](docs/official-account.md)
45
45
 
46
46
  > [!TIP]
47
47
  > **MCP Server (AI Agent Integration)** — Model Context Protocol cho Claude Code và các MCP client:
@@ -49,12 +49,14 @@ Xây dựng trên [zca-js](https://github.com/RFS-ADRENO/zca-js).
49
49
  > zalo-agent mcp start # stdio (local Claude Code)
50
50
  > zalo-agent mcp start --account <ID> # Ghim tài khoản (chạy nhiều tài khoản live cùng lúc)
51
51
  > zalo-agent mcp start --http 3847 --auth your-secret # HTTP (VPS)
52
+ > zalo-agent mcp wait -c my-bot --timeout 55 --json # Zero-polling chờ tin nhắn mới qua CLI
53
+ > zalo-agent mcp mark-read <cursor> -c my-bot --json # Đánh dấu đã đọc tới cursor qua CLI
52
54
  > ```
53
- > 23 tools: `zalo_get_messages` · `zalo_send_message` · `zalo_list_threads` · `zalo_search_threads` · `zalo_mark_read` · `zalo_get_history` · `zalo_view_media` · `zalo_react` · `zalo_undo` · `zalo_get_group_members` · `zalo_list_conversations` · `zalo_coverage` · `zalo_sync` · `zalo_sync_status` · `zalo_search_messages` · `zalo_lookup_user` · `zalo_forward_message` · `zalo_delete_message` · `zalo_reminder` · `zalo_note` · `zalo_poll` · `zalo_wait_for_message` · `zalo_label`
55
+ > 25 tools: `zalo_get_messages` · `zalo_send_message` · `zalo_list_threads` · `zalo_search_threads` · `zalo_mark_read` · `zalo_get_history` · `zalo_view_media` · `zalo_react` · `zalo_undo` · `zalo_get_group_members` · `zalo_list_conversations` · `zalo_coverage` · `zalo_sync` · `zalo_sync_status` · `zalo_search_messages` · `zalo_lookup_user` · `zalo_forward_message` · `zalo_delete_message` · `zalo_reminder` · `zalo_note` · `zalo_poll` · `zalo_wait_for_message` · `zalo_label` · `zalo_friend` · `zalo_group`
54
56
 
55
- [Sync qua MCP](docs/mcp-sync.vi.md) · [Ghim đa tài khoản live](docs/account-pinning.vi.md).
57
+ [Sync qua MCP](docs/mcp-sync.vi.md) · [Ghim đa tài khoản live](docs/account-pinning.vi.md) · [Triển khai Production](docs/deployment.vi.md).
56
58
  > Auto-reconnect · thread filter · noise reduction · tự tải media · thông báo qua nhóm Zalo · chạy song song nhiều tài khoản (`--account <ID>`)
57
- > Xem [MCP Guide](skill/references/mcp-guide.md) · [INSTALLATION.md](INSTALLATION.md)
59
+ > Xem [MCP Guide](skill/references/mcp-guide.md) · [INSTALLATION.vi.md](INSTALLATION.vi.md)
58
60
 
59
61
  ---
60
62
 
@@ -66,7 +68,7 @@ Yêu cầu **Node.js 22+**.
66
68
  npm install -g @ardennguyen/zalo-agent-cli
67
69
  ```
68
70
 
69
- Muốn cài kèm MCP server dạng sandbox (khuyến nghị cho AI client) → xem [INSTALLATION.md](INSTALLATION.md).
71
+ Muốn cài kèm MCP server dạng sandbox (khuyến nghị cho AI client) → xem [INSTALLATION.vi.md](INSTALLATION.vi.md) ([English](INSTALLATION.md)).
70
72
 
71
73
  ## Bắt đầu nhanh
72
74
 
@@ -111,20 +113,21 @@ Tất cả lệnh hỗ trợ `--json`. Tài liệu đầy đủ: **[Wiki](https:
111
113
  | Nhóm lệnh | Số lệnh | Mô tả | Docs |
112
114
  |------------|:---:|--------|------|
113
115
  | *(top-level)* | 11 | `login`, `logout`, `status`, `whoami`, `update`, `sync`, `sync-mobile`, `sync-media`, `sync-reactions`, `sync-boards`, `sync-cloud` | [Đăng nhập & Đăng xuất](https://github.com/ardennguyen/zalo-agent-cli/wiki/%C4%90%C4%83ng-Nh%E1%BA%ADp-&-%C4%90%C4%83ng-Xu%E1%BA%A5t) |
114
- | `msg` | 20 | Gửi tin nhắn, hình, file, voice, video, sticker, link, thẻ chuyển khoản, QR, thu hồi, lịch sử | [Tin nhắn](https://github.com/ardennguyen/zalo-agent-cli/wiki/Tin-Nh%E1%BA%AFn) |
115
- | `friend` | 22 | Danh sách, tìm, thêm, xóa, chặn, biệt danh, gợi ý | [Bạn bè](https://github.com/ardennguyen/zalo-agent-cli/wiki/B%E1%BA%A1n-B%C3%A8) |
116
- | `group` | 33 | Tạo, đổi tên, thành viên, cài đặt, link, ghi chú, lời mời | [Nhóm & Cộng đồng](https://github.com/ardennguyen/zalo-agent-cli/wiki/Nh%C3%B3m) |
117
- | `conv` | 20 | Tắt thông báo, ghim, lưu trữ, ẩn hội thoại, tự xóa, xoá bộ nhớ đệm cục bộ (`forget`) | [Hội thoại](https://github.com/ardennguyen/zalo-agent-cli/wiki/H%E1%BB%99i-Tho%E1%BA%A1i) |
116
+ | `msg` | 24 | Gửi tin nhắn, hình, file, voice, video, sticker, link, thẻ chuyển khoản, QR, thu hồi, lịch sử | [Tin nhắn](https://github.com/ardennguyen/zalo-agent-cli/wiki/Tin-Nh%E1%BA%AFn) |
117
+ | `friend` | 26 | Danh sách, tìm, thêm, xóa, chặn, biệt danh, gợi ý | [Bạn bè](https://github.com/ardennguyen/zalo-agent-cli/wiki/B%E1%BA%A1n-B%C3%A8) |
118
+ | `group` | 35 | Tạo, đổi tên, thành viên, cài đặt, link, ghi chú, lời mời | [Nhóm & Cộng đồng](https://github.com/ardennguyen/zalo-agent-cli/wiki/Nh%C3%B3m) |
119
+ | `conv` | 21 | Tắt thông báo, ghim, lưu trữ, ẩn hội thoại, tự xóa, xoá bộ nhớ đệm cục bộ (`forget`) | [Hội thoại](https://github.com/ardennguyen/zalo-agent-cli/wiki/H%E1%BB%99i-Tho%E1%BA%A1i) |
118
120
  | `account` | 7 | Đa tài khoản & proxy, thiết bị đã liên kết, xóa tài khoản | [Tài khoản](https://github.com/ardennguyen/zalo-agent-cli/wiki/T%C3%A0i-Kho%E1%BA%A3n) |
119
- | `profile` | 11 | Xem/cập nhật hồ sơ, ảnh đại diện, quyền riêng tư | [Hồ sơ](https://github.com/ardennguyen/zalo-agent-cli/wiki/H%E1%BB%93-S%C6%A1) |
121
+ | `profile` | 14 | Xem/cập nhật hồ sơ, ảnh đại diện, quyền riêng tư | [Hồ sơ](https://github.com/ardennguyen/zalo-agent-cli/wiki/H%E1%BB%93-S%C6%A1) |
120
122
  | `poll` | 7 | Tạo, bỏ phiếu, đóng khảo sát | [Khảo sát](https://github.com/ardennguyen/zalo-agent-cli/wiki/Kh%E1%BA%A3o-S%C3%A1t) |
121
123
  | `reminder` | 6 | Tạo, sửa, xóa nhắc nhở | [Nhắc nhở](https://github.com/ardennguyen/zalo-agent-cli/wiki/Nh%E1%BA%AFc-Nh%E1%BB%9F) |
122
124
  | `auto-reply` | 4 | Quản lý trả lời tự động | [Trả lời tự động](https://github.com/ardennguyen/zalo-agent-cli/wiki/Tr%E1%BA%A3-L%E1%BB%9Di-T%E1%BB%B1-%C4%90%E1%BB%99ng) |
123
125
  | `quick-msg` | 4 | Tin nhắn nhanh đã lưu | [Tin nhắn nhanh](https://github.com/ardennguyen/zalo-agent-cli/wiki/Tin-Nh%E1%BA%AFn-Nhanh) |
124
126
  | `label` | 2 | Nhãn hội thoại | [Nhãn](https://github.com/ardennguyen/zalo-agent-cli/wiki/Nh%C3%A3n) |
125
- | `catalog` | 9 | zBusiness — danh mục sản phẩm | [zBusiness](https://github.com/ardennguyen/zalo-agent-cli/wiki/zBusiness) |
127
+ | `catalog` | 10 | zBusiness — danh mục sản phẩm | [zBusiness](https://github.com/ardennguyen/zalo-agent-cli/wiki/zBusiness) |
128
+ | `bank` | 5 | Tài khoản ngân hàng đã lưu, danh sách ngân hàng được hỗ trợ | [Ngân hàng](https://github.com/ardennguyen/zalo-agent-cli/wiki/Ng%C3%A2n-H%C3%A0ng) |
126
129
  | `listen` | 1 | Lắng nghe real-time, webhook, JSONL, ghi vào cache cục bộ | [Lắng nghe](https://github.com/ardennguyen/zalo-agent-cli/wiki/L%E1%BA%AFng-Nghe) |
127
- | `mcp` | 1 | MCP server (stdio/HTTP/HTTPS) — 23 tools cho AI agent | [MCP Server](https://github.com/ardennguyen/zalo-agent-cli/wiki/MCP-Server-(VN)) |
130
+ | `mcp` | 3 | MCP server (`start`, `wait`, `mark-read`) — 25 tools cho AI agent + zero-polling CLI | [MCP Server](https://github.com/ardennguyen/zalo-agent-cli/wiki/MCP-Server-(VN)) |
128
131
  | **`oa`** | **32** | **Zalo Official Account API v3.0 — OAuth, tin nhắn, follower, tag, bài viết, cửa hàng, webhook** | **[Official Account](https://github.com/ardennguyen/zalo-agent-cli/wiki/Official-Account-(VN))** |
129
132
 
130
133
  Xem thêm: [Đa tài khoản & Proxy](https://github.com/ardennguyen/zalo-agent-cli/wiki/%C4%90a-T%C3%A0i-Kho%E1%BA%A3n-&-Proxy) · [Cài đặt VPS](https://github.com/ardennguyen/zalo-agent-cli/wiki/C%C3%A0i-%C4%90%E1%BA%B7t-VPS) · [Thẻ chuyển khoản & QR](https://github.com/ardennguyen/zalo-agent-cli/wiki/Th%E1%BA%BB-Chuy%E1%BB%83n-Kho%E1%BA%A3n-&-QR) · [Bộ nhớ đệm & Đồng bộ](https://github.com/ardennguyen/zalo-agent-cli/wiki/B%E1%BB%99-Nh%E1%BB%9B-%C4%90%E1%BB%87m-&-%C4%90%E1%BB%93ng-B%E1%BB%99) · [Bảo mật](https://github.com/ardennguyen/zalo-agent-cli/wiki/B%E1%BA%A3o-M%E1%BA%ADt)
@@ -135,9 +138,9 @@ Xem thêm: [Đa tài khoản & Proxy](https://github.com/ardennguyen/zalo-agent-
135
138
 
136
139
  - Đăng nhập QR qua HTTP server tự động (browser + terminal), báo ngay khi bị **từ chối trên điện thoại** thay vì treo tới hết 60s
137
140
  - Đa tài khoản với proxy riêng biệt (1:1), device fingerprint riêng cho từng tài khoản; chạy **nhiều tài khoản live đồng thời** (mỗi tài khoản một tiến trình `mcp start` hoặc `listen` kèm `--account <ID>`, và truyền `--account <ID>` / `ZALO_ACCOUNT` trên mọi lệnh CLI mà không ghi đè `accounts.json`)
138
- - **190 lệnh** phủ hết tính năng Zalo cá nhân
141
+ - **212 lệnh** phủ hết tính năng Zalo cá nhân
139
142
  - **Zalo Official Account (OA) API v3.0** — OAuth login, gửi tin nhắn, follower, tag, bài viết, cửa hàng, webhook listener, multi-OA
140
- - **MCP server** (stdio + HTTP/HTTPS + OAuth 2.0) — 23 tools cho Claude Code, Gemini và các MCP client: đọc, chờ tin nhắn đến (`zalo_wait_for_message`), gửi (văn bản, link preview, danh thiếp, vào My Documents, đánh dấu Quan trọng/Khẩn cấp), tìm kiếm tin nhắn trong cache, tra cứu người dùng, gắn/gỡ nhãn hội thoại (`zalo_label`), thả cảm xúc, thu hồi, chuyển tiếp, xóa tin, nhắc hẹn, ghi chú/ghim tin, bình chọn, xem thành viên nhóm, liệt kê hội thoại gần đây và kiểm tra độ đầy đủ của cache
143
+ - **MCP server** (stdio + HTTP/HTTPS + OAuth 2.0) — 25 tools cho Claude Code, Gemini và các MCP client: đọc, chờ tin nhắn đến (`zalo_wait_for_message`), gửi (văn bản, link preview, danh thiếp, vào My Documents, đánh dấu Quan trọng/Khẩn cấp), tìm kiếm tin nhắn trong cache, tra cứu người dùng, gắn/gỡ nhãn hội thoại (`zalo_label`), xem bạn bè và xử lý lời mời kết bạn (`zalo_friend`), xem thông tin nhóm, tạo nhóm, thêm/xóa thành viên và rời nhóm (`zalo_group`), thả cảm xúc, thu hồi, chuyển tiếp, xóa tin, nhắc hẹn, ghi chú/ghim tin, bình chọn, xem thành viên nhóm, liệt kê hội thoại gần đây và kiểm tra độ đầy đủ của cache
141
144
  - **Bộ nhớ đệm cục bộ (SQLite)** — `listen` ghi mọi tin nhắn vào `zalo.db`, `msg history` đọc từ cache, `sync` (hoặc `sync-mobile`) khôi phục toàn bộ lịch sử từ điện thoại vào `zalo.db` (giải mã transfer-sync-v2; xác nhận một lần trên điện thoại), mặc định lấy **toàn bộ** lịch sử (không còn mốc chặn 2024-01-01); thêm `--days <n>` hoặc `--from <YYYY-MM-DD>` nếu chỉ cần một khoảng. Dọn dẹp: `sync-media --prune <days|all>` giải phóng dung lượng nhưng giữ nguyên nội dung tin nhắn, `--prune-orphans` nhắm vào hội thoại tài khoản không còn, và `conv forget` xoá hẳn bản sao cục bộ của một hội thoại — không cái nào gửi gì tới Zalo. Luồng đồng bộ chỉ mang **liên kết** media chứ không mang file, nên sau khi lưu tin nhắn, `sync-mobile` **tự động tải media về** (thêm `--messages-only` nếu chỉ muốn tin nhắn); `sync-media` chạy lại/tiếp tục bước tải này, không cần xác nhận trên điện thoại. Ghi chú, tin ghim, bình chọn và nhắc hẹn nằm ngoài luồng tin nhắn — dùng `sync-boards`
142
145
  - Tự động tải media (ảnh/audio/video) — một downloader duy nhất cho `listen`, `msg history`, `mcp start` và các lệnh sync, lưu vào `~/.zalo-agent-cli/accounts/<id>/media/<threadId>/` (hoặc tách riêng credentials, database `zalo.db`, media và OA sang các ổ đĩa/mount khác nhau qua `--credentials-dir`, `--data-dir`, `--media-dir`, `--oa-dir` / biến môi trường `ZALO_*_DIR` trong `~/.zalo-agent-cli/.env`; nếu dùng kèm `zalo-mcp`, chỉ nên giữ cấu hình PORT trong `zalo-mcp/.env` và đặt toàn bộ đường dẫn lưu trữ vào `<CONFIG_DIR>/.env`)
143
146
  - Thẻ chuyển khoản (55+ ngân hàng VN) & QR VietQR
@@ -151,8 +154,9 @@ Xem thêm: [Đa tài khoản & Proxy](https://github.com/ardennguyen/zalo-agent-
151
154
 
152
155
  | Tài liệu | Nội dung |
153
156
  |----------|----------|
154
- | [INSTALLATION.md](INSTALLATION.md) | Cài đặt `zalo-mcp` wrapper, cấu hình MCP client, thiết lập OA |
155
- | [docs/official-account.md](docs/official-account.md) | Tham chiếu đầy đủ lệnh OA (tiếng Việt) |
157
+ | [INSTALLATION.vi.md](INSTALLATION.vi.md) ([EN](INSTALLATION.md)) | Cài đặt `zalo-mcp` wrapper, cấu hình MCP client, thiết lập OA |
158
+ | [docs/official-account.vi.md](docs/official-account.vi.md) ([EN](docs/official-account.md)) | Tham chiếu đầy đủ lệnh OA (song ngữ VN / EN) |
159
+ | [docs/deployment.vi.md](docs/deployment.vi.md) ([EN](docs/deployment.md)) | Hướng dẫn triển khai production (một socket, nhiều bot, HTTPS, OAuth 2.0, systemd/Docker) |
156
160
  | [skill/SKILL.md](skill/SKILL.md) | Skill cho AI agent |
157
161
  | [skill/references/command-reference.md](skill/references/command-reference.md) | Tham chiếu lệnh đầy đủ (nguồn chuẩn) |
158
162
  | [skill/references/mcp-guide.md](skill/references/mcp-guide.md) | Hướng dẫn MCP server (tiếng Việt) |
@@ -193,7 +197,7 @@ CLI tool for Zalo automation — multi-account, proxy support, bank transfers, Q
193
197
  > clawhub install zalo-agent # OpenClaw (from ClawHub registry)
194
198
  > cp -r skill/ ~/.claude/skills/zalo-agent/ # Claude Code
195
199
  > ```
196
- > 16 command groups · 190 commands · listen mode + webhook · 55+ VN banks · multi-account + proxy
200
+ > 17 command groups · 212 commands · listen mode + webhook · 55+ VN banks · multi-account + proxy
197
201
  > See [skill/SKILL.md](skill/SKILL.md) · [Full command reference](skill/references/command-reference.md) · [Eval scenarios](skill/evals/)
198
202
 
199
203
  > [!NOTE]
@@ -206,7 +210,7 @@ CLI tool for Zalo automation — multi-account, proxy support, bank transfers, Q
206
210
  > zalo-agent oa listen -p 3000 # Webhook listener
207
211
  > ```
208
212
  > OAuth login · messaging · followers · tags · articles · store · webhook listener · multi-OA · VPS support
209
- > See [docs/official-account.md](docs/official-account.md)
213
+ > See [docs/official-account.md](docs/official-account.md) · [Tiếng Việt](docs/official-account.vi.md)
210
214
 
211
215
  > [!TIP]
212
216
  > **MCP Server (AI Agent Integration)** — Model Context Protocol support for Claude Code and MCP clients:
@@ -214,10 +218,12 @@ CLI tool for Zalo automation — multi-account, proxy support, bank transfers, Q
214
218
  > zalo-agent mcp start # stdio (local Claude Code)
215
219
  > zalo-agent mcp start --account <ID> # Pin account (run multiple live accounts at once)
216
220
  > zalo-agent mcp start --http 3847 --auth your-secret # HTTP (VPS)
221
+ > zalo-agent mcp wait -c my-bot --timeout 55 --json # Zero-polling wait for next message via CLI
222
+ > zalo-agent mcp mark-read <cursor> -c my-bot --json # Advance consumer read cursor via CLI
217
223
  > ```
218
- > 23 tools: `zalo_get_messages` · `zalo_send_message` · `zalo_list_threads` · `zalo_search_threads` · `zalo_mark_read` · `zalo_get_history` · `zalo_view_media` · `zalo_react` · `zalo_undo` · `zalo_get_group_members` · `zalo_list_conversations` · `zalo_coverage` · `zalo_sync` · `zalo_sync_status` · `zalo_search_messages` · `zalo_lookup_user` · `zalo_forward_message` · `zalo_delete_message` · `zalo_reminder` · `zalo_note` · `zalo_poll` · `zalo_wait_for_message` · `zalo_label`
224
+ > 25 tools: `zalo_get_messages` · `zalo_send_message` · `zalo_list_threads` · `zalo_search_threads` · `zalo_mark_read` · `zalo_get_history` · `zalo_view_media` · `zalo_react` · `zalo_undo` · `zalo_get_group_members` · `zalo_list_conversations` · `zalo_coverage` · `zalo_sync` · `zalo_sync_status` · `zalo_search_messages` · `zalo_lookup_user` · `zalo_forward_message` · `zalo_delete_message` · `zalo_reminder` · `zalo_note` · `zalo_poll` · `zalo_wait_for_message` · `zalo_label` · `zalo_friend` · `zalo_group`
219
225
 
220
- [MCP sync](docs/mcp-sync.md) · [Multi-account pinning](docs/account-pinning.md).
226
+ [MCP sync](docs/mcp-sync.md) · [Multi-account pinning](docs/account-pinning.md) · [Production deployment](docs/deployment.md).
221
227
  > Auto-reconnect · thread filter · noise reduction · media auto-download · Zalo-group notifications · concurrent multi-account (`--account <ID>`)
222
228
  > See [MCP Guide](skill/references/mcp-guide.md) · [INSTALLATION.md](INSTALLATION.md)
223
229
 
@@ -233,7 +239,7 @@ zalo-agent listen # 3. Listen for threadId
233
239
  zalo-agent msg send <THREAD_ID> "Hello!" # 4. Send a message
234
240
  ```
235
241
 
236
- For the sandboxed MCP-server install (recommended for AI clients), see [INSTALLATION.md](INSTALLATION.md).
242
+ For the sandboxed MCP-server install (recommended for AI clients), see [INSTALLATION.md](INSTALLATION.md) ([Tiếng Việt](INSTALLATION.vi.md)).
237
243
 
238
244
  ### Commands
239
245
 
@@ -242,20 +248,21 @@ Full docs: **[Wiki](https://github.com/ardennguyen/zalo-agent-cli/wiki)** · [Fu
242
248
  | Group | Commands | Description | Docs |
243
249
  |-------|:---:|-------------|------|
244
250
  | *(top-level)* | 11 | `login`, `logout`, `status`, `whoami`, `update`, `sync`, `sync-mobile`, `sync-media`, `sync-reactions`, `sync-boards`, `sync-cloud` | [Login & Logout](https://github.com/ardennguyen/zalo-agent-cli/wiki/Login-&-Logout) |
245
- | `msg` | 20 | Text, images, files, voice, video, stickers, links, bank cards, QR, recall, history | [Messages](https://github.com/ardennguyen/zalo-agent-cli/wiki/Messages) |
246
- | `friend` | 22 | List, find, add, remove, block, alias, recommendations | [Friends](https://github.com/ardennguyen/zalo-agent-cli/wiki/Friends) |
247
- | `group` | 33 | Create, rename, members, settings, links, notes, invites | [Groups](https://github.com/ardennguyen/zalo-agent-cli/wiki/Groups) |
248
- | `conv` | 20 | Mute, pin, archive, hidden, auto-delete, forget local cache | [Conversations](https://github.com/ardennguyen/zalo-agent-cli/wiki/Conversations) |
251
+ | `msg` | 24 | Text, images, files, voice, video, stickers, links, bank cards, QR, recall, history | [Messages](https://github.com/ardennguyen/zalo-agent-cli/wiki/Messages) |
252
+ | `friend` | 26 | List, find, add, remove, block, alias, recommendations | [Friends](https://github.com/ardennguyen/zalo-agent-cli/wiki/Friends) |
253
+ | `group` | 35 | Create, rename, members, settings, links, notes, invites | [Groups](https://github.com/ardennguyen/zalo-agent-cli/wiki/Groups) |
254
+ | `conv` | 21 | Mute, pin, archive, hidden, auto-delete, forget local cache | [Conversations](https://github.com/ardennguyen/zalo-agent-cli/wiki/Conversations) |
249
255
  | `account` | 7 | Multi-account & proxy, linked devices, account removal | [Accounts](https://github.com/ardennguyen/zalo-agent-cli/wiki/Accounts) |
250
- | `profile` | 11 | Profile, avatar gallery, privacy | [Profile](https://github.com/ardennguyen/zalo-agent-cli/wiki/Profile) |
256
+ | `profile` | 14 | Profile, avatar gallery, privacy | [Profile](https://github.com/ardennguyen/zalo-agent-cli/wiki/Profile) |
251
257
  | `poll` | 7 | Create, vote, lock polls | [Polls](https://github.com/ardennguyen/zalo-agent-cli/wiki/Polls) |
252
258
  | `reminder` | 6 | Create, edit, remove reminders | [Reminders](https://github.com/ardennguyen/zalo-agent-cli/wiki/Reminders) |
253
259
  | `auto-reply` | 4 | Auto-reply rules | [Auto-Reply](https://github.com/ardennguyen/zalo-agent-cli/wiki/Auto-Reply) |
254
260
  | `quick-msg` | 4 | Saved quick messages | [Quick Messages](https://github.com/ardennguyen/zalo-agent-cli/wiki/Quick-Messages) |
255
261
  | `label` | 2 | Conversation labels | [Labels](https://github.com/ardennguyen/zalo-agent-cli/wiki/Labels) |
256
- | `catalog` | 9 | zBusiness catalogs & products | [Catalog](https://github.com/ardennguyen/zalo-agent-cli/wiki/Catalog) |
262
+ | `catalog` | 10 | zBusiness catalogs & products | [Catalog](https://github.com/ardennguyen/zalo-agent-cli/wiki/Catalog) |
263
+ | `bank` | 5 | Saved bank accounts, supported banks | [Bank](https://github.com/ardennguyen/zalo-agent-cli/wiki/Bank) |
257
264
  | `listen` | 1 | Real-time listener, webhook, JSONL, local cache writes | [Listener](https://github.com/ardennguyen/zalo-agent-cli/wiki/Listener) |
258
- | `mcp` | 1 | MCP server (stdio/HTTP/HTTPS) — 23 tools for AI agents | [MCP Server](https://github.com/ardennguyen/zalo-agent-cli/wiki/MCP-Server) |
265
+ | `mcp` | 3 | MCP server (`start`, `wait`, `mark-read`) — 25 tools for AI agents + zero-polling CLI | [MCP Server](https://github.com/ardennguyen/zalo-agent-cli/wiki/MCP-Server) |
259
266
  | **`oa`** | **32** | **Zalo Official Account API v3.0 — OAuth, messaging, followers, tags, articles, store, webhook** | **[Official Account](https://github.com/ardennguyen/zalo-agent-cli/wiki/Official-Account)** |
260
267
 
261
268
  See also: [Multi-Account & Proxy](https://github.com/ardennguyen/zalo-agent-cli/wiki/Multi-Account-&-Proxy) · [VPS Setup](https://github.com/ardennguyen/zalo-agent-cli/wiki/VPS-Setup) · [Bank Card & QR Payments](https://github.com/ardennguyen/zalo-agent-cli/wiki/Bank-Card-&-QR-Payments) · [Local Cache & Sync](https://github.com/ardennguyen/zalo-agent-cli/wiki/Local-Cache-&-Sync) · [Security](https://github.com/ardennguyen/zalo-agent-cli/wiki/Security)
@@ -264,9 +271,9 @@ See also: [Multi-Account & Proxy](https://github.com/ardennguyen/zalo-agent-cli/
264
271
 
265
272
  - QR login over an auto-started HTTP server (browser + terminal), reporting a **decline on the phone** immediately instead of hanging until the 60s timeout
266
273
  - Multi-account with a dedicated proxy (1:1) and a per-account device fingerprint; run **multiple live accounts simultaneously** (one `mcp start` or `listen` process per account with `--account <ID>`, plus `--account <ID>` / `ZALO_ACCOUNT` on any CLI command without mutating `accounts.json`)
267
- - **190 commands** covering the personal-account Zalo surface
274
+ - **212 commands** covering the personal-account Zalo surface
268
275
  - **Zalo Official Account (OA) API v3.0** — OAuth login, messaging, followers, tags, articles, store, webhook listener, multi-OA
269
- - **MCP server** (stdio + HTTP/HTTPS + OAuth 2.0) — 23 tools for Claude Code, Gemini and other MCP clients: read, wait for incoming messages (`zalo_wait_for_message`), send (text, link previews, contact cards, to My Documents too, marked Important/Urgent), search cached messages, look up users, manage conversation labels (`zalo_label`), react, recall, forward, delete, reminders, group notes/pins, group polls, list a group's members, list recent conversations, and check how complete the cache is
276
+ - **MCP server** (stdio + HTTP/HTTPS + OAuth 2.0) — 25 tools for Claude Code, Gemini and other MCP clients: read, wait for incoming messages (`zalo_wait_for_message`), send (text, local file/image attachments, link previews, contact cards, to My Documents too, marked Important/Urgent), search cached messages, look up users, manage conversation labels (`zalo_label`), list friends and handle friend requests (`zalo_friend`), inspect, create and manage groups and leave them (`zalo_group`), react, recall, forward, delete, reminders, group notes/pins, group polls, list a group's members, list recent conversations, and check how complete the cache is
270
277
  - **Local SQLite cache** — `listen` writes every message to `zalo.db`, `msg history` reads from it, and `sync` (or `sync-mobile`) restores full history from the phone into `zalo.db` (transfer-sync-v2 decrypt; one confirmation on the phone), defaulting to **all** history (the old 2024-01-01 floor is gone), with `--days <n>` or `--from <YYYY-MM-DD>` to narrow it. Housekeeping: `sync-media --prune <days|all>` reclaims disk while keeping message text, `--prune-orphans` targets conversations the account no longer has, and `conv forget` removes a conversation's local copy entirely — none of which contact Zalo. The sync stream carries media **links**, not files, so a `sync-mobile` run **downloads its attachments automatically** once the messages are stored (`--messages-only` skips it); `sync-media` re-runs or resumes that fetch on its own, with no phone confirmation. Notes, pinned messages, polls and reminders live outside the message stream — `sync-boards` fetches those
271
278
  - Automatic media download — one downloader shared by `listen`, `msg history`, `mcp start` and the sync commands, saving to `~/.zalo-agent-cli/accounts/<id>/media/<threadId>/` (or separate credentials, `zalo.db`, media, and OA credentials onto independent volumes/mounts via `--credentials-dir`, `--data-dir`, `--media-dir`, `--oa-dir` / `ZALO_*_DIR` in `~/.zalo-agent-cli/.env`; when using `zalo-mcp`, keep `zalo-mcp/.env` for PORT settings only and place all storage/engine settings in `<CONFIG_DIR>/.env`)
272
279
  - Bank cards (55+ VN banks) and VietQR payment images
@@ -280,8 +287,9 @@ See also: [Multi-Account & Proxy](https://github.com/ardennguyen/zalo-agent-cli/
280
287
 
281
288
  | Document | Contents |
282
289
  |----------|----------|
283
- | [INSTALLATION.md](INSTALLATION.md) | `zalo-mcp` wrapper install, MCP client config, OA setup |
284
- | [docs/official-account.md](docs/official-account.md) | Full OA command reference (Vietnamese) |
290
+ | [INSTALLATION.md](INSTALLATION.md) ([VI](INSTALLATION.vi.md)) | `zalo-mcp` wrapper install, MCP client config, OA setup |
291
+ | [docs/official-account.md](docs/official-account.md) ([VI](docs/official-account.vi.md)) | Full OA command reference (bilingual EN / VN) |
292
+ | [docs/deployment.md](docs/deployment.md) ([VI](docs/deployment.vi.md)) | Production deployment guide (one socket, many bots, HTTPS, OAuth 2.0, systemd/Docker) |
285
293
  | [skill/SKILL.md](skill/SKILL.md) | AI agent skill |
286
294
  | [skill/references/command-reference.md](skill/references/command-reference.md) | Exhaustive command reference (source of truth) |
287
295
  | [skill/references/mcp-guide.md](skill/references/mcp-guide.md) | MCP server guide (Vietnamese) |
@@ -154,10 +154,6 @@ import { uploadAttachmentFactory } from "./apis/uploadAttachment.js";
154
154
  import { uploadProductPhotoFactory } from "./apis/uploadProductPhoto.js";
155
155
  import { votePollFactory } from "./apis/votePoll.js";
156
156
  import { customFactory } from "./apis/custom.js";
157
- import { requestSyncMessageFactory } from "./apis/requestSyncMessage.js";
158
- import { pullMobileMsgFactory } from "./apis/pullMobileMsg.js";
159
- import { getCrossDBFactory } from "./apis/getCrossDB.js";
160
- import { deleteSnapshotMobileMsgFactory } from "./apis/deleteSnapshotMobileMsg.js";
161
157
  import { logoutV2Factory } from "./apis/logoutV2.js";
162
158
  export class API {
163
159
  constructor(ctx, zpwServiceMap, wsUrls) {
@@ -318,10 +314,6 @@ export class API {
318
314
  this.uploadProductPhoto = uploadProductPhotoFactory(ctx, this);
319
315
  this.votePoll = votePollFactory(ctx, this);
320
316
  this.custom = customFactory(ctx, this);
321
- this.requestSyncMessage = requestSyncMessageFactory(ctx, this);
322
- this.pullMobileMsg = pullMobileMsgFactory(ctx, this);
323
- this.getCrossDB = getCrossDBFactory(ctx, this);
324
- this.deleteSnapshotMobileMsg = deleteSnapshotMobileMsgFactory(ctx, this);
325
317
  this.logoutV2 = logoutV2Factory(ctx, this);
326
318
  }
327
319
  }
@@ -156,10 +156,6 @@ var uploadAttachment = require('./apis/uploadAttachment.cjs');
156
156
  var uploadProductPhoto = require('./apis/uploadProductPhoto.cjs');
157
157
  var votePoll = require('./apis/votePoll.cjs');
158
158
  var custom = require('./apis/custom.cjs');
159
- var requestSyncMessage = require('./apis/requestSyncMessage.cjs');
160
- var pullMobileMsg = require('./apis/pullMobileMsg.cjs');
161
- var getCrossDB = require('./apis/getCrossDB.cjs');
162
- var deleteSnapshotMobileMsg = require('./apis/deleteSnapshotMobileMsg.cjs');
163
159
  var logoutV2 = require('./apis/logoutV2.cjs');
164
160
 
165
161
  class API {
@@ -321,10 +317,6 @@ class API {
321
317
  this.uploadProductPhoto = uploadProductPhoto.uploadProductPhotoFactory(ctx, this);
322
318
  this.votePoll = votePoll.votePollFactory(ctx, this);
323
319
  this.custom = custom.customFactory(ctx, this);
324
- this.requestSyncMessage = requestSyncMessage.requestSyncMessageFactory(ctx, this);
325
- this.pullMobileMsg = pullMobileMsg.pullMobileMsgFactory(ctx, this);
326
- this.getCrossDB = getCrossDB.getCrossDBFactory(ctx, this);
327
- this.deleteSnapshotMobileMsg = deleteSnapshotMobileMsg.deleteSnapshotMobileMsgFactory(ctx, this);
328
320
  this.logoutV2 = logoutV2.logoutV2Factory(ctx, this);
329
321
  }
330
322
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ardennguyen/zalo-agent-cli",
3
- "version": "2.5.1",
3
+ "version": "2.5.3",
4
4
  "description": "CLI tool for Zalo automation — multi-account, proxy, bank transfers, QR payments, Official Account API v3.0",
5
5
  "type": "module",
6
6
  "bin": {
@@ -55,7 +55,7 @@
55
55
  "node": ">=22"
56
56
  },
57
57
  "dependencies": {
58
- "@modelcontextprotocol/sdk": "^1.29.0",
58
+ "@modelcontextprotocol/sdk": "^1.32.1",
59
59
  "better-sqlite3": "^13.0.3",
60
60
  "chalk": "^5.6.2",
61
61
  "commander": "^15.0.0",
@@ -77,6 +77,6 @@
77
77
  },
78
78
  "allowScripts": {
79
79
  "better-sqlite3@13.0.3": true,
80
- "@ardennguyen/zalo-agent-cli@2.2.2": true
80
+ "@ardennguyen/zalo-agent-cli@2.5.3": true
81
81
  }
82
82
  }
@@ -2,53 +2,21 @@ diff --git a/node_modules/zca-js/dist/apis.js b/node_modules/zca-js/dist/apis.js
2
2
  index c8b38fb..ebcf8f9 100644
3
3
  --- a/node_modules/zca-js/dist/apis.js
4
4
  +++ b/node_modules/zca-js/dist/apis.js
5
- @@ -154,6 +154,11 @@ import { uploadAttachmentFactory } from "./apis/uploadAttachment.js";
5
+ @@ -154,6 +154,7 @@ import { uploadAttachmentFactory } from "./apis/uploadAttachment.js";
6
6
  import { uploadProductPhotoFactory } from "./apis/uploadProductPhoto.js";
7
7
  import { votePollFactory } from "./apis/votePoll.js";
8
8
  import { customFactory } from "./apis/custom.js";
9
- +import { requestSyncMessageFactory } from "./apis/requestSyncMessage.js";
10
- +import { pullMobileMsgFactory } from "./apis/pullMobileMsg.js";
11
- +import { getCrossDBFactory } from "./apis/getCrossDB.js";
12
- +import { deleteSnapshotMobileMsgFactory } from "./apis/deleteSnapshotMobileMsg.js";
13
9
  +import { logoutV2Factory } from "./apis/logoutV2.js";
14
10
  export class API {
15
11
  constructor(ctx, zpwServiceMap, wsUrls) {
16
12
  this.zpwServiceMap = zpwServiceMap;
17
- @@ -313,5 +318,10 @@ export class API {
13
+ @@ -313,5 +314,6 @@ export class API {
18
14
  this.uploadProductPhoto = uploadProductPhotoFactory(ctx, this);
19
15
  this.votePoll = votePollFactory(ctx, this);
20
16
  this.custom = customFactory(ctx, this);
21
- + this.requestSyncMessage = requestSyncMessageFactory(ctx, this);
22
- + this.pullMobileMsg = pullMobileMsgFactory(ctx, this);
23
- + this.getCrossDB = getCrossDBFactory(ctx, this);
24
- + this.deleteSnapshotMobileMsg = deleteSnapshotMobileMsgFactory(ctx, this);
25
17
  + this.logoutV2 = logoutV2Factory(ctx, this);
26
18
  }
27
19
  }
28
- diff --git a/node_modules/zca-js/dist/apis/deleteSnapshotMobileMsg.js b/node_modules/zca-js/dist/apis/deleteSnapshotMobileMsg.js
29
- new file mode 100644
30
- index 0000000..ec513e6
31
- --- /dev/null
32
- +++ b/node_modules/zca-js/dist/apis/deleteSnapshotMobileMsg.js
33
- @@ -0,0 +1,18 @@
34
- +import { ZaloApiError } from "../Errors/ZaloApiError.js";
35
- +import { apiFactory } from "../utils.js";
36
- +
37
- +export const deleteSnapshotMobileMsgFactory = apiFactory()((api, ctx, utils) => {
38
- + const serviceURL = utils.makeURL(`${api.zpwServiceMap.file[0]}/api/message/delete_snapshot_mobile_msg`);
39
- + return async function deleteSnapshotMobileMsg(publicKey) {
40
- + const params = {
41
- + public_key: publicKey,
42
- + imei: ctx.imei
43
- + };
44
- + const encryptedParams = utils.encodeAES(JSON.stringify(params));
45
- + if (!encryptedParams) throw new ZaloApiError("Failed to encrypt message");
46
- + const response = await utils.request(`${serviceURL}&params=${encodeURIComponent(encryptedParams)}`, {
47
- + method: "GET"
48
- + });
49
- + return utils.resolve(response);
50
- + };
51
- +});
52
20
  diff --git a/node_modules/zca-js/dist/apis/forwardMessage.js b/node_modules/zca-js/dist/apis/forwardMessage.js
53
21
  index ff4f6c6..499fbcf 100644
54
22
  --- a/node_modules/zca-js/dist/apis/forwardMessage.js
@@ -83,30 +51,6 @@ index ff4f6c6..499fbcf 100644
83
51
  + return resolved;
84
52
  };
85
53
  });
86
- diff --git a/node_modules/zca-js/dist/apis/getCrossDB.js b/node_modules/zca-js/dist/apis/getCrossDB.js
87
- new file mode 100644
88
- index 0000000..3bf97b9
89
- --- /dev/null
90
- +++ b/node_modules/zca-js/dist/apis/getCrossDB.js
91
- @@ -0,0 +1,18 @@
92
- +import { ZaloApiError } from "../Errors/ZaloApiError.js";
93
- +import { apiFactory } from "../utils.js";
94
- +
95
- +export const getCrossDBFactory = apiFactory()((api, _, utils) => {
96
- + const serviceURL = utils.makeURL(`${api.zpwServiceMap.file[0]}/api/message/get_crossdb`);
97
- + return async function getCrossDB(syncSession) {
98
- + const params = {
99
- + pc_name: "Web",
100
- + sync_session: syncSession
101
- + };
102
- + const encryptedParams = utils.encodeAES(JSON.stringify(params));
103
- + if (!encryptedParams) throw new ZaloApiError("Failed to encrypt message");
104
- + const response = await utils.request(`${serviceURL}&params=${encodeURIComponent(encryptedParams)}`, {
105
- + method: "GET"
106
- + });
107
- + return utils.resolve(response);
108
- + };
109
- +});
110
54
  diff --git a/node_modules/zca-js/dist/apis/loginQR.js b/node_modules/zca-js/dist/apis/loginQR.js
111
55
  index 7405811..309c23c 100644
112
56
  --- a/node_modules/zca-js/dist/apis/loginQR.js
@@ -493,58 +437,6 @@ index 0000000..e250100
493
437
  + return await utils.resolve(response, undefined, false);
494
438
  + };
495
439
  +});
496
- diff --git a/node_modules/zca-js/dist/apis/pullMobileMsg.js b/node_modules/zca-js/dist/apis/pullMobileMsg.js
497
- new file mode 100644
498
- index 0000000..ef850ea
499
- --- /dev/null
500
- +++ b/node_modules/zca-js/dist/apis/pullMobileMsg.js
501
- @@ -0,0 +1,22 @@
502
- +import { ZaloApiError } from "../Errors/ZaloApiError.js";
503
- +import { apiFactory } from "../utils.js";
504
- +
505
- +export const pullMobileMsgFactory = apiFactory()((api, _, utils) => {
506
- + const serviceURL = utils.makeURL(`${api.zpwServiceMap.file[0]}/api/message/pull_mobile_msg`);
507
- + return async function pullMobileMsg(publicKey, fromSeqId = 0, isRetry = 0, tempKey = "") {
508
- + const params = {
509
- + pc_name: "Web",
510
- + public_key: publicKey,
511
- + from_seq_id: fromSeqId,
512
- + is_retry: isRetry,
513
- + min_seq_id: 0,
514
- + temp_key: tempKey
515
- + };
516
- + const encryptedParams = utils.encodeAES(JSON.stringify(params));
517
- + if (!encryptedParams) throw new ZaloApiError("Failed to encrypt message");
518
- + const response = await utils.request(`${serviceURL}&params=${encodeURIComponent(encryptedParams)}`, {
519
- + method: "GET"
520
- + });
521
- + return utils.resolve(response);
522
- + };
523
- +});
524
- diff --git a/node_modules/zca-js/dist/apis/requestSyncMessage.js b/node_modules/zca-js/dist/apis/requestSyncMessage.js
525
- new file mode 100644
526
- index 0000000..d459340
527
- --- /dev/null
528
- +++ b/node_modules/zca-js/dist/apis/requestSyncMessage.js
529
- @@ -0,0 +1,18 @@
530
- +import { ZaloApiError } from "../Errors/ZaloApiError.js";
531
- +import { apiFactory } from "../utils.js";
532
- +
533
- +export const requestSyncMessageFactory = apiFactory()((api, _, utils) => {
534
- + const serviceURL = utils.makeURL(`${api.zpwServiceMap.file[0]}/api/transfer-sync-v2/request-sync`);
535
- + return async function requestSyncMessage(reqId, data) {
536
- + const params = {
537
- + reqId: String(reqId),
538
- + data: JSON.stringify(data)
539
- + };
540
- + const encryptedParams = utils.encodeAES(JSON.stringify(params));
541
- + if (!encryptedParams) throw new ZaloApiError("Failed to encrypt message");
542
- + const response = await utils.request(`${serviceURL}&params=${encodeURIComponent(encryptedParams)}`, {
543
- + method: "GET"
544
- + });
545
- + return utils.resolve(response);
546
- + };
547
- +});
548
440
  diff --git a/node_modules/zca-js/dist/apis/sendBankCard.js b/node_modules/zca-js/dist/apis/sendBankCard.js
549
441
  index f1fbae0..5841159 100644
550
442
  --- a/node_modules/zca-js/dist/apis/sendBankCard.js
@@ -928,58 +820,22 @@ diff --git a/node_modules/zca-js/dist/cjs/apis.cjs b/node_modules/zca-js/dist/cj
928
820
  index c151de0..e49f3d6 100644
929
821
  --- a/node_modules/zca-js/dist/cjs/apis.cjs
930
822
  +++ b/node_modules/zca-js/dist/cjs/apis.cjs
931
- @@ -156,6 +156,11 @@ var uploadAttachment = require('./apis/uploadAttachment.cjs');
823
+ @@ -156,6 +156,7 @@ var uploadAttachment = require('./apis/uploadAttachment.cjs');
932
824
  var uploadProductPhoto = require('./apis/uploadProductPhoto.cjs');
933
825
  var votePoll = require('./apis/votePoll.cjs');
934
826
  var custom = require('./apis/custom.cjs');
935
- +var requestSyncMessage = require('./apis/requestSyncMessage.cjs');
936
- +var pullMobileMsg = require('./apis/pullMobileMsg.cjs');
937
- +var getCrossDB = require('./apis/getCrossDB.cjs');
938
- +var deleteSnapshotMobileMsg = require('./apis/deleteSnapshotMobileMsg.cjs');
939
827
  +var logoutV2 = require('./apis/logoutV2.cjs');
940
828
 
941
829
  class API {
942
830
  constructor(ctx, zpwServiceMap, wsUrls) {
943
- @@ -316,6 +321,11 @@ class API {
831
+ @@ -316,6 +317,7 @@ class API {
944
832
  this.uploadProductPhoto = uploadProductPhoto.uploadProductPhotoFactory(ctx, this);
945
833
  this.votePoll = votePoll.votePollFactory(ctx, this);
946
834
  this.custom = custom.customFactory(ctx, this);
947
- + this.requestSyncMessage = requestSyncMessage.requestSyncMessageFactory(ctx, this);
948
- + this.pullMobileMsg = pullMobileMsg.pullMobileMsgFactory(ctx, this);
949
- + this.getCrossDB = getCrossDB.getCrossDBFactory(ctx, this);
950
- + this.deleteSnapshotMobileMsg = deleteSnapshotMobileMsg.deleteSnapshotMobileMsgFactory(ctx, this);
951
835
  + this.logoutV2 = logoutV2.logoutV2Factory(ctx, this);
952
836
  }
953
837
  }
954
838
 
955
- diff --git a/node_modules/zca-js/dist/cjs/apis/deleteSnapshotMobileMsg.cjs b/node_modules/zca-js/dist/cjs/apis/deleteSnapshotMobileMsg.cjs
956
- new file mode 100644
957
- index 0000000..d5b3f5c
958
- --- /dev/null
959
- +++ b/node_modules/zca-js/dist/cjs/apis/deleteSnapshotMobileMsg.cjs
960
- @@ -0,0 +1,22 @@
961
- +'use strict';
962
- +
963
- +var ZaloApiError = require('../Errors/ZaloApiError.cjs');
964
- +var utils = require('../utils.cjs');
965
- +
966
- +const deleteSnapshotMobileMsgFactory = utils.apiFactory()((api, ctx, utils) => {
967
- + const serviceURL = utils.makeURL(`${api.zpwServiceMap.file[0]}/api/message/delete_snapshot_mobile_msg`);
968
- + return async function deleteSnapshotMobileMsg(publicKey) {
969
- + const params = {
970
- + public_key: publicKey,
971
- + imei: ctx.imei
972
- + };
973
- + const encryptedParams = utils.encodeAES(JSON.stringify(params));
974
- + if (!encryptedParams) throw new ZaloApiError.ZaloApiError("Failed to encrypt message");
975
- + const response = await utils.request(`${serviceURL}&params=${encodeURIComponent(encryptedParams)}`, {
976
- + method: "GET"
977
- + });
978
- + return utils.resolve(response);
979
- + };
980
- +});
981
- +
982
- +exports.deleteSnapshotMobileMsgFactory = deleteSnapshotMobileMsgFactory;
983
839
  diff --git a/node_modules/zca-js/dist/cjs/apis/forwardMessage.cjs b/node_modules/zca-js/dist/cjs/apis/forwardMessage.cjs
984
840
  index f9c670b..4dfa11c 100644
985
841
  --- a/node_modules/zca-js/dist/cjs/apis/forwardMessage.cjs
@@ -1016,34 +872,6 @@ index f9c670b..4dfa11c 100644
1016
872
  };
1017
873
  });
1018
874
 
1019
- diff --git a/node_modules/zca-js/dist/cjs/apis/getCrossDB.cjs b/node_modules/zca-js/dist/cjs/apis/getCrossDB.cjs
1020
- new file mode 100644
1021
- index 0000000..da5f16d
1022
- --- /dev/null
1023
- +++ b/node_modules/zca-js/dist/cjs/apis/getCrossDB.cjs
1024
- @@ -0,0 +1,22 @@
1025
- +'use strict';
1026
- +
1027
- +var ZaloApiError = require('../Errors/ZaloApiError.cjs');
1028
- +var utils = require('../utils.cjs');
1029
- +
1030
- +const getCrossDBFactory = utils.apiFactory()((api, _, utils) => {
1031
- + const serviceURL = utils.makeURL(`${api.zpwServiceMap.file[0]}/api/message/get_crossdb`);
1032
- + return async function getCrossDB(syncSession) {
1033
- + const params = {
1034
- + pc_name: "Web",
1035
- + sync_session: syncSession
1036
- + };
1037
- + const encryptedParams = utils.encodeAES(JSON.stringify(params));
1038
- + if (!encryptedParams) throw new ZaloApiError.ZaloApiError("Failed to encrypt message");
1039
- + const response = await utils.request(`${serviceURL}&params=${encodeURIComponent(encryptedParams)}`, {
1040
- + method: "GET"
1041
- + });
1042
- + return utils.resolve(response);
1043
- + };
1044
- +});
1045
- +
1046
- +exports.getCrossDBFactory = getCrossDBFactory;
1047
875
  diff --git a/node_modules/zca-js/dist/cjs/apis/loginQR.cjs b/node_modules/zca-js/dist/cjs/apis/loginQR.cjs
1048
876
  index dbd08ed..8abfdab 100644
1049
877
  --- a/node_modules/zca-js/dist/cjs/apis/loginQR.cjs
@@ -1246,66 +1074,6 @@ index 0000000..53cedb4
1246
1074
  +});
1247
1075
  +
1248
1076
  +exports.logoutV2Factory = logoutV2Factory;
1249
- diff --git a/node_modules/zca-js/dist/cjs/apis/pullMobileMsg.cjs b/node_modules/zca-js/dist/cjs/apis/pullMobileMsg.cjs
1250
- new file mode 100644
1251
- index 0000000..579bc2e
1252
- --- /dev/null
1253
- +++ b/node_modules/zca-js/dist/cjs/apis/pullMobileMsg.cjs
1254
- @@ -0,0 +1,26 @@
1255
- +'use strict';
1256
- +
1257
- +var ZaloApiError = require('../Errors/ZaloApiError.cjs');
1258
- +var utils = require('../utils.cjs');
1259
- +
1260
- +const pullMobileMsgFactory = utils.apiFactory()((api, _, utils) => {
1261
- + const serviceURL = utils.makeURL(`${api.zpwServiceMap.file[0]}/api/message/pull_mobile_msg`);
1262
- + return async function pullMobileMsg(publicKey, fromSeqId = 0, isRetry = 0, tempKey = "") {
1263
- + const params = {
1264
- + pc_name: "Web",
1265
- + public_key: publicKey,
1266
- + from_seq_id: fromSeqId,
1267
- + is_retry: isRetry,
1268
- + min_seq_id: 0,
1269
- + temp_key: tempKey
1270
- + };
1271
- + const encryptedParams = utils.encodeAES(JSON.stringify(params));
1272
- + if (!encryptedParams) throw new ZaloApiError.ZaloApiError("Failed to encrypt message");
1273
- + const response = await utils.request(`${serviceURL}&params=${encodeURIComponent(encryptedParams)}`, {
1274
- + method: "GET"
1275
- + });
1276
- + return utils.resolve(response);
1277
- + };
1278
- +});
1279
- +
1280
- +exports.pullMobileMsgFactory = pullMobileMsgFactory;
1281
- diff --git a/node_modules/zca-js/dist/cjs/apis/requestSyncMessage.cjs b/node_modules/zca-js/dist/cjs/apis/requestSyncMessage.cjs
1282
- new file mode 100644
1283
- index 0000000..324995e
1284
- --- /dev/null
1285
- +++ b/node_modules/zca-js/dist/cjs/apis/requestSyncMessage.cjs
1286
- @@ -0,0 +1,22 @@
1287
- +'use strict';
1288
- +
1289
- +var ZaloApiError = require('../Errors/ZaloApiError.cjs');
1290
- +var utils = require('../utils.cjs');
1291
- +
1292
- +const requestSyncMessageFactory = utils.apiFactory()((api, _, utils) => {
1293
- + const serviceURL = utils.makeURL(`${api.zpwServiceMap.file[0]}/api/transfer-sync-v2/request-sync`);
1294
- + return async function requestSyncMessage(reqId, data) {
1295
- + const params = {
1296
- + reqId: String(reqId),
1297
- + data: JSON.stringify(data)
1298
- + };
1299
- + const encryptedParams = utils.encodeAES(JSON.stringify(params));
1300
- + if (!encryptedParams) throw new ZaloApiError.ZaloApiError("Failed to encrypt message");
1301
- + const response = await utils.request(`${serviceURL}&params=${encodeURIComponent(encryptedParams)}`, {
1302
- + method: "GET"
1303
- + });
1304
- + return utils.resolve(response);
1305
- + };
1306
- +});
1307
- +
1308
- +exports.requestSyncMessageFactory = requestSyncMessageFactory;
1309
1077
  diff --git a/node_modules/zca-js/dist/cjs/apis/sendBankCard.cjs b/node_modules/zca-js/dist/cjs/apis/sendBankCard.cjs
1310
1078
  index a2ad818..3726a37 100644
1311
1079
  --- a/node_modules/zca-js/dist/cjs/apis/sendBankCard.cjs