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

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.
@@ -1,3 +1,4 @@
1
+ import { ListingType, SortType } from "../others";
1
2
  import { CommentReportView, CommentView } from "../views";
2
3
  export interface CreateComment {
3
4
  content: string;
@@ -68,14 +69,8 @@ export interface CreateCommentLike {
68
69
  * To get posts for a federated community by name, use `name@instance.tld` .
69
70
  */
70
71
  export interface GetComments {
71
- /**
72
- * The [[ListingType]].
73
- */
74
- type_?: string;
75
- /**
76
- * The [[SortType]].
77
- */
78
- sort?: string;
72
+ type_?: ListingType;
73
+ sort?: SortType;
79
74
  page?: number;
80
75
  limit?: number;
81
76
  community_id?: number;
@@ -1,3 +1,4 @@
1
+ import { ListingType, SortType } from "../others";
1
2
  import { Site } from "../source";
2
3
  import { CommunityModeratorView, CommunityView, PersonViewSafe } from "../views";
3
4
  /**
@@ -30,14 +31,8 @@ export interface CommunityResponse {
30
31
  community_view: CommunityView;
31
32
  }
32
33
  export interface ListCommunities {
33
- /**
34
- * The [[ListingType]].
35
- */
36
- type_?: string;
37
- /**
38
- * The [[SortType]].
39
- */
40
- sort?: string;
34
+ type_?: ListingType;
35
+ sort?: SortType;
41
36
  page?: number;
42
37
  limit?: number;
43
38
  auth?: string;
@@ -1,3 +1,4 @@
1
+ import { SortType } from "../others";
1
2
  import { CommentView, CommunityModeratorView, PersonMentionView, PersonViewSafe, PostView, PrivateMessageView } from "../views";
2
3
  export interface Login {
3
4
  username_or_email: string;
@@ -107,7 +108,7 @@ export interface GetPersonDetails {
107
108
  * To get details for a federated user, use `person@instance.tld`.
108
109
  */
109
110
  username?: string;
110
- sort?: string;
111
+ sort?: SortType;
111
112
  page?: number;
112
113
  limit?: number;
113
114
  community_id?: number;
@@ -156,20 +157,14 @@ export interface BanPersonResponse {
156
157
  banned: boolean;
157
158
  }
158
159
  export interface GetReplies {
159
- /**
160
- * The [[SortType]].
161
- */
162
- sort?: string;
160
+ sort?: SortType;
163
161
  page?: number;
164
162
  limit?: number;
165
163
  unread_only?: boolean;
166
164
  auth: string;
167
165
  }
168
166
  export interface GetPersonMentions {
169
- /**
170
- * The [[SortType]].
171
- */
172
- sort?: string;
167
+ sort?: SortType;
173
168
  page?: number;
174
169
  limit?: number;
175
170
  unread_only?: boolean;
@@ -1,4 +1,4 @@
1
- import { SiteMetadata } from "..";
1
+ import { ListingType, SiteMetadata, SortType } from "../others";
2
2
  import { CommentView, CommunityModeratorView, CommunityView, PostReportView, PostView } from "../views";
3
3
  export interface CreatePost {
4
4
  name: string;
@@ -24,16 +24,8 @@ export interface GetPostResponse {
24
24
  online: number;
25
25
  }
26
26
  export interface GetPosts {
27
- /**
28
- * The [[ListingType]].
29
- *
30
- * Post listing types are `All, Subscribed, Community`
31
- */
32
- type_?: string;
33
- /**
34
- * The [[SortType]].
35
- */
36
- sort?: string;
27
+ type_?: ListingType;
28
+ sort?: SortType;
37
29
  page?: number;
38
30
  limit?: number;
39
31
  community_id?: number;
@@ -1,4 +1,4 @@
1
- import { Option } from "@sniptt/monads";
1
+ import { ListingType, SearchType, SortType } from "../others";
2
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";
3
3
  /**
4
4
  * Search lemmy for different types of data.
@@ -8,21 +8,12 @@ export interface Search {
8
8
  * The search query string.
9
9
  */
10
10
  q: string;
11
- /**
12
- * The [[SearchType]].
13
- */
14
- type_?: string;
11
+ type_?: SearchType;
15
12
  community_id?: number;
16
13
  community_name?: string;
17
14
  creator_id?: number;
18
- /**
19
- * The [[SortType]].
20
- */
21
- sort?: string;
22
- /**
23
- * The [[ListingType]].
24
- */
25
- listing_type?: string;
15
+ sort?: SortType;
16
+ listing_type?: ListingType;
26
17
  page?: number;
27
18
  limit?: number;
28
19
  auth?: string;
@@ -75,7 +66,7 @@ export interface CreateSite {
75
66
  }
76
67
  export interface EditSite {
77
68
  name?: string;
78
- sidebar: Option<string>;
69
+ sidebar?: string;
79
70
  description?: string;
80
71
  icon?: string;
81
72
  banner?: string;
@@ -100,14 +91,14 @@ export interface GetSiteResponse {
100
91
  /**
101
92
  * Optional, because the site might not be set up yet.
102
93
  */
103
- site_view: Option<SiteView>;
94
+ site_view?: SiteView;
104
95
  admins: PersonViewSafe[];
105
96
  online: number;
106
97
  version: string;
107
98
  /**
108
99
  * If you're logged in, you'll get back extra user info.
109
100
  */
110
- my_user: Option<MyUserInfo>;
101
+ my_user?: MyUserInfo;
111
102
  federated_instances?: FederatedInstances;
112
103
  }
113
104
  /**
@@ -1,4 +1,3 @@
1
- import { Option } from "@sniptt/monads";
2
1
  export interface LocalUserSettings {
3
2
  id: number;
4
3
  person_id: number;
@@ -40,14 +39,14 @@ export interface PersonSafe {
40
39
  export interface Site {
41
40
  id: number;
42
41
  name: string;
43
- sidebar: Option<string>;
42
+ sidebar?: string;
44
43
  published: string;
45
44
  updated?: string;
46
45
  enable_downvotes: boolean;
47
46
  open_registration: boolean;
48
47
  enable_nsfw: boolean;
49
48
  icon?: string;
50
- banner: Option<string>;
49
+ banner?: string;
51
50
  description?: string;
52
51
  community_creation_admin_only: boolean;
53
52
  require_email_verification: boolean;
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.6",
4
+ "version": "0.17.0-rc.9",
5
5
  "author": "Dessalines <tyhou13@gmx.com>",
6
6
  "license": "AGPL-3.0",
7
7
  "main": "./dist/index.js",
@@ -15,11 +15,7 @@
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
- },
21
18
  "devDependencies": {
22
- "@sniptt/monads": "^0.5.10",
23
19
  "@types/node": "^17.0.10",
24
20
  "@types/node-fetch": "^3.0.3",
25
21
  "@typescript-eslint/eslint-plugin": "^5.10.0",