@pebblehouse/odin-cli 0.15.0 → 0.16.0
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/dist/index.js +20 -8
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -262,8 +262,13 @@ pebblesCmd.command("update <slug>").description("Update a pebble").option("--slu
|
|
|
262
262
|
import { Command as Command2 } from "commander";
|
|
263
263
|
import { readFileSync as readFileSync3 } from "fs";
|
|
264
264
|
var docsCmd = new Command2("docs").description("Manage documents");
|
|
265
|
-
docsCmd.command("list <slug>").description("List documents for a pebble").
|
|
266
|
-
|
|
265
|
+
docsCmd.command("list <slug>").description("List documents for a pebble").option(
|
|
266
|
+
"--doc-type <type>",
|
|
267
|
+
"Filter by document type (architecture, product, api, readme, spec, research, marketing, other, reference, org_chart, design, schema)"
|
|
268
|
+
).action(async (slug, opts) => {
|
|
269
|
+
const params = {};
|
|
270
|
+
if (opts.docType) params.doc_type = opts.docType;
|
|
271
|
+
const res = await apiRequest(`/pebbles/${slug}/documents`, { params });
|
|
267
272
|
process.stdout.write(JSON.stringify(res) + "\n");
|
|
268
273
|
if (res.error) process.exit(1);
|
|
269
274
|
});
|
|
@@ -405,7 +410,10 @@ function emitListResult(res, noun, resolved) {
|
|
|
405
410
|
// src/commands/decisions.ts
|
|
406
411
|
var decisionsCmd = new Command3("decisions").description("Manage decisions");
|
|
407
412
|
withListFlags(
|
|
408
|
-
decisionsCmd.command("list <slug>").description("List decisions for a pebble")
|
|
413
|
+
decisionsCmd.command("list <slug>").description("List decisions for a pebble").option(
|
|
414
|
+
"--status <status>",
|
|
415
|
+
"Filter by status (active, superseded, all). Defaults to active on the server."
|
|
416
|
+
)
|
|
409
417
|
).action(async (slug, opts) => {
|
|
410
418
|
const resolved = resolveListParams(opts);
|
|
411
419
|
if (resolved.fatal) {
|
|
@@ -413,9 +421,9 @@ withListFlags(
|
|
|
413
421
|
process.exit(1);
|
|
414
422
|
return;
|
|
415
423
|
}
|
|
416
|
-
const
|
|
417
|
-
|
|
418
|
-
});
|
|
424
|
+
const params = { ...resolved.params };
|
|
425
|
+
if (opts.status) params.status = opts.status;
|
|
426
|
+
const res = await apiRequest(`/pebbles/${slug}/decisions`, { params });
|
|
419
427
|
emitListResult(res, "decisions", resolved);
|
|
420
428
|
});
|
|
421
429
|
decisionsCmd.command("get <slug> <id>").description("Get a decision by ID").action(async (slug, id) => {
|
|
@@ -549,8 +557,12 @@ var searchCmd = new Command5("search").description("Full-text search across Odin
|
|
|
549
557
|
import { Command as Command6 } from "commander";
|
|
550
558
|
import { readFileSync as readFileSync4 } from "fs";
|
|
551
559
|
var plansCmd = new Command6("plans").description("Manage plans");
|
|
552
|
-
plansCmd.command("list <slug>").description("List plans for a pebble").action(async (slug) => {
|
|
553
|
-
const
|
|
560
|
+
plansCmd.command("list <slug>").description("List plans for a pebble").option("--status <status>", "Filter by status (active, done, archived)").option("--bet <id>", "Filter to plans linked to this bet").option("--task <id>", "Filter to plans linked to this task").action(async (slug, opts) => {
|
|
561
|
+
const params = {};
|
|
562
|
+
if (opts.status) params.status = opts.status;
|
|
563
|
+
if (opts.bet) params.bet_id = opts.bet;
|
|
564
|
+
if (opts.task) params.task_id = opts.task;
|
|
565
|
+
const res = await apiRequest(`/pebbles/${slug}/plans`, { params });
|
|
554
566
|
process.stdout.write(JSON.stringify(res) + "\n");
|
|
555
567
|
if (res.error) process.exit(1);
|
|
556
568
|
});
|