@erdoai/cli 0.137.0 → 0.138.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.
- package/dist/index.js +24 -8
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1327,8 +1327,9 @@ var ErdoClient = class {
|
|
|
1327
1327
|
input
|
|
1328
1328
|
);
|
|
1329
1329
|
}
|
|
1330
|
-
// Cannot be undone. Removes the lead from
|
|
1331
|
-
//
|
|
1330
|
+
// Cannot be undone. Removes the lead from Erdo so the same phone and email
|
|
1331
|
+
// can arrive as a new lead (details captured from conversations stay in the
|
|
1332
|
+
// pipeline's run history). Staff-only, for demos and tests. A
|
|
1332
1333
|
// retry of a delete that stopped part-way resumes it, and a lead already
|
|
1333
1334
|
// deleted answers "already_deleted".
|
|
1334
1335
|
deleteLead(datasetSlug, lead) {
|
|
@@ -1866,6 +1867,7 @@ var ErdoClient = class {
|
|
|
1866
1867
|
if (opts.since) params.set("since", opts.since);
|
|
1867
1868
|
if (opts.limit) params.set("limit", String(opts.limit));
|
|
1868
1869
|
if (opts.offset) params.set("offset", String(opts.offset));
|
|
1870
|
+
if (opts.lapsed_offset) params.set("lapsed_offset", String(opts.lapsed_offset));
|
|
1869
1871
|
const qs = params.toString();
|
|
1870
1872
|
return this.request("GET", `/v1/decisions${qs ? `?${qs}` : ""}`);
|
|
1871
1873
|
}
|
|
@@ -4555,7 +4557,10 @@ var decisionsCmd = program.command("decisions").description(
|
|
|
4555
4557
|
"The decision record \u2014 what your organization committed to, whether the change actually happened, and what the evidence said afterwards"
|
|
4556
4558
|
);
|
|
4557
4559
|
function decisionLine(d) {
|
|
4558
|
-
const parts = [d.slug, d.status];
|
|
4560
|
+
const parts = [d.slug, d.lapsed ? "lapsed" : d.status];
|
|
4561
|
+
if (d.review_by) parts.push(`review_by=${d.review_by}`);
|
|
4562
|
+
if (d.age_seconds !== void 0) parts.push(`age_seconds=${d.age_seconds}`);
|
|
4563
|
+
if (d.exit_condition) parts.push(`exit_condition=${d.exit_condition}`);
|
|
4559
4564
|
if (d.execution_status) parts.push(d.execution_status);
|
|
4560
4565
|
parts.push(d.what);
|
|
4561
4566
|
if (d.outcome_label) {
|
|
@@ -4614,7 +4619,11 @@ decisionsCmd.command("list").description("List decisions, newest first").option(
|
|
|
4614
4619
|
).option("--applicability <kind>", "standing | one_shot").option("--outcome <outcome>", "only decisions with a settled effect that came back met | not_met | inconclusive").option(
|
|
4615
4620
|
"--approval <id>",
|
|
4616
4621
|
"only the decisions produced by answering this approval (approvals are referenced by id, not slug)"
|
|
4617
|
-
).option("--since <timestamp>", "inclusive RFC3339 lower bound on the latest known decision movement").option("-l, --limit <n>", "max rows (default 50, max 200)", (v) => parseInt(v, 10)).option("--offset <n>", "pagination offset", (v) => parseInt(v, 10)).option(
|
|
4622
|
+
).option("--since <timestamp>", "inclusive RFC3339 lower bound on the latest known decision movement").option("-l, --limit <n>", "max rows (default 50, max 200)", (v) => parseInt(v, 10)).option("--offset <n>", "pagination offset", (v) => parseInt(v, 10)).option(
|
|
4623
|
+
"--lapsed-offset <n>",
|
|
4624
|
+
"pagination offset into lapsed commitments (with --applicability standing; paged separately from --offset)",
|
|
4625
|
+
(v) => parseInt(v, 10)
|
|
4626
|
+
).option("--json", "output raw JSON").action(
|
|
4618
4627
|
async (opts) => {
|
|
4619
4628
|
try {
|
|
4620
4629
|
const res = await new ErdoClient().listDecisions({
|
|
@@ -4630,17 +4639,22 @@ decisionsCmd.command("list").description("List decisions, newest first").option(
|
|
|
4630
4639
|
approval_id: opts.approval,
|
|
4631
4640
|
since: opts.since,
|
|
4632
4641
|
limit: opts.limit,
|
|
4633
|
-
offset: opts.offset
|
|
4642
|
+
offset: opts.offset,
|
|
4643
|
+
lapsed_offset: opts.lapsedOffset
|
|
4634
4644
|
});
|
|
4635
4645
|
if (opts.json) {
|
|
4636
4646
|
print(res);
|
|
4637
4647
|
return;
|
|
4638
4648
|
}
|
|
4639
|
-
if (!res.decisions.length) {
|
|
4649
|
+
if (!res.decisions.length && !res.lapsed_decisions?.length) {
|
|
4640
4650
|
console.log("No decisions match. Widen the filters, or check that the work engine is on for this org.");
|
|
4641
4651
|
return;
|
|
4642
4652
|
}
|
|
4643
4653
|
for (const d of res.decisions) console.log(decisionLine(d));
|
|
4654
|
+
if (res.lapsed_decisions?.length) {
|
|
4655
|
+
console.log("Lapsed commitments (no longer current):");
|
|
4656
|
+
for (const d of res.lapsed_decisions) console.log(decisionLine(d));
|
|
4657
|
+
}
|
|
4644
4658
|
} catch (e) {
|
|
4645
4659
|
fail(e);
|
|
4646
4660
|
}
|
|
@@ -4649,13 +4663,15 @@ decisionsCmd.command("list").description("List decisions, newest first").option(
|
|
|
4649
4663
|
function renderDecision(detail) {
|
|
4650
4664
|
const d = detail.decision;
|
|
4651
4665
|
console.log(d.what);
|
|
4666
|
+
const applicability = d.lapsed ? `lapsed on ${d.review_by ?? "its review deadline"} \u2014 no longer current` : d.applicability === "standing" ? "standing (until superseded)" : "one-off authorization";
|
|
4652
4667
|
const facts = [
|
|
4653
4668
|
["status", d.status],
|
|
4654
4669
|
["class", d.decision_class],
|
|
4655
4670
|
["source", d.source],
|
|
4656
|
-
["applies",
|
|
4671
|
+
["applies", applicability],
|
|
4657
4672
|
["decided by", d.decided_by_name ? `${d.decided_by_name} (${d.decider_kind})` : d.decider_kind]
|
|
4658
4673
|
];
|
|
4674
|
+
if (d.review_by) facts.push(["review by", d.review_by]);
|
|
4659
4675
|
if (d.subject_label) facts.push(["subject", d.subject_label]);
|
|
4660
4676
|
if (d.execution_status) facts.push(["execution", d.execution_status]);
|
|
4661
4677
|
if (d.outcome_status) facts.push(["outcome", d.outcome_label || d.outcome_status]);
|
|
@@ -7823,7 +7839,7 @@ leadsCmd.command("merge <dataset> <survivor>").description(
|
|
|
7823
7839
|
}
|
|
7824
7840
|
);
|
|
7825
7841
|
leadsCmd.command("delete <dataset> <lead>").description(
|
|
7826
|
-
"Delete a lead from
|
|
7842
|
+
"Delete a lead from Erdo: its row and identity, its text and WhatsApp conversations, its calls and website chats, its emails, and the follow-up engine's decisions about it. The same phone and email submitted again then make a new lead with nothing behind it. This cannot be undone. A staff tool for demos and tests: copies held by providers (message bodies, call audio, sent mail) and in logs stay, and so do opt-outs and the contact details a call, text or chat gave Erdo, in the Conversation leads pipeline's run history. A phone or email another lead in the organization also holds is not released until that lead is deleted too. Read the lead with `leads get` before running it."
|
|
7827
7843
|
).option("-y, --yes", "skip the confirmation prompt").option("--json", "print the raw JSON result instead of a summary").action(async (dataset, lead, opts) => {
|
|
7828
7844
|
try {
|
|
7829
7845
|
if (!opts.yes) {
|