lemmy-js-client 0.17.0-rc.31 → 0.17.0-rc.35
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/http.d.ts +28 -16
- package/dist/http.js +49 -25
- package/dist/interfaces/aggregates.d.ts +1 -0
- package/dist/interfaces/api/comment.d.ts +5 -11
- package/dist/interfaces/api/comment.js +34 -11
- package/dist/interfaces/api/person.d.ts +14 -5
- package/dist/interfaces/api/person.js +18 -2
- package/dist/interfaces/api/post.d.ts +3 -3
- package/dist/interfaces/api/post.js +22 -3
- package/dist/interfaces/api/site.d.ts +32 -13
- package/dist/interfaces/api/site.js +91 -21
- package/dist/interfaces/others.d.ts +76 -40
- package/dist/interfaces/others.js +72 -41
- package/dist/interfaces/source.d.ts +34 -2
- package/dist/interfaces/source.js +75 -12
- package/dist/interfaces/views.d.ts +33 -2
- package/dist/interfaces/views.js +85 -8
- package/dist/websocket.d.ts +20 -12
- package/dist/websocket.js +26 -14
- package/package.json +1 -1
package/dist/interfaces/views.js
CHANGED
@@ -6,7 +6,7 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
6
6
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
7
7
|
};
|
8
8
|
Object.defineProperty(exports, "__esModule", { value: true });
|
9
|
-
exports.RegistrationApplicationView = exports.CommunityView = exports.PersonBlockView = exports.CommunityPersonBanView = exports.CommunityModeratorView = exports.CommunityBlockView = exports.CommunityFollowerView = exports.ModStickyPostView = exports.ModRemovePostView = exports.ModRemoveCommunityView = exports.ModRemoveCommentView = exports.ModLockPostView = exports.ModBanView = exports.ModBanFromCommunityView = exports.ModAddView = exports.ModTransferCommunityView = exports.ModAddCommunityView = exports.CommentReportView = exports.CommentView = exports.PostReportView = exports.PostView = exports.PrivateMessageView = exports.SiteView = exports.LocalUserSettingsView = exports.PersonMentionView = exports.PersonViewSafe = void 0;
|
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
10
|
var class_transformer_1 = require("class-transformer");
|
11
11
|
require("reflect-metadata");
|
12
12
|
var utils_1 = require("../utils");
|
@@ -170,6 +170,12 @@ var CommentView = /** @class */ (function () {
|
|
170
170
|
__decorate([
|
171
171
|
(0, class_transformer_1.Type)(function () { return source_1.PersonSafe; })
|
172
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);
|
173
179
|
__decorate([
|
174
180
|
(0, class_transformer_1.Transform)(function (_a) {
|
175
181
|
var value = _a.value;
|
@@ -179,15 +185,32 @@ var CommentView = /** @class */ (function () {
|
|
179
185
|
var value = _a.value;
|
180
186
|
return (0, utils_1.toUndefined)(value);
|
181
187
|
}, { toPlainOnly: true }),
|
182
|
-
(0, class_transformer_1.Expose)()
|
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([
|
183
203
|
(0, class_transformer_1.Type)(function () { return source_1.PersonSafe; })
|
184
|
-
],
|
204
|
+
], CommentReplyView.prototype, "creator", void 0);
|
185
205
|
__decorate([
|
186
206
|
(0, class_transformer_1.Type)(function () { return source_1.Post; })
|
187
|
-
],
|
207
|
+
], CommentReplyView.prototype, "post", void 0);
|
188
208
|
__decorate([
|
189
209
|
(0, class_transformer_1.Type)(function () { return source_1.CommunitySafe; })
|
190
|
-
],
|
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);
|
191
214
|
__decorate([
|
192
215
|
(0, class_transformer_1.Transform)(function (_a) {
|
193
216
|
var value = _a.value;
|
@@ -198,10 +221,10 @@ var CommentView = /** @class */ (function () {
|
|
198
221
|
return (0, utils_1.toUndefined)(value);
|
199
222
|
}, { toPlainOnly: true }),
|
200
223
|
(0, class_transformer_1.Expose)()
|
201
|
-
],
|
202
|
-
return
|
224
|
+
], CommentReplyView.prototype, "my_vote", void 0);
|
225
|
+
return CommentReplyView;
|
203
226
|
}());
|
204
|
-
exports.
|
227
|
+
exports.CommentReplyView = CommentReplyView;
|
205
228
|
var CommentReportView = /** @class */ (function () {
|
206
229
|
function CommentReportView() {
|
207
230
|
}
|
@@ -426,6 +449,60 @@ var ModStickyPostView = /** @class */ (function () {
|
|
426
449
|
return ModStickyPostView;
|
427
450
|
}());
|
428
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;
|
429
506
|
var CommunityFollowerView = /** @class */ (function () {
|
430
507
|
function CommunityFollowerView() {
|
431
508
|
}
|
package/dist/websocket.d.ts
CHANGED
@@ -1,9 +1,9 @@
|
|
1
1
|
import { ClassConstructor } from "class-transformer";
|
2
|
-
import { CreateComment, CreateCommentLike, CreateCommentReport, DeleteComment, EditComment, GetComments, ListCommentReports,
|
2
|
+
import { CreateComment, CreateCommentLike, CreateCommentReport, DeleteComment, EditComment, GetComments, ListCommentReports, RemoveComment, ResolveCommentReport, SaveComment } from "./interfaces/api/comment";
|
3
3
|
import { AddModToCommunity, BanFromCommunity, BlockCommunity, CreateCommunity, DeleteCommunity, EditCommunity, FollowCommunity, GetCommunity, ListCommunities, RemoveCommunity, TransferCommunity } from "./interfaces/api/community";
|
4
|
-
import { AddAdmin, BanPerson, BlockPerson, ChangePassword, CreatePrivateMessage, DeleteAccount, DeletePrivateMessage, EditPrivateMessage, GetBannedPersons, GetPersonDetails, GetPersonMentions, GetPrivateMessages, GetReplies, GetReportCount, GetUnreadCount, Login, MarkAllAsRead, MarkPersonMentionAsRead, MarkPrivateMessageAsRead, PasswordChange, PasswordReset, Register, SaveUserSettings, VerifyEmail } from "./interfaces/api/person";
|
4
|
+
import { AddAdmin, BanPerson, BlockPerson, ChangePassword, CreatePrivateMessage, DeleteAccount, DeletePrivateMessage, EditPrivateMessage, GetBannedPersons, GetPersonDetails, GetPersonMentions, GetPrivateMessages, GetReplies, GetReportCount, GetUnreadCount, Login, MarkAllAsRead, MarkCommentReplyAsRead, MarkPersonMentionAsRead, MarkPrivateMessageAsRead, PasswordChange, PasswordReset, Register, SaveUserSettings, VerifyEmail } from "./interfaces/api/person";
|
5
5
|
import { CreatePost, CreatePostLike, CreatePostReport, DeletePost, EditPost, GetPost, GetPosts, GetSiteMetadata, ListPostReports, LockPost, MarkPostAsRead, RemovePost, ResolvePostReport, SavePost, StickyPost } from "./interfaces/api/post";
|
6
|
-
import { ApproveRegistrationApplication, CreateSite, EditSite, GetModlog, GetSite,
|
6
|
+
import { ApproveRegistrationApplication, CreateSite, EditSite, GetModlog, GetSite, GetUnreadRegistrationApplicationCount, LeaveAdmin, ListRegistrationApplications, PurgeComment, PurgeCommunity, PurgePerson, PurgePost, ResolveObject, Search } from "./interfaces/api/site";
|
7
7
|
import { CommunityJoin, PostJoin, UserJoin } from "./interfaces/api/websocket";
|
8
8
|
import { UserOperation } from "./interfaces/others";
|
9
9
|
/**
|
@@ -102,7 +102,7 @@ export declare class LemmyWebsocket {
|
|
102
102
|
/**
|
103
103
|
* Mark a comment as read.
|
104
104
|
*/
|
105
|
-
|
105
|
+
markCommentReplyAsRead(form: MarkCommentReplyAsRead): string;
|
106
106
|
/**
|
107
107
|
* Like / vote on a comment.
|
108
108
|
*/
|
@@ -251,10 +251,6 @@ export declare class LemmyWebsocket {
|
|
251
251
|
* Gets the site, and your user data.
|
252
252
|
*/
|
253
253
|
getSite(form: GetSite): string;
|
254
|
-
/**
|
255
|
-
* Get your site configuration.
|
256
|
-
*/
|
257
|
-
getSiteConfig(form: GetSiteConfig): string;
|
258
254
|
/**
|
259
255
|
* Search lemmy.
|
260
256
|
*/
|
@@ -319,10 +315,6 @@ export declare class LemmyWebsocket {
|
|
319
315
|
* Get / fetch private messages.
|
320
316
|
*/
|
321
317
|
getPrivateMessages(form: GetPrivateMessages): string;
|
322
|
-
/**
|
323
|
-
* Save your site config.
|
324
|
-
*/
|
325
|
-
saveSiteConfig(form: SaveSiteConfig): string;
|
326
318
|
/**
|
327
319
|
* Block a person.
|
328
320
|
*/
|
@@ -331,6 +323,22 @@ export declare class LemmyWebsocket {
|
|
331
323
|
* Block a community.
|
332
324
|
*/
|
333
325
|
blockCommunity(form: BlockCommunity): string;
|
326
|
+
/**
|
327
|
+
* Purge / Delete a person from the database.
|
328
|
+
*/
|
329
|
+
purgePerson(form: PurgePerson): string;
|
330
|
+
/**
|
331
|
+
* Purge / Delete a community from the database.
|
332
|
+
*/
|
333
|
+
purgeCommunity(form: PurgeCommunity): string;
|
334
|
+
/**
|
335
|
+
* Purge / Delete a post from the database.
|
336
|
+
*/
|
337
|
+
purgePost(form: PurgePost): string;
|
338
|
+
/**
|
339
|
+
* Purge / Delete a comment from the database.
|
340
|
+
*/
|
341
|
+
purgeComment(form: PurgeComment): string;
|
334
342
|
}
|
335
343
|
export declare function wsUserOp(msg: any): UserOperation;
|
336
344
|
/**
|
package/dist/websocket.js
CHANGED
@@ -138,8 +138,8 @@ var LemmyWebsocket = /** @class */ (function () {
|
|
138
138
|
/**
|
139
139
|
* Mark a comment as read.
|
140
140
|
*/
|
141
|
-
LemmyWebsocket.prototype.
|
142
|
-
return wrapper(others_1.UserOperation.
|
141
|
+
LemmyWebsocket.prototype.markCommentReplyAsRead = function (form) {
|
142
|
+
return wrapper(others_1.UserOperation.MarkCommentReplyAsRead, form);
|
143
143
|
};
|
144
144
|
/**
|
145
145
|
* Like / vote on a comment.
|
@@ -363,12 +363,6 @@ var LemmyWebsocket = /** @class */ (function () {
|
|
363
363
|
LemmyWebsocket.prototype.getSite = function (form) {
|
364
364
|
return wrapper(others_1.UserOperation.GetSite, form);
|
365
365
|
};
|
366
|
-
/**
|
367
|
-
* Get your site configuration.
|
368
|
-
*/
|
369
|
-
LemmyWebsocket.prototype.getSiteConfig = function (form) {
|
370
|
-
return wrapper(others_1.UserOperation.GetSiteConfig, form);
|
371
|
-
};
|
372
366
|
/**
|
373
367
|
* Search lemmy.
|
374
368
|
*/
|
@@ -465,12 +459,6 @@ var LemmyWebsocket = /** @class */ (function () {
|
|
465
459
|
LemmyWebsocket.prototype.getPrivateMessages = function (form) {
|
466
460
|
return wrapper(others_1.UserOperation.GetPrivateMessages, form);
|
467
461
|
};
|
468
|
-
/**
|
469
|
-
* Save your site config.
|
470
|
-
*/
|
471
|
-
LemmyWebsocket.prototype.saveSiteConfig = function (form) {
|
472
|
-
return wrapper(others_1.UserOperation.SaveSiteConfig, form);
|
473
|
-
};
|
474
462
|
/**
|
475
463
|
* Block a person.
|
476
464
|
*/
|
@@ -483,6 +471,30 @@ var LemmyWebsocket = /** @class */ (function () {
|
|
483
471
|
LemmyWebsocket.prototype.blockCommunity = function (form) {
|
484
472
|
return wrapper(others_1.UserOperation.BlockCommunity, form);
|
485
473
|
};
|
474
|
+
/**
|
475
|
+
* Purge / Delete a person from the database.
|
476
|
+
*/
|
477
|
+
LemmyWebsocket.prototype.purgePerson = function (form) {
|
478
|
+
return wrapper(others_1.UserOperation.PurgePerson, form);
|
479
|
+
};
|
480
|
+
/**
|
481
|
+
* Purge / Delete a community from the database.
|
482
|
+
*/
|
483
|
+
LemmyWebsocket.prototype.purgeCommunity = function (form) {
|
484
|
+
return wrapper(others_1.UserOperation.PurgeCommunity, form);
|
485
|
+
};
|
486
|
+
/**
|
487
|
+
* Purge / Delete a post from the database.
|
488
|
+
*/
|
489
|
+
LemmyWebsocket.prototype.purgePost = function (form) {
|
490
|
+
return wrapper(others_1.UserOperation.PurgePost, form);
|
491
|
+
};
|
492
|
+
/**
|
493
|
+
* Purge / Delete a comment from the database.
|
494
|
+
*/
|
495
|
+
LemmyWebsocket.prototype.purgeComment = function (form) {
|
496
|
+
return wrapper(others_1.UserOperation.PurgeComment, form);
|
497
|
+
};
|
486
498
|
return LemmyWebsocket;
|
487
499
|
}());
|
488
500
|
exports.LemmyWebsocket = LemmyWebsocket;
|
package/package.json
CHANGED