@erdoai/cli 0.36.0 → 0.37.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 +15 -9
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -606,11 +606,13 @@ var ErdoClient = class {
|
|
|
606
606
|
return this.request("GET", `/v1/threads/${encodeURIComponent(threadId)}/messages`);
|
|
607
607
|
}
|
|
608
608
|
// --- datasets ---
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
);
|
|
609
|
+
// class filters by structural class: omit (default) to show durable tables and
|
|
610
|
+
// hide scratch analysis by-products; "table"/"scratch" to select one; "all" for both.
|
|
611
|
+
listDatasets(params) {
|
|
612
|
+
const q = new URLSearchParams();
|
|
613
|
+
if (params?.class) q.set("class", params.class);
|
|
614
|
+
const qs = q.toString();
|
|
615
|
+
return this.request("GET", `/v1/datasets${qs ? `?${qs}` : ""}`);
|
|
614
616
|
}
|
|
615
617
|
// The endpoint's field is `question` (QueryDataNaturalLanguageInput). Sending
|
|
616
618
|
// `query` made every `erdo datasets query` fail with "question is required".
|
|
@@ -2620,10 +2622,14 @@ pagesCmd.command("review-result <id>").description("Read a page review by id \u2
|
|
|
2620
2622
|
}
|
|
2621
2623
|
});
|
|
2622
2624
|
var datasetsCmd = program.command("datasets").description("Datasets");
|
|
2623
|
-
datasetsCmd.command("list").description("List datasets").
|
|
2624
|
-
|
|
2625
|
-
|
|
2626
|
-
|
|
2625
|
+
datasetsCmd.command("list").description("List datasets").option(
|
|
2626
|
+
"--class <class>",
|
|
2627
|
+
"filter by structural class: 'table' or 'scratch', or 'all' to include scratch analysis by-products (default hides scratch)"
|
|
2628
|
+
).action(async (opts) => {
|
|
2629
|
+
try {
|
|
2630
|
+
const { datasets } = await new ErdoClient().listDatasets({ class: opts.class });
|
|
2631
|
+
for (const d of datasets)
|
|
2632
|
+
console.log(`${d.slug} ${d.type} ${d.status} ${d.class ?? "-"} ${d.name}`);
|
|
2627
2633
|
} catch (e) {
|
|
2628
2634
|
fail(e);
|
|
2629
2635
|
}
|