@curviate/cli 0.51.0 → 0.53.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 (62) hide show
  1. package/CHANGELOG.md +56 -0
  2. package/README.md +2 -2
  3. package/dist/{account-74N7HFFI.js → account-24YCNFNY.js} +9 -9
  4. package/dist/{analytics-CZ372NIV.js → analytics-RMRTJPHK.js} +6 -6
  5. package/dist/{beta-consent-6EY7JWUB.js → beta-consent-KCJUJFAR.js} +5 -5
  6. package/dist/{billing-LJGAAL4W.js → billing-5GK6WIXR.js} +6 -6
  7. package/dist/{chunk-3OYS3NWV.js → chunk-4YGTPVEH.js} +1 -1
  8. package/dist/{chunk-PHKICMO7.js → chunk-62YAYAUI.js} +6 -0
  9. package/dist/{contact-import-PAMRJ6MU.js → chunk-AA2UTHCS.js} +84 -25
  10. package/dist/{chunk-FBBZVIFJ.js → chunk-AQVE6HO5.js} +1 -1
  11. package/dist/{chunk-7AR2OA67.js → chunk-FNENKSJ7.js} +12 -12
  12. package/dist/{chunk-XDG3TOKG.js → chunk-FUX3BRYP.js} +2 -1
  13. package/dist/{chunk-7OUGD5DH.js → chunk-IRKTIZUM.js} +2 -2
  14. package/dist/{chunk-6SBO4WXA.js → chunk-N4IYTFIY.js} +1 -1
  15. package/dist/{chunk-DAFE2MTF.js → chunk-PAXWRJNA.js} +1 -1
  16. package/dist/{chunk-RYWWSZUH.js → chunk-QLKGOIWS.js} +2 -2
  17. package/dist/{chunk-A6UJU6ZW.js → chunk-R5VJTBAJ.js} +19 -10
  18. package/dist/{chunk-ERHJZL7A.js → chunk-TIYRNMGW.js} +3 -3
  19. package/dist/{chunk-BKQZDNXH.js → chunk-WY73KWPF.js} +1 -1
  20. package/dist/{chunk-AUHGVZCD.js → chunk-WYFTBTDQ.js} +5 -5
  21. package/dist/{chunk-3RRINPLF.js → chunk-YHXIFKCU.js} +29 -3
  22. package/dist/cli.js +25 -25
  23. package/dist/{comment-OWNTXKTR.js → comment-UUA7B5YC.js} +6 -6
  24. package/dist/{company-F5Z5Q3YA.js → company-65ILSE2U.js} +7 -7
  25. package/dist/{config-GIU3SIIY.js → config-TMFMXS7T.js} +3 -3
  26. package/dist/{connect-BZY5AA3I.js → connect-URFFJVYY.js} +7 -7
  27. package/dist/{contact-EXEJDG7S.js → contact-A3S2HEBM.js} +8 -8
  28. package/dist/{contact-groups-RQZQCFHI.js → contact-groups-CEV2YITT.js} +13 -12
  29. package/dist/contact-import-HHVKVRJW.js +35 -0
  30. package/dist/core-IOGPY6HS.js +46 -0
  31. package/dist/do-not-contact-QYPADRLJ.js +360 -0
  32. package/dist/{doctor-BLUHL4YW.js → doctor-M7JVNQPQ.js} +4 -4
  33. package/dist/{document-RXBOZG6M.js → document-MDE2WJYX.js} +1 -1
  34. package/dist/{draft-5ULT2UFJ.js → draft-6KY4F5AE.js} +6 -6
  35. package/dist/{enrollment-WF5DDULC.js → enrollment-IXQD5IGZ.js} +6 -6
  36. package/dist/{examples-ICAGL2S5.js → examples-KAMXHRLE.js} +1 -1
  37. package/dist/{export-CF7IAMYC.js → export-7ILY53LY.js} +5 -5
  38. package/dist/{feed-PR43TIM3.js → feed-GESAX65K.js} +5 -5
  39. package/dist/{group-W5QAQJBZ.js → group-KKTBXE42.js} +5 -5
  40. package/dist/{inbox-NO3RDC4U.js → inbox-QQ6AQDVB.js} +5 -5
  41. package/dist/{inboxes-PN26B6SL.js → inboxes-352YK6UB.js} +5 -5
  42. package/dist/{incoming-DYYCNX46.js → incoming-5T2ELEDF.js} +6 -6
  43. package/dist/{job-V67373SG.js → job-KBILRJJO.js} +6 -6
  44. package/dist/{login-K3IGFVZY.js → login-DQPKKDVA.js} +3 -3
  45. package/dist/{message-AIVMYHV5.js → message-ZB2IGJIQ.js} +6 -6
  46. package/dist/{motion-UXH422PR.js → motion-NNCRSOT6.js} +17 -13
  47. package/dist/{network-376YFM33.js → network-FLPECF4C.js} +6 -6
  48. package/dist/{notification-BAKHCJTV.js → notification-B3MRXH3A.js} +5 -5
  49. package/dist/{notifications-7HJSOQEK.js → notifications-PMJDG45H.js} +6 -6
  50. package/dist/{post-RBHNLWAM.js → post-O5DYXSHK.js} +6 -6
  51. package/dist/{profile-RDNIILT7.js → profile-ZDP23SNN.js} +7 -7
  52. package/dist/{recruiter-HX45CHBT.js → recruiter-QENVOZFV.js} +8 -8
  53. package/dist/{sales-nav-SIMRRJV7.js → sales-nav-JFAYF6DM.js} +7 -7
  54. package/dist/{search-ARMOCEYV.js → search-5HPVIIUJ.js} +8 -8
  55. package/dist/{setup-DVFWTM6J.js → setup-QUD7TUCB.js} +4 -4
  56. package/dist/{team-X6EMJ3EH.js → team-ZTGY45Y7.js} +6 -6
  57. package/dist/{tier-4VDJ3OEO.js → tier-3ISVHJJ5.js} +5 -5
  58. package/dist/{unibox-XGOS5YIJ.js → unibox-JQBP7COE.js} +8 -7
  59. package/dist/{webhook-3QYAOV7E.js → webhook-GPGFPF5P.js} +6 -6
  60. package/package.json +2 -2
  61. package/dist/core-F3RQLZFP.js +0 -46
  62. package/dist/do-not-contact-UWJRNFHH.js +0 -200
package/CHANGELOG.md CHANGED
@@ -6,6 +6,62 @@ The format follows [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
6
6
  Versioning follows [Semantic Versioning](https://semver.org/spec/v2.0.0.html):
7
7
  a new command or flag is a minor; a breaking command/flag/exit-code change is a major (before 1.0.0, a minor); a fix is a patch.
8
8
 
9
+ ## [Unreleased]
10
+
11
+ ## [0.53.0] - 2026-11-09
12
+
13
+ Requires `@curviate/sdk` 0.49.0 (exact pin). The vendored OpenAPI fixture is re-copied from the SDK's, fetched from production 134827ce6.
14
+
15
+ ### Forecast
16
+
17
+ - **`analytics get --include forecast`** and **`account overview --include forecast`**, with **`--forecast-days N`** (default 30, the server allows 1 to 365): per day from today, what your Motions are expected to send and get (invitations, acceptances, messages, replies with InMail replies included, InMails, InMail replies), a simulation with their observed rates. Motions only; it assumes the configuration frozen as it is now. A draft Motion reads as if turned on now. The human table prints it under `forecast through <day>`; a draft with no Account says there is none, and `status: computing` (an Account of the scope has had no simulation yet) says so instead of printing zeros. `--forecast-days` is refused with `--view activity`, and when it is not a whole number (exit 2, no request).
18
+ - **Same wording, new meaning:** `motion preview` help: a draft's expected actions a day are the mean daily invitations, messages and InMails of the first 7 days of its forecast, as if turned on now.
19
+ - `analytics get` and `account overview` help name the section. `commands.json` regenerated.
20
+
21
+ ### Contact import: async, and a busy Team names the import in its way
22
+
23
+ - **`contact import --async`** prints the imports' ids and statuses as soon as each is accepted and exits 0, without waiting; stderr names `curviate contact imports get IMPORT_ID` for a queued one. Same as `--no-wait`, which stays.
24
+ - **A busy-Team 429 (`RATE_LIMIT_TENANT`) names the import holding the Team's write lock** when the API names one (`details.import_id`, `details.started_at`): in the wait line on stderr and in the final error, so an agent reads that import instead of guessing.
25
+
26
+ - `--all` and `--max-pages` help: the default cap (100 pages), that a capped run ends with a `stream_truncated` line on stdout plus a stderr note, and that it still exits 0. Help text only.
27
+
28
+ ### Hygiene
29
+
30
+ - `motion lint` checks a Motion file's fields with the schema `motion create` uses: an unknown top-level or `settings` key (`description`), a missing `name` and the other field rules now exit 2 in lint, as they do in create. A bare Sequence document is unchanged.
31
+ - No-Account hint (`--account` omitted, none connected) says "Team" and sends the person to the dashboard (Accounts, Connect account) or `curviate account connect-request create`, not the stdin-credential `account link`.
32
+ - Help states limits: `unibox list --limit` 1 to 100, `unibox messages --limit` 1 to 25, `do-not-contact list --limit` 1 to 100 (the API returns no total there, so no `--total`); `contact lists add|remove` help names `--from-list` as the list filter, with an example.
33
+
34
+ ### Pending invitations
35
+
36
+ - **`core connect sent`** keeps `user.public_identifier` in the slim output (null when unknown). LinkedIn sends no slug for sent invitations; the API fills it from stored data when it knows the person.
37
+ - `motion preview` prints the new `pending_invite` skip count as the API returns it (Motions skip a Contact any Team Account has a pending invitation to; `settings.exclude.pending_invites`, default on). `motion create|update --file` accept `settings.exclude.pending_invites` (vendored document schemas re-derived from the OpenAPI fixture served by staging e858d1ed0; the SDK pin stays 0.48.0, whose generated types already carry it).
38
+
39
+ ## [0.52.0] - 2026-11-08
40
+
41
+ Requires `@curviate/sdk` 0.48.0 (exact pin). The vendored OpenAPI fixture is re-copied from the SDK's, regenerated from staging f4ecd2656.
42
+
43
+ ### Contact import tells the truth about timeouts and a busy Team
44
+
45
+ - **`contact import` after a timeout or dropped connection** reads the Team's newest imports and reports the one the request made: the import id with `completed` and its counts, or `running`/`queued` (it keeps waiting, as for a large file). Only when none exists does it say nothing was imported (connection refused: "Nothing was imported"; otherwise "no import from this request exists", with a pointer to `contact imports list`). It no longer says "0 of N rows were sent". No idempotency key or dry-run is added.
46
+ - **`RATE_LIMIT_TENANT` (429, known not processed)** waits the advertised `Retry-After` (default 5 s when none, at most 60 s, five sends per import) and sends that import again, then goes on with the next. A longer `Retry-After` stops the run at once, exit 6, without sleeping.
47
+ - `contact import --json` prints exactly one JSON document on stdout; waits and progress go to stderr (test added).
48
+ - A failed chunk's summary reads "N of M rows were accepted before it" (it said "sent").
49
+
50
+ ### Contact import finds an import that commits late
51
+
52
+ - **`contact import` after a timeout** reads the Team's imports again every 2 s for up to 30 s while none shows (an inline import writes its record in the same transaction as its rows, so a timeout mid-apply sees none yet), then polls the one it finds as before. Only after the window does it say no import appeared (exit 7).
53
+ - **`Retry-After: 0`** on a busy 429 waits 0 s; the 5 s default applies only when the header is absent.
54
+
55
+ ### Contact import applies the export's lists
56
+
57
+ - **`contact import --apply-lists`**: each row's Contact joins the Contact lists named in its `lists` (a CSV export's `lists` column, names joined with `;`, or a JSON/NDJSON row's `lists` array), and a missing list is created by name. Only adds. A row past the Team's list limit is skipped (`list_limit_reached`). **Same name, new meaning:** without the flag `lists` is ignored, as before. Every split chunk carries the option. Needs the server change (`apply_lists`); an older server rejects the unknown key.
58
+
59
+ ### Do-not-contact file
60
+
61
+ - **`do-not-contact export [--format csv|json|ndjson] [--output FILE]`** downloads the whole list: LinkedIn URL (empty once the Contact was deleted), reason, who added it, when. Data to stdout or `--output` (mode 0600, written whole), the count to stderr. Owners and Managers only.
62
+ - **`do-not-contact import --file FILE|- [--format csv|json|ndjson]`** puts the people of a file on the list (`linkedin_url`, optional `reason`; an exported file works as it is). A person already listed is reported unchanged; a bad URL or reason skips its row. One report: `total_rows`, summed `counts` and the `skipped` rows with file row, reason and field. A file over 10,000 rows is sent in several requests. Any member; needs Automate.
63
+ - `do-not-contact add` help points at `import` for many people. `commands.json` regenerated.
64
+
9
65
  ## [0.51.0] - 2026-11-05
10
66
 
11
67
  Requires `@curviate/sdk` 0.46.0 (exact pin). The vendored OpenAPI fixture is re-copied from the SDK's, regenerated from staging b25643d91.
package/README.md CHANGED
@@ -107,8 +107,8 @@ Global flags available on every command:
107
107
  --fields Comma-separated list of fields to include in JSON output
108
108
  --limit Maximum number of results to return per page
109
109
  --cursor Pagination cursor from a previous response (an empty value is a usage error, never a restart)
110
- --all Stream all pages as NDJSON
111
- --max-pages Cap on the number of pages fetched with --all (a positive integer)
110
+ --all Stream pages as NDJSON until --max-pages is reached, then end with a stream_truncated line
111
+ --max-pages Cap on the number of pages fetched with --all (a positive integer, default 100)
112
112
  --page-delay Milliseconds to pause between pages when --all is used (default 400)
113
113
  --preview Show what would happen without sending any write request
114
114
  --verbose Output the full SDK response instead of the slim default
@@ -3,14 +3,14 @@ import {
3
3
  slimAccountGet,
4
4
  slimAccountList,
5
5
  slimAccountListItem
6
- } from "./chunk-XDG3TOKG.js";
6
+ } from "./chunk-FUX3BRYP.js";
7
7
  import {
8
8
  GRAMMAR_ARGS,
9
9
  WINDOW_ARGS,
10
10
  grammarParams,
11
11
  renderOverview,
12
12
  windowParams
13
- } from "./chunk-A6UJU6ZW.js";
13
+ } from "./chunk-R5VJTBAJ.js";
14
14
  import {
15
15
  print,
16
16
  table
@@ -22,7 +22,7 @@ import {
22
22
  outputOpts,
23
23
  rootClient,
24
24
  usage
25
- } from "./chunk-BKQZDNXH.js";
25
+ } from "./chunk-WY73KWPF.js";
26
26
  import {
27
27
  buildPreviewOutput
28
28
  } from "./chunk-TCUYH5GO.js";
@@ -37,7 +37,7 @@ import {
37
37
  readablePage,
38
38
  rejectPaginationModifiersWithoutAll,
39
39
  streamAll
40
- } from "./chunk-DAFE2MTF.js";
40
+ } from "./chunk-PAXWRJNA.js";
41
41
  import {
42
42
  isJsonMode,
43
43
  renderError,
@@ -53,20 +53,20 @@ import {
53
53
  import {
54
54
  createClient,
55
55
  resolveEffectiveConfig
56
- } from "./chunk-3RRINPLF.js";
56
+ } from "./chunk-YHXIFKCU.js";
57
57
  import {
58
58
  GLOBAL_FLAGS,
59
59
  READ_SINGLE_FLAGS,
60
60
  WRITE_SINGLE_FLAGS,
61
61
  readOnly
62
- } from "./chunk-RYWWSZUH.js";
62
+ } from "./chunk-QLKGOIWS.js";
63
63
  import {
64
64
  DESCRIPTIONS
65
- } from "./chunk-FBBZVIFJ.js";
65
+ } from "./chunk-AQVE6HO5.js";
66
66
  import {
67
67
  parseDocument,
68
68
  readFileFlag
69
- } from "./chunk-PHKICMO7.js";
69
+ } from "./chunk-62YAYAUI.js";
70
70
  import "./chunk-FDJMAF7D.js";
71
71
  import {
72
72
  defaultReadStdin,
@@ -681,7 +681,7 @@ var connectRequestCommand = defineCommand4({
681
681
  meta: { name: "connect-request", description: "Connect a LinkedIn account without any credential passing through you: create a request, give the person its link, read it until done." },
682
682
  subCommands: { create: createCmd, get: getCmd2, cancel: cancelCmd },
683
683
  async run() {
684
- const { showHelp } = await import("./examples-ICAGL2S5.js");
684
+ const { showHelp } = await import("./examples-KAMXHRLE.js");
685
685
  await showHelp(connectRequestCommand, ["curviate", "account", "connect-request"]);
686
686
  }
687
687
  });
@@ -6,16 +6,16 @@ import {
6
6
  grammarParams,
7
7
  renderOverview,
8
8
  windowParams
9
- } from "./chunk-A6UJU6ZW.js";
9
+ } from "./chunk-R5VJTBAJ.js";
10
10
  import "./chunk-5S3MJVI5.js";
11
11
  import "./chunk-PPGKQJKU.js";
12
- import "./chunk-BKQZDNXH.js";
12
+ import "./chunk-WY73KWPF.js";
13
13
  import "./chunk-NNV2OYEF.js";
14
- import "./chunk-DAFE2MTF.js";
14
+ import "./chunk-PAXWRJNA.js";
15
15
  import "./chunk-QM57YDJE.js";
16
- import "./chunk-3RRINPLF.js";
17
- import "./chunk-RYWWSZUH.js";
18
- import "./chunk-FBBZVIFJ.js";
16
+ import "./chunk-YHXIFKCU.js";
17
+ import "./chunk-QLKGOIWS.js";
18
+ import "./chunk-AQVE6HO5.js";
19
19
  import "./chunk-ZYURL5VK.js";
20
20
  export {
21
21
  GRAMMAR_ARGS,
@@ -4,22 +4,22 @@ import {
4
4
  outputOpts,
5
5
  rootClient,
6
6
  usage
7
- } from "./chunk-BKQZDNXH.js";
7
+ } from "./chunk-WY73KWPF.js";
8
8
  import {
9
9
  buildPreviewOutput
10
10
  } from "./chunk-TCUYH5GO.js";
11
11
  import {
12
12
  renderSuccess
13
13
  } from "./chunk-QM57YDJE.js";
14
- import "./chunk-3RRINPLF.js";
14
+ import "./chunk-YHXIFKCU.js";
15
15
  import {
16
16
  READ_SINGLE_FLAGS,
17
17
  WRITE_SINGLE_FLAGS,
18
18
  readOnly
19
- } from "./chunk-RYWWSZUH.js";
19
+ } from "./chunk-QLKGOIWS.js";
20
20
  import {
21
21
  DESCRIPTIONS
22
- } from "./chunk-FBBZVIFJ.js";
22
+ } from "./chunk-AQVE6HO5.js";
23
23
  import "./chunk-ZYURL5VK.js";
24
24
 
25
25
  // src/commands/beta-consent.ts
@@ -72,7 +72,7 @@ var betaCommand = defineCommand({
72
72
  meta: { name: "beta", description: DESCRIPTIONS.beta },
73
73
  subCommands: { status: statusCmd, update: updateCmd },
74
74
  async run() {
75
- const { showHelp } = await import("./examples-ICAGL2S5.js");
75
+ const { showHelp } = await import("./examples-KAMXHRLE.js");
76
76
  await showHelp(betaCommand, ["curviate", "beta"]);
77
77
  }
78
78
  });
@@ -7,7 +7,7 @@ import {
7
7
  outputOpts,
8
8
  rootClient,
9
9
  usage
10
- } from "./chunk-BKQZDNXH.js";
10
+ } from "./chunk-WY73KWPF.js";
11
11
  import {
12
12
  intFlag
13
13
  } from "./chunk-NNV2OYEF.js";
@@ -18,21 +18,21 @@ import {
18
18
  readablePage,
19
19
  rejectPaginationModifiersWithoutAll,
20
20
  streamAll
21
- } from "./chunk-DAFE2MTF.js";
21
+ } from "./chunk-PAXWRJNA.js";
22
22
  import {
23
23
  renderSuccess,
24
24
  writeNdjsonItem
25
25
  } from "./chunk-QM57YDJE.js";
26
26
  import {
27
27
  downloadBinary
28
- } from "./chunk-3RRINPLF.js";
28
+ } from "./chunk-YHXIFKCU.js";
29
29
  import {
30
30
  GLOBAL_FLAGS,
31
31
  readOnly
32
- } from "./chunk-RYWWSZUH.js";
32
+ } from "./chunk-QLKGOIWS.js";
33
33
  import {
34
34
  DESCRIPTIONS
35
- } from "./chunk-FBBZVIFJ.js";
35
+ } from "./chunk-AQVE6HO5.js";
36
36
  import "./chunk-ZYURL5VK.js";
37
37
 
38
38
  // src/commands/billing.ts
@@ -115,7 +115,7 @@ var billingCommand = defineCommand({
115
115
  meta: { name: "billing", description: DESCRIPTIONS.billing },
116
116
  subCommands: { invoices: invoicesCmd },
117
117
  async run() {
118
- const { showHelp } = await import("./examples-ICAGL2S5.js");
118
+ const { showHelp } = await import("./examples-KAMXHRLE.js");
119
119
  await showHelp(billingCommand, ["curviate", "billing"]);
120
120
  }
121
121
  });
@@ -4,7 +4,7 @@ import {
4
4
  } from "./chunk-UEAX6KUB.js";
5
5
  import {
6
6
  readableId
7
- } from "./chunk-DAFE2MTF.js";
7
+ } from "./chunk-PAXWRJNA.js";
8
8
 
9
9
  // src/lib/member-id.ts
10
10
  var MEMBER_PROVIDER_ID_RE = /^A[CDE][A-Za-z0-9_-]{4,}$/;
@@ -1013,6 +1013,9 @@ var documents_default = {
1013
1013
  },
1014
1014
  known_chats: {
1015
1015
  type: "boolean"
1016
+ },
1017
+ pending_invites: {
1018
+ type: "boolean"
1016
1019
  }
1017
1020
  },
1018
1021
  additionalProperties: false
@@ -1207,6 +1210,9 @@ var documents_default = {
1207
1210
  },
1208
1211
  known_chats: {
1209
1212
  type: "boolean"
1213
+ },
1214
+ pending_invites: {
1215
+ type: "boolean"
1210
1216
  }
1211
1217
  },
1212
1218
  additionalProperties: false
@@ -2,19 +2,16 @@
2
2
  import {
3
3
  online,
4
4
  preview
5
- } from "./chunk-7AR2OA67.js";
6
- import "./chunk-7OUGD5DH.js";
7
- import "./chunk-GOICALYQ.js";
5
+ } from "./chunk-FNENKSJ7.js";
8
6
  import {
9
7
  sendChunked
10
- } from "./chunk-ERHJZL7A.js";
8
+ } from "./chunk-TIYRNMGW.js";
11
9
  import {
12
10
  fail,
13
11
  listFlag,
14
12
  outputOpts,
15
13
  usage
16
- } from "./chunk-BKQZDNXH.js";
17
- import "./chunk-TCUYH5GO.js";
14
+ } from "./chunk-WY73KWPF.js";
18
15
  import {
19
16
  intFlag
20
17
  } from "./chunk-NNV2OYEF.js";
@@ -26,26 +23,25 @@ import {
26
23
  readablePage,
27
24
  rejectPaginationModifiersWithoutAll,
28
25
  streamAll
29
- } from "./chunk-DAFE2MTF.js";
26
+ } from "./chunk-PAXWRJNA.js";
30
27
  import {
31
28
  renderSuccess,
32
29
  writeNdjsonItem
33
30
  } from "./chunk-QM57YDJE.js";
34
- import "./chunk-3RRINPLF.js";
31
+ import {
32
+ withWireNotes
33
+ } from "./chunk-YHXIFKCU.js";
35
34
  import {
36
35
  GLOBAL_FLAGS,
37
36
  WRITE_SINGLE_FLAGS,
38
37
  readOnly
39
- } from "./chunk-RYWWSZUH.js";
40
- import "./chunk-FBBZVIFJ.js";
38
+ } from "./chunk-QLKGOIWS.js";
41
39
  import {
42
40
  readFileFlag
43
- } from "./chunk-PHKICMO7.js";
44
- import "./chunk-FDJMAF7D.js";
41
+ } from "./chunk-62YAYAUI.js";
45
42
  import {
46
43
  isStdinToken
47
44
  } from "./chunk-ZYURL5VK.js";
48
- import "./chunk-QW5K5DTC.js";
49
45
 
50
46
  // src/commands/contact-import.ts
51
47
  import { defineCommand } from "citty";
@@ -143,6 +139,61 @@ function mapping(f) {
143
139
  }
144
140
  var DELIMITERS = { ",": ",", comma: ",", ";": ";", semicolon: ";", tab: " ", "\\t": " ", " ": " " };
145
141
  var COUNTS = ["created", "updated", "unchanged", "skipped"];
142
+ var RETRY_AFTER_BOUND_S = 60;
143
+ var RETRY_DEFAULT_S = 5;
144
+ var MAX_SENDS = 5;
145
+ var relistMs = () => Number(process.env["CURVIATE_IMPORT_RELIST_MS"]) || 2e3;
146
+ var RELIST_TRIES = 15;
147
+ var CLOCK_SKEW_MS = 3e4;
148
+ var say = (msg) => void process.stderr.write(msg + "\n");
149
+ async function createChunk(c, body, rows, seen, k, n) {
150
+ const { CurviateError } = await import("@curviate/sdk");
151
+ for (let sends = 1; ; sends++) {
152
+ const notes = {};
153
+ const started = Date.now();
154
+ try {
155
+ return readableObject(await withWireNotes(notes, () => c.contacts.imports.create(body)));
156
+ } catch (err) {
157
+ if (!(err instanceof CurviateError)) throw err;
158
+ if (err.code === "RATE_LIMIT_TENANT") {
159
+ const wait = notes.retryAfterS ?? RETRY_DEFAULT_S;
160
+ const d = err.details;
161
+ const holder = typeof d?.import_id === "string" ? ` Import ${d.import_id} (started ${String(d.started_at)}) holds the Team's write lock: read it with \`curviate contact imports get ${d.import_id}\`.` : "";
162
+ if (wait > RETRY_AFTER_BOUND_S || sends >= MAX_SENDS) {
163
+ const why = wait > RETRY_AFTER_BOUND_S ? ` The API asked to wait ${wait} s, more than the ${RETRY_AFTER_BOUND_S} s the CLI waits.` : "";
164
+ throw new CurviateError({ code: err.code, message: `${err.message}${why} Nothing in this chunk was imported; send it again later.${holder}`, httpStatus: 429, userFixable: false, retryLikelyToSucceed: true, ...err.details ? { details: err.details } : {} });
165
+ }
166
+ say(`Import ${k} of ${n}: the Team has other Contact writes running (nothing was imported); waiting ${wait} s, then sending it again.${holder}`);
167
+ await sleep(wait * 1e3);
168
+ continue;
169
+ }
170
+ if (err.code === "CLIENT_TIMEOUT" || err.code === "INTERNAL" && err.httpStatus === void 0) return recover(c, body, rows, seen, started, notes, err, k, n);
171
+ throw err;
172
+ }
173
+ }
174
+ }
175
+ async function recover(c, body, rows, seen, started, notes, err, k, n) {
176
+ const { CurviateError } = await import("@curviate/sdk");
177
+ const fresh = (message) => new CurviateError({ code: err.code, message, userFixable: true, retryLikelyToSucceed: false });
178
+ if (notes.unreached) throw fresh(`Nothing was imported: the API could not be reached (${err.message}).`);
179
+ say(`Import ${k} of ${n}: no answer from the API; looking for the import it made.`);
180
+ let found;
181
+ for (let tries = 0; ; tries++) {
182
+ try {
183
+ const page = await c.contacts.imports.list({ limit: 20 });
184
+ found = (page.items ?? []).find(
185
+ (i) => !seen.includes(String(i.id)) && i.total_rows === rows && i.format === (body["csv"] !== void 0 ? "csv" : "rows") && (body["list_id"] === void 0 || i.list_id === body["list_id"]) && Date.parse(i.created_at ?? "") >= started - CLOCK_SKEW_MS
186
+ );
187
+ } catch {
188
+ throw fresh(`${err.message} The check for an import it made failed too: read \`curviate contact imports list\` before running this again, it may have been imported.`);
189
+ }
190
+ if (found || tries >= RELIST_TRIES) break;
191
+ await sleep(relistMs());
192
+ }
193
+ if (!found) throw fresh(`${err.message} No import from this request appeared within 30 s, so nothing was imported so far. If the API is only slow, one may still appear: read \`curviate contact imports list\` before running this again.`);
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
+ return found;
196
+ }
146
197
  async function runImport(c, f) {
147
198
  const file = f.file;
148
199
  if (file === void 0 || file.trim() === "") usage("--file is required: a CSV, JSON or NDJSON file, or - for stdin.");
@@ -162,6 +213,7 @@ async function runImport(c, f) {
162
213
  if (tags.length) base["tags"] = tags;
163
214
  const removeTags = listFlag("remove-tag", f["remove-tag"]);
164
215
  if (removeTags.length) base["remove_tags"] = removeTags;
216
+ if (f["apply-lists"] === true) base["apply_lists"] = true;
165
217
  const map = mapping(f);
166
218
  if (map) base["mapping"] = map;
167
219
  if (f.delimiter !== void 0) {
@@ -174,7 +226,7 @@ async function runImport(c, f) {
174
226
  const bodyOf = (rows) => ({ ...base, ...header !== void 0 ? { csv: [header, ...rows].join("\n") } : { rows } });
175
227
  const total = chunks.reduce((n, x) => n + x.length, 0);
176
228
  if (f.preview) return preview("contacts.imports.create", chunks.length > 1 ? { imports: chunks.length, rows: total } : {}, bodyOf(chunks[0]));
177
- const wait = !(f["no-wait"] === true || f.wait === false);
229
+ const wait = !(f["no-wait"] === true || f.wait === false || f.async === true);
178
230
  const poll = async (made) => {
179
231
  let imp = made;
180
232
  while (wait && imp.status !== "completed" && imp.status !== "failed") {
@@ -189,12 +241,13 @@ async function runImport(c, f) {
189
241
  await sendChunked(
190
242
  chunks,
191
243
  async (rows) => {
192
- const made = readableObject(await c.contacts.imports.create(bodyOf(rows)));
244
+ const made = await createChunk(c, bodyOf(rows), rows.length, done.map((i) => String(i.id)), done.length + 1, chunks.length);
193
245
  const imp = await poll(made);
194
246
  offsets.push(at);
195
247
  at += rows.length;
196
248
  done.push(imp);
197
249
  if (imp.status === "failed") throw await failedImport(imp);
250
+ if (!wait && imp.status !== "completed") say(`Import ${done.length} of ${chunks.length}: ${imp.id} is ${imp.status}; read its progress with \`curviate contact imports get ${imp.id}\`.`);
198
251
  return imp;
199
252
  },
200
253
  f,
@@ -227,25 +280,27 @@ async function skippedRows(c, imp) {
227
280
  var importCmd = defineCommand({
228
281
  meta: {
229
282
  name: "import",
230
- description: `Import Contacts from a CSV, JSON (an array of objects) or NDJSON file. The format comes from the extension; with --file - pass --format. A file above ${IMPORT_MAX_ROWS} rows or ${(IMPORT_MAX_BODY_BYTES / 1048576).toFixed(0)} MiB is split into several imports, run one after the other (a CSV's header is repeated), each awaited unless --no-wait; the first refused or failed import stops the run. Only the file's structure is checked here; the server skips bad rows and reports why. Re-importing merges: a Contact already there is updated or left as it is. Needs Automate.`,
283
+ description: `Import Contacts from a CSV, JSON (an array of objects) or NDJSON file. The format comes from the extension; with --file - pass --format. A file above ${IMPORT_MAX_ROWS} rows or ${(IMPORT_MAX_BODY_BYTES / 1048576).toFixed(0)} MiB is split into several imports, run one after the other (a CSV's header is repeated), each awaited unless --async (or --no-wait); the first refused or failed import stops the run. Only the file's structure is checked here; the server skips bad rows and reports why. Re-importing merges: a Contact already there is updated or left as it is. If the request times out or the connection drops, the CLI looks up the Team's newest imports, again every 2 s for up to 30 s while none shows, and reports the one this request made (id and status; it waits on a running one); it says nothing was imported only when none appeared. A busy-Team 429 (RATE_LIMIT_TENANT) waits the advertised Retry-After (up to ${RETRY_AFTER_BOUND_S} s) and sends that import again, naming the import holding the Team's write lock when the API names one; a longer wait fails. Needs Automate.`,
231
284
  risk: "write",
232
285
  rules: {
233
- changes: "Contacts are created or updated, joined to --list and tagged with --tag. Nothing is sent to LinkedIn or to the people.",
286
+ changes: "Contacts are created or updated, joined to --list (and, with --apply-lists, to the lists their `lists` column names) and tagged with --tag. Nothing is sent to LinkedIn or to the people.",
234
287
  visible_to: "Your Team.",
235
288
  budget_rows: [],
236
- retry: "Safe to repeat: Contacts converge, a second run reports them `unchanged`. A run stopped part way: read `curviate contact imports list`, then import the rest.",
289
+ retry: "After a timeout the CLI reports the import it made; do not run it again then. Otherwise Contacts converge: a second run reports them `unchanged`. A run stopped part way: read `curviate contact imports list`, then import the rest.",
237
290
  undo: "Cannot be undone as a whole. `curviate contact delete --import IMPORT_ID` deletes every Contact in its report, those it only updated included; Tags and list membership are undone with `curviate contact tags remove` and `curviate contact lists remove`."
238
291
  },
239
292
  errors: {
240
293
  CONTACT_LIMIT_REACHED: "the Team is at its Contact cap; rows past it are skipped.",
241
294
  IMPORT_QUEUE_FULL: "too many imports are queued (429); wait, then run it again.",
295
+ RATE_LIMIT_TENANT: `the Team has other Contact or Motion 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 contact imports get\`.`,
296
+ 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 contact imports list` before running it again.",
242
297
  NAME_TAKEN: "--list-name names a list that exists."
243
298
  },
244
- output: ["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 --no-wait: the imports' ids and statuses only."],
299
+ 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 contact imports get IMPORT_ID` (stderr names it)."],
245
300
  seeAlso: ["curviate contact imports get", "curviate contact list"],
246
301
  examples: [
247
302
  'curviate contact import --file prospects.csv --list-name "Q4 prospects" --tag conference',
248
- 'curviate contact import --file prospects.csv --map "LinkedIn Profile=linkedin_url" --list cl_YOUR_LIST_ID --no-wait',
303
+ "curviate contact import --file contacts-export.csv --apply-lists --async",
249
304
  "curviate contact import --file - --format ndjson --list cl_YOUR_LIST_ID"
250
305
  ]
251
306
  },
@@ -257,9 +312,11 @@ var importCmd = defineCommand({
257
312
  "list-name": { type: "string", description: "Add them to the list of this name (up to 100 characters), creating it. Not with --list." },
258
313
  tag: { type: "string", description: "Put this Tag on every imported Contact (up to 64 characters); repeatable." },
259
314
  "remove-tag": { type: "string", description: "Take this Tag off every imported Contact; repeatable." },
315
+ "apply-lists": { type: "boolean", description: "Add each Contact to the Contact lists named in its `lists` (an export's column), creating a missing list by name. Only adds. A row past the Team's list limit is skipped (list_limit_reached). Default: the column is ignored." },
260
316
  map: { type: "string", description: 'Map a file header to a Contact field: header=target, for example "LinkedIn Profile=linkedin_url"; repeatable.' },
261
317
  delimiter: { type: "string", description: "A CSV's separator: comma, semicolon or tab. Default: found by the server." },
262
- "no-wait": { type: "boolean", description: "Print the imports' ids without waiting for them to finish. Stops only on a refused request." }
318
+ 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 contact imports get IMPORT_ID`. Stops only on a refused request." },
319
+ "no-wait": { type: "boolean", description: "Same as --async." }
263
320
  },
264
321
  run: online(runImport)
265
322
  });
@@ -322,15 +379,17 @@ var contactImportsCommand = defineCommand({
322
379
  meta: { name: "imports", description: "Your Team's import records." },
323
380
  subCommands: { list: importsList, get: importsGet },
324
381
  async run() {
325
- const { showHelp } = await import("./examples-ICAGL2S5.js");
382
+ const { showHelp } = await import("./examples-KAMXHRLE.js");
326
383
  await showHelp(contactImportsCommand, ["curviate", "contact", "imports"]);
327
384
  }
328
385
  });
386
+
329
387
  export {
330
- IMPORT_MAX_BODY_BYTES,
331
388
  IMPORT_MAX_ROWS,
389
+ IMPORT_MAX_BODY_BYTES,
390
+ csvRecords,
332
391
  chunkRows,
392
+ RETRY_AFTER_BOUND_S,
333
393
  contactImportCommand,
334
- contactImportsCommand,
335
- csvRecords
394
+ contactImportsCommand
336
395
  };
@@ -11,7 +11,7 @@ var DESCRIPTIONS = {
11
11
  motionVoiceClip: "Voice clips: the audio a `voice.send` step plays. Upload one audio file (1 to 120 seconds, up to 20 MiB), then put its id in a Sequence as `clip_id`; read one back. Nothing reaches LinkedIn until a Motion that uses it is started. Uploads need the Automate plan.",
12
12
  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.",
13
13
  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.",
14
- "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
+ "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, export and import a file. Any member adds and imports; removing and exporting are for Owners and Managers.",
15
15
  billing: "Billing: your Team's invoices, listed and downloaded as PDFs. Owners only. Seats and the Tier are under `curviate team` and `curviate tier`.",
16
16
  contactImport: "Import Contacts from a CSV, JSON or NDJSON file into a Contact list, splitting a large file into several imports.",
17
17
  contactImports: "Read your Team's import records: the counts, the failure, and the rows an import skipped and why.",
@@ -1,20 +1,20 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  requireAccount
4
- } from "./chunk-7OUGD5DH.js";
4
+ } from "./chunk-IRKTIZUM.js";
5
5
  import {
6
6
  writeAtomic
7
7
  } from "./chunk-GOICALYQ.js";
8
8
  import {
9
9
  sendInChunks
10
- } from "./chunk-ERHJZL7A.js";
10
+ } from "./chunk-TIYRNMGW.js";
11
11
  import {
12
12
  fail,
13
13
  listFlag,
14
14
  outputOpts,
15
15
  rootClient,
16
16
  usage
17
- } from "./chunk-BKQZDNXH.js";
17
+ } from "./chunk-WY73KWPF.js";
18
18
  import {
19
19
  buildPreviewOutput
20
20
  } from "./chunk-TCUYH5GO.js";
@@ -29,24 +29,24 @@ import {
29
29
  readablePage,
30
30
  rejectPaginationModifiersWithoutAll,
31
31
  streamAll
32
- } from "./chunk-DAFE2MTF.js";
32
+ } from "./chunk-PAXWRJNA.js";
33
33
  import {
34
34
  renderSuccess,
35
35
  writeNdjsonItem
36
36
  } from "./chunk-QM57YDJE.js";
37
37
  import {
38
38
  downloadBinary
39
- } from "./chunk-3RRINPLF.js";
39
+ } from "./chunk-YHXIFKCU.js";
40
40
  import {
41
41
  GLOBAL_FLAGS,
42
42
  READ_SINGLE_FLAGS,
43
43
  WRITE_SINGLE_FLAGS,
44
44
  readOnly
45
- } from "./chunk-RYWWSZUH.js";
45
+ } from "./chunk-QLKGOIWS.js";
46
46
  import {
47
47
  DESCRIPTIONS,
48
48
  lazy
49
- } from "./chunk-FBBZVIFJ.js";
49
+ } from "./chunk-AQVE6HO5.js";
50
50
 
51
51
  // src/commands/contact.ts
52
52
  import { defineCommand } from "citty";
@@ -501,15 +501,15 @@ var contactCommand = defineCommand({
501
501
  create: createCmd,
502
502
  update: updateCmd,
503
503
  delete: deleteCmd,
504
- import: lazy("contactImport", () => import("./contact-import-PAMRJ6MU.js").then((m) => m.contactImportCommand)),
504
+ import: lazy("contactImport", () => import("./contact-import-HHVKVRJW.js").then((m) => m.contactImportCommand)),
505
505
  export: exportCmd,
506
506
  enrich: enrichCmd,
507
- lists: lazy("contactLists", () => import("./contact-groups-RQZQCFHI.js").then((m) => m.contactListsCommand)),
508
- tags: lazy("contactTags", () => import("./contact-groups-RQZQCFHI.js").then((m) => m.contactTagsCommand)),
509
- imports: lazy("contactImports", () => import("./contact-import-PAMRJ6MU.js").then((m) => m.contactImportsCommand))
507
+ lists: lazy("contactLists", () => import("./contact-groups-CEV2YITT.js").then((m) => m.contactListsCommand)),
508
+ tags: lazy("contactTags", () => import("./contact-groups-CEV2YITT.js").then((m) => m.contactTagsCommand)),
509
+ imports: lazy("contactImports", () => import("./contact-import-HHVKVRJW.js").then((m) => m.contactImportsCommand))
510
510
  },
511
511
  async run() {
512
- const { showHelp } = await import("./examples-ICAGL2S5.js");
512
+ const { showHelp } = await import("./examples-KAMXHRLE.js");
513
513
  await showHelp(contactCommand, ["curviate", "contact"]);
514
514
  }
515
515
  });
@@ -125,7 +125,8 @@ function slimInviteSentItem(item) {
125
125
  id: rawUser["id"] ?? null,
126
126
  display_name: rawUser["display_name"] ?? null,
127
127
  first_name: rawUser["first_name"] ?? null,
128
- last_name: rawUser["last_name"] ?? null
128
+ last_name: rawUser["last_name"] ?? null,
129
+ public_identifier: rawUser["public_identifier"] ?? null
129
130
  } : null;
130
131
  return {
131
132
  id: item["id"] ?? null,
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  readablePage
4
- } from "./chunk-DAFE2MTF.js";
4
+ } from "./chunk-PAXWRJNA.js";
5
5
  import {
6
6
  assertNoStdinPlaceholder
7
7
  } from "./chunk-ZYURL5VK.js";
@@ -141,7 +141,7 @@ async function soleConnectedAccount(client, flags, out) {
141
141
  const { accounts } = listed;
142
142
  if (accounts.length === 0) {
143
143
  out.stderr.write(
144
- "error: no LinkedIn account is connected to this workspace yet. Connect one with `curviate account link --auth-method <m> --country <CC>`, then retry.\n"
144
+ "error: no LinkedIn account is connected to this Team yet. Ask your user to connect one in the dashboard (Accounts, Connect account), or run `curviate account connect-request create` and hand them the link, then retry.\n"
145
145
  );
146
146
  process.exit(2);
147
147
  }
@@ -3,7 +3,7 @@ import {
3
3
  parseDocument,
4
4
  readFileFlag,
5
5
  readStdinCapped
6
- } from "./chunk-PHKICMO7.js";
6
+ } from "./chunk-62YAYAUI.js";
7
7
  import {
8
8
  isStdinToken
9
9
  } from "./chunk-ZYURL5VK.js";
@@ -5,7 +5,7 @@ import {
5
5
  } from "./chunk-QM57YDJE.js";
6
6
  import {
7
7
  isPlainObject
8
- } from "./chunk-3RRINPLF.js";
8
+ } from "./chunk-YHXIFKCU.js";
9
9
 
10
10
  // src/lib/paginate.ts
11
11
  import { CurviateError } from "@curviate/sdk";