lemmy-js-client 1.0.0-post-notifications.1 → 1.0.0-post-notifications.3

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/dist/http.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import { Controller } from "@tsoa/runtime";
2
- import { AdminListUsersI, CommunityIdQueryI, DeleteImageParamsI, GetCommentI, GetCommentsI, GetCommunityI, GetCommunityPendingFollowsCountI, GetModlogI, GetMultiCommunityI, GetPersonDetailsI, GetPostI, GetPostsI, GetRandomCommunityI, GetRegistrationApplicationI, GetReportCountI, GetSiteMetadataI, ListCommentLikesI, ListCommunitiesI, ListCommunityPendingFollowsI, ListCustomEmojisI, ListInboxI, ListMediaI, ListMultiCommunitiesI, ListPersonContentI, ListPersonHiddenI, ListPersonLikedI, ListPersonReadI, ListPersonSavedI, ListPostLikesI, ListRegistrationApplicationsI, ListReportsI, ListTaglinesI, ResolveObjectI, SearchI, UploadImage } from "./other_types";
2
+ import { AdminListUsersI, CommunityIdQueryI, DeleteImageParamsI, GetCommentI, GetCommentsI, GetCommunityI, GetCommunityPendingFollowsCountI, GetModlogI, GetMultiCommunityI, GetPersonDetailsI, GetPostI, GetPostsI, GetRandomCommunityI, GetRegistrationApplicationI, GetReportCountI, GetSiteMetadataI, ListCommentLikesI, ListCommunitiesI, ListCommunityPendingFollowsI, ListCustomEmojisI, ListNotificationsI, ListMediaI, ListMultiCommunitiesI, ListPersonContentI, ListPersonHiddenI, ListPersonLikedI, ListPersonReadI, ListPersonSavedI, ListPostLikesI, ListRegistrationApplicationsI, ListReportsI, ListTaglinesI, ResolveObjectI, SearchI, UploadImage } from "./other_types";
3
3
  import { AddAdmin } from "./types/AddAdmin";
4
4
  import { AddAdminResponse } from "./types/AddAdminResponse";
5
5
  import { AddModToCommunity } from "./types/AddModToCommunity";
@@ -127,7 +127,6 @@ import { AdminBlockInstanceParams } from "./types/AdminBlockInstanceParams";
127
127
  import { ListPersonContentResponse } from "./types/ListPersonContentResponse";
128
128
  import { ListPersonSavedResponse } from "./types/ListPersonSavedResponse";
129
129
  import { UploadImageResponse } from "./types/UploadImageResponse";
130
- import { ListInboxResponse } from "./types/ListInboxResponse";
131
130
  import { GetCommentsSlimResponse } from "./types/GetCommentsSlimResponse";
132
131
  import { Tag } from "./types/Tag";
133
132
  import { ResendVerificationEmail } from "./types/ResendVerificationEmail";
@@ -144,6 +143,7 @@ import { FollowMultiCommunity } from "./types/FollowMultiCommunity";
144
143
  import { ListLoginsResponse } from "./types/ListLoginsResponse";
145
144
  import { ListPersonLikedResponse } from "./types/ListPersonLikedResponse";
146
145
  import { MarkNotificationAsRead } from "./types/MarkNotificationAsRead";
146
+ import { ListNotificationsResponse } from "./types/ListNotificationsResponse";
147
147
  type RequestOptions = Pick<RequestInit, "signal">;
148
148
  /**
149
149
  * Helps build lemmy HTTP requests.
@@ -534,7 +534,7 @@ export declare class LemmyHttp extends Controller {
534
534
  /**
535
535
  * @summary Get your inbox (replies, comment mentions, post mentions, and messages)
536
536
  */
537
- listInbox(form: ListInboxI, options?: RequestOptions): Promise<ListInboxResponse>;
537
+ listNotifications(form: ListNotificationsI, options?: RequestOptions): Promise<ListNotificationsResponse>;
538
538
  /**
539
539
  * @summary Verify your email
540
540
  */
package/dist/http.js CHANGED
@@ -607,7 +607,7 @@ let LemmyHttp = class LemmyHttp extends runtime_1.Controller {
607
607
  /**
608
608
  * @summary Get your inbox (replies, comment mentions, post mentions, and messages)
609
609
  */
610
- async listInbox(form, options) {
610
+ async listNotifications(form, options) {
611
611
  return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Get, "/account/inbox", form, options);
612
612
  }
613
613
  /**
@@ -1632,7 +1632,7 @@ __decorate([
1632
1632
  (0, runtime_1.Tags)("Account"),
1633
1633
  __param(0, (0, runtime_1.Queries)()),
1634
1634
  __param(1, (0, runtime_1.Inject)())
1635
- ], LemmyHttp.prototype, "listInbox", null);
1635
+ ], LemmyHttp.prototype, "listNotifications", null);
1636
1636
  __decorate([
1637
1637
  (0, runtime_1.Post)("/account/auth/verify_email"),
1638
1638
  (0, runtime_1.Tags)("Account"),
package/dist/index.d.ts CHANGED
@@ -171,13 +171,13 @@ export { ListCommunityPendingFollows } from "./types/ListCommunityPendingFollows
171
171
  export { ListCommunityPendingFollowsResponse } from "./types/ListCommunityPendingFollowsResponse";
172
172
  export { ListCustomEmojis } from "./types/ListCustomEmojis";
173
173
  export { ListCustomEmojisResponse } from "./types/ListCustomEmojisResponse";
174
- export { ListInbox } from "./types/ListInbox";
175
- export { ListInboxResponse } from "./types/ListInboxResponse";
176
174
  export { ListLoginsResponse } from "./types/ListLoginsResponse";
177
175
  export { ListMedia } from "./types/ListMedia";
178
176
  export { ListMediaResponse } from "./types/ListMediaResponse";
179
177
  export { ListMultiCommunities } from "./types/ListMultiCommunities";
180
178
  export { ListMultiCommunitiesResponse } from "./types/ListMultiCommunitiesResponse";
179
+ export { ListNotifications } from "./types/ListNotifications";
180
+ export { ListNotificationsResponse } from "./types/ListNotificationsResponse";
181
181
  export { ListPersonContent } from "./types/ListPersonContent";
182
182
  export { ListPersonContentResponse } from "./types/ListPersonContentResponse";
183
183
  export { ListPersonHidden } from "./types/ListPersonHidden";
@@ -257,6 +257,7 @@ export { MyUserInfo } from "./types/MyUserInfo";
257
257
  export { NotePerson } from "./types/NotePerson";
258
258
  export { Notification } from "./types/Notification";
259
259
  export { NotificationData } from "./types/NotificationData";
260
+ export { NotificationDataType } from "./types/NotificationDataType";
260
261
  export { NotificationId } from "./types/NotificationId";
261
262
  export { NotificationTypes } from "./types/NotificationTypes";
262
263
  export { NotificationView } from "./types/NotificationView";
@@ -18,7 +18,7 @@ import { ListCommentLikes } from "./types/ListCommentLikes";
18
18
  import { ListCommunities } from "./types/ListCommunities";
19
19
  import { ListCommunityPendingFollows } from "./types/ListCommunityPendingFollows";
20
20
  import { ListCustomEmojis } from "./types/ListCustomEmojis";
21
- import { ListInbox } from "./types/ListInbox";
21
+ import { ListNotifications } from "./types/ListNotifications";
22
22
  import { ListMedia } from "./types/ListMedia";
23
23
  import { ListMultiCommunities } from "./types/ListMultiCommunities";
24
24
  import { ListPersonContent } from "./types/ListPersonContent";
@@ -74,7 +74,7 @@ export interface ListPersonContentI extends ListPersonContent {
74
74
  }
75
75
  export interface GetReportCountI extends GetReportCount {
76
76
  }
77
- export interface ListInboxI extends ListInbox {
77
+ export interface ListNotificationsI extends ListNotifications {
78
78
  }
79
79
  export interface ListPersonSavedI extends ListPersonSaved {
80
80
  }
@@ -1,4 +1,4 @@
1
1
  /**
2
- * Lets you show votes for others only, show all votes, or hide all votes.
2
+ * Available settings for community notifications
3
3
  */
4
4
  export type CommunityNotificationsMode = "AllPostsAndComments" | "AllPosts" | "RepliesAndMentions" | "Mute";
@@ -4,7 +4,7 @@ import type { UserSettingsBackup } from "./UserSettingsBackup";
4
4
  * Your exported data.
5
5
  */
6
6
  export type ExportDataResponse = {
7
- inbox: Array<PostOrCommentOrPrivateMessage>;
7
+ notifications: Array<PostOrCommentOrPrivateMessage>;
8
8
  content: Array<PostOrCommentOrPrivateMessage>;
9
9
  read_posts: Array<string>;
10
10
  liked: Array<string>;
@@ -1,10 +1,10 @@
1
- import type { InboxDataType } from "./InboxDataType";
1
+ import type { NotificationDataType } from "./NotificationDataType";
2
2
  import type { PaginationCursor } from "./PaginationCursor";
3
3
  /**
4
4
  * Get your inbox (replies, comment mentions, post mentions, and messages)
5
5
  */
6
- export type ListInbox = {
7
- type_?: InboxDataType;
6
+ export type ListNotifications = {
7
+ type_?: NotificationDataType;
8
8
  unread_only?: boolean;
9
9
  page_cursor?: PaginationCursor;
10
10
  page_back?: boolean;
@@ -3,8 +3,8 @@ import type { PaginationCursor } from "./PaginationCursor";
3
3
  /**
4
4
  * Get your inbox (replies, comment mentions, post mentions, and messages)
5
5
  */
6
- export type ListInboxResponse = {
7
- inbox: Array<NotificationView>;
6
+ export type ListNotificationsResponse = {
7
+ notifications: Array<NotificationView>;
8
8
  /**
9
9
  * the pagination cursor to use to fetch the next page
10
10
  */
@@ -1,14 +1,16 @@
1
1
  import type { CommentId } from "./CommentId";
2
2
  import type { NotificationId } from "./NotificationId";
3
+ import type { NotificationTypes } from "./NotificationTypes";
4
+ import type { PersonId } from "./PersonId";
3
5
  import type { PostId } from "./PostId";
4
6
  import type { PrivateMessageId } from "./PrivateMessageId";
5
- /**
6
- * A person mention.
7
- */
8
7
  export type Notification = {
9
8
  id: NotificationId;
10
- post_id?: PostId;
9
+ recipient_id: PersonId;
11
10
  comment_id?: CommentId;
12
- private_message_id?: PrivateMessageId;
11
+ read: boolean;
13
12
  published_at: string;
13
+ kind: NotificationTypes;
14
+ post_id?: PostId;
15
+ private_message_id?: PrivateMessageId;
14
16
  };
@@ -1,17 +1,10 @@
1
- import type { Comment } from "./Comment";
2
- import type { Community } from "./Community";
3
- import type { Post } from "./Post";
4
- import type { PrivateMessage } from "./PrivateMessage";
5
- export type NotificationData = {
6
- type_: "Post";
7
- post: Post;
8
- community: Community;
9
- } | {
1
+ import type { CommentView } from "./CommentView";
2
+ import type { PostView } from "./PostView";
3
+ import type { PrivateMessageView } from "./PrivateMessageView";
4
+ export type NotificationData = ({
10
5
  type_: "Comment";
11
- comment: Comment;
12
- post: Post;
13
- community: Community;
14
- } | {
6
+ } & CommentView) | ({
7
+ type_: "Post";
8
+ } & PostView) | ({
15
9
  type_: "PrivateMessage";
16
- pm: PrivateMessage;
17
- };
10
+ } & PrivateMessageView);
@@ -0,0 +1,4 @@
1
+ /**
2
+ * A list of possible types for the inbox.
3
+ */
4
+ export type NotificationDataType = "All" | "Reply" | "Mention" | "PrivateMessage" | "Subscribed";
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
3
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,4 +1,4 @@
1
1
  /**
2
- * Lets you show votes for others only, show all votes, or hide all votes.
2
+ * Types of notifications which can be received in inbox
3
3
  */
4
4
  export type NotificationTypes = "Mention" | "Reply" | "Subscribed" | "PrivateMessage";
@@ -1,30 +1,11 @@
1
- import type { CommentActions } from "./CommentActions";
2
- import type { CommunityActions } from "./CommunityActions";
3
- import type { ImageDetails } from "./ImageDetails";
4
- import type { InstanceActions } from "./InstanceActions";
5
- import type { Notification } from "./Notification";
6
1
  import type { NotificationData } from "./NotificationData";
7
- import type { Person } from "./Person";
8
- import type { PersonActions } from "./PersonActions";
9
- import type { PersonNotification } from "./PersonNotification";
10
- import type { PostActions } from "./PostActions";
11
- import type { TagsView } from "./TagsView";
2
+ import type { NotificationId } from "./NotificationId";
3
+ import type { NotificationTypes } from "./NotificationTypes";
4
+ import type { PersonId } from "./PersonId";
12
5
  export type NotificationView = {
13
- notification: Notification;
14
- person_notification: PersonNotification;
15
- creator: Person;
16
- recipient: Person;
17
- image_details?: ImageDetails;
18
- community_actions?: CommunityActions;
19
- instance_actions?: InstanceActions;
20
- post_actions?: PostActions;
21
- person_actions?: PersonActions;
22
- comment_actions?: CommentActions;
23
- creator_is_admin: boolean;
24
- post_tags: TagsView;
25
- can_mod: boolean;
26
- creator_banned: boolean;
27
- creator_is_moderator: boolean;
28
- creator_banned_from_community: boolean;
6
+ id: NotificationId;
7
+ kind: NotificationTypes;
8
+ recipient_id: PersonId;
9
+ published_at: string;
29
10
  data: NotificationData;
30
11
  };
@@ -1,4 +1,4 @@
1
1
  /**
2
- * Lets you show votes for others only, show all votes, or hide all votes.
2
+ * Available settings for post notifications
3
3
  */
4
4
  export type PostNotificationsMode = "AllComments" | "RepliesAndMentions" | "Mute";
@@ -1,7 +1,7 @@
1
1
  import type { CommunityId } from "./CommunityId";
2
2
  import type { CommunityNotificationsMode } from "./CommunityNotificationsMode";
3
3
  /**
4
- * Disable reply notifications for a post and all comments inside it
4
+ * Change notification settings for a community
5
5
  */
6
6
  export type UpdateCommunityNotifications = {
7
7
  community_id: CommunityId;
@@ -1,7 +1,7 @@
1
1
  import type { PostId } from "./PostId";
2
2
  import type { PostNotificationsMode } from "./PostNotificationsMode";
3
3
  /**
4
- * Disable reply notifications for a post and all comments inside it
4
+ * Change notification settings for a post
5
5
  */
6
6
  export type UpdatePostNotifications = {
7
7
  post_id: PostId;
@@ -4,6 +4,7 @@ import type { Person } from "./Person";
4
4
  */
5
5
  export type VoteView = {
6
6
  creator: Person;
7
+ creator_banned: boolean;
7
8
  creator_banned_from_community: boolean;
8
9
  score: number;
9
10
  };
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": "1.0.0-post-notifications.1",
4
+ "version": "1.0.0-post-notifications.3",
5
5
  "author": "Dessalines",
6
6
  "license": "AGPL-3.0",
7
7
  "main": "./dist/index.js",