lemmy-js-client 0.16.4-rc.1 → 0.16.4

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