@dench.com/cli 2.8.2-staging.112 → 2.8.3-staging.117
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/crm.ts +29 -0
- package/dench.ts +77 -10
- package/leads.ts +529 -79
- package/lib/api-schemas.ts +163 -14
- package/lib/command-registry.ts +105 -2
- package/lib/enrichment-gateway.ts +6 -0
- package/lib/find-filter-options.generated.ts +206 -0
- package/package.json +1 -1
package/crm.ts
CHANGED
|
@@ -659,6 +659,9 @@ const api = {
|
|
|
659
659
|
saveView: makeFunctionReference<"mutation">(
|
|
660
660
|
"functions/crm/objects:saveView",
|
|
661
661
|
),
|
|
662
|
+
renameView: makeFunctionReference<"mutation">(
|
|
663
|
+
"functions/crm/objects:renameView",
|
|
664
|
+
),
|
|
662
665
|
deleteView: makeFunctionReference<"mutation">(
|
|
663
666
|
"functions/crm/objects:deleteView",
|
|
664
667
|
),
|
|
@@ -1621,6 +1624,29 @@ async function runViewsCommand(ctx: CrmCliContext): Promise<void> {
|
|
|
1621
1624
|
);
|
|
1622
1625
|
return;
|
|
1623
1626
|
}
|
|
1627
|
+
// Rename keeps the whole view definition (filters, pins, sidebar
|
|
1628
|
+
// slot) and just swaps the name — unlike `update`, which upserts by
|
|
1629
|
+
// name and so cannot change one.
|
|
1630
|
+
case "rename": {
|
|
1631
|
+
const objectName = shift(ctx.args, "object name");
|
|
1632
|
+
const viewName = shift(ctx.args, "view name");
|
|
1633
|
+
const newName = getFlag(ctx.args, "--to") ?? shift(ctx.args, "new name");
|
|
1634
|
+
assertNoUnknownFlags(ctx.args, "crm views rename");
|
|
1635
|
+
if (!newName.trim()) {
|
|
1636
|
+
throw new CrmCliError(
|
|
1637
|
+
'crm views rename requires the new name: dench crm views rename <object> "<view>" "<new name>"',
|
|
1638
|
+
);
|
|
1639
|
+
}
|
|
1640
|
+
out(
|
|
1641
|
+
ctx,
|
|
1642
|
+
await callMutation(ctx, api.objects.renameView, {
|
|
1643
|
+
objectName,
|
|
1644
|
+
viewName,
|
|
1645
|
+
newName: newName.trim(),
|
|
1646
|
+
}),
|
|
1647
|
+
);
|
|
1648
|
+
return;
|
|
1649
|
+
}
|
|
1624
1650
|
case "delete": {
|
|
1625
1651
|
const objectName = shift(ctx.args, "object name");
|
|
1626
1652
|
const viewName = shift(ctx.args, "view name");
|
|
@@ -3627,6 +3653,9 @@ Views (saved CRM subsets):
|
|
|
3627
3653
|
dench crm views update <object> <view-name> [same flags as create] [--set-active]
|
|
3628
3654
|
Merges the provided flags over the existing view definition;
|
|
3629
3655
|
untouched keys survive.
|
|
3656
|
+
dench crm views rename <object> <view-name> <new-name>
|
|
3657
|
+
Renames in place: filters, pinned rows, sidebar slot, and the
|
|
3658
|
+
active-view pointer all follow the new name.
|
|
3630
3659
|
dench crm views delete <object> <view-name>
|
|
3631
3660
|
Idempotent; also clears the active-view pointer if it referenced
|
|
3632
3661
|
the deleted view.
|
package/dench.ts
CHANGED
|
@@ -478,9 +478,15 @@ Usage:
|
|
|
478
478
|
dench artifacts list [--limit 25] [--json]
|
|
479
479
|
dench artifacts show <id> [--json]
|
|
480
480
|
dench artifacts import <id> --to lead|company|job_posting [--view "Q3 outbound"] [--pin] [--json]
|
|
481
|
-
dench
|
|
482
|
-
dench
|
|
483
|
-
dench
|
|
481
|
+
dench lists [--limit 25] [--json]
|
|
482
|
+
dench lists show <id> [--json]
|
|
483
|
+
dench lists rename <id> "New name" [--json]
|
|
484
|
+
dench lists update <id> [--title "New name"] [--filters-json '{...}'] [--json]
|
|
485
|
+
dench lists delete <id> [--json]
|
|
486
|
+
dench leads find --titles "VP Sales" [--locations "San Francisco"] [--save-as "Q3 targets"] [--limit 500] [--page-token <token>] [--json] (rich filters: dench leads help)
|
|
487
|
+
dench leads filters [--filter titles|locations|company-hq|...] [--search "query"] [--json]
|
|
488
|
+
dench companies find --name "Acme" [--domain acme.com] [--keywords fintech] [--save-as "Target accounts"] [--limit 500] [--page-token <token>] [--json]
|
|
489
|
+
dench jobs find --titles "Account Executive" [--locations "San Francisco"] [--save-as "AE openings"] [--limit 500] [--page-token <token>] [--json]
|
|
484
490
|
dench suggested-work [--json]
|
|
485
491
|
dench approval request "message" [--json]
|
|
486
492
|
dench approval approve <approvalId> [--evidence "User said yes in chat"] [--json]
|
|
@@ -753,7 +759,25 @@ Usage:
|
|
|
753
759
|
dench suggested-work [--json]
|
|
754
760
|
|
|
755
761
|
\`list\` / \`show\` / \`import\` operate on find results. Bare \`dench artifacts\`
|
|
756
|
-
lists agent suggested-work artifacts.
|
|
762
|
+
lists agent suggested-work artifacts. Rename/delete saved searches with
|
|
763
|
+
\`dench lists rename|delete\`.
|
|
764
|
+
`);
|
|
765
|
+
}
|
|
766
|
+
|
|
767
|
+
function listsCliHelp() {
|
|
768
|
+
console.log(`Dench lists
|
|
769
|
+
|
|
770
|
+
Usage:
|
|
771
|
+
dench lists [--limit 25] [--json]
|
|
772
|
+
dench lists show <id> [--json]
|
|
773
|
+
dench lists rename <id> "New name" [--json]
|
|
774
|
+
dench lists update <id> [--title "New name"] [--filters-json '{"titles":["CTO"]}'] [--json]
|
|
775
|
+
dench lists delete <id> [--json]
|
|
776
|
+
|
|
777
|
+
Lists are saved searches from Find (people / companies / job postings).
|
|
778
|
+
Create one with \`dench leads|companies|jobs find --save-as "Name"\`.
|
|
779
|
+
Delete removes the list, its exported CSV/JSONL files, and any linked watch.
|
|
780
|
+
CRM lists (saved views) are managed with \`dench crm views ...\`.
|
|
757
781
|
`);
|
|
758
782
|
}
|
|
759
783
|
|
|
@@ -761,7 +785,15 @@ function leadsHelp() {
|
|
|
761
785
|
console.log(`Dench leads
|
|
762
786
|
|
|
763
787
|
Usage:
|
|
764
|
-
dench leads find --titles "VP Sales" --locations "San Francisco" [--company-domain acme.com] [--keywords fintech] [--limit 500] [--page-token <token>] [--json]
|
|
788
|
+
dench leads find --titles "VP Sales" --locations "San Francisco" [--company-domain acme.com] [--keywords fintech] [--save-as "Q3 targets"] [--limit 500] [--page-token <token>] [--json]
|
|
789
|
+
dench leads filters [--filter titles|locations|company-hq|universities|skills|keywords|...] [--search "query"] [--json]
|
|
790
|
+
|
|
791
|
+
Rich filter flags: --past-titles --person-names --seniorities --functions
|
|
792
|
+
--sub-functions --languages --universities --skills --company-names
|
|
793
|
+
--past-company-names --company-domains --company-hq --company-types
|
|
794
|
+
--industries --headcount, plus min:max ranges --years-in-role
|
|
795
|
+
--years-at-company --days-since-job-change --founded-years.
|
|
796
|
+
Run \`dench leads filters\` for accepted enum values and curated suggestions.
|
|
765
797
|
`);
|
|
766
798
|
}
|
|
767
799
|
|
|
@@ -769,7 +801,7 @@ function companiesHelp() {
|
|
|
769
801
|
console.log(`Dench companies
|
|
770
802
|
|
|
771
803
|
Usage:
|
|
772
|
-
dench companies find --name "Acme" [--domain acme.com] [--keywords fintech] [--industries SaaS] [--locations "San Francisco"] [--limit 500] [--page-token <token>] [--json]
|
|
804
|
+
dench companies find --name "Acme" [--domain acme.com] [--keywords fintech] [--industries SaaS] [--locations "San Francisco"] [--save-as "Target accounts"] [--limit 500] [--page-token <token>] [--json]
|
|
773
805
|
`);
|
|
774
806
|
}
|
|
775
807
|
|
|
@@ -777,7 +809,7 @@ function jobsHelp() {
|
|
|
777
809
|
console.log(`Dench jobs
|
|
778
810
|
|
|
779
811
|
Usage:
|
|
780
|
-
dench jobs find --titles "Account Executive" --locations "San Francisco" [--company-domain acme.com] [--keywords remote] [--limit 500] [--page-token <token>] [--json]
|
|
812
|
+
dench jobs find --titles "Account Executive" --locations "San Francisco" [--company-domain acme.com] [--keywords remote] [--save-as "AE openings"] [--limit 500] [--page-token <token>] [--json]
|
|
781
813
|
`);
|
|
782
814
|
}
|
|
783
815
|
|
|
@@ -2739,7 +2771,8 @@ async function resolveGatewayCommandAuth(
|
|
|
2739
2771
|
return {
|
|
2740
2772
|
bearerToken: gatewayKey,
|
|
2741
2773
|
gatewayBaseUrl:
|
|
2742
|
-
envGatewayBaseUrlOverride() ??
|
|
2774
|
+
envGatewayBaseUrlOverride() ??
|
|
2775
|
+
gatewayBaseUrlForCli(body.gatewayBaseUrl),
|
|
2743
2776
|
gatewayHeaders:
|
|
2744
2777
|
body.gatewayHeaders &&
|
|
2745
2778
|
typeof body.gatewayHeaders === "object" &&
|
|
@@ -4258,6 +4291,11 @@ async function main() {
|
|
|
4258
4291
|
return;
|
|
4259
4292
|
}
|
|
4260
4293
|
|
|
4294
|
+
if (command === "lists" && (subcommand === "help" || hasFlag("--help"))) {
|
|
4295
|
+
listsCliHelp();
|
|
4296
|
+
return;
|
|
4297
|
+
}
|
|
4298
|
+
|
|
4261
4299
|
if (command === "leads" && (subcommand === "help" || hasFlag("--help"))) {
|
|
4262
4300
|
leadsHelp();
|
|
4263
4301
|
return;
|
|
@@ -4354,8 +4392,14 @@ async function main() {
|
|
|
4354
4392
|
}
|
|
4355
4393
|
|
|
4356
4394
|
if (command === "leads") {
|
|
4357
|
-
const { runLeadsCommand, assertLeadsFindArgs } =
|
|
4395
|
+
const { runLeadsCommand, assertLeadsFindArgs, runFindFiltersCommand } =
|
|
4396
|
+
await import("./leads");
|
|
4358
4397
|
const leadArgs = stripRuntimeFlags(args.slice(args.indexOf("leads") + 1));
|
|
4398
|
+
// `filters` prints bundled catalogs — no session or network needed.
|
|
4399
|
+
if (leadArgs[0] === "filters") {
|
|
4400
|
+
runFindFiltersCommand({ args: leadArgs.slice(1), jsonOutput: json });
|
|
4401
|
+
return;
|
|
4402
|
+
}
|
|
4359
4403
|
assertLeadsFindArgs(leadArgs);
|
|
4360
4404
|
const auth = await resolveFindCommandAuth("dench leads");
|
|
4361
4405
|
await runLeadsCommand({
|
|
@@ -4369,7 +4413,9 @@ async function main() {
|
|
|
4369
4413
|
}
|
|
4370
4414
|
|
|
4371
4415
|
if (command === "companies") {
|
|
4372
|
-
const { runCompaniesCommand, assertCompaniesFindArgs } = await import(
|
|
4416
|
+
const { runCompaniesCommand, assertCompaniesFindArgs } = await import(
|
|
4417
|
+
"./leads"
|
|
4418
|
+
);
|
|
4373
4419
|
const companyArgs = stripRuntimeFlags(
|
|
4374
4420
|
args.slice(args.indexOf("companies") + 1),
|
|
4375
4421
|
);
|
|
@@ -5006,6 +5052,27 @@ async function main() {
|
|
|
5006
5052
|
return;
|
|
5007
5053
|
}
|
|
5008
5054
|
|
|
5055
|
+
if (command === "lists") {
|
|
5056
|
+
const runtime = await getRuntime();
|
|
5057
|
+
const listsArgs = stripRuntimeFlags(args.slice(args.indexOf("lists") + 1));
|
|
5058
|
+
const { runListsCommand } = await import("./leads");
|
|
5059
|
+
// Same auth surface as `dench crm`: agent session tokens and unified
|
|
5060
|
+
// API keys hit requireCrmAccess directly; dev mode rides the encoded
|
|
5061
|
+
// dev CRM token so local workspaces work without a signin.
|
|
5062
|
+
const sessionToken =
|
|
5063
|
+
runtime.mode === "dev"
|
|
5064
|
+
? encodeDevCrmSessionToken(runtime.workspaceArgs)
|
|
5065
|
+
: requireAuthenticatedRuntime(runtime, "dench lists").sessionToken;
|
|
5066
|
+
const handled = await runListsCommand({
|
|
5067
|
+
convex: runtime.client,
|
|
5068
|
+
args: listsArgs,
|
|
5069
|
+
jsonOutput: json,
|
|
5070
|
+
sessionToken,
|
|
5071
|
+
});
|
|
5072
|
+
if (!handled) listsCliHelp();
|
|
5073
|
+
return;
|
|
5074
|
+
}
|
|
5075
|
+
|
|
5009
5076
|
if (command === "suggested-work") {
|
|
5010
5077
|
print(await listSuggestedWork(runtime));
|
|
5011
5078
|
return;
|