@letterstory/cli 0.177.158 → 0.177.159
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 +1 -1
- package/lib/commands/visits.mjs +10 -1
- package/package.json +1 -1
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.
|
|
96
|
+
export const VERSION = "0.177.159";
|
|
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;
|
package/lib/commands/visits.mjs
CHANGED
|
@@ -29,6 +29,7 @@
|
|
|
29
29
|
// letterstory visits transact remove <source-id>
|
|
30
30
|
// letterstory visits transact test "What does it cost?"
|
|
31
31
|
// letterstory visits transact asks [--since 7d] [--limit 50]
|
|
32
|
+
// letterstory visits transact learnings [--since 7d]
|
|
32
33
|
|
|
33
34
|
import { CliError } from "../client.mjs";
|
|
34
35
|
import { flagStr, printResult, argsFromFlags } from "./shared.mjs";
|
|
@@ -178,6 +179,7 @@ export const ARGS = {
|
|
|
178
179
|
update: { flag: "update", type: "bool" },
|
|
179
180
|
},
|
|
180
181
|
visitors_list_transact_asks: { site_id: "site", days, limit: { flag: "limit", type: "num" } },
|
|
182
|
+
visitors_get_transact_learnings: { site_id: "site", days },
|
|
181
183
|
visitors_export: {
|
|
182
184
|
site_id: "site",
|
|
183
185
|
days,
|
|
@@ -350,7 +352,7 @@ function transactLines(t) {
|
|
|
350
352
|
return lines;
|
|
351
353
|
}
|
|
352
354
|
|
|
353
|
-
/** `visits transact`: read it; `on` / `off`; `add <kind> …`; `source <id>`; `remove <id>`; `test "…"`; `pr`; `asks`. */
|
|
355
|
+
/** `visits transact`: read it; `on` / `off`; `add <kind> …`; `source <id>`; `remove <id>`; `test "…"`; `pr`; `asks`; `learnings`. */
|
|
354
356
|
async function visitsTransact(ctx) {
|
|
355
357
|
const { flags, io } = ctx;
|
|
356
358
|
const sub = ctx.positionals[0];
|
|
@@ -412,6 +414,13 @@ async function visitsTransact(ctx) {
|
|
|
412
414
|
printResult(io, flags, await call(rest, "visitors_open_transact_pr"));
|
|
413
415
|
return 0;
|
|
414
416
|
}
|
|
417
|
+
if (sub === "learnings") {
|
|
418
|
+
const result = await call(rest, "visitors_get_transact_learnings");
|
|
419
|
+
printResult(io, flags, result, (r) =>
|
|
420
|
+
r.learnings.length ? r.learnings.map((l) => `- ${l.text}`).join("\n") : "No asks yet"
|
|
421
|
+
);
|
|
422
|
+
return 0;
|
|
423
|
+
}
|
|
415
424
|
if (sub === "asks") {
|
|
416
425
|
const result = await call(rest, "visitors_list_transact_asks");
|
|
417
426
|
printResult(io, flags, result, (r) => {
|