@curviate/cli 0.47.0 → 0.48.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 +174 -1
- package/README.md +101 -87
- package/dist/{account-RFJ63QYL.js → account-WKQHMM7P.js} +39 -29
- package/dist/chunk-AYKKXGTR.js +1141 -0
- package/dist/{chunk-TC4ZPUWI.js → chunk-CVMSQ3OF.js} +19 -80
- package/dist/{chunk-HOQ7EUHJ.js → chunk-FDJMAF7D.js} +1 -0
- package/dist/chunk-GQKC6E5K.js +36 -0
- package/dist/{chunk-V3MVOVQT.js → chunk-MKGVNDMJ.js} +8 -1
- package/dist/chunk-NNV2OYEF.js +23 -0
- package/dist/{chunk-UJOTQPL6.js → chunk-OHXYFICP.js} +47 -14
- package/dist/{chunk-PD2I5TYC.js → chunk-Q63IIPL2.js} +2 -2
- package/dist/chunk-TSOIZBBU.js +41 -0
- package/dist/{chunk-ERBYEC5P.js → chunk-Y7K4UBFC.js} +1 -1
- package/dist/{chunk-FXYK2GTO.js → chunk-YFXLXION.js} +37 -32
- package/dist/chunk-ZYURL5VK.js +83 -0
- package/dist/cli.js +76 -97
- package/dist/{comment-MCXE7B7V.js → comment-7IQ6ZOJF.js} +27 -22
- package/dist/{company-EUUN372H.js → company-RD7RDGSA.js} +55 -50
- package/dist/{config-K4G3VSBA.js → config-EYBNYRGK.js} +13 -5
- package/dist/{connect-2AL7XVJO.js → connect-HVXT67A6.js} +35 -31
- package/dist/core-6XYGUNAY.js +46 -0
- package/dist/{doctor-WPYI7X2T.js → doctor-HUXQERLQ.js} +8 -4
- package/dist/document-AUUCGST2.js +27 -0
- package/dist/{draft-G65DVXT7.js → draft-DFO22K6Q.js} +26 -21
- package/dist/examples-64YT5V5K.js +53 -0
- package/dist/{feed-HV24WME4.js → feed-JWP6ANPI.js} +13 -9
- package/dist/{group-HADXNVJW.js → group-SIQFJEZV.js} +15 -11
- package/dist/{inbox-G3EE54OB.js → inbox-MMIMCA5O.js} +21 -17
- package/dist/{inboxes-237XOBTP.js → inboxes-RND3D4C7.js} +16 -12
- package/dist/{job-LIN6RWD7.js → job-ACFKBLFK.js} +29 -25
- package/dist/{login-OHAHNBRW.js → login-ZOB5KVKQ.js} +10 -5
- package/dist/{message-U2O2JQSW.js → message-OFK6UVXR.js} +9 -7
- package/dist/{notification-3VG32LWM.js → notification-KKGAZU7M.js} +17 -13
- package/dist/{post-ECDK2KJL.js → post-A5SBCFB2.js} +33 -28
- package/dist/{profile-JOHS6SDW.js → profile-4SOOQZ4K.js} +45 -41
- package/dist/{recruiter-7VXEIXN3.js → recruiter-YN73STDP.js} +123 -120
- package/dist/{sales-nav-K4BMBH7R.js → sales-nav-JXF5RY2K.js} +38 -32
- package/dist/{search-C2UYO6PI.js → search-JAL242A2.js} +58 -48
- package/dist/{setup-GYEZFDEN.js → setup-WICWH4JG.js} +13 -8
- package/dist/{webhook-KCOQOH7D.js → webhook-UGKVYWBC.js} +34 -36
- package/package.json +1 -1
- 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-CVMSQ3OF.js";
|
|
15
|
+
import {
|
|
16
|
+
lazy
|
|
17
|
+
} from "./chunk-GQKC6E5K.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,29 @@ 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
|
-
connect: () => import("./connect-2AL7XVJO.js").then((m) => m.connectCommand),
|
|
41
|
-
search: () => import("./search-C2UYO6PI.js").then((m) => m.searchCommand),
|
|
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-WICWH4JG.js").then((m) => m.setupCommand)),
|
|
48
|
+
doctor: lazy("doctor", () => import("./doctor-HUXQERLQ.js").then((m) => m.doctorCommand)),
|
|
49
|
+
login: lazy("login", () => import("./login-ZOB5KVKQ.js").then((m) => m.loginCommand)),
|
|
50
|
+
config: lazy("config", () => import("./config-EYBNYRGK.js").then((m) => m.configCommand)),
|
|
51
|
+
account: lazy("account", () => import("./account-WKQHMM7P.js").then((m) => m.accountCommand)),
|
|
52
|
+
webhook: lazy("webhook", () => import("./webhook-UGKVYWBC.js").then((m) => m.webhookCommand)),
|
|
53
|
+
// The LinkedIn building blocks. Reserved product groups
|
|
54
|
+
// (motion, contact, unibox, network, analytics, notification, team) land
|
|
55
|
+
// between `account` and `webhook` with their owning specs.
|
|
56
|
+
core: lazy("core", () => import("./core-6XYGUNAY.js").then((m) => m.coreCommand))
|
|
55
57
|
},
|
|
56
58
|
async run() {
|
|
57
|
-
const {
|
|
58
|
-
await
|
|
59
|
+
const { showHelp } = await import("./examples-64YT5V5K.js");
|
|
60
|
+
await showHelp(main, ["curviate"]);
|
|
59
61
|
}
|
|
60
62
|
});
|
|
61
63
|
|
|
@@ -93,46 +95,9 @@ function shownFlag(flag, index) {
|
|
|
93
95
|
const runsOn = !SECRET_FLAGS.includes(name) && SECRET_FLAGS.some((secret) => name.startsWith(secret));
|
|
94
96
|
return runsOn ? `at ${argumentAt(index)}` : `\`${flag}\``;
|
|
95
97
|
}
|
|
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
|
-
}
|
|
98
|
+
var REFUSED_TOKENS = {
|
|
99
|
+
"curviate core connect": /* @__PURE__ */ new Set(["respond"])
|
|
130
100
|
};
|
|
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
101
|
async function resolveValue(input) {
|
|
137
102
|
return typeof input === "function" ? input() : input;
|
|
138
103
|
}
|
|
@@ -250,10 +215,8 @@ async function assertLeafConsumesPositionals(leaf, leafArgs, path, siblings) {
|
|
|
250
215
|
const form = renderPath(path);
|
|
251
216
|
const arity = arityPhrase(await nodePositionalCount(leaf));
|
|
252
217
|
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
|
-
);
|
|
218
|
+
helpFor = form;
|
|
219
|
+
usageError(`unexpected ${shown} after \`${form}\`. \`${form}\` takes ${arity}.`, hint);
|
|
257
220
|
}
|
|
258
221
|
async function declaredArgNames(cmd) {
|
|
259
222
|
const names = /* @__PURE__ */ new Set();
|
|
@@ -274,17 +237,22 @@ function dropFalsePreview(args, walk, declared) {
|
|
|
274
237
|
);
|
|
275
238
|
return drop.size ? args.filter((_, i) => !drop.has(i)) : args;
|
|
276
239
|
}
|
|
277
|
-
function findUnknownFlag(flags, declared, booleans) {
|
|
240
|
+
function findUnknownFlag(flags, declared, booleans, flagNames) {
|
|
278
241
|
for (const { token, name, index } of flags) {
|
|
279
242
|
const dashes = /^-*/.exec(token)[0].length;
|
|
280
243
|
if (dashes === 2 || dashes === 1 && name.length === 1) {
|
|
281
244
|
if (declared.has(name)) continue;
|
|
282
245
|
if (name.startsWith("no-") && booleans.has(name.slice(3))) continue;
|
|
283
246
|
}
|
|
284
|
-
|
|
247
|
+
const shown = shownFlag(token.split("=")[0], index);
|
|
248
|
+
return { shown, hint: shown.startsWith("`") ? nearestFlag(name.split("=")[0], flagNames) : null };
|
|
285
249
|
}
|
|
286
250
|
return null;
|
|
287
251
|
}
|
|
252
|
+
function nearestFlag(name, declared) {
|
|
253
|
+
const near = [...declared].filter((d) => d.length > 1 && editDistance(name, d) <= 2);
|
|
254
|
+
return near.length === 1 ? near[0] : null;
|
|
255
|
+
}
|
|
288
256
|
function hasEmptyFields(rawArgs) {
|
|
289
257
|
for (let i = 0; i < rawArgs.length; i++) {
|
|
290
258
|
const arg = rawArgs[i];
|
|
@@ -319,9 +287,12 @@ function usageError(message, hint) {
|
|
|
319
287
|
`);
|
|
320
288
|
if (hint) process.stderr.write(`hint: ${hint}
|
|
321
289
|
`);
|
|
322
|
-
process.stderr.write(
|
|
290
|
+
process.stderr.write(helpPointer());
|
|
323
291
|
process.exit(2);
|
|
324
292
|
}
|
|
293
|
+
var helpFor = "curviate";
|
|
294
|
+
var helpPointer = () => `Run \`${helpFor} --help\` for usage.
|
|
295
|
+
`;
|
|
325
296
|
async function resolveLeaf(cmd, rawArgs, descent) {
|
|
326
297
|
const here = descent ?? { path: [await nodeName(cmd)] };
|
|
327
298
|
const subCommands = await resolveValue(cmd.subCommands);
|
|
@@ -340,11 +311,8 @@ async function resolveLeaf(cmd, rawArgs, descent) {
|
|
|
340
311
|
siblings: subCommands
|
|
341
312
|
});
|
|
342
313
|
}
|
|
343
|
-
if (token !== void 0) {
|
|
344
|
-
|
|
345
|
-
if (hint) {
|
|
346
|
-
usageError(`unknown command at ${argumentAt(idx)}`, hint);
|
|
347
|
-
}
|
|
314
|
+
if (token !== void 0 && REFUSED_TOKENS[renderPath(here.path)]?.has(token)) {
|
|
315
|
+
usageError(`unknown command at ${argumentAt(idx)}`);
|
|
348
316
|
}
|
|
349
317
|
if (token !== void 0 && hasBarePositional) {
|
|
350
318
|
const extras = await extraPositionals(cmd, rawArgs);
|
|
@@ -358,27 +326,30 @@ async function resolveLeaf(cmd, rawArgs, descent) {
|
|
|
358
326
|
siblings: subCommands
|
|
359
327
|
});
|
|
360
328
|
}
|
|
361
|
-
const
|
|
329
|
+
const form = renderPath(here.path);
|
|
330
|
+
helpFor = form;
|
|
362
331
|
usageError(
|
|
363
|
-
`unexpected ${argumentAt(first.index)} after \`${
|
|
332
|
+
`unexpected ${argumentAt(first.index)} after \`${form}\`. It is neither a positional \`${form}\` accepts nor one of its subcommands.`
|
|
364
333
|
);
|
|
365
334
|
}
|
|
366
|
-
return { leaf: cmd, leafArgs: rawArgs };
|
|
335
|
+
return { leaf: cmd, leafArgs: rawArgs, path: here.path };
|
|
367
336
|
}
|
|
368
337
|
if (token !== void 0) {
|
|
369
338
|
usageError(`unknown command at ${argumentAt(idx)}`);
|
|
370
339
|
}
|
|
371
|
-
return { leaf: cmd, leafArgs: rawArgs };
|
|
340
|
+
return { leaf: cmd, leafArgs: rawArgs, path: here.path };
|
|
372
341
|
}
|
|
373
342
|
await assertLeafConsumesPositionals(cmd, rawArgs, here.path, here.siblings);
|
|
374
|
-
return { leaf: cmd, leafArgs: rawArgs };
|
|
343
|
+
return { leaf: cmd, leafArgs: rawArgs, path: here.path };
|
|
375
344
|
}
|
|
376
345
|
async function dispatch(root, rawArgs) {
|
|
346
|
+
helpFor = "curviate";
|
|
377
347
|
if (rawArgs.includes("--help") || rawArgs.includes("-h")) {
|
|
378
|
-
const {
|
|
379
|
-
const {
|
|
380
|
-
await
|
|
381
|
-
|
|
348
|
+
const { leaf, path } = await resolveLeaf(root, rawArgs.filter((a) => a !== "--help" && a !== "-h"));
|
|
349
|
+
const { showHelp } = await import("./examples-64YT5V5K.js");
|
|
350
|
+
await showHelp(leaf, path);
|
|
351
|
+
await new Promise((done) => process.stdout.write("", () => done()));
|
|
352
|
+
process.exit(0);
|
|
382
353
|
}
|
|
383
354
|
const versionProbe = parseBetaFlag(rawArgs);
|
|
384
355
|
const versionArgs = versionProbe.ok ? versionProbe.rest : rawArgs;
|
|
@@ -397,20 +368,25 @@ async function dispatch(root, rawArgs) {
|
|
|
397
368
|
const argsAfterBeta = beta.ok ? beta.rest : rawArgs;
|
|
398
369
|
let hintLeaf;
|
|
399
370
|
try {
|
|
400
|
-
const { leaf, leafArgs: resolvedArgs } = await resolveLeaf(root, argsAfterBeta);
|
|
371
|
+
const { leaf, leafArgs: resolvedArgs, path: leafPath } = await resolveLeaf(root, argsAfterBeta);
|
|
401
372
|
hintLeaf = leaf;
|
|
373
|
+
helpFor = renderPath(leafPath);
|
|
402
374
|
if (hasEmptyFields(resolvedArgs)) {
|
|
403
375
|
usageError("--fields must not be empty.");
|
|
404
376
|
}
|
|
405
377
|
const booleanFlags = await booleanFlagNames(leaf);
|
|
406
378
|
const declared = await declaredArgNames(leaf);
|
|
379
|
+
const stateRecheck = STATE_WRITES[renderPath(leafPath)];
|
|
380
|
+
setWriteKind(stateRecheck ? "state" : declared.has("preview") ? "write" : "read", stateRecheck, renderPath(leafPath));
|
|
407
381
|
const leafArgs = dropFalsePreview(resolvedArgs, walkTokens(resolvedArgs, booleanFlags, declared), declared);
|
|
408
382
|
const walk = walkTokens(leafArgs, booleanFlags, declared);
|
|
409
|
-
const
|
|
383
|
+
const flagOnly = new Set(Object.entries(await resolveValue(leaf.args ?? {})).filter(([, d]) => d?.type !== "positional").map(([n]) => n));
|
|
384
|
+
const unknown = findUnknownFlag(walk.flags, declared, booleanFlags, flagOnly);
|
|
410
385
|
if (unknown !== null) {
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
386
|
+
if (unknown.shown === "`--preview`" && declared.has("beta")) {
|
|
387
|
+
usageError("--preview is only valid on write commands (mutations). Reads just run.");
|
|
388
|
+
}
|
|
389
|
+
usageError(`unknown flag ${unknown.shown}.`, unknown.hint ? `did you mean --${unknown.hint}?` : void 0);
|
|
414
390
|
}
|
|
415
391
|
const repeated = await repeatedFlag(leaf, walk.flags);
|
|
416
392
|
if (repeated !== null) {
|
|
@@ -429,6 +405,8 @@ async function dispatch(root, rawArgs) {
|
|
|
429
405
|
ctx.args,
|
|
430
406
|
leafArgsDef
|
|
431
407
|
);
|
|
408
|
+
const limit = ctx.args["limit"];
|
|
409
|
+
if (typeof limit === "string") intFlag("limit", limit);
|
|
432
410
|
return originalRun(ctx);
|
|
433
411
|
}
|
|
434
412
|
} : {}
|
|
@@ -446,6 +424,7 @@ async function dispatch(root, rawArgs) {
|
|
|
446
424
|
if (hint) process.stderr.write(`hint: --${missing}: ${hint}
|
|
447
425
|
`);
|
|
448
426
|
}
|
|
427
|
+
if (code === "EARG") process.stderr.write(helpPointer());
|
|
449
428
|
const { CurviateError } = await import("@curviate/sdk");
|
|
450
429
|
if (err instanceof CurviateError) {
|
|
451
430
|
const { getExitCode } = await import("./exit-codes-AW6KHDDN.js");
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import {
|
|
3
3
|
resolveMemberOrMeProviderId
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-Y7K4UBFC.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-Q63IIPL2.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-
|
|
30
|
+
} from "./chunk-MKGVNDMJ.js";
|
|
31
31
|
import "./chunk-76SWLAZ6.js";
|
|
32
32
|
import {
|
|
33
33
|
createClient
|
|
34
|
-
} from "./chunk-
|
|
34
|
+
} from "./chunk-OHXYFICP.js";
|
|
35
35
|
import {
|
|
36
36
|
GLOBAL_FLAGS,
|
|
37
37
|
WRITE_SINGLE_FLAGS,
|
|
38
|
-
readOnly
|
|
38
|
+
readOnly
|
|
39
|
+
} from "./chunk-CVMSQ3OF.js";
|
|
40
|
+
import {
|
|
41
|
+
DESCRIPTIONS
|
|
42
|
+
} from "./chunk-GQKC6E5K.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";
|
|
@@ -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
|
});
|