@curviate/cli 0.32.0 → 0.33.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 +215 -1
- package/README.md +2 -0
- package/dist/{account-JDSZC633.js → account-IPAW6YRD.js} +89 -46
- package/dist/{chunk-V3PB4HSF.js → chunk-27E2M2PS.js} +9 -6
- package/dist/chunk-4EH6EWFW.js +327 -0
- package/dist/{chunk-SKJNLN37.js → chunk-4GXO42ZH.js} +85 -1
- package/dist/{chunk-KQXYEQAD.js → chunk-4IPHFPLO.js} +172 -8
- package/dist/{chunk-5EJDQ47B.js → chunk-5SHLELR7.js} +16 -16
- package/dist/{chunk-JRKM4OV2.js → chunk-REO2BCEX.js} +1 -1
- package/dist/{chunk-6P52Q2GK.js → chunk-REVD4GXL.js} +5 -4
- package/dist/chunk-TCUYH5GO.js +34 -0
- package/dist/{chunk-EIEF2KFH.js → chunk-YCLU5VSN.js} +4 -2
- package/dist/cli.js +104 -37
- package/dist/{comment-YOFNFQUE.js → comment-F2O4UOSD.js} +32 -26
- package/dist/{company-6PKHDK6L.js → company-ANZGO2HT.js} +52 -34
- package/dist/{config-FUHT23SX.js → config-ZD3Y5MWP.js} +74 -29
- package/dist/{connect-DG2AVGVL.js → connect-HYJCGYFO.js} +34 -31
- package/dist/{doctor-FK7B6754.js → doctor-VPGGB5CW.js} +22 -16
- package/dist/{exit-codes-AAFTOAXF.js → exit-codes-ZFWQJYOY.js} +1 -1
- package/dist/{feed-HXBKXKAQ.js → feed-IZZYSYYI.js} +18 -17
- package/dist/{group-UYX3KTX3.js → group-ETDDF2PJ.js} +21 -18
- package/dist/{inbox-EVE2ZTHC.js → inbox-XQQ4YRRO.js} +27 -22
- package/dist/{inboxes-JBB34WMQ.js → inboxes-6KHXXEBC.js} +18 -17
- package/dist/{job-GXUZANYN.js → job-PBTJ5DWL.js} +43 -29
- package/dist/{login-3OAUY7TG.js → login-HP5URYD6.js} +15 -3
- package/dist/{message-34AGROW2.js → message-DQQPMRFU.js} +7 -9
- package/dist/{notification-SKKZS2C5.js → notification-CXIRJB57.js} +20 -19
- package/dist/{post-FIW522Q6.js → post-2S7FYMZO.js} +33 -25
- package/dist/{profile-SX6JOYMD.js → profile-UCERD6RR.js} +61 -43
- package/dist/{recruiter-H7ROBEVC.js → recruiter-PJFUM2ZZ.js} +41 -28
- package/dist/{sales-nav-7KCK562X.js → sales-nav-7XNJGVIX.js} +43 -29
- package/dist/{search-PASMDQEH.js → search-DYGIIODT.js} +57 -43
- package/dist/{setup-YV5PVIU5.js → setup-BRULZH53.js} +12 -8
- package/dist/{webhook-GPLFPC6N.js → webhook-2TKWOXYK.js} +25 -22
- package/package.json +2 -2
- package/dist/chunk-LKF5MZIP.js +0 -90
- package/dist/chunk-PKSKQ3LN.js +0 -68
- package/dist/chunk-R3VLWLVV.js +0 -23
- package/dist/chunk-TD2ZIXFR.js +0 -67
- package/dist/chunk-TQJ77SL4.js +0 -147
|
@@ -16,26 +16,28 @@ import {
|
|
|
16
16
|
normalizeChatId,
|
|
17
17
|
resolveIdentifier
|
|
18
18
|
} from "./chunk-UEAX6KUB.js";
|
|
19
|
-
import {
|
|
20
|
-
buildPreviewOutput
|
|
21
|
-
} from "./chunk-R3VLWLVV.js";
|
|
22
19
|
import {
|
|
23
20
|
requireAccount
|
|
24
|
-
} from "./chunk-
|
|
21
|
+
} from "./chunk-27E2M2PS.js";
|
|
22
|
+
import {
|
|
23
|
+
buildPreviewOutput
|
|
24
|
+
} from "./chunk-TCUYH5GO.js";
|
|
25
25
|
import {
|
|
26
|
+
readableId,
|
|
26
27
|
renderError,
|
|
27
28
|
renderSuccess,
|
|
28
|
-
renderUnexpectedError
|
|
29
|
-
|
|
29
|
+
renderUnexpectedError,
|
|
30
|
+
resolveEffectiveConfig
|
|
31
|
+
} from "./chunk-4IPHFPLO.js";
|
|
30
32
|
import {
|
|
31
33
|
createClient,
|
|
32
|
-
|
|
33
|
-
} from "./chunk-
|
|
34
|
+
downloadBinary
|
|
35
|
+
} from "./chunk-4EH6EWFW.js";
|
|
34
36
|
import {
|
|
35
37
|
READ_SINGLE_FLAGS,
|
|
36
38
|
WRITE_FLAGS,
|
|
37
39
|
resolveTextOrStdin
|
|
38
|
-
} from "./chunk-
|
|
40
|
+
} from "./chunk-4GXO42ZH.js";
|
|
39
41
|
|
|
40
42
|
// src/commands/message.ts
|
|
41
43
|
import { defineCommand } from "citty";
|
|
@@ -73,9 +75,9 @@ var MEMBER_PROVIDER_ID_RE = /^A[CDE][A-Za-z0-9_-]{4,}$/;
|
|
|
73
75
|
async function handleSdkError(err, outOpts, out) {
|
|
74
76
|
const { CurviateError } = await import("@curviate/sdk");
|
|
75
77
|
if (err instanceof CurviateError) {
|
|
76
|
-
const { getExitCode } = await import("./exit-codes-
|
|
78
|
+
const { getExitCode } = await import("./exit-codes-ZFWQJYOY.js");
|
|
77
79
|
renderError(err, outOpts, out);
|
|
78
|
-
process.exit(getExitCode(err
|
|
80
|
+
process.exit(getExitCode(err));
|
|
79
81
|
}
|
|
80
82
|
renderUnexpectedError(err, out);
|
|
81
83
|
process.exit(1);
|
|
@@ -115,8 +117,7 @@ async function runMessageNew(client, flags, out, _readStdin) {
|
|
|
115
117
|
providerId = resolvedSlugOrId;
|
|
116
118
|
} else {
|
|
117
119
|
try {
|
|
118
|
-
|
|
119
|
-
providerId = profileData.id;
|
|
120
|
+
providerId = readableId(await ns.users.get(resolvedSlugOrId, {}));
|
|
120
121
|
} catch (err) {
|
|
121
122
|
await handleSdkError(err, outOpts, out);
|
|
122
123
|
return;
|
|
@@ -298,7 +299,7 @@ async function runMessageAttachment(client, flags, out, isTTY) {
|
|
|
298
299
|
const attachmentId = flags.attachmentId ?? "";
|
|
299
300
|
const ns = client.account(accountId);
|
|
300
301
|
try {
|
|
301
|
-
const data = await ns.messaging.getAttachment(chatId, messageId, attachmentId);
|
|
302
|
+
const data = await downloadBinary(() => ns.messaging.getAttachment(chatId, messageId, attachmentId));
|
|
302
303
|
await writeBinaryOutput(data, {
|
|
303
304
|
outputPath: flags.output,
|
|
304
305
|
isTTY,
|
|
@@ -334,8 +335,7 @@ async function runMessageInMail(client, flags, out, _readStdin) {
|
|
|
334
335
|
recipientUrn = resolvedSlugOrId;
|
|
335
336
|
} else {
|
|
336
337
|
try {
|
|
337
|
-
|
|
338
|
-
recipientUrn = profileData.id;
|
|
338
|
+
recipientUrn = readableId(await ns.users.get(resolvedSlugOrId, {}));
|
|
339
339
|
} catch (err) {
|
|
340
340
|
await handleSdkError(err, outOpts, out);
|
|
341
341
|
return;
|
|
@@ -2,20 +2,21 @@
|
|
|
2
2
|
import {
|
|
3
3
|
resolveIdentifier
|
|
4
4
|
} from "./chunk-UEAX6KUB.js";
|
|
5
|
+
import {
|
|
6
|
+
readableId
|
|
7
|
+
} from "./chunk-4IPHFPLO.js";
|
|
5
8
|
|
|
6
9
|
// src/lib/member-id.ts
|
|
7
10
|
var MEMBER_PROVIDER_ID_RE = /^A[CDE][A-Za-z0-9_-]{4,}$/;
|
|
8
11
|
async function resolveMemberProviderId(ns, raw) {
|
|
9
12
|
const normalized = resolveIdentifier(raw);
|
|
10
13
|
if (MEMBER_PROVIDER_ID_RE.test(normalized)) return normalized;
|
|
11
|
-
|
|
12
|
-
return profile.id;
|
|
14
|
+
return readableId(await ns.users.get(normalized, {}));
|
|
13
15
|
}
|
|
14
16
|
async function resolveMemberOrMeProviderId(ns, raw, query = {}) {
|
|
15
17
|
const normalized = resolveIdentifier(raw);
|
|
16
18
|
if (normalized === "me" || MEMBER_PROVIDER_ID_RE.test(normalized)) return normalized;
|
|
17
|
-
|
|
18
|
-
return profile.id;
|
|
19
|
+
return readableId(await ns.users.get(normalized, query));
|
|
19
20
|
}
|
|
20
21
|
|
|
21
22
|
export {
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
// src/lib/preview.ts
|
|
4
|
+
var SECRET_FLAGS = ["api-key", "password", "proxy-password", "li-at", "li-a", "code", "secret"];
|
|
5
|
+
var SECRET_KEYS = new Set(SECRET_FLAGS.map((flag) => flag.replace(/-/g, "_")));
|
|
6
|
+
var SECRET_MASK = "\u2022\u2022\u2022\u2022";
|
|
7
|
+
function maskSecrets(value) {
|
|
8
|
+
if (Array.isArray(value)) return value.map(maskSecrets);
|
|
9
|
+
if (typeof value !== "object" || value === null || Buffer.isBuffer(value)) return value;
|
|
10
|
+
return Object.fromEntries(
|
|
11
|
+
Object.entries(value).map(([key, v]) => [key, SECRET_KEYS.has(key) && v !== void 0 && v !== null ? SECRET_MASK : maskSecrets(v)])
|
|
12
|
+
);
|
|
13
|
+
}
|
|
14
|
+
function buildPreviewOutput(req) {
|
|
15
|
+
const result = {
|
|
16
|
+
method: req.method,
|
|
17
|
+
args: maskSecrets(req.args),
|
|
18
|
+
body: maskSecrets(req.body)
|
|
19
|
+
};
|
|
20
|
+
if (req.account !== void 0) {
|
|
21
|
+
result.account = req.account;
|
|
22
|
+
}
|
|
23
|
+
if (req.attachments && req.attachments.length > 0) {
|
|
24
|
+
result.attachments = req.attachments.map(
|
|
25
|
+
(a) => `${a.name} (${a.buffer.byteLength} bytes)`
|
|
26
|
+
);
|
|
27
|
+
}
|
|
28
|
+
return result;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
export {
|
|
32
|
+
SECRET_FLAGS,
|
|
33
|
+
buildPreviewOutput
|
|
34
|
+
};
|
|
@@ -134,8 +134,10 @@ var EXIT_CODE_MAP = {
|
|
|
134
134
|
// and here it is not. The `--json` envelope still names the real code.
|
|
135
135
|
STRIPE_DRIFT_DETECTED: 1
|
|
136
136
|
};
|
|
137
|
-
function getExitCode(
|
|
138
|
-
return EXIT_CODE_MAP[
|
|
137
|
+
function getExitCode(error) {
|
|
138
|
+
if (typeof error === "string") return EXIT_CODE_MAP[error] ?? 1;
|
|
139
|
+
if (error.code === "INTERNAL" && error.httpStatus === void 0 && error.retryLikelyToSucceed === true) return 7;
|
|
140
|
+
return EXIT_CODE_MAP[error.code] ?? 1;
|
|
139
141
|
}
|
|
140
142
|
var AUTH_NEEDED = 12;
|
|
141
143
|
|
package/dist/cli.js
CHANGED
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
} from "./chunk-PKSKQ3LN.js";
|
|
3
|
+
SECRET_FLAGS
|
|
4
|
+
} from "./chunk-TCUYH5GO.js";
|
|
6
5
|
import {
|
|
7
6
|
GLOBAL_FLAGS,
|
|
8
7
|
STDIN_SENTINEL,
|
|
9
|
-
|
|
10
|
-
|
|
8
|
+
parseBetaFlag,
|
|
9
|
+
restoreLiteralDashes,
|
|
10
|
+
setBetaOverride
|
|
11
|
+
} from "./chunk-4GXO42ZH.js";
|
|
11
12
|
|
|
12
13
|
// src/cli.ts
|
|
13
14
|
import { defineCommand } from "citty";
|
|
@@ -19,6 +20,34 @@ var GLOBAL_FLAG_NAMES = new Set(Object.keys(GLOBAL_FLAGS));
|
|
|
19
20
|
var GLOBAL_BOOLEAN_FLAG_NAMES = new Set(
|
|
20
21
|
Object.entries(GLOBAL_FLAGS).filter(([, def]) => def.type === "boolean").map(([name]) => name)
|
|
21
22
|
);
|
|
23
|
+
var saysRepeatable = (def) => /\brepeatable\b/i.test(def?.description ?? "");
|
|
24
|
+
async function repeatedFlag(leaf, flags) {
|
|
25
|
+
const defs = await resolveValue(leaf.args ?? {});
|
|
26
|
+
const canonical = /* @__PURE__ */ new Map();
|
|
27
|
+
for (const [name, def] of Object.entries(defs)) {
|
|
28
|
+
if (def?.type === "boolean" && !(`no-${name}` in defs)) canonical.set(`no-${name}`, name);
|
|
29
|
+
}
|
|
30
|
+
for (const [name, def] of Object.entries(defs)) {
|
|
31
|
+
canonical.set(name, name);
|
|
32
|
+
for (const a of [].concat(def?.alias ?? [])) canonical.set(a, name);
|
|
33
|
+
}
|
|
34
|
+
const seen = /* @__PURE__ */ new Set();
|
|
35
|
+
for (const { name } of flags) {
|
|
36
|
+
const flag = canonical.get(name);
|
|
37
|
+
if (flag === void 0 || saysRepeatable(defs[flag])) continue;
|
|
38
|
+
if (seen.has(flag)) return flag;
|
|
39
|
+
seen.add(flag);
|
|
40
|
+
}
|
|
41
|
+
return null;
|
|
42
|
+
}
|
|
43
|
+
function argumentAt(index) {
|
|
44
|
+
return `argument ${index + 1}`;
|
|
45
|
+
}
|
|
46
|
+
function shownFlag(flag, index) {
|
|
47
|
+
const name = flag.replace(/^-+/, "");
|
|
48
|
+
const runsOn = !SECRET_FLAGS.includes(name) && SECRET_FLAGS.some((secret) => name.startsWith(secret));
|
|
49
|
+
return runsOn ? `at ${argumentAt(index)}` : `\`${flag}\``;
|
|
50
|
+
}
|
|
22
51
|
var REMOVED_COMMANDS = {
|
|
23
52
|
post: {
|
|
24
53
|
list: "`post list` was removed. Use `post user-posts <user_id>` (accepts `me`).",
|
|
@@ -172,11 +201,12 @@ async function assertLeafConsumesPositionals(leaf, leafArgs, path, siblings) {
|
|
|
172
201
|
const extras = await extraPositionals(leaf, leafArgs);
|
|
173
202
|
if (extras.length === 0) return;
|
|
174
203
|
const token = extras[0].token;
|
|
204
|
+
const shown = argumentAt(extras[0].index);
|
|
175
205
|
const form = renderPath(path);
|
|
176
206
|
const arity = arityPhrase(await nodePositionalCount(leaf));
|
|
177
207
|
const hint = siblings && Object.prototype.hasOwnProperty.call(siblings, token) ? `Did you mean \`${renderPath([...path.slice(0, -1), token])}\`?` : void 0;
|
|
178
208
|
usageError(
|
|
179
|
-
`unexpected
|
|
209
|
+
`unexpected ${shown} after \`${form}\`. \`${form}\` takes ${arity}. Run \`${form} --help\` for its usage.`,
|
|
180
210
|
hint
|
|
181
211
|
);
|
|
182
212
|
}
|
|
@@ -191,11 +221,14 @@ async function declaredArgNames(cmd) {
|
|
|
191
221
|
}
|
|
192
222
|
return names;
|
|
193
223
|
}
|
|
194
|
-
function findUnknownFlag(flags, declared) {
|
|
195
|
-
for (const { token, name } of flags) {
|
|
196
|
-
|
|
197
|
-
if (
|
|
198
|
-
|
|
224
|
+
function findUnknownFlag(flags, declared, booleans) {
|
|
225
|
+
for (const { token, name, index } of flags) {
|
|
226
|
+
const dashes = /^-*/.exec(token)[0].length;
|
|
227
|
+
if (dashes === 2 || dashes === 1 && name.length === 1) {
|
|
228
|
+
if (declared.has(name)) continue;
|
|
229
|
+
if (name.startsWith("no-") && booleans.has(name.slice(3))) continue;
|
|
230
|
+
}
|
|
231
|
+
return shownFlag(token.split("=")[0], index);
|
|
199
232
|
}
|
|
200
233
|
return null;
|
|
201
234
|
}
|
|
@@ -212,6 +245,22 @@ function hasEmptyFields(rawArgs) {
|
|
|
212
245
|
}
|
|
213
246
|
return false;
|
|
214
247
|
}
|
|
248
|
+
var HINT_ABBREVIATIONS = /(?:^|[\s(])(?:e\.g|i\.e|incl|etc|vs)$/i;
|
|
249
|
+
function firstSentenceHint(description) {
|
|
250
|
+
if (!description) return "";
|
|
251
|
+
let depth = 0;
|
|
252
|
+
let end = description.length;
|
|
253
|
+
for (let i = 0; i < description.length; i++) {
|
|
254
|
+
const ch = description[i];
|
|
255
|
+
if (ch === "(") depth++;
|
|
256
|
+
else if (ch === ")") depth = Math.max(0, depth - 1);
|
|
257
|
+
else if (depth === 0 && (ch === "." || ch === "!" || ch === "?") && (i + 1 === description.length || /\s/.test(description[i + 1])) && !HINT_ABBREVIATIONS.test(description.slice(0, i))) {
|
|
258
|
+
end = i + 1;
|
|
259
|
+
break;
|
|
260
|
+
}
|
|
261
|
+
}
|
|
262
|
+
return description.slice(0, end).replace(/\s*\(required\)/g, "").trim();
|
|
263
|
+
}
|
|
215
264
|
function usageError(message, hint) {
|
|
216
265
|
process.stderr.write(`error: ${message}
|
|
217
266
|
`);
|
|
@@ -241,7 +290,7 @@ async function resolveLeaf(cmd, rawArgs, descent) {
|
|
|
241
290
|
if (token !== void 0) {
|
|
242
291
|
const hint = successorHint(await nodeName(cmd), token);
|
|
243
292
|
if (hint) {
|
|
244
|
-
usageError(`unknown command
|
|
293
|
+
usageError(`unknown command at ${argumentAt(idx)}`, hint);
|
|
245
294
|
}
|
|
246
295
|
}
|
|
247
296
|
if (token !== void 0 && hasBarePositional) {
|
|
@@ -258,13 +307,13 @@ async function resolveLeaf(cmd, rawArgs, descent) {
|
|
|
258
307
|
}
|
|
259
308
|
const name = await nodeName(cmd);
|
|
260
309
|
usageError(
|
|
261
|
-
`unexpected
|
|
310
|
+
`unexpected ${argumentAt(first.index)} after \`${name}\`. It is neither a positional \`${name}\` accepts nor one of its subcommands. Run \`curviate ${name} --help\` for the available subcommands.`
|
|
262
311
|
);
|
|
263
312
|
}
|
|
264
313
|
return { leaf: cmd, leafArgs: rawArgs };
|
|
265
314
|
}
|
|
266
315
|
if (token !== void 0) {
|
|
267
|
-
usageError(`unknown command
|
|
316
|
+
usageError(`unknown command at ${argumentAt(idx)}`);
|
|
268
317
|
}
|
|
269
318
|
return { leaf: cmd, leafArgs: rawArgs };
|
|
270
319
|
}
|
|
@@ -293,17 +342,23 @@ async function dispatch(root, rawArgs) {
|
|
|
293
342
|
}
|
|
294
343
|
setBetaOverride(beta.ok ? beta.value : void 0);
|
|
295
344
|
const argsAfterBeta = beta.ok ? beta.rest : rawArgs;
|
|
345
|
+
let hintLeaf;
|
|
296
346
|
try {
|
|
297
347
|
const { leaf, leafArgs } = await resolveLeaf(root, argsAfterBeta);
|
|
348
|
+
hintLeaf = leaf;
|
|
298
349
|
if (hasEmptyFields(leafArgs)) {
|
|
299
350
|
usageError("--fields must not be empty.");
|
|
300
351
|
}
|
|
301
352
|
const booleanFlags = await booleanFlagNames(leaf);
|
|
302
353
|
const declared = await declaredArgNames(leaf);
|
|
303
354
|
const walk = walkTokens(leafArgs, booleanFlags, declared);
|
|
304
|
-
const unknown = findUnknownFlag(walk.flags, declared);
|
|
355
|
+
const unknown = findUnknownFlag(walk.flags, declared, booleanFlags);
|
|
305
356
|
if (unknown !== null) {
|
|
306
|
-
usageError(`unknown flag
|
|
357
|
+
usageError(`unknown flag ${unknown}.`);
|
|
358
|
+
}
|
|
359
|
+
const repeated = await repeatedFlag(leaf, walk.flags);
|
|
360
|
+
if (repeated !== null) {
|
|
361
|
+
usageError(`--${repeated} was given more than once. Pass it once.`);
|
|
307
362
|
}
|
|
308
363
|
const mergedLeafArgs = mergeDashPrefixedValues(leafArgs, walk.merges);
|
|
309
364
|
const processedLeafArgs = mergedLeafArgs.map((a) => a === "-" ? STDIN_SENTINEL : a);
|
|
@@ -328,6 +383,18 @@ async function dispatch(root, rawArgs) {
|
|
|
328
383
|
const code = err?.code;
|
|
329
384
|
process.stderr.write(`error: ${message}
|
|
330
385
|
`);
|
|
386
|
+
const missing = code === "EARG" ? /^Missing required argument: --([\w-]+)$/.exec(message)?.[1] : void 0;
|
|
387
|
+
if (missing && hintLeaf) {
|
|
388
|
+
const defs = await resolveValue(hintLeaf.args ?? {});
|
|
389
|
+
const hint = firstSentenceHint(defs[missing]?.description);
|
|
390
|
+
if (hint) process.stderr.write(`hint: --${missing}: ${hint}
|
|
391
|
+
`);
|
|
392
|
+
}
|
|
393
|
+
const { CurviateError } = await import("@curviate/sdk");
|
|
394
|
+
if (err instanceof CurviateError) {
|
|
395
|
+
const { getExitCode } = await import("./exit-codes-ZFWQJYOY.js");
|
|
396
|
+
process.exit(getExitCode(err));
|
|
397
|
+
}
|
|
331
398
|
process.exit(code === "EARG" ? 2 : 1);
|
|
332
399
|
}
|
|
333
400
|
}
|
|
@@ -347,30 +414,30 @@ var main = defineCommand({
|
|
|
347
414
|
// Subcommand registry, names and descriptions are static for help rendering;
|
|
348
415
|
// the handler implementation is loaded lazily on first invocation.
|
|
349
416
|
subCommands: {
|
|
350
|
-
setup: () => import("./setup-
|
|
351
|
-
doctor: () => import("./doctor-
|
|
352
|
-
login: () => import("./login-
|
|
353
|
-
config: () => import("./config-
|
|
417
|
+
setup: () => import("./setup-BRULZH53.js").then((m) => m.setupCommand),
|
|
418
|
+
doctor: () => import("./doctor-VPGGB5CW.js").then((m) => m.doctorCommand),
|
|
419
|
+
login: () => import("./login-HP5URYD6.js").then((m) => m.loginCommand),
|
|
420
|
+
config: () => import("./config-ZD3Y5MWP.js").then((m) => m.configCommand),
|
|
354
421
|
// ---------------------------------------------------------------------------
|
|
355
422
|
// Noun groups, lazy-loaded on first invocation.
|
|
356
423
|
// ---------------------------------------------------------------------------
|
|
357
|
-
profile: () => import("./profile-
|
|
358
|
-
company: () => import("./company-
|
|
359
|
-
job: () => import("./job-
|
|
360
|
-
connect: () => import("./connect-
|
|
361
|
-
search: () => import("./search-
|
|
362
|
-
inbox: () => import("./inbox-
|
|
363
|
-
inboxes: () => import("./inboxes-
|
|
364
|
-
message: () => import("./message-
|
|
365
|
-
post: () => import("./post-
|
|
366
|
-
comment: () => import("./comment-
|
|
367
|
-
account: () => import("./account-
|
|
368
|
-
webhook: () => import("./webhook-
|
|
369
|
-
"sales-nav": () => import("./sales-nav-
|
|
370
|
-
recruiter: () => import("./recruiter-
|
|
371
|
-
group: () => import("./group-
|
|
372
|
-
feed: () => import("./feed-
|
|
373
|
-
notification: () => import("./notification-
|
|
424
|
+
profile: () => import("./profile-UCERD6RR.js").then((m) => m.profileCommand),
|
|
425
|
+
company: () => import("./company-ANZGO2HT.js").then((m) => m.companyCommand),
|
|
426
|
+
job: () => import("./job-PBTJ5DWL.js").then((m) => m.jobCommand),
|
|
427
|
+
connect: () => import("./connect-HYJCGYFO.js").then((m) => m.connectCommand),
|
|
428
|
+
search: () => import("./search-DYGIIODT.js").then((m) => m.searchCommand),
|
|
429
|
+
inbox: () => import("./inbox-XQQ4YRRO.js").then((m) => m.inboxCommand),
|
|
430
|
+
inboxes: () => import("./inboxes-6KHXXEBC.js").then((m) => m.inboxesCommand),
|
|
431
|
+
message: () => import("./message-DQQPMRFU.js").then((m) => m.messageCommand),
|
|
432
|
+
post: () => import("./post-2S7FYMZO.js").then((m) => m.postCommand),
|
|
433
|
+
comment: () => import("./comment-F2O4UOSD.js").then((m) => m.commentCommand),
|
|
434
|
+
account: () => import("./account-IPAW6YRD.js").then((m) => m.accountCommand),
|
|
435
|
+
webhook: () => import("./webhook-2TKWOXYK.js").then((m) => m.webhookCommand),
|
|
436
|
+
"sales-nav": () => import("./sales-nav-7XNJGVIX.js").then((m) => m.salesNavCommand),
|
|
437
|
+
recruiter: () => import("./recruiter-PJFUM2ZZ.js").then((m) => m.recruiterCommand),
|
|
438
|
+
group: () => import("./group-ETDDF2PJ.js").then((m) => m.groupCommand),
|
|
439
|
+
feed: () => import("./feed-IZZYSYYI.js").then((m) => m.feedCommand),
|
|
440
|
+
notification: () => import("./notification-CXIRJB57.js").then((m) => m.notificationCommand)
|
|
374
441
|
},
|
|
375
442
|
async run() {
|
|
376
443
|
const { runMain } = await import("citty");
|
|
@@ -1,11 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import {
|
|
3
3
|
resolveMemberOrMeProviderId
|
|
4
|
-
} from "./chunk-
|
|
5
|
-
import {
|
|
6
|
-
pageDelayFromFlags,
|
|
7
|
-
streamAll
|
|
8
|
-
} from "./chunk-LKF5MZIP.js";
|
|
4
|
+
} from "./chunk-REVD4GXL.js";
|
|
9
5
|
import {
|
|
10
6
|
AttachError,
|
|
11
7
|
describeAttachment,
|
|
@@ -13,29 +9,32 @@ import {
|
|
|
13
9
|
toAttachmentPayload
|
|
14
10
|
} from "./chunk-BGZW6B7G.js";
|
|
15
11
|
import "./chunk-UEAX6KUB.js";
|
|
16
|
-
import {
|
|
17
|
-
buildPreviewOutput
|
|
18
|
-
} from "./chunk-R3VLWLVV.js";
|
|
19
12
|
import {
|
|
20
13
|
requireAccount
|
|
21
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-27E2M2PS.js";
|
|
22
15
|
import {
|
|
16
|
+
buildPreviewOutput
|
|
17
|
+
} from "./chunk-TCUYH5GO.js";
|
|
18
|
+
import {
|
|
19
|
+
pageDelayFromFlags,
|
|
20
|
+
readablePage,
|
|
21
|
+
rejectPaginationModifiersWithoutAll,
|
|
23
22
|
renderError,
|
|
24
23
|
renderSuccess,
|
|
25
|
-
renderUnexpectedError
|
|
26
|
-
|
|
24
|
+
renderUnexpectedError,
|
|
25
|
+
resolveEffectiveConfig,
|
|
26
|
+
streamAll,
|
|
27
|
+
writeNdjsonItem
|
|
28
|
+
} from "./chunk-4IPHFPLO.js";
|
|
29
|
+
import "./chunk-YCLU5VSN.js";
|
|
27
30
|
import {
|
|
28
|
-
createClient
|
|
29
|
-
|
|
30
|
-
} from "./chunk-TD2ZIXFR.js";
|
|
31
|
-
import "./chunk-PKSKQ3LN.js";
|
|
32
|
-
import "./chunk-EIEF2KFH.js";
|
|
33
|
-
import "./chunk-TQJ77SL4.js";
|
|
31
|
+
createClient
|
|
32
|
+
} from "./chunk-4EH6EWFW.js";
|
|
34
33
|
import {
|
|
35
34
|
GLOBAL_FLAGS,
|
|
36
35
|
WRITE_SINGLE_FLAGS,
|
|
37
36
|
resolveTextOrStdin
|
|
38
|
-
} from "./chunk-
|
|
37
|
+
} from "./chunk-4GXO42ZH.js";
|
|
39
38
|
|
|
40
39
|
// src/commands/comment.ts
|
|
41
40
|
import { defineCommand } from "citty";
|
|
@@ -69,16 +68,15 @@ function buildListQuery(flags) {
|
|
|
69
68
|
async function handleSdkError(err, outOpts, out) {
|
|
70
69
|
const { CurviateError } = await import("@curviate/sdk");
|
|
71
70
|
if (err instanceof CurviateError) {
|
|
72
|
-
const { getExitCode } = await import("./exit-codes-
|
|
71
|
+
const { getExitCode } = await import("./exit-codes-ZFWQJYOY.js");
|
|
73
72
|
renderError(err, outOpts, out);
|
|
74
|
-
process.exit(getExitCode(err
|
|
73
|
+
process.exit(getExitCode(err));
|
|
75
74
|
}
|
|
76
75
|
renderUnexpectedError(err, out);
|
|
77
76
|
process.exit(1);
|
|
78
77
|
}
|
|
79
78
|
function normalizeAttachPaths(attach) {
|
|
80
|
-
|
|
81
|
-
return Array.isArray(attach) ? attach : [attach];
|
|
79
|
+
return attach ? [attach] : [];
|
|
82
80
|
}
|
|
83
81
|
function assertReaction(reaction, out) {
|
|
84
82
|
if (!REACTIONS.includes(reaction)) {
|
|
@@ -91,6 +89,7 @@ function assertReaction(reaction, out) {
|
|
|
91
89
|
}
|
|
92
90
|
async function runCommentList(client, flags, out) {
|
|
93
91
|
rejectPreviewOnRead(flags.preview, out);
|
|
92
|
+
rejectPaginationModifiersWithoutAll(flags, out);
|
|
94
93
|
const accountId = await requireAccount(client, flags, out);
|
|
95
94
|
const postId = flags.postId ?? "";
|
|
96
95
|
const ns = client.account(accountId);
|
|
@@ -106,10 +105,11 @@ async function runCommentList(client, flags, out) {
|
|
|
106
105
|
out,
|
|
107
106
|
pageDelayMs: pageDelayFromFlags(flags)
|
|
108
107
|
})) {
|
|
109
|
-
out
|
|
108
|
+
writeNdjsonItem(out, item, outOpts.fields);
|
|
110
109
|
}
|
|
111
110
|
} else {
|
|
112
111
|
const result = await ns.posts.listComments(postId, params);
|
|
112
|
+
readablePage(result);
|
|
113
113
|
renderSuccess(result, outOpts, out);
|
|
114
114
|
}
|
|
115
115
|
} catch (err) {
|
|
@@ -118,6 +118,7 @@ async function runCommentList(client, flags, out) {
|
|
|
118
118
|
}
|
|
119
119
|
async function runCommentReplies(client, flags, out) {
|
|
120
120
|
rejectPreviewOnRead(flags.preview, out);
|
|
121
|
+
rejectPaginationModifiersWithoutAll(flags, out);
|
|
121
122
|
const accountId = await requireAccount(client, flags, out);
|
|
122
123
|
const postId = flags.postId ?? "";
|
|
123
124
|
const commentId = flags.commentId ?? "";
|
|
@@ -134,10 +135,11 @@ async function runCommentReplies(client, flags, out) {
|
|
|
134
135
|
out,
|
|
135
136
|
pageDelayMs: pageDelayFromFlags(flags)
|
|
136
137
|
})) {
|
|
137
|
-
out
|
|
138
|
+
writeNdjsonItem(out, item, outOpts.fields);
|
|
138
139
|
}
|
|
139
140
|
} else {
|
|
140
141
|
const result = await ns.comments.listReplies(postId, commentId, params);
|
|
142
|
+
readablePage(result);
|
|
141
143
|
renderSuccess(result, outOpts, out);
|
|
142
144
|
}
|
|
143
145
|
} catch (err) {
|
|
@@ -146,6 +148,7 @@ async function runCommentReplies(client, flags, out) {
|
|
|
146
148
|
}
|
|
147
149
|
async function runCommentReactions(client, flags, out) {
|
|
148
150
|
rejectPreviewOnRead(flags.preview, out);
|
|
151
|
+
rejectPaginationModifiersWithoutAll(flags, out);
|
|
149
152
|
const accountId = await requireAccount(client, flags, out);
|
|
150
153
|
const postId = flags.postId ?? "";
|
|
151
154
|
const commentId = flags.commentId ?? "";
|
|
@@ -162,10 +165,11 @@ async function runCommentReactions(client, flags, out) {
|
|
|
162
165
|
out,
|
|
163
166
|
pageDelayMs: pageDelayFromFlags(flags)
|
|
164
167
|
})) {
|
|
165
|
-
out
|
|
168
|
+
writeNdjsonItem(out, item, outOpts.fields);
|
|
166
169
|
}
|
|
167
170
|
} else {
|
|
168
171
|
const result = await ns.comments.listReactions(postId, commentId, params);
|
|
172
|
+
readablePage(result);
|
|
169
173
|
renderSuccess(result, outOpts, out);
|
|
170
174
|
}
|
|
171
175
|
} catch (err) {
|
|
@@ -174,6 +178,7 @@ async function runCommentReactions(client, flags, out) {
|
|
|
174
178
|
}
|
|
175
179
|
async function runCommentUser(client, flags, out) {
|
|
176
180
|
rejectPreviewOnRead(flags.preview, out);
|
|
181
|
+
rejectPaginationModifiersWithoutAll(flags, out);
|
|
177
182
|
const accountId = await requireAccount(client, flags, out);
|
|
178
183
|
const ns = client.account(accountId);
|
|
179
184
|
const outOpts = resolveOutputOpts(flags);
|
|
@@ -195,10 +200,11 @@ async function runCommentUser(client, flags, out) {
|
|
|
195
200
|
out,
|
|
196
201
|
pageDelayMs: pageDelayFromFlags(flags)
|
|
197
202
|
})) {
|
|
198
|
-
out
|
|
203
|
+
writeNdjsonItem(out, item, outOpts.fields);
|
|
199
204
|
}
|
|
200
205
|
} else {
|
|
201
206
|
const result = await ns.comments.listUserComments(userId, params);
|
|
207
|
+
readablePage(result);
|
|
202
208
|
renderSuccess(result, outOpts, out);
|
|
203
209
|
}
|
|
204
210
|
} catch (err) {
|