salesprompter-cli 0.1.11 → 0.1.13
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/dist/cli.js +92 -12
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -276,7 +276,8 @@ async function ensureWizardSession(options) {
|
|
|
276
276
|
return result.session;
|
|
277
277
|
}
|
|
278
278
|
async function runVendorIcpWizard(rl) {
|
|
279
|
-
const vendor =
|
|
279
|
+
const vendor = "deel";
|
|
280
|
+
writeWizardLine("Using the built-in Deel ICP template.");
|
|
280
281
|
writeWizardLine();
|
|
281
282
|
const market = await promptChoice(rl, "Which market do you want to target?", [
|
|
282
283
|
{ value: "dach", label: "DACH", description: "Germany, Austria, Switzerland" },
|
|
@@ -369,8 +370,29 @@ async function runTargetAccountWizard(rl) {
|
|
|
369
370
|
leadArgs.push("--out", leadsPath);
|
|
370
371
|
writeWizardLine(` ${buildCommandLine(leadArgs)}`);
|
|
371
372
|
}
|
|
373
|
+
async function runLeadGenerationWizard(rl) {
|
|
374
|
+
const source = await promptChoice(rl, "How do you want to generate leads?", [
|
|
375
|
+
{
|
|
376
|
+
value: "target-account",
|
|
377
|
+
label: "At a specific company",
|
|
378
|
+
description: "Example: find people at deel.com"
|
|
379
|
+
},
|
|
380
|
+
{
|
|
381
|
+
value: "vendor-lookup",
|
|
382
|
+
label: "From BigQuery",
|
|
383
|
+
description: "Use an ICP to search lead data you already have in BigQuery"
|
|
384
|
+
}
|
|
385
|
+
], "target-account");
|
|
386
|
+
writeWizardLine();
|
|
387
|
+
if (source === "target-account") {
|
|
388
|
+
await runTargetAccountWizard(rl);
|
|
389
|
+
return;
|
|
390
|
+
}
|
|
391
|
+
await runVendorLookupWizard(rl);
|
|
392
|
+
}
|
|
372
393
|
async function runVendorLookupWizard(rl) {
|
|
373
|
-
const vendor =
|
|
394
|
+
const vendor = "deel";
|
|
395
|
+
writeWizardLine("Using the built-in Deel ICP template.");
|
|
374
396
|
writeWizardLine();
|
|
375
397
|
const market = await promptChoice(rl, "Which market should the BigQuery lookup target?", [
|
|
376
398
|
{ value: "dach", label: "DACH", description: "Germany, Austria, Switzerland" },
|
|
@@ -446,6 +468,64 @@ async function runVendorLookupWizard(rl) {
|
|
|
446
468
|
}
|
|
447
469
|
writeWizardLine(` ${buildCommandLine(lookupArgs)}`);
|
|
448
470
|
}
|
|
471
|
+
async function runOutreachSyncWizard(rl) {
|
|
472
|
+
const target = await promptChoice(rl, "Which outreach tool do you want to use?", [
|
|
473
|
+
{
|
|
474
|
+
value: "instantly",
|
|
475
|
+
label: "Instantly",
|
|
476
|
+
description: "Create campaign leads from a scored leads JSON file"
|
|
477
|
+
}
|
|
478
|
+
], "instantly");
|
|
479
|
+
writeWizardLine();
|
|
480
|
+
if (!process.env.INSTANTLY_API_KEY || process.env.INSTANTLY_API_KEY.trim().length === 0) {
|
|
481
|
+
throw new Error("INSTANTLY_API_KEY is required for the Instantly sync flow.");
|
|
482
|
+
}
|
|
483
|
+
const inputPath = await promptText(rl, "Where is your scored leads JSON file?", {
|
|
484
|
+
defaultValue: "./data/scored.json",
|
|
485
|
+
required: true
|
|
486
|
+
});
|
|
487
|
+
const defaultCampaignId = process.env.INSTANTLY_CAMPAIGN_ID?.trim();
|
|
488
|
+
const campaignId = await promptText(rl, "Instantly campaign ID", {
|
|
489
|
+
defaultValue: defaultCampaignId && defaultCampaignId.length > 0 ? defaultCampaignId : undefined,
|
|
490
|
+
required: defaultCampaignId === undefined || defaultCampaignId.length === 0
|
|
491
|
+
});
|
|
492
|
+
const apply = await promptYesNo(rl, "Create the leads in Instantly now?", false);
|
|
493
|
+
const allowDuplicates = await promptYesNo(rl, "Allow duplicate emails in the campaign?", false);
|
|
494
|
+
writeWizardLine();
|
|
495
|
+
const leads = await readJsonFile(inputPath, z.array(ScoredLeadSchema));
|
|
496
|
+
const result = await syncProvider.sync(target, leads, {
|
|
497
|
+
apply,
|
|
498
|
+
instantlyCampaignId: campaignId,
|
|
499
|
+
allowDuplicates
|
|
500
|
+
});
|
|
501
|
+
const skipped = result.skipped ?? 0;
|
|
502
|
+
writeWizardLine(`${apply ? "Sent" : "Prepared"} ${result.synced} lead${result.synced === 1 ? "" : "s"} for ${target}.`);
|
|
503
|
+
if (skipped > 0) {
|
|
504
|
+
writeWizardLine(`Skipped ${skipped} duplicate lead${skipped === 1 ? "" : "s"}.`);
|
|
505
|
+
}
|
|
506
|
+
if (result.dryRun) {
|
|
507
|
+
writeWizardLine("This was a dry run. Re-run and confirm the write when you are ready.");
|
|
508
|
+
}
|
|
509
|
+
writeWizardLine();
|
|
510
|
+
writeWizardLine("Equivalent raw command:");
|
|
511
|
+
const syncArgs = [
|
|
512
|
+
"salesprompter",
|
|
513
|
+
"sync:outreach",
|
|
514
|
+
"--target",
|
|
515
|
+
target,
|
|
516
|
+
"--in",
|
|
517
|
+
inputPath,
|
|
518
|
+
"--campaign-id",
|
|
519
|
+
campaignId
|
|
520
|
+
];
|
|
521
|
+
if (allowDuplicates) {
|
|
522
|
+
syncArgs.push("--allow-duplicates");
|
|
523
|
+
}
|
|
524
|
+
if (apply) {
|
|
525
|
+
syncArgs.push("--apply");
|
|
526
|
+
}
|
|
527
|
+
writeWizardLine(` ${buildCommandLine(syncArgs)}`);
|
|
528
|
+
}
|
|
449
529
|
async function runWizard(options) {
|
|
450
530
|
if (runtimeOutputOptions.json || runtimeOutputOptions.quiet) {
|
|
451
531
|
throw new Error("wizard does not support --json or --quiet.");
|
|
@@ -463,17 +543,17 @@ async function runWizard(options) {
|
|
|
463
543
|
{
|
|
464
544
|
value: "vendor-icp",
|
|
465
545
|
label: "Define my ICP",
|
|
466
|
-
description: "
|
|
546
|
+
description: "Build the kind of company profile your product sells to"
|
|
467
547
|
},
|
|
468
548
|
{
|
|
469
|
-
value: "
|
|
470
|
-
label: "
|
|
471
|
-
description: "
|
|
549
|
+
value: "lead-generation",
|
|
550
|
+
label: "Generate leads",
|
|
551
|
+
description: "Find people at a target company or from your BigQuery data"
|
|
472
552
|
},
|
|
473
553
|
{
|
|
474
|
-
value: "
|
|
475
|
-
label: "
|
|
476
|
-
description: "
|
|
554
|
+
value: "outreach-sync",
|
|
555
|
+
label: "Send leads to outreach",
|
|
556
|
+
description: "Push scored leads into Instantly"
|
|
477
557
|
}
|
|
478
558
|
], "vendor-icp");
|
|
479
559
|
writeWizardLine();
|
|
@@ -481,11 +561,11 @@ async function runWizard(options) {
|
|
|
481
561
|
await runVendorIcpWizard(rl);
|
|
482
562
|
return;
|
|
483
563
|
}
|
|
484
|
-
if (flow === "
|
|
485
|
-
await
|
|
564
|
+
if (flow === "lead-generation") {
|
|
565
|
+
await runLeadGenerationWizard(rl);
|
|
486
566
|
return;
|
|
487
567
|
}
|
|
488
|
-
await
|
|
568
|
+
await runOutreachSyncWizard(rl);
|
|
489
569
|
}
|
|
490
570
|
finally {
|
|
491
571
|
rl.close();
|
package/package.json
CHANGED