lemmy-js-client 0.17.0-rc.12 → 0.17.0-rc.13
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/http.d.ts +1 -21
- package/dist/http.js +0 -44
- package/dist/interfaces/api/site.d.ts +4 -30
- package/dist/interfaces/others.d.ts +9 -13
- package/dist/interfaces/others.js +9 -13
- package/dist/interfaces/source.d.ts +2 -27
- package/dist/interfaces/views.d.ts +1 -19
- package/dist/websocket.d.ts +1 -17
- package/dist/websocket.js +0 -24
- package/package.json +2 -1
package/dist/http.d.ts
CHANGED
@@ -2,7 +2,7 @@ import { CommentReportResponse, CommentResponse, CreateComment, CreateCommentLik
|
|
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
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, MarkPostAsRead, PostReportResponse, PostResponse, RemovePost, ResolvePostReport, SavePost, StickyPost } from "./interfaces/api/post";
|
5
|
-
import { ApproveRegistrationApplication, CreateSite, EditSite, GetModlog, GetModlogResponse, GetSite, GetSiteConfig, GetSiteConfigResponse, GetSiteResponse, GetUnreadRegistrationApplicationCount, GetUnreadRegistrationApplicationCountResponse, LeaveAdmin, ListRegistrationApplications, ListRegistrationApplicationsResponse,
|
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
|
*/
|
@@ -387,26 +387,6 @@ export declare class LemmyHttp {
|
|
387
387
|
* `HTTP.PUT /admin/registration_application/approve`
|
388
388
|
*/
|
389
389
|
approveRegistrationApplication(form: ApproveRegistrationApplication): Promise<RegistrationApplicationResponse>;
|
390
|
-
/**
|
391
|
-
* Purge / Delete a person from the database.
|
392
|
-
* `HTTP.POST /admin/purge/person`
|
393
|
-
*/
|
394
|
-
purgePerson(form: PurgePerson): Promise<PurgeItemResponse>;
|
395
|
-
/**
|
396
|
-
* Purge / Delete a community from the database.
|
397
|
-
* `HTTP.POST /admin/purge/community`
|
398
|
-
*/
|
399
|
-
purgeCommunity(form: PurgeCommunity): Promise<PurgeItemResponse>;
|
400
|
-
/**
|
401
|
-
* Purge / Delete a post from the database.
|
402
|
-
* `HTTP.POST /admin/purge/post`
|
403
|
-
*/
|
404
|
-
purgePost(form: PurgePost): Promise<PurgeItemResponse>;
|
405
|
-
/**
|
406
|
-
* Purge / Delete a comment from the database.
|
407
|
-
* `HTTP.POST /admin/purge/comment`
|
408
|
-
*/
|
409
|
-
purgeComment(form: PurgeComment): Promise<PurgeItemResponse>;
|
410
390
|
private buildFullUrl;
|
411
391
|
private wrapper;
|
412
392
|
}
|
package/dist/http.js
CHANGED
@@ -886,50 +886,6 @@ var LemmyHttp = /** @class */ (function () {
|
|
886
886
|
});
|
887
887
|
});
|
888
888
|
};
|
889
|
-
/**
|
890
|
-
* Purge / Delete a person from the database.
|
891
|
-
* `HTTP.POST /admin/purge/person`
|
892
|
-
*/
|
893
|
-
LemmyHttp.prototype.purgePerson = function (form) {
|
894
|
-
return __awaiter(this, void 0, void 0, function () {
|
895
|
-
return __generator(this, function (_a) {
|
896
|
-
return [2 /*return*/, this.wrapper(HttpType.Post, "/admin/purge/person", form)];
|
897
|
-
});
|
898
|
-
});
|
899
|
-
};
|
900
|
-
/**
|
901
|
-
* Purge / Delete a community from the database.
|
902
|
-
* `HTTP.POST /admin/purge/community`
|
903
|
-
*/
|
904
|
-
LemmyHttp.prototype.purgeCommunity = function (form) {
|
905
|
-
return __awaiter(this, void 0, void 0, function () {
|
906
|
-
return __generator(this, function (_a) {
|
907
|
-
return [2 /*return*/, this.wrapper(HttpType.Post, "/admin/purge/community", form)];
|
908
|
-
});
|
909
|
-
});
|
910
|
-
};
|
911
|
-
/**
|
912
|
-
* Purge / Delete a post from the database.
|
913
|
-
* `HTTP.POST /admin/purge/post`
|
914
|
-
*/
|
915
|
-
LemmyHttp.prototype.purgePost = function (form) {
|
916
|
-
return __awaiter(this, void 0, void 0, function () {
|
917
|
-
return __generator(this, function (_a) {
|
918
|
-
return [2 /*return*/, this.wrapper(HttpType.Post, "/admin/purge/post", form)];
|
919
|
-
});
|
920
|
-
});
|
921
|
-
};
|
922
|
-
/**
|
923
|
-
* Purge / Delete a comment from the database.
|
924
|
-
* `HTTP.POST /admin/purge/comment`
|
925
|
-
*/
|
926
|
-
LemmyHttp.prototype.purgeComment = function (form) {
|
927
|
-
return __awaiter(this, void 0, void 0, function () {
|
928
|
-
return __generator(this, function (_a) {
|
929
|
-
return [2 /*return*/, this.wrapper(HttpType.Post, "/admin/purge/comment", form)];
|
930
|
-
});
|
931
|
-
});
|
932
|
-
};
|
933
889
|
LemmyHttp.prototype.buildFullUrl = function (endpoint) {
|
934
890
|
return "".concat(this.apiUrl).concat(endpoint);
|
935
891
|
};
|
@@ -1,5 +1,6 @@
|
|
1
|
+
import { Option } from "@swan-io/boxed";
|
1
2
|
import { ListingType, SearchType, SortType } from "../others";
|
2
|
-
import {
|
3
|
+
import { CommentView, CommunityBlockView, CommunityFollowerView, CommunityModeratorView, CommunityView, LocalUserSettingsView, ModAddCommunityView, ModAddView, ModBanFromCommunityView, ModBanView, ModLockPostView, ModRemoveCommentView, ModRemoveCommunityView, ModRemovePostView, ModStickyPostView, ModTransferCommunityView, PersonBlockView, PersonViewSafe, PostView, RegistrationApplicationView, SiteView } from "../views";
|
3
4
|
/**
|
4
5
|
* Search lemmy for different types of data.
|
5
6
|
*/
|
@@ -46,14 +47,10 @@ export interface GetModlogResponse {
|
|
46
47
|
added_to_community: ModAddCommunityView[];
|
47
48
|
transferred_to_community: ModTransferCommunityView[];
|
48
49
|
added: ModAddView[];
|
49
|
-
admin_purged_persons: AdminPurgePersonView[];
|
50
|
-
admin_purged_communities: AdminPurgeCommunityView[];
|
51
|
-
admin_purged_posts: AdminPurgePostView[];
|
52
|
-
admin_purged_comments: AdminPurgeCommentView[];
|
53
50
|
}
|
54
51
|
export interface CreateSite {
|
55
52
|
name: string;
|
56
|
-
sidebar
|
53
|
+
sidebar: Option<string>;
|
57
54
|
description?: string;
|
58
55
|
icon?: string;
|
59
56
|
banner?: string;
|
@@ -71,7 +68,7 @@ export interface CreateSite {
|
|
71
68
|
}
|
72
69
|
export interface EditSite {
|
73
70
|
name?: string;
|
74
|
-
sidebar
|
71
|
+
sidebar: Option<string>;
|
75
72
|
description?: string;
|
76
73
|
icon?: string;
|
77
74
|
banner?: string;
|
@@ -146,29 +143,6 @@ export interface ResolveObjectResponse {
|
|
146
143
|
community?: CommunityView;
|
147
144
|
person?: PersonViewSafe;
|
148
145
|
}
|
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
|
-
}
|
172
146
|
export interface ListRegistrationApplications {
|
173
147
|
/**
|
174
148
|
* Only shows the unread applications (IE those without an admin actor)
|
@@ -71,19 +71,15 @@ export declare enum UserOperation {
|
|
71
71
|
GetSiteMetadata = 65,
|
72
72
|
BlockCommunity = 66,
|
73
73
|
BlockPerson = 67,
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
ListPostReports = 77,
|
84
|
-
GetReportCount = 78,
|
85
|
-
GetUnreadCount = 79,
|
86
|
-
VerifyEmail = 80
|
74
|
+
CreateCommentReport = 68,
|
75
|
+
ResolveCommentReport = 69,
|
76
|
+
ListCommentReports = 70,
|
77
|
+
CreatePostReport = 71,
|
78
|
+
ResolvePostReport = 72,
|
79
|
+
ListPostReports = 73,
|
80
|
+
GetReportCount = 74,
|
81
|
+
GetUnreadCount = 75,
|
82
|
+
VerifyEmail = 76
|
87
83
|
}
|
88
84
|
/**
|
89
85
|
* Different sort types used in lemmy.
|
@@ -75,19 +75,15 @@ var UserOperation;
|
|
75
75
|
UserOperation[UserOperation["GetSiteMetadata"] = 65] = "GetSiteMetadata";
|
76
76
|
UserOperation[UserOperation["BlockCommunity"] = 66] = "BlockCommunity";
|
77
77
|
UserOperation[UserOperation["BlockPerson"] = 67] = "BlockPerson";
|
78
|
-
UserOperation[UserOperation["
|
79
|
-
UserOperation[UserOperation["
|
80
|
-
UserOperation[UserOperation["
|
81
|
-
UserOperation[UserOperation["
|
82
|
-
UserOperation[UserOperation["
|
83
|
-
UserOperation[UserOperation["
|
84
|
-
UserOperation[UserOperation["
|
85
|
-
UserOperation[UserOperation["
|
86
|
-
UserOperation[UserOperation["
|
87
|
-
UserOperation[UserOperation["ListPostReports"] = 77] = "ListPostReports";
|
88
|
-
UserOperation[UserOperation["GetReportCount"] = 78] = "GetReportCount";
|
89
|
-
UserOperation[UserOperation["GetUnreadCount"] = 79] = "GetUnreadCount";
|
90
|
-
UserOperation[UserOperation["VerifyEmail"] = 80] = "VerifyEmail";
|
78
|
+
UserOperation[UserOperation["CreateCommentReport"] = 68] = "CreateCommentReport";
|
79
|
+
UserOperation[UserOperation["ResolveCommentReport"] = 69] = "ResolveCommentReport";
|
80
|
+
UserOperation[UserOperation["ListCommentReports"] = 70] = "ListCommentReports";
|
81
|
+
UserOperation[UserOperation["CreatePostReport"] = 71] = "CreatePostReport";
|
82
|
+
UserOperation[UserOperation["ResolvePostReport"] = 72] = "ResolvePostReport";
|
83
|
+
UserOperation[UserOperation["ListPostReports"] = 73] = "ListPostReports";
|
84
|
+
UserOperation[UserOperation["GetReportCount"] = 74] = "GetReportCount";
|
85
|
+
UserOperation[UserOperation["GetUnreadCount"] = 75] = "GetUnreadCount";
|
86
|
+
UserOperation[UserOperation["VerifyEmail"] = 76] = "VerifyEmail";
|
91
87
|
})(UserOperation = exports.UserOperation || (exports.UserOperation = {}));
|
92
88
|
/**
|
93
89
|
* Different sort types used in lemmy.
|
@@ -1,3 +1,4 @@
|
|
1
|
+
import { Option } from "@swan-io/boxed";
|
1
2
|
export interface LocalUserSettings {
|
2
3
|
id: number;
|
3
4
|
person_id: number;
|
@@ -39,7 +40,7 @@ export interface PersonSafe {
|
|
39
40
|
export interface Site {
|
40
41
|
id: number;
|
41
42
|
name: string;
|
42
|
-
sidebar
|
43
|
+
sidebar: Option<string>;
|
43
44
|
published: string;
|
44
45
|
updated?: string;
|
45
46
|
enable_downvotes: boolean;
|
@@ -194,32 +195,6 @@ export interface ModAdd {
|
|
194
195
|
removed?: boolean;
|
195
196
|
when_: string;
|
196
197
|
}
|
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
|
-
}
|
223
198
|
export interface CommunitySafe {
|
224
199
|
id: number;
|
225
200
|
name: string;
|
@@ -1,5 +1,5 @@
|
|
1
1
|
import { CommentAggregates, CommunityAggregates, PersonAggregates, PostAggregates, SiteAggregates } from "./aggregates";
|
2
|
-
import {
|
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;
|
@@ -139,24 +139,6 @@ export interface ModStickyPostView {
|
|
139
139
|
post: Post;
|
140
140
|
community: CommunitySafe;
|
141
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
|
-
}
|
160
142
|
export interface CommunityFollowerView {
|
161
143
|
community: CommunitySafe;
|
162
144
|
follower: PersonSafe;
|
package/dist/websocket.d.ts
CHANGED
@@ -2,7 +2,7 @@ import { CreateComment, CreateCommentLike, CreateCommentReport, DeleteComment, E
|
|
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
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,
|
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.
|
@@ -329,20 +329,4 @@ export declare class LemmyWebsocket {
|
|
329
329
|
* Block a community.
|
330
330
|
*/
|
331
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;
|
348
332
|
}
|
package/dist/websocket.js
CHANGED
@@ -483,30 +483,6 @@ var LemmyWebsocket = /** @class */ (function () {
|
|
483
483
|
LemmyWebsocket.prototype.blockCommunity = function (form) {
|
484
484
|
return wrapper(others_1.UserOperation.BlockCommunity, form);
|
485
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
|
-
};
|
510
486
|
return LemmyWebsocket;
|
511
487
|
}());
|
512
488
|
exports.LemmyWebsocket = LemmyWebsocket;
|
package/package.json
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
{
|
2
2
|
"name": "lemmy-js-client",
|
3
3
|
"description": "A javascript / typescript client for Lemmy",
|
4
|
-
"version": "0.17.0-rc.
|
4
|
+
"version": "0.17.0-rc.13",
|
5
5
|
"author": "Dessalines <tyhou13@gmx.com>",
|
6
6
|
"license": "AGPL-3.0",
|
7
7
|
"main": "./dist/index.js",
|
@@ -16,6 +16,7 @@
|
|
16
16
|
},
|
17
17
|
"repository": "https://github.com/LemmyNet/lemmy-js-client",
|
18
18
|
"devDependencies": {
|
19
|
+
"@swan-io/boxed": "^0.9.0",
|
19
20
|
"@types/node": "^17.0.33",
|
20
21
|
"@types/node-fetch": "^3.0.3",
|
21
22
|
"@typescript-eslint/eslint-plugin": "^5.23.0",
|