@erdoai/cli 0.115.0 → 0.117.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 +39 -0
- 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");
|
|
@@ -7686,11 +7689,39 @@ working hours ${wh.days.join(", ")} ${wh.start}\u2013${wh.end} ${wh.timezone}`)
|
|
|
7686
7689
|
must not affect priority ${rb.priority.forbidden_factors.join(", ")}`);
|
|
7687
7690
|
}
|
|
7688
7691
|
}
|
|
7692
|
+
if (rb.flow) printLeadPlaybookFlow(rb.flow);
|
|
7689
7693
|
if (rb.limits?.length) {
|
|
7690
7694
|
console.log("\nlimits Erdo applied");
|
|
7691
7695
|
for (const l of rb.limits) console.log(` ${l.kind} \u2192 ${l.mode}: ${l.reason}`);
|
|
7692
7696
|
}
|
|
7693
7697
|
}
|
|
7698
|
+
function printLeadPlaybookFlow(flow) {
|
|
7699
|
+
const unfound = (found) => found ? "" : " (passage not found in the text)";
|
|
7700
|
+
if (flow.any_time.length) {
|
|
7701
|
+
console.log("\nat any point, from any stage (not enforced)");
|
|
7702
|
+
for (const r of flow.any_time) {
|
|
7703
|
+
console.log(` ${r.if} \u2192 ${r.exit_to || r.action}${unfound(r.source_found)}`);
|
|
7704
|
+
}
|
|
7705
|
+
}
|
|
7706
|
+
for (const stage of flow.stages) {
|
|
7707
|
+
console.log(`
|
|
7708
|
+
flow: ${stage.name}`);
|
|
7709
|
+
for (const phase of stage.phases) {
|
|
7710
|
+
if (phase.name || phase.aim) console.log(` ${[phase.name, phase.aim].filter(Boolean).join(": ")}`);
|
|
7711
|
+
printAlignedTable(
|
|
7712
|
+
["when", "step", "applies to", "goes to"],
|
|
7713
|
+
phase.steps.map((st) => [
|
|
7714
|
+
st.when || "\u2014",
|
|
7715
|
+
`${st.label}${unfound(st.source_found)}`,
|
|
7716
|
+
st.only_if.map((m) => `${m.key}=${m.values.join("/")}`).join(", ") || "every lead",
|
|
7717
|
+
st.exit_to || "\u2014"
|
|
7718
|
+
])
|
|
7719
|
+
);
|
|
7720
|
+
}
|
|
7721
|
+
}
|
|
7722
|
+
for (const c of flow.conflicts) console.log(`
|
|
7723
|
+
conflict in the text: ${c.description}`);
|
|
7724
|
+
}
|
|
7694
7725
|
function printLeadPlaybookRevision(rev) {
|
|
7695
7726
|
console.log(`revision ${rev.revision} (saved ${rev.saved_at}${rev.saved_by ? ` by ${rev.saved_by}` : ""})`);
|
|
7696
7727
|
console.log(`enabled ${rev.enabled ? "yes" : "no"}`);
|
|
@@ -8157,6 +8188,14 @@ knowledgeCmd.command("attach <objectId> <file>").description(
|
|
|
8157
8188
|
}
|
|
8158
8189
|
}
|
|
8159
8190
|
);
|
|
8191
|
+
var knowledgeAssetsCmd = knowledgeCmd.command("assets").description("Knowledge object files");
|
|
8192
|
+
knowledgeAssetsCmd.command("list <objectId>").description("List files attached to a knowledge object").action(async (objectId) => {
|
|
8193
|
+
try {
|
|
8194
|
+
print(await new ErdoClient().listKnowledgeAssets(objectId));
|
|
8195
|
+
} catch (e) {
|
|
8196
|
+
fail(e);
|
|
8197
|
+
}
|
|
8198
|
+
});
|
|
8160
8199
|
var autoCmd = program.command("automations").description("Scheduled automations (heartbeats)");
|
|
8161
8200
|
autoCmd.command("list").description("List automations").action(async () => {
|
|
8162
8201
|
try {
|