lemmy-js-client 0.17.0-rc.2 → 0.17.0-rc.20
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/http.d.ts +156 -4
- package/dist/http.js +255 -80
- package/dist/index.d.ts +1 -0
- package/dist/index.js +6 -1
- package/dist/interfaces/api/comment.d.ts +45 -38
- package/dist/interfaces/api/comment.js +313 -0
- package/dist/interfaces/api/community.d.ts +56 -52
- package/dist/interfaces/api/community.js +411 -0
- package/dist/interfaces/api/index.js +5 -1
- package/dist/interfaces/api/person.d.ts +120 -100
- package/dist/interfaces/api/person.js +854 -0
- package/dist/interfaces/api/post.d.ts +67 -51
- package/dist/interfaces/api/post.js +405 -0
- package/dist/interfaces/api/site.d.ts +99 -90
- package/dist/interfaces/api/site.js +824 -0
- package/dist/interfaces/index.js +5 -1
- package/dist/interfaces/others.d.ts +62 -92
- package/dist/interfaces/others.js +119 -55
- package/dist/interfaces/source.d.ts +79 -76
- package/dist/interfaces/source.js +747 -0
- package/dist/interfaces/views.d.ts +36 -37
- package/dist/interfaces/views.js +270 -0
- package/dist/utils.d.ts +5 -0
- package/dist/utils.js +10 -0
- package/dist/websocket.d.ts +16 -2
- package/dist/websocket.js +35 -3
- package/package.json +13 -11
@@ -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
|
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
|
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
|
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
|
24
|
-
captcha_answer
|
25
|
-
honeypot
|
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
|
32
|
+
answer: Option<string>;
|
33
|
+
constructor(init: Register);
|
30
34
|
}
|
31
|
-
export
|
35
|
+
export declare class GetCaptcha {
|
32
36
|
}
|
33
|
-
export
|
37
|
+
export declare class GetCaptchaResponse {
|
34
38
|
/**
|
35
39
|
* Will be undefined if captchas are disabled.
|
36
40
|
*/
|
37
|
-
ok
|
41
|
+
ok: Option<CaptchaResponse>;
|
38
42
|
}
|
39
|
-
export
|
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
|
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
|
54
|
-
show_nsfw
|
57
|
+
export declare class SaveUserSettings {
|
58
|
+
show_nsfw: Option<boolean>;
|
55
59
|
/**
|
56
60
|
* Default for this is `browser`.
|
57
61
|
*/
|
58
|
-
theme
|
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
|
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
|
71
|
-
lang
|
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
|
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
|
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
|
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
|
106
|
+
jwt: Option<string>;
|
101
107
|
verify_email_sent: boolean;
|
102
108
|
registration_created: boolean;
|
103
109
|
}
|
104
|
-
export
|
105
|
-
person_id
|
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
|
110
|
-
sort
|
111
|
-
page
|
112
|
-
limit
|
113
|
-
community_id
|
114
|
-
saved_only
|
115
|
-
auth
|
116
|
-
|
117
|
-
|
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
|
130
|
+
export declare class GetRepliesResponse {
|
124
131
|
replies: CommentView[];
|
125
132
|
}
|
126
|
-
export
|
133
|
+
export declare class GetPersonMentionsResponse {
|
127
134
|
mentions: PersonMentionView[];
|
128
135
|
}
|
129
|
-
export
|
136
|
+
export declare class MarkAllAsRead {
|
130
137
|
auth: string;
|
138
|
+
constructor(auth: string);
|
131
139
|
}
|
132
|
-
export
|
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
|
146
|
+
export declare class AddAdminResponse {
|
138
147
|
admins: PersonViewSafe[];
|
139
148
|
}
|
140
|
-
export
|
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
|
147
|
-
reason
|
155
|
+
remove_data: Option<boolean>;
|
156
|
+
reason: Option<string>;
|
148
157
|
/**
|
149
158
|
* The expire time in Unix seconds
|
150
159
|
*/
|
151
|
-
expires
|
160
|
+
expires: Option<number>;
|
152
161
|
auth: string;
|
162
|
+
constructor(init: BanPerson);
|
153
163
|
}
|
154
|
-
export
|
164
|
+
export declare class BanPersonResponse {
|
155
165
|
person_view: PersonViewSafe;
|
156
166
|
banned: boolean;
|
157
167
|
}
|
158
|
-
export
|
159
|
-
|
160
|
-
|
161
|
-
|
162
|
-
|
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
|
169
|
-
|
170
|
-
|
171
|
-
|
172
|
-
|
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
|
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
|
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
|
196
|
+
export declare class DeleteAccount {
|
190
197
|
password: string;
|
191
198
|
auth: string;
|
199
|
+
constructor(init: DeleteAccount);
|
192
200
|
}
|
193
|
-
export
|
201
|
+
export declare class DeleteAccountResponse {
|
194
202
|
}
|
195
|
-
export
|
203
|
+
export declare class PasswordReset {
|
196
204
|
email: string;
|
205
|
+
constructor(init: PasswordReset);
|
197
206
|
}
|
198
|
-
export
|
207
|
+
export declare class PasswordResetResponse {
|
199
208
|
}
|
200
|
-
export
|
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
|
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
|
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
|
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
|
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
|
226
|
-
unread_only
|
227
|
-
page
|
228
|
-
limit
|
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
|
246
|
+
export declare class PrivateMessagesResponse {
|
232
247
|
private_messages: PrivateMessageView[];
|
233
248
|
}
|
234
|
-
export
|
249
|
+
export declare class PrivateMessageResponse {
|
235
250
|
private_message_view: PrivateMessageView;
|
236
251
|
}
|
237
|
-
export
|
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
|
256
|
+
community_id: Option<number>;
|
242
257
|
auth: string;
|
258
|
+
constructor(init: GetReportCount);
|
243
259
|
}
|
244
|
-
export
|
245
|
-
community_id
|
260
|
+
export declare class GetReportCountResponse {
|
261
|
+
community_id: Option<number>;
|
246
262
|
comment_reports: number;
|
247
263
|
post_reports: number;
|
248
264
|
}
|
249
|
-
export
|
265
|
+
export declare class GetUnreadCount {
|
250
266
|
auth: string;
|
267
|
+
constructor(init: GetUnreadCount);
|
251
268
|
}
|
252
|
-
export
|
269
|
+
export declare class GetUnreadCountResponse {
|
253
270
|
replies: number;
|
254
271
|
mentions: number;
|
255
272
|
private_messages: number;
|
256
273
|
}
|
257
|
-
export
|
274
|
+
export declare class VerifyEmail {
|
258
275
|
token: string;
|
276
|
+
constructor(init: VerifyEmail);
|
259
277
|
}
|
260
|
-
export
|
278
|
+
export declare class VerifyEmailResponse {
|
261
279
|
}
|
262
|
-
export
|
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
|
286
|
+
export declare class BlockPersonResponse {
|
268
287
|
person_view: PersonViewSafe;
|
269
288
|
blocked: boolean;
|
270
289
|
}
|
271
|
-
export
|
290
|
+
export declare class GetBannedPersons {
|
272
291
|
auth: string;
|
292
|
+
constructor(init: GetBannedPersons);
|
273
293
|
}
|
274
|
-
export
|
294
|
+
export declare class BannedPersonsResponse {
|
275
295
|
banned: PersonViewSafe[];
|
276
296
|
}
|