@erdoai/cli 0.112.0 → 0.114.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 +19 -2
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -32,7 +32,7 @@ function describeRefreshWrites(strategy, mode, key, liveMode) {
|
|
|
32
32
|
import { readFileSync as readFileSync4 } from "fs";
|
|
33
33
|
import { basename } from "path";
|
|
34
34
|
import { password, select } from "@inquirer/prompts";
|
|
35
|
-
import { Command as Command2 } from "commander";
|
|
35
|
+
import { Command as Command2, Option as Option2 } from "commander";
|
|
36
36
|
|
|
37
37
|
// src/config.ts
|
|
38
38
|
import { existsSync, mkdirSync, readFileSync, writeFileSync } from "fs";
|
|
@@ -1165,6 +1165,9 @@ var ErdoClient = class {
|
|
|
1165
1165
|
// separate program a human chose to run), which leaves the other carriers
|
|
1166
1166
|
// alone.
|
|
1167
1167
|
setDatasetPurpose(slug, input) {
|
|
1168
|
+
return this.updateDatasetSchema(slug, input);
|
|
1169
|
+
}
|
|
1170
|
+
updateDatasetSchema(slug, input) {
|
|
1168
1171
|
return this.request("POST", `/v1/datasets/${encodeURIComponent(slug)}/schema`, input);
|
|
1169
1172
|
}
|
|
1170
1173
|
// The endpoint's field is `question` (QueryDataNaturalLanguageInput). Sending // The endpoint's field is `question` (QueryDataNaturalLanguageInput). Sending
|
|
@@ -6579,6 +6582,19 @@ datasetsCmd.command("ensure <purpose>").description(
|
|
|
6579
6582
|
fail(e);
|
|
6580
6583
|
}
|
|
6581
6584
|
});
|
|
6585
|
+
datasetsCmd.command("update-schema <slug>").description("Evolve an existing dataset's column contract. For populated lead-identity datasets, use add_column operations only; existing rows and lead ids are preserved.").requiredOption("--input <file>", "JSON request containing operations and optional class/purpose changes").action(async (slug, opts) => {
|
|
6586
|
+
try {
|
|
6587
|
+
const input = JSON.parse(readFileSync4(opts.input, "utf8"));
|
|
6588
|
+
if (!input || typeof input !== "object" || Array.isArray(input)) {
|
|
6589
|
+
throw new Error("--input must contain a JSON object");
|
|
6590
|
+
}
|
|
6591
|
+
const result = await new ErdoClient().updateDatasetSchema(slug, input);
|
|
6592
|
+
console.log(JSON.stringify(result, null, 2));
|
|
6593
|
+
for (const warning of result.warnings ?? []) console.error(`warning: ${warning}`);
|
|
6594
|
+
} catch (e) {
|
|
6595
|
+
fail(e);
|
|
6596
|
+
}
|
|
6597
|
+
});
|
|
6582
6598
|
datasetsCmd.command("set-purpose <slug> [purpose]").description(
|
|
6583
6599
|
"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."
|
|
6584
6600
|
).option("--clear", "remove the dataset's purpose instead of setting one").option(
|
|
@@ -8141,7 +8157,7 @@ autoCmd.command("run <id>").description("Trigger an automation now").action(asyn
|
|
|
8141
8157
|
fail(e);
|
|
8142
8158
|
}
|
|
8143
8159
|
});
|
|
8144
|
-
autoCmd.command("update <id>").description("Edit an automation \u2014 rename, reschedule, or replace its script/instructions").option("--name <name>", "New name").option("--description <text>", "New description").option("--instructions <text>", "Replacement instructions (agent automation)").option("--script-js <js>", "Replacement script body (scripted automation)").option(
|
|
8160
|
+
autoCmd.command("update <id>").description("Edit an automation \u2014 rename, reschedule, or replace its script/instructions").option("--name <name>", "New name").option("--description <text>", "New description").option("--instructions <text>", "Replacement instructions (agent automation)").addOption(new Option2("--agent-key <key>", "Executor for an agent automation; omit to keep current").choices(["erdo.heartbeat-executor", "erdo.workflow-executor"])).option("--script-js <js>", "Replacement script body (scripted automation)").option(
|
|
8145
8161
|
"--script-file <path>",
|
|
8146
8162
|
"Read the replacement script body from a file (scripted automation)"
|
|
8147
8163
|
).option("--interval <minutes>", "New interval in minutes (minimum 5)", (v) => parseInt(v, 10)).option("--timezone <tz>", "New scheduling timezone, e.g. America/New_York").action(
|
|
@@ -8156,6 +8172,7 @@ autoCmd.command("update <id>").description("Edit an automation \u2014 rename, re
|
|
|
8156
8172
|
name: opts.name,
|
|
8157
8173
|
description: opts.description,
|
|
8158
8174
|
instructions: opts.instructions,
|
|
8175
|
+
agent_key: opts.agentKey,
|
|
8159
8176
|
script_js: scriptJs,
|
|
8160
8177
|
interval_minutes: opts.interval,
|
|
8161
8178
|
timezone: opts.timezone
|