lemmy-js-client 0.17.0-rc.3 → 0.17.0-rc.6

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/dist/http.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import { CommentReportResponse, CommentResponse, CreateComment, CreateCommentLike, CreateCommentReport, DeleteComment, EditComment, GetComments, GetCommentsResponse, ListCommentReports, ListCommentReportsResponse, MarkCommentAsRead, RemoveComment, ResolveCommentReport, SaveComment } from "./interfaces/api/comment";
2
- import { AddModToCommunity, AddModToCommunityResponse, BanFromCommunity, BanFromCommunityResponse, BlockCommunity, BlockCommunityResponse, CommunityResponse, CreateCommunity, DeleteCommunity, EditCommunity, FollowCommunity, FollowCommunityResponse, GetCommunity, GetCommunityResponse, ListCommunities, ListCommunitiesResponse, RemoveCommunity, TransferCommunity } from "./interfaces/api/community";
2
+ import { AddModToCommunity, AddModToCommunityResponse, BanFromCommunity, BanFromCommunityResponse, BlockCommunity, BlockCommunityResponse, CommunityResponse, CreateCommunity, DeleteCommunity, EditCommunity, FollowCommunity, GetCommunity, GetCommunityResponse, ListCommunities, ListCommunitiesResponse, RemoveCommunity, TransferCommunity } from "./interfaces/api/community";
3
3
  import { AddAdmin, AddAdminResponse, BannedPersonsResponse, BanPerson, BanPersonResponse, BlockPerson, BlockPersonResponse, ChangePassword, CreatePrivateMessage, DeleteAccount, DeleteAccountResponse, DeletePrivateMessage, EditPrivateMessage, GetBannedPersons, GetCaptchaResponse, GetPersonDetails, GetPersonDetailsResponse, GetPersonMentions, GetPersonMentionsResponse, GetPrivateMessages, GetReplies, GetRepliesResponse, GetReportCount, GetReportCountResponse, GetUnreadCount, GetUnreadCountResponse, Login, LoginResponse, MarkAllAsRead, MarkPersonMentionAsRead, MarkPrivateMessageAsRead, PasswordChange, PasswordReset, PasswordResetResponse, PersonMentionResponse, PrivateMessageResponse, PrivateMessagesResponse, Register, SaveUserSettings, VerifyEmail, VerifyEmailResponse } from "./interfaces/api/person";
4
4
  import { CreatePost, CreatePostLike, CreatePostReport, DeletePost, EditPost, GetPost, GetPostResponse, GetPosts, GetPostsResponse, GetSiteMetadata, GetSiteMetadataResponse, ListPostReports, ListPostReportsResponse, LockPost, PostReportResponse, PostResponse, RemovePost, ResolvePostReport, SavePost, StickyPost } from "./interfaces/api/post";
5
5
  import { ApproveRegistrationApplication, CreateSite, EditSite, GetModlog, GetModlogResponse, GetSite, GetSiteConfig, GetSiteConfigResponse, GetSiteResponse, GetUnreadRegistrationApplicationCount, GetUnreadRegistrationApplicationCountResponse, LeaveAdmin, ListRegistrationApplications, ListRegistrationApplicationsResponse, RegistrationApplicationResponse, ResolveObject, ResolveObjectResponse, SaveSiteConfig, Search, SearchResponse, SiteResponse } from "./interfaces/api/site";
@@ -72,7 +72,7 @@ export declare class LemmyHttp {
72
72
  /**
73
73
  * Follow / subscribe to a community.
74
74
  */
75
- followCommunity(form: FollowCommunity): Promise<FollowCommunityResponse>;
75
+ followCommunity(form: FollowCommunity): Promise<CommunityResponse>;
76
76
  /**
77
77
  * Block a community.
78
78
  */
@@ -1,5 +1,5 @@
1
1
  import { Site } from "../source";
2
- import { CommunityFollowerView, CommunityModeratorView, CommunityView, PersonViewSafe } from "../views";
2
+ import { CommunityModeratorView, CommunityView, PersonViewSafe } from "../views";
3
3
  /**
4
4
  * You can use either `id` or `name` as an id.
5
5
  *
@@ -29,12 +29,6 @@ export interface CreateCommunity {
29
29
  export interface CommunityResponse {
30
30
  community_view: CommunityView;
31
31
  }
32
- export interface FollowCommunityResponse {
33
- /**
34
- * An unfollow returns null.
35
- */
36
- community_follower_view?: CommunityFollowerView;
37
- }
38
32
  export interface ListCommunities {
39
33
  /**
40
34
  * The [[ListingType]].
@@ -1,3 +1,4 @@
1
+ import { Option } from "@sniptt/monads";
1
2
  import { CommentView, CommunityBlockView, CommunityFollowerView, CommunityModeratorView, CommunityView, LocalUserSettingsView, ModAddCommunityView, ModAddView, ModBanFromCommunityView, ModBanView, ModLockPostView, ModRemoveCommentView, ModRemoveCommunityView, ModRemovePostView, ModStickyPostView, ModTransferCommunityView, PersonBlockView, PersonViewSafe, PostView, RegistrationApplicationView, SiteView } from "../views";
2
3
  /**
3
4
  * Search lemmy for different types of data.
@@ -74,7 +75,7 @@ export interface CreateSite {
74
75
  }
75
76
  export interface EditSite {
76
77
  name?: string;
77
- sidebar?: string;
78
+ sidebar: Option<string>;
78
79
  description?: string;
79
80
  icon?: string;
80
81
  banner?: string;
@@ -99,14 +100,14 @@ export interface GetSiteResponse {
99
100
  /**
100
101
  * Optional, because the site might not be set up yet.
101
102
  */
102
- site_view?: SiteView;
103
+ site_view: Option<SiteView>;
103
104
  admins: PersonViewSafe[];
104
105
  online: number;
105
106
  version: string;
106
107
  /**
107
108
  * If you're logged in, you'll get back extra user info.
108
109
  */
109
- my_user?: MyUserInfo;
110
+ my_user: Option<MyUserInfo>;
110
111
  federated_instances?: FederatedInstances;
111
112
  }
112
113
  /**
@@ -1,3 +1,4 @@
1
+ import { Option } from "@sniptt/monads";
1
2
  export interface LocalUserSettings {
2
3
  id: number;
3
4
  person_id: number;
@@ -39,14 +40,14 @@ export interface PersonSafe {
39
40
  export interface Site {
40
41
  id: number;
41
42
  name: string;
42
- sidebar?: string;
43
+ sidebar: Option<string>;
43
44
  published: string;
44
45
  updated?: string;
45
46
  enable_downvotes: boolean;
46
47
  open_registration: boolean;
47
48
  enable_nsfw: boolean;
48
49
  icon?: string;
49
- banner?: string;
50
+ banner: Option<string>;
50
51
  description?: string;
51
52
  community_creation_admin_only: boolean;
52
53
  require_email_verification: boolean;
@@ -25,7 +25,6 @@ export interface LocalUserSettingsView {
25
25
  }
26
26
  export interface SiteView {
27
27
  site: Site;
28
- creator: PersonSafe;
29
28
  counts: SiteAggregates;
30
29
  }
31
30
  export interface PrivateMessageView {
@@ -143,7 +142,6 @@ export interface ModStickyPostView {
143
142
  export interface CommunityFollowerView {
144
143
  community: CommunitySafe;
145
144
  follower: PersonSafe;
146
- pending: boolean;
147
145
  }
148
146
  export interface CommunityBlockView {
149
147
  person: PersonSafe;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "lemmy-js-client",
3
3
  "description": "A javascript / typescript client for Lemmy",
4
- "version": "0.17.0-rc.3",
4
+ "version": "0.17.0-rc.6",
5
5
  "author": "Dessalines <tyhou13@gmx.com>",
6
6
  "license": "AGPL-3.0",
7
7
  "main": "./dist/index.js",
@@ -15,7 +15,11 @@
15
15
  "prepare": "yarn run build && husky install"
16
16
  },
17
17
  "repository": "https://github.com/LemmyNet/lemmy-js-client",
18
+ "dependencies": {
19
+ "@sniptt/monads": "^0.5.10"
20
+ },
18
21
  "devDependencies": {
22
+ "@sniptt/monads": "^0.5.10",
19
23
  "@types/node": "^17.0.10",
20
24
  "@types/node-fetch": "^3.0.3",
21
25
  "@typescript-eslint/eslint-plugin": "^5.10.0",