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

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 { Option } from "@sniptt/monads";
2
+ import "reflect-metadata";
3
+ import { SortType } from "../others";
1
4
  import { CommentView, CommunityModeratorView, PersonMentionView, PersonViewSafe, PostView, PrivateMessageView } from "../views";
2
- export interface Login {
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,249 @@ 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 {
131
+ export declare class GetRepliesResponse {
124
132
  replies: CommentView[];
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<SortType>;
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<SortType>;
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
  }
186
194
  /**
187
195
  * Permanently deletes your posts and comments
188
196
  */
189
- export interface DeleteAccount {
197
+ export declare class DeleteAccount {
190
198
  password: string;
191
199
  auth: string;
200
+ constructor(init: DeleteAccount);
192
201
  }
193
- export interface DeleteAccountResponse {
202
+ export declare class DeleteAccountResponse {
194
203
  }
195
- export interface PasswordReset {
204
+ export declare class PasswordReset {
196
205
  email: string;
206
+ constructor(init: PasswordReset);
197
207
  }
198
- export interface PasswordResetResponse {
208
+ export declare class PasswordResetResponse {
199
209
  }
200
- export interface PasswordChange {
210
+ export declare class PasswordChange {
201
211
  token: string;
202
212
  password: string;
203
213
  password_verify: string;
214
+ constructor(init: PasswordChange);
204
215
  }
205
- export interface CreatePrivateMessage {
216
+ export declare class CreatePrivateMessage {
206
217
  content: string;
207
218
  recipient_id: number;
208
219
  auth: string;
220
+ constructor(init: CreatePrivateMessage);
209
221
  }
210
- export interface EditPrivateMessage {
222
+ export declare class EditPrivateMessage {
211
223
  private_message_id: number;
212
224
  content: string;
213
225
  auth: string;
226
+ constructor(init: EditPrivateMessage);
214
227
  }
215
- export interface DeletePrivateMessage {
228
+ export declare class DeletePrivateMessage {
216
229
  private_message_id: number;
217
230
  deleted: boolean;
218
231
  auth: string;
232
+ constructor(init: DeletePrivateMessage);
219
233
  }
220
- export interface MarkPrivateMessageAsRead {
234
+ export declare class MarkPrivateMessageAsRead {
221
235
  private_message_id: number;
222
236
  read: boolean;
223
237
  auth: string;
238
+ constructor(init: MarkPrivateMessageAsRead);
224
239
  }
225
- export interface GetPrivateMessages {
226
- unread_only?: boolean;
227
- page?: number;
228
- limit?: number;
240
+ export declare class GetPrivateMessages {
241
+ unread_only: Option<boolean>;
242
+ page: Option<number>;
243
+ limit: Option<number>;
229
244
  auth: string;
245
+ constructor(init: GetPrivateMessages);
230
246
  }
231
- export interface PrivateMessagesResponse {
247
+ export declare class PrivateMessagesResponse {
232
248
  private_messages: PrivateMessageView[];
233
249
  }
234
- export interface PrivateMessageResponse {
250
+ export declare class PrivateMessageResponse {
235
251
  private_message_view: PrivateMessageView;
236
252
  }
237
- export interface GetReportCount {
253
+ export declare class GetReportCount {
238
254
  /**
239
255
  * 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
256
  */
241
- community_id?: number;
257
+ community_id: Option<number>;
242
258
  auth: string;
259
+ constructor(init: GetReportCount);
243
260
  }
244
- export interface GetReportCountResponse {
245
- community_id?: number;
261
+ export declare class GetReportCountResponse {
262
+ community_id: Option<number>;
246
263
  comment_reports: number;
247
264
  post_reports: number;
248
265
  }
249
- export interface GetUnreadCount {
266
+ export declare class GetUnreadCount {
250
267
  auth: string;
268
+ constructor(init: GetUnreadCount);
251
269
  }
252
- export interface GetUnreadCountResponse {
270
+ export declare class GetUnreadCountResponse {
253
271
  replies: number;
254
272
  mentions: number;
255
273
  private_messages: number;
256
274
  }
257
- export interface VerifyEmail {
275
+ export declare class VerifyEmail {
258
276
  token: string;
277
+ constructor(init: VerifyEmail);
259
278
  }
260
- export interface VerifyEmailResponse {
279
+ export declare class VerifyEmailResponse {
261
280
  }
262
- export interface BlockPerson {
281
+ export declare class BlockPerson {
263
282
  person_id: number;
264
283
  block: boolean;
265
284
  auth: string;
285
+ constructor(init: BlockPerson);
266
286
  }
267
- export interface BlockPersonResponse {
287
+ export declare class BlockPersonResponse {
268
288
  person_view: PersonViewSafe;
269
289
  blocked: boolean;
270
290
  }
271
- export interface GetBannedPersons {
291
+ export declare class GetBannedPersons {
272
292
  auth: string;
293
+ constructor(init: GetBannedPersons);
273
294
  }
274
- export interface BannedPersonsResponse {
295
+ export declare class BannedPersonsResponse {
275
296
  banned: PersonViewSafe[];
276
297
  }