lemmy-js-client 0.17.0-rc.59 → 0.17.0-rc.60

Sign up to get free protection for your applications and to get access to all the features.
package/dist/http.js CHANGED
@@ -48,13 +48,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
48
48
  };
49
49
  Object.defineProperty(exports, "__esModule", { value: true });
50
50
  exports.LemmyHttp = void 0;
51
- var class_transformer_1 = require("class-transformer");
52
51
  var node_fetch_1 = require("node-fetch");
53
- var comment_1 = require("./interfaces/api/comment");
54
- var community_1 = require("./interfaces/api/community");
55
- var person_1 = require("./interfaces/api/person");
56
- var post_1 = require("./interfaces/api/post");
57
- var site_1 = require("./interfaces/api/site");
58
52
  var others_1 = require("./interfaces/others");
59
53
  var HttpType;
60
54
  (function (HttpType) {
@@ -86,7 +80,7 @@ var LemmyHttp = /** @class */ (function () {
86
80
  LemmyHttp.prototype.getSite = function (form) {
87
81
  return __awaiter(this, void 0, void 0, function () {
88
82
  return __generator(this, function (_a) {
89
- return [2 /*return*/, this.wrapper(HttpType.Get, "/site", form, site_1.GetSiteResponse)];
83
+ return [2 /*return*/, this.wrapper(HttpType.Get, "/site", form)];
90
84
  });
91
85
  });
92
86
  };
@@ -98,7 +92,7 @@ var LemmyHttp = /** @class */ (function () {
98
92
  LemmyHttp.prototype.createSite = function (form) {
99
93
  return __awaiter(this, void 0, void 0, function () {
100
94
  return __generator(this, function (_a) {
101
- return [2 /*return*/, this.wrapper(HttpType.Post, "/site", form, site_1.SiteResponse)];
95
+ return [2 /*return*/, this.wrapper(HttpType.Post, "/site", form)];
102
96
  });
103
97
  });
104
98
  };
@@ -110,7 +104,7 @@ var LemmyHttp = /** @class */ (function () {
110
104
  LemmyHttp.prototype.editSite = function (form) {
111
105
  return __awaiter(this, void 0, void 0, function () {
112
106
  return __generator(this, function (_a) {
113
- return [2 /*return*/, this.wrapper(HttpType.Put, "/site", form, site_1.SiteResponse)];
107
+ return [2 /*return*/, this.wrapper(HttpType.Put, "/site", form)];
114
108
  });
115
109
  });
116
110
  };
@@ -122,7 +116,7 @@ var LemmyHttp = /** @class */ (function () {
122
116
  LemmyHttp.prototype.leaveAdmin = function (form) {
123
117
  return __awaiter(this, void 0, void 0, function () {
124
118
  return __generator(this, function (_a) {
125
- return [2 /*return*/, this.wrapper(HttpType.Post, "/user/leave_admin", form, site_1.GetSiteResponse)];
119
+ return [2 /*return*/, this.wrapper(HttpType.Post, "/user/leave_admin", form)];
126
120
  });
127
121
  });
128
122
  };
@@ -134,7 +128,7 @@ var LemmyHttp = /** @class */ (function () {
134
128
  LemmyHttp.prototype.getModlog = function (form) {
135
129
  return __awaiter(this, void 0, void 0, function () {
136
130
  return __generator(this, function (_a) {
137
- return [2 /*return*/, this.wrapper(HttpType.Get, "/modlog", form, site_1.GetModlogResponse)];
131
+ return [2 /*return*/, this.wrapper(HttpType.Get, "/modlog", form)];
138
132
  });
139
133
  });
140
134
  };
@@ -146,7 +140,7 @@ var LemmyHttp = /** @class */ (function () {
146
140
  LemmyHttp.prototype.search = function (form) {
147
141
  return __awaiter(this, void 0, void 0, function () {
148
142
  return __generator(this, function (_a) {
149
- return [2 /*return*/, this.wrapper(HttpType.Get, "/search", form, site_1.SearchResponse)];
143
+ return [2 /*return*/, this.wrapper(HttpType.Get, "/search", form)];
150
144
  });
151
145
  });
152
146
  };
@@ -158,7 +152,7 @@ var LemmyHttp = /** @class */ (function () {
158
152
  LemmyHttp.prototype.resolveObject = function (form) {
159
153
  return __awaiter(this, void 0, void 0, function () {
160
154
  return __generator(this, function (_a) {
161
- return [2 /*return*/, this.wrapper(HttpType.Get, "/resolve_object", form, site_1.ResolveObjectResponse)];
155
+ return [2 /*return*/, this.wrapper(HttpType.Get, "/resolve_object", form)];
162
156
  });
163
157
  });
164
158
  };
@@ -170,7 +164,7 @@ var LemmyHttp = /** @class */ (function () {
170
164
  LemmyHttp.prototype.createCommunity = function (form) {
171
165
  return __awaiter(this, void 0, void 0, function () {
172
166
  return __generator(this, function (_a) {
173
- return [2 /*return*/, this.wrapper(HttpType.Post, "/community", form, community_1.CommunityResponse)];
167
+ return [2 /*return*/, this.wrapper(HttpType.Post, "/community", form)];
174
168
  });
175
169
  });
176
170
  };
@@ -182,7 +176,7 @@ var LemmyHttp = /** @class */ (function () {
182
176
  LemmyHttp.prototype.getCommunity = function (form) {
183
177
  return __awaiter(this, void 0, void 0, function () {
184
178
  return __generator(this, function (_a) {
185
- return [2 /*return*/, this.wrapper(HttpType.Get, "/community", form, community_1.GetCommunityResponse)];
179
+ return [2 /*return*/, this.wrapper(HttpType.Get, "/community", form)];
186
180
  });
187
181
  });
188
182
  };
@@ -194,7 +188,7 @@ var LemmyHttp = /** @class */ (function () {
194
188
  LemmyHttp.prototype.editCommunity = function (form) {
195
189
  return __awaiter(this, void 0, void 0, function () {
196
190
  return __generator(this, function (_a) {
197
- return [2 /*return*/, this.wrapper(HttpType.Put, "/community", form, community_1.CommunityResponse)];
191
+ return [2 /*return*/, this.wrapper(HttpType.Put, "/community", form)];
198
192
  });
199
193
  });
200
194
  };
@@ -206,7 +200,7 @@ var LemmyHttp = /** @class */ (function () {
206
200
  LemmyHttp.prototype.listCommunities = function (form) {
207
201
  return __awaiter(this, void 0, void 0, function () {
208
202
  return __generator(this, function (_a) {
209
- return [2 /*return*/, this.wrapper(HttpType.Get, "/community/list", form, community_1.ListCommunitiesResponse)];
203
+ return [2 /*return*/, this.wrapper(HttpType.Get, "/community/list", form)];
210
204
  });
211
205
  });
212
206
  };
@@ -218,7 +212,7 @@ var LemmyHttp = /** @class */ (function () {
218
212
  LemmyHttp.prototype.followCommunity = function (form) {
219
213
  return __awaiter(this, void 0, void 0, function () {
220
214
  return __generator(this, function (_a) {
221
- return [2 /*return*/, this.wrapper(HttpType.Post, "/community/follow", form, community_1.CommunityResponse)];
215
+ return [2 /*return*/, this.wrapper(HttpType.Post, "/community/follow", form)];
222
216
  });
223
217
  });
224
218
  };
@@ -230,7 +224,7 @@ var LemmyHttp = /** @class */ (function () {
230
224
  LemmyHttp.prototype.blockCommunity = function (form) {
231
225
  return __awaiter(this, void 0, void 0, function () {
232
226
  return __generator(this, function (_a) {
233
- return [2 /*return*/, this.wrapper(HttpType.Post, "/community/block", form, community_1.BlockCommunityResponse)];
227
+ return [2 /*return*/, this.wrapper(HttpType.Post, "/community/block", form)];
234
228
  });
235
229
  });
236
230
  };
@@ -242,7 +236,7 @@ var LemmyHttp = /** @class */ (function () {
242
236
  LemmyHttp.prototype.deleteCommunity = function (form) {
243
237
  return __awaiter(this, void 0, void 0, function () {
244
238
  return __generator(this, function (_a) {
245
- return [2 /*return*/, this.wrapper(HttpType.Post, "/community/delete", form, community_1.CommunityResponse)];
239
+ return [2 /*return*/, this.wrapper(HttpType.Post, "/community/delete", form)];
246
240
  });
247
241
  });
248
242
  };
@@ -254,7 +248,7 @@ var LemmyHttp = /** @class */ (function () {
254
248
  LemmyHttp.prototype.removeCommunity = function (form) {
255
249
  return __awaiter(this, void 0, void 0, function () {
256
250
  return __generator(this, function (_a) {
257
- return [2 /*return*/, this.wrapper(HttpType.Post, "/community/remove", form, community_1.CommunityResponse)];
251
+ return [2 /*return*/, this.wrapper(HttpType.Post, "/community/remove", form)];
258
252
  });
259
253
  });
260
254
  };
@@ -266,7 +260,7 @@ var LemmyHttp = /** @class */ (function () {
266
260
  LemmyHttp.prototype.transferCommunity = function (form) {
267
261
  return __awaiter(this, void 0, void 0, function () {
268
262
  return __generator(this, function (_a) {
269
- return [2 /*return*/, this.wrapper(HttpType.Post, "/community/transfer", form, community_1.GetCommunityResponse)];
263
+ return [2 /*return*/, this.wrapper(HttpType.Post, "/community/transfer", form)];
270
264
  });
271
265
  });
272
266
  };
@@ -278,7 +272,7 @@ var LemmyHttp = /** @class */ (function () {
278
272
  LemmyHttp.prototype.banFromCommunity = function (form) {
279
273
  return __awaiter(this, void 0, void 0, function () {
280
274
  return __generator(this, function (_a) {
281
- return [2 /*return*/, this.wrapper(HttpType.Post, "/community/ban_user", form, community_1.BanFromCommunityResponse)];
275
+ return [2 /*return*/, this.wrapper(HttpType.Post, "/community/ban_user", form)];
282
276
  });
283
277
  });
284
278
  };
@@ -290,7 +284,7 @@ var LemmyHttp = /** @class */ (function () {
290
284
  LemmyHttp.prototype.addModToCommunity = function (form) {
291
285
  return __awaiter(this, void 0, void 0, function () {
292
286
  return __generator(this, function (_a) {
293
- return [2 /*return*/, this.wrapper(HttpType.Post, "/community/mod", form, community_1.AddModToCommunityResponse)];
287
+ return [2 /*return*/, this.wrapper(HttpType.Post, "/community/mod", form)];
294
288
  });
295
289
  });
296
290
  };
@@ -302,7 +296,7 @@ var LemmyHttp = /** @class */ (function () {
302
296
  LemmyHttp.prototype.createPost = function (form) {
303
297
  return __awaiter(this, void 0, void 0, function () {
304
298
  return __generator(this, function (_a) {
305
- return [2 /*return*/, this.wrapper(HttpType.Post, "/post", form, post_1.PostResponse)];
299
+ return [2 /*return*/, this.wrapper(HttpType.Post, "/post", form)];
306
300
  });
307
301
  });
308
302
  };
@@ -314,7 +308,7 @@ var LemmyHttp = /** @class */ (function () {
314
308
  LemmyHttp.prototype.getPost = function (form) {
315
309
  return __awaiter(this, void 0, void 0, function () {
316
310
  return __generator(this, function (_a) {
317
- return [2 /*return*/, this.wrapper(HttpType.Get, "/post", form, post_1.GetPostResponse)];
311
+ return [2 /*return*/, this.wrapper(HttpType.Get, "/post", form)];
318
312
  });
319
313
  });
320
314
  };
@@ -326,7 +320,7 @@ var LemmyHttp = /** @class */ (function () {
326
320
  LemmyHttp.prototype.editPost = function (form) {
327
321
  return __awaiter(this, void 0, void 0, function () {
328
322
  return __generator(this, function (_a) {
329
- return [2 /*return*/, this.wrapper(HttpType.Put, "/post", form, post_1.PostResponse)];
323
+ return [2 /*return*/, this.wrapper(HttpType.Put, "/post", form)];
330
324
  });
331
325
  });
332
326
  };
@@ -338,7 +332,7 @@ var LemmyHttp = /** @class */ (function () {
338
332
  LemmyHttp.prototype.deletePost = function (form) {
339
333
  return __awaiter(this, void 0, void 0, function () {
340
334
  return __generator(this, function (_a) {
341
- return [2 /*return*/, this.wrapper(HttpType.Post, "/post/delete", form, post_1.PostResponse)];
335
+ return [2 /*return*/, this.wrapper(HttpType.Post, "/post/delete", form)];
342
336
  });
343
337
  });
344
338
  };
@@ -350,7 +344,7 @@ var LemmyHttp = /** @class */ (function () {
350
344
  LemmyHttp.prototype.removePost = function (form) {
351
345
  return __awaiter(this, void 0, void 0, function () {
352
346
  return __generator(this, function (_a) {
353
- return [2 /*return*/, this.wrapper(HttpType.Post, "/post/remove", form, post_1.PostResponse)];
347
+ return [2 /*return*/, this.wrapper(HttpType.Post, "/post/remove", form)];
354
348
  });
355
349
  });
356
350
  };
@@ -362,7 +356,7 @@ var LemmyHttp = /** @class */ (function () {
362
356
  LemmyHttp.prototype.markPostAsRead = function (form) {
363
357
  return __awaiter(this, void 0, void 0, function () {
364
358
  return __generator(this, function (_a) {
365
- return [2 /*return*/, this.wrapper(HttpType.Post, "/post/mark_as_read", form, post_1.PostResponse)];
359
+ return [2 /*return*/, this.wrapper(HttpType.Post, "/post/mark_as_read", form)];
366
360
  });
367
361
  });
368
362
  };
@@ -374,7 +368,7 @@ var LemmyHttp = /** @class */ (function () {
374
368
  LemmyHttp.prototype.lockPost = function (form) {
375
369
  return __awaiter(this, void 0, void 0, function () {
376
370
  return __generator(this, function (_a) {
377
- return [2 /*return*/, this.wrapper(HttpType.Post, "/post/lock", form, post_1.PostResponse)];
371
+ return [2 /*return*/, this.wrapper(HttpType.Post, "/post/lock", form)];
378
372
  });
379
373
  });
380
374
  };
@@ -386,7 +380,7 @@ var LemmyHttp = /** @class */ (function () {
386
380
  LemmyHttp.prototype.featurePost = function (form) {
387
381
  return __awaiter(this, void 0, void 0, function () {
388
382
  return __generator(this, function (_a) {
389
- return [2 /*return*/, this.wrapper(HttpType.Post, "/post/feature", form, post_1.PostResponse)];
383
+ return [2 /*return*/, this.wrapper(HttpType.Post, "/post/feature", form)];
390
384
  });
391
385
  });
392
386
  };
@@ -398,7 +392,7 @@ var LemmyHttp = /** @class */ (function () {
398
392
  LemmyHttp.prototype.getPosts = function (form) {
399
393
  return __awaiter(this, void 0, void 0, function () {
400
394
  return __generator(this, function (_a) {
401
- return [2 /*return*/, this.wrapper(HttpType.Get, "/post/list", form, post_1.GetPostsResponse)];
395
+ return [2 /*return*/, this.wrapper(HttpType.Get, "/post/list", form)];
402
396
  });
403
397
  });
404
398
  };
@@ -410,7 +404,7 @@ var LemmyHttp = /** @class */ (function () {
410
404
  LemmyHttp.prototype.likePost = function (form) {
411
405
  return __awaiter(this, void 0, void 0, function () {
412
406
  return __generator(this, function (_a) {
413
- return [2 /*return*/, this.wrapper(HttpType.Post, "/post/like", form, post_1.PostResponse)];
407
+ return [2 /*return*/, this.wrapper(HttpType.Post, "/post/like", form)];
414
408
  });
415
409
  });
416
410
  };
@@ -422,7 +416,7 @@ var LemmyHttp = /** @class */ (function () {
422
416
  LemmyHttp.prototype.savePost = function (form) {
423
417
  return __awaiter(this, void 0, void 0, function () {
424
418
  return __generator(this, function (_a) {
425
- return [2 /*return*/, this.wrapper(HttpType.Put, "/post/save", form, post_1.PostResponse)];
419
+ return [2 /*return*/, this.wrapper(HttpType.Put, "/post/save", form)];
426
420
  });
427
421
  });
428
422
  };
@@ -434,7 +428,7 @@ var LemmyHttp = /** @class */ (function () {
434
428
  LemmyHttp.prototype.createPostReport = function (form) {
435
429
  return __awaiter(this, void 0, void 0, function () {
436
430
  return __generator(this, function (_a) {
437
- return [2 /*return*/, this.wrapper(HttpType.Post, "/post/report", form, post_1.PostReportResponse)];
431
+ return [2 /*return*/, this.wrapper(HttpType.Post, "/post/report", form)];
438
432
  });
439
433
  });
440
434
  };
@@ -446,7 +440,7 @@ var LemmyHttp = /** @class */ (function () {
446
440
  LemmyHttp.prototype.resolvePostReport = function (form) {
447
441
  return __awaiter(this, void 0, void 0, function () {
448
442
  return __generator(this, function (_a) {
449
- return [2 /*return*/, this.wrapper(HttpType.Put, "/post/report/resolve", form, post_1.PostReportResponse)];
443
+ return [2 /*return*/, this.wrapper(HttpType.Put, "/post/report/resolve", form)];
450
444
  });
451
445
  });
452
446
  };
@@ -458,7 +452,7 @@ var LemmyHttp = /** @class */ (function () {
458
452
  LemmyHttp.prototype.listPostReports = function (form) {
459
453
  return __awaiter(this, void 0, void 0, function () {
460
454
  return __generator(this, function (_a) {
461
- return [2 /*return*/, this.wrapper(HttpType.Get, "/post/report/list", form, post_1.ListPostReportsResponse)];
455
+ return [2 /*return*/, this.wrapper(HttpType.Get, "/post/report/list", form)];
462
456
  });
463
457
  });
464
458
  };
@@ -470,7 +464,7 @@ var LemmyHttp = /** @class */ (function () {
470
464
  LemmyHttp.prototype.getSiteMetadata = function (form) {
471
465
  return __awaiter(this, void 0, void 0, function () {
472
466
  return __generator(this, function (_a) {
473
- return [2 /*return*/, this.wrapper(HttpType.Get, "/post/site_metadata", form, post_1.GetSiteMetadataResponse)];
467
+ return [2 /*return*/, this.wrapper(HttpType.Get, "/post/site_metadata", form)];
474
468
  });
475
469
  });
476
470
  };
@@ -482,7 +476,7 @@ var LemmyHttp = /** @class */ (function () {
482
476
  LemmyHttp.prototype.createComment = function (form) {
483
477
  return __awaiter(this, void 0, void 0, function () {
484
478
  return __generator(this, function (_a) {
485
- return [2 /*return*/, this.wrapper(HttpType.Post, "/comment", form, comment_1.CommentResponse)];
479
+ return [2 /*return*/, this.wrapper(HttpType.Post, "/comment", form)];
486
480
  });
487
481
  });
488
482
  };
@@ -494,7 +488,7 @@ var LemmyHttp = /** @class */ (function () {
494
488
  LemmyHttp.prototype.editComment = function (form) {
495
489
  return __awaiter(this, void 0, void 0, function () {
496
490
  return __generator(this, function (_a) {
497
- return [2 /*return*/, this.wrapper(HttpType.Put, "/comment", form, comment_1.CommentResponse)];
491
+ return [2 /*return*/, this.wrapper(HttpType.Put, "/comment", form)];
498
492
  });
499
493
  });
500
494
  };
@@ -506,7 +500,7 @@ var LemmyHttp = /** @class */ (function () {
506
500
  LemmyHttp.prototype.deleteComment = function (form) {
507
501
  return __awaiter(this, void 0, void 0, function () {
508
502
  return __generator(this, function (_a) {
509
- return [2 /*return*/, this.wrapper(HttpType.Post, "/comment/delete", form, comment_1.CommentResponse)];
503
+ return [2 /*return*/, this.wrapper(HttpType.Post, "/comment/delete", form)];
510
504
  });
511
505
  });
512
506
  };
@@ -518,7 +512,7 @@ var LemmyHttp = /** @class */ (function () {
518
512
  LemmyHttp.prototype.removeComment = function (form) {
519
513
  return __awaiter(this, void 0, void 0, function () {
520
514
  return __generator(this, function (_a) {
521
- return [2 /*return*/, this.wrapper(HttpType.Post, "/comment/remove", form, comment_1.CommentResponse)];
515
+ return [2 /*return*/, this.wrapper(HttpType.Post, "/comment/remove", form)];
522
516
  });
523
517
  });
524
518
  };
@@ -530,7 +524,7 @@ var LemmyHttp = /** @class */ (function () {
530
524
  LemmyHttp.prototype.markCommentReplyAsRead = function (form) {
531
525
  return __awaiter(this, void 0, void 0, function () {
532
526
  return __generator(this, function (_a) {
533
- return [2 /*return*/, this.wrapper(HttpType.Post, "/comment/mark_as_read", form, comment_1.CommentResponse)];
527
+ return [2 /*return*/, this.wrapper(HttpType.Post, "/comment/mark_as_read", form)];
534
528
  });
535
529
  });
536
530
  };
@@ -542,7 +536,7 @@ var LemmyHttp = /** @class */ (function () {
542
536
  LemmyHttp.prototype.likeComment = function (form) {
543
537
  return __awaiter(this, void 0, void 0, function () {
544
538
  return __generator(this, function (_a) {
545
- return [2 /*return*/, this.wrapper(HttpType.Post, "/comment/like", form, comment_1.CommentResponse)];
539
+ return [2 /*return*/, this.wrapper(HttpType.Post, "/comment/like", form)];
546
540
  });
547
541
  });
548
542
  };
@@ -554,7 +548,7 @@ var LemmyHttp = /** @class */ (function () {
554
548
  LemmyHttp.prototype.saveComment = function (form) {
555
549
  return __awaiter(this, void 0, void 0, function () {
556
550
  return __generator(this, function (_a) {
557
- return [2 /*return*/, this.wrapper(HttpType.Put, "/comment/save", form, comment_1.CommentResponse)];
551
+ return [2 /*return*/, this.wrapper(HttpType.Put, "/comment/save", form)];
558
552
  });
559
553
  });
560
554
  };
@@ -566,7 +560,7 @@ var LemmyHttp = /** @class */ (function () {
566
560
  LemmyHttp.prototype.getComments = function (form) {
567
561
  return __awaiter(this, void 0, void 0, function () {
568
562
  return __generator(this, function (_a) {
569
- return [2 /*return*/, this.wrapper(HttpType.Get, "/comment/list", form, comment_1.GetCommentsResponse)];
563
+ return [2 /*return*/, this.wrapper(HttpType.Get, "/comment/list", form)];
570
564
  });
571
565
  });
572
566
  };
@@ -578,7 +572,7 @@ var LemmyHttp = /** @class */ (function () {
578
572
  LemmyHttp.prototype.createCommentReport = function (form) {
579
573
  return __awaiter(this, void 0, void 0, function () {
580
574
  return __generator(this, function (_a) {
581
- return [2 /*return*/, this.wrapper(HttpType.Post, "/comment/report", form, comment_1.CommentReportResponse)];
575
+ return [2 /*return*/, this.wrapper(HttpType.Post, "/comment/report", form)];
582
576
  });
583
577
  });
584
578
  };
@@ -590,7 +584,7 @@ var LemmyHttp = /** @class */ (function () {
590
584
  LemmyHttp.prototype.resolveCommentReport = function (form) {
591
585
  return __awaiter(this, void 0, void 0, function () {
592
586
  return __generator(this, function (_a) {
593
- return [2 /*return*/, this.wrapper(HttpType.Put, "/comment/report/resolve", form, comment_1.CommentReportResponse)];
587
+ return [2 /*return*/, this.wrapper(HttpType.Put, "/comment/report/resolve", form)];
594
588
  });
595
589
  });
596
590
  };
@@ -602,7 +596,7 @@ var LemmyHttp = /** @class */ (function () {
602
596
  LemmyHttp.prototype.listCommentReports = function (form) {
603
597
  return __awaiter(this, void 0, void 0, function () {
604
598
  return __generator(this, function (_a) {
605
- return [2 /*return*/, this.wrapper(HttpType.Get, "/comment/report/list", form, comment_1.ListCommentReportsResponse)];
599
+ return [2 /*return*/, this.wrapper(HttpType.Get, "/comment/report/list", form)];
606
600
  });
607
601
  });
608
602
  };
@@ -614,7 +608,7 @@ var LemmyHttp = /** @class */ (function () {
614
608
  LemmyHttp.prototype.getPrivateMessages = function (form) {
615
609
  return __awaiter(this, void 0, void 0, function () {
616
610
  return __generator(this, function (_a) {
617
- return [2 /*return*/, this.wrapper(HttpType.Get, "/private_message/list", form, person_1.PrivateMessagesResponse)];
611
+ return [2 /*return*/, this.wrapper(HttpType.Get, "/private_message/list", form)];
618
612
  });
619
613
  });
620
614
  };
@@ -626,7 +620,7 @@ var LemmyHttp = /** @class */ (function () {
626
620
  LemmyHttp.prototype.createPrivateMessage = function (form) {
627
621
  return __awaiter(this, void 0, void 0, function () {
628
622
  return __generator(this, function (_a) {
629
- return [2 /*return*/, this.wrapper(HttpType.Post, "/private_message", form, person_1.PrivateMessageResponse)];
623
+ return [2 /*return*/, this.wrapper(HttpType.Post, "/private_message", form)];
630
624
  });
631
625
  });
632
626
  };
@@ -638,7 +632,7 @@ var LemmyHttp = /** @class */ (function () {
638
632
  LemmyHttp.prototype.editPrivateMessage = function (form) {
639
633
  return __awaiter(this, void 0, void 0, function () {
640
634
  return __generator(this, function (_a) {
641
- return [2 /*return*/, this.wrapper(HttpType.Put, "/private_message", form, person_1.PrivateMessageResponse)];
635
+ return [2 /*return*/, this.wrapper(HttpType.Put, "/private_message", form)];
642
636
  });
643
637
  });
644
638
  };
@@ -650,7 +644,7 @@ var LemmyHttp = /** @class */ (function () {
650
644
  LemmyHttp.prototype.deletePrivateMessage = function (form) {
651
645
  return __awaiter(this, void 0, void 0, function () {
652
646
  return __generator(this, function (_a) {
653
- return [2 /*return*/, this.wrapper(HttpType.Post, "/private_message/delete", form, person_1.PrivateMessageResponse)];
647
+ return [2 /*return*/, this.wrapper(HttpType.Post, "/private_message/delete", form)];
654
648
  });
655
649
  });
656
650
  };
@@ -662,7 +656,7 @@ var LemmyHttp = /** @class */ (function () {
662
656
  LemmyHttp.prototype.markPrivateMessageAsRead = function (form) {
663
657
  return __awaiter(this, void 0, void 0, function () {
664
658
  return __generator(this, function (_a) {
665
- return [2 /*return*/, this.wrapper(HttpType.Post, "/private_message/mark_as_read", form, person_1.PrivateMessageResponse)];
659
+ return [2 /*return*/, this.wrapper(HttpType.Post, "/private_message/mark_as_read", form)];
666
660
  });
667
661
  });
668
662
  };
@@ -674,7 +668,7 @@ var LemmyHttp = /** @class */ (function () {
674
668
  LemmyHttp.prototype.createPrivateMessageReport = function (form) {
675
669
  return __awaiter(this, void 0, void 0, function () {
676
670
  return __generator(this, function (_a) {
677
- return [2 /*return*/, this.wrapper(HttpType.Post, "/private_message/report", form, person_1.PrivateMessageReportResponse)];
671
+ return [2 /*return*/, this.wrapper(HttpType.Post, "/private_message/report", form)];
678
672
  });
679
673
  });
680
674
  };
@@ -686,7 +680,7 @@ var LemmyHttp = /** @class */ (function () {
686
680
  LemmyHttp.prototype.resolvePrivateMessageReport = function (form) {
687
681
  return __awaiter(this, void 0, void 0, function () {
688
682
  return __generator(this, function (_a) {
689
- return [2 /*return*/, this.wrapper(HttpType.Put, "/private_message/report/resolve", form, person_1.PrivateMessageReportResponse)];
683
+ return [2 /*return*/, this.wrapper(HttpType.Put, "/private_message/report/resolve", form)];
690
684
  });
691
685
  });
692
686
  };
@@ -698,7 +692,7 @@ var LemmyHttp = /** @class */ (function () {
698
692
  LemmyHttp.prototype.listPrivateMessageReports = function (form) {
699
693
  return __awaiter(this, void 0, void 0, function () {
700
694
  return __generator(this, function (_a) {
701
- return [2 /*return*/, this.wrapper(HttpType.Get, "/private_message/report/list", form, person_1.ListPrivateMessageReportsResponse)];
695
+ return [2 /*return*/, this.wrapper(HttpType.Get, "/private_message/report/list", form)];
702
696
  });
703
697
  });
704
698
  };
@@ -710,7 +704,7 @@ var LemmyHttp = /** @class */ (function () {
710
704
  LemmyHttp.prototype.register = function (form) {
711
705
  return __awaiter(this, void 0, void 0, function () {
712
706
  return __generator(this, function (_a) {
713
- return [2 /*return*/, this.wrapper(HttpType.Post, "/user/register", form, person_1.LoginResponse)];
707
+ return [2 /*return*/, this.wrapper(HttpType.Post, "/user/register", form)];
714
708
  });
715
709
  });
716
710
  };
@@ -722,7 +716,7 @@ var LemmyHttp = /** @class */ (function () {
722
716
  LemmyHttp.prototype.login = function (form) {
723
717
  return __awaiter(this, void 0, void 0, function () {
724
718
  return __generator(this, function (_a) {
725
- return [2 /*return*/, this.wrapper(HttpType.Post, "/user/login", form, person_1.LoginResponse)];
719
+ return [2 /*return*/, this.wrapper(HttpType.Post, "/user/login", form)];
726
720
  });
727
721
  });
728
722
  };
@@ -734,7 +728,7 @@ var LemmyHttp = /** @class */ (function () {
734
728
  LemmyHttp.prototype.getPersonDetails = function (form) {
735
729
  return __awaiter(this, void 0, void 0, function () {
736
730
  return __generator(this, function (_a) {
737
- return [2 /*return*/, this.wrapper(HttpType.Get, "/user", form, person_1.GetPersonDetailsResponse)];
731
+ return [2 /*return*/, this.wrapper(HttpType.Get, "/user", form)];
738
732
  });
739
733
  });
740
734
  };
@@ -746,7 +740,7 @@ var LemmyHttp = /** @class */ (function () {
746
740
  LemmyHttp.prototype.getPersonMentions = function (form) {
747
741
  return __awaiter(this, void 0, void 0, function () {
748
742
  return __generator(this, function (_a) {
749
- return [2 /*return*/, this.wrapper(HttpType.Get, "/user/mention", form, person_1.GetPersonMentionsResponse)];
743
+ return [2 /*return*/, this.wrapper(HttpType.Get, "/user/mention", form)];
750
744
  });
751
745
  });
752
746
  };
@@ -758,7 +752,7 @@ var LemmyHttp = /** @class */ (function () {
758
752
  LemmyHttp.prototype.markPersonMentionAsRead = function (form) {
759
753
  return __awaiter(this, void 0, void 0, function () {
760
754
  return __generator(this, function (_a) {
761
- return [2 /*return*/, this.wrapper(HttpType.Post, "/user/mention/mark_as_read", form, person_1.PersonMentionResponse)];
755
+ return [2 /*return*/, this.wrapper(HttpType.Post, "/user/mention/mark_as_read", form)];
762
756
  });
763
757
  });
764
758
  };
@@ -770,7 +764,7 @@ var LemmyHttp = /** @class */ (function () {
770
764
  LemmyHttp.prototype.getReplies = function (form) {
771
765
  return __awaiter(this, void 0, void 0, function () {
772
766
  return __generator(this, function (_a) {
773
- return [2 /*return*/, this.wrapper(HttpType.Get, "/user/replies", form, person_1.GetRepliesResponse)];
767
+ return [2 /*return*/, this.wrapper(HttpType.Get, "/user/replies", form)];
774
768
  });
775
769
  });
776
770
  };
@@ -782,7 +776,7 @@ var LemmyHttp = /** @class */ (function () {
782
776
  LemmyHttp.prototype.banPerson = function (form) {
783
777
  return __awaiter(this, void 0, void 0, function () {
784
778
  return __generator(this, function (_a) {
785
- return [2 /*return*/, this.wrapper(HttpType.Post, "/user/ban", form, person_1.BanPersonResponse)];
779
+ return [2 /*return*/, this.wrapper(HttpType.Post, "/user/ban", form)];
786
780
  });
787
781
  });
788
782
  };
@@ -794,7 +788,7 @@ var LemmyHttp = /** @class */ (function () {
794
788
  LemmyHttp.prototype.getBannedPersons = function (form) {
795
789
  return __awaiter(this, void 0, void 0, function () {
796
790
  return __generator(this, function (_a) {
797
- return [2 /*return*/, this.wrapper(HttpType.Get, "/user/banned", form, person_1.BannedPersonsResponse)];
791
+ return [2 /*return*/, this.wrapper(HttpType.Get, "/user/banned", form)];
798
792
  });
799
793
  });
800
794
  };
@@ -806,7 +800,7 @@ var LemmyHttp = /** @class */ (function () {
806
800
  LemmyHttp.prototype.blockPerson = function (form) {
807
801
  return __awaiter(this, void 0, void 0, function () {
808
802
  return __generator(this, function (_a) {
809
- return [2 /*return*/, this.wrapper(HttpType.Post, "/user/block", form, person_1.BlockPersonResponse)];
803
+ return [2 /*return*/, this.wrapper(HttpType.Post, "/user/block", form)];
810
804
  });
811
805
  });
812
806
  };
@@ -818,7 +812,7 @@ var LemmyHttp = /** @class */ (function () {
818
812
  LemmyHttp.prototype.getCaptcha = function () {
819
813
  return __awaiter(this, void 0, void 0, function () {
820
814
  return __generator(this, function (_a) {
821
- return [2 /*return*/, this.wrapper(HttpType.Get, "/user/get_captcha", {}, person_1.GetCaptchaResponse)];
815
+ return [2 /*return*/, this.wrapper(HttpType.Get, "/user/get_captcha", {})];
822
816
  });
823
817
  });
824
818
  };
@@ -830,7 +824,7 @@ var LemmyHttp = /** @class */ (function () {
830
824
  LemmyHttp.prototype.deleteAccount = function (form) {
831
825
  return __awaiter(this, void 0, void 0, function () {
832
826
  return __generator(this, function (_a) {
833
- return [2 /*return*/, this.wrapper(HttpType.Post, "/user/delete_account", form, person_1.DeleteAccountResponse)];
827
+ return [2 /*return*/, this.wrapper(HttpType.Post, "/user/delete_account", form)];
834
828
  });
835
829
  });
836
830
  };
@@ -842,7 +836,7 @@ var LemmyHttp = /** @class */ (function () {
842
836
  LemmyHttp.prototype.passwordReset = function (form) {
843
837
  return __awaiter(this, void 0, void 0, function () {
844
838
  return __generator(this, function (_a) {
845
- return [2 /*return*/, this.wrapper(HttpType.Post, "/user/password_reset", form, person_1.PasswordResetResponse)];
839
+ return [2 /*return*/, this.wrapper(HttpType.Post, "/user/password_reset", form)];
846
840
  });
847
841
  });
848
842
  };
@@ -854,7 +848,7 @@ var LemmyHttp = /** @class */ (function () {
854
848
  LemmyHttp.prototype.passwordChange = function (form) {
855
849
  return __awaiter(this, void 0, void 0, function () {
856
850
  return __generator(this, function (_a) {
857
- return [2 /*return*/, this.wrapper(HttpType.Post, "/user/password_change", form, person_1.LoginResponse)];
851
+ return [2 /*return*/, this.wrapper(HttpType.Post, "/user/password_change", form)];
858
852
  });
859
853
  });
860
854
  };
@@ -866,7 +860,7 @@ var LemmyHttp = /** @class */ (function () {
866
860
  LemmyHttp.prototype.markAllAsRead = function (form) {
867
861
  return __awaiter(this, void 0, void 0, function () {
868
862
  return __generator(this, function (_a) {
869
- return [2 /*return*/, this.wrapper(HttpType.Post, "/user/mark_all_as_read", form, person_1.GetRepliesResponse)];
863
+ return [2 /*return*/, this.wrapper(HttpType.Post, "/user/mark_all_as_read", form)];
870
864
  });
871
865
  });
872
866
  };
@@ -878,7 +872,7 @@ var LemmyHttp = /** @class */ (function () {
878
872
  LemmyHttp.prototype.saveUserSettings = function (form) {
879
873
  return __awaiter(this, void 0, void 0, function () {
880
874
  return __generator(this, function (_a) {
881
- return [2 /*return*/, this.wrapper(HttpType.Put, "/user/save_user_settings", form, person_1.LoginResponse)];
875
+ return [2 /*return*/, this.wrapper(HttpType.Put, "/user/save_user_settings", form)];
882
876
  });
883
877
  });
884
878
  };
@@ -890,7 +884,7 @@ var LemmyHttp = /** @class */ (function () {
890
884
  LemmyHttp.prototype.changePassword = function (form) {
891
885
  return __awaiter(this, void 0, void 0, function () {
892
886
  return __generator(this, function (_a) {
893
- return [2 /*return*/, this.wrapper(HttpType.Put, "/user/change_password", form, person_1.LoginResponse)];
887
+ return [2 /*return*/, this.wrapper(HttpType.Put, "/user/change_password", form)];
894
888
  });
895
889
  });
896
890
  };
@@ -902,7 +896,7 @@ var LemmyHttp = /** @class */ (function () {
902
896
  LemmyHttp.prototype.getReportCount = function (form) {
903
897
  return __awaiter(this, void 0, void 0, function () {
904
898
  return __generator(this, function (_a) {
905
- return [2 /*return*/, this.wrapper(HttpType.Get, "/user/report_count", form, person_1.GetReportCountResponse)];
899
+ return [2 /*return*/, this.wrapper(HttpType.Get, "/user/report_count", form)];
906
900
  });
907
901
  });
908
902
  };
@@ -914,7 +908,7 @@ var LemmyHttp = /** @class */ (function () {
914
908
  LemmyHttp.prototype.getUnreadCount = function (form) {
915
909
  return __awaiter(this, void 0, void 0, function () {
916
910
  return __generator(this, function (_a) {
917
- return [2 /*return*/, this.wrapper(HttpType.Get, "/user/unread_count", form, person_1.GetUnreadCountResponse)];
911
+ return [2 /*return*/, this.wrapper(HttpType.Get, "/user/unread_count", form)];
918
912
  });
919
913
  });
920
914
  };
@@ -926,7 +920,7 @@ var LemmyHttp = /** @class */ (function () {
926
920
  LemmyHttp.prototype.verifyEmail = function (form) {
927
921
  return __awaiter(this, void 0, void 0, function () {
928
922
  return __generator(this, function (_a) {
929
- return [2 /*return*/, this.wrapper(HttpType.Post, "/user/verify_email", form, person_1.VerifyEmailResponse)];
923
+ return [2 /*return*/, this.wrapper(HttpType.Post, "/user/verify_email", form)];
930
924
  });
931
925
  });
932
926
  };
@@ -938,7 +932,7 @@ var LemmyHttp = /** @class */ (function () {
938
932
  LemmyHttp.prototype.addAdmin = function (form) {
939
933
  return __awaiter(this, void 0, void 0, function () {
940
934
  return __generator(this, function (_a) {
941
- return [2 /*return*/, this.wrapper(HttpType.Post, "/admin/add", form, person_1.AddAdminResponse)];
935
+ return [2 /*return*/, this.wrapper(HttpType.Post, "/admin/add", form)];
942
936
  });
943
937
  });
944
938
  };
@@ -950,7 +944,7 @@ var LemmyHttp = /** @class */ (function () {
950
944
  LemmyHttp.prototype.getUnreadRegistrationApplicationCount = function (form) {
951
945
  return __awaiter(this, void 0, void 0, function () {
952
946
  return __generator(this, function (_a) {
953
- return [2 /*return*/, this.wrapper(HttpType.Get, "/admin/registration_application/count", form, site_1.GetUnreadRegistrationApplicationCountResponse)];
947
+ return [2 /*return*/, this.wrapper(HttpType.Get, "/admin/registration_application/count", form)];
954
948
  });
955
949
  });
956
950
  };
@@ -962,7 +956,7 @@ var LemmyHttp = /** @class */ (function () {
962
956
  LemmyHttp.prototype.listRegistrationApplications = function (form) {
963
957
  return __awaiter(this, void 0, void 0, function () {
964
958
  return __generator(this, function (_a) {
965
- return [2 /*return*/, this.wrapper(HttpType.Get, "/admin/registration_application/list", form, site_1.ListRegistrationApplicationsResponse)];
959
+ return [2 /*return*/, this.wrapper(HttpType.Get, "/admin/registration_application/list", form)];
966
960
  });
967
961
  });
968
962
  };
@@ -974,7 +968,7 @@ var LemmyHttp = /** @class */ (function () {
974
968
  LemmyHttp.prototype.approveRegistrationApplication = function (form) {
975
969
  return __awaiter(this, void 0, void 0, function () {
976
970
  return __generator(this, function (_a) {
977
- return [2 /*return*/, this.wrapper(HttpType.Put, "/admin/registration_application/approve", form, site_1.RegistrationApplicationResponse)];
971
+ return [2 /*return*/, this.wrapper(HttpType.Put, "/admin/registration_application/approve", form)];
978
972
  });
979
973
  });
980
974
  };
@@ -986,7 +980,7 @@ var LemmyHttp = /** @class */ (function () {
986
980
  LemmyHttp.prototype.purgePerson = function (form) {
987
981
  return __awaiter(this, void 0, void 0, function () {
988
982
  return __generator(this, function (_a) {
989
- return [2 /*return*/, this.wrapper(HttpType.Post, "/admin/purge/person", form, site_1.PurgeItemResponse)];
983
+ return [2 /*return*/, this.wrapper(HttpType.Post, "/admin/purge/person", form)];
990
984
  });
991
985
  });
992
986
  };
@@ -998,7 +992,7 @@ var LemmyHttp = /** @class */ (function () {
998
992
  LemmyHttp.prototype.purgeCommunity = function (form) {
999
993
  return __awaiter(this, void 0, void 0, function () {
1000
994
  return __generator(this, function (_a) {
1001
- return [2 /*return*/, this.wrapper(HttpType.Post, "/admin/purge/community", form, site_1.PurgeItemResponse)];
995
+ return [2 /*return*/, this.wrapper(HttpType.Post, "/admin/purge/community", form)];
1002
996
  });
1003
997
  });
1004
998
  };
@@ -1010,7 +1004,7 @@ var LemmyHttp = /** @class */ (function () {
1010
1004
  LemmyHttp.prototype.purgePost = function (form) {
1011
1005
  return __awaiter(this, void 0, void 0, function () {
1012
1006
  return __generator(this, function (_a) {
1013
- return [2 /*return*/, this.wrapper(HttpType.Post, "/admin/purge/post", form, site_1.PurgeItemResponse)];
1007
+ return [2 /*return*/, this.wrapper(HttpType.Post, "/admin/purge/post", form)];
1014
1008
  });
1015
1009
  });
1016
1010
  };
@@ -1022,14 +1016,14 @@ var LemmyHttp = /** @class */ (function () {
1022
1016
  LemmyHttp.prototype.purgeComment = function (form) {
1023
1017
  return __awaiter(this, void 0, void 0, function () {
1024
1018
  return __generator(this, function (_a) {
1025
- return [2 /*return*/, this.wrapper(HttpType.Post, "/admin/purge/comment", form, site_1.PurgeItemResponse)];
1019
+ return [2 /*return*/, this.wrapper(HttpType.Post, "/admin/purge/comment", form)];
1026
1020
  });
1027
1021
  });
1028
1022
  };
1029
1023
  LemmyHttp.prototype.buildFullUrl = function (endpoint) {
1030
1024
  return "".concat(this.apiUrl).concat(endpoint);
1031
1025
  };
1032
- LemmyHttp.prototype.wrapper = function (type_, endpoint, form, responseClass) {
1026
+ LemmyHttp.prototype.wrapper = function (type_, endpoint, form) {
1033
1027
  return __awaiter(this, void 0, void 0, function () {
1034
1028
  var getUrl;
1035
1029
  return __generator(this, function (_a) {
@@ -1038,22 +1032,14 @@ var LemmyHttp = /** @class */ (function () {
1038
1032
  return [2 /*return*/, (0, node_fetch_1.default)(getUrl, {
1039
1033
  method: "GET",
1040
1034
  headers: this.headers,
1041
- }).then(function (d) {
1042
- return d
1043
- .text()
1044
- .then(function (a) { return (0, class_transformer_1.deserialize)(responseClass, a); });
1045
- })];
1035
+ }).then(function (d) { return d.json(); })];
1046
1036
  }
1047
1037
  else {
1048
1038
  return [2 /*return*/, (0, node_fetch_1.default)(this.buildFullUrl(endpoint), {
1049
1039
  method: type_,
1050
1040
  headers: __assign({ "Content-Type": "application/json" }, this.headers),
1051
- body: (0, class_transformer_1.serialize)(form),
1052
- }).then(function (d) {
1053
- return d
1054
- .text()
1055
- .then(function (a) { return (0, class_transformer_1.deserialize)(responseClass, a); });
1056
- })];
1041
+ body: JSON.stringify(form),
1042
+ }).then(function (d) { return d.json(); })];
1057
1043
  }
1058
1044
  return [2 /*return*/];
1059
1045
  });
@@ -1063,9 +1049,8 @@ var LemmyHttp = /** @class */ (function () {
1063
1049
  }());
1064
1050
  exports.LemmyHttp = LemmyHttp;
1065
1051
  function encodeGetParams(p) {
1066
- // Necessary to remove the Options
1067
- var serialized = JSON.parse((0, class_transformer_1.serialize)(p));
1068
- return Object.entries(serialized)
1052
+ return Object.entries(p)
1053
+ .filter(function (kv) { return !!kv[1]; })
1069
1054
  .map(function (kv) { return kv.map(encodeURIComponent).join("="); })
1070
1055
  .join("&");
1071
1056
  }