lemmy-js-client 0.17.0-rc.1 → 0.17.0-rc.12
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 +103 -5
- package/dist/http.js +129 -1
- package/dist/index.js +5 -1
- package/dist/interfaces/api/comment.d.ts +3 -8
- package/dist/interfaces/api/community.d.ts +4 -12
- package/dist/interfaces/api/index.js +5 -1
- package/dist/interfaces/api/person.d.ts +4 -9
- package/dist/interfaces/api/post.d.ts +11 -11
- package/dist/interfaces/api/site.d.ts +35 -13
- package/dist/interfaces/index.js +5 -1
- package/dist/interfaces/others.d.ts +59 -54
- package/dist/interfaces/others.js +59 -54
- package/dist/interfaces/source.d.ts +28 -0
- package/dist/interfaces/views.d.ts +19 -3
- package/dist/websocket.d.ts +22 -2
- package/dist/websocket.js +30 -0
- package/package.json +11 -11
package/dist/http.js
CHANGED
@@ -74,6 +74,7 @@ var LemmyHttp = /** @class */ (function () {
|
|
74
74
|
}
|
75
75
|
/**
|
76
76
|
* Gets the site, and your user data.
|
77
|
+
* `HTTP.GET /site`
|
77
78
|
*/
|
78
79
|
LemmyHttp.prototype.getSite = function (form) {
|
79
80
|
return __awaiter(this, void 0, void 0, function () {
|
@@ -84,6 +85,7 @@ var LemmyHttp = /** @class */ (function () {
|
|
84
85
|
};
|
85
86
|
/**
|
86
87
|
* Create your site.
|
88
|
+
* `HTTP.POST /site`
|
87
89
|
*/
|
88
90
|
LemmyHttp.prototype.createSite = function (form) {
|
89
91
|
return __awaiter(this, void 0, void 0, function () {
|
@@ -94,6 +96,7 @@ var LemmyHttp = /** @class */ (function () {
|
|
94
96
|
};
|
95
97
|
/**
|
96
98
|
* Edit your site.
|
99
|
+
* `HTTP.PUT /site`
|
97
100
|
*/
|
98
101
|
LemmyHttp.prototype.editSite = function (form) {
|
99
102
|
return __awaiter(this, void 0, void 0, function () {
|
@@ -104,6 +107,7 @@ var LemmyHttp = /** @class */ (function () {
|
|
104
107
|
};
|
105
108
|
/**
|
106
109
|
* Leave the Site admins.
|
110
|
+
* `HTTP.POST /user/leave_admin`
|
107
111
|
*/
|
108
112
|
LemmyHttp.prototype.leaveAdmin = function (form) {
|
109
113
|
return __awaiter(this, void 0, void 0, function () {
|
@@ -114,6 +118,7 @@ var LemmyHttp = /** @class */ (function () {
|
|
114
118
|
};
|
115
119
|
/**
|
116
120
|
* Get your site configuration.
|
121
|
+
* `HTTP.GET /site/config`
|
117
122
|
*/
|
118
123
|
LemmyHttp.prototype.getSiteConfig = function (form) {
|
119
124
|
return __awaiter(this, void 0, void 0, function () {
|
@@ -124,6 +129,7 @@ var LemmyHttp = /** @class */ (function () {
|
|
124
129
|
};
|
125
130
|
/**
|
126
131
|
* Save your site config.
|
132
|
+
* `HTTP.PUT /site/config`
|
127
133
|
*/
|
128
134
|
LemmyHttp.prototype.saveSiteConfig = function (form) {
|
129
135
|
return __awaiter(this, void 0, void 0, function () {
|
@@ -134,6 +140,7 @@ var LemmyHttp = /** @class */ (function () {
|
|
134
140
|
};
|
135
141
|
/**
|
136
142
|
* Get the modlog.
|
143
|
+
* `HTTP.GET /modlog`
|
137
144
|
*/
|
138
145
|
LemmyHttp.prototype.getModlog = function (form) {
|
139
146
|
return __awaiter(this, void 0, void 0, function () {
|
@@ -144,6 +151,7 @@ var LemmyHttp = /** @class */ (function () {
|
|
144
151
|
};
|
145
152
|
/**
|
146
153
|
* Search lemmy.
|
154
|
+
* `HTTP.GET /search`
|
147
155
|
*/
|
148
156
|
LemmyHttp.prototype.search = function (form) {
|
149
157
|
return __awaiter(this, void 0, void 0, function () {
|
@@ -154,6 +162,7 @@ var LemmyHttp = /** @class */ (function () {
|
|
154
162
|
};
|
155
163
|
/**
|
156
164
|
* Fetch a non-local / federated object.
|
165
|
+
* `HTTP.GET /resolve_object`
|
157
166
|
*/
|
158
167
|
LemmyHttp.prototype.resolveObject = function (form) {
|
159
168
|
return __awaiter(this, void 0, void 0, function () {
|
@@ -164,6 +173,7 @@ var LemmyHttp = /** @class */ (function () {
|
|
164
173
|
};
|
165
174
|
/**
|
166
175
|
* Create a new community.
|
176
|
+
* `HTTP.POST /community`
|
167
177
|
*/
|
168
178
|
LemmyHttp.prototype.createCommunity = function (form) {
|
169
179
|
return __awaiter(this, void 0, void 0, function () {
|
@@ -174,6 +184,7 @@ var LemmyHttp = /** @class */ (function () {
|
|
174
184
|
};
|
175
185
|
/**
|
176
186
|
* Get / fetch a community.
|
187
|
+
* `HTTP.GET /community`
|
177
188
|
*/
|
178
189
|
LemmyHttp.prototype.getCommunity = function (form) {
|
179
190
|
return __awaiter(this, void 0, void 0, function () {
|
@@ -184,6 +195,7 @@ var LemmyHttp = /** @class */ (function () {
|
|
184
195
|
};
|
185
196
|
/**
|
186
197
|
* Edit a community.
|
198
|
+
* `HTTP.PUT /community`
|
187
199
|
*/
|
188
200
|
LemmyHttp.prototype.editCommunity = function (form) {
|
189
201
|
return __awaiter(this, void 0, void 0, function () {
|
@@ -194,6 +206,7 @@ var LemmyHttp = /** @class */ (function () {
|
|
194
206
|
};
|
195
207
|
/**
|
196
208
|
* List communities, with various filters.
|
209
|
+
* `HTTP.GET /community/list`
|
197
210
|
*/
|
198
211
|
LemmyHttp.prototype.listCommunities = function (form) {
|
199
212
|
return __awaiter(this, void 0, void 0, function () {
|
@@ -204,6 +217,7 @@ var LemmyHttp = /** @class */ (function () {
|
|
204
217
|
};
|
205
218
|
/**
|
206
219
|
* Follow / subscribe to a community.
|
220
|
+
* `HTTP.POST /community/follow`
|
207
221
|
*/
|
208
222
|
LemmyHttp.prototype.followCommunity = function (form) {
|
209
223
|
return __awaiter(this, void 0, void 0, function () {
|
@@ -214,6 +228,7 @@ var LemmyHttp = /** @class */ (function () {
|
|
214
228
|
};
|
215
229
|
/**
|
216
230
|
* Block a community.
|
231
|
+
* `HTTP.POST /community/block`
|
217
232
|
*/
|
218
233
|
LemmyHttp.prototype.blockCommunity = function (form) {
|
219
234
|
return __awaiter(this, void 0, void 0, function () {
|
@@ -224,6 +239,7 @@ var LemmyHttp = /** @class */ (function () {
|
|
224
239
|
};
|
225
240
|
/**
|
226
241
|
* Delete a community.
|
242
|
+
* `HTTP.POST /community/delete`
|
227
243
|
*/
|
228
244
|
LemmyHttp.prototype.deleteCommunity = function (form) {
|
229
245
|
return __awaiter(this, void 0, void 0, function () {
|
@@ -234,6 +250,7 @@ var LemmyHttp = /** @class */ (function () {
|
|
234
250
|
};
|
235
251
|
/**
|
236
252
|
* A moderator remove for a community.
|
253
|
+
* `HTTP.POST /community/remove`
|
237
254
|
*/
|
238
255
|
LemmyHttp.prototype.removeCommunity = function (form) {
|
239
256
|
return __awaiter(this, void 0, void 0, function () {
|
@@ -244,6 +261,7 @@ var LemmyHttp = /** @class */ (function () {
|
|
244
261
|
};
|
245
262
|
/**
|
246
263
|
* Transfer your community to an existing moderator.
|
264
|
+
* `HTTP.POST /community/transfer`
|
247
265
|
*/
|
248
266
|
LemmyHttp.prototype.transferCommunity = function (form) {
|
249
267
|
return __awaiter(this, void 0, void 0, function () {
|
@@ -254,6 +272,7 @@ var LemmyHttp = /** @class */ (function () {
|
|
254
272
|
};
|
255
273
|
/**
|
256
274
|
* Ban a user from a community.
|
275
|
+
* `HTTP.POST /community/ban_user`
|
257
276
|
*/
|
258
277
|
LemmyHttp.prototype.banFromCommunity = function (form) {
|
259
278
|
return __awaiter(this, void 0, void 0, function () {
|
@@ -264,6 +283,7 @@ var LemmyHttp = /** @class */ (function () {
|
|
264
283
|
};
|
265
284
|
/**
|
266
285
|
* Add a moderator to your community.
|
286
|
+
* `HTTP.POST /community/mod`
|
267
287
|
*/
|
268
288
|
LemmyHttp.prototype.addModToCommunity = function (form) {
|
269
289
|
return __awaiter(this, void 0, void 0, function () {
|
@@ -274,6 +294,7 @@ var LemmyHttp = /** @class */ (function () {
|
|
274
294
|
};
|
275
295
|
/**
|
276
296
|
* Create a post.
|
297
|
+
* `HTTP.POST /post`
|
277
298
|
*/
|
278
299
|
LemmyHttp.prototype.createPost = function (form) {
|
279
300
|
return __awaiter(this, void 0, void 0, function () {
|
@@ -284,6 +305,7 @@ var LemmyHttp = /** @class */ (function () {
|
|
284
305
|
};
|
285
306
|
/**
|
286
307
|
* Get / fetch a post.
|
308
|
+
* `HTTP.GET /post`
|
287
309
|
*/
|
288
310
|
LemmyHttp.prototype.getPost = function (form) {
|
289
311
|
return __awaiter(this, void 0, void 0, function () {
|
@@ -294,6 +316,7 @@ var LemmyHttp = /** @class */ (function () {
|
|
294
316
|
};
|
295
317
|
/**
|
296
318
|
* Edit a post.
|
319
|
+
* `HTTP.PUT /post`
|
297
320
|
*/
|
298
321
|
LemmyHttp.prototype.editPost = function (form) {
|
299
322
|
return __awaiter(this, void 0, void 0, function () {
|
@@ -304,6 +327,7 @@ var LemmyHttp = /** @class */ (function () {
|
|
304
327
|
};
|
305
328
|
/**
|
306
329
|
* Delete a post.
|
330
|
+
* `HTTP.POST /post/delete`
|
307
331
|
*/
|
308
332
|
LemmyHttp.prototype.deletePost = function (form) {
|
309
333
|
return __awaiter(this, void 0, void 0, function () {
|
@@ -314,6 +338,7 @@ var LemmyHttp = /** @class */ (function () {
|
|
314
338
|
};
|
315
339
|
/**
|
316
340
|
* A moderator remove for a post.
|
341
|
+
* `HTTP.POST /post/remove`
|
317
342
|
*/
|
318
343
|
LemmyHttp.prototype.removePost = function (form) {
|
319
344
|
return __awaiter(this, void 0, void 0, function () {
|
@@ -322,8 +347,20 @@ var LemmyHttp = /** @class */ (function () {
|
|
322
347
|
});
|
323
348
|
});
|
324
349
|
};
|
350
|
+
/**
|
351
|
+
* Mark a post as read.
|
352
|
+
* `HTTP.POST /post/mark_as_read`
|
353
|
+
*/
|
354
|
+
LemmyHttp.prototype.markPostAsRead = function (form) {
|
355
|
+
return __awaiter(this, void 0, void 0, function () {
|
356
|
+
return __generator(this, function (_a) {
|
357
|
+
return [2 /*return*/, this.wrapper(HttpType.Post, "/post/mark_as_read", form)];
|
358
|
+
});
|
359
|
+
});
|
360
|
+
};
|
325
361
|
/**
|
326
362
|
* A moderator can lock a post ( IE disable new comments ).
|
363
|
+
* `HTTP.POST /post/lock`
|
327
364
|
*/
|
328
365
|
LemmyHttp.prototype.lockPost = function (form) {
|
329
366
|
return __awaiter(this, void 0, void 0, function () {
|
@@ -334,6 +371,7 @@ var LemmyHttp = /** @class */ (function () {
|
|
334
371
|
};
|
335
372
|
/**
|
336
373
|
* A moderator can sticky a post ( IE stick it to the top of a community ).
|
374
|
+
* `HTTP.POST /post/sticky`
|
337
375
|
*/
|
338
376
|
LemmyHttp.prototype.stickyPost = function (form) {
|
339
377
|
return __awaiter(this, void 0, void 0, function () {
|
@@ -344,6 +382,7 @@ var LemmyHttp = /** @class */ (function () {
|
|
344
382
|
};
|
345
383
|
/**
|
346
384
|
* Get / fetch posts, with various filters.
|
385
|
+
* `HTTP.GET /post/list`
|
347
386
|
*/
|
348
387
|
LemmyHttp.prototype.getPosts = function (form) {
|
349
388
|
return __awaiter(this, void 0, void 0, function () {
|
@@ -354,6 +393,7 @@ var LemmyHttp = /** @class */ (function () {
|
|
354
393
|
};
|
355
394
|
/**
|
356
395
|
* Like / vote on a post.
|
396
|
+
* `HTTP.POST /post/like`
|
357
397
|
*/
|
358
398
|
LemmyHttp.prototype.likePost = function (form) {
|
359
399
|
return __awaiter(this, void 0, void 0, function () {
|
@@ -364,6 +404,7 @@ var LemmyHttp = /** @class */ (function () {
|
|
364
404
|
};
|
365
405
|
/**
|
366
406
|
* Save a post.
|
407
|
+
* `HTTP.PUT /post/save`
|
367
408
|
*/
|
368
409
|
LemmyHttp.prototype.savePost = function (form) {
|
369
410
|
return __awaiter(this, void 0, void 0, function () {
|
@@ -374,6 +415,7 @@ var LemmyHttp = /** @class */ (function () {
|
|
374
415
|
};
|
375
416
|
/**
|
376
417
|
* Report a post.
|
418
|
+
* `HTTP.POST /post/report`
|
377
419
|
*/
|
378
420
|
LemmyHttp.prototype.createPostReport = function (form) {
|
379
421
|
return __awaiter(this, void 0, void 0, function () {
|
@@ -384,6 +426,7 @@ var LemmyHttp = /** @class */ (function () {
|
|
384
426
|
};
|
385
427
|
/**
|
386
428
|
* Resolve a post report. Only a mod can do this.
|
429
|
+
* `HTTP.PUT /post/report/resolve`
|
387
430
|
*/
|
388
431
|
LemmyHttp.prototype.resolvePostReport = function (form) {
|
389
432
|
return __awaiter(this, void 0, void 0, function () {
|
@@ -394,6 +437,7 @@ var LemmyHttp = /** @class */ (function () {
|
|
394
437
|
};
|
395
438
|
/**
|
396
439
|
* List post reports.
|
440
|
+
* `HTTP.GET /post/report/list`
|
397
441
|
*/
|
398
442
|
LemmyHttp.prototype.listPostReports = function (form) {
|
399
443
|
return __awaiter(this, void 0, void 0, function () {
|
@@ -404,6 +448,7 @@ var LemmyHttp = /** @class */ (function () {
|
|
404
448
|
};
|
405
449
|
/**
|
406
450
|
* Fetch metadata for any given site.
|
451
|
+
* `HTTP.GET /post/site_metadata`
|
407
452
|
*/
|
408
453
|
LemmyHttp.prototype.getSiteMetadata = function (form) {
|
409
454
|
return __awaiter(this, void 0, void 0, function () {
|
@@ -414,6 +459,7 @@ var LemmyHttp = /** @class */ (function () {
|
|
414
459
|
};
|
415
460
|
/**
|
416
461
|
* Create a comment.
|
462
|
+
* `HTTP.POST /comment`
|
417
463
|
*/
|
418
464
|
LemmyHttp.prototype.createComment = function (form) {
|
419
465
|
return __awaiter(this, void 0, void 0, function () {
|
@@ -424,6 +470,7 @@ var LemmyHttp = /** @class */ (function () {
|
|
424
470
|
};
|
425
471
|
/**
|
426
472
|
* Edit a comment.
|
473
|
+
* `HTTP.PUT /comment`
|
427
474
|
*/
|
428
475
|
LemmyHttp.prototype.editComment = function (form) {
|
429
476
|
return __awaiter(this, void 0, void 0, function () {
|
@@ -434,6 +481,7 @@ var LemmyHttp = /** @class */ (function () {
|
|
434
481
|
};
|
435
482
|
/**
|
436
483
|
* Delete a comment.
|
484
|
+
* `HTTP.POST /comment/delete`
|
437
485
|
*/
|
438
486
|
LemmyHttp.prototype.deleteComment = function (form) {
|
439
487
|
return __awaiter(this, void 0, void 0, function () {
|
@@ -444,6 +492,7 @@ var LemmyHttp = /** @class */ (function () {
|
|
444
492
|
};
|
445
493
|
/**
|
446
494
|
* A moderator remove for a comment.
|
495
|
+
* `HTTP.POST /comment/remove`
|
447
496
|
*/
|
448
497
|
LemmyHttp.prototype.removeComment = function (form) {
|
449
498
|
return __awaiter(this, void 0, void 0, function () {
|
@@ -454,6 +503,7 @@ var LemmyHttp = /** @class */ (function () {
|
|
454
503
|
};
|
455
504
|
/**
|
456
505
|
* Mark a comment as read.
|
506
|
+
* `HTTP.POST /comment/mark_as_read`
|
457
507
|
*/
|
458
508
|
LemmyHttp.prototype.markCommentAsRead = function (form) {
|
459
509
|
return __awaiter(this, void 0, void 0, function () {
|
@@ -464,6 +514,7 @@ var LemmyHttp = /** @class */ (function () {
|
|
464
514
|
};
|
465
515
|
/**
|
466
516
|
* Like / vote on a comment.
|
517
|
+
* `HTTP.POST /comment/like`
|
467
518
|
*/
|
468
519
|
LemmyHttp.prototype.likeComment = function (form) {
|
469
520
|
return __awaiter(this, void 0, void 0, function () {
|
@@ -474,6 +525,7 @@ var LemmyHttp = /** @class */ (function () {
|
|
474
525
|
};
|
475
526
|
/**
|
476
527
|
* Save a comment.
|
528
|
+
* `HTTP.PUT /comment/save`
|
477
529
|
*/
|
478
530
|
LemmyHttp.prototype.saveComment = function (form) {
|
479
531
|
return __awaiter(this, void 0, void 0, function () {
|
@@ -484,6 +536,7 @@ var LemmyHttp = /** @class */ (function () {
|
|
484
536
|
};
|
485
537
|
/**
|
486
538
|
* Get / fetch comments.
|
539
|
+
* `HTTP.GET /comment/list`
|
487
540
|
*/
|
488
541
|
LemmyHttp.prototype.getComments = function (form) {
|
489
542
|
return __awaiter(this, void 0, void 0, function () {
|
@@ -494,6 +547,7 @@ var LemmyHttp = /** @class */ (function () {
|
|
494
547
|
};
|
495
548
|
/**
|
496
549
|
* Report a comment.
|
550
|
+
* `HTTP.POST /comment/report`
|
497
551
|
*/
|
498
552
|
LemmyHttp.prototype.createCommentReport = function (form) {
|
499
553
|
return __awaiter(this, void 0, void 0, function () {
|
@@ -504,6 +558,7 @@ var LemmyHttp = /** @class */ (function () {
|
|
504
558
|
};
|
505
559
|
/**
|
506
560
|
* Resolve a comment report. Only a mod can do this.
|
561
|
+
* `HTTP.PUT /comment/report/resolve`
|
507
562
|
*/
|
508
563
|
LemmyHttp.prototype.resolveCommentReport = function (form) {
|
509
564
|
return __awaiter(this, void 0, void 0, function () {
|
@@ -514,6 +569,7 @@ var LemmyHttp = /** @class */ (function () {
|
|
514
569
|
};
|
515
570
|
/**
|
516
571
|
* List comment reports.
|
572
|
+
* `HTTP.GET /comment/report/list`
|
517
573
|
*/
|
518
574
|
LemmyHttp.prototype.listCommentReports = function (form) {
|
519
575
|
return __awaiter(this, void 0, void 0, function () {
|
@@ -524,6 +580,7 @@ var LemmyHttp = /** @class */ (function () {
|
|
524
580
|
};
|
525
581
|
/**
|
526
582
|
* Get / fetch private messages.
|
583
|
+
* `HTTP.GET /private_message/list`
|
527
584
|
*/
|
528
585
|
LemmyHttp.prototype.getPrivateMessages = function (form) {
|
529
586
|
return __awaiter(this, void 0, void 0, function () {
|
@@ -534,6 +591,7 @@ var LemmyHttp = /** @class */ (function () {
|
|
534
591
|
};
|
535
592
|
/**
|
536
593
|
* Create a private message.
|
594
|
+
* `HTTP.POST /private_message`
|
537
595
|
*/
|
538
596
|
LemmyHttp.prototype.createPrivateMessage = function (form) {
|
539
597
|
return __awaiter(this, void 0, void 0, function () {
|
@@ -544,6 +602,7 @@ var LemmyHttp = /** @class */ (function () {
|
|
544
602
|
};
|
545
603
|
/**
|
546
604
|
* Edit a private message.
|
605
|
+
* `HTTP.PUT /private_message`
|
547
606
|
*/
|
548
607
|
LemmyHttp.prototype.editPrivateMessage = function (form) {
|
549
608
|
return __awaiter(this, void 0, void 0, function () {
|
@@ -554,6 +613,7 @@ var LemmyHttp = /** @class */ (function () {
|
|
554
613
|
};
|
555
614
|
/**
|
556
615
|
* Delete a private message.
|
616
|
+
* `HTTP.POST /private_message/delete`
|
557
617
|
*/
|
558
618
|
LemmyHttp.prototype.deletePrivateMessage = function (form) {
|
559
619
|
return __awaiter(this, void 0, void 0, function () {
|
@@ -564,6 +624,7 @@ var LemmyHttp = /** @class */ (function () {
|
|
564
624
|
};
|
565
625
|
/**
|
566
626
|
* Mark a private message as read.
|
627
|
+
* `HTTP.POST /private_message/mark_as_read`
|
567
628
|
*/
|
568
629
|
LemmyHttp.prototype.markPrivateMessageAsRead = function (form) {
|
569
630
|
return __awaiter(this, void 0, void 0, function () {
|
@@ -574,6 +635,7 @@ var LemmyHttp = /** @class */ (function () {
|
|
574
635
|
};
|
575
636
|
/**
|
576
637
|
* Register a new user.
|
638
|
+
* `HTTP.POST /user/register`
|
577
639
|
*/
|
578
640
|
LemmyHttp.prototype.register = function (form) {
|
579
641
|
return __awaiter(this, void 0, void 0, function () {
|
@@ -584,6 +646,7 @@ var LemmyHttp = /** @class */ (function () {
|
|
584
646
|
};
|
585
647
|
/**
|
586
648
|
* Log into lemmy.
|
649
|
+
* `HTTP.POST /user/login`
|
587
650
|
*/
|
588
651
|
LemmyHttp.prototype.login = function (form) {
|
589
652
|
return __awaiter(this, void 0, void 0, function () {
|
@@ -594,6 +657,7 @@ var LemmyHttp = /** @class */ (function () {
|
|
594
657
|
};
|
595
658
|
/**
|
596
659
|
* Get the details for a person.
|
660
|
+
* `HTTP.GET /user`
|
597
661
|
*/
|
598
662
|
LemmyHttp.prototype.getPersonDetails = function (form) {
|
599
663
|
return __awaiter(this, void 0, void 0, function () {
|
@@ -604,6 +668,7 @@ var LemmyHttp = /** @class */ (function () {
|
|
604
668
|
};
|
605
669
|
/**
|
606
670
|
* Get mentions for your user.
|
671
|
+
* `HTTP.GET /user/mention`
|
607
672
|
*/
|
608
673
|
LemmyHttp.prototype.getPersonMentions = function (form) {
|
609
674
|
return __awaiter(this, void 0, void 0, function () {
|
@@ -614,6 +679,7 @@ var LemmyHttp = /** @class */ (function () {
|
|
614
679
|
};
|
615
680
|
/**
|
616
681
|
* Mark a person mention as read.
|
682
|
+
* `HTTP.POST /user/mention/mark_as_read`
|
617
683
|
*/
|
618
684
|
LemmyHttp.prototype.markPersonMentionAsRead = function (form) {
|
619
685
|
return __awaiter(this, void 0, void 0, function () {
|
@@ -624,6 +690,7 @@ var LemmyHttp = /** @class */ (function () {
|
|
624
690
|
};
|
625
691
|
/**
|
626
692
|
* Get comment replies.
|
693
|
+
* `HTTP.GET /user/replies`
|
627
694
|
*/
|
628
695
|
LemmyHttp.prototype.getReplies = function (form) {
|
629
696
|
return __awaiter(this, void 0, void 0, function () {
|
@@ -634,6 +701,7 @@ var LemmyHttp = /** @class */ (function () {
|
|
634
701
|
};
|
635
702
|
/**
|
636
703
|
* Ban a person from your site.
|
704
|
+
* `HTTP.POST /user/ban`
|
637
705
|
*/
|
638
706
|
LemmyHttp.prototype.banPerson = function (form) {
|
639
707
|
return __awaiter(this, void 0, void 0, function () {
|
@@ -644,6 +712,7 @@ var LemmyHttp = /** @class */ (function () {
|
|
644
712
|
};
|
645
713
|
/**
|
646
714
|
* Get a list of banned users
|
715
|
+
* `HTTP.GET /user/banned`
|
647
716
|
*/
|
648
717
|
LemmyHttp.prototype.getBannedPersons = function (form) {
|
649
718
|
return __awaiter(this, void 0, void 0, function () {
|
@@ -654,6 +723,7 @@ var LemmyHttp = /** @class */ (function () {
|
|
654
723
|
};
|
655
724
|
/**
|
656
725
|
* Block a person.
|
726
|
+
* `HTTP.POST /user/block`
|
657
727
|
*/
|
658
728
|
LemmyHttp.prototype.blockPerson = function (form) {
|
659
729
|
return __awaiter(this, void 0, void 0, function () {
|
@@ -664,6 +734,7 @@ var LemmyHttp = /** @class */ (function () {
|
|
664
734
|
};
|
665
735
|
/**
|
666
736
|
* Fetch a Captcha.
|
737
|
+
* `HTTP.GET /user/get_captcha`
|
667
738
|
*/
|
668
739
|
LemmyHttp.prototype.getCaptcha = function () {
|
669
740
|
return __awaiter(this, void 0, void 0, function () {
|
@@ -674,6 +745,7 @@ var LemmyHttp = /** @class */ (function () {
|
|
674
745
|
};
|
675
746
|
/**
|
676
747
|
* Delete your account.
|
748
|
+
* `HTTP.POST /user/delete_account`
|
677
749
|
*/
|
678
750
|
LemmyHttp.prototype.deleteAccount = function (form) {
|
679
751
|
return __awaiter(this, void 0, void 0, function () {
|
@@ -684,6 +756,7 @@ var LemmyHttp = /** @class */ (function () {
|
|
684
756
|
};
|
685
757
|
/**
|
686
758
|
* Reset your password.
|
759
|
+
* `HTTP.POST /user/password_reset`
|
687
760
|
*/
|
688
761
|
LemmyHttp.prototype.passwordReset = function (form) {
|
689
762
|
return __awaiter(this, void 0, void 0, function () {
|
@@ -694,6 +767,7 @@ var LemmyHttp = /** @class */ (function () {
|
|
694
767
|
};
|
695
768
|
/**
|
696
769
|
* Change your password from an email / token based reset.
|
770
|
+
* `HTTP.POST /user/password_change`
|
697
771
|
*/
|
698
772
|
LemmyHttp.prototype.passwordChange = function (form) {
|
699
773
|
return __awaiter(this, void 0, void 0, function () {
|
@@ -704,6 +778,7 @@ var LemmyHttp = /** @class */ (function () {
|
|
704
778
|
};
|
705
779
|
/**
|
706
780
|
* Mark all replies as read.
|
781
|
+
* `HTTP.POST /user/mark_all_as_read`
|
707
782
|
*/
|
708
783
|
LemmyHttp.prototype.markAllAsRead = function (form) {
|
709
784
|
return __awaiter(this, void 0, void 0, function () {
|
@@ -714,6 +789,7 @@ var LemmyHttp = /** @class */ (function () {
|
|
714
789
|
};
|
715
790
|
/**
|
716
791
|
* Save your user settings.
|
792
|
+
* `HTTP.PUT /user/save_user_settings`
|
717
793
|
*/
|
718
794
|
LemmyHttp.prototype.saveUserSettings = function (form) {
|
719
795
|
return __awaiter(this, void 0, void 0, function () {
|
@@ -724,6 +800,7 @@ var LemmyHttp = /** @class */ (function () {
|
|
724
800
|
};
|
725
801
|
/**
|
726
802
|
* Change your user password.
|
803
|
+
* `HTTP.PUT /user/change_password`
|
727
804
|
*/
|
728
805
|
LemmyHttp.prototype.changePassword = function (form) {
|
729
806
|
return __awaiter(this, void 0, void 0, function () {
|
@@ -734,6 +811,7 @@ var LemmyHttp = /** @class */ (function () {
|
|
734
811
|
};
|
735
812
|
/**
|
736
813
|
* Get counts for your reports
|
814
|
+
* `HTTP.GET /user/report_count`
|
737
815
|
*/
|
738
816
|
LemmyHttp.prototype.getReportCount = function (form) {
|
739
817
|
return __awaiter(this, void 0, void 0, function () {
|
@@ -744,6 +822,7 @@ var LemmyHttp = /** @class */ (function () {
|
|
744
822
|
};
|
745
823
|
/**
|
746
824
|
* Get your unread counts
|
825
|
+
* `HTTP.GET /user/unread_count`
|
747
826
|
*/
|
748
827
|
LemmyHttp.prototype.getUnreadCount = function (form) {
|
749
828
|
return __awaiter(this, void 0, void 0, function () {
|
@@ -754,6 +833,7 @@ var LemmyHttp = /** @class */ (function () {
|
|
754
833
|
};
|
755
834
|
/**
|
756
835
|
* Verify your email
|
836
|
+
* `HTTP.POST /user/verify_email`
|
757
837
|
*/
|
758
838
|
LemmyHttp.prototype.verifyEmail = function (form) {
|
759
839
|
return __awaiter(this, void 0, void 0, function () {
|
@@ -764,6 +844,7 @@ var LemmyHttp = /** @class */ (function () {
|
|
764
844
|
};
|
765
845
|
/**
|
766
846
|
* Add an admin to your site.
|
847
|
+
* `HTTP.POST /admin/add`
|
767
848
|
*/
|
768
849
|
LemmyHttp.prototype.addAdmin = function (form) {
|
769
850
|
return __awaiter(this, void 0, void 0, function () {
|
@@ -774,6 +855,7 @@ var LemmyHttp = /** @class */ (function () {
|
|
774
855
|
};
|
775
856
|
/**
|
776
857
|
* Get the unread registration applications count.
|
858
|
+
* `HTTP.GET /admin/registration_application/count`
|
777
859
|
*/
|
778
860
|
LemmyHttp.prototype.getUnreadRegistrationApplicationCount = function (form) {
|
779
861
|
return __awaiter(this, void 0, void 0, function () {
|
@@ -783,7 +865,8 @@ var LemmyHttp = /** @class */ (function () {
|
|
783
865
|
});
|
784
866
|
};
|
785
867
|
/**
|
786
|
-
* List the
|
868
|
+
* List the registration applications.
|
869
|
+
* `HTTP.GET /admin/registration_application/list`
|
787
870
|
*/
|
788
871
|
LemmyHttp.prototype.listRegistrationApplications = function (form) {
|
789
872
|
return __awaiter(this, void 0, void 0, function () {
|
@@ -794,6 +877,7 @@ var LemmyHttp = /** @class */ (function () {
|
|
794
877
|
};
|
795
878
|
/**
|
796
879
|
* Approve a registration application
|
880
|
+
* `HTTP.PUT /admin/registration_application/approve`
|
797
881
|
*/
|
798
882
|
LemmyHttp.prototype.approveRegistrationApplication = function (form) {
|
799
883
|
return __awaiter(this, void 0, void 0, function () {
|
@@ -802,6 +886,50 @@ var LemmyHttp = /** @class */ (function () {
|
|
802
886
|
});
|
803
887
|
});
|
804
888
|
};
|
889
|
+
/**
|
890
|
+
* Purge / Delete a person from the database.
|
891
|
+
* `HTTP.POST /admin/purge/person`
|
892
|
+
*/
|
893
|
+
LemmyHttp.prototype.purgePerson = function (form) {
|
894
|
+
return __awaiter(this, void 0, void 0, function () {
|
895
|
+
return __generator(this, function (_a) {
|
896
|
+
return [2 /*return*/, this.wrapper(HttpType.Post, "/admin/purge/person", form)];
|
897
|
+
});
|
898
|
+
});
|
899
|
+
};
|
900
|
+
/**
|
901
|
+
* Purge / Delete a community from the database.
|
902
|
+
* `HTTP.POST /admin/purge/community`
|
903
|
+
*/
|
904
|
+
LemmyHttp.prototype.purgeCommunity = function (form) {
|
905
|
+
return __awaiter(this, void 0, void 0, function () {
|
906
|
+
return __generator(this, function (_a) {
|
907
|
+
return [2 /*return*/, this.wrapper(HttpType.Post, "/admin/purge/community", form)];
|
908
|
+
});
|
909
|
+
});
|
910
|
+
};
|
911
|
+
/**
|
912
|
+
* Purge / Delete a post from the database.
|
913
|
+
* `HTTP.POST /admin/purge/post`
|
914
|
+
*/
|
915
|
+
LemmyHttp.prototype.purgePost = function (form) {
|
916
|
+
return __awaiter(this, void 0, void 0, function () {
|
917
|
+
return __generator(this, function (_a) {
|
918
|
+
return [2 /*return*/, this.wrapper(HttpType.Post, "/admin/purge/post", form)];
|
919
|
+
});
|
920
|
+
});
|
921
|
+
};
|
922
|
+
/**
|
923
|
+
* Purge / Delete a comment from the database.
|
924
|
+
* `HTTP.POST /admin/purge/comment`
|
925
|
+
*/
|
926
|
+
LemmyHttp.prototype.purgeComment = function (form) {
|
927
|
+
return __awaiter(this, void 0, void 0, function () {
|
928
|
+
return __generator(this, function (_a) {
|
929
|
+
return [2 /*return*/, this.wrapper(HttpType.Post, "/admin/purge/comment", form)];
|
930
|
+
});
|
931
|
+
});
|
932
|
+
};
|
805
933
|
LemmyHttp.prototype.buildFullUrl = function (endpoint) {
|
806
934
|
return "".concat(this.apiUrl).concat(endpoint);
|
807
935
|
};
|
package/dist/index.js
CHANGED
@@ -1,7 +1,11 @@
|
|
1
1
|
"use strict";
|
2
2
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
3
3
|
if (k2 === undefined) k2 = k;
|
4
|
-
Object.
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
7
|
+
}
|
8
|
+
Object.defineProperty(o, k2, desc);
|
5
9
|
}) : (function(o, m, k, k2) {
|
6
10
|
if (k2 === undefined) k2 = k;
|
7
11
|
o[k2] = m[k];
|
@@ -1,3 +1,4 @@
|
|
1
|
+
import { ListingType, SortType } from "../others";
|
1
2
|
import { CommentReportView, CommentView } from "../views";
|
2
3
|
export interface CreateComment {
|
3
4
|
content: string;
|
@@ -68,14 +69,8 @@ export interface CreateCommentLike {
|
|
68
69
|
* To get posts for a federated community by name, use `name@instance.tld` .
|
69
70
|
*/
|
70
71
|
export interface GetComments {
|
71
|
-
|
72
|
-
|
73
|
-
*/
|
74
|
-
type_?: string;
|
75
|
-
/**
|
76
|
-
* The [[SortType]].
|
77
|
-
*/
|
78
|
-
sort?: string;
|
72
|
+
type_?: ListingType;
|
73
|
+
sort?: SortType;
|
79
74
|
page?: number;
|
80
75
|
limit?: number;
|
81
76
|
community_id?: number;
|
@@ -1,5 +1,6 @@
|
|
1
|
+
import { ListingType, SortType } from "../others";
|
1
2
|
import { Site } from "../source";
|
2
|
-
import {
|
3
|
+
import { CommunityModeratorView, CommunityView, PersonViewSafe } from "../views";
|
3
4
|
/**
|
4
5
|
* You can use either `id` or `name` as an id.
|
5
6
|
*
|
@@ -29,18 +30,9 @@ export interface CreateCommunity {
|
|
29
30
|
export interface CommunityResponse {
|
30
31
|
community_view: CommunityView;
|
31
32
|
}
|
32
|
-
export interface FollowCommunityResponse {
|
33
|
-
community_follower_view: CommunityFollowerView;
|
34
|
-
}
|
35
33
|
export interface ListCommunities {
|
36
|
-
|
37
|
-
|
38
|
-
*/
|
39
|
-
type_?: string;
|
40
|
-
/**
|
41
|
-
* The [[SortType]].
|
42
|
-
*/
|
43
|
-
sort?: string;
|
34
|
+
type_?: ListingType;
|
35
|
+
sort?: SortType;
|
44
36
|
page?: number;
|
45
37
|
limit?: number;
|
46
38
|
auth?: string;
|
@@ -1,7 +1,11 @@
|
|
1
1
|
"use strict";
|
2
2
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
3
3
|
if (k2 === undefined) k2 = k;
|
4
|
-
Object.
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
7
|
+
}
|
8
|
+
Object.defineProperty(o, k2, desc);
|
5
9
|
}) : (function(o, m, k, k2) {
|
6
10
|
if (k2 === undefined) k2 = k;
|
7
11
|
o[k2] = m[k];
|