conduyt 1.27.0 → 1.28.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 +61 -0
- 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>")
|
package/package.json
CHANGED