@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
|
@@ -15,7 +15,10 @@ import {
|
|
|
15
15
|
import {
|
|
16
16
|
normalizeChatId,
|
|
17
17
|
resolveIdentifier
|
|
18
|
-
} from "./chunk-
|
|
18
|
+
} from "./chunk-UEAX6KUB.js";
|
|
19
|
+
import {
|
|
20
|
+
requireAccount
|
|
21
|
+
} from "./chunk-3BO6GVS2.js";
|
|
19
22
|
import {
|
|
20
23
|
buildPreviewOutput
|
|
21
24
|
} from "./chunk-R3VLWLVV.js";
|
|
@@ -25,7 +28,7 @@ import {
|
|
|
25
28
|
renderSuccess,
|
|
26
29
|
renderUnexpectedError,
|
|
27
30
|
resolveEffectiveConfig
|
|
28
|
-
} from "./chunk-
|
|
31
|
+
} from "./chunk-JA3NNST6.js";
|
|
29
32
|
import {
|
|
30
33
|
READ_SINGLE_FLAGS,
|
|
31
34
|
WRITE_FLAGS
|
|
@@ -42,13 +45,6 @@ function buildOutputStreams() {
|
|
|
42
45
|
stderr: { write: (s) => process.stderr.write(s) }
|
|
43
46
|
};
|
|
44
47
|
}
|
|
45
|
-
function requireAccount(account, out) {
|
|
46
|
-
if (!account) {
|
|
47
|
-
out.stderr.write("error: --account is required for this command. Set it via --account, CURVIATE_ACCOUNT, or `curviate config set-account`.\n");
|
|
48
|
-
process.exit(2);
|
|
49
|
-
}
|
|
50
|
-
return account;
|
|
51
|
-
}
|
|
52
48
|
function rejectPreviewOnRead(preview, out) {
|
|
53
49
|
if (preview) {
|
|
54
50
|
out.stderr.write("error: --preview is only valid on write commands (mutations). Reads just run.\n");
|
|
@@ -77,7 +73,7 @@ var MEMBER_PROVIDER_ID_RE = /^A[CDE][A-Za-z0-9_-]{4,}$/;
|
|
|
77
73
|
async function handleSdkError(err, outOpts, out) {
|
|
78
74
|
const { CurviateError } = await import("@curviate/sdk");
|
|
79
75
|
if (err instanceof CurviateError) {
|
|
80
|
-
const { getExitCode } = await import("./exit-codes-
|
|
76
|
+
const { getExitCode } = await import("./exit-codes-KAVZN5BQ.js");
|
|
81
77
|
renderError(err, outOpts, out);
|
|
82
78
|
process.exit(getExitCode(err.code));
|
|
83
79
|
}
|
|
@@ -95,7 +91,7 @@ function willSendAsNotice(chatId) {
|
|
|
95
91
|
return chatId.startsWith("COMPANY_") ? "Will send as a company page\n" : null;
|
|
96
92
|
}
|
|
97
93
|
async function runMessageNew(client, flags, out, _readStdin) {
|
|
98
|
-
const accountId = requireAccount(flags
|
|
94
|
+
const accountId = await requireAccount(client, flags, out);
|
|
99
95
|
const rawTo = flags.to ?? "";
|
|
100
96
|
const rawText = flags.text ?? "";
|
|
101
97
|
const attachPaths = normalizeAttachPaths(flags.attach);
|
|
@@ -154,7 +150,7 @@ async function runMessageNew(client, flags, out, _readStdin) {
|
|
|
154
150
|
}
|
|
155
151
|
}
|
|
156
152
|
async function runMessageSend(client, flags, out, _readStdin) {
|
|
157
|
-
const accountId = requireAccount(flags
|
|
153
|
+
const accountId = await requireAccount(client, flags, out);
|
|
158
154
|
const chatId = normalizeChatId(flags.chatId ?? "");
|
|
159
155
|
const rawText = flags.text ?? "";
|
|
160
156
|
const attachPaths = normalizeAttachPaths(flags.attach);
|
|
@@ -205,7 +201,7 @@ async function runMessageSend(client, flags, out, _readStdin) {
|
|
|
205
201
|
async function runMessageGet(client, flags, out) {
|
|
206
202
|
rejectPreviewOnRead(flags.preview, out);
|
|
207
203
|
rejectAllOnNonPaginated(flags.all, out);
|
|
208
|
-
const accountId = requireAccount(flags
|
|
204
|
+
const accountId = await requireAccount(client, flags, out);
|
|
209
205
|
const chatId = normalizeChatId(flags.chatId ?? "");
|
|
210
206
|
const messageId = flags.messageId ?? "";
|
|
211
207
|
const ns = client.account(accountId);
|
|
@@ -218,7 +214,7 @@ async function runMessageGet(client, flags, out) {
|
|
|
218
214
|
}
|
|
219
215
|
}
|
|
220
216
|
async function runMessageEdit(client, flags, out, _readStdin) {
|
|
221
|
-
const accountId = requireAccount(flags
|
|
217
|
+
const accountId = await requireAccount(client, flags, out);
|
|
222
218
|
const chatId = normalizeChatId(flags.chatId ?? "");
|
|
223
219
|
const messageId = flags.messageId ?? "";
|
|
224
220
|
const rawText = flags.text ?? "";
|
|
@@ -243,7 +239,7 @@ async function runMessageEdit(client, flags, out, _readStdin) {
|
|
|
243
239
|
}
|
|
244
240
|
}
|
|
245
241
|
async function runMessageDelete(client, flags, out) {
|
|
246
|
-
const accountId = requireAccount(flags
|
|
242
|
+
const accountId = await requireAccount(client, flags, out);
|
|
247
243
|
const chatId = normalizeChatId(flags.chatId ?? "");
|
|
248
244
|
const messageId = flags.messageId ?? "";
|
|
249
245
|
if (flags.preview) {
|
|
@@ -266,7 +262,7 @@ async function runMessageDelete(client, flags, out) {
|
|
|
266
262
|
}
|
|
267
263
|
}
|
|
268
264
|
async function runMessageReact(client, flags, out) {
|
|
269
|
-
const accountId = requireAccount(flags
|
|
265
|
+
const accountId = await requireAccount(client, flags, out);
|
|
270
266
|
const chatId = normalizeChatId(flags.chatId ?? "");
|
|
271
267
|
const messageId = flags.messageId ?? "";
|
|
272
268
|
const reaction = flags.emoji ?? flags.emojiAlias ?? "";
|
|
@@ -296,7 +292,7 @@ async function runMessageReact(client, flags, out) {
|
|
|
296
292
|
}
|
|
297
293
|
async function runMessageAttachment(client, flags, out, isTTY) {
|
|
298
294
|
rejectPreviewOnRead(flags.preview, out);
|
|
299
|
-
const accountId = requireAccount(flags
|
|
295
|
+
const accountId = await requireAccount(client, flags, out);
|
|
300
296
|
const chatId = normalizeChatId(flags.chatId ?? "");
|
|
301
297
|
const messageId = flags.messageId ?? "";
|
|
302
298
|
const attachmentId = flags.attachmentId ?? "";
|
|
@@ -319,7 +315,7 @@ async function runMessageAttachment(client, flags, out, isTTY) {
|
|
|
319
315
|
}
|
|
320
316
|
}
|
|
321
317
|
async function runMessageInMail(client, flags, out, _readStdin) {
|
|
322
|
-
const accountId = requireAccount(flags
|
|
318
|
+
const accountId = await requireAccount(client, flags, out);
|
|
323
319
|
const rawTo = flags.to ?? "";
|
|
324
320
|
if (!rawTo) {
|
|
325
321
|
out.stderr.write(
|
|
@@ -373,7 +369,7 @@ async function runMessageInMail(client, flags, out, _readStdin) {
|
|
|
373
369
|
async function runMessageInMailBalance(client, flags, out) {
|
|
374
370
|
rejectPreviewOnRead(flags.preview, out);
|
|
375
371
|
rejectAllOnNonPaginated(flags.all, out);
|
|
376
|
-
const accountId = requireAccount(flags
|
|
372
|
+
const accountId = await requireAccount(client, flags, out);
|
|
377
373
|
const ns = client.account(accountId);
|
|
378
374
|
const outOpts = resolveOutputOpts(flags);
|
|
379
375
|
try {
|
|
@@ -390,7 +386,7 @@ var messageNewCommand = defineCommand({
|
|
|
390
386
|
...WRITE_FLAGS,
|
|
391
387
|
to: {
|
|
392
388
|
type: "string",
|
|
393
|
-
description: "Recipient: LinkedIn profile URL (e.g. https://www.linkedin.com/in/some-slug), bare slug (e.g. some-slug), or provider ID (e.g. ACoAAA
|
|
389
|
+
description: "Recipient: LinkedIn profile URL (e.g. https://www.linkedin.com/in/some-slug), bare slug (e.g. some-slug), or provider ID (e.g. ACoAAA...). URL and slug inputs resolve the provider ID automatically.",
|
|
394
390
|
required: true
|
|
395
391
|
},
|
|
396
392
|
text: { type: "positional", stdinArg: true, description: "Opening message text. Pass - to read from stdin (e.g. via heredoc or pipe)." },
|
|
@@ -565,7 +561,7 @@ var messageInMailCommand = defineCommand({
|
|
|
565
561
|
...WRITE_FLAGS,
|
|
566
562
|
to: {
|
|
567
563
|
type: "string",
|
|
568
|
-
description: "Recipient: LinkedIn profile URL, bare slug, provider-id (ACoAAA
|
|
564
|
+
description: "Recipient: LinkedIn profile URL, bare slug, provider-id (ACoAAA...), or member URN (urn:li:member:<id>). URL and slug inputs resolve the provider ID automatically.",
|
|
569
565
|
required: true
|
|
570
566
|
},
|
|
571
567
|
subject: { type: "string", description: "InMail subject line.", required: true },
|
|
@@ -657,12 +653,12 @@ var MESSAGE_SUBCOMMANDS = [
|
|
|
657
653
|
"inmail",
|
|
658
654
|
"inmail-balance"
|
|
659
655
|
];
|
|
660
|
-
var MESSAGE_USAGE = 'Usage: curviate message new --to <attendee> "<text>" [--attach <file
|
|
656
|
+
var MESSAGE_USAGE = 'Usage: curviate message new --to <attendee> "<text>" [--attach <file>...]\n curviate message send <chat_id> "<text>" [--attach <file>...]\n curviate message <chat_id> "<text>" [--attach <file>...]\n curviate message get <chat_id> <message_id>\n curviate message edit <chat_id> <message_id> "<text>"\n curviate message delete <chat_id> <message_id>\n curviate message react <chat_id> <message_id> <emoji>\n curviate message attachment <chat_id> <message_id> <attachment_id> [-o <file>]\n curviate message inmail --to <id> --subject <s> "<text>"\n curviate message inmail-balance\n';
|
|
661
657
|
function guardBareMessageForm(chatId, out) {
|
|
662
658
|
if (!looksLikeCommandWord(chatId)) return;
|
|
663
659
|
const suggestion = nearestSubcommand(chatId, [...MESSAGE_SUBCOMMANDS]);
|
|
664
660
|
out.stderr.write(
|
|
665
|
-
`error: \`${chatId}\` is not a curviate message subcommand, and it is not a chat id (a chat id looks like 2
|
|
661
|
+
`error: \`${chatId}\` is not a curviate message subcommand, and it is not a chat id (a chat id looks like 2-... or COMPANY_..., or a linkedin.com/messaging/thread/... URL).
|
|
666
662
|
`
|
|
667
663
|
);
|
|
668
664
|
if (suggestion) {
|
|
@@ -41,7 +41,7 @@ function slimProfileMe(data) {
|
|
|
41
41
|
first_name: d["first_name"] ?? null,
|
|
42
42
|
last_name: d["last_name"] ?? null,
|
|
43
43
|
// LinkedIn serves the profile headline in the `description` wire field
|
|
44
|
-
// on reads, not a field named `headline
|
|
44
|
+
// on reads, not a field named `headline`, see JSDoc above.
|
|
45
45
|
headline: d["description"] ?? null,
|
|
46
46
|
public_identifier: d["public_identifier"] ?? null,
|
|
47
47
|
location: d["location"] ?? null,
|
|
@@ -59,7 +59,7 @@ function slimProfile(data) {
|
|
|
59
59
|
first_name: d["first_name"] ?? null,
|
|
60
60
|
last_name: d["last_name"] ?? null,
|
|
61
61
|
// LinkedIn serves the profile headline in the `description` wire field
|
|
62
|
-
// on reads, not a field named `headline
|
|
62
|
+
// on reads, not a field named `headline`, see slimProfileMe's JSDoc.
|
|
63
63
|
headline: d["description"] ?? null,
|
|
64
64
|
location: d["location"] ?? null,
|
|
65
65
|
network_distance: specifics?.["network_distance"] ?? null,
|
|
@@ -33,6 +33,15 @@ function normalizeChatId(raw) {
|
|
|
33
33
|
if (match?.[1]) return match[1];
|
|
34
34
|
return raw;
|
|
35
35
|
}
|
|
36
|
+
var GROUP_URL_RE = /^https?:\/\/(?:[a-z0-9-]+\.)?linkedin\.com\/groups\/([^/?#]+)/i;
|
|
37
|
+
var GROUP_PATH_RE = /^\/groups\/([^/?#]+)\/?$/;
|
|
38
|
+
function normalizeGroupId(raw) {
|
|
39
|
+
const urlMatch = GROUP_URL_RE.exec(raw);
|
|
40
|
+
if (urlMatch?.[1]) return urlMatch[1];
|
|
41
|
+
const pathMatch = GROUP_PATH_RE.exec(raw);
|
|
42
|
+
if (pathMatch?.[1]) return pathMatch[1];
|
|
43
|
+
return raw;
|
|
44
|
+
}
|
|
36
45
|
var JOB_URL_RE = /\/jobs\/view\/(\d+)/;
|
|
37
46
|
function resolveJobIdentifier(raw) {
|
|
38
47
|
const match = JOB_URL_RE.exec(raw);
|
|
@@ -43,5 +52,6 @@ function resolveJobIdentifier(raw) {
|
|
|
43
52
|
export {
|
|
44
53
|
resolveIdentifier,
|
|
45
54
|
normalizeChatId,
|
|
55
|
+
normalizeGroupId,
|
|
46
56
|
resolveJobIdentifier
|
|
47
57
|
};
|
package/dist/cli.js
CHANGED
|
@@ -78,6 +78,15 @@ async function nodeName(cmd) {
|
|
|
78
78
|
const meta = await resolveValue(cmd.meta ?? {});
|
|
79
79
|
return meta.name ?? "this command";
|
|
80
80
|
}
|
|
81
|
+
function renderPath(path) {
|
|
82
|
+
const parts = path[0] === "curviate" ? path.slice(1) : path;
|
|
83
|
+
return ["curviate", ...parts].join(" ");
|
|
84
|
+
}
|
|
85
|
+
function arityPhrase(count) {
|
|
86
|
+
if (count === 0) return "no positional arguments";
|
|
87
|
+
if (count === 1) return "1 positional argument";
|
|
88
|
+
return `${count} positional arguments`;
|
|
89
|
+
}
|
|
81
90
|
function positionalTokens(rawArgs, booleanFlags) {
|
|
82
91
|
const out = [];
|
|
83
92
|
let afterDoubleDash = false;
|
|
@@ -104,6 +113,24 @@ function positionalTokens(rawArgs, booleanFlags) {
|
|
|
104
113
|
}
|
|
105
114
|
return out;
|
|
106
115
|
}
|
|
116
|
+
async function extraPositionals(cmd, rawArgs) {
|
|
117
|
+
const booleanFlags = await booleanFlagNames(cmd);
|
|
118
|
+
const positionals = positionalTokens(rawArgs, booleanFlags);
|
|
119
|
+
const declaredCount = await nodePositionalCount(cmd);
|
|
120
|
+
return positionals.slice(declaredCount);
|
|
121
|
+
}
|
|
122
|
+
async function assertLeafConsumesPositionals(leaf, leafArgs, path, siblings) {
|
|
123
|
+
const extras = await extraPositionals(leaf, leafArgs);
|
|
124
|
+
if (extras.length === 0) return;
|
|
125
|
+
const token = extras[0].token;
|
|
126
|
+
const form = renderPath(path);
|
|
127
|
+
const arity = arityPhrase(await nodePositionalCount(leaf));
|
|
128
|
+
const hint = siblings && Object.prototype.hasOwnProperty.call(siblings, token) ? `Did you mean \`${renderPath([...path.slice(0, -1), token])}\`?` : void 0;
|
|
129
|
+
usageError(
|
|
130
|
+
`unexpected argument \`${token}\` after \`${form}\`. \`${form}\` takes ${arity}. Run \`${form} --help\` for its usage.`,
|
|
131
|
+
hint
|
|
132
|
+
);
|
|
133
|
+
}
|
|
107
134
|
async function declaredArgNames(cmd) {
|
|
108
135
|
const names = /* @__PURE__ */ new Set();
|
|
109
136
|
const argsDef = await resolveValue(cmd.args ?? {});
|
|
@@ -155,7 +182,8 @@ function usageError(message, hint) {
|
|
|
155
182
|
process.stderr.write("Run `curviate --help` for usage.\n");
|
|
156
183
|
process.exit(2);
|
|
157
184
|
}
|
|
158
|
-
async function resolveLeaf(cmd, rawArgs) {
|
|
185
|
+
async function resolveLeaf(cmd, rawArgs, descent) {
|
|
186
|
+
const here = descent ?? { path: [await nodeName(cmd)] };
|
|
159
187
|
const subCommands = await resolveValue(cmd.subCommands);
|
|
160
188
|
if (subCommands && Object.keys(subCommands).length > 0) {
|
|
161
189
|
const idx = firstPositionalIndex(rawArgs);
|
|
@@ -163,7 +191,10 @@ async function resolveLeaf(cmd, rawArgs) {
|
|
|
163
191
|
const hasBarePositional = await nodeHasPositional(cmd);
|
|
164
192
|
if (token !== void 0 && subCommands[token]) {
|
|
165
193
|
const sub = await resolveValue(subCommands[token]);
|
|
166
|
-
return resolveLeaf(sub, rawArgs.slice(idx + 1)
|
|
194
|
+
return resolveLeaf(sub, rawArgs.slice(idx + 1), {
|
|
195
|
+
path: [...here.path, token],
|
|
196
|
+
siblings: subCommands
|
|
197
|
+
});
|
|
167
198
|
}
|
|
168
199
|
if (token !== void 0) {
|
|
169
200
|
const hint = successorHint(await nodeName(cmd), token);
|
|
@@ -172,16 +203,16 @@ async function resolveLeaf(cmd, rawArgs) {
|
|
|
172
203
|
}
|
|
173
204
|
}
|
|
174
205
|
if (token !== void 0 && hasBarePositional) {
|
|
175
|
-
const
|
|
176
|
-
const positionals = positionalTokens(rawArgs, booleanFlags);
|
|
177
|
-
const declaredCount = await nodePositionalCount(cmd);
|
|
178
|
-
const extras = positionals.slice(declaredCount);
|
|
206
|
+
const extras = await extraPositionals(cmd, rawArgs);
|
|
179
207
|
if (extras.length > 0) {
|
|
180
208
|
const first = extras[0];
|
|
181
209
|
if (extras.length === 1 && Object.prototype.hasOwnProperty.call(subCommands, first.token)) {
|
|
182
210
|
const sub = await resolveValue(subCommands[first.token]);
|
|
183
211
|
const remaining = rawArgs.filter((_, i) => i !== first.index);
|
|
184
|
-
return resolveLeaf(sub, remaining
|
|
212
|
+
return resolveLeaf(sub, remaining, {
|
|
213
|
+
path: [...here.path, first.token],
|
|
214
|
+
siblings: subCommands
|
|
215
|
+
});
|
|
185
216
|
}
|
|
186
217
|
const name = await nodeName(cmd);
|
|
187
218
|
usageError(
|
|
@@ -195,6 +226,7 @@ async function resolveLeaf(cmd, rawArgs) {
|
|
|
195
226
|
}
|
|
196
227
|
return { leaf: cmd, leafArgs: rawArgs };
|
|
197
228
|
}
|
|
229
|
+
await assertLeafConsumesPositionals(cmd, rawArgs, here.path, here.siblings);
|
|
198
230
|
return { leaf: cmd, leafArgs: rawArgs };
|
|
199
231
|
}
|
|
200
232
|
async function dispatch(root, rawArgs) {
|
|
@@ -259,31 +291,31 @@ var main = defineCommand({
|
|
|
259
291
|
version: pkg.version,
|
|
260
292
|
description: "Official command-line interface for the Curviate API."
|
|
261
293
|
},
|
|
262
|
-
// Subcommand registry
|
|
294
|
+
// Subcommand registry, names and descriptions are static for help rendering;
|
|
263
295
|
// the handler implementation is loaded lazily on first invocation.
|
|
264
296
|
subCommands: {
|
|
265
297
|
login: () => import("./login-ZLDDIAFW.js").then((m) => m.loginCommand),
|
|
266
298
|
config: () => import("./config-FPWWYG7G.js").then((m) => m.configCommand),
|
|
267
299
|
// ---------------------------------------------------------------------------
|
|
268
|
-
// Noun groups
|
|
300
|
+
// Noun groups, lazy-loaded on first invocation.
|
|
269
301
|
// ---------------------------------------------------------------------------
|
|
270
|
-
profile: () => import("./profile-
|
|
271
|
-
company: () => import("./company-
|
|
272
|
-
job: () => import("./job-
|
|
273
|
-
connect: () => import("./connect-
|
|
274
|
-
search: () => import("./search-
|
|
275
|
-
inbox: () => import("./inbox-
|
|
276
|
-
inboxes: () => import("./inboxes-
|
|
277
|
-
message: () => import("./message-
|
|
278
|
-
post: () => import("./post-
|
|
279
|
-
comment: () => import("./comment-
|
|
280
|
-
account: () => import("./account-
|
|
281
|
-
webhook: () => import("./webhook-
|
|
282
|
-
"sales-nav": () => import("./sales-nav-
|
|
283
|
-
recruiter: () => import("./recruiter-
|
|
284
|
-
group: () => import("./group-
|
|
285
|
-
feed: () => import("./feed-
|
|
286
|
-
notification: () => import("./notification-
|
|
302
|
+
profile: () => import("./profile-SUKHRWQP.js").then((m) => m.profileCommand),
|
|
303
|
+
company: () => import("./company-LHYDAO2C.js").then((m) => m.companyCommand),
|
|
304
|
+
job: () => import("./job-JQG34ATV.js").then((m) => m.jobCommand),
|
|
305
|
+
connect: () => import("./connect-5S4TFQAF.js").then((m) => m.connectCommand),
|
|
306
|
+
search: () => import("./search-MZQJDJTX.js").then((m) => m.searchCommand),
|
|
307
|
+
inbox: () => import("./inbox-3IQPPQMH.js").then((m) => m.inboxCommand),
|
|
308
|
+
inboxes: () => import("./inboxes-JK36F6SK.js").then((m) => m.inboxesCommand),
|
|
309
|
+
message: () => import("./message-2WIZESSM.js").then((m) => m.messageCommand),
|
|
310
|
+
post: () => import("./post-JRJMGV2I.js").then((m) => m.postCommand),
|
|
311
|
+
comment: () => import("./comment-TUXC7K72.js").then((m) => m.commentCommand),
|
|
312
|
+
account: () => import("./account-MIPWTAG5.js").then((m) => m.accountCommand),
|
|
313
|
+
webhook: () => import("./webhook-7ESDSIRU.js").then((m) => m.webhookCommand),
|
|
314
|
+
"sales-nav": () => import("./sales-nav-4MFL2JSE.js").then((m) => m.salesNavCommand),
|
|
315
|
+
recruiter: () => import("./recruiter-NIKKDGMR.js").then((m) => m.recruiterCommand),
|
|
316
|
+
group: () => import("./group-PHGUOOJE.js").then((m) => m.groupCommand),
|
|
317
|
+
feed: () => import("./feed-ISNH4NXB.js").then((m) => m.feedCommand),
|
|
318
|
+
notification: () => import("./notification-ORSZY2IJ.js").then((m) => m.notificationCommand)
|
|
287
319
|
},
|
|
288
320
|
async run() {
|
|
289
321
|
const { runMain } = await import("citty");
|
|
@@ -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
|
describeAttachment,
|
|
@@ -11,8 +11,11 @@ import {
|
|
|
11
11
|
import {
|
|
12
12
|
pageDelayFromFlags,
|
|
13
13
|
streamAll
|
|
14
|
-
} from "./chunk-
|
|
15
|
-
import "./chunk-
|
|
14
|
+
} from "./chunk-H6XD3F66.js";
|
|
15
|
+
import "./chunk-UEAX6KUB.js";
|
|
16
|
+
import {
|
|
17
|
+
requireAccount
|
|
18
|
+
} from "./chunk-3BO6GVS2.js";
|
|
16
19
|
import {
|
|
17
20
|
buildPreviewOutput
|
|
18
21
|
} from "./chunk-R3VLWLVV.js";
|
|
@@ -22,7 +25,7 @@ import {
|
|
|
22
25
|
renderSuccess,
|
|
23
26
|
renderUnexpectedError,
|
|
24
27
|
resolveEffectiveConfig
|
|
25
|
-
} from "./chunk-
|
|
28
|
+
} from "./chunk-JA3NNST6.js";
|
|
26
29
|
import {
|
|
27
30
|
GLOBAL_FLAGS,
|
|
28
31
|
WRITE_SINGLE_FLAGS
|
|
@@ -30,6 +33,7 @@ import {
|
|
|
30
33
|
import {
|
|
31
34
|
resolveTextOrStdin
|
|
32
35
|
} from "./chunk-ZYURL5VK.js";
|
|
36
|
+
import "./chunk-PMRQXBCP.js";
|
|
33
37
|
|
|
34
38
|
// src/commands/comment.ts
|
|
35
39
|
import { defineCommand } from "citty";
|
|
@@ -40,13 +44,6 @@ function buildOutputStreams() {
|
|
|
40
44
|
stderr: { write: (s) => process.stderr.write(s) }
|
|
41
45
|
};
|
|
42
46
|
}
|
|
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
47
|
function rejectPreviewOnRead(preview, out) {
|
|
51
48
|
if (preview) {
|
|
52
49
|
out.stderr.write("error: --preview is only valid on write commands (mutations). Reads just run.\n");
|
|
@@ -70,7 +67,7 @@ function buildListQuery(flags) {
|
|
|
70
67
|
async function handleSdkError(err, outOpts, out) {
|
|
71
68
|
const { CurviateError } = await import("@curviate/sdk");
|
|
72
69
|
if (err instanceof CurviateError) {
|
|
73
|
-
const { getExitCode } = await import("./exit-codes-
|
|
70
|
+
const { getExitCode } = await import("./exit-codes-KAVZN5BQ.js");
|
|
74
71
|
renderError(err, outOpts, out);
|
|
75
72
|
process.exit(getExitCode(err.code));
|
|
76
73
|
}
|
|
@@ -92,7 +89,7 @@ function assertReaction(reaction, out) {
|
|
|
92
89
|
}
|
|
93
90
|
async function runCommentList(client, flags, out) {
|
|
94
91
|
rejectPreviewOnRead(flags.preview, out);
|
|
95
|
-
const accountId = requireAccount(flags
|
|
92
|
+
const accountId = await requireAccount(client, flags, out);
|
|
96
93
|
const postId = flags.postId ?? "";
|
|
97
94
|
const ns = client.account(accountId);
|
|
98
95
|
const outOpts = resolveOutputOpts(flags);
|
|
@@ -119,7 +116,7 @@ async function runCommentList(client, flags, out) {
|
|
|
119
116
|
}
|
|
120
117
|
async function runCommentReplies(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 postId = flags.postId ?? "";
|
|
124
121
|
const commentId = flags.commentId ?? "";
|
|
125
122
|
const ns = client.account(accountId);
|
|
@@ -147,7 +144,7 @@ async function runCommentReplies(client, flags, out) {
|
|
|
147
144
|
}
|
|
148
145
|
async function runCommentReactions(client, flags, out) {
|
|
149
146
|
rejectPreviewOnRead(flags.preview, out);
|
|
150
|
-
const accountId = requireAccount(flags
|
|
147
|
+
const accountId = await requireAccount(client, flags, out);
|
|
151
148
|
const postId = flags.postId ?? "";
|
|
152
149
|
const commentId = flags.commentId ?? "";
|
|
153
150
|
const ns = client.account(accountId);
|
|
@@ -175,7 +172,7 @@ async function runCommentReactions(client, flags, out) {
|
|
|
175
172
|
}
|
|
176
173
|
async function runCommentUser(client, flags, out) {
|
|
177
174
|
rejectPreviewOnRead(flags.preview, out);
|
|
178
|
-
const accountId = requireAccount(flags
|
|
175
|
+
const accountId = await requireAccount(client, flags, out);
|
|
179
176
|
const ns = client.account(accountId);
|
|
180
177
|
const outOpts = resolveOutputOpts(flags);
|
|
181
178
|
let userId;
|
|
@@ -207,7 +204,7 @@ async function runCommentUser(client, flags, out) {
|
|
|
207
204
|
}
|
|
208
205
|
}
|
|
209
206
|
async function runCommentAdd(client, flags, out, readStdin) {
|
|
210
|
-
const accountId = requireAccount(flags
|
|
207
|
+
const accountId = await requireAccount(client, flags, out);
|
|
211
208
|
const postId = flags.postId ?? "";
|
|
212
209
|
const attachPaths = normalizeAttachPaths(flags.attach);
|
|
213
210
|
let attachBuffers = [];
|
|
@@ -248,7 +245,7 @@ async function runCommentAdd(client, flags, out, readStdin) {
|
|
|
248
245
|
}
|
|
249
246
|
}
|
|
250
247
|
async function runCommentReply(client, flags, out, readStdin) {
|
|
251
|
-
const accountId = requireAccount(flags
|
|
248
|
+
const accountId = await requireAccount(client, flags, out);
|
|
252
249
|
const postId = flags.postId ?? "";
|
|
253
250
|
const commentId = flags.commentId ?? "";
|
|
254
251
|
const attachPaths = normalizeAttachPaths(flags.attach);
|
|
@@ -290,7 +287,7 @@ async function runCommentReply(client, flags, out, readStdin) {
|
|
|
290
287
|
}
|
|
291
288
|
}
|
|
292
289
|
async function runCommentEdit(client, flags, out, readStdin) {
|
|
293
|
-
const accountId = requireAccount(flags
|
|
290
|
+
const accountId = await requireAccount(client, flags, out);
|
|
294
291
|
const postId = flags.postId ?? "";
|
|
295
292
|
const commentId = flags.commentId ?? "";
|
|
296
293
|
const text = await resolveTextOrStdin(flags.text ?? "", out, readStdin);
|
|
@@ -315,7 +312,7 @@ async function runCommentEdit(client, flags, out, readStdin) {
|
|
|
315
312
|
}
|
|
316
313
|
}
|
|
317
314
|
async function runCommentDelete(client, flags, out) {
|
|
318
|
-
const accountId = requireAccount(flags
|
|
315
|
+
const accountId = await requireAccount(client, flags, out);
|
|
319
316
|
const postId = flags.postId ?? "";
|
|
320
317
|
const commentId = flags.commentId ?? "";
|
|
321
318
|
if (flags.preview) {
|
|
@@ -338,7 +335,7 @@ async function runCommentDelete(client, flags, out) {
|
|
|
338
335
|
}
|
|
339
336
|
}
|
|
340
337
|
async function runCommentReact(client, flags, out) {
|
|
341
|
-
const accountId = requireAccount(flags
|
|
338
|
+
const accountId = await requireAccount(client, flags, out);
|
|
342
339
|
const postId = flags.postId ?? "";
|
|
343
340
|
const commentId = flags.commentId ?? "";
|
|
344
341
|
const reaction = flags.reaction ?? "";
|
|
@@ -364,7 +361,7 @@ async function runCommentReact(client, flags, out) {
|
|
|
364
361
|
}
|
|
365
362
|
}
|
|
366
363
|
async function runCommentUnreact(client, flags, out) {
|
|
367
|
-
const accountId = requireAccount(flags
|
|
364
|
+
const accountId = await requireAccount(client, flags, out);
|
|
368
365
|
const postId = flags.postId ?? "";
|
|
369
366
|
const commentId = flags.commentId ?? "";
|
|
370
367
|
const reaction = flags.reaction ?? "";
|