@erdoai/cli 0.116.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.
Files changed (2) hide show
  1. package/dist/index.js +21 -2
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -1605,6 +1605,9 @@ var ErdoClient = class {
1605
1605
  attachKnowledgeAsset(objectID, input) {
1606
1606
  return this.request("POST", `/v1/knowledge/${encodeURIComponent(objectID)}/attachments`, input);
1607
1607
  }
1608
+ listKnowledgeAssets(objectID) {
1609
+ return this.request("GET", `/v1/knowledge/${encodeURIComponent(objectID)}/attachments`);
1610
+ }
1608
1611
  // --- automations (heartbeats) ---
1609
1612
  listHeartbeats() {
1610
1613
  return this.request("GET", "/v1/heartbeats");
@@ -8047,7 +8050,7 @@ pipelinesCmd.command("get <slug>").description("Show one event pipeline \u2014 s
8047
8050
  });
8048
8051
  pipelinesCmd.command("update <slug>").description(
8049
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"
8050
- ).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(
8051
8054
  "--pipeline <jsonOr@file>",
8052
8055
  `replacement ordered actions array as JSON (or @path to a file), e.g. '[{"type":"dataset.write","key_column":"email","dataset_slug":"acme-leads"}]'`
8053
8056
  ).action(
@@ -8080,10 +8083,18 @@ pipelinesCmd.command("update <slug>").description(
8080
8083
  fail(new Error(`--pipeline must be a JSON array of actions: ${e instanceof Error ? e.message : String(e)}`));
8081
8084
  }
8082
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
+ }
8083
8094
  if (Object.keys(body).length === 0) {
8084
8095
  fail(
8085
8096
  new Error(
8086
- "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"
8087
8098
  )
8088
8099
  );
8089
8100
  }
@@ -8185,6 +8196,14 @@ knowledgeCmd.command("attach <objectId> <file>").description(
8185
8196
  }
8186
8197
  }
8187
8198
  );
8199
+ var knowledgeAssetsCmd = knowledgeCmd.command("assets").description("Knowledge object files");
8200
+ knowledgeAssetsCmd.command("list <objectId>").description("List files attached to a knowledge object").action(async (objectId) => {
8201
+ try {
8202
+ print(await new ErdoClient().listKnowledgeAssets(objectId));
8203
+ } catch (e) {
8204
+ fail(e);
8205
+ }
8206
+ });
8188
8207
  var autoCmd = program.command("automations").description("Scheduled automations (heartbeats)");
8189
8208
  autoCmd.command("list").description("List automations").action(async () => {
8190
8209
  try {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@erdoai/cli",
3
- "version": "0.116.0",
3
+ "version": "0.117.1",
4
4
  "description": "Erdo CLI — drive datasets, pages, and evals from the terminal or CI",
5
5
  "type": "module",
6
6
  "bin": {