@erdoai/cli 0.124.0 → 0.125.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 +17 -0
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1660,6 +1660,12 @@ var ErdoClient = class {
|
|
|
1660
1660
|
runHeartbeat(id) {
|
|
1661
1661
|
return this.request("POST", `/v1/heartbeats/${encodeURIComponent(id)}/run`, {});
|
|
1662
1662
|
}
|
|
1663
|
+
listHeartbeatExecutions(id, limit = 10) {
|
|
1664
|
+
if (!Number.isInteger(limit) || limit < 1 || limit > 100) {
|
|
1665
|
+
throw new Error("limit must be an integer between 1 and 100");
|
|
1666
|
+
}
|
|
1667
|
+
return this.request("GET", `/v1/heartbeats/${encodeURIComponent(id)}/executions?limit=${limit}`);
|
|
1668
|
+
}
|
|
1663
1669
|
updateHeartbeat(id, body) {
|
|
1664
1670
|
return this.request(
|
|
1665
1671
|
"PATCH",
|
|
@@ -8451,6 +8457,17 @@ autoCmd.command("list").description("List automations").action(async () => {
|
|
|
8451
8457
|
fail(e);
|
|
8452
8458
|
}
|
|
8453
8459
|
});
|
|
8460
|
+
autoCmd.command("executions <id>").description("Read recent execution history for one automation or refresh job").option("--limit <n>", "Number of executions (integer 1\u2013100)", "10").action(async (id, opts) => {
|
|
8461
|
+
try {
|
|
8462
|
+
const limit = Number(opts.limit);
|
|
8463
|
+
if (!/^\d+$/.test(opts.limit) || !Number.isInteger(limit) || limit < 1 || limit > 100) {
|
|
8464
|
+
throw new Error("limit must be an integer between 1 and 100");
|
|
8465
|
+
}
|
|
8466
|
+
print(await new ErdoClient().listHeartbeatExecutions(id, limit));
|
|
8467
|
+
} catch (e) {
|
|
8468
|
+
fail(e);
|
|
8469
|
+
}
|
|
8470
|
+
});
|
|
8454
8471
|
autoCmd.command("run <id>").description("Trigger an automation now").action(async (id) => {
|
|
8455
8472
|
try {
|
|
8456
8473
|
print(await new ErdoClient().runHeartbeat(id));
|