@letterstory/cli 0.177.20 → 0.177.22
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 +2 -2
- package/lib/commands/admin.mjs +22 -2
- package/package.json +1 -1
package/lib/cli.mjs
CHANGED
|
@@ -88,7 +88,7 @@ import {
|
|
|
88
88
|
import { fetchParkedSections, withoutParked } from "./parked.mjs";
|
|
89
89
|
|
|
90
90
|
// Matches cli/package.json; publish-cli.yml rewrites both to the published version.
|
|
91
|
-
export const VERSION = "0.177.
|
|
91
|
+
export const VERSION = "0.177.22";
|
|
92
92
|
|
|
93
93
|
/** The exit code for a gate refusal (CARD_REQUIRED, PAYMENT_FAILED, OUT_OF_TOKENS): 1 is a plain error. */
|
|
94
94
|
export const EXIT_PAYMENT_REQUIRED = 3;
|
|
@@ -1226,7 +1226,7 @@ Admin (STAFF key — --staff-key / LETTERSTORY_STAFF_API_KEY; acts before an org
|
|
|
1226
1226
|
admin demo ideas <org-id> [--library] [--preview] [--force] | --status [--id <run>]
|
|
1227
1227
|
Start every Idea on a demo org for real (pull requests, or
|
|
1228
1228
|
previews), or read how the latest run went.
|
|
1229
|
-
admin demo sweep [--prepare] [--pull-requests] [--recipes a,b] [--orgs a,b] [--exclude a,b] [--buy a,b] [--make-orgs] [--no-refit] | --status [--id <sweep>]
|
|
1229
|
+
admin demo sweep [--prepare] [--pull-requests] [--recipes a,b] [--variation <n|name>] [--orgs a,b] [--exclude a,b] [--buy a,b] [--make-orgs] [--no-refit] | --status [--id <sweep>] | --reset <recipe> [--id <sweep>]
|
|
1230
1230
|
Every live recipe end to end: each gets a test org whose Ideas
|
|
1231
1231
|
offers it, its Start pressed (or, with --prepare, left for you
|
|
1232
1232
|
to press in the app), and its outcome judged, with who owns a
|
package/lib/commands/admin.mjs
CHANGED
|
@@ -5938,6 +5938,7 @@ async function cmdAdminLetterpress(ctx) {
|
|
|
5938
5938
|
case "fits": {
|
|
5939
5939
|
// list_recipe_fits: the standing fit's verdicts, one per account, site and recipe.
|
|
5940
5940
|
const q = new URLSearchParams({ limit: String(flags.limit ?? 100) });
|
|
5941
|
+
if (flags.offset !== undefined) q.set("offset", String(flags.offset));
|
|
5941
5942
|
if (flags.recipe) q.set("recipe_id", String(flags.recipe));
|
|
5942
5943
|
if (flags.org) q.set("org_id", String(flags.org));
|
|
5943
5944
|
if (flags.site) q.set("domain", String(flags.site));
|
|
@@ -7006,7 +7007,7 @@ const DEMO_ITEM_FLAGS = [
|
|
|
7006
7007
|
"setup",
|
|
7007
7008
|
];
|
|
7008
7009
|
const DEMO_USAGE =
|
|
7009
|
-
"Usage: admin demo guide | list [--enrollable] | show <org-id> [--moves] | set <org-id> [--enroll] [--unenroll] [--file <state.json>] [--phantom parked|shown] [--main-blog …] [--visitors …] [--probes not_run|shown] [--cms hidden|shown] [--publish-target …] [--search-console …] [--github …] [--domain …] [--setup fresh|finished] [--domain-cap n] [--inject <key>]... [--hide <key>]... [--save-as <name>] [--baseline <owner/repo>[@sha] | --clear-baseline] [--copy-from <org-id> [--copy-scenarios a,b] [--overwrite]] [--auto-reset <scenario>|off] [--every <minutes>] [--release] | domains | new <domain> [--name <n>] [--brief <t>] [--full] [--host vercel|pages] [--no-wait] | teardown <org-id> [--keep-repo] | bootstrap <org-id>... --from <org-id> [--scenarios a,b] [--overwrite] | reset <org-id> <scenario> [--clean-slate] [--close-prs since_applied|all_open|none] [--hold <minutes>] [--restore-repo revert|force] [--rebuild] [--reread-company] [--forget-company] [--forget-site] | check <org-id> | ideas <org-id> [--library] [--preview] [--force] | ideas <org-id> --status [--id <run-id>] | sweep [--prepare] [--pull-requests] [--recipes <id>,…] [--orgs <id>,…] [--exclude <id>,…] [--buy <recipe-id>,…] [--make-orgs] [--no-refit] | sweep --status [--id <sweep-id>]";
|
|
7010
|
+
"Usage: admin demo guide | list [--enrollable] | show <org-id> [--moves] | set <org-id> [--enroll] [--unenroll] [--file <state.json>] [--phantom parked|shown] [--main-blog …] [--visitors …] [--probes not_run|shown] [--cms hidden|shown] [--publish-target …] [--search-console …] [--github …] [--domain …] [--setup fresh|finished] [--domain-cap n] [--inject <key>]... [--hide <key>]... [--save-as <name>] [--baseline <owner/repo>[@sha] | --clear-baseline] [--copy-from <org-id> [--copy-scenarios a,b] [--overwrite]] [--auto-reset <scenario>|off] [--every <minutes>] [--release] | domains | new <domain> [--name <n>] [--brief <t>] [--full] [--host vercel|pages] [--no-wait] | teardown <org-id> [--keep-repo] | bootstrap <org-id>... --from <org-id> [--scenarios a,b] [--overwrite] | reset <org-id> <scenario> [--clean-slate] [--close-prs since_applied|all_open|none] [--hold <minutes>] [--restore-repo revert|force] [--rebuild] [--reread-company] [--forget-company] [--forget-site] | check <org-id> | ideas <org-id> [--library] [--preview] [--force] | ideas <org-id> --status [--id <run-id>] | sweep [--prepare] [--pull-requests] [--recipes <id>,…] [--variation <n|name>] [--orgs <id>,…] [--exclude <id>,…] [--buy <recipe-id>,…] [--make-orgs] [--no-refit] | sweep --status [--id <sweep-id>] | sweep --reset <recipe-id> [--id <sweep-id>]";
|
|
7010
7011
|
|
|
7011
7012
|
const readinessLines = (r) =>
|
|
7012
7013
|
r
|
|
@@ -7051,7 +7052,7 @@ const recipeSweepLines = (sweep, appUrl) =>
|
|
|
7051
7052
|
`${sweep.start ? "started by the sweep" : "prepared for you to start"}, ${sweep.delivery === "build" ? "previews" : "pull requests"}, by ${sweep.started_by_name ?? "staff"} at ${sweep.created_at} sweep ${sweep.id}`,
|
|
7052
7053
|
...sweep.items.map((i) =>
|
|
7053
7054
|
[
|
|
7054
|
-
`\n${(SWEEP_MARK[i.result] ?? i.result).padEnd(10)} ${i.name}`,
|
|
7055
|
+
`\n${(SWEEP_MARK[i.result] ?? i.result).padEnd(10)} ${i.name}${i.variation ? ` (variation ${i.variation}: ${i.variation_name ?? ""})` : ""}`,
|
|
7055
7056
|
i.org ? ` org: ${i.org.name} (${i.org.host})${i.org.made ? ", made for it" : ""}` : null,
|
|
7056
7057
|
i.fit[0] ? ` fit: ${i.fit[0].fits}: ${i.fit[0].why}` : null,
|
|
7057
7058
|
i.row
|
|
@@ -7062,6 +7063,7 @@ const recipeSweepLines = (sweep, appUrl) =>
|
|
|
7062
7063
|
: null,
|
|
7063
7064
|
i.verdict ? ` outcome: ${i.verdict.state}: ${i.verdict.observed}` : null,
|
|
7064
7065
|
i.cause ? ` cause: ${i.cause.owner}: ${i.cause.why}` : null,
|
|
7066
|
+
...(i.tried ?? []).map((t) => ` tried ${t.name}: ${t.why}`),
|
|
7065
7067
|
i.profile_problem ? ` profile: ${i.profile_problem}` : null,
|
|
7066
7068
|
i.profile?.unsettable?.length
|
|
7067
7069
|
? ` can't be made on a test org: ${i.profile.unsettable.map((u) => u.key).join(", ")}`
|
|
@@ -7318,6 +7320,18 @@ async function cmdAdminDemo(ctx) {
|
|
|
7318
7320
|
const orgId = requirePositional(positionals, 1, "org-id");
|
|
7319
7321
|
const path = `${DEMO}/${encodeURIComponent(orgId)}/ideas`;
|
|
7320
7322
|
const id = flagStr(flags.id);
|
|
7323
|
+
// The retest loop: one recipe brought back on its test org (reset_recipe_sweep_item).
|
|
7324
|
+
if (flagStr(flags.reset)) {
|
|
7325
|
+
const reset = await staffPost(ctx, `${path}/reset`, compact({ id, recipe_id: flagStr(flags.reset) }));
|
|
7326
|
+
printResult(io, flags, reset, (r) =>
|
|
7327
|
+
[
|
|
7328
|
+
...r.reset.undone.map((u) => `undone: ${u}`),
|
|
7329
|
+
...r.reset.kept.map((k) => `kept: ${k}`),
|
|
7330
|
+
recipeSweepLines(r.sweep, ctx.client.url),
|
|
7331
|
+
].join("\n")
|
|
7332
|
+
);
|
|
7333
|
+
return 0;
|
|
7334
|
+
}
|
|
7321
7335
|
const result =
|
|
7322
7336
|
flagBool(flags.status) || id
|
|
7323
7337
|
? await staffRequest(ctx, "GET", id ? `${path}?id=${encodeURIComponent(id)}` : path)
|
|
@@ -7347,6 +7361,12 @@ async function cmdAdminDemo(ctx) {
|
|
|
7347
7361
|
start: flagBool(flags.prepare) ? false : undefined,
|
|
7348
7362
|
delivery: flagBool(flags["pull-requests"]) ? "build_pr" : undefined,
|
|
7349
7363
|
recipes: flags.recipes ? flagList(flags.recipes) : undefined,
|
|
7364
|
+
// A number is the variation's place (1 is the recipe itself); anything else its name.
|
|
7365
|
+
variation: flagStr(flags.variation)
|
|
7366
|
+
? /^\d+$/.test(flagStr(flags.variation))
|
|
7367
|
+
? Number(flagStr(flags.variation))
|
|
7368
|
+
: flagStr(flags.variation)
|
|
7369
|
+
: undefined,
|
|
7350
7370
|
orgs: flags.orgs ? flagList(flags.orgs) : undefined,
|
|
7351
7371
|
exclude: flags.exclude ? flagList(flags.exclude) : undefined,
|
|
7352
7372
|
purchases: flags.buy ? flagList(flags.buy) : undefined,
|