@audienti/cli 0.1.103 → 0.1.105
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/package.json +1 -1
- package/src/api-client.js +4 -0
- package/src/cli.js +43 -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.105] - 2026-10-07
|
|
8
|
+
|
|
9
|
+
### Added
|
|
10
|
+
|
|
11
|
+
- `audienti find <name>` finds people, companies, experiments and users in the account by name (a person also matches by company name), at most 5 of each. It uses the same search as the web Jump to pop-up (Cmd+K), through `GET /api/v1/accounts/:account_id/jump_to?q=<name>`.
|
|
12
|
+
|
|
13
|
+
## [0.1.104] - 2026-10-07
|
|
14
|
+
|
|
15
|
+
### Changed
|
|
16
|
+
|
|
17
|
+
- `POST quick_starts` with `page_url` takes `principal_account_user_id` from anyone in the account, as the experiment form does (#2705). The chosen person owns the page result, the experiment and its prospects. Anyone in the account can open a page result. Setup quick starts for another person still need an admin.
|
|
18
|
+
|
|
7
19
|
## [0.1.103] - 2026-10-06
|
|
8
20
|
|
|
9
21
|
### Changed
|
package/package.json
CHANGED
package/src/api-client.js
CHANGED
|
@@ -470,6 +470,10 @@ export class AudientiClient {
|
|
|
470
470
|
});
|
|
471
471
|
}
|
|
472
472
|
|
|
473
|
+
jumpTo(accountId, query) {
|
|
474
|
+
return this.requestJson(accountPath(accountId, ["jump_to"], { q: query }));
|
|
475
|
+
}
|
|
476
|
+
|
|
473
477
|
tags(accountId) {
|
|
474
478
|
return this.requestJson(accountPath(accountId, ["tags"]));
|
|
475
479
|
}
|
package/src/cli.js
CHANGED
|
@@ -412,6 +412,7 @@ async function dispatch(argv, context) {
|
|
|
412
412
|
if (normalizedResource === "reply-alerts") return replyAlertsCommand(action, rest, context);
|
|
413
413
|
if (normalizedResource === "brand-profile") return brandProfileCommand(action, rest, context, { accountOverride });
|
|
414
414
|
if (normalizedResource === "payment") return paymentCommand(action, rest, context, { accountOverride });
|
|
415
|
+
if (normalizedResource === "find") return findByName([action, ...rest].filter((value) => value !== undefined), context, { accountOverride });
|
|
415
416
|
if (normalizedResource === "tags" && action === "list") return tagsList(rest, context, { accountOverride });
|
|
416
417
|
if (normalizedResource === "tags" && action === "show") return tagsShow(rest, context, { accountOverride });
|
|
417
418
|
if (normalizedResource === "tasks" && ["list", "manage"].includes(action)) return tasksList(rest, context, { accountOverride });
|
|
@@ -3012,6 +3013,19 @@ function writeBrandProfile(profile, context) {
|
|
|
3012
3013
|
writeLine(context.stdout, `Do not use: ${display(profile?.do_not_use, "-")}`);
|
|
3013
3014
|
}
|
|
3014
3015
|
|
|
3016
|
+
// Same search as the web ⌘K "Jump to" pop-up: people, companies, experiments and users by name, at most 5 of each.
|
|
3017
|
+
async function findByName(args, context, { accountOverride } = {}) {
|
|
3018
|
+
const { values, positionals } = parseCommandArgs(args, jsonOptions());
|
|
3019
|
+
const query = positionals.join(" ").trim();
|
|
3020
|
+
if (!query) throw new CommandError("Usage: audienti find <name> [--json] [--account <acct_id>]");
|
|
3021
|
+
|
|
3022
|
+
const { client, accountId } = await requireAccountContext(context, { accountOverride });
|
|
3023
|
+
const payload = await client.jumpTo(accountId, query);
|
|
3024
|
+
if (values.json) return writeJson(context.stdout, payload);
|
|
3025
|
+
|
|
3026
|
+
renderFindResults(payload, context);
|
|
3027
|
+
}
|
|
3028
|
+
|
|
3015
3029
|
async function tagsList(args, context, { accountOverride } = {}) {
|
|
3016
3030
|
const { values, positionals } = parseCommandArgs(args, jsonOptions());
|
|
3017
3031
|
if (positionals.length > 0) throw new CommandError("Usage: audienti tags list [--json] [--account <acct_id>]");
|
|
@@ -7264,6 +7278,19 @@ function routingRuleTargetLabel(rule) {
|
|
|
7264
7278
|
"-";
|
|
7265
7279
|
}
|
|
7266
7280
|
|
|
7281
|
+
function renderFindResults(payload, context) {
|
|
7282
|
+
const groups = [["People", payload?.people], ["Companies", payload?.companies], ["Experiments", payload?.experiments], ["Users", payload?.users]];
|
|
7283
|
+
if (groups.every(([, rows]) => !Array.isArray(rows) || rows.length === 0)) return writeLine(context.stdout, "Nothing found.");
|
|
7284
|
+
|
|
7285
|
+
for (const [title, rows] of groups) {
|
|
7286
|
+
if (!Array.isArray(rows) || rows.length === 0) continue;
|
|
7287
|
+
writeLine(context.stdout, title);
|
|
7288
|
+
for (const row of rows) {
|
|
7289
|
+
writeLine(context.stdout, [" " + display(row.name), display(row.detail, ""), display(row.path, "")].join("\t"));
|
|
7290
|
+
}
|
|
7291
|
+
}
|
|
7292
|
+
}
|
|
7293
|
+
|
|
7267
7294
|
function renderTags(tags, context) {
|
|
7268
7295
|
if (!Array.isArray(tags) || tags.length === 0) return writeLine(context.stdout, "No tags found.");
|
|
7269
7296
|
|
|
@@ -10603,6 +10630,7 @@ const HELP_TOPICS = new Map([
|
|
|
10603
10630
|
" audienti lists bulk-add-tag --tag <tag> <list_id> [list_id...]",
|
|
10604
10631
|
" audienti lists merge <list_id> <list_id>",
|
|
10605
10632
|
" audienti lists export <list_id> [--output <file.csv>]",
|
|
10633
|
+
" audienti find <name>",
|
|
10606
10634
|
" audienti tags list",
|
|
10607
10635
|
" audienti tags show <tag>",
|
|
10608
10636
|
" audienti tasks list [--status open]",
|
|
@@ -12025,6 +12053,21 @@ const HELP_TOPICS = new Map([
|
|
|
12025
12053
|
" POST /api/v1/accounts/:account_id/company_rules/apply_all.json"
|
|
12026
12054
|
].join("\n")],
|
|
12027
12055
|
|
|
12056
|
+
["find", [
|
|
12057
|
+
"Usage:",
|
|
12058
|
+
" audienti find <name> [--json]",
|
|
12059
|
+
"",
|
|
12060
|
+
"Status: implemented",
|
|
12061
|
+
"",
|
|
12062
|
+
"Purpose:",
|
|
12063
|
+
" Find people, companies, experiments and users in the account by name, at most 5 of each.",
|
|
12064
|
+
" A person also matches by company name.",
|
|
12065
|
+
" Uses the same search as the web Jump to pop-up (Cmd+K). Needs at least 2 characters.",
|
|
12066
|
+
"",
|
|
12067
|
+
"API:",
|
|
12068
|
+
" GET /api/v1/accounts/:account_id/jump_to?q=<name>"
|
|
12069
|
+
].join("\n")],
|
|
12070
|
+
|
|
12028
12071
|
["tags", [
|
|
12029
12072
|
"Usage:",
|
|
12030
12073
|
" audienti tags list [--json]",
|