@curviate/cli 0.41.0 → 0.42.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 (32) hide show
  1. package/CHANGELOG.md +39 -0
  2. package/dist/{account-QZ5RYKIT.js → account-PFK5YROZ.js} +73 -26
  3. package/dist/{chunk-CBHL3QQJ.js → chunk-B5NIX4G6.js} +1 -1
  4. package/dist/{chunk-BLFGJIJJ.js → chunk-BLJGV6ST.js} +2 -2
  5. package/dist/{chunk-6W7364S3.js → chunk-KJ24DIAJ.js} +1 -1
  6. package/dist/{chunk-4AAKZPOM.js → chunk-OUMMWC7G.js} +76 -26
  7. package/dist/{chunk-WAE7YLO5.js → chunk-PCZH5QJA.js} +1 -1
  8. package/dist/{chunk-XDQHNUEU.js → chunk-TC4ZPUWI.js} +12 -6
  9. package/dist/{chunk-DCZR4M7G.js → chunk-UJOTQPL6.js} +1 -1
  10. package/dist/cli.js +64 -53
  11. package/dist/{comment-SYA6OKEY.js → comment-G4EXIIAQ.js} +83 -29
  12. package/dist/{company-IXQ4OFU3.js → company-WX5QOASS.js} +100 -50
  13. package/dist/{config-RUBXWFQ3.js → config-K4G3VSBA.js} +44 -9
  14. package/dist/{connect-TTA2X3KO.js → connect-IYTFL7NT.js} +44 -21
  15. package/dist/{doctor-ET7XQ22E.js → doctor-ICAEETCL.js} +8 -4
  16. package/dist/examples-IJL3A6SZ.js +18 -0
  17. package/dist/{feed-556LS3CN.js → feed-XC5235UF.js} +16 -14
  18. package/dist/{group-DIIG4XQT.js → group-JDP2HVSV.js} +29 -20
  19. package/dist/{inbox-SRVTUTE6.js → inbox-W3KR65VD.js} +49 -24
  20. package/dist/{inboxes-XHZTAUQ7.js → inboxes-XYS3IRT6.js} +21 -17
  21. package/dist/{job-QNVGEM4J.js → job-XW3WM57J.js} +108 -34
  22. package/dist/{login-YTVPIN27.js → login-OHAHNBRW.js} +7 -3
  23. package/dist/{message-2JEL6P7E.js → message-5XC7U4JC.js} +5 -5
  24. package/dist/{notification-T4SRAIJ3.js → notification-RIUSYJV6.js} +26 -16
  25. package/dist/{post-PV4UQVPO.js → post-LSEBRQYK.js} +94 -32
  26. package/dist/{profile-K5BZNGX5.js → profile-NHTYGX7K.js} +124 -43
  27. package/dist/{recruiter-OBKS4ZVL.js → recruiter-4SDAROK4.js} +210 -67
  28. package/dist/{sales-nav-WPTMS6QF.js → sales-nav-77NP3UXV.js} +100 -42
  29. package/dist/{search-YAKZKK74.js → search-XDOQZAVG.js} +80 -39
  30. package/dist/{setup-NZQUWJYC.js → setup-BPNLAHPC.js} +9 -4
  31. package/dist/{webhook-PXSLDB2F.js → webhook-XOPRW63N.js} +59 -23
  32. package/package.json +2 -1
package/dist/cli.js CHANGED
@@ -8,14 +8,58 @@ import {
8
8
  parseBetaFlag,
9
9
  restoreLiteralDashes,
10
10
  setBetaOverride
11
- } from "./chunk-XDQHNUEU.js";
11
+ } from "./chunk-TC4ZPUWI.js";
12
12
 
13
- // src/cli.ts
13
+ // src/main.ts
14
14
  import { defineCommand } from "citty";
15
15
  import { createRequire } from "module";
16
+ import { fileURLToPath } from "url";
17
+ import { dirname, resolve } from "path";
18
+ var __dirname = dirname(fileURLToPath(import.meta.url));
19
+ var require2 = createRequire(import.meta.url);
20
+ var pkg = require2(resolve(__dirname, "../package.json"));
21
+ var main = defineCommand({
22
+ meta: {
23
+ name: "curviate",
24
+ version: pkg.version,
25
+ description: "Official command-line interface for the Curviate API."
26
+ },
27
+ // Subcommand registry, names and descriptions are static for help rendering;
28
+ // the handler implementation is loaded lazily on first invocation.
29
+ subCommands: {
30
+ setup: () => import("./setup-BPNLAHPC.js").then((m) => m.setupCommand),
31
+ doctor: () => import("./doctor-ICAEETCL.js").then((m) => m.doctorCommand),
32
+ login: () => import("./login-OHAHNBRW.js").then((m) => m.loginCommand),
33
+ config: () => import("./config-K4G3VSBA.js").then((m) => m.configCommand),
34
+ // ---------------------------------------------------------------------------
35
+ // Noun groups, lazy-loaded on first invocation.
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),
42
+ inbox: () => import("./inbox-W3KR65VD.js").then((m) => m.inboxCommand),
43
+ inboxes: () => import("./inboxes-XYS3IRT6.js").then((m) => m.inboxesCommand),
44
+ message: () => import("./message-5XC7U4JC.js").then((m) => m.messageCommand),
45
+ post: () => import("./post-LSEBRQYK.js").then((m) => m.postCommand),
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),
49
+ "sales-nav": () => import("./sales-nav-77NP3UXV.js").then((m) => m.salesNavCommand),
50
+ recruiter: () => import("./recruiter-4SDAROK4.js").then((m) => m.recruiterCommand),
51
+ group: () => import("./group-JDP2HVSV.js").then((m) => m.groupCommand),
52
+ feed: () => import("./feed-XC5235UF.js").then((m) => m.feedCommand),
53
+ notification: () => import("./notification-RIUSYJV6.js").then((m) => m.notificationCommand)
54
+ },
55
+ async run() {
56
+ const { runMain } = await import("citty");
57
+ await runMain(main, { rawArgs: ["--help"] });
58
+ }
59
+ });
16
60
 
17
61
  // src/dispatch.ts
18
- import { runCommand } from "citty";
62
+ import { parseArgs, runCommand } from "citty";
19
63
  var GLOBAL_FLAG_NAMES = new Set(Object.keys(GLOBAL_FLAGS));
20
64
  var GLOBAL_BOOLEAN_FLAG_NAMES = new Set(
21
65
  Object.entries(GLOBAL_FLAGS).filter(([, def]) => def.type === "boolean").map(([name]) => name)
@@ -221,6 +265,14 @@ async function declaredArgNames(cmd) {
221
265
  }
222
266
  return names;
223
267
  }
268
+ function dropFalsePreview(args, walk, declared) {
269
+ if (declared.has("preview") || !declared.has("beta")) return args;
270
+ const readsFalse = (token) => parseArgs([token], { preview: GLOBAL_FLAGS.preview }).preview === false;
271
+ const drop = new Set(
272
+ walk.flags.filter(({ token, name }) => (name === "preview" || name === "no-preview") && readsFalse(token)).map(({ index }) => index)
273
+ );
274
+ return drop.size ? args.filter((_, i) => !drop.has(i)) : args;
275
+ }
224
276
  function findUnknownFlag(flags, declared, booleans) {
225
277
  for (const { token, name, index } of flags) {
226
278
  const dashes = /^-*/.exec(token)[0].length;
@@ -322,9 +374,9 @@ async function resolveLeaf(cmd, rawArgs, descent) {
322
374
  }
323
375
  async function dispatch(root, rawArgs) {
324
376
  if (rawArgs.includes("--help") || rawArgs.includes("-h")) {
325
- const { showUsage, runMain } = await import("citty");
326
- void showUsage;
327
- await runMain(root, { rawArgs });
377
+ const { runMain } = await import("citty");
378
+ const { showUsageWithExamples } = await import("./examples-IJL3A6SZ.js");
379
+ await runMain(root, { rawArgs, showUsage: showUsageWithExamples });
328
380
  return;
329
381
  }
330
382
  const versionProbe = parseBetaFlag(rawArgs);
@@ -344,17 +396,20 @@ async function dispatch(root, rawArgs) {
344
396
  const argsAfterBeta = beta.ok ? beta.rest : rawArgs;
345
397
  let hintLeaf;
346
398
  try {
347
- const { leaf, leafArgs } = await resolveLeaf(root, argsAfterBeta);
399
+ const { leaf, leafArgs: resolvedArgs } = await resolveLeaf(root, argsAfterBeta);
348
400
  hintLeaf = leaf;
349
- if (hasEmptyFields(leafArgs)) {
401
+ if (hasEmptyFields(resolvedArgs)) {
350
402
  usageError("--fields must not be empty.");
351
403
  }
352
404
  const booleanFlags = await booleanFlagNames(leaf);
353
405
  const declared = await declaredArgNames(leaf);
406
+ const leafArgs = dropFalsePreview(resolvedArgs, walkTokens(resolvedArgs, booleanFlags, declared), declared);
354
407
  const walk = walkTokens(leafArgs, booleanFlags, declared);
355
408
  const unknown = findUnknownFlag(walk.flags, declared, booleanFlags);
356
409
  if (unknown !== null) {
357
- usageError(`unknown flag ${unknown}.`);
410
+ usageError(
411
+ unknown === "`--preview`" && declared.has("beta") ? "--preview is only valid on write commands (mutations). Reads just run." : `unknown flag ${unknown}.`
412
+ );
358
413
  }
359
414
  const repeated = await repeatedFlag(leaf, walk.flags);
360
415
  if (repeated !== null) {
@@ -400,48 +455,4 @@ async function dispatch(root, rawArgs) {
400
455
  }
401
456
 
402
457
  // src/cli.ts
403
- import { fileURLToPath } from "url";
404
- import { dirname, resolve } from "path";
405
- var __dirname = dirname(fileURLToPath(import.meta.url));
406
- var require2 = createRequire(import.meta.url);
407
- var pkg = require2(resolve(__dirname, "../package.json"));
408
- var main = defineCommand({
409
- meta: {
410
- name: "curviate",
411
- version: pkg.version,
412
- description: "Official command-line interface for the Curviate API."
413
- },
414
- // Subcommand registry, names and descriptions are static for help rendering;
415
- // the handler implementation is loaded lazily on first invocation.
416
- subCommands: {
417
- setup: () => import("./setup-NZQUWJYC.js").then((m) => m.setupCommand),
418
- doctor: () => import("./doctor-ET7XQ22E.js").then((m) => m.doctorCommand),
419
- login: () => import("./login-YTVPIN27.js").then((m) => m.loginCommand),
420
- config: () => import("./config-RUBXWFQ3.js").then((m) => m.configCommand),
421
- // ---------------------------------------------------------------------------
422
- // Noun groups, lazy-loaded on first invocation.
423
- // ---------------------------------------------------------------------------
424
- profile: () => import("./profile-K5BZNGX5.js").then((m) => m.profileCommand),
425
- company: () => import("./company-IXQ4OFU3.js").then((m) => m.companyCommand),
426
- job: () => import("./job-QNVGEM4J.js").then((m) => m.jobCommand),
427
- connect: () => import("./connect-TTA2X3KO.js").then((m) => m.connectCommand),
428
- search: () => import("./search-YAKZKK74.js").then((m) => m.searchCommand),
429
- inbox: () => import("./inbox-SRVTUTE6.js").then((m) => m.inboxCommand),
430
- inboxes: () => import("./inboxes-XHZTAUQ7.js").then((m) => m.inboxesCommand),
431
- message: () => import("./message-2JEL6P7E.js").then((m) => m.messageCommand),
432
- post: () => import("./post-PV4UQVPO.js").then((m) => m.postCommand),
433
- comment: () => import("./comment-SYA6OKEY.js").then((m) => m.commentCommand),
434
- account: () => import("./account-QZ5RYKIT.js").then((m) => m.accountCommand),
435
- webhook: () => import("./webhook-PXSLDB2F.js").then((m) => m.webhookCommand),
436
- "sales-nav": () => import("./sales-nav-WPTMS6QF.js").then((m) => m.salesNavCommand),
437
- recruiter: () => import("./recruiter-OBKS4ZVL.js").then((m) => m.recruiterCommand),
438
- group: () => import("./group-DIIG4XQT.js").then((m) => m.groupCommand),
439
- feed: () => import("./feed-556LS3CN.js").then((m) => m.feedCommand),
440
- notification: () => import("./notification-T4SRAIJ3.js").then((m) => m.notificationCommand)
441
- },
442
- async run() {
443
- const { runMain } = await import("citty");
444
- await runMain(main, { rawArgs: ["--help"] });
445
- }
446
- });
447
458
  void dispatch(main, process.argv.slice(2));
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  resolveMemberOrMeProviderId
4
- } from "./chunk-WAE7YLO5.js";
4
+ } from "./chunk-PCZH5QJA.js";
5
5
  import {
6
6
  AttachError,
7
7
  describeAttachment,
@@ -11,7 +11,7 @@ import {
11
11
  import "./chunk-UEAX6KUB.js";
12
12
  import {
13
13
  requireAccount
14
- } from "./chunk-BLFGJIJJ.js";
14
+ } from "./chunk-BLJGV6ST.js";
15
15
  import {
16
16
  buildPreviewOutput
17
17
  } from "./chunk-TCUYH5GO.js";
@@ -27,16 +27,17 @@ import {
27
27
  resolveEffectiveConfig,
28
28
  streamAll,
29
29
  writeNdjsonItem
30
- } from "./chunk-CBHL3QQJ.js";
30
+ } from "./chunk-B5NIX4G6.js";
31
31
  import "./chunk-XZJQQJBE.js";
32
32
  import {
33
33
  createClient
34
- } from "./chunk-DCZR4M7G.js";
34
+ } from "./chunk-UJOTQPL6.js";
35
35
  import {
36
36
  GLOBAL_FLAGS,
37
37
  WRITE_SINGLE_FLAGS,
38
+ readOnly,
38
39
  resolveTextOrStdin
39
- } from "./chunk-XDQHNUEU.js";
40
+ } from "./chunk-TC4ZPUWI.js";
40
41
 
41
42
  // src/commands/comment.ts
42
43
  import { defineCommand } from "citty";
@@ -47,12 +48,6 @@ function buildOutputStreams() {
47
48
  stderr: { write: (s) => process.stderr.write(s) }
48
49
  };
49
50
  }
50
- function rejectPreviewOnRead(preview, out) {
51
- if (preview) {
52
- out.stderr.write("error: --preview is only valid on write commands (mutations). Reads just run.\n");
53
- process.exit(2);
54
- }
55
- }
56
51
  function resolveOutputOpts(flags) {
57
52
  return {
58
53
  json: (flags.json ?? false) || !process.stdout.isTTY,
@@ -91,7 +86,6 @@ function assertReaction(reaction, out) {
91
86
  }
92
87
  }
93
88
  async function runCommentList(client, flags, out) {
94
- rejectPreviewOnRead(flags.preview, out);
95
89
  rejectPaginationModifiersWithoutAll(flags, out);
96
90
  const accountId = await requireAccount(client, flags, out);
97
91
  const postId = flags.postId ?? "";
@@ -120,7 +114,6 @@ async function runCommentList(client, flags, out) {
120
114
  }
121
115
  }
122
116
  async function runCommentReplies(client, flags, out) {
123
- rejectPreviewOnRead(flags.preview, out);
124
117
  rejectPaginationModifiersWithoutAll(flags, out);
125
118
  const accountId = await requireAccount(client, flags, out);
126
119
  const postId = flags.postId ?? "";
@@ -150,7 +143,6 @@ async function runCommentReplies(client, flags, out) {
150
143
  }
151
144
  }
152
145
  async function runCommentReactions(client, flags, out) {
153
- rejectPreviewOnRead(flags.preview, out);
154
146
  rejectPaginationModifiersWithoutAll(flags, out);
155
147
  const accountId = await requireAccount(client, flags, out);
156
148
  const postId = flags.postId ?? "";
@@ -180,7 +172,6 @@ async function runCommentReactions(client, flags, out) {
180
172
  }
181
173
  }
182
174
  async function runCommentUser(client, flags, out) {
183
- rejectPreviewOnRead(flags.preview, out);
184
175
  rejectPaginationModifiersWithoutAll(flags, out);
185
176
  const accountId = await requireAccount(client, flags, out);
186
177
  const ns = client.account(accountId);
@@ -414,9 +405,16 @@ async function withClient(flags, fn) {
414
405
  await fn(client, { ...flags, account: flags.account ?? cfg.account }, out);
415
406
  }
416
407
  var commentListCommand = defineCommand({
417
- meta: { name: "list", description: "List the comments on a post. A very recent add/delete may take a few minutes to appear or clear here (LinkedIn-side indexing)." },
408
+ meta: {
409
+ name: "list",
410
+ description: "List the comments on a post. A very recent add/delete may take a few minutes to appear or clear here (LinkedIn-side indexing).",
411
+ examples: [
412
+ "curviate comment list 7290000000000000000",
413
+ "curviate comment list 7290000000000000000 --all"
414
+ ]
415
+ },
418
416
  args: {
419
- ...GLOBAL_FLAGS,
417
+ ...readOnly(GLOBAL_FLAGS),
420
418
  postId: { type: "positional", description: "Post id (or share URN) to list comments for." }
421
419
  },
422
420
  async run({ args }) {
@@ -424,9 +422,16 @@ var commentListCommand = defineCommand({
424
422
  }
425
423
  });
426
424
  var commentRepliesCommand = defineCommand({
427
- meta: { name: "replies", description: "List the replies to a comment." },
425
+ meta: {
426
+ name: "replies",
427
+ description: "List the replies to a comment.",
428
+ examples: [
429
+ "curviate comment replies 7290000000000000000 COMMENT_ID",
430
+ "curviate comment replies 7290000000000000000 COMMENT_ID --all"
431
+ ]
432
+ },
428
433
  args: {
429
- ...GLOBAL_FLAGS,
434
+ ...readOnly(GLOBAL_FLAGS),
430
435
  postId: { type: "positional", description: "Post id the comment belongs to." },
431
436
  commentId: { type: "positional", description: "Comment id to list replies for." }
432
437
  },
@@ -435,9 +440,15 @@ var commentRepliesCommand = defineCommand({
435
440
  }
436
441
  });
437
442
  var commentReactionsCommand = defineCommand({
438
- meta: { name: "reactions", description: "List the reactions on a comment." },
443
+ meta: {
444
+ name: "reactions",
445
+ description: "List the reactions on a comment.",
446
+ examples: [
447
+ "curviate comment reactions 7290000000000000000 COMMENT_ID"
448
+ ]
449
+ },
439
450
  args: {
440
- ...GLOBAL_FLAGS,
451
+ ...readOnly(GLOBAL_FLAGS),
441
452
  postId: { type: "positional", description: "Post id the comment belongs to." },
442
453
  commentId: { type: "positional", description: "Comment id to list reactions for." }
443
454
  },
@@ -446,9 +457,16 @@ var commentReactionsCommand = defineCommand({
446
457
  }
447
458
  });
448
459
  var commentUserCommand = defineCommand({
449
- meta: { name: "user", description: "List the comments authored by a user (accepts 'me')." },
460
+ meta: {
461
+ name: "user",
462
+ description: "List the comments authored by a user (accepts 'me').",
463
+ examples: [
464
+ "curviate comment user me",
465
+ "curviate comment user janesmith --limit 10"
466
+ ]
467
+ },
450
468
  args: {
451
- ...GLOBAL_FLAGS,
469
+ ...readOnly(GLOBAL_FLAGS),
452
470
  userId: { type: "positional", description: "Member identifier (URL, slug, provider id, or 'me')." }
453
471
  },
454
472
  async run({ args }) {
@@ -456,7 +474,13 @@ var commentUserCommand = defineCommand({
456
474
  }
457
475
  });
458
476
  var commentAddCommand = defineCommand({
459
- meta: { name: "add", description: "Publish a comment on a post." },
477
+ meta: {
478
+ name: "add",
479
+ description: "Publish a comment on a post.",
480
+ examples: [
481
+ 'curviate comment add 7290000000000000000 "Useful breakdown, thanks for sharing."'
482
+ ]
483
+ },
460
484
  args: {
461
485
  ...WRITE_SINGLE_FLAGS,
462
486
  postId: { type: "positional", description: "Post id to comment on." },
@@ -468,7 +492,13 @@ var commentAddCommand = defineCommand({
468
492
  }
469
493
  });
470
494
  var commentReplyCommand = defineCommand({
471
- meta: { name: "reply", description: "Reply to a comment." },
495
+ meta: {
496
+ name: "reply",
497
+ description: "Reply to a comment.",
498
+ examples: [
499
+ 'curviate comment reply 7290000000000000000 COMMENT_ID "Agreed, that matches what we saw."'
500
+ ]
501
+ },
472
502
  args: {
473
503
  ...WRITE_SINGLE_FLAGS,
474
504
  postId: { type: "positional", description: "Post id the comment belongs to." },
@@ -481,7 +511,13 @@ var commentReplyCommand = defineCommand({
481
511
  }
482
512
  });
483
513
  var commentEditCommand = defineCommand({
484
- meta: { name: "edit", description: "Edit your own comment." },
514
+ meta: {
515
+ name: "edit",
516
+ description: "Edit your own comment.",
517
+ examples: [
518
+ 'curviate comment edit 7290000000000000000 COMMENT_ID "Useful breakdown, thanks for writing it up."'
519
+ ]
520
+ },
485
521
  args: {
486
522
  ...WRITE_SINGLE_FLAGS,
487
523
  postId: { type: "positional", description: "Post id the comment belongs to." },
@@ -493,7 +529,13 @@ var commentEditCommand = defineCommand({
493
529
  }
494
530
  });
495
531
  var commentDeleteCommand = defineCommand({
496
- meta: { name: "delete", description: "Delete your own comment." },
532
+ meta: {
533
+ name: "delete",
534
+ description: "Delete your own comment.",
535
+ examples: [
536
+ "curviate comment delete 7290000000000000000 COMMENT_ID"
537
+ ]
538
+ },
497
539
  args: {
498
540
  ...WRITE_SINGLE_FLAGS,
499
541
  postId: { type: "positional", description: "Post id the comment belongs to." },
@@ -504,7 +546,13 @@ var commentDeleteCommand = defineCommand({
504
546
  }
505
547
  });
506
548
  var commentReactCommand = defineCommand({
507
- meta: { name: "react", description: "React to a comment (like|celebrate|support|love|insightful|funny)." },
549
+ meta: {
550
+ name: "react",
551
+ description: "React to a comment (like|celebrate|support|love|insightful|funny).",
552
+ examples: [
553
+ "curviate comment react 7290000000000000000 COMMENT_ID insightful"
554
+ ]
555
+ },
508
556
  args: {
509
557
  ...WRITE_SINGLE_FLAGS,
510
558
  postId: { type: "positional", description: "Post id the comment belongs to." },
@@ -516,7 +564,13 @@ var commentReactCommand = defineCommand({
516
564
  }
517
565
  });
518
566
  var commentUnreactCommand = defineCommand({
519
- meta: { name: "unreact", description: "Remove your reaction from a comment." },
567
+ meta: {
568
+ name: "unreact",
569
+ description: "Remove your reaction from a comment.",
570
+ examples: [
571
+ "curviate comment unreact 7290000000000000000 COMMENT_ID insightful"
572
+ ]
573
+ },
520
574
  args: {
521
575
  ...WRITE_SINGLE_FLAGS,
522
576
  postId: { type: "positional", description: "Post id the comment belongs to." },