From a7937e53f2737fbb107ad0cddce403479564f386 Mon Sep 17 00:00:00 2001 From: Dessalines Date: Fri, 12 Mar 2021 13:22:16 -0500 Subject: [PATCH 01/11] Update API to deal with new person table. Fixes #7 --- src/http.ts | 38 +++++----- src/interfaces/aggregates.ts | 4 +- src/interfaces/api/community.ts | 10 +-- src/interfaces/api/index.ts | 2 +- src/interfaces/api/{user.ts => person.ts} | 38 +++++----- src/interfaces/api/site.ts | 16 ++-- src/interfaces/others.ts | 8 +- src/interfaces/source.ts | 70 ++++++++---------- src/interfaces/views.ts | 89 ++++++++++++----------- src/websocket.ts | 26 +++---- 10 files changed, 150 insertions(+), 151 deletions(-) rename src/interfaces/api/{user.ts => person.ts} (86%) diff --git a/src/http.ts b/src/http.ts index 0efc481..c957e34 100644 --- a/src/http.ts +++ b/src/http.ts @@ -63,8 +63,8 @@ import { import { AddAdmin, AddAdminResponse, - BanUser, - BanUserResponse, + BanPerson, + BanPersonResponse, CreatePrivateMessage, DeleteAccount, DeletePrivateMessage, @@ -73,15 +73,15 @@ import { GetPrivateMessages, GetReplies, GetRepliesResponse, - GetUserDetails, - GetUserDetailsResponse, - GetUserMentions, - GetUserMentionsResponse, + GetPersonDetails, + GetPersonDetailsResponse, + GetPersonMentions, + GetPersonMentionsResponse, Login, LoginResponse, MarkAllAsRead, MarkPrivateMessageAsRead, - MarkUserMentionAsRead, + MarkPersonMentionAsRead, PasswordChange, PasswordReset, PasswordResetResponse, @@ -89,8 +89,8 @@ import { PrivateMessagesResponse, Register, SaveUserSettings, - UserMentionResponse, -} from './interfaces/api/user'; + PersonMentionResponse, +} from './interfaces/api/person'; enum HttpType { Get = 'GET', @@ -305,19 +305,21 @@ export class LemmyHttp { return this.wrapper(HttpType.Post, '/user/login', form); } - async getUserDetails(form: GetUserDetails): Promise { + async getPersonDetails( + form: GetPersonDetails + ): Promise { return this.wrapper(HttpType.Get, '/user', form); } - async getUserMentions( - form: GetUserMentions - ): Promise { + async getPersonMentions( + form: GetPersonMentions + ): Promise { return this.wrapper(HttpType.Get, '/user/mention', form); } - async markUserMentionAsRead( - form: MarkUserMentionAsRead - ): Promise { + async markPersonMentionAsRead( + form: MarkPersonMentionAsRead + ): Promise { return this.wrapper(HttpType.Post, '/user/mention/mark_as_read', form); } @@ -331,7 +333,7 @@ export class LemmyHttp { return this.wrapper(HttpType.Get, '/user/followed_communities', form); } - async banUser(form: BanUser): Promise { + async banPerson(form: BanPerson): Promise { return this.wrapper(HttpType.Post, '/user/ban', form); } @@ -355,7 +357,7 @@ export class LemmyHttp { return this.wrapper(HttpType.Post, '/user/mark_all_as_read', form); } - async saveUserSettings(form: SaveUserSettings): Promise { + async savePersonSettings(form: SaveUserSettings): Promise { return this.wrapper(HttpType.Put, '/user/save_user_settings', form); } diff --git a/src/interfaces/aggregates.ts b/src/interfaces/aggregates.ts index 01f5af7..43ca451 100644 --- a/src/interfaces/aggregates.ts +++ b/src/interfaces/aggregates.ts @@ -1,6 +1,6 @@ -export interface UserAggregates { +export interface PersonAggregates { id: number; - user_id: number; + person_id: number; post_count: number; post_score: number; comment_count: number; diff --git a/src/interfaces/api/community.ts b/src/interfaces/api/community.ts index e0de844..89c5a04 100644 --- a/src/interfaces/api/community.ts +++ b/src/interfaces/api/community.ts @@ -2,7 +2,7 @@ import { CommunityFollowerView, CommunityModeratorView, CommunityView, - UserViewSafe, + PersonViewSafe, } from '../views'; export interface GetCommunity { @@ -45,7 +45,7 @@ export interface ListCommunitiesResponse { export interface BanFromCommunity { community_id: number; - user_id: number; + person_id: number; ban: boolean; remove_data: boolean; // Removes/Restores their comments and posts for that community reason?: string; @@ -54,13 +54,13 @@ export interface BanFromCommunity { } export interface BanFromCommunityResponse { - user_view: UserViewSafe; + person_view: PersonViewSafe; banned: boolean; } export interface AddModToCommunity { community_id: number; - user_id: number; + person_id: number; added: boolean; auth: string; } @@ -115,6 +115,6 @@ export interface GetFollowedCommunitiesResponse { export interface TransferCommunity { community_id: number; - user_id: number; + person_id: number; auth: string; } diff --git a/src/interfaces/api/index.ts b/src/interfaces/api/index.ts index 673bc8d..08342a9 100644 --- a/src/interfaces/api/index.ts +++ b/src/interfaces/api/index.ts @@ -2,5 +2,5 @@ export * from './comment'; export * from './community'; export * from './post'; export * from './site'; -export * from './user'; +export * from './person'; export * from './websocket'; diff --git a/src/interfaces/api/user.ts b/src/interfaces/api/person.ts similarity index 86% rename from src/interfaces/api/user.ts rename to src/interfaces/api/person.ts index c3c96c3..0613b40 100644 --- a/src/interfaces/api/user.ts +++ b/src/interfaces/api/person.ts @@ -4,8 +4,8 @@ import { CommunityModeratorView, PostView, PrivateMessageView, - UserMentionView, - UserViewSafe, + PersonMentionView, + PersonViewSafe, } from '../views'; export interface Login { @@ -68,8 +68,8 @@ export interface LoginResponse { /** * `username` can only be used for local users. To get details for a federated user, pass `user_id` instead. */ -export interface GetUserDetails { - user_id?: number; +export interface GetPersonDetails { + person_id?: number; username?: string; sort: string; page?: number; @@ -79,8 +79,8 @@ export interface GetUserDetails { auth?: string; } -export interface GetUserDetailsResponse { - user_view: UserViewSafe; +export interface GetPersonDetailsResponse { + person_view: PersonViewSafe; follows: CommunityFollowerView[]; moderates: CommunityModeratorView[]; comments: CommentView[]; @@ -91,8 +91,8 @@ export interface GetRepliesResponse { replies: CommentView[]; } -export interface GetUserMentionsResponse { - mentions: UserMentionView[]; +export interface GetPersonMentionsResponse { + mentions: PersonMentionView[]; } export interface MarkAllAsRead { @@ -100,17 +100,17 @@ export interface MarkAllAsRead { } export interface AddAdmin { - user_id: number; + local_user_id: number; added: boolean; auth: string; } export interface AddAdminResponse { - admins: UserViewSafe[]; + admins: PersonViewSafe[]; } -export interface BanUser { - user_id: number; +export interface BanPerson { + person_id: number; ban: boolean; remove_data: boolean; // Removes/Restores their comments, posts, and communities reason?: string; @@ -118,8 +118,8 @@ export interface BanUser { auth: string; } -export interface BanUserResponse { - user_view: UserViewSafe; +export interface BanPersonResponse { + person_view: PersonViewSafe; banned: boolean; } @@ -131,7 +131,7 @@ export interface GetReplies { auth: string; } -export interface GetUserMentions { +export interface GetPersonMentions { sort: string; page?: number; limit?: number; @@ -139,14 +139,14 @@ export interface GetUserMentions { auth: string; } -export interface MarkUserMentionAsRead { - user_mention_id: number; +export interface MarkPersonMentionAsRead { + person_mention_id: number; read: boolean; auth: string; } -export interface UserMentionResponse { - user_mention_view: UserMentionView; +export interface PersonMentionResponse { + person_mention_view: PersonMentionView; } /** diff --git a/src/interfaces/api/site.ts b/src/interfaces/api/site.ts index bf0e654..7f667ef 100644 --- a/src/interfaces/api/site.ts +++ b/src/interfaces/api/site.ts @@ -1,4 +1,4 @@ -import { UserSafeSettings } from '../source'; +import { LocalUserSettingsView } from '../views'; import { CommentView, CommunityView, @@ -13,7 +13,7 @@ import { ModStickyPostView, PostView, SiteView, - UserViewSafe, + PersonViewSafe, } from '../views'; /** @@ -35,11 +35,11 @@ export interface SearchResponse { comments: CommentView[]; posts: PostView[]; communities: CommunityView[]; - users: UserViewSafe[]; + users: PersonViewSafe[]; } export interface GetModlog { - mod_user_id?: number; + mod_person_id?: number; community_id?: number; page?: number; limit?: number; @@ -89,16 +89,16 @@ export interface SiteResponse { export interface GetSiteResponse { site_view?: SiteView; // Because the site might not be set up yet - admins: UserViewSafe[]; - banned: UserViewSafe[]; + admins: PersonViewSafe[]; + banned: PersonViewSafe[]; online: number; version: string; - my_user?: UserSafeSettings; // Gives back your user and settings if logged in + my_user?: LocalUserSettingsView; // Gives back your local user and settings if logged in federated_instances?: FederatedInstances; } export interface TransferSite { - user_id: number; + person_id: number; auth: string; } diff --git a/src/interfaces/others.ts b/src/interfaces/others.ts index 8cf0992..e162928 100644 --- a/src/interfaces/others.ts +++ b/src/interfaces/others.ts @@ -30,10 +30,10 @@ export enum UserOperation { RemoveCommunity, FollowCommunity, GetFollowedCommunities, - GetUserDetails, + GetPersonDetails, GetReplies, - GetUserMentions, - MarkUserMentionAsRead, + GetPersonMentions, + MarkPersonMentionAsRead, GetModlog, BanFromCommunity, AddModToCommunity, @@ -41,7 +41,7 @@ export enum UserOperation { EditSite, GetSite, AddAdmin, - BanUser, + BanPerson, Search, MarkAllAsRead, SaveUserSettings, diff --git a/src/interfaces/source.ts b/src/interfaces/source.ts index 8d50f76..8688458 100644 --- a/src/interfaces/source.ts +++ b/src/interfaces/source.ts @@ -1,30 +1,8 @@ -export interface UserSafe { +export interface LocalUserSettings { id: number; - name: string; - preferred_username?: string; - avatar?: string; - admin: boolean; - banned: boolean; - published: string; - updated?: string; - matrix_user_id?: string; - actor_id: string; - bio?: string; - local: boolean; - banner?: string; - deleted: boolean; -} - -export interface UserSafeSettings { - id: number; - name: string; - preferred_username?: string; + person_id: number; email?: string; - avatar?: string; admin: boolean; - banned: boolean; - published: string; - updated?: string; show_nsfw: boolean; theme: string; default_sort_type: number; @@ -33,12 +11,24 @@ export interface UserSafeSettings { show_avatars: boolean; send_notifications_to_email: boolean; matrix_user_id?: string; +} + +export interface PersonSafe { + id: number; + name: string; + preferred_username?: string; + avatar?: string; + admin: boolean; + banned: boolean; + published: string; + updated?: string; actor_id: string; bio?: string; local: boolean; - last_refreshed_at: string; banner?: string; deleted: boolean; + inbox_url: string; + shared_inbox_url: string; } export interface Site { @@ -106,14 +96,14 @@ export interface Post { export interface PasswordResetRequest { id: number; - user_id: number; + local_user_id: number; token_encrypted: string; published: string; } export interface ModRemovePost { id: number; - mod_user_id: number; + mod_person_id: number; post_id: number; reason?: string; removed?: boolean; @@ -122,7 +112,7 @@ export interface ModRemovePost { export interface ModLockPost { id: number; - mod_user_id: number; + mod_person_id: number; post_id: number; locked?: boolean; when_: string; @@ -130,7 +120,7 @@ export interface ModLockPost { export interface ModStickyPost { id: number; - mod_user_id: number; + mod_person_id: number; post_id: number; stickied?: boolean; when_: string; @@ -138,7 +128,7 @@ export interface ModStickyPost { export interface ModRemoveComment { id: number; - mod_user_id: number; + mod_person_id: number; comment_id: number; reason?: string; removed?: boolean; @@ -147,7 +137,7 @@ export interface ModRemoveComment { export interface ModRemoveCommunity { id: number; - mod_user_id: number; + mod_person_id: number; community_id: number; reason?: string; removed?: boolean; @@ -157,8 +147,8 @@ export interface ModRemoveCommunity { export interface ModBanFromCommunity { id: number; - mod_user_id: number; - other_user_id: number; + mod_person_id: number; + other_person_id: number; community_id: number; reason?: string; banned?: boolean; @@ -168,8 +158,8 @@ export interface ModBanFromCommunity { export interface ModBan { id: number; - mod_user_id: number; - other_user_id: number; + mod_person_id: number; + other_person_id: number; reason?: string; banned?: boolean; expires?: string; @@ -178,8 +168,8 @@ export interface ModBan { export interface ModAddCommunity { id: number; - mod_user_id: number; - other_user_id: number; + mod_person_id: number; + other_person_id: number; community_id: number; removed?: boolean; when_: string; @@ -187,8 +177,8 @@ export interface ModAddCommunity { export interface ModAdd { id: number; - mod_user_id: number; - other_user_id: number; + mod_person_id: number; + other_person_id: number; removed?: boolean; when_: string; } @@ -237,7 +227,7 @@ export interface Comment { local: boolean; } -export interface UserMention { +export interface PersonMention { id: number; recipient_id: number; comment_id: number; diff --git a/src/interfaces/views.ts b/src/interfaces/views.ts index f45da9e..5bbf4f3 100644 --- a/src/interfaces/views.ts +++ b/src/interfaces/views.ts @@ -3,7 +3,7 @@ import { CommunityAggregates, PostAggregates, SiteAggregates, - UserAggregates, + PersonAggregates, } from './aggregates'; import { Comment, @@ -22,22 +22,23 @@ import { PostReport, PrivateMessage, Site, - UserMention, - UserSafe, + PersonMention, + PersonSafe, + LocalUserSettings, } from './source'; -export interface UserViewSafe { - user: UserSafe; - counts: UserAggregates; +export interface PersonViewSafe { + person: PersonSafe; + counts: PersonAggregates; } -export interface UserMentionView { - user_mention: UserMention; +export interface PersonMentionView { + person_mention: PersonMention; comment: Comment; - creator: UserSafe; + creator: PersonSafe; post: Post; community: CommunitySafe; - recipient: UserSafe; + recipient: PersonSafe; counts: CommentAggregates; creator_banned_from_community: boolean; subscribed: boolean; @@ -45,21 +46,27 @@ export interface UserMentionView { my_vote?: number; } +export interface LocalUserSettingsView { + local_user: LocalUserSettings; + person: PersonSafe; + counts: PersonAggregates; +} + export interface SiteView { site: Site; - creator: UserSafe; + creator: PersonSafe; counts: SiteAggregates; } export interface PrivateMessageView { private_message: PrivateMessage; - creator: UserSafe; - recipient: UserSafe; + creator: PersonSafe; + recipient: PersonSafe; } export interface PostView { post: Post; - creator: UserSafe; + creator: PersonSafe; community: CommunitySafe; creator_banned_from_community: boolean; counts: PostAggregates; @@ -73,15 +80,15 @@ export interface PostReportView { post_report: PostReport; post: Post; community: CommunitySafe; - creator: UserSafe; - post_creator: UserSafe; - resolver?: UserSafe; + creator: PersonSafe; + post_creator: PersonSafe; + resolver?: PersonSafe; } export interface CommentView { comment: Comment; - creator: UserSafe; - recipient?: UserSafe; + creator: PersonSafe; + recipient?: PersonSafe; post: Post; community: CommunitySafe; counts: CommentAggregates; @@ -96,91 +103,91 @@ export interface CommentReportView { comment: Comment; post: Post; community: CommunitySafe; - creator: UserSafe; - comment_creator: UserSafe; - resolver?: UserSafe; + creator: PersonSafe; + comment_creator: PersonSafe; + resolver?: PersonSafe; } export interface ModAddCommunityView { mod_add_community: ModAddCommunity; - moderator: UserSafe; + moderator: PersonSafe; community: CommunitySafe; - modded_user: UserSafe; + modded_person: PersonSafe; } export interface ModAddView { mod_add: ModAdd; - moderator: UserSafe; - modded_user: UserSafe; + moderator: PersonSafe; + modded_person: PersonSafe; } export interface ModBanFromCommunityView { mod_ban_from_community: ModBanFromCommunity; - moderator: UserSafe; + moderator: PersonSafe; community: CommunitySafe; - banned_user: UserSafe; + banned_person: PersonSafe; } export interface ModBanView { mod_ban: ModBan; - moderator: UserSafe; - banned_user: UserSafe; + moderator: PersonSafe; + banned_person: PersonSafe; } export interface ModLockPostView { mod_lock_post: ModLockPost; - moderator: UserSafe; + moderator: PersonSafe; post: Post; community: CommunitySafe; } export interface ModRemoveCommentView { mod_remove_comment: ModRemoveComment; - moderator: UserSafe; + moderator: PersonSafe; comment: Comment; - commenter: UserSafe; + commenter: PersonSafe; post: Post; community: CommunitySafe; } export interface ModRemoveCommunityView { mod_remove_community: ModRemoveCommunity; - moderator: UserSafe; + moderator: PersonSafe; community: CommunitySafe; } export interface ModRemovePostView { mod_remove_post: ModRemovePost; - moderator: UserSafe; + moderator: PersonSafe; post: Post; community: CommunitySafe; } export interface ModStickyPostView { mod_sticky_post: ModStickyPost; - moderator: UserSafe; + moderator: PersonSafe; post: Post; community: CommunitySafe; } export interface CommunityFollowerView { community: CommunitySafe; - follower: UserSafe; + follower: PersonSafe; } export interface CommunityModeratorView { community: CommunitySafe; - moderator: UserSafe; + moderator: PersonSafe; } -export interface CommunityUserBanView { +export interface CommunityPersonBanView { community: CommunitySafe; - user: UserSafe; + person: PersonSafe; } export interface CommunityView { community: CommunitySafe; - creator: UserSafe; + creator: PersonSafe; subscribed: boolean; counts: CommunityAggregates; } diff --git a/src/websocket.ts b/src/websocket.ts index ffc215a..abaa89f 100644 --- a/src/websocket.ts +++ b/src/websocket.ts @@ -45,24 +45,24 @@ import { } from './interfaces/api/site'; import { AddAdmin, - BanUser, + BanPerson, CreatePrivateMessage, DeleteAccount, DeletePrivateMessage, EditPrivateMessage, GetPrivateMessages, GetReplies, - GetUserDetails, - GetUserMentions, + GetPersonDetails, + GetPersonMentions, Login, MarkAllAsRead, MarkPrivateMessageAsRead, - MarkUserMentionAsRead, + MarkPersonMentionAsRead, PasswordChange, PasswordReset, Register, SaveUserSettings, -} from './interfaces/api/user'; +} from './interfaces/api/person'; import { UserJoin, PostJoin, CommunityJoin } from './interfaces/api/websocket'; import { UserOperation } from './interfaces/others'; @@ -216,28 +216,28 @@ export class LemmyWebsocket { return wrapper(UserOperation.TransferSite, form); } - banUser(form: BanUser) { - return wrapper(UserOperation.BanUser, form); + banPerson(form: BanPerson) { + return wrapper(UserOperation.BanPerson, form); } addAdmin(form: AddAdmin) { return wrapper(UserOperation.AddAdmin, form); } - getUserDetails(form: GetUserDetails) { - return wrapper(UserOperation.GetUserDetails, form); + getPersonDetails(form: GetPersonDetails) { + return wrapper(UserOperation.GetPersonDetails, form); } getReplies(form: GetReplies) { return wrapper(UserOperation.GetReplies, form); } - getUserMentions(form: GetUserMentions) { - return wrapper(UserOperation.GetUserMentions, form); + getPersonMentions(form: GetPersonMentions) { + return wrapper(UserOperation.GetPersonMentions, form); } - markUserMentionAsRead(form: MarkUserMentionAsRead) { - return wrapper(UserOperation.MarkUserMentionAsRead, form); + markPersonMentionAsRead(form: MarkPersonMentionAsRead) { + return wrapper(UserOperation.MarkPersonMentionAsRead, form); } getModlog(form: GetModlog) { From a913c0a1a7ebaeaad99b16c6854557a6903065a0 Mon Sep 17 00:00:00 2001 From: Dessalines Date: Fri, 12 Mar 2021 13:25:24 -0500 Subject: [PATCH 02/11] v0.10.0-rc.2 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index ee36f87..eb6f03d 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "lemmy-js-client", "description": "A javascript / typescript client for Lemmy", - "version": "0.10.0-rc.1", + "version": "0.10.0-rc.2", "author": "Dessalines ", "license": "AGPL-3.0", "main": "./dist/index.js", From 2fa73e119506361eb67e4d3dccc6f9eb95c2ad2f Mon Sep 17 00:00:00 2001 From: Dessalines Date: Fri, 12 Mar 2021 13:59:11 -0500 Subject: [PATCH 03/11] v0.10.0-rc.3 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index eb6f03d..bc05857 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "lemmy-js-client", "description": "A javascript / typescript client for Lemmy", - "version": "0.10.0-rc.2", + "version": "0.10.0-rc.3", "author": "Dessalines ", "license": "AGPL-3.0", "main": "./dist/index.js", From c836a28a9770a5257dade923d958cfdc257de658 Mon Sep 17 00:00:00 2001 From: Dessalines Date: Fri, 12 Mar 2021 14:03:44 -0500 Subject: [PATCH 04/11] Fixing saveusersettings --- src/http.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/http.ts b/src/http.ts index c957e34..54b3bbd 100644 --- a/src/http.ts +++ b/src/http.ts @@ -357,7 +357,7 @@ export class LemmyHttp { return this.wrapper(HttpType.Post, '/user/mark_all_as_read', form); } - async savePersonSettings(form: SaveUserSettings): Promise { + async saveUserSettings(form: SaveUserSettings): Promise { return this.wrapper(HttpType.Put, '/user/save_user_settings', form); } From 1e16c99ca5a597a8635815d1d250e4794a77da85 Mon Sep 17 00:00:00 2001 From: Dessalines Date: Fri, 12 Mar 2021 14:04:21 -0500 Subject: [PATCH 05/11] v0.10.0-rc.4 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index bc05857..8945560 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "lemmy-js-client", "description": "A javascript / typescript client for Lemmy", - "version": "0.10.0-rc.3", + "version": "0.10.0-rc.4", "author": "Dessalines ", "license": "AGPL-3.0", "main": "./dist/index.js", From f8066b27e77c6ec33013e843ece9c08107357d1a Mon Sep 17 00:00:00 2001 From: Dessalines Date: Fri, 12 Mar 2021 17:35:53 -0500 Subject: [PATCH 06/11] Fixing AddAdmin. --- src/interfaces/api/person.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/interfaces/api/person.ts b/src/interfaces/api/person.ts index 0613b40..c42aea9 100644 --- a/src/interfaces/api/person.ts +++ b/src/interfaces/api/person.ts @@ -100,7 +100,7 @@ export interface MarkAllAsRead { } export interface AddAdmin { - local_user_id: number; + person_id: number; added: boolean; auth: string; } From 4c0ed1845336f460ec1fe32a010f13b604220375 Mon Sep 17 00:00:00 2001 From: Dessalines Date: Fri, 12 Mar 2021 17:36:03 -0500 Subject: [PATCH 07/11] v0.10.0-rc.5 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 8945560..f719169 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "lemmy-js-client", "description": "A javascript / typescript client for Lemmy", - "version": "0.10.0-rc.4", + "version": "0.10.0-rc.5", "author": "Dessalines ", "license": "AGPL-3.0", "main": "./dist/index.js", From b60ceb49e023028438732820781be2c45d76b8a1 Mon Sep 17 00:00:00 2001 From: Dessalines Date: Tue, 23 Mar 2021 13:02:06 -0400 Subject: [PATCH 08/11] Moving matrix_user_id and admin to Person table. --- src/interfaces/api/community.ts | 4 ++-- src/interfaces/source.ts | 5 ++--- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/src/interfaces/api/community.ts b/src/interfaces/api/community.ts index 89c5a04..2ed8f66 100644 --- a/src/interfaces/api/community.ts +++ b/src/interfaces/api/community.ts @@ -23,7 +23,7 @@ export interface CreateCommunity { description?: string; icon?: string; banner?: string; - nsfw: boolean; + nsfw?: boolean; auth: string; } @@ -78,7 +78,7 @@ export interface EditCommunity { description?: string; icon?: string; banner?: string; - nsfw: boolean; + nsfw?: boolean; auth: string; } diff --git a/src/interfaces/source.ts b/src/interfaces/source.ts index 8688458..fac4070 100644 --- a/src/interfaces/source.ts +++ b/src/interfaces/source.ts @@ -2,7 +2,6 @@ export interface LocalUserSettings { id: number; person_id: number; email?: string; - admin: boolean; show_nsfw: boolean; theme: string; default_sort_type: number; @@ -10,7 +9,6 @@ export interface LocalUserSettings { lang: string; show_avatars: boolean; send_notifications_to_email: boolean; - matrix_user_id?: string; } export interface PersonSafe { @@ -18,7 +16,6 @@ export interface PersonSafe { name: string; preferred_username?: string; avatar?: string; - admin: boolean; banned: boolean; published: string; updated?: string; @@ -29,6 +26,8 @@ export interface PersonSafe { deleted: boolean; inbox_url: string; shared_inbox_url: string; + matrix_user_id?: string; + admin: boolean; } export interface Site { From e6b0e418fa6a4dee559021faaada70e356f62d56 Mon Sep 17 00:00:00 2001 From: Dessalines Date: Tue, 23 Mar 2021 13:02:59 -0400 Subject: [PATCH 09/11] v0.10.0-rc.9 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index f719169..2ad5fd0 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "lemmy-js-client", "description": "A javascript / typescript client for Lemmy", - "version": "0.10.0-rc.5", + "version": "0.10.0-rc.9", "author": "Dessalines ", "license": "AGPL-3.0", "main": "./dist/index.js", From 9bb31e3ff8fb682b570c26fc0252ba7a087e0887 Mon Sep 17 00:00:00 2001 From: Dessalines Date: Tue, 23 Mar 2021 18:53:59 -0400 Subject: [PATCH 10/11] Adding saved_only to GetComments and GetPosts --- src/interfaces/api/comment.ts | 1 + src/interfaces/api/post.ts | 1 + 2 files changed, 2 insertions(+) diff --git a/src/interfaces/api/comment.ts b/src/interfaces/api/comment.ts index f4bb64c..078a285 100644 --- a/src/interfaces/api/comment.ts +++ b/src/interfaces/api/comment.ts @@ -73,6 +73,7 @@ export interface GetComments { limit?: number; community_id?: number; community_name?: string; + saved_only: boolean; auth?: string; } diff --git a/src/interfaces/api/post.ts b/src/interfaces/api/post.ts index 11b4b85..48acbef 100644 --- a/src/interfaces/api/post.ts +++ b/src/interfaces/api/post.ts @@ -44,6 +44,7 @@ export interface GetPosts { limit?: number; community_id?: number; community_name?: string; + saved_only: boolean; auth?: string; } From 0337b3b38029210995bf4d743924795bddc59efd Mon Sep 17 00:00:00 2001 From: Dessalines Date: Tue, 23 Mar 2021 18:54:31 -0400 Subject: [PATCH 11/11] v0.10.0-rc.10 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 2ad5fd0..3e014c6 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "lemmy-js-client", "description": "A javascript / typescript client for Lemmy", - "version": "0.10.0-rc.9", + "version": "0.10.0-rc.10", "author": "Dessalines ", "license": "AGPL-3.0", "main": "./dist/index.js",