lemmy-js-client 0.20.0-show-mod-reports.2 → 1.0.0-action-structs.0
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/README.md +12 -3
- package/dist/http.d.ts +7 -2
- package/dist/http.js +13 -1
- package/dist/index.d.ts +8 -13
- package/dist/types/Comment.d.ts +9 -0
- package/dist/types/CommentActions.d.ts +9 -0
- package/dist/types/CommentReplyView.d.ts +11 -11
- package/dist/types/CommentReport.d.ts +1 -0
- package/dist/types/CommentReportView.d.ts +8 -10
- package/dist/types/CommentSlimView.d.ts +7 -10
- package/dist/types/CommentView.d.ts +10 -10
- package/dist/types/Community.d.ts +22 -0
- package/dist/types/CommunityActions.d.ts +14 -0
- package/dist/types/CommunityReportView.d.ts +0 -4
- package/dist/types/CommunitySortType.d.ts +1 -1
- package/dist/types/CommunityView.d.ts +5 -6
- package/dist/types/CreateCommentReport.d.ts +1 -0
- package/dist/types/CreatePostReport.d.ts +1 -0
- package/dist/types/CreateSite.d.ts +2 -0
- package/dist/types/EditSite.d.ts +8 -0
- package/dist/types/FederationError.d.ts +1 -1
- package/dist/types/GetComments.d.ts +5 -0
- package/dist/types/GetModlog.d.ts +26 -2
- package/dist/types/GetModlogResponse.d.ts +5 -0
- package/dist/types/GetPostResponse.d.ts +0 -2
- package/dist/types/GetPosts.d.ts +8 -2
- package/dist/types/GetPostsResponse.d.ts +2 -2
- package/dist/types/GetSiteResponse.d.ts +2 -2
- package/dist/types/ImageDetails.d.ts +1 -0
- package/dist/types/InstanceActions.d.ts +7 -0
- package/dist/types/LemmyErrorType.d.ts +6 -2
- package/dist/types/ListCommunities.d.ts +5 -0
- package/dist/types/ListInbox.d.ts +2 -2
- package/dist/types/ListInboxResponse.d.ts +5 -0
- package/dist/types/ListPersonContent.d.ts +2 -2
- package/dist/types/ListPersonContentResponse.d.ts +5 -0
- package/dist/types/ListPersonSaved.d.ts +2 -2
- package/dist/types/ListPersonSavedResponse.d.ts +7 -2
- package/dist/types/ListReports.d.ts +6 -2
- package/dist/types/ListReportsResponse.d.ts +5 -0
- package/dist/types/LocalSite.d.ts +28 -0
- package/dist/types/LocalUser.d.ts +8 -0
- package/dist/types/LocalUserView.d.ts +0 -4
- package/dist/types/PaginationCursor.d.ts +1 -4
- package/dist/types/Person.d.ts +2 -0
- package/dist/types/PersonActions.d.ts +8 -0
- package/dist/types/PersonCommentMentionView.d.ts +11 -11
- package/dist/types/PersonPostMentionView.d.ts +11 -16
- package/dist/types/PersonSavedCombinedView.d.ts +7 -0
- package/dist/types/PersonView.d.ts +0 -2
- package/dist/types/Post.d.ts +10 -0
- package/dist/types/PostActions.d.ts +13 -0
- package/dist/types/PostPaginationCursor.d.ts +7 -0
- package/dist/types/PostReport.d.ts +1 -0
- package/dist/types/PostReportView.d.ts +8 -13
- package/dist/types/PostSortType.d.ts +1 -1
- package/dist/types/PostView.d.ts +10 -15
- package/dist/types/PrivateMessage.d.ts +1 -0
- package/dist/types/PrivateMessageReportView.d.ts +1 -1
- package/dist/types/ResendVerificationEmail.d.ts +7 -0
- package/dist/types/ResendVerificationEmail.js +2 -0
- package/dist/types/SaveUserSettings.d.ts +4 -0
- package/dist/types/Search.d.ts +7 -2
- package/dist/types/SearchResponse.d.ts +5 -0
- package/dist/types/SiteView.d.ts +0 -2
- package/package.json +2 -2
- package/dist/types/CommentAggregates.d.ts +0 -17
- package/dist/types/CommunityAggregates.d.ts +0 -30
- package/dist/types/InboxCombinedPaginationCursor.d.ts +0 -4
- package/dist/types/LocalUserVoteDisplayMode.d.ts +0 -9
- package/dist/types/LocalUserVoteDisplayMode.js +0 -3
- package/dist/types/ModlogCombinedPaginationCursor.d.ts +0 -4
- package/dist/types/ModlogCombinedPaginationCursor.js +0 -3
- package/dist/types/PersonAggregates.d.ts +0 -9
- package/dist/types/PersonContentCombinedPaginationCursor.d.ts +0 -4
- package/dist/types/PersonContentCombinedPaginationCursor.js +0 -3
- package/dist/types/PersonSavedCombinedPaginationCursor.d.ts +0 -4
- package/dist/types/PersonSavedCombinedPaginationCursor.js +0 -3
- package/dist/types/PostAggregates.d.ts +0 -18
- package/dist/types/PostTags.d.ts +0 -7
- package/dist/types/ReportCombinedPaginationCursor.d.ts +0 -4
- package/dist/types/ReportCombinedPaginationCursor.js +0 -3
- package/dist/types/SearchCombinedPaginationCursor.d.ts +0 -4
- package/dist/types/SearchCombinedPaginationCursor.js +0 -3
- package/dist/types/SiteAggregates.d.ts +0 -27
- /package/dist/types/{CommentAggregates.js → CommentActions.js} +0 -0
- /package/dist/types/{CommunityAggregates.js → CommunityActions.js} +0 -0
- /package/dist/types/{PersonAggregates.js → InstanceActions.js} +0 -0
- /package/dist/types/{PostAggregates.js → PersonActions.js} +0 -0
- /package/dist/types/{PostTags.js → PersonSavedCombinedView.js} +0 -0
- /package/dist/types/{SiteAggregates.js → PostActions.js} +0 -0
- /package/dist/types/{InboxCombinedPaginationCursor.js → PostPaginationCursor.js} +0 -0
package/README.md
CHANGED
@@ -50,6 +50,15 @@ const posts = await client.getPosts(getPostsForm);
|
|
50
50
|
|
51
51
|
Use `pnpm add` to develop and test changes locally:
|
52
52
|
|
53
|
-
|
54
|
-
|
55
|
-
|
53
|
+
`pnpm add path/to/lemmy-js-client`
|
54
|
+
|
55
|
+
## OpenAPI
|
56
|
+
|
57
|
+
To generate OpenAPI docs, run `pnpm tsoa`
|
58
|
+
|
59
|
+
This creates two files:
|
60
|
+
|
61
|
+
- `redoc-static.html` - A static html rendering of the OpenAPI docs.
|
62
|
+
- `tsoa_build/swagger.json` - An OpenAPI / Swagger json file.
|
63
|
+
|
64
|
+
To contribute, check out the [tsoa docs](https://tsoa-community.github.io/docs/).
|
package/dist/http.d.ts
CHANGED
@@ -1,3 +1,5 @@
|
|
1
|
+
import { Controller } from "tsoa";
|
2
|
+
import { DeleteImageParamsI, GetCommentI, GetCommentsI, GetCommunityI, GetCommunityPendingFollowsCountI, GetModlogI, GetPersonDetailsI, GetPostI, GetPostsI, GetRandomCommunityI, GetRegistrationApplicationI, GetReportCountI, GetSiteMetadataI, ListCommentLikesI, ListCommunitiesI, ListCommunityPendingFollowsI, ListCustomEmojisI, ListInboxI, ListMediaI, ListPersonContentI, ListPersonSavedI, ListPostLikesI, ListRegistrationApplicationsI, ListReportsI, ListTaglinesI, ResolveObjectI, SearchI, UploadImage } from "./other_types";
|
1
3
|
import { AddAdmin } from "./types/AddAdmin";
|
2
4
|
import { AddAdminResponse } from "./types/AddAdminResponse";
|
3
5
|
import { AddModToCommunity } from "./types/AddModToCommunity";
|
@@ -95,7 +97,6 @@ import { SearchResponse } from "./types/SearchResponse";
|
|
95
97
|
import { SiteResponse } from "./types/SiteResponse";
|
96
98
|
import { TransferCommunity } from "./types/TransferCommunity";
|
97
99
|
import { VerifyEmail } from "./types/VerifyEmail";
|
98
|
-
import { DeleteImageParamsI, GetCommentI, GetCommentsI, GetCommunityI, GetCommunityPendingFollowsCountI, GetModlogI, GetPersonDetailsI, GetPostI, GetPostsI, GetRandomCommunityI, GetRegistrationApplicationI, GetReportCountI, GetSiteMetadataI, ListCommentLikesI, ListCommunitiesI, ListCommunityPendingFollowsI, ListCustomEmojisI, ListInboxI, ListMediaI, ListPersonContentI, ListPersonSavedI, ListPostLikesI, ListRegistrationApplicationsI, ListReportsI, ListTaglinesI, ResolveObjectI, SearchI, UploadImage } from "./other_types";
|
99
100
|
import { HideCommunity } from "./types/HideCommunity";
|
100
101
|
import { GenerateTotpSecretResponse } from "./types/GenerateTotpSecretResponse";
|
101
102
|
import { UpdateTotp } from "./types/UpdateTotp";
|
@@ -128,7 +129,7 @@ import { ListInboxResponse } from "./types/ListInboxResponse";
|
|
128
129
|
import { MarkPersonCommentMentionAsRead } from "./types/MarkPersonCommentMentionAsRead";
|
129
130
|
import { MarkPersonPostMentionAsRead } from "./types/MarkPersonPostMentionAsRead";
|
130
131
|
import { GetCommentsSlimResponse } from "./types/GetCommentsSlimResponse";
|
131
|
-
import {
|
132
|
+
import { ResendVerificationEmail } from "./types/ResendVerificationEmail";
|
132
133
|
type RequestOptions = Pick<RequestInit, "signal">;
|
133
134
|
/**
|
134
135
|
* Helps build lemmy HTTP requests.
|
@@ -516,6 +517,10 @@ export declare class LemmyHttp extends Controller {
|
|
516
517
|
* @summary Verify your email
|
517
518
|
*/
|
518
519
|
verifyEmail(form: VerifyEmail, options?: RequestOptions): Promise<SuccessResponse>;
|
520
|
+
/**
|
521
|
+
* @summary Resend a verification email.
|
522
|
+
*/
|
523
|
+
resendVerificationEmail(form: ResendVerificationEmail, options?: RequestOptions): Promise<SuccessResponse>;
|
519
524
|
/**
|
520
525
|
* @summary List your saved content.
|
521
526
|
*/
|
package/dist/http.js
CHANGED
@@ -31,8 +31,8 @@ var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (
|
|
31
31
|
var _LemmyHttp_instances, _LemmyHttp_apiUrl, _LemmyHttp_headers, _LemmyHttp_fetchFunction, _LemmyHttp_buildFullUrl, _LemmyHttp_upload, _LemmyHttp_wrapper;
|
32
32
|
Object.defineProperty(exports, "__esModule", { value: true });
|
33
33
|
exports.LemmyHttp = void 0;
|
34
|
-
const other_types_1 = require("./other_types");
|
35
34
|
const tsoa_1 = require("tsoa");
|
35
|
+
const other_types_1 = require("./other_types");
|
36
36
|
var HttpType;
|
37
37
|
(function (HttpType) {
|
38
38
|
HttpType["Get"] = "GET";
|
@@ -613,6 +613,12 @@ let LemmyHttp = class LemmyHttp extends tsoa_1.Controller {
|
|
613
613
|
verifyEmail(form, options) {
|
614
614
|
return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Post, "/account/auth/verify_email", form, options);
|
615
615
|
}
|
616
|
+
/**
|
617
|
+
* @summary Resend a verification email.
|
618
|
+
*/
|
619
|
+
resendVerificationEmail(form, options) {
|
620
|
+
return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Post, "/account/auth/resend_verification_email", form, options);
|
621
|
+
}
|
616
622
|
/**
|
617
623
|
* @summary List your saved content.
|
618
624
|
*/
|
@@ -1572,6 +1578,12 @@ __decorate([
|
|
1572
1578
|
__param(0, (0, tsoa_1.Body)()),
|
1573
1579
|
__param(1, (0, tsoa_1.Inject)())
|
1574
1580
|
], LemmyHttp.prototype, "verifyEmail", null);
|
1581
|
+
__decorate([
|
1582
|
+
(0, tsoa_1.Post)("/account/auth/resend_verification_email"),
|
1583
|
+
(0, tsoa_1.Tags)("Account"),
|
1584
|
+
__param(0, (0, tsoa_1.Body)()),
|
1585
|
+
__param(1, (0, tsoa_1.Inject)())
|
1586
|
+
], LemmyHttp.prototype, "resendVerificationEmail", null);
|
1575
1587
|
__decorate([
|
1576
1588
|
(0, tsoa_1.Security)("bearerAuth"),
|
1577
1589
|
(0, tsoa_1.Get)("/account/auth/saved"),
|
package/dist/index.d.ts
CHANGED
@@ -40,7 +40,7 @@ export { BlockPersonResponse } from "./types/BlockPersonResponse";
|
|
40
40
|
export { CaptchaResponse } from "./types/CaptchaResponse";
|
41
41
|
export { ChangePassword } from "./types/ChangePassword";
|
42
42
|
export { Comment } from "./types/Comment";
|
43
|
-
export {
|
43
|
+
export { CommentActions } from "./types/CommentActions";
|
44
44
|
export { CommentId } from "./types/CommentId";
|
45
45
|
export { CommentReply } from "./types/CommentReply";
|
46
46
|
export { CommentReplyId } from "./types/CommentReplyId";
|
@@ -54,7 +54,7 @@ export { CommentSlimView } from "./types/CommentSlimView";
|
|
54
54
|
export { CommentSortType } from "./types/CommentSortType";
|
55
55
|
export { CommentView } from "./types/CommentView";
|
56
56
|
export { Community } from "./types/Community";
|
57
|
-
export {
|
57
|
+
export { CommunityActions } from "./types/CommunityActions";
|
58
58
|
export { CommunityFollowerState } from "./types/CommunityFollowerState";
|
59
59
|
export { CommunityFollowerView } from "./types/CommunityFollowerView";
|
60
60
|
export { CommunityId } from "./types/CommunityId";
|
@@ -141,10 +141,10 @@ export { HidePost } from "./types/HidePost";
|
|
141
141
|
export { ImageDetails } from "./types/ImageDetails";
|
142
142
|
export { ImageGetParams } from "./types/ImageGetParams";
|
143
143
|
export { ImageProxyParams } from "./types/ImageProxyParams";
|
144
|
-
export { InboxCombinedPaginationCursor } from "./types/InboxCombinedPaginationCursor";
|
145
144
|
export { InboxCombinedView } from "./types/InboxCombinedView";
|
146
145
|
export { InboxDataType } from "./types/InboxDataType";
|
147
146
|
export { Instance } from "./types/Instance";
|
147
|
+
export { InstanceActions } from "./types/InstanceActions";
|
148
148
|
export { InstanceId } from "./types/InstanceId";
|
149
149
|
export { InstanceWithFederationState } from "./types/InstanceWithFederationState";
|
150
150
|
export { Language } from "./types/Language";
|
@@ -186,7 +186,6 @@ export { LocalSiteUrlBlocklist } from "./types/LocalSiteUrlBlocklist";
|
|
186
186
|
export { LocalUser } from "./types/LocalUser";
|
187
187
|
export { LocalUserId } from "./types/LocalUserId";
|
188
188
|
export { LocalUserView } from "./types/LocalUserView";
|
189
|
-
export { LocalUserVoteDisplayMode } from "./types/LocalUserVoteDisplayMode";
|
190
189
|
export { LockPost } from "./types/LockPost";
|
191
190
|
export { Login } from "./types/Login";
|
192
191
|
export { LoginResponse } from "./types/LoginResponse";
|
@@ -231,7 +230,6 @@ export { ModTransferCommunity } from "./types/ModTransferCommunity";
|
|
231
230
|
export { ModTransferCommunityId } from "./types/ModTransferCommunityId";
|
232
231
|
export { ModTransferCommunityView } from "./types/ModTransferCommunityView";
|
233
232
|
export { ModlogActionType } from "./types/ModlogActionType";
|
234
|
-
export { ModlogCombinedPaginationCursor } from "./types/ModlogCombinedPaginationCursor";
|
235
233
|
export { ModlogCombinedView } from "./types/ModlogCombinedView";
|
236
234
|
export { MyUserInfo } from "./types/MyUserInfo";
|
237
235
|
export { OAuthAccount } from "./types/OAuthAccount";
|
@@ -243,31 +241,30 @@ export { PasswordChangeAfterReset } from "./types/PasswordChangeAfterReset";
|
|
243
241
|
export { PasswordReset } from "./types/PasswordReset";
|
244
242
|
export { PendingFollow } from "./types/PendingFollow";
|
245
243
|
export { Person } from "./types/Person";
|
246
|
-
export {
|
244
|
+
export { PersonActions } from "./types/PersonActions";
|
247
245
|
export { PersonCommentMention } from "./types/PersonCommentMention";
|
248
246
|
export { PersonCommentMentionId } from "./types/PersonCommentMentionId";
|
249
247
|
export { PersonCommentMentionView } from "./types/PersonCommentMentionView";
|
250
|
-
export { PersonContentCombinedPaginationCursor } from "./types/PersonContentCombinedPaginationCursor";
|
251
248
|
export { PersonContentCombinedView } from "./types/PersonContentCombinedView";
|
252
249
|
export { PersonContentType } from "./types/PersonContentType";
|
253
250
|
export { PersonId } from "./types/PersonId";
|
254
251
|
export { PersonPostMention } from "./types/PersonPostMention";
|
255
252
|
export { PersonPostMentionId } from "./types/PersonPostMentionId";
|
256
253
|
export { PersonPostMentionView } from "./types/PersonPostMentionView";
|
257
|
-
export {
|
254
|
+
export { PersonSavedCombinedView } from "./types/PersonSavedCombinedView";
|
258
255
|
export { PersonView } from "./types/PersonView";
|
259
256
|
export { Post } from "./types/Post";
|
260
|
-
export {
|
257
|
+
export { PostActions } from "./types/PostActions";
|
261
258
|
export { PostFeatureType } from "./types/PostFeatureType";
|
262
259
|
export { PostId } from "./types/PostId";
|
263
260
|
export { PostListingMode } from "./types/PostListingMode";
|
261
|
+
export { PostPaginationCursor } from "./types/PostPaginationCursor";
|
264
262
|
export { PostReport } from "./types/PostReport";
|
265
263
|
export { PostReportId } from "./types/PostReportId";
|
266
264
|
export { PostReportResponse } from "./types/PostReportResponse";
|
267
265
|
export { PostReportView } from "./types/PostReportView";
|
268
266
|
export { PostResponse } from "./types/PostResponse";
|
269
267
|
export { PostSortType } from "./types/PostSortType";
|
270
|
-
export { PostTags } from "./types/PostTags";
|
271
268
|
export { PostView } from "./types/PostView";
|
272
269
|
export { PrivateMessage } from "./types/PrivateMessage";
|
273
270
|
export { PrivateMessageId } from "./types/PrivateMessageId";
|
@@ -292,9 +289,9 @@ export { RegistrationMode } from "./types/RegistrationMode";
|
|
292
289
|
export { RemoveComment } from "./types/RemoveComment";
|
293
290
|
export { RemoveCommunity } from "./types/RemoveCommunity";
|
294
291
|
export { RemovePost } from "./types/RemovePost";
|
295
|
-
export { ReportCombinedPaginationCursor } from "./types/ReportCombinedPaginationCursor";
|
296
292
|
export { ReportCombinedView } from "./types/ReportCombinedView";
|
297
293
|
export { ReportType } from "./types/ReportType";
|
294
|
+
export { ResendVerificationEmail } from "./types/ResendVerificationEmail";
|
298
295
|
export { ResolveCommentReport } from "./types/ResolveCommentReport";
|
299
296
|
export { ResolveObject } from "./types/ResolveObject";
|
300
297
|
export { ResolveObjectResponse } from "./types/ResolveObjectResponse";
|
@@ -304,14 +301,12 @@ export { SaveComment } from "./types/SaveComment";
|
|
304
301
|
export { SavePost } from "./types/SavePost";
|
305
302
|
export { SaveUserSettings } from "./types/SaveUserSettings";
|
306
303
|
export { Search } from "./types/Search";
|
307
|
-
export { SearchCombinedPaginationCursor } from "./types/SearchCombinedPaginationCursor";
|
308
304
|
export { SearchCombinedView } from "./types/SearchCombinedView";
|
309
305
|
export { SearchResponse } from "./types/SearchResponse";
|
310
306
|
export { SearchSortType } from "./types/SearchSortType";
|
311
307
|
export { SearchType } from "./types/SearchType";
|
312
308
|
export { SensitiveString } from "./types/SensitiveString";
|
313
309
|
export { Site } from "./types/Site";
|
314
|
-
export { SiteAggregates } from "./types/SiteAggregates";
|
315
310
|
export { SiteId } from "./types/SiteId";
|
316
311
|
export { SiteResponse } from "./types/SiteResponse";
|
317
312
|
export { SiteView } from "./types/SiteView";
|
package/dist/types/Comment.d.ts
CHANGED
@@ -39,4 +39,13 @@ export type Comment = {
|
|
39
39
|
*/
|
40
40
|
distinguished: boolean;
|
41
41
|
language_id: LanguageId;
|
42
|
+
score: number;
|
43
|
+
upvotes: number;
|
44
|
+
downvotes: number;
|
45
|
+
/**
|
46
|
+
* The total number of children in this comment branch.
|
47
|
+
*/
|
48
|
+
child_count: number;
|
49
|
+
report_count: number;
|
50
|
+
unresolved_report_count: number;
|
42
51
|
};
|
@@ -1,27 +1,27 @@
|
|
1
1
|
import type { Comment } from "./Comment";
|
2
|
-
import type {
|
2
|
+
import type { CommentActions } from "./CommentActions";
|
3
3
|
import type { CommentReply } from "./CommentReply";
|
4
4
|
import type { Community } from "./Community";
|
5
|
+
import type { CommunityActions } from "./CommunityActions";
|
6
|
+
import type { InstanceActions } from "./InstanceActions";
|
5
7
|
import type { Person } from "./Person";
|
8
|
+
import type { PersonActions } from "./PersonActions";
|
6
9
|
import type { Post } from "./Post";
|
7
|
-
import type { SubscribedType } from "./SubscribedType";
|
8
10
|
/**
|
9
11
|
* A comment reply view.
|
10
12
|
*/
|
11
13
|
export type CommentReplyView = {
|
12
14
|
comment_reply: CommentReply;
|
15
|
+
recipient: Person;
|
13
16
|
comment: Comment;
|
14
17
|
creator: Person;
|
15
18
|
post: Post;
|
16
19
|
community: Community;
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
20
|
+
community_actions?: CommunityActions;
|
21
|
+
comment_actions?: CommentActions;
|
22
|
+
person_actions?: PersonActions;
|
23
|
+
instance_actions?: InstanceActions;
|
24
|
+
creator_community_actions?: CommunityActions;
|
22
25
|
creator_is_admin: boolean;
|
23
|
-
|
24
|
-
saved: boolean;
|
25
|
-
creator_blocked: boolean;
|
26
|
-
my_vote?: number;
|
26
|
+
can_mod: boolean;
|
27
27
|
};
|
@@ -1,10 +1,11 @@
|
|
1
1
|
import type { Comment } from "./Comment";
|
2
|
-
import type {
|
2
|
+
import type { CommentActions } from "./CommentActions";
|
3
3
|
import type { CommentReport } from "./CommentReport";
|
4
4
|
import type { Community } from "./Community";
|
5
|
+
import type { CommunityActions } from "./CommunityActions";
|
5
6
|
import type { Person } from "./Person";
|
7
|
+
import type { PersonActions } from "./PersonActions";
|
6
8
|
import type { Post } from "./Post";
|
7
|
-
import type { SubscribedType } from "./SubscribedType";
|
8
9
|
/**
|
9
10
|
* A comment report view.
|
10
11
|
*/
|
@@ -15,13 +16,10 @@ export type CommentReportView = {
|
|
15
16
|
community: Community;
|
16
17
|
creator: Person;
|
17
18
|
comment_creator: Person;
|
18
|
-
|
19
|
-
creator_banned_from_community: boolean;
|
20
|
-
creator_is_moderator: boolean;
|
21
|
-
creator_is_admin: boolean;
|
22
|
-
creator_blocked: boolean;
|
23
|
-
subscribed: SubscribedType;
|
24
|
-
saved: boolean;
|
25
|
-
my_vote?: number;
|
19
|
+
comment_actions?: CommentActions;
|
26
20
|
resolver?: Person;
|
21
|
+
creator_community_actions?: CommunityActions;
|
22
|
+
person_actions?: PersonActions;
|
23
|
+
community_actions?: CommunityActions;
|
24
|
+
creator_is_admin: boolean;
|
27
25
|
};
|
@@ -1,20 +1,17 @@
|
|
1
1
|
import type { Comment } from "./Comment";
|
2
|
-
import type {
|
2
|
+
import type { CommentActions } from "./CommentActions";
|
3
|
+
import type { InstanceActions } from "./InstanceActions";
|
3
4
|
import type { Person } from "./Person";
|
4
|
-
import type {
|
5
|
+
import type { PersonActions } from "./PersonActions";
|
5
6
|
/**
|
6
7
|
* A slimmer comment view, without the post, or community.
|
7
8
|
*/
|
8
9
|
export type CommentSlimView = {
|
9
10
|
comment: Comment;
|
10
11
|
creator: Person;
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
creator_is_moderator: boolean;
|
12
|
+
comment_actions?: CommentActions;
|
13
|
+
person_actions?: PersonActions;
|
14
|
+
instance_actions?: InstanceActions;
|
15
15
|
creator_is_admin: boolean;
|
16
|
-
|
17
|
-
saved: boolean;
|
18
|
-
creator_blocked: boolean;
|
19
|
-
my_vote?: number;
|
16
|
+
can_mod: boolean;
|
20
17
|
};
|
@@ -1,9 +1,11 @@
|
|
1
1
|
import type { Comment } from "./Comment";
|
2
|
-
import type {
|
2
|
+
import type { CommentActions } from "./CommentActions";
|
3
3
|
import type { Community } from "./Community";
|
4
|
+
import type { CommunityActions } from "./CommunityActions";
|
5
|
+
import type { InstanceActions } from "./InstanceActions";
|
4
6
|
import type { Person } from "./Person";
|
7
|
+
import type { PersonActions } from "./PersonActions";
|
5
8
|
import type { Post } from "./Post";
|
6
|
-
import type { SubscribedType } from "./SubscribedType";
|
7
9
|
/**
|
8
10
|
* A comment view.
|
9
11
|
*/
|
@@ -12,13 +14,11 @@ export type CommentView = {
|
|
12
14
|
creator: Person;
|
13
15
|
post: Post;
|
14
16
|
community: Community;
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
17
|
+
community_actions?: CommunityActions;
|
18
|
+
comment_actions?: CommentActions;
|
19
|
+
person_actions?: PersonActions;
|
20
|
+
instance_actions?: InstanceActions;
|
21
|
+
creator_community_actions?: CommunityActions;
|
19
22
|
creator_is_admin: boolean;
|
20
|
-
|
21
|
-
saved: boolean;
|
22
|
-
creator_blocked: boolean;
|
23
|
-
my_vote?: number;
|
23
|
+
can_mod: boolean;
|
24
24
|
};
|
@@ -60,4 +60,26 @@ export type Community = {
|
|
60
60
|
* A shorter, one-line description of the site.
|
61
61
|
*/
|
62
62
|
description?: string;
|
63
|
+
subscribers: number;
|
64
|
+
posts: number;
|
65
|
+
comments: number;
|
66
|
+
/**
|
67
|
+
* The number of users with any activity in the last day.
|
68
|
+
*/
|
69
|
+
users_active_day: number;
|
70
|
+
/**
|
71
|
+
* The number of users with any activity in the last week.
|
72
|
+
*/
|
73
|
+
users_active_week: number;
|
74
|
+
/**
|
75
|
+
* The number of users with any activity in the last month.
|
76
|
+
*/
|
77
|
+
users_active_month: number;
|
78
|
+
/**
|
79
|
+
* The number of users with any activity in the last year.
|
80
|
+
*/
|
81
|
+
users_active_half_year: number;
|
82
|
+
subscribers_local: number;
|
83
|
+
report_count: number;
|
84
|
+
unresolved_report_count: number;
|
63
85
|
};
|
@@ -0,0 +1,14 @@
|
|
1
|
+
import type { CommunityFollowerState } from "./CommunityFollowerState";
|
2
|
+
import type { CommunityId } from "./CommunityId";
|
3
|
+
import type { PersonId } from "./PersonId";
|
4
|
+
export type CommunityActions = {
|
5
|
+
community_id: CommunityId;
|
6
|
+
person_id: PersonId;
|
7
|
+
followed?: string;
|
8
|
+
follow_state?: CommunityFollowerState;
|
9
|
+
follow_approver_id?: PersonId;
|
10
|
+
blocked?: string;
|
11
|
+
became_moderator?: string;
|
12
|
+
received_ban?: string;
|
13
|
+
ban_expires?: string;
|
14
|
+
};
|
@@ -1,8 +1,6 @@
|
|
1
1
|
import type { Community } from "./Community";
|
2
|
-
import type { CommunityAggregates } from "./CommunityAggregates";
|
3
2
|
import type { CommunityReport } from "./CommunityReport";
|
4
3
|
import type { Person } from "./Person";
|
5
|
-
import type { SubscribedType } from "./SubscribedType";
|
6
4
|
/**
|
7
5
|
* A community report view.
|
8
6
|
*/
|
@@ -10,7 +8,5 @@ export type CommunityReportView = {
|
|
10
8
|
community_report: CommunityReport;
|
11
9
|
community: Community;
|
12
10
|
creator: Person;
|
13
|
-
counts: CommunityAggregates;
|
14
|
-
subscribed: SubscribedType;
|
15
11
|
resolver?: Person;
|
16
12
|
};
|
@@ -1,4 +1,4 @@
|
|
1
1
|
/**
|
2
2
|
* The community sort types. See here for descriptions: https://join-lemmy.org/docs/en/users/03-votes-and-ranking.html
|
3
3
|
*/
|
4
|
-
export type CommunitySortType = "
|
4
|
+
export type CommunitySortType = "ActiveSixMonths" | "ActiveMonthly" | "ActiveWeekly" | "ActiveDaily" | "Hot" | "New" | "Old" | "NameAsc" | "NameDesc" | "Comments" | "Posts" | "Subscribers" | "SubscribersLocal";
|
@@ -1,13 +1,12 @@
|
|
1
1
|
import type { Community } from "./Community";
|
2
|
-
import type {
|
3
|
-
import type {
|
2
|
+
import type { CommunityActions } from "./CommunityActions";
|
3
|
+
import type { InstanceActions } from "./InstanceActions";
|
4
4
|
/**
|
5
5
|
* A community view.
|
6
6
|
*/
|
7
7
|
export type CommunityView = {
|
8
8
|
community: Community;
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
banned_from_community: boolean;
|
9
|
+
community_actions?: CommunityActions;
|
10
|
+
instance_actions?: InstanceActions;
|
11
|
+
can_mod: boolean;
|
13
12
|
};
|
@@ -20,6 +20,7 @@ export type CreateSite = {
|
|
20
20
|
default_post_listing_type?: ListingType;
|
21
21
|
default_post_listing_mode?: PostListingMode;
|
22
22
|
default_post_sort_type?: PostSortType;
|
23
|
+
default_post_time_range_seconds?: number;
|
23
24
|
default_comment_sort_type?: CommentSortType;
|
24
25
|
legal_information?: string;
|
25
26
|
application_email_admins?: boolean;
|
@@ -50,4 +51,5 @@ export type CreateSite = {
|
|
50
51
|
comment_upvotes?: FederationMode;
|
51
52
|
comment_downvotes?: FederationMode;
|
52
53
|
disable_donation_dialog?: boolean;
|
54
|
+
disallow_nsfw_content?: boolean;
|
53
55
|
};
|
package/dist/types/EditSite.d.ts
CHANGED
@@ -50,6 +50,10 @@ export type EditSite = {
|
|
50
50
|
* The default post sort, usually "active"
|
51
51
|
*/
|
52
52
|
default_post_sort_type?: PostSortType;
|
53
|
+
/**
|
54
|
+
* A default time range limit to apply to post sorts, in seconds. 0 means none.
|
55
|
+
*/
|
56
|
+
default_post_time_range_seconds?: number;
|
53
57
|
/**
|
54
58
|
* The default comment sort, usually "hot"
|
55
59
|
*/
|
@@ -159,4 +163,8 @@ export type EditSite = {
|
|
159
163
|
* donations.
|
160
164
|
*/
|
161
165
|
disable_donation_dialog?: boolean;
|
166
|
+
/**
|
167
|
+
* Block NSFW content being created
|
168
|
+
*/
|
169
|
+
disallow_nsfw_content?: boolean;
|
162
170
|
};
|
@@ -7,4 +7,4 @@ export type FederationError = "InvalidCommunity" | "CannotCreatePostOrCommentInD
|
|
7
7
|
DomainBlocked: string;
|
8
8
|
} | {
|
9
9
|
DomainNotInAllowList: string;
|
10
|
-
} | "FederationDisabledByStrictAllowList" | "ContradictingFilters" | "UrlWithoutDomain" | "InboxTimeout" | "CantDeleteSite" | "ObjectIsNotPublic" | "ObjectIsNotPrivate" | "Unreachable";
|
10
|
+
} | "FederationDisabledByStrictAllowList" | "ContradictingFilters" | "UrlWithoutDomain" | "InboxTimeout" | "CantDeleteSite" | "ObjectIsNotPublic" | "ObjectIsNotPrivate" | "PlatformLackingPrivateCommunitySupport" | "Unreachable";
|
@@ -9,6 +9,11 @@ import type { PostId } from "./PostId";
|
|
9
9
|
export type GetComments = {
|
10
10
|
type_?: ListingType;
|
11
11
|
sort?: CommentSortType;
|
12
|
+
/**
|
13
|
+
* Filter to within a given time range, in seconds.
|
14
|
+
* IE 60 would give results for the past minute.
|
15
|
+
*/
|
16
|
+
time_range_seconds?: number;
|
12
17
|
max_depth?: number;
|
13
18
|
page?: number;
|
14
19
|
limit?: number;
|
@@ -1,19 +1,43 @@
|
|
1
1
|
import type { CommentId } from "./CommentId";
|
2
2
|
import type { CommunityId } from "./CommunityId";
|
3
|
+
import type { ListingType } from "./ListingType";
|
3
4
|
import type { ModlogActionType } from "./ModlogActionType";
|
4
|
-
import type {
|
5
|
+
import type { PaginationCursor } from "./PaginationCursor";
|
5
6
|
import type { PersonId } from "./PersonId";
|
6
7
|
import type { PostId } from "./PostId";
|
7
8
|
/**
|
8
9
|
* Fetches the modlog.
|
9
10
|
*/
|
10
11
|
export type GetModlog = {
|
12
|
+
/**
|
13
|
+
* Filter by the moderator.
|
14
|
+
*/
|
11
15
|
mod_person_id?: PersonId;
|
16
|
+
/**
|
17
|
+
* Filter by the community.
|
18
|
+
*/
|
12
19
|
community_id?: CommunityId;
|
20
|
+
/**
|
21
|
+
* Filter by the modlog action type.
|
22
|
+
*/
|
13
23
|
type_?: ModlogActionType;
|
24
|
+
/**
|
25
|
+
* Filter by listing type. When not using All, it will remove the non-community modlog entries,
|
26
|
+
* such as site bans, instance blocks, adding an admin, etc.
|
27
|
+
*/
|
28
|
+
listing_type?: ListingType;
|
29
|
+
/**
|
30
|
+
* Filter by the other / modded person.
|
31
|
+
*/
|
14
32
|
other_person_id?: PersonId;
|
33
|
+
/**
|
34
|
+
* Filter by post. Will include comments of that post.
|
35
|
+
*/
|
15
36
|
post_id?: PostId;
|
37
|
+
/**
|
38
|
+
* Filter by comment.
|
39
|
+
*/
|
16
40
|
comment_id?: CommentId;
|
17
|
-
page_cursor?:
|
41
|
+
page_cursor?: PaginationCursor;
|
18
42
|
page_back?: boolean;
|
19
43
|
};
|
@@ -1,7 +1,12 @@
|
|
1
1
|
import type { ModlogCombinedView } from "./ModlogCombinedView";
|
2
|
+
import type { PaginationCursor } from "./PaginationCursor";
|
2
3
|
/**
|
3
4
|
* The modlog fetch response.
|
4
5
|
*/
|
5
6
|
export type GetModlogResponse = {
|
6
7
|
modlog: Array<ModlogCombinedView>;
|
8
|
+
/**
|
9
|
+
* the pagination cursor to use to fetch the next page
|
10
|
+
*/
|
11
|
+
next_page?: PaginationCursor;
|
7
12
|
};
|
@@ -1,4 +1,3 @@
|
|
1
|
-
import type { CommunityModeratorView } from "./CommunityModeratorView";
|
2
1
|
import type { CommunityView } from "./CommunityView";
|
3
2
|
import type { PostView } from "./PostView";
|
4
3
|
/**
|
@@ -7,7 +6,6 @@ import type { PostView } from "./PostView";
|
|
7
6
|
export type GetPostResponse = {
|
8
7
|
post_view: PostView;
|
9
8
|
community_view: CommunityView;
|
10
|
-
moderators: Array<CommunityModeratorView>;
|
11
9
|
/**
|
12
10
|
* A list of cross-posts, or other times / communities this link has been posted to.
|
13
11
|
*/
|
package/dist/types/GetPosts.d.ts
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
import type { CommunityId } from "./CommunityId";
|
2
2
|
import type { ListingType } from "./ListingType";
|
3
|
-
import type {
|
3
|
+
import type { PostPaginationCursor } from "./PostPaginationCursor";
|
4
4
|
import type { PostSortType } from "./PostSortType";
|
5
5
|
/**
|
6
6
|
* Get a list of posts.
|
@@ -8,6 +8,12 @@ import type { PostSortType } from "./PostSortType";
|
|
8
8
|
export type GetPosts = {
|
9
9
|
type_?: ListingType;
|
10
10
|
sort?: PostSortType;
|
11
|
+
/**
|
12
|
+
* Filter to within a given time range, in seconds.
|
13
|
+
* IE 60 would give results for the past minute.
|
14
|
+
* Use Zero to override the local_site and local_user time_range.
|
15
|
+
*/
|
16
|
+
time_range_seconds?: number;
|
11
17
|
/**
|
12
18
|
* DEPRECATED, use page_cursor
|
13
19
|
*/
|
@@ -40,6 +46,6 @@ export type GetPosts = {
|
|
40
46
|
* If true, then only show posts with no comments
|
41
47
|
*/
|
42
48
|
no_comments_only?: boolean;
|
43
|
-
page_cursor?:
|
49
|
+
page_cursor?: PostPaginationCursor;
|
44
50
|
page_back?: boolean;
|
45
51
|
};
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import type {
|
1
|
+
import type { PostPaginationCursor } from "./PostPaginationCursor";
|
2
2
|
import type { PostView } from "./PostView";
|
3
3
|
/**
|
4
4
|
* The post list response.
|
@@ -8,5 +8,5 @@ export type GetPostsResponse = {
|
|
8
8
|
/**
|
9
9
|
* the pagination cursor to use to fetch the next page
|
10
10
|
*/
|
11
|
-
next_page?:
|
11
|
+
next_page?: PostPaginationCursor;
|
12
12
|
};
|