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