@curviate/cli 0.21.1 → 0.23.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 +236 -116
- package/README.md +18 -18
- package/dist/{account-OIV73PXX.js → account-MIPWTAG5.js} +27 -27
- package/dist/chunk-3BO6GVS2.js +182 -0
- package/dist/{chunk-HZFK45IW.js → chunk-H6XD3F66.js} +1 -1
- package/dist/{chunk-VPKMJYIF.js → chunk-JA3NNST6.js} +9 -1
- package/dist/{chunk-OE7OMTCM.js → chunk-MBO4LBLY.js} +19 -23
- package/dist/{chunk-M6UDWFHX.js → chunk-PMRQXBCP.js} +1 -1
- package/dist/{chunk-WYRYCTUM.js → chunk-RFUO2G3M.js} +2 -2
- package/dist/{chunk-QJZ3LWOX.js → chunk-RJTG5YWE.js} +1 -1
- package/dist/{chunk-DMQZEPQE.js → chunk-UEAX6KUB.js} +10 -0
- package/dist/cli.js +58 -26
- package/dist/{comment-W4XTOTHN.js → comment-TUXC7K72.js} +19 -22
- package/dist/{company-NT4VO6JV.js → company-LHYDAO2C.js} +31 -34
- package/dist/{connect-VXWRLGQZ.js → connect-5S4TFQAF.js} +23 -26
- package/dist/{exit-codes-63JE5GM5.js → exit-codes-KAVZN5BQ.js} +1 -1
- package/dist/{feed-4Q3B56WI.js → feed-ISNH4NXB.js} +8 -11
- package/dist/{group-43PHTFP7.js → group-PHGUOOJE.js} +15 -15
- package/dist/{inbox-GZAOUWZP.js → inbox-3IQPPQMH.js} +14 -17
- package/dist/{inboxes-6AZOB43U.js → inboxes-JK36F6SK.js} +11 -14
- package/dist/{job-VOVQZGCK.js → job-JQG34ATV.js} +19 -22
- package/dist/{message-FIEWH2BU.js → message-2WIZESSM.js} +5 -3
- package/dist/{notification-65V67NWK.js → notification-ORSZY2IJ.js} +10 -13
- package/dist/{post-G4IMWUE2.js → post-JRJMGV2I.js} +22 -25
- package/dist/{profile-GADE33FY.js → profile-SUKHRWQP.js} +27 -30
- package/dist/{recruiter-LI2TMRHY.js → recruiter-NIKKDGMR.js} +38 -41
- package/dist/{sales-nav-OXLRN6YK.js → sales-nav-4MFL2JSE.js} +23 -26
- package/dist/{search-V35MFTXL.js → search-MZQJDJTX.js} +26 -29
- package/dist/{webhook-5HXMJQFO.js → webhook-7ESDSIRU.js} +9 -9
- package/package.json +4 -3
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import {
|
|
3
3
|
sentAsNotice
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-MBO4LBLY.js";
|
|
5
5
|
import "./chunk-HOQ7EUHJ.js";
|
|
6
6
|
import {
|
|
7
7
|
AttachError,
|
|
@@ -16,15 +16,18 @@ import {
|
|
|
16
16
|
slimSearchJobs,
|
|
17
17
|
slimSearchPeople,
|
|
18
18
|
slimSearchPosts
|
|
19
|
-
} from "./chunk-
|
|
19
|
+
} from "./chunk-RFUO2G3M.js";
|
|
20
20
|
import {
|
|
21
21
|
pageDelayFromFlags,
|
|
22
22
|
streamAll
|
|
23
|
-
} from "./chunk-
|
|
23
|
+
} from "./chunk-H6XD3F66.js";
|
|
24
24
|
import "./chunk-UWO2D4HW.js";
|
|
25
25
|
import {
|
|
26
26
|
resolveIdentifier
|
|
27
|
-
} from "./chunk-
|
|
27
|
+
} from "./chunk-UEAX6KUB.js";
|
|
28
|
+
import {
|
|
29
|
+
requireAccount
|
|
30
|
+
} from "./chunk-3BO6GVS2.js";
|
|
28
31
|
import {
|
|
29
32
|
buildPreviewOutput
|
|
30
33
|
} from "./chunk-R3VLWLVV.js";
|
|
@@ -34,7 +37,7 @@ import {
|
|
|
34
37
|
renderSuccess,
|
|
35
38
|
renderUnexpectedError,
|
|
36
39
|
resolveEffectiveConfig
|
|
37
|
-
} from "./chunk-
|
|
40
|
+
} from "./chunk-JA3NNST6.js";
|
|
38
41
|
import {
|
|
39
42
|
GLOBAL_FLAGS,
|
|
40
43
|
WRITE_FLAGS
|
|
@@ -42,6 +45,7 @@ import {
|
|
|
42
45
|
import {
|
|
43
46
|
resolveTextOrStdin
|
|
44
47
|
} from "./chunk-ZYURL5VK.js";
|
|
48
|
+
import "./chunk-PMRQXBCP.js";
|
|
45
49
|
|
|
46
50
|
// src/commands/company.ts
|
|
47
51
|
import { defineCommand } from "citty";
|
|
@@ -51,13 +55,6 @@ function buildOutputStreams() {
|
|
|
51
55
|
stderr: { write: (s) => process.stderr.write(s) }
|
|
52
56
|
};
|
|
53
57
|
}
|
|
54
|
-
function requireAccount(account, out) {
|
|
55
|
-
if (!account) {
|
|
56
|
-
out.stderr.write("error: --account is required for this command. Set it via --account, CURVIATE_ACCOUNT, or `curviate config set-account`.\n");
|
|
57
|
-
process.exit(2);
|
|
58
|
-
}
|
|
59
|
-
return account;
|
|
60
|
-
}
|
|
61
58
|
function rejectPreviewOnRead(preview, out) {
|
|
62
59
|
if (preview) {
|
|
63
60
|
out.stderr.write("error: --preview is only valid on write commands (mutations). Reads just run.\n");
|
|
@@ -89,7 +86,7 @@ async function resolveCompanyId(ns, raw) {
|
|
|
89
86
|
async function handleSdkError(err, outOpts, out) {
|
|
90
87
|
const { CurviateError } = await import("@curviate/sdk");
|
|
91
88
|
if (err instanceof CurviateError) {
|
|
92
|
-
const { getExitCode } = await import("./exit-codes-
|
|
89
|
+
const { getExitCode } = await import("./exit-codes-KAVZN5BQ.js");
|
|
93
90
|
renderError(err, outOpts, out);
|
|
94
91
|
process.exit(getExitCode(err.code));
|
|
95
92
|
}
|
|
@@ -106,7 +103,7 @@ async function runCompanyGet(client, flags, out) {
|
|
|
106
103
|
out.stderr.write("error: --sections is not supported on company commands.\n");
|
|
107
104
|
process.exit(2);
|
|
108
105
|
}
|
|
109
|
-
const accountId = requireAccount(flags
|
|
106
|
+
const accountId = await requireAccount(client, flags, out);
|
|
110
107
|
const rawId = flags.id ?? "";
|
|
111
108
|
const resolvedId = resolveIdentifier(rawId);
|
|
112
109
|
const outOpts = { ...resolveOutputOpts(flags), slim: slimCompany };
|
|
@@ -119,7 +116,7 @@ async function runCompanyGet(client, flags, out) {
|
|
|
119
116
|
}
|
|
120
117
|
async function runCompanyEmployees(client, flags, out) {
|
|
121
118
|
rejectPreviewOnRead(flags.preview, out);
|
|
122
|
-
const accountId = requireAccount(flags
|
|
119
|
+
const accountId = await requireAccount(client, flags, out);
|
|
123
120
|
const ns = client.account(accountId);
|
|
124
121
|
const outOpts = resolveOutputOpts(flags);
|
|
125
122
|
const params = {};
|
|
@@ -149,7 +146,7 @@ async function runCompanyEmployees(client, flags, out) {
|
|
|
149
146
|
}
|
|
150
147
|
async function runCompanyPosts(client, flags, out) {
|
|
151
148
|
rejectPreviewOnRead(flags.preview, out);
|
|
152
|
-
const accountId = requireAccount(flags
|
|
149
|
+
const accountId = await requireAccount(client, flags, out);
|
|
153
150
|
const ns = client.account(accountId);
|
|
154
151
|
const outOpts = resolveOutputOpts(flags);
|
|
155
152
|
const params = {};
|
|
@@ -177,7 +174,7 @@ async function runCompanyPosts(client, flags, out) {
|
|
|
177
174
|
}
|
|
178
175
|
async function runCompanyJobs(client, flags, out) {
|
|
179
176
|
rejectPreviewOnRead(flags.preview, out);
|
|
180
|
-
const accountId = requireAccount(flags
|
|
177
|
+
const accountId = await requireAccount(client, flags, out);
|
|
181
178
|
const ns = client.account(accountId);
|
|
182
179
|
const outOpts = resolveOutputOpts(flags);
|
|
183
180
|
const params = {};
|
|
@@ -206,7 +203,7 @@ async function runCompanyJobs(client, flags, out) {
|
|
|
206
203
|
}
|
|
207
204
|
async function runCompanyInvitableFollowers(client, flags, out) {
|
|
208
205
|
rejectPreviewOnRead(flags.preview, out);
|
|
209
|
-
const accountId = requireAccount(flags
|
|
206
|
+
const accountId = await requireAccount(client, flags, out);
|
|
210
207
|
const ns = client.account(accountId);
|
|
211
208
|
const outOpts = resolveOutputOpts(flags);
|
|
212
209
|
const params = {};
|
|
@@ -234,7 +231,7 @@ async function runCompanyInvitableFollowers(client, flags, out) {
|
|
|
234
231
|
}
|
|
235
232
|
}
|
|
236
233
|
async function runCompanyFollowInvite(client, flags, out) {
|
|
237
|
-
const accountId = requireAccount(flags
|
|
234
|
+
const accountId = await requireAccount(client, flags, out);
|
|
238
235
|
const ns = client.account(accountId);
|
|
239
236
|
const outOpts = resolveOutputOpts(flags);
|
|
240
237
|
const inviteeIds = normalizeInviteeIds(flags.invitee);
|
|
@@ -264,7 +261,7 @@ async function runCompanyFollowInvite(client, flags, out) {
|
|
|
264
261
|
}
|
|
265
262
|
async function runCompanyManaged(client, flags, out) {
|
|
266
263
|
rejectPreviewOnRead(flags.preview, out);
|
|
267
|
-
const accountId = requireAccount(flags
|
|
264
|
+
const accountId = await requireAccount(client, flags, out);
|
|
268
265
|
const ns = client.account(accountId);
|
|
269
266
|
const outOpts = resolveOutputOpts(flags);
|
|
270
267
|
const params = {};
|
|
@@ -291,7 +288,7 @@ async function runCompanyManaged(client, flags, out) {
|
|
|
291
288
|
}
|
|
292
289
|
async function runCompanyFollowers(client, flags, out) {
|
|
293
290
|
rejectPreviewOnRead(flags.preview, out);
|
|
294
|
-
const accountId = requireAccount(flags
|
|
291
|
+
const accountId = await requireAccount(client, flags, out);
|
|
295
292
|
const ns = client.account(accountId);
|
|
296
293
|
const outOpts = resolveOutputOpts(flags);
|
|
297
294
|
const params = {};
|
|
@@ -319,7 +316,7 @@ async function runCompanyFollowers(client, flags, out) {
|
|
|
319
316
|
}
|
|
320
317
|
async function runCompanyChats(client, flags, out) {
|
|
321
318
|
rejectPreviewOnRead(flags.preview, out);
|
|
322
|
-
const accountId = requireAccount(flags
|
|
319
|
+
const accountId = await requireAccount(client, flags, out);
|
|
323
320
|
const ns = client.account(accountId);
|
|
324
321
|
const outOpts = resolveOutputOpts(flags);
|
|
325
322
|
const params = {};
|
|
@@ -351,7 +348,7 @@ async function runCompanyChat(client, flags, out) {
|
|
|
351
348
|
out.stderr.write("error: --all is not supported on non-paginated commands.\n");
|
|
352
349
|
process.exit(2);
|
|
353
350
|
}
|
|
354
|
-
const accountId = requireAccount(flags
|
|
351
|
+
const accountId = await requireAccount(client, flags, out);
|
|
355
352
|
const ns = client.account(accountId);
|
|
356
353
|
const outOpts = resolveOutputOpts(flags);
|
|
357
354
|
const chatId = flags.chatId ?? "";
|
|
@@ -365,7 +362,7 @@ async function runCompanyChat(client, flags, out) {
|
|
|
365
362
|
}
|
|
366
363
|
async function runCompanyMessages(client, flags, out) {
|
|
367
364
|
rejectPreviewOnRead(flags.preview, out);
|
|
368
|
-
const accountId = requireAccount(flags
|
|
365
|
+
const accountId = await requireAccount(client, flags, out);
|
|
369
366
|
const ns = client.account(accountId);
|
|
370
367
|
const outOpts = resolveOutputOpts(flags);
|
|
371
368
|
const chatId = flags.chatId ?? "";
|
|
@@ -398,7 +395,7 @@ async function runCompanyMessage(client, flags, out) {
|
|
|
398
395
|
out.stderr.write("error: --all is not supported on non-paginated commands.\n");
|
|
399
396
|
process.exit(2);
|
|
400
397
|
}
|
|
401
|
-
const accountId = requireAccount(flags
|
|
398
|
+
const accountId = await requireAccount(client, flags, out);
|
|
402
399
|
const ns = client.account(accountId);
|
|
403
400
|
const outOpts = resolveOutputOpts(flags);
|
|
404
401
|
const chatId = flags.chatId ?? "";
|
|
@@ -413,7 +410,7 @@ async function runCompanyMessage(client, flags, out) {
|
|
|
413
410
|
}
|
|
414
411
|
async function runCompanySearchChats(client, flags, out) {
|
|
415
412
|
rejectPreviewOnRead(flags.preview, out);
|
|
416
|
-
const accountId = requireAccount(flags
|
|
413
|
+
const accountId = await requireAccount(client, flags, out);
|
|
417
414
|
const ns = client.account(accountId);
|
|
418
415
|
const outOpts = resolveOutputOpts(flags);
|
|
419
416
|
const params = {};
|
|
@@ -443,7 +440,7 @@ async function runCompanySearchChats(client, flags, out) {
|
|
|
443
440
|
}
|
|
444
441
|
}
|
|
445
442
|
async function runCompanyReply(client, flags, out, _readStdin) {
|
|
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
|
const chatId = flags.chatId ?? "";
|
|
@@ -597,14 +594,14 @@ var companyInvitableFollowersCommand = defineCommand({
|
|
|
597
594
|
var companyFollowInviteCommand = defineCommand({
|
|
598
595
|
meta: {
|
|
599
596
|
name: "follow-invite",
|
|
600
|
-
description: "Invite the account's 1st-degree connections to follow the administered company page. Write, admin-gated (the account must administer the page with invite rights). Pass the AC
|
|
597
|
+
description: "Invite the account's 1st-degree connections to follow the administered company page. Write, admin-gated (the account must administer the page with invite rights). Pass the AC... member ids from `company invitable-followers`, one --invitee per invitee. All-or-nothing: for an all-valid request you get one outcome per invitee, in request order (invited/already_invited/ineligible/not_found); if any invitee id is invalid the whole request rejects with a 404, not a partial result. Re-inviting an already-invited member is a safe no-op (the same invitation id, never a duplicate)."
|
|
601
598
|
},
|
|
602
599
|
args: {
|
|
603
600
|
...WRITE_FLAGS,
|
|
604
601
|
id: { type: "positional", description: "Company identifier (URL, slug, or numeric id), resolved to the numeric id first, including under --preview." },
|
|
605
602
|
invitee: {
|
|
606
603
|
type: "string",
|
|
607
|
-
description: "AC
|
|
604
|
+
description: "AC... member id to invite (from `company invitable-followers`). Repeatable, at least one required, max 50 per request."
|
|
608
605
|
}
|
|
609
606
|
},
|
|
610
607
|
async run({ args }) {
|
|
@@ -705,7 +702,7 @@ var companyChatCommand = defineCommand({
|
|
|
705
702
|
args: {
|
|
706
703
|
...GLOBAL_FLAGS,
|
|
707
704
|
id: { type: "positional", description: "Company identifier (URL, slug, or numeric id), a slug/URL is resolved to the numeric id first." },
|
|
708
|
-
chatId: { type: "positional", description: "The 2
|
|
705
|
+
chatId: { type: "positional", description: "The 2-... chat id from `company chats`, passed through verbatim." }
|
|
709
706
|
},
|
|
710
707
|
async run({ args }) {
|
|
711
708
|
const flags = args;
|
|
@@ -733,7 +730,7 @@ var companyMessagesCommand = defineCommand({
|
|
|
733
730
|
args: {
|
|
734
731
|
...GLOBAL_FLAGS,
|
|
735
732
|
id: { type: "positional", description: "Company identifier (URL, slug, or numeric id), a slug/URL is resolved to the numeric id first." },
|
|
736
|
-
chatId: { type: "positional", description: "The 2
|
|
733
|
+
chatId: { type: "positional", description: "The 2-... chat id from `company chats`, passed through verbatim." }
|
|
737
734
|
},
|
|
738
735
|
async run({ args }) {
|
|
739
736
|
const flags = args;
|
|
@@ -761,7 +758,7 @@ var companyMessageCommand = defineCommand({
|
|
|
761
758
|
args: {
|
|
762
759
|
...GLOBAL_FLAGS,
|
|
763
760
|
id: { type: "positional", description: "Company identifier (URL, slug, or numeric id), a slug/URL is resolved to the numeric id first." },
|
|
764
|
-
chatId: { type: "positional", description: "The 2
|
|
761
|
+
chatId: { type: "positional", description: "The 2-... chat id from `company chats`, passed through verbatim." },
|
|
765
762
|
messageId: { type: "positional", description: "The message id from `company messages`, passed through verbatim." }
|
|
766
763
|
},
|
|
767
764
|
async run({ args }) {
|
|
@@ -815,14 +812,14 @@ var companySearchChatsCommand = defineCommand({
|
|
|
815
812
|
var companyReplyCommand = defineCommand({
|
|
816
813
|
meta: {
|
|
817
814
|
name: "reply",
|
|
818
|
-
description: "Reply to a company-inbox conversation, as the page (write, admin-gated: the account must administer the page). Takes the normal 2
|
|
815
|
+
description: "Reply to a company-inbox conversation, as the page (write, admin-gated: the account must administer the page). Takes the normal 2-... chat id from `company chats`; the endpoint resolves the page mailbox internally from the company id. Reply-only, this cannot start a new conversation on the page's behalf. See also: `company chats` (the read that returns the chat id) and `message send` (the personal equivalent)."
|
|
819
816
|
},
|
|
820
817
|
args: {
|
|
821
818
|
...WRITE_FLAGS,
|
|
822
819
|
id: { type: "positional", description: "Company identifier (URL, slug, or numeric id), resolved to the numeric id first, including under --preview." },
|
|
823
820
|
chatId: {
|
|
824
821
|
type: "positional",
|
|
825
|
-
description: "The 2
|
|
822
|
+
description: "The 2-... chat id from `company chats`, passed through verbatim (no client-side check)."
|
|
826
823
|
},
|
|
827
824
|
text: { type: "positional", stdinArg: true, description: "Reply text. Pass - to read from stdin (e.g. via heredoc or pipe)." },
|
|
828
825
|
attach: { type: "string", description: "File to attach (repeatable)." }
|
|
@@ -7,14 +7,17 @@ import {
|
|
|
7
7
|
slimInviteReceivedItem,
|
|
8
8
|
slimInviteSent,
|
|
9
9
|
slimInviteSentItem
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-RFUO2G3M.js";
|
|
11
11
|
import {
|
|
12
12
|
pageDelayFromFlags,
|
|
13
13
|
streamAll
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-H6XD3F66.js";
|
|
15
15
|
import {
|
|
16
16
|
resolveIdentifier
|
|
17
|
-
} from "./chunk-
|
|
17
|
+
} from "./chunk-UEAX6KUB.js";
|
|
18
|
+
import {
|
|
19
|
+
requireAccount
|
|
20
|
+
} from "./chunk-3BO6GVS2.js";
|
|
18
21
|
import {
|
|
19
22
|
buildPreviewOutput
|
|
20
23
|
} from "./chunk-R3VLWLVV.js";
|
|
@@ -24,12 +27,13 @@ import {
|
|
|
24
27
|
renderSuccess,
|
|
25
28
|
renderUnexpectedError,
|
|
26
29
|
resolveEffectiveConfig
|
|
27
|
-
} from "./chunk-
|
|
30
|
+
} from "./chunk-JA3NNST6.js";
|
|
28
31
|
import {
|
|
29
32
|
GLOBAL_FLAGS,
|
|
30
33
|
WRITE_FLAGS
|
|
31
34
|
} from "./chunk-CUTMZWL6.js";
|
|
32
35
|
import "./chunk-ZYURL5VK.js";
|
|
36
|
+
import "./chunk-PMRQXBCP.js";
|
|
33
37
|
|
|
34
38
|
// src/commands/connect.ts
|
|
35
39
|
import { defineCommand } from "citty";
|
|
@@ -39,13 +43,6 @@ function buildOutputStreams() {
|
|
|
39
43
|
stderr: { write: (s) => process.stderr.write(s) }
|
|
40
44
|
};
|
|
41
45
|
}
|
|
42
|
-
function requireAccount(account, out) {
|
|
43
|
-
if (!account) {
|
|
44
|
-
out.stderr.write("error: --account is required for this command. Set it via --account, CURVIATE_ACCOUNT, or `curviate config set-account`.\n");
|
|
45
|
-
process.exit(2);
|
|
46
|
-
}
|
|
47
|
-
return account;
|
|
48
|
-
}
|
|
49
46
|
function rejectPreviewOnRead(preview, out) {
|
|
50
47
|
if (preview) {
|
|
51
48
|
out.stderr.write("error: --preview is only valid on write commands (mutations). Reads just run.\n");
|
|
@@ -61,7 +58,7 @@ function resolveOutputOpts(flags) {
|
|
|
61
58
|
};
|
|
62
59
|
}
|
|
63
60
|
async function runConnectSend(client, flags, out) {
|
|
64
|
-
const accountId = requireAccount(flags
|
|
61
|
+
const accountId = await requireAccount(client, flags, out);
|
|
65
62
|
const rawId = flags.id ?? "";
|
|
66
63
|
const resolvedId = resolveIdentifier(rawId);
|
|
67
64
|
const body = {
|
|
@@ -86,7 +83,7 @@ async function runConnectSend(client, flags, out) {
|
|
|
86
83
|
} catch (err) {
|
|
87
84
|
const { CurviateError } = await import("@curviate/sdk");
|
|
88
85
|
if (err instanceof CurviateError) {
|
|
89
|
-
const { getExitCode } = await import("./exit-codes-
|
|
86
|
+
const { getExitCode } = await import("./exit-codes-KAVZN5BQ.js");
|
|
90
87
|
renderError(err, outOpts, out);
|
|
91
88
|
process.exit(getExitCode(err.code));
|
|
92
89
|
}
|
|
@@ -96,7 +93,7 @@ async function runConnectSend(client, flags, out) {
|
|
|
96
93
|
}
|
|
97
94
|
async function runConnectSent(client, flags, out) {
|
|
98
95
|
rejectPreviewOnRead(flags.preview, out);
|
|
99
|
-
const accountId = requireAccount(flags
|
|
96
|
+
const accountId = await requireAccount(client, flags, out);
|
|
100
97
|
const ns = client.account(accountId);
|
|
101
98
|
const outOpts = resolveOutputOpts(flags);
|
|
102
99
|
const all = flags.all ?? false;
|
|
@@ -124,7 +121,7 @@ async function runConnectSent(client, flags, out) {
|
|
|
124
121
|
} catch (err) {
|
|
125
122
|
const { CurviateError } = await import("@curviate/sdk");
|
|
126
123
|
if (err instanceof CurviateError) {
|
|
127
|
-
const { getExitCode } = await import("./exit-codes-
|
|
124
|
+
const { getExitCode } = await import("./exit-codes-KAVZN5BQ.js");
|
|
128
125
|
renderError(err, outOpts, out);
|
|
129
126
|
process.exit(getExitCode(err.code));
|
|
130
127
|
}
|
|
@@ -134,7 +131,7 @@ async function runConnectSent(client, flags, out) {
|
|
|
134
131
|
}
|
|
135
132
|
async function runConnectReceived(client, flags, out) {
|
|
136
133
|
rejectPreviewOnRead(flags.preview, out);
|
|
137
|
-
const accountId = requireAccount(flags
|
|
134
|
+
const accountId = await requireAccount(client, flags, out);
|
|
138
135
|
const ns = client.account(accountId);
|
|
139
136
|
const outOpts = resolveOutputOpts(flags);
|
|
140
137
|
const all = flags.all ?? false;
|
|
@@ -162,7 +159,7 @@ async function runConnectReceived(client, flags, out) {
|
|
|
162
159
|
} catch (err) {
|
|
163
160
|
const { CurviateError } = await import("@curviate/sdk");
|
|
164
161
|
if (err instanceof CurviateError) {
|
|
165
|
-
const { getExitCode } = await import("./exit-codes-
|
|
162
|
+
const { getExitCode } = await import("./exit-codes-KAVZN5BQ.js");
|
|
166
163
|
renderError(err, outOpts, out);
|
|
167
164
|
process.exit(getExitCode(err.code));
|
|
168
165
|
}
|
|
@@ -171,7 +168,7 @@ async function runConnectReceived(client, flags, out) {
|
|
|
171
168
|
}
|
|
172
169
|
}
|
|
173
170
|
async function runConnectAccept(client, flags, out) {
|
|
174
|
-
const accountId = requireAccount(flags
|
|
171
|
+
const accountId = await requireAccount(client, flags, out);
|
|
175
172
|
const invitationId = flags.id ?? "";
|
|
176
173
|
if (flags.preview) {
|
|
177
174
|
const preview = buildPreviewOutput({
|
|
@@ -191,7 +188,7 @@ async function runConnectAccept(client, flags, out) {
|
|
|
191
188
|
} catch (err) {
|
|
192
189
|
const { CurviateError } = await import("@curviate/sdk");
|
|
193
190
|
if (err instanceof CurviateError) {
|
|
194
|
-
const { getExitCode } = await import("./exit-codes-
|
|
191
|
+
const { getExitCode } = await import("./exit-codes-KAVZN5BQ.js");
|
|
195
192
|
renderError(err, outOpts, out);
|
|
196
193
|
process.exit(getExitCode(err.code));
|
|
197
194
|
}
|
|
@@ -200,7 +197,7 @@ async function runConnectAccept(client, flags, out) {
|
|
|
200
197
|
}
|
|
201
198
|
}
|
|
202
199
|
async function runConnectDecline(client, flags, out) {
|
|
203
|
-
const accountId = requireAccount(flags
|
|
200
|
+
const accountId = await requireAccount(client, flags, out);
|
|
204
201
|
const invitationId = flags.id ?? "";
|
|
205
202
|
if (flags.preview) {
|
|
206
203
|
const preview = buildPreviewOutput({
|
|
@@ -220,7 +217,7 @@ async function runConnectDecline(client, flags, out) {
|
|
|
220
217
|
} catch (err) {
|
|
221
218
|
const { CurviateError } = await import("@curviate/sdk");
|
|
222
219
|
if (err instanceof CurviateError) {
|
|
223
|
-
const { getExitCode } = await import("./exit-codes-
|
|
220
|
+
const { getExitCode } = await import("./exit-codes-KAVZN5BQ.js");
|
|
224
221
|
renderError(err, outOpts, out);
|
|
225
222
|
process.exit(getExitCode(err.code));
|
|
226
223
|
}
|
|
@@ -229,7 +226,7 @@ async function runConnectDecline(client, flags, out) {
|
|
|
229
226
|
}
|
|
230
227
|
}
|
|
231
228
|
async function runConnectCancel(client, flags, out) {
|
|
232
|
-
const accountId = requireAccount(flags
|
|
229
|
+
const accountId = await requireAccount(client, flags, out);
|
|
233
230
|
const invitationId = flags.id ?? "";
|
|
234
231
|
if (flags.preview) {
|
|
235
232
|
const preview = buildPreviewOutput({
|
|
@@ -249,7 +246,7 @@ async function runConnectCancel(client, flags, out) {
|
|
|
249
246
|
} catch (err) {
|
|
250
247
|
const { CurviateError } = await import("@curviate/sdk");
|
|
251
248
|
if (err instanceof CurviateError) {
|
|
252
|
-
const { getExitCode } = await import("./exit-codes-
|
|
249
|
+
const { getExitCode } = await import("./exit-codes-KAVZN5BQ.js");
|
|
253
250
|
renderError(err, outOpts, out);
|
|
254
251
|
process.exit(getExitCode(err.code));
|
|
255
252
|
}
|
|
@@ -404,18 +401,18 @@ function guardBareConnectForm(id, out) {
|
|
|
404
401
|
var connectCommand = defineCommand({
|
|
405
402
|
meta: {
|
|
406
403
|
name: "connect",
|
|
407
|
-
description: "Send or manage connection invitations. Connection requests may take 10
|
|
404
|
+
description: "Send or manage connection invitations. Connection requests may take 10-30 seconds to appear in the recipient's received list (LinkedIn propagation delay)."
|
|
408
405
|
},
|
|
409
406
|
args: {
|
|
410
407
|
...WRITE_FLAGS,
|
|
411
408
|
id: {
|
|
412
409
|
type: "positional",
|
|
413
|
-
description: "Recipient's LinkedIn URL, public slug, or provider_id (ACoAAA
|
|
410
|
+
description: "Recipient's LinkedIn URL, public slug, or provider_id (ACoAAA... from `curviate profile`). LinkedIn URN (`urn:li:member:N`) also accepted but the numeric member ID is not exposed by this API.",
|
|
414
411
|
required: false
|
|
415
412
|
},
|
|
416
413
|
note: {
|
|
417
414
|
type: "string",
|
|
418
|
-
description: "Personalized message shown to the recipient alongside the connection request (
|
|
415
|
+
description: "Personalized message shown to the recipient alongside the connection request (<=300 chars; LinkedIn cap). Omit to send a generic note. Personalized messages increase acceptance rates."
|
|
419
416
|
}
|
|
420
417
|
},
|
|
421
418
|
subCommands: {
|
|
@@ -2,18 +2,22 @@
|
|
|
2
2
|
import {
|
|
3
3
|
pageDelayFromFlags,
|
|
4
4
|
streamAll
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-H6XD3F66.js";
|
|
6
|
+
import {
|
|
7
|
+
requireAccount
|
|
8
|
+
} from "./chunk-3BO6GVS2.js";
|
|
6
9
|
import {
|
|
7
10
|
createClient,
|
|
8
11
|
renderError,
|
|
9
12
|
renderSuccess,
|
|
10
13
|
renderUnexpectedError,
|
|
11
14
|
resolveEffectiveConfig
|
|
12
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-JA3NNST6.js";
|
|
13
16
|
import {
|
|
14
17
|
GLOBAL_FLAGS
|
|
15
18
|
} from "./chunk-CUTMZWL6.js";
|
|
16
19
|
import "./chunk-ZYURL5VK.js";
|
|
20
|
+
import "./chunk-PMRQXBCP.js";
|
|
17
21
|
|
|
18
22
|
// src/commands/feed.ts
|
|
19
23
|
import { defineCommand } from "citty";
|
|
@@ -23,13 +27,6 @@ function buildOutputStreams() {
|
|
|
23
27
|
stderr: { write: (s) => process.stderr.write(s) }
|
|
24
28
|
};
|
|
25
29
|
}
|
|
26
|
-
function requireAccount(account, out) {
|
|
27
|
-
if (!account) {
|
|
28
|
-
out.stderr.write("error: --account is required for this command. Set it via --account, CURVIATE_ACCOUNT, or `curviate config set-account`.\n");
|
|
29
|
-
process.exit(2);
|
|
30
|
-
}
|
|
31
|
-
return account;
|
|
32
|
-
}
|
|
33
30
|
function rejectPreviewOnRead(preview, out) {
|
|
34
31
|
if (preview) {
|
|
35
32
|
out.stderr.write("error: --preview is only valid on write commands (mutations). Reads just run.\n");
|
|
@@ -47,7 +44,7 @@ function resolveOutputOpts(flags) {
|
|
|
47
44
|
async function handleSdkError(err, outOpts, out) {
|
|
48
45
|
const { CurviateError } = await import("@curviate/sdk");
|
|
49
46
|
if (err instanceof CurviateError) {
|
|
50
|
-
const { getExitCode } = await import("./exit-codes-
|
|
47
|
+
const { getExitCode } = await import("./exit-codes-KAVZN5BQ.js");
|
|
51
48
|
renderError(err, outOpts, out);
|
|
52
49
|
process.exit(getExitCode(err.code));
|
|
53
50
|
}
|
|
@@ -56,7 +53,7 @@ async function handleSdkError(err, outOpts, out) {
|
|
|
56
53
|
}
|
|
57
54
|
async function runFeedHome(client, flags, out) {
|
|
58
55
|
rejectPreviewOnRead(flags.preview, out);
|
|
59
|
-
const accountId = requireAccount(flags
|
|
56
|
+
const accountId = await requireAccount(client, flags, out);
|
|
60
57
|
const ns = client.account(accountId);
|
|
61
58
|
const outOpts = resolveOutputOpts(flags);
|
|
62
59
|
const all = flags.all ?? false;
|
|
@@ -2,19 +2,26 @@
|
|
|
2
2
|
import {
|
|
3
3
|
pageDelayFromFlags,
|
|
4
4
|
streamAll
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-H6XD3F66.js";
|
|
6
|
+
import {
|
|
7
|
+
normalizeGroupId
|
|
8
|
+
} from "./chunk-UEAX6KUB.js";
|
|
9
|
+
import {
|
|
10
|
+
requireAccount
|
|
11
|
+
} from "./chunk-3BO6GVS2.js";
|
|
6
12
|
import {
|
|
7
13
|
createClient,
|
|
8
14
|
renderError,
|
|
9
15
|
renderSuccess,
|
|
10
16
|
renderUnexpectedError,
|
|
11
17
|
resolveEffectiveConfig
|
|
12
|
-
} from "./chunk-
|
|
18
|
+
} from "./chunk-JA3NNST6.js";
|
|
13
19
|
import {
|
|
14
20
|
GLOBAL_FLAGS,
|
|
15
21
|
READ_SINGLE_FLAGS
|
|
16
22
|
} from "./chunk-CUTMZWL6.js";
|
|
17
23
|
import "./chunk-ZYURL5VK.js";
|
|
24
|
+
import "./chunk-PMRQXBCP.js";
|
|
18
25
|
|
|
19
26
|
// src/commands/group.ts
|
|
20
27
|
import { defineCommand } from "citty";
|
|
@@ -24,13 +31,6 @@ function buildOutputStreams() {
|
|
|
24
31
|
stderr: { write: (s) => process.stderr.write(s) }
|
|
25
32
|
};
|
|
26
33
|
}
|
|
27
|
-
function requireAccount(account, out) {
|
|
28
|
-
if (!account) {
|
|
29
|
-
out.stderr.write("error: --account is required for this command. Set it via --account, CURVIATE_ACCOUNT, or `curviate config set-account`.\n");
|
|
30
|
-
process.exit(2);
|
|
31
|
-
}
|
|
32
|
-
return account;
|
|
33
|
-
}
|
|
34
34
|
function rejectPreviewOnRead(preview, out) {
|
|
35
35
|
if (preview) {
|
|
36
36
|
out.stderr.write("error: --preview is only valid on write commands (mutations). Reads just run.\n");
|
|
@@ -54,7 +54,7 @@ function resolveOutputOpts(flags) {
|
|
|
54
54
|
async function handleSdkError(err, outOpts, out) {
|
|
55
55
|
const { CurviateError } = await import("@curviate/sdk");
|
|
56
56
|
if (err instanceof CurviateError) {
|
|
57
|
-
const { getExitCode } = await import("./exit-codes-
|
|
57
|
+
const { getExitCode } = await import("./exit-codes-KAVZN5BQ.js");
|
|
58
58
|
renderError(err, outOpts, out);
|
|
59
59
|
process.exit(getExitCode(err.code));
|
|
60
60
|
}
|
|
@@ -63,7 +63,7 @@ async function handleSdkError(err, outOpts, out) {
|
|
|
63
63
|
}
|
|
64
64
|
async function runGroupList(client, flags, out) {
|
|
65
65
|
rejectPreviewOnRead(flags.preview, out);
|
|
66
|
-
const accountId = requireAccount(flags
|
|
66
|
+
const accountId = await requireAccount(client, flags, out);
|
|
67
67
|
const ns = client.account(accountId);
|
|
68
68
|
const outOpts = resolveOutputOpts(flags);
|
|
69
69
|
const all = flags.all ?? false;
|
|
@@ -93,8 +93,8 @@ async function runGroupList(client, flags, out) {
|
|
|
93
93
|
async function runGroupGet(client, flags, out) {
|
|
94
94
|
rejectPreviewOnRead(flags.preview, out);
|
|
95
95
|
rejectAllOnNonPaginated(flags.all, out);
|
|
96
|
-
const accountId = requireAccount(flags
|
|
97
|
-
const groupId = flags.groupId ?? "";
|
|
96
|
+
const accountId = await requireAccount(client, flags, out);
|
|
97
|
+
const groupId = normalizeGroupId(flags.groupId ?? "");
|
|
98
98
|
const ns = client.account(accountId);
|
|
99
99
|
const outOpts = resolveOutputOpts(flags);
|
|
100
100
|
try {
|
|
@@ -106,8 +106,8 @@ async function runGroupGet(client, flags, out) {
|
|
|
106
106
|
}
|
|
107
107
|
async function runGroupMembers(client, flags, out) {
|
|
108
108
|
rejectPreviewOnRead(flags.preview, out);
|
|
109
|
-
const accountId = requireAccount(flags
|
|
110
|
-
const groupId = flags.groupId ?? "";
|
|
109
|
+
const accountId = await requireAccount(client, flags, out);
|
|
110
|
+
const groupId = normalizeGroupId(flags.groupId ?? "");
|
|
111
111
|
const ns = client.account(accountId);
|
|
112
112
|
const outOpts = resolveOutputOpts(flags);
|
|
113
113
|
const all = flags.all ?? false;
|