@helm-ai/cli 1.0.0 → 1.1.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/dist/cli.js +16 -5
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -25,7 +25,7 @@ function renderSplash(ctx) {
|
|
|
25
25
|
}
|
|
26
26
|
|
|
27
27
|
// src/version.ts
|
|
28
|
-
var version = "1.
|
|
28
|
+
var version = "1.1.0";
|
|
29
29
|
|
|
30
30
|
// src/commands/auth.ts
|
|
31
31
|
import prompts from "prompts";
|
|
@@ -1643,6 +1643,10 @@ function registerCompanyCommands(parent) {
|
|
|
1643
1643
|
|
|
1644
1644
|
// src/commands/deal.ts
|
|
1645
1645
|
import prompts2 from "prompts";
|
|
1646
|
+
function clearable(value) {
|
|
1647
|
+
if (value === void 0) return void 0;
|
|
1648
|
+
return value.trim() || null;
|
|
1649
|
+
}
|
|
1646
1650
|
function registerDealCommands(parent) {
|
|
1647
1651
|
const cmd = parent.command("deal").alias("deals").description("Manage sales deals");
|
|
1648
1652
|
cmd.command("list").description("List deals").option("--stage <stage>", "stage key (defined per pipeline; see `pipeline list`)").option("--priority <level>").option("-C, --company <id>").option("--pipeline <id>", "filter by pipeline ID (see `pipeline list`)").option("-l, --limit <n>", "max rows", (v) => parseInt(v, 10), 50).option("-o, --output <format>").option("-p, --profile <name>").action(async (opts) => {
|
|
@@ -1679,7 +1683,7 @@ function registerDealCommands(parent) {
|
|
|
1679
1683
|
return;
|
|
1680
1684
|
}
|
|
1681
1685
|
});
|
|
1682
|
-
cmd.command("create").description("Create a deal").requiredOption("-t, --title <title>", "deal title (required)").option("--pipeline <id>", "pipeline ID (defaults to the workspace default; see `pipeline list`)").option("--stage <stage>", "stage key (defaults to the pipeline first stage)").option("--priority <level>", "low|medium|high|urgent").option("--value <amount>", "deal value in dollars", parseFloat).option("--probability <pct>", "0-100", parseFloat).option("-C, --company <id>").option("--contact <id>", "link the deal to a contact/person (see `contact list`)").option("--close-date <date>", "expected close (ISO 8601)").option("-p, --profile <name>").action(async (opts) => {
|
|
1686
|
+
cmd.command("create").description("Create a deal").requiredOption("-t, --title <title>", "deal title (required)").option("--pipeline <id>", "pipeline ID (defaults to the workspace default; see `pipeline list`)").option("--stage <stage>", "stage key (defaults to the pipeline first stage)").option("--priority <level>", "low|medium|high|urgent").option("--value <amount>", "deal value in dollars", parseFloat).option("--probability <pct>", "0-100", parseFloat).option("-C, --company <id>").option("--contact <id>", "link the deal to a contact/person (see `contact list`)").option("--close-date <date>", "expected close (ISO 8601)").option("--next-step <text>", "what the deal is waiting on, in a sentence").option("--next-step-date <date>", "when the next step is due (YYYY-MM-DD)").option("--source <text>", "where the deal came from").option("-p, --profile <name>").action(async (opts) => {
|
|
1683
1687
|
try {
|
|
1684
1688
|
const client = HelmClient.fromProfile(resolveProfile(opts.profile));
|
|
1685
1689
|
const deal = await client.deals.create({
|
|
@@ -1691,7 +1695,10 @@ function registerDealCommands(parent) {
|
|
|
1691
1695
|
probability: opts.probability,
|
|
1692
1696
|
company_id: opts.company,
|
|
1693
1697
|
contact_id: opts.contact,
|
|
1694
|
-
expected_close_date: opts.closeDate
|
|
1698
|
+
expected_close_date: opts.closeDate,
|
|
1699
|
+
next_step: opts.nextStep,
|
|
1700
|
+
next_step_date: opts.nextStepDate,
|
|
1701
|
+
source: opts.source
|
|
1695
1702
|
});
|
|
1696
1703
|
console.log(JSON.stringify(deal, null, 2));
|
|
1697
1704
|
} catch (err) {
|
|
@@ -1700,7 +1707,7 @@ function registerDealCommands(parent) {
|
|
|
1700
1707
|
return;
|
|
1701
1708
|
}
|
|
1702
1709
|
});
|
|
1703
|
-
cmd.command("update <id>").description("Update a deal").option("-t, --title <title>").option("--pipeline <id>", "move the deal to another pipeline (see `pipeline list`)").option("--stage <stage>", "stage key within the deal pipeline").option("--priority <level>", "low|medium|high|urgent").option("--value <amount>", "deal value in dollars", parseFloat).option("--probability <pct>", "0-100", parseFloat).option("-C, --company <id>").option("--contact <id>", "link the deal to a contact/person (see `contact list`)").option("--close-date <date>", "expected close (ISO 8601)").option("-p, --profile <name>").action(async (id, opts) => {
|
|
1710
|
+
cmd.command("update <id>").description("Update a deal").option("-t, --title <title>").option("--pipeline <id>", "move the deal to another pipeline (see `pipeline list`)").option("--stage <stage>", "stage key within the deal pipeline").option("--priority <level>", "low|medium|high|urgent").option("--value <amount>", "deal value in dollars", parseFloat).option("--probability <pct>", "0-100", parseFloat).option("-C, --company <id>").option("--contact <id>", "link the deal to a contact/person (see `contact list`)").option("--close-date <date>", "expected close (ISO 8601)").option("--next-step <text>", "what the deal is waiting on, in a sentence").option("--next-step-date <date>", "when the next step is due (YYYY-MM-DD)").option("--source <text>", "where the deal came from").option("--lost-reason <text>", "why the deal was lost").option("-p, --profile <name>").action(async (id, opts) => {
|
|
1704
1711
|
try {
|
|
1705
1712
|
const client = HelmClient.fromProfile(resolveProfile(opts.profile));
|
|
1706
1713
|
const deal = await client.deals.update(id, {
|
|
@@ -1712,7 +1719,11 @@ function registerDealCommands(parent) {
|
|
|
1712
1719
|
probability: opts.probability,
|
|
1713
1720
|
company_id: opts.company,
|
|
1714
1721
|
contact_id: opts.contact,
|
|
1715
|
-
expected_close_date: opts.closeDate
|
|
1722
|
+
expected_close_date: opts.closeDate,
|
|
1723
|
+
next_step: clearable(opts.nextStep),
|
|
1724
|
+
next_step_date: clearable(opts.nextStepDate),
|
|
1725
|
+
source: clearable(opts.source),
|
|
1726
|
+
lost_reason: clearable(opts.lostReason)
|
|
1716
1727
|
});
|
|
1717
1728
|
console.log(JSON.stringify(deal, null, 2));
|
|
1718
1729
|
} catch (err) {
|