lemmy-js-client 0.17.2-rc.21 → 0.17.2-rc.24

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/websocket.js CHANGED
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.wsJsonToRes = exports.wsUserOp = exports.LemmyWebsocket = void 0;
4
- var others_1 = require("./types/others");
4
+ const others_1 = require("./types/others");
5
5
  /**
6
6
  * Helps build lemmy websocket message requests, that you can use in your Websocket sends.
7
7
  *
@@ -9,31 +9,30 @@ var others_1 = require("./types/others");
9
9
  *
10
10
  * The return types for these are given in [[LemmyHttp]]
11
11
  */
12
- var LemmyWebsocket = /** @class */ (function () {
13
- function LemmyWebsocket() {
14
- }
12
+ class LemmyWebsocket {
13
+ constructor() { }
15
14
  /**
16
15
  * Log into lemmy.
17
16
  */
18
- LemmyWebsocket.prototype.login = function (form) {
17
+ login(form) {
19
18
  return wrapper(others_1.UserOperation.Login, form);
20
- };
19
+ }
21
20
  /**
22
21
  * A websocket join for your user.
23
22
  *
24
23
  * Allows your user to receive private messages and notifications.
25
24
  */
26
- LemmyWebsocket.prototype.userJoin = function (form) {
25
+ userJoin(form) {
27
26
  return wrapper(others_1.UserOperation.UserJoin, form);
28
- };
27
+ }
29
28
  /**
30
29
  * A websocket join for the current post room.
31
30
  *
32
31
  * Allows your user to receive new comments and updates for that post.
33
32
  */
34
- LemmyWebsocket.prototype.postJoin = function (form) {
33
+ postJoin(form) {
35
34
  return wrapper(others_1.UserOperation.PostJoin, form);
36
- };
35
+ }
37
36
  /**
38
37
  * A websocket join for a given community.
39
38
  *
@@ -41,516 +40,515 @@ var LemmyWebsocket = /** @class */ (function () {
41
40
  *
42
41
  * Note: community_id: 0, is your front page.
43
42
  */
44
- LemmyWebsocket.prototype.communityJoin = function (form) {
43
+ communityJoin(form) {
45
44
  return wrapper(others_1.UserOperation.CommunityJoin, form);
46
- };
45
+ }
47
46
  /**
48
47
  * Register a new user.
49
48
  */
50
- LemmyWebsocket.prototype.register = function (register) {
49
+ register(register) {
51
50
  return wrapper(others_1.UserOperation.Register, register);
52
- };
51
+ }
53
52
  /**
54
53
  * Fetch a Captcha.
55
54
  */
56
- LemmyWebsocket.prototype.getCaptcha = function (form) {
55
+ getCaptcha(form) {
57
56
  return wrapper(others_1.UserOperation.GetCaptcha, form);
58
- };
57
+ }
59
58
  /**
60
59
  * Create a new community.
61
60
  */
62
- LemmyWebsocket.prototype.createCommunity = function (form) {
61
+ createCommunity(form) {
63
62
  return wrapper(others_1.UserOperation.CreateCommunity, form);
64
- };
63
+ }
65
64
  /**
66
65
  * Edit a community.
67
66
  */
68
- LemmyWebsocket.prototype.editCommunity = function (form) {
67
+ editCommunity(form) {
69
68
  return wrapper(others_1.UserOperation.EditCommunity, form);
70
- };
69
+ }
71
70
  /**
72
71
  * Delete a community.
73
72
  */
74
- LemmyWebsocket.prototype.deleteCommunity = function (form) {
73
+ deleteCommunity(form) {
75
74
  return wrapper(others_1.UserOperation.DeleteCommunity, form);
76
- };
75
+ }
77
76
  /**
78
77
  * A moderator remove for a community.
79
78
  */
80
- LemmyWebsocket.prototype.removeCommunity = function (form) {
79
+ removeCommunity(form) {
81
80
  return wrapper(others_1.UserOperation.RemoveCommunity, form);
82
- };
81
+ }
83
82
  /**
84
83
  * Follow / subscribe to a community.
85
84
  */
86
- LemmyWebsocket.prototype.followCommunity = function (form) {
85
+ followCommunity(form) {
87
86
  return wrapper(others_1.UserOperation.FollowCommunity, form);
88
- };
87
+ }
89
88
  /**
90
89
  * List communities, with various filters.
91
90
  */
92
- LemmyWebsocket.prototype.listCommunities = function (form) {
91
+ listCommunities(form) {
93
92
  return wrapper(others_1.UserOperation.ListCommunities, form);
94
- };
93
+ }
95
94
  /**
96
95
  * Create a post.
97
96
  */
98
- LemmyWebsocket.prototype.createPost = function (form) {
97
+ createPost(form) {
99
98
  return wrapper(others_1.UserOperation.CreatePost, form);
100
- };
99
+ }
101
100
  /**
102
101
  * Get / fetch a post.
103
102
  */
104
- LemmyWebsocket.prototype.getPost = function (form) {
103
+ getPost(form) {
105
104
  return wrapper(others_1.UserOperation.GetPost, form);
106
- };
105
+ }
107
106
  /**
108
107
  * Get / fetch a community.
109
108
  */
110
- LemmyWebsocket.prototype.getCommunity = function (form) {
109
+ getCommunity(form) {
111
110
  return wrapper(others_1.UserOperation.GetCommunity, form);
112
- };
111
+ }
113
112
  /**
114
113
  * Create a comment.
115
114
  */
116
- LemmyWebsocket.prototype.createComment = function (form) {
115
+ createComment(form) {
117
116
  return wrapper(others_1.UserOperation.CreateComment, form);
118
- };
117
+ }
119
118
  /**
120
119
  * Edit a comment.
121
120
  */
122
- LemmyWebsocket.prototype.editComment = function (form) {
121
+ editComment(form) {
123
122
  return wrapper(others_1.UserOperation.EditComment, form);
124
- };
123
+ }
125
124
  /**
126
125
  * Delete a comment.
127
126
  */
128
- LemmyWebsocket.prototype.deleteComment = function (form) {
127
+ deleteComment(form) {
129
128
  return wrapper(others_1.UserOperation.DeleteComment, form);
130
- };
129
+ }
131
130
  /**
132
131
  * A moderator remove for a comment.
133
132
  */
134
- LemmyWebsocket.prototype.removeComment = function (form) {
133
+ removeComment(form) {
135
134
  return wrapper(others_1.UserOperation.RemoveComment, form);
136
- };
135
+ }
137
136
  /**
138
137
  * Mark a comment as read.
139
138
  */
140
- LemmyWebsocket.prototype.markCommentReplyAsRead = function (form) {
139
+ markCommentReplyAsRead(form) {
141
140
  return wrapper(others_1.UserOperation.MarkCommentReplyAsRead, form);
142
- };
141
+ }
143
142
  /**
144
143
  * Like / vote on a comment.
145
144
  */
146
- LemmyWebsocket.prototype.likeComment = function (form) {
145
+ likeComment(form) {
147
146
  return wrapper(others_1.UserOperation.CreateCommentLike, form);
148
- };
147
+ }
149
148
  /**
150
149
  * Save a comment.
151
150
  */
152
- LemmyWebsocket.prototype.saveComment = function (form) {
151
+ saveComment(form) {
153
152
  return wrapper(others_1.UserOperation.SaveComment, form);
154
- };
153
+ }
155
154
  /**
156
155
  * Report a comment.
157
156
  */
158
- LemmyWebsocket.prototype.createCommentReport = function (form) {
157
+ createCommentReport(form) {
159
158
  return wrapper(others_1.UserOperation.CreateCommentReport, form);
160
- };
159
+ }
161
160
  /**
162
161
  * Resolve a comment report. Only a mod can do this.
163
162
  */
164
- LemmyWebsocket.prototype.resolveCommentReport = function (form) {
163
+ resolveCommentReport(form) {
165
164
  return wrapper(others_1.UserOperation.ResolveCommentReport, form);
166
- };
165
+ }
167
166
  /**
168
167
  * List comment reports.
169
168
  */
170
- LemmyWebsocket.prototype.listCommentReports = function (form) {
169
+ listCommentReports(form) {
171
170
  return wrapper(others_1.UserOperation.ListCommentReports, form);
172
- };
171
+ }
173
172
  /**
174
173
  * Get / fetch posts, with various filters.
175
174
  */
176
- LemmyWebsocket.prototype.getPosts = function (form) {
175
+ getPosts(form) {
177
176
  return wrapper(others_1.UserOperation.GetPosts, form);
178
- };
177
+ }
179
178
  /**
180
179
  * Get / fetch comments.
181
180
  */
182
- LemmyWebsocket.prototype.getComments = function (form) {
181
+ getComments(form) {
183
182
  return wrapper(others_1.UserOperation.GetComments, form);
184
- };
183
+ }
185
184
  /**
186
185
  * Get / fetch comment.
187
186
  */
188
- LemmyWebsocket.prototype.getComment = function (form) {
187
+ getComment(form) {
189
188
  return wrapper(others_1.UserOperation.GetComment, form);
190
- };
189
+ }
191
190
  /**
192
191
  * Like / vote on a post.
193
192
  */
194
- LemmyWebsocket.prototype.likePost = function (form) {
193
+ likePost(form) {
195
194
  return wrapper(others_1.UserOperation.CreatePostLike, form);
196
- };
195
+ }
197
196
  /**
198
197
  * Edit a post.
199
198
  */
200
- LemmyWebsocket.prototype.editPost = function (form) {
199
+ editPost(form) {
201
200
  return wrapper(others_1.UserOperation.EditPost, form);
202
- };
201
+ }
203
202
  /**
204
203
  * Delete a post.
205
204
  */
206
- LemmyWebsocket.prototype.deletePost = function (form) {
205
+ deletePost(form) {
207
206
  return wrapper(others_1.UserOperation.DeletePost, form);
208
- };
207
+ }
209
208
  /**
210
209
  * A moderator remove for a post.
211
210
  */
212
- LemmyWebsocket.prototype.removePost = function (form) {
211
+ removePost(form) {
213
212
  return wrapper(others_1.UserOperation.RemovePost, form);
214
- };
213
+ }
215
214
  /**
216
215
  * A moderator can lock a post ( IE disable new comments ).
217
216
  */
218
- LemmyWebsocket.prototype.lockPost = function (form) {
217
+ lockPost(form) {
219
218
  return wrapper(others_1.UserOperation.LockPost, form);
220
- };
219
+ }
221
220
  /**
222
221
  * A moderator can feature a post ( IE stick it to the top of a community ).
223
222
  */
224
- LemmyWebsocket.prototype.featurePost = function (form) {
223
+ featurePost(form) {
225
224
  return wrapper(others_1.UserOperation.FeaturePost, form);
226
- };
225
+ }
227
226
  /**
228
227
  * Mark a post as read.
229
228
  */
230
- LemmyWebsocket.prototype.markPostAsRead = function (form) {
229
+ markPostAsRead(form) {
231
230
  return wrapper(others_1.UserOperation.MarkPostAsRead, form);
232
- };
231
+ }
233
232
  /**
234
233
  * Save a post.
235
234
  */
236
- LemmyWebsocket.prototype.savePost = function (form) {
235
+ savePost(form) {
237
236
  return wrapper(others_1.UserOperation.SavePost, form);
238
- };
237
+ }
239
238
  /**
240
239
  * Report a post.
241
240
  */
242
- LemmyWebsocket.prototype.createPostReport = function (form) {
241
+ createPostReport(form) {
243
242
  return wrapper(others_1.UserOperation.CreatePostReport, form);
244
- };
243
+ }
245
244
  /**
246
245
  * Resolve a post report. Only a mod can do this.
247
246
  */
248
- LemmyWebsocket.prototype.resolvePostReport = function (form) {
247
+ resolvePostReport(form) {
249
248
  return wrapper(others_1.UserOperation.ResolvePostReport, form);
250
- };
249
+ }
251
250
  /**
252
251
  * List post reports.
253
252
  */
254
- LemmyWebsocket.prototype.listPostReports = function (form) {
253
+ listPostReports(form) {
255
254
  return wrapper(others_1.UserOperation.ListPostReports, form);
256
- };
255
+ }
257
256
  /**
258
257
  * Fetch metadata for any given site.
259
258
  */
260
- LemmyWebsocket.prototype.getSiteMetadata = function (form) {
259
+ getSiteMetadata(form) {
261
260
  return wrapper(others_1.UserOperation.GetSiteMetadata, form);
262
- };
261
+ }
263
262
  /**
264
263
  * Ban a user from a community.
265
264
  */
266
- LemmyWebsocket.prototype.banFromCommunity = function (form) {
265
+ banFromCommunity(form) {
267
266
  return wrapper(others_1.UserOperation.BanFromCommunity, form);
268
- };
267
+ }
269
268
  /**
270
269
  * Add a moderator to your community.
271
270
  */
272
- LemmyWebsocket.prototype.addModToCommunity = function (form) {
271
+ addModToCommunity(form) {
273
272
  return wrapper(others_1.UserOperation.AddModToCommunity, form);
274
- };
273
+ }
275
274
  /**
276
275
  * Transfer your community to an existing moderator.
277
276
  */
278
- LemmyWebsocket.prototype.transferCommunity = function (form) {
277
+ transferCommunity(form) {
279
278
  return wrapper(others_1.UserOperation.TransferCommunity, form);
280
- };
279
+ }
281
280
  /**
282
281
  * Leave the Site admins.
283
282
  */
284
- LemmyWebsocket.prototype.leaveAdmin = function (form) {
283
+ leaveAdmin(form) {
285
284
  return wrapper(others_1.UserOperation.LeaveAdmin, form);
286
- };
285
+ }
287
286
  /**
288
287
  * Ban a person from your site.
289
288
  */
290
- LemmyWebsocket.prototype.banPerson = function (form) {
289
+ banPerson(form) {
291
290
  return wrapper(others_1.UserOperation.BanPerson, form);
292
- };
291
+ }
293
292
  /**
294
293
  * Get a list of banned users
295
294
  */
296
- LemmyWebsocket.prototype.getBannedPersons = function (form) {
295
+ getBannedPersons(form) {
297
296
  return wrapper(others_1.UserOperation.GetBannedPersons, form);
298
- };
297
+ }
299
298
  /**
300
299
  * Add an admin to your site.
301
300
  */
302
- LemmyWebsocket.prototype.addAdmin = function (form) {
301
+ addAdmin(form) {
303
302
  return wrapper(others_1.UserOperation.AddAdmin, form);
304
- };
303
+ }
305
304
  /**
306
305
  * Get the unread registration applications count.
307
306
  */
308
- LemmyWebsocket.prototype.getUnreadRegistrationApplicationCount = function (form) {
307
+ getUnreadRegistrationApplicationCount(form) {
309
308
  return wrapper(others_1.UserOperation.GetUnreadRegistrationApplicationCount, form);
310
- };
309
+ }
311
310
  /**
312
311
  * List the unread registration applications.
313
312
  */
314
- LemmyWebsocket.prototype.listRegistrationApplications = function (form) {
313
+ listRegistrationApplications(form) {
315
314
  return wrapper(others_1.UserOperation.ListRegistrationApplications, form);
316
- };
315
+ }
317
316
  /**
318
317
  * Approve a registration application
319
318
  */
320
- LemmyWebsocket.prototype.approveRegistrationApplication = function (form) {
319
+ approveRegistrationApplication(form) {
321
320
  return wrapper(others_1.UserOperation.ApproveRegistrationApplication, form);
322
- };
321
+ }
323
322
  /**
324
323
  * Get the details for a person.
325
324
  */
326
- LemmyWebsocket.prototype.getPersonDetails = function (form) {
325
+ getPersonDetails(form) {
327
326
  return wrapper(others_1.UserOperation.GetPersonDetails, form);
328
- };
327
+ }
329
328
  /**
330
329
  * Get comment replies.
331
330
  */
332
- LemmyWebsocket.prototype.getReplies = function (form) {
331
+ getReplies(form) {
333
332
  return wrapper(others_1.UserOperation.GetReplies, form);
334
- };
333
+ }
335
334
  /**
336
335
  * Get mentions for your user.
337
336
  */
338
- LemmyWebsocket.prototype.getPersonMentions = function (form) {
337
+ getPersonMentions(form) {
339
338
  return wrapper(others_1.UserOperation.GetPersonMentions, form);
340
- };
339
+ }
341
340
  /**
342
341
  * Mark a person mention as read.
343
342
  */
344
- LemmyWebsocket.prototype.markPersonMentionAsRead = function (form) {
343
+ markPersonMentionAsRead(form) {
345
344
  return wrapper(others_1.UserOperation.MarkPersonMentionAsRead, form);
346
- };
345
+ }
347
346
  /**
348
347
  * Get the modlog.
349
348
  */
350
- LemmyWebsocket.prototype.getModlog = function (form) {
349
+ getModlog(form) {
351
350
  return wrapper(others_1.UserOperation.GetModlog, form);
352
- };
351
+ }
353
352
  /**
354
353
  * Create your site.
355
354
  */
356
- LemmyWebsocket.prototype.createSite = function (form) {
355
+ createSite(form) {
357
356
  return wrapper(others_1.UserOperation.CreateSite, form);
358
- };
357
+ }
359
358
  /**
360
359
  * Edit your site.
361
360
  */
362
- LemmyWebsocket.prototype.editSite = function (form) {
361
+ editSite(form) {
363
362
  return wrapper(others_1.UserOperation.EditSite, form);
364
- };
363
+ }
365
364
  /**
366
365
  * Gets the site, and your user data.
367
366
  */
368
- LemmyWebsocket.prototype.getSite = function (form) {
367
+ getSite(form) {
369
368
  return wrapper(others_1.UserOperation.GetSite, form);
370
- };
369
+ }
371
370
  /**
372
371
  * Search lemmy.
373
372
  */
374
- LemmyWebsocket.prototype.search = function (form) {
373
+ search(form) {
375
374
  return wrapper(others_1.UserOperation.Search, form);
376
- };
375
+ }
377
376
  /**
378
377
  * Fetch a non-local / federated object.
379
378
  */
380
- LemmyWebsocket.prototype.resolveObject = function (form) {
379
+ resolveObject(form) {
381
380
  return wrapper(others_1.UserOperation.ResolveObject, form);
382
- };
381
+ }
383
382
  /**
384
383
  * Mark all replies as read.
385
384
  */
386
- LemmyWebsocket.prototype.markAllAsRead = function (form) {
385
+ markAllAsRead(form) {
387
386
  return wrapper(others_1.UserOperation.MarkAllAsRead, form);
388
- };
387
+ }
389
388
  /**
390
389
  * Save your user settings.
391
390
  */
392
- LemmyWebsocket.prototype.saveUserSettings = function (form) {
391
+ saveUserSettings(form) {
393
392
  return wrapper(others_1.UserOperation.SaveUserSettings, form);
394
- };
393
+ }
395
394
  /**
396
395
  * Change your user password.
397
396
  */
398
- LemmyWebsocket.prototype.changePassword = function (form) {
397
+ changePassword(form) {
399
398
  return wrapper(others_1.UserOperation.ChangePassword, form);
400
- };
399
+ }
401
400
  /**
402
401
  * Get counts for your reports
403
402
  */
404
- LemmyWebsocket.prototype.getReportCount = function (form) {
403
+ getReportCount(form) {
405
404
  return wrapper(others_1.UserOperation.GetReportCount, form);
406
- };
405
+ }
407
406
  /**
408
407
  * Get your unread counts
409
408
  */
410
- LemmyWebsocket.prototype.getUnreadCount = function (form) {
409
+ getUnreadCount(form) {
411
410
  return wrapper(others_1.UserOperation.GetUnreadCount, form);
412
- };
411
+ }
413
412
  /**
414
413
  * Verify your email
415
414
  */
416
- LemmyWebsocket.prototype.verifyEmail = function (form) {
415
+ verifyEmail(form) {
417
416
  return wrapper(others_1.UserOperation.VerifyEmail, form);
418
- };
417
+ }
419
418
  /**
420
419
  * Delete your account.
421
420
  */
422
- LemmyWebsocket.prototype.deleteAccount = function (form) {
421
+ deleteAccount(form) {
423
422
  return wrapper(others_1.UserOperation.DeleteAccount, form);
424
- };
423
+ }
425
424
  /**
426
425
  * Reset your password.
427
426
  */
428
- LemmyWebsocket.prototype.passwordReset = function (form) {
427
+ passwordReset(form) {
429
428
  return wrapper(others_1.UserOperation.PasswordReset, form);
430
- };
429
+ }
431
430
  /**
432
431
  * Change your password from an email / token based reset.
433
432
  */
434
- LemmyWebsocket.prototype.passwordChange = function (form) {
433
+ passwordChange(form) {
435
434
  return wrapper(others_1.UserOperation.PasswordChangeAfterReset, form);
436
- };
435
+ }
437
436
  /**
438
437
  * Create a private message.
439
438
  */
440
- LemmyWebsocket.prototype.createPrivateMessage = function (form) {
439
+ createPrivateMessage(form) {
441
440
  return wrapper(others_1.UserOperation.CreatePrivateMessage, form);
442
- };
441
+ }
443
442
  /**
444
443
  * Edit a private message.
445
444
  */
446
- LemmyWebsocket.prototype.editPrivateMessage = function (form) {
445
+ editPrivateMessage(form) {
447
446
  return wrapper(others_1.UserOperation.EditPrivateMessage, form);
448
- };
447
+ }
449
448
  /**
450
449
  * Delete a private message.
451
450
  */
452
- LemmyWebsocket.prototype.deletePrivateMessage = function (form) {
451
+ deletePrivateMessage(form) {
453
452
  return wrapper(others_1.UserOperation.DeletePrivateMessage, form);
454
- };
453
+ }
455
454
  /**
456
455
  * Mark a private message as read.
457
456
  */
458
- LemmyWebsocket.prototype.markPrivateMessageAsRead = function (form) {
457
+ markPrivateMessageAsRead(form) {
459
458
  return wrapper(others_1.UserOperation.MarkPrivateMessageAsRead, form);
460
- };
459
+ }
461
460
  /**
462
461
  * Get / fetch private messages.
463
462
  */
464
- LemmyWebsocket.prototype.getPrivateMessages = function (form) {
463
+ getPrivateMessages(form) {
465
464
  return wrapper(others_1.UserOperation.GetPrivateMessages, form);
466
- };
465
+ }
467
466
  /**
468
467
  * Create a report for a private message.
469
468
  */
470
- LemmyWebsocket.prototype.createPrivateMessageReport = function (form) {
469
+ createPrivateMessageReport(form) {
471
470
  return wrapper(others_1.UserOperation.CreatePrivateMessageReport, form);
472
- };
471
+ }
473
472
  /**
474
473
  * Resolve a report for a private message.
475
474
  */
476
- LemmyWebsocket.prototype.resolvePrivateMessageReport = function (form) {
475
+ resolvePrivateMessageReport(form) {
477
476
  return wrapper(others_1.UserOperation.ResolvePrivateMessageReport, form);
478
- };
477
+ }
479
478
  /**
480
479
  * List private message reports.
481
480
  */
482
- LemmyWebsocket.prototype.listPrivateMessageReports = function (form) {
481
+ listPrivateMessageReports(form) {
483
482
  return wrapper(others_1.UserOperation.ListPrivateMessageReports, form);
484
- };
483
+ }
485
484
  /**
486
485
  * Block a person.
487
486
  */
488
- LemmyWebsocket.prototype.blockPerson = function (form) {
487
+ blockPerson(form) {
489
488
  return wrapper(others_1.UserOperation.BlockPerson, form);
490
- };
489
+ }
491
490
  /**
492
491
  * Block a community.
493
492
  */
494
- LemmyWebsocket.prototype.blockCommunity = function (form) {
493
+ blockCommunity(form) {
495
494
  return wrapper(others_1.UserOperation.BlockCommunity, form);
496
- };
495
+ }
497
496
  /**
498
497
  * Purge / Delete a person from the database.
499
498
  */
500
- LemmyWebsocket.prototype.purgePerson = function (form) {
499
+ purgePerson(form) {
501
500
  return wrapper(others_1.UserOperation.PurgePerson, form);
502
- };
501
+ }
503
502
  /**
504
503
  * Purge / Delete a community from the database.
505
504
  */
506
- LemmyWebsocket.prototype.purgeCommunity = function (form) {
505
+ purgeCommunity(form) {
507
506
  return wrapper(others_1.UserOperation.PurgeCommunity, form);
508
- };
507
+ }
509
508
  /**
510
509
  * Purge / Delete a post from the database.
511
510
  */
512
- LemmyWebsocket.prototype.purgePost = function (form) {
511
+ purgePost(form) {
513
512
  return wrapper(others_1.UserOperation.PurgePost, form);
514
- };
513
+ }
515
514
  /**
516
515
  * Purge / Delete a comment from the database.
517
516
  */
518
- LemmyWebsocket.prototype.purgeComment = function (form) {
517
+ purgeComment(form) {
519
518
  return wrapper(others_1.UserOperation.PurgeComment, form);
520
- };
519
+ }
521
520
  /**
522
521
  * Create a custom emoji
523
522
  */
524
- LemmyWebsocket.prototype.createCustomEmoji = function (form) {
523
+ createCustomEmoji(form) {
525
524
  return wrapper(others_1.UserOperation.CreateCustomEmoji, form);
526
- };
525
+ }
527
526
  /**
528
527
  * Edit a custom emoji
529
528
  */
530
- LemmyWebsocket.prototype.editCustomEmoji = function (form) {
529
+ editCustomEmoji(form) {
531
530
  return wrapper(others_1.UserOperation.EditCustomEmoji, form);
532
- };
531
+ }
533
532
  /**
534
533
  * Delete a custom emoji
535
534
  */
536
- LemmyWebsocket.prototype.deleteCustomEmoji = function (form) {
535
+ deleteCustomEmoji(form) {
537
536
  return wrapper(others_1.UserOperation.DeleteCustomEmoji, form);
538
- };
537
+ }
539
538
  /**
540
539
  * Fetch federated instances.
541
540
  */
542
- LemmyWebsocket.prototype.getFederatedInstances = function (form) {
541
+ getFederatedInstances(form) {
543
542
  return wrapper(others_1.UserOperation.GetFederatedInstances, form);
544
- };
545
- return LemmyWebsocket;
546
- }());
543
+ }
544
+ }
547
545
  exports.LemmyWebsocket = LemmyWebsocket;
548
546
  function wrapper(op, data) {
549
- var send = JSON.stringify({ op: others_1.UserOperation[op], data: data });
547
+ let send = JSON.stringify({ op: others_1.UserOperation[op], data });
550
548
  return send;
551
549
  }
552
550
  function wsUserOp(msg) {
553
- var opStr = msg.op;
551
+ let opStr = msg.op;
554
552
  return others_1.UserOperation[opStr];
555
553
  }
556
554
  exports.wsUserOp = wsUserOp;