openzca 0.1.49 → 0.1.51
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/README.md +15 -2
- package/dist/cli.js +701 -360
- package/dist/db-worker.js +292 -0
- package/package.json +6 -5
package/README.md
CHANGED
|
@@ -19,7 +19,9 @@ Or run without installing:
|
|
|
19
19
|
npx openzca --help
|
|
20
20
|
```
|
|
21
21
|
|
|
22
|
-
Requires Node.js
|
|
22
|
+
Requires Node.js 22.13+.
|
|
23
|
+
|
|
24
|
+
The built-in DB backend now uses Node's official `node:sqlite` module, so no extra `sqlite3` native addon is installed.
|
|
23
25
|
|
|
24
26
|
## Quick start
|
|
25
27
|
|
|
@@ -40,6 +42,12 @@ openzca msg send GROUP_ID "Hello team" --group
|
|
|
40
42
|
openzca msg send GROUP_ID "Hi @Alice Nguyen" --group
|
|
41
43
|
openzca msg send GROUP_ID "Hi @123456789" --group
|
|
42
44
|
|
|
45
|
+
# Reply using a stored DB message id
|
|
46
|
+
openzca msg send USER_ID "Reply text" --reply-id MSG_ID
|
|
47
|
+
|
|
48
|
+
# Reply without DB using a listen --raw payload
|
|
49
|
+
openzca msg send USER_ID "Reply text" --reply-message '{"threadId":"...","msgId":"...","cliMsgId":"...","content":"...","msgType":"webchat","senderId":"...","toId":"...","ts":"..."}'
|
|
50
|
+
|
|
43
51
|
# Listen for incoming messages
|
|
44
52
|
openzca listen
|
|
45
53
|
|
|
@@ -91,7 +99,7 @@ You can also open the saved file manually (for example: `open qr.png` on macOS).
|
|
|
91
99
|
|
|
92
100
|
| Command | Description |
|
|
93
101
|
|---------|-------------|
|
|
94
|
-
| `openzca msg send <threadId> <message>` | Send text with formatting (`**bold**`, `*italic*`, `~~strike~~`, etc.)
|
|
102
|
+
| `openzca msg send <threadId> <message>` | Send text with formatting (`**bold**`, `*italic*`, `~~strike~~`, etc.), group @mention resolution (`--raw` to skip formatting), and quote replies via `--reply-id` or `--reply-message` |
|
|
95
103
|
| `openzca msg image <threadId> [file]` | Send image(s) from file or URL |
|
|
96
104
|
| `openzca msg video <threadId> [file]` | Send video(s) from file or URL; single `.mp4` inputs try native video mode |
|
|
97
105
|
| `openzca msg voice <threadId> [file]` | Send voice message from local file or URL (`.aac`, `.mp3`, `.m4a`, `.wav`, `.ogg`) |
|
|
@@ -115,6 +123,11 @@ Media commands accept local files, `file://` paths, and repeatable `--url` optio
|
|
|
115
123
|
`openzca msg video` attempts native video send for a single `.mp4` input by uploading the video and thumbnail to Zalo first. If `ffmpeg` is unavailable, the input is not a single `.mp4`, or native send fails, it falls back to the normal attachment send path. Use `--thumbnail <path-or-url>` to supply the preview image explicitly.
|
|
116
124
|
Local paths using `~` are expanded automatically (for positional file args, `--url`, and `OPENZCA_LISTEN_MEDIA_DIR`).
|
|
117
125
|
Group text sends via `openzca msg send --group` resolve unique `@Name` or `@userId` mentions against the current group member list using member ids, display names, and usernames. Mention offsets are computed after formatting markers are parsed, so messages like `**@Alice Nguyen** hello` work. If multiple members share the same label, the command fails instead of guessing.
|
|
126
|
+
Reply flows:
|
|
127
|
+
|
|
128
|
+
- `--reply-id <id>` resolves a stored message from the local DB by `msgId`, `cliMsgId`, or internal message uid. This requires DB persistence to be enabled for the profile.
|
|
129
|
+
- `--reply-message <json>` accepts either the original `message.data` object from `zca-js` or the current `openzca listen --raw` payload. Use this path when DB is disabled or when a caller already has the inbound payload in memory.
|
|
130
|
+
- Use exactly one of `--reply-id` or `--reply-message`.
|
|
118
131
|
`msg recent` keeps the previous live behavior by default. Use `--source db` to read only from the local SQLite store, or `--source auto` to try DB first and fall back to live history.
|
|
119
132
|
|
|
120
133
|
### Debug Logging
|