lemmy-js-client 0.15.0-rc.1 → 0.15.0-rc.7
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 -19
- package/dist/http.js +0 -40
- package/dist/interfaces/api/community.d.ts +6 -0
- package/dist/interfaces/api/person.d.ts +4 -20
- package/dist/interfaces/api/site.d.ts +1 -36
- package/dist/interfaces/api/user.d.ts +190 -0
- package/dist/interfaces/api/user.js +2 -0
- package/dist/interfaces/others.d.ts +33 -37
- package/dist/interfaces/others.js +33 -37
- package/dist/interfaces/source.d.ts +3 -16
- package/dist/interfaces/views.d.ts +1 -7
- package/dist/websocket.d.ts +2 -18
- package/dist/websocket.js +0 -24
- package/package.json +1 -1
package/dist/http.d.ts
CHANGED
@@ -1,8 +1,8 @@
|
|
1
1
|
import { CommentReportResponse, CommentResponse, CreateComment, CreateCommentLike, CreateCommentReport, DeleteComment, EditComment, GetComments, GetCommentsResponse, ListCommentReports, ListCommentReportsResponse, MarkCommentAsRead, 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, BanPerson, BanPersonResponse, BlockPerson, BlockPersonResponse, ChangePassword, CreatePrivateMessage, DeleteAccount,
|
3
|
+
import { AddAdmin, AddAdminResponse, BanPerson, BanPersonResponse, BlockPerson, BlockPersonResponse, ChangePassword, CreatePrivateMessage, DeleteAccount, DeletePrivateMessage, EditPrivateMessage, 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 } from "./interfaces/api/person";
|
4
4
|
import { CreatePost, CreatePostLike, CreatePostReport, DeletePost, EditPost, GetPost, GetPostResponse, GetPosts, GetPostsResponse, GetSiteMetadata, GetSiteMetadataResponse, ListPostReports, ListPostReportsResponse, LockPost, PostReportResponse, PostResponse, RemovePost, ResolvePostReport, SavePost, StickyPost } from "./interfaces/api/post";
|
5
|
-
import {
|
5
|
+
import { CreateSite, EditSite, GetModlog, GetModlogResponse, GetSite, GetSiteConfig, GetSiteConfigResponse, GetSiteResponse, ResolveObject, ResolveObjectResponse, SaveSiteConfig, Search, SearchResponse, SiteResponse, TransferSite } from "./interfaces/api/site";
|
6
6
|
/**
|
7
7
|
* Helps build lemmy HTTP requests.
|
8
8
|
*/
|
@@ -256,7 +256,7 @@ export declare class LemmyHttp {
|
|
256
256
|
/**
|
257
257
|
* Delete your account.
|
258
258
|
*/
|
259
|
-
deleteAccount(form: DeleteAccount): Promise<
|
259
|
+
deleteAccount(form: DeleteAccount): Promise<LoginResponse>;
|
260
260
|
/**
|
261
261
|
* Reset your password.
|
262
262
|
*/
|
@@ -285,26 +285,10 @@ export declare class LemmyHttp {
|
|
285
285
|
* Get your unread counts
|
286
286
|
*/
|
287
287
|
getUnreadCount(form: GetUnreadCount): Promise<GetUnreadCountResponse>;
|
288
|
-
/**
|
289
|
-
* Verify your email
|
290
|
-
*/
|
291
|
-
verifyEmail(form: VerifyEmail): Promise<VerifyEmailResponse>;
|
292
288
|
/**
|
293
289
|
* Add an admin to your site.
|
294
290
|
*/
|
295
291
|
addAdmin(form: AddAdmin): Promise<AddAdminResponse>;
|
296
|
-
/**
|
297
|
-
* Get the unread registration applications count.
|
298
|
-
*/
|
299
|
-
getUnreadRegistrationApplicationCount(form: GetUnreadRegistrationApplicationCount): Promise<GetUnreadRegistrationApplicationCountResponse>;
|
300
|
-
/**
|
301
|
-
* List the unread registration applications.
|
302
|
-
*/
|
303
|
-
listRegistrationApplications(form: ListRegistrationApplications): Promise<ListRegistrationApplicationsResponse>;
|
304
|
-
/**
|
305
|
-
* Approve a registration application
|
306
|
-
*/
|
307
|
-
approveRegistrationApplication(form: ApproveRegistrationApplication): Promise<RegistrationApplicationResponse>;
|
308
292
|
private buildFullUrl;
|
309
293
|
private wrapper;
|
310
294
|
}
|
package/dist/http.js
CHANGED
@@ -742,16 +742,6 @@ var LemmyHttp = /** @class */ (function () {
|
|
742
742
|
});
|
743
743
|
});
|
744
744
|
};
|
745
|
-
/**
|
746
|
-
* Verify your email
|
747
|
-
*/
|
748
|
-
LemmyHttp.prototype.verifyEmail = function (form) {
|
749
|
-
return __awaiter(this, void 0, void 0, function () {
|
750
|
-
return __generator(this, function (_a) {
|
751
|
-
return [2 /*return*/, this.wrapper(HttpType.Post, "/user/verify_email", form)];
|
752
|
-
});
|
753
|
-
});
|
754
|
-
};
|
755
745
|
/**
|
756
746
|
* Add an admin to your site.
|
757
747
|
*/
|
@@ -762,36 +752,6 @@ var LemmyHttp = /** @class */ (function () {
|
|
762
752
|
});
|
763
753
|
});
|
764
754
|
};
|
765
|
-
/**
|
766
|
-
* Get the unread registration applications count.
|
767
|
-
*/
|
768
|
-
LemmyHttp.prototype.getUnreadRegistrationApplicationCount = function (form) {
|
769
|
-
return __awaiter(this, void 0, void 0, function () {
|
770
|
-
return __generator(this, function (_a) {
|
771
|
-
return [2 /*return*/, this.wrapper(HttpType.Get, "/admin/registration_application/count", form)];
|
772
|
-
});
|
773
|
-
});
|
774
|
-
};
|
775
|
-
/**
|
776
|
-
* List the unread registration applications.
|
777
|
-
*/
|
778
|
-
LemmyHttp.prototype.listRegistrationApplications = function (form) {
|
779
|
-
return __awaiter(this, void 0, void 0, function () {
|
780
|
-
return __generator(this, function (_a) {
|
781
|
-
return [2 /*return*/, this.wrapper(HttpType.Get, "/admin/registration_application/list", form)];
|
782
|
-
});
|
783
|
-
});
|
784
|
-
};
|
785
|
-
/**
|
786
|
-
* Approve a registration application
|
787
|
-
*/
|
788
|
-
LemmyHttp.prototype.approveRegistrationApplication = function (form) {
|
789
|
-
return __awaiter(this, void 0, void 0, function () {
|
790
|
-
return __generator(this, function (_a) {
|
791
|
-
return [2 /*return*/, this.wrapper(HttpType.Put, "/admin/registration_application/approve", form)];
|
792
|
-
});
|
793
|
-
});
|
794
|
-
};
|
795
755
|
LemmyHttp.prototype.buildFullUrl = function (endpoint) {
|
796
756
|
return "".concat(this.apiUrl).concat(endpoint);
|
797
757
|
};
|
@@ -51,6 +51,9 @@ export interface BanFromCommunity {
|
|
51
51
|
*/
|
52
52
|
remove_data?: boolean;
|
53
53
|
reason?: string;
|
54
|
+
/**
|
55
|
+
* The expire time in Unix seconds
|
56
|
+
*/
|
54
57
|
expires?: number;
|
55
58
|
auth: string;
|
56
59
|
}
|
@@ -91,6 +94,9 @@ export interface RemoveCommunity {
|
|
91
94
|
community_id: number;
|
92
95
|
removed: boolean;
|
93
96
|
reason?: string;
|
97
|
+
/**
|
98
|
+
* The expire time in Unix seconds
|
99
|
+
*/
|
94
100
|
expires?: number;
|
95
101
|
auth: string;
|
96
102
|
}
|
@@ -10,9 +10,6 @@ export interface Login {
|
|
10
10
|
*/
|
11
11
|
export interface Register {
|
12
12
|
username: string;
|
13
|
-
/**
|
14
|
-
* Email is mandatory if email verification is enabled on the server
|
15
|
-
*/
|
16
13
|
email?: string;
|
17
14
|
password: string;
|
18
15
|
password_verify: string;
|
@@ -23,10 +20,6 @@ export interface Register {
|
|
23
20
|
captcha_uuid?: string;
|
24
21
|
captcha_answer?: string;
|
25
22
|
honeypot?: string;
|
26
|
-
/**
|
27
|
-
* An answer is mandatory if require application is enabled on the server
|
28
|
-
*/
|
29
|
-
answer?: string;
|
30
23
|
}
|
31
24
|
export interface GetCaptcha {
|
32
25
|
}
|
@@ -94,12 +87,7 @@ export interface ChangePassword {
|
|
94
87
|
* The `jwt` string should be stored and used anywhere `auth` is called for.
|
95
88
|
*/
|
96
89
|
export interface LoginResponse {
|
97
|
-
|
98
|
-
* This is None in response to `Register` if email verification is enabled, or the server requires registration applications.
|
99
|
-
*/
|
100
|
-
jwt?: string;
|
101
|
-
verify_email_sent: boolean;
|
102
|
-
registration_created: boolean;
|
90
|
+
jwt: string;
|
103
91
|
}
|
104
92
|
export interface GetPersonDetails {
|
105
93
|
person_id?: number;
|
@@ -145,6 +133,9 @@ export interface BanPerson {
|
|
145
133
|
*/
|
146
134
|
remove_data?: boolean;
|
147
135
|
reason?: string;
|
136
|
+
/**
|
137
|
+
* The expire time in Unix seconds
|
138
|
+
*/
|
148
139
|
expires?: number;
|
149
140
|
auth: string;
|
150
141
|
}
|
@@ -187,8 +178,6 @@ export interface DeleteAccount {
|
|
187
178
|
password: string;
|
188
179
|
auth: string;
|
189
180
|
}
|
190
|
-
export interface DeleteAccountResponse {
|
191
|
-
}
|
192
181
|
export interface PasswordReset {
|
193
182
|
email: string;
|
194
183
|
}
|
@@ -251,11 +240,6 @@ export interface GetUnreadCountResponse {
|
|
251
240
|
mentions: number;
|
252
241
|
private_messages: number;
|
253
242
|
}
|
254
|
-
export interface VerifyEmail {
|
255
|
-
token: string;
|
256
|
-
}
|
257
|
-
export interface VerifyEmailResponse {
|
258
|
-
}
|
259
243
|
export interface BlockPerson {
|
260
244
|
person_id: number;
|
261
245
|
block: boolean;
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import { CommentView, CommunityBlockView, CommunityFollowerView, CommunityModeratorView, CommunityView, LocalUserSettingsView, ModAddCommunityView, ModAddView, ModBanFromCommunityView, ModBanView, ModLockPostView, ModRemoveCommentView, ModRemoveCommunityView, ModRemovePostView, ModStickyPostView, ModTransferCommunityView, PersonBlockView, PersonViewSafe, PostView,
|
1
|
+
import { CommentView, CommunityBlockView, CommunityFollowerView, CommunityModeratorView, CommunityView, LocalUserSettingsView, ModAddCommunityView, ModAddView, ModBanFromCommunityView, ModBanView, ModLockPostView, ModRemoveCommentView, ModRemoveCommunityView, ModRemovePostView, ModStickyPostView, ModTransferCommunityView, PersonBlockView, PersonViewSafe, PostView, SiteView } from "../views";
|
2
2
|
/**
|
3
3
|
* Search lemmy for different types of data.
|
4
4
|
*/
|
@@ -64,10 +64,6 @@ export interface CreateSite {
|
|
64
64
|
open_registration?: boolean;
|
65
65
|
enable_nsfw?: boolean;
|
66
66
|
community_creation_admin_only?: boolean;
|
67
|
-
require_email_verification?: boolean;
|
68
|
-
require_application?: boolean;
|
69
|
-
application_question?: string;
|
70
|
-
private_instance?: boolean;
|
71
67
|
auth: string;
|
72
68
|
}
|
73
69
|
export interface EditSite {
|
@@ -80,10 +76,6 @@ export interface EditSite {
|
|
80
76
|
open_registration?: boolean;
|
81
77
|
enable_nsfw?: boolean;
|
82
78
|
community_creation_admin_only?: boolean;
|
83
|
-
require_email_verification?: boolean;
|
84
|
-
require_application?: boolean;
|
85
|
-
application_question?: string;
|
86
|
-
private_instance?: boolean;
|
87
79
|
auth: string;
|
88
80
|
}
|
89
81
|
export interface GetSite {
|
@@ -146,30 +138,3 @@ export interface ResolveObjectResponse {
|
|
146
138
|
community?: CommunityView;
|
147
139
|
person?: PersonViewSafe;
|
148
140
|
}
|
149
|
-
export interface ListRegistrationApplications {
|
150
|
-
/**
|
151
|
-
* Only shows the unread applications (IE those without an admin actor)
|
152
|
-
*/
|
153
|
-
unread_only?: boolean;
|
154
|
-
page?: number;
|
155
|
-
limit?: number;
|
156
|
-
auth: string;
|
157
|
-
}
|
158
|
-
export interface ListRegistrationApplicationsResponse {
|
159
|
-
registration_applications: RegistrationApplicationView[];
|
160
|
-
}
|
161
|
-
export interface ApproveRegistrationApplication {
|
162
|
-
id: number;
|
163
|
-
approve: boolean;
|
164
|
-
deny_reason?: string;
|
165
|
-
auth: string;
|
166
|
-
}
|
167
|
-
export interface RegistrationApplicationResponse {
|
168
|
-
registration_application: RegistrationApplicationView;
|
169
|
-
}
|
170
|
-
export interface GetUnreadRegistrationApplicationCount {
|
171
|
-
auth: string;
|
172
|
-
}
|
173
|
-
export interface GetUnreadRegistrationApplicationCountResponse {
|
174
|
-
registration_applications: number;
|
175
|
-
}
|
@@ -0,0 +1,190 @@
|
|
1
|
+
import {
|
2
|
+
CommentView,
|
3
|
+
CommunityFollowerView,
|
4
|
+
CommunityModeratorView,
|
5
|
+
PostView,
|
6
|
+
PrivateMessageView,
|
7
|
+
UserMentionView,
|
8
|
+
UserViewSafe,
|
9
|
+
} from "../views";
|
10
|
+
export interface Login {
|
11
|
+
username_or_email: string;
|
12
|
+
password: string;
|
13
|
+
}
|
14
|
+
/**
|
15
|
+
* Only the first user will be able to be the admin.
|
16
|
+
*/
|
17
|
+
export interface Register {
|
18
|
+
username: string;
|
19
|
+
email?: string;
|
20
|
+
password: string;
|
21
|
+
password_verify: string;
|
22
|
+
show_nsfw: boolean;
|
23
|
+
captcha_uuid?: string;
|
24
|
+
captcha_answer?: string;
|
25
|
+
}
|
26
|
+
export interface GetCaptcha {}
|
27
|
+
export interface GetCaptchaResponse {
|
28
|
+
ok?: CaptchaResponse;
|
29
|
+
}
|
30
|
+
export interface CaptchaResponse {
|
31
|
+
png: string;
|
32
|
+
wav?: string;
|
33
|
+
uuid: string;
|
34
|
+
}
|
35
|
+
export interface SaveUserSettings {
|
36
|
+
show_nsfw: boolean;
|
37
|
+
theme: string;
|
38
|
+
default_sort_type: number;
|
39
|
+
default_listing_type: number;
|
40
|
+
lang: string;
|
41
|
+
avatar?: string;
|
42
|
+
banner?: string;
|
43
|
+
preferred_username?: string;
|
44
|
+
email?: string;
|
45
|
+
bio?: string;
|
46
|
+
matrix_user_id?: string;
|
47
|
+
new_password?: string;
|
48
|
+
new_password_verify?: string;
|
49
|
+
old_password?: string;
|
50
|
+
show_avatars: boolean;
|
51
|
+
send_notifications_to_email: boolean;
|
52
|
+
auth: string;
|
53
|
+
}
|
54
|
+
/**
|
55
|
+
* The `jwt` string should be stored and used anywhere `auth` is called for.
|
56
|
+
*/
|
57
|
+
export interface LoginResponse {
|
58
|
+
jwt: string;
|
59
|
+
}
|
60
|
+
/**
|
61
|
+
* `username` can only be used for local users. To get details for a federated user, pass `user_id` instead.
|
62
|
+
*/
|
63
|
+
export interface GetUserDetails {
|
64
|
+
user_id?: number;
|
65
|
+
username?: string;
|
66
|
+
sort: string;
|
67
|
+
page?: number;
|
68
|
+
limit?: number;
|
69
|
+
community_id?: number;
|
70
|
+
saved_only: boolean;
|
71
|
+
auth?: string;
|
72
|
+
}
|
73
|
+
export interface GetUserDetailsResponse {
|
74
|
+
user_view: UserViewSafe;
|
75
|
+
follows: CommunityFollowerView[];
|
76
|
+
moderates: CommunityModeratorView[];
|
77
|
+
comments: CommentView[];
|
78
|
+
posts: PostView[];
|
79
|
+
}
|
80
|
+
export interface GetRepliesResponse {
|
81
|
+
replies: CommentView[];
|
82
|
+
}
|
83
|
+
export interface GetUserMentionsResponse {
|
84
|
+
mentions: UserMentionView[];
|
85
|
+
}
|
86
|
+
export interface MarkAllAsRead {
|
87
|
+
auth: string;
|
88
|
+
}
|
89
|
+
export interface AddAdmin {
|
90
|
+
user_id: number;
|
91
|
+
added: boolean;
|
92
|
+
auth: string;
|
93
|
+
}
|
94
|
+
export interface AddAdminResponse {
|
95
|
+
admins: UserViewSafe[];
|
96
|
+
}
|
97
|
+
export interface BanUser {
|
98
|
+
user_id: number;
|
99
|
+
ban: boolean;
|
100
|
+
remove_data: boolean;
|
101
|
+
reason?: string;
|
102
|
+
expires?: number;
|
103
|
+
auth: string;
|
104
|
+
}
|
105
|
+
export interface BanUserResponse {
|
106
|
+
user_view: UserViewSafe;
|
107
|
+
banned: boolean;
|
108
|
+
}
|
109
|
+
export interface GetReplies {
|
110
|
+
sort: string;
|
111
|
+
page?: number;
|
112
|
+
limit?: number;
|
113
|
+
unread_only: boolean;
|
114
|
+
auth: string;
|
115
|
+
}
|
116
|
+
export interface GetUserMentions {
|
117
|
+
sort: string;
|
118
|
+
page?: number;
|
119
|
+
limit?: number;
|
120
|
+
unread_only: boolean;
|
121
|
+
auth: string;
|
122
|
+
}
|
123
|
+
export interface MarkUserMentionAsRead {
|
124
|
+
user_mention_id: number;
|
125
|
+
read: boolean;
|
126
|
+
auth: string;
|
127
|
+
}
|
128
|
+
export interface UserMentionResponse {
|
129
|
+
user_mention_view: UserMentionView;
|
130
|
+
}
|
131
|
+
/**
|
132
|
+
* Permanently deletes your posts and comments
|
133
|
+
*/
|
134
|
+
export interface DeleteAccount {
|
135
|
+
password: string;
|
136
|
+
auth: string;
|
137
|
+
}
|
138
|
+
export interface PasswordReset {
|
139
|
+
email: string;
|
140
|
+
}
|
141
|
+
export interface PasswordResetResponse {}
|
142
|
+
export interface PasswordChange {
|
143
|
+
token: string;
|
144
|
+
password: string;
|
145
|
+
password_verify: string;
|
146
|
+
}
|
147
|
+
export interface CreatePrivateMessage {
|
148
|
+
content: string;
|
149
|
+
recipient_id: number;
|
150
|
+
auth: string;
|
151
|
+
}
|
152
|
+
export interface EditPrivateMessage {
|
153
|
+
private_message_id: number;
|
154
|
+
content: string;
|
155
|
+
auth: string;
|
156
|
+
}
|
157
|
+
export interface DeletePrivateMessage {
|
158
|
+
private_message_id: number;
|
159
|
+
deleted: boolean;
|
160
|
+
auth: string;
|
161
|
+
}
|
162
|
+
export interface MarkPrivateMessageAsRead {
|
163
|
+
private_message_id: number;
|
164
|
+
read: boolean;
|
165
|
+
auth: string;
|
166
|
+
}
|
167
|
+
export interface GetPrivateMessages {
|
168
|
+
unread_only: boolean;
|
169
|
+
page?: number;
|
170
|
+
limit?: number;
|
171
|
+
auth: string;
|
172
|
+
}
|
173
|
+
export interface PrivateMessagesResponse {
|
174
|
+
private_messages: PrivateMessageView[];
|
175
|
+
}
|
176
|
+
export interface PrivateMessageResponse {
|
177
|
+
private_message_view: PrivateMessageView;
|
178
|
+
}
|
179
|
+
/**
|
180
|
+
* If a community is supplied, returns the report count for only that community, otherwise returns the report count for all communities the user moderates.
|
181
|
+
*/
|
182
|
+
export interface GetReportCount {
|
183
|
+
community?: number;
|
184
|
+
auth: string;
|
185
|
+
}
|
186
|
+
export interface GetReportCountResponse {
|
187
|
+
community?: number;
|
188
|
+
comment_reports: number;
|
189
|
+
post_reports: number;
|
190
|
+
}
|
@@ -41,43 +41,39 @@ export declare enum UserOperation {
|
|
41
41
|
EditSite = 35,
|
42
42
|
GetSite = 36,
|
43
43
|
AddAdmin = 37,
|
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
|
-
ListPostReports = 71,
|
78
|
-
GetReportCount = 72,
|
79
|
-
GetUnreadCount = 73,
|
80
|
-
VerifyEmail = 74
|
44
|
+
BanPerson = 38,
|
45
|
+
Search = 39,
|
46
|
+
ResolveObject = 40,
|
47
|
+
MarkAllAsRead = 41,
|
48
|
+
SaveUserSettings = 42,
|
49
|
+
TransferCommunity = 43,
|
50
|
+
TransferSite = 44,
|
51
|
+
DeleteAccount = 45,
|
52
|
+
PasswordReset = 46,
|
53
|
+
PasswordChange = 47,
|
54
|
+
CreatePrivateMessage = 48,
|
55
|
+
EditPrivateMessage = 49,
|
56
|
+
DeletePrivateMessage = 50,
|
57
|
+
MarkPrivateMessageAsRead = 51,
|
58
|
+
GetPrivateMessages = 52,
|
59
|
+
UserJoin = 53,
|
60
|
+
GetComments = 54,
|
61
|
+
GetSiteConfig = 55,
|
62
|
+
SaveSiteConfig = 56,
|
63
|
+
PostJoin = 57,
|
64
|
+
CommunityJoin = 58,
|
65
|
+
ChangePassword = 59,
|
66
|
+
GetSiteMetadata = 60,
|
67
|
+
BlockCommunity = 61,
|
68
|
+
BlockPerson = 62,
|
69
|
+
CreateCommentReport = 63,
|
70
|
+
ResolveCommentReport = 64,
|
71
|
+
ListCommentReports = 65,
|
72
|
+
CreatePostReport = 66,
|
73
|
+
ResolvePostReport = 67,
|
74
|
+
ListPostReports = 68,
|
75
|
+
GetReportCount = 69,
|
76
|
+
GetUnreadCount = 70
|
81
77
|
}
|
82
78
|
/**
|
83
79
|
* Different sort types used in lemmy.
|
@@ -45,43 +45,39 @@ var UserOperation;
|
|
45
45
|
UserOperation[UserOperation["EditSite"] = 35] = "EditSite";
|
46
46
|
UserOperation[UserOperation["GetSite"] = 36] = "GetSite";
|
47
47
|
UserOperation[UserOperation["AddAdmin"] = 37] = "AddAdmin";
|
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["ListPostReports"] = 71] = "ListPostReports";
|
82
|
-
UserOperation[UserOperation["GetReportCount"] = 72] = "GetReportCount";
|
83
|
-
UserOperation[UserOperation["GetUnreadCount"] = 73] = "GetUnreadCount";
|
84
|
-
UserOperation[UserOperation["VerifyEmail"] = 74] = "VerifyEmail";
|
48
|
+
UserOperation[UserOperation["BanPerson"] = 38] = "BanPerson";
|
49
|
+
UserOperation[UserOperation["Search"] = 39] = "Search";
|
50
|
+
UserOperation[UserOperation["ResolveObject"] = 40] = "ResolveObject";
|
51
|
+
UserOperation[UserOperation["MarkAllAsRead"] = 41] = "MarkAllAsRead";
|
52
|
+
UserOperation[UserOperation["SaveUserSettings"] = 42] = "SaveUserSettings";
|
53
|
+
UserOperation[UserOperation["TransferCommunity"] = 43] = "TransferCommunity";
|
54
|
+
UserOperation[UserOperation["TransferSite"] = 44] = "TransferSite";
|
55
|
+
UserOperation[UserOperation["DeleteAccount"] = 45] = "DeleteAccount";
|
56
|
+
UserOperation[UserOperation["PasswordReset"] = 46] = "PasswordReset";
|
57
|
+
UserOperation[UserOperation["PasswordChange"] = 47] = "PasswordChange";
|
58
|
+
UserOperation[UserOperation["CreatePrivateMessage"] = 48] = "CreatePrivateMessage";
|
59
|
+
UserOperation[UserOperation["EditPrivateMessage"] = 49] = "EditPrivateMessage";
|
60
|
+
UserOperation[UserOperation["DeletePrivateMessage"] = 50] = "DeletePrivateMessage";
|
61
|
+
UserOperation[UserOperation["MarkPrivateMessageAsRead"] = 51] = "MarkPrivateMessageAsRead";
|
62
|
+
UserOperation[UserOperation["GetPrivateMessages"] = 52] = "GetPrivateMessages";
|
63
|
+
UserOperation[UserOperation["UserJoin"] = 53] = "UserJoin";
|
64
|
+
UserOperation[UserOperation["GetComments"] = 54] = "GetComments";
|
65
|
+
UserOperation[UserOperation["GetSiteConfig"] = 55] = "GetSiteConfig";
|
66
|
+
UserOperation[UserOperation["SaveSiteConfig"] = 56] = "SaveSiteConfig";
|
67
|
+
UserOperation[UserOperation["PostJoin"] = 57] = "PostJoin";
|
68
|
+
UserOperation[UserOperation["CommunityJoin"] = 58] = "CommunityJoin";
|
69
|
+
UserOperation[UserOperation["ChangePassword"] = 59] = "ChangePassword";
|
70
|
+
UserOperation[UserOperation["GetSiteMetadata"] = 60] = "GetSiteMetadata";
|
71
|
+
UserOperation[UserOperation["BlockCommunity"] = 61] = "BlockCommunity";
|
72
|
+
UserOperation[UserOperation["BlockPerson"] = 62] = "BlockPerson";
|
73
|
+
UserOperation[UserOperation["CreateCommentReport"] = 63] = "CreateCommentReport";
|
74
|
+
UserOperation[UserOperation["ResolveCommentReport"] = 64] = "ResolveCommentReport";
|
75
|
+
UserOperation[UserOperation["ListCommentReports"] = 65] = "ListCommentReports";
|
76
|
+
UserOperation[UserOperation["CreatePostReport"] = 66] = "CreatePostReport";
|
77
|
+
UserOperation[UserOperation["ResolvePostReport"] = 67] = "ResolvePostReport";
|
78
|
+
UserOperation[UserOperation["ListPostReports"] = 68] = "ListPostReports";
|
79
|
+
UserOperation[UserOperation["GetReportCount"] = 69] = "GetReportCount";
|
80
|
+
UserOperation[UserOperation["GetUnreadCount"] = 70] = "GetUnreadCount";
|
85
81
|
})(UserOperation = exports.UserOperation || (exports.UserOperation = {}));
|
86
82
|
/**
|
87
83
|
* Different sort types used in lemmy.
|
@@ -13,8 +13,6 @@ export interface LocalUserSettings {
|
|
13
13
|
show_scores: boolean;
|
14
14
|
show_read_posts: boolean;
|
15
15
|
show_new_post_notifs: boolean;
|
16
|
-
email_verified: boolean;
|
17
|
-
accepted_application: boolean;
|
18
16
|
}
|
19
17
|
export interface PersonSafe {
|
20
18
|
id: number;
|
@@ -34,25 +32,22 @@ export interface PersonSafe {
|
|
34
32
|
matrix_user_id?: string;
|
35
33
|
admin: boolean;
|
36
34
|
bot_account: boolean;
|
35
|
+
ban_expires?: string;
|
37
36
|
}
|
38
37
|
export interface Site {
|
39
38
|
id: number;
|
40
39
|
name: string;
|
41
40
|
sidebar?: string;
|
41
|
+
description?: string;
|
42
42
|
creator_id: number;
|
43
43
|
published: string;
|
44
44
|
updated?: string;
|
45
45
|
enable_downvotes: boolean;
|
46
46
|
open_registration: boolean;
|
47
47
|
enable_nsfw: boolean;
|
48
|
+
community_creation_admin_only: boolean;
|
48
49
|
icon?: string;
|
49
50
|
banner?: string;
|
50
|
-
description?: string;
|
51
|
-
community_creation_admin_only: boolean;
|
52
|
-
require_email_verification: boolean;
|
53
|
-
require_application: boolean;
|
54
|
-
application_question?: string;
|
55
|
-
private_instance: boolean;
|
56
51
|
}
|
57
52
|
export interface PrivateMessage {
|
58
53
|
id: number;
|
@@ -234,11 +229,3 @@ export interface PersonMention {
|
|
234
229
|
read: boolean;
|
235
230
|
published: string;
|
236
231
|
}
|
237
|
-
export interface RegistrationApplication {
|
238
|
-
id: number;
|
239
|
-
local_user_id: number;
|
240
|
-
answer: string;
|
241
|
-
admin_id?: number;
|
242
|
-
deny_reason?: string;
|
243
|
-
published: string;
|
244
|
-
}
|
@@ -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,
|
2
|
+
import { Comment, CommentReport, CommunitySafe, LocalUserSettings, ModAdd, ModAddCommunity, ModBan, ModBanFromCommunity, ModLockPost, ModRemoveComment, ModRemoveCommunity, ModRemovePost, ModStickyPost, ModTransferCommunity, PersonMention, PersonSafe, Post, PostReport, PrivateMessage, Site } from "./source";
|
3
3
|
export interface PersonViewSafe {
|
4
4
|
person: PersonSafe;
|
5
5
|
counts: PersonAggregates;
|
@@ -166,9 +166,3 @@ export interface CommunityView {
|
|
166
166
|
blocked: boolean;
|
167
167
|
counts: CommunityAggregates;
|
168
168
|
}
|
169
|
-
export interface RegistrationApplicationView {
|
170
|
-
registration_application: RegistrationApplication;
|
171
|
-
creator_local_user: LocalUserSettings;
|
172
|
-
creator: PersonSafe;
|
173
|
-
admin?: PersonSafe;
|
174
|
-
}
|
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
|
-
import { AddAdmin, BanPerson, BlockPerson, ChangePassword, CreatePrivateMessage, DeleteAccount, DeletePrivateMessage, EditPrivateMessage, GetPersonDetails, GetPersonMentions, GetPrivateMessages, GetReplies, GetReportCount, GetUnreadCount, Login, MarkAllAsRead, MarkPersonMentionAsRead, MarkPrivateMessageAsRead, PasswordChange, PasswordReset, Register, SaveUserSettings
|
3
|
+
import { AddAdmin, BanPerson, BlockPerson, ChangePassword, CreatePrivateMessage, DeleteAccount, DeletePrivateMessage, EditPrivateMessage, GetPersonDetails, GetPersonMentions, GetPrivateMessages, GetReplies, GetReportCount, GetUnreadCount, Login, MarkAllAsRead, MarkPersonMentionAsRead, MarkPrivateMessageAsRead, PasswordChange, PasswordReset, Register, SaveUserSettings } from "./interfaces/api/person";
|
4
4
|
import { CreatePost, CreatePostLike, CreatePostReport, DeletePost, EditPost, GetPost, GetPosts, GetSiteMetadata, ListPostReports, LockPost, RemovePost, ResolvePostReport, SavePost, StickyPost } from "./interfaces/api/post";
|
5
|
-
import {
|
5
|
+
import { CreateSite, EditSite, GetModlog, GetSite, GetSiteConfig, ResolveObject, SaveSiteConfig, Search, TransferSite } 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.
|
@@ -197,18 +197,6 @@ export declare class LemmyWebsocket {
|
|
197
197
|
* Add an admin to your site.
|
198
198
|
*/
|
199
199
|
addAdmin(form: AddAdmin): string;
|
200
|
-
/**
|
201
|
-
* Get the unread registration applications count.
|
202
|
-
*/
|
203
|
-
getUnreadRegistrationApplicationCount(form: GetUnreadRegistrationApplicationCount): string;
|
204
|
-
/**
|
205
|
-
* List the unread registration applications.
|
206
|
-
*/
|
207
|
-
listRegistrationApplications(form: ListRegistrationApplications): string;
|
208
|
-
/**
|
209
|
-
* Approve a registration application
|
210
|
-
*/
|
211
|
-
approveRegistrationApplication(form: ApproveRegistrationApplication): string;
|
212
200
|
/**
|
213
201
|
* Get the details for a person.
|
214
202
|
*/
|
@@ -273,10 +261,6 @@ export declare class LemmyWebsocket {
|
|
273
261
|
* Get your unread counts
|
274
262
|
*/
|
275
263
|
getUnreadCount(form: GetUnreadCount): string;
|
276
|
-
/**
|
277
|
-
* Verify your email
|
278
|
-
*/
|
279
|
-
verifyEmail(form: VerifyEmail): string;
|
280
264
|
/**
|
281
265
|
* Delete your account.
|
282
266
|
*/
|
package/dist/websocket.js
CHANGED
@@ -284,24 +284,6 @@ var LemmyWebsocket = /** @class */ (function () {
|
|
284
284
|
LemmyWebsocket.prototype.addAdmin = function (form) {
|
285
285
|
return wrapper(others_1.UserOperation.AddAdmin, form);
|
286
286
|
};
|
287
|
-
/**
|
288
|
-
* Get the unread registration applications count.
|
289
|
-
*/
|
290
|
-
LemmyWebsocket.prototype.getUnreadRegistrationApplicationCount = function (form) {
|
291
|
-
return wrapper(others_1.UserOperation.GetUnreadRegistrationApplicationCount, form);
|
292
|
-
};
|
293
|
-
/**
|
294
|
-
* List the unread registration applications.
|
295
|
-
*/
|
296
|
-
LemmyWebsocket.prototype.listRegistrationApplications = function (form) {
|
297
|
-
return wrapper(others_1.UserOperation.ListRegistrationApplications, form);
|
298
|
-
};
|
299
|
-
/**
|
300
|
-
* Approve a registration application
|
301
|
-
*/
|
302
|
-
LemmyWebsocket.prototype.approveRegistrationApplication = function (form) {
|
303
|
-
return wrapper(others_1.UserOperation.ApproveRegistrationApplication, form);
|
304
|
-
};
|
305
287
|
/**
|
306
288
|
* Get the details for a person.
|
307
289
|
*/
|
@@ -399,12 +381,6 @@ var LemmyWebsocket = /** @class */ (function () {
|
|
399
381
|
LemmyWebsocket.prototype.getUnreadCount = function (form) {
|
400
382
|
return wrapper(others_1.UserOperation.GetUnreadCount, form);
|
401
383
|
};
|
402
|
-
/**
|
403
|
-
* Verify your email
|
404
|
-
*/
|
405
|
-
LemmyWebsocket.prototype.verifyEmail = function (form) {
|
406
|
-
return wrapper(others_1.UserOperation.VerifyEmail, form);
|
407
|
-
};
|
408
384
|
/**
|
409
385
|
* Delete your account.
|
410
386
|
*/
|
package/package.json
CHANGED