conduyt 1.26.0 → 1.27.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 +14 -1
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -2238,7 +2238,7 @@ reports
2238
2238
  .action(run(async (client) => client.get("/api/v1/reports/custom")));
2239
2239
  reports
2240
2240
  .command("create")
2241
- .description("Create a saved report from a JSON definition (name, entity, columns, filters, sortBy, groupBy, groupBy2, aggregate, measureField, population: { smartViewId })")
2241
+ .description("Create a saved report from a JSON definition (name, entity, columns, filters, sortBy, groupBy, groupBy2, aggregate, measureField, population: { smartViewId }); pivot: { rows, columns, measures } for a pivot grid on contacts/deals")
2242
2242
  .requiredOption("--json <definition>", "the definition as JSON (or @file)")
2243
2243
  .action(run(async (client, opts) => {
2244
2244
  const raw = opts.json.startsWith("@") ? (await import("node:fs")).readFileSync(opts.json.slice(1), "utf8") : opts.json;
@@ -2248,6 +2248,19 @@ reports
2248
2248
  }
2249
2249
  return client.post("/api/v1/reports/custom", body);
2250
2250
  }));
2251
+ reports
2252
+ .command("update <id>")
2253
+ .description("Update a saved report from a JSON patch (any create field; pivot: { rows: [field, field?], columns: field|null, measures: [{ aggregate, field }] } builds a pivot grid on contacts/deals reports, pivot: null removes it)")
2254
+ .requiredOption("--json <patch>", "the patch as JSON (or @file)")
2255
+ .action(run(async (client, id, opts) => {
2256
+ assertUuid(id, "report id");
2257
+ const raw = opts.json.startsWith("@") ? (await import("node:fs")).readFileSync(opts.json.slice(1), "utf8") : opts.json;
2258
+ const body = JSON.parse(raw);
2259
+ if (!body || typeof body !== "object" || Array.isArray(body) || Object.keys(body).length === 0) {
2260
+ throw new Error("The patch needs at least one field to change.");
2261
+ }
2262
+ return client.patch(`/api/v1/reports/custom/${id}`, body);
2263
+ }));
2251
2264
  reports
2252
2265
  .command("run <id>")
2253
2266
  .description("Run a saved report: a page of rows, the total, the metric, the chart data and (with groupBy2) the grouped rows")
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "conduyt",
3
- "version": "1.26.0",
3
+ "version": "1.27.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",