conduyt 1.27.0 → 1.29.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 +79 -0
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -2222,6 +2222,67 @@ ringGroups
2222
2222
  // bottom. Dialing settings + reorder are admin-only in the API.
2223
2223
  // ---------------------------------------------------------------------------
2224
2224
  // ── Custom reports: the Lead Activity grid (reporting P1, 2026-09-10) ──────────────────────────────────────────────
2225
+ const dashboards = program.command("dashboards").description("Dashboards: boards of tiles (a saved report as a KPI, chart, table or pivot) with one set of filters for the whole board");
2226
+ dashboards
2227
+ .command("list")
2228
+ .description("List the dashboards this key can open")
2229
+ .action(run(async (client) => client.get("/api/v1/dashboards")));
2230
+ dashboards
2231
+ .command("create")
2232
+ .description("Create a dashboard from JSON ({ name, description?, filters?: { dateRange, start, end, assignedTo[], sources[] }, isShared? })")
2233
+ .requiredOption("--json <definition>", "the definition as JSON (or @file)")
2234
+ .action(run(async (client, opts) => {
2235
+ const raw = opts.json.startsWith("@") ? (await import("node:fs")).readFileSync(opts.json.slice(1), "utf8") : opts.json;
2236
+ const body = JSON.parse(raw);
2237
+ if (typeof body.name !== "string")
2238
+ throw new Error("The definition needs a name.");
2239
+ return client.post("/api/v1/dashboards", body);
2240
+ }));
2241
+ dashboards
2242
+ .command("get <id>")
2243
+ .description("One dashboard with its tiles")
2244
+ .action(run(async (client, id) => { assertUuid(id, "dashboard id"); return client.get(`/api/v1/dashboards/${id}`); }));
2245
+ dashboards
2246
+ .command("update <id>")
2247
+ .description("Patch a dashboard from JSON (name, description, filters, isShared, tileOrder: [tileId...])")
2248
+ .requiredOption("--json <patch>", "the patch as JSON (or @file)")
2249
+ .action(run(async (client, id, opts) => {
2250
+ assertUuid(id, "dashboard id");
2251
+ const raw = opts.json.startsWith("@") ? (await import("node:fs")).readFileSync(opts.json.slice(1), "utf8") : opts.json;
2252
+ return client.patch(`/api/v1/dashboards/${id}`, JSON.parse(raw));
2253
+ }));
2254
+ dashboards
2255
+ .command("delete <id>")
2256
+ .description("Delete a dashboard (its tiles go with it; the reports stay)")
2257
+ .action(run(async (client, id) => { assertUuid(id, "dashboard id"); return client.del(`/api/v1/dashboards/${id}`); }));
2258
+ dashboards
2259
+ .command("add-tile <id>")
2260
+ .description("Pin a saved report to a dashboard")
2261
+ .requiredOption("--report <reportId>", "saved report id")
2262
+ .requiredOption("--kind <kind>", "kpi | chart | table | pivot")
2263
+ .option("--style <style>", "kpi: ledger | trend | goal; chart: ranked | target | focus")
2264
+ .option("--size <size>", "s | m | l", "m")
2265
+ .option("--title <title>", "tile title (defaults to the report name)")
2266
+ .option("--target <n>", "goal KPI target")
2267
+ .action(run(async (client, id, opts) => {
2268
+ assertUuid(id, "dashboard id");
2269
+ assertUuid(opts.report, "report id");
2270
+ return client.post(`/api/v1/dashboards/${id}/tiles`, { savedReportId: opts.report, kind: opts.kind, style: opts.style, size: opts.size, title: opts.title, target: opts.target !== undefined ? Number(opts.target) : undefined });
2271
+ }));
2272
+ dashboards
2273
+ .command("update-tile <id> <tileId>")
2274
+ .description("Change a tile from JSON (style, size, title, target; null clears)")
2275
+ .requiredOption("--json <patch>", "the patch as JSON")
2276
+ .action(run(async (client, id, tileId, opts) => { assertUuid(id, "dashboard id"); assertUuid(tileId, "tile id"); return client.patch(`/api/v1/dashboards/${id}/tiles/${tileId}`, JSON.parse(opts.json)); }));
2277
+ dashboards
2278
+ .command("remove-tile <id> <tileId>")
2279
+ .description("Remove a tile from a dashboard")
2280
+ .action(run(async (client, id, tileId) => { assertUuid(id, "dashboard id"); assertUuid(tileId, "tile id"); return client.del(`/api/v1/dashboards/${id}/tiles/${tileId}`); }));
2281
+ dashboards
2282
+ .command("run <id>")
2283
+ .description("Run every tile with the board filters (or --filters JSON for this run only)")
2284
+ .option("--filters <json>", "board filters for this run")
2285
+ .action(run(async (client, id, opts) => { assertUuid(id, "dashboard id"); return client.post(`/api/v1/dashboards/${id}/run`, opts.filters ? { filters: JSON.parse(opts.filters) } : {}); }));
2225
2286
  const reports = program.command("reports").description("Custom reports: the Lead Activity grid (rollups, custom fields, Smart View populations, CSV/XLSX export)");
2226
2287
  reports
2227
2288
  .command("fields <entity>")
@@ -2427,6 +2488,24 @@ reports
2427
2488
  }
2428
2489
  return client.get(`/api/v1/reports/speed-to-lead?${params.toString()}`);
2429
2490
  }));
2491
+ reports
2492
+ .command("funnel")
2493
+ .description("Stage funnel for one pipeline: deals that entered each stage in the window (created in it or moved into it) and what happened to them so far (advanced, lost, moved back, handed off to another pipeline, still there; the five add up to the entries) with median days per stage, plus the cohort of deals created in the window by where they sit now. Built from recorded stage moves, never from a snapshot. Windows clamp to 90 days.")
2494
+ .requiredOption("--pipeline <id>", "the pipeline to report on")
2495
+ .option("--from <iso>", "window start (default: 90 days before --to)")
2496
+ .option("--to <iso>", "window end (default: now)")
2497
+ .option("--range <key>", "a shared dashboard range key (today, week, month, quarter, year, last_30_days, ...) instead of --from/--to")
2498
+ .action(run(async (client, opts) => {
2499
+ assertUuid(opts.pipeline, "pipeline id");
2500
+ const params = new URLSearchParams({ pipelineId: opts.pipeline });
2501
+ if (opts.from)
2502
+ params.set("from", opts.from);
2503
+ if (opts.to)
2504
+ params.set("to", opts.to);
2505
+ if (opts.range)
2506
+ params.set("dateRange", opts.range);
2507
+ return client.get(`/api/v1/reports/funnel?${params.toString()}`);
2508
+ }));
2430
2509
  reports
2431
2510
  .command("schedule-delete <sid>")
2432
2511
  .description("Remove a schedule (past deliveries stay downloadable until they expire)")
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "conduyt",
3
- "version": "1.27.0",
3
+ "version": "1.29.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",