Adding some API fixes.
This commit is contained in:
parent
b356f750e1
commit
5cf9d8a134
5 changed files with 24 additions and 8 deletions
|
@ -1,4 +0,0 @@
|
|||
module.exports = Object.assign(require("eslint-plugin-prettier"), {
|
||||
arrowParens: "avoid",
|
||||
semi: true,
|
||||
});
|
4
.prettierrc.json
Normal file
4
.prettierrc.json
Normal file
|
@ -0,0 +1,4 @@
|
|||
{
|
||||
"arrowParens": "avoid",
|
||||
"semi": true
|
||||
}
|
|
@ -11,7 +11,7 @@
|
|||
"scripts": {
|
||||
"build": "tsc",
|
||||
"docs": "typedoc src/index.ts --sourcefile-url-prefix 'https://github.com/LemmyNet/lemmy-js-client/tree/main/src/'",
|
||||
"lint": "tsc --noEmit && eslint --report-unused-disable-directives --ext .js,.ts,.tsx src",
|
||||
"lint": "tsc --noEmit && eslint --report-unused-disable-directives --ext .js,.ts,.tsx src && prettier --check src",
|
||||
"prepare": "yarn run build && husky install"
|
||||
},
|
||||
"repository": "https://github.com/LemmyNet/lemmy-js-client",
|
||||
|
|
|
@ -45,6 +45,11 @@ export class GetCommunityResponse {
|
|||
@Type(() => CommunityModeratorView)
|
||||
moderators: CommunityModeratorView[];
|
||||
online: number;
|
||||
discussion_languages: number[];
|
||||
@Transform(({ value }) => toOption(value), { toClassOnly: true })
|
||||
@Transform(({ value }) => toUndefined(value), { toPlainOnly: true })
|
||||
@Expose()
|
||||
default_post_language: Option<number>;
|
||||
}
|
||||
|
||||
export class CreateCommunity {
|
||||
|
@ -70,6 +75,10 @@ export class CreateCommunity {
|
|||
@Transform(({ value }) => toUndefined(value), { toPlainOnly: true })
|
||||
@Expose()
|
||||
posting_restricted_to_mods: Option<boolean>;
|
||||
@Transform(({ value }) => toOption(value), { toClassOnly: true })
|
||||
@Transform(({ value }) => toUndefined(value), { toPlainOnly: true })
|
||||
@Expose()
|
||||
discussion_languages: Option<number[]>;
|
||||
auth: string;
|
||||
|
||||
constructor(init: CreateCommunity) {
|
||||
|
@ -195,6 +204,10 @@ export class EditCommunity {
|
|||
@Transform(({ value }) => toUndefined(value), { toPlainOnly: true })
|
||||
@Expose()
|
||||
posting_restricted_to_mods: Option<boolean>;
|
||||
@Transform(({ value }) => toOption(value), { toClassOnly: true })
|
||||
@Transform(({ value }) => toUndefined(value), { toPlainOnly: true })
|
||||
@Expose()
|
||||
discussion_languages: Option<number[]>;
|
||||
auth: string;
|
||||
|
||||
constructor(init: EditCommunity) {
|
||||
|
|
|
@ -221,7 +221,6 @@ export class CreateSite {
|
|||
@Transform(({ value }) => toUndefined(value), { toPlainOnly: true })
|
||||
@Expose()
|
||||
application_email_admins: Option<boolean>;
|
||||
auth: string;
|
||||
@Transform(({ value }) => toOption(value), { toClassOnly: true })
|
||||
@Transform(({ value }) => toUndefined(value), { toPlainOnly: true })
|
||||
@Expose()
|
||||
|
@ -318,6 +317,11 @@ export class CreateSite {
|
|||
@Transform(({ value }) => toUndefined(value), { toPlainOnly: true })
|
||||
@Expose()
|
||||
blocked_instances: Option<string[]>;
|
||||
@Transform(({ value }) => toOption(value), { toClassOnly: true })
|
||||
@Transform(({ value }) => toUndefined(value), { toPlainOnly: true })
|
||||
@Expose()
|
||||
taglines: Option<string[]>;
|
||||
auth: string;
|
||||
constructor(init: CreateSite) {
|
||||
Object.assign(this, init);
|
||||
}
|
||||
|
@ -555,8 +559,7 @@ export class MyUserInfo {
|
|||
community_blocks: CommunityBlockView[];
|
||||
@Type(() => PersonBlockView)
|
||||
person_blocks: PersonBlockView[];
|
||||
@Type(() => Language)
|
||||
discussion_languages: Language[];
|
||||
discussion_languages: number[];
|
||||
}
|
||||
|
||||
export class LeaveAdmin {
|
||||
|
|
Loading…
Reference in a new issue