@erdoai/cli 0.114.0 → 0.115.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 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -7429,7 +7429,7 @@ unavailable: ${source} \u2014 ${reason}`);
|
|
|
7429
7429
|
fail(e);
|
|
7430
7430
|
}
|
|
7431
7431
|
});
|
|
7432
|
-
var leadNextActionsCmd = leadsCmd.command("next-actions").description("Read the suggested next action for each lead, hold or
|
|
7432
|
+
var leadNextActionsCmd = leadsCmd.command("next-actions").description("Read the suggested next action for each lead, hold, close or start a lead, and dry-run the playbook on one lead");
|
|
7433
7433
|
leadNextActionsCmd.command("list").description(
|
|
7434
7434
|
"List each lead's current suggestion, highest priority first. --status pending_approval lists the cards waiting for a person."
|
|
7435
7435
|
).option("--dataset <slug>", "narrow to one lead dataset").option(
|
|
@@ -7542,6 +7542,22 @@ leadNextActionsCmd.command("close <dataset> <lead>").description(
|
|
|
7542
7542
|
fail(e);
|
|
7543
7543
|
}
|
|
7544
7544
|
});
|
|
7545
|
+
leadNextActionsCmd.command("start <dataset> <lead>").description(
|
|
7546
|
+
"Have the follow-up engine work this lead now. By itself the engine only reaches leads captured after it was switched on, and never test traffic; this brings one of those in, and Erdo decides for it straight away. With --reset, start the lead over: anything open is withdrawn and Erdo reads the lead afresh from now, as if it had just been captured. Nothing is deleted, and opt-outs still apply. Refused when the engine is switched off, or (without --reset) when it already has the lead."
|
|
7547
|
+
).option("--reset", "start the lead over: Erdo reads nothing from before now").option("--note <text>", "why, in the desk's words").option("--json", "print the raw JSON result instead of a summary").action(async (dataset, lead, opts) => {
|
|
7548
|
+
try {
|
|
7549
|
+
const res = await new ErdoClient().recordLeadNextAction(dataset, lead, { kind: "start", reset: opts.reset, note: opts.note });
|
|
7550
|
+
if (opts.json) {
|
|
7551
|
+
print(res);
|
|
7552
|
+
return;
|
|
7553
|
+
}
|
|
7554
|
+
console.log(
|
|
7555
|
+
opts.reset ? `Started lead ${res.lead_reference} over. Erdo is deciding its first step now.` : `Started follow-up on lead ${res.lead_reference}. Erdo is deciding its next step now.`
|
|
7556
|
+
);
|
|
7557
|
+
} catch (e) {
|
|
7558
|
+
fail(e);
|
|
7559
|
+
}
|
|
7560
|
+
});
|
|
7545
7561
|
leadNextActionsCmd.command("resume <dataset> <lead>").description(
|
|
7546
7562
|
"End the lead's hold or close now, so Erdo works the lead again. Nothing is sent from here: Erdo decides for the lead on its next pass, within about fifteen minutes. Refused when the lead is not held or closed."
|
|
7547
7563
|
).option("--json", "print the raw JSON result instead of a summary").action(async (dataset, lead, opts) => {
|