@curviate/cli 0.15.0 → 0.15.2

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.
@@ -12,19 +12,20 @@ import {
12
12
  resolveIdentifier
13
13
  } from "./chunk-DMQZEPQE.js";
14
14
  import {
15
+ pageDelayFromFlags,
15
16
  streamAll
16
- } from "./chunk-DNTRQZBT.js";
17
+ } from "./chunk-EEMJDJ4W.js";
17
18
  import {
18
19
  createClient,
19
20
  renderError,
20
21
  renderSuccess,
21
22
  renderUnexpectedError,
22
23
  resolveEffectiveConfig
23
- } from "./chunk-JXF47TRY.js";
24
+ } from "./chunk-M33MI53G.js";
24
25
  import {
25
26
  GLOBAL_FLAGS,
26
27
  WRITE_FLAGS
27
- } from "./chunk-4JHGVY7R.js";
28
+ } from "./chunk-TMU3CSPR.js";
28
29
 
29
30
  // src/commands/connect.ts
30
31
  import { defineCommand } from "citty";
@@ -106,7 +107,8 @@ async function runConnectSent(client, flags, out) {
106
107
  const fn = (p) => ns.invites.listSent(p);
107
108
  for await (const item of streamAll(fn, params, {
108
109
  maxPages,
109
- out
110
+ out,
111
+ pageDelayMs: pageDelayFromFlags(flags)
110
112
  })) {
111
113
  const projected = !flags.verbose ? slimInviteSentItem(item) : item;
112
114
  out.stdout.write(JSON.stringify(projected) + "\n");
@@ -143,7 +145,8 @@ async function runConnectReceived(client, flags, out) {
143
145
  const fn = (p) => ns.invites.listReceived(p);
144
146
  for await (const item of streamAll(fn, params, {
145
147
  maxPages,
146
- out
148
+ out,
149
+ pageDelayMs: pageDelayFromFlags(flags)
147
150
  })) {
148
151
  const projected = !flags.verbose ? slimInviteReceivedItem(item) : item;
149
152
  out.stdout.write(JSON.stringify(projected) + "\n");
@@ -253,7 +256,7 @@ async function runConnectCancel(client, flags, out) {
253
256
  var connectSentCommand = defineCommand({
254
257
  meta: {
255
258
  name: "sent",
256
- description: "Returns pending sent invitations only \u2014 accepted and declined invitations are not returned (LinkedIn API limitation). Use `id` with `connect cancel`; use `user.id` (native member URN \u2014 the sent-variant carries no public slug) to identify the recipient. `created_at` is the platform's own ISO-8601 timestamp (not an approximation). No total count is available; use `connect sent --all` and count client-side."
259
+ description: "Returns pending sent invitations only \u2014 accepted and declined invitations are not returned (LinkedIn API limitation). Use `id` with `connect cancel`; use `user.id` (native member URN \u2014 the sent-variant carries no public slug) to identify the recipient. `created_at` is the platform's own ISO-8601 timestamp (not an approximation). No total count is available; use `connect sent --all` and count client-side. A very recently sent invitation may take a few minutes to appear here (LinkedIn-side indexing)."
257
260
  },
258
261
  args: { ...GLOBAL_FLAGS },
259
262
  async run({ args }) {
@@ -277,7 +280,7 @@ var connectSentCommand = defineCommand({
277
280
  var connectReceivedCommand = defineCommand({
278
281
  meta: {
279
282
  name: "received",
280
- description: "Returns pending received invitations only \u2014 already-handled invitations are not returned. The `user.*` fields (`public_identifier`, `display_name`, `first_name`, `last_name`) identify who sent the request. Use the `id` field with `connect accept` or `connect decline`."
283
+ description: "Returns pending received invitations only \u2014 already-handled invitations are not returned. The `user.*` fields (`public_identifier`, `display_name`, `first_name`, `last_name`) identify who sent the request. Use the `id` field with `connect accept` or `connect decline`. A very recently received invitation may take a few minutes to appear here (LinkedIn-side indexing)."
281
284
  },
282
285
  args: { ...GLOBAL_FLAGS },
283
286
  async run({ args }) {
@@ -6,20 +6,21 @@ import {
6
6
  normalizeChatId
7
7
  } from "./chunk-DMQZEPQE.js";
8
8
  import {
9
+ pageDelayFromFlags,
9
10
  streamAll
10
- } from "./chunk-DNTRQZBT.js";
11
+ } from "./chunk-EEMJDJ4W.js";
11
12
  import {
12
13
  createClient,
13
14
  renderError,
14
15
  renderSuccess,
15
16
  renderUnexpectedError,
16
17
  resolveEffectiveConfig
17
- } from "./chunk-JXF47TRY.js";
18
+ } from "./chunk-M33MI53G.js";
18
19
  import {
19
20
  GLOBAL_FLAGS,
20
21
  READ_SINGLE_FLAGS,
21
22
  WRITE_SINGLE_FLAGS
22
- } from "./chunk-4JHGVY7R.js";
23
+ } from "./chunk-TMU3CSPR.js";
23
24
 
24
25
  // src/commands/inbox.ts
25
26
  import { defineCommand } from "citty";
@@ -96,7 +97,8 @@ async function runInboxList(client, flags, out) {
96
97
  const fn = (p) => ns.messaging.listChats(p);
97
98
  for await (const item of streamAll(fn, params, {
98
99
  maxPages,
99
- out
100
+ out,
101
+ pageDelayMs: pageDelayFromFlags(flags)
100
102
  })) {
101
103
  out.stdout.write(JSON.stringify(item) + "\n");
102
104
  }
@@ -162,7 +164,8 @@ async function runInboxMessages(client, flags, out) {
162
164
  const fn = (p) => ns.messaging.listMessages(chatId, p);
163
165
  for await (const item of streamAll(fn, params, {
164
166
  maxPages,
165
- out
167
+ out,
168
+ pageDelayMs: pageDelayFromFlags(flags)
166
169
  })) {
167
170
  out.stdout.write(JSON.stringify(item) + "\n");
168
171
  }
@@ -253,7 +256,7 @@ var inboxMarkReadCommand = defineCommand({
253
256
  }
254
257
  });
255
258
  var inboxMessagesCommand = defineCommand({
256
- meta: { name: "messages", description: "List messages in a chat." },
259
+ meta: { name: "messages", description: "List messages in a chat. A very recent send/delete may take a few minutes to appear or clear here (LinkedIn-side indexing); `message get <chat_id> <message_id>` reflects it immediately." },
257
260
  args: {
258
261
  ...GLOBAL_FLAGS,
259
262
  chatId: { type: "positional", description: "Chat ID." },
@@ -13,20 +13,23 @@ import {
13
13
  resolveJobIdentifier
14
14
  } from "./chunk-DMQZEPQE.js";
15
15
  import {
16
+ DEFAULT_PAGE_DELAY_MS,
17
+ ndjsonModeNotice,
18
+ pageDelayFromFlags,
16
19
  streamAll
17
- } from "./chunk-DNTRQZBT.js";
20
+ } from "./chunk-EEMJDJ4W.js";
18
21
  import {
19
22
  createClient,
20
23
  renderError,
21
24
  renderSuccess,
22
25
  renderUnexpectedError,
23
26
  resolveEffectiveConfig
24
- } from "./chunk-JXF47TRY.js";
27
+ } from "./chunk-M33MI53G.js";
25
28
  import {
26
29
  GLOBAL_FLAGS,
27
30
  READ_SINGLE_FLAGS,
28
31
  WRITE_SINGLE_FLAGS
29
- } from "./chunk-4JHGVY7R.js";
32
+ } from "./chunk-TMU3CSPR.js";
30
33
 
31
34
  // src/commands/job.ts
32
35
  import { defineCommand } from "citty";
@@ -134,11 +137,16 @@ async function runJobList(client, flags, out) {
134
137
  rejectPreviewOnRead(flags.preview, out);
135
138
  const accountId = requireAccount(flags.account, out);
136
139
  const state = requireFlag(flags.state, "--state", out);
137
- requireEnum(state, JOB_STATES, "--state", out);
138
140
  const ns = client.account(accountId);
139
141
  const outOpts = resolveOutputOpts(flags);
140
142
  const all = flags.all ?? false;
141
143
  const maxPages = flags["max-pages"] ? parseInt(flags["max-pages"], 10) : 100;
144
+ const pageDelayMs = pageDelayFromFlags(flags);
145
+ if (state === "ALL") {
146
+ await runJobListAllStates(ns, flags, out, outOpts, { all, maxPages, pageDelayMs });
147
+ return;
148
+ }
149
+ requireEnum(state, JOB_STATES, "--state", out);
142
150
  const base = { state };
143
151
  if (flags.limit) base.limit = parseInt(flags.limit, 10);
144
152
  if (flags.cursor) base.cursor = flags.cursor;
@@ -153,7 +161,8 @@ async function runJobList(client, flags, out) {
153
161
  });
154
162
  for await (const item of streamAll(fn, base, {
155
163
  maxPages,
156
- out
164
+ out,
165
+ pageDelayMs: pageDelayFromFlags(flags)
157
166
  })) {
158
167
  out.stdout.write(JSON.stringify(item) + "\n");
159
168
  }
@@ -169,6 +178,66 @@ async function runJobList(client, flags, out) {
169
178
  await handleSdkError(err, outOpts, out);
170
179
  }
171
180
  }
181
+ function pace(ms) {
182
+ return ms > 0 ? new Promise((resolve) => setTimeout(resolve, ms)) : Promise.resolve();
183
+ }
184
+ var JOB_LIST_UNION_CAVEAT = "note: --state ALL is a best-effort client-side union over DRAFT/OPEN/CLOSED/REVIEW/SUSPENDED. LinkedIn's per-state filter is best-effort, so each state is queried, its items are re-filtered against their own state, and the results are merged and de-duplicated by id. There is no unified pagination cursor \u2014 each state is walked independently and --max-pages applies per state.\n";
185
+ function jobItemId(item) {
186
+ const id = item.id;
187
+ return typeof id === "string" ? id : void 0;
188
+ }
189
+ async function runJobListAllStates(ns, flags, out, outOpts, opts) {
190
+ const { all, maxPages, pageDelayMs } = opts;
191
+ const betweenStatesDelay = pageDelayMs ?? DEFAULT_PAGE_DELAY_MS;
192
+ const limit = flags.limit ? parseInt(flags.limit, 10) : void 0;
193
+ const seen = /* @__PURE__ */ new Set();
194
+ try {
195
+ if (all) {
196
+ out.stderr.write(ndjsonModeNotice());
197
+ out.stderr.write(JOB_LIST_UNION_CAVEAT);
198
+ for (let i = 0; i < JOB_STATES.length; i++) {
199
+ const s = JOB_STATES[i];
200
+ const base = { state: s };
201
+ if (limit !== void 0) base.limit = limit;
202
+ const fn = (p) => ns.jobs.list(p).then((page) => ({
203
+ ...page,
204
+ items: filterJobsByState(page.items, s).items
205
+ }));
206
+ for await (const item of streamAll(fn, base, {
207
+ maxPages,
208
+ pageDelayMs
209
+ /* union-aggregate-no-out */
210
+ })) {
211
+ const id = jobItemId(item);
212
+ if (id !== void 0 && seen.has(id)) continue;
213
+ if (id !== void 0) seen.add(id);
214
+ out.stdout.write(JSON.stringify(item) + "\n");
215
+ }
216
+ if (i < JOB_STATES.length - 1) await pace(betweenStatesDelay);
217
+ }
218
+ } else {
219
+ out.stderr.write(JOB_LIST_UNION_CAVEAT);
220
+ const merged = [];
221
+ for (let i = 0; i < JOB_STATES.length; i++) {
222
+ const s = JOB_STATES[i];
223
+ const base = { state: s };
224
+ if (limit !== void 0) base.limit = limit;
225
+ const page = await ns.jobs.list(base);
226
+ const { items: filtered } = filterJobsByState(page.items, s);
227
+ for (const item of filtered) {
228
+ const id = jobItemId(item);
229
+ if (id !== void 0 && seen.has(id)) continue;
230
+ if (id !== void 0) seen.add(id);
231
+ merged.push(item);
232
+ }
233
+ if (i < JOB_STATES.length - 1) await pace(betweenStatesDelay);
234
+ }
235
+ renderSuccess({ object: "list", items: merged, cursor: null }, outOpts, out);
236
+ }
237
+ } catch (err) {
238
+ await handleSdkError(err, outOpts, out);
239
+ }
240
+ }
172
241
  async function runJobBudget(client, flags, out) {
173
242
  rejectPreviewOnRead(flags.preview, out);
174
243
  const accountId = requireAccount(flags.account, out);
@@ -203,7 +272,8 @@ async function runJobApplicants(client, flags, out) {
203
272
  const fn = (p) => ns.jobs.listApplicants(jobId, p);
204
273
  for await (const item of streamAll(fn, base, {
205
274
  maxPages,
206
- out
275
+ out,
276
+ pageDelayMs: pageDelayFromFlags(flags)
207
277
  })) {
208
278
  out.stdout.write(JSON.stringify(item) + "\n");
209
279
  }
@@ -398,7 +468,7 @@ var JOB_BODY_FLAGS = {
398
468
  "workplace-type": { type: "string", description: "Workplace arrangement: ON_SITE|HYBRID|REMOTE." },
399
469
  location: { type: "string", description: "A LOCATION parameter id (from search parameters)." },
400
470
  "employment-status": { type: "string", description: "Employment type: FULL_TIME|PART_TIME|CONTRACT|TEMPORARY|OTHER|VOLUNTEER|INTERNSHIP." },
401
- description: { type: "string", description: "Full job description (min 200 chars)." },
471
+ description: { type: "string", description: "Full job description (required; minimum 200 characters \u2014 enforced server-side)." },
402
472
  "apply-method": { type: "string", description: "How candidates apply: linkedin|external." },
403
473
  "notification-email": { type: "string", description: "Email notified of new applicants (required when --apply-method is linkedin)." },
404
474
  "website-url": { type: "string", description: "External apply URL (required when --apply-method is external)." },
@@ -418,7 +488,7 @@ var jobListCommand = defineCommand({
418
488
  meta: { name: "list", description: "List your own classic job postings by state." },
419
489
  args: {
420
490
  ...GLOBAL_FLAGS,
421
- state: { type: "string", description: "Filter by state (required): DRAFT|OPEN|CLOSED|REVIEW|SUSPENDED. Best-effort on LinkedIn's side -- verify item.state. The CLI re-filters returned items against their own state (dropped items are noted on stderr), but the upstream page walk itself is unfiltered, so --all may fetch more pages than the filtered item count implies.", required: true }
491
+ state: { type: "string", description: "Filter by state (required): DRAFT|OPEN|CLOSED|REVIEW|SUSPENDED, or ALL for a best-effort client-side union across every state (each state queried, re-filtered, merged and de-duplicated by id; no unified cursor). Best-effort on LinkedIn's side -- verify item.state. The CLI re-filters returned items against their own state (dropped items are noted on stderr), but the upstream page walk itself is unfiltered, so --all may fetch more pages than the filtered item count implies.", required: true }
422
492
  },
423
493
  async run({ args }) {
424
494
  await withClient(args, runJobList);
@@ -462,7 +532,7 @@ var jobPublishCommand = defineCommand({
462
532
  id: { type: "positional", description: "Job id to publish." },
463
533
  mode: { type: "string", description: "Publish mode (required): FREE|PROMOTED|PROMOTED_PLUS.", required: true },
464
534
  "budget-currency": { type: "string", description: "ISO-4217 currency (required for a paid publish), e.g. EUR." },
465
- "budget-amount": { type: "string", description: "Budget amount (required for a paid publish)." },
535
+ "budget-amount": { type: "string", description: "Budget amount \u2014 a non-negative number (required for a paid publish)." },
466
536
  "budget-scope": { type: "string", description: "Budget scope (required for a paid publish): DAILY|TOTAL." }
467
537
  },
468
538
  async run({ args }) {
@@ -542,7 +612,7 @@ var jobCommand = defineCommand({
542
612
  },
543
613
  async run() {
544
614
  process.stderr.write(
545
- "Usage: curviate job get <url|id>\n curviate job list --state <DRAFT|OPEN|CLOSED|REVIEW|SUSPENDED>\n curviate job create --job-title <t> --company <c> --workplace-type <w> --location <id> --employment-status <e> --description <d> --apply-method <linkedin|external>\n curviate job update <id> [<flags>]\n curviate job budget <id>\n curviate job publish <id> --mode <FREE|PROMOTED|PROMOTED_PLUS>\n curviate job close <id>\n curviate job applicants <id>\n curviate job applicant get <id> <applicant_id>\n curviate job applicant resume <id> <applicant_id> -o <file>\n"
615
+ "Usage: curviate job get <url|id>\n curviate job list --state <DRAFT|OPEN|CLOSED|REVIEW|SUSPENDED|ALL>\n curviate job create --job-title <t> --company <c> --workplace-type <w> --location <id> --employment-status <e> --description <d> --apply-method <linkedin|external>\n curviate job update <id> [<flags>]\n curviate job budget <id>\n curviate job publish <id> --mode <FREE|PROMOTED|PROMOTED_PLUS>\n curviate job close <id>\n curviate job applicants <id>\n curviate job applicant get <id> <applicant_id>\n curviate job applicant resume <id> <applicant_id> -o <file>\n"
546
616
  );
547
617
  }
548
618
  });
@@ -1,11 +1,11 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  readlineSync
4
- } from "./chunk-MKXA2LAR.js";
4
+ } from "./chunk-H4KV7MIN.js";
5
5
  import {
6
6
  GLOBAL_FLAGS,
7
7
  writeProfile
8
- } from "./chunk-4JHGVY7R.js";
8
+ } from "./chunk-TMU3CSPR.js";
9
9
 
10
10
  // src/commands/login.ts
11
11
  import { defineCommand } from "citty";
@@ -24,11 +24,11 @@ import {
24
24
  renderSuccess,
25
25
  renderUnexpectedError,
26
26
  resolveEffectiveConfig
27
- } from "./chunk-JXF47TRY.js";
27
+ } from "./chunk-M33MI53G.js";
28
28
  import {
29
29
  READ_SINGLE_FLAGS,
30
30
  WRITE_FLAGS
31
- } from "./chunk-4JHGVY7R.js";
31
+ } from "./chunk-TMU3CSPR.js";
32
32
 
33
33
  // src/commands/message.ts
34
34
  import { defineCommand } from "citty";
@@ -251,7 +251,12 @@ async function runMessageReact(client, flags, out) {
251
251
  const accountId = requireAccount(flags.account, out);
252
252
  const chatId = normalizeChatId(flags.chatId ?? "");
253
253
  const messageId = flags.messageId ?? "";
254
- const reaction = flags.emoji ?? "";
254
+ const reaction = flags.emoji ?? flags.emojiAlias ?? "";
255
+ if (!reaction) {
256
+ out.stderr.write("error: a reaction is required \u2014 pass it as `message react <chat_id> <message_id> <emoji>` (or --emoji <e>).\n");
257
+ process.exit(2);
258
+ return;
259
+ }
255
260
  if (flags.preview) {
256
261
  const preview = buildPreviewOutput({
257
262
  method: "messaging.addReaction",
@@ -477,7 +482,12 @@ var messageReactCommand = defineCommand({
477
482
  ...WRITE_FLAGS,
478
483
  chatId: { type: "positional", description: "Chat ID or LinkedIn messaging thread URL." },
479
484
  messageId: { type: "positional", description: "Message ID." },
480
- emoji: { type: "string", description: "Native emoji reaction value (e.g. \u{1F44D}).", required: true }
485
+ emoji: { type: "positional", required: false, description: "Native emoji reaction value (e.g. \u{1F44D})." },
486
+ emojiAlias: {
487
+ type: "string",
488
+ alias: "emoji",
489
+ description: "Deprecated: pass the emoji as the positional <emoji> instead. --emoji still works."
490
+ }
481
491
  },
482
492
  async run({ args }) {
483
493
  const flags = args;
@@ -636,7 +646,7 @@ var messageCommand = defineCommand({
636
646
  const flags = args;
637
647
  if (!flags.chatId) {
638
648
  process.stderr.write(
639
- 'Usage: curviate message new --to <attendee> "<text>" [--attach <file>\u2026]\n curviate message <chat_id> "<text>" [--attach <file>\u2026]\n curviate message get <chat_id> <message_id>\n curviate message edit <chat_id> <message_id> "<text>"\n curviate message delete <chat_id> <message_id>\n curviate message react <chat_id> <message_id> --emoji <e>\n curviate message attachment <chat_id> <message_id> <attachment_id> [-o <file>]\n curviate message inmail --to <id> --subject <s> "<text>"\n curviate message inmail-balance\n'
649
+ 'Usage: curviate message new --to <attendee> "<text>" [--attach <file>\u2026]\n curviate message <chat_id> "<text>" [--attach <file>\u2026]\n curviate message get <chat_id> <message_id>\n curviate message edit <chat_id> <message_id> "<text>"\n curviate message delete <chat_id> <message_id>\n curviate message react <chat_id> <message_id> <emoji>\n curviate message attachment <chat_id> <message_id> <attachment_id> [-o <file>]\n curviate message inmail --to <id> --subject <s> "<text>"\n curviate message inmail-balance\n'
640
650
  );
641
651
  process.exit(2);
642
652
  }
@@ -15,20 +15,21 @@ import {
15
15
  } from "./chunk-R3VLWLVV.js";
16
16
  import "./chunk-DMQZEPQE.js";
17
17
  import {
18
+ pageDelayFromFlags,
18
19
  streamAll
19
- } from "./chunk-DNTRQZBT.js";
20
+ } from "./chunk-EEMJDJ4W.js";
20
21
  import {
21
22
  createClient,
22
23
  renderError,
23
24
  renderSuccess,
24
25
  renderUnexpectedError,
25
26
  resolveEffectiveConfig
26
- } from "./chunk-JXF47TRY.js";
27
+ } from "./chunk-M33MI53G.js";
27
28
  import {
28
29
  GLOBAL_FLAGS,
29
30
  WRITE_FLAGS,
30
31
  WRITE_SINGLE_FLAGS
31
- } from "./chunk-4JHGVY7R.js";
32
+ } from "./chunk-TMU3CSPR.js";
32
33
 
33
34
  // src/commands/post.ts
34
35
  import { defineCommand } from "citty";
@@ -147,10 +148,10 @@ async function runPostCreate(client, flags, out, _readStdin) {
147
148
  async function runPostReact(client, flags, out) {
148
149
  const accountId = requireAccount(flags.account, out);
149
150
  const postId = flags.postId ?? "";
150
- const reaction = flags.reaction ?? "";
151
+ const reaction = flags.reaction ?? flags.reactionAlias ?? "";
151
152
  if (!VALID_REACTIONS.has(reaction)) {
152
153
  out.stderr.write(
153
- `error: --reaction must be one of: like, celebrate, support, love, insightful, funny. Got: "${reaction}"
154
+ `error: reaction must be one of: like, celebrate, support, love, insightful, funny. Got: "${reaction}"
154
155
  `
155
156
  );
156
157
  process.exit(2);
@@ -194,7 +195,8 @@ async function runPostReactions(client, flags, out) {
194
195
  const fn = (p) => ns.posts.listReactions(postId, p);
195
196
  for await (const item of streamAll(fn, params, {
196
197
  maxPages,
197
- out
198
+ out,
199
+ pageDelayMs: pageDelayFromFlags(flags)
198
200
  })) {
199
201
  out.stdout.write(JSON.stringify(item) + "\n");
200
202
  }
@@ -272,7 +274,8 @@ async function runPostUserPosts(client, flags, out) {
272
274
  const fn = (p) => ns.posts.listUserPosts(userId, p);
273
275
  for await (const item of streamAll(fn, params, {
274
276
  maxPages,
275
- out
277
+ out,
278
+ pageDelayMs: pageDelayFromFlags(flags)
276
279
  })) {
277
280
  out.stdout.write(JSON.stringify(item) + "\n");
278
281
  }
@@ -304,7 +307,8 @@ async function runPostUserReactions(client, flags, out) {
304
307
  const fn = (p) => ns.posts.listUserReactions(userId, p);
305
308
  for await (const item of streamAll(fn, params, {
306
309
  maxPages,
307
- out
310
+ out,
311
+ pageDelayMs: pageDelayFromFlags(flags)
308
312
  })) {
309
313
  out.stdout.write(JSON.stringify(item) + "\n");
310
314
  }
@@ -382,10 +386,15 @@ var postReactCommand = defineCommand({
382
386
  description: "Numeric post id, urn:li:activity:N, or full LinkedIn share URL (activity-<N>- extracted). POSTID is always the post's id."
383
387
  },
384
388
  reaction: {
385
- type: "string",
386
- required: true,
389
+ type: "positional",
390
+ required: false,
387
391
  description: "Write-side reaction (lowercase). Write values: like, celebrate, support, love, insightful, funny. Read-side vocabulary (in the value and user_reacted response fields): LIKE, PRAISE, APPRECIATION, EMPATHY, INTEREST, ENTERTAINMENT. Confirmed write\u2192read mappings: like=LIKE, celebrate=PRAISE, insightful=INTEREST. (support, love, and funny are valid write values; their read-side pairings are unconfirmed.)"
388
392
  },
393
+ reactionAlias: {
394
+ type: "string",
395
+ alias: "reaction",
396
+ description: "Deprecated: pass the reaction as the positional <reaction> instead. --reaction still works."
397
+ },
389
398
  "as-organization": {
390
399
  type: "string",
391
400
  description: "React on behalf of an organization/company page you administer \u2014 pass that page's numeric id or URN."
@@ -474,7 +483,7 @@ var postUnreactCommand = defineCommand({
474
483
  }
475
484
  });
476
485
  var postUserPostsCommand = defineCommand({
477
- meta: { name: "user-posts", description: "List a member's own posts (accepts 'me')." },
486
+ meta: { name: "user-posts", description: "List a member's own posts (accepts 'me'). A very recent create/delete may take a few minutes to appear or clear here (LinkedIn-side indexing); `post get <post_id>` reflects it immediately." },
478
487
  args: {
479
488
  ...GLOBAL_FLAGS,
480
489
  userId: { type: "positional", description: "Member identifier (URL, slug, provider id, or 'me')." }
@@ -507,7 +516,7 @@ var postCommand = defineCommand({
507
516
  },
508
517
  async run() {
509
518
  process.stderr.write(
510
- 'Usage: curviate post <subcommand>\n get <post_id>\n create "<text>" [--attach <file>\u2026]\n react <post_id> --reaction <r> [--as-organization <org_id>]\n reactions <post_id>\n delete <post_id>\n unreact <post_id> <reaction>\n user-posts <user_id>\n user-reactions <user_id>\n\nComment operations moved to the `comment` command group.\n'
519
+ 'Usage: curviate post <subcommand>\n get <post_id>\n create "<text>" [--attach <file>\u2026]\n react <post_id> <reaction> [--as-organization <org_id>]\n reactions <post_id>\n delete <post_id>\n unreact <post_id> <reaction>\n user-posts <user_id>\n user-reactions <user_id>\n\nComment operations moved to the `comment` command group.\n'
511
520
  );
512
521
  }
513
522
  });
@@ -19,19 +19,20 @@ import {
19
19
  resolveIdentifier
20
20
  } from "./chunk-DMQZEPQE.js";
21
21
  import {
22
+ pageDelayFromFlags,
22
23
  streamAll
23
- } from "./chunk-DNTRQZBT.js";
24
+ } from "./chunk-EEMJDJ4W.js";
24
25
  import {
25
26
  createClient,
26
27
  renderError,
27
28
  renderSuccess,
28
29
  renderUnexpectedError,
29
30
  resolveEffectiveConfig
30
- } from "./chunk-JXF47TRY.js";
31
+ } from "./chunk-M33MI53G.js";
31
32
  import {
32
33
  GLOBAL_FLAGS,
33
34
  WRITE_SINGLE_FLAGS
34
- } from "./chunk-4JHGVY7R.js";
35
+ } from "./chunk-TMU3CSPR.js";
35
36
 
36
37
  // src/commands/profile.ts
37
38
  import { defineCommand } from "citty";
@@ -133,7 +134,8 @@ async function runProfileMe(client, flags, out) {
133
134
  const fn = (p) => ns.posts.listUserPosts("me", p);
134
135
  for await (const item of streamAll(fn, params2, {
135
136
  maxPages,
136
- out
137
+ out,
138
+ pageDelayMs: pageDelayFromFlags(flags)
137
139
  })) {
138
140
  out.stdout.write(JSON.stringify(item) + "\n");
139
141
  }
@@ -146,7 +148,8 @@ async function runProfileMe(client, flags, out) {
146
148
  const fn = (p) => ns.comments.listUserComments("me", p);
147
149
  for await (const item of streamAll(fn, params2, {
148
150
  maxPages,
149
- out
151
+ out,
152
+ pageDelayMs: pageDelayFromFlags(flags)
150
153
  })) {
151
154
  out.stdout.write(JSON.stringify(item) + "\n");
152
155
  }
@@ -159,7 +162,8 @@ async function runProfileMe(client, flags, out) {
159
162
  const fn = (p) => ns.posts.listUserReactions("me", p);
160
163
  for await (const item of streamAll(fn, params2, {
161
164
  maxPages,
162
- out
165
+ out,
166
+ pageDelayMs: pageDelayFromFlags(flags)
163
167
  })) {
164
168
  out.stdout.write(JSON.stringify(item) + "\n");
165
169
  }
@@ -172,7 +176,8 @@ async function runProfileMe(client, flags, out) {
172
176
  const fn = (p) => ns.users.listFollowers("me", p);
173
177
  for await (const item of streamAll(fn, params2, {
174
178
  maxPages,
175
- out
179
+ out,
180
+ pageDelayMs: pageDelayFromFlags(flags)
176
181
  })) {
177
182
  out.stdout.write(JSON.stringify(item) + "\n");
178
183
  }
@@ -262,7 +267,8 @@ async function runProfileGet(client, flags, out) {
262
267
  const fn = (p) => ns.posts.listUserPosts(postId, p);
263
268
  for await (const item of streamAll(fn, params, {
264
269
  maxPages,
265
- out
270
+ out,
271
+ pageDelayMs: pageDelayFromFlags(flags)
266
272
  })) {
267
273
  out.stdout.write(JSON.stringify(item) + "\n");
268
274
  }
@@ -278,7 +284,8 @@ async function runProfileGet(client, flags, out) {
278
284
  const fn = (p) => ns.comments.listUserComments(resolvedId, p);
279
285
  for await (const item of streamAll(fn, params, {
280
286
  maxPages,
281
- out
287
+ out,
288
+ pageDelayMs: pageDelayFromFlags(flags)
282
289
  })) {
283
290
  out.stdout.write(JSON.stringify(item) + "\n");
284
291
  }
@@ -294,7 +301,8 @@ async function runProfileGet(client, flags, out) {
294
301
  const fn = (p) => ns.posts.listUserReactions(resolvedId, p);
295
302
  for await (const item of streamAll(fn, params, {
296
303
  maxPages,
297
- out
304
+ out,
305
+ pageDelayMs: pageDelayFromFlags(flags)
298
306
  })) {
299
307
  out.stdout.write(JSON.stringify(item) + "\n");
300
308
  }
@@ -310,7 +318,8 @@ async function runProfileGet(client, flags, out) {
310
318
  const fn = (p) => ns.users.listFollowers(resolvedId, p);
311
319
  for await (const item of streamAll(fn, params, {
312
320
  maxPages,
313
- out
321
+ out,
322
+ pageDelayMs: pageDelayFromFlags(flags)
314
323
  })) {
315
324
  out.stdout.write(JSON.stringify(item) + "\n");
316
325
  }
@@ -357,7 +366,8 @@ async function runProfileRelations(client, flags, out) {
357
366
  const fn = (p) => ns.users.listRelations(p);
358
367
  for await (const item of streamAll(fn, params, {
359
368
  maxPages,
360
- out
369
+ out,
370
+ pageDelayMs: pageDelayFromFlags(flags)
361
371
  })) {
362
372
  out.stdout.write(JSON.stringify(item) + "\n");
363
373
  }
@@ -378,33 +388,31 @@ async function runProfileRelations(client, flags, out) {
378
388
  }
379
389
  async function runProfileEndorse(client, flags, out) {
380
390
  const accountId = requireAccount(flags.account, out);
381
- const rawId = flags.id ?? "";
382
- const resolvedId = resolveIdentifier(rawId);
391
+ const ns = client.account(accountId);
383
392
  const skillId = flags["endorsement-id"] ?? "";
384
393
  const outOpts = resolveOutputOpts(flags);
394
+ let providerId;
395
+ try {
396
+ providerId = await resolveMemberProviderId(ns, flags.id ?? "");
397
+ } catch (err) {
398
+ await handleSdkError(err, outOpts, out);
399
+ return;
400
+ }
385
401
  if (flags.preview) {
386
402
  const preview = buildPreviewOutput({
387
403
  method: "users.endorseSkill",
388
- args: { id: resolvedId },
404
+ args: { id: providerId },
389
405
  body: { endorsement_id: skillId },
390
406
  account: accountId
391
407
  });
392
408
  out.stdout.write(JSON.stringify(preview) + "\n");
393
409
  return;
394
410
  }
395
- const ns = client.account(accountId);
396
411
  try {
397
- const result = await ns.users.endorseSkill(resolvedId, { endorsement_id: skillId });
412
+ const result = await ns.users.endorseSkill(providerId, { endorsement_id: skillId });
398
413
  renderSuccess(result, outOpts, out);
399
414
  } catch (err) {
400
- const { CurviateError } = await import("@curviate/sdk");
401
- if (err instanceof CurviateError) {
402
- const { getExitCode } = await import("./exit-codes-SL3GQF7W.js");
403
- renderError(err, outOpts, out);
404
- process.exit(getExitCode(err.code));
405
- }
406
- renderUnexpectedError(err, out);
407
- process.exit(1);
415
+ await handleSdkError(err, outOpts, out);
408
416
  }
409
417
  }
410
418
  async function handleSdkError(err, outOpts, out) {
@@ -527,7 +535,8 @@ async function runProfileFollowers(client, flags, out) {
527
535
  const fn = (p) => ns.users.listFollowers(resolvedId, p);
528
536
  for await (const item of streamAll(fn, params, {
529
537
  maxPages,
530
- out
538
+ out,
539
+ pageDelayMs: pageDelayFromFlags(flags)
531
540
  })) {
532
541
  out.stdout.write(JSON.stringify(item) + "\n");
533
542
  }
@@ -555,7 +564,8 @@ async function runProfileFollowing(client, flags, out) {
555
564
  const fn = (p) => ns.users.listFollowing(resolvedId, p);
556
565
  for await (const item of streamAll(fn, params, {
557
566
  maxPages,
558
- out
567
+ out,
568
+ pageDelayMs: pageDelayFromFlags(flags)
559
569
  })) {
560
570
  out.stdout.write(JSON.stringify(item) + "\n");
561
571
  }
@@ -639,7 +649,7 @@ var profileEndorseCommand = defineCommand({
639
649
  meta: { name: "endorse", description: "Endorse a skill on a member's profile." },
640
650
  args: {
641
651
  ...GLOBAL_FLAGS,
642
- id: { type: "positional", description: "Member identifier (URL, slug, or URN)." },
652
+ id: { type: "positional", description: "Member identifier (URL, slug, or provider id). A URL/slug is resolved to the provider id automatically (a slug is not accepted directly by the endorse endpoint)." },
643
653
  "endorsement-id": {
644
654
  type: "string",
645
655
  description: "Endorsement ID to endorse \u2014 get it from the target's skills section via `profile <id> --sections linkedin_skills`.",