@erdoai/cli 0.59.0 → 0.60.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 +46 -0
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -870,6 +870,9 @@ var ErdoClient = class {
|
|
|
870
870
|
getEventPipeline(slug) {
|
|
871
871
|
return this.request("GET", `/v1/event-pipelines/${encodeURIComponent(slug)}`);
|
|
872
872
|
}
|
|
873
|
+
updateEventPipeline(slug, body) {
|
|
874
|
+
return this.request("PUT", `/v1/event-pipelines/${encodeURIComponent(slug)}`, body);
|
|
875
|
+
}
|
|
873
876
|
listEventPipelineExecutions(slug, limit, offset) {
|
|
874
877
|
const q = new URLSearchParams();
|
|
875
878
|
if (limit) q.set("limit", String(limit));
|
|
@@ -1400,6 +1403,12 @@ function printPageReview(review) {
|
|
|
1400
1403
|
return;
|
|
1401
1404
|
}
|
|
1402
1405
|
console.error(`review: ${review.summary || `${review.issues?.length ?? 0} issue(s)`}`);
|
|
1406
|
+
if (review.lighthouse) {
|
|
1407
|
+
const score = (value) => value === void 0 ? "unavailable" : `${value}/100`;
|
|
1408
|
+
console.error(
|
|
1409
|
+
` lighthouse (mobile): performance ${score(review.lighthouse.performance)}, accessibility ${score(review.lighthouse.accessibility)}, best practices ${score(review.lighthouse.best_practices)}, seo ${score(review.lighthouse.seo)}`
|
|
1410
|
+
);
|
|
1411
|
+
}
|
|
1403
1412
|
for (const issue of review.issues || []) {
|
|
1404
1413
|
console.error(` [${issue.severity}/${issue.category}] ${issue.description}`);
|
|
1405
1414
|
if (issue.suggestion) console.error(` fix: ${issue.suggestion}`);
|
|
@@ -4087,6 +4096,43 @@ pipelinesCmd.command("get <slug>").description("Show one event pipeline \u2014 s
|
|
|
4087
4096
|
fail(e);
|
|
4088
4097
|
}
|
|
4089
4098
|
});
|
|
4099
|
+
pipelinesCmd.command("update <slug>").description(
|
|
4100
|
+
"Update an event pipeline's editable fields \u2014 omitted fields keep their current values (merge). Use get first for the current transform/actions; --transform-js/--pipeline accept @file"
|
|
4101
|
+
).option("--name <name>", "new name").option("--description <description>", "new description").option("--state <state>", "new state: active, disabled, or proposed").option("--transform-js <jsOr@file>", "new transform \u2014 function transform(event) { \u2026 } (or @path to a file)").option(
|
|
4102
|
+
"--pipeline <jsonOr@file>",
|
|
4103
|
+
`replacement ordered actions array as JSON (or @path to a file), e.g. '[{"type":"dataset.write","key_column":"email","dataset_slug":"acme-leads"}]'`
|
|
4104
|
+
).action(
|
|
4105
|
+
async (slug, opts) => {
|
|
4106
|
+
const body = {};
|
|
4107
|
+
if (opts.name !== void 0) body.name = opts.name;
|
|
4108
|
+
if (opts.description !== void 0) body.description = opts.description;
|
|
4109
|
+
if (opts.state !== void 0) body.state = opts.state;
|
|
4110
|
+
const transformJs = readMaybeFile(opts.transformJs);
|
|
4111
|
+
if (transformJs !== void 0) body.transform_js = transformJs;
|
|
4112
|
+
const pipelineRaw = readMaybeFile(opts.pipeline);
|
|
4113
|
+
if (pipelineRaw !== void 0) {
|
|
4114
|
+
try {
|
|
4115
|
+
const steps = JSON.parse(pipelineRaw);
|
|
4116
|
+
if (!Array.isArray(steps)) throw new Error("not a JSON array");
|
|
4117
|
+
body.pipeline = steps;
|
|
4118
|
+
} catch (e) {
|
|
4119
|
+
fail(new Error(`--pipeline must be a JSON array of actions: ${e instanceof Error ? e.message : String(e)}`));
|
|
4120
|
+
}
|
|
4121
|
+
}
|
|
4122
|
+
if (Object.keys(body).length === 0) {
|
|
4123
|
+
fail(
|
|
4124
|
+
new Error(
|
|
4125
|
+
"nothing to update \u2014 pass at least one of --name, --description, --state, --transform-js, --pipeline"
|
|
4126
|
+
)
|
|
4127
|
+
);
|
|
4128
|
+
}
|
|
4129
|
+
try {
|
|
4130
|
+
print(await new ErdoClient().updateEventPipeline(slug, body));
|
|
4131
|
+
} catch (e) {
|
|
4132
|
+
fail(e);
|
|
4133
|
+
}
|
|
4134
|
+
}
|
|
4135
|
+
);
|
|
4090
4136
|
filterCmd.command("add <slug>").description("Add a filter to a dataset (default-on unless --no-default)").requiredOption(
|
|
4091
4137
|
"--where <condition>",
|
|
4092
4138
|
"a '<column> <operator> <value>' condition (repeatable, AND-combined). A filter KEEPS matching rows, so exclude by matching what you want to keep: --where 'email not_contains @example.com' (label 'Exclude test submissions') hides the test rows; --where 'email contains @acme.com' would keep ONLY @acme.com rows. Operators: " + OPERATORS.join(", ") + " (for 'between' use 'col between 10,100')",
|