From 8d0b25d8629203bc9731d937d451fd7c829823b2 Mon Sep 17 00:00:00 2001 From: Dessalines Date: Wed, 17 Aug 2022 19:29:58 -0400 Subject: [PATCH] Distinguish (#73) * Add distinguish * v0.17.0-rc.41 --- package.json | 2 +- src/interfaces/api/comment.ts | 12 +++++++++++- src/interfaces/source.ts | 1 + 3 files changed, 13 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index 98a852d..2bb2508 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "lemmy-js-client", "description": "A javascript / typescript client for Lemmy", - "version": "0.17.0-rc.39", + "version": "0.17.0-rc.41", "author": "Dessalines ", "license": "AGPL-3.0", "main": "./dist/index.js", diff --git a/src/interfaces/api/comment.ts b/src/interfaces/api/comment.ts index 2c37220..423dd7d 100644 --- a/src/interfaces/api/comment.ts +++ b/src/interfaces/api/comment.ts @@ -27,8 +27,18 @@ export class CreateComment { } export class EditComment { - content: string; comment_id: number; + @Transform(({ value }) => toOption(value), { toClassOnly: true }) + @Transform(({ value }) => toUndefined(value), { toPlainOnly: true }) + @Expose() + content: Option; + /** + * "Distinguishes" a comment, or speak officially. Only doable by community mods or admins. + */ + @Transform(({ value }) => toOption(value), { toClassOnly: true }) + @Transform(({ value }) => toUndefined(value), { toPlainOnly: true }) + @Expose() + distinguished: Option; /** * An optional front end ID, to tell which is comment is coming back. */ diff --git a/src/interfaces/source.ts b/src/interfaces/source.ts index 44a5a06..49120bd 100644 --- a/src/interfaces/source.ts +++ b/src/interfaces/source.ts @@ -454,6 +454,7 @@ export class Comment { ap_id: string; local: boolean; path: string; + distinguished: boolean; } export class PersonMention {