lemmy-js-client 0.15.0-rc.7 → 0.15.0-rc.8
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/http.d.ts +23 -3
- package/dist/http.js +50 -0
- package/dist/interfaces/api/community.d.ts +0 -6
- package/dist/interfaces/api/person.d.ts +26 -4
- package/dist/interfaces/api/site.d.ts +37 -2
- package/dist/interfaces/others.d.ts +38 -33
- package/dist/interfaces/others.js +38 -33
- package/dist/interfaces/source.d.ts +16 -3
- package/dist/interfaces/views.d.ts +7 -1
- package/dist/websocket.d.ts +22 -2
- package/dist/websocket.js +30 -0
- 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, 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";
|
3
|
+
import { AddAdmin, AddAdminResponse, BannedPersonsResponse, BanPerson, BanPersonResponse, BlockPerson, BlockPersonResponse, ChangePassword, CreatePrivateMessage, DeleteAccount, DeleteAccountResponse, DeletePrivateMessage, EditPrivateMessage, GetBannedPersons, GetCaptchaResponse, GetPersonDetails, GetPersonDetailsResponse, GetPersonMentions, GetPersonMentionsResponse, GetPrivateMessages, GetReplies, GetRepliesResponse, GetReportCount, GetReportCountResponse, GetUnreadCount, GetUnreadCountResponse, Login, LoginResponse, MarkAllAsRead, MarkPersonMentionAsRead, MarkPrivateMessageAsRead, PasswordChange, PasswordReset, PasswordResetResponse, PersonMentionResponse, PrivateMessageResponse, PrivateMessagesResponse, Register, SaveUserSettings, VerifyEmail, VerifyEmailResponse } from "./interfaces/api/person";
|
4
4
|
import { CreatePost, CreatePostLike, CreatePostReport, DeletePost, EditPost, GetPost, GetPostResponse, GetPosts, GetPostsResponse, GetSiteMetadata, GetSiteMetadataResponse, ListPostReports, ListPostReportsResponse, LockPost, PostReportResponse, PostResponse, RemovePost, ResolvePostReport, SavePost, StickyPost } from "./interfaces/api/post";
|
5
|
-
import { CreateSite, EditSite, GetModlog, GetModlogResponse, GetSite, GetSiteConfig, GetSiteConfigResponse, GetSiteResponse, ResolveObject, ResolveObjectResponse, SaveSiteConfig, Search, SearchResponse, SiteResponse, TransferSite } from "./interfaces/api/site";
|
5
|
+
import { ApproveRegistrationApplication, CreateSite, EditSite, GetModlog, GetModlogResponse, GetSite, GetSiteConfig, GetSiteConfigResponse, GetSiteResponse, GetUnreadRegistrationApplicationCount, GetUnreadRegistrationApplicationCountResponse, ListRegistrationApplications, ListRegistrationApplicationsResponse, RegistrationApplicationResponse, ResolveObject, ResolveObjectResponse, SaveSiteConfig, Search, SearchResponse, SiteResponse, TransferSite } from "./interfaces/api/site";
|
6
6
|
/**
|
7
7
|
* Helps build lemmy HTTP requests.
|
8
8
|
*/
|
@@ -245,6 +245,10 @@ export declare class LemmyHttp {
|
|
245
245
|
* Ban a person from your site.
|
246
246
|
*/
|
247
247
|
banPerson(form: BanPerson): Promise<BanPersonResponse>;
|
248
|
+
/**
|
249
|
+
* Get a list of banned users
|
250
|
+
*/
|
251
|
+
getBannedPersons(form: GetBannedPersons): Promise<BannedPersonsResponse>;
|
248
252
|
/**
|
249
253
|
* Block a person.
|
250
254
|
*/
|
@@ -256,7 +260,7 @@ export declare class LemmyHttp {
|
|
256
260
|
/**
|
257
261
|
* Delete your account.
|
258
262
|
*/
|
259
|
-
deleteAccount(form: DeleteAccount): Promise<
|
263
|
+
deleteAccount(form: DeleteAccount): Promise<DeleteAccountResponse>;
|
260
264
|
/**
|
261
265
|
* Reset your password.
|
262
266
|
*/
|
@@ -285,10 +289,26 @@ export declare class LemmyHttp {
|
|
285
289
|
* Get your unread counts
|
286
290
|
*/
|
287
291
|
getUnreadCount(form: GetUnreadCount): Promise<GetUnreadCountResponse>;
|
292
|
+
/**
|
293
|
+
* Verify your email
|
294
|
+
*/
|
295
|
+
verifyEmail(form: VerifyEmail): Promise<VerifyEmailResponse>;
|
288
296
|
/**
|
289
297
|
* Add an admin to your site.
|
290
298
|
*/
|
291
299
|
addAdmin(form: AddAdmin): Promise<AddAdminResponse>;
|
300
|
+
/**
|
301
|
+
* Get the unread registration applications count.
|
302
|
+
*/
|
303
|
+
getUnreadRegistrationApplicationCount(form: GetUnreadRegistrationApplicationCount): Promise<GetUnreadRegistrationApplicationCountResponse>;
|
304
|
+
/**
|
305
|
+
* List the unread registration applications.
|
306
|
+
*/
|
307
|
+
listRegistrationApplications(form: ListRegistrationApplications): Promise<ListRegistrationApplicationsResponse>;
|
308
|
+
/**
|
309
|
+
* Approve a registration application
|
310
|
+
*/
|
311
|
+
approveRegistrationApplication(form: ApproveRegistrationApplication): Promise<RegistrationApplicationResponse>;
|
292
312
|
private buildFullUrl;
|
293
313
|
private wrapper;
|
294
314
|
}
|
package/dist/http.js
CHANGED
@@ -642,6 +642,16 @@ var LemmyHttp = /** @class */ (function () {
|
|
642
642
|
});
|
643
643
|
});
|
644
644
|
};
|
645
|
+
/**
|
646
|
+
* Get a list of banned users
|
647
|
+
*/
|
648
|
+
LemmyHttp.prototype.getBannedPersons = function (form) {
|
649
|
+
return __awaiter(this, void 0, void 0, function () {
|
650
|
+
return __generator(this, function (_a) {
|
651
|
+
return [2 /*return*/, this.wrapper(HttpType.Get, "/user/banned", form)];
|
652
|
+
});
|
653
|
+
});
|
654
|
+
};
|
645
655
|
/**
|
646
656
|
* Block a person.
|
647
657
|
*/
|
@@ -742,6 +752,16 @@ var LemmyHttp = /** @class */ (function () {
|
|
742
752
|
});
|
743
753
|
});
|
744
754
|
};
|
755
|
+
/**
|
756
|
+
* Verify your email
|
757
|
+
*/
|
758
|
+
LemmyHttp.prototype.verifyEmail = function (form) {
|
759
|
+
return __awaiter(this, void 0, void 0, function () {
|
760
|
+
return __generator(this, function (_a) {
|
761
|
+
return [2 /*return*/, this.wrapper(HttpType.Post, "/user/verify_email", form)];
|
762
|
+
});
|
763
|
+
});
|
764
|
+
};
|
745
765
|
/**
|
746
766
|
* Add an admin to your site.
|
747
767
|
*/
|
@@ -752,6 +772,36 @@ var LemmyHttp = /** @class */ (function () {
|
|
752
772
|
});
|
753
773
|
});
|
754
774
|
};
|
775
|
+
/**
|
776
|
+
* Get the unread registration applications count.
|
777
|
+
*/
|
778
|
+
LemmyHttp.prototype.getUnreadRegistrationApplicationCount = 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/count", form)];
|
782
|
+
});
|
783
|
+
});
|
784
|
+
};
|
785
|
+
/**
|
786
|
+
* List the unread registration applications.
|
787
|
+
*/
|
788
|
+
LemmyHttp.prototype.listRegistrationApplications = function (form) {
|
789
|
+
return __awaiter(this, void 0, void 0, function () {
|
790
|
+
return __generator(this, function (_a) {
|
791
|
+
return [2 /*return*/, this.wrapper(HttpType.Get, "/admin/registration_application/list", form)];
|
792
|
+
});
|
793
|
+
});
|
794
|
+
};
|
795
|
+
/**
|
796
|
+
* Approve a registration application
|
797
|
+
*/
|
798
|
+
LemmyHttp.prototype.approveRegistrationApplication = function (form) {
|
799
|
+
return __awaiter(this, void 0, void 0, function () {
|
800
|
+
return __generator(this, function (_a) {
|
801
|
+
return [2 /*return*/, this.wrapper(HttpType.Put, "/admin/registration_application/approve", form)];
|
802
|
+
});
|
803
|
+
});
|
804
|
+
};
|
755
805
|
LemmyHttp.prototype.buildFullUrl = function (endpoint) {
|
756
806
|
return "".concat(this.apiUrl).concat(endpoint);
|
757
807
|
};
|
@@ -51,9 +51,6 @@ export interface BanFromCommunity {
|
|
51
51
|
*/
|
52
52
|
remove_data?: boolean;
|
53
53
|
reason?: string;
|
54
|
-
/**
|
55
|
-
* The expire time in Unix seconds
|
56
|
-
*/
|
57
54
|
expires?: number;
|
58
55
|
auth: string;
|
59
56
|
}
|
@@ -94,9 +91,6 @@ export interface RemoveCommunity {
|
|
94
91
|
community_id: number;
|
95
92
|
removed: boolean;
|
96
93
|
reason?: string;
|
97
|
-
/**
|
98
|
-
* The expire time in Unix seconds
|
99
|
-
*/
|
100
94
|
expires?: number;
|
101
95
|
auth: string;
|
102
96
|
}
|
@@ -10,6 +10,9 @@ 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
|
+
*/
|
13
16
|
email?: string;
|
14
17
|
password: string;
|
15
18
|
password_verify: string;
|
@@ -20,6 +23,10 @@ export interface Register {
|
|
20
23
|
captcha_uuid?: string;
|
21
24
|
captcha_answer?: string;
|
22
25
|
honeypot?: string;
|
26
|
+
/**
|
27
|
+
* An answer is mandatory if require application is enabled on the server
|
28
|
+
*/
|
29
|
+
answer?: string;
|
23
30
|
}
|
24
31
|
export interface GetCaptcha {
|
25
32
|
}
|
@@ -87,7 +94,12 @@ export interface ChangePassword {
|
|
87
94
|
* The `jwt` string should be stored and used anywhere `auth` is called for.
|
88
95
|
*/
|
89
96
|
export interface LoginResponse {
|
90
|
-
|
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;
|
91
103
|
}
|
92
104
|
export interface GetPersonDetails {
|
93
105
|
person_id?: number;
|
@@ -133,9 +145,6 @@ export interface BanPerson {
|
|
133
145
|
*/
|
134
146
|
remove_data?: boolean;
|
135
147
|
reason?: string;
|
136
|
-
/**
|
137
|
-
* The expire time in Unix seconds
|
138
|
-
*/
|
139
148
|
expires?: number;
|
140
149
|
auth: string;
|
141
150
|
}
|
@@ -178,6 +187,8 @@ export interface DeleteAccount {
|
|
178
187
|
password: string;
|
179
188
|
auth: string;
|
180
189
|
}
|
190
|
+
export interface DeleteAccountResponse {
|
191
|
+
}
|
181
192
|
export interface PasswordReset {
|
182
193
|
email: string;
|
183
194
|
}
|
@@ -240,6 +251,11 @@ export interface GetUnreadCountResponse {
|
|
240
251
|
mentions: number;
|
241
252
|
private_messages: number;
|
242
253
|
}
|
254
|
+
export interface VerifyEmail {
|
255
|
+
token: string;
|
256
|
+
}
|
257
|
+
export interface VerifyEmailResponse {
|
258
|
+
}
|
243
259
|
export interface BlockPerson {
|
244
260
|
person_id: number;
|
245
261
|
block: boolean;
|
@@ -249,3 +265,9 @@ export interface BlockPersonResponse {
|
|
249
265
|
person_view: PersonViewSafe;
|
250
266
|
blocked: boolean;
|
251
267
|
}
|
268
|
+
export interface GetBannedPersons {
|
269
|
+
auth: string;
|
270
|
+
}
|
271
|
+
export interface BannedPersonsResponse {
|
272
|
+
banned: PersonViewSafe[];
|
273
|
+
}
|
@@ -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, SiteView } from "../views";
|
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";
|
2
2
|
/**
|
3
3
|
* Search lemmy for different types of data.
|
4
4
|
*/
|
@@ -41,6 +41,7 @@ export interface GetModlog {
|
|
41
41
|
community_id?: number;
|
42
42
|
page?: number;
|
43
43
|
limit?: number;
|
44
|
+
auth?: string;
|
44
45
|
}
|
45
46
|
export interface GetModlogResponse {
|
46
47
|
removed_posts: ModRemovePostView[];
|
@@ -64,6 +65,10 @@ export interface CreateSite {
|
|
64
65
|
open_registration?: boolean;
|
65
66
|
enable_nsfw?: boolean;
|
66
67
|
community_creation_admin_only?: boolean;
|
68
|
+
require_email_verification?: boolean;
|
69
|
+
require_application?: boolean;
|
70
|
+
application_question?: string;
|
71
|
+
private_instance?: boolean;
|
67
72
|
auth: string;
|
68
73
|
}
|
69
74
|
export interface EditSite {
|
@@ -76,6 +81,10 @@ export interface EditSite {
|
|
76
81
|
open_registration?: boolean;
|
77
82
|
enable_nsfw?: boolean;
|
78
83
|
community_creation_admin_only?: boolean;
|
84
|
+
require_email_verification?: boolean;
|
85
|
+
require_application?: boolean;
|
86
|
+
application_question?: string;
|
87
|
+
private_instance?: boolean;
|
79
88
|
auth: string;
|
80
89
|
}
|
81
90
|
export interface GetSite {
|
@@ -90,7 +99,6 @@ export interface GetSiteResponse {
|
|
90
99
|
*/
|
91
100
|
site_view?: SiteView;
|
92
101
|
admins: PersonViewSafe[];
|
93
|
-
banned: PersonViewSafe[];
|
94
102
|
online: number;
|
95
103
|
version: string;
|
96
104
|
/**
|
@@ -138,3 +146,30 @@ export interface ResolveObjectResponse {
|
|
138
146
|
community?: CommunityView;
|
139
147
|
person?: PersonViewSafe;
|
140
148
|
}
|
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
|
+
}
|
@@ -41,39 +41,44 @@ 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
|
-
|
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
|
+
TransferSite = 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
|
77
82
|
}
|
78
83
|
/**
|
79
84
|
* Different sort types used in lemmy.
|
@@ -45,39 +45,44 @@ 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["
|
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["TransferSite"] = 48] = "TransferSite";
|
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";
|
81
86
|
})(UserOperation = exports.UserOperation || (exports.UserOperation = {}));
|
82
87
|
/**
|
83
88
|
* Different sort types used in lemmy.
|
@@ -13,6 +13,8 @@ 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;
|
16
18
|
}
|
17
19
|
export interface PersonSafe {
|
18
20
|
id: number;
|
@@ -32,22 +34,25 @@ export interface PersonSafe {
|
|
32
34
|
matrix_user_id?: string;
|
33
35
|
admin: boolean;
|
34
36
|
bot_account: boolean;
|
35
|
-
ban_expires?: string;
|
36
37
|
}
|
37
38
|
export interface Site {
|
38
39
|
id: number;
|
39
40
|
name: string;
|
40
41
|
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;
|
49
48
|
icon?: string;
|
50
49
|
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;
|
51
56
|
}
|
52
57
|
export interface PrivateMessage {
|
53
58
|
id: number;
|
@@ -229,3 +234,11 @@ export interface PersonMention {
|
|
229
234
|
read: boolean;
|
230
235
|
published: string;
|
231
236
|
}
|
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, Site } from "./source";
|
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";
|
3
3
|
export interface PersonViewSafe {
|
4
4
|
person: PersonSafe;
|
5
5
|
counts: PersonAggregates;
|
@@ -166,3 +166,9 @@ 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 } from "./interfaces/api/person";
|
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
4
|
import { CreatePost, CreatePostLike, CreatePostReport, DeletePost, EditPost, GetPost, GetPosts, GetSiteMetadata, ListPostReports, LockPost, RemovePost, ResolvePostReport, SavePost, StickyPost } from "./interfaces/api/post";
|
5
|
-
import { CreateSite, EditSite, GetModlog, GetSite, GetSiteConfig, ResolveObject, SaveSiteConfig, Search, TransferSite } from "./interfaces/api/site";
|
5
|
+
import { ApproveRegistrationApplication, CreateSite, EditSite, GetModlog, GetSite, GetSiteConfig, GetUnreadRegistrationApplicationCount, ListRegistrationApplications, 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.
|
@@ -193,10 +193,26 @@ export declare class LemmyWebsocket {
|
|
193
193
|
* Ban a person from your site.
|
194
194
|
*/
|
195
195
|
banPerson(form: BanPerson): string;
|
196
|
+
/**
|
197
|
+
* Get a list of banned users
|
198
|
+
*/
|
199
|
+
getBannedPersons(form: GetBannedPersons): string;
|
196
200
|
/**
|
197
201
|
* Add an admin to your site.
|
198
202
|
*/
|
199
203
|
addAdmin(form: AddAdmin): string;
|
204
|
+
/**
|
205
|
+
* Get the unread registration applications count.
|
206
|
+
*/
|
207
|
+
getUnreadRegistrationApplicationCount(form: GetUnreadRegistrationApplicationCount): string;
|
208
|
+
/**
|
209
|
+
* List the unread registration applications.
|
210
|
+
*/
|
211
|
+
listRegistrationApplications(form: ListRegistrationApplications): string;
|
212
|
+
/**
|
213
|
+
* Approve a registration application
|
214
|
+
*/
|
215
|
+
approveRegistrationApplication(form: ApproveRegistrationApplication): string;
|
200
216
|
/**
|
201
217
|
* Get the details for a person.
|
202
218
|
*/
|
@@ -261,6 +277,10 @@ export declare class LemmyWebsocket {
|
|
261
277
|
* Get your unread counts
|
262
278
|
*/
|
263
279
|
getUnreadCount(form: GetUnreadCount): string;
|
280
|
+
/**
|
281
|
+
* Verify your email
|
282
|
+
*/
|
283
|
+
verifyEmail(form: VerifyEmail): string;
|
264
284
|
/**
|
265
285
|
* Delete your account.
|
266
286
|
*/
|
package/dist/websocket.js
CHANGED
@@ -278,12 +278,36 @@ var LemmyWebsocket = /** @class */ (function () {
|
|
278
278
|
LemmyWebsocket.prototype.banPerson = function (form) {
|
279
279
|
return wrapper(others_1.UserOperation.BanPerson, form);
|
280
280
|
};
|
281
|
+
/**
|
282
|
+
* Get a list of banned users
|
283
|
+
*/
|
284
|
+
LemmyWebsocket.prototype.getBannedPersons = function (form) {
|
285
|
+
return wrapper(others_1.UserOperation.GetBannedPersons, form);
|
286
|
+
};
|
281
287
|
/**
|
282
288
|
* Add an admin to your site.
|
283
289
|
*/
|
284
290
|
LemmyWebsocket.prototype.addAdmin = function (form) {
|
285
291
|
return wrapper(others_1.UserOperation.AddAdmin, form);
|
286
292
|
};
|
293
|
+
/**
|
294
|
+
* Get the unread registration applications count.
|
295
|
+
*/
|
296
|
+
LemmyWebsocket.prototype.getUnreadRegistrationApplicationCount = function (form) {
|
297
|
+
return wrapper(others_1.UserOperation.GetUnreadRegistrationApplicationCount, form);
|
298
|
+
};
|
299
|
+
/**
|
300
|
+
* List the unread registration applications.
|
301
|
+
*/
|
302
|
+
LemmyWebsocket.prototype.listRegistrationApplications = function (form) {
|
303
|
+
return wrapper(others_1.UserOperation.ListRegistrationApplications, form);
|
304
|
+
};
|
305
|
+
/**
|
306
|
+
* Approve a registration application
|
307
|
+
*/
|
308
|
+
LemmyWebsocket.prototype.approveRegistrationApplication = function (form) {
|
309
|
+
return wrapper(others_1.UserOperation.ApproveRegistrationApplication, form);
|
310
|
+
};
|
287
311
|
/**
|
288
312
|
* Get the details for a person.
|
289
313
|
*/
|
@@ -381,6 +405,12 @@ var LemmyWebsocket = /** @class */ (function () {
|
|
381
405
|
LemmyWebsocket.prototype.getUnreadCount = function (form) {
|
382
406
|
return wrapper(others_1.UserOperation.GetUnreadCount, form);
|
383
407
|
};
|
408
|
+
/**
|
409
|
+
* Verify your email
|
410
|
+
*/
|
411
|
+
LemmyWebsocket.prototype.verifyEmail = function (form) {
|
412
|
+
return wrapper(others_1.UserOperation.VerifyEmail, form);
|
413
|
+
};
|
384
414
|
/**
|
385
415
|
* Delete your account.
|
386
416
|
*/
|
package/package.json
CHANGED