zele 0.3.12 → 0.3.14
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 +8 -1
- package/dist/auth.js +1 -1
- package/dist/auth.js.map +1 -1
- package/dist/cli.d.ts +1 -1
- package/dist/cli.js +10 -8
- package/dist/cli.js.map +1 -1
- package/dist/commands/attachment.js +2 -3
- package/dist/commands/attachment.js.map +1 -1
- package/dist/commands/auth-cmd.js +1 -2
- package/dist/commands/auth-cmd.js.map +1 -1
- package/dist/commands/calendar.js +4 -6
- package/dist/commands/calendar.js.map +1 -1
- package/dist/commands/draft.js +2 -3
- package/dist/commands/draft.js.map +1 -1
- package/dist/commands/label.js +4 -5
- package/dist/commands/label.js.map +1 -1
- package/dist/commands/mail.js +24 -21
- package/dist/commands/mail.js.map +1 -1
- package/dist/gmail-client.d.ts +11 -12
- package/dist/gmail-client.js +55 -40
- package/dist/gmail-client.js.map +1 -1
- package/dist/mail-tui.js +165 -187
- package/dist/mail-tui.js.map +1 -1
- package/dist/output.d.ts +3 -1
- package/dist/output.js +7 -2
- package/dist/output.js.map +1 -1
- package/package.json +7 -5
- package/src/auth.ts +1 -1
- package/src/cli.ts +31 -30
- package/src/commands/attachment.ts +2 -4
- package/src/commands/auth-cmd.ts +1 -2
- package/src/commands/calendar.ts +4 -7
- package/src/commands/draft.ts +2 -3
- package/src/commands/label.ts +4 -4
- package/src/commands/mail.ts +24 -19
- package/src/gmail-client.test.ts +8 -3
- package/src/gmail-client.ts +64 -58
- package/src/mail-tui.tsx +419 -418
- package/src/output.ts +8 -3
- package/bin/zele +0 -27
package/src/output.ts
CHANGED
|
@@ -212,17 +212,22 @@ export function printYaml(data: unknown): void {
|
|
|
212
212
|
}
|
|
213
213
|
|
|
214
214
|
/**
|
|
215
|
-
* Print a list of items as YAML with optional pagination.
|
|
215
|
+
* Print a list of items as YAML with optional pagination and summary.
|
|
216
216
|
* Output shape:
|
|
217
|
+
* summary: "5 threads (inbox)"
|
|
217
218
|
* items:
|
|
218
219
|
* - key: value
|
|
219
220
|
* next_page: "token"
|
|
220
221
|
*/
|
|
221
222
|
export function printList(
|
|
222
223
|
items: Record<string, unknown>[],
|
|
223
|
-
opts?: { nextPage?: string | null },
|
|
224
|
+
opts?: { nextPage?: string | null; summary?: string },
|
|
224
225
|
): void {
|
|
225
|
-
const doc: Record<string, unknown> = {
|
|
226
|
+
const doc: Record<string, unknown> = {}
|
|
227
|
+
if (opts?.summary) {
|
|
228
|
+
doc.summary = opts.summary
|
|
229
|
+
}
|
|
230
|
+
doc.items = items
|
|
226
231
|
if (opts?.nextPage) {
|
|
227
232
|
doc.next_page = opts.nextPage
|
|
228
233
|
}
|
package/bin/zele
DELETED
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env sh
|
|
2
|
-
# Shell launcher for zele CLI.
|
|
3
|
-
# Prefers bun (required for the TUI), falls back to node for non-TUI commands.
|
|
4
|
-
# Uses exec so no child process is spawned — the shell is replaced in-place.
|
|
5
|
-
#
|
|
6
|
-
# Shebang uses "#!/usr/bin/env sh" instead of "#!/bin/sh" so that npm's
|
|
7
|
-
# cmd-shim on Windows captures "sh" as the program name (looked up via PATH)
|
|
8
|
-
# rather than the literal "/bin/sh" path which doesn't exist on Windows.
|
|
9
|
-
# Git for Windows provides sh.exe on PATH, making this work cross-platform.
|
|
10
|
-
|
|
11
|
-
# Resolve symlink (npm/pnpm create symlinks for bin entries)
|
|
12
|
-
SELF="$0"
|
|
13
|
-
if [ -L "$SELF" ]; then
|
|
14
|
-
LINK="$(readlink "$SELF")"
|
|
15
|
-
case "$LINK" in
|
|
16
|
-
/*) SELF="$LINK" ;;
|
|
17
|
-
*) SELF="$(dirname "$SELF")/$LINK" ;;
|
|
18
|
-
esac
|
|
19
|
-
fi
|
|
20
|
-
DIR="$(cd "$(dirname "$SELF")" && pwd)"
|
|
21
|
-
CLI="$DIR/../dist/cli.js"
|
|
22
|
-
|
|
23
|
-
if command -v bun >/dev/null 2>&1; then
|
|
24
|
-
exec bun "$CLI" "$@"
|
|
25
|
-
else
|
|
26
|
-
exec node "$CLI" "$@"
|
|
27
|
-
fi
|