@curviate/cli 0.14.0 → 0.15.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.
@@ -1,17 +1,22 @@
1
1
  #!/usr/bin/env node
2
- import {
3
- AttachError,
4
- readAttachment
5
- } from "./chunk-Q43HZUN3.js";
6
2
  import {
7
3
  resolveTextOrStdin
8
4
  } from "./chunk-U7Y4EXHT.js";
5
+ import {
6
+ resolveMemberOrMeProviderId
7
+ } from "./chunk-QJZ3LWOX.js";
8
+ import {
9
+ AttachError,
10
+ readAttachment,
11
+ toAttachmentPayload
12
+ } from "./chunk-BGZW6B7G.js";
9
13
  import {
10
14
  buildPreviewOutput
11
15
  } from "./chunk-R3VLWLVV.js";
16
+ import "./chunk-DMQZEPQE.js";
12
17
  import {
13
18
  streamAll
14
- } from "./chunk-GXTZION6.js";
19
+ } from "./chunk-DNTRQZBT.js";
15
20
  import {
16
21
  createClient,
17
22
  renderError,
@@ -21,7 +26,8 @@ import {
21
26
  } from "./chunk-JXF47TRY.js";
22
27
  import {
23
28
  GLOBAL_FLAGS,
24
- WRITE_FLAGS
29
+ WRITE_FLAGS,
30
+ WRITE_SINGLE_FLAGS
25
31
  } from "./chunk-4JHGVY7R.js";
26
32
 
27
33
  // src/commands/post.ts
@@ -72,39 +78,13 @@ function normalizeAttachPaths(attach) {
72
78
  async function handleSdkError(err, outOpts, out) {
73
79
  const { CurviateError } = await import("@curviate/sdk");
74
80
  if (err instanceof CurviateError) {
75
- const { getExitCode } = await import("./exit-codes-ZTY2NY3X.js");
81
+ const { getExitCode } = await import("./exit-codes-SL3GQF7W.js");
76
82
  renderError(err, outOpts, out);
77
83
  process.exit(getExitCode(err.code));
78
84
  }
79
85
  renderUnexpectedError(err, out);
80
86
  process.exit(1);
81
87
  }
82
- async function runPostList(client, flags, out) {
83
- rejectPreviewOnRead(flags.preview, out);
84
- const accountId = requireAccount(flags.account, out);
85
- const ns = client.account(accountId);
86
- const outOpts = resolveOutputOpts(flags);
87
- const all = flags.all ?? false;
88
- const maxPages = flags["max-pages"] ? parseInt(flags["max-pages"], 10) : 100;
89
- const params = buildPaginationParams(flags);
90
- try {
91
- if (all) {
92
- const fn = (p) => ns.posts.list(p);
93
- for await (const item of streamAll(fn, params, {
94
- maxPages,
95
- onTruncated: (n) => out.stderr.write(`Streaming truncated at ${n} page(s). Use --all --max-pages or --cursor for manual paging.
96
- `)
97
- })) {
98
- out.stdout.write(JSON.stringify(item) + "\n");
99
- }
100
- } else {
101
- const result = await ns.posts.list(params);
102
- renderSuccess(result, outOpts, out);
103
- }
104
- } catch (err) {
105
- await handleSdkError(err, outOpts, out);
106
- }
107
- }
108
88
  async function runPostGet(client, flags, out) {
109
89
  rejectPreviewOnRead(flags.preview, out);
110
90
  rejectAllOnNonPaginated(flags.all, out);
@@ -123,7 +103,6 @@ async function runPostCreate(client, flags, out, _readStdin) {
123
103
  const accountId = requireAccount(flags.account, out);
124
104
  const rawText = flags.text ?? "";
125
105
  const attachPaths = normalizeAttachPaths(flags.attach);
126
- const thumbPath = flags["video-thumbnail"];
127
106
  const text = await resolveTextOrStdin(rawText, out, _readStdin);
128
107
  let attachBuffers = [];
129
108
  try {
@@ -136,30 +115,11 @@ async function runPostCreate(client, flags, out, _readStdin) {
136
115
  }
137
116
  throw err;
138
117
  }
139
- let thumbBuffer;
140
- if (thumbPath) {
141
- try {
142
- thumbBuffer = await readAttachment(thumbPath);
143
- } catch (err) {
144
- if (err instanceof AttachError) {
145
- out.stderr.write(`error: ${err.message}
146
- `);
147
- process.exit(err.exitCode);
148
- }
149
- throw err;
150
- }
151
- }
152
118
  if (flags.preview) {
153
119
  const allAttachmentPreviews = attachBuffers.map((buf, i) => ({
154
120
  name: attachPaths[i] ? attachPaths[i].split("/").pop() ?? attachPaths[i] : `attachment_${i}`,
155
121
  buffer: buf
156
122
  }));
157
- if (thumbBuffer && thumbPath) {
158
- allAttachmentPreviews.push({
159
- name: `video_thumbnail:${thumbPath.split("/").pop() ?? thumbPath}`,
160
- buffer: thumbBuffer
161
- });
162
- }
163
123
  const preview = buildPreviewOutput({
164
124
  method: "posts.create",
165
125
  args: {},
@@ -170,13 +130,11 @@ async function runPostCreate(client, flags, out, _readStdin) {
170
130
  out.stdout.write(JSON.stringify(preview) + "\n");
171
131
  return;
172
132
  }
173
- const body = { text };
174
- if (attachBuffers.length > 0) {
175
- body["attachments"] = attachBuffers;
176
- }
177
- if (thumbBuffer) {
178
- body["video_thumbnail"] = thumbBuffer;
179
- }
133
+ const attachmentPayloads = attachBuffers.map((buf, i) => toAttachmentPayload(attachPaths[i], buf));
134
+ const body = {
135
+ text,
136
+ ...attachmentPayloads.length > 0 ? { attachments: attachmentPayloads } : {}
137
+ };
180
138
  const ns = client.account(accountId);
181
139
  const outOpts = resolveOutputOpts(flags);
182
140
  try {
@@ -186,53 +144,43 @@ async function runPostCreate(client, flags, out, _readStdin) {
186
144
  await handleSdkError(err, outOpts, out);
187
145
  }
188
146
  }
189
- async function runPostComment(client, flags, out, _readStdin) {
147
+ async function runPostReact(client, flags, out) {
190
148
  const accountId = requireAccount(flags.account, out);
191
149
  const postId = flags.postId ?? "";
192
- const rawText = flags.text ?? "";
193
- const replyTo = flags["reply-to"];
194
- const text = await resolveTextOrStdin(rawText, out, _readStdin);
195
- const attachPaths = normalizeAttachPaths(flags.attach);
196
- let attachBuffers = [];
197
- try {
198
- attachBuffers = await Promise.all(attachPaths.map((p) => readAttachment(p)));
199
- } catch (err) {
200
- if (err instanceof AttachError) {
201
- out.stderr.write(`error: ${err.message}
202
- `);
203
- process.exit(err.exitCode);
204
- }
205
- throw err;
150
+ const reaction = flags.reaction ?? "";
151
+ if (!VALID_REACTIONS.has(reaction)) {
152
+ out.stderr.write(
153
+ `error: --reaction must be one of: like, celebrate, support, love, insightful, funny. Got: "${reaction}"
154
+ `
155
+ );
156
+ process.exit(2);
157
+ return;
206
158
  }
207
- const body = { text };
208
- if (replyTo) body["comment_id"] = replyTo;
159
+ const asOrganization = flags["as-organization"];
160
+ const body = {
161
+ reaction,
162
+ ...asOrganization ? { react_as: asOrganization } : {}
163
+ };
209
164
  if (flags.preview) {
210
165
  const preview = buildPreviewOutput({
211
- method: "posts.comment",
166
+ method: "posts.react",
212
167
  args: { post_id: postId },
213
168
  body,
214
- account: accountId,
215
- attachments: attachBuffers.map((buf, i) => ({
216
- name: attachPaths[i] ? attachPaths[i].split("/").pop() ?? attachPaths[i] : `attachment_${i}`,
217
- buffer: buf
218
- }))
169
+ account: accountId
219
170
  });
220
171
  out.stdout.write(JSON.stringify(preview) + "\n");
221
172
  return;
222
173
  }
223
- if (attachBuffers.length > 0) {
224
- body["attachments"] = attachBuffers;
225
- }
226
174
  const ns = client.account(accountId);
227
175
  const outOpts = resolveOutputOpts(flags);
228
176
  try {
229
- const result = await ns.posts.comment(postId, body);
177
+ const result = await ns.posts.react(postId, body);
230
178
  renderSuccess(result, outOpts, out);
231
179
  } catch (err) {
232
180
  await handleSdkError(err, outOpts, out);
233
181
  }
234
182
  }
235
- async function runPostComments(client, flags, out) {
183
+ async function runPostReactions(client, flags, out) {
236
184
  rejectPreviewOnRead(flags.preview, out);
237
185
  const accountId = requireAccount(flags.account, out);
238
186
  const postId = flags.postId ?? "";
@@ -241,116 +189,140 @@ async function runPostComments(client, flags, out) {
241
189
  const all = flags.all ?? false;
242
190
  const maxPages = flags["max-pages"] ? parseInt(flags["max-pages"], 10) : 100;
243
191
  const params = buildPaginationParams(flags);
244
- if (flags["reply-to"]) params["comment_id"] = flags["reply-to"];
245
192
  try {
246
193
  if (all) {
247
- const fn = (p) => ns.posts.listComments(postId, p);
194
+ const fn = (p) => ns.posts.listReactions(postId, p);
248
195
  for await (const item of streamAll(fn, params, {
249
196
  maxPages,
250
- onTruncated: (n) => out.stderr.write(`Streaming truncated at ${n} page(s). Use --all --max-pages or --cursor for manual paging.
251
- `)
197
+ out
252
198
  })) {
253
199
  out.stdout.write(JSON.stringify(item) + "\n");
254
200
  }
255
201
  } else {
256
- const result = await ns.posts.listComments(postId, params);
202
+ const result = await ns.posts.listReactions(postId, params);
257
203
  renderSuccess(result, outOpts, out);
258
204
  }
259
205
  } catch (err) {
260
206
  await handleSdkError(err, outOpts, out);
261
207
  }
262
208
  }
263
- async function runPostReact(client, flags, out) {
209
+ async function runPostDelete(client, flags, out) {
210
+ const accountId = requireAccount(flags.account, out);
211
+ const postId = flags.postId ?? "";
212
+ if (flags.preview) {
213
+ const preview = buildPreviewOutput({ method: "posts.delete", args: { post_id: postId }, body: {}, account: accountId });
214
+ out.stdout.write(JSON.stringify(preview) + "\n");
215
+ return;
216
+ }
217
+ const ns = client.account(accountId);
218
+ const outOpts = resolveOutputOpts(flags);
219
+ try {
220
+ const result = await ns.posts.delete(postId);
221
+ renderSuccess(result, outOpts, out);
222
+ } catch (err) {
223
+ await handleSdkError(err, outOpts, out);
224
+ }
225
+ }
226
+ async function runPostUnreact(client, flags, out) {
264
227
  const accountId = requireAccount(flags.account, out);
265
228
  const postId = flags.postId ?? "";
266
229
  const reaction = flags.reaction ?? "";
267
230
  if (!VALID_REACTIONS.has(reaction)) {
268
231
  out.stderr.write(
269
- `error: --reaction must be one of: like, celebrate, support, love, insightful, funny. Got: "${reaction}"
232
+ `error: reaction must be one of: like, celebrate, support, love, insightful, funny. Got: "${reaction}"
270
233
  `
271
234
  );
272
235
  process.exit(2);
273
236
  return;
274
237
  }
275
- const commentId = flags["comment-id"];
276
- const asOrganization = flags["as-organization"];
277
- const body = { reaction };
278
- if (commentId) body["comment_id"] = commentId;
279
- if (asOrganization) body["as_organization"] = asOrganization;
238
+ const body = {
239
+ reaction
240
+ };
280
241
  if (flags.preview) {
281
- const preview = buildPreviewOutput({
282
- method: "posts.react",
283
- args: { post_id: postId },
284
- body,
285
- account: accountId
286
- });
242
+ const preview = buildPreviewOutput({ method: "posts.unreact", args: { post_id: postId }, body, account: accountId });
287
243
  out.stdout.write(JSON.stringify(preview) + "\n");
288
244
  return;
289
245
  }
290
246
  const ns = client.account(accountId);
291
247
  const outOpts = resolveOutputOpts(flags);
292
248
  try {
293
- const result = await ns.posts.react(postId, body);
249
+ const result = await ns.posts.unreact(postId, body);
294
250
  renderSuccess(result, outOpts, out);
295
251
  } catch (err) {
296
252
  await handleSdkError(err, outOpts, out);
297
253
  }
298
254
  }
299
- async function runPostReactions(client, flags, out) {
255
+ async function runPostUserPosts(client, flags, out) {
300
256
  rejectPreviewOnRead(flags.preview, out);
301
257
  const accountId = requireAccount(flags.account, out);
302
- const postId = flags.postId ?? "";
303
258
  const ns = client.account(accountId);
304
259
  const outOpts = resolveOutputOpts(flags);
260
+ let userId;
261
+ try {
262
+ userId = await resolveMemberOrMeProviderId(ns, flags.userId ?? "");
263
+ } catch (err) {
264
+ await handleSdkError(err, outOpts, out);
265
+ return;
266
+ }
305
267
  const all = flags.all ?? false;
306
268
  const maxPages = flags["max-pages"] ? parseInt(flags["max-pages"], 10) : 100;
307
269
  const params = buildPaginationParams(flags);
308
270
  try {
309
271
  if (all) {
310
- const fn = (p) => ns.posts.listReactions(postId, p);
272
+ const fn = (p) => ns.posts.listUserPosts(userId, p);
311
273
  for await (const item of streamAll(fn, params, {
312
274
  maxPages,
313
- onTruncated: (n) => out.stderr.write(`Streaming truncated at ${n} page(s). Use --all --max-pages or --cursor for manual paging.
314
- `)
275
+ out
315
276
  })) {
316
277
  out.stdout.write(JSON.stringify(item) + "\n");
317
278
  }
318
279
  } else {
319
- const result = await ns.posts.listReactions(postId, params);
280
+ const result = await ns.posts.listUserPosts(userId, params);
320
281
  renderSuccess(result, outOpts, out);
321
282
  }
322
283
  } catch (err) {
323
284
  await handleSdkError(err, outOpts, out);
324
285
  }
325
286
  }
326
- var postListCommand = defineCommand({
327
- meta: { name: "list", description: "List posts published by the account." },
328
- args: { ...GLOBAL_FLAGS },
329
- async run({ args }) {
330
- const flags = args;
331
- const cfg = await resolveEffectiveConfig({
332
- apiKey: flags["api-key"],
333
- baseUrl: flags["base-url"],
334
- timeout: flags.timeout,
335
- account: flags.account,
336
- profile: flags.profile
337
- });
338
- if (!cfg.apiKey) {
339
- process.stderr.write("error: no API key \u2014 run `curviate login` or pass --api-key.\n");
340
- process.exit(3);
287
+ async function runPostUserReactions(client, flags, out) {
288
+ rejectPreviewOnRead(flags.preview, out);
289
+ const accountId = requireAccount(flags.account, out);
290
+ const ns = client.account(accountId);
291
+ const outOpts = resolveOutputOpts(flags);
292
+ let userId;
293
+ try {
294
+ userId = await resolveMemberOrMeProviderId(ns, flags.userId ?? "");
295
+ } catch (err) {
296
+ await handleSdkError(err, outOpts, out);
297
+ return;
298
+ }
299
+ const all = flags.all ?? false;
300
+ const maxPages = flags["max-pages"] ? parseInt(flags["max-pages"], 10) : 100;
301
+ const params = buildPaginationParams(flags);
302
+ try {
303
+ if (all) {
304
+ const fn = (p) => ns.posts.listUserReactions(userId, p);
305
+ for await (const item of streamAll(fn, params, {
306
+ maxPages,
307
+ out
308
+ })) {
309
+ out.stdout.write(JSON.stringify(item) + "\n");
310
+ }
311
+ } else {
312
+ const result = await ns.posts.listUserReactions(userId, params);
313
+ renderSuccess(result, outOpts, out);
341
314
  }
342
- const client = createClient({ apiKey: cfg.apiKey, baseUrl: cfg.baseUrl, timeout: cfg.timeout });
343
- const out = buildOutputStreams();
344
- await runPostList(client, { ...flags, account: flags.account ?? cfg.account }, out);
315
+ } catch (err) {
316
+ await handleSdkError(err, outOpts, out);
345
317
  }
346
- });
318
+ }
347
319
  var postGetCommand = defineCommand({
348
320
  meta: { name: "get", description: "Get a post by id." },
349
321
  args: {
350
322
  ...GLOBAL_FLAGS,
351
323
  postId: {
352
324
  type: "positional",
353
- description: "Numeric post id, urn:li:activity:N, or full LinkedIn share URL (activity-<N>- extracted). POSTID is always the post's id. To list replies to a comment, use 'post comments <post_id> --reply-to <comment_id>'."
325
+ description: "Numeric post id, urn:li:activity:N, or full LinkedIn share URL (activity-<N>- extracted). POSTID is always the post's id. To list comments on a post, use 'comment list <post_id>'."
354
326
  }
355
327
  },
356
328
  async run({ args }) {
@@ -379,11 +351,7 @@ var postCreateCommand = defineCommand({
379
351
  text: { type: "positional", description: "Post body text. Pass - to read from stdin (enables multiline via heredoc or pipe)." },
380
352
  attach: {
381
353
  type: "string",
382
- description: "Image/video/document to attach (repeatable for images; use --video-thumbnail when attaching a video). Supported: jpg, png, gif, mp4, pdf."
383
- },
384
- "video-thumbnail": {
385
- type: "string",
386
- description: "Thumbnail image for a video attachment (required when attaching a video post)."
354
+ description: "Image/video/document to attach (repeatable for images; a single PDF produces a document post). Supported: jpg, png, gif, mp4, pdf."
387
355
  }
388
356
  },
389
357
  async run({ args }) {
@@ -404,92 +372,23 @@ var postCreateCommand = defineCommand({
404
372
  await runPostCreate(client, { ...flags, account: flags.account ?? cfg.account }, out);
405
373
  }
406
374
  });
407
- var postCommentCommand = defineCommand({
408
- meta: { name: "comment", description: "Comment on a post, or reply to a comment with --reply-to." },
409
- args: {
410
- // Write command: WRITE_FLAGS omits pagination/projection flags
411
- ...WRITE_FLAGS,
412
- postId: {
413
- type: "positional",
414
- description: "Numeric post id, urn:li:activity:N, or full LinkedIn share URL (activity-<N>- extracted). POSTID is always the post's id; use --reply-to <comment_id> to reply to a specific comment within this post."
415
- },
416
- text: { type: "positional", description: "Comment text (max ~1,250 characters per LinkedIn limits). Pass - to read from stdin." },
417
- attach: { type: "string", description: "Image to attach to the comment (optional; one image per comment)." },
418
- "reply-to": {
419
- type: "string",
420
- description: "Post as a reply to this comment id (omit for a top-level comment on the post)."
421
- }
422
- },
423
- async run({ args }) {
424
- const flags = args;
425
- const cfg = await resolveEffectiveConfig({
426
- apiKey: flags["api-key"],
427
- baseUrl: flags["base-url"],
428
- timeout: flags.timeout,
429
- account: flags.account,
430
- profile: flags.profile
431
- });
432
- if (!cfg.apiKey) {
433
- process.stderr.write("error: no API key \u2014 run `curviate login` or pass --api-key.\n");
434
- process.exit(3);
435
- }
436
- const client = createClient({ apiKey: cfg.apiKey, baseUrl: cfg.baseUrl, timeout: cfg.timeout });
437
- const out = buildOutputStreams();
438
- await runPostComment(client, { ...flags, account: flags.account ?? cfg.account }, out);
439
- }
440
- });
441
- var postCommentsCommand = defineCommand({
442
- meta: { name: "comments", description: "List comments on a post. Use --reply-to to fetch replies to a specific comment." },
443
- args: {
444
- ...GLOBAL_FLAGS,
445
- postId: {
446
- type: "positional",
447
- description: "Numeric post id, urn:li:activity:N, or full LinkedIn share URL (activity-<N>- extracted). POSTID is always the post's id; to fetch replies to a comment, use --reply-to <comment_id>."
448
- },
449
- "reply-to": {
450
- type: "string",
451
- description: "Filter replies under this comment id (omit to list top-level comments on the post)."
452
- }
453
- },
454
- async run({ args }) {
455
- const flags = args;
456
- const cfg = await resolveEffectiveConfig({
457
- apiKey: flags["api-key"],
458
- baseUrl: flags["base-url"],
459
- timeout: flags.timeout,
460
- account: flags.account,
461
- profile: flags.profile
462
- });
463
- if (!cfg.apiKey) {
464
- process.stderr.write("error: no API key \u2014 run `curviate login` or pass --api-key.\n");
465
- process.exit(3);
466
- }
467
- const client = createClient({ apiKey: cfg.apiKey, baseUrl: cfg.baseUrl, timeout: cfg.timeout });
468
- const out = buildOutputStreams();
469
- await runPostComments(client, { ...flags, account: flags.account ?? cfg.account }, out);
470
- }
471
- });
472
375
  var postReactCommand = defineCommand({
473
- meta: { name: "react", description: "React to a post or comment." },
376
+ meta: { name: "react", description: "React to a post." },
474
377
  args: {
475
378
  // Write command: WRITE_FLAGS omits pagination/projection flags
476
379
  ...WRITE_FLAGS,
477
380
  postId: {
478
381
  type: "positional",
479
- description: "Numeric post id, urn:li:activity:N, or full LinkedIn share URL (activity-<N>- extracted). POSTID is always the post's id; to react to a comment within the post, use --comment-id <comment_id>."
382
+ description: "Numeric post id, urn:li:activity:N, or full LinkedIn share URL (activity-<N>- extracted). POSTID is always the post's id."
480
383
  },
481
384
  reaction: {
482
385
  type: "string",
483
386
  required: true,
484
387
  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.)"
485
388
  },
486
- "comment-id": {
487
- type: "string",
488
- description: "React to this specific comment id within the post (omit to react to the post itself)."
489
- },
490
389
  "as-organization": {
491
390
  type: "string",
492
- description: "React on behalf of an organization page (org id from 'profile me' organizations)."
391
+ description: "React on behalf of an organization/company page you administer \u2014 pass that page's numeric id or URN."
493
392
  }
494
393
  },
495
394
  async run({ args }) {
@@ -537,30 +436,89 @@ var postReactionsCommand = defineCommand({
537
436
  await runPostReactions(client, { ...flags, account: flags.account ?? cfg.account }, out);
538
437
  }
539
438
  });
439
+ async function withClient(flags, fn) {
440
+ const cfg = await resolveEffectiveConfig({
441
+ apiKey: flags["api-key"],
442
+ baseUrl: flags["base-url"],
443
+ timeout: flags.timeout,
444
+ account: flags.account,
445
+ profile: flags.profile
446
+ });
447
+ if (!cfg.apiKey) {
448
+ process.stderr.write("error: no API key \u2014 run `curviate login` or pass --api-key.\n");
449
+ process.exit(3);
450
+ }
451
+ const client = createClient({ apiKey: cfg.apiKey, baseUrl: cfg.baseUrl, timeout: cfg.timeout });
452
+ const out = buildOutputStreams();
453
+ await fn(client, { ...flags, account: flags.account ?? cfg.account }, out);
454
+ }
455
+ var postDeleteCommand = defineCommand({
456
+ meta: { name: "delete", description: "Delete a post you own." },
457
+ args: {
458
+ ...WRITE_SINGLE_FLAGS,
459
+ postId: { type: "positional", description: "Post id, urn:li:activity:N, or full share URL." }
460
+ },
461
+ async run({ args }) {
462
+ await withClient(args, runPostDelete);
463
+ }
464
+ });
465
+ var postUnreactCommand = defineCommand({
466
+ meta: { name: "unreact", description: "Remove your reaction from a post." },
467
+ args: {
468
+ ...WRITE_SINGLE_FLAGS,
469
+ postId: { type: "positional", description: "Post id, urn:li:activity:N, or full share URL." },
470
+ reaction: { type: "positional", description: "Reaction to remove: like|celebrate|support|love|insightful|funny." }
471
+ },
472
+ async run({ args }) {
473
+ await withClient(args, runPostUnreact);
474
+ }
475
+ });
476
+ var postUserPostsCommand = defineCommand({
477
+ meta: { name: "user-posts", description: "List a member's own posts (accepts 'me')." },
478
+ args: {
479
+ ...GLOBAL_FLAGS,
480
+ userId: { type: "positional", description: "Member identifier (URL, slug, provider id, or 'me')." }
481
+ },
482
+ async run({ args }) {
483
+ await withClient(args, runPostUserPosts);
484
+ }
485
+ });
486
+ var postUserReactionsCommand = defineCommand({
487
+ meta: { name: "user-reactions", description: "List a member's own reactions (accepts 'me')." },
488
+ args: {
489
+ ...GLOBAL_FLAGS,
490
+ userId: { type: "positional", description: "Member identifier (URL, slug, provider id, or 'me')." }
491
+ },
492
+ async run({ args }) {
493
+ await withClient(args, runPostUserReactions);
494
+ }
495
+ });
540
496
  var postCommand = defineCommand({
541
497
  meta: { name: "post", description: "Create and manage LinkedIn posts." },
542
498
  subCommands: {
543
- list: postListCommand,
544
499
  get: postGetCommand,
545
500
  create: postCreateCommand,
546
- comment: postCommentCommand,
547
- comments: postCommentsCommand,
548
501
  react: postReactCommand,
549
- reactions: postReactionsCommand
502
+ reactions: postReactionsCommand,
503
+ delete: postDeleteCommand,
504
+ unreact: postUnreactCommand,
505
+ "user-posts": postUserPostsCommand,
506
+ "user-reactions": postUserReactionsCommand
550
507
  },
551
508
  async run() {
552
509
  process.stderr.write(
553
- 'Usage: curviate post <subcommand>\n list\n get <post_id>\n create "<text>" [--attach <file>\u2026] [--video-thumbnail <file>]\n comment <post_id> "<text>" [--attach <file>] [--reply-to <comment_id>]\n comments <post_id> [--reply-to <comment_id>]\n react <post_id> --reaction <r> [--comment-id <comment_id>] [--as-organization <org_id>]\n reactions <post_id>\n'
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'
554
511
  );
555
512
  }
556
513
  });
557
514
  export {
558
515
  postCommand,
559
- runPostComment,
560
- runPostComments,
561
516
  runPostCreate,
517
+ runPostDelete,
562
518
  runPostGet,
563
- runPostList,
564
519
  runPostReact,
565
- runPostReactions
520
+ runPostReactions,
521
+ runPostUnreact,
522
+ runPostUserPosts,
523
+ runPostUserReactions
566
524
  };