dblx 0.1.64 → 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.
Files changed (2) hide show
  1. package/dist/index.js +30 -3
  2. package/package.json +1 -1
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: () => mod[key],
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,6 +2618,12 @@ 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) {
2609
2629
  return `${thread.thread.id.slice(0, 8)} ${thread.thread.body}`;
@@ -2618,7 +2638,14 @@ var getCommand = new Command("get").description("Read data from dblebox").addCom
2618
2638
  if (error2)
2619
2639
  throw error2;
2620
2640
  if (opts.json) {
2621
- output(data2, { json: true });
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 });
2622
2649
  return;
2623
2650
  }
2624
2651
  console.log(`Thread: ${data2.thread.body}`);
@@ -2919,7 +2946,7 @@ var inviteCommand = new Command("invite").description("Invite collaborators").ad
2919
2946
  // package.json
2920
2947
  var package_default = {
2921
2948
  name: "dblx",
2922
- version: "0.1.64",
2949
+ version: "0.1.68",
2923
2950
  description: "CLI for dblebox — thread-first communication",
2924
2951
  type: "module",
2925
2952
  bin: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dblx",
3
- "version": "0.1.64",
3
+ "version": "0.1.68",
4
4
  "description": "CLI for dblebox — thread-first communication",
5
5
  "type": "module",
6
6
  "bin": {