lemmy-js-client 0.17.0-rc.59 → 0.17.0-rc.60
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/http.js +85 -100
- package/dist/index.d.ts +0 -1
- package/dist/index.js +0 -1
- package/dist/interfaces/api/comment.d.ts +38 -50
- package/dist/interfaces/api/comment.js +0 -393
- package/dist/interfaces/api/community.d.ts +45 -58
- package/dist/interfaces/api/community.js +0 -466
- package/dist/interfaces/api/person.d.ts +106 -136
- package/dist/interfaces/api/person.js +0 -1004
- package/dist/interfaces/api/post.d.ts +47 -64
- package/dist/interfaces/api/post.js +0 -475
- package/dist/interfaces/api/site.d.ts +142 -157
- package/dist/interfaces/api/site.js +0 -1520
- package/dist/interfaces/others.d.ts +5 -7
- package/dist/interfaces/others.js +1 -63
- package/dist/interfaces/source.d.ts +97 -98
- package/dist/interfaces/source.js +1 -905
- package/dist/interfaces/views.d.ts +57 -59
- package/dist/interfaces/views.js +0 -772
- package/dist/utils.d.ts +0 -9
- package/dist/utils.js +0 -18
- package/dist/websocket.d.ts +1 -2
- package/dist/websocket.js +4 -4
- package/package.json +2 -5
@@ -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
|
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
|
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
|
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
|
28
|
-
captcha_answer
|
29
|
-
honeypot
|
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
|
34
|
-
constructor(init: Register);
|
30
|
+
answer?: string;
|
35
31
|
}
|
36
|
-
export
|
32
|
+
export interface GetCaptcha {
|
37
33
|
}
|
38
|
-
export
|
34
|
+
export interface GetCaptchaResponse {
|
39
35
|
/**
|
40
36
|
* Will be undefined if captchas are disabled.
|
41
37
|
*/
|
42
|
-
ok
|
38
|
+
ok?: CaptchaResponse;
|
43
39
|
}
|
44
|
-
export
|
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
|
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
|
59
|
-
show_nsfw
|
54
|
+
export interface SaveUserSettings {
|
55
|
+
show_nsfw?: boolean;
|
60
56
|
/**
|
61
57
|
* Default for this is `browser`.
|
62
58
|
*/
|
63
|
-
theme
|
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
|
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
|
76
|
-
interface_language
|
77
|
-
avatar
|
78
|
-
banner
|
79
|
-
display_name
|
80
|
-
email
|
81
|
-
bio
|
82
|
-
matrix_user_id
|
83
|
-
show_avatars
|
84
|
-
show_scores
|
85
|
-
send_notifications_to_email
|
86
|
-
bot_account
|
87
|
-
show_bot_accounts
|
88
|
-
show_read_posts
|
89
|
-
show_new_post_notifs
|
90
|
-
discussion_languages
|
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
|
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
|
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
|
102
|
+
jwt?: string;
|
109
103
|
verify_email_sent: boolean;
|
110
104
|
registration_created: boolean;
|
111
105
|
}
|
112
|
-
export
|
113
|
-
person_id
|
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
|
118
|
-
sort
|
119
|
-
page
|
120
|
-
limit
|
121
|
-
community_id
|
122
|
-
saved_only
|
123
|
-
auth
|
124
|
-
|
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
|
125
|
+
export interface GetRepliesResponse {
|
133
126
|
replies: CommentReplyView[];
|
134
127
|
}
|
135
|
-
export
|
128
|
+
export interface GetPersonMentionsResponse {
|
136
129
|
mentions: PersonMentionView[];
|
137
130
|
}
|
138
|
-
export
|
131
|
+
export interface MarkAllAsRead {
|
139
132
|
auth: string;
|
140
|
-
constructor(auth: string);
|
141
133
|
}
|
142
|
-
export
|
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
|
139
|
+
export interface AddAdminResponse {
|
149
140
|
admins: PersonViewSafe[];
|
150
141
|
}
|
151
|
-
export
|
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
|
158
|
-
reason
|
148
|
+
remove_data?: boolean;
|
149
|
+
reason?: string;
|
159
150
|
/**
|
160
151
|
* The expire time in Unix seconds
|
161
152
|
*/
|
162
|
-
expires
|
153
|
+
expires?: number;
|
163
154
|
auth: string;
|
164
|
-
constructor(init: BanPerson);
|
165
155
|
}
|
166
|
-
export
|
156
|
+
export interface BanPersonResponse {
|
167
157
|
person_view: PersonViewSafe;
|
168
158
|
banned: boolean;
|
169
159
|
}
|
170
|
-
export
|
171
|
-
sort
|
172
|
-
page
|
173
|
-
limit
|
174
|
-
unread_only
|
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
|
179
|
-
sort
|
180
|
-
page
|
181
|
-
limit
|
182
|
-
unread_only
|
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
|
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
|
179
|
+
export interface PersonMentionResponse {
|
193
180
|
person_mention_view: PersonMentionView;
|
194
181
|
}
|
195
|
-
export
|
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
|
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
|
193
|
+
export interface DeleteAccount {
|
208
194
|
password: string;
|
209
195
|
auth: string;
|
210
|
-
constructor(init: DeleteAccount);
|
211
196
|
}
|
212
|
-
export
|
197
|
+
export interface DeleteAccountResponse {
|
213
198
|
}
|
214
|
-
export
|
199
|
+
export interface PasswordReset {
|
215
200
|
email: string;
|
216
|
-
constructor(init: PasswordReset);
|
217
201
|
}
|
218
|
-
export
|
202
|
+
export interface PasswordResetResponse {
|
219
203
|
}
|
220
|
-
export
|
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
|
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
|
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
|
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
|
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
|
251
|
-
unread_only
|
252
|
-
page
|
253
|
-
limit
|
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
|
235
|
+
export interface PrivateMessagesResponse {
|
258
236
|
private_messages: PrivateMessageView[];
|
259
237
|
}
|
260
|
-
export
|
238
|
+
export interface PrivateMessageResponse {
|
261
239
|
private_message_view: PrivateMessageView;
|
262
240
|
}
|
263
|
-
export
|
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
|
246
|
+
export interface PrivateMessageReportResponse {
|
270
247
|
private_message_report_view: PrivateMessageReportView;
|
271
248
|
}
|
272
|
-
export
|
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
|
279
|
-
page
|
280
|
-
limit
|
281
|
-
unresolved_only
|
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
|
260
|
+
export interface ListPrivateMessageReportsResponse {
|
286
261
|
private_message_reports: PrivateMessageReportView[];
|
287
262
|
}
|
288
|
-
export
|
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
|
267
|
+
community_id?: number;
|
293
268
|
auth: string;
|
294
|
-
constructor(init: GetReportCount);
|
295
269
|
}
|
296
|
-
export
|
297
|
-
community_id
|
270
|
+
export interface GetReportCountResponse {
|
271
|
+
community_id?: number;
|
298
272
|
comment_reports: number;
|
299
273
|
post_reports: number;
|
300
|
-
private_message_reports
|
274
|
+
private_message_reports?: number;
|
301
275
|
}
|
302
|
-
export
|
276
|
+
export interface GetUnreadCount {
|
303
277
|
auth: string;
|
304
|
-
constructor(init: GetUnreadCount);
|
305
278
|
}
|
306
|
-
export
|
279
|
+
export interface GetUnreadCountResponse {
|
307
280
|
replies: number;
|
308
281
|
mentions: number;
|
309
282
|
private_messages: number;
|
310
283
|
}
|
311
|
-
export
|
284
|
+
export interface VerifyEmail {
|
312
285
|
token: string;
|
313
|
-
constructor(init: VerifyEmail);
|
314
286
|
}
|
315
|
-
export
|
287
|
+
export interface VerifyEmailResponse {
|
316
288
|
}
|
317
|
-
export
|
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
|
294
|
+
export interface BlockPersonResponse {
|
324
295
|
person_view: PersonViewSafe;
|
325
296
|
blocked: boolean;
|
326
297
|
}
|
327
|
-
export
|
298
|
+
export interface GetBannedPersons {
|
328
299
|
auth: string;
|
329
|
-
constructor(init: GetBannedPersons);
|
330
300
|
}
|
331
|
-
export
|
301
|
+
export interface BannedPersonsResponse {
|
332
302
|
banned: PersonViewSafe[];
|
333
303
|
}
|