@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 +1 -1
- package/package.json +1 -1
- package/src/commands/post.ts +14 -1
- package/src/types/api.ts +2 -0
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.
|
|
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
package/src/commands/post.ts
CHANGED
|
@@ -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",
|
|
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,
|