lemmy-js-client 0.17.0-rc.4 → 0.17.0-rc.40
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 +178 -14
- package/dist/http.js +296 -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 +47 -45
- package/dist/interfaces/api/comment.js +349 -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 +132 -102
- package/dist/interfaces/api/person.js +910 -0
- package/dist/interfaces/api/post.d.ts +71 -54
- package/dist/interfaces/api/post.js +453 -0
- package/dist/interfaces/api/site.d.ts +127 -98
- package/dist/interfaces/api/site.js +985 -0
- package/dist/interfaces/index.js +5 -1
- package/dist/interfaces/others.d.ts +101 -93
- package/dist/interfaces/others.js +162 -59
- package/dist/interfaces/source.d.ts +113 -77
- package/dist/interfaces/source.js +809 -0
- package/dist/interfaces/views.d.ts +79 -40
- package/dist/interfaces/views.js +599 -0
- package/dist/utils.d.ts +9 -0
- package/dist/utils.js +18 -0
- package/dist/websocket.d.ts +33 -14
- package/dist/websocket.js +49 -19
- 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, 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,258 @@ 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
|
-
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
|
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
|
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
|
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
|
107
|
+
jwt: Option<string>;
|
101
108
|
verify_email_sent: boolean;
|
102
109
|
registration_created: boolean;
|
103
110
|
}
|
104
|
-
export
|
105
|
-
person_id
|
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
|
110
|
-
sort
|
111
|
-
page
|
112
|
-
limit
|
113
|
-
community_id
|
114
|
-
saved_only
|
115
|
-
auth
|
116
|
-
|
117
|
-
|
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
|
124
|
-
replies:
|
131
|
+
export declare class GetRepliesResponse {
|
132
|
+
replies: CommentReplyView[];
|
125
133
|
}
|
126
|
-
export
|
134
|
+
export declare class GetPersonMentionsResponse {
|
127
135
|
mentions: PersonMentionView[];
|
128
136
|
}
|
129
|
-
export
|
137
|
+
export declare class MarkAllAsRead {
|
130
138
|
auth: string;
|
139
|
+
constructor(auth: string);
|
131
140
|
}
|
132
|
-
export
|
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
|
147
|
+
export declare class AddAdminResponse {
|
138
148
|
admins: PersonViewSafe[];
|
139
149
|
}
|
140
|
-
export
|
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
|
147
|
-
reason
|
156
|
+
remove_data: Option<boolean>;
|
157
|
+
reason: Option<string>;
|
148
158
|
/**
|
149
159
|
* The expire time in Unix seconds
|
150
160
|
*/
|
151
|
-
expires
|
161
|
+
expires: Option<number>;
|
152
162
|
auth: string;
|
163
|
+
constructor(init: BanPerson);
|
153
164
|
}
|
154
|
-
export
|
165
|
+
export declare class BanPersonResponse {
|
155
166
|
person_view: PersonViewSafe;
|
156
167
|
banned: boolean;
|
157
168
|
}
|
158
|
-
export
|
159
|
-
|
160
|
-
|
161
|
-
|
162
|
-
|
163
|
-
page?: number;
|
164
|
-
limit?: number;
|
165
|
-
unread_only?: boolean;
|
169
|
+
export declare class GetReplies {
|
170
|
+
sort: Option<CommentSortType>;
|
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
|
169
|
-
|
170
|
-
|
171
|
-
|
172
|
-
|
173
|
-
page?: number;
|
174
|
-
limit?: number;
|
175
|
-
unread_only?: boolean;
|
177
|
+
export declare class GetPersonMentions {
|
178
|
+
sort: Option<CommentSortType>;
|
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
|
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
|
191
|
+
export declare class PersonMentionResponse {
|
184
192
|
person_mention_view: PersonMentionView;
|
185
193
|
}
|
194
|
+
export declare class MarkCommentReplyAsRead {
|
195
|
+
comment_reply_id: number;
|
196
|
+
read: boolean;
|
197
|
+
auth: string;
|
198
|
+
constructor(init: MarkCommentReplyAsRead);
|
199
|
+
}
|
200
|
+
export declare class CommentReplyResponse {
|
201
|
+
comment_reply_view: CommentReplyView;
|
202
|
+
}
|
186
203
|
/**
|
187
204
|
* Permanently deletes your posts and comments
|
188
205
|
*/
|
189
|
-
export
|
206
|
+
export declare class DeleteAccount {
|
190
207
|
password: string;
|
191
208
|
auth: string;
|
209
|
+
constructor(init: DeleteAccount);
|
192
210
|
}
|
193
|
-
export
|
211
|
+
export declare class DeleteAccountResponse {
|
194
212
|
}
|
195
|
-
export
|
213
|
+
export declare class PasswordReset {
|
196
214
|
email: string;
|
215
|
+
constructor(init: PasswordReset);
|
197
216
|
}
|
198
|
-
export
|
217
|
+
export declare class PasswordResetResponse {
|
199
218
|
}
|
200
|
-
export
|
219
|
+
export declare class PasswordChange {
|
201
220
|
token: string;
|
202
221
|
password: string;
|
203
222
|
password_verify: string;
|
223
|
+
constructor(init: PasswordChange);
|
204
224
|
}
|
205
|
-
export
|
225
|
+
export declare class CreatePrivateMessage {
|
206
226
|
content: string;
|
207
227
|
recipient_id: number;
|
208
228
|
auth: string;
|
229
|
+
constructor(init: CreatePrivateMessage);
|
209
230
|
}
|
210
|
-
export
|
231
|
+
export declare class EditPrivateMessage {
|
211
232
|
private_message_id: number;
|
212
233
|
content: string;
|
213
234
|
auth: string;
|
235
|
+
constructor(init: EditPrivateMessage);
|
214
236
|
}
|
215
|
-
export
|
237
|
+
export declare class DeletePrivateMessage {
|
216
238
|
private_message_id: number;
|
217
239
|
deleted: boolean;
|
218
240
|
auth: string;
|
241
|
+
constructor(init: DeletePrivateMessage);
|
219
242
|
}
|
220
|
-
export
|
243
|
+
export declare class MarkPrivateMessageAsRead {
|
221
244
|
private_message_id: number;
|
222
245
|
read: boolean;
|
223
246
|
auth: string;
|
247
|
+
constructor(init: MarkPrivateMessageAsRead);
|
224
248
|
}
|
225
|
-
export
|
226
|
-
unread_only
|
227
|
-
page
|
228
|
-
limit
|
249
|
+
export declare class GetPrivateMessages {
|
250
|
+
unread_only: Option<boolean>;
|
251
|
+
page: Option<number>;
|
252
|
+
limit: Option<number>;
|
229
253
|
auth: string;
|
254
|
+
constructor(init: GetPrivateMessages);
|
230
255
|
}
|
231
|
-
export
|
256
|
+
export declare class PrivateMessagesResponse {
|
232
257
|
private_messages: PrivateMessageView[];
|
233
258
|
}
|
234
|
-
export
|
259
|
+
export declare class PrivateMessageResponse {
|
235
260
|
private_message_view: PrivateMessageView;
|
236
261
|
}
|
237
|
-
export
|
262
|
+
export declare class GetReportCount {
|
238
263
|
/**
|
239
264
|
* 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
265
|
*/
|
241
|
-
community_id
|
266
|
+
community_id: Option<number>;
|
242
267
|
auth: string;
|
268
|
+
constructor(init: GetReportCount);
|
243
269
|
}
|
244
|
-
export
|
245
|
-
community_id
|
270
|
+
export declare class GetReportCountResponse {
|
271
|
+
community_id: Option<number>;
|
246
272
|
comment_reports: number;
|
247
273
|
post_reports: number;
|
248
274
|
}
|
249
|
-
export
|
275
|
+
export declare class GetUnreadCount {
|
250
276
|
auth: string;
|
277
|
+
constructor(init: GetUnreadCount);
|
251
278
|
}
|
252
|
-
export
|
279
|
+
export declare class GetUnreadCountResponse {
|
253
280
|
replies: number;
|
254
281
|
mentions: number;
|
255
282
|
private_messages: number;
|
256
283
|
}
|
257
|
-
export
|
284
|
+
export declare class VerifyEmail {
|
258
285
|
token: string;
|
286
|
+
constructor(init: VerifyEmail);
|
259
287
|
}
|
260
|
-
export
|
288
|
+
export declare class VerifyEmailResponse {
|
261
289
|
}
|
262
|
-
export
|
290
|
+
export declare class BlockPerson {
|
263
291
|
person_id: number;
|
264
292
|
block: boolean;
|
265
293
|
auth: string;
|
294
|
+
constructor(init: BlockPerson);
|
266
295
|
}
|
267
|
-
export
|
296
|
+
export declare class BlockPersonResponse {
|
268
297
|
person_view: PersonViewSafe;
|
269
298
|
blocked: boolean;
|
270
299
|
}
|
271
|
-
export
|
300
|
+
export declare class GetBannedPersons {
|
272
301
|
auth: string;
|
302
|
+
constructor(init: GetBannedPersons);
|
273
303
|
}
|
274
|
-
export
|
304
|
+
export declare class BannedPersonsResponse {
|
275
305
|
banned: PersonViewSafe[];
|
276
306
|
}
|