@letterstory/cli 0.100.0 → 0.100.1
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/admin.mjs +30 -1
- package/package.json +1 -1
package/lib/cli.mjs
CHANGED
|
@@ -59,7 +59,7 @@ import {
|
|
|
59
59
|
} from "./commands.mjs";
|
|
60
60
|
|
|
61
61
|
// Keep in sync with cli/package.json.
|
|
62
|
-
export const VERSION = "0.100.
|
|
62
|
+
export const VERSION = "0.100.1";
|
|
63
63
|
|
|
64
64
|
// Flags that never take a value. Listing them explicitly means `deploy get --json <id>`
|
|
65
65
|
// can't accidentally swallow the id as --json's value. Every `type: "bool"` flag (and its
|
package/lib/commands/admin.mjs
CHANGED
|
@@ -2838,6 +2838,7 @@ async function cmdAdminCrmCapture(ctx, paths) {
|
|
|
2838
2838
|
* outreach add "Jane Doe" [--company …] [--owner …] [--channel x] [--relationship …]
|
|
2839
2839
|
* [--ask …] [--linkedin …] [--email …] [--lookup]
|
|
2840
2840
|
* outreach lookup "Jane Doe from Acme" [shot.png …] prefilled from the web; writes nothing
|
|
2841
|
+
* outreach catch-up [--dry-run] handle #launch-outreach posts the bot missed
|
|
2841
2842
|
* outreach set <id> [--reached|--not-reached] [--response "…" --tone positive]
|
|
2842
2843
|
* [--owner-id <uuid>] [--channel …] [--ask …] [--draft "…"] [--archive|--restore]
|
|
2843
2844
|
*/
|
|
@@ -2952,8 +2953,36 @@ async function cmdAdminCrmOutreach(ctx, args) {
|
|
|
2952
2953
|
const r = await staffRequest(ctx, "PATCH", `${CRM}/outreach/${id}`, body);
|
|
2953
2954
|
return json ? printResult(io, flags, r) : io.log(line(r));
|
|
2954
2955
|
}
|
|
2956
|
+
case "catch-up": {
|
|
2957
|
+
// admin crm outreach catch-up [--dry-run] — handle #launch-outreach posts the bot
|
|
2958
|
+
// missed, calling again until none remain (each call is bounded server-side).
|
|
2959
|
+
const dryRun = flagBool(flags["dry-run"]);
|
|
2960
|
+
let total = 0;
|
|
2961
|
+
let after;
|
|
2962
|
+
for (let i = 0; i < 20; i++) {
|
|
2963
|
+
const r = await staffPost(
|
|
2964
|
+
ctx,
|
|
2965
|
+
`${CRM}/outreach/catch-up`,
|
|
2966
|
+
dryRun ? { dryRun: true } : compact({ after })
|
|
2967
|
+
);
|
|
2968
|
+
after = r.nextAfter ?? after;
|
|
2969
|
+
if (json) printResult(io, flags, r);
|
|
2970
|
+
else
|
|
2971
|
+
for (const it of r.items)
|
|
2972
|
+
io.log(
|
|
2973
|
+
`${it.ts} ${it.outcome ?? "pending"} ${it.preview}${it.files ? ` [${it.files} file(s)]` : ""}`
|
|
2974
|
+
);
|
|
2975
|
+
total += r.processed;
|
|
2976
|
+
if (dryRun || r.remaining === 0 || r.items.some((it) => it.outcome?.startsWith("failed:"))) {
|
|
2977
|
+
if (!json)
|
|
2978
|
+
io.log(dryRun ? `${r.pending} post(s) the bot missed` : `caught up: ${total} post(s) handled`);
|
|
2979
|
+
return;
|
|
2980
|
+
}
|
|
2981
|
+
}
|
|
2982
|
+
return;
|
|
2983
|
+
}
|
|
2955
2984
|
default:
|
|
2956
|
-
throw new CliError("Usage: admin crm outreach [list|add|lookup|set] … (see --help)");
|
|
2985
|
+
throw new CliError("Usage: admin crm outreach [list|add|lookup|set|catch-up] … (see --help)");
|
|
2957
2986
|
}
|
|
2958
2987
|
}
|
|
2959
2988
|
|