@letterstory/cli 0.177.205 → 0.177.207

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/lib/cli.mjs CHANGED
@@ -93,7 +93,7 @@ import {
93
93
  import { fetchParkedSections, withoutParked } from "./parked.mjs";
94
94
 
95
95
  // Matches cli/package.json; publish-cli.yml rewrites both to the published version.
96
- export const VERSION = "0.177.205";
96
+ export const VERSION = "0.177.207";
97
97
 
98
98
  /** The exit code for a gate refusal (CARD_REQUIRED, PAYMENT_FAILED, OUT_OF_TOKENS): 1 is a plain error. */
99
99
  export const EXIT_PAYMENT_REQUIRED = 3;
@@ -173,6 +173,10 @@ export const ARGS = {
173
173
  get_sequence: {
174
174
  sequence_id: { positional: 0, label: "sequence-id", required: true },
175
175
  },
176
+ duplicate_sequence: {
177
+ sequence_id: { positional: 0, label: "sequence-id", required: true },
178
+ name: { flag: "name" },
179
+ },
176
180
  create_sequence: {
177
181
  name: { flag: "name", required: true },
178
182
  flow: {
@@ -283,6 +287,10 @@ export const ARGS = {
283
287
  get_prospect_list: {
284
288
  list_id: { positional: 0, label: "list-id", required: true },
285
289
  },
290
+ export_prospects: {
291
+ list_id: { flag: "list" },
292
+ sequence_id: { flag: "sequence" },
293
+ },
286
294
  delete_prospect_list: {
287
295
  list_id: { positional: 0, label: "list-id", required: true },
288
296
  },
@@ -539,7 +547,7 @@ function deleteDispatchLine(result) {
539
547
  return `Dispatch deleted; ${n(moved)} moved${moved > 0 ? ` to ${result.moved_to}` : ""}.`;
540
548
  }
541
549
 
542
- const SEQUENCES_USAGE = `Usage: sequences <list|get|create|update|pause|resume|enroll|stop|review|links|cakes|heyreach>`;
550
+ const SEQUENCES_USAGE = `Usage: sequences <list|get|create|duplicate|update|pause|resume|enroll|stop|review|links|cakes|heyreach>`;
543
551
  const DISPATCHES_USAGE = `Usage: dispatches <list|create|rename|delete>`;
544
552
 
545
553
  // Dispatches: the named review desks a sequence's review stage queues to.
@@ -589,6 +597,9 @@ export async function cmdSequences(ctx) {
589
597
  case "create":
590
598
  case "new":
591
599
  return run(rest, "create_sequence", "Created sequence (a draft: set --status active to send).");
600
+ case "duplicate":
601
+ case "copy":
602
+ return run(rest, "duplicate_sequence", "Copied as a draft.");
592
603
  case "update":
593
604
  return run(rest, "update_sequence", "Updated sequence.");
594
605
  case "pause":
@@ -709,7 +720,7 @@ async function sequencesLinks(ctx, sub) {
709
720
  }
710
721
  }
711
722
 
712
- const PROSPECTS_USAGE = `Usage: prospects <lists|list|ls|get|create-list|delete-list|import|source|enrich|openers|update|delete|columns>`;
723
+ const PROSPECTS_USAGE = `Usage: prospects <lists|list|ls|get|export|create-list|delete-list|import|source|enrich|openers|update|delete|columns>`;
713
724
 
714
725
  export async function cmdProspects(ctx) {
715
726
  const sub = ctx.positionals[0];
@@ -721,6 +732,17 @@ export async function cmdProspects(ctx) {
721
732
  return run(rest, "get_prospect_list");
722
733
  case "ls":
723
734
  return run(rest, "list_prospects");
735
+ case "export": {
736
+ // The CSV itself on stdout (`> file.csv`); --json for the whole result.
737
+ const result = await rest.client.callTool(
738
+ "export_prospects",
739
+ argsFromFlags(ARGS.export_prospects, rest.flags, [])
740
+ );
741
+ if (rest.flags.json) printResult(rest.io, rest.flags, result);
742
+ else rest.io.log(result?.csv ?? "");
743
+ if (result?.truncated) rest.io.error("Over 20,000 rows: this export stops there.");
744
+ return 0;
745
+ }
724
746
  case "get":
725
747
  case "show":
726
748
  return run(rest, "get_prospect");
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@letterstory/cli",
3
- "version": "0.177.205",
3
+ "version": "0.177.207",
4
4
  "description": "Spin up and manage Letter phantom blogs from your terminal.",
5
5
  "type": "module",
6
6
  "license": "UNLICENSED",