@erdoai/cli 0.107.0 → 0.108.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 +31 -3
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -2561,7 +2561,7 @@ businessProfileCmd.command("set").description("Save the organization's business
|
|
|
2561
2561
|
"read the tax id from standard input instead of prompting, for a script \u2014 e.g. `pass show ein | erdo org business-profile set --tax-id-stdin`"
|
|
2562
2562
|
).option("--street <street>", "street address of the registered business").option("--city <city>", "city of the registered business").option("--region <region>", "state or province, e.g. FL").option("--postal-code <code>", "postal or ZIP code").option("--country <iso2>", "two-letter ISO country code, e.g. US").option("--website-url <url>", "the business's own website \u2014 carriers check that it describes it").option("--industry <industry>", "one of the industries listed by: erdo org business-profile get --json").option("--privacy-policy-url <url>", "the business's own privacy policy page (https) \u2014 a campaign without one is rejected").option("--terms-url <url>", "the business's own terms and conditions page (https) \u2014 required for the same reason").option(
|
|
2563
2563
|
"--example-landing-page-url <url>",
|
|
2564
|
-
"a public landing page (https) where people opt in to texts through the form's SMS consent checkbox and
|
|
2564
|
+
"a public landing page (https) where people opt in to texts through the form's SMS consent checkbox, with your privacy policy and terms linked under it \u2014 the opt-in the campaign reviewer opens"
|
|
2565
2565
|
).option("--first-name <name>", "given name of the person carriers may contact").option("--last-name <name>", "family name of that person").option("--title <title>", "their job title in the business's own words, e.g. Managing Partner").option(
|
|
2566
2566
|
"--job-position <position>",
|
|
2567
2567
|
"their role from the fixed list (ceo, cfo, director, general_counsel, gm, vp, other)"
|
|
@@ -7059,7 +7059,7 @@ var leadsCmd = program.command("leads").description(
|
|
|
7059
7059
|
"Read leads in a lead dataset, merge two that are the same person, and run the lead playbook that suggests each lead's next action"
|
|
7060
7060
|
);
|
|
7061
7061
|
leadsCmd.command("get <dataset> <lead>").description(
|
|
7062
|
-
"Read one lead: its permanent canonical_lead_id, the email and phone evidence bound to it, its dataset row, the leads merged into it, and its capture history. <lead> is either the canonical_lead_id UUID or the 22-character lead reference, and an id that has since been merged away resolves to the lead it became \u2014 so an id read off an old capture response still works."
|
|
7062
|
+
"Read one lead: its permanent canonical_lead_id, what it told us (on the form and in every call, chat, text and email reply since), the email and phone evidence bound to it, its dataset row, the leads merged into it, and its capture history. <lead> is either the canonical_lead_id UUID or the 22-character lead reference, and an id that has since been merged away resolves to the lead it became \u2014 so an id read off an old capture response still works."
|
|
7063
7063
|
).option("--json", "print the raw JSON result instead of a summary").action(async (dataset, lead, opts) => {
|
|
7064
7064
|
try {
|
|
7065
7065
|
const res = await new ErdoClient().getLead(dataset, lead);
|
|
@@ -7145,7 +7145,7 @@ leadsCmd.command("merge <dataset> <survivor>").description(
|
|
|
7145
7145
|
console.log(`Already one lead: ${res.absorbed_lead_id} resolves to ${res.lead.canonical_lead_id}.`);
|
|
7146
7146
|
} else {
|
|
7147
7147
|
console.log(
|
|
7148
|
-
`Merged ${res.absorbed_lead_id} into ${res.lead.canonical_lead_id} \u2014 ${res.aliases_moved} contact ${res.aliases_moved === 1 ? "alias" : "aliases"} moved, ${res.rows_combined} ${res.rows_combined === 1 ? "row" : "rows"} combined.`
|
|
7148
|
+
`Merged ${res.absorbed_lead_id} into ${res.lead.canonical_lead_id} \u2014 ${res.aliases_moved} contact ${res.aliases_moved === 1 ? "alias" : "aliases"} and ${res.details_moved ?? 0} ${res.details_moved === 1 ? "detail" : "details"} moved, ${res.rows_combined} ${res.rows_combined === 1 ? "row" : "rows"} combined.`
|
|
7149
7149
|
);
|
|
7150
7150
|
}
|
|
7151
7151
|
printLead(res.lead);
|
|
@@ -7552,6 +7552,24 @@ function printRecordedLeadDecision(a) {
|
|
|
7552
7552
|
console.log(`Recorded ${a.action_kind} on lead ${a.lead_reference}${a.action_kind === "hold" ? until : ""}.`);
|
|
7553
7553
|
if (a.rationale) console.log(a.rationale);
|
|
7554
7554
|
}
|
|
7555
|
+
function leadDetailSource(kind) {
|
|
7556
|
+
switch (kind) {
|
|
7557
|
+
case "form":
|
|
7558
|
+
return "form";
|
|
7559
|
+
case "phone_call":
|
|
7560
|
+
return "call";
|
|
7561
|
+
case "widget_conversation":
|
|
7562
|
+
return "website chat";
|
|
7563
|
+
case "sms":
|
|
7564
|
+
return "text";
|
|
7565
|
+
case "whatsapp":
|
|
7566
|
+
return "WhatsApp";
|
|
7567
|
+
case "email_reply":
|
|
7568
|
+
return "email reply";
|
|
7569
|
+
default:
|
|
7570
|
+
return kind;
|
|
7571
|
+
}
|
|
7572
|
+
}
|
|
7555
7573
|
function printLead(lead) {
|
|
7556
7574
|
console.log(`lead ${lead.canonical_lead_id}`);
|
|
7557
7575
|
console.log(`reference ${lead.reference}`);
|
|
@@ -7565,6 +7583,16 @@ function printLead(lead) {
|
|
|
7565
7583
|
if (lead.absorbed_lead_ids?.length) {
|
|
7566
7584
|
console.log(`absorbed ${lead.absorbed_lead_ids.join(", ")}`);
|
|
7567
7585
|
}
|
|
7586
|
+
if (lead.details?.length) {
|
|
7587
|
+
console.log("\nwhat they told us");
|
|
7588
|
+
printAlignedTable(
|
|
7589
|
+
["question", "answer", "from", "when"],
|
|
7590
|
+
lead.details.flatMap((d) => [
|
|
7591
|
+
[d.label, d.value, leadDetailSource(d.source_kind), d.observed_at],
|
|
7592
|
+
...(d.earlier ?? []).map((e) => ["", ` earlier: ${e.value}`, leadDetailSource(e.source_kind), e.observed_at])
|
|
7593
|
+
])
|
|
7594
|
+
);
|
|
7595
|
+
}
|
|
7568
7596
|
if (lead.aliases?.length) {
|
|
7569
7597
|
console.log("\ncontact evidence");
|
|
7570
7598
|
printAlignedTable(
|