lemmy-js-client 0.15.0-rc.6 → 0.15.1-rc.1
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/http.d.ts +8 -4
- package/dist/http.js +13 -3
- package/dist/interfaces/api/community.d.ts +6 -0
- package/dist/interfaces/api/person.d.ts +9 -0
- package/dist/interfaces/api/site.d.ts +1 -3
- package/dist/interfaces/others.d.ts +34 -33
- package/dist/interfaces/others.js +34 -33
- package/dist/interfaces/source.d.ts +1 -1
- package/dist/websocket.d.ts +8 -4
- package/dist/websocket.js +9 -3
- package/package.json +7 -7
- package/dist/interfaces/api/user.d.ts +0 -190
- package/dist/interfaces/api/user.js +0 -2
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, DeleteAccountResponse, 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, VerifyEmail, VerifyEmailResponse } from "./interfaces/api/person";
|
3
|
+
import { AddAdmin, AddAdminResponse, BannedPersonsResponse, BanPerson, BanPersonResponse, BlockPerson, BlockPersonResponse, ChangePassword, CreatePrivateMessage, DeleteAccount, DeleteAccountResponse, DeletePrivateMessage, EditPrivateMessage, GetBannedPersons, GetCaptchaResponse, GetPersonDetails, GetPersonDetailsResponse, GetPersonMentions, GetPersonMentionsResponse, GetPrivateMessages, GetReplies, GetRepliesResponse, GetReportCount, GetReportCountResponse, GetUnreadCount, GetUnreadCountResponse, Login, LoginResponse, MarkAllAsRead, 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 { ApproveRegistrationApplication, CreateSite, EditSite, GetModlog, GetModlogResponse, GetSite, GetSiteConfig, GetSiteConfigResponse, GetSiteResponse, GetUnreadRegistrationApplicationCount, GetUnreadRegistrationApplicationCountResponse, ListRegistrationApplications, ListRegistrationApplicationsResponse, RegistrationApplicationResponse, ResolveObject, ResolveObjectResponse, SaveSiteConfig, Search, SearchResponse, SiteResponse
|
5
|
+
import { ApproveRegistrationApplication, CreateSite, EditSite, GetModlog, GetModlogResponse, GetSite, GetSiteConfig, GetSiteConfigResponse, GetSiteResponse, GetUnreadRegistrationApplicationCount, GetUnreadRegistrationApplicationCountResponse, LeaveAdmin, ListRegistrationApplications, ListRegistrationApplicationsResponse, RegistrationApplicationResponse, ResolveObject, ResolveObjectResponse, SaveSiteConfig, Search, SearchResponse, SiteResponse } from "./interfaces/api/site";
|
6
6
|
/**
|
7
7
|
* Helps build lemmy HTTP requests.
|
8
8
|
*/
|
@@ -30,9 +30,9 @@ export declare class LemmyHttp {
|
|
30
30
|
*/
|
31
31
|
editSite(form: EditSite): Promise<SiteResponse>;
|
32
32
|
/**
|
33
|
-
*
|
33
|
+
* Leave the Site admins.
|
34
34
|
*/
|
35
|
-
|
35
|
+
leaveAdmin(form: LeaveAdmin): Promise<GetSiteResponse>;
|
36
36
|
/**
|
37
37
|
* Get your site configuration.
|
38
38
|
*/
|
@@ -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
|
*/
|
package/dist/http.js
CHANGED
@@ -103,12 +103,12 @@ var LemmyHttp = /** @class */ (function () {
|
|
103
103
|
});
|
104
104
|
};
|
105
105
|
/**
|
106
|
-
*
|
106
|
+
* Leave the Site admins.
|
107
107
|
*/
|
108
|
-
LemmyHttp.prototype.
|
108
|
+
LemmyHttp.prototype.leaveAdmin = function (form) {
|
109
109
|
return __awaiter(this, void 0, void 0, function () {
|
110
110
|
return __generator(this, function (_a) {
|
111
|
-
return [2 /*return*/, this.wrapper(HttpType.Post, "/
|
111
|
+
return [2 /*return*/, this.wrapper(HttpType.Post, "/user/leave_admin", form)];
|
112
112
|
});
|
113
113
|
});
|
114
114
|
};
|
@@ -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
|
*/
|
@@ -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
|
}
|
@@ -145,6 +145,9 @@ export interface BanPerson {
|
|
145
145
|
*/
|
146
146
|
remove_data?: boolean;
|
147
147
|
reason?: string;
|
148
|
+
/**
|
149
|
+
* The expire time in Unix seconds
|
150
|
+
*/
|
148
151
|
expires?: number;
|
149
152
|
auth: string;
|
150
153
|
}
|
@@ -265,3 +268,9 @@ export interface BlockPersonResponse {
|
|
265
268
|
person_view: PersonViewSafe;
|
266
269
|
blocked: boolean;
|
267
270
|
}
|
271
|
+
export interface GetBannedPersons {
|
272
|
+
auth: string;
|
273
|
+
}
|
274
|
+
export interface BannedPersonsResponse {
|
275
|
+
banned: PersonViewSafe[];
|
276
|
+
}
|
@@ -99,7 +99,6 @@ export interface GetSiteResponse {
|
|
99
99
|
*/
|
100
100
|
site_view?: SiteView;
|
101
101
|
admins: PersonViewSafe[];
|
102
|
-
banned: PersonViewSafe[];
|
103
102
|
online: number;
|
104
103
|
version: string;
|
105
104
|
/**
|
@@ -118,8 +117,7 @@ export interface MyUserInfo {
|
|
118
117
|
community_blocks: CommunityBlockView[];
|
119
118
|
person_blocks: PersonBlockView[];
|
120
119
|
}
|
121
|
-
export interface
|
122
|
-
person_id: number;
|
120
|
+
export interface LeaveAdmin {
|
123
121
|
auth: string;
|
124
122
|
}
|
125
123
|
export interface GetSiteConfig {
|
@@ -45,39 +45,40 @@ export declare enum UserOperation {
|
|
45
45
|
ListRegistrationApplications = 39,
|
46
46
|
ApproveRegistrationApplication = 40,
|
47
47
|
BanPerson = 41,
|
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
|
-
|
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
|
81
82
|
}
|
82
83
|
/**
|
83
84
|
* Different sort types used in lemmy.
|
@@ -49,39 +49,40 @@ var UserOperation;
|
|
49
49
|
UserOperation[UserOperation["ListRegistrationApplications"] = 39] = "ListRegistrationApplications";
|
50
50
|
UserOperation[UserOperation["ApproveRegistrationApplication"] = 40] = "ApproveRegistrationApplication";
|
51
51
|
UserOperation[UserOperation["BanPerson"] = 41] = "BanPerson";
|
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["
|
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";
|
85
86
|
})(UserOperation = exports.UserOperation || (exports.UserOperation = {}));
|
86
87
|
/**
|
87
88
|
* Different sort types used in lemmy.
|
@@ -34,12 +34,12 @@ export interface PersonSafe {
|
|
34
34
|
matrix_user_id?: string;
|
35
35
|
admin: boolean;
|
36
36
|
bot_account: boolean;
|
37
|
+
ban_expires?: string;
|
37
38
|
}
|
38
39
|
export interface Site {
|
39
40
|
id: number;
|
40
41
|
name: string;
|
41
42
|
sidebar?: string;
|
42
|
-
creator_id: number;
|
43
43
|
published: string;
|
44
44
|
updated?: string;
|
45
45
|
enable_downvotes: boolean;
|
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, VerifyEmail } 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 { ApproveRegistrationApplication, CreateSite, EditSite, GetModlog, GetSite, GetSiteConfig, GetUnreadRegistrationApplicationCount, ListRegistrationApplications, ResolveObject, SaveSiteConfig, Search
|
5
|
+
import { ApproveRegistrationApplication, CreateSite, EditSite, GetModlog, GetSite, GetSiteConfig, GetUnreadRegistrationApplicationCount, LeaveAdmin, ListRegistrationApplications, 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.
|
@@ -186,13 +186,17 @@ export declare class LemmyWebsocket {
|
|
186
186
|
*/
|
187
187
|
transferCommunity(form: TransferCommunity): string;
|
188
188
|
/**
|
189
|
-
*
|
189
|
+
* Leave the Site admins.
|
190
190
|
*/
|
191
|
-
|
191
|
+
leaveAdmin(form: LeaveAdmin): string;
|
192
192
|
/**
|
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
|
*/
|
package/dist/websocket.js
CHANGED
@@ -267,10 +267,10 @@ var LemmyWebsocket = /** @class */ (function () {
|
|
267
267
|
return wrapper(others_1.UserOperation.TransferCommunity, form);
|
268
268
|
};
|
269
269
|
/**
|
270
|
-
*
|
270
|
+
* Leave the Site admins.
|
271
271
|
*/
|
272
|
-
LemmyWebsocket.prototype.
|
273
|
-
return wrapper(others_1.UserOperation.
|
272
|
+
LemmyWebsocket.prototype.leaveAdmin = function (form) {
|
273
|
+
return wrapper(others_1.UserOperation.LeaveAdmin, form);
|
274
274
|
};
|
275
275
|
/**
|
276
276
|
* Ban a person from your site.
|
@@ -278,6 +278,12 @@ 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
|
*/
|
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.15.
|
4
|
+
"version": "0.15.1-rc.1",
|
5
5
|
"author": "Dessalines <tyhou13@gmx.com>",
|
6
6
|
"license": "AGPL-3.0",
|
7
7
|
"main": "./dist/index.js",
|
@@ -16,14 +16,14 @@
|
|
16
16
|
},
|
17
17
|
"repository": "https://github.com/LemmyNet/lemmy-js-client",
|
18
18
|
"devDependencies": {
|
19
|
-
"@types/node": "^
|
19
|
+
"@types/node": "^17.0.8",
|
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.9.1",
|
22
|
+
"@typescript-eslint/parser": "^5.9.1",
|
23
|
+
"eslint": "^8.6.0",
|
24
24
|
"eslint-plugin-prettier": "^4.0.0",
|
25
25
|
"husky": "^7.0.4",
|
26
|
-
"lint-staged": "^12.1.
|
26
|
+
"lint-staged": "^12.1.7",
|
27
27
|
"node-fetch": "^3.1.0",
|
28
28
|
"prettier": "^2.5.0",
|
29
29
|
"prettier-plugin-import-sort": "^0.0.7",
|
@@ -32,7 +32,7 @@
|
|
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.
|
35
|
+
"typescript": "^4.5.4"
|
36
36
|
},
|
37
37
|
"types": "./dist/index.d.ts",
|
38
38
|
"lint-staged": {
|
@@ -1,190 +0,0 @@
|
|
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
|
-
}
|