@curviate/cli 0.31.1 → 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.
Files changed (40) hide show
  1. package/CHANGELOG.md +254 -1
  2. package/README.md +2 -0
  3. package/dist/{account-DZRX4YOK.js → account-IPAW6YRD.js} +89 -46
  4. package/dist/{chunk-A73TUZBK.js → chunk-27E2M2PS.js} +9 -6
  5. package/dist/chunk-4EH6EWFW.js +327 -0
  6. package/dist/{chunk-SKJNLN37.js → chunk-4GXO42ZH.js} +85 -1
  7. package/dist/{chunk-KQXYEQAD.js → chunk-4IPHFPLO.js} +172 -8
  8. package/dist/{chunk-Y3H55OSY.js → chunk-5SHLELR7.js} +16 -16
  9. package/dist/{chunk-JRKM4OV2.js → chunk-REO2BCEX.js} +1 -1
  10. package/dist/{chunk-6P52Q2GK.js → chunk-REVD4GXL.js} +5 -4
  11. package/dist/chunk-TCUYH5GO.js +34 -0
  12. package/dist/{chunk-X3YWBMBC.js → chunk-YCLU5VSN.js} +14 -17
  13. package/dist/cli.js +104 -37
  14. package/dist/{comment-6JI4Q6QY.js → comment-F2O4UOSD.js} +32 -26
  15. package/dist/{company-RLU5SHUO.js → company-ANZGO2HT.js} +52 -34
  16. package/dist/{config-FUHT23SX.js → config-ZD3Y5MWP.js} +74 -29
  17. package/dist/{connect-63NUITEZ.js → connect-HYJCGYFO.js} +34 -31
  18. package/dist/{doctor-KSLZNAKH.js → doctor-VPGGB5CW.js} +22 -16
  19. package/dist/{exit-codes-RUKZC4WV.js → exit-codes-ZFWQJYOY.js} +1 -1
  20. package/dist/{feed-PAWXR56T.js → feed-IZZYSYYI.js} +18 -17
  21. package/dist/{group-ZIIWI7JV.js → group-ETDDF2PJ.js} +21 -18
  22. package/dist/{inbox-GIPLWRHQ.js → inbox-XQQ4YRRO.js} +27 -22
  23. package/dist/{inboxes-ECGEMDH7.js → inboxes-6KHXXEBC.js} +18 -17
  24. package/dist/{job-WPWIAVQY.js → job-PBTJ5DWL.js} +43 -29
  25. package/dist/{login-3OAUY7TG.js → login-HP5URYD6.js} +15 -3
  26. package/dist/{message-JQL2XABC.js → message-DQQPMRFU.js} +7 -9
  27. package/dist/{notification-URSGC7OR.js → notification-CXIRJB57.js} +20 -19
  28. package/dist/{post-2HI6KL73.js → post-2S7FYMZO.js} +33 -25
  29. package/dist/{profile-4BXLUYMH.js → profile-UCERD6RR.js} +61 -43
  30. package/dist/{recruiter-OUXQ5XYU.js → recruiter-PJFUM2ZZ.js} +41 -28
  31. package/dist/{sales-nav-MJAMCSBO.js → sales-nav-7XNJGVIX.js} +43 -29
  32. package/dist/{search-M3R35BIB.js → search-DYGIIODT.js} +57 -43
  33. package/dist/{setup-YV5PVIU5.js → setup-BRULZH53.js} +12 -8
  34. package/dist/{webhook-3TEYA3B2.js → webhook-2TKWOXYK.js} +25 -22
  35. package/package.json +2 -2
  36. package/dist/chunk-LKF5MZIP.js +0 -90
  37. package/dist/chunk-PKSKQ3LN.js +0 -68
  38. package/dist/chunk-R3VLWLVV.js +0 -23
  39. package/dist/chunk-TD2ZIXFR.js +0 -67
  40. 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-A73TUZBK.js";
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
- } from "./chunk-KQXYEQAD.js";
29
+ renderUnexpectedError,
30
+ resolveEffectiveConfig
31
+ } from "./chunk-4IPHFPLO.js";
30
32
  import {
31
33
  createClient,
32
- resolveEffectiveConfig
33
- } from "./chunk-TD2ZIXFR.js";
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-SKJNLN37.js";
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-RUKZC4WV.js");
78
+ const { getExitCode } = await import("./exit-codes-ZFWQJYOY.js");
77
79
  renderError(err, outOpts, out);
78
- process.exit(getExitCode(err.code));
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
- const profileData = await ns.users.get(resolvedSlugOrId, {});
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
- const profileData = await ns.users.get(resolvedSlugOrId, {});
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;
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  isStdinToken
4
- } from "./chunk-SKJNLN37.js";
4
+ } from "./chunk-4GXO42ZH.js";
5
5
 
6
6
  // src/lib/search-filters.ts
7
7
  import { readFile } from "fs/promises";
@@ -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
- const profile = await ns.users.get(normalized, {});
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
- const profile = await ns.users.get(normalized, query);
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
+ };
@@ -25,14 +25,6 @@ var EXIT_CODE_MAP = {
25
25
  NO_ACTIVE_SEAT: 5,
26
26
  LINKEDIN_FEATURE_NOT_SUBSCRIBED: 5,
27
27
  BETA_NOT_ENABLED: 5,
28
- // DEPRECATED, and mapped anyway. `TIER_NOT_ACTIVE` is what a deployment
29
- // predating the seat-based entitlement rollout answers instead of
30
- // `NO_ACTIVE_SEAT`, and this CLI is pointed at whichever deployment the
31
- // caller configured. Unmapped it would fall to exit 1 and read as "the tool
32
- // broke" for a plain billing refusal, on exactly the deployments most likely
33
- // to send it. Same bucket as its replacement, because the caller's remedy is
34
- // identical. Removed once every deployment carries the new contract.
35
- TIER_NOT_ACTIVE: 5,
36
28
  // Rate-limited (6)
37
29
  RATE_LIMIT_ACCOUNT: 6,
38
30
  RATE_LIMIT_TENANT: 6,
@@ -52,12 +44,6 @@ var EXIT_CODE_MAP = {
52
44
  LINKEDIN_OPERATION_NOT_SUPPORTED: 8,
53
45
  CONNECTION_REQUEST_CONFLICT: 8,
54
46
  REAUTH_REQUIRED: 8,
55
- // DEPRECATED, mapped for the same reason as `TIER_NOT_ACTIVE` above: the
56
- // connect rework made it unreachable on current deployments, and an older one
57
- // can still send it. A seat resolving to both individual-Premium products at
58
- // once, which is the same "this account/seat is in a state that blocks the
59
- // request" shape as `ACCOUNT_RESTRICTED`.
60
- PREMIUM_CONFLICT: 8,
61
47
  // Checkpoint flow (9)
62
48
  CHECKPOINT_NOT_FOUND: 9,
63
49
  CHECKPOINT_EXPIRED: 9,
@@ -137,10 +123,21 @@ var EXIT_CODE_MAP = {
137
123
  TRIAL_IDENTITY_UNRESOLVED: 11,
138
124
  // Internal / uncaught (1), last resort bucket
139
125
  INTERNAL: 1,
140
- PLATFORM_NOT_IMPLEMENTED: 1
126
+ PLATFORM_NOT_IMPLEMENTED: 1,
127
+ // 1, chosen rather than defaulted, and deliberately not 7 or 11.
128
+ // `STRIPE_DRIFT_DETECTED` is a 503 on checkout: Curviate's own seat-price
129
+ // configuration disagrees with the price it displays, so it refuses closed
130
+ // until Curviate corrects it. It carries the same flags as
131
+ // `PLATFORM_NOT_IMPLEMENTED` (neither user_fixable nor retry-likely), so it
132
+ // takes the same bucket. Not 7, which tells the caller to retry with
133
+ // backoff. Not 11, which tells the caller the tenant's billing is at fault,
134
+ // and here it is not. The `--json` envelope still names the real code.
135
+ STRIPE_DRIFT_DETECTED: 1
141
136
  };
142
- function getExitCode(code) {
143
- return EXIT_CODE_MAP[code] ?? 1;
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;
144
141
  }
145
142
  var AUTH_NEEDED = 12;
146
143
 
package/dist/cli.js CHANGED
@@ -1,13 +1,14 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
- parseBetaFlag,
4
- setBetaOverride
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
- restoreLiteralDashes
10
- } from "./chunk-SKJNLN37.js";
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 argument \`${token}\` after \`${form}\`. \`${form}\` takes ${arity}. Run \`${form} --help\` for its usage.`,
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
- if (declared.has(name)) continue;
197
- if (name.startsWith("no-") && declared.has(name.slice(3))) continue;
198
- return token;
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 \`${token}\``, hint);
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 argument \`${first.token}\` after \`${name}\`. It is neither a positional \`${name}\` accepts nor one of its subcommands. Run \`curviate ${name} --help\` for the available subcommands.`
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 \`${token}\``);
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 \`${unknown}\`.`);
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-YV5PVIU5.js").then((m) => m.setupCommand),
351
- doctor: () => import("./doctor-KSLZNAKH.js").then((m) => m.doctorCommand),
352
- login: () => import("./login-3OAUY7TG.js").then((m) => m.loginCommand),
353
- config: () => import("./config-FUHT23SX.js").then((m) => m.configCommand),
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-4BXLUYMH.js").then((m) => m.profileCommand),
358
- company: () => import("./company-RLU5SHUO.js").then((m) => m.companyCommand),
359
- job: () => import("./job-WPWIAVQY.js").then((m) => m.jobCommand),
360
- connect: () => import("./connect-63NUITEZ.js").then((m) => m.connectCommand),
361
- search: () => import("./search-M3R35BIB.js").then((m) => m.searchCommand),
362
- inbox: () => import("./inbox-GIPLWRHQ.js").then((m) => m.inboxCommand),
363
- inboxes: () => import("./inboxes-ECGEMDH7.js").then((m) => m.inboxesCommand),
364
- message: () => import("./message-JQL2XABC.js").then((m) => m.messageCommand),
365
- post: () => import("./post-2HI6KL73.js").then((m) => m.postCommand),
366
- comment: () => import("./comment-6JI4Q6QY.js").then((m) => m.commentCommand),
367
- account: () => import("./account-DZRX4YOK.js").then((m) => m.accountCommand),
368
- webhook: () => import("./webhook-3TEYA3B2.js").then((m) => m.webhookCommand),
369
- "sales-nav": () => import("./sales-nav-MJAMCSBO.js").then((m) => m.salesNavCommand),
370
- recruiter: () => import("./recruiter-OUXQ5XYU.js").then((m) => m.recruiterCommand),
371
- group: () => import("./group-ZIIWI7JV.js").then((m) => m.groupCommand),
372
- feed: () => import("./feed-PAWXR56T.js").then((m) => m.feedCommand),
373
- notification: () => import("./notification-URSGC7OR.js").then((m) => m.notificationCommand)
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-6P52Q2GK.js";
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-A73TUZBK.js";
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
- } from "./chunk-KQXYEQAD.js";
24
+ renderUnexpectedError,
25
+ resolveEffectiveConfig,
26
+ streamAll,
27
+ writeNdjsonItem
28
+ } from "./chunk-4IPHFPLO.js";
29
+ import "./chunk-YCLU5VSN.js";
27
30
  import {
28
- createClient,
29
- resolveEffectiveConfig
30
- } from "./chunk-TD2ZIXFR.js";
31
- import "./chunk-PKSKQ3LN.js";
32
- import "./chunk-X3YWBMBC.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-SKJNLN37.js";
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-RUKZC4WV.js");
71
+ const { getExitCode } = await import("./exit-codes-ZFWQJYOY.js");
73
72
  renderError(err, outOpts, out);
74
- process.exit(getExitCode(err.code));
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
- if (!attach) return [];
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.stdout.write(JSON.stringify(item) + "\n");
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.stdout.write(JSON.stringify(item) + "\n");
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.stdout.write(JSON.stringify(item) + "\n");
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.stdout.write(JSON.stringify(item) + "\n");
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) {