chirpie 1.1.1 → 1.1.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.
Files changed (2) hide show
  1. package/dist/index.js +13 -4
  2. package/package.json +2 -2
package/dist/index.js CHANGED
@@ -1249,7 +1249,7 @@ for (const { cmd, label } of comingSoonCli) {
1249
1249
  }
1250
1250
 
1251
1251
  // src/commands/comments.ts
1252
- import { Command as Command7 } from "commander";
1252
+ import { Command as Command7, Option } from "commander";
1253
1253
  var PREVIEW_CHARS = 60;
1254
1254
  function commentAuthorLabel(comment) {
1255
1255
  const displayName = comment.author.display_name?.trim();
@@ -1259,14 +1259,21 @@ function commentAuthorLabel(comment) {
1259
1259
  return "Unknown commenter";
1260
1260
  }
1261
1261
  function commentRowText(comment) {
1262
- if (comment.deleted) return "[deleted]";
1263
1262
  const flat = comment.text.replace(/\s+/gu, " ").trim();
1264
1263
  const chars = [...flat];
1265
1264
  if (chars.length <= PREVIEW_CHARS) return flat;
1266
1265
  return chars.slice(0, PREVIEW_CHARS).join("").trimEnd() + "\u2026";
1267
1266
  }
1267
+ function commentState(comment) {
1268
+ if (comment.deleted) return "deleted";
1269
+ if (comment.hidden) return "hidden";
1270
+ return "";
1271
+ }
1268
1272
  var commentsCommand = new Command7("comments").description("List, reply to, hide, or delete the comments on a post").option("--json", "Output raw JSON");
1269
- commentsCommand.command("list").description("List the comments on a post you published").argument("<post_id>", "Post ID").option("--limit <n>", "Comments to show (default 25, max 100)").option("--cursor <cursor>", "The next_cursor from the previous page").option("--since <datetime>", "Only comments posted after this ISO 8601 time").option("--no-sync", "Show the stored comments without refreshing them").option("--hidden", "Include comments you have hidden").option("--json", "Output raw JSON").action(async (postId, opts, cmd) => {
1273
+ commentsCommand.command("list").description("List the comments on a post you published").argument("<post_id>", "Post ID").option("--limit <n>", "Comments to show (default 25, max 100)").option("--cursor <cursor>", "The next_cursor from the previous page").option("--since <datetime>", "Only comments posted after this ISO 8601 time").option("--no-sync", "Show the stored comments without refreshing them").option("--include-hidden", "Include comments you have hidden").option(
1274
+ "--include-deleted",
1275
+ "Include deleted comments, with the last text Chirpie stored for them"
1276
+ ).addOption(new Option("--hidden").hideHelp()).option("--json", "Output raw JSON").action(async (postId, opts, cmd) => {
1270
1277
  const client = getClient();
1271
1278
  try {
1272
1279
  const result = await client.listComments(postId, {
@@ -1277,7 +1284,8 @@ commentsCommand.command("list").description("List the comments on a post you pub
1277
1284
  // otherwise, which is not the same as asking for a refresh now: the
1278
1285
  // default is the server's own `auto`.
1279
1286
  sync: opts.sync === false ? false : void 0,
1280
- include_hidden: opts.hidden ? true : void 0
1287
+ include_hidden: opts.includeHidden || opts.hidden ? true : void 0,
1288
+ include_deleted: opts.includeDeleted ? true : void 0
1281
1289
  });
1282
1290
  if (wantsJson(opts, cmd)) {
1283
1291
  json(result);
@@ -1292,6 +1300,7 @@ commentsCommand.command("list").description("List the comments on a post you pub
1292
1300
  author: commentAuthorLabel(comment),
1293
1301
  time: comment.created_at.slice(0, 16).replace("T", " "),
1294
1302
  text: commentRowText(comment),
1303
+ state: commentState(comment),
1295
1304
  replied: comment.replied ? "\u2713" : ""
1296
1305
  }))
1297
1306
  );
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "chirpie",
3
- "version": "1.1.1",
3
+ "version": "1.1.2",
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.1.1",
47
+ "@chirpie/sdk": "^1.1.2",
48
48
  "commander": "^13"
49
49
  },
50
50
  "devDependencies": {