lemmy-js-client 0.17.0-rc.6 → 0.17.0-rc.60
Sign up to get free protection for your applications and to get access to all the features.
- package/README.md +4 -4
- package/dist/http.d.ts +198 -16
- package/dist/http.js +245 -26
- package/dist/index.js +5 -1
- package/dist/interfaces/aggregates.d.ts +3 -0
- package/dist/interfaces/api/comment.d.ts +13 -17
- package/dist/interfaces/api/community.d.ts +8 -8
- package/dist/interfaces/api/index.js +5 -1
- package/dist/interfaces/api/person.d.ts +39 -12
- package/dist/interfaces/api/post.d.ts +21 -18
- package/dist/interfaces/api/site.d.ts +97 -31
- package/dist/interfaces/index.js +5 -1
- package/dist/interfaces/others.d.ts +122 -85
- package/dist/interfaces/others.js +133 -59
- package/dist/interfaces/source.d.ts +124 -19
- package/dist/interfaces/source.js +7 -0
- package/dist/interfaces/views.d.ts +66 -18
- package/dist/utils.d.ts +0 -0
- package/dist/utils.js +0 -0
- package/dist/websocket.d.ts +44 -14
- package/dist/websocket.js +67 -19
- package/package.json +26 -28
package/dist/http.js
CHANGED
@@ -25,7 +25,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
25
25
|
function verb(n) { return function (v) { return step([n, v]); }; }
|
26
26
|
function step(op) {
|
27
27
|
if (f) throw new TypeError("Generator is already executing.");
|
28
|
-
while (_) try {
|
28
|
+
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
29
29
|
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
30
30
|
if (y = 0, t) op = [op[0] & 2, t.value];
|
31
31
|
switch (op[0]) {
|
@@ -74,6 +74,8 @@ var LemmyHttp = /** @class */ (function () {
|
|
74
74
|
}
|
75
75
|
/**
|
76
76
|
* Gets the site, and your user data.
|
77
|
+
*
|
78
|
+
* `HTTP.GET /site`
|
77
79
|
*/
|
78
80
|
LemmyHttp.prototype.getSite = function (form) {
|
79
81
|
return __awaiter(this, void 0, void 0, function () {
|
@@ -84,6 +86,8 @@ var LemmyHttp = /** @class */ (function () {
|
|
84
86
|
};
|
85
87
|
/**
|
86
88
|
* Create your site.
|
89
|
+
*
|
90
|
+
* `HTTP.POST /site`
|
87
91
|
*/
|
88
92
|
LemmyHttp.prototype.createSite = function (form) {
|
89
93
|
return __awaiter(this, void 0, void 0, function () {
|
@@ -94,6 +98,8 @@ var LemmyHttp = /** @class */ (function () {
|
|
94
98
|
};
|
95
99
|
/**
|
96
100
|
* Edit your site.
|
101
|
+
*
|
102
|
+
* `HTTP.PUT /site`
|
97
103
|
*/
|
98
104
|
LemmyHttp.prototype.editSite = function (form) {
|
99
105
|
return __awaiter(this, void 0, void 0, function () {
|
@@ -104,6 +110,8 @@ var LemmyHttp = /** @class */ (function () {
|
|
104
110
|
};
|
105
111
|
/**
|
106
112
|
* Leave the Site admins.
|
113
|
+
*
|
114
|
+
* `HTTP.POST /user/leave_admin`
|
107
115
|
*/
|
108
116
|
LemmyHttp.prototype.leaveAdmin = function (form) {
|
109
117
|
return __awaiter(this, void 0, void 0, function () {
|
@@ -112,28 +120,10 @@ var LemmyHttp = /** @class */ (function () {
|
|
112
120
|
});
|
113
121
|
});
|
114
122
|
};
|
115
|
-
/**
|
116
|
-
* Get your site configuration.
|
117
|
-
*/
|
118
|
-
LemmyHttp.prototype.getSiteConfig = function (form) {
|
119
|
-
return __awaiter(this, void 0, void 0, function () {
|
120
|
-
return __generator(this, function (_a) {
|
121
|
-
return [2 /*return*/, this.wrapper(HttpType.Get, "/site/config", form)];
|
122
|
-
});
|
123
|
-
});
|
124
|
-
};
|
125
|
-
/**
|
126
|
-
* Save your site config.
|
127
|
-
*/
|
128
|
-
LemmyHttp.prototype.saveSiteConfig = function (form) {
|
129
|
-
return __awaiter(this, void 0, void 0, function () {
|
130
|
-
return __generator(this, function (_a) {
|
131
|
-
return [2 /*return*/, this.wrapper(HttpType.Put, "/site/config", form)];
|
132
|
-
});
|
133
|
-
});
|
134
|
-
};
|
135
123
|
/**
|
136
124
|
* Get the modlog.
|
125
|
+
*
|
126
|
+
* `HTTP.GET /modlog`
|
137
127
|
*/
|
138
128
|
LemmyHttp.prototype.getModlog = function (form) {
|
139
129
|
return __awaiter(this, void 0, void 0, function () {
|
@@ -144,6 +134,8 @@ var LemmyHttp = /** @class */ (function () {
|
|
144
134
|
};
|
145
135
|
/**
|
146
136
|
* Search lemmy.
|
137
|
+
*
|
138
|
+
* `HTTP.GET /search`
|
147
139
|
*/
|
148
140
|
LemmyHttp.prototype.search = function (form) {
|
149
141
|
return __awaiter(this, void 0, void 0, function () {
|
@@ -154,6 +146,8 @@ var LemmyHttp = /** @class */ (function () {
|
|
154
146
|
};
|
155
147
|
/**
|
156
148
|
* Fetch a non-local / federated object.
|
149
|
+
*
|
150
|
+
* `HTTP.GET /resolve_object`
|
157
151
|
*/
|
158
152
|
LemmyHttp.prototype.resolveObject = function (form) {
|
159
153
|
return __awaiter(this, void 0, void 0, function () {
|
@@ -164,6 +158,8 @@ var LemmyHttp = /** @class */ (function () {
|
|
164
158
|
};
|
165
159
|
/**
|
166
160
|
* Create a new community.
|
161
|
+
*
|
162
|
+
* `HTTP.POST /community`
|
167
163
|
*/
|
168
164
|
LemmyHttp.prototype.createCommunity = function (form) {
|
169
165
|
return __awaiter(this, void 0, void 0, function () {
|
@@ -174,6 +170,8 @@ var LemmyHttp = /** @class */ (function () {
|
|
174
170
|
};
|
175
171
|
/**
|
176
172
|
* Get / fetch a community.
|
173
|
+
*
|
174
|
+
* `HTTP.GET /community`
|
177
175
|
*/
|
178
176
|
LemmyHttp.prototype.getCommunity = function (form) {
|
179
177
|
return __awaiter(this, void 0, void 0, function () {
|
@@ -184,6 +182,8 @@ var LemmyHttp = /** @class */ (function () {
|
|
184
182
|
};
|
185
183
|
/**
|
186
184
|
* Edit a community.
|
185
|
+
*
|
186
|
+
* `HTTP.PUT /community`
|
187
187
|
*/
|
188
188
|
LemmyHttp.prototype.editCommunity = function (form) {
|
189
189
|
return __awaiter(this, void 0, void 0, function () {
|
@@ -194,6 +194,8 @@ var LemmyHttp = /** @class */ (function () {
|
|
194
194
|
};
|
195
195
|
/**
|
196
196
|
* List communities, with various filters.
|
197
|
+
*
|
198
|
+
* `HTTP.GET /community/list`
|
197
199
|
*/
|
198
200
|
LemmyHttp.prototype.listCommunities = function (form) {
|
199
201
|
return __awaiter(this, void 0, void 0, function () {
|
@@ -204,6 +206,8 @@ var LemmyHttp = /** @class */ (function () {
|
|
204
206
|
};
|
205
207
|
/**
|
206
208
|
* Follow / subscribe to a community.
|
209
|
+
*
|
210
|
+
* `HTTP.POST /community/follow`
|
207
211
|
*/
|
208
212
|
LemmyHttp.prototype.followCommunity = function (form) {
|
209
213
|
return __awaiter(this, void 0, void 0, function () {
|
@@ -214,6 +218,8 @@ var LemmyHttp = /** @class */ (function () {
|
|
214
218
|
};
|
215
219
|
/**
|
216
220
|
* Block a community.
|
221
|
+
*
|
222
|
+
* `HTTP.POST /community/block`
|
217
223
|
*/
|
218
224
|
LemmyHttp.prototype.blockCommunity = function (form) {
|
219
225
|
return __awaiter(this, void 0, void 0, function () {
|
@@ -224,6 +230,8 @@ var LemmyHttp = /** @class */ (function () {
|
|
224
230
|
};
|
225
231
|
/**
|
226
232
|
* Delete a community.
|
233
|
+
*
|
234
|
+
* `HTTP.POST /community/delete`
|
227
235
|
*/
|
228
236
|
LemmyHttp.prototype.deleteCommunity = function (form) {
|
229
237
|
return __awaiter(this, void 0, void 0, function () {
|
@@ -234,6 +242,8 @@ var LemmyHttp = /** @class */ (function () {
|
|
234
242
|
};
|
235
243
|
/**
|
236
244
|
* A moderator remove for a community.
|
245
|
+
*
|
246
|
+
* `HTTP.POST /community/remove`
|
237
247
|
*/
|
238
248
|
LemmyHttp.prototype.removeCommunity = function (form) {
|
239
249
|
return __awaiter(this, void 0, void 0, function () {
|
@@ -244,6 +254,8 @@ var LemmyHttp = /** @class */ (function () {
|
|
244
254
|
};
|
245
255
|
/**
|
246
256
|
* Transfer your community to an existing moderator.
|
257
|
+
*
|
258
|
+
* `HTTP.POST /community/transfer`
|
247
259
|
*/
|
248
260
|
LemmyHttp.prototype.transferCommunity = function (form) {
|
249
261
|
return __awaiter(this, void 0, void 0, function () {
|
@@ -254,6 +266,8 @@ var LemmyHttp = /** @class */ (function () {
|
|
254
266
|
};
|
255
267
|
/**
|
256
268
|
* Ban a user from a community.
|
269
|
+
*
|
270
|
+
* `HTTP.POST /community/ban_user`
|
257
271
|
*/
|
258
272
|
LemmyHttp.prototype.banFromCommunity = function (form) {
|
259
273
|
return __awaiter(this, void 0, void 0, function () {
|
@@ -264,6 +278,8 @@ var LemmyHttp = /** @class */ (function () {
|
|
264
278
|
};
|
265
279
|
/**
|
266
280
|
* Add a moderator to your community.
|
281
|
+
*
|
282
|
+
* `HTTP.POST /community/mod`
|
267
283
|
*/
|
268
284
|
LemmyHttp.prototype.addModToCommunity = function (form) {
|
269
285
|
return __awaiter(this, void 0, void 0, function () {
|
@@ -274,6 +290,8 @@ var LemmyHttp = /** @class */ (function () {
|
|
274
290
|
};
|
275
291
|
/**
|
276
292
|
* Create a post.
|
293
|
+
*
|
294
|
+
* `HTTP.POST /post`
|
277
295
|
*/
|
278
296
|
LemmyHttp.prototype.createPost = function (form) {
|
279
297
|
return __awaiter(this, void 0, void 0, function () {
|
@@ -284,6 +302,8 @@ var LemmyHttp = /** @class */ (function () {
|
|
284
302
|
};
|
285
303
|
/**
|
286
304
|
* Get / fetch a post.
|
305
|
+
*
|
306
|
+
* `HTTP.GET /post`
|
287
307
|
*/
|
288
308
|
LemmyHttp.prototype.getPost = function (form) {
|
289
309
|
return __awaiter(this, void 0, void 0, function () {
|
@@ -294,6 +314,8 @@ var LemmyHttp = /** @class */ (function () {
|
|
294
314
|
};
|
295
315
|
/**
|
296
316
|
* Edit a post.
|
317
|
+
*
|
318
|
+
* `HTTP.PUT /post`
|
297
319
|
*/
|
298
320
|
LemmyHttp.prototype.editPost = function (form) {
|
299
321
|
return __awaiter(this, void 0, void 0, function () {
|
@@ -304,6 +326,8 @@ var LemmyHttp = /** @class */ (function () {
|
|
304
326
|
};
|
305
327
|
/**
|
306
328
|
* Delete a post.
|
329
|
+
*
|
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,8 @@ var LemmyHttp = /** @class */ (function () {
|
|
314
338
|
};
|
315
339
|
/**
|
316
340
|
* A moderator remove for a post.
|
341
|
+
*
|
342
|
+
* `HTTP.POST /post/remove`
|
317
343
|
*/
|
318
344
|
LemmyHttp.prototype.removePost = function (form) {
|
319
345
|
return __awaiter(this, void 0, void 0, function () {
|
@@ -322,8 +348,22 @@ var LemmyHttp = /** @class */ (function () {
|
|
322
348
|
});
|
323
349
|
});
|
324
350
|
};
|
351
|
+
/**
|
352
|
+
* Mark a post as read.
|
353
|
+
*
|
354
|
+
* `HTTP.POST /post/mark_as_read`
|
355
|
+
*/
|
356
|
+
LemmyHttp.prototype.markPostAsRead = function (form) {
|
357
|
+
return __awaiter(this, void 0, void 0, function () {
|
358
|
+
return __generator(this, function (_a) {
|
359
|
+
return [2 /*return*/, this.wrapper(HttpType.Post, "/post/mark_as_read", form)];
|
360
|
+
});
|
361
|
+
});
|
362
|
+
};
|
325
363
|
/**
|
326
364
|
* A moderator can lock a post ( IE disable new comments ).
|
365
|
+
*
|
366
|
+
* `HTTP.POST /post/lock`
|
327
367
|
*/
|
328
368
|
LemmyHttp.prototype.lockPost = function (form) {
|
329
369
|
return __awaiter(this, void 0, void 0, function () {
|
@@ -333,17 +373,21 @@ var LemmyHttp = /** @class */ (function () {
|
|
333
373
|
});
|
334
374
|
};
|
335
375
|
/**
|
336
|
-
* A moderator can
|
376
|
+
* A moderator can feature a community post ( IE stick it to the top of a community ).
|
377
|
+
*
|
378
|
+
* `HTTP.POST /post/feature`
|
337
379
|
*/
|
338
|
-
LemmyHttp.prototype.
|
380
|
+
LemmyHttp.prototype.featurePost = function (form) {
|
339
381
|
return __awaiter(this, void 0, void 0, function () {
|
340
382
|
return __generator(this, function (_a) {
|
341
|
-
return [2 /*return*/, this.wrapper(HttpType.Post, "/post/
|
383
|
+
return [2 /*return*/, this.wrapper(HttpType.Post, "/post/feature", form)];
|
342
384
|
});
|
343
385
|
});
|
344
386
|
};
|
345
387
|
/**
|
346
388
|
* Get / fetch posts, with various filters.
|
389
|
+
*
|
390
|
+
* `HTTP.GET /post/list`
|
347
391
|
*/
|
348
392
|
LemmyHttp.prototype.getPosts = function (form) {
|
349
393
|
return __awaiter(this, void 0, void 0, function () {
|
@@ -354,6 +398,8 @@ var LemmyHttp = /** @class */ (function () {
|
|
354
398
|
};
|
355
399
|
/**
|
356
400
|
* Like / vote on a post.
|
401
|
+
*
|
402
|
+
* `HTTP.POST /post/like`
|
357
403
|
*/
|
358
404
|
LemmyHttp.prototype.likePost = function (form) {
|
359
405
|
return __awaiter(this, void 0, void 0, function () {
|
@@ -364,6 +410,8 @@ var LemmyHttp = /** @class */ (function () {
|
|
364
410
|
};
|
365
411
|
/**
|
366
412
|
* Save a post.
|
413
|
+
*
|
414
|
+
* `HTTP.PUT /post/save`
|
367
415
|
*/
|
368
416
|
LemmyHttp.prototype.savePost = function (form) {
|
369
417
|
return __awaiter(this, void 0, void 0, function () {
|
@@ -374,6 +422,8 @@ var LemmyHttp = /** @class */ (function () {
|
|
374
422
|
};
|
375
423
|
/**
|
376
424
|
* Report a post.
|
425
|
+
*
|
426
|
+
* `HTTP.POST /post/report`
|
377
427
|
*/
|
378
428
|
LemmyHttp.prototype.createPostReport = function (form) {
|
379
429
|
return __awaiter(this, void 0, void 0, function () {
|
@@ -384,6 +434,8 @@ var LemmyHttp = /** @class */ (function () {
|
|
384
434
|
};
|
385
435
|
/**
|
386
436
|
* Resolve a post report. Only a mod can do this.
|
437
|
+
*
|
438
|
+
* `HTTP.PUT /post/report/resolve`
|
387
439
|
*/
|
388
440
|
LemmyHttp.prototype.resolvePostReport = function (form) {
|
389
441
|
return __awaiter(this, void 0, void 0, function () {
|
@@ -394,6 +446,8 @@ var LemmyHttp = /** @class */ (function () {
|
|
394
446
|
};
|
395
447
|
/**
|
396
448
|
* List post reports.
|
449
|
+
*
|
450
|
+
* `HTTP.GET /post/report/list`
|
397
451
|
*/
|
398
452
|
LemmyHttp.prototype.listPostReports = function (form) {
|
399
453
|
return __awaiter(this, void 0, void 0, function () {
|
@@ -404,6 +458,8 @@ var LemmyHttp = /** @class */ (function () {
|
|
404
458
|
};
|
405
459
|
/**
|
406
460
|
* Fetch metadata for any given site.
|
461
|
+
*
|
462
|
+
* `HTTP.GET /post/site_metadata`
|
407
463
|
*/
|
408
464
|
LemmyHttp.prototype.getSiteMetadata = function (form) {
|
409
465
|
return __awaiter(this, void 0, void 0, function () {
|
@@ -414,6 +470,8 @@ var LemmyHttp = /** @class */ (function () {
|
|
414
470
|
};
|
415
471
|
/**
|
416
472
|
* Create a comment.
|
473
|
+
*
|
474
|
+
* `HTTP.POST /comment`
|
417
475
|
*/
|
418
476
|
LemmyHttp.prototype.createComment = function (form) {
|
419
477
|
return __awaiter(this, void 0, void 0, function () {
|
@@ -424,6 +482,8 @@ var LemmyHttp = /** @class */ (function () {
|
|
424
482
|
};
|
425
483
|
/**
|
426
484
|
* Edit a comment.
|
485
|
+
*
|
486
|
+
* `HTTP.PUT /comment`
|
427
487
|
*/
|
428
488
|
LemmyHttp.prototype.editComment = function (form) {
|
429
489
|
return __awaiter(this, void 0, void 0, function () {
|
@@ -434,6 +494,8 @@ var LemmyHttp = /** @class */ (function () {
|
|
434
494
|
};
|
435
495
|
/**
|
436
496
|
* Delete a comment.
|
497
|
+
*
|
498
|
+
* `HTTP.POST /comment/delete`
|
437
499
|
*/
|
438
500
|
LemmyHttp.prototype.deleteComment = function (form) {
|
439
501
|
return __awaiter(this, void 0, void 0, function () {
|
@@ -444,6 +506,8 @@ var LemmyHttp = /** @class */ (function () {
|
|
444
506
|
};
|
445
507
|
/**
|
446
508
|
* A moderator remove for a comment.
|
509
|
+
*
|
510
|
+
* `HTTP.POST /comment/remove`
|
447
511
|
*/
|
448
512
|
LemmyHttp.prototype.removeComment = function (form) {
|
449
513
|
return __awaiter(this, void 0, void 0, function () {
|
@@ -454,8 +518,10 @@ var LemmyHttp = /** @class */ (function () {
|
|
454
518
|
};
|
455
519
|
/**
|
456
520
|
* Mark a comment as read.
|
521
|
+
*
|
522
|
+
* `HTTP.POST /comment/mark_as_read`
|
457
523
|
*/
|
458
|
-
LemmyHttp.prototype.
|
524
|
+
LemmyHttp.prototype.markCommentReplyAsRead = function (form) {
|
459
525
|
return __awaiter(this, void 0, void 0, function () {
|
460
526
|
return __generator(this, function (_a) {
|
461
527
|
return [2 /*return*/, this.wrapper(HttpType.Post, "/comment/mark_as_read", form)];
|
@@ -464,6 +530,8 @@ var LemmyHttp = /** @class */ (function () {
|
|
464
530
|
};
|
465
531
|
/**
|
466
532
|
* Like / vote on a comment.
|
533
|
+
*
|
534
|
+
* `HTTP.POST /comment/like`
|
467
535
|
*/
|
468
536
|
LemmyHttp.prototype.likeComment = function (form) {
|
469
537
|
return __awaiter(this, void 0, void 0, function () {
|
@@ -474,6 +542,8 @@ var LemmyHttp = /** @class */ (function () {
|
|
474
542
|
};
|
475
543
|
/**
|
476
544
|
* Save a comment.
|
545
|
+
*
|
546
|
+
* `HTTP.PUT /comment/save`
|
477
547
|
*/
|
478
548
|
LemmyHttp.prototype.saveComment = function (form) {
|
479
549
|
return __awaiter(this, void 0, void 0, function () {
|
@@ -484,6 +554,8 @@ var LemmyHttp = /** @class */ (function () {
|
|
484
554
|
};
|
485
555
|
/**
|
486
556
|
* Get / fetch comments.
|
557
|
+
*
|
558
|
+
* `HTTP.GET /comment/list`
|
487
559
|
*/
|
488
560
|
LemmyHttp.prototype.getComments = function (form) {
|
489
561
|
return __awaiter(this, void 0, void 0, function () {
|
@@ -494,6 +566,8 @@ var LemmyHttp = /** @class */ (function () {
|
|
494
566
|
};
|
495
567
|
/**
|
496
568
|
* Report a comment.
|
569
|
+
*
|
570
|
+
* `HTTP.POST /comment/report`
|
497
571
|
*/
|
498
572
|
LemmyHttp.prototype.createCommentReport = function (form) {
|
499
573
|
return __awaiter(this, void 0, void 0, function () {
|
@@ -504,6 +578,8 @@ var LemmyHttp = /** @class */ (function () {
|
|
504
578
|
};
|
505
579
|
/**
|
506
580
|
* Resolve a comment report. Only a mod can do this.
|
581
|
+
*
|
582
|
+
* `HTTP.PUT /comment/report/resolve`
|
507
583
|
*/
|
508
584
|
LemmyHttp.prototype.resolveCommentReport = function (form) {
|
509
585
|
return __awaiter(this, void 0, void 0, function () {
|
@@ -514,6 +590,8 @@ var LemmyHttp = /** @class */ (function () {
|
|
514
590
|
};
|
515
591
|
/**
|
516
592
|
* List comment reports.
|
593
|
+
*
|
594
|
+
* `HTTP.GET /comment/report/list`
|
517
595
|
*/
|
518
596
|
LemmyHttp.prototype.listCommentReports = function (form) {
|
519
597
|
return __awaiter(this, void 0, void 0, function () {
|
@@ -524,6 +602,8 @@ var LemmyHttp = /** @class */ (function () {
|
|
524
602
|
};
|
525
603
|
/**
|
526
604
|
* Get / fetch private messages.
|
605
|
+
*
|
606
|
+
* `HTTP.GET /private_message/list`
|
527
607
|
*/
|
528
608
|
LemmyHttp.prototype.getPrivateMessages = function (form) {
|
529
609
|
return __awaiter(this, void 0, void 0, function () {
|
@@ -534,6 +614,8 @@ var LemmyHttp = /** @class */ (function () {
|
|
534
614
|
};
|
535
615
|
/**
|
536
616
|
* Create a private message.
|
617
|
+
*
|
618
|
+
* `HTTP.POST /private_message`
|
537
619
|
*/
|
538
620
|
LemmyHttp.prototype.createPrivateMessage = function (form) {
|
539
621
|
return __awaiter(this, void 0, void 0, function () {
|
@@ -544,6 +626,8 @@ var LemmyHttp = /** @class */ (function () {
|
|
544
626
|
};
|
545
627
|
/**
|
546
628
|
* Edit a private message.
|
629
|
+
*
|
630
|
+
* `HTTP.PUT /private_message`
|
547
631
|
*/
|
548
632
|
LemmyHttp.prototype.editPrivateMessage = function (form) {
|
549
633
|
return __awaiter(this, void 0, void 0, function () {
|
@@ -554,6 +638,8 @@ var LemmyHttp = /** @class */ (function () {
|
|
554
638
|
};
|
555
639
|
/**
|
556
640
|
* Delete a private message.
|
641
|
+
*
|
642
|
+
* `HTTP.POST /private_message/delete`
|
557
643
|
*/
|
558
644
|
LemmyHttp.prototype.deletePrivateMessage = function (form) {
|
559
645
|
return __awaiter(this, void 0, void 0, function () {
|
@@ -564,6 +650,8 @@ var LemmyHttp = /** @class */ (function () {
|
|
564
650
|
};
|
565
651
|
/**
|
566
652
|
* Mark a private message as read.
|
653
|
+
*
|
654
|
+
* `HTTP.POST /private_message/mark_as_read`
|
567
655
|
*/
|
568
656
|
LemmyHttp.prototype.markPrivateMessageAsRead = function (form) {
|
569
657
|
return __awaiter(this, void 0, void 0, function () {
|
@@ -572,8 +660,46 @@ var LemmyHttp = /** @class */ (function () {
|
|
572
660
|
});
|
573
661
|
});
|
574
662
|
};
|
663
|
+
/**
|
664
|
+
* Create a report for a private message.
|
665
|
+
*
|
666
|
+
* `HTTP.POST /private_message/report`
|
667
|
+
*/
|
668
|
+
LemmyHttp.prototype.createPrivateMessageReport = function (form) {
|
669
|
+
return __awaiter(this, void 0, void 0, function () {
|
670
|
+
return __generator(this, function (_a) {
|
671
|
+
return [2 /*return*/, this.wrapper(HttpType.Post, "/private_message/report", form)];
|
672
|
+
});
|
673
|
+
});
|
674
|
+
};
|
675
|
+
/**
|
676
|
+
* Resolve a report for a private message.
|
677
|
+
*
|
678
|
+
* `HTTP.PUT /private_message/report/resolve`
|
679
|
+
*/
|
680
|
+
LemmyHttp.prototype.resolvePrivateMessageReport = function (form) {
|
681
|
+
return __awaiter(this, void 0, void 0, function () {
|
682
|
+
return __generator(this, function (_a) {
|
683
|
+
return [2 /*return*/, this.wrapper(HttpType.Put, "/private_message/report/resolve", form)];
|
684
|
+
});
|
685
|
+
});
|
686
|
+
};
|
687
|
+
/**
|
688
|
+
* List private message reports.
|
689
|
+
*
|
690
|
+
* `HTTP.GET /private_message/report/list`
|
691
|
+
*/
|
692
|
+
LemmyHttp.prototype.listPrivateMessageReports = function (form) {
|
693
|
+
return __awaiter(this, void 0, void 0, function () {
|
694
|
+
return __generator(this, function (_a) {
|
695
|
+
return [2 /*return*/, this.wrapper(HttpType.Get, "/private_message/report/list", form)];
|
696
|
+
});
|
697
|
+
});
|
698
|
+
};
|
575
699
|
/**
|
576
700
|
* Register a new user.
|
701
|
+
*
|
702
|
+
* `HTTP.POST /user/register`
|
577
703
|
*/
|
578
704
|
LemmyHttp.prototype.register = function (form) {
|
579
705
|
return __awaiter(this, void 0, void 0, function () {
|
@@ -584,6 +710,8 @@ var LemmyHttp = /** @class */ (function () {
|
|
584
710
|
};
|
585
711
|
/**
|
586
712
|
* Log into lemmy.
|
713
|
+
*
|
714
|
+
* `HTTP.POST /user/login`
|
587
715
|
*/
|
588
716
|
LemmyHttp.prototype.login = function (form) {
|
589
717
|
return __awaiter(this, void 0, void 0, function () {
|
@@ -594,6 +722,8 @@ var LemmyHttp = /** @class */ (function () {
|
|
594
722
|
};
|
595
723
|
/**
|
596
724
|
* Get the details for a person.
|
725
|
+
*
|
726
|
+
* `HTTP.GET /user`
|
597
727
|
*/
|
598
728
|
LemmyHttp.prototype.getPersonDetails = function (form) {
|
599
729
|
return __awaiter(this, void 0, void 0, function () {
|
@@ -604,6 +734,8 @@ var LemmyHttp = /** @class */ (function () {
|
|
604
734
|
};
|
605
735
|
/**
|
606
736
|
* Get mentions for your user.
|
737
|
+
*
|
738
|
+
* `HTTP.GET /user/mention`
|
607
739
|
*/
|
608
740
|
LemmyHttp.prototype.getPersonMentions = function (form) {
|
609
741
|
return __awaiter(this, void 0, void 0, function () {
|
@@ -614,6 +746,8 @@ var LemmyHttp = /** @class */ (function () {
|
|
614
746
|
};
|
615
747
|
/**
|
616
748
|
* Mark a person mention as read.
|
749
|
+
*
|
750
|
+
* `HTTP.POST /user/mention/mark_as_read`
|
617
751
|
*/
|
618
752
|
LemmyHttp.prototype.markPersonMentionAsRead = function (form) {
|
619
753
|
return __awaiter(this, void 0, void 0, function () {
|
@@ -624,6 +758,8 @@ var LemmyHttp = /** @class */ (function () {
|
|
624
758
|
};
|
625
759
|
/**
|
626
760
|
* Get comment replies.
|
761
|
+
*
|
762
|
+
* `HTTP.GET /user/replies`
|
627
763
|
*/
|
628
764
|
LemmyHttp.prototype.getReplies = function (form) {
|
629
765
|
return __awaiter(this, void 0, void 0, function () {
|
@@ -634,6 +770,8 @@ var LemmyHttp = /** @class */ (function () {
|
|
634
770
|
};
|
635
771
|
/**
|
636
772
|
* Ban a person from your site.
|
773
|
+
*
|
774
|
+
* `HTTP.POST /user/ban`
|
637
775
|
*/
|
638
776
|
LemmyHttp.prototype.banPerson = function (form) {
|
639
777
|
return __awaiter(this, void 0, void 0, function () {
|
@@ -644,6 +782,8 @@ var LemmyHttp = /** @class */ (function () {
|
|
644
782
|
};
|
645
783
|
/**
|
646
784
|
* Get a list of banned users
|
785
|
+
*
|
786
|
+
* `HTTP.GET /user/banned`
|
647
787
|
*/
|
648
788
|
LemmyHttp.prototype.getBannedPersons = function (form) {
|
649
789
|
return __awaiter(this, void 0, void 0, function () {
|
@@ -654,6 +794,8 @@ var LemmyHttp = /** @class */ (function () {
|
|
654
794
|
};
|
655
795
|
/**
|
656
796
|
* Block a person.
|
797
|
+
*
|
798
|
+
* `HTTP.POST /user/block`
|
657
799
|
*/
|
658
800
|
LemmyHttp.prototype.blockPerson = function (form) {
|
659
801
|
return __awaiter(this, void 0, void 0, function () {
|
@@ -664,6 +806,8 @@ var LemmyHttp = /** @class */ (function () {
|
|
664
806
|
};
|
665
807
|
/**
|
666
808
|
* Fetch a Captcha.
|
809
|
+
*
|
810
|
+
* `HTTP.GET /user/get_captcha`
|
667
811
|
*/
|
668
812
|
LemmyHttp.prototype.getCaptcha = function () {
|
669
813
|
return __awaiter(this, void 0, void 0, function () {
|
@@ -674,6 +818,8 @@ var LemmyHttp = /** @class */ (function () {
|
|
674
818
|
};
|
675
819
|
/**
|
676
820
|
* Delete your account.
|
821
|
+
*
|
822
|
+
* `HTTP.POST /user/delete_account`
|
677
823
|
*/
|
678
824
|
LemmyHttp.prototype.deleteAccount = function (form) {
|
679
825
|
return __awaiter(this, void 0, void 0, function () {
|
@@ -684,6 +830,8 @@ var LemmyHttp = /** @class */ (function () {
|
|
684
830
|
};
|
685
831
|
/**
|
686
832
|
* Reset your password.
|
833
|
+
*
|
834
|
+
* `HTTP.POST /user/password_reset`
|
687
835
|
*/
|
688
836
|
LemmyHttp.prototype.passwordReset = function (form) {
|
689
837
|
return __awaiter(this, void 0, void 0, function () {
|
@@ -694,6 +842,8 @@ var LemmyHttp = /** @class */ (function () {
|
|
694
842
|
};
|
695
843
|
/**
|
696
844
|
* Change your password from an email / token based reset.
|
845
|
+
*
|
846
|
+
* `HTTP.POST /user/password_change`
|
697
847
|
*/
|
698
848
|
LemmyHttp.prototype.passwordChange = function (form) {
|
699
849
|
return __awaiter(this, void 0, void 0, function () {
|
@@ -704,6 +854,8 @@ var LemmyHttp = /** @class */ (function () {
|
|
704
854
|
};
|
705
855
|
/**
|
706
856
|
* Mark all replies as read.
|
857
|
+
*
|
858
|
+
* `HTTP.POST /user/mark_all_as_read`
|
707
859
|
*/
|
708
860
|
LemmyHttp.prototype.markAllAsRead = function (form) {
|
709
861
|
return __awaiter(this, void 0, void 0, function () {
|
@@ -714,6 +866,8 @@ var LemmyHttp = /** @class */ (function () {
|
|
714
866
|
};
|
715
867
|
/**
|
716
868
|
* Save your user settings.
|
869
|
+
*
|
870
|
+
* `HTTP.PUT /user/save_user_settings`
|
717
871
|
*/
|
718
872
|
LemmyHttp.prototype.saveUserSettings = function (form) {
|
719
873
|
return __awaiter(this, void 0, void 0, function () {
|
@@ -724,6 +878,8 @@ var LemmyHttp = /** @class */ (function () {
|
|
724
878
|
};
|
725
879
|
/**
|
726
880
|
* Change your user password.
|
881
|
+
*
|
882
|
+
* `HTTP.PUT /user/change_password`
|
727
883
|
*/
|
728
884
|
LemmyHttp.prototype.changePassword = function (form) {
|
729
885
|
return __awaiter(this, void 0, void 0, function () {
|
@@ -734,6 +890,8 @@ var LemmyHttp = /** @class */ (function () {
|
|
734
890
|
};
|
735
891
|
/**
|
736
892
|
* Get counts for your reports
|
893
|
+
*
|
894
|
+
* `HTTP.GET /user/report_count`
|
737
895
|
*/
|
738
896
|
LemmyHttp.prototype.getReportCount = function (form) {
|
739
897
|
return __awaiter(this, void 0, void 0, function () {
|
@@ -744,6 +902,8 @@ var LemmyHttp = /** @class */ (function () {
|
|
744
902
|
};
|
745
903
|
/**
|
746
904
|
* Get your unread counts
|
905
|
+
*
|
906
|
+
* `HTTP.GET /user/unread_count`
|
747
907
|
*/
|
748
908
|
LemmyHttp.prototype.getUnreadCount = function (form) {
|
749
909
|
return __awaiter(this, void 0, void 0, function () {
|
@@ -754,6 +914,8 @@ var LemmyHttp = /** @class */ (function () {
|
|
754
914
|
};
|
755
915
|
/**
|
756
916
|
* Verify your email
|
917
|
+
*
|
918
|
+
* `HTTP.POST /user/verify_email`
|
757
919
|
*/
|
758
920
|
LemmyHttp.prototype.verifyEmail = function (form) {
|
759
921
|
return __awaiter(this, void 0, void 0, function () {
|
@@ -764,6 +926,8 @@ var LemmyHttp = /** @class */ (function () {
|
|
764
926
|
};
|
765
927
|
/**
|
766
928
|
* Add an admin to your site.
|
929
|
+
*
|
930
|
+
* `HTTP.POST /admin/add`
|
767
931
|
*/
|
768
932
|
LemmyHttp.prototype.addAdmin = function (form) {
|
769
933
|
return __awaiter(this, void 0, void 0, function () {
|
@@ -774,6 +938,8 @@ var LemmyHttp = /** @class */ (function () {
|
|
774
938
|
};
|
775
939
|
/**
|
776
940
|
* Get the unread registration applications count.
|
941
|
+
*
|
942
|
+
* `HTTP.GET /admin/registration_application/count`
|
777
943
|
*/
|
778
944
|
LemmyHttp.prototype.getUnreadRegistrationApplicationCount = function (form) {
|
779
945
|
return __awaiter(this, void 0, void 0, function () {
|
@@ -783,7 +949,9 @@ var LemmyHttp = /** @class */ (function () {
|
|
783
949
|
});
|
784
950
|
};
|
785
951
|
/**
|
786
|
-
* List the
|
952
|
+
* List the registration applications.
|
953
|
+
*
|
954
|
+
* `HTTP.GET /admin/registration_application/list`
|
787
955
|
*/
|
788
956
|
LemmyHttp.prototype.listRegistrationApplications = function (form) {
|
789
957
|
return __awaiter(this, void 0, void 0, function () {
|
@@ -794,6 +962,8 @@ var LemmyHttp = /** @class */ (function () {
|
|
794
962
|
};
|
795
963
|
/**
|
796
964
|
* Approve a registration application
|
965
|
+
*
|
966
|
+
* `HTTP.PUT /admin/registration_application/approve`
|
797
967
|
*/
|
798
968
|
LemmyHttp.prototype.approveRegistrationApplication = function (form) {
|
799
969
|
return __awaiter(this, void 0, void 0, function () {
|
@@ -802,6 +972,54 @@ var LemmyHttp = /** @class */ (function () {
|
|
802
972
|
});
|
803
973
|
});
|
804
974
|
};
|
975
|
+
/**
|
976
|
+
* Purge / Delete a person from the database.
|
977
|
+
*
|
978
|
+
* `HTTP.POST /admin/purge/person`
|
979
|
+
*/
|
980
|
+
LemmyHttp.prototype.purgePerson = function (form) {
|
981
|
+
return __awaiter(this, void 0, void 0, function () {
|
982
|
+
return __generator(this, function (_a) {
|
983
|
+
return [2 /*return*/, this.wrapper(HttpType.Post, "/admin/purge/person", form)];
|
984
|
+
});
|
985
|
+
});
|
986
|
+
};
|
987
|
+
/**
|
988
|
+
* Purge / Delete a community from the database.
|
989
|
+
*
|
990
|
+
* `HTTP.POST /admin/purge/community`
|
991
|
+
*/
|
992
|
+
LemmyHttp.prototype.purgeCommunity = function (form) {
|
993
|
+
return __awaiter(this, void 0, void 0, function () {
|
994
|
+
return __generator(this, function (_a) {
|
995
|
+
return [2 /*return*/, this.wrapper(HttpType.Post, "/admin/purge/community", form)];
|
996
|
+
});
|
997
|
+
});
|
998
|
+
};
|
999
|
+
/**
|
1000
|
+
* Purge / Delete a post from the database.
|
1001
|
+
*
|
1002
|
+
* `HTTP.POST /admin/purge/post`
|
1003
|
+
*/
|
1004
|
+
LemmyHttp.prototype.purgePost = function (form) {
|
1005
|
+
return __awaiter(this, void 0, void 0, function () {
|
1006
|
+
return __generator(this, function (_a) {
|
1007
|
+
return [2 /*return*/, this.wrapper(HttpType.Post, "/admin/purge/post", form)];
|
1008
|
+
});
|
1009
|
+
});
|
1010
|
+
};
|
1011
|
+
/**
|
1012
|
+
* Purge / Delete a comment from the database.
|
1013
|
+
*
|
1014
|
+
* `HTTP.POST /admin/purge/comment`
|
1015
|
+
*/
|
1016
|
+
LemmyHttp.prototype.purgeComment = function (form) {
|
1017
|
+
return __awaiter(this, void 0, void 0, function () {
|
1018
|
+
return __generator(this, function (_a) {
|
1019
|
+
return [2 /*return*/, this.wrapper(HttpType.Post, "/admin/purge/comment", form)];
|
1020
|
+
});
|
1021
|
+
});
|
1022
|
+
};
|
805
1023
|
LemmyHttp.prototype.buildFullUrl = function (endpoint) {
|
806
1024
|
return "".concat(this.apiUrl).concat(endpoint);
|
807
1025
|
};
|
@@ -832,6 +1050,7 @@ var LemmyHttp = /** @class */ (function () {
|
|
832
1050
|
exports.LemmyHttp = LemmyHttp;
|
833
1051
|
function encodeGetParams(p) {
|
834
1052
|
return Object.entries(p)
|
1053
|
+
.filter(function (kv) { return !!kv[1]; })
|
835
1054
|
.map(function (kv) { return kv.map(encodeURIComponent).join("="); })
|
836
1055
|
.join("&");
|
837
1056
|
}
|