lemmy-js-client 0.17.0-rc.2 → 0.17.0-rc.22
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 +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 +57 -52
- package/dist/interfaces/api/community.js +412 -0
- package/dist/interfaces/api/index.js +5 -1
- package/dist/interfaces/api/person.d.ts +121 -100
- package/dist/interfaces/api/person.js +855 -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 +100 -90
- package/dist/interfaces/api/site.js +825 -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 +37 -37
- package/dist/interfaces/views.js +274 -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 +14 -11
@@ -1,42 +1,47 @@
|
|
1
|
+
import { Option } from "@sniptt/monads";
|
2
|
+
import "reflect-metadata";
|
3
|
+
import { SortType } from "../others";
|
1
4
|
import { CommentView, CommunityModeratorView, PersonMentionView, PersonViewSafe, PostView, PrivateMessageView } from "../views";
|
2
|
-
export
|
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,249 @@ 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
|
131
|
+
export declare class GetRepliesResponse {
|
124
132
|
replies: CommentView[];
|
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<SortType>;
|
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<SortType>;
|
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
|
}
|
186
194
|
/**
|
187
195
|
* Permanently deletes your posts and comments
|
188
196
|
*/
|
189
|
-
export
|
197
|
+
export declare class DeleteAccount {
|
190
198
|
password: string;
|
191
199
|
auth: string;
|
200
|
+
constructor(init: DeleteAccount);
|
192
201
|
}
|
193
|
-
export
|
202
|
+
export declare class DeleteAccountResponse {
|
194
203
|
}
|
195
|
-
export
|
204
|
+
export declare class PasswordReset {
|
196
205
|
email: string;
|
206
|
+
constructor(init: PasswordReset);
|
197
207
|
}
|
198
|
-
export
|
208
|
+
export declare class PasswordResetResponse {
|
199
209
|
}
|
200
|
-
export
|
210
|
+
export declare class PasswordChange {
|
201
211
|
token: string;
|
202
212
|
password: string;
|
203
213
|
password_verify: string;
|
214
|
+
constructor(init: PasswordChange);
|
204
215
|
}
|
205
|
-
export
|
216
|
+
export declare class CreatePrivateMessage {
|
206
217
|
content: string;
|
207
218
|
recipient_id: number;
|
208
219
|
auth: string;
|
220
|
+
constructor(init: CreatePrivateMessage);
|
209
221
|
}
|
210
|
-
export
|
222
|
+
export declare class EditPrivateMessage {
|
211
223
|
private_message_id: number;
|
212
224
|
content: string;
|
213
225
|
auth: string;
|
226
|
+
constructor(init: EditPrivateMessage);
|
214
227
|
}
|
215
|
-
export
|
228
|
+
export declare class DeletePrivateMessage {
|
216
229
|
private_message_id: number;
|
217
230
|
deleted: boolean;
|
218
231
|
auth: string;
|
232
|
+
constructor(init: DeletePrivateMessage);
|
219
233
|
}
|
220
|
-
export
|
234
|
+
export declare class MarkPrivateMessageAsRead {
|
221
235
|
private_message_id: number;
|
222
236
|
read: boolean;
|
223
237
|
auth: string;
|
238
|
+
constructor(init: MarkPrivateMessageAsRead);
|
224
239
|
}
|
225
|
-
export
|
226
|
-
unread_only
|
227
|
-
page
|
228
|
-
limit
|
240
|
+
export declare class GetPrivateMessages {
|
241
|
+
unread_only: Option<boolean>;
|
242
|
+
page: Option<number>;
|
243
|
+
limit: Option<number>;
|
229
244
|
auth: string;
|
245
|
+
constructor(init: GetPrivateMessages);
|
230
246
|
}
|
231
|
-
export
|
247
|
+
export declare class PrivateMessagesResponse {
|
232
248
|
private_messages: PrivateMessageView[];
|
233
249
|
}
|
234
|
-
export
|
250
|
+
export declare class PrivateMessageResponse {
|
235
251
|
private_message_view: PrivateMessageView;
|
236
252
|
}
|
237
|
-
export
|
253
|
+
export declare class GetReportCount {
|
238
254
|
/**
|
239
255
|
* 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
256
|
*/
|
241
|
-
community_id
|
257
|
+
community_id: Option<number>;
|
242
258
|
auth: string;
|
259
|
+
constructor(init: GetReportCount);
|
243
260
|
}
|
244
|
-
export
|
245
|
-
community_id
|
261
|
+
export declare class GetReportCountResponse {
|
262
|
+
community_id: Option<number>;
|
246
263
|
comment_reports: number;
|
247
264
|
post_reports: number;
|
248
265
|
}
|
249
|
-
export
|
266
|
+
export declare class GetUnreadCount {
|
250
267
|
auth: string;
|
268
|
+
constructor(init: GetUnreadCount);
|
251
269
|
}
|
252
|
-
export
|
270
|
+
export declare class GetUnreadCountResponse {
|
253
271
|
replies: number;
|
254
272
|
mentions: number;
|
255
273
|
private_messages: number;
|
256
274
|
}
|
257
|
-
export
|
275
|
+
export declare class VerifyEmail {
|
258
276
|
token: string;
|
277
|
+
constructor(init: VerifyEmail);
|
259
278
|
}
|
260
|
-
export
|
279
|
+
export declare class VerifyEmailResponse {
|
261
280
|
}
|
262
|
-
export
|
281
|
+
export declare class BlockPerson {
|
263
282
|
person_id: number;
|
264
283
|
block: boolean;
|
265
284
|
auth: string;
|
285
|
+
constructor(init: BlockPerson);
|
266
286
|
}
|
267
|
-
export
|
287
|
+
export declare class BlockPersonResponse {
|
268
288
|
person_view: PersonViewSafe;
|
269
289
|
blocked: boolean;
|
270
290
|
}
|
271
|
-
export
|
291
|
+
export declare class GetBannedPersons {
|
272
292
|
auth: string;
|
293
|
+
constructor(init: GetBannedPersons);
|
273
294
|
}
|
274
|
-
export
|
295
|
+
export declare class BannedPersonsResponse {
|
275
296
|
banned: PersonViewSafe[];
|
276
297
|
}
|