@curviate/cli 0.48.0 → 0.50.0-next.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.
Files changed (70) hide show
  1. package/CHANGELOG.md +72 -0
  2. package/README.md +47 -6
  3. package/dist/{account-WKQHMM7P.js → account-KGCGUYKF.js} +668 -116
  4. package/dist/analytics-HRAD4ABO.js +27 -0
  5. package/dist/beta-consent-364JI6IL.js +81 -0
  6. package/dist/billing-3SSVRS2Y.js +124 -0
  7. package/dist/{chunk-Q63IIPL2.js → chunk-25MO7BYN.js} +4 -4
  8. package/dist/{chunk-76SWLAZ6.js → chunk-2W4RN5ON.js} +59 -1
  9. package/dist/chunk-5S3MJVI5.js +22 -0
  10. package/dist/chunk-67S4JHZZ.js +339 -0
  11. package/dist/chunk-73DJ3KNE.js +54 -0
  12. package/dist/chunk-CQGDMARG.js +525 -0
  13. package/dist/{chunk-Y7K4UBFC.js → chunk-DOHBOYXN.js} +1 -1
  14. package/dist/{chunk-TSOIZBBU.js → chunk-DSGKYZDK.js} +1 -1
  15. package/dist/{chunk-YLSJ4HKU.js → chunk-ENBIMEKS.js} +26 -1
  16. package/dist/{chunk-LCGXJGPB.js → chunk-GHMRPX5H.js} +7 -1
  17. package/dist/chunk-GOICALYQ.js +28 -0
  18. package/dist/chunk-L4CIJT6F.js +144 -0
  19. package/dist/{chunk-PQWDDSV7.js → chunk-L7JH3W56.js} +1 -1
  20. package/dist/{chunk-YFXLXION.js → chunk-OE6YFYUM.js} +85 -10
  21. package/dist/chunk-PPGKQJKU.js +38 -0
  22. package/dist/{chunk-MKGVNDMJ.js → chunk-QM57YDJE.js} +13 -201
  23. package/dist/{chunk-CVMSQ3OF.js → chunk-RYWWSZUH.js} +17 -3
  24. package/dist/chunk-T6GBS5SS.js +58 -0
  25. package/dist/{chunk-AYKKXGTR.js → chunk-TE3WBPW6.js} +392 -14
  26. package/dist/chunk-UL53T4O6.js +52 -0
  27. package/dist/chunk-UWQPX4AE.js +20 -0
  28. package/dist/{chunk-OHXYFICP.js → chunk-YXVF5UST.js} +77 -4
  29. package/dist/cli.js +35 -17
  30. package/dist/{comment-7IQ6ZOJF.js → comment-5JKGNYOY.js} +90 -11
  31. package/dist/{company-RD7RDGSA.js → company-TXST2VXW.js} +65 -15
  32. package/dist/{config-EYBNYRGK.js → config-TVIQUVNK.js} +53 -4
  33. package/dist/{connect-HVXT67A6.js → connect-RBL6U4KV.js} +63 -18
  34. package/dist/contact-YAHC5QFX.js +32 -0
  35. package/dist/contact-groups-DKOIBC57.js +399 -0
  36. package/dist/contact-import-ITSJQV7K.js +336 -0
  37. package/dist/core-PWMJPPRG.js +46 -0
  38. package/dist/do-not-contact-WDYIBWYA.js +200 -0
  39. package/dist/{doctor-HUXQERLQ.js → doctor-F7JLPTED.js} +65 -11
  40. package/dist/{document-AUUCGST2.js → document-BHYAUJ6F.js} +1 -1
  41. package/dist/{draft-DFO22K6Q.js → draft-TDJJUXLH.js} +60 -14
  42. package/dist/enrollment-Q6UOKHPY.js +484 -0
  43. package/dist/{examples-64YT5V5K.js → examples-DQSVIIXZ.js} +2 -2
  44. package/dist/{exit-codes-AW6KHDDN.js → exit-codes-7DBETBDT.js} +1 -1
  45. package/dist/export-HIJSCJS6.js +96 -0
  46. package/dist/{feed-JWP6ANPI.js → feed-W56ZTA4Z.js} +13 -10
  47. package/dist/{group-SIQFJEZV.js → group-AUALYK5H.js} +18 -10
  48. package/dist/{inbox-MMIMCA5O.js → inbox-HLZR2ZPV.js} +31 -12
  49. package/dist/{inboxes-RND3D4C7.js → inboxes-IZTRD6FE.js} +14 -10
  50. package/dist/incoming-ULB2RNV4.js +218 -0
  51. package/dist/{job-ACFKBLFK.js → job-55IKS6LP.js} +65 -13
  52. package/dist/{login-ZOB5KVKQ.js → login-DPZ6CXNO.js} +13 -4
  53. package/dist/{message-OFK6UVXR.js → message-J44YKRDS.js} +9 -7
  54. package/dist/motion-SQI5F2EK.js +868 -0
  55. package/dist/network-K4QD7APQ.js +235 -0
  56. package/dist/{notification-KKGAZU7M.js → notification-SEDXZHXO.js} +38 -11
  57. package/dist/notifications-HGIBRUNQ.js +231 -0
  58. package/dist/{post-A5SBCFB2.js → post-L467SKIG.js} +92 -12
  59. package/dist/{profile-4SOOQZ4K.js → profile-A2N6RMR2.js} +79 -23
  60. package/dist/{recruiter-YN73STDP.js → recruiter-AR75RHBO.js} +132 -21
  61. package/dist/{sales-nav-JXF5RY2K.js → sales-nav-C2AYFXPV.js} +73 -18
  62. package/dist/{search-JAL242A2.js → search-Z4DZIG4X.js} +55 -23
  63. package/dist/{setup-WICWH4JG.js → setup-45BEVX6B.js} +69 -17
  64. package/dist/team-6QWY4IFP.js +450 -0
  65. package/dist/tier-2HS3BXDF.js +61 -0
  66. package/dist/unibox-DHUKG65Z.js +402 -0
  67. package/dist/{webhook-UGKVYWBC.js → webhook-Q53WUAI2.js} +273 -45
  68. package/package.json +2 -2
  69. package/dist/chunk-GQKC6E5K.js +0 -36
  70. package/dist/core-6XYGUNAY.js +0 -46
@@ -0,0 +1,339 @@
1
+ #!/usr/bin/env node
2
+ import {
3
+ print,
4
+ rate,
5
+ table
6
+ } from "./chunk-5S3MJVI5.js";
7
+ import {
8
+ writeExport
9
+ } from "./chunk-PPGKQJKU.js";
10
+ import {
11
+ fail,
12
+ listFlag,
13
+ outputOpts,
14
+ rootClient,
15
+ usage
16
+ } from "./chunk-T6GBS5SS.js";
17
+ import {
18
+ intFlag
19
+ } from "./chunk-NNV2OYEF.js";
20
+ import {
21
+ pageDelayFromFlags,
22
+ readCursorFlag,
23
+ readMaxPagesFlag,
24
+ readablePage,
25
+ rejectPaginationModifiersWithoutAll,
26
+ streamAll
27
+ } from "./chunk-L4CIJT6F.js";
28
+ import {
29
+ renderSuccess,
30
+ writeNdjsonItem
31
+ } from "./chunk-QM57YDJE.js";
32
+ import {
33
+ downloadBinary
34
+ } from "./chunk-YXVF5UST.js";
35
+ import {
36
+ GLOBAL_FLAGS,
37
+ READ_SINGLE_FLAGS,
38
+ readOnly
39
+ } from "./chunk-RYWWSZUH.js";
40
+ import {
41
+ DESCRIPTIONS
42
+ } from "./chunk-73DJ3KNE.js";
43
+
44
+ // src/commands/analytics.ts
45
+ import { defineCommand } from "citty";
46
+ var DATE = /^\d{4}-\d{2}-\d{2}$/;
47
+ function windowParams(f) {
48
+ const q = {};
49
+ for (const k of ["from", "to"]) {
50
+ const v = f[k];
51
+ if (v === void 0) continue;
52
+ if (!DATE.test(v)) usage(`--${k} takes a date, YYYY-MM-DD.`);
53
+ q[k] = v;
54
+ }
55
+ if (f.range !== void 0) q["range"] = f.range;
56
+ if (f.timezone !== void 0) q["timezone"] = f.timezone;
57
+ if (f.bucket !== void 0) q["bucket"] = f.bucket;
58
+ return q;
59
+ }
60
+ function grammarParams(f) {
61
+ const q = {};
62
+ if (f.include !== void 0) q["include"] = listFlag("include", f.include);
63
+ if (f.sort !== void 0) q["sort"] = listFlag("sort", f.sort);
64
+ if (f.limit !== void 0) q["limit"] = intFlag("limit", f.limit);
65
+ if (f.compare !== void 0) q["compare"] = f.compare;
66
+ return q;
67
+ }
68
+ function filterParams(f, keys) {
69
+ const q = {};
70
+ if (keys.includes("motions") && f.motions !== void 0) q["motion_id"] = listFlag("motions", f.motions);
71
+ if (keys.includes("accounts") && f.accounts !== void 0) q["account_id"] = listFlag("accounts", f.accounts);
72
+ if (keys.includes("origin") && f.origin !== void 0) q["origin"] = listFlag("origin", f.origin);
73
+ return q;
74
+ }
75
+ var outcomes = (s) => `acceptance ${rate(s?.["acceptance"], "accepted", "sent")} \xB7 reply ${rate(s?.["reply"], "replied", "messaged")} \xB7 InMail reply ${rate(s?.["inmail_reply"], "replied", "inmailed")} \xB7 replies ${s?.["replies"] ?? "-"}`;
76
+ var rowsTable = (label, id, name, items) => Array.isArray(items) && items.length ? table(
77
+ [label, "NAME", "ACCEPTANCE", "REPLY", "INMAIL REPLY", "REPLIES"],
78
+ items.map((r) => [r[id], r[name], rate(r["acceptance"], "accepted", "sent"), rate(r["reply"], "replied", "messaged"), rate(r["inmail_reply"], "replied", "inmailed"), r["replies"]])
79
+ ) : null;
80
+ var reasons = (r) => Object.entries(r ?? {}).flatMap(([k, m]) => Object.entries(m ?? {}).map(([code, n]) => `${k} ${code} ${n}`)).join(", ");
81
+ function windowLines(body) {
82
+ const w = body["window"] ?? {};
83
+ const lines = [`${w["from"]} to ${w["to"]} (${w["timezone"]})`];
84
+ if (w["counts_only_through"]) lines.push(`daily counts only through ${w["counts_only_through"]}: step, variant and seen detail covers the days after it`);
85
+ return lines;
86
+ }
87
+ function renderOverview(body) {
88
+ const out = [...windowLines(body)];
89
+ const profile = body["profile"];
90
+ if (profile) out.push(`${profile["name"]} \xB7 ${profile["status"]}${profile["status_reason"] ? ` (${profile["status_reason"]})` : ""}`);
91
+ const metrics = body["metrics"];
92
+ if (metrics) out.push(`connections ${metrics["connections"]} \xB7 followers ${metrics["followers"]} \xB7 profile viewers 90d ${metrics["profile_viewers_90d"]} \xB7 search appearances ${metrics["search_appearances_week"]} (as of ${metrics["as_of"]})`);
93
+ const s = body["totals"] ?? body["performance"];
94
+ if (s) out.push(outcomes(s));
95
+ const steps = body["steps"];
96
+ if (Array.isArray(steps) && steps.length) {
97
+ out.push(table(
98
+ ["STEP", "ACTION", "EXECUTED", "SKIPPED", "FAILED", "ACCEPTANCE", "REPLY", "SEEN"],
99
+ steps.map((t) => [t["step_id"], t["action"] ?? t["kind"], t["executed"], t["skipped"], t["failed"], rate(t["acceptance"], "accepted", "sent"), rate(t["reply"], "replied", "messaged"), rate(t["seen"], "seen", "sent")])
100
+ ));
101
+ for (const t of steps) if (reasons(t["reasons"])) out.push(` ${t["step_id"]}: ${reasons(t["reasons"])}`);
102
+ }
103
+ const paths = body["paths"];
104
+ if (Array.isArray(paths) && paths.length) {
105
+ out.push(table(
106
+ ["PATH", "ACCEPTANCE", "REPLY", "INMAIL REPLY", "REPLIES"],
107
+ paths.map((p) => {
108
+ const t = p["totals"] ?? {};
109
+ return [p["path"], rate(t["acceptance"], "accepted", "sent"), rate(t["reply"], "replied", "messaged"), rate(t["inmail_reply"], "replied", "inmailed"), t["replies"]];
110
+ })
111
+ ));
112
+ const through = body["window"]?.["paths_through"];
113
+ if (through) out.push(`paths cover days after ${through}`);
114
+ }
115
+ const limits = body["limits"]?.["rows"];
116
+ if (Array.isArray(limits) && limits.length) out.push(table(["BUDGET ROW", "USED", "CEILING", "LEFT"], limits.map((r) => [r["budget_row"], r["used"], r["effective_ceiling"], r["remaining"]])));
117
+ out.push(rowsTable("MOTION", "motion_id", "name", body["motions"]));
118
+ out.push(rowsTable("ACCOUNT", "account_id", "account_name", body["accounts"]));
119
+ for (const fl of body["flags"] ?? []) out.push(`${fl["code"]}: ${fl["message"]}${fl["next"] ? ` (${fl["next"]})` : ""}`);
120
+ print(out.filter((x) => !!x).join("\n"));
121
+ }
122
+ function renderActivity(body) {
123
+ const out = [...windowLines(body), table(["BUDGET ROW", "USED", "FAILED", "REFUSED"], (body["types"] ?? []).map((t) => [t["budget_row"], t["used"], t["failed"], t["refused"]]))];
124
+ for (const a of body["accounts"] ?? []) out.push(`${a["account_name"] ?? a["account_id"]}: ${(a["types"] ?? []).map((t) => `${t["budget_row"]} ${t["used"]}`).join(", ")}`);
125
+ print(out.join("\n"));
126
+ }
127
+ async function runGet(c, f) {
128
+ const view = f.view ?? "motions";
129
+ if (view !== "motions" && view !== "activity") usage("--view takes motions or activity.");
130
+ if (view === "activity") {
131
+ const motionOnly = ["motion", "motions", "origin", "include", "sort", "limit", "compare", "version"].find((k) => f[k] !== void 0);
132
+ if (motionOnly) usage(`--${motionOnly} reads Motions: --view activity takes the window and --accounts only.`);
133
+ }
134
+ if (f.version !== void 0 && f.motion === void 0) usage("--version needs --motion.");
135
+ const q = { ...windowParams(f), ...filterParams(f, view === "activity" ? ["accounts"] : ["accounts", "origin"]) };
136
+ try {
137
+ if (view === "activity") {
138
+ const body2 = await c.analytics.activity(q);
139
+ return outputOpts(f).json ? renderSuccess(body2, outputOpts(f), process) : renderActivity(body2);
140
+ }
141
+ Object.assign(q, grammarParams(f));
142
+ if (f.version !== void 0) q["version"] = intFlag("version", f.version);
143
+ let body;
144
+ if (f.motion !== void 0) body = await c.analytics.motions.get(f.motion, q);
145
+ else body = await c.analytics.motions.list({ ...q, ...filterParams(f, ["motions"]) });
146
+ return outputOpts(f).json ? renderSuccess(body, outputOpts(f), process) : renderOverview(body);
147
+ } catch (err) {
148
+ await fail(err, f);
149
+ }
150
+ }
151
+ async function runEvents(c, f) {
152
+ rejectPaginationModifiersWithoutAll(f, process);
153
+ if (f.step !== void 0 && f.motion === void 0) usage("--step needs --motion: a step id names a step of one Motion.");
154
+ const q = { ...filterParams(f, ["origin"]) };
155
+ if (f.motion !== void 0) q["motion_id"] = f.motion;
156
+ if (f.step !== void 0) q["step_id"] = f.step;
157
+ if (f.contact !== void 0) q["contact_id"] = f.contact;
158
+ if (f.accounts !== void 0) q["account_id"] = listFlag("accounts", f.accounts).join(",");
159
+ if (f.kind !== void 0) q["kind"] = listFlag("kind", f.kind);
160
+ if (f.limit !== void 0) q["limit"] = intFlag("limit", f.limit, 1, 100);
161
+ const cursor = readCursorFlag(f, process);
162
+ if (cursor) q["cursor"] = cursor;
163
+ try {
164
+ if (f.all) {
165
+ const page2 = (p) => c.analytics.events.list(p);
166
+ for await (const item of streamAll(page2, q, { maxPages: readMaxPagesFlag(f, process), out: process, pageDelayMs: pageDelayFromFlags(f) })) writeNdjsonItem(process, item, f.fields);
167
+ return;
168
+ }
169
+ const page = readablePage(await c.analytics.events.list(q));
170
+ if (outputOpts(f).json) return renderSuccess(page, outputOpts(f), process);
171
+ print(table(
172
+ ["AT", "KIND", "ORIGIN", "MOTION", "STEP", "OUTCOME", "REASON", "CONTACT"],
173
+ page.items.map((e) => [e["occurred_at"], e["kind"], e["origin"], e["motion_name"], e["step_id"], e["outcome"], e["reason"] ? `${e["reason"]}: ${e["reason_message"] ?? ""}` : null, e["contact"]?.["full_name"]])
174
+ ));
175
+ if (page["cursor"]) print(`next page: --cursor ${String(page["cursor"])}`);
176
+ } catch (err) {
177
+ await fail(err, f);
178
+ }
179
+ }
180
+ var ANALYTICS_TABLES = ["daily", "accounts", "motions", "enrollments"];
181
+ var JOB_ENTITIES = ["motion_activity", "account_activity", "account_metrics"];
182
+ async function runExport(c, f) {
183
+ if (f.json) usage("export commands take no --json: pass --format json.");
184
+ const tables = f.table === void 0 ? [] : listFlag("table", f.table);
185
+ const entity = tables.length === 1 && JOB_ENTITIES.includes(tables[0]) ? tables[0] : "analytics";
186
+ if (entity !== "analytics" && !f.job) usage(`--table ${entity} is built by a background job: add --job.`);
187
+ const unknown = tables.find((t) => !ANALYTICS_TABLES.includes(t) && t !== entity);
188
+ if (unknown !== void 0) usage(`--table takes ${ANALYTICS_TABLES.join(", ")}, or one of ${JOB_ENTITIES.join(", ")} with --job.`);
189
+ const format = f.format ?? "csv";
190
+ const filters = { ...windowParams(f), ...filterParams(f, ["motions", "accounts", "origin"]) };
191
+ try {
192
+ if (f.job) {
193
+ const exp = await c.exports.create({ entity, tables: tables.length ? tables : ANALYTICS_TABLES, format, filters });
194
+ renderSuccess(exp, outputOpts(f), process);
195
+ process.stderr.write(`Export ${exp["id"]} is ${exp["status"]}. Read it with \`curviate export get ${exp["id"]}\`, then \`curviate export download ${exp["id"]} -o <file>\` once ready.
196
+ `);
197
+ return;
198
+ }
199
+ if (f.output === void 0 && process.stdout.isTTY && tables.length !== 1) usage("several tables come as one ZIP file: pass -o <file>, or one --table.");
200
+ const bytes = await downloadBinary(() => c.analytics.export({ ...filters, format, ...tables.length ? { table: tables } : {} }));
201
+ await writeExport(f.output, new Uint8Array(bytes));
202
+ } catch (err) {
203
+ await fail(err, f);
204
+ }
205
+ }
206
+ var online = (fn) => async ({ args }) => {
207
+ const f = args;
208
+ await fn(await rootClient(f), f);
209
+ };
210
+ var WINDOW_ARGS = {
211
+ from: {
212
+ type: "string",
213
+ description: "First day, YYYY-MM-DD, inclusive, in --timezone. A Motion read (with or without --motion) or an Account overview may start more than a year back: up to `window.counts_only_through` the figures come from daily counts (UTC days, no step, variant or seen detail), and `paths` cover only the days after `window.paths_through`. --view activity and the activity exports keep their own cap, named in the refusal."
214
+ },
215
+ to: { type: "string", description: "Last day, YYYY-MM-DD, inclusive, in --timezone (default today). Same rules as --from." },
216
+ range: { type: "string", description: "Instead of --from/--to: 7d, 30d, 90d, 12m or all." },
217
+ timezone: { type: "string", description: "IANA zone the days are read in (default UTC)." },
218
+ bucket: { type: "string", description: "Daily series grouping: auto, day, week or month." }
219
+ };
220
+ var FILTER_ARGS = {
221
+ accounts: { type: "string", description: "Only these Accounts: a comma list of ids (acc_...). Never filled from your profile's default Account." },
222
+ origin: { type: "string", description: "Who sent the actions: a comma list of motion, unibox, api; direct is an alias for unibox and api." }
223
+ };
224
+ var GRAMMAR_ARGS = {
225
+ include: { type: "string", description: "Sections to return, comma list (for example performance,motions,accounts,steps,variants,paths,flags)." },
226
+ sort: { type: "string", description: "Order of the Motion and Account lists, comma list of sent, acceptance.rate, reply.rate, inmail_reply.rate, last_activity_at, name; a leading - sorts descending." },
227
+ limit: { type: "string", description: "How many Motions and Accounts to return." },
228
+ compare: { type: "string", description: "previous_period: add the same number of days before --from to every rate (`previous`, `delta`)." }
229
+ };
230
+ var getCmd = defineCommand({
231
+ meta: {
232
+ name: "get",
233
+ description: "Motion outcomes over a window: invitations, acceptance, messages, reply and InMail reply as outcomes so far, with each Motion and Account. With --motion: one Motion's steps, paths and Accounts. With --view activity: the budget rows your Accounts used. Each Contact counts once per Account.",
234
+ risk: "read",
235
+ output: [
236
+ "acceptance: invitations accepted over invitations sent in the window, so far.",
237
+ "reply: people who replied over people messaged; InMail reply the same for InMails. Rates move as replies and acceptances arrive; `maturing` counts what was sent under 7 days ago and `low_sample` marks fewer than 30.",
238
+ "seen (--motion): messages read or replied over messages sent, per message step.",
239
+ "A compact table by default; --json (or piped) prints the API body."
240
+ ],
241
+ seeAlso: ["curviate analytics events list", "curviate account overview", "Judgement on reading the numbers: https://github.com/curviate/curviate-plugin"],
242
+ examples: [
243
+ "curviate analytics get --range 30d",
244
+ "curviate analytics get --motion mot_YOUR_MOTION_ID --include steps,paths --range 90d",
245
+ "curviate analytics get --view activity --from 2026-10-01 --to 2026-10-28"
246
+ ]
247
+ },
248
+ args: {
249
+ ...readOnly(READ_SINGLE_FLAGS),
250
+ view: { type: "string", description: "motions (default): Motion outcomes; activity: budget rows used, not with --motion." },
251
+ motion: { type: "string", description: "One Motion (mot_...): its steps, paths and Accounts." },
252
+ motions: { type: "string", description: "Without --motion: only these Motions, comma list (mot_...)." },
253
+ version: { type: "string", description: "With --motion: only this Sequence version." },
254
+ ...WINDOW_ARGS,
255
+ ...FILTER_ARGS,
256
+ ...GRAMMAR_ARGS
257
+ },
258
+ run: online(runGet)
259
+ });
260
+ var eventsListCmd = defineCommand({
261
+ meta: {
262
+ name: "list",
263
+ description: "The records behind the numbers, newest first: steps executed or failed, invitations accepted, replies; each reason with its sentence. Metadata only, never message text.",
264
+ risk: "read",
265
+ examples: [
266
+ "curviate analytics events list --motion mot_YOUR_MOTION_ID --step opener",
267
+ "curviate analytics events list --contact con_YOUR_CONTACT_ID --origin unibox,api --all"
268
+ ]
269
+ },
270
+ args: {
271
+ ...readOnly(GLOBAL_FLAGS),
272
+ motion: { type: "string", description: "Only this Motion's records (mot_...)." },
273
+ step: { type: "string", description: "With --motion: only this step's records." },
274
+ contact: { type: "string", description: "Only this Contact's records (con_...): its Motion records and its direct ones." },
275
+ kind: { type: "string", description: "Comma list of step.executed, step.failed, invite.accepted, message.replied." },
276
+ accounts: FILTER_ARGS.accounts,
277
+ origin: FILTER_ARGS.origin
278
+ },
279
+ run: online(runEvents)
280
+ });
281
+ var exportCmd = defineCommand({
282
+ meta: {
283
+ name: "export",
284
+ description: "Export the Analytics tables (daily, accounts, motions, enrollments) under the same window and filters: streamed now, or with --job built in the background (then `curviate export get` and `curviate export download`). One table is one file; several are one ZIP. Never message text. Owners and Managers only.",
285
+ risk: "read",
286
+ output: ["Data only on stdout or the --output file (mode 0600); with --job the export record."],
287
+ errors: { INSUFFICIENT_ROLE: "Members cannot export: ask an Owner or Manager.", EXPORT_IN_PROGRESS: "your Team already has an export running; read it with `curviate export get <export_id>`." },
288
+ seeAlso: ["curviate export get", "curviate export download"],
289
+ examples: [
290
+ "curviate analytics export --table enrollments --format csv --range 30d -o enrollments.csv",
291
+ "curviate analytics export --table daily,accounts,motions,enrollments --format csv --range 90d --job"
292
+ ]
293
+ },
294
+ args: {
295
+ "api-key": GLOBAL_FLAGS["api-key"],
296
+ profile: GLOBAL_FLAGS.profile,
297
+ team: GLOBAL_FLAGS.team,
298
+ "base-url": GLOBAL_FLAGS["base-url"],
299
+ timeout: GLOBAL_FLAGS.timeout,
300
+ table: { type: "string", description: "Comma list of daily, accounts, motions, enrollments (default all four); or, with --job, one of motion_activity, account_activity, account_metrics." },
301
+ format: { type: "string", description: "csv (default), json or ndjson (ndjson takes one table)." },
302
+ output: { type: "string", alias: "o", description: "File to write (mode 0600), or - for stdout (default)." },
303
+ job: { type: "boolean", description: "Build it in the background and print the export record instead of streaming it." },
304
+ motions: { type: "string", description: "Only these Motions, comma list (mot_...)." },
305
+ ...WINDOW_ARGS,
306
+ ...FILTER_ARGS,
307
+ json: { type: "boolean", description: "Not taken by exports: pass --format json." }
308
+ },
309
+ run: online(runExport)
310
+ });
311
+ var eventsCommand = defineCommand({
312
+ meta: { name: "events", description: "The records behind the analytics numbers." },
313
+ subCommands: { list: eventsListCmd },
314
+ async run() {
315
+ const { showHelp } = await import("./examples-DQSVIIXZ.js");
316
+ await showHelp(eventsCommand, ["curviate", "analytics", "events"]);
317
+ }
318
+ });
319
+ var analyticsCommand = defineCommand({
320
+ meta: { name: "analytics", description: DESCRIPTIONS.analytics },
321
+ subCommands: {
322
+ get: getCmd,
323
+ events: eventsCommand,
324
+ export: exportCmd
325
+ },
326
+ async run() {
327
+ const { showHelp } = await import("./examples-DQSVIIXZ.js");
328
+ await showHelp(analyticsCommand, ["curviate", "analytics"]);
329
+ }
330
+ });
331
+
332
+ export {
333
+ windowParams,
334
+ grammarParams,
335
+ renderOverview,
336
+ WINDOW_ARGS,
337
+ GRAMMAR_ARGS,
338
+ analyticsCommand
339
+ };
@@ -0,0 +1,54 @@
1
+ #!/usr/bin/env node
2
+
3
+ // src/commands/descriptions.ts
4
+ var DESCRIPTIONS = {
5
+ setup: "Connect this machine to your workspace: opens the dashboard, takes the code it shows you, and saves an API key.",
6
+ doctor: "Check that this machine can call the API: config, credential source, workspace, reachability and connected accounts.",
7
+ login: "Save an API key to a local profile. Run `curviate core profile me` to verify.",
8
+ config: "Manage CLI profiles and settings.",
9
+ account: "LinkedIn account connection management.",
10
+ motion: "Motions: one Sequence run for the Contacts of your Team's Contact lists, from its sending Accounts, paced on a schedule. Create and edit drafts, preview, start, pause, resume, archive, add or remove Contacts; lint a Sequence and write a template offline. Your Team's data: every role reads; writes need motion-send on each sending Account, and Motions need the Automate plan.",
11
+ enrollment: "Enrollments: one Contact in one Motion on one Account. List and read them; pause, resume, retry a failed Step, stop, send a custom event, reassign, or act on many at once. Your Team's data: every role reads; writes need operate on the Enrollment's Account.",
12
+ contact: "Contacts: the people in your Team's lists, not LinkedIn actions. List, read, add, change and delete them; import and export; enrich from LinkedIn profiles. Subgroups: `curviate contact lists` (Contact lists, including combining lists), `curviate contact tags`, `curviate contact imports`. Your Team's data: every role reads and writes; deleting is for Owners and Managers.",
13
+ "do-not-contact": "Do-not-contact: your Team's one list of people no Motion contacts and no write reaches (a write toward them exits 10). List, read, add, change the reason, remove. Any member adds; removing is for Owners and Managers.",
14
+ billing: "Billing: your Team's invoices, listed and downloaded as PDFs. Owners only. Seats and the Tier are under `curviate team` and `curviate tier`.",
15
+ contactImport: "Import Contacts from a CSV, JSON or NDJSON file into a Contact list, splitting a large file into several imports.",
16
+ contactImports: "Read your Team's import records: the counts, the failure, and the rows an import skipped and why.",
17
+ contactLists: "Contact lists: named sets of Contacts a Motion enrolls from. List, read, create, combine lists into a new one, rename, delete, add and remove Contacts.",
18
+ contactTags: "Tags: labels on Contacts. List, rename, delete, and add or remove one on Contacts named by id or by filter.",
19
+ unibox: "Unibox: one inbox over the chats of every Account you may operate, served from Curviate's store. List, read and count chats; reply, mark, tag the person, enroll them in a Motion; refresh. An Account shows its whole inbox only with Sync full inbox, which its own person turns on (`curviate unibox consent`); otherwise only its Motion chats.",
20
+ network: "Network: each Account's LinkedIn Connections, synced and stored by Curviate. List, export, read the sync status, ask for a resync. Your Team's data, for the Accounts you may operate.",
21
+ analytics: "Motion outcomes and the budget your Accounts used. Read-only; Motion numbers cover your Accounts and your team's shared Accounts, core activity the Accounts you may operate.",
22
+ export: "Background export jobs started by `curviate analytics export --job`: read the status, download the file. Only the person who started one can.",
23
+ tier: "Your Team's Tier now, what it bought, any trial, override or pending change, the features it includes, and early access. Every role may read it.",
24
+ team: "Teams: list yours and switch the one calls act in, read or rename it, manage members and invites, set its logo, create a Team, lend seats between your Teams. Owners and Managers manage (a Manager invites Members only); every role reads.",
25
+ incoming: "Incoming events: a private URL any tool posts to. Curviate finds the Contact in the post and moves the Enrollments waiting for that event (`until event.<name>`). Your Team's data.",
26
+ beta: "Beta consent for your Team: whether beta operations run without --beta on each call. Owners change it.",
27
+ webhook: "Webhook management and signature verification.",
28
+ core: "Curviate core: LinkedIn building blocks. Each command runs one action now, from one Account, and counts against that Account's budgets. Nothing is queued, paced or retried for you, except a Draft scheduled with `--schedule-at`, which Curviate publishes at that time (`curviate core draft create`).",
29
+ profile: "LinkedIn profile operations.",
30
+ company: "Fetch a company profile by URL, slug, or numeric id, and its sub-resources.",
31
+ job: "Classic LinkedIn job-posting operations.",
32
+ connect: "Send or manage connection invitations. Connection requests may take 10-30 seconds to appear in the recipient's received list (LinkedIn propagation delay).",
33
+ search: "Search people, companies, posts, and jobs. Also runs a pasted search URL directly.",
34
+ inbox: "Read one Account's LinkedIn message inbox, live. Every Account's chats in one inbox: `curviate unibox`.",
35
+ inboxes: "Discover LinkedIn inboxes (personal + company pages) and list their conversations. Beta. See also: `curviate core inbox` (the account's own message-thread inbox), `curviate core message send` (reply to a chat).",
36
+ message: "Send and manage LinkedIn messages. A COMPANY_ chat id (from `curviate core inboxes chats`) sends as that company page instead of yourself; see `curviate core message send --help`.",
37
+ post: "Create and manage LinkedIn posts.",
38
+ comment: "Comment-thread operations (list, add, reply, edit, delete, react).",
39
+ "sales-nav": "Beta. Sales Navigator operations. Needs the LinkedIn account's own Sales Navigator subscription; no Curviate add-on. Beta operations can require consent: an Owner enables beta with `curviate beta update --enabled true`, or pass --beta for this call.",
40
+ recruiter: "Beta. LinkedIn Recruiter operations. Needs the LinkedIn account's own Recruiter subscription; no Curviate add-on. Beta operations can require consent: an Owner enables beta with `curviate beta update --enabled true`, or pass --beta for this call.",
41
+ group: "Read LinkedIn groups: your own membership list, one group's detail, and its member roster.",
42
+ feed: "Read the connected account's LinkedIn home feed as agent-actionable posts.",
43
+ notification: "Curviate Notifications: an account that needs reconnecting, a paused Motion, a finished import, a member who left. Yours alone, per Team; list, count, mark read, archive. LinkedIn's own notification cards are under `curviate core notification`.",
44
+ coreNotification: "Read and act on LinkedIn notification cards. Curviate's own Notifications are `curviate notification`.",
45
+ draft: "Drafts and scheduled posts."
46
+ };
47
+ function lazy(name, load) {
48
+ return Object.assign(load, { description: DESCRIPTIONS[name] });
49
+ }
50
+
51
+ export {
52
+ DESCRIPTIONS,
53
+ lazy
54
+ };