lemmy-js-client 0.17.0-rc.38 → 0.17.0-rc.40
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 +3 -3
- package/dist/http.js +12 -13
- 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 +2 -0
- package/dist/interfaces/api/site.js +22 -0
- package/dist/interfaces/others.d.ts +53 -24
- package/dist/interfaces/others.js +54 -24
- package/dist/interfaces/source.d.ts +9 -2
- package/dist/interfaces/source.js +7 -12
- package/dist/interfaces/views.d.ts +20 -2
- package/dist/interfaces/views.js +31 -8
- package/dist/websocket.d.ts +3 -3
- package/dist/websocket.js +2 -2
- package/package.json +12 -12
package/dist/http.d.ts
CHANGED
@@ -1,6 +1,6 @@
|
|
1
|
-
import { CommentReportResponse, CommentResponse, CreateComment, CreateCommentLike, CreateCommentReport, DeleteComment, EditComment, GetComments, GetCommentsResponse, ListCommentReports, ListCommentReportsResponse,
|
1
|
+
import { CommentReportResponse, CommentResponse, CreateComment, CreateCommentLike, CreateCommentReport, DeleteComment, EditComment, GetComments, GetCommentsResponse, ListCommentReports, ListCommentReportsResponse, RemoveComment, ResolveCommentReport, SaveComment } from "./interfaces/api/comment";
|
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
|
-
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";
|
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, MarkCommentReplyAsRead, 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
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
|
/**
|
@@ -244,7 +244,7 @@ export declare class LemmyHttp {
|
|
244
244
|
*
|
245
245
|
* `HTTP.POST /comment/mark_as_read`
|
246
246
|
*/
|
247
|
-
|
247
|
+
markCommentReplyAsRead(form: MarkCommentReplyAsRead): Promise<CommentResponse>;
|
248
248
|
/**
|
249
249
|
* Like / vote on a comment.
|
250
250
|
*
|
package/dist/http.js
CHANGED
@@ -527,7 +527,7 @@ var LemmyHttp = /** @class */ (function () {
|
|
527
527
|
*
|
528
528
|
* `HTTP.POST /comment/mark_as_read`
|
529
529
|
*/
|
530
|
-
LemmyHttp.prototype.
|
530
|
+
LemmyHttp.prototype.markCommentReplyAsRead = function (form) {
|
531
531
|
return __awaiter(this, void 0, void 0, function () {
|
532
532
|
return __generator(this, function (_a) {
|
533
533
|
return [2 /*return*/, this.wrapper(HttpType.Post, "/comment/mark_as_read", form, comment_1.CommentResponse)];
|
@@ -999,25 +999,25 @@ var LemmyHttp = /** @class */ (function () {
|
|
999
999
|
return __generator(this, function (_a) {
|
1000
1000
|
if (type_ == HttpType.Get) {
|
1001
1001
|
getUrl = "".concat(this.buildFullUrl(endpoint), "?").concat(encodeGetParams(form));
|
1002
|
-
return [2 /*return*/, (
|
1002
|
+
return [2 /*return*/, (0, node_fetch_1.default)(getUrl, {
|
1003
1003
|
method: "GET",
|
1004
1004
|
headers: this.headers,
|
1005
|
-
})
|
1006
|
-
// TODO test this
|
1007
|
-
.then(function (d) {
|
1005
|
+
}).then(function (d) {
|
1008
1006
|
return d
|
1009
1007
|
.text()
|
1010
|
-
.then(function (a) {
|
1011
|
-
|
1012
|
-
});
|
1013
|
-
}))];
|
1008
|
+
.then(function (a) { return (0, class_transformer_1.deserialize)(responseClass, a); });
|
1009
|
+
})];
|
1014
1010
|
}
|
1015
1011
|
else {
|
1016
1012
|
return [2 /*return*/, (0, node_fetch_1.default)(this.buildFullUrl(endpoint), {
|
1017
1013
|
method: type_,
|
1018
1014
|
headers: __assign({ "Content-Type": "application/json" }, this.headers),
|
1019
1015
|
body: (0, class_transformer_1.serialize)(form),
|
1020
|
-
}).then(function (d) {
|
1016
|
+
}).then(function (d) {
|
1017
|
+
return d
|
1018
|
+
.text()
|
1019
|
+
.then(function (a) { return (0, class_transformer_1.deserialize)(responseClass, a); });
|
1020
|
+
})];
|
1021
1021
|
}
|
1022
1022
|
return [2 /*return*/];
|
1023
1023
|
});
|
@@ -1029,8 +1029,7 @@ exports.LemmyHttp = LemmyHttp;
|
|
1029
1029
|
function encodeGetParams(p) {
|
1030
1030
|
// Necessary to remove the Options
|
1031
1031
|
var serialized = JSON.parse((0, class_transformer_1.serialize)(p));
|
1032
|
-
return
|
1033
|
-
// TODO test this, it might serialize the undefineds
|
1032
|
+
return Object.entries(serialized)
|
1034
1033
|
.map(function (kv) { return kv.map(encodeURIComponent).join("="); })
|
1035
|
-
.join("&")
|
1034
|
+
.join("&");
|
1036
1035
|
}
|
@@ -1,6 +1,6 @@
|
|
1
1
|
import { Option } from "@sniptt/monads";
|
2
2
|
import "reflect-metadata";
|
3
|
-
import {
|
3
|
+
import { CommentSortType, ListingType } from "../others";
|
4
4
|
import { CommentReportView, CommentView } from "../views";
|
5
5
|
export declare class CreateComment {
|
6
6
|
content: string;
|
@@ -42,15 +42,6 @@ export declare class RemoveComment {
|
|
42
42
|
auth: string;
|
43
43
|
constructor(init: RemoveComment);
|
44
44
|
}
|
45
|
-
/**
|
46
|
-
* Only the recipient can do this.
|
47
|
-
*/
|
48
|
-
export declare class MarkCommentAsRead {
|
49
|
-
comment_id: number;
|
50
|
-
read: boolean;
|
51
|
-
auth: string;
|
52
|
-
constructor(init: MarkCommentAsRead);
|
53
|
-
}
|
54
45
|
export declare class SaveComment {
|
55
46
|
comment_id: number;
|
56
47
|
save: boolean;
|
@@ -79,11 +70,14 @@ export declare class CreateCommentLike {
|
|
79
70
|
*/
|
80
71
|
export declare class GetComments {
|
81
72
|
type_: Option<ListingType>;
|
82
|
-
sort: Option<
|
73
|
+
sort: Option<CommentSortType>;
|
74
|
+
max_depth: Option<number>;
|
83
75
|
page: Option<number>;
|
84
76
|
limit: Option<number>;
|
85
77
|
community_id: Option<number>;
|
86
78
|
community_name: Option<string>;
|
79
|
+
post_id: Option<number>;
|
80
|
+
parent_id: Option<number>;
|
87
81
|
saved_only: Option<boolean>;
|
88
82
|
auth: Option<string>;
|
89
83
|
constructor(init: GetComments);
|
@@ -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.ListCommentReportsResponse = exports.ListCommentReports = exports.ResolveCommentReport = exports.CommentReportResponse = exports.CreateCommentReport = exports.GetCommentsResponse = exports.GetComments = exports.CreateCommentLike = exports.CommentResponse = exports.SaveComment = exports.
|
9
|
+
exports.ListCommentReportsResponse = exports.ListCommentReports = exports.ResolveCommentReport = exports.CommentReportResponse = exports.CreateCommentReport = exports.GetCommentsResponse = exports.GetComments = exports.CreateCommentLike = exports.CommentResponse = exports.SaveComment = exports.RemoveComment = exports.DeleteComment = exports.EditComment = exports.CreateComment = void 0;
|
10
10
|
var class_transformer_1 = require("class-transformer");
|
11
11
|
require("reflect-metadata");
|
12
12
|
var utils_1 = require("../../utils");
|
@@ -89,16 +89,6 @@ var RemoveComment = /** @class */ (function () {
|
|
89
89
|
return RemoveComment;
|
90
90
|
}());
|
91
91
|
exports.RemoveComment = RemoveComment;
|
92
|
-
/**
|
93
|
-
* Only the recipient can do this.
|
94
|
-
*/
|
95
|
-
var MarkCommentAsRead = /** @class */ (function () {
|
96
|
-
function MarkCommentAsRead(init) {
|
97
|
-
Object.assign(this, init);
|
98
|
-
}
|
99
|
-
return MarkCommentAsRead;
|
100
|
-
}());
|
101
|
-
exports.MarkCommentAsRead = MarkCommentAsRead;
|
102
92
|
var SaveComment = /** @class */ (function () {
|
103
93
|
function SaveComment(init) {
|
104
94
|
Object.assign(this, init);
|
@@ -165,6 +155,17 @@ var GetComments = /** @class */ (function () {
|
|
165
155
|
}, { toPlainOnly: true }),
|
166
156
|
(0, class_transformer_1.Expose)()
|
167
157
|
], GetComments.prototype, "sort", void 0);
|
158
|
+
__decorate([
|
159
|
+
(0, class_transformer_1.Transform)(function (_a) {
|
160
|
+
var value = _a.value;
|
161
|
+
return (0, utils_1.toOption)(value);
|
162
|
+
}, { toClassOnly: true }),
|
163
|
+
(0, class_transformer_1.Transform)(function (_a) {
|
164
|
+
var value = _a.value;
|
165
|
+
return (0, utils_1.toUndefined)(value);
|
166
|
+
}, { toPlainOnly: true }),
|
167
|
+
(0, class_transformer_1.Expose)()
|
168
|
+
], GetComments.prototype, "max_depth", void 0);
|
168
169
|
__decorate([
|
169
170
|
(0, class_transformer_1.Transform)(function (_a) {
|
170
171
|
var value = _a.value;
|
@@ -209,6 +210,28 @@ var GetComments = /** @class */ (function () {
|
|
209
210
|
}, { toPlainOnly: true }),
|
210
211
|
(0, class_transformer_1.Expose)()
|
211
212
|
], GetComments.prototype, "community_name", void 0);
|
213
|
+
__decorate([
|
214
|
+
(0, class_transformer_1.Transform)(function (_a) {
|
215
|
+
var value = _a.value;
|
216
|
+
return (0, utils_1.toOption)(value);
|
217
|
+
}, { toClassOnly: true }),
|
218
|
+
(0, class_transformer_1.Transform)(function (_a) {
|
219
|
+
var value = _a.value;
|
220
|
+
return (0, utils_1.toUndefined)(value);
|
221
|
+
}, { toPlainOnly: true }),
|
222
|
+
(0, class_transformer_1.Expose)()
|
223
|
+
], GetComments.prototype, "post_id", void 0);
|
224
|
+
__decorate([
|
225
|
+
(0, class_transformer_1.Transform)(function (_a) {
|
226
|
+
var value = _a.value;
|
227
|
+
return (0, utils_1.toOption)(value);
|
228
|
+
}, { toClassOnly: true }),
|
229
|
+
(0, class_transformer_1.Transform)(function (_a) {
|
230
|
+
var value = _a.value;
|
231
|
+
return (0, utils_1.toUndefined)(value);
|
232
|
+
}, { toPlainOnly: true }),
|
233
|
+
(0, class_transformer_1.Expose)()
|
234
|
+
], GetComments.prototype, "parent_id", void 0);
|
212
235
|
__decorate([
|
213
236
|
(0, class_transformer_1.Transform)(function (_a) {
|
214
237
|
var value = _a.value;
|
@@ -1,7 +1,7 @@
|
|
1
1
|
import { Option } from "@sniptt/monads";
|
2
2
|
import "reflect-metadata";
|
3
|
-
import { SortType } from "../others";
|
4
|
-
import { CommentView, CommunityModeratorView, PersonMentionView, PersonViewSafe, PostView, PrivateMessageView } from "../views";
|
3
|
+
import { CommentSortType, SortType } from "../others";
|
4
|
+
import { CommentReplyView, CommentView, CommunityModeratorView, PersonMentionView, PersonViewSafe, PostView, PrivateMessageView } from "../views";
|
5
5
|
export declare class Login {
|
6
6
|
username_or_email: string;
|
7
7
|
password: string;
|
@@ -129,7 +129,7 @@ export declare class GetPersonDetailsResponse {
|
|
129
129
|
moderates: CommunityModeratorView[];
|
130
130
|
}
|
131
131
|
export declare class GetRepliesResponse {
|
132
|
-
replies:
|
132
|
+
replies: CommentReplyView[];
|
133
133
|
}
|
134
134
|
export declare class GetPersonMentionsResponse {
|
135
135
|
mentions: PersonMentionView[];
|
@@ -167,7 +167,7 @@ export declare class BanPersonResponse {
|
|
167
167
|
banned: boolean;
|
168
168
|
}
|
169
169
|
export declare class GetReplies {
|
170
|
-
sort: Option<
|
170
|
+
sort: Option<CommentSortType>;
|
171
171
|
page: Option<number>;
|
172
172
|
limit: Option<number>;
|
173
173
|
unread_only: Option<boolean>;
|
@@ -175,7 +175,7 @@ export declare class GetReplies {
|
|
175
175
|
constructor(init: GetReplies);
|
176
176
|
}
|
177
177
|
export declare class GetPersonMentions {
|
178
|
-
sort: Option<
|
178
|
+
sort: Option<CommentSortType>;
|
179
179
|
page: Option<number>;
|
180
180
|
limit: Option<number>;
|
181
181
|
unread_only: Option<boolean>;
|
@@ -191,6 +191,15 @@ export declare class MarkPersonMentionAsRead {
|
|
191
191
|
export declare class PersonMentionResponse {
|
192
192
|
person_mention_view: PersonMentionView;
|
193
193
|
}
|
194
|
+
export declare class MarkCommentReplyAsRead {
|
195
|
+
comment_reply_id: number;
|
196
|
+
read: boolean;
|
197
|
+
auth: string;
|
198
|
+
constructor(init: MarkCommentReplyAsRead);
|
199
|
+
}
|
200
|
+
export declare class CommentReplyResponse {
|
201
|
+
comment_reply_view: CommentReplyView;
|
202
|
+
}
|
194
203
|
/**
|
195
204
|
* Permanently deletes your posts and comments
|
196
205
|
*/
|
@@ -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.BannedPersonsResponse = exports.GetBannedPersons = exports.BlockPersonResponse = exports.BlockPerson = exports.VerifyEmailResponse = exports.VerifyEmail = exports.GetUnreadCountResponse = exports.GetUnreadCount = exports.GetReportCountResponse = exports.GetReportCount = exports.PrivateMessageResponse = exports.PrivateMessagesResponse = exports.GetPrivateMessages = exports.MarkPrivateMessageAsRead = exports.DeletePrivateMessage = exports.EditPrivateMessage = exports.CreatePrivateMessage = exports.PasswordChange = exports.PasswordResetResponse = exports.PasswordReset = exports.DeleteAccountResponse = exports.DeleteAccount = exports.PersonMentionResponse = exports.MarkPersonMentionAsRead = exports.GetPersonMentions = exports.GetReplies = exports.BanPersonResponse = exports.BanPerson = exports.AddAdminResponse = exports.AddAdmin = exports.MarkAllAsRead = exports.GetPersonMentionsResponse = exports.GetRepliesResponse = exports.GetPersonDetailsResponse = exports.GetPersonDetails = exports.LoginResponse = exports.ChangePassword = exports.SaveUserSettings = exports.CaptchaResponse = exports.GetCaptchaResponse = exports.GetCaptcha = exports.Register = exports.Login = void 0;
|
9
|
+
exports.BannedPersonsResponse = exports.GetBannedPersons = exports.BlockPersonResponse = exports.BlockPerson = exports.VerifyEmailResponse = exports.VerifyEmail = exports.GetUnreadCountResponse = exports.GetUnreadCount = exports.GetReportCountResponse = exports.GetReportCount = exports.PrivateMessageResponse = exports.PrivateMessagesResponse = exports.GetPrivateMessages = exports.MarkPrivateMessageAsRead = exports.DeletePrivateMessage = exports.EditPrivateMessage = exports.CreatePrivateMessage = exports.PasswordChange = exports.PasswordResetResponse = exports.PasswordReset = exports.DeleteAccountResponse = exports.DeleteAccount = exports.CommentReplyResponse = exports.MarkCommentReplyAsRead = exports.PersonMentionResponse = exports.MarkPersonMentionAsRead = exports.GetPersonMentions = exports.GetReplies = exports.BanPersonResponse = exports.BanPerson = exports.AddAdminResponse = exports.AddAdmin = exports.MarkAllAsRead = exports.GetPersonMentionsResponse = exports.GetRepliesResponse = exports.GetPersonDetailsResponse = exports.GetPersonDetails = exports.LoginResponse = exports.ChangePassword = exports.SaveUserSettings = exports.CaptchaResponse = exports.GetCaptchaResponse = exports.GetCaptcha = exports.Register = exports.Login = void 0;
|
10
10
|
var class_transformer_1 = require("class-transformer");
|
11
11
|
require("reflect-metadata");
|
12
12
|
var utils_1 = require("../../utils");
|
@@ -475,7 +475,7 @@ var GetRepliesResponse = /** @class */ (function () {
|
|
475
475
|
function GetRepliesResponse() {
|
476
476
|
}
|
477
477
|
__decorate([
|
478
|
-
(0, class_transformer_1.Type)(function () { return views_1.
|
478
|
+
(0, class_transformer_1.Type)(function () { return views_1.CommentReplyView; })
|
479
479
|
], GetRepliesResponse.prototype, "replies", void 0);
|
480
480
|
return GetRepliesResponse;
|
481
481
|
}());
|
@@ -679,6 +679,22 @@ var PersonMentionResponse = /** @class */ (function () {
|
|
679
679
|
return PersonMentionResponse;
|
680
680
|
}());
|
681
681
|
exports.PersonMentionResponse = PersonMentionResponse;
|
682
|
+
var MarkCommentReplyAsRead = /** @class */ (function () {
|
683
|
+
function MarkCommentReplyAsRead(init) {
|
684
|
+
Object.assign(this, init);
|
685
|
+
}
|
686
|
+
return MarkCommentReplyAsRead;
|
687
|
+
}());
|
688
|
+
exports.MarkCommentReplyAsRead = MarkCommentReplyAsRead;
|
689
|
+
var CommentReplyResponse = /** @class */ (function () {
|
690
|
+
function CommentReplyResponse() {
|
691
|
+
}
|
692
|
+
__decorate([
|
693
|
+
(0, class_transformer_1.Type)(function () { return views_1.CommentReplyView; })
|
694
|
+
], CommentReplyResponse.prototype, "comment_reply_view", void 0);
|
695
|
+
return CommentReplyResponse;
|
696
|
+
}());
|
697
|
+
exports.CommentReplyResponse = CommentReplyResponse;
|
682
698
|
/**
|
683
699
|
* Permanently deletes your posts and comments
|
684
700
|
*/
|
@@ -1,7 +1,7 @@
|
|
1
1
|
import { Option } from "@sniptt/monads";
|
2
2
|
import "reflect-metadata";
|
3
3
|
import { ListingType, SiteMetadata, SortType } from "../others";
|
4
|
-
import {
|
4
|
+
import { CommunityModeratorView, CommunityView, PostReportView, PostView } from "../views";
|
5
5
|
export declare class CreatePost {
|
6
6
|
name: string;
|
7
7
|
url: Option<string>;
|
@@ -16,14 +16,14 @@ export declare class PostResponse {
|
|
16
16
|
post_view: PostView;
|
17
17
|
}
|
18
18
|
export declare class GetPost {
|
19
|
-
id: number
|
19
|
+
id: Option<number>;
|
20
|
+
comment_id: Option<number>;
|
20
21
|
auth: Option<string>;
|
21
22
|
constructor(init: GetPost);
|
22
23
|
}
|
23
24
|
export declare class GetPostResponse {
|
24
25
|
post_view: PostView;
|
25
26
|
community_view: CommunityView;
|
26
|
-
comments: CommentView[];
|
27
27
|
moderators: CommunityModeratorView[];
|
28
28
|
online: number;
|
29
29
|
}
|
@@ -76,6 +76,28 @@ var GetPost = /** @class */ (function () {
|
|
76
76
|
function GetPost(init) {
|
77
77
|
Object.assign(this, init);
|
78
78
|
}
|
79
|
+
__decorate([
|
80
|
+
(0, class_transformer_1.Transform)(function (_a) {
|
81
|
+
var value = _a.value;
|
82
|
+
return (0, utils_1.toOption)(value);
|
83
|
+
}, { toClassOnly: true }),
|
84
|
+
(0, class_transformer_1.Transform)(function (_a) {
|
85
|
+
var value = _a.value;
|
86
|
+
return (0, utils_1.toUndefined)(value);
|
87
|
+
}, { toPlainOnly: true }),
|
88
|
+
(0, class_transformer_1.Expose)()
|
89
|
+
], GetPost.prototype, "id", void 0);
|
90
|
+
__decorate([
|
91
|
+
(0, class_transformer_1.Transform)(function (_a) {
|
92
|
+
var value = _a.value;
|
93
|
+
return (0, utils_1.toOption)(value);
|
94
|
+
}, { toClassOnly: true }),
|
95
|
+
(0, class_transformer_1.Transform)(function (_a) {
|
96
|
+
var value = _a.value;
|
97
|
+
return (0, utils_1.toUndefined)(value);
|
98
|
+
}, { toPlainOnly: true }),
|
99
|
+
(0, class_transformer_1.Expose)()
|
100
|
+
], GetPost.prototype, "comment_id", void 0);
|
79
101
|
__decorate([
|
80
102
|
(0, class_transformer_1.Transform)(function (_a) {
|
81
103
|
var value = _a.value;
|
@@ -99,9 +121,6 @@ var GetPostResponse = /** @class */ (function () {
|
|
99
121
|
__decorate([
|
100
122
|
(0, class_transformer_1.Type)(function () { return views_1.CommunityView; })
|
101
123
|
], GetPostResponse.prototype, "community_view", void 0);
|
102
|
-
__decorate([
|
103
|
-
(0, class_transformer_1.Type)(function () { return views_1.CommentView; })
|
104
|
-
], GetPostResponse.prototype, "comments", void 0);
|
105
124
|
__decorate([
|
106
125
|
(0, class_transformer_1.Type)(function () { return views_1.CommunityModeratorView; })
|
107
126
|
], GetPostResponse.prototype, "moderators", void 0);
|
@@ -71,6 +71,7 @@ export declare class CreateSite {
|
|
71
71
|
private_instance: Option<boolean>;
|
72
72
|
default_theme: Option<string>;
|
73
73
|
default_post_listing_type: Option<string>;
|
74
|
+
application_email_admins: Option<boolean>;
|
74
75
|
auth: string;
|
75
76
|
constructor(init: CreateSite);
|
76
77
|
}
|
@@ -91,6 +92,7 @@ export declare class EditSite {
|
|
91
92
|
default_theme: Option<string>;
|
92
93
|
legal_information: Option<string>;
|
93
94
|
default_post_listing_type: Option<string>;
|
95
|
+
application_email_admins: Option<boolean>;
|
94
96
|
auth: string;
|
95
97
|
constructor(init: EditSite);
|
96
98
|
}
|
@@ -406,6 +406,17 @@ var CreateSite = /** @class */ (function () {
|
|
406
406
|
}, { toPlainOnly: true }),
|
407
407
|
(0, class_transformer_1.Expose)()
|
408
408
|
], CreateSite.prototype, "default_post_listing_type", void 0);
|
409
|
+
__decorate([
|
410
|
+
(0, class_transformer_1.Transform)(function (_a) {
|
411
|
+
var value = _a.value;
|
412
|
+
return (0, utils_1.toOption)(value);
|
413
|
+
}, { toClassOnly: true }),
|
414
|
+
(0, class_transformer_1.Transform)(function (_a) {
|
415
|
+
var value = _a.value;
|
416
|
+
return (0, utils_1.toUndefined)(value);
|
417
|
+
}, { toPlainOnly: true }),
|
418
|
+
(0, class_transformer_1.Expose)()
|
419
|
+
], CreateSite.prototype, "application_email_admins", void 0);
|
409
420
|
return CreateSite;
|
410
421
|
}());
|
411
422
|
exports.CreateSite = CreateSite;
|
@@ -589,6 +600,17 @@ var EditSite = /** @class */ (function () {
|
|
589
600
|
}, { toPlainOnly: true }),
|
590
601
|
(0, class_transformer_1.Expose)()
|
591
602
|
], EditSite.prototype, "default_post_listing_type", void 0);
|
603
|
+
__decorate([
|
604
|
+
(0, class_transformer_1.Transform)(function (_a) {
|
605
|
+
var value = _a.value;
|
606
|
+
return (0, utils_1.toOption)(value);
|
607
|
+
}, { toClassOnly: true }),
|
608
|
+
(0, class_transformer_1.Transform)(function (_a) {
|
609
|
+
var value = _a.value;
|
610
|
+
return (0, utils_1.toUndefined)(value);
|
611
|
+
}, { toPlainOnly: true }),
|
612
|
+
(0, class_transformer_1.Expose)()
|
613
|
+
], EditSite.prototype, "application_email_admins", void 0);
|
592
614
|
return EditSite;
|
593
615
|
}());
|
594
616
|
exports.EditSite = EditSite;
|
@@ -16,26 +16,26 @@ export declare enum UserOperation {
|
|
16
16
|
EditComment = 9,
|
17
17
|
DeleteComment = 10,
|
18
18
|
RemoveComment = 11,
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
19
|
+
SaveComment = 12,
|
20
|
+
CreateCommentLike = 13,
|
21
|
+
GetPosts = 14,
|
22
|
+
CreatePostLike = 15,
|
23
|
+
EditPost = 16,
|
24
|
+
DeletePost = 17,
|
25
|
+
RemovePost = 18,
|
26
|
+
LockPost = 19,
|
27
|
+
StickyPost = 20,
|
28
|
+
MarkPostAsRead = 21,
|
29
|
+
SavePost = 22,
|
30
|
+
EditCommunity = 23,
|
31
|
+
DeleteCommunity = 24,
|
32
|
+
RemoveCommunity = 25,
|
33
|
+
FollowCommunity = 26,
|
34
|
+
GetPersonDetails = 27,
|
35
|
+
GetReplies = 28,
|
36
|
+
GetPersonMentions = 29,
|
37
|
+
MarkPersonMentionAsRead = 30,
|
38
|
+
MarkCommentReplyAsRead = 31,
|
39
39
|
GetModlog = 32,
|
40
40
|
BanFromCommunity = 33,
|
41
41
|
AddModToCommunity = 34,
|
@@ -85,18 +85,25 @@ export declare enum UserOperation {
|
|
85
85
|
VerifyEmail = 78
|
86
86
|
}
|
87
87
|
/**
|
88
|
-
* Different sort types used in lemmy.
|
88
|
+
* Different post sort types used in lemmy.
|
89
89
|
*/
|
90
90
|
export declare enum SortType {
|
91
91
|
/**
|
92
|
-
* Posts sorted by
|
92
|
+
* Posts sorted by hot, but bumped by new comments up to 2 days
|
93
93
|
*/
|
94
94
|
Active = "Active",
|
95
95
|
/**
|
96
|
-
* Posts sorted by
|
96
|
+
* Posts sorted by a decaying rank.
|
97
97
|
*/
|
98
98
|
Hot = "Hot",
|
99
|
+
/**
|
100
|
+
* Posts sorted by the published time.
|
101
|
+
*/
|
99
102
|
New = "New",
|
103
|
+
/**
|
104
|
+
* Posts sorted by the published time ascending
|
105
|
+
*/
|
106
|
+
Old = "Old",
|
100
107
|
/**
|
101
108
|
* The top posts for this last day.
|
102
109
|
*/
|
@@ -126,13 +133,35 @@ export declare enum SortType {
|
|
126
133
|
*/
|
127
134
|
NewComments = "NewComments"
|
128
135
|
}
|
136
|
+
/**
|
137
|
+
* Different comment sort types used in lemmy.
|
138
|
+
*/
|
139
|
+
export declare enum CommentSortType {
|
140
|
+
/**
|
141
|
+
* Comments sorted by a decaying rank.
|
142
|
+
*/
|
143
|
+
Hot = "Hot",
|
144
|
+
/**
|
145
|
+
* Comments sorted by top score.
|
146
|
+
*/
|
147
|
+
Top = "Top",
|
148
|
+
/**
|
149
|
+
* Comments sorted by new.
|
150
|
+
*/
|
151
|
+
New = "New",
|
152
|
+
/**
|
153
|
+
* Comments sorted by old.
|
154
|
+
*/
|
155
|
+
Old = "Old"
|
156
|
+
}
|
129
157
|
/**
|
130
158
|
* The different listing types for post and comment fetches.
|
131
159
|
*/
|
132
160
|
export declare enum ListingType {
|
133
161
|
All = "All",
|
134
162
|
Local = "Local",
|
135
|
-
Subscribed = "Subscribed"
|
163
|
+
Subscribed = "Subscribed",
|
164
|
+
Community = "Community"
|
136
165
|
}
|
137
166
|
/**
|
138
167
|
* Search types for lemmy's search.
|
@@ -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.SiteMetadata = exports.SubscribedType = exports.SearchType = exports.ListingType = exports.SortType = exports.UserOperation = exports.VERSION = void 0;
|
9
|
+
exports.SiteMetadata = exports.SubscribedType = exports.SearchType = exports.ListingType = exports.CommentSortType = exports.SortType = exports.UserOperation = exports.VERSION = void 0;
|
10
10
|
var class_transformer_1 = require("class-transformer");
|
11
11
|
var utils_1 = require("../utils");
|
12
12
|
exports.VERSION = "v3";
|
@@ -27,26 +27,26 @@ var UserOperation;
|
|
27
27
|
UserOperation[UserOperation["EditComment"] = 9] = "EditComment";
|
28
28
|
UserOperation[UserOperation["DeleteComment"] = 10] = "DeleteComment";
|
29
29
|
UserOperation[UserOperation["RemoveComment"] = 11] = "RemoveComment";
|
30
|
-
UserOperation[UserOperation["
|
31
|
-
UserOperation[UserOperation["
|
32
|
-
UserOperation[UserOperation["
|
33
|
-
UserOperation[UserOperation["
|
34
|
-
UserOperation[UserOperation["
|
35
|
-
UserOperation[UserOperation["
|
36
|
-
UserOperation[UserOperation["
|
37
|
-
UserOperation[UserOperation["
|
38
|
-
UserOperation[UserOperation["
|
39
|
-
UserOperation[UserOperation["
|
40
|
-
UserOperation[UserOperation["
|
41
|
-
UserOperation[UserOperation["
|
42
|
-
UserOperation[UserOperation["
|
43
|
-
UserOperation[UserOperation["
|
44
|
-
UserOperation[UserOperation["
|
45
|
-
UserOperation[UserOperation["
|
46
|
-
UserOperation[UserOperation["
|
47
|
-
UserOperation[UserOperation["
|
48
|
-
UserOperation[UserOperation["
|
49
|
-
UserOperation[UserOperation["
|
30
|
+
UserOperation[UserOperation["SaveComment"] = 12] = "SaveComment";
|
31
|
+
UserOperation[UserOperation["CreateCommentLike"] = 13] = "CreateCommentLike";
|
32
|
+
UserOperation[UserOperation["GetPosts"] = 14] = "GetPosts";
|
33
|
+
UserOperation[UserOperation["CreatePostLike"] = 15] = "CreatePostLike";
|
34
|
+
UserOperation[UserOperation["EditPost"] = 16] = "EditPost";
|
35
|
+
UserOperation[UserOperation["DeletePost"] = 17] = "DeletePost";
|
36
|
+
UserOperation[UserOperation["RemovePost"] = 18] = "RemovePost";
|
37
|
+
UserOperation[UserOperation["LockPost"] = 19] = "LockPost";
|
38
|
+
UserOperation[UserOperation["StickyPost"] = 20] = "StickyPost";
|
39
|
+
UserOperation[UserOperation["MarkPostAsRead"] = 21] = "MarkPostAsRead";
|
40
|
+
UserOperation[UserOperation["SavePost"] = 22] = "SavePost";
|
41
|
+
UserOperation[UserOperation["EditCommunity"] = 23] = "EditCommunity";
|
42
|
+
UserOperation[UserOperation["DeleteCommunity"] = 24] = "DeleteCommunity";
|
43
|
+
UserOperation[UserOperation["RemoveCommunity"] = 25] = "RemoveCommunity";
|
44
|
+
UserOperation[UserOperation["FollowCommunity"] = 26] = "FollowCommunity";
|
45
|
+
UserOperation[UserOperation["GetPersonDetails"] = 27] = "GetPersonDetails";
|
46
|
+
UserOperation[UserOperation["GetReplies"] = 28] = "GetReplies";
|
47
|
+
UserOperation[UserOperation["GetPersonMentions"] = 29] = "GetPersonMentions";
|
48
|
+
UserOperation[UserOperation["MarkPersonMentionAsRead"] = 30] = "MarkPersonMentionAsRead";
|
49
|
+
UserOperation[UserOperation["MarkCommentReplyAsRead"] = 31] = "MarkCommentReplyAsRead";
|
50
50
|
UserOperation[UserOperation["GetModlog"] = 32] = "GetModlog";
|
51
51
|
UserOperation[UserOperation["BanFromCommunity"] = 33] = "BanFromCommunity";
|
52
52
|
UserOperation[UserOperation["AddModToCommunity"] = 34] = "AddModToCommunity";
|
@@ -96,19 +96,26 @@ var UserOperation;
|
|
96
96
|
UserOperation[UserOperation["VerifyEmail"] = 78] = "VerifyEmail";
|
97
97
|
})(UserOperation = exports.UserOperation || (exports.UserOperation = {}));
|
98
98
|
/**
|
99
|
-
* Different sort types used in lemmy.
|
99
|
+
* Different post sort types used in lemmy.
|
100
100
|
*/
|
101
101
|
var SortType;
|
102
102
|
(function (SortType) {
|
103
103
|
/**
|
104
|
-
* Posts sorted by
|
104
|
+
* Posts sorted by hot, but bumped by new comments up to 2 days
|
105
105
|
*/
|
106
106
|
SortType["Active"] = "Active";
|
107
107
|
/**
|
108
|
-
* Posts sorted by
|
108
|
+
* Posts sorted by a decaying rank.
|
109
109
|
*/
|
110
110
|
SortType["Hot"] = "Hot";
|
111
|
+
/**
|
112
|
+
* Posts sorted by the published time.
|
113
|
+
*/
|
111
114
|
SortType["New"] = "New";
|
115
|
+
/**
|
116
|
+
* Posts sorted by the published time ascending
|
117
|
+
*/
|
118
|
+
SortType["Old"] = "Old";
|
112
119
|
/**
|
113
120
|
* The top posts for this last day.
|
114
121
|
*/
|
@@ -138,6 +145,28 @@ var SortType;
|
|
138
145
|
*/
|
139
146
|
SortType["NewComments"] = "NewComments";
|
140
147
|
})(SortType = exports.SortType || (exports.SortType = {}));
|
148
|
+
/**
|
149
|
+
* Different comment sort types used in lemmy.
|
150
|
+
*/
|
151
|
+
var CommentSortType;
|
152
|
+
(function (CommentSortType) {
|
153
|
+
/**
|
154
|
+
* Comments sorted by a decaying rank.
|
155
|
+
*/
|
156
|
+
CommentSortType["Hot"] = "Hot";
|
157
|
+
/**
|
158
|
+
* Comments sorted by top score.
|
159
|
+
*/
|
160
|
+
CommentSortType["Top"] = "Top";
|
161
|
+
/**
|
162
|
+
* Comments sorted by new.
|
163
|
+
*/
|
164
|
+
CommentSortType["New"] = "New";
|
165
|
+
/**
|
166
|
+
* Comments sorted by old.
|
167
|
+
*/
|
168
|
+
CommentSortType["Old"] = "Old";
|
169
|
+
})(CommentSortType = exports.CommentSortType || (exports.CommentSortType = {}));
|
141
170
|
/**
|
142
171
|
* The different listing types for post and comment fetches.
|
143
172
|
*/
|
@@ -146,6 +175,7 @@ var ListingType;
|
|
146
175
|
ListingType["All"] = "All";
|
147
176
|
ListingType["Local"] = "Local";
|
148
177
|
ListingType["Subscribed"] = "Subscribed";
|
178
|
+
ListingType["Community"] = "Community";
|
149
179
|
})(ListingType = exports.ListingType || (exports.ListingType = {}));
|
150
180
|
/**
|
151
181
|
* Search types for lemmy's search.
|
@@ -61,6 +61,7 @@ export declare class Site {
|
|
61
61
|
inbox_url: string;
|
62
62
|
public_key: string;
|
63
63
|
legal_information: Option<string>;
|
64
|
+
application_email_admins: boolean;
|
64
65
|
}
|
65
66
|
export declare class PrivateMessage {
|
66
67
|
id: number;
|
@@ -252,15 +253,14 @@ export declare class Comment {
|
|
252
253
|
id: number;
|
253
254
|
creator_id: number;
|
254
255
|
post_id: number;
|
255
|
-
parent_id: Option<number>;
|
256
256
|
content: string;
|
257
257
|
removed: boolean;
|
258
|
-
read: boolean;
|
259
258
|
published: string;
|
260
259
|
updated: Option<string>;
|
261
260
|
deleted: boolean;
|
262
261
|
ap_id: string;
|
263
262
|
local: boolean;
|
263
|
+
path: string;
|
264
264
|
}
|
265
265
|
export declare class PersonMention {
|
266
266
|
id: number;
|
@@ -269,6 +269,13 @@ export declare class PersonMention {
|
|
269
269
|
read: boolean;
|
270
270
|
published: string;
|
271
271
|
}
|
272
|
+
export declare class CommentReply {
|
273
|
+
id: number;
|
274
|
+
recipient_id: number;
|
275
|
+
comment_id: number;
|
276
|
+
read: boolean;
|
277
|
+
published: string;
|
278
|
+
}
|
272
279
|
export declare class RegistrationApplication {
|
273
280
|
id: number;
|
274
281
|
local_user_id: number;
|
@@ -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.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;
|
9
|
+
exports.RegistrationApplication = exports.CommentReply = 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 () {
|
@@ -755,17 +755,6 @@ exports.CommentReport = CommentReport;
|
|
755
755
|
var Comment = /** @class */ (function () {
|
756
756
|
function Comment() {
|
757
757
|
}
|
758
|
-
__decorate([
|
759
|
-
(0, class_transformer_1.Transform)(function (_a) {
|
760
|
-
var value = _a.value;
|
761
|
-
return (0, utils_1.toOption)(value);
|
762
|
-
}, { toClassOnly: true }),
|
763
|
-
(0, class_transformer_1.Transform)(function (_a) {
|
764
|
-
var value = _a.value;
|
765
|
-
return (0, utils_1.toUndefined)(value);
|
766
|
-
}, { toPlainOnly: true }),
|
767
|
-
(0, class_transformer_1.Expose)()
|
768
|
-
], Comment.prototype, "parent_id", void 0);
|
769
758
|
__decorate([
|
770
759
|
(0, class_transformer_1.Transform)(function (_a) {
|
771
760
|
var value = _a.value;
|
@@ -786,6 +775,12 @@ var PersonMention = /** @class */ (function () {
|
|
786
775
|
return PersonMention;
|
787
776
|
}());
|
788
777
|
exports.PersonMention = PersonMention;
|
778
|
+
var CommentReply = /** @class */ (function () {
|
779
|
+
function CommentReply() {
|
780
|
+
}
|
781
|
+
return CommentReply;
|
782
|
+
}());
|
783
|
+
exports.CommentReply = CommentReply;
|
789
784
|
var RegistrationApplication = /** @class */ (function () {
|
790
785
|
function RegistrationApplication() {
|
791
786
|
}
|
@@ -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 { 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";
|
5
|
+
import { AdminPurgeComment, AdminPurgeCommunity, AdminPurgePerson, AdminPurgePost, Comment, CommentReply, 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;
|
@@ -61,7 +61,6 @@ export declare class PostReportView {
|
|
61
61
|
export declare class CommentView {
|
62
62
|
comment: Comment;
|
63
63
|
creator: PersonSafe;
|
64
|
-
recipient: Option<PersonSafe>;
|
65
64
|
post: Post;
|
66
65
|
community: CommunitySafe;
|
67
66
|
counts: CommentAggregates;
|
@@ -71,6 +70,20 @@ export declare class CommentView {
|
|
71
70
|
creator_blocked: boolean;
|
72
71
|
my_vote: Option<number>;
|
73
72
|
}
|
73
|
+
export declare class CommentReplyView {
|
74
|
+
comment_reply: CommentReply;
|
75
|
+
comment: Comment;
|
76
|
+
creator: PersonSafe;
|
77
|
+
post: Post;
|
78
|
+
community: CommunitySafe;
|
79
|
+
recipient: PersonSafe;
|
80
|
+
counts: CommentAggregates;
|
81
|
+
creator_banned_from_community: boolean;
|
82
|
+
subscribed: SubscribedType;
|
83
|
+
saved: boolean;
|
84
|
+
creator_blocked: boolean;
|
85
|
+
my_vote: Option<number>;
|
86
|
+
}
|
74
87
|
export declare class CommentReportView {
|
75
88
|
comment_report: CommentReport;
|
76
89
|
comment: Comment;
|
@@ -192,3 +205,8 @@ export declare class RegistrationApplicationView {
|
|
192
205
|
creator: PersonSafe;
|
193
206
|
admin: Option<PersonSafe>;
|
194
207
|
}
|
208
|
+
export interface CommentNode {
|
209
|
+
comment_view: CommentView | PersonMentionView | CommentReplyView;
|
210
|
+
children: CommentNode[];
|
211
|
+
depth: number;
|
212
|
+
}
|
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.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;
|
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
|
}
|
package/dist/websocket.d.ts
CHANGED
@@ -1,7 +1,7 @@
|
|
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
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";
|
@@ -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
|
*/
|
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.
|
package/package.json
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
{
|
2
2
|
"name": "lemmy-js-client",
|
3
3
|
"description": "A javascript / typescript client for Lemmy",
|
4
|
-
"version": "0.17.0-rc.
|
4
|
+
"version": "0.17.0-rc.40",
|
5
5
|
"author": "Dessalines <tyhou13@gmx.com>",
|
6
6
|
"license": "AGPL-3.0",
|
7
7
|
"main": "./dist/index.js",
|
@@ -17,25 +17,25 @@
|
|
17
17
|
"repository": "https://github.com/LemmyNet/lemmy-js-client",
|
18
18
|
"devDependencies": {
|
19
19
|
"@sniptt/monads": "^0.5.10",
|
20
|
-
"@types/node": "^
|
20
|
+
"@types/node": "^18.6.2",
|
21
21
|
"@types/node-fetch": "^3.0.3",
|
22
|
-
"@typescript-eslint/eslint-plugin": "^5.
|
23
|
-
"@typescript-eslint/parser": "^5.
|
22
|
+
"@typescript-eslint/eslint-plugin": "^5.31.0",
|
23
|
+
"@typescript-eslint/parser": "^5.31.0",
|
24
24
|
"class-transformer": "^0.5.1",
|
25
|
-
"eslint": "^8.
|
26
|
-
"eslint-plugin-prettier": "^4.
|
25
|
+
"eslint": "^8.20.0",
|
26
|
+
"eslint-plugin-prettier": "^4.2.1",
|
27
27
|
"husky": "^8.0.1",
|
28
|
-
"lint-staged": "^
|
29
|
-
"node-fetch": "^3.2.
|
30
|
-
"prettier": "^2.
|
28
|
+
"lint-staged": "^13.0.3",
|
29
|
+
"node-fetch": "^3.2.9",
|
30
|
+
"prettier": "^2.7.1",
|
31
31
|
"prettier-plugin-import-sort": "^0.0.7",
|
32
|
-
"prettier-plugin-organize-imports": "^
|
32
|
+
"prettier-plugin-organize-imports": "^3.0.0",
|
33
33
|
"prettier-plugin-packagejson": "^2.2.18",
|
34
34
|
"reflect-metadata": "^0.1.13",
|
35
|
-
"sortpack": "^2.
|
35
|
+
"sortpack": "^2.3.0",
|
36
36
|
"typedoc": "^0.21.6",
|
37
37
|
"typedoc-plugin-sourcefile-url": "^1.0.6",
|
38
|
-
"typescript": "^4.
|
38
|
+
"typescript": "^4.7.4"
|
39
39
|
},
|
40
40
|
"types": "./dist/index.d.ts",
|
41
41
|
"lint-staged": {
|