@letterstory/cli 0.177.205 → 0.177.206

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.206";
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;
@@ -283,6 +283,10 @@ export const ARGS = {
283
283
  get_prospect_list: {
284
284
  list_id: { positional: 0, label: "list-id", required: true },
285
285
  },
286
+ export_prospects: {
287
+ list_id: { flag: "list" },
288
+ sequence_id: { flag: "sequence" },
289
+ },
286
290
  delete_prospect_list: {
287
291
  list_id: { positional: 0, label: "list-id", required: true },
288
292
  },
@@ -709,7 +713,7 @@ async function sequencesLinks(ctx, sub) {
709
713
  }
710
714
  }
711
715
 
712
- const PROSPECTS_USAGE = `Usage: prospects <lists|list|ls|get|create-list|delete-list|import|source|enrich|openers|update|delete|columns>`;
716
+ const PROSPECTS_USAGE = `Usage: prospects <lists|list|ls|get|export|create-list|delete-list|import|source|enrich|openers|update|delete|columns>`;
713
717
 
714
718
  export async function cmdProspects(ctx) {
715
719
  const sub = ctx.positionals[0];
@@ -721,6 +725,17 @@ export async function cmdProspects(ctx) {
721
725
  return run(rest, "get_prospect_list");
722
726
  case "ls":
723
727
  return run(rest, "list_prospects");
728
+ case "export": {
729
+ // The CSV itself on stdout (`> file.csv`); --json for the whole result.
730
+ const result = await rest.client.callTool(
731
+ "export_prospects",
732
+ argsFromFlags(ARGS.export_prospects, rest.flags, [])
733
+ );
734
+ if (rest.flags.json) printResult(rest.io, rest.flags, result);
735
+ else rest.io.log(result?.csv ?? "");
736
+ if (result?.truncated) rest.io.error("Over 20,000 rows: this export stops there.");
737
+ return 0;
738
+ }
724
739
  case "get":
725
740
  case "show":
726
741
  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.206",
4
4
  "description": "Spin up and manage Letter phantom blogs from your terminal.",
5
5
  "type": "module",
6
6
  "license": "UNLICENSED",