@letterstory/cli 0.175.15 → 0.175.16

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
@@ -78,7 +78,7 @@ import {
78
78
  } from "./commands.mjs";
79
79
 
80
80
  // Matches cli/package.json; publish-cli.yml rewrites both to the published version.
81
- export const VERSION = "0.175.15";
81
+ export const VERSION = "0.175.16";
82
82
 
83
83
  /** The exit code for a gate refusal (CARD_REQUIRED, PAYMENT_FAILED, OUT_OF_TOKENS): 1 is a plain error. */
84
84
  export const EXIT_PAYMENT_REQUIRED = 3;
@@ -1,7 +1,7 @@
1
1
  // `vary` — Variationals from a terminal: A/B tests of a page's words and images on your own site
2
2
  // (docs/architecture/variationals.md). Thin wrappers over the variationals tools (list_variationals,
3
3
  // get_variational, create_variational, update_variational, save_variational_variant,
4
- // remove_variational_variant, delete_variational), the same lib functions the app calls.
4
+ // remove_variational_variant, delete_variational, ship_variational_winner), the same lib functions the app calls.
5
5
  //
6
6
  // letterstory vary list [--status running]
7
7
  // letterstory vary create --page https://acme.com/pricing [--name "Pricing headline"] [--goals-file goals.json]
@@ -13,6 +13,7 @@
13
13
  // letterstory vary weights <id> a=50,b=50
14
14
  // letterstory vary goals <id> --goals-file goals.json
15
15
  // letterstory vary start <id> | pause <id> | end <id> [--winner b]
16
+ // letterstory vary ship <id> [--variant b] the winner written into the site's code, as a pull request
16
17
  // letterstory vary remove-variant <id> <key>
17
18
  // letterstory vary delete <id>
18
19
 
@@ -70,6 +71,10 @@ export const ARGS = {
70
71
  name: "name",
71
72
  goals: jsonFile("goals-file", "goals"),
72
73
  },
74
+ ship_variational_winner: {
75
+ variational_id: variationalId,
76
+ variant: "variant",
77
+ },
73
78
  update_variational: {
74
79
  variational_id: variationalId,
75
80
  name: "name",
@@ -148,6 +153,12 @@ export async function cmdVary(ctx) {
148
153
  }
149
154
  case "remove-variant":
150
155
  return varyShow(rest, await call(rest, "remove_variational_variant"));
156
+ case "ship": {
157
+ refuseUnknownFlags(rest, ARGS.ship_variational_winner, []);
158
+ const result = await call(rest, "ship_variational_winner");
159
+ printResult(rest.io, rest.flags, result, (r) => r.message);
160
+ return 0;
161
+ }
151
162
  case "delete": {
152
163
  const result = await call(rest, "delete_variational");
153
164
  printResult(rest.io, rest.flags, result, (r) => `Deleted ${r.deleted}.`);
@@ -155,7 +166,7 @@ export async function cmdVary(ctx) {
155
166
  }
156
167
  default:
157
168
  throw new CliError(
158
- "Usage: vary [list|get|page|create|update|weights|goals|start|pause|end|save-variant|remove-variant|delete]"
169
+ "Usage: vary [list|get|page|create|update|weights|goals|start|pause|end|save-variant|remove-variant|ship|delete]"
159
170
  );
160
171
  }
161
172
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@letterstory/cli",
3
- "version": "0.175.15",
3
+ "version": "0.175.16",
4
4
  "description": "Spin up and manage Letter phantom blogs from your terminal.",
5
5
  "type": "module",
6
6
  "license": "UNLICENSED",