@erdoai/cli 0.117.0 → 0.117.1
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 -2
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -8050,7 +8050,7 @@ pipelinesCmd.command("get <slug>").description("Show one event pipeline \u2014 s
|
|
|
8050
8050
|
});
|
|
8051
8051
|
pipelinesCmd.command("update <slug>").description(
|
|
8052
8052
|
"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"
|
|
8053
|
-
).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("--turnstile <jsonOr@file>", `optional managed form protection settings; use @file for widget credentials, or '{"enabled":false}' to disable`).option(
|
|
8053
|
+
).option("--sample-payload <jsonOr@file>", "complete representative event used to validate and initialize target contracts; JSON or @path").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("--turnstile <jsonOr@file>", `optional managed form protection settings; use @file for widget credentials, or '{"enabled":false}' to disable`).option(
|
|
8054
8054
|
"--pipeline <jsonOr@file>",
|
|
8055
8055
|
`replacement ordered actions array as JSON (or @path to a file), e.g. '[{"type":"dataset.write","key_column":"email","dataset_slug":"acme-leads"}]'`
|
|
8056
8056
|
).action(
|
|
@@ -8083,10 +8083,18 @@ pipelinesCmd.command("update <slug>").description(
|
|
|
8083
8083
|
fail(new Error(`--pipeline must be a JSON array of actions: ${e instanceof Error ? e.message : String(e)}`));
|
|
8084
8084
|
}
|
|
8085
8085
|
}
|
|
8086
|
+
const sampleRaw = readMaybeFile(opts.samplePayload);
|
|
8087
|
+
if (sampleRaw !== void 0) {
|
|
8088
|
+
try {
|
|
8089
|
+
body.sample_payload = JSON.parse(sampleRaw);
|
|
8090
|
+
} catch {
|
|
8091
|
+
fail(new Error("--sample-payload must be valid JSON"));
|
|
8092
|
+
}
|
|
8093
|
+
}
|
|
8086
8094
|
if (Object.keys(body).length === 0) {
|
|
8087
8095
|
fail(
|
|
8088
8096
|
new Error(
|
|
8089
|
-
"nothing to update \u2014 pass at least one of --name, --description, --state, --transform-js, --pipeline, --turnstile"
|
|
8097
|
+
"nothing to update \u2014 pass at least one of --name, --description, --state, --transform-js, --pipeline, --turnstile, --sample-payload"
|
|
8090
8098
|
)
|
|
8091
8099
|
);
|
|
8092
8100
|
}
|