@curviate/cli 0.56.0 → 0.57.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 (61) hide show
  1. package/CHANGELOG.md +36 -0
  2. package/dist/{account-ZF5NEMID.js → account-IRIYB2SG.js} +11 -11
  3. package/dist/{analytics-M7JWS67A.js → analytics-IRSCLVOL.js} +5 -5
  4. package/dist/{beta-consent-4Q2LZZQC.js → beta-consent-NQVGFZL3.js} +4 -4
  5. package/dist/{billing-LYPSX5SR.js → billing-TCTP44ZB.js} +58 -6
  6. package/dist/{chunk-UOWOKEB2.js → chunk-3B5M2RUN.js} +1 -1
  7. package/dist/{chunk-UWRWZG4N.js → chunk-3ZQNOKEK.js} +2 -2
  8. package/dist/{chunk-MWVTFTWV.js → chunk-5LGKZBAY.js} +5 -3
  9. package/dist/{chunk-XP6S6E55.js → chunk-6OT6TS7N.js} +2 -2
  10. package/dist/{chunk-J4SFOFMT.js → chunk-A6JGJGDF.js} +16 -16
  11. package/dist/{chunk-L3RJU7C3.js → chunk-AG6G3PRQ.js} +110 -13
  12. package/dist/{chunk-CRO7PJ4I.js → chunk-F7CLAS5Y.js} +2 -2
  13. package/dist/{chunk-MIOEYSBQ.js → chunk-OE4CY3ZL.js} +1 -1
  14. package/dist/{chunk-EI64VFBE.js → chunk-RTT75CXE.js} +44 -6
  15. package/dist/{chunk-7PLTQHNO.js → chunk-RXDG57B2.js} +1 -1
  16. package/dist/{chunk-RDKTHFQ6.js → chunk-SCUTAREU.js} +4 -0
  17. package/dist/{chunk-VEMK4MJM.js → chunk-VPFV7YV3.js} +5 -5
  18. package/dist/cli.js +32 -30
  19. package/dist/{comment-D6RSZTVK.js → comment-PNHEKGZX.js} +7 -7
  20. package/dist/{company-3Z6PXGTW.js → company-OUFF23SU.js} +20 -9
  21. package/dist/company-record-ULPDDB6L.js +128 -0
  22. package/dist/{config-VY5MCJMN.js → config-U6VDNL2P.js} +2 -2
  23. package/dist/{connect-G2RTLV7G.js → connect-ICNXC37R.js} +11 -11
  24. package/dist/{contact-QSLJCBDE.js → contact-K6RIVQWU.js} +9 -9
  25. package/dist/{contact-groups-OITAD73K.js → contact-groups-CNH2VB6A.js} +11 -11
  26. package/dist/{contact-import-LT7BKESC.js → contact-import-FK22UTN2.js} +10 -10
  27. package/dist/core-MPEBYNSL.js +46 -0
  28. package/dist/{do-not-contact-ZA7KS5WD.js → do-not-contact-BQHXNHTV.js} +13 -13
  29. package/dist/{doctor-JQT3DO6G.js → doctor-ZYPZF5BE.js} +21 -4
  30. package/dist/{domain-7EX4E34B.js → domain-HLOT6Y4A.js} +8 -8
  31. package/dist/{draft-7U6H4BPF.js → draft-JGQ36JSH.js} +4 -4
  32. package/dist/{enrollment-AZ6XGVVL.js → enrollment-CF634DB4.js} +9 -9
  33. package/dist/{examples-IGQJCSNL.js → examples-J4X5NEIE.js} +1 -1
  34. package/dist/{exit-codes-ZSOLAXQO.js → exit-codes-P2FLCKM7.js} +1 -1
  35. package/dist/{export-OYMQXL62.js → export-ZQLDQYUZ.js} +4 -4
  36. package/dist/{feed-M5D4SJW7.js → feed-RQHEDZVL.js} +6 -6
  37. package/dist/{group-UTC3YBKE.js → group-LRMG76FN.js} +6 -6
  38. package/dist/{inbox-VSGNHSLG.js → inbox-5RGG5RQG.js} +6 -6
  39. package/dist/{inboxes-23C2MJK4.js → inboxes-ZFY6ZP33.js} +6 -6
  40. package/dist/{incoming-QVPP32K7.js → incoming-3MJ4CP6H.js} +8 -8
  41. package/dist/{job-ZHVFFRWE.js → job-QFIUTHHT.js} +6 -6
  42. package/dist/{login-6OTNXEJZ.js → login-THXWX5HZ.js} +2 -2
  43. package/dist/{mailbox-HD2UXZCA.js → mailbox-54DPLNXA.js} +23 -16
  44. package/dist/{message-PIV77W47.js → message-DM5OUKQS.js} +6 -6
  45. package/dist/{motion-AHYF34DP.js → motion-NKOAK7NU.js} +10 -10
  46. package/dist/{network-RJHJFZEY.js → network-VKJUMZ2L.js} +8 -8
  47. package/dist/{notification-XGR4NT3S.js → notification-XW5J6KFA.js} +6 -6
  48. package/dist/{notifications-BHRWSHPR.js → notifications-USYOV54R.js} +17 -12
  49. package/dist/{post-Z7AVDDKA.js → post-M2G3BK4A.js} +7 -7
  50. package/dist/{profile-YZNBX2RP.js → profile-3SG64IEG.js} +11 -11
  51. package/dist/{recruiter-EXM4P7X7.js → recruiter-7OUGZ776.js} +6 -6
  52. package/dist/{sales-nav-CKDSEXV2.js → sales-nav-HHQLLM5C.js} +6 -6
  53. package/dist/{search-B7FB6674.js → search-5LMSLUH4.js} +14 -14
  54. package/dist/{setup-VZVPLJ4V.js → setup-6F4HYUSZ.js} +4 -4
  55. package/dist/signal-LVODDBOY.js +331 -0
  56. package/dist/{team-PYABBUHO.js → team-MSOPELF6.js} +62 -8
  57. package/dist/{tier-PRK4WQKR.js → tier-RXHOAQ6L.js} +6 -5
  58. package/dist/{unibox-ZNKX2EKL.js → unibox-UAA6WIGZ.js} +65 -12
  59. package/dist/{webhook-V74EV4E2.js → webhook-J2H7X766.js} +8 -8
  60. package/package.json +2 -2
  61. package/dist/core-RFTNNB6P.js +0 -46
@@ -2,16 +2,16 @@
2
2
  import {
3
3
  online,
4
4
  preview
5
- } from "./chunk-J4SFOFMT.js";
5
+ } from "./chunk-A6JGJGDF.js";
6
6
  import {
7
7
  sendChunked
8
- } from "./chunk-XP6S6E55.js";
8
+ } from "./chunk-6OT6TS7N.js";
9
9
  import {
10
10
  fail,
11
11
  listFlag,
12
12
  outputOpts,
13
13
  usage
14
- } from "./chunk-UWRWZG4N.js";
14
+ } from "./chunk-3ZQNOKEK.js";
15
15
  import {
16
16
  intFlag
17
17
  } from "./chunk-NNV2OYEF.js";
@@ -23,14 +23,14 @@ import {
23
23
  readablePage,
24
24
  rejectPaginationModifiersWithoutAll,
25
25
  streamAll
26
- } from "./chunk-MIOEYSBQ.js";
26
+ } from "./chunk-OE4CY3ZL.js";
27
27
  import {
28
28
  renderSuccess,
29
29
  writeNdjsonItem
30
30
  } from "./chunk-QM57YDJE.js";
31
31
  import {
32
32
  withWireNotes
33
- } from "./chunk-7PLTQHNO.js";
33
+ } from "./chunk-RXDG57B2.js";
34
34
  import {
35
35
  GLOBAL_FLAGS,
36
36
  WRITE_SINGLE_FLAGS,
@@ -194,7 +194,66 @@ async function recover(c, body, rows, seen, started, notes, err, k, n) {
194
194
  say(`Import ${k} of ${n}: the API did apply it. Import ${found.id} is ${found.status}${found.status === "completed" ? ` (${COUNTS.map((x) => `${x} ${found.counts?.[x] ?? 0}`).join(", ")})` : ""}.`);
195
195
  return found;
196
196
  }
197
+ var SOURCE_KINDS = ["people_search", "company_people", "sales_nav_search", "sales_nav_lead_list", "recruiter_search", "post_engagers", "group_members"];
198
+ function kindOfUrl(url) {
199
+ if (/linkedin\.com\/sales\//i.test(url)) return "sales_nav_search";
200
+ if (/linkedin\.com\/talent\//i.test(url)) return "recruiter_search";
201
+ if (/\/search\/results\/people/i.test(url)) return "people_search";
202
+ if (/\/search\/results\/companies/i.test(url)) return "company_people";
203
+ return void 0;
204
+ }
205
+ async function runSourceImport(c, f) {
206
+ if (f.file !== void 0) usage("--file and --source/--source-url cannot be combined: import a file, or a LinkedIn source.");
207
+ const url = f["source-url"];
208
+ const kind = f.source ?? (url !== void 0 ? kindOfUrl(url) : void 0);
209
+ if (kind === void 0) usage("--source is required: the URL names no kind it knows. One of " + SOURCE_KINDS.join(", ") + ".");
210
+ if (f.account === void 0 || f.account.trim() === "") usage("--account is required: the Account that reads the source (acc_...). Its limits and Active hours apply.");
211
+ if (f.continue !== void 0 && f.restart) usage("--continue and --restart cannot be combined.");
212
+ const source = { kind, account_id: f.account };
213
+ if (url !== void 0) source["url"] = url;
214
+ const pairs = listFlag("filter", f.filter);
215
+ if (pairs.length && f["filters-json"] !== void 0) usage("--filter and --filters-json cannot be combined.");
216
+ if (f["filters-json"] !== void 0) {
217
+ try {
218
+ source["filters"] = JSON.parse(f["filters-json"]);
219
+ } catch {
220
+ usage(`--filters-json is not valid JSON: pass an object, for example '{"keywords":"cto"}'.`);
221
+ }
222
+ } else if (pairs.length) {
223
+ const filters = {};
224
+ for (const p of pairs) {
225
+ const eq = p.indexOf("=");
226
+ if (eq <= 0) usage("--filter takes key=value, for example --filter keywords=cto.");
227
+ const k = p.slice(0, eq), v = p.slice(eq + 1);
228
+ filters[k] = k in filters ? [filters[k], v].flat() : v;
229
+ }
230
+ source["filters"] = filters;
231
+ }
232
+ if (f["list-id"] !== void 0) source["list_id"] = f["list-id"];
233
+ if (f["post-id"] !== void 0) source["post_id"] = f["post-id"];
234
+ if (f["group-id"] !== void 0) source["group_id"] = f["group-id"];
235
+ const titles = listFlag("titles", f.titles);
236
+ if (titles.length) source["titles"] = titles;
237
+ if (f.max !== void 0) source["max"] = intFlag("max", f.max, 1);
238
+ const body = { source };
239
+ if (f.continue !== void 0) body["continue_from"] = f.continue;
240
+ if (f.restart) body["restart"] = true;
241
+ if (f.list !== void 0) body["list_id"] = f.list;
242
+ if (f["list-name"] !== void 0) body["list_name"] = f["list-name"];
243
+ const tags = listFlag("tag", f.tag);
244
+ if (tags.length) body["tags"] = tags;
245
+ if (f.preview) return preview("leads.imports.create", {}, body);
246
+ try {
247
+ const imp = await c.leads.imports.create(body);
248
+ renderSuccess(readableObject(imp), outputOpts(f), process);
249
+ if (!outputOpts(f).json) process.stderr.write(`Follow it with \`curviate lead imports get ${String(imp["id"])}\`; pause, resume or stop it with \`curviate lead imports pause|resume|stop\`.
250
+ `);
251
+ } catch (err) {
252
+ await fail(err, f);
253
+ }
254
+ }
197
255
  async function runImport(c, f) {
256
+ if (f.source !== void 0 || f["source-url"] !== void 0) return runSourceImport(c, f);
198
257
  const file = f.file;
199
258
  if (file === void 0 || file.trim() === "") usage("--file is required: a CSV, JSON or NDJSON file, or - for stdin.");
200
259
  const dash = isStdinToken(file);
@@ -294,19 +353,21 @@ var importCmd = defineCommand({
294
353
  IMPORT_QUEUE_FULL: "too many imports are queued (429); wait, then run it again.",
295
354
  RATE_LIMIT_TENANT: `the Team has other Lead or Campaign writes running (429, nothing imported); the CLI waits Retry-After (up to ${RETRY_AFTER_BOUND_S} s) and sends again, a longer wait stops the run. When an import holds the Team's write lock, the message and \`details.import_id\` name it: read it with \`curviate lead imports get\`.`,
296
355
  CLIENT_TIMEOUT: "no answer within --timeout; the CLI reads the Team's newest imports (again for up to 30 s while none shows) and reports the import this request made. None found: nothing was imported so far, but read `curviate lead imports list` before running it again.",
297
- NAME_TAKEN: "--list-name names a list that exists."
356
+ NAME_TAKEN: "--list-name names a list that exists.",
357
+ IMPORT_STATUS_CONFLICT: "an import of this source is still queued, running or paused: resume or stop it, or pass --restart.",
358
+ IMPORT_CANNOT_CONTINUE: "--continue names an import that read LinkedIn's last results for its search: narrow the search or split it."
298
359
  },
299
360
  output: ["With --json stdout is exactly one JSON document; progress and waits go to stderr. One report: `imports` (id and status each), `total_rows`, summed `counts` (created, updated, unchanged, skipped) and `skipped` rows with their number in the file, a reason and the field. With --async (or --no-wait): the imports' ids and statuses only, printed as soon as each is accepted; a queued one's progress is `curviate lead imports get IMPORT_ID` (stderr names it)."],
300
361
  seeAlso: ["curviate lead imports get", "curviate lead list"],
301
362
  examples: [
302
363
  'curviate lead import --file prospects.csv --list-name "Q4 prospects" --tag conference',
303
- "curviate lead import --file leads-export.csv --apply-lists --async",
304
- "curviate lead import --file - --format ndjson --list cl_YOUR_LIST_ID"
364
+ 'curviate lead import --source-url "https://www.linkedin.com/search/results/people/?keywords=cto" --account acc_YOUR_ACCOUNT_ID --max 200 --list-name CTOs',
365
+ "curviate lead import --source company_people --filter keywords=fintech --titles CTO,VP Engineering --account acc_YOUR_ACCOUNT_ID"
305
366
  ]
306
367
  },
307
368
  args: {
308
369
  ...WRITE_SINGLE_FLAGS,
309
- file: { type: "string", stdinArg: true, required: true, description: "The file: a path, or - to read it from stdin (then --format is required)." },
370
+ file: { type: "string", stdinArg: true, description: "The file: a path, or - to read it from stdin (then --format is required). Not with --source." },
310
371
  format: { type: "string", description: "csv | json | ndjson. Default: from the file extension (.csv, .json, .ndjson)." },
311
372
  list: { type: "string", description: "Add every imported Lead to this Lead list (cl_...)." },
312
373
  "list-name": { type: "string", description: "Add them to the list of this name (up to 100 characters), creating it. Not with --list." },
@@ -316,7 +377,18 @@ var importCmd = defineCommand({
316
377
  map: { type: "string", description: 'Map a file header to a Lead field: header=target, for example "LinkedIn Profile=linkedin_url"; repeatable.' },
317
378
  delimiter: { type: "string", description: "A CSV's separator: comma, semicolon or tab. Default: found by the server." },
318
379
  async: { type: "boolean", description: "Print the imports' ids as soon as each is accepted and exit 0, without waiting for them to finish; follow one with `curviate lead imports get IMPORT_ID`. Stops only on a refused request." },
319
- "no-wait": { type: "boolean", description: "Same as --async." }
380
+ "no-wait": { type: "boolean", description: "Same as --async." },
381
+ source: { type: "string", description: "Import from LinkedIn instead of a file: people_search, sales_nav_search, recruiter_search (a pasted --source-url or --filter), company_people (a company search plus --titles), sales_nav_lead_list (--list-id), post_engagers (--post-id) or group_members (--group-id). Default with --source-url: the kind the URL names." },
382
+ "source-url": { type: "string", description: "A pasted LinkedIn search URL (people, Sales Navigator, Recruiter or company search)." },
383
+ filter: { type: "string", description: "A built search instead of a URL: key=value, repeatable (a key given twice becomes a list). The keys are the kind's search filters." },
384
+ "filters-json": { type: "string", description: "The built search as one JSON object. Not with --filter." },
385
+ "list-id": { type: "string", description: "The Sales Navigator lead list id (sales_nav_lead_list)." },
386
+ "post-id": { type: "string", description: "The post id or URL (post_engagers)." },
387
+ "group-id": { type: "string", description: "A LinkedIn group id the Account belongs to (group_members)." },
388
+ titles: { type: "string", description: "Job titles to keep, repeatable or a comma list (company_people: required)." },
389
+ max: { type: "string", description: "Stop after this many people (default and maximum: the kind's cap)." },
390
+ continue: { type: "string", description: "Continue this earlier import of the same source (imp_...) from where it stopped." },
391
+ restart: { type: "boolean", description: "Read the source from the beginning, even when an earlier import of it could continue." }
320
392
  },
321
393
  run: online(runImport)
322
394
  });
@@ -345,7 +417,7 @@ var importsList = defineCommand({
345
417
  var importsGet = defineCommand({
346
418
  meta: {
347
419
  name: "get",
348
- description: "One import: its status, counts, the columns it mapped or ignored, and its failure. With --outcome, its rows instead: one per row of the file with what happened (created, updated, unchanged, skipped), the reason and the field. Import records are kept for a limited time.",
420
+ description: "One import: its status, counts, the columns it mapped or ignored, and its failure; an import from a LinkedIn source also carries `waiting` (why no page is read now: active_hours, budget or pushback, with `until`) and `estimate`. With --outcome, its rows instead: one per row of the file with what happened (created, updated, unchanged, skipped), the reason and the field. Import records are kept for a limited time.",
349
421
  risk: "read",
350
422
  examples: ["curviate lead imports get imp_YOUR_IMPORT_ID", "curviate lead imports get imp_YOUR_IMPORT_ID --outcome skipped"]
351
423
  },
@@ -374,12 +446,37 @@ var importsGet = defineCommand({
374
446
  }
375
447
  })
376
448
  });
449
+ var control = (name, description, changes, undo, conflict) => defineCommand({
450
+ meta: {
451
+ name,
452
+ description,
453
+ risk: "write",
454
+ rules: { changes, visible_to: "Your Team.", budget_rows: [], retry: "A repeat answers IMPORT_STATUS_CONFLICT; nothing changes.", undo },
455
+ errors: { IMPORT_STATUS_CONFLICT: conflict, TIER_REQUIRED: "your plan does not include imports from LinkedIn (Automate)." },
456
+ seeAlso: ["curviate lead imports get"],
457
+ examples: [`curviate lead imports ${name} imp_YOUR_IMPORT_ID`]
458
+ },
459
+ args: { ...WRITE_SINGLE_FLAGS, id: ID },
460
+ run: online(async (c, f) => {
461
+ const id = String(f.id ?? "");
462
+ if (id.trim() === "") usage("the import id is required (imp_...).");
463
+ if (f.preview) return preview(`leads.imports.${name}`, { id });
464
+ try {
465
+ renderSuccess(readableObject(await c.leads.imports[name](id)), outputOpts(f), process);
466
+ } catch (err) {
467
+ await fail(err, f);
468
+ }
469
+ })
470
+ });
471
+ var importsPause = control("pause", "Pause an import from a LinkedIn source: no page is read until it resumes; the Account is free for its next import meanwhile.", "The import stops reading pages until resumed.", "`curviate lead imports resume IMPORT_ID`.", "the import is not queued or running.");
472
+ var importsResume = control("resume", "Resume a paused import: it reads on from where it stopped, after the Account's running import if there is one, at the same pace.", "The import reads pages again.", "`curviate lead imports pause IMPORT_ID`.", "the import is not paused.");
473
+ var importsStop = control("stop", "Stop an import for good: the people found so far stay and the position is kept, so `curviate lead import --source ... --continue IMPORT_ID` reads on from there.", "The import ends; its Leads stay.", "None for this import; continue it with a new import and --continue.", "the import has finished.");
377
474
  var contactImportCommand = importCmd;
378
475
  var contactImportsCommand = defineCommand({
379
476
  meta: { name: "imports", description: "Your Team's import records." },
380
- subCommands: { list: importsList, get: importsGet },
477
+ subCommands: { list: importsList, get: importsGet, pause: importsPause, resume: importsResume, stop: importsStop },
381
478
  async run() {
382
- const { showHelp } = await import("./examples-IGQJCSNL.js");
479
+ const { showHelp } = await import("./examples-J4X5NEIE.js");
383
480
  await showHelp(contactImportsCommand, ["curviate", "lead", "imports"]);
384
481
  }
385
482
  });
@@ -1,13 +1,13 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  readablePage
4
- } from "./chunk-MIOEYSBQ.js";
4
+ } from "./chunk-OE4CY3ZL.js";
5
5
  import {
6
6
  assertNoStdinPlaceholder
7
7
  } from "./chunk-ZYURL5VK.js";
8
8
  import {
9
9
  getExitCode
10
- } from "./chunk-RDKTHFQ6.js";
10
+ } from "./chunk-SCUTAREU.js";
11
11
 
12
12
  // src/lib/path-safety.ts
13
13
  var UNSAFE_CHARS = /[\u0000-\u0020\u007F/\\?#%]/;
@@ -5,7 +5,7 @@ import {
5
5
  } from "./chunk-QM57YDJE.js";
6
6
  import {
7
7
  isPlainObject
8
- } from "./chunk-7PLTQHNO.js";
8
+ } from "./chunk-RXDG57B2.js";
9
9
 
10
10
  // src/lib/paginate.ts
11
11
  import { CurviateError } from "@curviate/sdk";
@@ -13,7 +13,7 @@ import {
13
13
  outputOpts,
14
14
  rootClient,
15
15
  usage
16
- } from "./chunk-UWRWZG4N.js";
16
+ } from "./chunk-3ZQNOKEK.js";
17
17
  import {
18
18
  intFlag
19
19
  } from "./chunk-NNV2OYEF.js";
@@ -24,14 +24,14 @@ import {
24
24
  readablePage,
25
25
  rejectPaginationModifiersWithoutAll,
26
26
  streamAll
27
- } from "./chunk-MIOEYSBQ.js";
27
+ } from "./chunk-OE4CY3ZL.js";
28
28
  import {
29
29
  renderSuccess,
30
30
  writeNdjsonItem
31
31
  } from "./chunk-QM57YDJE.js";
32
32
  import {
33
33
  downloadBinary
34
- } from "./chunk-7PLTQHNO.js";
34
+ } from "./chunk-RXDG57B2.js";
35
35
  import {
36
36
  GLOBAL_FLAGS,
37
37
  READ_SINGLE_FLAGS,
@@ -39,7 +39,7 @@ import {
39
39
  } from "./chunk-QLKGOIWS.js";
40
40
  import {
41
41
  DESCRIPTIONS
42
- } from "./chunk-MWVTFTWV.js";
42
+ } from "./chunk-5LGKZBAY.js";
43
43
 
44
44
  // src/commands/analytics.ts
45
45
  import { defineCommand } from "citty";
@@ -321,19 +321,57 @@ var eventsCommand = defineCommand({
321
321
  meta: { name: "events", description: "The records behind the analytics numbers." },
322
322
  subCommands: { list: eventsListCmd },
323
323
  async run() {
324
- const { showHelp } = await import("./examples-IGQJCSNL.js");
324
+ const { showHelp } = await import("./examples-J4X5NEIE.js");
325
325
  await showHelp(eventsCommand, ["curviate", "analytics", "events"]);
326
326
  }
327
327
  });
328
+ async function runEmail(c, f) {
329
+ const q = { ...windowParams(f), ...filterParams(f, ["campaigns", "accounts"]) };
330
+ if (f.include !== void 0) q["include"] = listFlag("include", f.include);
331
+ try {
332
+ const body = await c.analytics.email(q);
333
+ if (outputOpts(f).json) return renderSuccess(body, outputOpts(f), process);
334
+ const today = body["today"];
335
+ print(`sent ${String(body["sent"] ?? "-")} \xB7 reply ${rate(body["reply"], "replied", "first_emailed")} \xB7 open ${body["open"] == null ? "not tracked" : rate(body["open"], "opened", "tracked")} \xB7 bounce ${rate(body["bounce"], "bounced", "sent")} \xB7 opt-out ${rate(body["opt_out"], "opted_out", "first_emailed")}`);
336
+ if (today) print(`today: ${String(today["sent"])} sent of a ${String(today["cap"])} daily cap`);
337
+ if (body["tracking"] !== "set_up") print(`open tracking: ${String(body["tracking"])} (set it up on the Mailboxes for an open rate over every email)`);
338
+ } catch (err) {
339
+ await fail(err, f);
340
+ }
341
+ }
342
+ var emailCmd = defineCommand({
343
+ meta: {
344
+ name: "email",
345
+ description: "Email results of your Campaigns over a window: emails sent, and the reply, open, bounce and opt-out rates with their counts, today's sending against the Mailboxes' daily caps and the daily series. Read from what Curviate recorded per send: no email or inbox is read.",
346
+ risk: "read",
347
+ output: [
348
+ "reply: Leads first emailed in the window whose first reply, by email or on LinkedIn, came after that email, so far; an out-of-office reply is never a reply.",
349
+ "open: opened over tracked emails; null when no Mailbox in scope tracks opens (`tracking`).",
350
+ "bounce: bounced over sent. opt-out: Leads who opted out over Leads first emailed.",
351
+ "--include weeks adds the reply rate by week of first email. A compact line by default; --json (or piped) prints the API body."
352
+ ],
353
+ seeAlso: ["curviate analytics get", "curviate mailbox list"],
354
+ examples: ["curviate analytics email --range 30d", "curviate analytics email --campaigns mot_YOUR_CAMPAIGN_ID --include weeks --json"]
355
+ },
356
+ args: {
357
+ ...readOnly(READ_SINGLE_FLAGS),
358
+ campaigns: { type: "string", description: "Only these Campaigns, comma list (mot_...)." },
359
+ ...WINDOW_ARGS,
360
+ accounts: FILTER_ARGS.accounts,
361
+ include: { type: "string", description: "Sections to add: weeks (the reply rate by week of first email)." }
362
+ },
363
+ run: online(runEmail)
364
+ });
328
365
  var analyticsCommand = defineCommand({
329
366
  meta: { name: "analytics", description: DESCRIPTIONS.analytics },
330
367
  subCommands: {
331
368
  get: getCmd,
369
+ email: emailCmd,
332
370
  events: eventsCommand,
333
371
  export: exportCmd
334
372
  },
335
373
  async run() {
336
- const { showHelp } = await import("./examples-IGQJCSNL.js");
374
+ const { showHelp } = await import("./examples-J4X5NEIE.js");
337
375
  await showHelp(analyticsCommand, ["curviate", "analytics"]);
338
376
  }
339
377
  });
@@ -274,7 +274,7 @@ import { AsyncLocalStorage } from "async_hooks";
274
274
  import { Curviate, CurviateError as CurviateError2 } from "@curviate/sdk";
275
275
 
276
276
  // package.json
277
- var version = "0.56.0";
277
+ var version = "0.57.0";
278
278
 
279
279
  // src/lib/client.ts
280
280
  function headerStrings(headers) {
@@ -215,6 +215,9 @@ var EXIT_CODE_MAP = {
215
215
  RESOURCE_IN_USE: 2,
216
216
  LEAD_LIMIT_REACHED: 2,
217
217
  IMPORT_QUEUE_FULL: 6,
218
+ // Import control: the import's status forbids it, or a continue has nothing left; never succeeds as sent.
219
+ IMPORT_STATUS_CONFLICT: 2,
220
+ IMPORT_CANNOT_CONTINUE: 2,
218
221
  // Campaigns and Enrollments. Every refusal but one never succeeds as
219
222
  // sent (2): fix the document, merge the newer Sequence, or pick another
220
223
  // Enrollment or Account. STEP_IN_FLIGHT settles within a minute (7, the
@@ -231,6 +234,7 @@ var EXIT_CODE_MAP = {
231
234
  KNOWN_CHAT: 2,
232
235
  LEAD_NOT_ENROLLABLE: 2,
233
236
  CHAT_NOT_ONE_TO_ONE: 2,
237
+ REPLY_NOT_LABELLABLE: 2,
234
238
  STEP_IN_FLIGHT: 7,
235
239
  // Voice clips: the file is empty, not audio, undecodable or outside 1 to 120 seconds; it never succeeds as sent.
236
240
  VOICE_CLIP_INVALID: 2,
@@ -21,14 +21,14 @@ import {
21
21
  } from "./chunk-VHNF6OZD.js";
22
22
  import {
23
23
  requireAccount
24
- } from "./chunk-CRO7PJ4I.js";
24
+ } from "./chunk-F7CLAS5Y.js";
25
25
  import {
26
26
  buildPreviewOutput
27
27
  } from "./chunk-TCUYH5GO.js";
28
28
  import {
29
29
  readableId,
30
30
  readableObject
31
- } from "./chunk-MIOEYSBQ.js";
31
+ } from "./chunk-OE4CY3ZL.js";
32
32
  import {
33
33
  renderError,
34
34
  renderSuccess,
@@ -38,7 +38,7 @@ import {
38
38
  createClient,
39
39
  downloadBinary,
40
40
  resolveEffectiveConfig
41
- } from "./chunk-7PLTQHNO.js";
41
+ } from "./chunk-RXDG57B2.js";
42
42
  import {
43
43
  READ_SINGLE_FLAGS,
44
44
  WRITE_FLAGS,
@@ -46,7 +46,7 @@ import {
46
46
  } from "./chunk-QLKGOIWS.js";
47
47
  import {
48
48
  DESCRIPTIONS
49
- } from "./chunk-MWVTFTWV.js";
49
+ } from "./chunk-5LGKZBAY.js";
50
50
  import {
51
51
  looksLikeCommandWord,
52
52
  nearestSubcommand
@@ -153,7 +153,7 @@ var MEMBER_PROVIDER_ID_RE = /^A[CDE][A-Za-z0-9_-]{4,}$/;
153
153
  async function handleSdkError(err, outOpts, out) {
154
154
  const { CurviateError } = await import("@curviate/sdk");
155
155
  if (err instanceof CurviateError) {
156
- const { getExitCode } = await import("./exit-codes-ZSOLAXQO.js");
156
+ const { getExitCode } = await import("./exit-codes-P2FLCKM7.js");
157
157
  renderError(err, outOpts, out);
158
158
  process.exit(getExitCode(err));
159
159
  }
package/dist/cli.js CHANGED
@@ -1,10 +1,10 @@
1
1
  #!/usr/bin/env node
2
- import {
3
- SECRET_FLAGS
4
- } from "./chunk-TCUYH5GO.js";
5
2
  import {
6
3
  intFlag
7
4
  } from "./chunk-NNV2OYEF.js";
5
+ import {
6
+ SECRET_FLAGS
7
+ } from "./chunk-TCUYH5GO.js";
8
8
  import {
9
9
  GLOBAL_FLAGS,
10
10
  STATE_WRITES,
@@ -15,7 +15,7 @@ import {
15
15
  } from "./chunk-QLKGOIWS.js";
16
16
  import {
17
17
  lazy
18
- } from "./chunk-MWVTFTWV.js";
18
+ } from "./chunk-5LGKZBAY.js";
19
19
  import {
20
20
  editDistance
21
21
  } from "./chunk-FDJMAF7D.js";
@@ -45,35 +45,37 @@ var main = defineCommand({
45
45
  // Subcommand registry, names and descriptions are static for help rendering;
46
46
  // the handler implementation is loaded lazily on first invocation.
47
47
  subCommands: {
48
- setup: lazy("setup", () => import("./setup-VZVPLJ4V.js").then((m) => m.setupCommand)),
49
- doctor: lazy("doctor", () => import("./doctor-JQT3DO6G.js").then((m) => m.doctorCommand)),
50
- login: lazy("login", () => import("./login-6OTNXEJZ.js").then((m) => m.loginCommand)),
51
- config: lazy("config", () => import("./config-VY5MCJMN.js").then((m) => m.configCommand)),
52
- account: lazy("account", () => import("./account-ZF5NEMID.js").then((m) => m.accountCommand)),
53
- campaign: lazy("campaign", () => import("./motion-AHYF34DP.js").then((m) => m.campaignCommand)),
54
- enrollment: lazy("enrollment", () => import("./enrollment-AZ6XGVVL.js").then((m) => m.enrollmentCommand)),
55
- lead: lazy("lead", () => import("./contact-QSLJCBDE.js").then((m) => m.contactCommand)),
56
- "do-not-contact": lazy("do-not-contact", () => import("./do-not-contact-ZA7KS5WD.js").then((m) => m.doNotContactCommand)),
57
- mailbox: lazy("mailbox", () => import("./mailbox-HD2UXZCA.js").then((m) => m.mailboxCommand)),
58
- domain: lazy("domain", () => import("./domain-7EX4E34B.js").then((m) => m.domainCommand)),
59
- unibox: lazy("unibox", () => import("./unibox-ZNKX2EKL.js").then((m) => m.uniboxCommand)),
60
- network: lazy("network", () => import("./network-RJHJFZEY.js").then((m) => m.networkCommand)),
61
- analytics: lazy("analytics", () => import("./analytics-M7JWS67A.js").then((m) => m.analyticsCommand)),
62
- notification: lazy("notification", () => import("./notifications-BHRWSHPR.js").then((m) => m.notificationsCommand)),
63
- export: lazy("export", () => import("./export-OYMQXL62.js").then((m) => m.exportCommand)),
64
- billing: lazy("billing", () => import("./billing-LYPSX5SR.js").then((m) => m.billingCommand)),
65
- tier: lazy("tier", () => import("./tier-PRK4WQKR.js").then((m) => m.tierCommand)),
66
- team: lazy("team", () => import("./team-PYABBUHO.js").then((m) => m.teamCommand)),
67
- incoming: lazy("incoming", () => import("./incoming-QVPP32K7.js").then((m) => m.incomingCommand)),
68
- beta: lazy("beta", () => import("./beta-consent-4Q2LZZQC.js").then((m) => m.betaCommand)),
69
- webhook: lazy("webhook", () => import("./webhook-V74EV4E2.js").then((m) => m.webhookCommand)),
48
+ setup: lazy("setup", () => import("./setup-6F4HYUSZ.js").then((m) => m.setupCommand)),
49
+ doctor: lazy("doctor", () => import("./doctor-ZYPZF5BE.js").then((m) => m.doctorCommand)),
50
+ login: lazy("login", () => import("./login-THXWX5HZ.js").then((m) => m.loginCommand)),
51
+ config: lazy("config", () => import("./config-U6VDNL2P.js").then((m) => m.configCommand)),
52
+ account: lazy("account", () => import("./account-IRIYB2SG.js").then((m) => m.accountCommand)),
53
+ campaign: lazy("campaign", () => import("./motion-NKOAK7NU.js").then((m) => m.campaignCommand)),
54
+ enrollment: lazy("enrollment", () => import("./enrollment-CF634DB4.js").then((m) => m.enrollmentCommand)),
55
+ lead: lazy("lead", () => import("./contact-K6RIVQWU.js").then((m) => m.contactCommand)),
56
+ company: lazy("companyRecord", () => import("./company-record-ULPDDB6L.js").then((m) => m.companyRecordCommand)),
57
+ signal: lazy("signal", () => import("./signal-LVODDBOY.js").then((m) => m.signalCommand)),
58
+ "do-not-contact": lazy("do-not-contact", () => import("./do-not-contact-BQHXNHTV.js").then((m) => m.doNotContactCommand)),
59
+ mailbox: lazy("mailbox", () => import("./mailbox-54DPLNXA.js").then((m) => m.mailboxCommand)),
60
+ domain: lazy("domain", () => import("./domain-HLOT6Y4A.js").then((m) => m.domainCommand)),
61
+ unibox: lazy("unibox", () => import("./unibox-UAA6WIGZ.js").then((m) => m.uniboxCommand)),
62
+ network: lazy("network", () => import("./network-VKJUMZ2L.js").then((m) => m.networkCommand)),
63
+ analytics: lazy("analytics", () => import("./analytics-IRSCLVOL.js").then((m) => m.analyticsCommand)),
64
+ notification: lazy("notification", () => import("./notifications-USYOV54R.js").then((m) => m.notificationsCommand)),
65
+ export: lazy("export", () => import("./export-ZQLDQYUZ.js").then((m) => m.exportCommand)),
66
+ billing: lazy("billing", () => import("./billing-TCTP44ZB.js").then((m) => m.billingCommand)),
67
+ tier: lazy("tier", () => import("./tier-RXHOAQ6L.js").then((m) => m.tierCommand)),
68
+ team: lazy("team", () => import("./team-MSOPELF6.js").then((m) => m.teamCommand)),
69
+ incoming: lazy("incoming", () => import("./incoming-3MJ4CP6H.js").then((m) => m.incomingCommand)),
70
+ beta: lazy("beta", () => import("./beta-consent-NQVGFZL3.js").then((m) => m.betaCommand)),
71
+ webhook: lazy("webhook", () => import("./webhook-J2H7X766.js").then((m) => m.webhookCommand)),
70
72
  // The LinkedIn building blocks. Reserved product groups
71
73
  // (unibox, network, analytics, team) land
72
74
  // between `enrollment` and `webhook` with their owning specs.
73
- core: lazy("core", () => import("./core-RFTNNB6P.js").then((m) => m.coreCommand))
75
+ core: lazy("core", () => import("./core-MPEBYNSL.js").then((m) => m.coreCommand))
74
76
  },
75
77
  async run() {
76
- const { showHelp } = await import("./examples-IGQJCSNL.js");
78
+ const { showHelp } = await import("./examples-J4X5NEIE.js");
77
79
  await showHelp(main, ["curviate"]);
78
80
  }
79
81
  });
@@ -365,7 +367,7 @@ async function dispatch(root, rawArgs) {
365
367
  helpFor = "curviate";
366
368
  if (rawArgs.includes("--help") || rawArgs.includes("-h")) {
367
369
  const { leaf, path } = await resolveLeaf(root, rawArgs.filter((a) => a !== "--help" && a !== "-h"));
368
- const { showHelp } = await import("./examples-IGQJCSNL.js");
370
+ const { showHelp } = await import("./examples-J4X5NEIE.js");
369
371
  await showHelp(leaf, path);
370
372
  await new Promise((done) => process.stdout.write("", () => done()));
371
373
  process.exit(0);
@@ -453,7 +455,7 @@ async function dispatch(root, rawArgs) {
453
455
  if (code === "EARG") process.stderr.write(helpPointer());
454
456
  const { CurviateError } = await import("@curviate/sdk");
455
457
  if (err instanceof CurviateError) {
456
- const { getExitCode } = await import("./exit-codes-ZSOLAXQO.js");
458
+ const { getExitCode } = await import("./exit-codes-P2FLCKM7.js");
457
459
  process.exit(getExitCode(err));
458
460
  }
459
461
  process.exit(code === "EARG" ? 2 : 1);
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  resolveMemberOrMeProviderId
4
- } from "./chunk-UOWOKEB2.js";
4
+ } from "./chunk-3B5M2RUN.js";
5
5
  import "./chunk-UEAX6KUB.js";
6
6
  import {
7
7
  AS_ACCOUNT,
@@ -16,7 +16,7 @@ import {
16
16
  } from "./chunk-VHNF6OZD.js";
17
17
  import {
18
18
  requireAccount
19
- } from "./chunk-CRO7PJ4I.js";
19
+ } from "./chunk-F7CLAS5Y.js";
20
20
  import {
21
21
  buildPreviewOutput
22
22
  } from "./chunk-TCUYH5GO.js";
@@ -27,7 +27,7 @@ import {
27
27
  readablePage,
28
28
  rejectPaginationModifiersWithoutAll,
29
29
  streamAll
30
- } from "./chunk-MIOEYSBQ.js";
30
+ } from "./chunk-OE4CY3ZL.js";
31
31
  import {
32
32
  renderError,
33
33
  renderSuccess,
@@ -37,7 +37,7 @@ import {
37
37
  import {
38
38
  createClient,
39
39
  resolveEffectiveConfig
40
- } from "./chunk-7PLTQHNO.js";
40
+ } from "./chunk-RXDG57B2.js";
41
41
  import {
42
42
  GLOBAL_FLAGS,
43
43
  WRITE_SINGLE_FLAGS,
@@ -45,11 +45,11 @@ import {
45
45
  } from "./chunk-QLKGOIWS.js";
46
46
  import {
47
47
  DESCRIPTIONS
48
- } from "./chunk-MWVTFTWV.js";
48
+ } from "./chunk-5LGKZBAY.js";
49
49
  import {
50
50
  resolveTextOrStdin
51
51
  } from "./chunk-ZYURL5VK.js";
52
- import "./chunk-RDKTHFQ6.js";
52
+ import "./chunk-SCUTAREU.js";
53
53
 
54
54
  // src/commands/comment.ts
55
55
  import { defineCommand } from "citty";
@@ -78,7 +78,7 @@ function buildListQuery(flags, out) {
78
78
  async function handleSdkError(err, outOpts, out) {
79
79
  const { CurviateError } = await import("@curviate/sdk");
80
80
  if (err instanceof CurviateError) {
81
- const { getExitCode } = await import("./exit-codes-ZSOLAXQO.js");
81
+ const { getExitCode } = await import("./exit-codes-P2FLCKM7.js");
82
82
  renderError(err, outOpts, out);
83
83
  process.exit(getExitCode(err));
84
84
  }
@@ -1,7 +1,12 @@
1
1
  #!/usr/bin/env node
2
+ import {
3
+ RETRIEVAL_FLAGS,
4
+ hasRetrievalFlags,
5
+ parseRetrievalFlags
6
+ } from "./chunk-L7JH3W56.js";
2
7
  import {
3
8
  sentAsNotice
4
- } from "./chunk-VEMK4MJM.js";
9
+ } from "./chunk-VPFV7YV3.js";
5
10
  import "./chunk-UWO2D4HW.js";
6
11
  import {
7
12
  resolveIdentifier
@@ -26,7 +31,7 @@ import {
26
31
  } from "./chunk-VHNF6OZD.js";
27
32
  import {
28
33
  requireAccount
29
- } from "./chunk-CRO7PJ4I.js";
34
+ } from "./chunk-F7CLAS5Y.js";
30
35
  import {
31
36
  buildPreviewOutput
32
37
  } from "./chunk-TCUYH5GO.js";
@@ -39,7 +44,7 @@ import {
39
44
  readablePage,
40
45
  rejectPaginationModifiersWithoutAll,
41
46
  streamAll
42
- } from "./chunk-MIOEYSBQ.js";
47
+ } from "./chunk-OE4CY3ZL.js";
43
48
  import {
44
49
  renderError,
45
50
  renderSuccess,
@@ -49,7 +54,7 @@ import {
49
54
  import {
50
55
  createClient,
51
56
  resolveEffectiveConfig
52
- } from "./chunk-7PLTQHNO.js";
57
+ } from "./chunk-RXDG57B2.js";
53
58
  import {
54
59
  GLOBAL_FLAGS,
55
60
  READ_SINGLE_FLAGS,
@@ -58,12 +63,12 @@ import {
58
63
  } from "./chunk-QLKGOIWS.js";
59
64
  import {
60
65
  DESCRIPTIONS
61
- } from "./chunk-MWVTFTWV.js";
66
+ } from "./chunk-5LGKZBAY.js";
62
67
  import "./chunk-FDJMAF7D.js";
63
68
  import {
64
69
  resolveTextOrStdin
65
70
  } from "./chunk-ZYURL5VK.js";
66
- import "./chunk-RDKTHFQ6.js";
71
+ import "./chunk-SCUTAREU.js";
67
72
 
68
73
  // src/commands/company.ts
69
74
  import { defineCommand } from "citty";
@@ -97,7 +102,7 @@ async function resolveCompanyId(ns, raw) {
97
102
  async function handleSdkError(err, outOpts, out) {
98
103
  const { CurviateError } = await import("@curviate/sdk");
99
104
  if (err instanceof CurviateError) {
100
- const { getExitCode } = await import("./exit-codes-ZSOLAXQO.js");
105
+ const { getExitCode } = await import("./exit-codes-P2FLCKM7.js");
101
106
  renderError(err, outOpts, out);
102
107
  process.exit(getExitCode(err));
103
108
  }
@@ -113,12 +118,17 @@ async function runCompanyGet(client, flags, out) {
113
118
  out.stderr.write("error: --sections is not supported on company commands.\n");
114
119
  process.exit(2);
115
120
  }
121
+ const retrieval = parseRetrievalFlags(flags);
122
+ if (!retrieval.ok) {
123
+ out.stderr.write(retrieval.error);
124
+ process.exit(2);
125
+ }
116
126
  const accountId = await requireAccount(client, flags, out);
117
127
  const rawId = flags.id ?? "";
118
128
  const resolvedId = resolveIdentifier(rawId);
119
129
  const outOpts = { ...resolveOutputOpts(flags), slim: slimCompany };
120
130
  try {
121
- const result = await client.account(accountId).companies.get(resolvedId);
131
+ const result = hasRetrievalFlags(flags) ? await client.account(accountId).companies.get(resolvedId, retrieval.query) : await client.account(accountId).companies.get(resolvedId);
122
132
  readableObject(result);
123
133
  renderSuccess(result, outOpts, out);
124
134
  } catch (err) {
@@ -987,7 +997,8 @@ var companyCommand = defineCommand({
987
997
  args: {
988
998
  ...readOnly(READ_SINGLE_FLAGS),
989
999
  id: { type: "positional", description: "Company identifier (URL, slug, or native id)." },
990
- sections: { type: "string", description: "Not supported on company commands; a usage error (exit 2) if supplied." }
1000
+ sections: { type: "string", description: "Not supported on company commands; a usage error (exit 2) if supplied." },
1001
+ ...RETRIEVAL_FLAGS
991
1002
  },
992
1003
  subCommands: {
993
1004
  employees: companyEmployeesCommand,