lemmy-js-client 0.17.0-rc.2 → 0.17.0-rc.20

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