lemmy-js-client 0.17.0-rc.1 → 0.17.0-rc.12
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/http.d.ts +103 -5
- package/dist/http.js +129 -1
- package/dist/index.js +5 -1
- package/dist/interfaces/api/comment.d.ts +3 -8
- package/dist/interfaces/api/community.d.ts +4 -12
- package/dist/interfaces/api/index.js +5 -1
- package/dist/interfaces/api/person.d.ts +4 -9
- package/dist/interfaces/api/post.d.ts +11 -11
- package/dist/interfaces/api/site.d.ts +35 -13
- package/dist/interfaces/index.js +5 -1
- package/dist/interfaces/others.d.ts +59 -54
- package/dist/interfaces/others.js +59 -54
- package/dist/interfaces/source.d.ts +28 -0
- package/dist/interfaces/views.d.ts +19 -3
- package/dist/websocket.d.ts +22 -2
- package/dist/websocket.js +30 -0
- package/package.json +11 -11
@@ -1,3 +1,4 @@
|
|
1
|
+
import { SortType } from "../others";
|
1
2
|
import { CommentView, CommunityModeratorView, PersonMentionView, PersonViewSafe, PostView, PrivateMessageView } from "../views";
|
2
3
|
export interface Login {
|
3
4
|
username_or_email: string;
|
@@ -107,7 +108,7 @@ export interface GetPersonDetails {
|
|
107
108
|
* To get details for a federated user, use `person@instance.tld`.
|
108
109
|
*/
|
109
110
|
username?: string;
|
110
|
-
sort?:
|
111
|
+
sort?: SortType;
|
111
112
|
page?: number;
|
112
113
|
limit?: number;
|
113
114
|
community_id?: number;
|
@@ -156,20 +157,14 @@ export interface BanPersonResponse {
|
|
156
157
|
banned: boolean;
|
157
158
|
}
|
158
159
|
export interface GetReplies {
|
159
|
-
|
160
|
-
* The [[SortType]].
|
161
|
-
*/
|
162
|
-
sort?: string;
|
160
|
+
sort?: SortType;
|
163
161
|
page?: number;
|
164
162
|
limit?: number;
|
165
163
|
unread_only?: boolean;
|
166
164
|
auth: string;
|
167
165
|
}
|
168
166
|
export interface GetPersonMentions {
|
169
|
-
|
170
|
-
* The [[SortType]].
|
171
|
-
*/
|
172
|
-
sort?: string;
|
167
|
+
sort?: SortType;
|
173
168
|
page?: number;
|
174
169
|
limit?: number;
|
175
170
|
unread_only?: boolean;
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import { SiteMetadata } from "
|
1
|
+
import { ListingType, SiteMetadata, SortType } from "../others";
|
2
2
|
import { CommentView, CommunityModeratorView, CommunityView, PostReportView, PostView } from "../views";
|
3
3
|
export interface CreatePost {
|
4
4
|
name: string;
|
@@ -24,16 +24,8 @@ export interface GetPostResponse {
|
|
24
24
|
online: number;
|
25
25
|
}
|
26
26
|
export interface GetPosts {
|
27
|
-
|
28
|
-
|
29
|
-
*
|
30
|
-
* Post listing types are `All, Subscribed, Community`
|
31
|
-
*/
|
32
|
-
type_?: string;
|
33
|
-
/**
|
34
|
-
* The [[SortType]].
|
35
|
-
*/
|
36
|
-
sort?: string;
|
27
|
+
type_?: ListingType;
|
28
|
+
sort?: SortType;
|
37
29
|
page?: number;
|
38
30
|
limit?: number;
|
39
31
|
community_id?: number;
|
@@ -77,6 +69,14 @@ export interface RemovePost {
|
|
77
69
|
reason?: string;
|
78
70
|
auth: string;
|
79
71
|
}
|
72
|
+
/**
|
73
|
+
* Marks a post as read.
|
74
|
+
*/
|
75
|
+
export interface MarkPostAsRead {
|
76
|
+
post_id: number;
|
77
|
+
read: boolean;
|
78
|
+
auth: string;
|
79
|
+
}
|
80
80
|
/**
|
81
81
|
* Only admins and mods can lock a post.
|
82
82
|
*/
|
@@ -1,4 +1,5 @@
|
|
1
|
-
import {
|
1
|
+
import { ListingType, SearchType, SortType } from "../others";
|
2
|
+
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";
|
2
3
|
/**
|
3
4
|
* Search lemmy for different types of data.
|
4
5
|
*/
|
@@ -7,21 +8,12 @@ export interface Search {
|
|
7
8
|
* The search query string.
|
8
9
|
*/
|
9
10
|
q: string;
|
10
|
-
|
11
|
-
* The [[SearchType]].
|
12
|
-
*/
|
13
|
-
type_?: string;
|
11
|
+
type_?: SearchType;
|
14
12
|
community_id?: number;
|
15
13
|
community_name?: string;
|
16
14
|
creator_id?: number;
|
17
|
-
|
18
|
-
|
19
|
-
*/
|
20
|
-
sort?: string;
|
21
|
-
/**
|
22
|
-
* The [[ListingType]].
|
23
|
-
*/
|
24
|
-
listing_type?: string;
|
15
|
+
sort?: SortType;
|
16
|
+
listing_type?: ListingType;
|
25
17
|
page?: number;
|
26
18
|
limit?: number;
|
27
19
|
auth?: string;
|
@@ -54,6 +46,10 @@ export interface GetModlogResponse {
|
|
54
46
|
added_to_community: ModAddCommunityView[];
|
55
47
|
transferred_to_community: ModTransferCommunityView[];
|
56
48
|
added: ModAddView[];
|
49
|
+
admin_purged_persons: AdminPurgePersonView[];
|
50
|
+
admin_purged_communities: AdminPurgeCommunityView[];
|
51
|
+
admin_purged_posts: AdminPurgePostView[];
|
52
|
+
admin_purged_comments: AdminPurgeCommentView[];
|
57
53
|
}
|
58
54
|
export interface CreateSite {
|
59
55
|
name: string;
|
@@ -70,6 +66,7 @@ export interface CreateSite {
|
|
70
66
|
application_question?: string;
|
71
67
|
private_instance?: boolean;
|
72
68
|
default_theme?: string;
|
69
|
+
default_post_listing_type?: string;
|
73
70
|
auth: string;
|
74
71
|
}
|
75
72
|
export interface EditSite {
|
@@ -87,6 +84,8 @@ export interface EditSite {
|
|
87
84
|
application_question?: string;
|
88
85
|
private_instance?: boolean;
|
89
86
|
default_theme?: string;
|
87
|
+
legal_information?: string;
|
88
|
+
default_post_listing_type?: string;
|
90
89
|
auth: string;
|
91
90
|
}
|
92
91
|
export interface GetSite {
|
@@ -147,6 +146,29 @@ export interface ResolveObjectResponse {
|
|
147
146
|
community?: CommunityView;
|
148
147
|
person?: PersonViewSafe;
|
149
148
|
}
|
149
|
+
export interface PurgePerson {
|
150
|
+
person_id: number;
|
151
|
+
reason?: string;
|
152
|
+
auth: string;
|
153
|
+
}
|
154
|
+
export interface PurgeCommunity {
|
155
|
+
community_id: number;
|
156
|
+
reason?: string;
|
157
|
+
auth: string;
|
158
|
+
}
|
159
|
+
export interface PurgePost {
|
160
|
+
post_id: number;
|
161
|
+
reason?: string;
|
162
|
+
auth: string;
|
163
|
+
}
|
164
|
+
export interface PurgeComment {
|
165
|
+
comment_id: number;
|
166
|
+
reason?: string;
|
167
|
+
auth: string;
|
168
|
+
}
|
169
|
+
export interface PurgeItemResponse {
|
170
|
+
success: boolean;
|
171
|
+
}
|
150
172
|
export interface ListRegistrationApplications {
|
151
173
|
/**
|
152
174
|
* Only shows the unread applications (IE those without an admin actor)
|
package/dist/interfaces/index.js
CHANGED
@@ -1,7 +1,11 @@
|
|
1
1
|
"use strict";
|
2
2
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
3
3
|
if (k2 === undefined) k2 = k;
|
4
|
-
Object.
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
7
|
+
}
|
8
|
+
Object.defineProperty(o, k2, desc);
|
5
9
|
}) : (function(o, m, k, k2) {
|
6
10
|
if (k2 === undefined) k2 = k;
|
7
11
|
o[k2] = m[k];
|
@@ -25,60 +25,65 @@ export declare enum UserOperation {
|
|
25
25
|
RemovePost = 19,
|
26
26
|
LockPost = 20,
|
27
27
|
StickyPost = 21,
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
28
|
+
MarkPostAsRead = 22,
|
29
|
+
SavePost = 23,
|
30
|
+
EditCommunity = 24,
|
31
|
+
DeleteCommunity = 25,
|
32
|
+
RemoveCommunity = 26,
|
33
|
+
FollowCommunity = 27,
|
34
|
+
GetPersonDetails = 28,
|
35
|
+
GetReplies = 29,
|
36
|
+
GetPersonMentions = 30,
|
37
|
+
MarkPersonMentionAsRead = 31,
|
38
|
+
GetModlog = 32,
|
39
|
+
BanFromCommunity = 33,
|
40
|
+
AddModToCommunity = 34,
|
41
|
+
CreateSite = 35,
|
42
|
+
EditSite = 36,
|
43
|
+
GetSite = 37,
|
44
|
+
AddAdmin = 38,
|
45
|
+
GetUnreadRegistrationApplicationCount = 39,
|
46
|
+
ListRegistrationApplications = 40,
|
47
|
+
ApproveRegistrationApplication = 41,
|
48
|
+
BanPerson = 42,
|
49
|
+
GetBannedPersons = 43,
|
50
|
+
Search = 44,
|
51
|
+
ResolveObject = 45,
|
52
|
+
MarkAllAsRead = 46,
|
53
|
+
SaveUserSettings = 47,
|
54
|
+
TransferCommunity = 48,
|
55
|
+
LeaveAdmin = 49,
|
56
|
+
DeleteAccount = 50,
|
57
|
+
PasswordReset = 51,
|
58
|
+
PasswordChange = 52,
|
59
|
+
CreatePrivateMessage = 53,
|
60
|
+
EditPrivateMessage = 54,
|
61
|
+
DeletePrivateMessage = 55,
|
62
|
+
MarkPrivateMessageAsRead = 56,
|
63
|
+
GetPrivateMessages = 57,
|
64
|
+
UserJoin = 58,
|
65
|
+
GetComments = 59,
|
66
|
+
GetSiteConfig = 60,
|
67
|
+
SaveSiteConfig = 61,
|
68
|
+
PostJoin = 62,
|
69
|
+
CommunityJoin = 63,
|
70
|
+
ChangePassword = 64,
|
71
|
+
GetSiteMetadata = 65,
|
72
|
+
BlockCommunity = 66,
|
73
|
+
BlockPerson = 67,
|
74
|
+
PurgePerson = 68,
|
75
|
+
PurgeCommunity = 69,
|
76
|
+
PurgePost = 70,
|
77
|
+
PurgeComment = 71,
|
78
|
+
CreateCommentReport = 72,
|
79
|
+
ResolveCommentReport = 73,
|
80
|
+
ListCommentReports = 74,
|
81
|
+
CreatePostReport = 75,
|
82
|
+
ResolvePostReport = 76,
|
83
|
+
ListPostReports = 77,
|
84
|
+
GetReportCount = 78,
|
85
|
+
GetUnreadCount = 79,
|
86
|
+
VerifyEmail = 80
|
82
87
|
}
|
83
88
|
/**
|
84
89
|
* Different sort types used in lemmy.
|
@@ -29,60 +29,65 @@ var UserOperation;
|
|
29
29
|
UserOperation[UserOperation["RemovePost"] = 19] = "RemovePost";
|
30
30
|
UserOperation[UserOperation["LockPost"] = 20] = "LockPost";
|
31
31
|
UserOperation[UserOperation["StickyPost"] = 21] = "StickyPost";
|
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["
|
50
|
-
UserOperation[UserOperation["
|
51
|
-
UserOperation[UserOperation["
|
52
|
-
UserOperation[UserOperation["
|
53
|
-
UserOperation[UserOperation["
|
54
|
-
UserOperation[UserOperation["
|
55
|
-
UserOperation[UserOperation["
|
56
|
-
UserOperation[UserOperation["
|
57
|
-
UserOperation[UserOperation["
|
58
|
-
UserOperation[UserOperation["
|
59
|
-
UserOperation[UserOperation["
|
60
|
-
UserOperation[UserOperation["
|
61
|
-
UserOperation[UserOperation["
|
62
|
-
UserOperation[UserOperation["
|
63
|
-
UserOperation[UserOperation["
|
64
|
-
UserOperation[UserOperation["
|
65
|
-
UserOperation[UserOperation["
|
66
|
-
UserOperation[UserOperation["
|
67
|
-
UserOperation[UserOperation["
|
68
|
-
UserOperation[UserOperation["
|
69
|
-
UserOperation[UserOperation["
|
70
|
-
UserOperation[UserOperation["
|
71
|
-
UserOperation[UserOperation["
|
72
|
-
UserOperation[UserOperation["
|
73
|
-
UserOperation[UserOperation["
|
74
|
-
UserOperation[UserOperation["
|
75
|
-
UserOperation[UserOperation["
|
76
|
-
UserOperation[UserOperation["
|
77
|
-
UserOperation[UserOperation["
|
78
|
-
UserOperation[UserOperation["
|
79
|
-
UserOperation[UserOperation["
|
80
|
-
UserOperation[UserOperation["
|
81
|
-
UserOperation[UserOperation["
|
82
|
-
UserOperation[UserOperation["
|
83
|
-
UserOperation[UserOperation["
|
84
|
-
UserOperation[UserOperation["
|
85
|
-
UserOperation[UserOperation["
|
32
|
+
UserOperation[UserOperation["MarkPostAsRead"] = 22] = "MarkPostAsRead";
|
33
|
+
UserOperation[UserOperation["SavePost"] = 23] = "SavePost";
|
34
|
+
UserOperation[UserOperation["EditCommunity"] = 24] = "EditCommunity";
|
35
|
+
UserOperation[UserOperation["DeleteCommunity"] = 25] = "DeleteCommunity";
|
36
|
+
UserOperation[UserOperation["RemoveCommunity"] = 26] = "RemoveCommunity";
|
37
|
+
UserOperation[UserOperation["FollowCommunity"] = 27] = "FollowCommunity";
|
38
|
+
UserOperation[UserOperation["GetPersonDetails"] = 28] = "GetPersonDetails";
|
39
|
+
UserOperation[UserOperation["GetReplies"] = 29] = "GetReplies";
|
40
|
+
UserOperation[UserOperation["GetPersonMentions"] = 30] = "GetPersonMentions";
|
41
|
+
UserOperation[UserOperation["MarkPersonMentionAsRead"] = 31] = "MarkPersonMentionAsRead";
|
42
|
+
UserOperation[UserOperation["GetModlog"] = 32] = "GetModlog";
|
43
|
+
UserOperation[UserOperation["BanFromCommunity"] = 33] = "BanFromCommunity";
|
44
|
+
UserOperation[UserOperation["AddModToCommunity"] = 34] = "AddModToCommunity";
|
45
|
+
UserOperation[UserOperation["CreateSite"] = 35] = "CreateSite";
|
46
|
+
UserOperation[UserOperation["EditSite"] = 36] = "EditSite";
|
47
|
+
UserOperation[UserOperation["GetSite"] = 37] = "GetSite";
|
48
|
+
UserOperation[UserOperation["AddAdmin"] = 38] = "AddAdmin";
|
49
|
+
UserOperation[UserOperation["GetUnreadRegistrationApplicationCount"] = 39] = "GetUnreadRegistrationApplicationCount";
|
50
|
+
UserOperation[UserOperation["ListRegistrationApplications"] = 40] = "ListRegistrationApplications";
|
51
|
+
UserOperation[UserOperation["ApproveRegistrationApplication"] = 41] = "ApproveRegistrationApplication";
|
52
|
+
UserOperation[UserOperation["BanPerson"] = 42] = "BanPerson";
|
53
|
+
UserOperation[UserOperation["GetBannedPersons"] = 43] = "GetBannedPersons";
|
54
|
+
UserOperation[UserOperation["Search"] = 44] = "Search";
|
55
|
+
UserOperation[UserOperation["ResolveObject"] = 45] = "ResolveObject";
|
56
|
+
UserOperation[UserOperation["MarkAllAsRead"] = 46] = "MarkAllAsRead";
|
57
|
+
UserOperation[UserOperation["SaveUserSettings"] = 47] = "SaveUserSettings";
|
58
|
+
UserOperation[UserOperation["TransferCommunity"] = 48] = "TransferCommunity";
|
59
|
+
UserOperation[UserOperation["LeaveAdmin"] = 49] = "LeaveAdmin";
|
60
|
+
UserOperation[UserOperation["DeleteAccount"] = 50] = "DeleteAccount";
|
61
|
+
UserOperation[UserOperation["PasswordReset"] = 51] = "PasswordReset";
|
62
|
+
UserOperation[UserOperation["PasswordChange"] = 52] = "PasswordChange";
|
63
|
+
UserOperation[UserOperation["CreatePrivateMessage"] = 53] = "CreatePrivateMessage";
|
64
|
+
UserOperation[UserOperation["EditPrivateMessage"] = 54] = "EditPrivateMessage";
|
65
|
+
UserOperation[UserOperation["DeletePrivateMessage"] = 55] = "DeletePrivateMessage";
|
66
|
+
UserOperation[UserOperation["MarkPrivateMessageAsRead"] = 56] = "MarkPrivateMessageAsRead";
|
67
|
+
UserOperation[UserOperation["GetPrivateMessages"] = 57] = "GetPrivateMessages";
|
68
|
+
UserOperation[UserOperation["UserJoin"] = 58] = "UserJoin";
|
69
|
+
UserOperation[UserOperation["GetComments"] = 59] = "GetComments";
|
70
|
+
UserOperation[UserOperation["GetSiteConfig"] = 60] = "GetSiteConfig";
|
71
|
+
UserOperation[UserOperation["SaveSiteConfig"] = 61] = "SaveSiteConfig";
|
72
|
+
UserOperation[UserOperation["PostJoin"] = 62] = "PostJoin";
|
73
|
+
UserOperation[UserOperation["CommunityJoin"] = 63] = "CommunityJoin";
|
74
|
+
UserOperation[UserOperation["ChangePassword"] = 64] = "ChangePassword";
|
75
|
+
UserOperation[UserOperation["GetSiteMetadata"] = 65] = "GetSiteMetadata";
|
76
|
+
UserOperation[UserOperation["BlockCommunity"] = 66] = "BlockCommunity";
|
77
|
+
UserOperation[UserOperation["BlockPerson"] = 67] = "BlockPerson";
|
78
|
+
UserOperation[UserOperation["PurgePerson"] = 68] = "PurgePerson";
|
79
|
+
UserOperation[UserOperation["PurgeCommunity"] = 69] = "PurgeCommunity";
|
80
|
+
UserOperation[UserOperation["PurgePost"] = 70] = "PurgePost";
|
81
|
+
UserOperation[UserOperation["PurgeComment"] = 71] = "PurgeComment";
|
82
|
+
UserOperation[UserOperation["CreateCommentReport"] = 72] = "CreateCommentReport";
|
83
|
+
UserOperation[UserOperation["ResolveCommentReport"] = 73] = "ResolveCommentReport";
|
84
|
+
UserOperation[UserOperation["ListCommentReports"] = 74] = "ListCommentReports";
|
85
|
+
UserOperation[UserOperation["CreatePostReport"] = 75] = "CreatePostReport";
|
86
|
+
UserOperation[UserOperation["ResolvePostReport"] = 76] = "ResolvePostReport";
|
87
|
+
UserOperation[UserOperation["ListPostReports"] = 77] = "ListPostReports";
|
88
|
+
UserOperation[UserOperation["GetReportCount"] = 78] = "GetReportCount";
|
89
|
+
UserOperation[UserOperation["GetUnreadCount"] = 79] = "GetUnreadCount";
|
90
|
+
UserOperation[UserOperation["VerifyEmail"] = 80] = "VerifyEmail";
|
86
91
|
})(UserOperation = exports.UserOperation || (exports.UserOperation = {}));
|
87
92
|
/**
|
88
93
|
* Different sort types used in lemmy.
|
@@ -54,10 +54,12 @@ export interface Site {
|
|
54
54
|
application_question?: string;
|
55
55
|
private_instance: boolean;
|
56
56
|
default_theme: string;
|
57
|
+
default_post_listing_type: string;
|
57
58
|
actor_id: string;
|
58
59
|
last_refreshed_at: string;
|
59
60
|
inbox_url: string;
|
60
61
|
public_key: string;
|
62
|
+
legal_information?: string;
|
61
63
|
}
|
62
64
|
export interface PrivateMessage {
|
63
65
|
id: number;
|
@@ -192,6 +194,32 @@ export interface ModAdd {
|
|
192
194
|
removed?: boolean;
|
193
195
|
when_: string;
|
194
196
|
}
|
197
|
+
export interface AdminPurgePerson {
|
198
|
+
id: number;
|
199
|
+
admin_person_id: number;
|
200
|
+
reason?: string;
|
201
|
+
when_: string;
|
202
|
+
}
|
203
|
+
export interface AdminPurgeCommunity {
|
204
|
+
id: number;
|
205
|
+
admin_person_id: number;
|
206
|
+
reason?: string;
|
207
|
+
when_: string;
|
208
|
+
}
|
209
|
+
export interface AdminPurgePost {
|
210
|
+
id: number;
|
211
|
+
admin_person_id: number;
|
212
|
+
community_id: number;
|
213
|
+
reason?: string;
|
214
|
+
when_: string;
|
215
|
+
}
|
216
|
+
export interface AdminPurgeComment {
|
217
|
+
id: number;
|
218
|
+
admin_person_id: number;
|
219
|
+
post_id: number;
|
220
|
+
reason?: string;
|
221
|
+
when_: string;
|
222
|
+
}
|
195
223
|
export interface CommunitySafe {
|
196
224
|
id: number;
|
197
225
|
name: string;
|
@@ -1,5 +1,5 @@
|
|
1
1
|
import { CommentAggregates, CommunityAggregates, PersonAggregates, PostAggregates, SiteAggregates } from "./aggregates";
|
2
|
-
import { Comment, CommentReport, CommunitySafe, LocalUserSettings, ModAdd, ModAddCommunity, ModBan, ModBanFromCommunity, ModLockPost, ModRemoveComment, ModRemoveCommunity, ModRemovePost, ModStickyPost, ModTransferCommunity, PersonMention, PersonSafe, Post, PostReport, PrivateMessage, RegistrationApplication, Site } from "./source";
|
2
|
+
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";
|
3
3
|
export interface PersonViewSafe {
|
4
4
|
person: PersonSafe;
|
5
5
|
counts: PersonAggregates;
|
@@ -25,7 +25,6 @@ export interface LocalUserSettingsView {
|
|
25
25
|
}
|
26
26
|
export interface SiteView {
|
27
27
|
site: Site;
|
28
|
-
creator: PersonSafe;
|
29
28
|
counts: SiteAggregates;
|
30
29
|
}
|
31
30
|
export interface PrivateMessageView {
|
@@ -140,10 +139,27 @@ export interface ModStickyPostView {
|
|
140
139
|
post: Post;
|
141
140
|
community: CommunitySafe;
|
142
141
|
}
|
142
|
+
export interface AdminPurgeCommunityView {
|
143
|
+
admin_purge_community: AdminPurgeCommunity;
|
144
|
+
admin: PersonSafe;
|
145
|
+
}
|
146
|
+
export interface AdminPurgePersonView {
|
147
|
+
admin_purge_person: AdminPurgePerson;
|
148
|
+
admin: PersonSafe;
|
149
|
+
}
|
150
|
+
export interface AdminPurgePostView {
|
151
|
+
admin_purge_post: AdminPurgePost;
|
152
|
+
admin: PersonSafe;
|
153
|
+
community: CommunitySafe;
|
154
|
+
}
|
155
|
+
export interface AdminPurgeCommentView {
|
156
|
+
admin_purge_comment: AdminPurgeComment;
|
157
|
+
admin: PersonSafe;
|
158
|
+
post: Post;
|
159
|
+
}
|
143
160
|
export interface CommunityFollowerView {
|
144
161
|
community: CommunitySafe;
|
145
162
|
follower: PersonSafe;
|
146
|
-
pending?: boolean;
|
147
163
|
}
|
148
164
|
export interface CommunityBlockView {
|
149
165
|
person: PersonSafe;
|
package/dist/websocket.d.ts
CHANGED
@@ -1,8 +1,8 @@
|
|
1
1
|
import { CreateComment, CreateCommentLike, CreateCommentReport, DeleteComment, EditComment, GetComments, ListCommentReports, MarkCommentAsRead, RemoveComment, ResolveCommentReport, SaveComment } from "./interfaces/api/comment";
|
2
2
|
import { AddModToCommunity, BanFromCommunity, BlockCommunity, CreateCommunity, DeleteCommunity, EditCommunity, FollowCommunity, GetCommunity, ListCommunities, RemoveCommunity, TransferCommunity } from "./interfaces/api/community";
|
3
3
|
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 { CreatePost, CreatePostLike, CreatePostReport, DeletePost, EditPost, GetPost, GetPosts, GetSiteMetadata, ListPostReports, LockPost, RemovePost, ResolvePostReport, SavePost, StickyPost } from "./interfaces/api/post";
|
5
|
-
import { ApproveRegistrationApplication, CreateSite, EditSite, GetModlog, GetSite, GetSiteConfig, GetUnreadRegistrationApplicationCount, LeaveAdmin, ListRegistrationApplications, ResolveObject, SaveSiteConfig, Search } from "./interfaces/api/site";
|
4
|
+
import { CreatePost, CreatePostLike, CreatePostReport, DeletePost, EditPost, GetPost, GetPosts, GetSiteMetadata, ListPostReports, LockPost, MarkPostAsRead, RemovePost, ResolvePostReport, SavePost, StickyPost } from "./interfaces/api/post";
|
5
|
+
import { ApproveRegistrationApplication, CreateSite, EditSite, GetModlog, GetSite, GetSiteConfig, GetUnreadRegistrationApplicationCount, LeaveAdmin, ListRegistrationApplications, PurgeComment, PurgeCommunity, PurgePerson, PurgePost, ResolveObject, SaveSiteConfig, Search } from "./interfaces/api/site";
|
6
6
|
import { CommunityJoin, PostJoin, UserJoin } from "./interfaces/api/websocket";
|
7
7
|
/**
|
8
8
|
* Helps build lemmy websocket message requests, that you can use in your Websocket sends.
|
@@ -153,6 +153,10 @@ export declare class LemmyWebsocket {
|
|
153
153
|
* A moderator can sticky a post ( IE stick it to the top of a community ).
|
154
154
|
*/
|
155
155
|
stickyPost(form: StickyPost): string;
|
156
|
+
/**
|
157
|
+
* Mark a post as read.
|
158
|
+
*/
|
159
|
+
markPostAsRead(form: MarkPostAsRead): string;
|
156
160
|
/**
|
157
161
|
* Save a post.
|
158
162
|
*/
|
@@ -325,4 +329,20 @@ export declare class LemmyWebsocket {
|
|
325
329
|
* Block a community.
|
326
330
|
*/
|
327
331
|
blockCommunity(form: BlockCommunity): string;
|
332
|
+
/**
|
333
|
+
* Purge / Delete a person from the database.
|
334
|
+
*/
|
335
|
+
purgePerson(form: PurgePerson): string;
|
336
|
+
/**
|
337
|
+
* Purge / Delete a community from the database.
|
338
|
+
*/
|
339
|
+
purgeCommunity(form: PurgeCommunity): string;
|
340
|
+
/**
|
341
|
+
* Purge / Delete a post from the database.
|
342
|
+
*/
|
343
|
+
purgePost(form: PurgePost): string;
|
344
|
+
/**
|
345
|
+
* Purge / Delete a comment from the database.
|
346
|
+
*/
|
347
|
+
purgeComment(form: PurgeComment): string;
|
328
348
|
}
|
package/dist/websocket.js
CHANGED
@@ -218,6 +218,12 @@ var LemmyWebsocket = /** @class */ (function () {
|
|
218
218
|
LemmyWebsocket.prototype.stickyPost = function (form) {
|
219
219
|
return wrapper(others_1.UserOperation.StickyPost, form);
|
220
220
|
};
|
221
|
+
/**
|
222
|
+
* Mark a post as read.
|
223
|
+
*/
|
224
|
+
LemmyWebsocket.prototype.markPostAsRead = function (form) {
|
225
|
+
return wrapper(others_1.UserOperation.MarkPostAsRead, form);
|
226
|
+
};
|
221
227
|
/**
|
222
228
|
* Save a post.
|
223
229
|
*/
|
@@ -477,6 +483,30 @@ var LemmyWebsocket = /** @class */ (function () {
|
|
477
483
|
LemmyWebsocket.prototype.blockCommunity = function (form) {
|
478
484
|
return wrapper(others_1.UserOperation.BlockCommunity, form);
|
479
485
|
};
|
486
|
+
/**
|
487
|
+
* Purge / Delete a person from the database.
|
488
|
+
*/
|
489
|
+
LemmyWebsocket.prototype.purgePerson = function (form) {
|
490
|
+
return wrapper(others_1.UserOperation.PurgePerson, form);
|
491
|
+
};
|
492
|
+
/**
|
493
|
+
* Purge / Delete a community from the database.
|
494
|
+
*/
|
495
|
+
LemmyWebsocket.prototype.purgeCommunity = function (form) {
|
496
|
+
return wrapper(others_1.UserOperation.PurgeCommunity, form);
|
497
|
+
};
|
498
|
+
/**
|
499
|
+
* Purge / Delete a post from the database.
|
500
|
+
*/
|
501
|
+
LemmyWebsocket.prototype.purgePost = function (form) {
|
502
|
+
return wrapper(others_1.UserOperation.PurgePost, form);
|
503
|
+
};
|
504
|
+
/**
|
505
|
+
* Purge / Delete a comment from the database.
|
506
|
+
*/
|
507
|
+
LemmyWebsocket.prototype.purgeComment = function (form) {
|
508
|
+
return wrapper(others_1.UserOperation.PurgeComment, form);
|
509
|
+
};
|
480
510
|
return LemmyWebsocket;
|
481
511
|
}());
|
482
512
|
exports.LemmyWebsocket = LemmyWebsocket;
|
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.12",
|
5
5
|
"author": "Dessalines <tyhou13@gmx.com>",
|
6
6
|
"license": "AGPL-3.0",
|
7
7
|
"main": "./dist/index.js",
|
@@ -16,23 +16,23 @@
|
|
16
16
|
},
|
17
17
|
"repository": "https://github.com/LemmyNet/lemmy-js-client",
|
18
18
|
"devDependencies": {
|
19
|
-
"@types/node": "^17.0.
|
19
|
+
"@types/node": "^17.0.33",
|
20
20
|
"@types/node-fetch": "^3.0.3",
|
21
|
-
"@typescript-eslint/eslint-plugin": "^5.
|
22
|
-
"@typescript-eslint/parser": "^5.
|
23
|
-
"eslint": "^8.
|
21
|
+
"@typescript-eslint/eslint-plugin": "^5.23.0",
|
22
|
+
"@typescript-eslint/parser": "^5.23.0",
|
23
|
+
"eslint": "^8.15.0",
|
24
24
|
"eslint-plugin-prettier": "^4.0.0",
|
25
|
-
"husky": "^
|
26
|
-
"lint-staged": "^12.
|
27
|
-
"node-fetch": "^3.
|
28
|
-
"prettier": "^2.
|
25
|
+
"husky": "^8.0.1",
|
26
|
+
"lint-staged": "^12.4.1",
|
27
|
+
"node-fetch": "^3.2.4",
|
28
|
+
"prettier": "^2.6.2",
|
29
29
|
"prettier-plugin-import-sort": "^0.0.7",
|
30
30
|
"prettier-plugin-organize-imports": "^2.3.4",
|
31
|
-
"prettier-plugin-packagejson": "^2.2.
|
31
|
+
"prettier-plugin-packagejson": "^2.2.18",
|
32
32
|
"sortpack": "^2.2.0",
|
33
33
|
"typedoc": "^0.21.6",
|
34
34
|
"typedoc-plugin-sourcefile-url": "^1.0.6",
|
35
|
-
"typescript": "^4.
|
35
|
+
"typescript": "^4.6.4"
|
36
36
|
},
|
37
37
|
"types": "./dist/index.d.ts",
|
38
38
|
"lint-staged": {
|