@letterstory/cli 0.41.0 → 0.42.0
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/README.md +2 -0
- package/lib/cli.mjs +1 -1
- package/lib/commands/admin.mjs +25 -2
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -384,6 +384,8 @@ letterstory admin crm signal <signal-id> qualify # link/create the account
|
|
|
384
384
|
letterstory admin crm signal <signal-id> dismiss # the easy delete (kept, marked)
|
|
385
385
|
letterstory admin crm accounts --stage demo_scheduled # with likelihood
|
|
386
386
|
letterstory admin crm score <account-id> # recompute; prints the factors
|
|
387
|
+
letterstory admin crm slack-channels [--all] # Watchdog channels + the account each is linked to
|
|
388
|
+
letterstory admin crm link-slack <account-id> C0123ABC # the CRM's watch-only Slack link (`none` unlinks)
|
|
387
389
|
```
|
|
388
390
|
|
|
389
391
|
Every trigger — Cal.com bookings, Circleback recordings, Letterhome dinner RSVPs, RB2B
|
package/lib/cli.mjs
CHANGED
|
@@ -52,7 +52,7 @@ import {
|
|
|
52
52
|
} from "./commands.mjs";
|
|
53
53
|
|
|
54
54
|
// Keep in sync with cli/package.json.
|
|
55
|
-
export const VERSION = "0.
|
|
55
|
+
export const VERSION = "0.42.0";
|
|
56
56
|
|
|
57
57
|
// Flags that never take a value. Listing them explicitly means `deploy get --json <id>`
|
|
58
58
|
// can't accidentally swallow the id as --json's value.
|
package/lib/commands/admin.mjs
CHANGED
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
// admin experiments list|show|new|update|note|started|spend|conclude|abandon … (tuning:experiment)
|
|
8
8
|
// admin tuning-context [--q "<question>"] (tuning:experiment)
|
|
9
9
|
// admin tuning-import <brief-results.json> [--experiment <id>] (tuning:experiment)
|
|
10
|
-
// admin crm signals|record|signal|accounts|account|score …
|
|
10
|
+
// admin crm signals|record|signal|accounts|account|score|slack-channels|link-slack … (crm:read / crm:write)
|
|
11
11
|
// admin create-org --domain acme.com [--name "Acme"] [--test] [--no-key] [--key-name N]
|
|
12
12
|
// [--capabilities a,b] [--onboard] [--about "…"] [--sitemap <url>]
|
|
13
13
|
// [--cms <provider>] [--posts N] [--seers suggest|skip] [--no-visuals]
|
|
@@ -509,8 +509,31 @@ async function cmdAdminCrm(ctx) {
|
|
|
509
509
|
].join("\n")
|
|
510
510
|
);
|
|
511
511
|
}
|
|
512
|
+
case "slack-channels": {
|
|
513
|
+
const params = flagBool(flags.all) ? "?all=1" : "";
|
|
514
|
+
return out(await staffRequest(ctx, "GET", `${CRM}/slack-channels${params}`), (r) =>
|
|
515
|
+
r.channels.length
|
|
516
|
+
? r.channels
|
|
517
|
+
.map(
|
|
518
|
+
(c) =>
|
|
519
|
+
`${c.id} #${c.name ?? "?"}${c.linkedAccountId ? ` → ${c.linkedAccountId}` : ""}`
|
|
520
|
+
)
|
|
521
|
+
.join("\n")
|
|
522
|
+
: "(no channels)"
|
|
523
|
+
);
|
|
524
|
+
}
|
|
525
|
+
case "link-slack": {
|
|
526
|
+
// admin crm link-slack <account-id> <channel-id|none> — the CRM's watch-only link (never a binding).
|
|
527
|
+
if (!id || !action) throw new CliError("Usage: admin crm link-slack <account-id> <channel-id|none>");
|
|
528
|
+
const r = await staffRequest(ctx, "PATCH", `${CRM}/accounts/${id}`, {
|
|
529
|
+
slack_channel_id: action === "none" ? null : action,
|
|
530
|
+
});
|
|
531
|
+
return out(r, () => (action === "none" ? "unlinked" : `linked ${action}`));
|
|
532
|
+
}
|
|
512
533
|
default:
|
|
513
|
-
throw new CliError(
|
|
534
|
+
throw new CliError(
|
|
535
|
+
"Usage: admin crm signals|record|signal|accounts|account|score|slack-channels|link-slack … (see --help)"
|
|
536
|
+
);
|
|
514
537
|
}
|
|
515
538
|
}
|
|
516
539
|
|