@hasna/contacts 0.4.1 → 0.4.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/dist/cli/index.js +17 -33
- package/package.json +1 -1
package/dist/cli/index.js
CHANGED
|
@@ -6528,45 +6528,29 @@ ${items.length} upcoming item(s) in next ${opts.days} days
|
|
|
6528
6528
|
program.command("stats").description("Network health dashboard").action(async () => {
|
|
6529
6529
|
const { getNetworkStats: getNetworkStats2 } = await Promise.resolve().then(() => (init_stats(), exports_stats));
|
|
6530
6530
|
const db = getDatabase();
|
|
6531
|
-
const
|
|
6531
|
+
const s = getNetworkStats2(db);
|
|
6532
6532
|
console.log(chalk.bold.blue(`
|
|
6533
6533
|
\u2501\u2501\u2501 Network Health Dashboard \u2501\u2501\u2501
|
|
6534
6534
|
`));
|
|
6535
|
-
|
|
6536
|
-
|
|
6537
|
-
|
|
6538
|
-
console.log(` ${chalk.cyan(String(size["contacts"] ?? 0))} contacts ${chalk.cyan(String(size["companies"] ?? 0))} companies ${chalk.cyan(String(size["tags"] ?? 0))} tags`);
|
|
6539
|
-
}
|
|
6540
|
-
const cold = stats["cold_contacts"];
|
|
6541
|
-
if (cold) {
|
|
6542
|
-
console.log(chalk.bold(`
|
|
6535
|
+
console.log(chalk.bold(" Network Size:"));
|
|
6536
|
+
console.log(` ${chalk.cyan(String(s.total_contacts))} contacts ${chalk.cyan(String(s.total_companies))} companies ${chalk.cyan(String(s.total_tags))} tags ${chalk.cyan(String(s.total_groups))} groups`);
|
|
6537
|
+
console.log(chalk.bold(`
|
|
6543
6538
|
Cold Contacts:`));
|
|
6544
|
-
|
|
6545
|
-
|
|
6546
|
-
|
|
6547
|
-
|
|
6548
|
-
|
|
6549
|
-
|
|
6550
|
-
|
|
6551
|
-
const action = stats["action_required"];
|
|
6552
|
-
if (action) {
|
|
6553
|
-
console.log(chalk.bold(`
|
|
6539
|
+
const c30 = s.cold_30d;
|
|
6540
|
+
const c60 = s.cold_60d;
|
|
6541
|
+
const cnever = s.cold_never;
|
|
6542
|
+
console.log(` ${c30 > 5 ? chalk.red(String(c30)) : c30 > 0 ? chalk.yellow(String(c30)) : chalk.green(String(c30))} not contacted in 30d`);
|
|
6543
|
+
console.log(` ${c60 > 5 ? chalk.red(String(c60)) : c60 > 0 ? chalk.yellow(String(c60)) : chalk.green(String(c60))} not contacted in 60d`);
|
|
6544
|
+
console.log(` ${cnever > 5 ? chalk.red(String(cnever)) : cnever > 0 ? chalk.yellow(String(cnever)) : chalk.green(String(cnever))} never contacted`);
|
|
6545
|
+
console.log(chalk.bold(`
|
|
6554
6546
|
Action Required:`));
|
|
6555
|
-
|
|
6556
|
-
|
|
6557
|
-
|
|
6558
|
-
|
|
6559
|
-
|
|
6560
|
-
console.log(` ${pending > 0 ? chalk.yellow(String(pending)) : chalk.green("0")} pending applications`);
|
|
6561
|
-
console.log(` ${missing > 0 ? chalk.yellow(String(missing)) : chalk.green("0")} missing invoices`);
|
|
6562
|
-
console.log(` ${upcoming > 0 ? chalk.yellow(String(upcoming)) : chalk.green("0")} upcoming in 7d`);
|
|
6563
|
-
}
|
|
6564
|
-
const pipeline = stats["pipeline_value_usd"];
|
|
6565
|
-
if (pipeline !== undefined) {
|
|
6566
|
-
console.log(chalk.bold(`
|
|
6547
|
+
console.log(` ${s.overdue_tasks > 0 ? chalk.red(String(s.overdue_tasks)) : chalk.green("0")} overdue tasks`);
|
|
6548
|
+
console.log(` ${s.pending_applications > 0 ? chalk.yellow(String(s.pending_applications)) : chalk.green("0")} pending applications`);
|
|
6549
|
+
console.log(` ${s.missing_invoices > 0 ? chalk.yellow(String(s.missing_invoices)) : chalk.green("0")} missing invoices`);
|
|
6550
|
+
console.log(` ${s.upcoming_7d > 0 ? chalk.yellow(String(s.upcoming_7d)) : chalk.green("0")} upcoming in 7d`);
|
|
6551
|
+
console.log(chalk.bold(`
|
|
6567
6552
|
Deal Pipeline:`));
|
|
6568
|
-
|
|
6569
|
-
}
|
|
6553
|
+
console.log(` ${chalk.cyan("$" + s.active_deals_value.toLocaleString())} active pipeline ${chalk.cyan(String(s.total_deals))} active deal(s)`);
|
|
6570
6554
|
console.log();
|
|
6571
6555
|
});
|
|
6572
6556
|
program.command("audit").description("Score contacts for data completeness").option("--limit <n>", "Number to show", "20").action(async (opts) => {
|