@helm-ai/cli 0.31.1 → 1.0.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 +3 -3
- package/dist/cli.js +158 -127
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -83,14 +83,14 @@ Every resource follows the same shape — `list`, `get <id>`, `create`, `update
|
|
|
83
83
|
| Group | What it covers |
|
|
84
84
|
|---|---|
|
|
85
85
|
| `project`, `task`, `time` | Delivery: projects, tasks, comments, time entries |
|
|
86
|
-
| `
|
|
86
|
+
| `company`, `contact`, `deal`, `pipeline` | Customers: companies, people, and the sales pipeline |
|
|
87
87
|
| `invoice`, `estimate`, `product` | Money: billing documents and the product catalog |
|
|
88
88
|
| `doc` | Rich-text documents, folders, and pages |
|
|
89
89
|
| `calendar` | Events and meetings |
|
|
90
90
|
| `form`, `sequence`, `email` | Capture and follow-up |
|
|
91
91
|
| `workflow`, `template` | Automations and reusable project structures |
|
|
92
92
|
| `agent` | AI staff — schedules, objectives, and runs |
|
|
93
|
-
| `import` | Bulk import of people,
|
|
93
|
+
| `import` | Bulk import of people, companies, deals and tasks from CSV/JSON |
|
|
94
94
|
| `login`, `logout`, `whoami`, `profile`, `config` | Credentials and settings |
|
|
95
95
|
|
|
96
96
|
Run `helm-ai --help` for the full list, or `helm-ai <group> --help` for one group.
|
|
@@ -141,7 +141,7 @@ Single-record commands (`helm-ai task get <id>`) default to JSON, since one reco
|
|
|
141
141
|
|
|
142
142
|
## Scripting notes
|
|
143
143
|
|
|
144
|
-
- **Imports are a dry run until you say otherwise.** `helm-ai import <entity> <file>` reports what it *would* do; add `--apply` to write. Entities: `people`, `
|
|
144
|
+
- **Imports are a dry run until you say otherwise.** `helm-ai import <entity> <file>` reports what it *would* do; add `--apply` to write. Entities: `people`, `companies`, `deals`, `tasks`.
|
|
145
145
|
- **Rate limits are handled for you.** The client retries on `429` (honouring `Retry-After`) and on `5xx` with exponential backoff, five attempts maximum. You do not need a retry loop.
|
|
146
146
|
- **Exit codes mean something.** Any failure exits non-zero with the reason on stderr, so `set -e` behaves.
|
|
147
147
|
- **Output stays clean when piped.** The startup banner is suppressed whenever output is not a terminal.
|
package/dist/cli.js
CHANGED
|
@@ -25,7 +25,7 @@ function renderSplash(ctx) {
|
|
|
25
25
|
}
|
|
26
26
|
|
|
27
27
|
// src/version.ts
|
|
28
|
-
var version = "0.
|
|
28
|
+
var version = "1.0.0";
|
|
29
29
|
|
|
30
30
|
// src/commands/auth.ts
|
|
31
31
|
import prompts from "prompts";
|
|
@@ -123,6 +123,33 @@ function parseRetryAfter(header) {
|
|
|
123
123
|
if (!isNaN(date)) return Math.min(Math.max(0, date - Date.now()), 6e4);
|
|
124
124
|
return 5e3;
|
|
125
125
|
}
|
|
126
|
+
var TO_API_KEYS = {
|
|
127
|
+
company_id: "account_id",
|
|
128
|
+
company_ids: "account_ids",
|
|
129
|
+
company_name: "account_name",
|
|
130
|
+
company_product_id: "account_product_id"
|
|
131
|
+
};
|
|
132
|
+
var FROM_API_KEYS = {
|
|
133
|
+
account_id: "company_id",
|
|
134
|
+
account_ids: "company_ids",
|
|
135
|
+
account_name: "company_name",
|
|
136
|
+
account_product_id: "company_product_id",
|
|
137
|
+
account_product: "company_product",
|
|
138
|
+
account_products: "company_products",
|
|
139
|
+
account: "company",
|
|
140
|
+
accounts: "companies"
|
|
141
|
+
};
|
|
142
|
+
function renameKeys(value, keys, kind) {
|
|
143
|
+
if (Array.isArray(value)) return value.map((v) => renameKeys(v, keys, kind));
|
|
144
|
+
if (!value || typeof value !== "object") return value;
|
|
145
|
+
const src = value;
|
|
146
|
+
const out = {};
|
|
147
|
+
for (const [k, v] of Object.entries(src)) {
|
|
148
|
+
const key = keys[k] && !(keys[k] in src) ? keys[k] : k;
|
|
149
|
+
out[key] = k === "entity_type" && v === kind.from ? kind.to : renameKeys(v, keys, kind);
|
|
150
|
+
}
|
|
151
|
+
return out;
|
|
152
|
+
}
|
|
126
153
|
var HelmClient = class _HelmClient {
|
|
127
154
|
constructor(opts) {
|
|
128
155
|
this.opts = opts;
|
|
@@ -138,6 +165,9 @@ var HelmClient = class _HelmClient {
|
|
|
138
165
|
async request(action, method, payload, options = {}) {
|
|
139
166
|
const url = new URL(`${this.opts.apiUrl}/mcp`);
|
|
140
167
|
url.searchParams.set("action", action);
|
|
168
|
+
if (payload) {
|
|
169
|
+
payload = renameKeys(payload, TO_API_KEYS, { from: "company", to: "account" });
|
|
170
|
+
}
|
|
141
171
|
if (method === "GET" && payload) {
|
|
142
172
|
for (const [key, value] of Object.entries(payload)) {
|
|
143
173
|
if (value !== void 0 && value !== null) {
|
|
@@ -183,7 +213,7 @@ var HelmClient = class _HelmClient {
|
|
|
183
213
|
if (!response.ok || data.success === false) {
|
|
184
214
|
throw parseApiError(response.status, data);
|
|
185
215
|
}
|
|
186
|
-
return data;
|
|
216
|
+
return renameKeys(data, FROM_API_KEYS, { from: "account", to: "company" });
|
|
187
217
|
}
|
|
188
218
|
throw new HelmNetworkError(`Request failed after ${maxAttempts} attempts (action=${action})`);
|
|
189
219
|
}
|
|
@@ -252,29 +282,29 @@ var HelmClient = class _HelmClient {
|
|
|
252
282
|
return data.attachment;
|
|
253
283
|
}
|
|
254
284
|
};
|
|
255
|
-
|
|
285
|
+
companies = {
|
|
256
286
|
list: async (filters = {}) => {
|
|
257
287
|
const data = await this.request("get_accounts", "GET", filters);
|
|
258
|
-
return data.
|
|
288
|
+
return data.companies ?? [];
|
|
259
289
|
},
|
|
260
|
-
get: async (
|
|
261
|
-
const data = await this.request("get_account", "GET", {
|
|
262
|
-
return data.
|
|
290
|
+
get: async (companyId) => {
|
|
291
|
+
const data = await this.request("get_account", "GET", { company_id: companyId });
|
|
292
|
+
return data.company;
|
|
263
293
|
},
|
|
264
294
|
create: async (input) => {
|
|
265
295
|
const data = await this.request("add_account", "POST", input);
|
|
266
|
-
return data.
|
|
296
|
+
return data.company;
|
|
267
297
|
},
|
|
268
|
-
update: async (
|
|
269
|
-
const data = await this.request("update_account", "POST", {
|
|
270
|
-
return data.
|
|
298
|
+
update: async (companyId, input) => {
|
|
299
|
+
const data = await this.request("update_account", "POST", { company_id: companyId, ...input });
|
|
300
|
+
return data.company;
|
|
271
301
|
},
|
|
272
|
-
// Page through every
|
|
302
|
+
// Page through every company (the server caps a single response at ~1000 rows).
|
|
273
303
|
listAll: async (filters = {}) => {
|
|
274
304
|
const pageSize = 1e3;
|
|
275
305
|
const all = [];
|
|
276
306
|
for (let offset = 0; ; offset += pageSize) {
|
|
277
|
-
const page = await this.
|
|
307
|
+
const page = await this.companies.list({ ...filters, limit: pageSize, offset });
|
|
278
308
|
all.push(...page);
|
|
279
309
|
if (page.length < pageSize) break;
|
|
280
310
|
}
|
|
@@ -565,9 +595,9 @@ var HelmClient = class _HelmClient {
|
|
|
565
595
|
}
|
|
566
596
|
}
|
|
567
597
|
};
|
|
568
|
-
|
|
569
|
-
list: async (
|
|
570
|
-
const data = await this.request("list_account_products", "GET", {
|
|
598
|
+
companyProducts = {
|
|
599
|
+
list: async (companyId) => {
|
|
600
|
+
const data = await this.request("list_account_products", "GET", { company_id: companyId });
|
|
571
601
|
return {
|
|
572
602
|
rows: data.rows ?? [],
|
|
573
603
|
summary: data.summary
|
|
@@ -580,8 +610,8 @@ var HelmClient = class _HelmClient {
|
|
|
580
610
|
update: async (input) => {
|
|
581
611
|
return await this.request("update_account_product", "POST", input);
|
|
582
612
|
},
|
|
583
|
-
detach: async (
|
|
584
|
-
return await this.request("detach_product_from_account", "POST", {
|
|
613
|
+
detach: async (companyProductId) => {
|
|
614
|
+
return await this.request("detach_product_from_account", "POST", { company_product_id: companyProductId });
|
|
585
615
|
}
|
|
586
616
|
};
|
|
587
617
|
calendar = {
|
|
@@ -1329,12 +1359,12 @@ function profileFieldsFrom(opts) {
|
|
|
1329
1359
|
}
|
|
1330
1360
|
function registerContactCommands(parent) {
|
|
1331
1361
|
const cmd = parent.command("contact").alias("contacts").description("Manage contacts (people)");
|
|
1332
|
-
cmd.command("list").description("List contacts with optional filters").option("-q, --query <text>", "search by name (first or last) or email (case-insensitive partial match)").option("-
|
|
1362
|
+
cmd.command("list").description("List contacts with optional filters").option("-q, --query <text>", "search by name (first or last) or email (case-insensitive partial match)").option("-C, --company <id>", "filter by company ID").option("-t, --type <type>", "filter by contact type (lead|customer|partner|vendor)").option("--priority <level>", "filter by priority (low|medium|high|urgent)").option("-l, --limit <n>", "max rows", (v) => parseInt(v, 10), 50).option("--offset <n>", "skip n rows (paginate)", (v) => parseInt(v, 10)).option("--all", "fetch every matching contact (auto-paginate, ignores --limit/--offset)").option("-o, --output <format>", "output: table|json|ndjson|csv|yaml").option("-p, --profile <name>", "profile name").action(async (opts) => {
|
|
1333
1363
|
try {
|
|
1334
1364
|
const client = HelmClient.fromProfile(resolveProfile(opts.profile));
|
|
1335
1365
|
const filters = {
|
|
1336
1366
|
query: opts.query,
|
|
1337
|
-
|
|
1367
|
+
company_id: opts.company,
|
|
1338
1368
|
contact_type: opts.type,
|
|
1339
1369
|
priority: opts.priority
|
|
1340
1370
|
};
|
|
@@ -1342,7 +1372,7 @@ function registerContactCommands(parent) {
|
|
|
1342
1372
|
console.log(render(rows, [
|
|
1343
1373
|
{ header: "Name", get: (r) => `${r.first_name} ${r.last_name ?? ""}`.trim() },
|
|
1344
1374
|
{ header: "Email", get: (r) => r.email },
|
|
1345
|
-
{ header: "
|
|
1375
|
+
{ header: "Company", get: (r) => r.company?.name },
|
|
1346
1376
|
{ header: "Type", get: (r) => r.contact_type },
|
|
1347
1377
|
{ header: "ID", get: (r) => r.id, truncate: 8 }
|
|
1348
1378
|
], opts.output ?? defaultFormat()));
|
|
@@ -1363,7 +1393,7 @@ function registerContactCommands(parent) {
|
|
|
1363
1393
|
return;
|
|
1364
1394
|
}
|
|
1365
1395
|
});
|
|
1366
|
-
cmd.command("create").description("Create a contact").requiredOption("-f, --first-name <name>", "first name (required)").option("-l, --last-name <name>").option("-e, --email <email>").option("--phone <phone>").option("-
|
|
1396
|
+
cmd.command("create").description("Create a contact").requiredOption("-f, --first-name <name>", "first name (required)").option("-l, --last-name <name>").option("-e, --email <email>").option("--phone <phone>").option("-C, --company <id>", "company ID").option("--title <title>").option("-t, --type <type>", "lead|customer|partner|vendor").option("--priority <level>").option("--notes <notes>").option("--tags <list>", 'comma-separated tags, e.g. "vip,lead"').option("--custom-fields <json>", `custom fields as a JSON object, e.g. '{"region":"EU"}'`).option("--secondary-email <email>").option("--mobile-phone <phone>").option("--linkedin <url>", "LinkedIn profile URL").option("--twitter <url>", "X/Twitter profile URL").option("--facebook <url>").option("--instagram <url>").option("--tiktok <url>").option("--youtube <url>").option("--street <street>", "street address").option("--city <city>").option("--state <state>").option("--zip <zip>").option("--country <country>").option("--timezone <tz>", 'IANA timezone, e.g. "America/New_York"').option("--lead-source <source>").option("--last-contacted <iso>", "ISO 8601 timestamp of the last contact").option("--next-follow-up <iso>", "ISO 8601 timestamp for the next planned follow-up").option("-p, --profile <name>").action(async (opts) => {
|
|
1367
1397
|
try {
|
|
1368
1398
|
const client = HelmClient.fromProfile(resolveProfile(opts.profile));
|
|
1369
1399
|
const contact = await client.contacts.create({
|
|
@@ -1371,7 +1401,7 @@ function registerContactCommands(parent) {
|
|
|
1371
1401
|
last_name: opts.lastName,
|
|
1372
1402
|
email: opts.email,
|
|
1373
1403
|
phone: opts.phone,
|
|
1374
|
-
|
|
1404
|
+
company_id: opts.company,
|
|
1375
1405
|
title: opts.title,
|
|
1376
1406
|
contact_type: opts.type,
|
|
1377
1407
|
priority: opts.priority,
|
|
@@ -1387,7 +1417,7 @@ function registerContactCommands(parent) {
|
|
|
1387
1417
|
return;
|
|
1388
1418
|
}
|
|
1389
1419
|
});
|
|
1390
|
-
cmd.command("update <id>").description("Update a contact").option("-f, --first-name <name>").option("-l, --last-name <name>").option("-e, --email <email>").option("--phone <phone>").option("-
|
|
1420
|
+
cmd.command("update <id>").description("Update a contact").option("-f, --first-name <name>").option("-l, --last-name <name>").option("-e, --email <email>").option("--phone <phone>").option("-C, --company <id>", "company ID").option("--title <title>").option("-t, --type <type>", "lead|customer|partner|vendor").option("--priority <level>").option("--notes <notes>").option("--tags <list>", "comma-separated tags (replaces the existing set)").option("--custom-fields <json>", "custom fields as a JSON object (replaces the existing object)").option("--secondary-email <email>").option("--mobile-phone <phone>").option("--linkedin <url>", "LinkedIn profile URL").option("--twitter <url>", "X/Twitter profile URL").option("--facebook <url>").option("--instagram <url>").option("--tiktok <url>").option("--youtube <url>").option("--street <street>", "street address").option("--city <city>").option("--state <state>").option("--zip <zip>").option("--country <country>").option("--timezone <tz>", 'IANA timezone, e.g. "America/New_York"').option("--lead-source <source>").option("--last-contacted <iso>", "ISO 8601 timestamp of the last contact").option("--next-follow-up <iso>", "ISO 8601 timestamp for the next planned follow-up").option("-p, --profile <name>").action(async (id, opts) => {
|
|
1391
1421
|
try {
|
|
1392
1422
|
const client = HelmClient.fromProfile(resolveProfile(opts.profile));
|
|
1393
1423
|
const updates = {};
|
|
@@ -1395,7 +1425,7 @@ function registerContactCommands(parent) {
|
|
|
1395
1425
|
if (opts.lastName !== void 0) updates.last_name = opts.lastName;
|
|
1396
1426
|
if (opts.email !== void 0) updates.email = opts.email;
|
|
1397
1427
|
if (opts.phone !== void 0) updates.phone = opts.phone;
|
|
1398
|
-
if (opts.
|
|
1428
|
+
if (opts.company !== void 0) updates.company_id = opts.company;
|
|
1399
1429
|
if (opts.title !== void 0) updates.title = opts.title;
|
|
1400
1430
|
if (opts.type !== void 0) updates.contact_type = opts.type;
|
|
1401
1431
|
if (opts.priority !== void 0) updates.priority = opts.priority;
|
|
@@ -1459,10 +1489,10 @@ function registerContactCommands(parent) {
|
|
|
1459
1489
|
});
|
|
1460
1490
|
}
|
|
1461
1491
|
|
|
1462
|
-
// src/commands/
|
|
1463
|
-
function
|
|
1464
|
-
const cmd = parent.command("
|
|
1465
|
-
cmd.command("list").description("List
|
|
1492
|
+
// src/commands/company.ts
|
|
1493
|
+
function registerCompanyCommands(parent) {
|
|
1494
|
+
const cmd = parent.command("company").alias("companies").description("Manage client companies");
|
|
1495
|
+
cmd.command("list").description("List companies").option("-q, --query <text>", "search by company name or email (case-insensitive partial match)").option("--status <status>", "active|inactive|paused").option("--health <health>", "good|at_risk|critical|not_set").option("--owner <id>", "filter by owner user ID").option("-l, --limit <n>", "max rows", (v) => parseInt(v, 10), 50).option("--offset <n>", "skip n rows (paginate)", (v) => parseInt(v, 10)).option("--all", "fetch every matching company (auto-paginate, ignores --limit/--offset)").option("-o, --output <format>").option("-p, --profile <name>").action(async (opts) => {
|
|
1466
1496
|
try {
|
|
1467
1497
|
const client = HelmClient.fromProfile(resolveProfile(opts.profile));
|
|
1468
1498
|
const filters = {
|
|
@@ -1471,7 +1501,7 @@ function registerAccountCommands(parent) {
|
|
|
1471
1501
|
health: opts.health,
|
|
1472
1502
|
owner_id: opts.owner
|
|
1473
1503
|
};
|
|
1474
|
-
const rows = opts.all ? await client.
|
|
1504
|
+
const rows = opts.all ? await client.companies.listAll(filters) : await client.companies.list({ ...filters, limit: opts.limit, offset: opts.offset });
|
|
1475
1505
|
console.log(render(rows, [
|
|
1476
1506
|
{ header: "Name", get: (r) => r.name },
|
|
1477
1507
|
{ header: "Email", get: (r) => r.email },
|
|
@@ -1485,21 +1515,21 @@ function registerAccountCommands(parent) {
|
|
|
1485
1515
|
return;
|
|
1486
1516
|
}
|
|
1487
1517
|
});
|
|
1488
|
-
cmd.command("get <id>").description("Get
|
|
1518
|
+
cmd.command("get <id>").description("Get a company by ID").option("-o, --output <format>").option("-p, --profile <name>").action(async (id, opts) => {
|
|
1489
1519
|
try {
|
|
1490
1520
|
const client = HelmClient.fromProfile(resolveProfile(opts.profile));
|
|
1491
|
-
const
|
|
1492
|
-
console.log(JSON.stringify(
|
|
1521
|
+
const company = await client.companies.get(id);
|
|
1522
|
+
console.log(JSON.stringify(company, null, 2));
|
|
1493
1523
|
} catch (err) {
|
|
1494
1524
|
console.error(formatErrorForCli(err));
|
|
1495
1525
|
process.exitCode = 1;
|
|
1496
1526
|
return;
|
|
1497
1527
|
}
|
|
1498
1528
|
});
|
|
1499
|
-
cmd.command("create").description("Create
|
|
1529
|
+
cmd.command("create").description("Create a company").requiredOption("-n, --name <name>", "company name (required)").option("-e, --email <email>").option("-w, --website <url>").option("--phone <phone>").option("--status <status>", "active|inactive|paused").option("--health <health>", "good|at_risk|critical|not_set").option("--description <text>").option("--tags <list>", 'comma-separated tags, e.g. "agency,priority"').option("--custom-fields <json>", `custom fields as a JSON object, e.g. '{"region":"EU"}'`).option("-p, --profile <name>").action(async (opts) => {
|
|
1500
1530
|
try {
|
|
1501
1531
|
const client = HelmClient.fromProfile(resolveProfile(opts.profile));
|
|
1502
|
-
const
|
|
1532
|
+
const company = await client.companies.create({
|
|
1503
1533
|
name: opts.name,
|
|
1504
1534
|
email: opts.email,
|
|
1505
1535
|
website: opts.website,
|
|
@@ -1510,14 +1540,14 @@ function registerAccountCommands(parent) {
|
|
|
1510
1540
|
tags: parseTags(opts.tags),
|
|
1511
1541
|
custom_fields: parseCustomFields(opts.customFields)
|
|
1512
1542
|
});
|
|
1513
|
-
console.log(JSON.stringify(
|
|
1543
|
+
console.log(JSON.stringify(company, null, 2));
|
|
1514
1544
|
} catch (err) {
|
|
1515
1545
|
console.error(formatErrorForCli(err));
|
|
1516
1546
|
process.exitCode = 1;
|
|
1517
1547
|
return;
|
|
1518
1548
|
}
|
|
1519
1549
|
});
|
|
1520
|
-
cmd.command("update <id>").description("Update
|
|
1550
|
+
cmd.command("update <id>").description("Update a company").option("-n, --name <name>").option("-e, --email <email>").option("-w, --website <url>").option("--phone <phone>").option("--status <status>", "active|inactive|paused").option("--health <health>", "good|at_risk|critical|not_set").option("--description <text>").option("--tags <list>", "comma-separated tags (replaces the existing set)").option("--custom-fields <json>", "custom fields as a JSON object (replaces the existing object)").option("-p, --profile <name>").action(async (id, opts) => {
|
|
1521
1551
|
try {
|
|
1522
1552
|
const client = HelmClient.fromProfile(resolveProfile(opts.profile));
|
|
1523
1553
|
const updates = {};
|
|
@@ -1530,19 +1560,19 @@ function registerAccountCommands(parent) {
|
|
|
1530
1560
|
if (opts.description !== void 0) updates.description = opts.description;
|
|
1531
1561
|
if (opts.tags !== void 0) updates.tags = parseTags(opts.tags);
|
|
1532
1562
|
if (opts.customFields !== void 0) updates.custom_fields = parseCustomFields(opts.customFields);
|
|
1533
|
-
const
|
|
1534
|
-
console.log(JSON.stringify(
|
|
1563
|
+
const company = await client.companies.update(id, updates);
|
|
1564
|
+
console.log(JSON.stringify(company, null, 2));
|
|
1535
1565
|
} catch (err) {
|
|
1536
1566
|
console.error(formatErrorForCli(err));
|
|
1537
1567
|
process.exitCode = 1;
|
|
1538
1568
|
return;
|
|
1539
1569
|
}
|
|
1540
1570
|
});
|
|
1541
|
-
const products = cmd.command("products").description("Manage
|
|
1542
|
-
products.command("list <
|
|
1571
|
+
const products = cmd.command("products").description("Manage company \u2194 product attribution");
|
|
1572
|
+
products.command("list <companyId>").description("Customer-360 list: what's attributed, paid, won, and in pipeline").option("-o, --output <format>").option("-p, --profile <name>").action(async (companyId, opts) => {
|
|
1543
1573
|
try {
|
|
1544
1574
|
const client = HelmClient.fromProfile(resolveProfile(opts.profile));
|
|
1545
|
-
const { rows } = await client.
|
|
1575
|
+
const { rows } = await client.companyProducts.list(companyId);
|
|
1546
1576
|
console.log(render(rows, [
|
|
1547
1577
|
{ header: "Product", get: (r) => r.product_name, truncate: 24 },
|
|
1548
1578
|
{ header: "Source", get: (r) => r.source },
|
|
@@ -1558,11 +1588,11 @@ function registerAccountCommands(parent) {
|
|
|
1558
1588
|
return;
|
|
1559
1589
|
}
|
|
1560
1590
|
});
|
|
1561
|
-
products.command("attach <
|
|
1591
|
+
products.command("attach <companyId>").description("Attach a product to a company (no invoice created \u2014 pure attribution)").requiredOption("--product <id>", "product id (required)").option("--tier <id>", "price tier id (omit for the default tier)").option("-q, --quantity <n>", "", parseFloat).option("-r, --rate <amount>", "snapshot rate", parseFloat).option("--purchased <date>", "ISO date the relationship began").option("--ended <date>", "ISO date the relationship ended (mark as historical)").option("--notes <text>").option("--source <source>", "manual|import|onboarding", "manual").option("-p, --profile <name>").action(async (companyId, opts) => {
|
|
1562
1592
|
try {
|
|
1563
1593
|
const client = HelmClient.fromProfile(resolveProfile(opts.profile));
|
|
1564
|
-
const result = await client.
|
|
1565
|
-
|
|
1594
|
+
const result = await client.companyProducts.attach({
|
|
1595
|
+
company_id: companyId,
|
|
1566
1596
|
product_id: opts.product,
|
|
1567
1597
|
product_price_id: opts.tier,
|
|
1568
1598
|
quantity: opts.quantity,
|
|
@@ -1579,11 +1609,11 @@ function registerAccountCommands(parent) {
|
|
|
1579
1609
|
return;
|
|
1580
1610
|
}
|
|
1581
1611
|
});
|
|
1582
|
-
products.command("update <
|
|
1612
|
+
products.command("update <companyProductId>").description("Update a company-product attribution row").option("--tier <id>", "switch to a different price tier of the same product (rate follows the tier)").option("-q, --quantity <n>", "", parseFloat).option("-r, --rate <amount>", "", parseFloat).option("--purchased <date>", "ISO date started").option("--ended <date>", "ISO date ended").option("--notes <text>").option("-p, --profile <name>").action(async (companyProductId, opts) => {
|
|
1583
1613
|
try {
|
|
1584
1614
|
const client = HelmClient.fromProfile(resolveProfile(opts.profile));
|
|
1585
|
-
const result = await client.
|
|
1586
|
-
|
|
1615
|
+
const result = await client.companyProducts.update({
|
|
1616
|
+
company_product_id: companyProductId,
|
|
1587
1617
|
product_price_id: opts.tier,
|
|
1588
1618
|
quantity: opts.quantity,
|
|
1589
1619
|
rate: opts.rate,
|
|
@@ -1598,10 +1628,10 @@ function registerAccountCommands(parent) {
|
|
|
1598
1628
|
return;
|
|
1599
1629
|
}
|
|
1600
1630
|
});
|
|
1601
|
-
products.command("detach <
|
|
1631
|
+
products.command("detach <companyProductId>").description('Delete an attribution row (prefer "update --ended" for natural endings)').option("-p, --profile <name>").action(async (companyProductId, opts) => {
|
|
1602
1632
|
try {
|
|
1603
1633
|
const client = HelmClient.fromProfile(resolveProfile(opts.profile));
|
|
1604
|
-
const result = await client.
|
|
1634
|
+
const result = await client.companyProducts.detach(companyProductId);
|
|
1605
1635
|
console.log(JSON.stringify(result, null, 2));
|
|
1606
1636
|
} catch (err) {
|
|
1607
1637
|
console.error(formatErrorForCli(err));
|
|
@@ -1615,13 +1645,13 @@ function registerAccountCommands(parent) {
|
|
|
1615
1645
|
import prompts2 from "prompts";
|
|
1616
1646
|
function registerDealCommands(parent) {
|
|
1617
1647
|
const cmd = parent.command("deal").alias("deals").description("Manage sales deals");
|
|
1618
|
-
cmd.command("list").description("List deals").option("--stage <stage>", "stage key (defined per pipeline; see `pipeline list`)").option("--priority <level>").option("-
|
|
1648
|
+
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) => {
|
|
1619
1649
|
try {
|
|
1620
1650
|
const client = HelmClient.fromProfile(resolveProfile(opts.profile));
|
|
1621
1651
|
const rows = await client.deals.list({
|
|
1622
1652
|
stage: opts.stage,
|
|
1623
1653
|
priority: opts.priority,
|
|
1624
|
-
|
|
1654
|
+
company_id: opts.company,
|
|
1625
1655
|
pipeline_id: opts.pipeline,
|
|
1626
1656
|
limit: opts.limit
|
|
1627
1657
|
});
|
|
@@ -1649,7 +1679,7 @@ function registerDealCommands(parent) {
|
|
|
1649
1679
|
return;
|
|
1650
1680
|
}
|
|
1651
1681
|
});
|
|
1652
|
-
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("-
|
|
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) => {
|
|
1653
1683
|
try {
|
|
1654
1684
|
const client = HelmClient.fromProfile(resolveProfile(opts.profile));
|
|
1655
1685
|
const deal = await client.deals.create({
|
|
@@ -1659,7 +1689,7 @@ function registerDealCommands(parent) {
|
|
|
1659
1689
|
priority: opts.priority,
|
|
1660
1690
|
value: opts.value,
|
|
1661
1691
|
probability: opts.probability,
|
|
1662
|
-
|
|
1692
|
+
company_id: opts.company,
|
|
1663
1693
|
contact_id: opts.contact,
|
|
1664
1694
|
expected_close_date: opts.closeDate
|
|
1665
1695
|
});
|
|
@@ -1670,7 +1700,7 @@ function registerDealCommands(parent) {
|
|
|
1670
1700
|
return;
|
|
1671
1701
|
}
|
|
1672
1702
|
});
|
|
1673
|
-
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("-
|
|
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) => {
|
|
1674
1704
|
try {
|
|
1675
1705
|
const client = HelmClient.fromProfile(resolveProfile(opts.profile));
|
|
1676
1706
|
const deal = await client.deals.update(id, {
|
|
@@ -1680,7 +1710,7 @@ function registerDealCommands(parent) {
|
|
|
1680
1710
|
priority: opts.priority,
|
|
1681
1711
|
value: opts.value,
|
|
1682
1712
|
probability: opts.probability,
|
|
1683
|
-
|
|
1713
|
+
company_id: opts.company,
|
|
1684
1714
|
contact_id: opts.contact,
|
|
1685
1715
|
expected_close_date: opts.closeDate
|
|
1686
1716
|
});
|
|
@@ -1907,13 +1937,13 @@ function registerProjectCommands(parent) {
|
|
|
1907
1937
|
return;
|
|
1908
1938
|
}
|
|
1909
1939
|
});
|
|
1910
|
-
cmd.command("create").description("Create a project").requiredOption("-n, --name <name>", "project name (required)").option("-d, --description <text>").option("-
|
|
1940
|
+
cmd.command("create").description("Create a project").requiredOption("-n, --name <name>", "project name (required)").option("-d, --description <text>").option("-C, --company <id>", "link to company ID or name").option("--stage <stage>", "planning|active|on_hold|review|completed|archived", "active").option("--visibility <vis>", "public|private", "private").option("-p, --profile <name>").action(async (opts) => {
|
|
1911
1941
|
try {
|
|
1912
1942
|
const client = HelmClient.fromProfile(resolveProfile(opts.profile));
|
|
1913
1943
|
const project = await client.projects.create({
|
|
1914
1944
|
name: opts.name,
|
|
1915
1945
|
description: opts.description,
|
|
1916
|
-
|
|
1946
|
+
company_id: opts.company,
|
|
1917
1947
|
stage: opts.stage,
|
|
1918
1948
|
visibility: opts.visibility
|
|
1919
1949
|
});
|
|
@@ -2271,12 +2301,12 @@ var TYPE_LABELS = {
|
|
|
2271
2301
|
};
|
|
2272
2302
|
function registerHoursCommands(parent) {
|
|
2273
2303
|
const cmd = parent.command("hours").description("Clients' hour plans: prepaid and monthly hours");
|
|
2274
|
-
cmd.command("balance").description("Hours available, used and left on hour plans (every live plan by default)").option("--project <id>", "the plan this project draws from").option("--
|
|
2304
|
+
cmd.command("balance").description("Hours available, used and left on hour plans (every live plan by default)").option("--project <id>", "the plan this project draws from").option("--company <id>", "a client's plans").option("--plan <id>", "one plan, including an ended one").option("-o, --output <format>").option("-p, --profile <name>").action(async (opts) => {
|
|
2275
2305
|
try {
|
|
2276
2306
|
const client = HelmClient.fromProfile(resolveProfile(opts.profile));
|
|
2277
2307
|
const { plans, message } = await client.hours.balance({
|
|
2278
2308
|
project_id: opts.project,
|
|
2279
|
-
|
|
2309
|
+
company_id: opts.company,
|
|
2280
2310
|
plan_id: opts.plan
|
|
2281
2311
|
});
|
|
2282
2312
|
const format = opts.output ?? defaultFormat();
|
|
@@ -2414,11 +2444,11 @@ Refusing to void without confirmation in a non-interactive shell. Re-run with -y
|
|
|
2414
2444
|
period_product_id: opts.product
|
|
2415
2445
|
});
|
|
2416
2446
|
const withSettings = (c) => c.option("--hours <n>", "hours each month or quarter").option("--reset-day <n>", "day of the month the hours reset, 1 to 28").option("--rollover <policy>", "none | capped | unlimited").option("--rollover-cap <hours>", "with --rollover capped, the most hours that roll over").option("--round <minutes>", "round each entry: 6, 10, 15 or 30").option("--round-mode <mode>", "up | nearest").option("--minimum <minutes>", "each entry counts for at least this many minutes").option("--low-alert <pct>", "alert when this percent of the newest hours added is left").option("--extra-hours <policy>", "track | review | bill").option("--extra-rate <rate>", "hourly rate for billed extra hours").option("--draft-invoice <on|off>", "draft an invoice for each period's hours").option("--price <amount>", "price of each period's hours, for the draft invoice").option("--product <id>", "product for the draft invoice line");
|
|
2417
|
-
withSettings(plan.command("create").description("Set up an hour plan for a client").requiredOption("--
|
|
2447
|
+
withSettings(plan.command("create").description("Set up an hour plan for a client").requiredOption("--company <id>", "the client").requiredOption("--name <name>", 'e.g. "Dev & Maintenance retainer"').requiredOption("--type <type>", "monthly | quarterly | hours_as_needed").requiredOption("--projects <ids>", "comma-separated projects whose time uses these hours").option("--starts <date>", "YYYY-MM-DD (default today)").option("--timezone <tz>", "IANA time zone the plan keeps dates in").option("--starting-hours <n>", "hours the client already has (required for hours_as_needed)")).option("-p, --profile <name>").action(async (opts) => {
|
|
2418
2448
|
try {
|
|
2419
2449
|
const client = HelmClient.fromProfile(resolveProfile(opts.profile));
|
|
2420
2450
|
const data = await client.hours.createPlan({
|
|
2421
|
-
|
|
2451
|
+
company_id: opts.company,
|
|
2422
2452
|
name: opts.name,
|
|
2423
2453
|
type: opts.type,
|
|
2424
2454
|
project_ids: String(opts.projects).split(",").map((s) => s.trim()).filter(Boolean),
|
|
@@ -2580,12 +2610,12 @@ Example:
|
|
|
2580
2610
|
// src/commands/invoice.ts
|
|
2581
2611
|
function registerInvoiceCommands(parent) {
|
|
2582
2612
|
const cmd = parent.command("invoice").alias("invoices").description("Manage invoices");
|
|
2583
|
-
cmd.command("list").description("List invoices").option("-s, --status <status>", "draft|open|partially_paid|paid|archived|cancelled").option("-
|
|
2613
|
+
cmd.command("list").description("List invoices").option("-s, --status <status>", "draft|open|partially_paid|paid|archived|cancelled").option("-C, --company <id>").option("--deal <id>", "only invoices billing against this deal").option("-l, --limit <n>", "max rows", (v) => parseInt(v, 10), 50).option("-o, --output <format>").option("-p, --profile <name>").action(async (opts) => {
|
|
2584
2614
|
try {
|
|
2585
2615
|
const client = HelmClient.fromProfile(resolveProfile(opts.profile));
|
|
2586
2616
|
const rows = await client.invoices.list({
|
|
2587
2617
|
status: opts.status,
|
|
2588
|
-
|
|
2618
|
+
company_id: opts.company,
|
|
2589
2619
|
deal_id: opts.deal,
|
|
2590
2620
|
limit: opts.limit
|
|
2591
2621
|
});
|
|
@@ -2614,17 +2644,17 @@ function registerInvoiceCommands(parent) {
|
|
|
2614
2644
|
return;
|
|
2615
2645
|
}
|
|
2616
2646
|
});
|
|
2617
|
-
cmd.command("create").description("Create an invoice").requiredOption("-t, --title <title>", "invoice title (required)").option("-d, --description <text>").option("-
|
|
2647
|
+
cmd.command("create").description("Create an invoice").requiredOption("-t, --title <title>", "invoice title (required)").option("-d, --description <text>").option("-C, --company <id>").option("--deal <id>", "deal this invoice bills against").option("-i, --item <item>", LINE_ITEM_HELP, collectLineItem).option("--items <path>", LINE_ITEMS_FILE_HELP).option("--tax-rate <pct>", "tax rate %", parseFloat).option("--issue-date <date>", "ISO 8601").option("--due-date <date>", "ISO 8601").option("--notes <text>", "client-visible notes").option("--internal-notes <text>").option("-p, --profile <name>").addHelpText("after", `
|
|
2618
2648
|
Examples:
|
|
2619
|
-
helm-ai invoice create -t "October retainer" -
|
|
2649
|
+
helm-ai invoice create -t "October retainer" -C <company-id> \\
|
|
2620
2650
|
--item "Development|10|150" --item "Hosting|49"
|
|
2621
|
-
helm-ai invoice create -t "October retainer" -
|
|
2651
|
+
helm-ai invoice create -t "October retainer" -C <company-id> --items items.json`).action(async (opts) => {
|
|
2622
2652
|
try {
|
|
2623
2653
|
const client = HelmClient.fromProfile(resolveProfile(opts.profile));
|
|
2624
2654
|
const invoice = await client.invoices.create({
|
|
2625
2655
|
title: opts.title,
|
|
2626
2656
|
description: opts.description,
|
|
2627
|
-
|
|
2657
|
+
company_id: opts.company,
|
|
2628
2658
|
deal_id: opts.deal,
|
|
2629
2659
|
line_items: await resolveLineItems(opts),
|
|
2630
2660
|
tax_rate: opts.taxRate,
|
|
@@ -2640,14 +2670,14 @@ Examples:
|
|
|
2640
2670
|
return;
|
|
2641
2671
|
}
|
|
2642
2672
|
});
|
|
2643
|
-
cmd.command("update <id>").description('Update an invoice (details only; edit lines with "invoice line")').option("-t, --title <title>").option("-d, --description <text>").option("-s, --status <status>", "draft|open|partially_paid|paid|archived|cancelled").option("-
|
|
2673
|
+
cmd.command("update <id>").description('Update an invoice (details only; edit lines with "invoice line")').option("-t, --title <title>").option("-d, --description <text>").option("-s, --status <status>", "draft|open|partially_paid|paid|archived|cancelled").option("-C, --company <id>").option("--deal <id>", "deal this invoice bills against").option("--tax-rate <pct>", "", parseFloat).option("--issue-date <date>", "ISO 8601").option("--due-date <date>", "ISO 8601").option("--notes <text>", "client-visible notes").option("--internal-notes <text>").option("-p, --profile <name>").action(async (id, opts) => {
|
|
2644
2674
|
try {
|
|
2645
2675
|
const client = HelmClient.fromProfile(resolveProfile(opts.profile));
|
|
2646
2676
|
const invoice = await client.invoices.update(id, {
|
|
2647
2677
|
title: opts.title,
|
|
2648
2678
|
description: opts.description,
|
|
2649
2679
|
status: opts.status,
|
|
2650
|
-
|
|
2680
|
+
company_id: opts.company,
|
|
2651
2681
|
deal_id: opts.deal,
|
|
2652
2682
|
tax_rate: opts.taxRate,
|
|
2653
2683
|
issue_date: opts.issueDate,
|
|
@@ -2668,12 +2698,12 @@ Examples:
|
|
|
2668
2698
|
// src/commands/payment.ts
|
|
2669
2699
|
function registerPaymentCommands(parent) {
|
|
2670
2700
|
const cmd = parent.command("payment").alias("payments").description("Record and review payments");
|
|
2671
|
-
cmd.command("list").description("List recorded payments").option("-s, --status <status>", "pending|completed|failed|refunded").option("-
|
|
2701
|
+
cmd.command("list").description("List recorded payments").option("-s, --status <status>", "pending|completed|failed|refunded").option("-C, --company <id>").option("-i, --invoice <id>").option("-d, --deal <id>", "only payments attributed to this deal").option("--start <date>", "earliest payment date (YYYY-MM-DD)").option("--end <date>", "latest payment date (YYYY-MM-DD)").option("-l, --limit <n>", "max rows", (v) => parseInt(v, 10), 50).option("-o, --output <format>").option("-p, --profile <name>").action(async (opts) => {
|
|
2672
2702
|
try {
|
|
2673
2703
|
const client = HelmClient.fromProfile(resolveProfile(opts.profile));
|
|
2674
2704
|
const rows = await client.payments.list({
|
|
2675
2705
|
status: opts.status,
|
|
2676
|
-
|
|
2706
|
+
company_id: opts.company,
|
|
2677
2707
|
invoice_id: opts.invoice,
|
|
2678
2708
|
deal_id: opts.deal,
|
|
2679
2709
|
start_date: opts.start,
|
|
@@ -2695,14 +2725,14 @@ function registerPaymentCommands(parent) {
|
|
|
2695
2725
|
return;
|
|
2696
2726
|
}
|
|
2697
2727
|
});
|
|
2698
|
-
cmd.command("record").description("Record a payment received (including money captured outside Helm)").requiredOption("--amount <n>", "amount received (required)", parseFloat).option("-i, --invoice <id>", "Helm invoice this settles; totals and status update automatically").option("-d, --deal <id>", "deal to attribute the payment to (inherited from the invoice if given)").option("-
|
|
2728
|
+
cmd.command("record").description("Record a payment received (including money captured outside Helm)").requiredOption("--amount <n>", "amount received (required)", parseFloat).option("-i, --invoice <id>", "Helm invoice this settles; totals and status update automatically").option("-d, --deal <id>", "deal to attribute the payment to (inherited from the invoice if given)").option("-C, --company <id>", "client who paid (inherited from the invoice or deal if given)").option("--date <date>", "date received (YYYY-MM-DD), defaults to today").option("-m, --method <method>", "cash|check|credit_card|bank_transfer|stripe|paypal|other").option("-r, --reference <text>", "external reference: check number, transaction id, external system id").option("--description <text>", "what the payment was for").option("--notes <text>", "internal notes").option("-s, --status <status>", "pending|completed|failed|refunded (default completed)").option("-p, --profile <name>").action(async (opts) => {
|
|
2699
2729
|
try {
|
|
2700
2730
|
const client = HelmClient.fromProfile(resolveProfile(opts.profile));
|
|
2701
2731
|
const payment = await client.payments.record({
|
|
2702
2732
|
amount: opts.amount,
|
|
2703
2733
|
invoice_id: opts.invoice,
|
|
2704
2734
|
deal_id: opts.deal,
|
|
2705
|
-
|
|
2735
|
+
company_id: opts.company,
|
|
2706
2736
|
payment_date: opts.date,
|
|
2707
2737
|
payment_method: opts.method,
|
|
2708
2738
|
reference_number: opts.reference,
|
|
@@ -2736,12 +2766,12 @@ function recurring(r) {
|
|
|
2736
2766
|
if (n > 1) return `${base}/${n}${INTERVAL_SHORT[r.billing_interval] ?? r.billing_interval}`;
|
|
2737
2767
|
return `${base}/${INTERVAL_SHORT[r.billing_interval] ?? r.billing_interval}`;
|
|
2738
2768
|
}
|
|
2739
|
-
function printLink(
|
|
2769
|
+
function printLink(result) {
|
|
2740
2770
|
console.log("Send this link to the customer:");
|
|
2741
|
-
console.log(
|
|
2771
|
+
console.log(result.link_url ?? result.checkout_url);
|
|
2742
2772
|
console.log(
|
|
2743
2773
|
`
|
|
2744
|
-
It shows as awaiting payment until they pay` + (
|
|
2774
|
+
It shows as awaiting payment until they pay` + (result.link_url ? ", and stays valid until then or until you cancel it." : result.expires_at ? `, and expires ${new Date(result.expires_at).toLocaleString()}.` : ".") + `
|
|
2745
2775
|
See waiting links with: helm-ai subscription links`
|
|
2746
2776
|
);
|
|
2747
2777
|
}
|
|
@@ -2750,14 +2780,14 @@ function statusOf(r) {
|
|
|
2750
2780
|
}
|
|
2751
2781
|
function registerSubscriptionCommands(parent) {
|
|
2752
2782
|
const cmd = parent.command("subscription").alias("subscriptions").alias("sub").description("Recurring plans you bill your customers");
|
|
2753
|
-
cmd.command("list").description("List customer subscriptions").option("-s, --status <status>", "active|trialing|past_due|unpaid|canceled|incomplete|paused").option("--active", "only live revenue (active, trialing, past_due)").option("--origin <origin>", "helm|external \u2014 helm revenue is fee-bearing").option("-
|
|
2783
|
+
cmd.command("list").description("List customer subscriptions").option("-s, --status <status>", "active|trialing|past_due|unpaid|canceled|incomplete|paused").option("--active", "only live revenue (active, trialing, past_due)").option("--origin <origin>", "helm|external \u2014 helm revenue is fee-bearing").option("-C, --company <id>").option("-c, --contact <id>").option("--product <id>").option("-l, --limit <n>", "max rows", (v) => parseInt(v, 10), 50).option("-o, --output <format>").option("-p, --profile <name>").action(async (opts) => {
|
|
2754
2784
|
try {
|
|
2755
2785
|
const client = HelmClient.fromProfile(resolveProfile(opts.profile));
|
|
2756
2786
|
const rows = await client.subscriptions.list({
|
|
2757
2787
|
status: opts.status,
|
|
2758
2788
|
active_only: opts.active || void 0,
|
|
2759
2789
|
origin: opts.origin,
|
|
2760
|
-
|
|
2790
|
+
company_id: opts.company,
|
|
2761
2791
|
contact_id: opts.contact,
|
|
2762
2792
|
product_id: opts.product,
|
|
2763
2793
|
limit: opts.limit
|
|
@@ -2802,20 +2832,20 @@ function registerSubscriptionCommands(parent) {
|
|
|
2802
2832
|
process.exitCode = 1;
|
|
2803
2833
|
}
|
|
2804
2834
|
});
|
|
2805
|
-
cmd.command("create").description("Start billing a customer on a recurring schedule").requiredOption("-c, --contact <id>", "the person to bill (Stripe bills a person, not an account)").requiredOption("--product <id>", "a recurring product from your catalogue").option("--price <id>", "price tier on that product; omit to use its default price").option("-
|
|
2835
|
+
cmd.command("create").description("Start billing a customer on a recurring schedule").requiredOption("-c, --contact <id>", "the person to bill (Stripe bills a person, not an account)").requiredOption("--product <id>", "a recurring product from your catalogue").option("--price <id>", "price tier on that product; omit to use its default price").option("-C, --company <id>", "company attribution; defaults to the contact's company").option("-q, --quantity <n>", "seats or units", (v) => parseInt(v, 10), 1).option("--trial <days>", "free trial length in days", (v) => parseInt(v, 10)).option("--checkout", "always return a payment link instead of charging a saved card").option("-p, --profile <name>").action(async (opts) => {
|
|
2806
2836
|
try {
|
|
2807
2837
|
const client = HelmClient.fromProfile(resolveProfile(opts.profile));
|
|
2808
2838
|
const result = await client.subscriptions.create({
|
|
2809
2839
|
contact_id: opts.contact,
|
|
2810
2840
|
product_id: opts.product,
|
|
2811
2841
|
product_price_id: opts.price,
|
|
2812
|
-
|
|
2842
|
+
company_id: opts.company,
|
|
2813
2843
|
quantity: opts.quantity,
|
|
2814
2844
|
trial_days: opts.trial,
|
|
2815
2845
|
method: opts.checkout ? "checkout" : "auto"
|
|
2816
2846
|
});
|
|
2817
2847
|
if (result.method === "checkout") {
|
|
2818
|
-
printLink(result
|
|
2848
|
+
printLink(result);
|
|
2819
2849
|
} else {
|
|
2820
2850
|
console.log(`\u2713 Subscription started (${result.subscription.stripe_subscription_id})`);
|
|
2821
2851
|
}
|
|
@@ -2824,13 +2854,13 @@ function registerSubscriptionCommands(parent) {
|
|
|
2824
2854
|
process.exitCode = 1;
|
|
2825
2855
|
}
|
|
2826
2856
|
});
|
|
2827
|
-
cmd.command("links").alias("pending").description("Payment links sent for a subscription that have not been paid").option("-s, --status <status>", "open|expired|completed|canceled|all (default: open and expired)").option("-c, --contact <id>").option("-
|
|
2857
|
+
cmd.command("links").alias("pending").description("Payment links sent for a subscription that have not been paid").option("-s, --status <status>", "open|expired|completed|canceled|all (default: open and expired)").option("-c, --contact <id>").option("-C, --company <id>").option("-l, --limit <n>", "max rows", (v) => parseInt(v, 10), 50).option("-o, --output <format>").option("-p, --profile <name>").action(async (opts) => {
|
|
2828
2858
|
try {
|
|
2829
2859
|
const client = HelmClient.fromProfile(resolveProfile(opts.profile));
|
|
2830
2860
|
const rows = await client.subscriptions.links({
|
|
2831
2861
|
status: opts.status,
|
|
2832
2862
|
contact_id: opts.contact,
|
|
2833
|
-
|
|
2863
|
+
company_id: opts.company,
|
|
2834
2864
|
limit: opts.limit
|
|
2835
2865
|
});
|
|
2836
2866
|
console.log(render(rows, [
|
|
@@ -2840,8 +2870,9 @@ function registerSubscriptionCommands(parent) {
|
|
|
2840
2870
|
{ header: "Product", get: (r) => r.product_name ?? (r.product_id ? "" : "(removed)"), truncate: 24 },
|
|
2841
2871
|
{ header: "Amount", get: (r) => recurring(r) },
|
|
2842
2872
|
{ header: "Sent", get: (r) => r.created_at.slice(0, 10) },
|
|
2843
|
-
|
|
2844
|
-
{ header: "
|
|
2873
|
+
// A Helm link never expires; only one sent straight to Stripe does.
|
|
2874
|
+
{ header: "Expires (UTC)", get: (r) => r.public_token ? "never" : r.expires_at?.replace("T", " ").slice(0, 16) ?? "" },
|
|
2875
|
+
{ header: "Link", get: (r) => r.link_url ?? r.checkout_url, truncate: 40 },
|
|
2845
2876
|
{ header: "ID", get: (r) => r.id, truncate: 8 }
|
|
2846
2877
|
], opts.output ?? defaultFormat()));
|
|
2847
2878
|
} catch (err) {
|
|
@@ -2863,7 +2894,7 @@ function registerSubscriptionCommands(parent) {
|
|
|
2863
2894
|
try {
|
|
2864
2895
|
const client = HelmClient.fromProfile(resolveProfile(opts.profile));
|
|
2865
2896
|
const result = await client.subscriptions.renewLink(id);
|
|
2866
|
-
if (result.method === "checkout") printLink(result
|
|
2897
|
+
if (result.method === "checkout") printLink(result);
|
|
2867
2898
|
} catch (err) {
|
|
2868
2899
|
console.error(formatErrorForCli(err));
|
|
2869
2900
|
process.exitCode = 1;
|
|
@@ -2916,12 +2947,12 @@ function registerSubscriptionCommands(parent) {
|
|
|
2916
2947
|
// src/commands/estimate.ts
|
|
2917
2948
|
function registerEstimateCommands(parent) {
|
|
2918
2949
|
const cmd = parent.command("estimate").alias("estimates").description("Manage estimates");
|
|
2919
|
-
cmd.command("list").description("List estimates").option("-s, --status <status>").option("-
|
|
2950
|
+
cmd.command("list").description("List estimates").option("-s, --status <status>").option("-C, --company <id>").option("-l, --limit <n>", "max rows", (v) => parseInt(v, 10), 50).option("-o, --output <format>").option("-p, --profile <name>").action(async (opts) => {
|
|
2920
2951
|
try {
|
|
2921
2952
|
const client = HelmClient.fromProfile(resolveProfile(opts.profile));
|
|
2922
2953
|
const rows = await client.estimates.list({
|
|
2923
2954
|
status: opts.status,
|
|
2924
|
-
|
|
2955
|
+
company_id: opts.company,
|
|
2925
2956
|
limit: opts.limit
|
|
2926
2957
|
});
|
|
2927
2958
|
console.log(render(rows, [
|
|
@@ -2949,9 +2980,9 @@ function registerEstimateCommands(parent) {
|
|
|
2949
2980
|
return;
|
|
2950
2981
|
}
|
|
2951
2982
|
});
|
|
2952
|
-
cmd.command("create").description("Create an estimate").requiredOption("-t, --title <title>", "estimate title (required)").option("-d, --description <text>").option("-
|
|
2983
|
+
cmd.command("create").description("Create an estimate").requiredOption("-t, --title <title>", "estimate title (required)").option("-d, --description <text>").option("-C, --company <id>").option("-c, --contact <id>", "person at the company the estimate is addressed to").option("-i, --item <item>", LINE_ITEM_HELP, collectLineItem).option("--items <path>", LINE_ITEMS_FILE_HELP).option("--tax-rate <pct>", "", parseFloat).option("--issue-date <date>").option("--expiry-date <date>").option("--notes <text>").option("--internal-notes <text>").option("-p, --profile <name>").addHelpText("after", `
|
|
2953
2984
|
Examples:
|
|
2954
|
-
helm-ai estimate create -t "Launch readiness" -
|
|
2985
|
+
helm-ai estimate create -t "Launch readiness" -C <company-id> \\
|
|
2955
2986
|
--item "Checkout fixes|4|150" --item "Speed pass|500"
|
|
2956
2987
|
helm-ai estimate create -t "Launch readiness" --items items.json`).action(async (opts) => {
|
|
2957
2988
|
try {
|
|
@@ -2959,7 +2990,7 @@ Examples:
|
|
|
2959
2990
|
const estimate = await client.estimates.create({
|
|
2960
2991
|
title: opts.title,
|
|
2961
2992
|
description: opts.description,
|
|
2962
|
-
|
|
2993
|
+
company_id: opts.company,
|
|
2963
2994
|
contact_id: opts.contact,
|
|
2964
2995
|
line_items: await resolveLineItems(opts),
|
|
2965
2996
|
tax_rate: opts.taxRate,
|
|
@@ -2975,14 +3006,14 @@ Examples:
|
|
|
2975
3006
|
return;
|
|
2976
3007
|
}
|
|
2977
3008
|
});
|
|
2978
|
-
cmd.command("update <id>").description('Update an estimate (details only; edit lines with "estimate line")').option("-t, --title <title>").option("-d, --description <text>").option("-s, --status <status>", "draft|sent|accepted|declined|archived|cancelled").option("-
|
|
3009
|
+
cmd.command("update <id>").description('Update an estimate (details only; edit lines with "estimate line")').option("-t, --title <title>").option("-d, --description <text>").option("-s, --status <status>", "draft|sent|accepted|declined|archived|cancelled").option("-C, --company <id>").option("-c, --contact <id>", "person at the company the estimate is addressed to").option("--tax-rate <pct>", "", parseFloat).option("--issue-date <date>").option("--expiry-date <date>").option("--notes <text>").option("--internal-notes <text>").option("-p, --profile <name>").action(async (id, opts) => {
|
|
2979
3010
|
try {
|
|
2980
3011
|
const client = HelmClient.fromProfile(resolveProfile(opts.profile));
|
|
2981
3012
|
const estimate = await client.estimates.update(id, {
|
|
2982
3013
|
title: opts.title,
|
|
2983
3014
|
description: opts.description,
|
|
2984
3015
|
status: opts.status,
|
|
2985
|
-
|
|
3016
|
+
company_id: opts.company,
|
|
2986
3017
|
contact_id: opts.contact,
|
|
2987
3018
|
tax_rate: opts.taxRate,
|
|
2988
3019
|
issue_date: opts.issueDate,
|
|
@@ -3394,7 +3425,7 @@ function registerFormCommands(parent) {
|
|
|
3394
3425
|
// src/commands/calendar.ts
|
|
3395
3426
|
function registerCalendarCommands(parent) {
|
|
3396
3427
|
const cmd = parent.command("calendar").alias("cal").description("Manage calendar events");
|
|
3397
|
-
cmd.command("list").description("List calendar events (defaults to next 7 days)").option("--start <date>", "ISO 8601 start").option("--end <date>", "ISO 8601 end").option("--all-users", "deprecated and ignored; a calendar is personal").option("--project <id>").option("--
|
|
3428
|
+
cmd.command("list").description("List calendar events (defaults to next 7 days)").option("--start <date>", "ISO 8601 start").option("--end <date>", "ISO 8601 end").option("--all-users", "deprecated and ignored; a calendar is personal").option("--project <id>").option("--company <id>").option("-l, --limit <n>", "max rows", (v) => parseInt(v, 10), 50).option("-o, --output <format>").option("-p, --profile <name>").action(async (opts) => {
|
|
3398
3429
|
try {
|
|
3399
3430
|
const client = HelmClient.fromProfile(resolveProfile(opts.profile));
|
|
3400
3431
|
const rows = await client.calendar.list({
|
|
@@ -3402,7 +3433,7 @@ function registerCalendarCommands(parent) {
|
|
|
3402
3433
|
end: opts.end,
|
|
3403
3434
|
include_all_users: opts.allUsers,
|
|
3404
3435
|
project_id: opts.project,
|
|
3405
|
-
|
|
3436
|
+
company_id: opts.company,
|
|
3406
3437
|
limit: opts.limit
|
|
3407
3438
|
});
|
|
3408
3439
|
console.log(render(rows, [
|
|
@@ -3418,7 +3449,7 @@ function registerCalendarCommands(parent) {
|
|
|
3418
3449
|
return;
|
|
3419
3450
|
}
|
|
3420
3451
|
});
|
|
3421
|
-
cmd.command("create").description("Create a calendar event").requiredOption("-t, --title <title>").requiredOption("--start <date>", "ISO 8601 start time").requiredOption("--end <date>", "ISO 8601 end time").option("-d, --description <text>").option("--location <text>").option("--all-day").option("--meet", "auto-create Google Meet link").option("--zoom <url>", "attach a Zoom URL").option("--project <id>").option("--
|
|
3452
|
+
cmd.command("create").description("Create a calendar event").requiredOption("-t, --title <title>").requiredOption("--start <date>", "ISO 8601 start time").requiredOption("--end <date>", "ISO 8601 end time").option("-d, --description <text>").option("--location <text>").option("--all-day").option("--meet", "auto-create Google Meet link").option("--zoom <url>", "attach a Zoom URL").option("--project <id>").option("--company <id>").option("-p, --profile <name>").action(async (opts) => {
|
|
3422
3453
|
try {
|
|
3423
3454
|
const client = HelmClient.fromProfile(resolveProfile(opts.profile));
|
|
3424
3455
|
const event = await client.calendar.create({
|
|
@@ -3431,7 +3462,7 @@ function registerCalendarCommands(parent) {
|
|
|
3431
3462
|
conference_provider: opts.meet ? "google_meet" : opts.zoom ? "zoom" : void 0,
|
|
3432
3463
|
conference_url: opts.zoom,
|
|
3433
3464
|
project_id: opts.project,
|
|
3434
|
-
|
|
3465
|
+
company_id: opts.company
|
|
3435
3466
|
});
|
|
3436
3467
|
console.log(JSON.stringify(event, null, 2));
|
|
3437
3468
|
} catch (err) {
|
|
@@ -3935,7 +3966,7 @@ var PEOPLE_SCHEMA = [
|
|
|
3935
3966
|
{ name: "mobile_phone", aliases: ["cell_phone", "mobile_number", "cellphone", "mobile", "cell"] },
|
|
3936
3967
|
{ name: "phone", aliases: ["phone_number", "tel", "mobile", "cell"] },
|
|
3937
3968
|
{ name: "title", aliases: ["job_title", "role", "position"] },
|
|
3938
|
-
{ name: "
|
|
3969
|
+
{ name: "company_id", aliases: ["account", "company", "organization", "org", "client"] },
|
|
3939
3970
|
{ name: "contact_type", aliases: ["type", "category"] },
|
|
3940
3971
|
{ name: "priority" },
|
|
3941
3972
|
{ name: "notes", aliases: ["note", "description", "comments"] },
|
|
@@ -3959,7 +3990,7 @@ var PEOPLE_SCHEMA = [
|
|
|
3959
3990
|
{ name: "tags", aliases: ["tag", "labels", "label"] },
|
|
3960
3991
|
{ name: "custom_fields", aliases: ["custom", "metadata", "meta"] }
|
|
3961
3992
|
];
|
|
3962
|
-
var
|
|
3993
|
+
var COMPANIES_SCHEMA = [
|
|
3963
3994
|
{ name: "name", required: true, aliases: ["company", "organization", "account_name", "business"] },
|
|
3964
3995
|
{ name: "email", aliases: ["email_address", "mail"] },
|
|
3965
3996
|
{ name: "website", aliases: ["url", "web", "site"] },
|
|
@@ -3982,7 +4013,7 @@ var DEALS_SCHEMA = [
|
|
|
3982
4013
|
{ name: "priority" },
|
|
3983
4014
|
{ name: "value", aliases: ["amount", "price", "deal_value"] },
|
|
3984
4015
|
{ name: "probability", aliases: ["prob", "win_rate", "win_probability"] },
|
|
3985
|
-
{ name: "
|
|
4016
|
+
{ name: "company_id", aliases: ["account", "company", "client"] },
|
|
3986
4017
|
{ name: "expected_close_date", aliases: ["close_date", "expected_close", "closing_date"] }
|
|
3987
4018
|
];
|
|
3988
4019
|
var TASKS_SCHEMA = [
|
|
@@ -3995,13 +4026,13 @@ var TASKS_SCHEMA = [
|
|
|
3995
4026
|
];
|
|
3996
4027
|
var SCHEMAS = {
|
|
3997
4028
|
people: PEOPLE_SCHEMA,
|
|
3998
|
-
|
|
4029
|
+
companies: COMPANIES_SCHEMA,
|
|
3999
4030
|
deals: DEALS_SCHEMA,
|
|
4000
4031
|
tasks: TASKS_SCHEMA
|
|
4001
4032
|
};
|
|
4002
4033
|
function registerImportCommands(parent) {
|
|
4003
4034
|
const cmd = parent.command("import").description("Bulk-import CSV/JSON data into Helm");
|
|
4004
|
-
for (const entity of ["people", "
|
|
4035
|
+
for (const entity of ["people", "companies", "deals", "tasks"]) {
|
|
4005
4036
|
cmd.command(`${entity} <file>`).description(`Import ${entity} from a CSV/TSV/JSON/NDJSON file`).option("-m, --map <field=column...>", "explicit field mapping (repeatable)").option("--apply", "actually write (default is dry-run)").option("--on-duplicate <mode>", "skip|update|create", "skip").option("-c, --concurrency <n>", "parallel writes", "5").option("--report <file>", "write per-row outcomes to NDJSON file").option("--strict", "abort on first error").option("-p, --profile <name>").action(async (file, opts) => {
|
|
4006
4037
|
try {
|
|
4007
4038
|
await runImport(entity, file, opts);
|
|
@@ -4057,7 +4088,7 @@ Rows to import: ${rows.length}`));
|
|
|
4057
4088
|
Preview (first ${previewN}):`));
|
|
4058
4089
|
for (let i = 0; i < previewN; i++) {
|
|
4059
4090
|
const mapped = applyMapping(rows[i], mapping);
|
|
4060
|
-
const display = entity === "people" ? `${mapped.first_name ?? ""} ${mapped.last_name ?? ""} <${mapped.email ?? ""}>`.trim() : entity === "
|
|
4091
|
+
const display = entity === "people" ? `${mapped.first_name ?? ""} ${mapped.last_name ?? ""} <${mapped.email ?? ""}>`.trim() : entity === "companies" ? `${mapped.name ?? ""} <${mapped.email ?? ""}>`.trim() : entity === "tasks" ? `${mapped.title ?? ""} (${mapped.priority ?? "medium"}, ${mapped.status ?? "backlog"})`.trim() : `${mapped.title ?? ""} ($${mapped.value ?? "0"})`.trim();
|
|
4061
4092
|
console.log(` ${i + 1}. ${display}`);
|
|
4062
4093
|
}
|
|
4063
4094
|
}
|
|
@@ -4069,7 +4100,7 @@ Preview (first ${previewN}):`));
|
|
|
4069
4100
|
const client = HelmClient.fromProfile(profile);
|
|
4070
4101
|
const prep = ora({ text: "Loading existing records for dedup...", color: "cyan" }).start();
|
|
4071
4102
|
const dedupIndex = await buildDedupIndex(client, entity);
|
|
4072
|
-
const
|
|
4103
|
+
const companyResolver = await buildCompanyResolver(entity, mapping, client);
|
|
4073
4104
|
prep.stop();
|
|
4074
4105
|
const spinner = ora({ text: "Importing...", color: "cyan" }).start();
|
|
4075
4106
|
const results = [];
|
|
@@ -4082,11 +4113,11 @@ Preview (first ${previewN}):`));
|
|
|
4082
4113
|
const row = rows[idx];
|
|
4083
4114
|
const mapped = applyMapping(row, mapping);
|
|
4084
4115
|
try {
|
|
4085
|
-
const
|
|
4086
|
-
if (
|
|
4087
|
-
const resolved = await
|
|
4088
|
-
if (resolved) mapped.
|
|
4089
|
-
else delete mapped.
|
|
4116
|
+
const companyInput = mapped.company_id;
|
|
4117
|
+
if (companyInput && companyResolver) {
|
|
4118
|
+
const resolved = await companyResolver(companyInput);
|
|
4119
|
+
if (resolved) mapped.company_id = resolved;
|
|
4120
|
+
else delete mapped.company_id;
|
|
4090
4121
|
}
|
|
4091
4122
|
const outcome = await createOne(client, entity, mapped, opts, dedupIndex);
|
|
4092
4123
|
if (outcome === "skipped") {
|
|
@@ -4169,7 +4200,7 @@ async function createOne(client, entity, data, opts, dedupIndex) {
|
|
|
4169
4200
|
email: data.email,
|
|
4170
4201
|
phone: data.phone,
|
|
4171
4202
|
title: data.title,
|
|
4172
|
-
|
|
4203
|
+
company_id: data.company_id,
|
|
4173
4204
|
contact_type: data.contact_type,
|
|
4174
4205
|
priority: data.priority,
|
|
4175
4206
|
notes: data.notes,
|
|
@@ -4199,7 +4230,7 @@ async function createOne(client, entity, data, opts, dedupIndex) {
|
|
|
4199
4230
|
const rec2 = doUpdate ? await client.contacts.update(existingId, payload2) : await client.contacts.create(payload2);
|
|
4200
4231
|
return { id: rec2.id, action: doUpdate ? "updated" : "created" };
|
|
4201
4232
|
}
|
|
4202
|
-
if (entity === "
|
|
4233
|
+
if (entity === "companies") {
|
|
4203
4234
|
const payload2 = {
|
|
4204
4235
|
name: data.name,
|
|
4205
4236
|
email: data.email,
|
|
@@ -4216,7 +4247,7 @@ async function createOne(client, entity, data, opts, dedupIndex) {
|
|
|
4216
4247
|
tags: parseTags(data.tags),
|
|
4217
4248
|
custom_fields: buildCustomFields(data)
|
|
4218
4249
|
};
|
|
4219
|
-
const rec2 = doUpdate ? await client.
|
|
4250
|
+
const rec2 = doUpdate ? await client.companies.update(existingId, payload2) : await client.companies.create(payload2);
|
|
4220
4251
|
return { id: rec2.id, action: doUpdate ? "updated" : "created" };
|
|
4221
4252
|
}
|
|
4222
4253
|
if (entity === "tasks") {
|
|
@@ -4237,7 +4268,7 @@ async function createOne(client, entity, data, opts, dedupIndex) {
|
|
|
4237
4268
|
priority: data.priority,
|
|
4238
4269
|
value: data.value ? parseFloat(data.value) : void 0,
|
|
4239
4270
|
probability: data.probability ? parseFloat(data.probability) : void 0,
|
|
4240
|
-
|
|
4271
|
+
company_id: data.company_id,
|
|
4241
4272
|
expected_close_date: data.expected_close_date
|
|
4242
4273
|
};
|
|
4243
4274
|
const rec = doUpdate ? await client.deals.update(existingId, payload) : await client.deals.create(payload);
|
|
@@ -4262,8 +4293,8 @@ async function buildDedupIndex(client, entity) {
|
|
|
4262
4293
|
}
|
|
4263
4294
|
};
|
|
4264
4295
|
}
|
|
4265
|
-
if (entity === "
|
|
4266
|
-
const existing2 = await client.
|
|
4296
|
+
if (entity === "companies") {
|
|
4297
|
+
const existing2 = await client.companies.listAll();
|
|
4267
4298
|
const byName = /* @__PURE__ */ new Map();
|
|
4268
4299
|
for (const a of existing2) byName.set(a.name.toLowerCase(), a.id);
|
|
4269
4300
|
const keyOf = (d) => d.name?.toLowerCase();
|
|
@@ -4289,20 +4320,20 @@ async function buildDedupIndex(client, entity) {
|
|
|
4289
4320
|
};
|
|
4290
4321
|
}
|
|
4291
4322
|
const existing = await client.deals.list({ limit: 1e4 });
|
|
4292
|
-
const dealKey = (title,
|
|
4323
|
+
const dealKey = (title, companyId) => `${(title ?? "").toLowerCase()}::${companyId ?? ""}`;
|
|
4293
4324
|
const byKey = /* @__PURE__ */ new Map();
|
|
4294
|
-
for (const d of existing) byKey.set(dealKey(d.title, d.
|
|
4325
|
+
for (const d of existing) byKey.set(dealKey(d.title, d.company_id), d.id);
|
|
4295
4326
|
return {
|
|
4296
|
-
findId: (d) => byKey.get(dealKey(d.title, d.
|
|
4297
|
-
add: (d, id) => byKey.set(dealKey(d.title, d.
|
|
4327
|
+
findId: (d) => byKey.get(dealKey(d.title, d.company_id)),
|
|
4328
|
+
add: (d, id) => byKey.set(dealKey(d.title, d.company_id), id)
|
|
4298
4329
|
};
|
|
4299
4330
|
}
|
|
4300
|
-
async function
|
|
4301
|
-
if (!mapping.
|
|
4302
|
-
if (entity === "
|
|
4303
|
-
const
|
|
4304
|
-
const byName = new Map(
|
|
4305
|
-
const ids = new Set(
|
|
4331
|
+
async function buildCompanyResolver(entity, mapping, client) {
|
|
4332
|
+
if (!mapping.company_id) return null;
|
|
4333
|
+
if (entity === "companies") return null;
|
|
4334
|
+
const companies = await client.companies.listAll();
|
|
4335
|
+
const byName = new Map(companies.map((a) => [a.name.toLowerCase(), a.id]));
|
|
4336
|
+
const ids = new Set(companies.map((a) => a.id));
|
|
4306
4337
|
return async (input) => {
|
|
4307
4338
|
if (ids.has(input)) return input;
|
|
4308
4339
|
return byName.get(input.toLowerCase()) ?? null;
|
|
@@ -4883,7 +4914,7 @@ registerAuthCommands(program);
|
|
|
4883
4914
|
registerProfileCommands(program);
|
|
4884
4915
|
registerConfigCommands(program);
|
|
4885
4916
|
registerProjectCommands(program);
|
|
4886
|
-
|
|
4917
|
+
registerCompanyCommands(program);
|
|
4887
4918
|
registerContactCommands(program);
|
|
4888
4919
|
registerDealCommands(program);
|
|
4889
4920
|
registerPipelineCommands(program);
|