chirpie 1.0.43 → 1.0.44

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 (2) hide show
  1. package/dist/index.js +17 -2
  2. package/package.json +2 -2
package/dist/index.js CHANGED
@@ -333,6 +333,7 @@ var threadCommand = new Command4("thread").description("Create a thread").argume
333
333
 
334
334
  // src/commands/posts.ts
335
335
  import { Command as Command5 } from "commander";
336
+ import { postFailureReason } from "@chirpie/sdk";
336
337
 
337
338
  // src/lib/flags.ts
338
339
  function wantsJson(opts, cmd) {
@@ -357,7 +358,10 @@ var postsCommand = new Command5("posts").description("List, get, update, or dele
357
358
  id: p.id.slice(0, 8),
358
359
  status: p.status,
359
360
  text: p.text.length > 50 ? p.text.slice(0, 50) + "..." : p.text,
360
- created: p.created_at.slice(0, 10)
361
+ created: p.created_at.slice(0, 10),
362
+ // Why a post is not where you expected it. Empty for the ones
363
+ // that are exactly where you left them.
364
+ issue: postFailureReason(p) ?? ""
361
365
  }))
362
366
  );
363
367
  }
@@ -380,6 +384,10 @@ postsCommand.command("get <id>").description("Get a post by ID").option("--json"
380
384
  if (post.scheduled_at) console.log(`Scheduled: ${post.scheduled_at}`);
381
385
  if (post.published_at) console.log(`Published: ${post.published_at}`);
382
386
  if (post.platform_post_id) console.log(`Platform Post ID: ${post.platform_post_id}`);
387
+ if (post.platform_post_url) console.log(`URL: ${post.platform_post_url}`);
388
+ if (post.retry_count > 0) console.log(`Attempts: ${post.retry_count}`);
389
+ const issue = postFailureReason(post);
390
+ if (issue) console.log(`Issue: ${issue}`);
383
391
  }
384
392
  } catch (err) {
385
393
  error(err instanceof Error ? err.message : "Failed to get post");
@@ -525,7 +533,7 @@ var accountsCommand = new Command6("accounts").description("List connected socia
525
533
  // Inactive accounts are listed too, so a Facebook Page that was
526
534
  // connected past the plan's account limit is visible and can be
527
535
  // switched on with `chirpie accounts activate <id>`.
528
- note: a.is_active ? "" : a.inactive_reason === "plan_limit" ? "over plan limit" : ""
536
+ note: a.is_active ? "" : inactiveNote(a.inactive_reason)
529
537
  }))
530
538
  );
531
539
  }
@@ -534,6 +542,13 @@ var accountsCommand = new Command6("accounts").description("List connected socia
534
542
  process.exit(1);
535
543
  }
536
544
  });
545
+ function inactiveNote(reason) {
546
+ if (reason === "plan_limit") return "over plan limit";
547
+ if (reason === "token_revoked" || reason === "token_expired" || reason === "reauth_required") {
548
+ return "needs reconnecting";
549
+ }
550
+ return "";
551
+ }
537
552
  accountsCommand.command("activate").argument("<id>", "Account ID (from `chirpie accounts`)").description("Activate a connected account so it can publish").option("--json", "Output raw JSON").action(async (id, opts, cmd) => {
538
553
  const client = getClient();
539
554
  try {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "chirpie",
3
- "version": "1.0.43",
3
+ "version": "1.0.44",
4
4
  "description": "Chirpie CLI: post to social media from the command line",
5
5
  "repository": {
6
6
  "type": "git",
@@ -44,7 +44,7 @@
44
44
  ],
45
45
  "license": "MIT",
46
46
  "dependencies": {
47
- "@chirpie/sdk": "^1.0.40",
47
+ "@chirpie/sdk": "^1.0.41",
48
48
  "commander": "^13"
49
49
  },
50
50
  "devDependencies": {