@erdoai/cli 0.264.0 → 0.265.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 +5 -5
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -9259,8 +9259,8 @@ function readSchemaFile(path) {
|
|
|
9259
9259
|
return schema;
|
|
9260
9260
|
}
|
|
9261
9261
|
datasetsCmd.command("create <name>").description(
|
|
9262
|
-
"Create an empty dataset with its columns declared up front. Every write is checked against the schema, which is set now rather than taken from the first rows. --schema is required unless the purpose is one whose columns Erdo defines (page events, widget events, widget leads)."
|
|
9263
|
-
).option("--schema <file>", "JSON
|
|
9262
|
+
"Create an empty dataset with its columns declared up front. Every write is checked against the schema, which is set now rather than taken from the first rows. Schema columns support allowed_values, integer, and minimum; constraints support immutable_groups, required_together, server stamps, and less_or_equal numeric pairs. --schema is required unless the purpose is one whose columns Erdo defines (page events, widget events, widget leads)."
|
|
9263
|
+
).option("--schema <file>", "JSON columns array or { columns, constraints } schema object").option("--purpose <purpose>", "the dataset's role in the org vocabulary, e.g. leads (see `erdo datasets purposes`)").option("--purpose-description <text>", "what writes and reads this purpose").option("--description <text>", "what the dataset holds").option("--separate", "deliberately create a second dataset for a purpose the org already has").action(async (name, opts) => {
|
|
9264
9264
|
try {
|
|
9265
9265
|
const result = await new ErdoClient().createDataset({
|
|
9266
9266
|
name,
|
|
@@ -9293,8 +9293,8 @@ datasetViewCmd.command("create <source>").description(
|
|
|
9293
9293
|
}
|
|
9294
9294
|
});
|
|
9295
9295
|
datasetsCmd.command("ensure <purpose>").description(
|
|
9296
|
-
"Create or reuse the one dataset for a purpose and verify its declared producer contract. Refuses legacy splits and incompatible populated datasets instead of choosing silently."
|
|
9297
|
-
).requiredOption("--schema <file>", "JSON
|
|
9296
|
+
"Create or reuse the one dataset for a purpose and verify its declared producer contract. Schema columns support allowed_values, integer, and minimum; constraints support immutable_groups, required_together, server stamps, and less_or_equal numeric pairs. Refuses legacy splits and incompatible populated datasets instead of choosing silently."
|
|
9297
|
+
).requiredOption("--schema <file>", "JSON columns array or { columns, constraints } schema object").option("--name <name>", "dataset name when creation is required").option("--description <text>", "dataset description when creation is required").option("--purpose-description <text>", "what writes and reads this purpose").option("--preferred-dataset <slug>", "existing bound dataset slug or id to adopt").option("--reviewed-optional-addition <name>", "producer-reviewed optional column to add atomically; repeat for multiple columns", (value, previous = []) => [...previous, value], []).option("--email-column <name>", "for a leads purpose: which declared column holds the email (default email)").option("--phone-column <name>", "for a leads purpose: which declared column holds the phone (default phone)").action(async (purpose, opts) => {
|
|
9298
9298
|
try {
|
|
9299
9299
|
const declaredSchema = readSchemaFile(opts.schema);
|
|
9300
9300
|
const result = await new ErdoClient().ensureDataset({
|
|
@@ -9313,7 +9313,7 @@ datasetsCmd.command("ensure <purpose>").description(
|
|
|
9313
9313
|
fail(e);
|
|
9314
9314
|
}
|
|
9315
9315
|
});
|
|
9316
|
-
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/owner/record/provenance changes").action(async (slug, opts) => {
|
|
9316
|
+
datasetsCmd.command("update-schema <slug>").description("Evolve an existing dataset's column contract. declare_schema columns support allowed_values, integer, and minimum; constraints support immutable_groups, required_together, server stamps, and less_or_equal numeric pairs. 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/owner/record/provenance changes").action(async (slug, opts) => {
|
|
9317
9317
|
try {
|
|
9318
9318
|
const input = JSON.parse(readFileSync5(opts.input, "utf8"));
|
|
9319
9319
|
if (!input || typeof input !== "object" || Array.isArray(input)) {
|