@curviate/cli 0.31.1 → 0.33.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 (40) hide show
  1. package/CHANGELOG.md +254 -1
  2. package/README.md +2 -0
  3. package/dist/{account-DZRX4YOK.js → account-IPAW6YRD.js} +89 -46
  4. package/dist/{chunk-A73TUZBK.js → chunk-27E2M2PS.js} +9 -6
  5. package/dist/chunk-4EH6EWFW.js +327 -0
  6. package/dist/{chunk-SKJNLN37.js → chunk-4GXO42ZH.js} +85 -1
  7. package/dist/{chunk-KQXYEQAD.js → chunk-4IPHFPLO.js} +172 -8
  8. package/dist/{chunk-Y3H55OSY.js → chunk-5SHLELR7.js} +16 -16
  9. package/dist/{chunk-JRKM4OV2.js → chunk-REO2BCEX.js} +1 -1
  10. package/dist/{chunk-6P52Q2GK.js → chunk-REVD4GXL.js} +5 -4
  11. package/dist/chunk-TCUYH5GO.js +34 -0
  12. package/dist/{chunk-X3YWBMBC.js → chunk-YCLU5VSN.js} +14 -17
  13. package/dist/cli.js +104 -37
  14. package/dist/{comment-6JI4Q6QY.js → comment-F2O4UOSD.js} +32 -26
  15. package/dist/{company-RLU5SHUO.js → company-ANZGO2HT.js} +52 -34
  16. package/dist/{config-FUHT23SX.js → config-ZD3Y5MWP.js} +74 -29
  17. package/dist/{connect-63NUITEZ.js → connect-HYJCGYFO.js} +34 -31
  18. package/dist/{doctor-KSLZNAKH.js → doctor-VPGGB5CW.js} +22 -16
  19. package/dist/{exit-codes-RUKZC4WV.js → exit-codes-ZFWQJYOY.js} +1 -1
  20. package/dist/{feed-PAWXR56T.js → feed-IZZYSYYI.js} +18 -17
  21. package/dist/{group-ZIIWI7JV.js → group-ETDDF2PJ.js} +21 -18
  22. package/dist/{inbox-GIPLWRHQ.js → inbox-XQQ4YRRO.js} +27 -22
  23. package/dist/{inboxes-ECGEMDH7.js → inboxes-6KHXXEBC.js} +18 -17
  24. package/dist/{job-WPWIAVQY.js → job-PBTJ5DWL.js} +43 -29
  25. package/dist/{login-3OAUY7TG.js → login-HP5URYD6.js} +15 -3
  26. package/dist/{message-JQL2XABC.js → message-DQQPMRFU.js} +7 -9
  27. package/dist/{notification-URSGC7OR.js → notification-CXIRJB57.js} +20 -19
  28. package/dist/{post-2HI6KL73.js → post-2S7FYMZO.js} +33 -25
  29. package/dist/{profile-4BXLUYMH.js → profile-UCERD6RR.js} +61 -43
  30. package/dist/{recruiter-OUXQ5XYU.js → recruiter-PJFUM2ZZ.js} +41 -28
  31. package/dist/{sales-nav-MJAMCSBO.js → sales-nav-7XNJGVIX.js} +43 -29
  32. package/dist/{search-M3R35BIB.js → search-DYGIIODT.js} +57 -43
  33. package/dist/{setup-YV5PVIU5.js → setup-BRULZH53.js} +12 -8
  34. package/dist/{webhook-3TEYA3B2.js → webhook-2TKWOXYK.js} +25 -22
  35. package/package.json +2 -2
  36. package/dist/chunk-LKF5MZIP.js +0 -90
  37. package/dist/chunk-PKSKQ3LN.js +0 -68
  38. package/dist/chunk-R3VLWLVV.js +0 -23
  39. package/dist/chunk-TD2ZIXFR.js +0 -67
  40. package/dist/chunk-TQJ77SL4.js +0 -147
@@ -3,13 +3,14 @@ import {
3
3
  readlineSync
4
4
  } from "./chunk-YLSJ4HKU.js";
5
5
  import {
6
+ baseUrlProblem,
6
7
  writeProfile
7
- } from "./chunk-TQJ77SL4.js";
8
+ } from "./chunk-4EH6EWFW.js";
8
9
  import {
9
10
  GLOBAL_FLAGS,
10
11
  defaultReadStdin,
11
12
  resolveTextOrStdin
12
- } from "./chunk-SKJNLN37.js";
13
+ } from "./chunk-4GXO42ZH.js";
13
14
 
14
15
  // src/commands/login.ts
15
16
  import { defineCommand } from "citty";
@@ -27,6 +28,13 @@ async function runLogin(args, out) {
27
28
  process.exit(2);
28
29
  return;
29
30
  }
31
+ const badUrl = baseUrl === void 0 ? null : baseUrlProblem(baseUrl);
32
+ if (badUrl) {
33
+ out.stderr.write(`error: ${badUrl}
34
+ `);
35
+ process.exit(2);
36
+ return;
37
+ }
30
38
  const account = args.account;
31
39
  const entry = { apiKey, account };
32
40
  if (baseUrl !== void 0 && baseUrl !== "") {
@@ -43,8 +51,12 @@ var loginCommand = defineCommand({
43
51
  name: "login",
44
52
  description: "Save an API key to a local profile. Run `curviate profile me` to verify."
45
53
  },
54
+ // Only what login acts on: it makes no request, so pagination, projection,
55
+ // preview and transport flags would be accepted and do nothing. `--json` is
56
+ // kept: callers pass it on every command as an output-mode selector.
46
57
  args: {
47
- ...GLOBAL_FLAGS,
58
+ "base-url": GLOBAL_FLAGS["base-url"],
59
+ json: GLOBAL_FLAGS.json,
48
60
  "api-key": {
49
61
  type: "string",
50
62
  stdinArg: true,
@@ -13,19 +13,17 @@ import {
13
13
  runMessageSend,
14
14
  sentAsNotice,
15
15
  willSendAsNotice
16
- } from "./chunk-Y3H55OSY.js";
16
+ } from "./chunk-5SHLELR7.js";
17
17
  import "./chunk-UWO2D4HW.js";
18
18
  import "./chunk-HOQ7EUHJ.js";
19
19
  import "./chunk-BGZW6B7G.js";
20
20
  import "./chunk-UEAX6KUB.js";
21
- import "./chunk-R3VLWLVV.js";
22
- import "./chunk-A73TUZBK.js";
23
- import "./chunk-KQXYEQAD.js";
24
- import "./chunk-TD2ZIXFR.js";
25
- import "./chunk-PKSKQ3LN.js";
26
- import "./chunk-X3YWBMBC.js";
27
- import "./chunk-TQJ77SL4.js";
28
- import "./chunk-SKJNLN37.js";
21
+ import "./chunk-27E2M2PS.js";
22
+ import "./chunk-TCUYH5GO.js";
23
+ import "./chunk-4IPHFPLO.js";
24
+ import "./chunk-YCLU5VSN.js";
25
+ import "./chunk-4EH6EWFW.js";
26
+ import "./chunk-4GXO42ZH.js";
29
27
  export {
30
28
  guardBareMessageForm,
31
29
  messageCommand,
@@ -1,30 +1,29 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
- pageDelayFromFlags,
4
- streamAll
5
- } from "./chunk-LKF5MZIP.js";
3
+ requireAccount
4
+ } from "./chunk-27E2M2PS.js";
6
5
  import {
7
6
  buildPreviewOutput
8
- } from "./chunk-R3VLWLVV.js";
9
- import {
10
- requireAccount
11
- } from "./chunk-A73TUZBK.js";
7
+ } from "./chunk-TCUYH5GO.js";
12
8
  import {
9
+ pageDelayFromFlags,
10
+ readablePage,
11
+ rejectPaginationModifiersWithoutAll,
13
12
  renderError,
14
13
  renderSuccess,
15
- renderUnexpectedError
16
- } from "./chunk-KQXYEQAD.js";
14
+ renderUnexpectedError,
15
+ resolveEffectiveConfig,
16
+ streamAll,
17
+ writeNdjsonItem
18
+ } from "./chunk-4IPHFPLO.js";
19
+ import "./chunk-YCLU5VSN.js";
17
20
  import {
18
- createClient,
19
- resolveEffectiveConfig
20
- } from "./chunk-TD2ZIXFR.js";
21
- import "./chunk-PKSKQ3LN.js";
22
- import "./chunk-X3YWBMBC.js";
23
- import "./chunk-TQJ77SL4.js";
21
+ createClient
22
+ } from "./chunk-4EH6EWFW.js";
24
23
  import {
25
24
  GLOBAL_FLAGS,
26
25
  WRITE_SINGLE_FLAGS
27
- } from "./chunk-SKJNLN37.js";
26
+ } from "./chunk-4GXO42ZH.js";
28
27
 
29
28
  // src/commands/notification.ts
30
29
  import { defineCommand } from "citty";
@@ -51,15 +50,16 @@ function resolveOutputOpts(flags) {
51
50
  async function handleSdkError(err, outOpts, out) {
52
51
  const { CurviateError } = await import("@curviate/sdk");
53
52
  if (err instanceof CurviateError) {
54
- const { getExitCode } = await import("./exit-codes-RUKZC4WV.js");
53
+ const { getExitCode } = await import("./exit-codes-ZFWQJYOY.js");
55
54
  renderError(err, outOpts, out);
56
- process.exit(getExitCode(err.code));
55
+ process.exit(getExitCode(err));
57
56
  }
58
57
  renderUnexpectedError(err, out);
59
58
  process.exit(1);
60
59
  }
61
60
  async function runNotificationList(client, flags, out) {
62
61
  rejectPreviewOnRead(flags.preview, out);
62
+ rejectPaginationModifiersWithoutAll(flags, out);
63
63
  const accountId = await requireAccount(client, flags, out);
64
64
  const ns = client.account(accountId);
65
65
  const outOpts = resolveOutputOpts(flags);
@@ -77,10 +77,11 @@ async function runNotificationList(client, flags, out) {
77
77
  out,
78
78
  pageDelayMs: pageDelayFromFlags(flags)
79
79
  })) {
80
- out.stdout.write(JSON.stringify(item) + "\n");
80
+ writeNdjsonItem(out, item, outOpts.fields);
81
81
  }
82
82
  } else {
83
83
  const result = await ns.notifications.list(params);
84
+ readablePage(result);
84
85
  renderSuccess(result, outOpts, out);
85
86
  }
86
87
  } catch (err) {
@@ -1,41 +1,41 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  resolveMemberOrMeProviderId
4
- } from "./chunk-6P52Q2GK.js";
5
- import {
6
- pageDelayFromFlags,
7
- streamAll
8
- } from "./chunk-LKF5MZIP.js";
4
+ } from "./chunk-REVD4GXL.js";
9
5
  import {
10
6
  AttachError,
11
7
  readAttachment,
12
8
  toAttachmentPayload
13
9
  } from "./chunk-BGZW6B7G.js";
14
10
  import "./chunk-UEAX6KUB.js";
15
- import {
16
- buildPreviewOutput
17
- } from "./chunk-R3VLWLVV.js";
18
11
  import {
19
12
  requireAccount
20
- } from "./chunk-A73TUZBK.js";
13
+ } from "./chunk-27E2M2PS.js";
21
14
  import {
15
+ buildPreviewOutput
16
+ } from "./chunk-TCUYH5GO.js";
17
+ import {
18
+ pageDelayFromFlags,
19
+ readablePage,
20
+ rejectPaginationModifiersWithoutAll,
22
21
  renderError,
23
22
  renderSuccess,
24
- renderUnexpectedError
25
- } from "./chunk-KQXYEQAD.js";
23
+ renderUnexpectedError,
24
+ resolveEffectiveConfig,
25
+ streamAll,
26
+ writeNdjsonItem
27
+ } from "./chunk-4IPHFPLO.js";
28
+ import "./chunk-YCLU5VSN.js";
26
29
  import {
27
- createClient,
28
- resolveEffectiveConfig
29
- } from "./chunk-TD2ZIXFR.js";
30
- import "./chunk-PKSKQ3LN.js";
31
- import "./chunk-X3YWBMBC.js";
32
- import "./chunk-TQJ77SL4.js";
30
+ createClient
31
+ } from "./chunk-4EH6EWFW.js";
33
32
  import {
34
33
  GLOBAL_FLAGS,
34
+ NON_STREAM_FLAGS,
35
35
  WRITE_FLAGS,
36
36
  WRITE_SINGLE_FLAGS,
37
37
  resolveTextOrStdin
38
- } from "./chunk-SKJNLN37.js";
38
+ } from "./chunk-4GXO42ZH.js";
39
39
 
40
40
  // src/commands/post.ts
41
41
  import { defineCommand } from "citty";
@@ -78,9 +78,9 @@ function normalizeAttachPaths(attach) {
78
78
  async function handleSdkError(err, outOpts, out) {
79
79
  const { CurviateError } = await import("@curviate/sdk");
80
80
  if (err instanceof CurviateError) {
81
- const { getExitCode } = await import("./exit-codes-RUKZC4WV.js");
81
+ const { getExitCode } = await import("./exit-codes-ZFWQJYOY.js");
82
82
  renderError(err, outOpts, out);
83
- process.exit(getExitCode(err.code));
83
+ process.exit(getExitCode(err));
84
84
  }
85
85
  renderUnexpectedError(err, out);
86
86
  process.exit(1);
@@ -182,6 +182,7 @@ async function runPostReact(client, flags, out) {
182
182
  }
183
183
  async function runPostReactions(client, flags, out) {
184
184
  rejectPreviewOnRead(flags.preview, out);
185
+ rejectPaginationModifiersWithoutAll(flags, out);
185
186
  const accountId = await requireAccount(client, flags, out);
186
187
  const postId = flags.postId ?? "";
187
188
  const ns = client.account(accountId);
@@ -197,10 +198,11 @@ async function runPostReactions(client, flags, out) {
197
198
  out,
198
199
  pageDelayMs: pageDelayFromFlags(flags)
199
200
  })) {
200
- out.stdout.write(JSON.stringify(item) + "\n");
201
+ writeNdjsonItem(out, item, outOpts.fields);
201
202
  }
202
203
  } else {
203
204
  const result = await ns.posts.listReactions(postId, params);
205
+ readablePage(result);
204
206
  renderSuccess(result, outOpts, out);
205
207
  }
206
208
  } catch (err) {
@@ -209,6 +211,7 @@ async function runPostReactions(client, flags, out) {
209
211
  }
210
212
  async function runPostSaved(client, flags, out) {
211
213
  rejectPreviewOnRead(flags.preview, out);
214
+ rejectPaginationModifiersWithoutAll(flags, out);
212
215
  const accountId = await requireAccount(client, flags, out);
213
216
  const ns = client.account(accountId);
214
217
  const outOpts = resolveOutputOpts(flags);
@@ -223,10 +226,11 @@ async function runPostSaved(client, flags, out) {
223
226
  out,
224
227
  pageDelayMs: pageDelayFromFlags(flags)
225
228
  })) {
226
- out.stdout.write(JSON.stringify(item) + "\n");
229
+ writeNdjsonItem(out, item, outOpts.fields);
227
230
  }
228
231
  } else {
229
232
  const result = await ns.posts.listSaved(params);
233
+ readablePage(result);
230
234
  renderSuccess(result, outOpts, out);
231
235
  }
232
236
  } catch (err) {
@@ -315,6 +319,7 @@ async function runPostUnreact(client, flags, out) {
315
319
  }
316
320
  async function runPostUserPosts(client, flags, out) {
317
321
  rejectPreviewOnRead(flags.preview, out);
322
+ rejectPaginationModifiersWithoutAll(flags, out);
318
323
  const accountId = await requireAccount(client, flags, out);
319
324
  const ns = client.account(accountId);
320
325
  const outOpts = resolveOutputOpts(flags);
@@ -336,10 +341,11 @@ async function runPostUserPosts(client, flags, out) {
336
341
  out,
337
342
  pageDelayMs: pageDelayFromFlags(flags)
338
343
  })) {
339
- out.stdout.write(JSON.stringify(item) + "\n");
344
+ writeNdjsonItem(out, item, outOpts.fields);
340
345
  }
341
346
  } else {
342
347
  const result = await ns.posts.listUserPosts(userId, params);
348
+ readablePage(result);
343
349
  renderSuccess(result, outOpts, out);
344
350
  }
345
351
  } catch (err) {
@@ -348,6 +354,7 @@ async function runPostUserPosts(client, flags, out) {
348
354
  }
349
355
  async function runPostUserReactions(client, flags, out) {
350
356
  rejectPreviewOnRead(flags.preview, out);
357
+ rejectPaginationModifiersWithoutAll(flags, out);
351
358
  const accountId = await requireAccount(client, flags, out);
352
359
  const ns = client.account(accountId);
353
360
  const outOpts = resolveOutputOpts(flags);
@@ -369,10 +376,11 @@ async function runPostUserReactions(client, flags, out) {
369
376
  out,
370
377
  pageDelayMs: pageDelayFromFlags(flags)
371
378
  })) {
372
- out.stdout.write(JSON.stringify(item) + "\n");
379
+ writeNdjsonItem(out, item, outOpts.fields);
373
380
  }
374
381
  } else {
375
382
  const result = await ns.posts.listUserReactions(userId, params);
383
+ readablePage(result);
376
384
  renderSuccess(result, outOpts, out);
377
385
  }
378
386
  } catch (err) {
@@ -382,7 +390,7 @@ async function runPostUserReactions(client, flags, out) {
382
390
  var postGetCommand = defineCommand({
383
391
  meta: { name: "get", description: "Get a post by id." },
384
392
  args: {
385
- ...GLOBAL_FLAGS,
393
+ ...NON_STREAM_FLAGS,
386
394
  postId: {
387
395
  type: "positional",
388
396
  description: "Numeric post id, urn:li:activity:N, or full LinkedIn share URL (activity-<N>- extracted). POSTID is always the post's id. To list comments on a post, use 'comment list <post_id>'."
@@ -11,11 +11,7 @@ import {
11
11
  import {
12
12
  resolveMemberOrMeProviderId,
13
13
  resolveMemberProviderId
14
- } from "./chunk-6P52Q2GK.js";
15
- import {
16
- pageDelayFromFlags,
17
- streamAll
18
- } from "./chunk-LKF5MZIP.js";
14
+ } from "./chunk-REVD4GXL.js";
19
15
  import {
20
16
  AttachError,
21
17
  readAttachment,
@@ -24,29 +20,34 @@ import {
24
20
  import {
25
21
  resolveIdentifier
26
22
  } from "./chunk-UEAX6KUB.js";
27
- import {
28
- buildPreviewOutput
29
- } from "./chunk-R3VLWLVV.js";
30
23
  import {
31
24
  requireAccount
32
- } from "./chunk-A73TUZBK.js";
25
+ } from "./chunk-27E2M2PS.js";
33
26
  import {
27
+ buildPreviewOutput
28
+ } from "./chunk-TCUYH5GO.js";
29
+ import {
30
+ pageDelayFromFlags,
31
+ readableId,
32
+ readablePage,
33
+ rejectPaginationModifiersWithoutAll,
34
34
  renderError,
35
35
  renderSuccess,
36
- renderUnexpectedError
37
- } from "./chunk-KQXYEQAD.js";
36
+ renderUnexpectedError,
37
+ resolveEffectiveConfig,
38
+ streamAll,
39
+ writeNdjsonItem
40
+ } from "./chunk-4IPHFPLO.js";
41
+ import "./chunk-YCLU5VSN.js";
38
42
  import {
39
- createClient,
40
- resolveEffectiveConfig
41
- } from "./chunk-TD2ZIXFR.js";
42
- import "./chunk-PKSKQ3LN.js";
43
- import "./chunk-X3YWBMBC.js";
44
- import "./chunk-TQJ77SL4.js";
43
+ createClient
44
+ } from "./chunk-4EH6EWFW.js";
45
45
  import {
46
46
  GLOBAL_FLAGS,
47
+ NON_STREAM_FLAGS,
47
48
  READ_SINGLE_FLAGS,
48
49
  WRITE_SINGLE_FLAGS
49
- } from "./chunk-SKJNLN37.js";
50
+ } from "./chunk-4GXO42ZH.js";
50
51
 
51
52
  // src/commands/profile.ts
52
53
  import { defineCommand } from "citty";
@@ -133,6 +134,7 @@ function resolveOutputOpts(flags) {
133
134
  }
134
135
  async function runProfileMe(client, flags, out) {
135
136
  rejectPreviewOnRead(flags.preview, out);
137
+ rejectPaginationModifiersWithoutAll(flags, out);
136
138
  const hasActivityFlag = !!(flags.posts || flags.comments || flags.reactions || flags.followers);
137
139
  if (!hasActivityFlag) {
138
140
  rejectAllOnNonPaginated(flags.all, out);
@@ -162,10 +164,11 @@ async function runProfileMe(client, flags, out) {
162
164
  out,
163
165
  pageDelayMs: pageDelayFromFlags(flags)
164
166
  })) {
165
- out.stdout.write(JSON.stringify(item) + "\n");
167
+ writeNdjsonItem(out, item, outOpts.fields);
166
168
  }
167
169
  } else {
168
170
  const result = await ns.posts.listUserPosts("me", params2);
171
+ readablePage(result);
169
172
  renderSuccess(result, outOpts, out);
170
173
  }
171
174
  } else if (flags.comments) {
@@ -176,10 +179,11 @@ async function runProfileMe(client, flags, out) {
176
179
  out,
177
180
  pageDelayMs: pageDelayFromFlags(flags)
178
181
  })) {
179
- out.stdout.write(JSON.stringify(item) + "\n");
182
+ writeNdjsonItem(out, item, outOpts.fields);
180
183
  }
181
184
  } else {
182
185
  const result = await ns.comments.listUserComments("me", params2);
186
+ readablePage(result);
183
187
  renderSuccess(result, outOpts, out);
184
188
  }
185
189
  } else if (flags.reactions) {
@@ -190,10 +194,11 @@ async function runProfileMe(client, flags, out) {
190
194
  out,
191
195
  pageDelayMs: pageDelayFromFlags(flags)
192
196
  })) {
193
- out.stdout.write(JSON.stringify(item) + "\n");
197
+ writeNdjsonItem(out, item, outOpts.fields);
194
198
  }
195
199
  } else {
196
200
  const result = await ns.posts.listUserReactions("me", params2);
201
+ readablePage(result);
197
202
  renderSuccess(result, outOpts, out);
198
203
  }
199
204
  } else if (flags.followers) {
@@ -204,19 +209,20 @@ async function runProfileMe(client, flags, out) {
204
209
  out,
205
210
  pageDelayMs: pageDelayFromFlags(flags)
206
211
  })) {
207
- out.stdout.write(JSON.stringify(item) + "\n");
212
+ writeNdjsonItem(out, item, outOpts.fields);
208
213
  }
209
214
  } else {
210
215
  const result = await ns.users.listFollowers("me", params2);
216
+ readablePage(result);
211
217
  renderSuccess(result, outOpts, out);
212
218
  }
213
219
  }
214
220
  } catch (err) {
215
221
  const { CurviateError } = await import("@curviate/sdk");
216
222
  if (err instanceof CurviateError) {
217
- const { getExitCode } = await import("./exit-codes-RUKZC4WV.js");
223
+ const { getExitCode } = await import("./exit-codes-ZFWQJYOY.js");
218
224
  renderError(err, outOpts, out);
219
- process.exit(getExitCode(err.code));
225
+ process.exit(getExitCode(err));
220
226
  }
221
227
  renderUnexpectedError(err, out);
222
228
  process.exit(1);
@@ -240,9 +246,9 @@ async function runProfileMe(client, flags, out) {
240
246
  } catch (err) {
241
247
  const { CurviateError } = await import("@curviate/sdk");
242
248
  if (err instanceof CurviateError) {
243
- const { getExitCode } = await import("./exit-codes-RUKZC4WV.js");
249
+ const { getExitCode } = await import("./exit-codes-ZFWQJYOY.js");
244
250
  renderError(err, outOpts, out);
245
- process.exit(getExitCode(err.code));
251
+ process.exit(getExitCode(err));
246
252
  }
247
253
  renderUnexpectedError(err, out);
248
254
  process.exit(1);
@@ -250,6 +256,7 @@ async function runProfileMe(client, flags, out) {
250
256
  }
251
257
  async function runProfileGet(client, flags, out) {
252
258
  rejectPreviewOnRead(flags.preview, out);
259
+ rejectPaginationModifiersWithoutAll(flags, out);
253
260
  const isListCommand = flags.posts || flags.comments || flags.reactions || flags.followers;
254
261
  if (!isListCommand && flags.sections === "") {
255
262
  out.stderr.write("error: --sections must not be empty. Omit the flag or provide section names.\n");
@@ -286,8 +293,7 @@ async function runProfileGet(client, flags, out) {
286
293
  if (flags["is-company"]) {
287
294
  const isNumericId = /^\d+$/.test(resolvedId);
288
295
  if (!isNumericId) {
289
- const companyData = await ns.companies.get(resolvedId);
290
- postId = companyData.id;
296
+ postId = readableId(await ns.companies.get(resolvedId));
291
297
  }
292
298
  }
293
299
  if (all) {
@@ -297,10 +303,11 @@ async function runProfileGet(client, flags, out) {
297
303
  out,
298
304
  pageDelayMs: pageDelayFromFlags(flags)
299
305
  })) {
300
- out.stdout.write(JSON.stringify(item) + "\n");
306
+ writeNdjsonItem(out, item, outOpts.fields);
301
307
  }
302
308
  } else {
303
309
  const result = await ns.posts.listUserPosts(postId, params);
310
+ readablePage(result);
304
311
  renderSuccess(result, outOpts, out);
305
312
  }
306
313
  } else if (flags.comments) {
@@ -314,10 +321,11 @@ async function runProfileGet(client, flags, out) {
314
321
  out,
315
322
  pageDelayMs: pageDelayFromFlags(flags)
316
323
  })) {
317
- out.stdout.write(JSON.stringify(item) + "\n");
324
+ writeNdjsonItem(out, item, outOpts.fields);
318
325
  }
319
326
  } else {
320
327
  const result = await ns.comments.listUserComments(resolvedId, params);
328
+ readablePage(result);
321
329
  renderSuccess(result, outOpts, out);
322
330
  }
323
331
  } else if (flags.reactions) {
@@ -331,10 +339,11 @@ async function runProfileGet(client, flags, out) {
331
339
  out,
332
340
  pageDelayMs: pageDelayFromFlags(flags)
333
341
  })) {
334
- out.stdout.write(JSON.stringify(item) + "\n");
342
+ writeNdjsonItem(out, item, outOpts.fields);
335
343
  }
336
344
  } else {
337
345
  const result = await ns.posts.listUserReactions(resolvedId, params);
346
+ readablePage(result);
338
347
  renderSuccess(result, outOpts, out);
339
348
  }
340
349
  } else if (flags.followers) {
@@ -348,10 +357,11 @@ async function runProfileGet(client, flags, out) {
348
357
  out,
349
358
  pageDelayMs: pageDelayFromFlags(flags)
350
359
  })) {
351
- out.stdout.write(JSON.stringify(item) + "\n");
360
+ writeNdjsonItem(out, item, outOpts.fields);
352
361
  }
353
362
  } else {
354
363
  const result = await ns.users.listFollowers(resolvedId, params);
364
+ readablePage(result);
355
365
  renderSuccess(result, outOpts, out);
356
366
  }
357
367
  } else {
@@ -368,9 +378,9 @@ async function runProfileGet(client, flags, out) {
368
378
  } catch (err) {
369
379
  const { CurviateError } = await import("@curviate/sdk");
370
380
  if (err instanceof CurviateError) {
371
- const { getExitCode } = await import("./exit-codes-RUKZC4WV.js");
381
+ const { getExitCode } = await import("./exit-codes-ZFWQJYOY.js");
372
382
  renderError(err, outOpts, out);
373
- process.exit(getExitCode(err.code));
383
+ process.exit(getExitCode(err));
374
384
  }
375
385
  renderUnexpectedError(err, out);
376
386
  process.exit(1);
@@ -378,6 +388,7 @@ async function runProfileGet(client, flags, out) {
378
388
  }
379
389
  async function runProfileRelations(client, flags, out) {
380
390
  rejectPreviewOnRead(flags.preview, out);
391
+ rejectPaginationModifiersWithoutAll(flags, out);
381
392
  const accountId = await requireAccount(client, flags, out);
382
393
  const ns = client.account(accountId);
383
394
  const outOpts = resolveOutputOpts(flags);
@@ -396,18 +407,19 @@ async function runProfileRelations(client, flags, out) {
396
407
  out,
397
408
  pageDelayMs: pageDelayFromFlags(flags)
398
409
  })) {
399
- out.stdout.write(JSON.stringify(item) + "\n");
410
+ writeNdjsonItem(out, item, outOpts.fields);
400
411
  }
401
412
  } else {
402
413
  const result = await ns.users.listRelations(params);
414
+ readablePage(result);
403
415
  renderSuccess(result, outOpts, out);
404
416
  }
405
417
  } catch (err) {
406
418
  const { CurviateError } = await import("@curviate/sdk");
407
419
  if (err instanceof CurviateError) {
408
- const { getExitCode } = await import("./exit-codes-RUKZC4WV.js");
420
+ const { getExitCode } = await import("./exit-codes-ZFWQJYOY.js");
409
421
  renderError(err, outOpts, out);
410
- process.exit(getExitCode(err.code));
422
+ process.exit(getExitCode(err));
411
423
  }
412
424
  renderUnexpectedError(err, out);
413
425
  process.exit(1);
@@ -445,9 +457,9 @@ async function runProfileEndorse(client, flags, out) {
445
457
  async function handleSdkError(err, outOpts, out) {
446
458
  const { CurviateError } = await import("@curviate/sdk");
447
459
  if (err instanceof CurviateError) {
448
- const { getExitCode } = await import("./exit-codes-RUKZC4WV.js");
460
+ const { getExitCode } = await import("./exit-codes-ZFWQJYOY.js");
449
461
  renderError(err, outOpts, out);
450
- process.exit(getExitCode(err.code));
462
+ process.exit(getExitCode(err));
451
463
  }
452
464
  renderUnexpectedError(err, out);
453
465
  process.exit(1);
@@ -480,6 +492,7 @@ async function runProfileAnalytics(client, flags, out) {
480
492
  }
481
493
  async function runProfileVisitors(client, flags, out) {
482
494
  rejectPreviewOnRead(flags.preview, out);
495
+ rejectPaginationModifiersWithoutAll(flags, out);
483
496
  const accountId = await requireAccount(client, flags, out);
484
497
  const ns = client.account(accountId);
485
498
  const outOpts = resolveOutputOpts(flags);
@@ -498,10 +511,11 @@ async function runProfileVisitors(client, flags, out) {
498
511
  out,
499
512
  pageDelayMs: pageDelayFromFlags(flags)
500
513
  })) {
501
- out.stdout.write(JSON.stringify(item) + "\n");
514
+ writeNdjsonItem(out, item, outOpts.fields);
502
515
  }
503
516
  } else {
504
517
  const result = await ns.profile.visitors(params);
518
+ readablePage(result);
505
519
  renderSuccess(result, outOpts, out);
506
520
  }
507
521
  } catch (err) {
@@ -617,6 +631,7 @@ async function runProfileUnfollow(client, flags, out) {
617
631
  }
618
632
  async function runProfileFollowers(client, flags, out) {
619
633
  rejectPreviewOnRead(flags.preview, out);
634
+ rejectPaginationModifiersWithoutAll(flags, out);
620
635
  const accountId = await requireAccount(client, flags, out);
621
636
  const resolvedId = resolveIdentifier(flags.id ?? "");
622
637
  const ns = client.account(accountId);
@@ -634,10 +649,11 @@ async function runProfileFollowers(client, flags, out) {
634
649
  out,
635
650
  pageDelayMs: pageDelayFromFlags(flags)
636
651
  })) {
637
- out.stdout.write(JSON.stringify(item) + "\n");
652
+ writeNdjsonItem(out, item, outOpts.fields);
638
653
  }
639
654
  } else {
640
655
  const result = await ns.users.listFollowers(resolvedId, params);
656
+ readablePage(result);
641
657
  renderSuccess(result, outOpts, out);
642
658
  }
643
659
  } catch (err) {
@@ -646,6 +662,7 @@ async function runProfileFollowers(client, flags, out) {
646
662
  }
647
663
  async function runProfileFollowing(client, flags, out) {
648
664
  rejectPreviewOnRead(flags.preview, out);
665
+ rejectPaginationModifiersWithoutAll(flags, out);
649
666
  const accountId = await requireAccount(client, flags, out);
650
667
  const resolvedId = resolveIdentifier(flags.id ?? "");
651
668
  const ns = client.account(accountId);
@@ -663,10 +680,11 @@ async function runProfileFollowing(client, flags, out) {
663
680
  out,
664
681
  pageDelayMs: pageDelayFromFlags(flags)
665
682
  })) {
666
- out.stdout.write(JSON.stringify(item) + "\n");
683
+ writeNdjsonItem(out, item, outOpts.fields);
667
684
  }
668
685
  } else {
669
686
  const result = await ns.users.listFollowing(resolvedId, params);
687
+ readablePage(result);
670
688
  renderSuccess(result, outOpts, out);
671
689
  }
672
690
  } catch (err) {
@@ -745,7 +763,7 @@ var profileRelationsCommand = defineCommand({
745
763
  var profileEndorseCommand = defineCommand({
746
764
  meta: { name: "endorse", description: "Endorse a skill on a member's profile." },
747
765
  args: {
748
- ...GLOBAL_FLAGS,
766
+ ...NON_STREAM_FLAGS,
749
767
  id: { type: "positional", description: "Member identifier (URL, slug, or provider id). A URL/slug is resolved to the provider id automatically (a slug is not accepted directly by the endorse endpoint)." },
750
768
  "endorsement-id": {
751
769
  type: "string",