lemmy-js-client 0.17.0-rc.59 → 0.17.0-rc.60

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