@general-input/cli 0.5.0 → 0.6.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 +117 -3
- package/dist/cli.js.map +1 -1
- package/package.json +2 -2
package/dist/cli.js
CHANGED
|
@@ -384,7 +384,7 @@ import chalk4 from "chalk";
|
|
|
384
384
|
// package.json
|
|
385
385
|
var package_default = {
|
|
386
386
|
name: "@general-input/cli",
|
|
387
|
-
version: "0.
|
|
387
|
+
version: "0.6.0",
|
|
388
388
|
type: "module",
|
|
389
389
|
description: "The agent-facing CLI for General Input. Authenticate, manage workflows, run bash with operator credentials injected by the cloud.",
|
|
390
390
|
license: "SEE LICENSE IN LICENSE",
|
|
@@ -1466,6 +1466,19 @@ var CrmService = class {
|
|
|
1466
1466
|
async unassignTag(id, entityId) {
|
|
1467
1467
|
return (await this.crm()).unassignTag(id, entityId);
|
|
1468
1468
|
}
|
|
1469
|
+
// ── Attribution sources ────────────────────────────────────────────
|
|
1470
|
+
async listAttributionSources(includeArchived) {
|
|
1471
|
+
return (await this.crm()).listAttributionSources(includeArchived);
|
|
1472
|
+
}
|
|
1473
|
+
async createAttributionSource(body) {
|
|
1474
|
+
return (await this.crm()).createAttributionSource(body);
|
|
1475
|
+
}
|
|
1476
|
+
async updateAttributionSource(id, body) {
|
|
1477
|
+
return (await this.crm()).updateAttributionSource(id, body);
|
|
1478
|
+
}
|
|
1479
|
+
async reorderAttributionSources(body) {
|
|
1480
|
+
return (await this.crm()).reorderAttributionSources(body);
|
|
1481
|
+
}
|
|
1469
1482
|
// ── Notes ──────────────────────────────────────────────────────────
|
|
1470
1483
|
async listNotes(entityType, entityId) {
|
|
1471
1484
|
return (await this.crm()).listNotes(entityType, entityId);
|
|
@@ -2152,6 +2165,34 @@ var CrmApiClient = class {
|
|
|
2152
2165
|
{ method: "DELETE" }
|
|
2153
2166
|
);
|
|
2154
2167
|
}
|
|
2168
|
+
// ── Attribution sources ────────────────────────────────────────────
|
|
2169
|
+
async listAttributionSources(includeArchived) {
|
|
2170
|
+
this.http.requireAuthed();
|
|
2171
|
+
return this.http.fetch(
|
|
2172
|
+
`${CRM}/attribution-sources${includeArchived ? "?includeArchived=true" : ""}`
|
|
2173
|
+
);
|
|
2174
|
+
}
|
|
2175
|
+
async createAttributionSource(body) {
|
|
2176
|
+
this.http.requireAuthed();
|
|
2177
|
+
return this.http.fetch(`${CRM}/attribution-sources`, {
|
|
2178
|
+
method: "POST",
|
|
2179
|
+
body
|
|
2180
|
+
});
|
|
2181
|
+
}
|
|
2182
|
+
async updateAttributionSource(id, body) {
|
|
2183
|
+
this.http.requireAuthed();
|
|
2184
|
+
return this.http.fetch(`${CRM}/attribution-sources/${enc(id)}`, {
|
|
2185
|
+
method: "PATCH",
|
|
2186
|
+
body
|
|
2187
|
+
});
|
|
2188
|
+
}
|
|
2189
|
+
async reorderAttributionSources(body) {
|
|
2190
|
+
this.http.requireAuthed();
|
|
2191
|
+
return this.http.fetch(`${CRM}/attribution-sources/reorder`, {
|
|
2192
|
+
method: "POST",
|
|
2193
|
+
body
|
|
2194
|
+
});
|
|
2195
|
+
}
|
|
2155
2196
|
// ── Notes ──────────────────────────────────────────────────────────
|
|
2156
2197
|
async createNote(entityType, entityId, body) {
|
|
2157
2198
|
this.http.requireAuthed();
|
|
@@ -5965,7 +6006,7 @@ function registerCrmCards(parent) {
|
|
|
5965
6006
|
}
|
|
5966
6007
|
});
|
|
5967
6008
|
cards.command("create").argument("<pipelineId>", "Pipeline to create the card in.").description(
|
|
5968
|
-
"Create a card. --json: { title, stageId?, ownerMembershipId?, primaryCompanyId?, people?, amount?, currency?, expectedCloseAt?, custom? }."
|
|
6009
|
+
"Create a card. --json: { title, stageId?, ownerMembershipId?, primaryCompanyId?, people?, amount?, currency?, expectedCloseAt?, attributionSourceId?, custom? }."
|
|
5969
6010
|
).requiredOption("--json <body>", "JSON card definition.").action(async (pipelineId, opts) => {
|
|
5970
6011
|
try {
|
|
5971
6012
|
printJson(
|
|
@@ -5976,7 +6017,7 @@ function registerCrmCards(parent) {
|
|
|
5976
6017
|
}
|
|
5977
6018
|
});
|
|
5978
6019
|
cards.command("update").argument("<id>", "Card id.").description(
|
|
5979
|
-
"Edit card fields. --json: { title?, ownerMembershipId?, primaryCompanyId?, amount?, currency?, expectedCloseAt?, custom? }."
|
|
6020
|
+
"Edit card fields. --json: { title?, ownerMembershipId?, primaryCompanyId?, amount?, currency?, expectedCloseAt?, attributionSourceId?, custom? }."
|
|
5980
6021
|
).requiredOption("--json <body>", "JSON fields to change.").option(
|
|
5981
6022
|
"--expected-updated-at <ts>",
|
|
5982
6023
|
"Optimistic-concurrency token; omit to fetch the current version first."
|
|
@@ -6065,6 +6106,78 @@ function registerCrmCards(parent) {
|
|
|
6065
6106
|
});
|
|
6066
6107
|
}
|
|
6067
6108
|
|
|
6109
|
+
// src/commands/crm/attributionSources.ts
|
|
6110
|
+
function registerCrmAttributionSources(parent) {
|
|
6111
|
+
const sources = parent.command("attribution-sources").description(
|
|
6112
|
+
"List lead sources (default), or create / update / reorder them. Set one on a card via `cards update`."
|
|
6113
|
+
).option("--include-archived", "Include archived sources.").option("--json", "Machine-readable output.").action((opts) => executeList(opts));
|
|
6114
|
+
sources.command("create").description(
|
|
6115
|
+
"Create a lead source (reuses the name if it already exists). --json: { name }."
|
|
6116
|
+
).requiredOption("--json <body>", "JSON source definition.").action(async (opts) => {
|
|
6117
|
+
try {
|
|
6118
|
+
printJson(
|
|
6119
|
+
await crmService.createAttributionSource(
|
|
6120
|
+
parseJsonObjectArg(opts.json)
|
|
6121
|
+
)
|
|
6122
|
+
);
|
|
6123
|
+
} catch (error) {
|
|
6124
|
+
exitOnApiError(error);
|
|
6125
|
+
}
|
|
6126
|
+
});
|
|
6127
|
+
sources.command("update").argument("<id>", "Attribution source id.").description(
|
|
6128
|
+
"Rename or archive a lead source. --json: { name?, isArchived? }."
|
|
6129
|
+
).requiredOption("--json <body>", "JSON fields to change.").action(async (id, opts) => {
|
|
6130
|
+
try {
|
|
6131
|
+
printJson(
|
|
6132
|
+
await crmService.updateAttributionSource(
|
|
6133
|
+
id,
|
|
6134
|
+
parseJsonObjectArg(opts.json)
|
|
6135
|
+
)
|
|
6136
|
+
);
|
|
6137
|
+
} catch (error) {
|
|
6138
|
+
exitOnApiError(error);
|
|
6139
|
+
}
|
|
6140
|
+
});
|
|
6141
|
+
sources.command("reorder").description("Reorder the picker. --json: { orderedIds: [id, \u2026] }.").requiredOption("--json <body>", "JSON with orderedIds.").action(async (opts) => {
|
|
6142
|
+
try {
|
|
6143
|
+
printJson(
|
|
6144
|
+
await crmService.reorderAttributionSources(
|
|
6145
|
+
parseJsonObjectArg(opts.json)
|
|
6146
|
+
)
|
|
6147
|
+
);
|
|
6148
|
+
} catch (error) {
|
|
6149
|
+
exitOnApiError(error);
|
|
6150
|
+
}
|
|
6151
|
+
});
|
|
6152
|
+
}
|
|
6153
|
+
async function executeList(opts) {
|
|
6154
|
+
try {
|
|
6155
|
+
const sources = await crmService.listAttributionSources(
|
|
6156
|
+
opts.includeArchived
|
|
6157
|
+
);
|
|
6158
|
+
if (opts.json) {
|
|
6159
|
+
printJson({ sources });
|
|
6160
|
+
return;
|
|
6161
|
+
}
|
|
6162
|
+
if (sources.length === 0) {
|
|
6163
|
+
process.stdout.write("No lead sources yet.\n");
|
|
6164
|
+
return;
|
|
6165
|
+
}
|
|
6166
|
+
printTable(
|
|
6167
|
+
["ID", "NAME", "USES", "ARCHIVED"],
|
|
6168
|
+
sources.map((source) => [
|
|
6169
|
+
source.id,
|
|
6170
|
+
source.name,
|
|
6171
|
+
source.usageCount.toString(),
|
|
6172
|
+
source.isArchived ? "yes" : ""
|
|
6173
|
+
]),
|
|
6174
|
+
{ colorFn: dimColumn(0) }
|
|
6175
|
+
);
|
|
6176
|
+
} catch (error) {
|
|
6177
|
+
exitOnApiError(error);
|
|
6178
|
+
}
|
|
6179
|
+
}
|
|
6180
|
+
|
|
6068
6181
|
// src/commands/crm/touchpoints.ts
|
|
6069
6182
|
function registerCrmTouchpoints(parent) {
|
|
6070
6183
|
const touchpoints = parent.command("touchpoints").description("Log, edit, and delete interactions on a card's timeline.");
|
|
@@ -6412,6 +6525,7 @@ function registerCrmCommands(program2) {
|
|
|
6412
6525
|
registerCrmPipelines(crm);
|
|
6413
6526
|
registerCrmStages(crm);
|
|
6414
6527
|
registerCrmCards(crm);
|
|
6528
|
+
registerCrmAttributionSources(crm);
|
|
6415
6529
|
registerCrmTouchpoints(crm);
|
|
6416
6530
|
registerCrmFields(crm);
|
|
6417
6531
|
registerCrmEmployments(crm);
|