lemmy-js-client 0.17.0-rc.5 → 0.17.0-rc.50

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