lemmy-js-client 0.17.0-rc.4 → 0.17.0-rc.42

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,2 +1,601 @@
1
1
  "use strict";
2
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
6
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
7
+ };
2
8
  Object.defineProperty(exports, "__esModule", { value: true });
9
+ exports.RegistrationApplicationView = exports.CommunityView = exports.PersonBlockView = exports.CommunityPersonBanView = exports.CommunityModeratorView = exports.CommunityBlockView = exports.CommunityFollowerView = exports.AdminPurgeCommentView = exports.AdminPurgePostView = exports.AdminPurgePersonView = exports.AdminPurgeCommunityView = exports.ModStickyPostView = exports.ModRemovePostView = exports.ModRemoveCommunityView = exports.ModRemoveCommentView = exports.ModLockPostView = exports.ModBanView = exports.ModBanFromCommunityView = exports.ModAddView = exports.ModTransferCommunityView = exports.ModAddCommunityView = exports.CommentReportView = exports.CommentReplyView = exports.CommentView = exports.PostReportView = exports.PostView = exports.PrivateMessageView = exports.SiteView = exports.LocalUserSettingsView = exports.PersonMentionView = exports.PersonViewSafe = void 0;
10
+ var class_transformer_1 = require("class-transformer");
11
+ require("reflect-metadata");
12
+ var utils_1 = require("../utils");
13
+ var source_1 = require("./source");
14
+ var PersonViewSafe = /** @class */ (function () {
15
+ function PersonViewSafe() {
16
+ }
17
+ __decorate([
18
+ (0, class_transformer_1.Type)(function () { return source_1.PersonSafe; })
19
+ ], PersonViewSafe.prototype, "person", void 0);
20
+ return PersonViewSafe;
21
+ }());
22
+ exports.PersonViewSafe = PersonViewSafe;
23
+ var PersonMentionView = /** @class */ (function () {
24
+ function PersonMentionView() {
25
+ }
26
+ __decorate([
27
+ (0, class_transformer_1.Type)(function () { return source_1.PersonMention; })
28
+ ], PersonMentionView.prototype, "person_mention", void 0);
29
+ __decorate([
30
+ (0, class_transformer_1.Type)(function () { return source_1.Comment; })
31
+ ], PersonMentionView.prototype, "comment", void 0);
32
+ __decorate([
33
+ (0, class_transformer_1.Type)(function () { return source_1.PersonSafe; })
34
+ ], PersonMentionView.prototype, "creator", void 0);
35
+ __decorate([
36
+ (0, class_transformer_1.Type)(function () { return source_1.Post; })
37
+ ], PersonMentionView.prototype, "post", void 0);
38
+ __decorate([
39
+ (0, class_transformer_1.Type)(function () { return source_1.CommunitySafe; })
40
+ ], PersonMentionView.prototype, "community", void 0);
41
+ __decorate([
42
+ (0, class_transformer_1.Type)(function () { return source_1.PersonSafe; })
43
+ ], PersonMentionView.prototype, "recipient", void 0);
44
+ __decorate([
45
+ (0, class_transformer_1.Transform)(function (_a) {
46
+ var value = _a.value;
47
+ return (0, utils_1.toOption)(value);
48
+ }, { toClassOnly: true }),
49
+ (0, class_transformer_1.Transform)(function (_a) {
50
+ var value = _a.value;
51
+ return (0, utils_1.toUndefined)(value);
52
+ }, { toPlainOnly: true }),
53
+ (0, class_transformer_1.Expose)()
54
+ ], PersonMentionView.prototype, "my_vote", void 0);
55
+ return PersonMentionView;
56
+ }());
57
+ exports.PersonMentionView = PersonMentionView;
58
+ var LocalUserSettingsView = /** @class */ (function () {
59
+ function LocalUserSettingsView() {
60
+ }
61
+ __decorate([
62
+ (0, class_transformer_1.Type)(function () { return source_1.LocalUserSettings; })
63
+ ], LocalUserSettingsView.prototype, "local_user", void 0);
64
+ __decorate([
65
+ (0, class_transformer_1.Type)(function () { return source_1.PersonSafe; })
66
+ ], LocalUserSettingsView.prototype, "person", void 0);
67
+ return LocalUserSettingsView;
68
+ }());
69
+ exports.LocalUserSettingsView = LocalUserSettingsView;
70
+ var SiteView = /** @class */ (function () {
71
+ function SiteView() {
72
+ }
73
+ __decorate([
74
+ (0, class_transformer_1.Type)(function () { return source_1.Site; })
75
+ ], SiteView.prototype, "site", void 0);
76
+ return SiteView;
77
+ }());
78
+ exports.SiteView = SiteView;
79
+ var PrivateMessageView = /** @class */ (function () {
80
+ function PrivateMessageView() {
81
+ }
82
+ __decorate([
83
+ (0, class_transformer_1.Type)(function () { return source_1.PrivateMessage; })
84
+ ], PrivateMessageView.prototype, "private_message", void 0);
85
+ __decorate([
86
+ (0, class_transformer_1.Type)(function () { return source_1.PersonSafe; })
87
+ ], PrivateMessageView.prototype, "creator", void 0);
88
+ __decorate([
89
+ (0, class_transformer_1.Type)(function () { return source_1.PersonSafe; })
90
+ ], PrivateMessageView.prototype, "recipient", void 0);
91
+ return PrivateMessageView;
92
+ }());
93
+ exports.PrivateMessageView = PrivateMessageView;
94
+ var PostView = /** @class */ (function () {
95
+ function PostView() {
96
+ }
97
+ __decorate([
98
+ (0, class_transformer_1.Type)(function () { return source_1.Post; })
99
+ ], PostView.prototype, "post", void 0);
100
+ __decorate([
101
+ (0, class_transformer_1.Type)(function () { return source_1.PersonSafe; })
102
+ ], PostView.prototype, "creator", void 0);
103
+ __decorate([
104
+ (0, class_transformer_1.Type)(function () { return source_1.CommunitySafe; })
105
+ ], PostView.prototype, "community", void 0);
106
+ __decorate([
107
+ (0, class_transformer_1.Transform)(function (_a) {
108
+ var value = _a.value;
109
+ return (0, utils_1.toOption)(value);
110
+ }, { toClassOnly: true }),
111
+ (0, class_transformer_1.Transform)(function (_a) {
112
+ var value = _a.value;
113
+ return (0, utils_1.toUndefined)(value);
114
+ }, { toPlainOnly: true }),
115
+ (0, class_transformer_1.Expose)()
116
+ ], PostView.prototype, "my_vote", void 0);
117
+ return PostView;
118
+ }());
119
+ exports.PostView = PostView;
120
+ var PostReportView = /** @class */ (function () {
121
+ function PostReportView() {
122
+ }
123
+ __decorate([
124
+ (0, class_transformer_1.Type)(function () { return source_1.PostReport; })
125
+ ], PostReportView.prototype, "post_report", void 0);
126
+ __decorate([
127
+ (0, class_transformer_1.Type)(function () { return source_1.Post; })
128
+ ], PostReportView.prototype, "post", void 0);
129
+ __decorate([
130
+ (0, class_transformer_1.Type)(function () { return source_1.CommunitySafe; })
131
+ ], PostReportView.prototype, "community", void 0);
132
+ __decorate([
133
+ (0, class_transformer_1.Type)(function () { return source_1.PersonSafe; })
134
+ ], PostReportView.prototype, "creator", void 0);
135
+ __decorate([
136
+ (0, class_transformer_1.Type)(function () { return source_1.PersonSafe; })
137
+ ], PostReportView.prototype, "post_creator", void 0);
138
+ __decorate([
139
+ (0, class_transformer_1.Transform)(function (_a) {
140
+ var value = _a.value;
141
+ return (0, utils_1.toOption)(value);
142
+ }, { toClassOnly: true }),
143
+ (0, class_transformer_1.Transform)(function (_a) {
144
+ var value = _a.value;
145
+ return (0, utils_1.toUndefined)(value);
146
+ }, { toPlainOnly: true }),
147
+ (0, class_transformer_1.Expose)()
148
+ ], PostReportView.prototype, "my_vote", void 0);
149
+ __decorate([
150
+ (0, class_transformer_1.Transform)(function (_a) {
151
+ var value = _a.value;
152
+ return (0, utils_1.toOption)(value);
153
+ }, { toClassOnly: true }),
154
+ (0, class_transformer_1.Transform)(function (_a) {
155
+ var value = _a.value;
156
+ return (0, utils_1.toUndefined)(value);
157
+ }, { toPlainOnly: true }),
158
+ (0, class_transformer_1.Expose)(),
159
+ (0, class_transformer_1.Type)(function () { return source_1.PersonSafe; })
160
+ ], PostReportView.prototype, "resolver", void 0);
161
+ return PostReportView;
162
+ }());
163
+ exports.PostReportView = PostReportView;
164
+ var CommentView = /** @class */ (function () {
165
+ function CommentView() {
166
+ }
167
+ __decorate([
168
+ (0, class_transformer_1.Type)(function () { return source_1.Comment; })
169
+ ], CommentView.prototype, "comment", void 0);
170
+ __decorate([
171
+ (0, class_transformer_1.Type)(function () { return source_1.PersonSafe; })
172
+ ], CommentView.prototype, "creator", void 0);
173
+ __decorate([
174
+ (0, class_transformer_1.Type)(function () { return source_1.Post; })
175
+ ], CommentView.prototype, "post", void 0);
176
+ __decorate([
177
+ (0, class_transformer_1.Type)(function () { return source_1.CommunitySafe; })
178
+ ], CommentView.prototype, "community", void 0);
179
+ __decorate([
180
+ (0, class_transformer_1.Transform)(function (_a) {
181
+ var value = _a.value;
182
+ return (0, utils_1.toOption)(value);
183
+ }, { toClassOnly: true }),
184
+ (0, class_transformer_1.Transform)(function (_a) {
185
+ var value = _a.value;
186
+ return (0, utils_1.toUndefined)(value);
187
+ }, { toPlainOnly: true }),
188
+ (0, class_transformer_1.Expose)()
189
+ ], CommentView.prototype, "my_vote", void 0);
190
+ return CommentView;
191
+ }());
192
+ exports.CommentView = CommentView;
193
+ var CommentReplyView = /** @class */ (function () {
194
+ function CommentReplyView() {
195
+ }
196
+ __decorate([
197
+ (0, class_transformer_1.Type)(function () { return source_1.CommentReply; })
198
+ ], CommentReplyView.prototype, "comment_reply", void 0);
199
+ __decorate([
200
+ (0, class_transformer_1.Type)(function () { return source_1.Comment; })
201
+ ], CommentReplyView.prototype, "comment", void 0);
202
+ __decorate([
203
+ (0, class_transformer_1.Type)(function () { return source_1.PersonSafe; })
204
+ ], CommentReplyView.prototype, "creator", void 0);
205
+ __decorate([
206
+ (0, class_transformer_1.Type)(function () { return source_1.Post; })
207
+ ], CommentReplyView.prototype, "post", void 0);
208
+ __decorate([
209
+ (0, class_transformer_1.Type)(function () { return source_1.CommunitySafe; })
210
+ ], CommentReplyView.prototype, "community", void 0);
211
+ __decorate([
212
+ (0, class_transformer_1.Type)(function () { return source_1.PersonSafe; })
213
+ ], CommentReplyView.prototype, "recipient", void 0);
214
+ __decorate([
215
+ (0, class_transformer_1.Transform)(function (_a) {
216
+ var value = _a.value;
217
+ return (0, utils_1.toOption)(value);
218
+ }, { toClassOnly: true }),
219
+ (0, class_transformer_1.Transform)(function (_a) {
220
+ var value = _a.value;
221
+ return (0, utils_1.toUndefined)(value);
222
+ }, { toPlainOnly: true }),
223
+ (0, class_transformer_1.Expose)()
224
+ ], CommentReplyView.prototype, "my_vote", void 0);
225
+ return CommentReplyView;
226
+ }());
227
+ exports.CommentReplyView = CommentReplyView;
228
+ var CommentReportView = /** @class */ (function () {
229
+ function CommentReportView() {
230
+ }
231
+ __decorate([
232
+ (0, class_transformer_1.Type)(function () { return source_1.CommentReport; })
233
+ ], CommentReportView.prototype, "comment_report", void 0);
234
+ __decorate([
235
+ (0, class_transformer_1.Type)(function () { return source_1.Comment; })
236
+ ], CommentReportView.prototype, "comment", void 0);
237
+ __decorate([
238
+ (0, class_transformer_1.Type)(function () { return source_1.Post; })
239
+ ], CommentReportView.prototype, "post", void 0);
240
+ __decorate([
241
+ (0, class_transformer_1.Type)(function () { return source_1.CommunitySafe; })
242
+ ], CommentReportView.prototype, "community", void 0);
243
+ __decorate([
244
+ (0, class_transformer_1.Type)(function () { return source_1.PersonSafe; })
245
+ ], CommentReportView.prototype, "creator", void 0);
246
+ __decorate([
247
+ (0, class_transformer_1.Type)(function () { return source_1.PersonSafe; })
248
+ ], CommentReportView.prototype, "comment_creator", void 0);
249
+ __decorate([
250
+ (0, class_transformer_1.Transform)(function (_a) {
251
+ var value = _a.value;
252
+ return (0, utils_1.toOption)(value);
253
+ }, { toClassOnly: true }),
254
+ (0, class_transformer_1.Transform)(function (_a) {
255
+ var value = _a.value;
256
+ return (0, utils_1.toUndefined)(value);
257
+ }, { toPlainOnly: true }),
258
+ (0, class_transformer_1.Expose)()
259
+ ], CommentReportView.prototype, "my_vote", void 0);
260
+ __decorate([
261
+ (0, class_transformer_1.Transform)(function (_a) {
262
+ var value = _a.value;
263
+ return (0, utils_1.toOption)(value);
264
+ }, { toClassOnly: true }),
265
+ (0, class_transformer_1.Transform)(function (_a) {
266
+ var value = _a.value;
267
+ return (0, utils_1.toUndefined)(value);
268
+ }, { toPlainOnly: true }),
269
+ (0, class_transformer_1.Expose)(),
270
+ (0, class_transformer_1.Type)(function () { return source_1.PersonSafe; })
271
+ ], CommentReportView.prototype, "resolver", void 0);
272
+ return CommentReportView;
273
+ }());
274
+ exports.CommentReportView = CommentReportView;
275
+ var ModAddCommunityView = /** @class */ (function () {
276
+ function ModAddCommunityView() {
277
+ }
278
+ __decorate([
279
+ (0, class_transformer_1.Type)(function () { return source_1.ModAddCommunity; })
280
+ ], ModAddCommunityView.prototype, "mod_add_community", void 0);
281
+ __decorate([
282
+ (0, class_transformer_1.Type)(function () { return source_1.PersonSafe; })
283
+ ], ModAddCommunityView.prototype, "moderator", void 0);
284
+ __decorate([
285
+ (0, class_transformer_1.Type)(function () { return source_1.CommunitySafe; })
286
+ ], ModAddCommunityView.prototype, "community", void 0);
287
+ __decorate([
288
+ (0, class_transformer_1.Type)(function () { return source_1.PersonSafe; })
289
+ ], ModAddCommunityView.prototype, "modded_person", void 0);
290
+ return ModAddCommunityView;
291
+ }());
292
+ exports.ModAddCommunityView = ModAddCommunityView;
293
+ var ModTransferCommunityView = /** @class */ (function () {
294
+ function ModTransferCommunityView() {
295
+ }
296
+ __decorate([
297
+ (0, class_transformer_1.Type)(function () { return source_1.ModTransferCommunity; })
298
+ ], ModTransferCommunityView.prototype, "mod_transfer_community", void 0);
299
+ __decorate([
300
+ (0, class_transformer_1.Type)(function () { return source_1.PersonSafe; })
301
+ ], ModTransferCommunityView.prototype, "moderator", void 0);
302
+ __decorate([
303
+ (0, class_transformer_1.Type)(function () { return source_1.CommunitySafe; })
304
+ ], ModTransferCommunityView.prototype, "community", void 0);
305
+ __decorate([
306
+ (0, class_transformer_1.Type)(function () { return source_1.PersonSafe; })
307
+ ], ModTransferCommunityView.prototype, "modded_person", void 0);
308
+ return ModTransferCommunityView;
309
+ }());
310
+ exports.ModTransferCommunityView = ModTransferCommunityView;
311
+ var ModAddView = /** @class */ (function () {
312
+ function ModAddView() {
313
+ }
314
+ __decorate([
315
+ (0, class_transformer_1.Type)(function () { return source_1.ModAdd; })
316
+ ], ModAddView.prototype, "mod_add", void 0);
317
+ __decorate([
318
+ (0, class_transformer_1.Type)(function () { return source_1.PersonSafe; })
319
+ ], ModAddView.prototype, "moderator", void 0);
320
+ __decorate([
321
+ (0, class_transformer_1.Type)(function () { return source_1.PersonSafe; })
322
+ ], ModAddView.prototype, "modded_person", void 0);
323
+ return ModAddView;
324
+ }());
325
+ exports.ModAddView = ModAddView;
326
+ var ModBanFromCommunityView = /** @class */ (function () {
327
+ function ModBanFromCommunityView() {
328
+ }
329
+ __decorate([
330
+ (0, class_transformer_1.Type)(function () { return source_1.ModBanFromCommunity; })
331
+ ], ModBanFromCommunityView.prototype, "mod_ban_from_community", void 0);
332
+ __decorate([
333
+ (0, class_transformer_1.Type)(function () { return source_1.PersonSafe; })
334
+ ], ModBanFromCommunityView.prototype, "moderator", void 0);
335
+ __decorate([
336
+ (0, class_transformer_1.Type)(function () { return source_1.CommunitySafe; })
337
+ ], ModBanFromCommunityView.prototype, "community", void 0);
338
+ __decorate([
339
+ (0, class_transformer_1.Type)(function () { return source_1.PersonSafe; })
340
+ ], ModBanFromCommunityView.prototype, "banned_person", void 0);
341
+ return ModBanFromCommunityView;
342
+ }());
343
+ exports.ModBanFromCommunityView = ModBanFromCommunityView;
344
+ var ModBanView = /** @class */ (function () {
345
+ function ModBanView() {
346
+ }
347
+ __decorate([
348
+ (0, class_transformer_1.Type)(function () { return source_1.ModBan; })
349
+ ], ModBanView.prototype, "mod_ban", void 0);
350
+ __decorate([
351
+ (0, class_transformer_1.Type)(function () { return source_1.PersonSafe; })
352
+ ], ModBanView.prototype, "moderator", void 0);
353
+ __decorate([
354
+ (0, class_transformer_1.Type)(function () { return source_1.PersonSafe; })
355
+ ], ModBanView.prototype, "banned_person", void 0);
356
+ return ModBanView;
357
+ }());
358
+ exports.ModBanView = ModBanView;
359
+ var ModLockPostView = /** @class */ (function () {
360
+ function ModLockPostView() {
361
+ }
362
+ __decorate([
363
+ (0, class_transformer_1.Type)(function () { return source_1.ModLockPost; })
364
+ ], ModLockPostView.prototype, "mod_lock_post", void 0);
365
+ __decorate([
366
+ (0, class_transformer_1.Type)(function () { return source_1.PersonSafe; })
367
+ ], ModLockPostView.prototype, "moderator", void 0);
368
+ __decorate([
369
+ (0, class_transformer_1.Type)(function () { return source_1.Post; })
370
+ ], ModLockPostView.prototype, "post", void 0);
371
+ __decorate([
372
+ (0, class_transformer_1.Type)(function () { return source_1.CommunitySafe; })
373
+ ], ModLockPostView.prototype, "community", void 0);
374
+ return ModLockPostView;
375
+ }());
376
+ exports.ModLockPostView = ModLockPostView;
377
+ var ModRemoveCommentView = /** @class */ (function () {
378
+ function ModRemoveCommentView() {
379
+ }
380
+ __decorate([
381
+ (0, class_transformer_1.Type)(function () { return source_1.ModRemoveComment; })
382
+ ], ModRemoveCommentView.prototype, "mod_remove_comment", void 0);
383
+ __decorate([
384
+ (0, class_transformer_1.Type)(function () { return source_1.PersonSafe; })
385
+ ], ModRemoveCommentView.prototype, "moderator", void 0);
386
+ __decorate([
387
+ (0, class_transformer_1.Type)(function () { return source_1.Comment; })
388
+ ], ModRemoveCommentView.prototype, "comment", void 0);
389
+ __decorate([
390
+ (0, class_transformer_1.Type)(function () { return source_1.PersonSafe; })
391
+ ], ModRemoveCommentView.prototype, "commenter", void 0);
392
+ __decorate([
393
+ (0, class_transformer_1.Type)(function () { return source_1.Post; })
394
+ ], ModRemoveCommentView.prototype, "post", void 0);
395
+ __decorate([
396
+ (0, class_transformer_1.Type)(function () { return source_1.CommunitySafe; })
397
+ ], ModRemoveCommentView.prototype, "community", void 0);
398
+ return ModRemoveCommentView;
399
+ }());
400
+ exports.ModRemoveCommentView = ModRemoveCommentView;
401
+ var ModRemoveCommunityView = /** @class */ (function () {
402
+ function ModRemoveCommunityView() {
403
+ }
404
+ __decorate([
405
+ (0, class_transformer_1.Type)(function () { return source_1.ModRemoveCommunity; })
406
+ ], ModRemoveCommunityView.prototype, "mod_remove_community", void 0);
407
+ __decorate([
408
+ (0, class_transformer_1.Type)(function () { return source_1.PersonSafe; })
409
+ ], ModRemoveCommunityView.prototype, "moderator", void 0);
410
+ __decorate([
411
+ (0, class_transformer_1.Type)(function () { return source_1.CommunitySafe; })
412
+ ], ModRemoveCommunityView.prototype, "community", void 0);
413
+ return ModRemoveCommunityView;
414
+ }());
415
+ exports.ModRemoveCommunityView = ModRemoveCommunityView;
416
+ var ModRemovePostView = /** @class */ (function () {
417
+ function ModRemovePostView() {
418
+ }
419
+ __decorate([
420
+ (0, class_transformer_1.Type)(function () { return source_1.ModRemovePost; })
421
+ ], ModRemovePostView.prototype, "mod_remove_post", void 0);
422
+ __decorate([
423
+ (0, class_transformer_1.Type)(function () { return source_1.PersonSafe; })
424
+ ], ModRemovePostView.prototype, "moderator", void 0);
425
+ __decorate([
426
+ (0, class_transformer_1.Type)(function () { return source_1.Post; })
427
+ ], ModRemovePostView.prototype, "post", void 0);
428
+ __decorate([
429
+ (0, class_transformer_1.Type)(function () { return source_1.CommunitySafe; })
430
+ ], ModRemovePostView.prototype, "community", void 0);
431
+ return ModRemovePostView;
432
+ }());
433
+ exports.ModRemovePostView = ModRemovePostView;
434
+ var ModStickyPostView = /** @class */ (function () {
435
+ function ModStickyPostView() {
436
+ }
437
+ __decorate([
438
+ (0, class_transformer_1.Type)(function () { return source_1.ModStickyPost; })
439
+ ], ModStickyPostView.prototype, "mod_sticky_post", void 0);
440
+ __decorate([
441
+ (0, class_transformer_1.Type)(function () { return source_1.PersonSafe; })
442
+ ], ModStickyPostView.prototype, "moderator", void 0);
443
+ __decorate([
444
+ (0, class_transformer_1.Type)(function () { return source_1.Post; })
445
+ ], ModStickyPostView.prototype, "post", void 0);
446
+ __decorate([
447
+ (0, class_transformer_1.Type)(function () { return source_1.CommunitySafe; })
448
+ ], ModStickyPostView.prototype, "community", void 0);
449
+ return ModStickyPostView;
450
+ }());
451
+ exports.ModStickyPostView = ModStickyPostView;
452
+ var AdminPurgeCommunityView = /** @class */ (function () {
453
+ function AdminPurgeCommunityView() {
454
+ }
455
+ __decorate([
456
+ (0, class_transformer_1.Type)(function () { return source_1.AdminPurgeCommunity; })
457
+ ], AdminPurgeCommunityView.prototype, "admin_purge_community", void 0);
458
+ __decorate([
459
+ (0, class_transformer_1.Type)(function () { return source_1.PersonSafe; })
460
+ ], AdminPurgeCommunityView.prototype, "admin", void 0);
461
+ return AdminPurgeCommunityView;
462
+ }());
463
+ exports.AdminPurgeCommunityView = AdminPurgeCommunityView;
464
+ var AdminPurgePersonView = /** @class */ (function () {
465
+ function AdminPurgePersonView() {
466
+ }
467
+ __decorate([
468
+ (0, class_transformer_1.Type)(function () { return source_1.AdminPurgePerson; })
469
+ ], AdminPurgePersonView.prototype, "admin_purge_person", void 0);
470
+ __decorate([
471
+ (0, class_transformer_1.Type)(function () { return source_1.PersonSafe; })
472
+ ], AdminPurgePersonView.prototype, "admin", void 0);
473
+ return AdminPurgePersonView;
474
+ }());
475
+ exports.AdminPurgePersonView = AdminPurgePersonView;
476
+ var AdminPurgePostView = /** @class */ (function () {
477
+ function AdminPurgePostView() {
478
+ }
479
+ __decorate([
480
+ (0, class_transformer_1.Type)(function () { return source_1.AdminPurgePost; })
481
+ ], AdminPurgePostView.prototype, "admin_purge_post", void 0);
482
+ __decorate([
483
+ (0, class_transformer_1.Type)(function () { return source_1.PersonSafe; })
484
+ ], AdminPurgePostView.prototype, "admin", void 0);
485
+ __decorate([
486
+ (0, class_transformer_1.Type)(function () { return source_1.CommunitySafe; })
487
+ ], AdminPurgePostView.prototype, "community", void 0);
488
+ return AdminPurgePostView;
489
+ }());
490
+ exports.AdminPurgePostView = AdminPurgePostView;
491
+ var AdminPurgeCommentView = /** @class */ (function () {
492
+ function AdminPurgeCommentView() {
493
+ }
494
+ __decorate([
495
+ (0, class_transformer_1.Type)(function () { return source_1.AdminPurgeComment; })
496
+ ], AdminPurgeCommentView.prototype, "admin_purge_comment", void 0);
497
+ __decorate([
498
+ (0, class_transformer_1.Type)(function () { return source_1.PersonSafe; })
499
+ ], AdminPurgeCommentView.prototype, "admin", void 0);
500
+ __decorate([
501
+ (0, class_transformer_1.Type)(function () { return source_1.Post; })
502
+ ], AdminPurgeCommentView.prototype, "post", void 0);
503
+ return AdminPurgeCommentView;
504
+ }());
505
+ exports.AdminPurgeCommentView = AdminPurgeCommentView;
506
+ var CommunityFollowerView = /** @class */ (function () {
507
+ function CommunityFollowerView() {
508
+ }
509
+ __decorate([
510
+ (0, class_transformer_1.Type)(function () { return source_1.CommunitySafe; })
511
+ ], CommunityFollowerView.prototype, "community", void 0);
512
+ __decorate([
513
+ (0, class_transformer_1.Type)(function () { return source_1.PersonSafe; })
514
+ ], CommunityFollowerView.prototype, "follower", void 0);
515
+ return CommunityFollowerView;
516
+ }());
517
+ exports.CommunityFollowerView = CommunityFollowerView;
518
+ var CommunityBlockView = /** @class */ (function () {
519
+ function CommunityBlockView() {
520
+ }
521
+ __decorate([
522
+ (0, class_transformer_1.Type)(function () { return source_1.PersonSafe; })
523
+ ], CommunityBlockView.prototype, "person", void 0);
524
+ __decorate([
525
+ (0, class_transformer_1.Type)(function () { return source_1.CommunitySafe; })
526
+ ], CommunityBlockView.prototype, "community", void 0);
527
+ return CommunityBlockView;
528
+ }());
529
+ exports.CommunityBlockView = CommunityBlockView;
530
+ var CommunityModeratorView = /** @class */ (function () {
531
+ function CommunityModeratorView() {
532
+ }
533
+ __decorate([
534
+ (0, class_transformer_1.Type)(function () { return source_1.CommunitySafe; })
535
+ ], CommunityModeratorView.prototype, "community", void 0);
536
+ __decorate([
537
+ (0, class_transformer_1.Type)(function () { return source_1.PersonSafe; })
538
+ ], CommunityModeratorView.prototype, "moderator", void 0);
539
+ return CommunityModeratorView;
540
+ }());
541
+ exports.CommunityModeratorView = CommunityModeratorView;
542
+ var CommunityPersonBanView = /** @class */ (function () {
543
+ function CommunityPersonBanView() {
544
+ }
545
+ __decorate([
546
+ (0, class_transformer_1.Type)(function () { return source_1.CommunitySafe; })
547
+ ], CommunityPersonBanView.prototype, "community", void 0);
548
+ __decorate([
549
+ (0, class_transformer_1.Type)(function () { return source_1.PersonSafe; })
550
+ ], CommunityPersonBanView.prototype, "person", void 0);
551
+ return CommunityPersonBanView;
552
+ }());
553
+ exports.CommunityPersonBanView = CommunityPersonBanView;
554
+ var PersonBlockView = /** @class */ (function () {
555
+ function PersonBlockView() {
556
+ }
557
+ __decorate([
558
+ (0, class_transformer_1.Type)(function () { return source_1.PersonSafe; })
559
+ ], PersonBlockView.prototype, "person", void 0);
560
+ __decorate([
561
+ (0, class_transformer_1.Type)(function () { return source_1.PersonSafe; })
562
+ ], PersonBlockView.prototype, "target", void 0);
563
+ return PersonBlockView;
564
+ }());
565
+ exports.PersonBlockView = PersonBlockView;
566
+ var CommunityView = /** @class */ (function () {
567
+ function CommunityView() {
568
+ }
569
+ __decorate([
570
+ (0, class_transformer_1.Type)(function () { return source_1.CommunitySafe; })
571
+ ], CommunityView.prototype, "community", void 0);
572
+ return CommunityView;
573
+ }());
574
+ exports.CommunityView = CommunityView;
575
+ var RegistrationApplicationView = /** @class */ (function () {
576
+ function RegistrationApplicationView() {
577
+ }
578
+ __decorate([
579
+ (0, class_transformer_1.Type)(function () { return source_1.RegistrationApplication; })
580
+ ], RegistrationApplicationView.prototype, "registration_application", void 0);
581
+ __decorate([
582
+ (0, class_transformer_1.Type)(function () { return source_1.LocalUserSettings; })
583
+ ], RegistrationApplicationView.prototype, "creator_local_user", void 0);
584
+ __decorate([
585
+ (0, class_transformer_1.Type)(function () { return source_1.PersonSafe; })
586
+ ], RegistrationApplicationView.prototype, "creator", void 0);
587
+ __decorate([
588
+ (0, class_transformer_1.Transform)(function (_a) {
589
+ var value = _a.value;
590
+ return (0, utils_1.toOption)(value);
591
+ }, { toClassOnly: true }),
592
+ (0, class_transformer_1.Transform)(function (_a) {
593
+ var value = _a.value;
594
+ return (0, utils_1.toUndefined)(value);
595
+ }, { toPlainOnly: true }),
596
+ (0, class_transformer_1.Expose)(),
597
+ (0, class_transformer_1.Type)(function () { return source_1.PersonSafe; })
598
+ ], RegistrationApplicationView.prototype, "admin", void 0);
599
+ return RegistrationApplicationView;
600
+ }());
601
+ exports.RegistrationApplicationView = RegistrationApplicationView;
@@ -0,0 +1,9 @@
1
+ import { Option } from "@sniptt/monads";
2
+ /**
3
+ * Converts an option to an undefined. Necessary for API requests.
4
+ */
5
+ export declare function toUndefined<T>(opt: Option<T>): T;
6
+ /**
7
+ * Converts a null value to an option.
8
+ */
9
+ export declare function toOption<T>(val: T): Option<T>;
package/dist/utils.js ADDED
@@ -0,0 +1,18 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.toOption = exports.toUndefined = void 0;
4
+ var monads_1 = require("@sniptt/monads");
5
+ /**
6
+ * Converts an option to an undefined. Necessary for API requests.
7
+ */
8
+ function toUndefined(opt) {
9
+ return opt.isSome() ? opt.unwrap() : undefined;
10
+ }
11
+ exports.toUndefined = toUndefined;
12
+ /**
13
+ * Converts a null value to an option.
14
+ */
15
+ function toOption(val) {
16
+ return (0, monads_1.Some)(val || undefined);
17
+ }
18
+ exports.toOption = toOption;