dblx 0.1.63 → 0.1.68
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 +9 -0
- package/dist/index.js +73 -3
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -14,6 +14,7 @@ Examples:
|
|
|
14
14
|
|
|
15
15
|
```bash
|
|
16
16
|
dblx get threads
|
|
17
|
+
dblx get threads <thread-id>
|
|
17
18
|
dblx get threads --q "planning"
|
|
18
19
|
dblx get today
|
|
19
20
|
dblx create thread --title "New thread"
|
|
@@ -61,6 +62,7 @@ You can also set `DBLEBOX_API_KEY` and `DBLEBOX_API_URL` environment variables i
|
|
|
61
62
|
|
|
62
63
|
```bash
|
|
63
64
|
dblx get threads
|
|
65
|
+
dblx get threads <thread-id>
|
|
64
66
|
dblx get threads --archived
|
|
65
67
|
dblx get threads --snoozed
|
|
66
68
|
dblx get threads --archived --snoozed
|
|
@@ -68,6 +70,12 @@ dblx get threads --q "plan"
|
|
|
68
70
|
dblx get threads --q "#dblebox" --archived --snoozed
|
|
69
71
|
```
|
|
70
72
|
|
|
73
|
+
### Get All Thread Content, Including Comments and Notes
|
|
74
|
+
|
|
75
|
+
```bash
|
|
76
|
+
dblx get threads <thread-id>
|
|
77
|
+
```
|
|
78
|
+
|
|
71
79
|
### Today
|
|
72
80
|
|
|
73
81
|
```bash
|
|
@@ -149,6 +157,7 @@ All read commands support `--json` for machine-readable output:
|
|
|
149
157
|
|
|
150
158
|
```bash
|
|
151
159
|
dblx get threads --json
|
|
160
|
+
dblx get threads <thread-id> --json
|
|
152
161
|
dblx get threads --q "plan" --json
|
|
153
162
|
dblx get today --json
|
|
154
163
|
dblx get thread-note <thread-id> --json
|
package/dist/index.js
CHANGED
|
@@ -5,15 +5,29 @@ var __getProtoOf = Object.getPrototypeOf;
|
|
|
5
5
|
var __defProp = Object.defineProperty;
|
|
6
6
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
7
7
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
function __accessProp(key) {
|
|
9
|
+
return this[key];
|
|
10
|
+
}
|
|
11
|
+
var __toESMCache_node;
|
|
12
|
+
var __toESMCache_esm;
|
|
8
13
|
var __toESM = (mod, isNodeMode, target) => {
|
|
14
|
+
var canCache = mod != null && typeof mod === "object";
|
|
15
|
+
if (canCache) {
|
|
16
|
+
var cache = isNodeMode ? __toESMCache_node ??= new WeakMap : __toESMCache_esm ??= new WeakMap;
|
|
17
|
+
var cached = cache.get(mod);
|
|
18
|
+
if (cached)
|
|
19
|
+
return cached;
|
|
20
|
+
}
|
|
9
21
|
target = mod != null ? __create(__getProtoOf(mod)) : {};
|
|
10
22
|
const to = isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target;
|
|
11
23
|
for (let key of __getOwnPropNames(mod))
|
|
12
24
|
if (!__hasOwnProp.call(to, key))
|
|
13
25
|
__defProp(to, key, {
|
|
14
|
-
get: (
|
|
26
|
+
get: __accessProp.bind(mod, key),
|
|
15
27
|
enumerable: true
|
|
16
28
|
});
|
|
29
|
+
if (canCache)
|
|
30
|
+
cache.set(mod, to);
|
|
17
31
|
return to;
|
|
18
32
|
};
|
|
19
33
|
var __commonJS = (cb, mod) => () => (mod || cb((mod = { exports: {} }).exports, mod), mod.exports);
|
|
@@ -2604,9 +2618,65 @@ function parseBooleanish(value) {
|
|
|
2604
2618
|
throw new InvalidArgumentError('Expected "true" or "false".');
|
|
2605
2619
|
}
|
|
2606
2620
|
|
|
2621
|
+
// src/urls.ts
|
|
2622
|
+
function inferThreadUrl(apiUrl, threadId) {
|
|
2623
|
+
const { origin } = new URL(apiUrl);
|
|
2624
|
+
return `${origin}/dashboard/thread/${threadId}`;
|
|
2625
|
+
}
|
|
2626
|
+
|
|
2607
2627
|
// src/commands/get.ts
|
|
2608
|
-
|
|
2628
|
+
function relatedThreadLabel(thread) {
|
|
2629
|
+
return `${thread.thread.id.slice(0, 8)} ${thread.thread.body}`;
|
|
2630
|
+
}
|
|
2631
|
+
var getCommand = new Command("get").description("Read data from dblebox").addCommand(new Command("threads").description("List or search your threads").argument("[thread-id]", "Thread ID").option("--q <query>", "Filter by partial title/body text").option("--json", "Output as JSON").option("--archived", "Include archived threads").option("--snoozed", "Include snoozed threads").action(async (threadId, opts) => {
|
|
2609
2632
|
const api = getApi();
|
|
2633
|
+
if (threadId) {
|
|
2634
|
+
if (opts.q || opts.archived || opts.snoozed) {
|
|
2635
|
+
throw new Error("Thread lookup does not support --q, --archived, or --snoozed.");
|
|
2636
|
+
}
|
|
2637
|
+
const { data: data2, error: error2 } = await api.api.cli.v1.threads({ id: threadId }).get();
|
|
2638
|
+
if (error2)
|
|
2639
|
+
throw error2;
|
|
2640
|
+
if (opts.json) {
|
|
2641
|
+
const config = loadConfig();
|
|
2642
|
+
if (!config) {
|
|
2643
|
+
throw new Error("Not logged in. Run: dblx auth login");
|
|
2644
|
+
}
|
|
2645
|
+
output({
|
|
2646
|
+
...data2,
|
|
2647
|
+
url: inferThreadUrl(config.api_url, data2.thread.id)
|
|
2648
|
+
}, { json: true });
|
|
2649
|
+
return;
|
|
2650
|
+
}
|
|
2651
|
+
console.log(`Thread: ${data2.thread.body}`);
|
|
2652
|
+
console.log(`ID: ${data2.thread.id}`);
|
|
2653
|
+
console.log(`Created: ${data2.thread.created_at}`);
|
|
2654
|
+
console.log(`
|
|
2655
|
+
Note:`);
|
|
2656
|
+
console.log(data2.note ? data2.note.content || "(empty)" : "(none)");
|
|
2657
|
+
console.log(`
|
|
2658
|
+
Comments:`);
|
|
2659
|
+
if (data2.comments.length === 0) {
|
|
2660
|
+
console.log("(none)");
|
|
2661
|
+
} else {
|
|
2662
|
+
for (const comment of data2.comments) {
|
|
2663
|
+
console.log(`- [${comment.created_at}] @${comment.creator_username}: ${comment.body}`);
|
|
2664
|
+
}
|
|
2665
|
+
}
|
|
2666
|
+
console.log(`
|
|
2667
|
+
Parent:`);
|
|
2668
|
+
console.log(data2.parent_thread ? relatedThreadLabel(data2.parent_thread) : "(none)");
|
|
2669
|
+
console.log(`
|
|
2670
|
+
Children:`);
|
|
2671
|
+
if (data2.child_threads.length === 0) {
|
|
2672
|
+
console.log("(none)");
|
|
2673
|
+
} else {
|
|
2674
|
+
for (const child of data2.child_threads) {
|
|
2675
|
+
console.log(`- ${relatedThreadLabel(child)}`);
|
|
2676
|
+
}
|
|
2677
|
+
}
|
|
2678
|
+
return;
|
|
2679
|
+
}
|
|
2610
2680
|
const { data, error } = await api.api.cli.v1.threads.get({
|
|
2611
2681
|
query: {
|
|
2612
2682
|
q: opts.q,
|
|
@@ -2876,7 +2946,7 @@ var inviteCommand = new Command("invite").description("Invite collaborators").ad
|
|
|
2876
2946
|
// package.json
|
|
2877
2947
|
var package_default = {
|
|
2878
2948
|
name: "dblx",
|
|
2879
|
-
version: "0.1.
|
|
2949
|
+
version: "0.1.68",
|
|
2880
2950
|
description: "CLI for dblebox — thread-first communication",
|
|
2881
2951
|
type: "module",
|
|
2882
2952
|
bin: {
|