lemmy-js-client 0.17.0-rc.5 → 0.17.0-rc.51

Sign up to get free protection for your applications and to get access to all the features.
package/dist/http.d.ts CHANGED
@@ -1,8 +1,8 @@
1
- import { CommentReportResponse, CommentResponse, CreateComment, CreateCommentLike, CreateCommentReport, DeleteComment, EditComment, GetComments, GetCommentsResponse, ListCommentReports, ListCommentReportsResponse, MarkCommentAsRead, RemoveComment, ResolveCommentReport, SaveComment } from "./interfaces/api/comment";
1
+ import { CommentReportResponse, CommentResponse, CreateComment, CreateCommentLike, CreateCommentReport, DeleteComment, EditComment, GetComments, GetCommentsResponse, ListCommentReports, ListCommentReportsResponse, RemoveComment, ResolveCommentReport, SaveComment } from "./interfaces/api/comment";
2
2
  import { AddModToCommunity, AddModToCommunityResponse, BanFromCommunity, BanFromCommunityResponse, BlockCommunity, BlockCommunityResponse, CommunityResponse, CreateCommunity, DeleteCommunity, EditCommunity, FollowCommunity, GetCommunity, GetCommunityResponse, ListCommunities, ListCommunitiesResponse, RemoveCommunity, TransferCommunity } from "./interfaces/api/community";
3
- import { AddAdmin, AddAdminResponse, BannedPersonsResponse, BanPerson, BanPersonResponse, BlockPerson, BlockPersonResponse, ChangePassword, CreatePrivateMessage, DeleteAccount, DeleteAccountResponse, DeletePrivateMessage, EditPrivateMessage, GetBannedPersons, GetCaptchaResponse, GetPersonDetails, GetPersonDetailsResponse, GetPersonMentions, GetPersonMentionsResponse, GetPrivateMessages, GetReplies, GetRepliesResponse, GetReportCount, GetReportCountResponse, GetUnreadCount, GetUnreadCountResponse, Login, LoginResponse, MarkAllAsRead, MarkPersonMentionAsRead, MarkPrivateMessageAsRead, PasswordChange, PasswordReset, PasswordResetResponse, PersonMentionResponse, PrivateMessageResponse, PrivateMessagesResponse, Register, SaveUserSettings, VerifyEmail, VerifyEmailResponse } from "./interfaces/api/person";
4
- import { CreatePost, CreatePostLike, CreatePostReport, DeletePost, EditPost, GetPost, GetPostResponse, GetPosts, GetPostsResponse, GetSiteMetadata, GetSiteMetadataResponse, ListPostReports, ListPostReportsResponse, LockPost, PostReportResponse, PostResponse, RemovePost, ResolvePostReport, SavePost, StickyPost } from "./interfaces/api/post";
5
- import { ApproveRegistrationApplication, CreateSite, EditSite, GetModlog, GetModlogResponse, GetSite, GetSiteConfig, GetSiteConfigResponse, GetSiteResponse, GetUnreadRegistrationApplicationCount, GetUnreadRegistrationApplicationCountResponse, LeaveAdmin, ListRegistrationApplications, ListRegistrationApplicationsResponse, RegistrationApplicationResponse, ResolveObject, ResolveObjectResponse, SaveSiteConfig, Search, SearchResponse, SiteResponse } from "./interfaces/api/site";
3
+ import { AddAdmin, AddAdminResponse, BannedPersonsResponse, BanPerson, BanPersonResponse, BlockPerson, BlockPersonResponse, ChangePassword, CreatePrivateMessage, CreatePrivateMessageReport, DeleteAccount, DeleteAccountResponse, DeletePrivateMessage, EditPrivateMessage, GetBannedPersons, GetCaptchaResponse, GetPersonDetails, GetPersonDetailsResponse, GetPersonMentions, GetPersonMentionsResponse, GetPrivateMessages, GetReplies, GetRepliesResponse, GetReportCount, GetReportCountResponse, GetUnreadCount, GetUnreadCountResponse, ListPrivateMessageReports, ListPrivateMessageReportsResponse, Login, LoginResponse, MarkAllAsRead, MarkCommentReplyAsRead, MarkPersonMentionAsRead, MarkPrivateMessageAsRead, PasswordChange, PasswordReset, PasswordResetResponse, PersonMentionResponse, PrivateMessageReportResponse, PrivateMessageResponse, PrivateMessagesResponse, Register, ResolvePrivateMessageReport, SaveUserSettings, VerifyEmail, VerifyEmailResponse } from "./interfaces/api/person";
4
+ import { CreatePost, CreatePostLike, CreatePostReport, DeletePost, EditPost, GetPost, GetPostResponse, GetPosts, GetPostsResponse, GetSiteMetadata, GetSiteMetadataResponse, ListPostReports, ListPostReportsResponse, LockPost, MarkPostAsRead, PostReportResponse, PostResponse, RemovePost, ResolvePostReport, SavePost, StickyPost } from "./interfaces/api/post";
5
+ import { ApproveRegistrationApplication, CreateSite, EditSite, GetModlog, GetModlogResponse, GetSite, GetSiteResponse, GetUnreadRegistrationApplicationCount, GetUnreadRegistrationApplicationCountResponse, LeaveAdmin, ListRegistrationApplications, ListRegistrationApplicationsResponse, PurgeComment, PurgeCommunity, PurgeItemResponse, PurgePerson, PurgePost, RegistrationApplicationResponse, ResolveObject, ResolveObjectResponse, Search, SearchResponse, SiteResponse } from "./interfaces/api/site";
6
6
  /**
7
7
  * Helps build lemmy HTTP requests.
8
8
  */
@@ -19,296 +19,478 @@ export declare class LemmyHttp {
19
19
  });
20
20
  /**
21
21
  * Gets the site, and your user data.
22
+ *
23
+ * `HTTP.GET /site`
22
24
  */
23
25
  getSite(form: GetSite): Promise<GetSiteResponse>;
24
26
  /**
25
27
  * Create your site.
28
+ *
29
+ * `HTTP.POST /site`
26
30
  */
27
31
  createSite(form: CreateSite): Promise<SiteResponse>;
28
32
  /**
29
33
  * Edit your site.
34
+ *
35
+ * `HTTP.PUT /site`
30
36
  */
31
37
  editSite(form: EditSite): Promise<SiteResponse>;
32
38
  /**
33
39
  * Leave the Site admins.
40
+ *
41
+ * `HTTP.POST /user/leave_admin`
34
42
  */
35
43
  leaveAdmin(form: LeaveAdmin): Promise<GetSiteResponse>;
36
- /**
37
- * Get your site configuration.
38
- */
39
- getSiteConfig(form: GetSiteConfig): Promise<GetSiteConfigResponse>;
40
- /**
41
- * Save your site config.
42
- */
43
- saveSiteConfig(form: SaveSiteConfig): Promise<GetSiteConfigResponse>;
44
44
  /**
45
45
  * Get the modlog.
46
+ *
47
+ * `HTTP.GET /modlog`
46
48
  */
47
49
  getModlog(form: GetModlog): Promise<GetModlogResponse>;
48
50
  /**
49
51
  * Search lemmy.
52
+ *
53
+ * `HTTP.GET /search`
50
54
  */
51
55
  search(form: Search): Promise<SearchResponse>;
52
56
  /**
53
57
  * Fetch a non-local / federated object.
58
+ *
59
+ * `HTTP.GET /resolve_object`
54
60
  */
55
61
  resolveObject(form: ResolveObject): Promise<ResolveObjectResponse>;
56
62
  /**
57
63
  * Create a new community.
64
+ *
65
+ * `HTTP.POST /community`
58
66
  */
59
67
  createCommunity(form: CreateCommunity): Promise<CommunityResponse>;
60
68
  /**
61
69
  * Get / fetch a community.
70
+ *
71
+ * `HTTP.GET /community`
62
72
  */
63
73
  getCommunity(form: GetCommunity): Promise<GetCommunityResponse>;
64
74
  /**
65
75
  * Edit a community.
76
+ *
77
+ * `HTTP.PUT /community`
66
78
  */
67
79
  editCommunity(form: EditCommunity): Promise<CommunityResponse>;
68
80
  /**
69
81
  * List communities, with various filters.
82
+ *
83
+ * `HTTP.GET /community/list`
70
84
  */
71
85
  listCommunities(form: ListCommunities): Promise<ListCommunitiesResponse>;
72
86
  /**
73
87
  * Follow / subscribe to a community.
88
+ *
89
+ * `HTTP.POST /community/follow`
74
90
  */
75
91
  followCommunity(form: FollowCommunity): Promise<CommunityResponse>;
76
92
  /**
77
93
  * Block a community.
94
+ *
95
+ * `HTTP.POST /community/block`
78
96
  */
79
97
  blockCommunity(form: BlockCommunity): Promise<BlockCommunityResponse>;
80
98
  /**
81
99
  * Delete a community.
100
+ *
101
+ * `HTTP.POST /community/delete`
82
102
  */
83
103
  deleteCommunity(form: DeleteCommunity): Promise<CommunityResponse>;
84
104
  /**
85
105
  * A moderator remove for a community.
106
+ *
107
+ * `HTTP.POST /community/remove`
86
108
  */
87
109
  removeCommunity(form: RemoveCommunity): Promise<CommunityResponse>;
88
110
  /**
89
111
  * Transfer your community to an existing moderator.
112
+ *
113
+ * `HTTP.POST /community/transfer`
90
114
  */
91
115
  transferCommunity(form: TransferCommunity): Promise<GetCommunityResponse>;
92
116
  /**
93
117
  * Ban a user from a community.
118
+ *
119
+ * `HTTP.POST /community/ban_user`
94
120
  */
95
121
  banFromCommunity(form: BanFromCommunity): Promise<BanFromCommunityResponse>;
96
122
  /**
97
123
  * Add a moderator to your community.
124
+ *
125
+ * `HTTP.POST /community/mod`
98
126
  */
99
127
  addModToCommunity(form: AddModToCommunity): Promise<AddModToCommunityResponse>;
100
128
  /**
101
129
  * Create a post.
130
+ *
131
+ * `HTTP.POST /post`
102
132
  */
103
133
  createPost(form: CreatePost): Promise<PostResponse>;
104
134
  /**
105
135
  * Get / fetch a post.
136
+ *
137
+ * `HTTP.GET /post`
106
138
  */
107
139
  getPost(form: GetPost): Promise<GetPostResponse>;
108
140
  /**
109
141
  * Edit a post.
142
+ *
143
+ * `HTTP.PUT /post`
110
144
  */
111
145
  editPost(form: EditPost): Promise<PostResponse>;
112
146
  /**
113
147
  * Delete a post.
148
+ *
149
+ * `HTTP.POST /post/delete`
114
150
  */
115
151
  deletePost(form: DeletePost): Promise<PostResponse>;
116
152
  /**
117
153
  * A moderator remove for a post.
154
+ *
155
+ * `HTTP.POST /post/remove`
118
156
  */
119
157
  removePost(form: RemovePost): Promise<PostResponse>;
158
+ /**
159
+ * Mark a post as read.
160
+ *
161
+ * `HTTP.POST /post/mark_as_read`
162
+ */
163
+ markPostAsRead(form: MarkPostAsRead): Promise<PostResponse>;
120
164
  /**
121
165
  * A moderator can lock a post ( IE disable new comments ).
166
+ *
167
+ * `HTTP.POST /post/lock`
122
168
  */
123
169
  lockPost(form: LockPost): Promise<PostResponse>;
124
170
  /**
125
171
  * A moderator can sticky a post ( IE stick it to the top of a community ).
172
+ *
173
+ * `HTTP.POST /post/sticky`
126
174
  */
127
175
  stickyPost(form: StickyPost): Promise<PostResponse>;
128
176
  /**
129
177
  * Get / fetch posts, with various filters.
178
+ *
179
+ * `HTTP.GET /post/list`
130
180
  */
131
181
  getPosts(form: GetPosts): Promise<GetPostsResponse>;
132
182
  /**
133
183
  * Like / vote on a post.
184
+ *
185
+ * `HTTP.POST /post/like`
134
186
  */
135
187
  likePost(form: CreatePostLike): Promise<PostResponse>;
136
188
  /**
137
189
  * Save a post.
190
+ *
191
+ * `HTTP.PUT /post/save`
138
192
  */
139
193
  savePost(form: SavePost): Promise<PostResponse>;
140
194
  /**
141
195
  * Report a post.
196
+ *
197
+ * `HTTP.POST /post/report`
142
198
  */
143
199
  createPostReport(form: CreatePostReport): Promise<PostReportResponse>;
144
200
  /**
145
201
  * Resolve a post report. Only a mod can do this.
202
+ *
203
+ * `HTTP.PUT /post/report/resolve`
146
204
  */
147
205
  resolvePostReport(form: ResolvePostReport): Promise<PostReportResponse>;
148
206
  /**
149
207
  * List post reports.
208
+ *
209
+ * `HTTP.GET /post/report/list`
150
210
  */
151
211
  listPostReports(form: ListPostReports): Promise<ListPostReportsResponse>;
152
212
  /**
153
213
  * Fetch metadata for any given site.
214
+ *
215
+ * `HTTP.GET /post/site_metadata`
154
216
  */
155
217
  getSiteMetadata(form: GetSiteMetadata): Promise<GetSiteMetadataResponse>;
156
218
  /**
157
219
  * Create a comment.
220
+ *
221
+ * `HTTP.POST /comment`
158
222
  */
159
223
  createComment(form: CreateComment): Promise<CommentResponse>;
160
224
  /**
161
225
  * Edit a comment.
226
+ *
227
+ * `HTTP.PUT /comment`
162
228
  */
163
229
  editComment(form: EditComment): Promise<CommentResponse>;
164
230
  /**
165
231
  * Delete a comment.
232
+ *
233
+ * `HTTP.POST /comment/delete`
166
234
  */
167
235
  deleteComment(form: DeleteComment): Promise<CommentResponse>;
168
236
  /**
169
237
  * A moderator remove for a comment.
238
+ *
239
+ * `HTTP.POST /comment/remove`
170
240
  */
171
241
  removeComment(form: RemoveComment): Promise<CommentResponse>;
172
242
  /**
173
243
  * Mark a comment as read.
244
+ *
245
+ * `HTTP.POST /comment/mark_as_read`
174
246
  */
175
- markCommentAsRead(form: MarkCommentAsRead): Promise<CommentResponse>;
247
+ markCommentReplyAsRead(form: MarkCommentReplyAsRead): Promise<CommentResponse>;
176
248
  /**
177
249
  * Like / vote on a comment.
250
+ *
251
+ * `HTTP.POST /comment/like`
178
252
  */
179
253
  likeComment(form: CreateCommentLike): Promise<CommentResponse>;
180
254
  /**
181
255
  * Save a comment.
256
+ *
257
+ * `HTTP.PUT /comment/save`
182
258
  */
183
259
  saveComment(form: SaveComment): Promise<CommentResponse>;
184
260
  /**
185
261
  * Get / fetch comments.
262
+ *
263
+ * `HTTP.GET /comment/list`
186
264
  */
187
265
  getComments(form: GetComments): Promise<GetCommentsResponse>;
188
266
  /**
189
267
  * Report a comment.
268
+ *
269
+ * `HTTP.POST /comment/report`
190
270
  */
191
271
  createCommentReport(form: CreateCommentReport): Promise<CommentReportResponse>;
192
272
  /**
193
273
  * Resolve a comment report. Only a mod can do this.
274
+ *
275
+ * `HTTP.PUT /comment/report/resolve`
194
276
  */
195
277
  resolveCommentReport(form: ResolveCommentReport): Promise<CommentReportResponse>;
196
278
  /**
197
279
  * List comment reports.
280
+ *
281
+ * `HTTP.GET /comment/report/list`
198
282
  */
199
283
  listCommentReports(form: ListCommentReports): Promise<ListCommentReportsResponse>;
200
284
  /**
201
285
  * Get / fetch private messages.
286
+ *
287
+ * `HTTP.GET /private_message/list`
202
288
  */
203
289
  getPrivateMessages(form: GetPrivateMessages): Promise<PrivateMessagesResponse>;
204
290
  /**
205
291
  * Create a private message.
292
+ *
293
+ * `HTTP.POST /private_message`
206
294
  */
207
295
  createPrivateMessage(form: CreatePrivateMessage): Promise<PrivateMessageResponse>;
208
296
  /**
209
297
  * Edit a private message.
298
+ *
299
+ * `HTTP.PUT /private_message`
210
300
  */
211
301
  editPrivateMessage(form: EditPrivateMessage): Promise<PrivateMessageResponse>;
212
302
  /**
213
303
  * Delete a private message.
304
+ *
305
+ * `HTTP.POST /private_message/delete`
214
306
  */
215
307
  deletePrivateMessage(form: DeletePrivateMessage): Promise<PrivateMessageResponse>;
216
308
  /**
217
309
  * Mark a private message as read.
310
+ *
311
+ * `HTTP.POST /private_message/mark_as_read`
218
312
  */
219
313
  markPrivateMessageAsRead(form: MarkPrivateMessageAsRead): Promise<PrivateMessageResponse>;
314
+ /**
315
+ * Create a report for a private message.
316
+ *
317
+ * `HTTP.POST /private_message/report`
318
+ */
319
+ createPrivateMessageReport(form: CreatePrivateMessageReport): Promise<PrivateMessageReportResponse>;
320
+ /**
321
+ * Resolve a report for a private message.
322
+ *
323
+ * `HTTP.PUT /private_message/report/resolve`
324
+ */
325
+ resolvePrivateMessageReport(form: ResolvePrivateMessageReport): Promise<PrivateMessageReportResponse>;
326
+ /**
327
+ * List private message reports.
328
+ *
329
+ * `HTTP.GET /private_message/report/list`
330
+ */
331
+ listPrivateMessageReports(form: ListPrivateMessageReports): Promise<ListPrivateMessageReportsResponse>;
220
332
  /**
221
333
  * Register a new user.
334
+ *
335
+ * `HTTP.POST /user/register`
222
336
  */
223
337
  register(form: Register): Promise<LoginResponse>;
224
338
  /**
225
339
  * Log into lemmy.
340
+ *
341
+ * `HTTP.POST /user/login`
226
342
  */
227
343
  login(form: Login): Promise<LoginResponse>;
228
344
  /**
229
345
  * Get the details for a person.
346
+ *
347
+ * `HTTP.GET /user`
230
348
  */
231
349
  getPersonDetails(form: GetPersonDetails): Promise<GetPersonDetailsResponse>;
232
350
  /**
233
351
  * Get mentions for your user.
352
+ *
353
+ * `HTTP.GET /user/mention`
234
354
  */
235
355
  getPersonMentions(form: GetPersonMentions): Promise<GetPersonMentionsResponse>;
236
356
  /**
237
357
  * Mark a person mention as read.
358
+ *
359
+ * `HTTP.POST /user/mention/mark_as_read`
238
360
  */
239
361
  markPersonMentionAsRead(form: MarkPersonMentionAsRead): Promise<PersonMentionResponse>;
240
362
  /**
241
363
  * Get comment replies.
364
+ *
365
+ * `HTTP.GET /user/replies`
242
366
  */
243
367
  getReplies(form: GetReplies): Promise<GetRepliesResponse>;
244
368
  /**
245
369
  * Ban a person from your site.
370
+ *
371
+ * `HTTP.POST /user/ban`
246
372
  */
247
373
  banPerson(form: BanPerson): Promise<BanPersonResponse>;
248
374
  /**
249
375
  * Get a list of banned users
376
+ *
377
+ * `HTTP.GET /user/banned`
250
378
  */
251
379
  getBannedPersons(form: GetBannedPersons): Promise<BannedPersonsResponse>;
252
380
  /**
253
381
  * Block a person.
382
+ *
383
+ * `HTTP.POST /user/block`
254
384
  */
255
385
  blockPerson(form: BlockPerson): Promise<BlockPersonResponse>;
256
386
  /**
257
387
  * Fetch a Captcha.
388
+ *
389
+ * `HTTP.GET /user/get_captcha`
258
390
  */
259
391
  getCaptcha(): Promise<GetCaptchaResponse>;
260
392
  /**
261
393
  * Delete your account.
394
+ *
395
+ * `HTTP.POST /user/delete_account`
262
396
  */
263
397
  deleteAccount(form: DeleteAccount): Promise<DeleteAccountResponse>;
264
398
  /**
265
399
  * Reset your password.
400
+ *
401
+ * `HTTP.POST /user/password_reset`
266
402
  */
267
403
  passwordReset(form: PasswordReset): Promise<PasswordResetResponse>;
268
404
  /**
269
405
  * Change your password from an email / token based reset.
406
+ *
407
+ * `HTTP.POST /user/password_change`
270
408
  */
271
409
  passwordChange(form: PasswordChange): Promise<LoginResponse>;
272
410
  /**
273
411
  * Mark all replies as read.
412
+ *
413
+ * `HTTP.POST /user/mark_all_as_read`
274
414
  */
275
415
  markAllAsRead(form: MarkAllAsRead): Promise<GetRepliesResponse>;
276
416
  /**
277
417
  * Save your user settings.
418
+ *
419
+ * `HTTP.PUT /user/save_user_settings`
278
420
  */
279
421
  saveUserSettings(form: SaveUserSettings): Promise<LoginResponse>;
280
422
  /**
281
423
  * Change your user password.
424
+ *
425
+ * `HTTP.PUT /user/change_password`
282
426
  */
283
427
  changePassword(form: ChangePassword): Promise<LoginResponse>;
284
428
  /**
285
429
  * Get counts for your reports
430
+ *
431
+ * `HTTP.GET /user/report_count`
286
432
  */
287
433
  getReportCount(form: GetReportCount): Promise<GetReportCountResponse>;
288
434
  /**
289
435
  * Get your unread counts
436
+ *
437
+ * `HTTP.GET /user/unread_count`
290
438
  */
291
439
  getUnreadCount(form: GetUnreadCount): Promise<GetUnreadCountResponse>;
292
440
  /**
293
441
  * Verify your email
442
+ *
443
+ * `HTTP.POST /user/verify_email`
294
444
  */
295
445
  verifyEmail(form: VerifyEmail): Promise<VerifyEmailResponse>;
296
446
  /**
297
447
  * Add an admin to your site.
448
+ *
449
+ * `HTTP.POST /admin/add`
298
450
  */
299
451
  addAdmin(form: AddAdmin): Promise<AddAdminResponse>;
300
452
  /**
301
453
  * Get the unread registration applications count.
454
+ *
455
+ * `HTTP.GET /admin/registration_application/count`
302
456
  */
303
457
  getUnreadRegistrationApplicationCount(form: GetUnreadRegistrationApplicationCount): Promise<GetUnreadRegistrationApplicationCountResponse>;
304
458
  /**
305
- * List the unread registration applications.
459
+ * List the registration applications.
460
+ *
461
+ * `HTTP.GET /admin/registration_application/list`
306
462
  */
307
463
  listRegistrationApplications(form: ListRegistrationApplications): Promise<ListRegistrationApplicationsResponse>;
308
464
  /**
309
465
  * Approve a registration application
466
+ *
467
+ * `HTTP.PUT /admin/registration_application/approve`
310
468
  */
311
469
  approveRegistrationApplication(form: ApproveRegistrationApplication): Promise<RegistrationApplicationResponse>;
470
+ /**
471
+ * Purge / Delete a person from the database.
472
+ *
473
+ * `HTTP.POST /admin/purge/person`
474
+ */
475
+ purgePerson(form: PurgePerson): Promise<PurgeItemResponse>;
476
+ /**
477
+ * Purge / Delete a community from the database.
478
+ *
479
+ * `HTTP.POST /admin/purge/community`
480
+ */
481
+ purgeCommunity(form: PurgeCommunity): Promise<PurgeItemResponse>;
482
+ /**
483
+ * Purge / Delete a post from the database.
484
+ *
485
+ * `HTTP.POST /admin/purge/post`
486
+ */
487
+ purgePost(form: PurgePost): Promise<PurgeItemResponse>;
488
+ /**
489
+ * Purge / Delete a comment from the database.
490
+ *
491
+ * `HTTP.POST /admin/purge/comment`
492
+ */
493
+ purgeComment(form: PurgeComment): Promise<PurgeItemResponse>;
312
494
  private buildFullUrl;
313
495
  private wrapper;
314
496
  }