@erdoai/cli 0.195.0 → 0.196.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 +16 -0
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1574,6 +1574,11 @@ var ErdoClient = class {
|
|
|
1574
1574
|
// `purpose_sibling: true` only to declare a deliberate parallel carrier (a
|
|
1575
1575
|
// separate program a human chose to run), which leaves the other carriers
|
|
1576
1576
|
// alone.
|
|
1577
|
+
// deleteDataset permanently deletes a dataset and its data (DELETE
|
|
1578
|
+
// /v1/datasets/:slug, the same path as the erdo_delete_dataset MCP tool).
|
|
1579
|
+
deleteDataset(slug) {
|
|
1580
|
+
return this.request("DELETE", `/v1/datasets/${encodeURIComponent(slug)}`);
|
|
1581
|
+
}
|
|
1577
1582
|
setDatasetPurpose(slug, input) {
|
|
1578
1583
|
return this.updateDatasetSchema(slug, input);
|
|
1579
1584
|
}
|
|
@@ -8492,6 +8497,17 @@ datasetsCmd.command("update-schema <slug>").description("Evolve an existing data
|
|
|
8492
8497
|
fail(e);
|
|
8493
8498
|
}
|
|
8494
8499
|
});
|
|
8500
|
+
datasetsCmd.command("delete <slug>").description("Permanently delete a dataset and all its data (the erdo_delete_dataset MCP tool). Nothing is deleted without --yes").option("--yes", "confirm the permanent deletion").action(async (slug, opts) => {
|
|
8501
|
+
try {
|
|
8502
|
+
if (!opts.yes) {
|
|
8503
|
+
fail(new Error(`deleting ${slug} is permanent and removes all its data; rerun with --yes to delete it`));
|
|
8504
|
+
}
|
|
8505
|
+
await new ErdoClient().deleteDataset(slug);
|
|
8506
|
+
console.log(`deleted ${slug}`);
|
|
8507
|
+
} catch (e) {
|
|
8508
|
+
fail(e);
|
|
8509
|
+
}
|
|
8510
|
+
});
|
|
8495
8511
|
datasetsCmd.command("set-purpose <slug> [purpose]").description(
|
|
8496
8512
|
"Set (or with --clear, remove) the dataset's purpose \u2014 the org-vocabulary role `datasets purposes` reports. Use it to CORRECT a purpose that names the wrong dataset: one purpose maps to one dataset per org, so a purpose left on the wrong one points everything that resolves through the vocabulary at the wrong rows. Setting a purpose another dataset carries is an atomic MOVE: the old carrier is cleared in the same transaction, so one call on the right dataset lands it (the response says which dataset it moved from). Use --sibling only when deliberately running a parallel table for the same purpose."
|
|
8497
8513
|
).option("--clear", "remove the dataset's purpose instead of setting one").option(
|