lemmy-js-client 0.17.0-rc.1 → 0.17.0-rc.12

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.
@@ -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?: string;
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
- * The [[ListingType]].
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 { CommentView, CommunityBlockView, CommunityFollowerView, CommunityModeratorView, CommunityView, LocalUserSettingsView, ModAddCommunityView, ModAddView, ModBanFromCommunityView, ModBanView, ModLockPostView, ModRemoveCommentView, ModRemoveCommunityView, ModRemovePostView, ModStickyPostView, ModTransferCommunityView, PersonBlockView, PersonViewSafe, PostView, RegistrationApplicationView, SiteView } from "../views";
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
- * The [[SortType]].
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)
@@ -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.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
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
- SavePost = 22,
29
- EditCommunity = 23,
30
- DeleteCommunity = 24,
31
- RemoveCommunity = 25,
32
- FollowCommunity = 26,
33
- GetPersonDetails = 27,
34
- GetReplies = 28,
35
- GetPersonMentions = 29,
36
- MarkPersonMentionAsRead = 30,
37
- GetModlog = 31,
38
- BanFromCommunity = 32,
39
- AddModToCommunity = 33,
40
- CreateSite = 34,
41
- EditSite = 35,
42
- GetSite = 36,
43
- AddAdmin = 37,
44
- GetUnreadRegistrationApplicationCount = 38,
45
- ListRegistrationApplications = 39,
46
- ApproveRegistrationApplication = 40,
47
- BanPerson = 41,
48
- GetBannedPersons = 42,
49
- Search = 43,
50
- ResolveObject = 44,
51
- MarkAllAsRead = 45,
52
- SaveUserSettings = 46,
53
- TransferCommunity = 47,
54
- LeaveAdmin = 48,
55
- DeleteAccount = 49,
56
- PasswordReset = 50,
57
- PasswordChange = 51,
58
- CreatePrivateMessage = 52,
59
- EditPrivateMessage = 53,
60
- DeletePrivateMessage = 54,
61
- MarkPrivateMessageAsRead = 55,
62
- GetPrivateMessages = 56,
63
- UserJoin = 57,
64
- GetComments = 58,
65
- GetSiteConfig = 59,
66
- SaveSiteConfig = 60,
67
- PostJoin = 61,
68
- CommunityJoin = 62,
69
- ChangePassword = 63,
70
- GetSiteMetadata = 64,
71
- BlockCommunity = 65,
72
- BlockPerson = 66,
73
- CreateCommentReport = 67,
74
- ResolveCommentReport = 68,
75
- ListCommentReports = 69,
76
- CreatePostReport = 70,
77
- ResolvePostReport = 71,
78
- ListPostReports = 72,
79
- GetReportCount = 73,
80
- GetUnreadCount = 74,
81
- VerifyEmail = 75
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["SavePost"] = 22] = "SavePost";
33
- UserOperation[UserOperation["EditCommunity"] = 23] = "EditCommunity";
34
- UserOperation[UserOperation["DeleteCommunity"] = 24] = "DeleteCommunity";
35
- UserOperation[UserOperation["RemoveCommunity"] = 25] = "RemoveCommunity";
36
- UserOperation[UserOperation["FollowCommunity"] = 26] = "FollowCommunity";
37
- UserOperation[UserOperation["GetPersonDetails"] = 27] = "GetPersonDetails";
38
- UserOperation[UserOperation["GetReplies"] = 28] = "GetReplies";
39
- UserOperation[UserOperation["GetPersonMentions"] = 29] = "GetPersonMentions";
40
- UserOperation[UserOperation["MarkPersonMentionAsRead"] = 30] = "MarkPersonMentionAsRead";
41
- UserOperation[UserOperation["GetModlog"] = 31] = "GetModlog";
42
- UserOperation[UserOperation["BanFromCommunity"] = 32] = "BanFromCommunity";
43
- UserOperation[UserOperation["AddModToCommunity"] = 33] = "AddModToCommunity";
44
- UserOperation[UserOperation["CreateSite"] = 34] = "CreateSite";
45
- UserOperation[UserOperation["EditSite"] = 35] = "EditSite";
46
- UserOperation[UserOperation["GetSite"] = 36] = "GetSite";
47
- UserOperation[UserOperation["AddAdmin"] = 37] = "AddAdmin";
48
- UserOperation[UserOperation["GetUnreadRegistrationApplicationCount"] = 38] = "GetUnreadRegistrationApplicationCount";
49
- UserOperation[UserOperation["ListRegistrationApplications"] = 39] = "ListRegistrationApplications";
50
- UserOperation[UserOperation["ApproveRegistrationApplication"] = 40] = "ApproveRegistrationApplication";
51
- UserOperation[UserOperation["BanPerson"] = 41] = "BanPerson";
52
- UserOperation[UserOperation["GetBannedPersons"] = 42] = "GetBannedPersons";
53
- UserOperation[UserOperation["Search"] = 43] = "Search";
54
- UserOperation[UserOperation["ResolveObject"] = 44] = "ResolveObject";
55
- UserOperation[UserOperation["MarkAllAsRead"] = 45] = "MarkAllAsRead";
56
- UserOperation[UserOperation["SaveUserSettings"] = 46] = "SaveUserSettings";
57
- UserOperation[UserOperation["TransferCommunity"] = 47] = "TransferCommunity";
58
- UserOperation[UserOperation["LeaveAdmin"] = 48] = "LeaveAdmin";
59
- UserOperation[UserOperation["DeleteAccount"] = 49] = "DeleteAccount";
60
- UserOperation[UserOperation["PasswordReset"] = 50] = "PasswordReset";
61
- UserOperation[UserOperation["PasswordChange"] = 51] = "PasswordChange";
62
- UserOperation[UserOperation["CreatePrivateMessage"] = 52] = "CreatePrivateMessage";
63
- UserOperation[UserOperation["EditPrivateMessage"] = 53] = "EditPrivateMessage";
64
- UserOperation[UserOperation["DeletePrivateMessage"] = 54] = "DeletePrivateMessage";
65
- UserOperation[UserOperation["MarkPrivateMessageAsRead"] = 55] = "MarkPrivateMessageAsRead";
66
- UserOperation[UserOperation["GetPrivateMessages"] = 56] = "GetPrivateMessages";
67
- UserOperation[UserOperation["UserJoin"] = 57] = "UserJoin";
68
- UserOperation[UserOperation["GetComments"] = 58] = "GetComments";
69
- UserOperation[UserOperation["GetSiteConfig"] = 59] = "GetSiteConfig";
70
- UserOperation[UserOperation["SaveSiteConfig"] = 60] = "SaveSiteConfig";
71
- UserOperation[UserOperation["PostJoin"] = 61] = "PostJoin";
72
- UserOperation[UserOperation["CommunityJoin"] = 62] = "CommunityJoin";
73
- UserOperation[UserOperation["ChangePassword"] = 63] = "ChangePassword";
74
- UserOperation[UserOperation["GetSiteMetadata"] = 64] = "GetSiteMetadata";
75
- UserOperation[UserOperation["BlockCommunity"] = 65] = "BlockCommunity";
76
- UserOperation[UserOperation["BlockPerson"] = 66] = "BlockPerson";
77
- UserOperation[UserOperation["CreateCommentReport"] = 67] = "CreateCommentReport";
78
- UserOperation[UserOperation["ResolveCommentReport"] = 68] = "ResolveCommentReport";
79
- UserOperation[UserOperation["ListCommentReports"] = 69] = "ListCommentReports";
80
- UserOperation[UserOperation["CreatePostReport"] = 70] = "CreatePostReport";
81
- UserOperation[UserOperation["ResolvePostReport"] = 71] = "ResolvePostReport";
82
- UserOperation[UserOperation["ListPostReports"] = 72] = "ListPostReports";
83
- UserOperation[UserOperation["GetReportCount"] = 73] = "GetReportCount";
84
- UserOperation[UserOperation["GetUnreadCount"] = 74] = "GetUnreadCount";
85
- UserOperation[UserOperation["VerifyEmail"] = 75] = "VerifyEmail";
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;
@@ -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.1",
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.10",
19
+ "@types/node": "^17.0.33",
20
20
  "@types/node-fetch": "^3.0.3",
21
- "@typescript-eslint/eslint-plugin": "^5.10.0",
22
- "@typescript-eslint/parser": "^5.10.0",
23
- "eslint": "^8.7.0",
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": "^7.0.4",
26
- "lint-staged": "^12.2.2",
27
- "node-fetch": "^3.1.1",
28
- "prettier": "^2.5.0",
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.15",
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.5.4"
35
+ "typescript": "^4.6.4"
36
36
  },
37
37
  "types": "./dist/index.d.ts",
38
38
  "lint-staged": {