@erdoai/cli 0.226.0 → 0.228.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 +10 -11
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -2348,10 +2348,12 @@ var ErdoClient = class {
|
|
|
2348
2348
|
);
|
|
2349
2349
|
}
|
|
2350
2350
|
// --- event pipelines ---
|
|
2351
|
-
listEventPipelines(limit, offset) {
|
|
2351
|
+
listEventPipelines(limit, offset, include, summaryFailureBasis) {
|
|
2352
2352
|
const q = new URLSearchParams();
|
|
2353
2353
|
if (limit) q.set("limit", String(limit));
|
|
2354
2354
|
if (offset) q.set("offset", String(offset));
|
|
2355
|
+
if (include) q.set("include", include);
|
|
2356
|
+
if (summaryFailureBasis) q.set("summary_failure_basis", summaryFailureBasis);
|
|
2355
2357
|
const qs = q.toString();
|
|
2356
2358
|
return this.request("GET", `/v1/event-pipelines${qs ? `?${qs}` : ""}`);
|
|
2357
2359
|
}
|
|
@@ -6938,10 +6940,10 @@ reviewsCmd.command("decide <id>").description(
|
|
|
6938
6940
|
);
|
|
6939
6941
|
var pagesCmd = program.command("pages").description("Create and manage pages/artifacts");
|
|
6940
6942
|
var criticCmd = program.command("critic").description("Review campaign creative");
|
|
6941
|
-
criticCmd.command("review").description("Review an ad or document and print per-lens findings").option("-f, --file <path>", "JSON file containing the full critic review request envelope").option("--text <text>", "Document text to review (use instead of --file)").option("--
|
|
6943
|
+
criticCmd.command("review").description("Review an ad or document and print per-lens findings").option("-f, --file <path>", "JSON file containing the full critic review request envelope").option("--text <text>", "Document text to review (use instead of --file)").option("--wait", "Poll a running document review's run until it completes").option("--json", "print the complete raw JSON response").action(async (opts) => {
|
|
6942
6944
|
try {
|
|
6943
6945
|
if (!opts.file && !opts.text) throw new Error("provide --file or --text");
|
|
6944
|
-
const input = opts.text ? { subject_kind: "document", document: { text: opts.text
|
|
6946
|
+
const input = opts.text ? { subject_kind: "document", document: { text: opts.text } } : JSON.parse(readFileSync5(opts.file, "utf8"));
|
|
6945
6947
|
const result = await new ErdoClient().reviewCritic(input);
|
|
6946
6948
|
let finalResult = result;
|
|
6947
6949
|
if (opts.wait && result.status === "running" && result.run_id) {
|
|
@@ -6969,15 +6971,12 @@ criticCmd.command("review").description("Review an ad or document and print per-
|
|
|
6969
6971
|
for (const lens of finalResult.lenses) {
|
|
6970
6972
|
console.log(`
|
|
6971
6973
|
${lens.lens_slug}: ${lens.summary}`);
|
|
6972
|
-
for (const finding of lens.findings) {
|
|
6973
|
-
console.log(` [${finding.severity}] ${finding.issue}`);
|
|
6974
|
+
for (const finding of lens.findings ?? []) {
|
|
6975
|
+
console.log(` [${finding.severity}] ${finding.issue}${finding.unsupported ? " (unsupported)" : ""}`);
|
|
6974
6976
|
console.log(` Evidence: ${finding.evidence}`);
|
|
6977
|
+
if (finding.source_url) console.log(` Source: ${finding.source_url}`);
|
|
6975
6978
|
console.log(` Suggested rewrite: ${finding.suggested_rewrite}`);
|
|
6976
6979
|
}
|
|
6977
|
-
for (const claim of lens.claims ?? []) {
|
|
6978
|
-
console.log(` Claim ${claim.claim_id}: ${claim.verdict} \u2014 ${claim.claim}`);
|
|
6979
|
-
if (claim.note) console.log(` Note: ${claim.note}`);
|
|
6980
|
-
}
|
|
6981
6980
|
}
|
|
6982
6981
|
if (finalResult.usage) console.log(`
|
|
6983
6982
|
Usage: ${JSON.stringify(finalResult.usage)}`);
|
|
@@ -11135,9 +11134,9 @@ connectLinksCmd.command("revoke <id>").description("Revoke a pending connect lin
|
|
|
11135
11134
|
}
|
|
11136
11135
|
});
|
|
11137
11136
|
var pipelinesCmd = program.command("event-pipelines").description("Inspect event pipelines (lead-capture / webhook flows)");
|
|
11138
|
-
pipelinesCmd.command("list").description("List event pipelines in the active org").option("-n, --limit <n>", "max rows", (v) => parseInt(v, 10)).action(async (opts) => {
|
|
11137
|
+
pipelinesCmd.command("list").description("List event pipelines in the active org").option("-n, --limit <n>", "max rows", (v) => parseInt(v, 10)).option("--with-execution-summary", "add each pipeline's recent-execution health (latest outcome, failures in the last 30 days, held refusals) in the same call").option("--failure-basis <basis>", "with --with-execution-summary: outcome (default) or error_text (also counts soft action errors on a 2xx and 202 drops as failed)").action(async (opts) => {
|
|
11139
11138
|
try {
|
|
11140
|
-
print(await new ErdoClient().listEventPipelines(opts.limit));
|
|
11139
|
+
print(await new ErdoClient().listEventPipelines(opts.limit, void 0, opts.withExecutionSummary ? "execution_summary" : void 0, opts.failureBasis));
|
|
11141
11140
|
} catch (e) {
|
|
11142
11141
|
fail(e);
|
|
11143
11142
|
}
|