conduyt 1.39.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.
Files changed (2) hide show
  1. package/dist/index.js +37 -0
  2. 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
@@ -2780,6 +2809,8 @@ smartViews
2780
2809
  .option("--max-attempts <n>", "stop after N calls to a lead, ever (1-20)")
2781
2810
  .option("--per-day <n>", "most calls to one lead per account-local day (1-20); pass 'none' to remove the daily cap")
2782
2811
  .option("--cooldown <minutes>", "minutes to wait between calls to the same lead (0-10080)")
2812
+ .option("--include-unassigned", "also hand out leads nobody owns yet (shared pool; the lead is assigned to the rep at hand-out)")
2813
+ .option("--assigned-only", "the rep's own leads only (turns the shared pool off)")
2783
2814
  .option("--schedule <json>", 'retry schedule JSON, e.g. \'[{"attemptNumber":1,"delayMinutes":0},{"attemptNumber":2,"delayMinutes":60}]\'')
2784
2815
  .action(run(async (client, id, opts) => {
2785
2816
  assertUuid(id, "smart view id");
@@ -2790,6 +2821,12 @@ smartViews
2790
2821
  body.dialEnabled = true;
2791
2822
  if (opts.disable)
2792
2823
  body.dialEnabled = false;
2824
+ if (opts.includeUnassigned && opts.assignedOnly)
2825
+ throw new Error("--include-unassigned and --assigned-only are exclusive");
2826
+ if (opts.includeUnassigned)
2827
+ body.dialIncludeUnassigned = true;
2828
+ if (opts.assignedOnly)
2829
+ body.dialIncludeUnassigned = false;
2793
2830
  const intFlag = (raw, flag, min, max) => {
2794
2831
  if (raw === undefined)
2795
2832
  return undefined;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "conduyt",
3
- "version": "1.39.0",
3
+ "version": "1.41.0",
4
4
  "description": "Command-line interface for Conduyt CRM — manage contacts, deals, pipelines, and run insight queries from your terminal.",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",