@erdoai/cli 0.38.0 → 0.39.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.
Files changed (2) hide show
  1. package/dist/index.js +23 -0
  2. package/package.json +2 -2
package/dist/index.js CHANGED
@@ -750,6 +750,13 @@ var ErdoClient = class {
750
750
  runHeartbeat(id) {
751
751
  return this.request("POST", `/v1/heartbeats/${encodeURIComponent(id)}/run`, {});
752
752
  }
753
+ setHeartbeatState(id, state) {
754
+ return this.request(
755
+ "POST",
756
+ `/v1/heartbeats/${encodeURIComponent(id)}/state`,
757
+ { state }
758
+ );
759
+ }
753
760
  // --- kv (named key/value stores, a.k.a. collections) ---
754
761
  listKVStores() {
755
762
  return this.request("GET", "/v1/kv");
@@ -3057,6 +3064,22 @@ autoCmd.command("run <id>").description("Trigger an automation now").action(asyn
3057
3064
  fail(e);
3058
3065
  }
3059
3066
  });
3067
+ autoCmd.command("disable <id>").description("Disable an automation so it stops running").action(async (id) => {
3068
+ try {
3069
+ const h = await new ErdoClient().setHeartbeatState(id, "disabled");
3070
+ console.log(`${h.id} ${h.state} ${h.name}`);
3071
+ } catch (e) {
3072
+ fail(e);
3073
+ }
3074
+ });
3075
+ autoCmd.command("enable <id>").description("Re-enable a disabled automation").action(async (id) => {
3076
+ try {
3077
+ const h = await new ErdoClient().setHeartbeatState(id, "active");
3078
+ console.log(`${h.id} ${h.state} ${h.name}`);
3079
+ } catch (e) {
3080
+ fail(e);
3081
+ }
3082
+ });
3060
3083
  var kvCmd = program.command("kv").description("Named key/value stores");
3061
3084
  kvCmd.command("list").description("List KV stores").action(async () => {
3062
3085
  try {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@erdoai/cli",
3
- "version": "0.38.0",
4
- "description": "Erdo CLI drive datasets, pages, and evals from the terminal or CI",
3
+ "version": "0.39.0",
4
+ "description": "Erdo CLI \u2014 drive datasets, pages, and evals from the terminal or CI",
5
5
  "type": "module",
6
6
  "bin": {
7
7
  "erdo": "dist/index.js"