@erdoai/cli 0.174.0 → 0.176.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 +21 -2
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -6953,11 +6953,12 @@ contact: ${parts.join(" \xB7 ")}`);
|
|
|
6953
6953
|
}
|
|
6954
6954
|
console.log("");
|
|
6955
6955
|
printAlignedTable(
|
|
6956
|
-
["at", "direction", "status", "media", "body"],
|
|
6956
|
+
["at", "direction", "status", "delivered", "media", "body"],
|
|
6957
6957
|
messages.map((m) => [
|
|
6958
6958
|
m.created_at,
|
|
6959
6959
|
m.direction,
|
|
6960
6960
|
m.status,
|
|
6961
|
+
m.delivered_at ?? "",
|
|
6961
6962
|
m.num_media > 0 ? m.num_media : "",
|
|
6962
6963
|
m.body
|
|
6963
6964
|
])
|
|
@@ -7074,11 +7075,13 @@ contact: ${parts.join(" \xB7 ")}`);
|
|
|
7074
7075
|
}
|
|
7075
7076
|
console.log("");
|
|
7076
7077
|
printAlignedTable(
|
|
7077
|
-
["at", "direction", "status", "media", "message"],
|
|
7078
|
+
["at", "direction", "status", "delivered", "read", "media", "message"],
|
|
7078
7079
|
messages.map((m) => [
|
|
7079
7080
|
m.created_at,
|
|
7080
7081
|
m.direction,
|
|
7081
7082
|
m.status,
|
|
7083
|
+
m.delivered_at ?? "",
|
|
7084
|
+
m.read_at ?? "",
|
|
7082
7085
|
m.num_media > 0 ? m.num_media : "",
|
|
7083
7086
|
whatsAppMessageText(m)
|
|
7084
7087
|
])
|
|
@@ -7898,6 +7901,22 @@ datasetsCmd.command("create <name>").description(
|
|
|
7898
7901
|
fail(e);
|
|
7899
7902
|
}
|
|
7900
7903
|
});
|
|
7904
|
+
var datasetViewCmd = datasetsCmd.command("view").description("Dataset views: read-only datasets whose rows are a SQL query over another dataset");
|
|
7905
|
+
datasetViewCmd.command("create <source>").description(
|
|
7906
|
+
"Create a view of <source>: a dataset whose rows are --sql over the source (named `data`), run on every read. Readers see only what the query selects, and the source's default filters always apply underneath. Bind a view, not its source, to a page whose visitors should see only part of the data."
|
|
7907
|
+
).requiredOption("--name <name>", "the view's name").requiredOption("--sql <sql>", "a single SELECT over the source, which it names data (@file reads it from a file)").option("--description <text>", "what the view shows and who it is for").action(async (source, opts) => {
|
|
7908
|
+
try {
|
|
7909
|
+
const sql = readMaybeFile(opts.sql) ?? "";
|
|
7910
|
+
const result = await new ErdoClient().createDataset({
|
|
7911
|
+
name: opts.name,
|
|
7912
|
+
view: { source_dataset: source, sql },
|
|
7913
|
+
...opts.description ? { description: opts.description } : {}
|
|
7914
|
+
});
|
|
7915
|
+
console.log(`${result.slug} view of ${source}`);
|
|
7916
|
+
} catch (e) {
|
|
7917
|
+
fail(e);
|
|
7918
|
+
}
|
|
7919
|
+
});
|
|
7901
7920
|
datasetsCmd.command("ensure <purpose>").description(
|
|
7902
7921
|
"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."
|
|
7903
7922
|
).requiredOption("--schema <file>", "JSON file containing { columns: [...] } or a columns array").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) => {
|