lemmy-js-client 0.20.0-api-v4.17 → 0.20.0-api-no-optional-vec.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 +13 -4
- package/dist/http.d.ts +237 -430
- package/dist/http.js +1225 -411
- package/dist/index.d.ts +62 -20
- package/dist/other_types.d.ts +80 -16
- package/dist/types/AdminAllowInstance.d.ts +2 -1
- package/dist/types/AdminAllowInstanceId.d.ts +1 -0
- package/dist/types/AdminAllowInstanceView.d.ts +1 -1
- package/dist/types/AdminBlockInstance.d.ts +2 -1
- package/dist/types/AdminBlockInstanceId.d.ts +1 -0
- package/dist/types/AdminPurgeComment.d.ts +3 -2
- package/dist/types/AdminPurgeCommentId.d.ts +1 -0
- package/dist/types/AdminPurgeCommentId.js +3 -0
- package/dist/types/AdminPurgeCommunity.d.ts +3 -2
- package/dist/types/AdminPurgeCommunityId.d.ts +1 -0
- package/dist/types/AdminPurgeCommunityId.js +3 -0
- package/dist/types/AdminPurgePerson.d.ts +3 -2
- package/dist/types/AdminPurgePersonId.d.ts +1 -0
- package/dist/types/AdminPurgePersonId.js +3 -0
- package/dist/types/AdminPurgePost.d.ts +3 -2
- package/dist/types/AdminPurgePostId.d.ts +1 -0
- package/dist/types/AdminPurgePostId.js +3 -0
- package/dist/types/AuthenticateWithOauth.d.ts +1 -1
- package/dist/types/CommentReplyView.d.ts +5 -1
- package/dist/types/CommentReport.d.ts +1 -0
- package/dist/types/CommentReportView.d.ts +4 -1
- package/dist/types/CommentSlimView.d.ts +24 -0
- package/dist/types/CommentView.d.ts +5 -1
- package/dist/types/Community.d.ts +2 -2
- package/dist/types/CommunityAggregates.d.ts +2 -0
- package/dist/types/CommunityReport.d.ts +22 -0
- package/dist/types/CommunityReportId.d.ts +4 -0
- package/dist/types/CommunityReportId.js +3 -0
- package/dist/types/CommunityReportView.d.ts +16 -0
- package/dist/types/CommunitySortType.d.ts +1 -1
- package/dist/types/CommunityView.d.ts +1 -0
- package/dist/types/CreateCommentReport.d.ts +1 -0
- package/dist/types/CreateCommunity.d.ts +1 -1
- package/dist/types/CreatePost.d.ts +2 -0
- package/dist/types/CreatePostReport.d.ts +1 -0
- package/dist/types/CreateSite.d.ts +3 -5
- package/dist/types/DeleteImageParams.d.ts +3 -0
- package/dist/types/DeleteImageParams.js +3 -0
- package/dist/types/EditCommunity.d.ts +1 -9
- package/dist/types/EditPost.d.ts +2 -0
- package/dist/types/EditSite.d.ts +11 -18
- package/dist/types/FederationError.d.ts +2 -2
- package/dist/types/GetComments.d.ts +5 -1
- package/dist/types/GetCommentsSlimResponse.d.ts +7 -0
- package/dist/types/GetModlog.d.ts +27 -2
- package/dist/types/GetModlogResponse.d.ts +2 -34
- package/dist/types/GetPersonDetails.d.ts +0 -7
- package/dist/types/GetPersonDetailsResponse.d.ts +0 -4
- package/dist/types/GetPostResponse.d.ts +0 -2
- package/dist/types/GetPosts.d.ts +12 -0
- package/dist/types/GetRandomCommunity.d.ts +1 -0
- package/dist/types/GetReportCountResponse.d.ts +1 -5
- package/dist/types/GetReportCountResponse.js +1 -0
- package/dist/types/GetSiteResponse.d.ts +3 -10
- package/dist/types/GetUnreadCountResponse.d.ts +2 -4
- package/dist/types/ImageDetails.d.ts +1 -0
- package/dist/types/ImageGetParams.d.ts +4 -0
- package/dist/types/ImageGetParams.js +3 -0
- package/dist/types/ImageProxyParams.d.ts +5 -0
- package/dist/types/ImageProxyParams.js +3 -0
- package/dist/types/InboxCombinedPaginationCursor.d.ts +4 -0
- package/dist/types/InboxCombinedPaginationCursor.js +3 -0
- package/dist/types/InboxCombinedView.d.ts +13 -0
- package/dist/types/InboxDataType.d.ts +4 -0
- package/dist/types/InboxDataType.js +3 -0
- package/dist/types/LemmyErrorType.d.ts +5 -3
- package/dist/types/ListCommunities.d.ts +5 -0
- package/dist/types/ListInbox.d.ts +11 -0
- package/dist/types/ListInboxResponse.d.ts +7 -0
- package/dist/types/ListPersonContent.d.ts +18 -0
- package/dist/types/ListPersonContentResponse.d.ts +7 -0
- package/dist/types/ListPersonSaved.d.ts +10 -0
- package/dist/types/ListPersonSavedResponse.d.ts +7 -0
- package/dist/types/ListReports.d.ts +35 -0
- package/dist/types/ListReportsResponse.d.ts +7 -0
- package/dist/types/LocalImage.d.ts +0 -1
- package/dist/types/LocalSite.d.ts +9 -0
- package/dist/types/LocalUser.d.ts +13 -0
- package/dist/types/MarkPersonCommentMentionAsRead.d.ts +8 -0
- package/dist/types/MarkPersonPostMentionAsRead.d.ts +8 -0
- package/dist/types/ModAdd.d.ts +3 -2
- package/dist/types/ModAddCommunity.d.ts +3 -2
- package/dist/types/ModAddCommunityId.d.ts +1 -0
- package/dist/types/ModAddCommunityId.js +3 -0
- package/dist/types/ModAddCommunityView.d.ts +1 -1
- package/dist/types/ModAddId.d.ts +1 -0
- package/dist/types/ModAddId.js +3 -0
- package/dist/types/ModAddView.d.ts +1 -1
- package/dist/types/ModBan.d.ts +3 -2
- package/dist/types/ModBanFromCommunity.d.ts +3 -2
- package/dist/types/ModBanFromCommunityId.d.ts +1 -0
- package/dist/types/ModBanFromCommunityId.js +3 -0
- package/dist/types/ModBanFromCommunityView.d.ts +1 -1
- package/dist/types/ModBanId.d.ts +1 -0
- package/dist/types/ModBanId.js +3 -0
- package/dist/types/ModBanView.d.ts +1 -1
- package/dist/types/ModFeaturePost.d.ts +3 -2
- package/dist/types/ModFeaturePostId.d.ts +1 -0
- package/dist/types/ModFeaturePostId.js +3 -0
- package/dist/types/ModFeaturePostView.d.ts +1 -0
- package/dist/types/ModHideCommunity.d.ts +3 -2
- package/dist/types/ModHideCommunityId.d.ts +1 -0
- package/dist/types/ModHideCommunityId.js +3 -0
- package/dist/types/ModLockPost.d.ts +3 -2
- package/dist/types/ModLockPostId.d.ts +1 -0
- package/dist/types/ModLockPostId.js +3 -0
- package/dist/types/ModLockPostView.d.ts +1 -0
- package/dist/types/ModRemoveComment.d.ts +3 -2
- package/dist/types/ModRemoveCommentId.d.ts +1 -0
- package/dist/types/ModRemoveCommentId.js +3 -0
- package/dist/types/ModRemoveCommentView.d.ts +1 -1
- package/dist/types/ModRemoveCommunity.d.ts +3 -2
- package/dist/types/ModRemoveCommunityId.d.ts +1 -0
- package/dist/types/ModRemoveCommunityId.js +3 -0
- package/dist/types/ModRemovePost.d.ts +3 -2
- package/dist/types/ModRemovePostId.d.ts +1 -0
- package/dist/types/ModRemovePostId.js +3 -0
- package/dist/types/ModRemovePostView.d.ts +1 -0
- package/dist/types/ModTransferCommunity.d.ts +3 -2
- package/dist/types/ModTransferCommunityId.d.ts +1 -0
- package/dist/types/ModTransferCommunityId.js +3 -0
- package/dist/types/ModTransferCommunityView.d.ts +1 -1
- package/dist/types/ModlogCombinedPaginationCursor.d.ts +4 -0
- package/dist/types/ModlogCombinedPaginationCursor.js +3 -0
- package/dist/types/ModlogCombinedView.d.ts +52 -0
- package/dist/types/Person.d.ts +2 -2
- package/dist/types/PersonAggregates.d.ts +1 -0
- package/dist/types/{PersonMention.d.ts → PersonCommentMention.d.ts} +3 -3
- package/dist/types/PersonCommentMentionId.d.ts +4 -0
- package/dist/types/PersonCommentMentionId.js +3 -0
- package/dist/types/{PersonMentionView.d.ts → PersonCommentMentionView.d.ts} +9 -5
- package/dist/types/PersonCommentMentionView.js +2 -0
- package/dist/types/PersonContentCombinedPaginationCursor.d.ts +4 -0
- package/dist/types/PersonContentCombinedPaginationCursor.js +3 -0
- package/dist/types/PersonContentCombinedView.d.ts +7 -0
- package/dist/types/PersonContentCombinedView.js +2 -0
- package/dist/types/PersonContentType.d.ts +4 -0
- package/dist/types/PersonContentType.js +3 -0
- package/dist/types/PersonPostMention.d.ts +13 -0
- package/dist/types/PersonPostMention.js +2 -0
- package/dist/types/PersonPostMentionId.d.ts +4 -0
- package/dist/types/PersonPostMentionId.js +3 -0
- package/dist/types/PersonPostMentionView.d.ts +36 -0
- package/dist/types/PersonPostMentionView.js +2 -0
- package/dist/types/PersonSavedCombinedPaginationCursor.d.ts +4 -0
- package/dist/types/PersonSavedCombinedPaginationCursor.js +3 -0
- package/dist/types/PostReport.d.ts +1 -0
- package/dist/types/PostReportView.d.ts +4 -1
- package/dist/types/PostSortType.d.ts +1 -1
- package/dist/types/PostTags.d.ts +7 -0
- package/dist/types/PostTags.js +2 -0
- package/dist/types/PostView.d.ts +7 -1
- package/dist/types/PrivateMessage.d.ts +1 -0
- package/dist/types/ReportCombinedPaginationCursor.d.ts +4 -0
- package/dist/types/ReportCombinedPaginationCursor.js +3 -0
- package/dist/types/ReportCombinedView.d.ts +13 -0
- package/dist/types/ReportCombinedView.js +2 -0
- package/dist/types/ReportType.d.ts +4 -0
- package/dist/types/ReportType.js +3 -0
- package/dist/types/ResendVerificationEmail.d.ts +7 -0
- package/dist/types/ResendVerificationEmail.js +2 -0
- package/dist/types/SaveUserSettings.d.ts +9 -9
- package/dist/types/Search.d.ts +12 -7
- package/dist/types/SearchCombinedPaginationCursor.d.ts +4 -0
- package/dist/types/SearchCombinedPaginationCursor.js +3 -0
- package/dist/types/SearchCombinedView.d.ts +13 -0
- package/dist/types/SearchCombinedView.js +2 -0
- package/dist/types/SearchResponse.d.ts +2 -10
- package/dist/types/SearchSortType.d.ts +4 -0
- package/dist/types/SearchSortType.js +3 -0
- package/dist/types/Site.d.ts +2 -2
- package/dist/types/SiteResponse.d.ts +1 -1
- package/dist/types/SuccessResponse.d.ts +1 -1
- package/dist/types/Tag.d.ts +27 -0
- package/dist/types/Tag.js +2 -0
- package/dist/types/TagId.d.ts +4 -0
- package/dist/types/TagId.js +3 -0
- package/dist/types/UploadImageResponse.d.ts +4 -0
- package/dist/types/UploadImageResponse.js +3 -0
- package/package.json +9 -4
- package/dist/types/CommentReplyResponse.d.ts +0 -7
- package/dist/types/GetPersonMentions.d.ts +0 -10
- package/dist/types/GetPersonMentionsResponse.d.ts +0 -7
- package/dist/types/GetPrivateMessages.d.ts +0 -10
- package/dist/types/GetReplies.d.ts +0 -10
- package/dist/types/GetRepliesResponse.d.ts +0 -7
- package/dist/types/ListCommentReports.d.ts +0 -18
- package/dist/types/ListCommentReportsResponse.d.ts +0 -7
- package/dist/types/ListPostReports.d.ts +0 -18
- package/dist/types/ListPostReportsResponse.d.ts +0 -7
- package/dist/types/ListPrivateMessageReports.d.ts +0 -11
- package/dist/types/ListPrivateMessageReportsResponse.d.ts +0 -7
- package/dist/types/MarkPersonMentionAsRead.d.ts +0 -8
- package/dist/types/ModlogListParams.d.ts +0 -17
- package/dist/types/PersonMentionId.d.ts +0 -4
- package/dist/types/PersonMentionResponse.d.ts +0 -7
- package/dist/types/PrivateMessagesResponse.d.ts +0 -7
- /package/dist/types/{ListPrivateMessageReports.js → AdminAllowInstanceId.js} +0 -0
- /package/dist/types/{PersonMentionId.js → AdminBlockInstanceId.js} +0 -0
- /package/dist/types/{CommentReplyResponse.js → CommentSlimView.js} +0 -0
- /package/dist/types/{GetPersonMentions.js → CommunityReport.js} +0 -0
- /package/dist/types/{GetPersonMentionsResponse.js → CommunityReportView.js} +0 -0
- /package/dist/types/{GetPrivateMessages.js → GetCommentsSlimResponse.js} +0 -0
- /package/dist/types/{GetReplies.js → InboxCombinedView.js} +0 -0
- /package/dist/types/{GetRepliesResponse.js → ListInbox.js} +0 -0
- /package/dist/types/{ListCommentReports.js → ListInboxResponse.js} +0 -0
- /package/dist/types/{ListCommentReportsResponse.js → ListPersonContent.js} +0 -0
- /package/dist/types/{ListPostReports.js → ListPersonContentResponse.js} +0 -0
- /package/dist/types/{ListPostReportsResponse.js → ListPersonSaved.js} +0 -0
- /package/dist/types/{ListPrivateMessageReportsResponse.js → ListPersonSavedResponse.js} +0 -0
- /package/dist/types/{MarkPersonMentionAsRead.js → ListReports.js} +0 -0
- /package/dist/types/{ModlogListParams.js → ListReportsResponse.js} +0 -0
- /package/dist/types/{PersonMention.js → MarkPersonCommentMentionAsRead.js} +0 -0
- /package/dist/types/{PersonMentionResponse.js → MarkPersonPostMentionAsRead.js} +0 -0
- /package/dist/types/{PersonMentionView.js → ModlogCombinedView.js} +0 -0
- /package/dist/types/{PrivateMessagesResponse.js → PersonCommentMention.js} +0 -0
@@ -2,14 +2,14 @@ import type { Comment } from "./Comment";
|
|
2
2
|
import type { CommentAggregates } from "./CommentAggregates";
|
3
3
|
import type { Community } from "./Community";
|
4
4
|
import type { Person } from "./Person";
|
5
|
-
import type {
|
5
|
+
import type { PersonCommentMention } from "./PersonCommentMention";
|
6
6
|
import type { Post } from "./Post";
|
7
7
|
import type { SubscribedType } from "./SubscribedType";
|
8
8
|
/**
|
9
|
-
* A person mention view.
|
9
|
+
* A person comment mention view.
|
10
10
|
*/
|
11
|
-
export type
|
12
|
-
|
11
|
+
export type PersonCommentMentionView = {
|
12
|
+
person_comment_mention: PersonCommentMention;
|
13
13
|
comment: Comment;
|
14
14
|
creator: Person;
|
15
15
|
post: Post;
|
@@ -21,7 +21,11 @@ export type PersonMentionView = {
|
|
21
21
|
creator_is_moderator: boolean;
|
22
22
|
creator_is_admin: boolean;
|
23
23
|
subscribed: SubscribedType;
|
24
|
-
|
24
|
+
/**
|
25
|
+
* The time when the comment was saved.
|
26
|
+
*/
|
27
|
+
saved?: string;
|
25
28
|
creator_blocked: boolean;
|
26
29
|
my_vote?: number;
|
30
|
+
can_mod: boolean;
|
27
31
|
};
|
@@ -0,0 +1,13 @@
|
|
1
|
+
import type { PersonId } from "./PersonId";
|
2
|
+
import type { PersonPostMentionId } from "./PersonPostMentionId";
|
3
|
+
import type { PostId } from "./PostId";
|
4
|
+
/**
|
5
|
+
* A person mention.
|
6
|
+
*/
|
7
|
+
export type PersonPostMention = {
|
8
|
+
id: PersonPostMentionId;
|
9
|
+
recipient_id: PersonId;
|
10
|
+
post_id: PostId;
|
11
|
+
read: boolean;
|
12
|
+
published: string;
|
13
|
+
};
|
@@ -0,0 +1,36 @@
|
|
1
|
+
import type { Community } from "./Community";
|
2
|
+
import type { ImageDetails } from "./ImageDetails";
|
3
|
+
import type { Person } from "./Person";
|
4
|
+
import type { PersonPostMention } from "./PersonPostMention";
|
5
|
+
import type { Post } from "./Post";
|
6
|
+
import type { PostAggregates } from "./PostAggregates";
|
7
|
+
import type { PostTags } from "./PostTags";
|
8
|
+
import type { SubscribedType } from "./SubscribedType";
|
9
|
+
/**
|
10
|
+
* A person post mention view.
|
11
|
+
*/
|
12
|
+
export type PersonPostMentionView = {
|
13
|
+
person_post_mention: PersonPostMention;
|
14
|
+
post: Post;
|
15
|
+
creator: Person;
|
16
|
+
community: Community;
|
17
|
+
image_details?: ImageDetails;
|
18
|
+
recipient: Person;
|
19
|
+
counts: PostAggregates;
|
20
|
+
creator_banned_from_community: boolean;
|
21
|
+
banned_from_community: boolean;
|
22
|
+
creator_is_moderator: boolean;
|
23
|
+
creator_is_admin: boolean;
|
24
|
+
subscribed: SubscribedType;
|
25
|
+
/**
|
26
|
+
* The time when the post was saved.
|
27
|
+
*/
|
28
|
+
saved?: string;
|
29
|
+
read: boolean;
|
30
|
+
hidden: boolean;
|
31
|
+
creator_blocked: boolean;
|
32
|
+
my_vote?: number;
|
33
|
+
unread_comments: number;
|
34
|
+
post_tags: PostTags;
|
35
|
+
can_mod: boolean;
|
36
|
+
};
|
@@ -17,7 +17,10 @@ export type PostReportView = {
|
|
17
17
|
creator_is_moderator: boolean;
|
18
18
|
creator_is_admin: boolean;
|
19
19
|
subscribed: SubscribedType;
|
20
|
-
|
20
|
+
/**
|
21
|
+
* The time when the post was saved.
|
22
|
+
*/
|
23
|
+
saved?: string;
|
21
24
|
read: boolean;
|
22
25
|
hidden: boolean;
|
23
26
|
creator_blocked: boolean;
|
@@ -1,4 +1,4 @@
|
|
1
1
|
/**
|
2
2
|
* The post sort types. See here for descriptions: https://join-lemmy.org/docs/en/users/03-votes-and-ranking.html
|
3
3
|
*/
|
4
|
-
export type PostSortType = "Active" | "Hot" | "New" | "Old" | "
|
4
|
+
export type PostSortType = "Active" | "Hot" | "New" | "Old" | "Top" | "MostComments" | "NewComments" | "Controversial" | "Scaled";
|
package/dist/types/PostView.d.ts
CHANGED
@@ -3,6 +3,7 @@ import type { ImageDetails } from "./ImageDetails";
|
|
3
3
|
import type { Person } from "./Person";
|
4
4
|
import type { Post } from "./Post";
|
5
5
|
import type { PostAggregates } from "./PostAggregates";
|
6
|
+
import type { PostTags } from "./PostTags";
|
6
7
|
import type { SubscribedType } from "./SubscribedType";
|
7
8
|
/**
|
8
9
|
* A post view.
|
@@ -18,10 +19,15 @@ export type PostView = {
|
|
18
19
|
creator_is_admin: boolean;
|
19
20
|
counts: PostAggregates;
|
20
21
|
subscribed: SubscribedType;
|
21
|
-
|
22
|
+
/**
|
23
|
+
* The time when the post was saved.
|
24
|
+
*/
|
25
|
+
saved?: string;
|
22
26
|
read: boolean;
|
23
27
|
hidden: boolean;
|
24
28
|
creator_blocked: boolean;
|
25
29
|
my_vote?: number;
|
26
30
|
unread_comments: number;
|
31
|
+
tags: PostTags;
|
32
|
+
can_mod: boolean;
|
27
33
|
};
|
@@ -0,0 +1,13 @@
|
|
1
|
+
import type { CommentReportView } from "./CommentReportView";
|
2
|
+
import type { CommunityReportView } from "./CommunityReportView";
|
3
|
+
import type { PostReportView } from "./PostReportView";
|
4
|
+
import type { PrivateMessageReportView } from "./PrivateMessageReportView";
|
5
|
+
export type ReportCombinedView = ({
|
6
|
+
type_: "Post";
|
7
|
+
} & PostReportView) | ({
|
8
|
+
type_: "Comment";
|
9
|
+
} & CommentReportView) | ({
|
10
|
+
type_: "PrivateMessage";
|
11
|
+
} & PrivateMessageReportView) | ({
|
12
|
+
type_: "Community";
|
13
|
+
} & CommunityReportView);
|
@@ -32,6 +32,10 @@ export type SaveUserSettings = {
|
|
32
32
|
* The default post sort, usually "active"
|
33
33
|
*/
|
34
34
|
default_post_sort_type?: PostSortType;
|
35
|
+
/**
|
36
|
+
* A default time range limit to apply to post sorts, in seconds. 0 means none.
|
37
|
+
*/
|
38
|
+
default_post_time_range_seconds?: number;
|
35
39
|
/**
|
36
40
|
* The default comment sort, usually "hot"
|
37
41
|
*/
|
@@ -40,14 +44,6 @@ export type SaveUserSettings = {
|
|
40
44
|
* The language of the lemmy interface
|
41
45
|
*/
|
42
46
|
interface_language?: string;
|
43
|
-
/**
|
44
|
-
* A URL for your avatar.
|
45
|
-
*/
|
46
|
-
avatar?: string;
|
47
|
-
/**
|
48
|
-
* A URL for your banner.
|
49
|
-
*/
|
50
|
-
banner?: string;
|
51
47
|
/**
|
52
48
|
* Your display name, which can contain strange characters, and does not need to be unique.
|
53
49
|
*/
|
@@ -87,7 +83,7 @@ export type SaveUserSettings = {
|
|
87
83
|
/**
|
88
84
|
* A list of languages you are able to see discussion in.
|
89
85
|
*/
|
90
|
-
discussion_languages
|
86
|
+
discussion_languages: Array<LanguageId>;
|
91
87
|
/**
|
92
88
|
* Open links in a new tab
|
93
89
|
*/
|
@@ -124,4 +120,8 @@ export type SaveUserSettings = {
|
|
124
120
|
* Whether to automatically mark fetched posts as read.
|
125
121
|
*/
|
126
122
|
auto_mark_fetched_posts_as_read?: boolean;
|
123
|
+
/**
|
124
|
+
* Whether to hide posts containing images/videos.
|
125
|
+
*/
|
126
|
+
hide_media?: boolean;
|
127
127
|
};
|
package/dist/types/Search.d.ts
CHANGED
@@ -1,24 +1,29 @@
|
|
1
1
|
import type { CommunityId } from "./CommunityId";
|
2
2
|
import type { ListingType } from "./ListingType";
|
3
3
|
import type { PersonId } from "./PersonId";
|
4
|
-
import type {
|
4
|
+
import type { SearchCombinedPaginationCursor } from "./SearchCombinedPaginationCursor";
|
5
|
+
import type { SearchSortType } from "./SearchSortType";
|
5
6
|
import type { SearchType } from "./SearchType";
|
6
7
|
/**
|
7
|
-
* Searches the site, given a
|
8
|
+
* Searches the site, given a search term, and some optional filters.
|
8
9
|
*/
|
9
10
|
export type Search = {
|
10
|
-
|
11
|
+
search_term?: string;
|
11
12
|
community_id?: CommunityId;
|
12
13
|
community_name?: string;
|
13
14
|
creator_id?: PersonId;
|
14
15
|
type_?: SearchType;
|
15
|
-
sort?:
|
16
|
+
sort?: SearchSortType;
|
17
|
+
/**
|
18
|
+
* Filter to within a given time range, in seconds.
|
19
|
+
* IE 60 would give results for the past minute.
|
20
|
+
*/
|
21
|
+
time_range_seconds?: number;
|
16
22
|
listing_type?: ListingType;
|
17
|
-
page?: number;
|
18
|
-
limit?: number;
|
19
23
|
title_only?: boolean;
|
20
24
|
post_url_only?: boolean;
|
21
|
-
saved_only?: boolean;
|
22
25
|
liked_only?: boolean;
|
23
26
|
disliked_only?: boolean;
|
27
|
+
page_cursor?: SearchCombinedPaginationCursor;
|
28
|
+
page_back?: boolean;
|
24
29
|
};
|
@@ -0,0 +1,13 @@
|
|
1
|
+
import type { CommentView } from "./CommentView";
|
2
|
+
import type { CommunityView } from "./CommunityView";
|
3
|
+
import type { PersonView } from "./PersonView";
|
4
|
+
import type { PostView } from "./PostView";
|
5
|
+
export type SearchCombinedView = ({
|
6
|
+
type_: "Post";
|
7
|
+
} & PostView) | ({
|
8
|
+
type_: "Comment";
|
9
|
+
} & CommentView) | ({
|
10
|
+
type_: "Community";
|
11
|
+
} & CommunityView) | ({
|
12
|
+
type_: "Person";
|
13
|
+
} & PersonView);
|
@@ -1,15 +1,7 @@
|
|
1
|
-
import type {
|
2
|
-
import type { CommunityView } from "./CommunityView";
|
3
|
-
import type { PersonView } from "./PersonView";
|
4
|
-
import type { PostView } from "./PostView";
|
5
|
-
import type { SearchType } from "./SearchType";
|
1
|
+
import type { SearchCombinedView } from "./SearchCombinedView";
|
6
2
|
/**
|
7
3
|
* The search response, containing lists of the return type possibilities
|
8
4
|
*/
|
9
5
|
export type SearchResponse = {
|
10
|
-
|
11
|
-
comments: Array<CommentView>;
|
12
|
-
posts: Array<PostView>;
|
13
|
-
communities: Array<CommunityView>;
|
14
|
-
users: Array<PersonView>;
|
6
|
+
results: Array<SearchCombinedView>;
|
15
7
|
};
|
package/dist/types/Site.d.ts
CHANGED
@@ -0,0 +1,27 @@
|
|
1
|
+
import type { CommunityId } from "./CommunityId";
|
2
|
+
import type { DbUrl } from "./DbUrl";
|
3
|
+
import type { TagId } from "./TagId";
|
4
|
+
/**
|
5
|
+
* A tag that can be assigned to a post within a community.
|
6
|
+
* The tag object is created by the community moderators.
|
7
|
+
* The assignment happens by the post creator and can be updated by the community moderators.
|
8
|
+
*
|
9
|
+
* A tag is a federatable object that gives additional context to another object, which can be
|
10
|
+
* displayed and filtered on currently, we only have community post tags, which is a tag that is
|
11
|
+
* created by post authors as well as mods of a community, to categorize a post. in the future we
|
12
|
+
* may add more tag types, depending on the requirements, this will lead to either expansion of
|
13
|
+
* this table (community_id optional, addition of tag_type enum) or split of this table / creation
|
14
|
+
* of new tables.
|
15
|
+
*/
|
16
|
+
export type Tag = {
|
17
|
+
id: TagId;
|
18
|
+
ap_id: DbUrl;
|
19
|
+
name: string;
|
20
|
+
/**
|
21
|
+
* the community that owns this tag
|
22
|
+
*/
|
23
|
+
community_id: CommunityId;
|
24
|
+
published: string;
|
25
|
+
updated?: string;
|
26
|
+
deleted: boolean;
|
27
|
+
};
|
package/package.json
CHANGED
@@ -1,8 +1,8 @@
|
|
1
1
|
{
|
2
2
|
"name": "lemmy-js-client",
|
3
3
|
"description": "A javascript / typescript client for Lemmy",
|
4
|
-
"version": "0.20.0-api-
|
5
|
-
"author": "Dessalines
|
4
|
+
"version": "0.20.0-api-no-optional-vec.0",
|
5
|
+
"author": "Dessalines",
|
6
6
|
"license": "AGPL-3.0",
|
7
7
|
"main": "./dist/index.js",
|
8
8
|
"files": [
|
@@ -12,13 +12,17 @@
|
|
12
12
|
"build": "tsc",
|
13
13
|
"docs": "typedoc src/index.ts",
|
14
14
|
"lint": "tsc --noEmit && eslint --report-unused-disable-directives && prettier --check src",
|
15
|
-
"prepare": "pnpm run build && husky"
|
15
|
+
"prepare": "pnpm run build && husky",
|
16
|
+
"tsoa": "tsoa spec-and-routes && tsc && redocly build-docs tsoa_build/swagger.json"
|
16
17
|
},
|
17
18
|
"repository": {
|
18
19
|
"type": "git",
|
19
20
|
"url": "git+https://github.com/LemmyNet/lemmy-js-client.git"
|
20
21
|
},
|
21
22
|
"devDependencies": {
|
23
|
+
"@eslint/js": "^9.20.0",
|
24
|
+
"@redocly/cli": "^1.27.2",
|
25
|
+
"@types/joi": "^17.2.3",
|
22
26
|
"@types/node": "^22.7.4",
|
23
27
|
"@typescript-eslint/eslint-plugin": "^8.7.0",
|
24
28
|
"@typescript-eslint/parser": "^8.7.0",
|
@@ -31,11 +35,12 @@
|
|
31
35
|
"prettier-plugin-organize-imports": "^4.0.0",
|
32
36
|
"prettier-plugin-packagejson": "^2.5.1",
|
33
37
|
"sortpack": "^2.4.0",
|
38
|
+
"tsoa": "^6.6.0",
|
34
39
|
"typedoc": "^0.27.0",
|
35
40
|
"typescript": "^5.5.4",
|
36
41
|
"typescript-eslint": "^8.7.0"
|
37
42
|
},
|
38
|
-
"packageManager": "pnpm@
|
43
|
+
"packageManager": "pnpm@10.4.1",
|
39
44
|
"types": "./dist/index.d.ts",
|
40
45
|
"lint-staged": {
|
41
46
|
"*.{ts,tsx,js}": [
|
@@ -1,18 +0,0 @@
|
|
1
|
-
import type { CommentId } from "./CommentId";
|
2
|
-
import type { CommunityId } from "./CommunityId";
|
3
|
-
/**
|
4
|
-
* List comment reports.
|
5
|
-
*/
|
6
|
-
export type ListCommentReports = {
|
7
|
-
comment_id?: CommentId;
|
8
|
-
page?: number;
|
9
|
-
limit?: number;
|
10
|
-
/**
|
11
|
-
* Only shows the unresolved reports
|
12
|
-
*/
|
13
|
-
unresolved_only?: boolean;
|
14
|
-
/**
|
15
|
-
* if no community is given, it returns reports for all communities moderated by the auth user
|
16
|
-
*/
|
17
|
-
community_id?: CommunityId;
|
18
|
-
};
|