conduyt 1.50.0 → 1.51.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 +27 -0
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -1277,6 +1277,33 @@ appointments
1277
1277
  throw new Error("Nothing to update. Pass at least one field flag or --json.");
1278
1278
  return client.patch(`/api/v1/appointments/${encodeURIComponent(id)}`, body);
1279
1279
  }));
1280
+ appointments
1281
+ .command("outcome <id>")
1282
+ .description("Record the outcome (completed | no_show | cancelled | rescheduled): sets the status (rescheduled keeps it) and moves the contact's open deal to the stage mapped in Pipeline settings (POST /appointments/:id/outcome)")
1283
+ .requiredOption("--outcome <outcome>", "completed, no_show, cancelled or rescheduled")
1284
+ .option("--start <iso>", "rescheduled only: new start, ISO-8601 with tz offset")
1285
+ .option("--end <iso>", "rescheduled only: new end, ISO-8601 with tz offset")
1286
+ .action(run(async (client, id, opts) => {
1287
+ assertUuid(id, "appointment id");
1288
+ if (!["completed", "no_show", "cancelled", "rescheduled"].includes(opts.outcome)) {
1289
+ throw new Error("--outcome must be completed, no_show, cancelled or rescheduled");
1290
+ }
1291
+ if (opts.outcome === "rescheduled" && (!opts.start || !opts.end))
1292
+ throw new Error("--outcome rescheduled needs --start and --end");
1293
+ const body = { outcome: opts.outcome };
1294
+ if (opts.start)
1295
+ body.startTime = opts.start;
1296
+ if (opts.end)
1297
+ body.endTime = opts.end;
1298
+ return client.post(`/api/v1/appointments/${encodeURIComponent(id)}/outcome`, body);
1299
+ }));
1300
+ appointments
1301
+ .command("outcome-undo <id>")
1302
+ .description("Undo the last recorded outcome: status back to what it was, deal back to its previous stage when nobody moved it since (POST /appointments/:id/outcome/undo)")
1303
+ .action(run(async (client, id) => {
1304
+ assertUuid(id, "appointment id");
1305
+ return client.post(`/api/v1/appointments/${encodeURIComponent(id)}/outcome/undo`, {});
1306
+ }));
1280
1307
  appointments
1281
1308
  .command("cancel <id>")
1282
1309
  .description("Cancel an appointment (soft-cancel; sets status=cancelled)")
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "conduyt",
3
- "version": "1.50.0",
3
+ "version": "1.51.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",