@letterstory/cli 0.100.1 → 0.100.2
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 +32 -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.2";
|
|
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,8 @@ 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 relookup [--missing linkedin] the web lookup again for whoever lacks it
|
|
2842
|
+
* outreach customers [--dry-run] every customer's primary contact onto the list
|
|
2841
2843
|
* outreach catch-up [--dry-run] handle #launch-outreach posts the bot missed
|
|
2842
2844
|
* outreach set <id> [--reached|--not-reached] [--response "…" --tone positive]
|
|
2843
2845
|
* [--owner-id <uuid>] [--channel …] [--ask …] [--draft "…"] [--archive|--restore]
|
|
@@ -2953,6 +2955,33 @@ async function cmdAdminCrmOutreach(ctx, args) {
|
|
|
2953
2955
|
const r = await staffRequest(ctx, "PATCH", `${CRM}/outreach/${id}`, body);
|
|
2954
2956
|
return json ? printResult(io, flags, r) : io.log(line(r));
|
|
2955
2957
|
}
|
|
2958
|
+
case "relookup": {
|
|
2959
|
+
// admin crm outreach relookup [--missing linkedin|company|any] — the web lookup again,
|
|
2960
|
+
// filling only blanks, calling until none remain (a dozen people per call).
|
|
2961
|
+
const missing = flagStr(flags.missing) ?? "linkedin";
|
|
2962
|
+
let total = 0;
|
|
2963
|
+
for (let i = 0; i < 30; i++) {
|
|
2964
|
+
const r = await staffPost(ctx, `${CRM}/outreach/relookup`, compact({ list, missing }));
|
|
2965
|
+
for (const f of r.filled) io.log(`${f.name}: ${f.fields.join(", ")}`);
|
|
2966
|
+
total += r.looked;
|
|
2967
|
+
if (!r.looked || r.remaining === 0) break;
|
|
2968
|
+
}
|
|
2969
|
+
return io.log(`looked up ${total}`);
|
|
2970
|
+
}
|
|
2971
|
+
case "customers": {
|
|
2972
|
+
// admin crm outreach customers [--dry-run] — every customer's primary contact onto the list.
|
|
2973
|
+
const r = await staffPost(
|
|
2974
|
+
ctx,
|
|
2975
|
+
`${CRM}/outreach/from-accounts`,
|
|
2976
|
+
compact({ list, dryRun: flagBool(flags["dry-run"]) || undefined })
|
|
2977
|
+
);
|
|
2978
|
+
if (json) return printResult(io, flags, r);
|
|
2979
|
+
return io.log(
|
|
2980
|
+
r.dryRun
|
|
2981
|
+
? `would add up to ${r.candidates.length}: ${r.candidates.join(", ")}`
|
|
2982
|
+
: `added ${r.created.length}; already on the list: ${r.duplicates.length}`
|
|
2983
|
+
);
|
|
2984
|
+
}
|
|
2956
2985
|
case "catch-up": {
|
|
2957
2986
|
// admin crm outreach catch-up [--dry-run] — handle #launch-outreach posts the bot
|
|
2958
2987
|
// missed, calling again until none remain (each call is bounded server-side).
|
|
@@ -2982,7 +3011,9 @@ async function cmdAdminCrmOutreach(ctx, args) {
|
|
|
2982
3011
|
return;
|
|
2983
3012
|
}
|
|
2984
3013
|
default:
|
|
2985
|
-
throw new CliError(
|
|
3014
|
+
throw new CliError(
|
|
3015
|
+
"Usage: admin crm outreach [list|add|lookup|set|relookup|customers|catch-up] … (see --help)"
|
|
3016
|
+
);
|
|
2986
3017
|
}
|
|
2987
3018
|
}
|
|
2988
3019
|
|