@curviate/cli 0.40.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.
- package/CHANGELOG.md +67 -0
- package/dist/{account-LTXAUBBP.js → account-PFK5YROZ.js} +81 -26
- package/dist/{chunk-OTBJATDE.js → chunk-B5NIX4G6.js} +6 -1
- package/dist/{chunk-LD5KJSCT.js → chunk-BLJGV6ST.js} +2 -2
- package/dist/{chunk-6W7364S3.js → chunk-KJ24DIAJ.js} +1 -1
- package/dist/{chunk-T6G5AASF.js → chunk-OUMMWC7G.js} +79 -26
- package/dist/{chunk-BGVK73VI.js → chunk-PCZH5QJA.js} +1 -1
- package/dist/{chunk-XDQHNUEU.js → chunk-TC4ZPUWI.js} +12 -6
- package/dist/{chunk-DCZR4M7G.js → chunk-UJOTQPL6.js} +1 -1
- package/dist/cli.js +64 -53
- package/dist/{comment-2CSBSBOH.js → comment-G4EXIIAQ.js} +83 -29
- package/dist/{company-ZUIUR5UN.js → company-WX5QOASS.js} +104 -50
- package/dist/{config-RUBXWFQ3.js → config-K4G3VSBA.js} +44 -9
- package/dist/{connect-LSXKNEL2.js → connect-IYTFL7NT.js} +44 -21
- package/dist/{doctor-FHOHIQPX.js → doctor-ICAEETCL.js} +8 -4
- package/dist/examples-IJL3A6SZ.js +18 -0
- package/dist/{feed-UUHB2FXI.js → feed-XC5235UF.js} +16 -14
- package/dist/{group-NUCO3P2W.js → group-JDP2HVSV.js} +31 -20
- package/dist/{inbox-DEZTGTPO.js → inbox-W3KR65VD.js} +51 -24
- package/dist/{inboxes-F3NIQQRK.js → inboxes-XYS3IRT6.js} +23 -17
- package/dist/{job-YMGO3WJH.js → job-XW3WM57J.js} +112 -34
- package/dist/{login-YTVPIN27.js → login-OHAHNBRW.js} +7 -3
- package/dist/{message-RSBUXI64.js → message-5XC7U4JC.js} +5 -5
- package/dist/{notification-EJ35OD3Q.js → notification-RIUSYJV6.js} +26 -16
- package/dist/{post-VHVQ56A7.js → post-LSEBRQYK.js} +96 -32
- package/dist/{profile-3CBNI42H.js → profile-NHTYGX7K.js} +130 -43
- package/dist/{recruiter-M7XUFYNR.js → recruiter-4SDAROK4.js} +219 -67
- package/dist/{sales-nav-S47OCEUC.js → sales-nav-77NP3UXV.js} +102 -42
- package/dist/{search-UWI37MKG.js → search-XDOQZAVG.js} +80 -39
- package/dist/{setup-3EQRACT6.js → setup-BPNLAHPC.js} +9 -4
- package/dist/{webhook-I4U4C4XE.js → webhook-XOPRW63N.js} +62 -23
- package/package.json +3 -2
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import {
|
|
3
3
|
resolveMemberOrMeProviderId
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-PCZH5QJA.js";
|
|
5
5
|
import {
|
|
6
6
|
AttachError,
|
|
7
7
|
readAttachment,
|
|
@@ -10,7 +10,7 @@ import {
|
|
|
10
10
|
import "./chunk-UEAX6KUB.js";
|
|
11
11
|
import {
|
|
12
12
|
requireAccount
|
|
13
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-BLJGV6ST.js";
|
|
14
14
|
import {
|
|
15
15
|
buildPreviewOutput
|
|
16
16
|
} from "./chunk-TCUYH5GO.js";
|
|
@@ -18,6 +18,7 @@ import {
|
|
|
18
18
|
pageDelayFromFlags,
|
|
19
19
|
readCursorFlag,
|
|
20
20
|
readMaxPagesFlag,
|
|
21
|
+
readableObject,
|
|
21
22
|
readablePage,
|
|
22
23
|
rejectPaginationModifiersWithoutAll,
|
|
23
24
|
renderError,
|
|
@@ -26,18 +27,19 @@ import {
|
|
|
26
27
|
resolveEffectiveConfig,
|
|
27
28
|
streamAll,
|
|
28
29
|
writeNdjsonItem
|
|
29
|
-
} from "./chunk-
|
|
30
|
+
} from "./chunk-B5NIX4G6.js";
|
|
30
31
|
import "./chunk-XZJQQJBE.js";
|
|
31
32
|
import {
|
|
32
33
|
createClient
|
|
33
|
-
} from "./chunk-
|
|
34
|
+
} from "./chunk-UJOTQPL6.js";
|
|
34
35
|
import {
|
|
35
36
|
GLOBAL_FLAGS,
|
|
36
37
|
NON_STREAM_FLAGS,
|
|
37
38
|
WRITE_FLAGS,
|
|
38
39
|
WRITE_SINGLE_FLAGS,
|
|
40
|
+
readOnly,
|
|
39
41
|
resolveTextOrStdin
|
|
40
|
-
} from "./chunk-
|
|
42
|
+
} from "./chunk-TC4ZPUWI.js";
|
|
41
43
|
|
|
42
44
|
// src/commands/post.ts
|
|
43
45
|
import { defineCommand } from "citty";
|
|
@@ -48,12 +50,6 @@ function buildOutputStreams() {
|
|
|
48
50
|
stderr: { write: (s) => process.stderr.write(s) }
|
|
49
51
|
};
|
|
50
52
|
}
|
|
51
|
-
function rejectPreviewOnRead(preview, out) {
|
|
52
|
-
if (preview) {
|
|
53
|
-
out.stderr.write("error: --preview is only valid on write commands (mutations). Reads just run.\n");
|
|
54
|
-
process.exit(2);
|
|
55
|
-
}
|
|
56
|
-
}
|
|
57
53
|
function rejectAllOnNonPaginated(all, out) {
|
|
58
54
|
if (all) {
|
|
59
55
|
out.stderr.write("error: --all is not supported on non-paginated commands.\n");
|
|
@@ -89,7 +85,6 @@ async function handleSdkError(err, outOpts, out) {
|
|
|
89
85
|
process.exit(1);
|
|
90
86
|
}
|
|
91
87
|
async function runPostGet(client, flags, out) {
|
|
92
|
-
rejectPreviewOnRead(flags.preview, out);
|
|
93
88
|
rejectAllOnNonPaginated(flags.all, out);
|
|
94
89
|
const accountId = await requireAccount(client, flags, out);
|
|
95
90
|
const postId = flags.postId ?? "";
|
|
@@ -97,6 +92,7 @@ async function runPostGet(client, flags, out) {
|
|
|
97
92
|
const outOpts = resolveOutputOpts(flags);
|
|
98
93
|
try {
|
|
99
94
|
const result = await ns.posts.get(postId);
|
|
95
|
+
readableObject(result);
|
|
100
96
|
renderSuccess(result, outOpts, out);
|
|
101
97
|
} catch (err) {
|
|
102
98
|
await handleSdkError(err, outOpts, out);
|
|
@@ -184,7 +180,6 @@ async function runPostReact(client, flags, out) {
|
|
|
184
180
|
}
|
|
185
181
|
}
|
|
186
182
|
async function runPostReactions(client, flags, out) {
|
|
187
|
-
rejectPreviewOnRead(flags.preview, out);
|
|
188
183
|
rejectPaginationModifiersWithoutAll(flags, out);
|
|
189
184
|
const accountId = await requireAccount(client, flags, out);
|
|
190
185
|
const postId = flags.postId ?? "";
|
|
@@ -213,7 +208,6 @@ async function runPostReactions(client, flags, out) {
|
|
|
213
208
|
}
|
|
214
209
|
}
|
|
215
210
|
async function runPostSaved(client, flags, out) {
|
|
216
|
-
rejectPreviewOnRead(flags.preview, out);
|
|
217
211
|
rejectPaginationModifiersWithoutAll(flags, out);
|
|
218
212
|
const accountId = await requireAccount(client, flags, out);
|
|
219
213
|
const ns = client.account(accountId);
|
|
@@ -321,7 +315,6 @@ async function runPostUnreact(client, flags, out) {
|
|
|
321
315
|
}
|
|
322
316
|
}
|
|
323
317
|
async function runPostUserPosts(client, flags, out) {
|
|
324
|
-
rejectPreviewOnRead(flags.preview, out);
|
|
325
318
|
rejectPaginationModifiersWithoutAll(flags, out);
|
|
326
319
|
const accountId = await requireAccount(client, flags, out);
|
|
327
320
|
const ns = client.account(accountId);
|
|
@@ -356,7 +349,6 @@ async function runPostUserPosts(client, flags, out) {
|
|
|
356
349
|
}
|
|
357
350
|
}
|
|
358
351
|
async function runPostUserReactions(client, flags, out) {
|
|
359
|
-
rejectPreviewOnRead(flags.preview, out);
|
|
360
352
|
rejectPaginationModifiersWithoutAll(flags, out);
|
|
361
353
|
const accountId = await requireAccount(client, flags, out);
|
|
362
354
|
const ns = client.account(accountId);
|
|
@@ -391,9 +383,16 @@ async function runPostUserReactions(client, flags, out) {
|
|
|
391
383
|
}
|
|
392
384
|
}
|
|
393
385
|
var postGetCommand = defineCommand({
|
|
394
|
-
meta: {
|
|
386
|
+
meta: {
|
|
387
|
+
name: "get",
|
|
388
|
+
description: "Get a post by id.",
|
|
389
|
+
examples: [
|
|
390
|
+
"curviate post get 7290000000000000000",
|
|
391
|
+
"curviate post get urn:li:activity:7290000000000000000"
|
|
392
|
+
]
|
|
393
|
+
},
|
|
395
394
|
args: {
|
|
396
|
-
...NON_STREAM_FLAGS,
|
|
395
|
+
...readOnly(NON_STREAM_FLAGS),
|
|
397
396
|
postId: {
|
|
398
397
|
type: "positional",
|
|
399
398
|
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>'."
|
|
@@ -418,7 +417,14 @@ var postGetCommand = defineCommand({
|
|
|
418
417
|
}
|
|
419
418
|
});
|
|
420
419
|
var postCreateCommand = defineCommand({
|
|
421
|
-
meta: {
|
|
420
|
+
meta: {
|
|
421
|
+
name: "create",
|
|
422
|
+
description: "Create a new post.",
|
|
423
|
+
examples: [
|
|
424
|
+
'curviate post create "We just shipped webhooks for inbox events."',
|
|
425
|
+
'curviate post create "Our latest product update." --attach screenshot.png'
|
|
426
|
+
]
|
|
427
|
+
},
|
|
422
428
|
args: {
|
|
423
429
|
// Write command: WRITE_FLAGS omits pagination/projection flags
|
|
424
430
|
...WRITE_FLAGS,
|
|
@@ -447,7 +453,14 @@ var postCreateCommand = defineCommand({
|
|
|
447
453
|
}
|
|
448
454
|
});
|
|
449
455
|
var postReactCommand = defineCommand({
|
|
450
|
-
meta: {
|
|
456
|
+
meta: {
|
|
457
|
+
name: "react",
|
|
458
|
+
description: "React to a post.",
|
|
459
|
+
examples: [
|
|
460
|
+
"curviate post react 7290000000000000000 like",
|
|
461
|
+
"curviate post react 7290000000000000000 celebrate --as-organization 1234567"
|
|
462
|
+
]
|
|
463
|
+
},
|
|
451
464
|
args: {
|
|
452
465
|
// Write command: WRITE_FLAGS omits pagination/projection flags
|
|
453
466
|
...WRITE_FLAGS,
|
|
@@ -489,9 +502,16 @@ var postReactCommand = defineCommand({
|
|
|
489
502
|
}
|
|
490
503
|
});
|
|
491
504
|
var postReactionsCommand = defineCommand({
|
|
492
|
-
meta: {
|
|
505
|
+
meta: {
|
|
506
|
+
name: "reactions",
|
|
507
|
+
description: "List reactions on a post.",
|
|
508
|
+
examples: [
|
|
509
|
+
"curviate post reactions 7290000000000000000",
|
|
510
|
+
"curviate post reactions 7290000000000000000 --all"
|
|
511
|
+
]
|
|
512
|
+
},
|
|
493
513
|
args: {
|
|
494
|
-
...GLOBAL_FLAGS,
|
|
514
|
+
...readOnly(GLOBAL_FLAGS),
|
|
495
515
|
postId: {
|
|
496
516
|
type: "positional",
|
|
497
517
|
description: "Numeric post id, urn:li:activity:N, or full LinkedIn share URL (activity-<N>- extracted). POSTID is always the post's id."
|
|
@@ -532,7 +552,13 @@ async function withClient(flags, fn) {
|
|
|
532
552
|
await fn(client, { ...flags, account: flags.account ?? cfg.account }, out);
|
|
533
553
|
}
|
|
534
554
|
var postDeleteCommand = defineCommand({
|
|
535
|
-
meta: {
|
|
555
|
+
meta: {
|
|
556
|
+
name: "delete",
|
|
557
|
+
description: "Delete a post you own.",
|
|
558
|
+
examples: [
|
|
559
|
+
"curviate post delete 7290000000000000000"
|
|
560
|
+
]
|
|
561
|
+
},
|
|
536
562
|
args: {
|
|
537
563
|
...WRITE_SINGLE_FLAGS,
|
|
538
564
|
postId: { type: "positional", description: "Post id, urn:li:activity:N, or full share URL." }
|
|
@@ -542,7 +568,13 @@ var postDeleteCommand = defineCommand({
|
|
|
542
568
|
}
|
|
543
569
|
});
|
|
544
570
|
var postUnreactCommand = defineCommand({
|
|
545
|
-
meta: {
|
|
571
|
+
meta: {
|
|
572
|
+
name: "unreact",
|
|
573
|
+
description: "Remove your reaction from a post.",
|
|
574
|
+
examples: [
|
|
575
|
+
"curviate post unreact 7290000000000000000 like"
|
|
576
|
+
]
|
|
577
|
+
},
|
|
546
578
|
args: {
|
|
547
579
|
...WRITE_SINGLE_FLAGS,
|
|
548
580
|
postId: { type: "positional", description: "Post id, urn:li:activity:N, or full share URL." },
|
|
@@ -553,14 +585,26 @@ var postUnreactCommand = defineCommand({
|
|
|
553
585
|
}
|
|
554
586
|
});
|
|
555
587
|
var postSavedCommand = defineCommand({
|
|
556
|
-
meta: {
|
|
557
|
-
|
|
588
|
+
meta: {
|
|
589
|
+
name: "saved",
|
|
590
|
+
description: "List your own saved posts (a private bookmark list, newest-saved-first). Each item is a preview (snippet capped at 140 chars).",
|
|
591
|
+
examples: [
|
|
592
|
+
"curviate post saved"
|
|
593
|
+
]
|
|
594
|
+
},
|
|
595
|
+
args: { ...readOnly(GLOBAL_FLAGS) },
|
|
558
596
|
async run({ args }) {
|
|
559
597
|
await withClient(args, runPostSaved);
|
|
560
598
|
}
|
|
561
599
|
});
|
|
562
600
|
var postSaveCommand = defineCommand({
|
|
563
|
-
meta: {
|
|
601
|
+
meta: {
|
|
602
|
+
name: "save",
|
|
603
|
+
description: "Save a post to your private bookmark list. Never notifies the author, never visible to third parties. Saving a saved post changes nothing.",
|
|
604
|
+
examples: [
|
|
605
|
+
"curviate post save 7290000000000000000"
|
|
606
|
+
]
|
|
607
|
+
},
|
|
564
608
|
args: {
|
|
565
609
|
...WRITE_SINGLE_FLAGS,
|
|
566
610
|
postId: { type: "positional", description: "Post id (urn:li:activity:N or a bare numeric id)." }
|
|
@@ -570,7 +614,13 @@ var postSaveCommand = defineCommand({
|
|
|
570
614
|
}
|
|
571
615
|
});
|
|
572
616
|
var postUnsaveCommand = defineCommand({
|
|
573
|
-
meta: {
|
|
617
|
+
meta: {
|
|
618
|
+
name: "unsave",
|
|
619
|
+
description: "Remove a post from your saved-posts bookmark list. Unsaving a post that is not saved changes nothing.",
|
|
620
|
+
examples: [
|
|
621
|
+
"curviate post unsave 7290000000000000000"
|
|
622
|
+
]
|
|
623
|
+
},
|
|
574
624
|
args: {
|
|
575
625
|
...WRITE_SINGLE_FLAGS,
|
|
576
626
|
postId: { type: "positional", description: "Post id (urn:li:activity:N or a bare numeric id)." }
|
|
@@ -580,9 +630,16 @@ var postUnsaveCommand = defineCommand({
|
|
|
580
630
|
}
|
|
581
631
|
});
|
|
582
632
|
var postUserPostsCommand = defineCommand({
|
|
583
|
-
meta: {
|
|
633
|
+
meta: {
|
|
634
|
+
name: "user-posts",
|
|
635
|
+
description: "List a member's own posts (accepts 'me'). A very recent create/delete may take a few minutes to appear or clear here (LinkedIn-side indexing); `post get <post_id>` reflects it immediately.",
|
|
636
|
+
examples: [
|
|
637
|
+
"curviate post user-posts me",
|
|
638
|
+
"curviate post user-posts janesmith --limit 10"
|
|
639
|
+
]
|
|
640
|
+
},
|
|
584
641
|
args: {
|
|
585
|
-
...GLOBAL_FLAGS,
|
|
642
|
+
...readOnly(GLOBAL_FLAGS),
|
|
586
643
|
userId: { type: "positional", description: "Member identifier (URL, slug, provider id, or 'me')." }
|
|
587
644
|
},
|
|
588
645
|
async run({ args }) {
|
|
@@ -590,9 +647,16 @@ var postUserPostsCommand = defineCommand({
|
|
|
590
647
|
}
|
|
591
648
|
});
|
|
592
649
|
var postUserReactionsCommand = defineCommand({
|
|
593
|
-
meta: {
|
|
650
|
+
meta: {
|
|
651
|
+
name: "user-reactions",
|
|
652
|
+
description: "List a member's own reactions (accepts 'me'). Items carry no time of the reaction: `parent_post.created_at` is when the post was created, not when it was reacted to, so the listing cannot be filtered by date; without `--all`, `--limit` caps the read at one page.",
|
|
653
|
+
examples: [
|
|
654
|
+
"curviate post user-reactions me",
|
|
655
|
+
"curviate post user-reactions me --all"
|
|
656
|
+
]
|
|
657
|
+
},
|
|
594
658
|
args: {
|
|
595
|
-
...GLOBAL_FLAGS,
|
|
659
|
+
...readOnly(GLOBAL_FLAGS),
|
|
596
660
|
userId: { type: "positional", description: "Member identifier (URL, slug, provider id, or 'me')." }
|
|
597
661
|
},
|
|
598
662
|
async run({ args }) {
|
|
@@ -13,7 +13,7 @@ import {
|
|
|
13
13
|
import {
|
|
14
14
|
resolveMemberOrMeProviderId,
|
|
15
15
|
resolveMemberProviderId
|
|
16
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-PCZH5QJA.js";
|
|
17
17
|
import {
|
|
18
18
|
AttachError,
|
|
19
19
|
readAttachment,
|
|
@@ -24,7 +24,7 @@ import {
|
|
|
24
24
|
} from "./chunk-UEAX6KUB.js";
|
|
25
25
|
import {
|
|
26
26
|
requireAccount
|
|
27
|
-
} from "./chunk-
|
|
27
|
+
} from "./chunk-BLJGV6ST.js";
|
|
28
28
|
import {
|
|
29
29
|
buildPreviewOutput
|
|
30
30
|
} from "./chunk-TCUYH5GO.js";
|
|
@@ -33,6 +33,7 @@ import {
|
|
|
33
33
|
readCursorFlag,
|
|
34
34
|
readMaxPagesFlag,
|
|
35
35
|
readableId,
|
|
36
|
+
readableObject,
|
|
36
37
|
readablePage,
|
|
37
38
|
rejectPaginationModifiersWithoutAll,
|
|
38
39
|
renderError,
|
|
@@ -41,26 +42,21 @@ import {
|
|
|
41
42
|
resolveEffectiveConfig,
|
|
42
43
|
streamAll,
|
|
43
44
|
writeNdjsonItem
|
|
44
|
-
} from "./chunk-
|
|
45
|
+
} from "./chunk-B5NIX4G6.js";
|
|
45
46
|
import "./chunk-XZJQQJBE.js";
|
|
46
47
|
import {
|
|
47
48
|
createClient
|
|
48
|
-
} from "./chunk-
|
|
49
|
+
} from "./chunk-UJOTQPL6.js";
|
|
49
50
|
import {
|
|
50
51
|
GLOBAL_FLAGS,
|
|
51
52
|
NON_STREAM_FLAGS,
|
|
52
53
|
READ_SINGLE_FLAGS,
|
|
53
|
-
WRITE_SINGLE_FLAGS
|
|
54
|
-
|
|
54
|
+
WRITE_SINGLE_FLAGS,
|
|
55
|
+
readOnly
|
|
56
|
+
} from "./chunk-TC4ZPUWI.js";
|
|
55
57
|
|
|
56
58
|
// src/commands/profile.ts
|
|
57
59
|
import { defineCommand } from "citty";
|
|
58
|
-
function rejectPreviewOnRead(preview, out) {
|
|
59
|
-
if (preview) {
|
|
60
|
-
out.stderr.write("error: --preview is only valid on write commands (mutations). Reads just run.\n");
|
|
61
|
-
process.exit(2);
|
|
62
|
-
}
|
|
63
|
-
}
|
|
64
60
|
function rejectAllOnNonPaginated(all, out) {
|
|
65
61
|
if (all) {
|
|
66
62
|
out.stderr.write("error: --all is not supported on non-paginated commands.\n");
|
|
@@ -98,7 +94,6 @@ function resolveOutputOpts(flags) {
|
|
|
98
94
|
};
|
|
99
95
|
}
|
|
100
96
|
async function runProfileMe(client, flags, out) {
|
|
101
|
-
rejectPreviewOnRead(flags.preview, out);
|
|
102
97
|
rejectPaginationModifiersWithoutAll(flags, out);
|
|
103
98
|
const hasActivityFlag = !!(flags.posts || flags.comments || flags.reactions || flags.followers);
|
|
104
99
|
if (!hasActivityFlag) {
|
|
@@ -207,6 +202,7 @@ async function runProfileMe(client, flags, out) {
|
|
|
207
202
|
}
|
|
208
203
|
try {
|
|
209
204
|
const result = await ns.users.get("me", params);
|
|
205
|
+
readableObject(result);
|
|
210
206
|
const slimOutOpts = { ...outOpts, slim: withRequestedSections(slimProfileMe, params.linkedin_sections) };
|
|
211
207
|
renderSuccess(result, slimOutOpts, out);
|
|
212
208
|
} catch (err) {
|
|
@@ -221,7 +217,6 @@ async function runProfileMe(client, flags, out) {
|
|
|
221
217
|
}
|
|
222
218
|
}
|
|
223
219
|
async function runProfileGet(client, flags, out) {
|
|
224
|
-
rejectPreviewOnRead(flags.preview, out);
|
|
225
220
|
rejectPaginationModifiersWithoutAll(flags, out);
|
|
226
221
|
const isListCommand = flags.posts || flags.comments || flags.reactions || flags.followers;
|
|
227
222
|
if (!isListCommand && flags.sections === "") {
|
|
@@ -338,6 +333,7 @@ async function runProfileGet(client, flags, out) {
|
|
|
338
333
|
}
|
|
339
334
|
const getId = flags.sections ? await resolveMemberOrMeProviderId(ns, rawId, retrievalQuery) : resolvedId;
|
|
340
335
|
const result = await ns.users.get(getId, params);
|
|
336
|
+
readableObject(result);
|
|
341
337
|
const getOutOpts = { ...outOpts, slim: withRequestedSections(slimProfile, parsedSections) };
|
|
342
338
|
renderSuccess(result, getOutOpts, out);
|
|
343
339
|
}
|
|
@@ -353,7 +349,6 @@ async function runProfileGet(client, flags, out) {
|
|
|
353
349
|
}
|
|
354
350
|
}
|
|
355
351
|
async function runProfileRelations(client, flags, out) {
|
|
356
|
-
rejectPreviewOnRead(flags.preview, out);
|
|
357
352
|
rejectPaginationModifiersWithoutAll(flags, out);
|
|
358
353
|
const accountId = await requireAccount(client, flags, out);
|
|
359
354
|
const ns = client.account(accountId);
|
|
@@ -431,33 +426,32 @@ async function handleSdkError(err, outOpts, out) {
|
|
|
431
426
|
process.exit(1);
|
|
432
427
|
}
|
|
433
428
|
async function runProfileSubscription(client, flags, out) {
|
|
434
|
-
rejectPreviewOnRead(flags.preview, out);
|
|
435
429
|
rejectAllOnNonPaginated(flags.all, out);
|
|
436
430
|
const accountId = await requireAccount(client, flags, out);
|
|
437
431
|
const ns = client.account(accountId);
|
|
438
432
|
const outOpts = resolveOutputOpts(flags);
|
|
439
433
|
try {
|
|
440
434
|
const result = await ns.profile.subscription();
|
|
435
|
+
readableObject(result);
|
|
441
436
|
renderSuccess(result, outOpts, out);
|
|
442
437
|
} catch (err) {
|
|
443
438
|
await handleSdkError(err, outOpts, out);
|
|
444
439
|
}
|
|
445
440
|
}
|
|
446
441
|
async function runProfileAnalytics(client, flags, out) {
|
|
447
|
-
rejectPreviewOnRead(flags.preview, out);
|
|
448
442
|
rejectAllOnNonPaginated(flags.all, out);
|
|
449
443
|
const accountId = await requireAccount(client, flags, out);
|
|
450
444
|
const ns = client.account(accountId);
|
|
451
445
|
const outOpts = resolveOutputOpts(flags);
|
|
452
446
|
try {
|
|
453
447
|
const result = await ns.profile.analytics();
|
|
448
|
+
readableObject(result);
|
|
454
449
|
renderSuccess(result, outOpts, out);
|
|
455
450
|
} catch (err) {
|
|
456
451
|
await handleSdkError(err, outOpts, out);
|
|
457
452
|
}
|
|
458
453
|
}
|
|
459
454
|
async function runProfileVisitors(client, flags, out) {
|
|
460
|
-
rejectPreviewOnRead(flags.preview, out);
|
|
461
455
|
rejectPaginationModifiersWithoutAll(flags, out);
|
|
462
456
|
const accountId = await requireAccount(client, flags, out);
|
|
463
457
|
const ns = client.account(accountId);
|
|
@@ -489,13 +483,13 @@ async function runProfileVisitors(client, flags, out) {
|
|
|
489
483
|
}
|
|
490
484
|
}
|
|
491
485
|
async function runProfileSsi(client, flags, out) {
|
|
492
|
-
rejectPreviewOnRead(flags.preview, out);
|
|
493
486
|
rejectAllOnNonPaginated(flags.all, out);
|
|
494
487
|
const accountId = await requireAccount(client, flags, out);
|
|
495
488
|
const ns = client.account(accountId);
|
|
496
489
|
const outOpts = resolveOutputOpts(flags);
|
|
497
490
|
try {
|
|
498
491
|
const result = await ns.profile.ssi();
|
|
492
|
+
readableObject(result);
|
|
499
493
|
renderSuccess(result, outOpts, out);
|
|
500
494
|
} catch (err) {
|
|
501
495
|
await handleSdkError(err, outOpts, out);
|
|
@@ -596,7 +590,6 @@ async function runProfileUnfollow(client, flags, out) {
|
|
|
596
590
|
}
|
|
597
591
|
}
|
|
598
592
|
async function runProfileFollowers(client, flags, out) {
|
|
599
|
-
rejectPreviewOnRead(flags.preview, out);
|
|
600
593
|
rejectPaginationModifiersWithoutAll(flags, out);
|
|
601
594
|
const accountId = await requireAccount(client, flags, out);
|
|
602
595
|
const resolvedId = resolveIdentifier(flags.id ?? "");
|
|
@@ -628,7 +621,6 @@ async function runProfileFollowers(client, flags, out) {
|
|
|
628
621
|
}
|
|
629
622
|
}
|
|
630
623
|
async function runProfileFollowing(client, flags, out) {
|
|
631
|
-
rejectPreviewOnRead(flags.preview, out);
|
|
632
624
|
rejectPaginationModifiersWithoutAll(flags, out);
|
|
633
625
|
const accountId = await requireAccount(client, flags, out);
|
|
634
626
|
const resolvedId = resolveIdentifier(flags.id ?? "");
|
|
@@ -660,9 +652,19 @@ async function runProfileFollowing(client, flags, out) {
|
|
|
660
652
|
}
|
|
661
653
|
}
|
|
662
654
|
var profileMeCommand = defineCommand({
|
|
663
|
-
meta: {
|
|
655
|
+
meta: {
|
|
656
|
+
name: "me",
|
|
657
|
+
description: "Get your own profile, or list own activity with --posts/--comments/--reactions/--followers.",
|
|
658
|
+
examples: [
|
|
659
|
+
"curviate profile me",
|
|
660
|
+
"curviate profile me --posts"
|
|
661
|
+
],
|
|
662
|
+
requires: [
|
|
663
|
+
"--all, --max-pages and --page-delay only with a list flag: --posts, --comments, --reactions or --followers."
|
|
664
|
+
]
|
|
665
|
+
},
|
|
664
666
|
args: {
|
|
665
|
-
...GLOBAL_FLAGS,
|
|
667
|
+
...readOnly(GLOBAL_FLAGS),
|
|
666
668
|
...RETRIEVAL_FLAGS,
|
|
667
669
|
sections: {
|
|
668
670
|
type: "string",
|
|
@@ -708,8 +710,15 @@ var profileMeCommand = defineCommand({
|
|
|
708
710
|
}
|
|
709
711
|
});
|
|
710
712
|
var profileRelationsCommand = defineCommand({
|
|
711
|
-
meta: {
|
|
712
|
-
|
|
713
|
+
meta: {
|
|
714
|
+
name: "relations",
|
|
715
|
+
description: "List your 1st-degree connections.",
|
|
716
|
+
examples: [
|
|
717
|
+
"curviate profile relations",
|
|
718
|
+
"curviate profile relations --all"
|
|
719
|
+
]
|
|
720
|
+
},
|
|
721
|
+
args: { ...readOnly(GLOBAL_FLAGS) },
|
|
713
722
|
async run({ args }) {
|
|
714
723
|
const flags = args;
|
|
715
724
|
const cfg = await resolveEffectiveConfig({
|
|
@@ -729,7 +738,13 @@ var profileRelationsCommand = defineCommand({
|
|
|
729
738
|
}
|
|
730
739
|
});
|
|
731
740
|
var profileEndorseCommand = defineCommand({
|
|
732
|
-
meta: {
|
|
741
|
+
meta: {
|
|
742
|
+
name: "endorse",
|
|
743
|
+
description: "Endorse a skill on a member's profile.",
|
|
744
|
+
examples: [
|
|
745
|
+
"curviate profile endorse janesmith --endorsement-id 12345"
|
|
746
|
+
]
|
|
747
|
+
},
|
|
733
748
|
args: {
|
|
734
749
|
...NON_STREAM_FLAGS,
|
|
735
750
|
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)." },
|
|
@@ -774,7 +789,17 @@ async function withClient(flags, fn) {
|
|
|
774
789
|
await fn(client, { ...flags, account: flags.account ?? cfg.account }, out);
|
|
775
790
|
}
|
|
776
791
|
var profileUpdateCommand = defineCommand({
|
|
777
|
-
meta: {
|
|
792
|
+
meta: {
|
|
793
|
+
name: "update",
|
|
794
|
+
description: "Update your own profile (headline, bio, name, skills, photos).",
|
|
795
|
+
examples: [
|
|
796
|
+
'curviate profile update --headline "Building agent infrastructure"',
|
|
797
|
+
'curviate profile update --skills "TypeScript,Agents"'
|
|
798
|
+
],
|
|
799
|
+
requires: [
|
|
800
|
+
"At least one of --first-name, --last-name, --headline, --bio, --skills, --picture, --background-picture."
|
|
801
|
+
]
|
|
802
|
+
},
|
|
778
803
|
args: {
|
|
779
804
|
...WRITE_SINGLE_FLAGS,
|
|
780
805
|
headline: { type: "string", description: "New headline." },
|
|
@@ -790,7 +815,13 @@ var profileUpdateCommand = defineCommand({
|
|
|
790
815
|
}
|
|
791
816
|
});
|
|
792
817
|
var profileFollowCommand = defineCommand({
|
|
793
|
-
meta: {
|
|
818
|
+
meta: {
|
|
819
|
+
name: "follow",
|
|
820
|
+
description: "Follow a member (sends a connect request if their profile is private).",
|
|
821
|
+
examples: [
|
|
822
|
+
"curviate profile follow janesmith"
|
|
823
|
+
]
|
|
824
|
+
},
|
|
794
825
|
args: {
|
|
795
826
|
...WRITE_SINGLE_FLAGS,
|
|
796
827
|
id: { type: "positional", description: "Member identifier (URL, slug, provider id)." }
|
|
@@ -800,7 +831,13 @@ var profileFollowCommand = defineCommand({
|
|
|
800
831
|
}
|
|
801
832
|
});
|
|
802
833
|
var profileUnfollowCommand = defineCommand({
|
|
803
|
-
meta: {
|
|
834
|
+
meta: {
|
|
835
|
+
name: "unfollow",
|
|
836
|
+
description: "Unfollow a member. Unfollowing someone you do not follow changes nothing.",
|
|
837
|
+
examples: [
|
|
838
|
+
"curviate profile unfollow janesmith"
|
|
839
|
+
]
|
|
840
|
+
},
|
|
804
841
|
args: {
|
|
805
842
|
...WRITE_SINGLE_FLAGS,
|
|
806
843
|
id: { type: "positional", description: "Member identifier (URL, slug, provider id)." }
|
|
@@ -810,9 +847,16 @@ var profileUnfollowCommand = defineCommand({
|
|
|
810
847
|
}
|
|
811
848
|
});
|
|
812
849
|
var profileFollowersCommand = defineCommand({
|
|
813
|
-
meta: {
|
|
850
|
+
meta: {
|
|
851
|
+
name: "followers",
|
|
852
|
+
description: "List a member's followers (accepts 'me').",
|
|
853
|
+
examples: [
|
|
854
|
+
"curviate profile followers me",
|
|
855
|
+
"curviate profile followers janesmith --limit 20"
|
|
856
|
+
]
|
|
857
|
+
},
|
|
814
858
|
args: {
|
|
815
|
-
...GLOBAL_FLAGS,
|
|
859
|
+
...readOnly(GLOBAL_FLAGS),
|
|
816
860
|
id: { type: "positional", description: "Member identifier (URL, slug, provider id, or 'me')." }
|
|
817
861
|
},
|
|
818
862
|
async run({ args }) {
|
|
@@ -820,9 +864,16 @@ var profileFollowersCommand = defineCommand({
|
|
|
820
864
|
}
|
|
821
865
|
});
|
|
822
866
|
var profileFollowingCommand = defineCommand({
|
|
823
|
-
meta: {
|
|
867
|
+
meta: {
|
|
868
|
+
name: "following",
|
|
869
|
+
description: "List who a member follows (accepts 'me').",
|
|
870
|
+
examples: [
|
|
871
|
+
"curviate profile following me",
|
|
872
|
+
"curviate profile following me --all"
|
|
873
|
+
]
|
|
874
|
+
},
|
|
824
875
|
args: {
|
|
825
|
-
...GLOBAL_FLAGS,
|
|
876
|
+
...readOnly(GLOBAL_FLAGS),
|
|
826
877
|
id: { type: "positional", description: "Member identifier (URL, slug, provider id, or 'me')." }
|
|
827
878
|
},
|
|
828
879
|
async run({ args }) {
|
|
@@ -830,37 +881,73 @@ var profileFollowingCommand = defineCommand({
|
|
|
830
881
|
}
|
|
831
882
|
});
|
|
832
883
|
var profileSubscriptionCommand = defineCommand({
|
|
833
|
-
meta: {
|
|
834
|
-
|
|
884
|
+
meta: {
|
|
885
|
+
name: "subscription",
|
|
886
|
+
description: "Read your premium subscription: entitlements, primary plan, and LinkedIn management links. A free account is a valid result (has_premium:false).",
|
|
887
|
+
examples: [
|
|
888
|
+
"curviate profile subscription"
|
|
889
|
+
]
|
|
890
|
+
},
|
|
891
|
+
args: { ...readOnly(READ_SINGLE_FLAGS) },
|
|
835
892
|
async run({ args }) {
|
|
836
893
|
await withClient(args, runProfileSubscription);
|
|
837
894
|
}
|
|
838
895
|
});
|
|
839
896
|
var profileAnalyticsCommand = defineCommand({
|
|
840
|
-
meta: {
|
|
841
|
-
|
|
897
|
+
meta: {
|
|
898
|
+
name: "analytics",
|
|
899
|
+
description: "Read your performance headline metrics: profile viewers, followers, post impressions, and search appearances (fixed LinkedIn reporting windows, no window selector).",
|
|
900
|
+
examples: [
|
|
901
|
+
"curviate profile analytics"
|
|
902
|
+
]
|
|
903
|
+
},
|
|
904
|
+
args: { ...readOnly(READ_SINGLE_FLAGS) },
|
|
842
905
|
async run({ args }) {
|
|
843
906
|
await withClient(args, runProfileAnalytics);
|
|
844
907
|
}
|
|
845
908
|
});
|
|
846
909
|
var profileVisitorsCommand = defineCommand({
|
|
847
|
-
meta: {
|
|
848
|
-
|
|
910
|
+
meta: {
|
|
911
|
+
name: "visitors",
|
|
912
|
+
description: "List people who recently viewed your profile, classified by disclosure fidelity (identified, semi-anonymous, or aggregate; Premium sees more identified viewers).",
|
|
913
|
+
examples: [
|
|
914
|
+
"curviate profile visitors",
|
|
915
|
+
"curviate profile visitors --limit 20"
|
|
916
|
+
]
|
|
917
|
+
},
|
|
918
|
+
args: { ...readOnly(GLOBAL_FLAGS) },
|
|
849
919
|
async run({ args }) {
|
|
850
920
|
await withClient(args, runProfileVisitors);
|
|
851
921
|
}
|
|
852
922
|
});
|
|
853
923
|
var profileSsiCommand = defineCommand({
|
|
854
|
-
meta: {
|
|
855
|
-
|
|
924
|
+
meta: {
|
|
925
|
+
name: "ssi",
|
|
926
|
+
description: "Read your Social Selling Index: the overall score, its four pillar breakdowns, and industry/network percentile ranks.",
|
|
927
|
+
examples: [
|
|
928
|
+
"curviate profile ssi"
|
|
929
|
+
]
|
|
930
|
+
},
|
|
931
|
+
args: { ...readOnly(READ_SINGLE_FLAGS) },
|
|
856
932
|
async run({ args }) {
|
|
857
933
|
await withClient(args, runProfileSsi);
|
|
858
934
|
}
|
|
859
935
|
});
|
|
860
936
|
var profileCommand = defineCommand({
|
|
861
|
-
meta: {
|
|
937
|
+
meta: {
|
|
938
|
+
name: "profile",
|
|
939
|
+
description: "LinkedIn profile operations.",
|
|
940
|
+
examples: [
|
|
941
|
+
"curviate profile janesmith",
|
|
942
|
+
"curviate profile https://www.linkedin.com/in/janesmith --posts",
|
|
943
|
+
"curviate profile janesmith --sections experience,skills"
|
|
944
|
+
],
|
|
945
|
+
requires: [
|
|
946
|
+
"--all, --max-pages and --page-delay only with a list flag: --posts, --comments, --reactions or --followers."
|
|
947
|
+
]
|
|
948
|
+
},
|
|
862
949
|
args: {
|
|
863
|
-
...GLOBAL_FLAGS,
|
|
950
|
+
...readOnly(GLOBAL_FLAGS),
|
|
864
951
|
id: { type: "positional", description: "Member identifier (URL, slug, or URN). Optional for subcommands.", required: false },
|
|
865
952
|
posts: { type: "boolean", description: "List the profile's posts.", default: false },
|
|
866
953
|
comments: { type: "boolean", description: "List the profile's comments.", default: false },
|