@curviate/cli 0.42.0 → 0.43.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 CHANGED
@@ -8,6 +8,37 @@ a new command or flag is a minor; a breaking command/flag/exit-code change is a
8
8
 
9
9
  ## [Unreleased]
10
10
 
11
+ ## [0.43.0] - 2026-09-25
12
+
13
+ Programmatic connect at scale: tag accounts with your own end-user id, one
14
+ account-status webhook for every account, and the verification-method choice
15
+ on checkpoints. Requires `@curviate/sdk` 0.38.0.
16
+
17
+ ### Added
18
+
19
+ - **`account link --external-id <id> --timezone <zone> --products <list>`.**
20
+ `--external-id` stores your own id for the account's end user; it comes back
21
+ on the account and on every account webhook. `--timezone` is an IANA zone
22
+ (`Europe/Berlin`). `--products` narrows the premium products asked for
23
+ (`sales_navigator`, `recruiter`, comma-separated); an empty or unknown value
24
+ exits 2.
25
+ - **`account list --external-id <id>`** lists only that end user's accounts.
26
+ `account list` and `account get` show `external_id` in their default view.
27
+ - **`account checkpoint request <account_id> --challenge <id>`** answers a
28
+ `challenge_selection` checkpoint (LinkedIn asking which method to verify
29
+ with: `email`, `sms` or `whatsapp`). It prints the next checkpoint and
30
+ exits 12; finish with `account checkpoint solve`.
31
+ - **`webhook create --source account_status` without `--account-ids`** covers
32
+ every current and future account. `messaging` and `user` still require
33
+ `--account-ids`, and an empty `--account-ids` value exits 2 instead of
34
+ widening to every account.
35
+
36
+ ### Changed
37
+
38
+ - **`account link` on a terminal no longer prompts for a code at a
39
+ `challenge_selection` checkpoint.** It prints the choices, names the
40
+ `checkpoint request --challenge` command, and exits 12.
41
+
11
42
  ## [0.42.0] - 2026-09-23
12
43
 
13
44
  Adds examples to every command's help and the manifest the docs site
@@ -6,7 +6,7 @@ import {
6
6
  slimAccountGet,
7
7
  slimAccountList,
8
8
  slimAccountListItem
9
- } from "./chunk-XP2LN6F6.js";
9
+ } from "./chunk-EGDDVF3Q.js";
10
10
  import {
11
11
  buildPreviewOutput
12
12
  } from "./chunk-TCUYH5GO.js";
@@ -216,6 +216,7 @@ async function runAccountList(client, flags, out) {
216
216
  const params = {};
217
217
  if (limit !== void 0) params["limit"] = limit;
218
218
  if (cursor) params["cursor"] = cursor;
219
+ if (flags["external-id"] !== void 0) params["external_id"] = flags["external-id"];
219
220
  try {
220
221
  if (all) {
221
222
  const fn = (p) => client.accounts.list(p);
@@ -302,6 +303,20 @@ async function buildAuthBody(flags, ctx) {
302
303
  body["linkedin_premium"] = value;
303
304
  }
304
305
  }
306
+ if (flags["external-id"] !== void 0) body["external_id"] = flags["external-id"];
307
+ if (flags.timezone !== void 0) body["timezone"] = flags.timezone;
308
+ if (flags.products !== void 0) {
309
+ const products = flags.products.split(",").map((p) => p.trim()).filter(Boolean);
310
+ if (products.length === 0 || products.some((p) => p !== "sales_navigator" && p !== "recruiter")) {
311
+ ctx.out.stderr.write(
312
+ `error: --products takes a comma-separated list of: sales_navigator, recruiter. Got "${flags.products}".
313
+ `
314
+ );
315
+ if (!ctx.previewMode) process.exit(2);
316
+ } else {
317
+ body["products"] = products;
318
+ }
319
+ }
305
320
  if (flags["auth-method"] === "credentials") {
306
321
  const password = await resolveSecret({
307
322
  flagValue: flags.password,
@@ -437,6 +452,16 @@ async function runInteractiveCheckpointLoop(client, initial, ctx) {
437
452
  for (; ; ) {
438
453
  const challengeType = current.challenge_type;
439
454
  const accountId = current.account_id ?? "";
455
+ if (current.challenge_type === "challenge_selection") {
456
+ readableObject(current);
457
+ renderSuccess(current, ctx.outOpts, ctx.out);
458
+ ctx.out.stderr.write(
459
+ `Choose how LinkedIn verifies this sign-in: curviate account checkpoint request ${accountId} --challenge <id> (an id from challenges).
460
+ `
461
+ );
462
+ process.exit(AUTH_NEEDED);
463
+ return;
464
+ }
440
465
  printChallengeCopy(challengeType, ctx.out);
441
466
  printResendHintIfApplicable(challengeType, accountId, ctx.out);
442
467
  if (challengeType === "mobile_app_approval") {
@@ -841,21 +866,26 @@ async function runAccountCheckpointRequest(client, flags, out) {
841
866
  }
842
867
  const accountId = flags["account-id"] ?? "";
843
868
  const outOpts = resolveOutputOpts(flags);
869
+ const body = flags.challenge !== void 0 ? { challenge: flags.challenge } : void 0;
844
870
  if (flags.preview) {
845
871
  const preview = buildPreviewOutput({
846
872
  method: "auth.requestCheckpoint",
847
873
  args: { accountId },
848
- body: {}
874
+ body: body ?? {}
849
875
  });
850
876
  out.stdout.write(JSON.stringify(preview) + "\n");
851
877
  return;
852
878
  }
879
+ let chained = false;
853
880
  try {
854
- const result = await client.auth.requestCheckpoint(accountId);
881
+ const result = body ? await client.auth.requestCheckpoint(accountId, body) : await client.auth.requestCheckpoint(accountId);
855
882
  renderSuccess(result, outOpts, out);
883
+ chained = result.status === "checkpoint_required";
856
884
  } catch (err) {
857
885
  await handleError(err, outOpts, out);
886
+ return;
858
887
  }
888
+ if (chained) process.exit(AUTH_NEEDED);
859
889
  }
860
890
  function formatRemaining(ms) {
861
891
  const totalSec = Math.max(0, Math.ceil(ms / 1e3));
@@ -962,10 +992,14 @@ var accountListCommand = defineCommand({
962
992
  description: "List connected LinkedIn accounts.",
963
993
  examples: [
964
994
  "curviate account list",
965
- "curviate account list --json --fields items.account_id,items.status"
995
+ "curviate account list --json --fields items.account_id,items.status",
996
+ "curviate account list --external-id usr_42"
966
997
  ]
967
998
  },
968
- args: { ...readOnly(GLOBAL_FLAGS) },
999
+ args: {
1000
+ ...readOnly(GLOBAL_FLAGS),
1001
+ "external-id": { type: "string", description: "Only accounts whose external_id (your own end-user id, set on link) equals this value exactly." }
1002
+ },
969
1003
  async run({ args }) {
970
1004
  const flags = args;
971
1005
  const cfg = await resolveEffectiveConfig({
@@ -1073,6 +1107,9 @@ var accountLinkCommand = defineCommand({
1073
1107
  "user-agent": { type: "string", description: "Browser User-Agent to pin for this account. Required with --auth-method cookie: a session cookie only works paired with the User-Agent of the browser it was copied from, and the command exits 2 without it. Optional with --auth-method credentials, where it is still pinned for the account when given." },
1074
1108
  "recruiter-contract-id": { type: "string", description: "Recruiter contract to bind to. Only meaningful when the LinkedIn account holds a Recruiter subscription." },
1075
1109
  "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." },
1110
+ products: { type: "string", description: "Comma-separated premium products to ask for: sales_navigator, recruiter. Omit to ask for both (--linkedin-premium still narrows). Classic LinkedIn and company pages are always included." },
1111
+ "external-id": { type: "string", description: "Your own id for this account's end user (1-255 chars, not unique). Returned on the account and every account webhook; filter with `account list --external-id`. Use an opaque id, not an email." },
1112
+ timezone: { type: "string", description: "IANA time zone for the account, e.g. Europe/Berlin. A UTC offset is refused." },
1076
1113
  "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." },
1077
1114
  "no-interactive": {
1078
1115
  type: "boolean",
@@ -1303,9 +1340,10 @@ var accountCheckpointPollCommand = defineCommand({
1303
1340
  var accountCheckpointRequestCommand = defineCommand({
1304
1341
  meta: {
1305
1342
  name: "request",
1306
- description: "Re-request the challenge notification for a pending checkpoint (e.g. re-send an OTP email, SMS code, or mobile-app approval push). Not every challenge type supports it; an authenticator- app code has nothing to re-send. The response's `resent` boolean tells you honestly whether a new notification actually went out; the command still exits 0 either way.",
1343
+ description: "Re-request the challenge notification for a pending checkpoint (e.g. re-send an OTP email, SMS code, or mobile-app approval push). Not every challenge type supports it; an authenticator- app code has nothing to re-send. The response's `resent` boolean tells you honestly whether a new notification actually went out; the command still exits 0 either way. With --challenge it instead answers a challenge_selection checkpoint by picking the verification method.",
1307
1344
  examples: [
1308
- "curviate account checkpoint request acc_YOUR_ACCOUNT_ID"
1345
+ "curviate account checkpoint request acc_YOUR_ACCOUNT_ID",
1346
+ "curviate account checkpoint request acc_YOUR_ACCOUNT_ID --challenge sms"
1309
1347
  ]
1310
1348
  },
1311
1349
  args: {
@@ -1313,6 +1351,10 @@ var accountCheckpointRequestCommand = defineCommand({
1313
1351
  "account-id": {
1314
1352
  type: "positional",
1315
1353
  description: "The provisional account_id (acc_...) from the 202 checkpoint_required response."
1354
+ },
1355
+ challenge: {
1356
+ type: "string",
1357
+ description: "Answer a challenge_selection checkpoint: an id from its challenges list (email | sms | whatsapp). Prints the next checkpoint and exits 12; solve it with `checkpoint solve`. Omit to re-send the current code."
1316
1358
  }
1317
1359
  },
1318
1360
  async run({ args }) {
@@ -248,7 +248,8 @@ function slimAccountListItem(item) {
248
248
  full_name: item["full_name"] ?? null,
249
249
  headline: item["headline"] ?? null,
250
250
  seat_id: item["seat_id"] ?? null,
251
- connected_at: item["connected_at"] ?? null
251
+ connected_at: item["connected_at"] ?? null,
252
+ external_id: item["external_id"] ?? null
252
253
  };
253
254
  }
254
255
  function slimAccountList(data) {
@@ -266,6 +267,7 @@ function slimAccountGet(data) {
266
267
  headline: d["headline"] ?? null,
267
268
  seat_id: d["seat_id"] ?? null,
268
269
  connected_at: d["connected_at"] ?? null,
270
+ external_id: d["external_id"] ?? null,
269
271
  last_checked_at: d["last_checked_at"] ?? null,
270
272
  quotas: d["quotas"] ?? [],
271
273
  account_states: d["account_states"] ?? []
package/dist/cli.js CHANGED
@@ -34,20 +34,20 @@ var main = defineCommand({
34
34
  // ---------------------------------------------------------------------------
35
35
  // Noun groups, lazy-loaded on first invocation.
36
36
  // ---------------------------------------------------------------------------
37
- profile: () => import("./profile-NHTYGX7K.js").then((m) => m.profileCommand),
38
- company: () => import("./company-WX5QOASS.js").then((m) => m.companyCommand),
39
- job: () => import("./job-XW3WM57J.js").then((m) => m.jobCommand),
40
- connect: () => import("./connect-IYTFL7NT.js").then((m) => m.connectCommand),
41
- search: () => import("./search-XDOQZAVG.js").then((m) => m.searchCommand),
37
+ profile: () => import("./profile-BHZPRUFU.js").then((m) => m.profileCommand),
38
+ company: () => import("./company-2WKYM34T.js").then((m) => m.companyCommand),
39
+ job: () => import("./job-OJB4VSI2.js").then((m) => m.jobCommand),
40
+ connect: () => import("./connect-GHABKXB2.js").then((m) => m.connectCommand),
41
+ search: () => import("./search-3MRQE6VC.js").then((m) => m.searchCommand),
42
42
  inbox: () => import("./inbox-W3KR65VD.js").then((m) => m.inboxCommand),
43
43
  inboxes: () => import("./inboxes-XYS3IRT6.js").then((m) => m.inboxesCommand),
44
44
  message: () => import("./message-5XC7U4JC.js").then((m) => m.messageCommand),
45
45
  post: () => import("./post-LSEBRQYK.js").then((m) => m.postCommand),
46
46
  comment: () => import("./comment-G4EXIIAQ.js").then((m) => m.commentCommand),
47
- account: () => import("./account-PFK5YROZ.js").then((m) => m.accountCommand),
48
- webhook: () => import("./webhook-XOPRW63N.js").then((m) => m.webhookCommand),
47
+ account: () => import("./account-FDPUPVFB.js").then((m) => m.accountCommand),
48
+ webhook: () => import("./webhook-TOQUQPT4.js").then((m) => m.webhookCommand),
49
49
  "sales-nav": () => import("./sales-nav-77NP3UXV.js").then((m) => m.salesNavCommand),
50
- recruiter: () => import("./recruiter-4SDAROK4.js").then((m) => m.recruiterCommand),
50
+ recruiter: () => import("./recruiter-JUA4BZIC.js").then((m) => m.recruiterCommand),
51
51
  group: () => import("./group-JDP2HVSV.js").then((m) => m.groupCommand),
52
52
  feed: () => import("./feed-XC5235UF.js").then((m) => m.feedCommand),
53
53
  notification: () => import("./notification-RIUSYJV6.js").then((m) => m.notificationCommand)
@@ -7,7 +7,7 @@ import {
7
7
  slimSearchJobs,
8
8
  slimSearchPeople,
9
9
  slimSearchPosts
10
- } from "./chunk-XP2LN6F6.js";
10
+ } from "./chunk-EGDDVF3Q.js";
11
11
  import {
12
12
  sentAsNotice
13
13
  } from "./chunk-OUMMWC7G.js";
@@ -4,7 +4,7 @@ import {
4
4
  slimInviteReceivedItem,
5
5
  slimInviteSent,
6
6
  slimInviteSentItem
7
- } from "./chunk-XP2LN6F6.js";
7
+ } from "./chunk-EGDDVF3Q.js";
8
8
  import {
9
9
  nearestSubcommand
10
10
  } from "./chunk-HOQ7EUHJ.js";
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  slimJob
4
- } from "./chunk-XP2LN6F6.js";
4
+ } from "./chunk-EGDDVF3Q.js";
5
5
  import {
6
6
  BinaryOutputError,
7
7
  writeBinaryOutput
@@ -4,7 +4,7 @@ import {
4
4
  slimProfile,
5
5
  slimProfileMe,
6
6
  withRequestedSections
7
- } from "./chunk-XP2LN6F6.js";
7
+ } from "./chunk-EGDDVF3Q.js";
8
8
  import {
9
9
  RETRIEVAL_FLAGS,
10
10
  hasRetrievalFlags,
@@ -6,7 +6,7 @@ import {
6
6
  } from "./chunk-KJ24DIAJ.js";
7
7
  import {
8
8
  slimJob
9
- } from "./chunk-XP2LN6F6.js";
9
+ } from "./chunk-EGDDVF3Q.js";
10
10
  import {
11
11
  BinaryOutputError,
12
12
  writeBinaryOutput
@@ -14,7 +14,7 @@ import {
14
14
  slimSearchPeopleItem,
15
15
  slimSearchPosts,
16
16
  slimSearchPostsItem
17
- } from "./chunk-XP2LN6F6.js";
17
+ } from "./chunk-EGDDVF3Q.js";
18
18
  import {
19
19
  requireAccount
20
20
  } from "./chunk-BLJGV6ST.js";
@@ -68,16 +68,25 @@ async function runWebhookCreate(client, flags, out) {
68
68
  out.stderr.write("error: --request-url is required (HTTPS URL for webhook deliveries).\n");
69
69
  process.exit(2);
70
70
  }
71
- if (!flags["account-ids"]) {
72
- out.stderr.write("error: --account-ids is required (comma-separated list of acc_... ids).\n");
73
- process.exit(2);
74
- }
75
- const accountIds = flags["account-ids"].split(",").map((s) => s.trim()).filter(Boolean);
76
71
  const body = {
77
72
  source: flags.source,
78
- request_url: flags["request-url"],
79
- account_ids: accountIds
73
+ request_url: flags["request-url"]
80
74
  };
75
+ if (flags["account-ids"] !== void 0) {
76
+ const accountIds = flags["account-ids"].split(",").map((s) => s.trim()).filter(Boolean);
77
+ if (accountIds.length === 0) {
78
+ out.stderr.write(
79
+ "error: --account-ids was given an empty value. Pass acc_... ids, or omit the flag on an account_status webhook to cover every account.\n"
80
+ );
81
+ process.exit(2);
82
+ }
83
+ body["account_ids"] = accountIds;
84
+ } else if (flags.source !== "account_status") {
85
+ out.stderr.write(
86
+ "error: --account-ids is required when --source is messaging or user (comma-separated acc_... ids). Only an account_status webhook may omit it.\n"
87
+ );
88
+ process.exit(2);
89
+ }
81
90
  if (flags.name) body["name"] = flags.name;
82
91
  if (flags.enabled !== void 0) body["enabled"] = flags.enabled;
83
92
  if (flags.events) {
@@ -271,14 +280,17 @@ var webhookCreateCommand = defineCommand({
271
280
  description: "Register a new webhook endpoint.",
272
281
  examples: [
273
282
  "curviate webhook create --source messaging --request-url https://example.com/hooks/curviate --account-ids acc_YOUR_ACCOUNT_ID",
274
- "curviate webhook create --source account_status --request-url https://example.com/hooks/curviate --account-ids acc_YOUR_ACCOUNT_ID --name status"
283
+ "curviate webhook create --source account_status --request-url https://example.com/hooks/curviate --name status"
284
+ ],
285
+ requires: [
286
+ "--account-ids for --source messaging and user; omit it with --source account_status to cover every current and future account."
275
287
  ]
276
288
  },
277
289
  args: {
278
290
  ...NON_STREAM_FLAGS,
279
291
  source: { type: "string", description: "Event source: messaging | user | account_status.", required: true },
280
292
  "request-url": { type: "string", description: "HTTPS URL to receive webhook deliveries.", required: true },
281
- "account-ids": { type: "string", description: "Comma-separated account ids to target (required).", required: true },
293
+ "account-ids": { type: "string", description: "Comma-separated account ids to target. Required for messaging and user; omit on account_status to cover every current and future account." },
282
294
  name: { type: "string", description: "Human-readable name (1-100 chars)." },
283
295
  enabled: { type: "boolean", description: "Create as enabled (default: true).", default: true },
284
296
  events: { type: "string", description: "Comma-separated event names to subscribe to." },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@curviate/cli",
3
- "version": "0.42.0",
3
+ "version": "0.43.0",
4
4
  "private": false,
5
5
  "description": "Official command-line interface for the Curviate API.",
6
6
  "license": "MIT",
@@ -47,7 +47,7 @@
47
47
  "clean": "rm -rf dist *.tsbuildinfo"
48
48
  },
49
49
  "dependencies": {
50
- "@curviate/sdk": "0.37.1",
50
+ "@curviate/sdk": "0.38.0",
51
51
  "citty": "^0.1.6",
52
52
  "open": "^10.1.0"
53
53
  },