@letterstory/cli 0.176.35 → 0.176.36
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 +7 -3
- package/lib/commands/automations.mjs +3 -1
- package/package.json +1 -1
package/lib/cli.mjs
CHANGED
|
@@ -83,7 +83,7 @@ import {
|
|
|
83
83
|
import { fetchParkedSections, withoutParked } from "./parked.mjs";
|
|
84
84
|
|
|
85
85
|
// Matches cli/package.json; publish-cli.yml rewrites both to the published version.
|
|
86
|
-
export const VERSION = "0.176.
|
|
86
|
+
export const VERSION = "0.176.36";
|
|
87
87
|
|
|
88
88
|
/** The exit code for a gate refusal (CARD_REQUIRED, PAYMENT_FAILED, OUT_OF_TOKENS): 1 is a plain error. */
|
|
89
89
|
export const EXIT_PAYMENT_REQUIRED = 3;
|
|
@@ -99,6 +99,8 @@ export const BOOLEAN_FLAGS = new Set([
|
|
|
99
99
|
"wait",
|
|
100
100
|
// automations set: stop reading a data feed.
|
|
101
101
|
"no-reads",
|
|
102
|
+
// automations add|set --reads: leave out records the feed only changed.
|
|
103
|
+
"new-only",
|
|
102
104
|
// vary start: pause the test running on the page first.
|
|
103
105
|
"pause-running",
|
|
104
106
|
// bench run: the spec was just changed.
|
|
@@ -605,13 +607,15 @@ Reviewers:
|
|
|
605
607
|
automations dismiss <topic-id> --collection <id> Set one subject aside
|
|
606
608
|
automations add topic|series|signal|best --collection <id> [--topic <id>] [--goal <target-id>]
|
|
607
609
|
[--seer <id>] [--pace <n> | --on "fri 09:00 America/New_York"] [--brief <text>]
|
|
608
|
-
[--reads <seer-id> [--window <days>]] [--new-topic <name>] [--new-series <name>]
|
|
610
|
+
[--reads <seer-id> [--window <days>] [--new-only]] [--new-topic <name>] [--new-series <name>]
|
|
609
611
|
Add one (refused if it says the same as another).
|
|
610
612
|
--on pins it: one post a week, on that day and time
|
|
611
613
|
--reads: a data feed (a data_feed seer) whose records in
|
|
612
614
|
the window before each post are the post's own data
|
|
615
|
+
--new-only: only records the feed dates in the window,
|
|
616
|
+
not ones it merely changed (a price, a flag)
|
|
613
617
|
automations set <automation-id> --collection <id> [--pace <n> | --on "<day> <HH:MM> <tz>" | --unpin]
|
|
614
|
-
[--reads <seer-id> [--window <days>] | --no-reads]
|
|
618
|
+
[--reads <seer-id> [--window <days>] [--new-only] | --no-reads]
|
|
615
619
|
[--pause | --resume] [--goal <id>] [--brief <text>] [--remap]
|
|
616
620
|
automations remove <automation-id> --collection <id>
|
|
617
621
|
automate options What an automation can be made of here: the triggers,
|
|
@@ -26,6 +26,7 @@ export function parsePublishAt(text) {
|
|
|
26
26
|
/**
|
|
27
27
|
* `--reads <seer-id> [--window <days>]` → { seer_id, window_days } (the tool's `reads`): a data
|
|
28
28
|
* feed the automation reads, the window ending at each post's publish instant (7 days unless set).
|
|
29
|
+
* `--new-only` adds include_changed: false (records the feed only changed never count).
|
|
29
30
|
* `--no-reads` sends null (stop reading one).
|
|
30
31
|
*/
|
|
31
32
|
export function parseReads(flags) {
|
|
@@ -33,12 +34,13 @@ export function parseReads(flags) {
|
|
|
33
34
|
const seer = flagStr(flags.reads);
|
|
34
35
|
if (seer === undefined) {
|
|
35
36
|
if (flags.window !== undefined) throw new CliError("--window goes with --reads <seer-id>");
|
|
37
|
+
if (flags["new-only"] === true) throw new CliError("--new-only goes with --reads <seer-id>");
|
|
36
38
|
return undefined;
|
|
37
39
|
}
|
|
38
40
|
const days = flags.window === undefined ? 7 : Number(flags.window);
|
|
39
41
|
if (!Number.isInteger(days) || days < 1)
|
|
40
42
|
throw new CliError("--window takes a whole number of days, e.g. --window 7");
|
|
41
|
-
return { seer_id: seer, window_days: days };
|
|
43
|
+
return { seer_id: seer, window_days: days, ...(flags["new-only"] === true ? { include_changed: false } : {}) };
|
|
42
44
|
}
|
|
43
45
|
|
|
44
46
|
/** See `argsFromFlags` in shared.mjs; `scripts/parity-check.ts` diffs these keys against the tool. */
|