chirpie 1.0.21 → 1.0.23

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 +35 -1
  2. package/package.json +2 -2
package/dist/index.js CHANGED
@@ -407,7 +407,11 @@ var accountsCommand = new Command6("accounts").description("List connected socia
407
407
  platform: a.platform,
408
408
  username: a.platform === "x" ? `@${a.username}` : a.username,
409
409
  name: a.display_name ?? "",
410
- active: a.is_active ? "\u2713" : "\u2717"
410
+ active: a.is_active ? "\u2713" : "\u2717",
411
+ // Inactive accounts are listed too, so a Facebook Page that was
412
+ // connected past the plan's account limit is visible and can be
413
+ // switched on with `chirpie accounts activate <id>`.
414
+ note: a.is_active ? "" : a.inactive_reason === "plan_limit" ? "over plan limit" : ""
411
415
  }))
412
416
  );
413
417
  }
@@ -416,6 +420,36 @@ var accountsCommand = new Command6("accounts").description("List connected socia
416
420
  process.exit(1);
417
421
  }
418
422
  });
423
+ 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) => {
424
+ const client = getClient();
425
+ try {
426
+ const account = await client.activateAccount(id);
427
+ if (opts.json) {
428
+ json(account);
429
+ } else {
430
+ success(`Activated ${account.display_name ?? account.username} (${account.platform})`);
431
+ }
432
+ } catch (err) {
433
+ error(err instanceof Error ? err.message : "Failed to activate account");
434
+ process.exit(1);
435
+ }
436
+ });
437
+ accountsCommand.command("deactivate").argument("<id>", "Account ID (from `chirpie accounts`)").description("Deactivate a connected account (stays connected, frees a plan slot)").option("--json", "Output raw JSON").action(async (id, opts) => {
438
+ const client = getClient();
439
+ try {
440
+ const account = await client.deactivateAccount(id);
441
+ if (opts.json) {
442
+ json(account);
443
+ } else {
444
+ success(
445
+ `Deactivated ${account.display_name ?? account.username} (${account.platform})`
446
+ );
447
+ }
448
+ } catch (err) {
449
+ error(err instanceof Error ? err.message : "Failed to deactivate account");
450
+ process.exit(1);
451
+ }
452
+ });
419
453
  accountsCommand.command("connect-x").description("Connect a new X/Twitter account via OAuth").action(async () => {
420
454
  const client = getClient();
421
455
  try {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "chirpie",
3
- "version": "1.0.21",
3
+ "version": "1.0.23",
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.19",
47
+ "@chirpie/sdk": "^1.0.21",
48
48
  "commander": "^13"
49
49
  },
50
50
  "devDependencies": {