@curviate/cli 0.47.0 → 0.49.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 +231 -1
- package/README.md +136 -88
- package/dist/{account-RFJ63QYL.js → account-2BH2Q6VG.js} +41 -31
- package/dist/chunk-3RCW7URJ.js +41 -0
- package/dist/{chunk-UJOTQPL6.js → chunk-5ZGTU4VD.js} +47 -14
- package/dist/chunk-D2S5OCYU.js +38 -0
- package/dist/{chunk-HOQ7EUHJ.js → chunk-FDJMAF7D.js} +1 -0
- package/dist/{chunk-ERBYEC5P.js → chunk-JYKYD57J.js} +1 -1
- package/dist/chunk-MGB6FE4A.js +58 -0
- package/dist/chunk-NNV2OYEF.js +23 -0
- package/dist/{chunk-76SWLAZ6.js → chunk-RXWODUWA.js} +43 -1
- package/dist/{chunk-V3MVOVQT.js → chunk-SA2QHAXG.js} +8 -1
- package/dist/chunk-TEAWYLPO.js +1493 -0
- package/dist/{chunk-PD2I5TYC.js → chunk-V7FJWTZW.js} +3 -3
- package/dist/{chunk-TC4ZPUWI.js → chunk-Y7MZZRYR.js} +21 -80
- package/dist/{chunk-FXYK2GTO.js → chunk-Z7OQSWBD.js} +38 -33
- package/dist/chunk-ZYURL5VK.js +83 -0
- package/dist/cli.js +79 -98
- package/dist/{comment-MCXE7B7V.js → comment-MRDPDA33.js} +29 -24
- package/dist/{company-EUUN372H.js → company-2AEHSGHA.js} +57 -52
- package/dist/{config-K4G3VSBA.js → config-NRBKHXES.js} +13 -5
- package/dist/{connect-2AL7XVJO.js → connect-4XEBV5V3.js} +42 -38
- package/dist/core-RGU2SCBN.js +46 -0
- package/dist/{doctor-WPYI7X2T.js → doctor-BZ4DA7DV.js} +9 -5
- package/dist/document-RKHRWXNT.js +27 -0
- package/dist/{draft-G65DVXT7.js → draft-C5N6EOO5.js} +27 -22
- package/dist/enrollment-BNQOUKI7.js +472 -0
- package/dist/examples-NIMSIXMV.js +53 -0
- package/dist/{exit-codes-AW6KHDDN.js → exit-codes-TLMKTLRI.js} +1 -1
- package/dist/{feed-HV24WME4.js → feed-DFUU7SUJ.js} +15 -11
- package/dist/{group-HADXNVJW.js → group-CSD2OWOZ.js} +17 -13
- package/dist/{inbox-G3EE54OB.js → inbox-SNSPWI7J.js} +23 -19
- package/dist/{inboxes-237XOBTP.js → inboxes-RIRHPS4H.js} +18 -14
- package/dist/{job-LIN6RWD7.js → job-6PNXXZNF.js} +31 -27
- package/dist/{login-OHAHNBRW.js → login-Y7JBAHCW.js} +10 -5
- package/dist/{message-U2O2JQSW.js → message-2IK4MBBG.js} +10 -8
- package/dist/motion-7ATUXO6R.js +946 -0
- package/dist/{notification-3VG32LWM.js → notification-VYK5NDEB.js} +19 -15
- package/dist/{post-ECDK2KJL.js → post-AN6T2OJF.js} +35 -30
- package/dist/{profile-JOHS6SDW.js → profile-UQY64642.js} +46 -42
- package/dist/{recruiter-7VXEIXN3.js → recruiter-OY4RN5HH.js} +122 -119
- package/dist/{sales-nav-K4BMBH7R.js → sales-nav-KLODLYMW.js} +36 -30
- package/dist/{search-C2UYO6PI.js → search-NWP5S6CF.js} +68 -58
- package/dist/{setup-GYEZFDEN.js → setup-YPPFLH2N.js} +14 -9
- package/dist/{webhook-KCOQOH7D.js → webhook-OHKBL3YS.js} +51 -55
- package/package.json +2 -2
- package/dist/chunk-KJ24DIAJ.js +0 -60
- package/dist/examples-IJL3A6SZ.js +0 -18
package/dist/cli.js
CHANGED
|
@@ -1,14 +1,27 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
+
import {
|
|
3
|
+
intFlag
|
|
4
|
+
} from "./chunk-NNV2OYEF.js";
|
|
2
5
|
import {
|
|
3
6
|
SECRET_FLAGS
|
|
4
7
|
} from "./chunk-TCUYH5GO.js";
|
|
5
8
|
import {
|
|
6
9
|
GLOBAL_FLAGS,
|
|
7
|
-
|
|
10
|
+
STATE_WRITES,
|
|
8
11
|
parseBetaFlag,
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
} from "./chunk-
|
|
12
|
+
setBetaOverride,
|
|
13
|
+
setWriteKind
|
|
14
|
+
} from "./chunk-Y7MZZRYR.js";
|
|
15
|
+
import {
|
|
16
|
+
lazy
|
|
17
|
+
} from "./chunk-D2S5OCYU.js";
|
|
18
|
+
import {
|
|
19
|
+
editDistance
|
|
20
|
+
} from "./chunk-FDJMAF7D.js";
|
|
21
|
+
import {
|
|
22
|
+
STDIN_SENTINEL,
|
|
23
|
+
restoreLiteralDashes
|
|
24
|
+
} from "./chunk-ZYURL5VK.js";
|
|
12
25
|
|
|
13
26
|
// src/main.ts
|
|
14
27
|
import { defineCommand } from "citty";
|
|
@@ -22,40 +35,31 @@ var main = defineCommand({
|
|
|
22
35
|
meta: {
|
|
23
36
|
name: "curviate",
|
|
24
37
|
version: pkg.version,
|
|
25
|
-
description: "Official command-line interface for the Curviate API."
|
|
38
|
+
description: "Official command-line interface for the Curviate API.",
|
|
39
|
+
seeAlso: [
|
|
40
|
+
"Skill plugin (judgement, playbooks): https://github.com/curviate/curviate-plugin",
|
|
41
|
+
"Reference: https://docs.curviate.com/reference/cli"
|
|
42
|
+
]
|
|
26
43
|
},
|
|
27
44
|
// Subcommand registry, names and descriptions are static for help rendering;
|
|
28
45
|
// the handler implementation is loaded lazily on first invocation.
|
|
29
46
|
subCommands: {
|
|
30
|
-
setup: () => import("./setup-
|
|
31
|
-
doctor: () => import("./doctor-
|
|
32
|
-
login: () => import("./login-
|
|
33
|
-
config: () => import("./config-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
inbox: () => import("./inbox-G3EE54OB.js").then((m) => m.inboxCommand),
|
|
43
|
-
inboxes: () => import("./inboxes-237XOBTP.js").then((m) => m.inboxesCommand),
|
|
44
|
-
message: () => import("./message-U2O2JQSW.js").then((m) => m.messageCommand),
|
|
45
|
-
post: () => import("./post-ECDK2KJL.js").then((m) => m.postCommand),
|
|
46
|
-
comment: () => import("./comment-MCXE7B7V.js").then((m) => m.commentCommand),
|
|
47
|
-
account: () => import("./account-RFJ63QYL.js").then((m) => m.accountCommand),
|
|
48
|
-
webhook: () => import("./webhook-KCOQOH7D.js").then((m) => m.webhookCommand),
|
|
49
|
-
draft: () => import("./draft-G65DVXT7.js").then((m) => m.draftCommand),
|
|
50
|
-
"sales-nav": () => import("./sales-nav-K4BMBH7R.js").then((m) => m.salesNavCommand),
|
|
51
|
-
recruiter: () => import("./recruiter-7VXEIXN3.js").then((m) => m.recruiterCommand),
|
|
52
|
-
group: () => import("./group-HADXNVJW.js").then((m) => m.groupCommand),
|
|
53
|
-
feed: () => import("./feed-HV24WME4.js").then((m) => m.feedCommand),
|
|
54
|
-
notification: () => import("./notification-3VG32LWM.js").then((m) => m.notificationCommand)
|
|
47
|
+
setup: lazy("setup", () => import("./setup-YPPFLH2N.js").then((m) => m.setupCommand)),
|
|
48
|
+
doctor: lazy("doctor", () => import("./doctor-BZ4DA7DV.js").then((m) => m.doctorCommand)),
|
|
49
|
+
login: lazy("login", () => import("./login-Y7JBAHCW.js").then((m) => m.loginCommand)),
|
|
50
|
+
config: lazy("config", () => import("./config-NRBKHXES.js").then((m) => m.configCommand)),
|
|
51
|
+
account: lazy("account", () => import("./account-2BH2Q6VG.js").then((m) => m.accountCommand)),
|
|
52
|
+
motion: lazy("motion", () => import("./motion-7ATUXO6R.js").then((m) => m.motionCommand)),
|
|
53
|
+
enrollment: lazy("enrollment", () => import("./enrollment-BNQOUKI7.js").then((m) => m.enrollmentCommand)),
|
|
54
|
+
webhook: lazy("webhook", () => import("./webhook-OHKBL3YS.js").then((m) => m.webhookCommand)),
|
|
55
|
+
// The LinkedIn building blocks. Reserved product groups
|
|
56
|
+
// (contact, unibox, network, analytics, notification, team) land
|
|
57
|
+
// between `enrollment` and `webhook` with their owning specs.
|
|
58
|
+
core: lazy("core", () => import("./core-RGU2SCBN.js").then((m) => m.coreCommand))
|
|
55
59
|
},
|
|
56
60
|
async run() {
|
|
57
|
-
const {
|
|
58
|
-
await
|
|
61
|
+
const { showHelp } = await import("./examples-NIMSIXMV.js");
|
|
62
|
+
await showHelp(main, ["curviate"]);
|
|
59
63
|
}
|
|
60
64
|
});
|
|
61
65
|
|
|
@@ -93,46 +97,9 @@ function shownFlag(flag, index) {
|
|
|
93
97
|
const runsOn = !SECRET_FLAGS.includes(name) && SECRET_FLAGS.some((secret) => name.startsWith(secret));
|
|
94
98
|
return runsOn ? `at ${argumentAt(index)}` : `\`${flag}\``;
|
|
95
99
|
}
|
|
96
|
-
var
|
|
97
|
-
|
|
98
|
-
list: "`post list` was removed. Use `post user-posts <user_id>` (accepts `me`).",
|
|
99
|
-
comment: "post comments are their own group now. Use `comment add <post_id> <text>`.",
|
|
100
|
-
comments: "post comments are their own group now. Use `comment list <post_id>`."
|
|
101
|
-
},
|
|
102
|
-
connect: {
|
|
103
|
-
respond: "`connect respond` was split. Use `connect accept <id>` or `connect decline <id>`."
|
|
104
|
-
},
|
|
105
|
-
profile: {
|
|
106
|
-
connections: "`profile connections` was renamed. Use `profile relations`."
|
|
107
|
-
},
|
|
108
|
-
account: {
|
|
109
|
-
"connect-link": "`account connect-link` was removed. Use `account link [--account-id <id>]`.",
|
|
110
|
-
"reconnect-link": "`account reconnect-link` was removed. Use `account link [--account-id <id>]`.",
|
|
111
|
-
reconnect: "`account reconnect` was removed. Use `account link [--account-id <id>]`."
|
|
112
|
-
},
|
|
113
|
-
inbox: {
|
|
114
|
-
sync: "`inbox sync` was removed. History syncs automatically; just read `inbox messages <chat_id>`.",
|
|
115
|
-
"sync-chat": "`inbox sync-chat` was removed. History syncs automatically; just read `inbox messages <chat_id>`."
|
|
116
|
-
},
|
|
117
|
-
recruiter: {
|
|
118
|
-
"add-candidate": "`recruiter add-candidate` was renamed. Use `recruiter save-candidate <project_id> --stage-id <id> --candidate-id <id>`.",
|
|
119
|
-
"project-jobs": "`recruiter project-jobs` was renamed. Use `recruiter project-job get <project_id>`.",
|
|
120
|
-
sync: "`recruiter sync` was removed. Recruiter data syncs automatically now.",
|
|
121
|
-
"add-applicant": "`recruiter add-applicant` was removed with no replacement.",
|
|
122
|
-
"reject-applicant": "`recruiter reject-applicant` was removed with no replacement."
|
|
123
|
-
},
|
|
124
|
-
"sales-nav": {
|
|
125
|
-
sync: "`sales-nav sync` was removed. Sales Navigator data syncs automatically now."
|
|
126
|
-
},
|
|
127
|
-
webhook: {
|
|
128
|
-
"state-diff": "`webhook state-diff` was removed with no replacement."
|
|
129
|
-
}
|
|
100
|
+
var REFUSED_TOKENS = {
|
|
101
|
+
"curviate core connect": /* @__PURE__ */ new Set(["respond"])
|
|
130
102
|
};
|
|
131
|
-
function successorHint(group, token) {
|
|
132
|
-
const groupMap = REMOVED_COMMANDS[group];
|
|
133
|
-
if (!groupMap || !Object.prototype.hasOwnProperty.call(groupMap, token)) return null;
|
|
134
|
-
return groupMap[token] ?? null;
|
|
135
|
-
}
|
|
136
103
|
async function resolveValue(input) {
|
|
137
104
|
return typeof input === "function" ? input() : input;
|
|
138
105
|
}
|
|
@@ -250,10 +217,8 @@ async function assertLeafConsumesPositionals(leaf, leafArgs, path, siblings) {
|
|
|
250
217
|
const form = renderPath(path);
|
|
251
218
|
const arity = arityPhrase(await nodePositionalCount(leaf));
|
|
252
219
|
const hint = siblings && Object.prototype.hasOwnProperty.call(siblings, token) ? `Did you mean \`${renderPath([...path.slice(0, -1), token])}\`?` : void 0;
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
hint
|
|
256
|
-
);
|
|
220
|
+
helpFor = form;
|
|
221
|
+
usageError(`unexpected ${shown} after \`${form}\`. \`${form}\` takes ${arity}.`, hint);
|
|
257
222
|
}
|
|
258
223
|
async function declaredArgNames(cmd) {
|
|
259
224
|
const names = /* @__PURE__ */ new Set();
|
|
@@ -274,17 +239,22 @@ function dropFalsePreview(args, walk, declared) {
|
|
|
274
239
|
);
|
|
275
240
|
return drop.size ? args.filter((_, i) => !drop.has(i)) : args;
|
|
276
241
|
}
|
|
277
|
-
function findUnknownFlag(flags, declared, booleans) {
|
|
242
|
+
function findUnknownFlag(flags, declared, booleans, flagNames) {
|
|
278
243
|
for (const { token, name, index } of flags) {
|
|
279
244
|
const dashes = /^-*/.exec(token)[0].length;
|
|
280
245
|
if (dashes === 2 || dashes === 1 && name.length === 1) {
|
|
281
246
|
if (declared.has(name)) continue;
|
|
282
247
|
if (name.startsWith("no-") && booleans.has(name.slice(3))) continue;
|
|
283
248
|
}
|
|
284
|
-
|
|
249
|
+
const shown = shownFlag(token.split("=")[0], index);
|
|
250
|
+
return { shown, hint: shown.startsWith("`") ? nearestFlag(name.split("=")[0], flagNames) : null };
|
|
285
251
|
}
|
|
286
252
|
return null;
|
|
287
253
|
}
|
|
254
|
+
function nearestFlag(name, declared) {
|
|
255
|
+
const near = [...declared].filter((d) => d.length > 1 && editDistance(name, d) <= 2);
|
|
256
|
+
return near.length === 1 ? near[0] : null;
|
|
257
|
+
}
|
|
288
258
|
function hasEmptyFields(rawArgs) {
|
|
289
259
|
for (let i = 0; i < rawArgs.length; i++) {
|
|
290
260
|
const arg = rawArgs[i];
|
|
@@ -319,9 +289,12 @@ function usageError(message, hint) {
|
|
|
319
289
|
`);
|
|
320
290
|
if (hint) process.stderr.write(`hint: ${hint}
|
|
321
291
|
`);
|
|
322
|
-
process.stderr.write(
|
|
292
|
+
process.stderr.write(helpPointer());
|
|
323
293
|
process.exit(2);
|
|
324
294
|
}
|
|
295
|
+
var helpFor = "curviate";
|
|
296
|
+
var helpPointer = () => `Run \`${helpFor} --help\` for usage.
|
|
297
|
+
`;
|
|
325
298
|
async function resolveLeaf(cmd, rawArgs, descent) {
|
|
326
299
|
const here = descent ?? { path: [await nodeName(cmd)] };
|
|
327
300
|
const subCommands = await resolveValue(cmd.subCommands);
|
|
@@ -340,11 +313,8 @@ async function resolveLeaf(cmd, rawArgs, descent) {
|
|
|
340
313
|
siblings: subCommands
|
|
341
314
|
});
|
|
342
315
|
}
|
|
343
|
-
if (token !== void 0) {
|
|
344
|
-
|
|
345
|
-
if (hint) {
|
|
346
|
-
usageError(`unknown command at ${argumentAt(idx)}`, hint);
|
|
347
|
-
}
|
|
316
|
+
if (token !== void 0 && REFUSED_TOKENS[renderPath(here.path)]?.has(token)) {
|
|
317
|
+
usageError(`unknown command at ${argumentAt(idx)}`);
|
|
348
318
|
}
|
|
349
319
|
if (token !== void 0 && hasBarePositional) {
|
|
350
320
|
const extras = await extraPositionals(cmd, rawArgs);
|
|
@@ -358,27 +328,30 @@ async function resolveLeaf(cmd, rawArgs, descent) {
|
|
|
358
328
|
siblings: subCommands
|
|
359
329
|
});
|
|
360
330
|
}
|
|
361
|
-
const
|
|
331
|
+
const form = renderPath(here.path);
|
|
332
|
+
helpFor = form;
|
|
362
333
|
usageError(
|
|
363
|
-
`unexpected ${argumentAt(first.index)} after \`${
|
|
334
|
+
`unexpected ${argumentAt(first.index)} after \`${form}\`. It is neither a positional \`${form}\` accepts nor one of its subcommands.`
|
|
364
335
|
);
|
|
365
336
|
}
|
|
366
|
-
return { leaf: cmd, leafArgs: rawArgs };
|
|
337
|
+
return { leaf: cmd, leafArgs: rawArgs, path: here.path };
|
|
367
338
|
}
|
|
368
339
|
if (token !== void 0) {
|
|
369
340
|
usageError(`unknown command at ${argumentAt(idx)}`);
|
|
370
341
|
}
|
|
371
|
-
return { leaf: cmd, leafArgs: rawArgs };
|
|
342
|
+
return { leaf: cmd, leafArgs: rawArgs, path: here.path };
|
|
372
343
|
}
|
|
373
344
|
await assertLeafConsumesPositionals(cmd, rawArgs, here.path, here.siblings);
|
|
374
|
-
return { leaf: cmd, leafArgs: rawArgs };
|
|
345
|
+
return { leaf: cmd, leafArgs: rawArgs, path: here.path };
|
|
375
346
|
}
|
|
376
347
|
async function dispatch(root, rawArgs) {
|
|
348
|
+
helpFor = "curviate";
|
|
377
349
|
if (rawArgs.includes("--help") || rawArgs.includes("-h")) {
|
|
378
|
-
const {
|
|
379
|
-
const {
|
|
380
|
-
await
|
|
381
|
-
|
|
350
|
+
const { leaf, path } = await resolveLeaf(root, rawArgs.filter((a) => a !== "--help" && a !== "-h"));
|
|
351
|
+
const { showHelp } = await import("./examples-NIMSIXMV.js");
|
|
352
|
+
await showHelp(leaf, path);
|
|
353
|
+
await new Promise((done) => process.stdout.write("", () => done()));
|
|
354
|
+
process.exit(0);
|
|
382
355
|
}
|
|
383
356
|
const versionProbe = parseBetaFlag(rawArgs);
|
|
384
357
|
const versionArgs = versionProbe.ok ? versionProbe.rest : rawArgs;
|
|
@@ -397,20 +370,25 @@ async function dispatch(root, rawArgs) {
|
|
|
397
370
|
const argsAfterBeta = beta.ok ? beta.rest : rawArgs;
|
|
398
371
|
let hintLeaf;
|
|
399
372
|
try {
|
|
400
|
-
const { leaf, leafArgs: resolvedArgs } = await resolveLeaf(root, argsAfterBeta);
|
|
373
|
+
const { leaf, leafArgs: resolvedArgs, path: leafPath } = await resolveLeaf(root, argsAfterBeta);
|
|
401
374
|
hintLeaf = leaf;
|
|
375
|
+
helpFor = renderPath(leafPath);
|
|
402
376
|
if (hasEmptyFields(resolvedArgs)) {
|
|
403
377
|
usageError("--fields must not be empty.");
|
|
404
378
|
}
|
|
405
379
|
const booleanFlags = await booleanFlagNames(leaf);
|
|
406
380
|
const declared = await declaredArgNames(leaf);
|
|
381
|
+
const stateRecheck = STATE_WRITES[renderPath(leafPath)];
|
|
382
|
+
setWriteKind(stateRecheck ? "state" : declared.has("preview") ? "write" : "read", stateRecheck, renderPath(leafPath));
|
|
407
383
|
const leafArgs = dropFalsePreview(resolvedArgs, walkTokens(resolvedArgs, booleanFlags, declared), declared);
|
|
408
384
|
const walk = walkTokens(leafArgs, booleanFlags, declared);
|
|
409
|
-
const
|
|
385
|
+
const flagOnly = new Set(Object.entries(await resolveValue(leaf.args ?? {})).filter(([, d]) => d?.type !== "positional").map(([n]) => n));
|
|
386
|
+
const unknown = findUnknownFlag(walk.flags, declared, booleanFlags, flagOnly);
|
|
410
387
|
if (unknown !== null) {
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
388
|
+
if (unknown.shown === "`--preview`" && declared.has("beta")) {
|
|
389
|
+
usageError("--preview is only valid on write commands (mutations). Reads just run.");
|
|
390
|
+
}
|
|
391
|
+
usageError(`unknown flag ${unknown.shown}.`, unknown.hint ? `did you mean --${unknown.hint}?` : void 0);
|
|
414
392
|
}
|
|
415
393
|
const repeated = await repeatedFlag(leaf, walk.flags);
|
|
416
394
|
if (repeated !== null) {
|
|
@@ -429,6 +407,8 @@ async function dispatch(root, rawArgs) {
|
|
|
429
407
|
ctx.args,
|
|
430
408
|
leafArgsDef
|
|
431
409
|
);
|
|
410
|
+
const limit = ctx.args["limit"];
|
|
411
|
+
if (typeof limit === "string") intFlag("limit", limit);
|
|
432
412
|
return originalRun(ctx);
|
|
433
413
|
}
|
|
434
414
|
} : {}
|
|
@@ -446,9 +426,10 @@ async function dispatch(root, rawArgs) {
|
|
|
446
426
|
if (hint) process.stderr.write(`hint: --${missing}: ${hint}
|
|
447
427
|
`);
|
|
448
428
|
}
|
|
429
|
+
if (code === "EARG") process.stderr.write(helpPointer());
|
|
449
430
|
const { CurviateError } = await import("@curviate/sdk");
|
|
450
431
|
if (err instanceof CurviateError) {
|
|
451
|
-
const { getExitCode } = await import("./exit-codes-
|
|
432
|
+
const { getExitCode } = await import("./exit-codes-TLMKTLRI.js");
|
|
452
433
|
process.exit(getExitCode(err));
|
|
453
434
|
}
|
|
454
435
|
process.exit(code === "EARG" ? 2 : 1);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import {
|
|
3
3
|
resolveMemberOrMeProviderId
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-JYKYD57J.js";
|
|
5
5
|
import {
|
|
6
6
|
AttachError,
|
|
7
7
|
describeAttachment,
|
|
@@ -11,7 +11,7 @@ import {
|
|
|
11
11
|
import "./chunk-UEAX6KUB.js";
|
|
12
12
|
import {
|
|
13
13
|
requireAccount
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-V7FJWTZW.js";
|
|
15
15
|
import {
|
|
16
16
|
buildPreviewOutput
|
|
17
17
|
} from "./chunk-TCUYH5GO.js";
|
|
@@ -27,17 +27,22 @@ import {
|
|
|
27
27
|
resolveEffectiveConfig,
|
|
28
28
|
streamAll,
|
|
29
29
|
writeNdjsonItem
|
|
30
|
-
} from "./chunk-
|
|
31
|
-
import "./chunk-
|
|
30
|
+
} from "./chunk-SA2QHAXG.js";
|
|
31
|
+
import "./chunk-RXWODUWA.js";
|
|
32
32
|
import {
|
|
33
33
|
createClient
|
|
34
|
-
} from "./chunk-
|
|
34
|
+
} from "./chunk-5ZGTU4VD.js";
|
|
35
35
|
import {
|
|
36
36
|
GLOBAL_FLAGS,
|
|
37
37
|
WRITE_SINGLE_FLAGS,
|
|
38
|
-
readOnly
|
|
38
|
+
readOnly
|
|
39
|
+
} from "./chunk-Y7MZZRYR.js";
|
|
40
|
+
import {
|
|
41
|
+
DESCRIPTIONS
|
|
42
|
+
} from "./chunk-D2S5OCYU.js";
|
|
43
|
+
import {
|
|
39
44
|
resolveTextOrStdin
|
|
40
|
-
} from "./chunk-
|
|
45
|
+
} from "./chunk-ZYURL5VK.js";
|
|
41
46
|
|
|
42
47
|
// src/commands/comment.ts
|
|
43
48
|
import { defineCommand } from "citty";
|
|
@@ -66,7 +71,7 @@ function buildListQuery(flags, out) {
|
|
|
66
71
|
async function handleSdkError(err, outOpts, out) {
|
|
67
72
|
const { CurviateError } = await import("@curviate/sdk");
|
|
68
73
|
if (err instanceof CurviateError) {
|
|
69
|
-
const { getExitCode } = await import("./exit-codes-
|
|
74
|
+
const { getExitCode } = await import("./exit-codes-TLMKTLRI.js");
|
|
70
75
|
renderError(err, outOpts, out);
|
|
71
76
|
process.exit(getExitCode(err));
|
|
72
77
|
}
|
|
@@ -409,13 +414,13 @@ var commentListCommand = defineCommand({
|
|
|
409
414
|
name: "list",
|
|
410
415
|
description: "List the comments on a post. A very recent add/delete may take a few minutes to appear or clear here (LinkedIn-side indexing).",
|
|
411
416
|
examples: [
|
|
412
|
-
"curviate comment list 7290000000000000000",
|
|
413
|
-
"curviate comment list 7290000000000000000 --all"
|
|
417
|
+
"curviate core comment list 7290000000000000000",
|
|
418
|
+
"curviate core comment list 7290000000000000000 --all"
|
|
414
419
|
]
|
|
415
420
|
},
|
|
416
421
|
args: {
|
|
417
422
|
...readOnly(GLOBAL_FLAGS),
|
|
418
|
-
postId: { type: "positional", description: "Post to list comments for: the `id` from search posts or a post read, a bare numeric activity id, a urn:li:activity|ugcPost|share:N URN, or a full LinkedIn post URL." }
|
|
423
|
+
postId: { type: "positional", description: "Post to list comments for: the `id` from `curviate core search posts` or a post read, a bare numeric activity id, a urn:li:activity|ugcPost|share:N URN, or a full LinkedIn post URL." }
|
|
419
424
|
},
|
|
420
425
|
async run({ args }) {
|
|
421
426
|
await withClient(args, runCommentList);
|
|
@@ -426,8 +431,8 @@ var commentRepliesCommand = defineCommand({
|
|
|
426
431
|
name: "replies",
|
|
427
432
|
description: "List the replies to a comment.",
|
|
428
433
|
examples: [
|
|
429
|
-
"curviate comment replies 7290000000000000000 COMMENT_ID",
|
|
430
|
-
"curviate comment replies 7290000000000000000 COMMENT_ID --all"
|
|
434
|
+
"curviate core comment replies 7290000000000000000 COMMENT_ID",
|
|
435
|
+
"curviate core comment replies 7290000000000000000 COMMENT_ID --all"
|
|
431
436
|
]
|
|
432
437
|
},
|
|
433
438
|
args: {
|
|
@@ -444,7 +449,7 @@ var commentReactionsCommand = defineCommand({
|
|
|
444
449
|
name: "reactions",
|
|
445
450
|
description: "List the reactions on a comment.",
|
|
446
451
|
examples: [
|
|
447
|
-
"curviate comment reactions 7290000000000000000 COMMENT_ID"
|
|
452
|
+
"curviate core comment reactions 7290000000000000000 COMMENT_ID"
|
|
448
453
|
]
|
|
449
454
|
},
|
|
450
455
|
args: {
|
|
@@ -461,8 +466,8 @@ var commentUserCommand = defineCommand({
|
|
|
461
466
|
name: "user",
|
|
462
467
|
description: "List the comments authored by a user (accepts 'me').",
|
|
463
468
|
examples: [
|
|
464
|
-
"curviate comment user me",
|
|
465
|
-
"curviate comment user janesmith --limit 10"
|
|
469
|
+
"curviate core comment user me",
|
|
470
|
+
"curviate core comment user janesmith --limit 10"
|
|
466
471
|
]
|
|
467
472
|
},
|
|
468
473
|
args: {
|
|
@@ -478,7 +483,7 @@ var commentAddCommand = defineCommand({
|
|
|
478
483
|
name: "add",
|
|
479
484
|
description: "Publish a comment on a post.",
|
|
480
485
|
examples: [
|
|
481
|
-
'curviate comment add 7290000000000000000 "Useful breakdown, thanks for sharing."'
|
|
486
|
+
'curviate core comment add 7290000000000000000 "Useful breakdown, thanks for sharing."'
|
|
482
487
|
]
|
|
483
488
|
},
|
|
484
489
|
args: {
|
|
@@ -496,7 +501,7 @@ var commentReplyCommand = defineCommand({
|
|
|
496
501
|
name: "reply",
|
|
497
502
|
description: "Reply to a comment.",
|
|
498
503
|
examples: [
|
|
499
|
-
'curviate comment reply 7290000000000000000 COMMENT_ID "Agreed, that matches what we saw."'
|
|
504
|
+
'curviate core comment reply 7290000000000000000 COMMENT_ID "Agreed, that matches what we saw."'
|
|
500
505
|
]
|
|
501
506
|
},
|
|
502
507
|
args: {
|
|
@@ -515,7 +520,7 @@ var commentEditCommand = defineCommand({
|
|
|
515
520
|
name: "edit",
|
|
516
521
|
description: "Edit your own comment.",
|
|
517
522
|
examples: [
|
|
518
|
-
'curviate comment edit 7290000000000000000 COMMENT_ID "Useful breakdown, thanks for writing it up."'
|
|
523
|
+
'curviate core comment edit 7290000000000000000 COMMENT_ID "Useful breakdown, thanks for writing it up."'
|
|
519
524
|
]
|
|
520
525
|
},
|
|
521
526
|
args: {
|
|
@@ -533,7 +538,7 @@ var commentDeleteCommand = defineCommand({
|
|
|
533
538
|
name: "delete",
|
|
534
539
|
description: "Delete your own comment.",
|
|
535
540
|
examples: [
|
|
536
|
-
"curviate comment delete 7290000000000000000 COMMENT_ID"
|
|
541
|
+
"curviate core comment delete 7290000000000000000 COMMENT_ID"
|
|
537
542
|
]
|
|
538
543
|
},
|
|
539
544
|
args: {
|
|
@@ -550,7 +555,7 @@ var commentReactCommand = defineCommand({
|
|
|
550
555
|
name: "react",
|
|
551
556
|
description: "React to a comment (like|celebrate|support|love|insightful|funny).",
|
|
552
557
|
examples: [
|
|
553
|
-
"curviate comment react 7290000000000000000 COMMENT_ID insightful"
|
|
558
|
+
"curviate core comment react 7290000000000000000 COMMENT_ID insightful"
|
|
554
559
|
]
|
|
555
560
|
},
|
|
556
561
|
args: {
|
|
@@ -568,7 +573,7 @@ var commentUnreactCommand = defineCommand({
|
|
|
568
573
|
name: "unreact",
|
|
569
574
|
description: "Remove your reaction from a comment.",
|
|
570
575
|
examples: [
|
|
571
|
-
"curviate comment unreact 7290000000000000000 COMMENT_ID insightful"
|
|
576
|
+
"curviate core comment unreact 7290000000000000000 COMMENT_ID insightful"
|
|
572
577
|
]
|
|
573
578
|
},
|
|
574
579
|
args: {
|
|
@@ -582,7 +587,7 @@ var commentUnreactCommand = defineCommand({
|
|
|
582
587
|
}
|
|
583
588
|
});
|
|
584
589
|
var commentCommand = defineCommand({
|
|
585
|
-
meta: { name: "comment", description:
|
|
590
|
+
meta: { name: "comment", description: DESCRIPTIONS.comment },
|
|
586
591
|
args: { ...GLOBAL_FLAGS },
|
|
587
592
|
subCommands: {
|
|
588
593
|
list: commentListCommand,
|
|
@@ -598,7 +603,7 @@ var commentCommand = defineCommand({
|
|
|
598
603
|
},
|
|
599
604
|
async run() {
|
|
600
605
|
process.stderr.write(
|
|
601
|
-
"Usage: curviate comment list <post_id>\n curviate comment add <post_id> <text> [--attach <file>]\n curviate comment reply <post_id> <comment_id> <text>\n curviate comment edit <post_id> <comment_id> <text>\n curviate comment delete <post_id> <comment_id>\n curviate comment replies <post_id> <comment_id>\n curviate comment react <post_id> <comment_id> <reaction>\n curviate comment reactions <post_id> <comment_id>\n curviate comment unreact <post_id> <comment_id> <reaction>\n curviate comment user <user_id>\n"
|
|
606
|
+
"Usage: curviate core comment list <post_id>\n curviate core comment add <post_id> <text> [--attach <file>]\n curviate core comment reply <post_id> <comment_id> <text>\n curviate core comment edit <post_id> <comment_id> <text>\n curviate core comment delete <post_id> <comment_id>\n curviate core comment replies <post_id> <comment_id>\n curviate core comment react <post_id> <comment_id> <reaction>\n curviate core comment reactions <post_id> <comment_id>\n curviate core comment unreact <post_id> <comment_id> <reaction>\n curviate core comment user <user_id>\n"
|
|
602
607
|
);
|
|
603
608
|
}
|
|
604
609
|
});
|