conduyt 1.23.0 → 1.24.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 +93 -0
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -2281,6 +2281,99 @@ reports
2281
2281
  fail(err);
2282
2282
  }
2283
2283
  });
2284
+ // ── Reporting P2 (2026-09-10): scheduled delivery of saved reports ────────────────────────────────────────────────
2285
+ reports
2286
+ .command("schedules <id>")
2287
+ .description("The scheduled deliveries on a saved report (cadence, time, formats, recipients, next/last run)")
2288
+ .action(run(async (client, id) => { assertUuid(id, "report id"); return client.get(`/api/v1/reports/custom/${id}/subscriptions`); }));
2289
+ reports
2290
+ .command("schedule <id>")
2291
+ .description("Email a saved report on a schedule (runs with your visibility)")
2292
+ .requiredOption("--cadence <cadence>", "daily | weekly | monthly")
2293
+ .requiredOption("--to <emails>", "recipient addresses, comma-separated (inside or outside the workspace)")
2294
+ .option("--at <hh:mm>", "workspace-local time, 24h", "07:00")
2295
+ .option("--weekday <n>", "weekly: 0 = Sunday … 6 = Saturday")
2296
+ .option("--monthday <n>", "monthly: 1-28")
2297
+ .option("--formats <list>", "csv,xlsx,pdf", "csv")
2298
+ .option("--timezone <zone>", "IANA zone (defaults to the workspace timezone)")
2299
+ .option("--name <name>", "a label for the schedule")
2300
+ .option("--rolling", "only records created in the period since the last run")
2301
+ .option("--paused", "create it paused")
2302
+ .action(run(async (client, id, opts) => {
2303
+ assertUuid(id, "report id");
2304
+ const [hh, mm] = opts.at.split(":").map((x) => Number(x));
2305
+ if (!Number.isInteger(hh) || hh < 0 || hh > 23 || !Number.isInteger(mm) || mm < 0 || mm > 59)
2306
+ throw new Error("--at must be hh:mm (24h)");
2307
+ const body = {
2308
+ cadence: opts.cadence, hourLocal: hh, minuteLocal: mm,
2309
+ formats: opts.formats.split(",").map((f) => f.trim()).filter(Boolean),
2310
+ recipients: opts.to.split(",").map((e) => e.trim()).filter(Boolean).map((email) => ({ email })),
2311
+ rangeMode: opts.rolling ? "rolling" : "as_saved", enabled: !opts.paused,
2312
+ };
2313
+ if (opts.weekday !== undefined)
2314
+ body.weekday = Number(opts.weekday);
2315
+ if (opts.monthday !== undefined)
2316
+ body.monthday = Number(opts.monthday);
2317
+ if (opts.timezone)
2318
+ body.timezone = opts.timezone;
2319
+ if (opts.name)
2320
+ body.name = opts.name;
2321
+ return client.post(`/api/v1/reports/custom/${id}/subscriptions`, body);
2322
+ }));
2323
+ reports
2324
+ .command("schedule-update <sid>")
2325
+ .description("Change a schedule (only the flags you pass change); --pause / --resume toggle it")
2326
+ .option("--cadence <cadence>", "daily | weekly | monthly")
2327
+ .option("--to <emails>", "replace the recipients, comma-separated")
2328
+ .option("--at <hh:mm>", "workspace-local time, 24h")
2329
+ .option("--weekday <n>").option("--monthday <n>").option("--formats <list>").option("--timezone <zone>").option("--name <name>")
2330
+ .option("--rolling").option("--as-saved").option("--pause").option("--resume")
2331
+ .action(run(async (client, sid, opts) => {
2332
+ assertUuid(sid, "schedule id");
2333
+ const body = {};
2334
+ if (typeof opts.cadence === "string")
2335
+ body.cadence = opts.cadence;
2336
+ if (typeof opts.to === "string")
2337
+ body.recipients = opts.to.split(",").map((e) => e.trim()).filter(Boolean).map((email) => ({ email }));
2338
+ if (typeof opts.at === "string") {
2339
+ const [hh, mm] = opts.at.split(":").map((x) => Number(x));
2340
+ body.hourLocal = hh;
2341
+ body.minuteLocal = mm;
2342
+ }
2343
+ if (typeof opts.weekday === "string")
2344
+ body.weekday = Number(opts.weekday);
2345
+ if (typeof opts.monthday === "string")
2346
+ body.monthday = Number(opts.monthday);
2347
+ if (typeof opts.formats === "string")
2348
+ body.formats = opts.formats.split(",").map((f) => f.trim()).filter(Boolean);
2349
+ if (typeof opts.timezone === "string")
2350
+ body.timezone = opts.timezone;
2351
+ if (typeof opts.name === "string")
2352
+ body.name = opts.name;
2353
+ if (opts.rolling)
2354
+ body.rangeMode = "rolling";
2355
+ if (opts.asSaved)
2356
+ body.rangeMode = "as_saved";
2357
+ if (opts.pause)
2358
+ body.enabled = false;
2359
+ if (opts.resume)
2360
+ body.enabled = true;
2361
+ if (Object.keys(body).length === 0)
2362
+ throw new Error("Pass at least one change.");
2363
+ return client.patch(`/api/v1/reports/subscriptions/${sid}`, body);
2364
+ }));
2365
+ reports
2366
+ .command("schedule-delete <sid>")
2367
+ .description("Remove a schedule (past deliveries stay downloadable until they expire)")
2368
+ .action(run(async (client, sid) => { assertUuid(sid, "schedule id"); return client.del(`/api/v1/reports/subscriptions/${sid}`); }));
2369
+ reports
2370
+ .command("schedule-send <sid>")
2371
+ .description("Build and email a schedule now (one manual delivery)")
2372
+ .action(run(async (client, sid) => { assertUuid(sid, "schedule id"); return client.post(`/api/v1/reports/subscriptions/${sid}/run`, {}); }));
2373
+ reports
2374
+ .command("deliveries <sid>")
2375
+ .description("The delivery history of a schedule with download URLs")
2376
+ .action(run(async (client, sid) => { assertUuid(sid, "schedule id"); return client.get(`/api/v1/reports/subscriptions/${sid}/deliveries`); }));
2284
2377
  const smartViews = program.command("smart-views").description("Smart Views and their Smart Dialing priorities");
2285
2378
  smartViews
2286
2379
  .command("list")
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "conduyt",
3
- "version": "1.23.0",
3
+ "version": "1.24.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",