@curviate/cli 0.22.0 → 0.23.1
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 +85 -1
- package/README.md +65 -23
- package/dist/{account-QRGWUQXF.js → account-NZZLUI4E.js} +11 -12
- package/dist/{chunk-H6XD3F66.js → chunk-766W25QS.js} +1 -1
- package/dist/{chunk-ZYURL5VK.js → chunk-AHYUM2XQ.js} +93 -1
- package/dist/{chunk-56ORAZJO.js → chunk-LCIUD7S2.js} +1 -1
- package/dist/chunk-LCLYFE54.js +182 -0
- package/dist/{chunk-QJZ3LWOX.js → chunk-RJTG5YWE.js} +1 -1
- package/dist/{chunk-T5LPGAGJ.js → chunk-S6VAMUCC.js} +16 -22
- package/dist/{chunk-CUTMZWL6.js → chunk-SYRFLZ4D.js} +2 -94
- package/dist/{chunk-JA3NNST6.js → chunk-TKWW6BV6.js} +2 -2
- package/dist/{chunk-DMQZEPQE.js → chunk-UEAX6KUB.js} +10 -0
- package/dist/cli.js +107 -68
- package/dist/{comment-MCGXFMN4.js → comment-SXYTJPXI.js} +21 -25
- package/dist/{company-WDDLWP7E.js → company-GZ2QR2CZ.js} +26 -30
- package/dist/{config-FPWWYG7G.js → config-YKQ4QEBI.js} +4 -3
- package/dist/{connect-5OROSY5C.js → connect-3LTKVRGM.js} +15 -18
- package/dist/{feed-SFVYEAYP.js → feed-ZY27EY52.js} +9 -12
- package/dist/{group-HSZY2IJU.js → group-DBE25EID.js} +16 -16
- package/dist/{inbox-L6JBGZIB.js → inbox-E6ME3ROZ.js} +14 -17
- package/dist/{inboxes-UIO74C5Q.js → inboxes-JRX3J32A.js} +10 -13
- package/dist/{job-75ML7R7I.js → job-U5YIJ7KB.js} +19 -22
- package/dist/{login-ZLDDIAFW.js → login-ERQVI27Q.js} +3 -3
- package/dist/{message-DAQHRBSJ.js → message-NPX7UX46.js} +7 -5
- package/dist/{notification-DYJN4ZHN.js → notification-XSSA5QOJ.js} +11 -14
- package/dist/{post-RGDOCGC4.js → post-OSM7JH65.js} +22 -26
- package/dist/{profile-TJS2YAZD.js → profile-LQXOC7HY.js} +25 -28
- package/dist/{recruiter-NSM33IEK.js → recruiter-ZUTWJHO5.js} +34 -38
- package/dist/{sales-nav-5O7FR57S.js → sales-nav-LSUBIJWZ.js} +22 -25
- package/dist/{search-TDSLK2MB.js → search-FEHXVTQ3.js} +30 -33
- package/dist/{webhook-7ESDSIRU.js → webhook-C43C5BK7.js} +5 -10
- package/package.json +2 -2
|
@@ -7,14 +7,17 @@ import {
|
|
|
7
7
|
ndjsonModeNotice,
|
|
8
8
|
pageDelayFromFlags,
|
|
9
9
|
streamAll
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-766W25QS.js";
|
|
11
11
|
import {
|
|
12
12
|
BinaryOutputError,
|
|
13
13
|
writeBinaryOutput
|
|
14
14
|
} from "./chunk-UWO2D4HW.js";
|
|
15
15
|
import {
|
|
16
16
|
resolveJobIdentifier
|
|
17
|
-
} from "./chunk-
|
|
17
|
+
} from "./chunk-UEAX6KUB.js";
|
|
18
|
+
import {
|
|
19
|
+
requireAccount
|
|
20
|
+
} from "./chunk-LCLYFE54.js";
|
|
18
21
|
import {
|
|
19
22
|
buildPreviewOutput
|
|
20
23
|
} from "./chunk-R3VLWLVV.js";
|
|
@@ -24,13 +27,14 @@ import {
|
|
|
24
27
|
renderSuccess,
|
|
25
28
|
renderUnexpectedError,
|
|
26
29
|
resolveEffectiveConfig
|
|
27
|
-
} from "./chunk-
|
|
30
|
+
} from "./chunk-TKWW6BV6.js";
|
|
31
|
+
import "./chunk-SYRFLZ4D.js";
|
|
28
32
|
import {
|
|
29
33
|
GLOBAL_FLAGS,
|
|
30
34
|
READ_SINGLE_FLAGS,
|
|
31
35
|
WRITE_SINGLE_FLAGS
|
|
32
|
-
} from "./chunk-
|
|
33
|
-
import "./chunk-
|
|
36
|
+
} from "./chunk-AHYUM2XQ.js";
|
|
37
|
+
import "./chunk-PMRQXBCP.js";
|
|
34
38
|
|
|
35
39
|
// src/commands/job.ts
|
|
36
40
|
import { defineCommand } from "citty";
|
|
@@ -60,13 +64,6 @@ function buildOutputStreams() {
|
|
|
60
64
|
stderr: { write: (s) => process.stderr.write(s) }
|
|
61
65
|
};
|
|
62
66
|
}
|
|
63
|
-
function requireAccount(account, out) {
|
|
64
|
-
if (!account) {
|
|
65
|
-
out.stderr.write("error: --account is required for this command. Set it via --account, CURVIATE_ACCOUNT, or `curviate config set-account`.\n");
|
|
66
|
-
process.exit(2);
|
|
67
|
-
}
|
|
68
|
-
return account;
|
|
69
|
-
}
|
|
70
67
|
function rejectPreviewOnRead(preview, out) {
|
|
71
68
|
if (preview) {
|
|
72
69
|
out.stderr.write("error: --preview is only valid on write commands (mutations). Reads just run.\n");
|
|
@@ -123,7 +120,7 @@ function buildApplyMethod(flags, out) {
|
|
|
123
120
|
}
|
|
124
121
|
async function runJobGet(client, flags, out) {
|
|
125
122
|
rejectPreviewOnRead(flags.preview, out);
|
|
126
|
-
const accountId = requireAccount(flags
|
|
123
|
+
const accountId = await requireAccount(client, flags, out);
|
|
127
124
|
const resolvedId = resolveJobIdentifier(flags.id ?? "");
|
|
128
125
|
const ns = client.account(accountId);
|
|
129
126
|
const outOpts = resolveOutputOpts(flags);
|
|
@@ -136,7 +133,7 @@ async function runJobGet(client, flags, out) {
|
|
|
136
133
|
}
|
|
137
134
|
async function runJobList(client, flags, out) {
|
|
138
135
|
rejectPreviewOnRead(flags.preview, out);
|
|
139
|
-
const accountId = requireAccount(flags
|
|
136
|
+
const accountId = await requireAccount(client, flags, out);
|
|
140
137
|
const state = requireFlag(flags.state, "--state", out);
|
|
141
138
|
const ns = client.account(accountId);
|
|
142
139
|
const outOpts = resolveOutputOpts(flags);
|
|
@@ -241,7 +238,7 @@ async function runJobListAllStates(ns, flags, out, outOpts, opts) {
|
|
|
241
238
|
}
|
|
242
239
|
async function runJobBudget(client, flags, out) {
|
|
243
240
|
rejectPreviewOnRead(flags.preview, out);
|
|
244
|
-
const accountId = requireAccount(flags
|
|
241
|
+
const accountId = await requireAccount(client, flags, out);
|
|
245
242
|
const jobId = resolveJobIdentifier(flags.id ?? "");
|
|
246
243
|
const ns = client.account(accountId);
|
|
247
244
|
const outOpts = resolveOutputOpts(flags);
|
|
@@ -254,7 +251,7 @@ async function runJobBudget(client, flags, out) {
|
|
|
254
251
|
}
|
|
255
252
|
async function runJobApplicants(client, flags, out) {
|
|
256
253
|
rejectPreviewOnRead(flags.preview, out);
|
|
257
|
-
const accountId = requireAccount(flags
|
|
254
|
+
const accountId = await requireAccount(client, flags, out);
|
|
258
255
|
const jobId = resolveJobIdentifier(flags.id ?? "");
|
|
259
256
|
const ns = client.account(accountId);
|
|
260
257
|
const outOpts = resolveOutputOpts(flags);
|
|
@@ -288,7 +285,7 @@ async function runJobApplicants(client, flags, out) {
|
|
|
288
285
|
}
|
|
289
286
|
async function runJobApplicantGet(client, flags, out) {
|
|
290
287
|
rejectPreviewOnRead(flags.preview, out);
|
|
291
|
-
const accountId = requireAccount(flags
|
|
288
|
+
const accountId = await requireAccount(client, flags, out);
|
|
292
289
|
const jobId = resolveJobIdentifier(flags.id ?? "");
|
|
293
290
|
const applicantId = flags.applicantId ?? "";
|
|
294
291
|
const ns = client.account(accountId);
|
|
@@ -302,7 +299,7 @@ async function runJobApplicantGet(client, flags, out) {
|
|
|
302
299
|
}
|
|
303
300
|
async function runJobApplicantResume(client, flags, out, isTTY) {
|
|
304
301
|
rejectPreviewOnRead(flags.preview, out);
|
|
305
|
-
const accountId = requireAccount(flags
|
|
302
|
+
const accountId = await requireAccount(client, flags, out);
|
|
306
303
|
const jobId = resolveJobIdentifier(flags.id ?? "");
|
|
307
304
|
const applicantId = flags.applicantId ?? "";
|
|
308
305
|
const ns = client.account(accountId);
|
|
@@ -319,7 +316,7 @@ async function runJobApplicantResume(client, flags, out, isTTY) {
|
|
|
319
316
|
}
|
|
320
317
|
}
|
|
321
318
|
async function runJobCreate(client, flags, out) {
|
|
322
|
-
const accountId = requireAccount(flags
|
|
319
|
+
const accountId = await requireAccount(client, flags, out);
|
|
323
320
|
if (!flags["job-title"] && !flags["job-title-id"]) {
|
|
324
321
|
out.stderr.write("error: --job-title (a free-text name) or --job-title-id is required.\n");
|
|
325
322
|
process.exit(2);
|
|
@@ -363,7 +360,7 @@ async function runJobCreate(client, flags, out) {
|
|
|
363
360
|
}
|
|
364
361
|
}
|
|
365
362
|
async function runJobUpdate(client, flags, out) {
|
|
366
|
-
const accountId = requireAccount(flags
|
|
363
|
+
const accountId = await requireAccount(client, flags, out);
|
|
367
364
|
const jobId = resolveJobIdentifier(flags.id ?? "");
|
|
368
365
|
const body = {};
|
|
369
366
|
const jobTitle = buildRef(flags["job-title-id"], flags["job-title"]);
|
|
@@ -397,7 +394,7 @@ async function runJobUpdate(client, flags, out) {
|
|
|
397
394
|
}
|
|
398
395
|
}
|
|
399
396
|
async function runJobPublish(client, flags, out) {
|
|
400
|
-
const accountId = requireAccount(flags
|
|
397
|
+
const accountId = await requireAccount(client, flags, out);
|
|
401
398
|
const jobId = resolveJobIdentifier(flags.id ?? "");
|
|
402
399
|
const mode = requireFlag(flags.mode, "--mode", out);
|
|
403
400
|
requireEnum(mode, PUBLISH_MODES, "--mode", out);
|
|
@@ -429,7 +426,7 @@ async function runJobPublish(client, flags, out) {
|
|
|
429
426
|
}
|
|
430
427
|
}
|
|
431
428
|
async function runJobClose(client, flags, out) {
|
|
432
|
-
const accountId = requireAccount(flags
|
|
429
|
+
const accountId = await requireAccount(client, flags, out);
|
|
433
430
|
const jobId = resolveJobIdentifier(flags.id ?? "");
|
|
434
431
|
if (flags.preview) {
|
|
435
432
|
const preview = buildPreviewOutput({ method: "jobs.close", args: { job_id: jobId }, body: {}, account: accountId });
|
|
@@ -3,13 +3,13 @@ import {
|
|
|
3
3
|
readlineSync
|
|
4
4
|
} from "./chunk-H4KV7MIN.js";
|
|
5
5
|
import {
|
|
6
|
-
GLOBAL_FLAGS,
|
|
7
6
|
writeProfile
|
|
8
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-SYRFLZ4D.js";
|
|
9
8
|
import {
|
|
9
|
+
GLOBAL_FLAGS,
|
|
10
10
|
defaultReadStdin,
|
|
11
11
|
resolveTextOrStdin
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-AHYUM2XQ.js";
|
|
13
13
|
|
|
14
14
|
// src/commands/login.ts
|
|
15
15
|
import { defineCommand } from "citty";
|
|
@@ -13,15 +13,17 @@ import {
|
|
|
13
13
|
runMessageSend,
|
|
14
14
|
sentAsNotice,
|
|
15
15
|
willSendAsNotice
|
|
16
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-S6VAMUCC.js";
|
|
17
17
|
import "./chunk-HOQ7EUHJ.js";
|
|
18
18
|
import "./chunk-BGZW6B7G.js";
|
|
19
19
|
import "./chunk-UWO2D4HW.js";
|
|
20
|
-
import "./chunk-
|
|
20
|
+
import "./chunk-UEAX6KUB.js";
|
|
21
|
+
import "./chunk-LCLYFE54.js";
|
|
21
22
|
import "./chunk-R3VLWLVV.js";
|
|
22
|
-
import "./chunk-
|
|
23
|
-
import "./chunk-
|
|
24
|
-
import "./chunk-
|
|
23
|
+
import "./chunk-TKWW6BV6.js";
|
|
24
|
+
import "./chunk-SYRFLZ4D.js";
|
|
25
|
+
import "./chunk-AHYUM2XQ.js";
|
|
26
|
+
import "./chunk-PMRQXBCP.js";
|
|
25
27
|
export {
|
|
26
28
|
guardBareMessageForm,
|
|
27
29
|
messageCommand,
|
|
@@ -2,7 +2,10 @@
|
|
|
2
2
|
import {
|
|
3
3
|
pageDelayFromFlags,
|
|
4
4
|
streamAll
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-766W25QS.js";
|
|
6
|
+
import {
|
|
7
|
+
requireAccount
|
|
8
|
+
} from "./chunk-LCLYFE54.js";
|
|
6
9
|
import {
|
|
7
10
|
buildPreviewOutput
|
|
8
11
|
} from "./chunk-R3VLWLVV.js";
|
|
@@ -12,12 +15,13 @@ import {
|
|
|
12
15
|
renderSuccess,
|
|
13
16
|
renderUnexpectedError,
|
|
14
17
|
resolveEffectiveConfig
|
|
15
|
-
} from "./chunk-
|
|
18
|
+
} from "./chunk-TKWW6BV6.js";
|
|
19
|
+
import "./chunk-SYRFLZ4D.js";
|
|
16
20
|
import {
|
|
17
21
|
GLOBAL_FLAGS,
|
|
18
22
|
WRITE_SINGLE_FLAGS
|
|
19
|
-
} from "./chunk-
|
|
20
|
-
import "./chunk-
|
|
23
|
+
} from "./chunk-AHYUM2XQ.js";
|
|
24
|
+
import "./chunk-PMRQXBCP.js";
|
|
21
25
|
|
|
22
26
|
// src/commands/notification.ts
|
|
23
27
|
import { defineCommand } from "citty";
|
|
@@ -27,13 +31,6 @@ function buildOutputStreams() {
|
|
|
27
31
|
stderr: { write: (s) => process.stderr.write(s) }
|
|
28
32
|
};
|
|
29
33
|
}
|
|
30
|
-
function requireAccount(account, out) {
|
|
31
|
-
if (!account) {
|
|
32
|
-
out.stderr.write("error: --account is required for this command. Set it via --account, CURVIATE_ACCOUNT, or `curviate config set-account`.\n");
|
|
33
|
-
process.exit(2);
|
|
34
|
-
}
|
|
35
|
-
return account;
|
|
36
|
-
}
|
|
37
34
|
function rejectPreviewOnRead(preview, out) {
|
|
38
35
|
if (preview) {
|
|
39
36
|
out.stderr.write("error: --preview is only valid on write commands (mutations). Reads just run.\n");
|
|
@@ -60,7 +57,7 @@ async function handleSdkError(err, outOpts, out) {
|
|
|
60
57
|
}
|
|
61
58
|
async function runNotificationList(client, flags, out) {
|
|
62
59
|
rejectPreviewOnRead(flags.preview, out);
|
|
63
|
-
const accountId = requireAccount(flags
|
|
60
|
+
const accountId = await requireAccount(client, flags, out);
|
|
64
61
|
const ns = client.account(accountId);
|
|
65
62
|
const outOpts = resolveOutputOpts(flags);
|
|
66
63
|
const all = flags.all ?? false;
|
|
@@ -88,7 +85,7 @@ async function runNotificationList(client, flags, out) {
|
|
|
88
85
|
}
|
|
89
86
|
}
|
|
90
87
|
async function runNotificationDelete(client, flags, out) {
|
|
91
|
-
const accountId = requireAccount(flags
|
|
88
|
+
const accountId = await requireAccount(client, flags, out);
|
|
92
89
|
const cardUrn = flags.cardUrn ?? "";
|
|
93
90
|
if (flags.preview) {
|
|
94
91
|
const preview = buildPreviewOutput({ method: "notifications.delete", args: { card_urn: cardUrn }, body: {}, account: accountId });
|
|
@@ -105,7 +102,7 @@ async function runNotificationDelete(client, flags, out) {
|
|
|
105
102
|
}
|
|
106
103
|
}
|
|
107
104
|
async function runNotificationShowLess(client, flags, out) {
|
|
108
|
-
const accountId = requireAccount(flags
|
|
105
|
+
const accountId = await requireAccount(client, flags, out);
|
|
109
106
|
const cardUrn = flags.cardUrn ?? "";
|
|
110
107
|
if (flags.preview) {
|
|
111
108
|
const preview = buildPreviewOutput({ method: "notifications.showLess", args: { card_urn: cardUrn }, body: {}, account: accountId });
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import {
|
|
3
3
|
resolveMemberOrMeProviderId
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-RJTG5YWE.js";
|
|
5
5
|
import {
|
|
6
6
|
AttachError,
|
|
7
7
|
readAttachment,
|
|
@@ -10,8 +10,11 @@ import {
|
|
|
10
10
|
import {
|
|
11
11
|
pageDelayFromFlags,
|
|
12
12
|
streamAll
|
|
13
|
-
} from "./chunk-
|
|
14
|
-
import "./chunk-
|
|
13
|
+
} from "./chunk-766W25QS.js";
|
|
14
|
+
import "./chunk-UEAX6KUB.js";
|
|
15
|
+
import {
|
|
16
|
+
requireAccount
|
|
17
|
+
} from "./chunk-LCLYFE54.js";
|
|
15
18
|
import {
|
|
16
19
|
buildPreviewOutput
|
|
17
20
|
} from "./chunk-R3VLWLVV.js";
|
|
@@ -21,15 +24,15 @@ import {
|
|
|
21
24
|
renderSuccess,
|
|
22
25
|
renderUnexpectedError,
|
|
23
26
|
resolveEffectiveConfig
|
|
24
|
-
} from "./chunk-
|
|
27
|
+
} from "./chunk-TKWW6BV6.js";
|
|
28
|
+
import "./chunk-SYRFLZ4D.js";
|
|
25
29
|
import {
|
|
26
30
|
GLOBAL_FLAGS,
|
|
27
31
|
WRITE_FLAGS,
|
|
28
|
-
WRITE_SINGLE_FLAGS
|
|
29
|
-
} from "./chunk-CUTMZWL6.js";
|
|
30
|
-
import {
|
|
32
|
+
WRITE_SINGLE_FLAGS,
|
|
31
33
|
resolveTextOrStdin
|
|
32
|
-
} from "./chunk-
|
|
34
|
+
} from "./chunk-AHYUM2XQ.js";
|
|
35
|
+
import "./chunk-PMRQXBCP.js";
|
|
33
36
|
|
|
34
37
|
// src/commands/post.ts
|
|
35
38
|
import { defineCommand } from "citty";
|
|
@@ -40,13 +43,6 @@ function buildOutputStreams() {
|
|
|
40
43
|
stderr: { write: (s) => process.stderr.write(s) }
|
|
41
44
|
};
|
|
42
45
|
}
|
|
43
|
-
function requireAccount(account, out) {
|
|
44
|
-
if (!account) {
|
|
45
|
-
out.stderr.write("error: --account is required for this command. Set it via --account, CURVIATE_ACCOUNT, or `curviate config set-account`.\n");
|
|
46
|
-
process.exit(2);
|
|
47
|
-
}
|
|
48
|
-
return account;
|
|
49
|
-
}
|
|
50
46
|
function rejectPreviewOnRead(preview, out) {
|
|
51
47
|
if (preview) {
|
|
52
48
|
out.stderr.write("error: --preview is only valid on write commands (mutations). Reads just run.\n");
|
|
@@ -89,7 +85,7 @@ async function handleSdkError(err, outOpts, out) {
|
|
|
89
85
|
async function runPostGet(client, flags, out) {
|
|
90
86
|
rejectPreviewOnRead(flags.preview, out);
|
|
91
87
|
rejectAllOnNonPaginated(flags.all, out);
|
|
92
|
-
const accountId = requireAccount(flags
|
|
88
|
+
const accountId = await requireAccount(client, flags, out);
|
|
93
89
|
const postId = flags.postId ?? "";
|
|
94
90
|
const ns = client.account(accountId);
|
|
95
91
|
const outOpts = resolveOutputOpts(flags);
|
|
@@ -101,7 +97,7 @@ async function runPostGet(client, flags, out) {
|
|
|
101
97
|
}
|
|
102
98
|
}
|
|
103
99
|
async function runPostCreate(client, flags, out, _readStdin) {
|
|
104
|
-
const accountId = requireAccount(flags
|
|
100
|
+
const accountId = await requireAccount(client, flags, out);
|
|
105
101
|
const rawText = flags.text ?? "";
|
|
106
102
|
const attachPaths = normalizeAttachPaths(flags.attach);
|
|
107
103
|
const text = await resolveTextOrStdin(rawText, out, _readStdin);
|
|
@@ -146,7 +142,7 @@ async function runPostCreate(client, flags, out, _readStdin) {
|
|
|
146
142
|
}
|
|
147
143
|
}
|
|
148
144
|
async function runPostReact(client, flags, out) {
|
|
149
|
-
const accountId = requireAccount(flags
|
|
145
|
+
const accountId = await requireAccount(client, flags, out);
|
|
150
146
|
const postId = flags.postId ?? "";
|
|
151
147
|
const reaction = flags.reaction ?? flags.reactionAlias ?? "";
|
|
152
148
|
if (!VALID_REACTIONS.has(reaction)) {
|
|
@@ -183,7 +179,7 @@ async function runPostReact(client, flags, out) {
|
|
|
183
179
|
}
|
|
184
180
|
async function runPostReactions(client, flags, out) {
|
|
185
181
|
rejectPreviewOnRead(flags.preview, out);
|
|
186
|
-
const accountId = requireAccount(flags
|
|
182
|
+
const accountId = await requireAccount(client, flags, out);
|
|
187
183
|
const postId = flags.postId ?? "";
|
|
188
184
|
const ns = client.account(accountId);
|
|
189
185
|
const outOpts = resolveOutputOpts(flags);
|
|
@@ -210,7 +206,7 @@ async function runPostReactions(client, flags, out) {
|
|
|
210
206
|
}
|
|
211
207
|
async function runPostSaved(client, flags, out) {
|
|
212
208
|
rejectPreviewOnRead(flags.preview, out);
|
|
213
|
-
const accountId = requireAccount(flags
|
|
209
|
+
const accountId = await requireAccount(client, flags, out);
|
|
214
210
|
const ns = client.account(accountId);
|
|
215
211
|
const outOpts = resolveOutputOpts(flags);
|
|
216
212
|
const all = flags.all ?? false;
|
|
@@ -235,7 +231,7 @@ async function runPostSaved(client, flags, out) {
|
|
|
235
231
|
}
|
|
236
232
|
}
|
|
237
233
|
async function runPostSave(client, flags, out) {
|
|
238
|
-
const accountId = requireAccount(flags
|
|
234
|
+
const accountId = await requireAccount(client, flags, out);
|
|
239
235
|
const postId = flags.postId ?? "";
|
|
240
236
|
if (flags.preview) {
|
|
241
237
|
const preview = buildPreviewOutput({ method: "posts.save", args: { post_id: postId }, body: {}, account: accountId });
|
|
@@ -252,7 +248,7 @@ async function runPostSave(client, flags, out) {
|
|
|
252
248
|
}
|
|
253
249
|
}
|
|
254
250
|
async function runPostUnsave(client, flags, out) {
|
|
255
|
-
const accountId = requireAccount(flags
|
|
251
|
+
const accountId = await requireAccount(client, flags, out);
|
|
256
252
|
const postId = flags.postId ?? "";
|
|
257
253
|
if (flags.preview) {
|
|
258
254
|
const preview = buildPreviewOutput({ method: "posts.unsave", args: { post_id: postId }, body: {}, account: accountId });
|
|
@@ -269,7 +265,7 @@ async function runPostUnsave(client, flags, out) {
|
|
|
269
265
|
}
|
|
270
266
|
}
|
|
271
267
|
async function runPostDelete(client, flags, out) {
|
|
272
|
-
const accountId = requireAccount(flags
|
|
268
|
+
const accountId = await requireAccount(client, flags, out);
|
|
273
269
|
const postId = flags.postId ?? "";
|
|
274
270
|
if (flags.preview) {
|
|
275
271
|
const preview = buildPreviewOutput({ method: "posts.delete", args: { post_id: postId }, body: {}, account: accountId });
|
|
@@ -286,7 +282,7 @@ async function runPostDelete(client, flags, out) {
|
|
|
286
282
|
}
|
|
287
283
|
}
|
|
288
284
|
async function runPostUnreact(client, flags, out) {
|
|
289
|
-
const accountId = requireAccount(flags
|
|
285
|
+
const accountId = await requireAccount(client, flags, out);
|
|
290
286
|
const postId = flags.postId ?? "";
|
|
291
287
|
const reaction = flags.reaction ?? "";
|
|
292
288
|
if (!VALID_REACTIONS.has(reaction)) {
|
|
@@ -316,7 +312,7 @@ async function runPostUnreact(client, flags, out) {
|
|
|
316
312
|
}
|
|
317
313
|
async function runPostUserPosts(client, flags, out) {
|
|
318
314
|
rejectPreviewOnRead(flags.preview, out);
|
|
319
|
-
const accountId = requireAccount(flags
|
|
315
|
+
const accountId = await requireAccount(client, flags, out);
|
|
320
316
|
const ns = client.account(accountId);
|
|
321
317
|
const outOpts = resolveOutputOpts(flags);
|
|
322
318
|
let userId;
|
|
@@ -349,7 +345,7 @@ async function runPostUserPosts(client, flags, out) {
|
|
|
349
345
|
}
|
|
350
346
|
async function runPostUserReactions(client, flags, out) {
|
|
351
347
|
rejectPreviewOnRead(flags.preview, out);
|
|
352
|
-
const accountId = requireAccount(flags
|
|
348
|
+
const accountId = await requireAccount(client, flags, out);
|
|
353
349
|
const ns = client.account(accountId);
|
|
354
350
|
const outOpts = resolveOutputOpts(flags);
|
|
355
351
|
let userId;
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import {
|
|
3
3
|
resolveMemberOrMeProviderId,
|
|
4
4
|
resolveMemberProviderId
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-RJTG5YWE.js";
|
|
6
6
|
import {
|
|
7
7
|
AttachError,
|
|
8
8
|
readAttachment,
|
|
@@ -15,10 +15,13 @@ import {
|
|
|
15
15
|
import {
|
|
16
16
|
pageDelayFromFlags,
|
|
17
17
|
streamAll
|
|
18
|
-
} from "./chunk-
|
|
18
|
+
} from "./chunk-766W25QS.js";
|
|
19
19
|
import {
|
|
20
20
|
resolveIdentifier
|
|
21
|
-
} from "./chunk-
|
|
21
|
+
} from "./chunk-UEAX6KUB.js";
|
|
22
|
+
import {
|
|
23
|
+
requireAccount
|
|
24
|
+
} from "./chunk-LCLYFE54.js";
|
|
22
25
|
import {
|
|
23
26
|
buildPreviewOutput
|
|
24
27
|
} from "./chunk-R3VLWLVV.js";
|
|
@@ -28,13 +31,14 @@ import {
|
|
|
28
31
|
renderSuccess,
|
|
29
32
|
renderUnexpectedError,
|
|
30
33
|
resolveEffectiveConfig
|
|
31
|
-
} from "./chunk-
|
|
34
|
+
} from "./chunk-TKWW6BV6.js";
|
|
35
|
+
import "./chunk-SYRFLZ4D.js";
|
|
32
36
|
import {
|
|
33
37
|
GLOBAL_FLAGS,
|
|
34
38
|
READ_SINGLE_FLAGS,
|
|
35
39
|
WRITE_SINGLE_FLAGS
|
|
36
|
-
} from "./chunk-
|
|
37
|
-
import "./chunk-
|
|
40
|
+
} from "./chunk-AHYUM2XQ.js";
|
|
41
|
+
import "./chunk-PMRQXBCP.js";
|
|
38
42
|
|
|
39
43
|
// src/commands/profile.ts
|
|
40
44
|
import { defineCommand } from "citty";
|
|
@@ -77,13 +81,6 @@ function parseSectionsFlag(raw) {
|
|
|
77
81
|
}
|
|
78
82
|
|
|
79
83
|
// src/commands/profile.ts
|
|
80
|
-
function requireAccount(account, out) {
|
|
81
|
-
if (!account) {
|
|
82
|
-
out.stderr.write("error: --account is required for this command. Set it via --account, CURVIATE_ACCOUNT, or `curviate config set-account`.\n");
|
|
83
|
-
process.exit(2);
|
|
84
|
-
}
|
|
85
|
-
return account;
|
|
86
|
-
}
|
|
87
84
|
function rejectPreviewOnRead(preview, out) {
|
|
88
85
|
if (preview) {
|
|
89
86
|
out.stderr.write("error: --preview is only valid on write commands (mutations). Reads just run.\n");
|
|
@@ -121,7 +118,7 @@ async function runProfileMe(client, flags, out) {
|
|
|
121
118
|
process.exit(2);
|
|
122
119
|
return;
|
|
123
120
|
}
|
|
124
|
-
const accountId = requireAccount(flags
|
|
121
|
+
const accountId = await requireAccount(client, flags, out);
|
|
125
122
|
const ns = client.account(accountId);
|
|
126
123
|
const outOpts = resolveOutputOpts(flags);
|
|
127
124
|
if (hasActivityFlag) {
|
|
@@ -243,7 +240,7 @@ async function runProfileGet(client, flags, out) {
|
|
|
243
240
|
}
|
|
244
241
|
parsedSections = result.sections;
|
|
245
242
|
}
|
|
246
|
-
const accountId = requireAccount(flags
|
|
243
|
+
const accountId = await requireAccount(client, flags, out);
|
|
247
244
|
const rawId = flags.id ?? "";
|
|
248
245
|
const resolvedId = resolveIdentifier(rawId);
|
|
249
246
|
const ns = client.account(accountId);
|
|
@@ -353,7 +350,7 @@ async function runProfileGet(client, flags, out) {
|
|
|
353
350
|
}
|
|
354
351
|
async function runProfileRelations(client, flags, out) {
|
|
355
352
|
rejectPreviewOnRead(flags.preview, out);
|
|
356
|
-
const accountId = requireAccount(flags
|
|
353
|
+
const accountId = await requireAccount(client, flags, out);
|
|
357
354
|
const ns = client.account(accountId);
|
|
358
355
|
const outOpts = resolveOutputOpts(flags);
|
|
359
356
|
const all = flags.all ?? false;
|
|
@@ -389,7 +386,7 @@ async function runProfileRelations(client, flags, out) {
|
|
|
389
386
|
}
|
|
390
387
|
}
|
|
391
388
|
async function runProfileEndorse(client, flags, out) {
|
|
392
|
-
const accountId = requireAccount(flags
|
|
389
|
+
const accountId = await requireAccount(client, flags, out);
|
|
393
390
|
const ns = client.account(accountId);
|
|
394
391
|
const skillId = flags["endorsement-id"] ?? "";
|
|
395
392
|
const outOpts = resolveOutputOpts(flags);
|
|
@@ -430,7 +427,7 @@ async function handleSdkError(err, outOpts, out) {
|
|
|
430
427
|
async function runProfileSubscription(client, flags, out) {
|
|
431
428
|
rejectPreviewOnRead(flags.preview, out);
|
|
432
429
|
rejectAllOnNonPaginated(flags.all, out);
|
|
433
|
-
const accountId = requireAccount(flags
|
|
430
|
+
const accountId = await requireAccount(client, flags, out);
|
|
434
431
|
const ns = client.account(accountId);
|
|
435
432
|
const outOpts = resolveOutputOpts(flags);
|
|
436
433
|
try {
|
|
@@ -443,7 +440,7 @@ async function runProfileSubscription(client, flags, out) {
|
|
|
443
440
|
async function runProfileAnalytics(client, flags, out) {
|
|
444
441
|
rejectPreviewOnRead(flags.preview, out);
|
|
445
442
|
rejectAllOnNonPaginated(flags.all, out);
|
|
446
|
-
const accountId = requireAccount(flags
|
|
443
|
+
const accountId = await requireAccount(client, flags, out);
|
|
447
444
|
const ns = client.account(accountId);
|
|
448
445
|
const outOpts = resolveOutputOpts(flags);
|
|
449
446
|
try {
|
|
@@ -455,7 +452,7 @@ async function runProfileAnalytics(client, flags, out) {
|
|
|
455
452
|
}
|
|
456
453
|
async function runProfileVisitors(client, flags, out) {
|
|
457
454
|
rejectPreviewOnRead(flags.preview, out);
|
|
458
|
-
const accountId = requireAccount(flags
|
|
455
|
+
const accountId = await requireAccount(client, flags, out);
|
|
459
456
|
const ns = client.account(accountId);
|
|
460
457
|
const outOpts = resolveOutputOpts(flags);
|
|
461
458
|
const all = flags.all ?? false;
|
|
@@ -486,7 +483,7 @@ async function runProfileVisitors(client, flags, out) {
|
|
|
486
483
|
async function runProfileSsi(client, flags, out) {
|
|
487
484
|
rejectPreviewOnRead(flags.preview, out);
|
|
488
485
|
rejectAllOnNonPaginated(flags.all, out);
|
|
489
|
-
const accountId = requireAccount(flags
|
|
486
|
+
const accountId = await requireAccount(client, flags, out);
|
|
490
487
|
const ns = client.account(accountId);
|
|
491
488
|
const outOpts = resolveOutputOpts(flags);
|
|
492
489
|
try {
|
|
@@ -497,7 +494,7 @@ async function runProfileSsi(client, flags, out) {
|
|
|
497
494
|
}
|
|
498
495
|
}
|
|
499
496
|
async function runProfileUpdate(client, flags, out) {
|
|
500
|
-
const accountId = requireAccount(flags
|
|
497
|
+
const accountId = await requireAccount(client, flags, out);
|
|
501
498
|
const body = {};
|
|
502
499
|
if (flags["first-name"]) body.first_name = flags["first-name"];
|
|
503
500
|
if (flags["last-name"]) body.last_name = flags["last-name"];
|
|
@@ -545,7 +542,7 @@ async function runProfileUpdate(client, flags, out) {
|
|
|
545
542
|
}
|
|
546
543
|
}
|
|
547
544
|
async function runProfileFollow(client, flags, out) {
|
|
548
|
-
const accountId = requireAccount(flags
|
|
545
|
+
const accountId = await requireAccount(client, flags, out);
|
|
549
546
|
const ns = client.account(accountId);
|
|
550
547
|
const outOpts = resolveOutputOpts(flags);
|
|
551
548
|
let providerId;
|
|
@@ -568,7 +565,7 @@ async function runProfileFollow(client, flags, out) {
|
|
|
568
565
|
}
|
|
569
566
|
}
|
|
570
567
|
async function runProfileUnfollow(client, flags, out) {
|
|
571
|
-
const accountId = requireAccount(flags
|
|
568
|
+
const accountId = await requireAccount(client, flags, out);
|
|
572
569
|
const ns = client.account(accountId);
|
|
573
570
|
const outOpts = resolveOutputOpts(flags);
|
|
574
571
|
let providerId;
|
|
@@ -592,7 +589,7 @@ async function runProfileUnfollow(client, flags, out) {
|
|
|
592
589
|
}
|
|
593
590
|
async function runProfileFollowers(client, flags, out) {
|
|
594
591
|
rejectPreviewOnRead(flags.preview, out);
|
|
595
|
-
const accountId = requireAccount(flags
|
|
592
|
+
const accountId = await requireAccount(client, flags, out);
|
|
596
593
|
const resolvedId = resolveIdentifier(flags.id ?? "");
|
|
597
594
|
const ns = client.account(accountId);
|
|
598
595
|
const outOpts = resolveOutputOpts(flags);
|
|
@@ -621,7 +618,7 @@ async function runProfileFollowers(client, flags, out) {
|
|
|
621
618
|
}
|
|
622
619
|
async function runProfileFollowing(client, flags, out) {
|
|
623
620
|
rejectPreviewOnRead(flags.preview, out);
|
|
624
|
-
const accountId = requireAccount(flags
|
|
621
|
+
const accountId = await requireAccount(client, flags, out);
|
|
625
622
|
const resolvedId = resolveIdentifier(flags.id ?? "");
|
|
626
623
|
const ns = client.account(accountId);
|
|
627
624
|
const outOpts = resolveOutputOpts(flags);
|
|
@@ -658,7 +655,7 @@ var profileMeCommand = defineCommand({
|
|
|
658
655
|
},
|
|
659
656
|
posts: {
|
|
660
657
|
type: "boolean",
|
|
661
|
-
description: "List own activity feed (posts + reposts). For authored-only posts, use 'post
|
|
658
|
+
description: "List own activity feed (posts + reposts). For authored-only posts, use 'post user-posts me'.",
|
|
662
659
|
default: false
|
|
663
660
|
},
|
|
664
661
|
comments: {
|
|
@@ -723,7 +720,7 @@ var profileEndorseCommand = defineCommand({
|
|
|
723
720
|
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)." },
|
|
724
721
|
"endorsement-id": {
|
|
725
722
|
type: "string",
|
|
726
|
-
description: "Endorsement ID to endorse. Get it from the target's skills section via `profile <id> --sections linkedin_skills`.",
|
|
723
|
+
description: "Endorsement ID to endorse. Get it from the target's skills section via `curviate profile <id> --sections linkedin_skills`.",
|
|
727
724
|
required: true
|
|
728
725
|
}
|
|
729
726
|
},
|