lemmy-js-client 0.17.0-rc.4 → 0.17.0-rc.42

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,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, 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,258 @@ 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
+ lang: 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>;
85
90
  auth: string;
91
+ constructor(init: SaveUserSettings);
86
92
  }
87
- export interface ChangePassword {
93
+ export declare class ChangePassword {
88
94
  new_password: string;
89
95
  new_password_verify: string;
90
96
  old_password: string;
91
97
  auth: string;
98
+ constructor(init: ChangePassword);
92
99
  }
93
100
  /**
94
101
  * The `jwt` string should be stored and used anywhere `auth` is called for.
95
102
  */
96
- export interface LoginResponse {
103
+ export declare class LoginResponse {
97
104
  /**
98
105
  * This is None in response to `Register` if email verification is enabled, or the server requires registration applications.
99
106
  */
100
- jwt?: string;
107
+ jwt: Option<string>;
101
108
  verify_email_sent: boolean;
102
109
  registration_created: boolean;
103
110
  }
104
- export interface GetPersonDetails {
105
- person_id?: number;
111
+ export declare class GetPersonDetails {
112
+ person_id: Option<number>;
106
113
  /**
107
114
  * To get details for a federated user, use `person@instance.tld`.
108
115
  */
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 {
116
+ username: Option<string>;
117
+ sort: Option<SortType>;
118
+ page: Option<number>;
119
+ limit: Option<number>;
120
+ community_id: Option<number>;
121
+ saved_only: Option<boolean>;
122
+ auth: Option<string>;
123
+ constructor(init: GetPersonDetails);
124
+ }
125
+ export declare class GetPersonDetailsResponse {
118
126
  person_view: PersonViewSafe;
119
127
  comments: CommentView[];
120
128
  posts: PostView[];
121
129
  moderates: CommunityModeratorView[];
122
130
  }
123
- export interface GetRepliesResponse {
124
- replies: CommentView[];
131
+ export declare class GetRepliesResponse {
132
+ replies: CommentReplyView[];
125
133
  }
126
- export interface GetPersonMentionsResponse {
134
+ export declare class GetPersonMentionsResponse {
127
135
  mentions: PersonMentionView[];
128
136
  }
129
- export interface MarkAllAsRead {
137
+ export declare class MarkAllAsRead {
130
138
  auth: string;
139
+ constructor(auth: string);
131
140
  }
132
- export interface AddAdmin {
141
+ export declare class AddAdmin {
133
142
  person_id: number;
134
143
  added: boolean;
135
144
  auth: string;
145
+ constructor(init: AddAdmin);
136
146
  }
137
- export interface AddAdminResponse {
147
+ export declare class AddAdminResponse {
138
148
  admins: PersonViewSafe[];
139
149
  }
140
- export interface BanPerson {
150
+ export declare class BanPerson {
141
151
  person_id: number;
142
152
  ban: boolean;
143
153
  /**
144
154
  * Removes/Restores their comments, posts, and communities
145
155
  */
146
- remove_data?: boolean;
147
- reason?: string;
156
+ remove_data: Option<boolean>;
157
+ reason: Option<string>;
148
158
  /**
149
159
  * The expire time in Unix seconds
150
160
  */
151
- expires?: number;
161
+ expires: Option<number>;
152
162
  auth: string;
163
+ constructor(init: BanPerson);
153
164
  }
154
- export interface BanPersonResponse {
165
+ export declare class BanPersonResponse {
155
166
  person_view: PersonViewSafe;
156
167
  banned: boolean;
157
168
  }
158
- export interface GetReplies {
159
- /**
160
- * The [[SortType]].
161
- */
162
- sort?: string;
163
- page?: number;
164
- limit?: number;
165
- unread_only?: boolean;
169
+ export declare class GetReplies {
170
+ sort: Option<CommentSortType>;
171
+ page: Option<number>;
172
+ limit: Option<number>;
173
+ unread_only: Option<boolean>;
166
174
  auth: string;
175
+ constructor(init: GetReplies);
167
176
  }
168
- export interface GetPersonMentions {
169
- /**
170
- * The [[SortType]].
171
- */
172
- sort?: string;
173
- page?: number;
174
- limit?: number;
175
- unread_only?: boolean;
177
+ export declare class GetPersonMentions {
178
+ sort: Option<CommentSortType>;
179
+ page: Option<number>;
180
+ limit: Option<number>;
181
+ unread_only: Option<boolean>;
176
182
  auth: string;
183
+ constructor(init: GetPersonMentions);
177
184
  }
178
- export interface MarkPersonMentionAsRead {
185
+ export declare class MarkPersonMentionAsRead {
179
186
  person_mention_id: number;
180
187
  read: boolean;
181
188
  auth: string;
189
+ constructor(init: MarkPersonMentionAsRead);
182
190
  }
183
- export interface PersonMentionResponse {
191
+ export declare class PersonMentionResponse {
184
192
  person_mention_view: PersonMentionView;
185
193
  }
194
+ export declare class MarkCommentReplyAsRead {
195
+ comment_reply_id: number;
196
+ read: boolean;
197
+ auth: string;
198
+ constructor(init: MarkCommentReplyAsRead);
199
+ }
200
+ export declare class CommentReplyResponse {
201
+ comment_reply_view: CommentReplyView;
202
+ }
186
203
  /**
187
204
  * Permanently deletes your posts and comments
188
205
  */
189
- export interface DeleteAccount {
206
+ export declare class DeleteAccount {
190
207
  password: string;
191
208
  auth: string;
209
+ constructor(init: DeleteAccount);
192
210
  }
193
- export interface DeleteAccountResponse {
211
+ export declare class DeleteAccountResponse {
194
212
  }
195
- export interface PasswordReset {
213
+ export declare class PasswordReset {
196
214
  email: string;
215
+ constructor(init: PasswordReset);
197
216
  }
198
- export interface PasswordResetResponse {
217
+ export declare class PasswordResetResponse {
199
218
  }
200
- export interface PasswordChange {
219
+ export declare class PasswordChange {
201
220
  token: string;
202
221
  password: string;
203
222
  password_verify: string;
223
+ constructor(init: PasswordChange);
204
224
  }
205
- export interface CreatePrivateMessage {
225
+ export declare class CreatePrivateMessage {
206
226
  content: string;
207
227
  recipient_id: number;
208
228
  auth: string;
229
+ constructor(init: CreatePrivateMessage);
209
230
  }
210
- export interface EditPrivateMessage {
231
+ export declare class EditPrivateMessage {
211
232
  private_message_id: number;
212
233
  content: string;
213
234
  auth: string;
235
+ constructor(init: EditPrivateMessage);
214
236
  }
215
- export interface DeletePrivateMessage {
237
+ export declare class DeletePrivateMessage {
216
238
  private_message_id: number;
217
239
  deleted: boolean;
218
240
  auth: string;
241
+ constructor(init: DeletePrivateMessage);
219
242
  }
220
- export interface MarkPrivateMessageAsRead {
243
+ export declare class MarkPrivateMessageAsRead {
221
244
  private_message_id: number;
222
245
  read: boolean;
223
246
  auth: string;
247
+ constructor(init: MarkPrivateMessageAsRead);
224
248
  }
225
- export interface GetPrivateMessages {
226
- unread_only?: boolean;
227
- page?: number;
228
- limit?: number;
249
+ export declare class GetPrivateMessages {
250
+ unread_only: Option<boolean>;
251
+ page: Option<number>;
252
+ limit: Option<number>;
229
253
  auth: string;
254
+ constructor(init: GetPrivateMessages);
230
255
  }
231
- export interface PrivateMessagesResponse {
256
+ export declare class PrivateMessagesResponse {
232
257
  private_messages: PrivateMessageView[];
233
258
  }
234
- export interface PrivateMessageResponse {
259
+ export declare class PrivateMessageResponse {
235
260
  private_message_view: PrivateMessageView;
236
261
  }
237
- export interface GetReportCount {
262
+ export declare class GetReportCount {
238
263
  /**
239
264
  * 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
265
  */
241
- community_id?: number;
266
+ community_id: Option<number>;
242
267
  auth: string;
268
+ constructor(init: GetReportCount);
243
269
  }
244
- export interface GetReportCountResponse {
245
- community_id?: number;
270
+ export declare class GetReportCountResponse {
271
+ community_id: Option<number>;
246
272
  comment_reports: number;
247
273
  post_reports: number;
248
274
  }
249
- export interface GetUnreadCount {
275
+ export declare class GetUnreadCount {
250
276
  auth: string;
277
+ constructor(init: GetUnreadCount);
251
278
  }
252
- export interface GetUnreadCountResponse {
279
+ export declare class GetUnreadCountResponse {
253
280
  replies: number;
254
281
  mentions: number;
255
282
  private_messages: number;
256
283
  }
257
- export interface VerifyEmail {
284
+ export declare class VerifyEmail {
258
285
  token: string;
286
+ constructor(init: VerifyEmail);
259
287
  }
260
- export interface VerifyEmailResponse {
288
+ export declare class VerifyEmailResponse {
261
289
  }
262
- export interface BlockPerson {
290
+ export declare class BlockPerson {
263
291
  person_id: number;
264
292
  block: boolean;
265
293
  auth: string;
294
+ constructor(init: BlockPerson);
266
295
  }
267
- export interface BlockPersonResponse {
296
+ export declare class BlockPersonResponse {
268
297
  person_view: PersonViewSafe;
269
298
  blocked: boolean;
270
299
  }
271
- export interface GetBannedPersons {
300
+ export declare class GetBannedPersons {
272
301
  auth: string;
302
+ constructor(init: GetBannedPersons);
273
303
  }
274
- export interface BannedPersonsResponse {
304
+ export declare class BannedPersonsResponse {
275
305
  banned: PersonViewSafe[];
276
306
  }