lemmy-js-client 0.17.0-rc.5 → 0.17.0-rc.51
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.
- package/dist/http.d.ts +196 -14
- package/dist/http.js +332 -98
- package/dist/index.d.ts +1 -0
- package/dist/index.js +6 -1
- package/dist/interfaces/aggregates.d.ts +1 -0
- package/dist/interfaces/api/comment.d.ts +54 -46
- package/dist/interfaces/api/comment.js +393 -0
- package/dist/interfaces/api/community.d.ts +56 -48
- package/dist/interfaces/api/community.js +433 -0
- package/dist/interfaces/api/index.js +5 -1
- package/dist/interfaces/api/person.d.ts +159 -102
- package/dist/interfaces/api/person.js +1004 -0
- package/dist/interfaces/api/post.d.ts +73 -54
- package/dist/interfaces/api/post.js +475 -0
- package/dist/interfaces/api/site.d.ts +182 -99
- package/dist/interfaces/api/site.js +1555 -0
- package/dist/interfaces/index.js +5 -1
- package/dist/interfaces/others.d.ts +122 -90
- package/dist/interfaces/others.js +187 -59
- package/dist/interfaces/source.d.ts +178 -83
- package/dist/interfaces/source.js +899 -0
- package/dist/interfaces/views.d.ts +99 -50
- package/dist/interfaces/views.js +761 -0
- package/dist/utils.d.ts +9 -0
- package/dist/utils.js +18 -0
- package/dist/websocket.d.ts +43 -12
- package/dist/websocket.js +64 -16
- package/package.json +17 -14
@@ -1,42 +1,47 @@
|
|
1
|
-
import {
|
2
|
-
|
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
|
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
|
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
|
24
|
-
captcha_answer
|
25
|
-
honeypot
|
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
|
33
|
+
answer: Option<string>;
|
34
|
+
constructor(init: Register);
|
30
35
|
}
|
31
|
-
export
|
36
|
+
export declare class GetCaptcha {
|
32
37
|
}
|
33
|
-
export
|
38
|
+
export declare class GetCaptchaResponse {
|
34
39
|
/**
|
35
40
|
* Will be undefined if captchas are disabled.
|
36
41
|
*/
|
37
|
-
ok
|
42
|
+
ok: Option<CaptchaResponse>;
|
38
43
|
}
|
39
|
-
export
|
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
|
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
|
54
|
-
show_nsfw
|
58
|
+
export declare class SaveUserSettings {
|
59
|
+
show_nsfw: Option<boolean>;
|
55
60
|
/**
|
56
61
|
* Default for this is `browser`.
|
57
62
|
*/
|
58
|
-
theme
|
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
|
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
|
71
|
-
|
72
|
-
avatar
|
73
|
-
banner
|
74
|
-
display_name
|
75
|
-
email
|
76
|
-
bio
|
77
|
-
matrix_user_id
|
78
|
-
show_avatars
|
79
|
-
show_scores
|
80
|
-
send_notifications_to_email
|
81
|
-
bot_account
|
82
|
-
show_bot_accounts
|
83
|
-
show_read_posts
|
84
|
-
show_new_post_notifs
|
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
|
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
|
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
|
108
|
+
jwt: Option<string>;
|
101
109
|
verify_email_sent: boolean;
|
102
110
|
registration_created: boolean;
|
103
111
|
}
|
104
|
-
export
|
105
|
-
person_id
|
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
|
110
|
-
sort
|
111
|
-
page
|
112
|
-
limit
|
113
|
-
community_id
|
114
|
-
saved_only
|
115
|
-
auth
|
116
|
-
|
117
|
-
|
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
|
124
|
-
replies:
|
132
|
+
export declare class GetRepliesResponse {
|
133
|
+
replies: CommentReplyView[];
|
125
134
|
}
|
126
|
-
export
|
135
|
+
export declare class GetPersonMentionsResponse {
|
127
136
|
mentions: PersonMentionView[];
|
128
137
|
}
|
129
|
-
export
|
138
|
+
export declare class MarkAllAsRead {
|
130
139
|
auth: string;
|
140
|
+
constructor(auth: string);
|
131
141
|
}
|
132
|
-
export
|
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
|
148
|
+
export declare class AddAdminResponse {
|
138
149
|
admins: PersonViewSafe[];
|
139
150
|
}
|
140
|
-
export
|
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
|
147
|
-
reason
|
157
|
+
remove_data: Option<boolean>;
|
158
|
+
reason: Option<string>;
|
148
159
|
/**
|
149
160
|
* The expire time in Unix seconds
|
150
161
|
*/
|
151
|
-
expires
|
162
|
+
expires: Option<number>;
|
152
163
|
auth: string;
|
164
|
+
constructor(init: BanPerson);
|
153
165
|
}
|
154
|
-
export
|
166
|
+
export declare class BanPersonResponse {
|
155
167
|
person_view: PersonViewSafe;
|
156
168
|
banned: boolean;
|
157
169
|
}
|
158
|
-
export
|
159
|
-
|
160
|
-
|
161
|
-
|
162
|
-
|
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
|
169
|
-
|
170
|
-
|
171
|
-
|
172
|
-
|
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
|
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
|
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
|
207
|
+
export declare class DeleteAccount {
|
190
208
|
password: string;
|
191
209
|
auth: string;
|
210
|
+
constructor(init: DeleteAccount);
|
192
211
|
}
|
193
|
-
export
|
212
|
+
export declare class DeleteAccountResponse {
|
194
213
|
}
|
195
|
-
export
|
214
|
+
export declare class PasswordReset {
|
196
215
|
email: string;
|
216
|
+
constructor(init: PasswordReset);
|
197
217
|
}
|
198
|
-
export
|
218
|
+
export declare class PasswordResetResponse {
|
199
219
|
}
|
200
|
-
export
|
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
|
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
|
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
|
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
|
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
|
226
|
-
unread_only
|
227
|
-
page
|
228
|
-
limit
|
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
|
257
|
+
export declare class PrivateMessagesResponse {
|
232
258
|
private_messages: PrivateMessageView[];
|
233
259
|
}
|
234
|
-
export
|
260
|
+
export declare class PrivateMessageResponse {
|
235
261
|
private_message_view: PrivateMessageView;
|
236
262
|
}
|
237
|
-
export
|
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
|
292
|
+
community_id: Option<number>;
|
242
293
|
auth: string;
|
294
|
+
constructor(init: GetReportCount);
|
243
295
|
}
|
244
|
-
export
|
245
|
-
community_id
|
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
|
302
|
+
export declare class GetUnreadCount {
|
250
303
|
auth: string;
|
304
|
+
constructor(init: GetUnreadCount);
|
251
305
|
}
|
252
|
-
export
|
306
|
+
export declare class GetUnreadCountResponse {
|
253
307
|
replies: number;
|
254
308
|
mentions: number;
|
255
309
|
private_messages: number;
|
256
310
|
}
|
257
|
-
export
|
311
|
+
export declare class VerifyEmail {
|
258
312
|
token: string;
|
313
|
+
constructor(init: VerifyEmail);
|
259
314
|
}
|
260
|
-
export
|
315
|
+
export declare class VerifyEmailResponse {
|
261
316
|
}
|
262
|
-
export
|
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
|
323
|
+
export declare class BlockPersonResponse {
|
268
324
|
person_view: PersonViewSafe;
|
269
325
|
blocked: boolean;
|
270
326
|
}
|
271
|
-
export
|
327
|
+
export declare class GetBannedPersons {
|
272
328
|
auth: string;
|
329
|
+
constructor(init: GetBannedPersons);
|
273
330
|
}
|
274
|
-
export
|
331
|
+
export declare class BannedPersonsResponse {
|
275
332
|
banned: PersonViewSafe[];
|
276
333
|
}
|