conduyt 1.25.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.
- package/dist/index.js +40 -1
- 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")
|
|
@@ -2388,6 +2401,32 @@ reports
|
|
|
2388
2401
|
params.set("attributionDays", opts.attributionDays);
|
|
2389
2402
|
return client.get(`/api/v1/reports/sms-drip-conversion?${params.toString()}`);
|
|
2390
2403
|
}));
|
|
2404
|
+
reports
|
|
2405
|
+
.command("speed-to-lead")
|
|
2406
|
+
.description("Speed to lead: time from a new lead to the first call, text, email or note by a person inside the CRM (median, p90, within 5/15 min and 1/4/24 h, never), by assigned rep, by lead source and by who touched; spans clamp to 90 days")
|
|
2407
|
+
.option("--from <iso>", "window start (default: 90 days before --to)")
|
|
2408
|
+
.option("--to <iso>", "window end (default: now)")
|
|
2409
|
+
.option("--assigned-to <id>", "only leads assigned to this user")
|
|
2410
|
+
.option("--sources <list>", "comma-separated exact contact source values; __none__ adds contacts with no source")
|
|
2411
|
+
.option("--smart-list <id>", "only contacts in this smart list")
|
|
2412
|
+
.action(run(async (client, opts) => {
|
|
2413
|
+
const params = new URLSearchParams();
|
|
2414
|
+
if (opts.from)
|
|
2415
|
+
params.set("from", opts.from);
|
|
2416
|
+
if (opts.to)
|
|
2417
|
+
params.set("to", opts.to);
|
|
2418
|
+
if (opts.assignedTo) {
|
|
2419
|
+
assertUuid(opts.assignedTo, "user id");
|
|
2420
|
+
params.set("assignedTo", opts.assignedTo);
|
|
2421
|
+
}
|
|
2422
|
+
if (opts.sources)
|
|
2423
|
+
params.set("sources", opts.sources);
|
|
2424
|
+
if (opts.smartList) {
|
|
2425
|
+
assertUuid(opts.smartList, "smart list id");
|
|
2426
|
+
params.set("smartListId", opts.smartList);
|
|
2427
|
+
}
|
|
2428
|
+
return client.get(`/api/v1/reports/speed-to-lead?${params.toString()}`);
|
|
2429
|
+
}));
|
|
2391
2430
|
reports
|
|
2392
2431
|
.command("schedule-delete <sid>")
|
|
2393
2432
|
.description("Remove a schedule (past deliveries stay downloadable until they expire)")
|
package/package.json
CHANGED