lemmy-js-client 0.17.0-rc.13 → 0.17.0-rc.16

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,43 +1,46 @@
1
+ import { Option } from "@sniptt/monads";
1
2
  import { SortType } from "../others";
2
3
  import { CommentView, CommunityModeratorView, PersonMentionView, PersonViewSafe, PostView, PrivateMessageView } from "../views";
3
- export interface Login {
4
+ export declare class Login {
4
5
  username_or_email: string;
5
6
  password: string;
7
+ constructor(username_or_email: string, password: string);
6
8
  }
7
9
  /**
8
10
  * Register a new user.
9
11
  *
10
12
  * Only the first user to register will be able to be the admin.
11
13
  */
12
- export interface Register {
14
+ export declare class Register {
13
15
  username: string;
14
16
  /**
15
17
  * Email is mandatory if email verification is enabled on the server
16
18
  */
17
- email?: string;
19
+ email: Option<string>;
18
20
  password: string;
19
21
  password_verify: string;
20
22
  show_nsfw: boolean;
21
23
  /**
22
24
  * Captcha is only checked if these are enabled in the server.
23
25
  */
24
- captcha_uuid?: string;
25
- captcha_answer?: string;
26
- honeypot?: string;
26
+ captcha_uuid: Option<string>;
27
+ captcha_answer: Option<string>;
28
+ honeypot: Option<string>;
27
29
  /**
28
30
  * An answer is mandatory if require application is enabled on the server
29
31
  */
30
- answer?: string;
32
+ answer: Option<string>;
33
+ constructor(username: string, email: Option<string>, password: string, password_verify: string, show_nsfw: boolean, captcha_uuid: Option<string>, captcha_answer: Option<string>, honeypot: Option<string>, answer: Option<string>);
31
34
  }
32
- export interface GetCaptcha {
35
+ export declare class GetCaptcha {
33
36
  }
34
- export interface GetCaptchaResponse {
37
+ export declare class GetCaptchaResponse {
35
38
  /**
36
39
  * Will be undefined if captchas are disabled.
37
40
  */
38
- ok?: CaptchaResponse;
41
+ ok: Option<CaptchaResponse>;
39
42
  }
40
- export interface CaptchaResponse {
43
+ export declare class CaptchaResponse {
41
44
  /**
42
45
  * A Base64 encoded png.
43
46
  */
@@ -45,227 +48,248 @@ export interface CaptchaResponse {
45
48
  /**
46
49
  * A Base64 encoded wav file.
47
50
  */
48
- wav?: string;
51
+ wav: Option<string>;
49
52
  /**
50
53
  * A UUID to match the one given on request.
51
54
  */
52
55
  uuid: string;
53
56
  }
54
- export interface SaveUserSettings {
55
- show_nsfw?: boolean;
57
+ export declare class SaveUserSettings {
58
+ show_nsfw: Option<boolean>;
56
59
  /**
57
60
  * Default for this is `browser`.
58
61
  */
59
- theme?: string;
62
+ theme: Option<string>;
60
63
  /**
61
64
  * The [[SortType]].
62
65
  *
63
66
  * The Sort types from above, zero indexed as a number
64
67
  */
65
- default_sort_type?: number;
68
+ default_sort_type: Option<number>;
66
69
  /**
67
70
  * The [[ListingType]].
68
71
  *
69
72
  * Post listing types are `All, Subscribed, Community`
70
73
  */
71
- default_listing_type?: number;
72
- lang?: string;
73
- avatar?: string;
74
- banner?: string;
75
- display_name?: string;
76
- email?: string;
77
- bio?: string;
78
- matrix_user_id?: string;
79
- show_avatars?: boolean;
80
- show_scores?: boolean;
81
- send_notifications_to_email?: boolean;
82
- bot_account?: boolean;
83
- show_bot_accounts?: boolean;
84
- show_read_posts?: boolean;
85
- show_new_post_notifs?: boolean;
74
+ default_listing_type: Option<number>;
75
+ lang: Option<string>;
76
+ avatar: Option<string>;
77
+ banner: Option<string>;
78
+ display_name: Option<string>;
79
+ email: Option<string>;
80
+ bio: Option<string>;
81
+ matrix_user_id: Option<string>;
82
+ show_avatars: Option<boolean>;
83
+ show_scores: Option<boolean>;
84
+ send_notifications_to_email: Option<boolean>;
85
+ bot_account: Option<boolean>;
86
+ show_bot_accounts: Option<boolean>;
87
+ show_read_posts: Option<boolean>;
88
+ show_new_post_notifs: Option<boolean>;
86
89
  auth: string;
90
+ constructor(show_nsfw: Option<boolean>, theme: Option<string>, default_sort_type: Option<number>, default_listing_type: Option<number>, lang: Option<string>, avatar: Option<string>, banner: Option<string>, display_name: Option<string>, email: Option<string>, bio: Option<string>, matrix_user_id: Option<string>, show_avatars: Option<boolean>, show_scores: Option<boolean>, send_notifications_to_email: Option<boolean>, bot_account: Option<boolean>, show_bot_accounts: Option<boolean>, show_read_posts: Option<boolean>, show_new_post_notifs: Option<boolean>, auth: string);
87
91
  }
88
- export interface ChangePassword {
92
+ export declare class ChangePassword {
89
93
  new_password: string;
90
94
  new_password_verify: string;
91
95
  old_password: string;
92
96
  auth: string;
97
+ constructor(new_password: string, new_password_verify: string, old_password: string, auth: string);
93
98
  }
94
99
  /**
95
100
  * The `jwt` string should be stored and used anywhere `auth` is called for.
96
101
  */
97
- export interface LoginResponse {
102
+ export declare class LoginResponse {
98
103
  /**
99
104
  * This is None in response to `Register` if email verification is enabled, or the server requires registration applications.
100
105
  */
101
- jwt?: string;
106
+ jwt: Option<string>;
102
107
  verify_email_sent: boolean;
103
108
  registration_created: boolean;
104
109
  }
105
- export interface GetPersonDetails {
106
- person_id?: number;
110
+ export declare class GetPersonDetails {
111
+ person_id: Option<number>;
107
112
  /**
108
113
  * To get details for a federated user, use `person@instance.tld`.
109
114
  */
110
- username?: string;
111
- sort?: SortType;
112
- page?: number;
113
- limit?: number;
114
- community_id?: number;
115
- saved_only?: boolean;
116
- auth?: string;
117
- }
118
- export interface GetPersonDetailsResponse {
115
+ username: Option<string>;
116
+ sort: Option<SortType>;
117
+ page: Option<number>;
118
+ limit: Option<number>;
119
+ community_id: Option<number>;
120
+ saved_only: Option<boolean>;
121
+ auth: Option<string>;
122
+ constructor(person_id: Option<number>, username: Option<string>, sort: Option<SortType>, page: Option<number>, limit: Option<number>, community_id: Option<number>, saved_only: Option<boolean>, auth: Option<string>);
123
+ }
124
+ export declare class GetPersonDetailsResponse {
119
125
  person_view: PersonViewSafe;
120
126
  comments: CommentView[];
121
127
  posts: PostView[];
122
128
  moderates: CommunityModeratorView[];
123
129
  }
124
- export interface GetRepliesResponse {
130
+ export declare class GetRepliesResponse {
125
131
  replies: CommentView[];
126
132
  }
127
- export interface GetPersonMentionsResponse {
133
+ export declare class GetPersonMentionsResponse {
128
134
  mentions: PersonMentionView[];
129
135
  }
130
- export interface MarkAllAsRead {
136
+ export declare class MarkAllAsRead {
131
137
  auth: string;
138
+ constructor(auth: string);
132
139
  }
133
- export interface AddAdmin {
140
+ export declare class AddAdmin {
134
141
  person_id: number;
135
142
  added: boolean;
136
143
  auth: string;
144
+ constructor(person_id: number, added: boolean, auth: string);
137
145
  }
138
- export interface AddAdminResponse {
146
+ export declare class AddAdminResponse {
139
147
  admins: PersonViewSafe[];
140
148
  }
141
- export interface BanPerson {
149
+ export declare class BanPerson {
142
150
  person_id: number;
143
151
  ban: boolean;
144
152
  /**
145
153
  * Removes/Restores their comments, posts, and communities
146
154
  */
147
- remove_data?: boolean;
148
- reason?: string;
155
+ remove_data: Option<boolean>;
156
+ reason: Option<string>;
149
157
  /**
150
158
  * The expire time in Unix seconds
151
159
  */
152
- expires?: number;
160
+ expires: Option<number>;
153
161
  auth: string;
162
+ constructor(person_id: number, ban: boolean, remove_data: Option<boolean>, reason: Option<string>, expires: Option<number>, auth: string);
154
163
  }
155
- export interface BanPersonResponse {
164
+ export declare class BanPersonResponse {
156
165
  person_view: PersonViewSafe;
157
166
  banned: boolean;
158
167
  }
159
- export interface GetReplies {
160
- sort?: SortType;
161
- page?: number;
162
- limit?: number;
163
- unread_only?: boolean;
168
+ export declare class GetReplies {
169
+ sort: Option<SortType>;
170
+ page: Option<number>;
171
+ limit: Option<number>;
172
+ unread_only: Option<boolean>;
164
173
  auth: string;
174
+ constructor(sort: Option<SortType>, page: Option<number>, limit: Option<number>, unread_only: Option<boolean>, auth: string);
165
175
  }
166
- export interface GetPersonMentions {
167
- sort?: SortType;
168
- page?: number;
169
- limit?: number;
170
- unread_only?: boolean;
176
+ export declare class GetPersonMentions {
177
+ sort: Option<SortType>;
178
+ page: Option<number>;
179
+ limit: Option<number>;
180
+ unread_only: Option<boolean>;
171
181
  auth: string;
182
+ constructor(sort: Option<SortType>, page: Option<number>, limit: Option<number>, unread_only: Option<boolean>, auth: string);
172
183
  }
173
- export interface MarkPersonMentionAsRead {
184
+ export declare class MarkPersonMentionAsRead {
174
185
  person_mention_id: number;
175
186
  read: boolean;
176
187
  auth: string;
188
+ constructor(person_mention_id: number, read: boolean, auth: string);
177
189
  }
178
- export interface PersonMentionResponse {
190
+ export declare class PersonMentionResponse {
179
191
  person_mention_view: PersonMentionView;
180
192
  }
181
193
  /**
182
194
  * Permanently deletes your posts and comments
183
195
  */
184
- export interface DeleteAccount {
196
+ export declare class DeleteAccount {
185
197
  password: string;
186
198
  auth: string;
199
+ constructor(password: string, auth: string);
187
200
  }
188
- export interface DeleteAccountResponse {
201
+ export declare class DeleteAccountResponse {
189
202
  }
190
- export interface PasswordReset {
203
+ export declare class PasswordReset {
191
204
  email: string;
205
+ constructor(email: string);
192
206
  }
193
- export interface PasswordResetResponse {
207
+ export declare class PasswordResetResponse {
194
208
  }
195
- export interface PasswordChange {
209
+ export declare class PasswordChange {
196
210
  token: string;
197
211
  password: string;
198
212
  password_verify: string;
213
+ constructor(token: string, password: string, password_verify: string);
199
214
  }
200
- export interface CreatePrivateMessage {
215
+ export declare class CreatePrivateMessage {
201
216
  content: string;
202
217
  recipient_id: number;
203
218
  auth: string;
219
+ constructor(content: string, recipient_id: number, auth: string);
204
220
  }
205
- export interface EditPrivateMessage {
221
+ export declare class EditPrivateMessage {
206
222
  private_message_id: number;
207
223
  content: string;
208
224
  auth: string;
225
+ constructor(private_message_id: number, content: string, auth: string);
209
226
  }
210
- export interface DeletePrivateMessage {
227
+ export declare class DeletePrivateMessage {
211
228
  private_message_id: number;
212
229
  deleted: boolean;
213
230
  auth: string;
231
+ constructor(private_message_id: number, deleted: boolean, auth: string);
214
232
  }
215
- export interface MarkPrivateMessageAsRead {
233
+ export declare class MarkPrivateMessageAsRead {
216
234
  private_message_id: number;
217
235
  read: boolean;
218
236
  auth: string;
237
+ constructor(private_message_id: number, read: boolean, auth: string);
219
238
  }
220
- export interface GetPrivateMessages {
221
- unread_only?: boolean;
222
- page?: number;
223
- limit?: number;
239
+ export declare class GetPrivateMessages {
240
+ unread_only: Option<boolean>;
241
+ page: Option<number>;
242
+ limit: Option<number>;
224
243
  auth: string;
225
244
  }
226
- export interface PrivateMessagesResponse {
245
+ export declare class PrivateMessagesResponse {
227
246
  private_messages: PrivateMessageView[];
228
247
  }
229
- export interface PrivateMessageResponse {
248
+ export declare class PrivateMessageResponse {
230
249
  private_message_view: PrivateMessageView;
231
250
  }
232
- export interface GetReportCount {
251
+ export declare class GetReportCount {
233
252
  /**
234
253
  * If a community is supplied, returns the report count for only that community, otherwise returns the report count for all communities the user moderates.
235
254
  */
236
- community_id?: number;
255
+ community_id: Option<number>;
237
256
  auth: string;
257
+ constructor(community_id: Option<number>, auth: string);
238
258
  }
239
- export interface GetReportCountResponse {
240
- community_id?: number;
259
+ export declare class GetReportCountResponse {
260
+ community_id: Option<number>;
241
261
  comment_reports: number;
242
262
  post_reports: number;
243
263
  }
244
- export interface GetUnreadCount {
264
+ export declare class GetUnreadCount {
245
265
  auth: string;
266
+ constructor(auth: string);
246
267
  }
247
- export interface GetUnreadCountResponse {
268
+ export declare class GetUnreadCountResponse {
248
269
  replies: number;
249
270
  mentions: number;
250
271
  private_messages: number;
251
272
  }
252
- export interface VerifyEmail {
273
+ export declare class VerifyEmail {
253
274
  token: string;
275
+ constructor(token: string);
254
276
  }
255
- export interface VerifyEmailResponse {
277
+ export declare class VerifyEmailResponse {
256
278
  }
257
- export interface BlockPerson {
279
+ export declare class BlockPerson {
258
280
  person_id: number;
259
281
  block: boolean;
260
282
  auth: string;
283
+ constructor(person_id: number, block: boolean, auth: string);
261
284
  }
262
- export interface BlockPersonResponse {
285
+ export declare class BlockPersonResponse {
263
286
  person_view: PersonViewSafe;
264
287
  blocked: boolean;
265
288
  }
266
- export interface GetBannedPersons {
289
+ export declare class GetBannedPersons {
267
290
  auth: string;
291
+ constructor(auth: string);
268
292
  }
269
- export interface BannedPersonsResponse {
293
+ export declare class BannedPersonsResponse {
270
294
  banned: PersonViewSafe[];
271
295
  }