conduyt 1.40.0 → 1.41.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 +29 -0
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1984,6 +1984,14 @@ lifecycle
|
|
|
1984
1984
|
customs,
|
|
1985
1985
|
effective: [...DEFAULTS, ...customs.filter((c) => !DEFAULTS.includes(c.toLowerCase()))],
|
|
1986
1986
|
},
|
|
1987
|
+
// (09-15) which lead status each call disposition sets when picked; {} = none (lifecycle set-disposition-status)
|
|
1988
|
+
dispositionStatusMap: (() => {
|
|
1989
|
+
const cd = raw.callDispositions;
|
|
1990
|
+
const map = cd && typeof cd === "object" && !Array.isArray(cd) ? cd.statusMap : undefined;
|
|
1991
|
+
return map && typeof map === "object" && !Array.isArray(map)
|
|
1992
|
+
? Object.fromEntries(Object.entries(map).filter((e) => typeof e[1] === "string"))
|
|
1993
|
+
: {};
|
|
1994
|
+
})(),
|
|
1987
1995
|
intakeDeals,
|
|
1988
1996
|
...(intakeDeals === null
|
|
1989
1997
|
? {
|
|
@@ -2069,6 +2077,27 @@ lifecycle
|
|
|
2069
2077
|
throw new Error(`Invalid status name '${bad}' — 1-40 chars; letters, numbers, spaces, - and _ only.`);
|
|
2070
2078
|
return client.patch("/api/v1/settings", { masterStatuses: clean });
|
|
2071
2079
|
}));
|
|
2080
|
+
lifecycle
|
|
2081
|
+
.command("set-disposition-status <disposition> <status>")
|
|
2082
|
+
.description("Map a call disposition to the lead status it sets when picked (by a rep after a call or by the AI auto-disposition): e.g. `not-interested lost`, `sale-closed won`, `interested working`. Pass `none` as the status to remove the mapping. Dispositions are built-in values (interested, not-interested, callback-requested, appointment-set, follow-up-needed, sale-closed, dnc-requested, voicemail, no-answer, wrong-number) or the account's custom outcomes; statuses are open|won|lost|abandoned|disqualified or an account custom (`lifecycle set-master-statuses`). Terminal statuses close the lead and stop its automations; a lead a deal has won is never moved. The rest of the map and every other disposition setting stay as they are.")
|
|
2083
|
+
.action(run(async (client, disposition, status) => {
|
|
2084
|
+
const d = disposition.trim().toLowerCase().replace(/[^a-z0-9]+/g, "-").replace(/^-|-$/g, "");
|
|
2085
|
+
const st = status.trim().toLowerCase();
|
|
2086
|
+
if (!d)
|
|
2087
|
+
throw new Error("The disposition must not be blank.");
|
|
2088
|
+
if (!st)
|
|
2089
|
+
throw new Error("The status must not be blank; pass 'none' to remove the mapping.");
|
|
2090
|
+
if (d.length > 40 || st.length > 40)
|
|
2091
|
+
throw new Error("Dispositions and statuses are at most 40 characters.");
|
|
2092
|
+
const current = (await client.get("/api/v1/settings"));
|
|
2093
|
+
const stored = current?.data?.callDispositions?.statusMap;
|
|
2094
|
+
const next = Object.fromEntries(Object.entries(stored && typeof stored === "object" ? stored : {}).filter((e) => typeof e[1] === "string"));
|
|
2095
|
+
if (st === "none")
|
|
2096
|
+
delete next[d];
|
|
2097
|
+
else
|
|
2098
|
+
next[d] = st;
|
|
2099
|
+
return client.patch("/api/v1/settings", { callDispositions: { statusMap: next } });
|
|
2100
|
+
}));
|
|
2072
2101
|
// ---- account default columns for the Contacts list (tri-surface parity, 2026-09-03) ----
|
|
2073
2102
|
const CONTACT_COLUMN_IDS = ["name", "email", "phone", "company", "source", "tags", "score", "intent", "stage", "createdAt", "lastActivity", "assignedTo", "address", "city", "state", "zip"];
|
|
2074
2103
|
lifecycle
|
package/package.json
CHANGED