lemmy-js-client 0.17.0-rc.32 → 0.17.0-rc.33
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/http.d.ts +25 -1
- package/dist/http.js +48 -0
- package/dist/interfaces/api/site.d.ts +32 -1
- package/dist/interfaces/api/site.js +91 -1
- package/dist/interfaces/others.d.ts +13 -9
- package/dist/interfaces/others.js +13 -9
- package/dist/interfaces/source.d.ts +26 -0
- package/dist/interfaces/source.js +69 -1
- package/dist/interfaces/views.d.ts +19 -1
- package/dist/interfaces/views.js +55 -1
- package/dist/websocket.d.ts +17 -1
- package/dist/websocket.js +24 -0
- package/package.json +1 -1
package/dist/http.d.ts
CHANGED
@@ -2,7 +2,7 @@ import { CommentReportResponse, CommentResponse, CreateComment, CreateCommentLik
|
|
2
2
|
import { AddModToCommunity, AddModToCommunityResponse, BanFromCommunity, BanFromCommunityResponse, BlockCommunity, BlockCommunityResponse, CommunityResponse, CreateCommunity, DeleteCommunity, EditCommunity, FollowCommunity, GetCommunity, GetCommunityResponse, ListCommunities, ListCommunitiesResponse, RemoveCommunity, TransferCommunity } from "./interfaces/api/community";
|
3
3
|
import { AddAdmin, AddAdminResponse, BannedPersonsResponse, BanPerson, BanPersonResponse, BlockPerson, BlockPersonResponse, ChangePassword, CreatePrivateMessage, DeleteAccount, DeleteAccountResponse, DeletePrivateMessage, EditPrivateMessage, GetBannedPersons, GetCaptchaResponse, GetPersonDetails, GetPersonDetailsResponse, GetPersonMentions, GetPersonMentionsResponse, GetPrivateMessages, GetReplies, GetRepliesResponse, GetReportCount, GetReportCountResponse, GetUnreadCount, GetUnreadCountResponse, Login, LoginResponse, MarkAllAsRead, MarkPersonMentionAsRead, MarkPrivateMessageAsRead, PasswordChange, PasswordReset, PasswordResetResponse, PersonMentionResponse, PrivateMessageResponse, PrivateMessagesResponse, Register, SaveUserSettings, VerifyEmail, VerifyEmailResponse } from "./interfaces/api/person";
|
4
4
|
import { CreatePost, CreatePostLike, CreatePostReport, DeletePost, EditPost, GetPost, GetPostResponse, GetPosts, GetPostsResponse, GetSiteMetadata, GetSiteMetadataResponse, ListPostReports, ListPostReportsResponse, LockPost, MarkPostAsRead, PostReportResponse, PostResponse, RemovePost, ResolvePostReport, SavePost, StickyPost } from "./interfaces/api/post";
|
5
|
-
import { ApproveRegistrationApplication, CreateSite, EditSite, GetModlog, GetModlogResponse, GetSite, GetSiteResponse, GetUnreadRegistrationApplicationCount, GetUnreadRegistrationApplicationCountResponse, LeaveAdmin, ListRegistrationApplications, ListRegistrationApplicationsResponse, RegistrationApplicationResponse, ResolveObject, ResolveObjectResponse, Search, SearchResponse, SiteResponse } from "./interfaces/api/site";
|
5
|
+
import { ApproveRegistrationApplication, CreateSite, EditSite, GetModlog, GetModlogResponse, GetSite, GetSiteResponse, GetUnreadRegistrationApplicationCount, GetUnreadRegistrationApplicationCountResponse, LeaveAdmin, ListRegistrationApplications, ListRegistrationApplicationsResponse, PurgeComment, PurgeCommunity, PurgeItemResponse, PurgePerson, PurgePost, RegistrationApplicationResponse, ResolveObject, ResolveObjectResponse, Search, SearchResponse, SiteResponse } from "./interfaces/api/site";
|
6
6
|
/**
|
7
7
|
* Helps build lemmy HTTP requests.
|
8
8
|
*/
|
@@ -449,6 +449,30 @@ export declare class LemmyHttp {
|
|
449
449
|
* `HTTP.PUT /admin/registration_application/approve`
|
450
450
|
*/
|
451
451
|
approveRegistrationApplication(form: ApproveRegistrationApplication): Promise<RegistrationApplicationResponse>;
|
452
|
+
/**
|
453
|
+
* Purge / Delete a person from the database.
|
454
|
+
*
|
455
|
+
* `HTTP.POST /admin/purge/person`
|
456
|
+
*/
|
457
|
+
purgePerson(form: PurgePerson): Promise<PurgeItemResponse>;
|
458
|
+
/**
|
459
|
+
* Purge / Delete a community from the database.
|
460
|
+
*
|
461
|
+
* `HTTP.POST /admin/purge/community`
|
462
|
+
*/
|
463
|
+
purgeCommunity(form: PurgeCommunity): Promise<PurgeItemResponse>;
|
464
|
+
/**
|
465
|
+
* Purge / Delete a post from the database.
|
466
|
+
*
|
467
|
+
* `HTTP.POST /admin/purge/post`
|
468
|
+
*/
|
469
|
+
purgePost(form: PurgePost): Promise<PurgeItemResponse>;
|
470
|
+
/**
|
471
|
+
* Purge / Delete a comment from the database.
|
472
|
+
*
|
473
|
+
* `HTTP.POST /admin/purge/comment`
|
474
|
+
*/
|
475
|
+
purgeComment(form: PurgeComment): Promise<PurgeItemResponse>;
|
452
476
|
private buildFullUrl;
|
453
477
|
private wrapper;
|
454
478
|
}
|
package/dist/http.js
CHANGED
@@ -942,6 +942,54 @@ var LemmyHttp = /** @class */ (function () {
|
|
942
942
|
});
|
943
943
|
});
|
944
944
|
};
|
945
|
+
/**
|
946
|
+
* Purge / Delete a person from the database.
|
947
|
+
*
|
948
|
+
* `HTTP.POST /admin/purge/person`
|
949
|
+
*/
|
950
|
+
LemmyHttp.prototype.purgePerson = function (form) {
|
951
|
+
return __awaiter(this, void 0, void 0, function () {
|
952
|
+
return __generator(this, function (_a) {
|
953
|
+
return [2 /*return*/, this.wrapper(HttpType.Post, "/admin/purge/person", form, site_1.PurgeItemResponse)];
|
954
|
+
});
|
955
|
+
});
|
956
|
+
};
|
957
|
+
/**
|
958
|
+
* Purge / Delete a community from the database.
|
959
|
+
*
|
960
|
+
* `HTTP.POST /admin/purge/community`
|
961
|
+
*/
|
962
|
+
LemmyHttp.prototype.purgeCommunity = function (form) {
|
963
|
+
return __awaiter(this, void 0, void 0, function () {
|
964
|
+
return __generator(this, function (_a) {
|
965
|
+
return [2 /*return*/, this.wrapper(HttpType.Post, "/admin/purge/community", form, site_1.PurgeItemResponse)];
|
966
|
+
});
|
967
|
+
});
|
968
|
+
};
|
969
|
+
/**
|
970
|
+
* Purge / Delete a post from the database.
|
971
|
+
*
|
972
|
+
* `HTTP.POST /admin/purge/post`
|
973
|
+
*/
|
974
|
+
LemmyHttp.prototype.purgePost = function (form) {
|
975
|
+
return __awaiter(this, void 0, void 0, function () {
|
976
|
+
return __generator(this, function (_a) {
|
977
|
+
return [2 /*return*/, this.wrapper(HttpType.Post, "/admin/purge/post", form, site_1.PurgeItemResponse)];
|
978
|
+
});
|
979
|
+
});
|
980
|
+
};
|
981
|
+
/**
|
982
|
+
* Purge / Delete a comment from the database.
|
983
|
+
*
|
984
|
+
* `HTTP.POST /admin/purge/comment`
|
985
|
+
*/
|
986
|
+
LemmyHttp.prototype.purgeComment = function (form) {
|
987
|
+
return __awaiter(this, void 0, void 0, function () {
|
988
|
+
return __generator(this, function (_a) {
|
989
|
+
return [2 /*return*/, this.wrapper(HttpType.Post, "/admin/purge/comment", form, site_1.PurgeItemResponse)];
|
990
|
+
});
|
991
|
+
});
|
992
|
+
};
|
945
993
|
LemmyHttp.prototype.buildFullUrl = function (endpoint) {
|
946
994
|
return "".concat(this.apiUrl).concat(endpoint);
|
947
995
|
};
|
@@ -1,7 +1,7 @@
|
|
1
1
|
import { Option } from "@sniptt/monads";
|
2
2
|
import "reflect-metadata";
|
3
3
|
import { ListingType, SearchType, SortType } from "../others";
|
4
|
-
import { CommentView, CommunityBlockView, CommunityFollowerView, CommunityModeratorView, CommunityView, LocalUserSettingsView, ModAddCommunityView, ModAddView, ModBanFromCommunityView, ModBanView, ModLockPostView, ModRemoveCommentView, ModRemoveCommunityView, ModRemovePostView, ModStickyPostView, ModTransferCommunityView, PersonBlockView, PersonViewSafe, PostView, RegistrationApplicationView, SiteView } from "../views";
|
4
|
+
import { AdminPurgeCommentView, AdminPurgeCommunityView, AdminPurgePersonView, AdminPurgePostView, CommentView, CommunityBlockView, CommunityFollowerView, CommunityModeratorView, CommunityView, LocalUserSettingsView, ModAddCommunityView, ModAddView, ModBanFromCommunityView, ModBanView, ModLockPostView, ModRemoveCommentView, ModRemoveCommunityView, ModRemovePostView, ModStickyPostView, ModTransferCommunityView, PersonBlockView, PersonViewSafe, PostView, RegistrationApplicationView, SiteView } from "../views";
|
5
5
|
/**
|
6
6
|
* Search lemmy for different types of data.
|
7
7
|
*/
|
@@ -50,6 +50,10 @@ export declare class GetModlogResponse {
|
|
50
50
|
added_to_community: ModAddCommunityView[];
|
51
51
|
transferred_to_community: ModTransferCommunityView[];
|
52
52
|
added: ModAddView[];
|
53
|
+
admin_purged_persons: AdminPurgePersonView[];
|
54
|
+
admin_purged_communities: AdminPurgeCommunityView[];
|
55
|
+
admin_purged_posts: AdminPurgePostView[];
|
56
|
+
admin_purged_comments: AdminPurgeCommentView[];
|
53
57
|
}
|
54
58
|
export declare class CreateSite {
|
55
59
|
name: string;
|
@@ -142,6 +146,33 @@ export declare class ResolveObjectResponse {
|
|
142
146
|
community: Option<CommunityView>;
|
143
147
|
person: Option<PersonViewSafe>;
|
144
148
|
}
|
149
|
+
export declare class PurgePerson {
|
150
|
+
person_id: number;
|
151
|
+
reason: Option<string>;
|
152
|
+
auth: string;
|
153
|
+
constructor(init: PurgePerson);
|
154
|
+
}
|
155
|
+
export declare class PurgeCommunity {
|
156
|
+
community_id: number;
|
157
|
+
reason: Option<string>;
|
158
|
+
auth: string;
|
159
|
+
constructor(init: PurgeCommunity);
|
160
|
+
}
|
161
|
+
export declare class PurgePost {
|
162
|
+
post_id: number;
|
163
|
+
reason: Option<string>;
|
164
|
+
auth: string;
|
165
|
+
constructor(init: PurgePost);
|
166
|
+
}
|
167
|
+
export declare class PurgeComment {
|
168
|
+
comment_id: number;
|
169
|
+
reason: Option<string>;
|
170
|
+
auth: string;
|
171
|
+
constructor(init: PurgeComment);
|
172
|
+
}
|
173
|
+
export declare class PurgeItemResponse {
|
174
|
+
success: boolean;
|
175
|
+
}
|
145
176
|
export declare class ListRegistrationApplications {
|
146
177
|
/**
|
147
178
|
* Only shows the unread applications (IE those without an admin actor)
|
@@ -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.GetUnreadRegistrationApplicationCountResponse = exports.GetUnreadRegistrationApplicationCount = exports.RegistrationApplicationResponse = exports.ApproveRegistrationApplication = exports.ListRegistrationApplicationsResponse = exports.ListRegistrationApplications = exports.ResolveObjectResponse = exports.ResolveObject = exports.FederatedInstances = exports.LeaveAdmin = exports.MyUserInfo = exports.GetSiteResponse = exports.SiteResponse = exports.GetSite = exports.EditSite = exports.CreateSite = exports.GetModlogResponse = exports.GetModlog = exports.SearchResponse = exports.Search = void 0;
|
9
|
+
exports.GetUnreadRegistrationApplicationCountResponse = exports.GetUnreadRegistrationApplicationCount = exports.RegistrationApplicationResponse = exports.ApproveRegistrationApplication = exports.ListRegistrationApplicationsResponse = exports.ListRegistrationApplications = exports.PurgeItemResponse = exports.PurgeComment = exports.PurgePost = exports.PurgeCommunity = exports.PurgePerson = exports.ResolveObjectResponse = exports.ResolveObject = exports.FederatedInstances = exports.LeaveAdmin = exports.MyUserInfo = exports.GetSiteResponse = exports.SiteResponse = exports.GetSite = exports.EditSite = exports.CreateSite = exports.GetModlogResponse = exports.GetModlog = exports.SearchResponse = exports.Search = void 0;
|
10
10
|
var class_transformer_1 = require("class-transformer");
|
11
11
|
require("reflect-metadata");
|
12
12
|
var utils_1 = require("../../utils");
|
@@ -233,6 +233,18 @@ var GetModlogResponse = /** @class */ (function () {
|
|
233
233
|
__decorate([
|
234
234
|
(0, class_transformer_1.Type)(function () { return views_1.ModAddView; })
|
235
235
|
], GetModlogResponse.prototype, "added", void 0);
|
236
|
+
__decorate([
|
237
|
+
(0, class_transformer_1.Type)(function () { return views_1.AdminPurgePersonView; })
|
238
|
+
], GetModlogResponse.prototype, "admin_purged_persons", void 0);
|
239
|
+
__decorate([
|
240
|
+
(0, class_transformer_1.Type)(function () { return views_1.AdminPurgeCommunityView; })
|
241
|
+
], GetModlogResponse.prototype, "admin_purged_communities", void 0);
|
242
|
+
__decorate([
|
243
|
+
(0, class_transformer_1.Type)(function () { return views_1.AdminPurgePostView; })
|
244
|
+
], GetModlogResponse.prototype, "admin_purged_posts", void 0);
|
245
|
+
__decorate([
|
246
|
+
(0, class_transformer_1.Type)(function () { return views_1.AdminPurgeCommentView; })
|
247
|
+
], GetModlogResponse.prototype, "admin_purged_comments", void 0);
|
236
248
|
return GetModlogResponse;
|
237
249
|
}());
|
238
250
|
exports.GetModlogResponse = GetModlogResponse;
|
@@ -784,6 +796,84 @@ var ResolveObjectResponse = /** @class */ (function () {
|
|
784
796
|
return ResolveObjectResponse;
|
785
797
|
}());
|
786
798
|
exports.ResolveObjectResponse = ResolveObjectResponse;
|
799
|
+
var PurgePerson = /** @class */ (function () {
|
800
|
+
function PurgePerson(init) {
|
801
|
+
Object.assign(this, init);
|
802
|
+
}
|
803
|
+
__decorate([
|
804
|
+
(0, class_transformer_1.Transform)(function (_a) {
|
805
|
+
var value = _a.value;
|
806
|
+
return (0, utils_1.toOption)(value);
|
807
|
+
}, { toClassOnly: true }),
|
808
|
+
(0, class_transformer_1.Transform)(function (_a) {
|
809
|
+
var value = _a.value;
|
810
|
+
return (0, utils_1.toUndefined)(value);
|
811
|
+
}, { toPlainOnly: true }),
|
812
|
+
(0, class_transformer_1.Expose)()
|
813
|
+
], PurgePerson.prototype, "reason", void 0);
|
814
|
+
return PurgePerson;
|
815
|
+
}());
|
816
|
+
exports.PurgePerson = PurgePerson;
|
817
|
+
var PurgeCommunity = /** @class */ (function () {
|
818
|
+
function PurgeCommunity(init) {
|
819
|
+
Object.assign(this, init);
|
820
|
+
}
|
821
|
+
__decorate([
|
822
|
+
(0, class_transformer_1.Transform)(function (_a) {
|
823
|
+
var value = _a.value;
|
824
|
+
return (0, utils_1.toOption)(value);
|
825
|
+
}, { toClassOnly: true }),
|
826
|
+
(0, class_transformer_1.Transform)(function (_a) {
|
827
|
+
var value = _a.value;
|
828
|
+
return (0, utils_1.toUndefined)(value);
|
829
|
+
}, { toPlainOnly: true }),
|
830
|
+
(0, class_transformer_1.Expose)()
|
831
|
+
], PurgeCommunity.prototype, "reason", void 0);
|
832
|
+
return PurgeCommunity;
|
833
|
+
}());
|
834
|
+
exports.PurgeCommunity = PurgeCommunity;
|
835
|
+
var PurgePost = /** @class */ (function () {
|
836
|
+
function PurgePost(init) {
|
837
|
+
Object.assign(this, init);
|
838
|
+
}
|
839
|
+
__decorate([
|
840
|
+
(0, class_transformer_1.Transform)(function (_a) {
|
841
|
+
var value = _a.value;
|
842
|
+
return (0, utils_1.toOption)(value);
|
843
|
+
}, { toClassOnly: true }),
|
844
|
+
(0, class_transformer_1.Transform)(function (_a) {
|
845
|
+
var value = _a.value;
|
846
|
+
return (0, utils_1.toUndefined)(value);
|
847
|
+
}, { toPlainOnly: true }),
|
848
|
+
(0, class_transformer_1.Expose)()
|
849
|
+
], PurgePost.prototype, "reason", void 0);
|
850
|
+
return PurgePost;
|
851
|
+
}());
|
852
|
+
exports.PurgePost = PurgePost;
|
853
|
+
var PurgeComment = /** @class */ (function () {
|
854
|
+
function PurgeComment(init) {
|
855
|
+
Object.assign(this, init);
|
856
|
+
}
|
857
|
+
__decorate([
|
858
|
+
(0, class_transformer_1.Transform)(function (_a) {
|
859
|
+
var value = _a.value;
|
860
|
+
return (0, utils_1.toOption)(value);
|
861
|
+
}, { toClassOnly: true }),
|
862
|
+
(0, class_transformer_1.Transform)(function (_a) {
|
863
|
+
var value = _a.value;
|
864
|
+
return (0, utils_1.toUndefined)(value);
|
865
|
+
}, { toPlainOnly: true }),
|
866
|
+
(0, class_transformer_1.Expose)()
|
867
|
+
], PurgeComment.prototype, "reason", void 0);
|
868
|
+
return PurgeComment;
|
869
|
+
}());
|
870
|
+
exports.PurgeComment = PurgeComment;
|
871
|
+
var PurgeItemResponse = /** @class */ (function () {
|
872
|
+
function PurgeItemResponse() {
|
873
|
+
}
|
874
|
+
return PurgeItemResponse;
|
875
|
+
}());
|
876
|
+
exports.PurgeItemResponse = PurgeItemResponse;
|
787
877
|
var ListRegistrationApplications = /** @class */ (function () {
|
788
878
|
function ListRegistrationApplications(init) {
|
789
879
|
Object.assign(this, init);
|
@@ -70,15 +70,19 @@ export declare enum UserOperation {
|
|
70
70
|
GetSiteMetadata = 63,
|
71
71
|
BlockCommunity = 64,
|
72
72
|
BlockPerson = 65,
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
73
|
+
PurgePerson = 66,
|
74
|
+
PurgeCommunity = 67,
|
75
|
+
PurgePost = 68,
|
76
|
+
PurgeComment = 69,
|
77
|
+
CreateCommentReport = 70,
|
78
|
+
ResolveCommentReport = 71,
|
79
|
+
ListCommentReports = 72,
|
80
|
+
CreatePostReport = 73,
|
81
|
+
ResolvePostReport = 74,
|
82
|
+
ListPostReports = 75,
|
83
|
+
GetReportCount = 76,
|
84
|
+
GetUnreadCount = 77,
|
85
|
+
VerifyEmail = 78
|
82
86
|
}
|
83
87
|
/**
|
84
88
|
* Different sort types used in lemmy.
|
@@ -81,15 +81,19 @@ var UserOperation;
|
|
81
81
|
UserOperation[UserOperation["GetSiteMetadata"] = 63] = "GetSiteMetadata";
|
82
82
|
UserOperation[UserOperation["BlockCommunity"] = 64] = "BlockCommunity";
|
83
83
|
UserOperation[UserOperation["BlockPerson"] = 65] = "BlockPerson";
|
84
|
-
UserOperation[UserOperation["
|
85
|
-
UserOperation[UserOperation["
|
86
|
-
UserOperation[UserOperation["
|
87
|
-
UserOperation[UserOperation["
|
88
|
-
UserOperation[UserOperation["
|
89
|
-
UserOperation[UserOperation["
|
90
|
-
UserOperation[UserOperation["
|
91
|
-
UserOperation[UserOperation["
|
92
|
-
UserOperation[UserOperation["
|
84
|
+
UserOperation[UserOperation["PurgePerson"] = 66] = "PurgePerson";
|
85
|
+
UserOperation[UserOperation["PurgeCommunity"] = 67] = "PurgeCommunity";
|
86
|
+
UserOperation[UserOperation["PurgePost"] = 68] = "PurgePost";
|
87
|
+
UserOperation[UserOperation["PurgeComment"] = 69] = "PurgeComment";
|
88
|
+
UserOperation[UserOperation["CreateCommentReport"] = 70] = "CreateCommentReport";
|
89
|
+
UserOperation[UserOperation["ResolveCommentReport"] = 71] = "ResolveCommentReport";
|
90
|
+
UserOperation[UserOperation["ListCommentReports"] = 72] = "ListCommentReports";
|
91
|
+
UserOperation[UserOperation["CreatePostReport"] = 73] = "CreatePostReport";
|
92
|
+
UserOperation[UserOperation["ResolvePostReport"] = 74] = "ResolvePostReport";
|
93
|
+
UserOperation[UserOperation["ListPostReports"] = 75] = "ListPostReports";
|
94
|
+
UserOperation[UserOperation["GetReportCount"] = 76] = "GetReportCount";
|
95
|
+
UserOperation[UserOperation["GetUnreadCount"] = 77] = "GetUnreadCount";
|
96
|
+
UserOperation[UserOperation["VerifyEmail"] = 78] = "VerifyEmail";
|
93
97
|
})(UserOperation = exports.UserOperation || (exports.UserOperation = {}));
|
94
98
|
/**
|
95
99
|
* Different sort types used in lemmy.
|
@@ -195,6 +195,32 @@ export declare class ModAdd {
|
|
195
195
|
removed: Option<boolean>;
|
196
196
|
when_: string;
|
197
197
|
}
|
198
|
+
export declare class AdminPurgePerson {
|
199
|
+
id: number;
|
200
|
+
admin_person_id: number;
|
201
|
+
reason: Option<string>;
|
202
|
+
when_: string;
|
203
|
+
}
|
204
|
+
export declare class AdminPurgeCommunity {
|
205
|
+
id: number;
|
206
|
+
admin_person_id: number;
|
207
|
+
reason: Option<string>;
|
208
|
+
when_: string;
|
209
|
+
}
|
210
|
+
export declare class AdminPurgePost {
|
211
|
+
id: number;
|
212
|
+
admin_person_id: number;
|
213
|
+
community_id: number;
|
214
|
+
reason: Option<string>;
|
215
|
+
when_: string;
|
216
|
+
}
|
217
|
+
export declare class AdminPurgeComment {
|
218
|
+
id: number;
|
219
|
+
admin_person_id: number;
|
220
|
+
post_id: number;
|
221
|
+
reason: Option<string>;
|
222
|
+
when_: string;
|
223
|
+
}
|
198
224
|
export declare class CommunitySafe {
|
199
225
|
id: number;
|
200
226
|
name: string;
|
@@ -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.RegistrationApplication = exports.PersonMention = exports.Comment = exports.CommentReport = exports.CommunitySafe = exports.ModAdd = exports.ModTransferCommunity = exports.ModAddCommunity = exports.ModBan = exports.ModBanFromCommunity = exports.ModRemoveCommunity = exports.ModRemoveComment = exports.ModStickyPost = exports.ModLockPost = exports.ModRemovePost = exports.PasswordResetRequest = exports.Post = exports.PostReport = exports.PrivateMessage = exports.Site = exports.PersonSafe = exports.LocalUserSettings = void 0;
|
9
|
+
exports.RegistrationApplication = exports.PersonMention = exports.Comment = exports.CommentReport = exports.CommunitySafe = exports.AdminPurgeComment = exports.AdminPurgePost = exports.AdminPurgeCommunity = exports.AdminPurgePerson = exports.ModAdd = exports.ModTransferCommunity = exports.ModAddCommunity = exports.ModBan = exports.ModBanFromCommunity = exports.ModRemoveCommunity = exports.ModRemoveComment = exports.ModStickyPost = exports.ModLockPost = exports.ModRemovePost = exports.PasswordResetRequest = exports.Post = exports.PostReport = exports.PrivateMessage = exports.Site = exports.PersonSafe = exports.LocalUserSettings = void 0;
|
10
10
|
var class_transformer_1 = require("class-transformer");
|
11
11
|
var utils_1 = require("../utils");
|
12
12
|
var LocalUserSettings = /** @class */ (function () {
|
@@ -606,6 +606,74 @@ var ModAdd = /** @class */ (function () {
|
|
606
606
|
return ModAdd;
|
607
607
|
}());
|
608
608
|
exports.ModAdd = ModAdd;
|
609
|
+
var AdminPurgePerson = /** @class */ (function () {
|
610
|
+
function AdminPurgePerson() {
|
611
|
+
}
|
612
|
+
__decorate([
|
613
|
+
(0, class_transformer_1.Transform)(function (_a) {
|
614
|
+
var value = _a.value;
|
615
|
+
return (0, utils_1.toOption)(value);
|
616
|
+
}, { toClassOnly: true }),
|
617
|
+
(0, class_transformer_1.Transform)(function (_a) {
|
618
|
+
var value = _a.value;
|
619
|
+
return (0, utils_1.toUndefined)(value);
|
620
|
+
}, { toPlainOnly: true }),
|
621
|
+
(0, class_transformer_1.Expose)()
|
622
|
+
], AdminPurgePerson.prototype, "reason", void 0);
|
623
|
+
return AdminPurgePerson;
|
624
|
+
}());
|
625
|
+
exports.AdminPurgePerson = AdminPurgePerson;
|
626
|
+
var AdminPurgeCommunity = /** @class */ (function () {
|
627
|
+
function AdminPurgeCommunity() {
|
628
|
+
}
|
629
|
+
__decorate([
|
630
|
+
(0, class_transformer_1.Transform)(function (_a) {
|
631
|
+
var value = _a.value;
|
632
|
+
return (0, utils_1.toOption)(value);
|
633
|
+
}, { toClassOnly: true }),
|
634
|
+
(0, class_transformer_1.Transform)(function (_a) {
|
635
|
+
var value = _a.value;
|
636
|
+
return (0, utils_1.toUndefined)(value);
|
637
|
+
}, { toPlainOnly: true }),
|
638
|
+
(0, class_transformer_1.Expose)()
|
639
|
+
], AdminPurgeCommunity.prototype, "reason", void 0);
|
640
|
+
return AdminPurgeCommunity;
|
641
|
+
}());
|
642
|
+
exports.AdminPurgeCommunity = AdminPurgeCommunity;
|
643
|
+
var AdminPurgePost = /** @class */ (function () {
|
644
|
+
function AdminPurgePost() {
|
645
|
+
}
|
646
|
+
__decorate([
|
647
|
+
(0, class_transformer_1.Transform)(function (_a) {
|
648
|
+
var value = _a.value;
|
649
|
+
return (0, utils_1.toOption)(value);
|
650
|
+
}, { toClassOnly: true }),
|
651
|
+
(0, class_transformer_1.Transform)(function (_a) {
|
652
|
+
var value = _a.value;
|
653
|
+
return (0, utils_1.toUndefined)(value);
|
654
|
+
}, { toPlainOnly: true }),
|
655
|
+
(0, class_transformer_1.Expose)()
|
656
|
+
], AdminPurgePost.prototype, "reason", void 0);
|
657
|
+
return AdminPurgePost;
|
658
|
+
}());
|
659
|
+
exports.AdminPurgePost = AdminPurgePost;
|
660
|
+
var AdminPurgeComment = /** @class */ (function () {
|
661
|
+
function AdminPurgeComment() {
|
662
|
+
}
|
663
|
+
__decorate([
|
664
|
+
(0, class_transformer_1.Transform)(function (_a) {
|
665
|
+
var value = _a.value;
|
666
|
+
return (0, utils_1.toOption)(value);
|
667
|
+
}, { toClassOnly: true }),
|
668
|
+
(0, class_transformer_1.Transform)(function (_a) {
|
669
|
+
var value = _a.value;
|
670
|
+
return (0, utils_1.toUndefined)(value);
|
671
|
+
}, { toPlainOnly: true }),
|
672
|
+
(0, class_transformer_1.Expose)()
|
673
|
+
], AdminPurgeComment.prototype, "reason", void 0);
|
674
|
+
return AdminPurgeComment;
|
675
|
+
}());
|
676
|
+
exports.AdminPurgeComment = AdminPurgeComment;
|
609
677
|
var CommunitySafe = /** @class */ (function () {
|
610
678
|
function CommunitySafe() {
|
611
679
|
}
|
@@ -2,7 +2,7 @@ import { Option } from "@sniptt/monads";
|
|
2
2
|
import "reflect-metadata";
|
3
3
|
import { CommentAggregates, CommunityAggregates, PersonAggregates, PostAggregates, SiteAggregates } from "./aggregates";
|
4
4
|
import { SubscribedType } from "./others";
|
5
|
-
import { Comment, CommentReport, CommunitySafe, LocalUserSettings, ModAdd, ModAddCommunity, ModBan, ModBanFromCommunity, ModLockPost, ModRemoveComment, ModRemoveCommunity, ModRemovePost, ModStickyPost, ModTransferCommunity, PersonMention, PersonSafe, Post, PostReport, PrivateMessage, RegistrationApplication, Site } from "./source";
|
5
|
+
import { AdminPurgeComment, AdminPurgeCommunity, AdminPurgePerson, AdminPurgePost, Comment, CommentReport, CommunitySafe, LocalUserSettings, ModAdd, ModAddCommunity, ModBan, ModBanFromCommunity, ModLockPost, ModRemoveComment, ModRemoveCommunity, ModRemovePost, ModStickyPost, ModTransferCommunity, PersonMention, PersonSafe, Post, PostReport, PrivateMessage, RegistrationApplication, Site } from "./source";
|
6
6
|
export declare class PersonViewSafe {
|
7
7
|
person: PersonSafe;
|
8
8
|
counts: PersonAggregates;
|
@@ -142,6 +142,24 @@ export declare class ModStickyPostView {
|
|
142
142
|
post: Post;
|
143
143
|
community: CommunitySafe;
|
144
144
|
}
|
145
|
+
export declare class AdminPurgeCommunityView {
|
146
|
+
admin_purge_community: AdminPurgeCommunity;
|
147
|
+
admin: PersonSafe;
|
148
|
+
}
|
149
|
+
export declare class AdminPurgePersonView {
|
150
|
+
admin_purge_person: AdminPurgePerson;
|
151
|
+
admin: PersonSafe;
|
152
|
+
}
|
153
|
+
export declare class AdminPurgePostView {
|
154
|
+
admin_purge_post: AdminPurgePost;
|
155
|
+
admin: PersonSafe;
|
156
|
+
community: CommunitySafe;
|
157
|
+
}
|
158
|
+
export declare class AdminPurgeCommentView {
|
159
|
+
admin_purge_comment: AdminPurgeComment;
|
160
|
+
admin: PersonSafe;
|
161
|
+
post: Post;
|
162
|
+
}
|
145
163
|
export declare class CommunityFollowerView {
|
146
164
|
community: CommunitySafe;
|
147
165
|
follower: PersonSafe;
|
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.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");
|
@@ -426,6 +426,60 @@ var ModStickyPostView = /** @class */ (function () {
|
|
426
426
|
return ModStickyPostView;
|
427
427
|
}());
|
428
428
|
exports.ModStickyPostView = ModStickyPostView;
|
429
|
+
var AdminPurgeCommunityView = /** @class */ (function () {
|
430
|
+
function AdminPurgeCommunityView() {
|
431
|
+
}
|
432
|
+
__decorate([
|
433
|
+
(0, class_transformer_1.Type)(function () { return source_1.AdminPurgeCommunity; })
|
434
|
+
], AdminPurgeCommunityView.prototype, "admin_purge_community", void 0);
|
435
|
+
__decorate([
|
436
|
+
(0, class_transformer_1.Type)(function () { return source_1.PersonSafe; })
|
437
|
+
], AdminPurgeCommunityView.prototype, "admin", void 0);
|
438
|
+
return AdminPurgeCommunityView;
|
439
|
+
}());
|
440
|
+
exports.AdminPurgeCommunityView = AdminPurgeCommunityView;
|
441
|
+
var AdminPurgePersonView = /** @class */ (function () {
|
442
|
+
function AdminPurgePersonView() {
|
443
|
+
}
|
444
|
+
__decorate([
|
445
|
+
(0, class_transformer_1.Type)(function () { return source_1.AdminPurgePerson; })
|
446
|
+
], AdminPurgePersonView.prototype, "admin_purge_person", void 0);
|
447
|
+
__decorate([
|
448
|
+
(0, class_transformer_1.Type)(function () { return source_1.PersonSafe; })
|
449
|
+
], AdminPurgePersonView.prototype, "admin", void 0);
|
450
|
+
return AdminPurgePersonView;
|
451
|
+
}());
|
452
|
+
exports.AdminPurgePersonView = AdminPurgePersonView;
|
453
|
+
var AdminPurgePostView = /** @class */ (function () {
|
454
|
+
function AdminPurgePostView() {
|
455
|
+
}
|
456
|
+
__decorate([
|
457
|
+
(0, class_transformer_1.Type)(function () { return source_1.AdminPurgePost; })
|
458
|
+
], AdminPurgePostView.prototype, "admin_purge_post", void 0);
|
459
|
+
__decorate([
|
460
|
+
(0, class_transformer_1.Type)(function () { return source_1.PersonSafe; })
|
461
|
+
], AdminPurgePostView.prototype, "admin", void 0);
|
462
|
+
__decorate([
|
463
|
+
(0, class_transformer_1.Type)(function () { return source_1.CommunitySafe; })
|
464
|
+
], AdminPurgePostView.prototype, "community", void 0);
|
465
|
+
return AdminPurgePostView;
|
466
|
+
}());
|
467
|
+
exports.AdminPurgePostView = AdminPurgePostView;
|
468
|
+
var AdminPurgeCommentView = /** @class */ (function () {
|
469
|
+
function AdminPurgeCommentView() {
|
470
|
+
}
|
471
|
+
__decorate([
|
472
|
+
(0, class_transformer_1.Type)(function () { return source_1.AdminPurgeComment; })
|
473
|
+
], AdminPurgeCommentView.prototype, "admin_purge_comment", void 0);
|
474
|
+
__decorate([
|
475
|
+
(0, class_transformer_1.Type)(function () { return source_1.PersonSafe; })
|
476
|
+
], AdminPurgeCommentView.prototype, "admin", void 0);
|
477
|
+
__decorate([
|
478
|
+
(0, class_transformer_1.Type)(function () { return source_1.Post; })
|
479
|
+
], AdminPurgeCommentView.prototype, "post", void 0);
|
480
|
+
return AdminPurgeCommentView;
|
481
|
+
}());
|
482
|
+
exports.AdminPurgeCommentView = AdminPurgeCommentView;
|
429
483
|
var CommunityFollowerView = /** @class */ (function () {
|
430
484
|
function CommunityFollowerView() {
|
431
485
|
}
|
package/dist/websocket.d.ts
CHANGED
@@ -3,7 +3,7 @@ import { CreateComment, CreateCommentLike, CreateCommentReport, DeleteComment, E
|
|
3
3
|
import { AddModToCommunity, BanFromCommunity, BlockCommunity, CreateCommunity, DeleteCommunity, EditCommunity, FollowCommunity, GetCommunity, ListCommunities, RemoveCommunity, TransferCommunity } from "./interfaces/api/community";
|
4
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";
|
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, GetUnreadRegistrationApplicationCount, LeaveAdmin, ListRegistrationApplications, ResolveObject, Search } from "./interfaces/api/site";
|
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
|
/**
|
@@ -323,6 +323,22 @@ export declare class LemmyWebsocket {
|
|
323
323
|
* Block a community.
|
324
324
|
*/
|
325
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;
|
326
342
|
}
|
327
343
|
export declare function wsUserOp(msg: any): UserOperation;
|
328
344
|
/**
|
package/dist/websocket.js
CHANGED
@@ -471,6 +471,30 @@ var LemmyWebsocket = /** @class */ (function () {
|
|
471
471
|
LemmyWebsocket.prototype.blockCommunity = function (form) {
|
472
472
|
return wrapper(others_1.UserOperation.BlockCommunity, form);
|
473
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
|
+
};
|
474
498
|
return LemmyWebsocket;
|
475
499
|
}());
|
476
500
|
exports.LemmyWebsocket = LemmyWebsocket;
|
package/package.json
CHANGED