@curviate/cli 0.25.0 → 0.27.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 (30) hide show
  1. package/CHANGELOG.md +138 -1
  2. package/README.md +104 -0
  3. package/dist/{account-52BUCCTZ.js → account-5KGM6EPR.js} +5 -5
  4. package/dist/{chunk-PMRQXBCP.js → chunk-2OG6M6ME.js} +22 -0
  5. package/dist/{chunk-XHVR32RW.js → chunk-5KANHEBN.js} +66 -5
  6. package/dist/{chunk-PS6QPY67.js → chunk-63X3VI3T.js} +5 -2
  7. package/dist/{chunk-RJTG5YWE.js → chunk-6P52Q2GK.js} +2 -2
  8. package/dist/{chunk-LCLYFE54.js → chunk-GHT2DLZR.js} +1 -1
  9. package/dist/{chunk-VAUKRTRG.js → chunk-LJR4LJG6.js} +2 -1
  10. package/dist/chunk-PQWDDSV7.js +65 -0
  11. package/dist/{chunk-RXIPY4O7.js → chunk-TAOXJNQN.js} +3 -3
  12. package/dist/cli.js +17 -17
  13. package/dist/{comment-XAF7AMHR.js → comment-BLG4WHST.js} +6 -6
  14. package/dist/{company-PAKHOCVR.js → company-ZT65QZ6F.js} +7 -7
  15. package/dist/{connect-5TMGM326.js → connect-57AUN33D.js} +11 -11
  16. package/dist/{exit-codes-KAVZN5BQ.js → exit-codes-U5CHA6FT.js} +1 -1
  17. package/dist/{feed-E5EQMI7T.js → feed-3AWI2URQ.js} +5 -5
  18. package/dist/{group-SNCEAWKI.js → group-DYC2NX5M.js} +5 -5
  19. package/dist/{inbox-R5OSZWTG.js → inbox-CQO2I47N.js} +25 -7
  20. package/dist/{inboxes-6XMIABRX.js → inboxes-XQ2B6X3Q.js} +5 -5
  21. package/dist/{job-3HU7KQQI.js → job-NUT4QMH2.js} +6 -6
  22. package/dist/{message-GA7D3A6Y.js → message-KMNRUD4H.js} +4 -4
  23. package/dist/{notification-B5PTNNPE.js → notification-LEM57IBY.js} +5 -5
  24. package/dist/{post-QAVRVRON.js → post-FXAANNUB.js} +6 -6
  25. package/dist/{profile-REKGQYAW.js → profile-72V55PZM.js} +41 -14
  26. package/dist/{recruiter-N36AROW7.js → recruiter-JUNB5AUR.js} +6 -6
  27. package/dist/{sales-nav-Q5RVL4PR.js → sales-nav-BALVVD35.js} +5 -5
  28. package/dist/{search-SYWHOM5J.js → search-QCXTK33P.js} +14 -14
  29. package/dist/{webhook-RE2BGX3N.js → webhook-D4QRWF7W.js} +3 -3
  30. package/package.json +2 -2
@@ -1,8 +1,13 @@
1
1
  #!/usr/bin/env node
2
+ import {
3
+ RETRIEVAL_FLAGS,
4
+ hasRetrievalFlags,
5
+ parseRetrievalFlags
6
+ } from "./chunk-PQWDDSV7.js";
2
7
  import {
3
8
  resolveMemberOrMeProviderId,
4
9
  resolveMemberProviderId
5
- } from "./chunk-RJTG5YWE.js";
10
+ } from "./chunk-6P52Q2GK.js";
6
11
  import {
7
12
  AttachError,
8
13
  readAttachment,
@@ -11,17 +16,17 @@ import {
11
16
  import {
12
17
  slimProfile,
13
18
  slimProfileMe
14
- } from "./chunk-VAUKRTRG.js";
19
+ } from "./chunk-LJR4LJG6.js";
15
20
  import {
16
21
  pageDelayFromFlags,
17
22
  streamAll
18
- } from "./chunk-PS6QPY67.js";
23
+ } from "./chunk-63X3VI3T.js";
19
24
  import {
20
25
  resolveIdentifier
21
26
  } from "./chunk-UEAX6KUB.js";
22
27
  import {
23
28
  requireAccount
24
- } from "./chunk-LCLYFE54.js";
29
+ } from "./chunk-GHT2DLZR.js";
25
30
  import {
26
31
  buildPreviewOutput
27
32
  } from "./chunk-R3VLWLVV.js";
@@ -31,14 +36,14 @@ import {
31
36
  renderSuccess,
32
37
  renderUnexpectedError,
33
38
  resolveEffectiveConfig
34
- } from "./chunk-XHVR32RW.js";
39
+ } from "./chunk-5KANHEBN.js";
35
40
  import "./chunk-KTY7R27U.js";
36
41
  import {
37
42
  GLOBAL_FLAGS,
38
43
  READ_SINGLE_FLAGS,
39
44
  WRITE_SINGLE_FLAGS
40
45
  } from "./chunk-AHYUM2XQ.js";
41
- import "./chunk-PMRQXBCP.js";
46
+ import "./chunk-2OG6M6ME.js";
42
47
 
43
48
  // src/commands/profile.ts
44
49
  import { defineCommand } from "citty";
@@ -93,6 +98,22 @@ function rejectAllOnNonPaginated(all, out) {
93
98
  process.exit(2);
94
99
  }
95
100
  }
101
+ function retrievalQueryOrExit(flags, branchTakesRetrieval, out) {
102
+ if (!branchTakesRetrieval && hasRetrievalFlags(flags)) {
103
+ out.stderr.write(
104
+ "error: --mode/--max-age apply to the profile read itself, not to --posts/--comments/--reactions/--followers. Those list endpoints do not accept them.\n"
105
+ );
106
+ process.exit(2);
107
+ return null;
108
+ }
109
+ const parsed = parseRetrievalFlags(flags);
110
+ if (!parsed.ok) {
111
+ out.stderr.write(parsed.error);
112
+ process.exit(2);
113
+ return null;
114
+ }
115
+ return parsed.query;
116
+ }
96
117
  function buildOutputStreams() {
97
118
  return {
98
119
  stdout: { write: (s) => process.stdout.write(s) },
@@ -118,6 +139,8 @@ async function runProfileMe(client, flags, out) {
118
139
  process.exit(2);
119
140
  return;
120
141
  }
142
+ const retrievalQuery = retrievalQueryOrExit(flags, !hasActivityFlag, out);
143
+ if (retrievalQuery === null) return;
121
144
  const accountId = await requireAccount(client, flags, out);
122
145
  const ns = client.account(accountId);
123
146
  const outOpts = resolveOutputOpts(flags);
@@ -188,7 +211,7 @@ async function runProfileMe(client, flags, out) {
188
211
  } catch (err) {
189
212
  const { CurviateError } = await import("@curviate/sdk");
190
213
  if (err instanceof CurviateError) {
191
- const { getExitCode } = await import("./exit-codes-KAVZN5BQ.js");
214
+ const { getExitCode } = await import("./exit-codes-U5CHA6FT.js");
192
215
  renderError(err, outOpts, out);
193
216
  process.exit(getExitCode(err.code));
194
217
  }
@@ -197,7 +220,7 @@ async function runProfileMe(client, flags, out) {
197
220
  }
198
221
  return;
199
222
  }
200
- const params = {};
223
+ const params = { ...retrievalQuery };
201
224
  if (flags.sections) {
202
225
  const parsedSections = parseSectionsFlag(flags.sections);
203
226
  if (!parsedSections.ok) {
@@ -214,7 +237,7 @@ async function runProfileMe(client, flags, out) {
214
237
  } catch (err) {
215
238
  const { CurviateError } = await import("@curviate/sdk");
216
239
  if (err instanceof CurviateError) {
217
- const { getExitCode } = await import("./exit-codes-KAVZN5BQ.js");
240
+ const { getExitCode } = await import("./exit-codes-U5CHA6FT.js");
218
241
  renderError(err, outOpts, out);
219
242
  process.exit(getExitCode(err.code));
220
243
  }
@@ -240,6 +263,8 @@ async function runProfileGet(client, flags, out) {
240
263
  }
241
264
  parsedSections = result.sections;
242
265
  }
266
+ const retrievalQuery = retrievalQueryOrExit(flags, !isListCommand, out);
267
+ if (retrievalQuery === null) return;
243
268
  const accountId = await requireAccount(client, flags, out);
244
269
  const rawId = flags.id ?? "";
245
270
  const resolvedId = resolveIdentifier(rawId);
@@ -328,11 +353,11 @@ async function runProfileGet(client, flags, out) {
328
353
  }
329
354
  } else {
330
355
  rejectAllOnNonPaginated(flags.all, out);
331
- const params = {};
356
+ const params = { ...retrievalQuery };
332
357
  if (parsedSections) {
333
358
  params.linkedin_sections = parsedSections;
334
359
  }
335
- const getId = flags.sections ? await resolveMemberOrMeProviderId(ns, rawId) : resolvedId;
360
+ const getId = flags.sections ? await resolveMemberOrMeProviderId(ns, rawId, retrievalQuery) : resolvedId;
336
361
  const result = await ns.users.get(getId, params);
337
362
  const getOutOpts = { ...outOpts, slim: slimProfile };
338
363
  renderSuccess(result, getOutOpts, out);
@@ -340,7 +365,7 @@ async function runProfileGet(client, flags, out) {
340
365
  } catch (err) {
341
366
  const { CurviateError } = await import("@curviate/sdk");
342
367
  if (err instanceof CurviateError) {
343
- const { getExitCode } = await import("./exit-codes-KAVZN5BQ.js");
368
+ const { getExitCode } = await import("./exit-codes-U5CHA6FT.js");
344
369
  renderError(err, outOpts, out);
345
370
  process.exit(getExitCode(err.code));
346
371
  }
@@ -377,7 +402,7 @@ async function runProfileRelations(client, flags, out) {
377
402
  } catch (err) {
378
403
  const { CurviateError } = await import("@curviate/sdk");
379
404
  if (err instanceof CurviateError) {
380
- const { getExitCode } = await import("./exit-codes-KAVZN5BQ.js");
405
+ const { getExitCode } = await import("./exit-codes-U5CHA6FT.js");
381
406
  renderError(err, outOpts, out);
382
407
  process.exit(getExitCode(err.code));
383
408
  }
@@ -417,7 +442,7 @@ async function runProfileEndorse(client, flags, out) {
417
442
  async function handleSdkError(err, outOpts, out) {
418
443
  const { CurviateError } = await import("@curviate/sdk");
419
444
  if (err instanceof CurviateError) {
420
- const { getExitCode } = await import("./exit-codes-KAVZN5BQ.js");
445
+ const { getExitCode } = await import("./exit-codes-U5CHA6FT.js");
421
446
  renderError(err, outOpts, out);
422
447
  process.exit(getExitCode(err.code));
423
448
  }
@@ -649,6 +674,7 @@ var profileMeCommand = defineCommand({
649
674
  meta: { name: "me", description: "Get your own profile, or list own activity with --posts/--comments/--reactions/--followers." },
650
675
  args: {
651
676
  ...GLOBAL_FLAGS,
677
+ ...RETRIEVAL_FLAGS,
652
678
  sections: {
653
679
  type: "string",
654
680
  description: "Comma-separated LinkedIn sections to fetch: linkedin_experience, linkedin_education, linkedin_languages, linkedin_skills, linkedin_certifications, linkedin_volunteer_experience, linkedin_projects, linkedin_recommendations, linkedin_interests, or linkedin_* for all (each also has a _preview variant). A bare value (e.g. skills) is auto-prefixed to linkedin_skills. Only applies to the base getMe call (no activity flag)."
@@ -852,6 +878,7 @@ var profileCommand = defineCommand({
852
878
  reactions: { type: "boolean", description: "List the profile's reactions.", default: false },
853
879
  followers: { type: "boolean", description: "List the profile's followers.", default: false },
854
880
  "is-company": { type: "boolean", description: "When listing posts, treat the profile as a company page.", default: false },
881
+ ...RETRIEVAL_FLAGS,
855
882
  sections: {
856
883
  type: "string",
857
884
  description: "Comma-separated LinkedIn sections to fetch: linkedin_experience, linkedin_education, linkedin_languages, linkedin_skills, linkedin_certifications, linkedin_volunteer_experience, linkedin_projects, linkedin_recommendations, linkedin_interests, or linkedin_* for all (each also has a _preview variant). A bare value (e.g. skills) is auto-prefixed to linkedin_skills."
@@ -11,11 +11,11 @@ import {
11
11
  } from "./chunk-BGZW6B7G.js";
12
12
  import {
13
13
  slimJob
14
- } from "./chunk-VAUKRTRG.js";
14
+ } from "./chunk-LJR4LJG6.js";
15
15
  import {
16
16
  pageDelayFromFlags,
17
17
  streamAll
18
- } from "./chunk-PS6QPY67.js";
18
+ } from "./chunk-63X3VI3T.js";
19
19
  import {
20
20
  BinaryOutputError,
21
21
  writeBinaryOutput
@@ -26,7 +26,7 @@ import {
26
26
  } from "./chunk-UEAX6KUB.js";
27
27
  import {
28
28
  requireAccount
29
- } from "./chunk-LCLYFE54.js";
29
+ } from "./chunk-GHT2DLZR.js";
30
30
  import {
31
31
  buildPreviewOutput
32
32
  } from "./chunk-R3VLWLVV.js";
@@ -36,7 +36,7 @@ import {
36
36
  renderSuccess,
37
37
  renderUnexpectedError,
38
38
  resolveEffectiveConfig
39
- } from "./chunk-XHVR32RW.js";
39
+ } from "./chunk-5KANHEBN.js";
40
40
  import "./chunk-KTY7R27U.js";
41
41
  import {
42
42
  GLOBAL_FLAGS,
@@ -45,7 +45,7 @@ import {
45
45
  WRITE_SINGLE_FLAGS,
46
46
  isStdinToken
47
47
  } from "./chunk-AHYUM2XQ.js";
48
- import "./chunk-PMRQXBCP.js";
48
+ import "./chunk-2OG6M6ME.js";
49
49
 
50
50
  // src/commands/recruiter.ts
51
51
  import { defineCommand } from "citty";
@@ -77,7 +77,7 @@ function normalizeAttachPaths(attach) {
77
77
  async function handleSdkError(err, outOpts, out) {
78
78
  const { CurviateError } = await import("@curviate/sdk");
79
79
  if (err instanceof CurviateError) {
80
- const { getExitCode } = await import("./exit-codes-KAVZN5BQ.js");
80
+ const { getExitCode } = await import("./exit-codes-U5CHA6FT.js");
81
81
  renderError(err, outOpts, out);
82
82
  process.exit(getExitCode(err.code));
83
83
  }
@@ -12,13 +12,13 @@ import {
12
12
  import {
13
13
  pageDelayFromFlags,
14
14
  streamAll
15
- } from "./chunk-PS6QPY67.js";
15
+ } from "./chunk-63X3VI3T.js";
16
16
  import {
17
17
  resolveIdentifier
18
18
  } from "./chunk-UEAX6KUB.js";
19
19
  import {
20
20
  requireAccount
21
- } from "./chunk-LCLYFE54.js";
21
+ } from "./chunk-GHT2DLZR.js";
22
22
  import {
23
23
  buildPreviewOutput
24
24
  } from "./chunk-R3VLWLVV.js";
@@ -28,14 +28,14 @@ import {
28
28
  renderSuccess,
29
29
  renderUnexpectedError,
30
30
  resolveEffectiveConfig
31
- } from "./chunk-XHVR32RW.js";
31
+ } from "./chunk-5KANHEBN.js";
32
32
  import "./chunk-KTY7R27U.js";
33
33
  import {
34
34
  GLOBAL_FLAGS,
35
35
  READ_SINGLE_FLAGS,
36
36
  WRITE_FLAGS
37
37
  } from "./chunk-AHYUM2XQ.js";
38
- import "./chunk-PMRQXBCP.js";
38
+ import "./chunk-2OG6M6ME.js";
39
39
 
40
40
  // src/commands/sales-nav.ts
41
41
  import { defineCommand } from "citty";
@@ -65,7 +65,7 @@ function normalizeAttachPaths(attach) {
65
65
  async function handleSdkError(err, outOpts, out) {
66
66
  const { CurviateError } = await import("@curviate/sdk");
67
67
  if (err instanceof CurviateError) {
68
- const { getExitCode } = await import("./exit-codes-KAVZN5BQ.js");
68
+ const { getExitCode } = await import("./exit-codes-U5CHA6FT.js");
69
69
  renderError(err, outOpts, out);
70
70
  process.exit(getExitCode(err.code));
71
71
  }
@@ -14,26 +14,26 @@ import {
14
14
  slimSearchPeopleItem,
15
15
  slimSearchPosts,
16
16
  slimSearchPostsItem
17
- } from "./chunk-VAUKRTRG.js";
17
+ } from "./chunk-LJR4LJG6.js";
18
18
  import {
19
19
  pageDelayFromFlags,
20
20
  streamAll
21
- } from "./chunk-PS6QPY67.js";
21
+ } from "./chunk-63X3VI3T.js";
22
22
  import {
23
23
  requireAccount
24
- } from "./chunk-LCLYFE54.js";
24
+ } from "./chunk-GHT2DLZR.js";
25
25
  import {
26
26
  createClient,
27
27
  renderError,
28
28
  renderSuccess,
29
29
  renderUnexpectedError,
30
30
  resolveEffectiveConfig
31
- } from "./chunk-XHVR32RW.js";
31
+ } from "./chunk-5KANHEBN.js";
32
32
  import "./chunk-KTY7R27U.js";
33
33
  import {
34
34
  GLOBAL_FLAGS
35
35
  } from "./chunk-AHYUM2XQ.js";
36
- import "./chunk-PMRQXBCP.js";
36
+ import "./chunk-2OG6M6ME.js";
37
37
 
38
38
  // src/commands/search.ts
39
39
  import { defineCommand } from "citty";
@@ -219,7 +219,7 @@ async function runSearchPeople(client, flags, out, readers = DEFAULT_FILTER_READ
219
219
  } catch (err) {
220
220
  const { CurviateError } = await import("@curviate/sdk");
221
221
  if (err instanceof CurviateError) {
222
- const { getExitCode } = await import("./exit-codes-KAVZN5BQ.js");
222
+ const { getExitCode } = await import("./exit-codes-U5CHA6FT.js");
223
223
  renderError(err, outOpts, out);
224
224
  process.exit(getExitCode(err.code));
225
225
  }
@@ -260,7 +260,7 @@ async function runSearchCompanies(client, flags, out, readers = DEFAULT_FILTER_R
260
260
  } catch (err) {
261
261
  const { CurviateError } = await import("@curviate/sdk");
262
262
  if (err instanceof CurviateError) {
263
- const { getExitCode } = await import("./exit-codes-KAVZN5BQ.js");
263
+ const { getExitCode } = await import("./exit-codes-U5CHA6FT.js");
264
264
  renderError(err, outOpts, out);
265
265
  process.exit(getExitCode(err.code));
266
266
  }
@@ -301,7 +301,7 @@ async function runSearchPosts(client, flags, out, readers = DEFAULT_FILTER_READE
301
301
  } catch (err) {
302
302
  const { CurviateError } = await import("@curviate/sdk");
303
303
  if (err instanceof CurviateError) {
304
- const { getExitCode } = await import("./exit-codes-KAVZN5BQ.js");
304
+ const { getExitCode } = await import("./exit-codes-U5CHA6FT.js");
305
305
  renderError(err, outOpts, out);
306
306
  process.exit(getExitCode(err.code));
307
307
  }
@@ -342,7 +342,7 @@ async function runSearchJobs(client, flags, out, readers = DEFAULT_FILTER_READER
342
342
  } catch (err) {
343
343
  const { CurviateError } = await import("@curviate/sdk");
344
344
  if (err instanceof CurviateError) {
345
- const { getExitCode } = await import("./exit-codes-KAVZN5BQ.js");
345
+ const { getExitCode } = await import("./exit-codes-U5CHA6FT.js");
346
346
  renderError(err, outOpts, out);
347
347
  process.exit(getExitCode(err.code));
348
348
  }
@@ -375,7 +375,7 @@ async function runSearchParameters(client, flags, out) {
375
375
  } catch (err) {
376
376
  const { CurviateError } = await import("@curviate/sdk");
377
377
  if (err instanceof CurviateError) {
378
- const { getExitCode } = await import("./exit-codes-KAVZN5BQ.js");
378
+ const { getExitCode } = await import("./exit-codes-U5CHA6FT.js");
379
379
  renderError(err, outOpts, out);
380
380
  process.exit(getExitCode(err.code));
381
381
  }
@@ -415,7 +415,7 @@ async function runSearchGroups(client, flags, out) {
415
415
  } catch (err) {
416
416
  const { CurviateError } = await import("@curviate/sdk");
417
417
  if (err instanceof CurviateError) {
418
- const { getExitCode } = await import("./exit-codes-KAVZN5BQ.js");
418
+ const { getExitCode } = await import("./exit-codes-U5CHA6FT.js");
419
419
  renderError(err, outOpts, out);
420
420
  process.exit(getExitCode(err.code));
421
421
  }
@@ -457,7 +457,7 @@ async function runSearchServices(client, flags, out) {
457
457
  } catch (err) {
458
458
  const { CurviateError } = await import("@curviate/sdk");
459
459
  if (err instanceof CurviateError) {
460
- const { getExitCode } = await import("./exit-codes-KAVZN5BQ.js");
460
+ const { getExitCode } = await import("./exit-codes-U5CHA6FT.js");
461
461
  renderError(err, outOpts, out);
462
462
  process.exit(getExitCode(err.code));
463
463
  }
@@ -484,7 +484,7 @@ async function runSearchServiceParameters(client, flags, out) {
484
484
  } catch (err) {
485
485
  const { CurviateError } = await import("@curviate/sdk");
486
486
  if (err instanceof CurviateError) {
487
- const { getExitCode } = await import("./exit-codes-KAVZN5BQ.js");
487
+ const { getExitCode } = await import("./exit-codes-U5CHA6FT.js");
488
488
  renderError(err, outOpts, out);
489
489
  process.exit(getExitCode(err.code));
490
490
  }
@@ -521,7 +521,7 @@ async function runSearchFromUrl(client, flags, out) {
521
521
  } catch (err) {
522
522
  const { CurviateError } = await import("@curviate/sdk");
523
523
  if (err instanceof CurviateError) {
524
- const { getExitCode } = await import("./exit-codes-KAVZN5BQ.js");
524
+ const { getExitCode } = await import("./exit-codes-U5CHA6FT.js");
525
525
  renderError(err, outOpts, out);
526
526
  process.exit(getExitCode(err.code));
527
527
  }
@@ -2,7 +2,7 @@
2
2
  import {
3
3
  pageDelayFromFlags,
4
4
  streamAll
5
- } from "./chunk-PS6QPY67.js";
5
+ } from "./chunk-63X3VI3T.js";
6
6
  import {
7
7
  buildPreviewOutput
8
8
  } from "./chunk-R3VLWLVV.js";
@@ -12,7 +12,7 @@ import {
12
12
  renderSuccess,
13
13
  renderUnexpectedError,
14
14
  resolveEffectiveConfig
15
- } from "./chunk-XHVR32RW.js";
15
+ } from "./chunk-5KANHEBN.js";
16
16
  import "./chunk-KTY7R27U.js";
17
17
  import {
18
18
  GLOBAL_FLAGS,
@@ -51,7 +51,7 @@ function resolveOutputOpts(flags) {
51
51
  async function handleError(err, outOpts, out) {
52
52
  const { CurviateError } = await import("@curviate/sdk");
53
53
  if (err instanceof CurviateError) {
54
- const { getExitCode } = await import("./exit-codes-KAVZN5BQ.js");
54
+ const { getExitCode } = await import("./exit-codes-U5CHA6FT.js");
55
55
  renderError(err, outOpts, out);
56
56
  process.exit(getExitCode(err.code));
57
57
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@curviate/cli",
3
- "version": "0.25.0",
3
+ "version": "0.27.0",
4
4
  "private": false,
5
5
  "description": "Official command-line interface for the Curviate API.",
6
6
  "license": "MIT",
@@ -46,7 +46,7 @@
46
46
  "clean": "rm -rf dist *.tsbuildinfo"
47
47
  },
48
48
  "dependencies": {
49
- "@curviate/sdk": "0.24.3",
49
+ "@curviate/sdk": "0.26.0",
50
50
  "citty": "^0.1.6",
51
51
  "open": "^10.1.0"
52
52
  },