lemmy-js-client 1.0.0-post-notifications.0 → 1.0.0-post-notifications.2

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
@@ -60,6 +60,7 @@ export { CommunityFollowerView } from "./types/CommunityFollowerView";
60
60
  export { CommunityId } from "./types/CommunityId";
61
61
  export { CommunityIdQuery } from "./types/CommunityIdQuery";
62
62
  export { CommunityModeratorView } from "./types/CommunityModeratorView";
63
+ export { CommunityNotificationsMode } from "./types/CommunityNotificationsMode";
63
64
  export { CommunityReport } from "./types/CommunityReport";
64
65
  export { CommunityReportId } from "./types/CommunityReportId";
65
66
  export { CommunityReportResponse } from "./types/CommunityReportResponse";
@@ -170,13 +171,13 @@ export { ListCommunityPendingFollows } from "./types/ListCommunityPendingFollows
170
171
  export { ListCommunityPendingFollowsResponse } from "./types/ListCommunityPendingFollowsResponse";
171
172
  export { ListCustomEmojis } from "./types/ListCustomEmojis";
172
173
  export { ListCustomEmojisResponse } from "./types/ListCustomEmojisResponse";
173
- export { ListInbox } from "./types/ListInbox";
174
- export { ListInboxResponse } from "./types/ListInboxResponse";
175
174
  export { ListLoginsResponse } from "./types/ListLoginsResponse";
176
175
  export { ListMedia } from "./types/ListMedia";
177
176
  export { ListMediaResponse } from "./types/ListMediaResponse";
178
177
  export { ListMultiCommunities } from "./types/ListMultiCommunities";
179
178
  export { ListMultiCommunitiesResponse } from "./types/ListMultiCommunitiesResponse";
179
+ export { ListNotifications } from "./types/ListNotifications";
180
+ export { ListNotificationsResponse } from "./types/ListNotificationsResponse";
180
181
  export { ListPersonContent } from "./types/ListPersonContent";
181
182
  export { ListPersonContentResponse } from "./types/ListPersonContentResponse";
182
183
  export { ListPersonHidden } from "./types/ListPersonHidden";
@@ -255,6 +256,8 @@ export { MultiCommunityView } from "./types/MultiCommunityView";
255
256
  export { MyUserInfo } from "./types/MyUserInfo";
256
257
  export { NotePerson } from "./types/NotePerson";
257
258
  export { Notification } from "./types/Notification";
259
+ export { NotificationData } from "./types/NotificationData";
260
+ export { NotificationDataType } from "./types/NotificationDataType";
258
261
  export { NotificationId } from "./types/NotificationId";
259
262
  export { NotificationTypes } from "./types/NotificationTypes";
260
263
  export { NotificationView } from "./types/NotificationView";
@@ -286,6 +289,7 @@ export { PostActions } from "./types/PostActions";
286
289
  export { PostFeatureType } from "./types/PostFeatureType";
287
290
  export { PostId } from "./types/PostId";
288
291
  export { PostListingMode } from "./types/PostListingMode";
292
+ export { PostNotificationsMode } from "./types/PostNotificationsMode";
289
293
  export { PostOrCommentOrPrivateMessage } from "./types/PostOrCommentOrPrivateMessage";
290
294
  export { PostReport } from "./types/PostReport";
291
295
  export { PostReportId } from "./types/PostReportId";
@@ -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,5 @@
1
1
  import type { CommunityFollowerState } from "./CommunityFollowerState";
2
+ import type { CommunityNotificationsMode } from "./CommunityNotificationsMode";
2
3
  export type CommunityActions = {
3
4
  /**
4
5
  * When the community was followed.
@@ -24,4 +25,5 @@ export type CommunityActions = {
24
25
  * When their ban expires.
25
26
  */
26
27
  ban_expires_at?: string;
28
+ notifications?: CommunityNotificationsMode;
27
29
  };
@@ -0,0 +1,4 @@
1
+ /**
2
+ * Available settings for community notifications
3
+ */
4
+ export type CommunityNotificationsMode = "AllPostsAndComments" | "AllPosts" | "RepliesAndMentions" | "Mute";
@@ -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 });
@@ -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
  };
@@ -0,0 +1,10 @@
1
+ import type { CommentView } from "./CommentView";
2
+ import type { PostView } from "./PostView";
3
+ import type { PrivateMessageView } from "./PrivateMessageView";
4
+ export type NotificationData = ({
5
+ type_: "Comment";
6
+ } & CommentView) | ({
7
+ type_: "Post";
8
+ } & PostView) | ({
9
+ type_: "PrivateMessage";
10
+ } & PrivateMessageView);
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -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,36 +1,10 @@
1
- import type { Comment } from "./Comment";
2
- import type { CommentActions } from "./CommentActions";
3
- import type { Community } from "./Community";
4
- import type { CommunityActions } from "./CommunityActions";
5
- import type { ImageDetails } from "./ImageDetails";
6
- import type { InstanceActions } from "./InstanceActions";
7
- import type { Notification } from "./Notification";
8
- import type { Person } from "./Person";
9
- import type { PersonActions } from "./PersonActions";
10
- import type { PersonNotification } from "./PersonNotification";
11
- import type { Post } from "./Post";
12
- import type { PostActions } from "./PostActions";
13
- import type { PrivateMessage } from "./PrivateMessage";
14
- import type { TagsView } from "./TagsView";
1
+ import type { NotificationData } from "./NotificationData";
2
+ import type { NotificationId } from "./NotificationId";
3
+ import type { NotificationTypes } from "./NotificationTypes";
4
+ import type { PersonId } from "./PersonId";
15
5
  export type NotificationView = {
16
- notification: Notification;
17
- person_notification: PersonNotification;
18
- private_message?: PrivateMessage;
19
- comment?: Comment;
20
- post?: Post;
21
- community?: Community;
22
- creator: Person;
23
- recipient: Person;
24
- image_details?: ImageDetails;
25
- community_actions?: CommunityActions;
26
- instance_actions?: InstanceActions;
27
- post_actions?: PostActions;
28
- person_actions?: PersonActions;
29
- comment_actions?: CommentActions;
30
- item_creator_is_admin: boolean;
31
- post_tags: TagsView;
32
- can_mod: boolean;
33
- creator_banned: boolean;
34
- creator_is_moderator: boolean;
35
- creator_banned_from_community: boolean;
6
+ id: NotificationId;
7
+ kind: NotificationTypes;
8
+ recipient_id: PersonId;
9
+ data: NotificationData;
36
10
  };
@@ -1,4 +1,4 @@
1
- import type { NotificationsMode } from "./NotificationsMode";
1
+ import type { PostNotificationsMode } from "./PostNotificationsMode";
2
2
  export type PostActions = {
3
3
  /**
4
4
  * When the post was read.
@@ -29,5 +29,5 @@ export type PostActions = {
29
29
  * When the post was hidden.
30
30
  */
31
31
  hidden_at?: string;
32
- notifications?: NotificationsMode;
32
+ notifications?: PostNotificationsMode;
33
33
  };
@@ -0,0 +1,4 @@
1
+ /**
2
+ * Available settings for post notifications
3
+ */
4
+ export type PostNotificationsMode = "AllComments" | "RepliesAndMentions" | "Mute";
@@ -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,9 +1,9 @@
1
1
  import type { CommunityId } from "./CommunityId";
2
- import type { NotificationsMode } from "./NotificationsMode";
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;
8
- new_state: NotificationsMode;
8
+ mode: CommunityNotificationsMode;
9
9
  };
@@ -1,9 +1,9 @@
1
- import type { NotificationsMode } from "./NotificationsMode";
2
1
  import type { PostId } from "./PostId";
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;
8
- new_state: NotificationsMode;
8
+ mode: PostNotificationsMode;
9
9
  };
@@ -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.0",
4
+ "version": "1.0.0-post-notifications.2",
5
5
  "author": "Dessalines",
6
6
  "license": "AGPL-3.0",
7
7
  "main": "./dist/index.js",