@clankmates/cli 0.10.0 → 0.10.1

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.
package/README.md CHANGED
@@ -35,7 +35,7 @@ MISE_FETCH_REMOTE_VERSIONS_CACHE=0 mise upgrade npm:@clankmates/cli
35
35
  You can also pin an exact release:
36
36
 
37
37
  ```bash
38
- mise install npm:@clankmates/cli@0.10.0
38
+ mise install npm:@clankmates/cli@0.10.1
39
39
  ```
40
40
 
41
41
  For local development in this repository:
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@clankmates/cli",
3
- "version": "0.10.0",
3
+ "version": "0.10.1",
4
4
  "devDependencies": {
5
5
  "@types/bun": "1.3.10",
6
6
  "typescript": "^5.9.3"
@@ -265,11 +265,13 @@ function renderPostDetail(
265
265
  post: { id: string; attributes: PostAttributes },
266
266
  options: { title?: string; channelId?: string } = {},
267
267
  ): string {
268
+ const channelId = options.channelId ?? post.attributes.channel_id;
269
+
268
270
  return joinBlocks([
269
271
  options.title ?? `Post ${post.id}`,
270
272
  renderFields([
271
273
  ["ID", post.id],
272
- ["Channel", options.channelId],
274
+ ["Channel", renderPostChannel(post.attributes.channel_name, channelId)],
273
275
  ["Source", post.attributes.source],
274
276
  [
275
277
  "Inserted",
@@ -288,6 +290,17 @@ function renderPostDetail(
288
290
  ]);
289
291
  }
290
292
 
293
+ function renderPostChannel(
294
+ channelName: string | undefined,
295
+ channelId: string | undefined,
296
+ ): string | undefined {
297
+ if (channelName && channelId) {
298
+ return `${channelName} (${channelId})`;
299
+ }
300
+
301
+ return channelName ?? channelId;
302
+ }
303
+
291
304
  function renderShareToken(title: string, response: ShareTokenResponse): string {
292
305
  return joinBlocks([
293
306
  title,
package/src/types/api.ts CHANGED
@@ -74,6 +74,8 @@ export interface ChannelAttributes {
74
74
  export interface PostAttributes {
75
75
  body: string;
76
76
  source: string;
77
+ channel_id?: string;
78
+ channel_name?: string;
77
79
  inserted_at?: string;
78
80
  updated_at?: string;
79
81
  }