@curviate/cli 0.29.0 → 0.31.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.
- package/CHANGELOG.md +153 -0
- package/README.md +65 -12
- package/dist/{account-5KGM6EPR.js → account-DZRX4YOK.js} +28 -12
- package/dist/{chunk-GHT2DLZR.js → chunk-A73TUZBK.js} +4 -4
- package/dist/{chunk-LCIUD7S2.js → chunk-JRKM4OV2.js} +1 -1
- package/dist/{chunk-5KANHEBN.js → chunk-KQXYEQAD.js} +0 -56
- package/dist/{chunk-63X3VI3T.js → chunk-LKF5MZIP.js} +1 -1
- package/dist/chunk-PKSKQ3LN.js +68 -0
- package/dist/{chunk-AHYUM2XQ.js → chunk-SKJNLN37.js} +12 -2
- package/dist/chunk-TD2ZIXFR.js +67 -0
- package/dist/{chunk-KTY7R27U.js → chunk-TQJ77SL4.js} +3 -1
- package/dist/chunk-X3YWBMBC.js +151 -0
- package/dist/{chunk-TAOXJNQN.js → chunk-Y3H55OSY.js} +14 -12
- package/dist/cli.js +36 -22
- package/dist/{comment-BLG4WHST.js → comment-6JI4Q6QY.js} +17 -14
- package/dist/{company-ZT65QZ6F.js → company-RLU5SHUO.js} +25 -22
- package/dist/{config-5HB2J3RY.js → config-FUHT23SX.js} +2 -2
- package/dist/{connect-57AUN33D.js → connect-63NUITEZ.js} +22 -19
- package/dist/doctor-7TEE36NY.js +192 -0
- package/dist/{exit-codes-U5CHA6FT.js → exit-codes-RUKZC4WV.js} +1 -1
- package/dist/{feed-3AWI2URQ.js → feed-PAWXR56T.js} +12 -9
- package/dist/{group-DYC2NX5M.js → group-ZIIWI7JV.js} +12 -9
- package/dist/{inbox-ZRFIFOEP.js → inbox-GIPLWRHQ.js} +14 -11
- package/dist/{inboxes-XQ2B6X3Q.js → inboxes-ECGEMDH7.js} +12 -9
- package/dist/{job-NUT4QMH2.js → job-WPWIAVQY.js} +14 -11
- package/dist/{login-KNNEN4HP.js → login-3OAUY7TG.js} +3 -3
- package/dist/{message-KMNRUD4H.js → message-JQL2XABC.js} +9 -7
- package/dist/{notification-LEM57IBY.js → notification-URSGC7OR.js} +14 -11
- package/dist/{post-FXAANNUB.js → post-2HI6KL73.js} +17 -14
- package/dist/{profile-72V55PZM.js → profile-4BXLUYMH.js} +25 -22
- package/dist/{recruiter-JUNB5AUR.js → recruiter-OUXQ5XYU.js} +24 -18
- package/dist/{sales-nav-BALVVD35.js → sales-nav-MJAMCSBO.js} +22 -16
- package/dist/{search-QCXTK33P.js → search-M3R35BIB.js} +21 -18
- package/dist/setup-YV5PVIU5.js +419 -0
- package/dist/{webhook-D4QRWF7W.js → webhook-3TEYA3B2.js} +10 -7
- package/package.json +2 -2
- package/dist/chunk-2OG6M6ME.js +0 -89
- package/dist/{chunk-H4KV7MIN.js → chunk-YLSJ4HKU.js} +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -6,6 +6,159 @@ 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; a fix is a patch.
|
|
8
8
|
|
|
9
|
+
## [0.31.0] - 2026-09-09
|
|
10
|
+
|
|
11
|
+
Follows the SDK to `0.30.0` and catches the CLI up to the server-side tier
|
|
12
|
+
retirement, the connect rework and the beta consent gate.
|
|
13
|
+
|
|
14
|
+
**Breaking for anyone matching on error codes, not on exit codes.** Exit 5 still
|
|
15
|
+
means the same thing and still fires in the same situations, so a script that
|
|
16
|
+
branches on `$?` needs no change. A script that reads `.error.code` out of
|
|
17
|
+
`--json` sees `NO_ACTIVE_SEAT` where a current deployment used to answer
|
|
18
|
+
`TIER_NOT_ACTIVE`, and no longer sees `.error.requiredTier` at all.
|
|
19
|
+
|
|
20
|
+
**`TIER_NOT_ACTIVE` and `PREMIUM_CONFLICT` still exit 5 and 8.** They are
|
|
21
|
+
deprecated rather than dropped, because this CLI is pointed at whichever
|
|
22
|
+
deployment you configure, and one that predates the seat-based entitlement
|
|
23
|
+
rollout still answers them. Unmapped they would fall to exit 1, which reads as
|
|
24
|
+
"the tool broke" for a plain billing refusal. Each shares its successor's exit
|
|
25
|
+
code, so branching on `$?` is deployment-independent: `TIER_NOT_ACTIVE` and
|
|
26
|
+
`NO_ACTIVE_SEAT` both exit 5, and you need no logic to tell which deployment
|
|
27
|
+
answered.
|
|
28
|
+
|
|
29
|
+
Ripple: this release rides the same wave as the SDK it pins, and the wire
|
|
30
|
+
contract moved before either of them. It is one release rather than three
|
|
31
|
+
because the CLI had two unpublished pin bumps waiting behind it.
|
|
32
|
+
|
|
33
|
+
### Changed
|
|
34
|
+
|
|
35
|
+
- **`@curviate/sdk` pinned at `0.30.0`** (exact, as always), and
|
|
36
|
+
`test/fixtures/openapi.json` re-vendored from that release
|
|
37
|
+
(`server_git_sha ebddaea7...`, 125 paths), with `VENDORED_FROM.json`'s
|
|
38
|
+
`sdkVersion`, salted `sha256`, `vendoredAt` and `sourceServerGitSha`
|
|
39
|
+
refreshed together so `check:fixture-pin` stays closed.
|
|
40
|
+
|
|
41
|
+
- **Exit 5 now carries three codes instead of two.** `NO_ACTIVE_SEAT`
|
|
42
|
+
(replacing `TIER_NOT_ACTIVE`), `LINKEDIN_FEATURE_NOT_SUBSCRIBED`, and the new
|
|
43
|
+
`BETA_NOT_ENABLED`. They share one exit code because the remedy has the same
|
|
44
|
+
SHAPE (a human changes something and you retry) and a scripted caller wants
|
|
45
|
+
one bucket for that. They are not interchangeable: the fixes live in three
|
|
46
|
+
different systems, so read the `code` in the `--json` envelope. Reusing 5 for
|
|
47
|
+
the beta refusal rather than minting a new number is deliberate; an exit code
|
|
48
|
+
is a public contract and a new one breaks every existing case statement.
|
|
49
|
+
|
|
50
|
+
- **The documented exit codes are now checked for reachability**, so removing
|
|
51
|
+
the last code from a bucket reds instead of leaving a dead row in the README
|
|
52
|
+
table. That check is what will catch `PREMIUM_CONFLICT`'s eventual removal
|
|
53
|
+
from exit 8, when the deprecation ends.
|
|
54
|
+
|
|
55
|
+
- **The `Required tier: <tier>` line is gone from human-mode error output**,
|
|
56
|
+
along with the SDK field that fed it. Nothing ever asserted that line while
|
|
57
|
+
it existed, which is exactly why it could have been left behind silently;
|
|
58
|
+
both its absence and the code-and-message line that remains are now asserted.
|
|
59
|
+
|
|
60
|
+
- **Sales Navigator and Recruiter are marked beta in `--help` and the README**,
|
|
61
|
+
and neither describes a Curviate-side entitlement any more. There is no
|
|
62
|
+
add-on to buy and no tier on a seat: one ordinary paid seat entitles every
|
|
63
|
+
command in both groups. What they need is the LinkedIn account's own Sales
|
|
64
|
+
Navigator or Recruiter subscription.
|
|
65
|
+
|
|
66
|
+
- **Exit-code table row 5** now reads "No active seat, the LinkedIn account
|
|
67
|
+
lacks the subscription, or beta consent is missing".
|
|
68
|
+
|
|
69
|
+
- **Twenty-one error codes now get a real exit code instead of falling to 1.**
|
|
70
|
+
`@curviate/sdk` 0.30.0 exports codes it previously did not, each of which the
|
|
71
|
+
API already returned; until now the SDK decoded every one to `INTERNAL` and
|
|
72
|
+
this CLI exited 1, which reads as "the tool broke" for a refusal that is
|
|
73
|
+
usually yours to fix.
|
|
74
|
+
|
|
75
|
+
Now: `4` for `NOT_FOUND` and `REACTION_NOT_FOUND`; `7` for
|
|
76
|
+
`SUBSTRATE_LINK_FAILED`, `SUBSTRATE_CAP_REACHED`, `BILLING_CHECKOUT_FAILED`
|
|
77
|
+
and `BILLING_PORTAL_UNAVAILABLE`, all of which are a dependency failing
|
|
78
|
+
rather than a bad request; `2` for `ADMIN_BYPASS` and
|
|
79
|
+
`INVALID_CANCELLATION_SOURCE`, where the request itself does not apply or a
|
|
80
|
+
field value is wrong; and `11` for the remaining thirteen, which are tenant
|
|
81
|
+
standing, seat and subscription state, and the free-trial limits.
|
|
82
|
+
|
|
83
|
+
**If you branch on exit 1 to detect any of these, that check needs
|
|
84
|
+
updating.** Everything else is additive: a case that fell through to 1 now
|
|
85
|
+
gets a specific number, and `--json` carries the real code where it used to
|
|
86
|
+
carry `INTERNAL`.
|
|
87
|
+
|
|
88
|
+
- **`RATE_LIMITED` loses its exit-code entry**, because `@curviate/sdk` 0.30.0
|
|
89
|
+
withdrew the code: the API never produced it (the substrate's own
|
|
90
|
+
`RATE_LIMITED` is translated to `PLATFORM_RATE_LIMIT` before any response is
|
|
91
|
+
written). Nothing changes for any real response. The throttle codes that do
|
|
92
|
+
arrive, `RATE_LIMIT_ACCOUNT`, `RATE_LIMIT_TENANT`, `PLATFORM_RATE_LIMIT` and
|
|
93
|
+
`LINKEDIN_RATE_LIMITED`, all still exit 6.
|
|
94
|
+
|
|
95
|
+
### Fixed
|
|
96
|
+
|
|
97
|
+
- **`company` inbox beta markers were wrong in both directions.**
|
|
98
|
+
`company chat` claimed beta for an operation that is stable, promising a gate
|
|
99
|
+
that cannot fire; `company search-chats` omitted it for one that IS beta, so a
|
|
100
|
+
caller got no warning the call can be refused for missing beta consent. Both
|
|
101
|
+
now match the served badge, and the match is checked mechanically per
|
|
102
|
+
operation rather than by hand, so the two cannot drift apart again.
|
|
103
|
+
|
|
104
|
+
### Added
|
|
105
|
+
|
|
106
|
+
- **`--beta`, a global flag.** Allows beta operations for one invocation:
|
|
107
|
+
`--beta` (or `--beta=true`) opts in, `--beta=false` opts out even where the
|
|
108
|
+
workspace has consented, and omitting it leaves the workspace setting to
|
|
109
|
+
decide. It persists nothing, in any profile, config file or environment
|
|
110
|
+
variable, because durable beta consent is a workspace setting a human owns in
|
|
111
|
+
the dashboard. Accepts the same value grammar as the API header it sets
|
|
112
|
+
(`true|false`, `1|0`, `on|off`, `yes|no`), and an unrecognised value is a
|
|
113
|
+
usage error (exit 2) with no request sent. `--no-beta` is accepted as a
|
|
114
|
+
synonym for `--beta=false`, and takes no value of its own: `--no-beta=false`
|
|
115
|
+
is a usage error rather than a guess at which negation was meant.
|
|
116
|
+
|
|
117
|
+
Worth knowing if you were relying on the old behaviour: an invalid value used
|
|
118
|
+
to be impossible to express and now refuses loudly rather than guessing. The
|
|
119
|
+
argument parser reads `--beta=maybe` as `true`, so guessing would mean opting
|
|
120
|
+
IN on a typo, which is the one direction a consent flag must not fail in.
|
|
121
|
+
|
|
122
|
+
- **`account link --linkedin-premium <sales_navigator|recruiter>`.** Narrows a
|
|
123
|
+
connect to one LinkedIn premium surface. Omit it and the connect asks for
|
|
124
|
+
every product and LinkedIn activates whichever ones the account holds; set it
|
|
125
|
+
to `recruiter` for an account that holds both, where Sales Navigator would
|
|
126
|
+
otherwise win. It applies to THAT call only and is never remembered, so
|
|
127
|
+
restate it on every connect and reconnect where Recruiter must win. The
|
|
128
|
+
previous `trial_premium` field is gone from the connect surface, and was
|
|
129
|
+
never exposed as a CLI flag.
|
|
130
|
+
|
|
131
|
+
An unrecognised value is a usage error (exit 2) with no request sent, and so
|
|
132
|
+
is an EMPTY one: `--linkedin-premium="$PREF"` with `PREF` unset would
|
|
133
|
+
otherwise take the same path as omitting the flag, which asks for every
|
|
134
|
+
product and lets Sales Navigator win. Under `--preview` it reports the
|
|
135
|
+
problem and renders instead of exiting, since a client-side render never
|
|
136
|
+
exits.
|
|
137
|
+
|
|
138
|
+
---
|
|
139
|
+
|
|
140
|
+
## [0.30.0] - 2026-09-07
|
|
141
|
+
|
|
142
|
+
Pins `@curviate/sdk` at `0.29.0` and re-vendors the OpenAPI fixture from it
|
|
143
|
+
(`server_git_sha 1447ffd4...`, 125 paths). No command, flag or exit code changes
|
|
144
|
+
meaning, and no source change was needed: the release exists so the CLI's SDK
|
|
145
|
+
dependency resolves the current published contract.
|
|
146
|
+
|
|
147
|
+
### Changed
|
|
148
|
+
|
|
149
|
+
- **`safety-policy` now reports where `limit_profile` came from.** The API's
|
|
150
|
+
`GET`/`PATCH /v1/{account_id}/safety-policy` responses gained
|
|
151
|
+
`limit_profile_source` (`default`, `detected` or `operator`) and
|
|
152
|
+
`limit_profile_detected_at` (ISO date-time, or null until the value has been
|
|
153
|
+
read at least once), and the `PATCH` accepts `limit_profile_source: "default"`
|
|
154
|
+
to release an operator override. The CLI has no `safety-policy` command, so
|
|
155
|
+
nothing it prints changes; the fields are reachable through `@curviate/sdk`
|
|
156
|
+
for anyone building on the same pin.
|
|
157
|
+
|
|
158
|
+
- `POST /v1/billing/seats/:seat_id/tier` was removed from the API in the same
|
|
159
|
+
wave. Billing has never been part of the published REST surface and the CLI
|
|
160
|
+
never called it, so no command is affected.
|
|
161
|
+
|
|
9
162
|
## [0.29.0] - 2026-09-07
|
|
10
163
|
|
|
11
164
|
Pins `@curviate/sdk@0.28.0`. **BREAKING**: `inbox search <query>` requires a term
|
package/README.md
CHANGED
|
@@ -23,6 +23,40 @@ Requires Node.js 18 or later.
|
|
|
23
23
|
|
|
24
24
|
## Authentication
|
|
25
25
|
|
|
26
|
+
**Option 0: `curviate setup`** (the one-command path). It prints a link, opens
|
|
27
|
+
it if there is a browser here, and waits. Sign in, press Authorize, paste the
|
|
28
|
+
code it shows you back into the terminal, and the key lands in a local profile:
|
|
29
|
+
|
|
30
|
+
```
|
|
31
|
+
curviate setup
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
There is no browser on the machine, or you are on a remote shell? Nothing
|
|
35
|
+
changes: the link is printed either way, and the code can be opened on a phone
|
|
36
|
+
and pasted back. `--no-browser` forces that shape.
|
|
37
|
+
|
|
38
|
+
Agents run the same flow in two steps, because an agent cannot read a browser:
|
|
39
|
+
|
|
40
|
+
```
|
|
41
|
+
curviate setup --json # prints {"authorize_url": ..., "next_step": "curviate setup --code -"}
|
|
42
|
+
curviate setup --code - # the code arrives on stdin, so it stays out of argv and shell history
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
Self-hosting, or serving the dashboard somewhere unusual? Set
|
|
46
|
+
`CURVIATE_APP_URL` to the host that serves the authorize page. Otherwise the
|
|
47
|
+
link is derived from the API base URL.
|
|
48
|
+
|
|
49
|
+
Then `curviate doctor` answers "can I run?" in one call: version, config path,
|
|
50
|
+
active profile, base URL, which precedence tier the credential came from
|
|
51
|
+
(never its value), whether the API is reachable and the key valid, and the
|
|
52
|
+
connected accounts with their status. It exits `0` when every check passes and
|
|
53
|
+
with the first failing check's code otherwise.
|
|
54
|
+
|
|
55
|
+
`doctor` also names the workspace the credential belongs to, but only when the
|
|
56
|
+
key it resolved is one `curviate setup` wrote to a profile. A key from
|
|
57
|
+
`CURVIATE_API_KEY` or `--api-key` may belong to another workspace entirely, so
|
|
58
|
+
it is reported as unknown rather than guessed at.
|
|
59
|
+
|
|
26
60
|
**Option 1: interactive login** (stores a profile in `~/.config/curviate/`):
|
|
27
61
|
|
|
28
62
|
```bash
|
|
@@ -69,6 +103,7 @@ Global flags available on every command:
|
|
|
69
103
|
--page-delay Milliseconds to pause between pages when --all is used (default 400)
|
|
70
104
|
--preview Show what would happen without sending any write request
|
|
71
105
|
--verbose Output the full SDK response instead of the slim default
|
|
106
|
+
--beta Allow beta operations for this call only (--beta, --beta=false)
|
|
72
107
|
--base-url Override the API base URL (for testing)
|
|
73
108
|
--timeout Request timeout in milliseconds (default: 30000)
|
|
74
109
|
```
|
|
@@ -146,16 +181,20 @@ curviate profile "$PROFILE_URL" --posts --fields id --account acc_1 --json \
|
|
|
146
181
|
| xargs -I{} curviate post react {} --account acc_1 --reaction like
|
|
147
182
|
```
|
|
148
183
|
|
|
149
|
-
### 4. Check
|
|
184
|
+
### 4. Check entitlement before a Sales Navigator sweep
|
|
150
185
|
|
|
151
|
-
Exit code `5`
|
|
186
|
+
Exit code `5` is the entitlement refusal. Three different things produce it and the
|
|
187
|
+
`code` in the JSON body says which: `NO_ACTIVE_SEAT` (no Curviate seat covers the
|
|
188
|
+
account), `LINKEDIN_FEATURE_NOT_SUBSCRIBED` (the LinkedIn account lacks its own Sales
|
|
189
|
+
Navigator subscription) or `BETA_NOT_ENABLED` (the workspace has not opted into beta).
|
|
190
|
+
Branch on the exit code for the retry decision and read the code for the remedy:
|
|
152
191
|
|
|
153
192
|
```bash
|
|
154
193
|
curviate sales-nav search people --keywords "VP Engineering" --account acc_1 --json \
|
|
155
194
|
|| {
|
|
156
195
|
code=$?
|
|
157
196
|
if [ "$code" -eq 5 ]; then
|
|
158
|
-
echo "
|
|
197
|
+
echo "Entitlement refused. Read .error.code for which of the three it was."
|
|
159
198
|
else
|
|
160
199
|
echo "Search failed with exit code $code"
|
|
161
200
|
exit "$code"
|
|
@@ -228,11 +267,18 @@ curviate company jobs 112013061 --all --account acc_1 --json # streams every p
|
|
|
228
267
|
|
|
229
268
|
## Sales Navigator
|
|
230
269
|
|
|
231
|
-
Sales Navigator commands (`curviate sales-nav ...`)
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
270
|
+
Sales Navigator commands (`curviate sales-nav ...`) are **beta**: this surface has not been
|
|
271
|
+
exercised against a real Sales Navigator subscription yet, so its responses may still move.
|
|
272
|
+
|
|
273
|
+
There is no Sales Navigator add-on to buy from Curviate and no tier on a seat: one ordinary
|
|
274
|
+
paid seat entitles every command here. What these commands do need is the LinkedIn account's
|
|
275
|
+
own Sales Navigator subscription. A refusal is **exit code `5`** with one of three codes in
|
|
276
|
+
the JSON body: `NO_ACTIVE_SEAT` (no Curviate seat covers the account, fix it in billing),
|
|
277
|
+
`LINKEDIN_FEATURE_NOT_SUBSCRIBED` (the LinkedIn account lacks the subscription, fix it on
|
|
278
|
+
LinkedIn) or `BETA_NOT_ENABLED` (a human enables beta in Settings, or pass `--beta` for this
|
|
279
|
+
call). Branch on the exit code the same way as example 4 above, and read the code for the
|
|
280
|
+
remedy. Write commands (`save-lead`, `save-account`, `message new`) accept `--preview` to
|
|
281
|
+
render the request without sending it.
|
|
236
282
|
|
|
237
283
|
### 1. Search Sales Navigator profiles, then get one full profile
|
|
238
284
|
|
|
@@ -321,9 +367,16 @@ curviate sales-nav save-account 112013061 --account acc_1 --list 987654
|
|
|
321
367
|
|
|
322
368
|
## Recruiter
|
|
323
369
|
|
|
324
|
-
Recruiter commands (`curviate recruiter ...`)
|
|
325
|
-
|
|
326
|
-
|
|
370
|
+
Recruiter commands (`curviate recruiter ...`) are **beta**: this surface has not been exercised
|
|
371
|
+
against a real Recruiter subscription yet, so its responses may still move.
|
|
372
|
+
|
|
373
|
+
There is no Recruiter add-on to buy from Curviate and no tier on a seat: one ordinary paid seat
|
|
374
|
+
entitles every command here. What these commands do need is the LinkedIn account's own Recruiter
|
|
375
|
+
subscription. A refusal is **exit code `5`** with one of three codes in the JSON body:
|
|
376
|
+
`NO_ACTIVE_SEAT` (no Curviate seat covers the account, fix it in billing),
|
|
377
|
+
`LINKEDIN_FEATURE_NOT_SUBSCRIBED` (the LinkedIn account lacks the subscription, fix it on
|
|
378
|
+
LinkedIn) or `BETA_NOT_ENABLED` (a human enables beta in Settings, or pass `--beta` for this
|
|
379
|
+
call). The surface is project-centric: most
|
|
327
380
|
operations are scoped to a hiring project id. Write commands (`save-candidate`, `project update`,
|
|
328
381
|
`project-job create`/`update`, `job create`/`publish`/`close`, `message new`) accept `--preview`
|
|
329
382
|
to render the request without sending it.
|
|
@@ -508,7 +561,7 @@ curviate inbox get 2-AbCdEf== --account acc_1 --mode cache_only --json
|
|
|
508
561
|
| 2 | Usage / argument error |
|
|
509
562
|
| 3 | Authentication or authorization failure |
|
|
510
563
|
| 4 | Resource not found |
|
|
511
|
-
| 5 |
|
|
564
|
+
| 5 | No active seat, the LinkedIn account lacks the subscription, or beta consent is missing |
|
|
512
565
|
| 6 | Rate limited |
|
|
513
566
|
| 7 | Transient platform error (retry likely to succeed) |
|
|
514
567
|
| 8 | Account or connection state blocks the request |
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import {
|
|
3
3
|
readlineSync
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-YLSJ4HKU.js";
|
|
5
5
|
import {
|
|
6
6
|
slimAccountGet,
|
|
7
7
|
slimAccountList,
|
|
@@ -10,27 +10,30 @@ import {
|
|
|
10
10
|
import {
|
|
11
11
|
pageDelayFromFlags,
|
|
12
12
|
streamAll
|
|
13
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-LKF5MZIP.js";
|
|
14
14
|
import {
|
|
15
15
|
buildPreviewOutput
|
|
16
16
|
} from "./chunk-R3VLWLVV.js";
|
|
17
17
|
import {
|
|
18
|
-
createClient,
|
|
19
18
|
renderError,
|
|
20
19
|
renderSuccess,
|
|
21
|
-
renderUnexpectedError
|
|
20
|
+
renderUnexpectedError
|
|
21
|
+
} from "./chunk-KQXYEQAD.js";
|
|
22
|
+
import {
|
|
23
|
+
createClient,
|
|
22
24
|
resolveEffectiveConfig
|
|
23
|
-
} from "./chunk-
|
|
24
|
-
import "./chunk-
|
|
25
|
+
} from "./chunk-TD2ZIXFR.js";
|
|
26
|
+
import "./chunk-PKSKQ3LN.js";
|
|
27
|
+
import {
|
|
28
|
+
AUTH_NEEDED
|
|
29
|
+
} from "./chunk-X3YWBMBC.js";
|
|
30
|
+
import "./chunk-TQJ77SL4.js";
|
|
25
31
|
import {
|
|
26
32
|
GLOBAL_FLAGS,
|
|
27
33
|
READ_SINGLE_FLAGS,
|
|
28
34
|
WRITE_SINGLE_FLAGS,
|
|
29
35
|
defaultReadStdin
|
|
30
|
-
} from "./chunk-
|
|
31
|
-
import {
|
|
32
|
-
AUTH_NEEDED
|
|
33
|
-
} from "./chunk-2OG6M6ME.js";
|
|
36
|
+
} from "./chunk-SKJNLN37.js";
|
|
34
37
|
|
|
35
38
|
// src/commands/account.ts
|
|
36
39
|
import { defineCommand } from "citty";
|
|
@@ -220,7 +223,7 @@ function resolveOutputOpts(flags) {
|
|
|
220
223
|
async function handleError(err, outOpts, out) {
|
|
221
224
|
const { CurviateError } = await import("@curviate/sdk");
|
|
222
225
|
if (err instanceof CurviateError) {
|
|
223
|
-
const { getExitCode } = await import("./exit-codes-
|
|
226
|
+
const { getExitCode } = await import("./exit-codes-RUKZC4WV.js");
|
|
224
227
|
renderError(err, outOpts, out);
|
|
225
228
|
process.exit(getExitCode(err.code));
|
|
226
229
|
}
|
|
@@ -273,6 +276,18 @@ async function buildAuthBody(flags, ctx) {
|
|
|
273
276
|
if (flags["auth-method"]) body["auth_method"] = flags["auth-method"];
|
|
274
277
|
if (flags["user-agent"]) body["user_agent"] = flags["user-agent"];
|
|
275
278
|
if (flags["recruiter-contract-id"]) body["recruiter_contract_id"] = flags["recruiter-contract-id"];
|
|
279
|
+
if (flags["linkedin-premium"] !== void 0) {
|
|
280
|
+
const value = flags["linkedin-premium"];
|
|
281
|
+
if (value !== "sales_navigator" && value !== "recruiter") {
|
|
282
|
+
ctx.out.stderr.write(
|
|
283
|
+
`error: --linkedin-premium must be one of: sales_navigator, recruiter. Got "${value}".
|
|
284
|
+
`
|
|
285
|
+
);
|
|
286
|
+
if (!ctx.previewMode) process.exit(2);
|
|
287
|
+
} else {
|
|
288
|
+
body["linkedin_premium"] = value;
|
|
289
|
+
}
|
|
290
|
+
}
|
|
276
291
|
if (flags["auth-method"] === "credentials") {
|
|
277
292
|
const password = await resolveSecret({
|
|
278
293
|
flagValue: flags.password,
|
|
@@ -922,7 +937,8 @@ var accountLinkCommand = defineCommand({
|
|
|
922
937
|
"proxy-username": { type: "string", description: "Proxy auth username." },
|
|
923
938
|
"proxy-password": { type: "string", description: `Proxy auth password. ${OPTIONAL_SECRET_WARNING("CURVIATE_PROXY_PASSWORD")}` },
|
|
924
939
|
"user-agent": { type: "string", description: "Browser User-Agent to pin for this account." },
|
|
925
|
-
"recruiter-contract-id": { type: "string", description: "Recruiter contract to bind to
|
|
940
|
+
"recruiter-contract-id": { type: "string", description: "Recruiter contract to bind to. Only meaningful when the LinkedIn account holds a Recruiter subscription." },
|
|
941
|
+
"linkedin-premium": { type: "string", description: "Narrow this connection to one LinkedIn premium surface: sales_navigator | recruiter. Omit it and the connect asks for every product and LinkedIn activates what the account holds. Applies to THIS call only and is never remembered, so restate it on every connect and reconnect where Recruiter must win." },
|
|
926
942
|
"account-id": { type: "string", description: "Existing account id (acc_...) to re-authenticate IN PLACE. Passing it makes this an in-place reconnect of that account. Omit to connect a NEW account into --seat-id." },
|
|
927
943
|
"no-interactive": {
|
|
928
944
|
type: "boolean",
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import {
|
|
3
|
-
assertNoStdinPlaceholder
|
|
4
|
-
} from "./chunk-AHYUM2XQ.js";
|
|
5
2
|
import {
|
|
6
3
|
getExitCode
|
|
7
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-X3YWBMBC.js";
|
|
5
|
+
import {
|
|
6
|
+
assertNoStdinPlaceholder
|
|
7
|
+
} from "./chunk-SKJNLN37.js";
|
|
8
8
|
|
|
9
9
|
// src/lib/path-safety.ts
|
|
10
10
|
var UNSAFE_CHARS = /[\u0000-\u0020\u007F/\\?#%]/;
|
|
@@ -1,54 +1,4 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import {
|
|
3
|
-
readConfig
|
|
4
|
-
} from "./chunk-KTY7R27U.js";
|
|
5
|
-
import {
|
|
6
|
-
assertNoStdinPlaceholder
|
|
7
|
-
} from "./chunk-AHYUM2XQ.js";
|
|
8
|
-
|
|
9
|
-
// src/lib/resolve.ts
|
|
10
|
-
var DEFAULT_BASE_URL = "https://api.curviate.com";
|
|
11
|
-
var DEFAULT_TIMEOUT_MS = 3e4;
|
|
12
|
-
async function resolveEffectiveConfig(flags) {
|
|
13
|
-
const cfg = await readConfig();
|
|
14
|
-
const profileName = flags.profile ?? (cfg?.active ?? "default");
|
|
15
|
-
const profile = cfg?.profiles[profileName];
|
|
16
|
-
const apiKey = flags.apiKey ?? process.env["CURVIATE_API_KEY"] ?? profile?.apiKey ?? void 0;
|
|
17
|
-
const baseUrl = flags.baseUrl ?? process.env["CURVIATE_BASE_URL"] ?? profile?.baseUrl ?? DEFAULT_BASE_URL;
|
|
18
|
-
const timeoutFlag = flags.timeout !== void 0 ? parseInt(flags.timeout, 10) : void 0;
|
|
19
|
-
const timeout = timeoutFlag ?? profile?.timeout ?? DEFAULT_TIMEOUT_MS;
|
|
20
|
-
const account = flags.account ?? process.env["CURVIATE_ACCOUNT"] ?? profile?.account ?? void 0;
|
|
21
|
-
return { apiKey, baseUrl, timeout, account };
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
// src/lib/client.ts
|
|
25
|
-
import { Curviate } from "@curviate/sdk";
|
|
26
|
-
function headerStrings(headers) {
|
|
27
|
-
if (!headers) return [];
|
|
28
|
-
if (headers instanceof Headers) {
|
|
29
|
-
const out = [];
|
|
30
|
-
headers.forEach((value, key) => out.push(key, value));
|
|
31
|
-
return out;
|
|
32
|
-
}
|
|
33
|
-
if (Array.isArray(headers)) return headers.flat().map(String);
|
|
34
|
-
return Object.entries(headers).flat().map(String);
|
|
35
|
-
}
|
|
36
|
-
var guardedFetch = (input, init) => {
|
|
37
|
-
assertNoStdinPlaceholder("the request about to be sent", [
|
|
38
|
-
String(input instanceof Request ? input.url : input),
|
|
39
|
-
...headerStrings(init?.headers),
|
|
40
|
-
typeof init?.body === "string" ? init.body : void 0
|
|
41
|
-
]);
|
|
42
|
-
return fetch(input, init);
|
|
43
|
-
};
|
|
44
|
-
function createClient(config) {
|
|
45
|
-
return new Curviate({
|
|
46
|
-
apiKey: config.apiKey.trim(),
|
|
47
|
-
fetch: guardedFetch,
|
|
48
|
-
...config.baseUrl !== void 0 ? { baseUrl: config.baseUrl } : {},
|
|
49
|
-
...config.timeout !== void 0 ? { timeout: config.timeout } : {}
|
|
50
|
-
});
|
|
51
|
-
}
|
|
52
2
|
|
|
53
3
|
// src/lib/output.ts
|
|
54
4
|
function isJsonMode(opts) {
|
|
@@ -227,10 +177,6 @@ function renderError(err, opts, out) {
|
|
|
227
177
|
);
|
|
228
178
|
} else {
|
|
229
179
|
let msg = `Error: [${errJson.code}] ${errJson.message}`;
|
|
230
|
-
if (errJson.requiredTier) {
|
|
231
|
-
msg += `
|
|
232
|
-
Required tier: ${errJson.requiredTier}`;
|
|
233
|
-
}
|
|
234
180
|
const safety = errJson;
|
|
235
181
|
if (safety.budgetRow) {
|
|
236
182
|
if (errJson.code === "BUDGET_EXHAUSTED") {
|
|
@@ -277,8 +223,6 @@ function renderUnexpectedError(err, out) {
|
|
|
277
223
|
}
|
|
278
224
|
|
|
279
225
|
export {
|
|
280
|
-
resolveEffectiveConfig,
|
|
281
|
-
createClient,
|
|
282
226
|
renderProvenanceNote,
|
|
283
227
|
renderSuccess,
|
|
284
228
|
renderNotices,
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
// src/lib/beta.ts
|
|
4
|
+
var BETA_CONSENT_HEADER = "X-Curviate-Beta";
|
|
5
|
+
var TRUE_TOKENS = /* @__PURE__ */ new Set(["true", "1", "on", "yes"]);
|
|
6
|
+
var FALSE_TOKENS = /* @__PURE__ */ new Set(["false", "0", "off", "no"]);
|
|
7
|
+
var BETA_ACCEPTED_VALUES = "true|false, 1|0, on|off, yes|no (case-insensitive)";
|
|
8
|
+
function parseBetaFlag(rawArgs) {
|
|
9
|
+
let value;
|
|
10
|
+
const rest = [];
|
|
11
|
+
let endOfFlags = false;
|
|
12
|
+
for (const arg of rawArgs) {
|
|
13
|
+
if (endOfFlags) {
|
|
14
|
+
rest.push(arg);
|
|
15
|
+
continue;
|
|
16
|
+
}
|
|
17
|
+
if (arg === "--") {
|
|
18
|
+
endOfFlags = true;
|
|
19
|
+
rest.push(arg);
|
|
20
|
+
continue;
|
|
21
|
+
}
|
|
22
|
+
if (arg === "--beta") {
|
|
23
|
+
value = true;
|
|
24
|
+
continue;
|
|
25
|
+
}
|
|
26
|
+
if (arg === "--no-beta") {
|
|
27
|
+
value = false;
|
|
28
|
+
continue;
|
|
29
|
+
}
|
|
30
|
+
if (arg.startsWith("--no-beta=")) {
|
|
31
|
+
return {
|
|
32
|
+
ok: false,
|
|
33
|
+
error: `--no-beta takes no value. Use --no-beta, or --beta=${BETA_ACCEPTED_VALUES.split(",")[0].split("|")[1]}.`
|
|
34
|
+
};
|
|
35
|
+
}
|
|
36
|
+
if (arg.startsWith("--beta=")) {
|
|
37
|
+
const raw = arg.slice("--beta=".length).trim().toLowerCase();
|
|
38
|
+
if (TRUE_TOKENS.has(raw)) {
|
|
39
|
+
value = true;
|
|
40
|
+
continue;
|
|
41
|
+
}
|
|
42
|
+
if (FALSE_TOKENS.has(raw)) {
|
|
43
|
+
value = false;
|
|
44
|
+
continue;
|
|
45
|
+
}
|
|
46
|
+
return {
|
|
47
|
+
ok: false,
|
|
48
|
+
error: `--beta must be one of ${BETA_ACCEPTED_VALUES}. Got "${arg.slice("--beta=".length)}".`
|
|
49
|
+
};
|
|
50
|
+
}
|
|
51
|
+
rest.push(arg);
|
|
52
|
+
}
|
|
53
|
+
return { ok: true, value, rest };
|
|
54
|
+
}
|
|
55
|
+
var override;
|
|
56
|
+
function setBetaOverride(value) {
|
|
57
|
+
override = value;
|
|
58
|
+
}
|
|
59
|
+
function betaOverrideHeader() {
|
|
60
|
+
if (override === void 0) return {};
|
|
61
|
+
return { [BETA_CONSENT_HEADER]: override ? "true" : "false" };
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
export {
|
|
65
|
+
parseBetaFlag,
|
|
66
|
+
setBetaOverride,
|
|
67
|
+
betaOverrideHeader
|
|
68
|
+
};
|
|
@@ -136,6 +136,14 @@ var GLOBAL_FLAGS = {
|
|
|
136
136
|
type: "boolean",
|
|
137
137
|
description: "Output the full SDK response instead of the slim default.",
|
|
138
138
|
default: false
|
|
139
|
+
},
|
|
140
|
+
// Declared here so `--help` renders it and the dispatcher's routing scan
|
|
141
|
+
// recognises it, but its VALUE is never read from citty: the dispatcher
|
|
142
|
+
// parses and strips the token first (see lib/beta.ts for why citty 0.1.6
|
|
143
|
+
// cannot express an optional-valued boolean without silently opting in).
|
|
144
|
+
beta: {
|
|
145
|
+
type: "boolean",
|
|
146
|
+
description: "Allow beta operations for THIS call only (--beta, --beta=false). A gated operation refuses BETA_NOT_ENABLED (exit 5) until a human enables beta in Settings, or you pass --beta for this call. Persists nothing."
|
|
139
147
|
}
|
|
140
148
|
};
|
|
141
149
|
var WRITE_FLAGS = {
|
|
@@ -146,7 +154,8 @@ var WRITE_FLAGS = {
|
|
|
146
154
|
timeout: GLOBAL_FLAGS.timeout,
|
|
147
155
|
json: GLOBAL_FLAGS.json,
|
|
148
156
|
preview: GLOBAL_FLAGS.preview,
|
|
149
|
-
verbose: GLOBAL_FLAGS.verbose
|
|
157
|
+
verbose: GLOBAL_FLAGS.verbose,
|
|
158
|
+
beta: GLOBAL_FLAGS.beta
|
|
150
159
|
};
|
|
151
160
|
var READ_SINGLE_FLAGS = {
|
|
152
161
|
"api-key": GLOBAL_FLAGS["api-key"],
|
|
@@ -157,7 +166,8 @@ var READ_SINGLE_FLAGS = {
|
|
|
157
166
|
json: GLOBAL_FLAGS.json,
|
|
158
167
|
fields: GLOBAL_FLAGS.fields,
|
|
159
168
|
preview: GLOBAL_FLAGS.preview,
|
|
160
|
-
verbose: GLOBAL_FLAGS.verbose
|
|
169
|
+
verbose: GLOBAL_FLAGS.verbose,
|
|
170
|
+
beta: GLOBAL_FLAGS.beta
|
|
161
171
|
};
|
|
162
172
|
var WRITE_SINGLE_FLAGS = READ_SINGLE_FLAGS;
|
|
163
173
|
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import {
|
|
3
|
+
betaOverrideHeader
|
|
4
|
+
} from "./chunk-PKSKQ3LN.js";
|
|
5
|
+
import {
|
|
6
|
+
readConfig
|
|
7
|
+
} from "./chunk-TQJ77SL4.js";
|
|
8
|
+
import {
|
|
9
|
+
assertNoStdinPlaceholder
|
|
10
|
+
} from "./chunk-SKJNLN37.js";
|
|
11
|
+
|
|
12
|
+
// src/lib/client.ts
|
|
13
|
+
import { Curviate } from "@curviate/sdk";
|
|
14
|
+
function headerStrings(headers) {
|
|
15
|
+
if (!headers) return [];
|
|
16
|
+
if (headers instanceof Headers) {
|
|
17
|
+
const out = [];
|
|
18
|
+
headers.forEach((value, key) => out.push(key, value));
|
|
19
|
+
return out;
|
|
20
|
+
}
|
|
21
|
+
if (Array.isArray(headers)) return headers.flat().map(String);
|
|
22
|
+
return Object.entries(headers).flat().map(String);
|
|
23
|
+
}
|
|
24
|
+
var guardedFetch = (input, init) => {
|
|
25
|
+
const beta = betaOverrideHeader();
|
|
26
|
+
let merged = init;
|
|
27
|
+
if (Object.keys(beta).length > 0) {
|
|
28
|
+
const headers = new Headers(init?.headers);
|
|
29
|
+
for (const [name, value] of Object.entries(beta)) headers.set(name, value);
|
|
30
|
+
merged = { ...init, headers };
|
|
31
|
+
}
|
|
32
|
+
assertNoStdinPlaceholder("the request about to be sent", [
|
|
33
|
+
String(input instanceof Request ? input.url : input),
|
|
34
|
+
...headerStrings(merged?.headers),
|
|
35
|
+
typeof merged?.body === "string" ? merged.body : void 0
|
|
36
|
+
]);
|
|
37
|
+
return fetch(input, merged);
|
|
38
|
+
};
|
|
39
|
+
function createClient(config) {
|
|
40
|
+
return new Curviate({
|
|
41
|
+
apiKey: config.apiKey.trim(),
|
|
42
|
+
fetch: guardedFetch,
|
|
43
|
+
...config.baseUrl !== void 0 ? { baseUrl: config.baseUrl } : {},
|
|
44
|
+
...config.timeout !== void 0 ? { timeout: config.timeout } : {}
|
|
45
|
+
});
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
// src/lib/resolve.ts
|
|
49
|
+
var DEFAULT_BASE_URL = "https://api.curviate.com";
|
|
50
|
+
var DEFAULT_TIMEOUT_MS = 3e4;
|
|
51
|
+
async function resolveEffectiveConfig(flags) {
|
|
52
|
+
const cfg = await readConfig();
|
|
53
|
+
const profileName = flags.profile ?? (cfg?.active ?? "default");
|
|
54
|
+
const profile = cfg?.profiles[profileName];
|
|
55
|
+
const apiKey = flags.apiKey ?? process.env["CURVIATE_API_KEY"] ?? profile?.apiKey ?? void 0;
|
|
56
|
+
const apiKeySource = flags.apiKey !== void 0 ? "flag" : process.env["CURVIATE_API_KEY"] !== void 0 ? "env" : profile?.apiKey !== void 0 ? "profile" : "none";
|
|
57
|
+
const baseUrl = flags.baseUrl ?? process.env["CURVIATE_BASE_URL"] ?? profile?.baseUrl ?? DEFAULT_BASE_URL;
|
|
58
|
+
const timeoutFlag = flags.timeout !== void 0 ? parseInt(flags.timeout, 10) : void 0;
|
|
59
|
+
const timeout = timeoutFlag ?? profile?.timeout ?? DEFAULT_TIMEOUT_MS;
|
|
60
|
+
const account = flags.account ?? process.env["CURVIATE_ACCOUNT"] ?? profile?.account ?? void 0;
|
|
61
|
+
return { apiKey, baseUrl, timeout, account, apiKeySource };
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
export {
|
|
65
|
+
createClient,
|
|
66
|
+
resolveEffectiveConfig
|
|
67
|
+
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import {
|
|
3
3
|
assertNoStdinPlaceholder
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-SKJNLN37.js";
|
|
5
5
|
|
|
6
6
|
// src/lib/config.ts
|
|
7
7
|
import {
|
|
@@ -129,6 +129,8 @@ async function updateProfileField(profileName, field, value) {
|
|
|
129
129
|
profile.account = value !== void 0 ? String(value) : void 0;
|
|
130
130
|
} else if (field === "baseUrl") {
|
|
131
131
|
profile.baseUrl = value !== void 0 ? String(value) : void 0;
|
|
132
|
+
} else if (field === "tenant") {
|
|
133
|
+
profile.tenant = value !== void 0 ? String(value) : void 0;
|
|
132
134
|
}
|
|
133
135
|
}
|
|
134
136
|
await writeConfig(cfg);
|