@audienti/cli 0.1.109 → 0.1.111
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/CHANGELOG.md +12 -0
- package/README.md +1 -0
- package/package.json +1 -1
- package/src/api-client.js +7 -0
- package/src/cli.js +40 -0
package/CHANGELOG.md
CHANGED
|
@@ -4,6 +4,18 @@ All notable changes to the Audienti CLI are documented here.
|
|
|
4
4
|
|
|
5
5
|
## [Unreleased]
|
|
6
6
|
|
|
7
|
+
## [0.1.111] - 2026-10-09
|
|
8
|
+
|
|
9
|
+
### Changed
|
|
10
|
+
|
|
11
|
+
- Record shared setup API fixes in this CLI release: bare public domains normalize to HTTPS, and valid same-site retries preserve trusted website evidence and explicitly scoped corrections.
|
|
12
|
+
|
|
13
|
+
## [0.1.110] - 2026-10-08
|
|
14
|
+
|
|
15
|
+
### Added
|
|
16
|
+
|
|
17
|
+
- `prospects set-destination` adds or explicitly moves selected people to existing lists/experiments, creates named lists or transitions without setup, and preserves partial-failure results through the shared destination API.
|
|
18
|
+
|
|
7
19
|
## [0.1.109] - 2026-10-08
|
|
8
20
|
|
|
9
21
|
### Changed
|
package/README.md
CHANGED
|
@@ -877,3 +877,4 @@ credentials or silently authenticate an agent.
|
|
|
877
877
|
Copyright (c) 2026 OMALab, Inc. All rights reserved. See [LICENSE](LICENSE).
|
|
878
878
|
|
|
879
879
|
Batch import accepts up to 50 rows per API request. Split larger files before importing. Row destination IDs or new names override batch defaults; failed rows stay visible in the response.
|
|
880
|
+
Bulk destinations: `audienti prospects set-destination <prsp_id> --type list --destination <list_id>` adds by default. Use `--name "New list"` to create a list, `--type experiment --name "Existing relationships"` to create a transition without setup, or `--mode move` for explicit reassignment. Add preserves existing memberships; experiment Add skips people assigned elsewhere.
|
package/package.json
CHANGED
package/src/api-client.js
CHANGED
|
@@ -949,6 +949,13 @@ export class AudientiClient {
|
|
|
949
949
|
});
|
|
950
950
|
}
|
|
951
951
|
|
|
952
|
+
setProspectDestination(accountId, body) {
|
|
953
|
+
return this.requestJson(accountPath(accountId, ["prospect_destinations"]), {
|
|
954
|
+
method: "POST",
|
|
955
|
+
body
|
|
956
|
+
});
|
|
957
|
+
}
|
|
958
|
+
|
|
952
959
|
assignProspects(accountId, body) {
|
|
953
960
|
return this.requestJson(accountPath(accountId, ["prospects", "assign"]), {
|
|
954
961
|
method: "POST",
|
package/src/cli.js
CHANGED
|
@@ -65,6 +65,7 @@ const PROSPECTS_ADD_NOTE_USAGE = "Usage: audienti prospects add-note <prsp_id> (
|
|
|
65
65
|
const PROSPECTS_ADD_STEER_USAGE = "Usage: audienti prospects add-steer <prsp_id> (--message <text> [--engagement-type <key>] | --payload <file.json>) [--json] [--account <acct_id>]";
|
|
66
66
|
const PROSPECTS_ADD_PROFILE_USAGE = "Usage: audienti prospects add-profile <prsp_id> --url <profile_url|email|phone> [--json] [--account <acct_id>]";
|
|
67
67
|
const PROSPECTS_REPORT_BAD_PROFILE_USAGE = "Usage: audienti prospects report-bad-profile <prsp_id> <prof_id|citation_id> [--json] [--account <acct_id>]";
|
|
68
|
+
const PROSPECTS_DESTINATION_USAGE = "Usage: audienti prospects set-destination <prsp_id> [prsp_id...] --type <list|experiment> (--destination <id> | --name <name>) [--mode <add|move>] [--json] [--account <acct_id>]. A new experiment name creates a transition without setup.";
|
|
68
69
|
const PROSPECTS_ASSIGN_USAGE = "Usage: audienti prospects assign <prsp_id> [prsp_id...] --assigned-user <id|me|unassign> [--json] [--account <acct_id>]";
|
|
69
70
|
const PROSPECTS_MOVE_ACCOUNT_USAGE = "Usage: audienti prospects move-account <prsp_id> --target-account <acct_id> [--assigned-user <id|me>] [--target-motion <motn_id>] [--target-list <list_id>] [--apply] [--json] [--account <source_acct_id>]";
|
|
70
71
|
const PROSPECTS_SET_STATUS_USAGE = "Usage: audienti prospects set-status <prsp_id> --status <active|nurture|non_responsive|not_fit|bad_data_404|rejected> [--json] [--account <acct_id>]";
|
|
@@ -484,6 +485,7 @@ async function dispatch(argv, context) {
|
|
|
484
485
|
if (normalizedResource === "prospects" && action === "list") return prospectsList(rest, context, { accountOverride });
|
|
485
486
|
if (normalizedResource === "prospects" && action === "check") return prospectsCheck(rest, context, { accountOverride });
|
|
486
487
|
if (normalizedResource === "prospects" && action === "show") return prospectsShow(rest, context, { accountOverride });
|
|
488
|
+
if (normalizedResource === "prospects" && action === "set-destination") return prospectsSetDestination(rest, context, { accountOverride });
|
|
487
489
|
if (normalizedResource === "prospects" && action === "assign") return prospectsAssign(rest, context, { accountOverride });
|
|
488
490
|
if (normalizedResource === "prospects" && action === "move-account") return prospectsMoveAccount(rest, context, { accountOverride });
|
|
489
491
|
if (normalizedResource === "prospects" && action === "set-status") return prospectsSetStatus(rest, context, { accountOverride });
|
|
@@ -4566,6 +4568,28 @@ function prospectQueryFromValues(values, config, { accountOverride } = {}) {
|
|
|
4566
4568
|
});
|
|
4567
4569
|
}
|
|
4568
4570
|
|
|
4571
|
+
async function prospectsSetDestination(args, context, { accountOverride } = {}) {
|
|
4572
|
+
const { values, positionals } = parseCommandArgs(args, {
|
|
4573
|
+
...jsonOptions(), type: { type: "string" }, destination: { type: "string" },
|
|
4574
|
+
name: { type: "string" }, mode: { type: "string", default: "add" }
|
|
4575
|
+
});
|
|
4576
|
+
if (!positionals.length || !["list", "experiment"].includes(values.type) ||
|
|
4577
|
+
!["add", "move"].includes(values.mode) || Boolean(values.destination) === Boolean(values.name)) {
|
|
4578
|
+
throw new CommandError(PROSPECTS_DESTINATION_USAGE);
|
|
4579
|
+
}
|
|
4580
|
+
const { client, accountId } = await requireAccountContext(context, { accountOverride });
|
|
4581
|
+
const { payload, rejected } = await performBulkMutation(() => client.setProspectDestination(accountId, compactObject({
|
|
4582
|
+
prospect_ids: positionals, destination_type: values.type === "list" ? "list" : "motion",
|
|
4583
|
+
destination_id: values.destination, name: values.name, mode: values.mode
|
|
4584
|
+
})));
|
|
4585
|
+
if (values.json) writeJson(context.stdout, payload);
|
|
4586
|
+
else {
|
|
4587
|
+
writeLine(context.stdout, `${payload.created ? "Created " : ""}${display(payload.destination?.name)}: ${payload.added?.length || 0} added, ${payload.moved?.length || 0} moved, ${payload.skipped?.length || 0} skipped, ${payload.failed?.length || 0} failed.`);
|
|
4588
|
+
for (const row of payload.failed || []) writeLine(context.stdout, `${row.id}: ${row.message || row.reason}`);
|
|
4589
|
+
}
|
|
4590
|
+
return rejected ? 1 : 0;
|
|
4591
|
+
}
|
|
4592
|
+
|
|
4569
4593
|
async function prospectsAssign(args, context, { accountOverride } = {}) {
|
|
4570
4594
|
const { values, positionals } = parseCommandArgs(args, {
|
|
4571
4595
|
...jsonOptions(),
|
|
@@ -13747,6 +13771,22 @@ const HELP_TOPICS = new Map([
|
|
|
13747
13771
|
" audienti prospects check --assigned-user me --json"
|
|
13748
13772
|
].join("\n")],
|
|
13749
13773
|
|
|
13774
|
+
["prospects set-destination", [
|
|
13775
|
+
"Usage:",
|
|
13776
|
+
` ${PROSPECTS_DESTINATION_USAGE.slice("Usage: ".length)}`,
|
|
13777
|
+
"",
|
|
13778
|
+
"Status: implemented",
|
|
13779
|
+
"",
|
|
13780
|
+
"Behavior:",
|
|
13781
|
+
" Search destinations in the app; pass an existing destination ID or a new name here.",
|
|
13782
|
+
" --type list creates a list; --type experiment with a new name creates a transition without setup.",
|
|
13783
|
+
" Add preserves other lists and skips people assigned to another experiment. Move is explicit.",
|
|
13784
|
+
" Partial failures return their row outcomes and exit 1.",
|
|
13785
|
+
"",
|
|
13786
|
+
"API:",
|
|
13787
|
+
" POST /api/v1/accounts/:account_id/prospect_destinations.json"
|
|
13788
|
+
].join("\n")],
|
|
13789
|
+
|
|
13750
13790
|
["prospects assign", [
|
|
13751
13791
|
"Usage:",
|
|
13752
13792
|
` ${PROSPECTS_ASSIGN_USAGE.slice("Usage: ".length)}`,
|