lemmy-js-client 1.0.0-alpha.0 → 1.0.0-alpha.1

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.
Files changed (80) hide show
  1. package/dist/http.d.ts +26 -6
  2. package/dist/http.js +262 -237
  3. package/dist/index.d.ts +5 -1
  4. package/dist/types/BannedPersonsResponse.d.ts +1 -0
  5. package/dist/types/Comment.d.ts +5 -0
  6. package/dist/types/CommentReplyView.d.ts +5 -0
  7. package/dist/types/CommentSlimView.d.ts +3 -0
  8. package/dist/types/CommentView.d.ts +5 -0
  9. package/dist/types/Community.d.ts +1 -0
  10. package/dist/types/CommunityView.d.ts +2 -0
  11. package/dist/types/CreateCommunityTag.d.ts +8 -0
  12. package/dist/types/CreateCommunityTag.js +2 -0
  13. package/dist/types/CreateSite.d.ts +1 -1
  14. package/dist/types/DeleteCommunityTag.d.ts +7 -0
  15. package/dist/types/DeleteCommunityTag.js +2 -0
  16. package/dist/types/EditPost.d.ts +1 -1
  17. package/dist/types/EditSite.d.ts +4 -5
  18. package/dist/types/GetComments.d.ts +3 -1
  19. package/dist/types/GetCommentsResponse.d.ts +3 -0
  20. package/dist/types/GetCommentsSlimResponse.d.ts +3 -0
  21. package/dist/types/GetModlog.d.ts +1 -0
  22. package/dist/types/GetModlogResponse.d.ts +1 -0
  23. package/dist/types/GetPosts.d.ts +3 -9
  24. package/dist/types/GetPostsResponse.d.ts +3 -2
  25. package/dist/types/GetSiteResponse.d.ts +2 -0
  26. package/dist/types/InstanceActions.d.ts +8 -0
  27. package/dist/types/LemmyErrorType.d.ts +91 -22
  28. package/dist/types/ListCommentLikes.d.ts +3 -1
  29. package/dist/types/ListCommentLikesResponse.d.ts +6 -0
  30. package/dist/types/ListCommunities.d.ts +3 -1
  31. package/dist/types/ListCommunitiesResponse.d.ts +6 -0
  32. package/dist/types/ListCommunityPendingFollows.d.ts +3 -1
  33. package/dist/types/ListCommunityPendingFollows.js +0 -1
  34. package/dist/types/ListCommunityPendingFollowsResponse.d.ts +6 -0
  35. package/dist/types/ListCustomEmojis.d.ts +0 -3
  36. package/dist/types/ListInbox.d.ts +1 -0
  37. package/dist/types/ListInboxResponse.d.ts +1 -0
  38. package/dist/types/ListMedia.d.ts +3 -1
  39. package/dist/types/ListMedia.js +0 -1
  40. package/dist/types/ListMediaResponse.d.ts +6 -0
  41. package/dist/types/ListPersonContent.d.ts +1 -0
  42. package/dist/types/ListPersonContentResponse.d.ts +1 -0
  43. package/dist/types/ListPersonSaved.d.ts +1 -0
  44. package/dist/types/ListPersonSavedResponse.d.ts +1 -0
  45. package/dist/types/ListPostLikes.d.ts +3 -1
  46. package/dist/types/ListPostLikesResponse.d.ts +6 -0
  47. package/dist/types/ListRegistrationApplications.d.ts +3 -1
  48. package/dist/types/ListRegistrationApplications.js +0 -1
  49. package/dist/types/ListRegistrationApplicationsResponse.d.ts +6 -0
  50. package/dist/types/ListReports.d.ts +1 -0
  51. package/dist/types/ListReportsResponse.d.ts +1 -0
  52. package/dist/types/ListTaglines.d.ts +3 -1
  53. package/dist/types/ListTaglines.js +0 -1
  54. package/dist/types/ListTaglinesResponse.d.ts +6 -0
  55. package/dist/types/LocalSite.d.ts +4 -5
  56. package/dist/types/LocalUserView.d.ts +2 -0
  57. package/dist/types/ModBan.d.ts +2 -0
  58. package/dist/types/MyUserInfo.d.ts +1 -0
  59. package/dist/types/Person.d.ts +0 -8
  60. package/dist/types/PersonCommentMentionView.d.ts +3 -0
  61. package/dist/types/PersonPostMentionView.d.ts +5 -0
  62. package/dist/types/PersonView.d.ts +4 -0
  63. package/dist/types/PluginMetadata.d.ts +5 -0
  64. package/dist/types/Post.d.ts +5 -0
  65. package/dist/types/PostView.d.ts +5 -0
  66. package/dist/types/SaveUserSettings.d.ts +1 -0
  67. package/dist/types/Search.d.ts +1 -0
  68. package/dist/types/SearchResponse.d.ts +1 -0
  69. package/dist/types/SiteView.d.ts +2 -0
  70. package/dist/types/Tag.d.ts +8 -6
  71. package/dist/types/Tagline.d.ts +2 -1
  72. package/dist/types/Tagline.js +0 -1
  73. package/dist/types/TagsView.d.ts +5 -0
  74. package/dist/types/TagsView.js +2 -0
  75. package/dist/types/UpdateCommunityTag.d.ts +8 -0
  76. package/dist/types/UpdateCommunityTag.js +2 -0
  77. package/dist/types/VoteView.d.ts +1 -0
  78. package/package.json +2 -2
  79. package/dist/types/PostPaginationCursor.d.ts +0 -7
  80. /package/dist/types/{PostPaginationCursor.js → PluginMetadata.js} +0 -0
@@ -15,4 +15,5 @@ export type ListPersonContent = {
15
15
  username?: string;
16
16
  page_cursor?: PaginationCursor;
17
17
  page_back?: boolean;
18
+ limit?: number;
18
19
  };
@@ -9,4 +9,5 @@ export type ListPersonContentResponse = {
9
9
  * the pagination cursor to use to fetch the next page
10
10
  */
11
11
  next_page?: PaginationCursor;
12
+ prev_page?: PaginationCursor;
12
13
  };
@@ -7,4 +7,5 @@ export type ListPersonSaved = {
7
7
  type_?: PersonContentType;
8
8
  page_cursor?: PaginationCursor;
9
9
  page_back?: boolean;
10
+ limit?: number;
10
11
  };
@@ -9,4 +9,5 @@ export type ListPersonSavedResponse = {
9
9
  * the pagination cursor to use to fetch the next page
10
10
  */
11
11
  next_page?: PaginationCursor;
12
+ prev_page?: PaginationCursor;
12
13
  };
@@ -1,9 +1,11 @@
1
+ import type { PaginationCursor } from "./PaginationCursor";
1
2
  import type { PostId } from "./PostId";
2
3
  /**
3
4
  * List post likes. Admins-only.
4
5
  */
5
6
  export type ListPostLikes = {
6
7
  post_id: PostId;
7
- page?: number;
8
+ page_cursor?: PaginationCursor;
9
+ page_back?: boolean;
8
10
  limit?: number;
9
11
  };
@@ -1,7 +1,13 @@
1
+ import type { PaginationCursor } from "./PaginationCursor";
1
2
  import type { VoteView } from "./VoteView";
2
3
  /**
3
4
  * The post likes response
4
5
  */
5
6
  export type ListPostLikesResponse = {
6
7
  post_likes: Array<VoteView>;
8
+ /**
9
+ * the pagination cursor to use to fetch the next page
10
+ */
11
+ next_page?: PaginationCursor;
12
+ prev_page?: PaginationCursor;
7
13
  };
@@ -1,3 +1,4 @@
1
+ import type { PaginationCursor } from "./PaginationCursor";
1
2
  /**
2
3
  * Fetches a list of registration applications.
3
4
  */
@@ -6,6 +7,7 @@ export type ListRegistrationApplications = {
6
7
  * Only shows the unread applications (IE those without an admin actor)
7
8
  */
8
9
  unread_only?: boolean;
9
- page?: number;
10
+ page_cursor?: PaginationCursor;
11
+ page_back?: boolean;
10
12
  limit?: number;
11
13
  };
@@ -1,3 +1,2 @@
1
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
2
  Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,7 +1,13 @@
1
+ import type { PaginationCursor } from "./PaginationCursor";
1
2
  import type { RegistrationApplicationView } from "./RegistrationApplicationView";
2
3
  /**
3
4
  * The list of registration applications.
4
5
  */
5
6
  export type ListRegistrationApplicationsResponse = {
6
7
  registration_applications: Array<RegistrationApplicationView>;
8
+ /**
9
+ * the pagination cursor to use to fetch the next page
10
+ */
11
+ next_page?: PaginationCursor;
12
+ prev_page?: PaginationCursor;
7
13
  };
@@ -24,6 +24,7 @@ export type ListReports = {
24
24
  community_id?: CommunityId;
25
25
  page_cursor?: PaginationCursor;
26
26
  page_back?: boolean;
27
+ limit?: number;
27
28
  /**
28
29
  * Only for admins: also show reports with `violates_instance_rules=false`
29
30
  */
@@ -9,4 +9,5 @@ export type ListReportsResponse = {
9
9
  * the pagination cursor to use to fetch the next page
10
10
  */
11
11
  next_page?: PaginationCursor;
12
+ prev_page?: PaginationCursor;
12
13
  };
@@ -1,7 +1,9 @@
1
+ import type { PaginationCursor } from "./PaginationCursor";
1
2
  /**
2
3
  * Fetches a list of taglines.
3
4
  */
4
5
  export type ListTaglines = {
5
- page?: number;
6
+ page_cursor?: PaginationCursor;
7
+ page_back?: boolean;
6
8
  limit?: number;
7
9
  };
@@ -1,3 +1,2 @@
1
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
2
  Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,7 +1,13 @@
1
+ import type { PaginationCursor } from "./PaginationCursor";
1
2
  import type { Tagline } from "./Tagline";
2
3
  /**
3
4
  * A response for taglines.
4
5
  */
5
6
  export type ListTaglinesResponse = {
6
7
  taglines: Array<Tagline>;
8
+ /**
9
+ * the pagination cursor to use to fetch the next page
10
+ */
11
+ next_page?: PaginationCursor;
12
+ prev_page?: PaginationCursor;
7
13
  };
@@ -113,11 +113,6 @@ export type LocalSite = {
113
113
  * What kind of comment downvotes your site allows.
114
114
  */
115
115
  comment_downvotes: FederationMode;
116
- /**
117
- * If this is true, users will never see the dialog asking to support Lemmy development with
118
- * donations.
119
- */
120
- disable_donation_dialog: boolean;
121
116
  /**
122
117
  * A default time range limit to apply to post sorts, in seconds.
123
118
  */
@@ -146,4 +141,8 @@ export type LocalSite = {
146
141
  * The number of users with any activity in the last half year.
147
142
  */
148
143
  users_active_half_year: number;
144
+ /**
145
+ * Dont send email notifications to users for new replies, mentions etc
146
+ */
147
+ disable_email_notifications: boolean;
149
148
  };
@@ -1,3 +1,4 @@
1
+ import type { InstanceActions } from "./InstanceActions";
1
2
  import type { LocalUser } from "./LocalUser";
2
3
  import type { Person } from "./Person";
3
4
  /**
@@ -6,4 +7,5 @@ import type { Person } from "./Person";
6
7
  export type LocalUserView = {
7
8
  local_user: LocalUser;
8
9
  person: Person;
10
+ instance_actions?: InstanceActions;
9
11
  };
@@ -1,3 +1,4 @@
1
+ import type { InstanceId } from "./InstanceId";
1
2
  import type { ModBanId } from "./ModBanId";
2
3
  import type { PersonId } from "./PersonId";
3
4
  /**
@@ -11,4 +12,5 @@ export type ModBan = {
11
12
  banned: boolean;
12
13
  expires?: string;
13
14
  published: string;
15
+ instance_id: InstanceId;
14
16
  };
@@ -15,5 +15,6 @@ export type MyUserInfo = {
15
15
  community_blocks: Array<Community>;
16
16
  instance_blocks: Array<Instance>;
17
17
  person_blocks: Array<Person>;
18
+ keyword_blocks: Array<string>;
18
19
  discussion_languages: Array<LanguageId>;
19
20
  };
@@ -15,10 +15,6 @@ export type Person = {
15
15
  * A URL for an avatar.
16
16
  */
17
17
  avatar?: DbUrl;
18
- /**
19
- * Whether the person is banned.
20
- */
21
- banned: boolean;
22
18
  published: string;
23
19
  updated?: string;
24
20
  /**
@@ -49,10 +45,6 @@ export type Person = {
49
45
  * Whether the person is a bot account.
50
46
  */
51
47
  bot_account: boolean;
52
- /**
53
- * When their ban, if it exists, expires, if at all.
54
- */
55
- ban_expires?: string;
56
48
  instance_id: InstanceId;
57
49
  post_count: number;
58
50
  comment_count: number;
@@ -21,7 +21,10 @@ export type PersonCommentMentionView = {
21
21
  comment_actions?: CommentActions;
22
22
  person_actions?: PersonActions;
23
23
  instance_actions?: InstanceActions;
24
+ creator_home_instance_actions?: InstanceActions;
25
+ creator_local_instance_actions?: InstanceActions;
24
26
  creator_community_actions?: CommunityActions;
25
27
  creator_is_admin: boolean;
26
28
  can_mod: boolean;
29
+ creator_banned: boolean;
27
30
  };
@@ -7,6 +7,7 @@ import type { PersonActions } from "./PersonActions";
7
7
  import type { PersonPostMention } from "./PersonPostMention";
8
8
  import type { Post } from "./Post";
9
9
  import type { PostActions } from "./PostActions";
10
+ import type { TagsView } from "./TagsView";
10
11
  /**
11
12
  * A person post mention view.
12
13
  */
@@ -21,7 +22,11 @@ export type PersonPostMentionView = {
21
22
  person_actions?: PersonActions;
22
23
  post_actions?: PostActions;
23
24
  instance_actions?: InstanceActions;
25
+ creator_home_instance_actions?: InstanceActions;
26
+ creator_local_instance_actions?: InstanceActions;
24
27
  creator_community_actions?: CommunityActions;
28
+ post_tags: TagsView;
25
29
  creator_is_admin: boolean;
26
30
  can_mod: boolean;
31
+ creator_banned: boolean;
27
32
  };
@@ -1,3 +1,4 @@
1
+ import type { InstanceActions } from "./InstanceActions";
1
2
  import type { Person } from "./Person";
2
3
  /**
3
4
  * A person view.
@@ -5,4 +6,7 @@ import type { Person } from "./Person";
5
6
  export type PersonView = {
6
7
  person: Person;
7
8
  is_admin: boolean;
9
+ home_instance_actions?: InstanceActions;
10
+ local_instance_actions?: InstanceActions;
11
+ creator_banned: boolean;
8
12
  };
@@ -0,0 +1,5 @@
1
+ export type PluginMetadata = {
2
+ name: string;
3
+ url: string;
4
+ description: string;
5
+ };
@@ -89,4 +89,9 @@ export type Post = {
89
89
  newest_comment_time: string;
90
90
  report_count: number;
91
91
  unresolved_report_count: number;
92
+ /**
93
+ * If a local user posts in a remote community, the comment is hidden until it is confirmed
94
+ * accepted by the community (by receiving it back via federation).
95
+ */
96
+ federation_pending: boolean;
92
97
  };
@@ -6,6 +6,7 @@ import type { Person } from "./Person";
6
6
  import type { PersonActions } from "./PersonActions";
7
7
  import type { Post } from "./Post";
8
8
  import type { PostActions } from "./PostActions";
9
+ import type { TagsView } from "./TagsView";
9
10
  /**
10
11
  * A post view.
11
12
  */
@@ -18,7 +19,11 @@ export type PostView = {
18
19
  person_actions?: PersonActions;
19
20
  post_actions?: PostActions;
20
21
  instance_actions?: InstanceActions;
22
+ creator_home_instance_actions?: InstanceActions;
23
+ creator_local_instance_actions?: InstanceActions;
21
24
  creator_community_actions?: CommunityActions;
22
25
  creator_is_admin: boolean;
26
+ tags: TagsView;
23
27
  can_mod: boolean;
28
+ creator_banned: boolean;
24
29
  };
@@ -84,6 +84,7 @@ export type SaveUserSettings = {
84
84
  * A list of languages you are able to see discussion in.
85
85
  */
86
86
  discussion_languages?: Array<LanguageId>;
87
+ blocking_keywords?: Array<string>;
87
88
  /**
88
89
  * Open links in a new tab
89
90
  */
@@ -26,4 +26,5 @@ export type Search = {
26
26
  disliked_only?: boolean;
27
27
  page_cursor?: PaginationCursor;
28
28
  page_back?: boolean;
29
+ limit?: number;
29
30
  };
@@ -9,4 +9,5 @@ export type SearchResponse = {
9
9
  * the pagination cursor to use to fetch the next page
10
10
  */
11
11
  next_page?: PaginationCursor;
12
+ prev_page?: PaginationCursor;
12
13
  };
@@ -1,3 +1,4 @@
1
+ import type { Instance } from "./Instance";
1
2
  import type { LocalSite } from "./LocalSite";
2
3
  import type { LocalSiteRateLimit } from "./LocalSiteRateLimit";
3
4
  import type { Site } from "./Site";
@@ -8,4 +9,5 @@ export type SiteView = {
8
9
  site: Site;
9
10
  local_site: LocalSite;
10
11
  local_site_rate_limit: LocalSiteRateLimit;
12
+ instance: Instance;
11
13
  };
@@ -7,16 +7,18 @@ import type { TagId } from "./TagId";
7
7
  * The assignment happens by the post creator and can be updated by the community moderators.
8
8
  *
9
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.
10
+ * displayed and filtered on. Currently, we only have community post tags, which is a tag that is
11
+ * created by the mods of a community, then assigned to posts by post authors as well as mods of a
12
+ * community, to categorize a post.
13
+ *
14
+ * In the future we may add more tag types, depending on the requirements, this will lead to either
15
+ * expansion of this table (community_id optional, addition of tag_type enum) or split of this
16
+ * table / creation of new tables.
15
17
  */
16
18
  export type Tag = {
17
19
  id: TagId;
18
20
  ap_id: DbUrl;
19
- name: string;
21
+ display_name: string;
20
22
  /**
21
23
  * the community that owns this tag
22
24
  */
@@ -1,8 +1,9 @@
1
+ import type { TaglineId } from "./TaglineId";
1
2
  /**
2
3
  * A tagline, shown at the top of your site.
3
4
  */
4
5
  export type Tagline = {
5
- id: number;
6
+ id: TaglineId;
6
7
  content: string;
7
8
  published: string;
8
9
  updated?: string;
@@ -1,3 +1,2 @@
1
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
2
  Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,5 @@
1
+ import type { Tag } from "./Tag";
2
+ /**
3
+ * we wrap this in a struct so we can implement FromSqlRow<Json> for it
4
+ */
5
+ export type TagsView = Array<Tag>;
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,8 @@
1
+ import type { TagId } from "./TagId";
2
+ /**
3
+ * Update a community tag.
4
+ */
5
+ export type UpdateCommunityTag = {
6
+ tag_id: TagId;
7
+ display_name: string;
8
+ };
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -4,6 +4,7 @@ import type { Person } from "./Person";
4
4
  */
5
5
  export type VoteView = {
6
6
  creator: Person;
7
+ item_id: number;
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-alpha.0",
4
+ "version": "1.0.0-alpha.1",
5
5
  "author": "Dessalines",
6
6
  "license": "AGPL-3.0",
7
7
  "main": "./dist/index.js",
@@ -43,7 +43,7 @@
43
43
  "typescript": "^5.5.4",
44
44
  "typescript-eslint": "^8.7.0"
45
45
  },
46
- "packageManager": "pnpm@10.7.0",
46
+ "packageManager": "pnpm@10.8.0",
47
47
  "types": "./dist/index.d.ts",
48
48
  "lint-staged": {
49
49
  "*.{ts,tsx,js}": [
@@ -1,7 +0,0 @@
1
- /**
2
- * currently this is just a wrapper around post id, but should be seen as opaque from the client's
3
- * perspective. stringified since we might want to use arbitrary info later, with a P prepended to
4
- * prevent ossification (api users love to make assumptions (e.g. parse stuff that looks like
5
- * numbers as numbers) about apis that aren't part of the spec
6
- */
7
- export type PostPaginationCursor = string;