lemmy-js-client 1.0.0-multi-community.4 → 1.0.0-multi-community.8

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 { CommunityIdQueryI, DeleteImageParamsI, GetCommentI, GetCommentsI, GetCommunityI, GetCommunityPendingFollowsCountI, GetModlogI, GetPersonDetailsI, GetPostI, GetPostsI, GetRandomCommunityI, GetRegistrationApplicationI, GetReportCountI, GetSiteMetadataI, ListBannedPersonsI, ListCommentLikesI, ListCommunitiesI, ListCommunityPendingFollowsI, ListCustomEmojisI, ListInboxI, ListMediaI, ListPersonContentI, ListPersonSavedI, ListPostLikesI, ListRegistrationApplicationsI, ListReportsI, ListTaglinesI, ResolveObjectI, SearchI, UploadImage } from "./other_types";
2
+ import { AdminListUsersI, CommunityIdQueryI, DeleteImageParamsI, GetCommentI, GetCommentsI, GetCommunityI, GetCommunityPendingFollowsCountI, GetModlogI, GetPersonDetailsI, GetPostI, GetPostsI, GetRandomCommunityI, GetRegistrationApplicationI, GetReportCountI, GetSiteMetadataI, ListCommentLikesI, ListCommunitiesI, ListCommunityPendingFollowsI, ListCustomEmojisI, ListInboxI, ListMediaI, ListPersonContentI, ListPersonHiddenI, 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";
@@ -10,7 +10,6 @@ import { BanFromCommunityResponse } from "./types/BanFromCommunityResponse";
10
10
  import { MarkManyPostsAsRead } from "./types/MarkManyPostsAsRead";
11
11
  import { BanPerson } from "./types/BanPerson";
12
12
  import { BanPersonResponse } from "./types/BanPersonResponse";
13
- import { BannedPersonsResponse } from "./types/BannedPersonsResponse";
14
13
  import { BlockCommunity } from "./types/BlockCommunity";
15
14
  import { BlockCommunityResponse } from "./types/BlockCommunityResponse";
16
15
  import { BlockPerson } from "./types/BlockPerson";
@@ -137,12 +136,15 @@ import { MarkPersonPostMentionAsRead } from "./types/MarkPersonPostMentionAsRead
137
136
  import { GetCommentsSlimResponse } from "./types/GetCommentsSlimResponse";
138
137
  import { Tag } from "./types/Tag";
139
138
  import { ResendVerificationEmail } from "./types/ResendVerificationEmail";
139
+ import { ListPersonReadResponse } from "./types/ListPersonReadResponse";
140
+ import { ListPersonHiddenResponse } from "./types/ListPersonHiddenResponse";
140
141
  import { CommunityIdQuery } from "./types/CommunityIdQuery";
141
142
  import { CreateMultiCommunity } from "./types/CreateMultiCommunity";
142
143
  import { MultiCommunity } from "./types/MultiCommunity";
143
144
  import { UpdateMultiCommunity } from "./types/UpdateMultiCommunity";
144
145
  import { ListMultiCommunities } from "./types/ListMultiCommunities";
145
146
  import { ListMultiCommunitiesResponse } from "./types/ListMultiCommunitiesResponse";
147
+ import { AdminListUsersResponse } from "./types/AdminListUsersResponse";
146
148
  type RequestOptions = Pick<RequestInit, "signal">;
147
149
  /**
148
150
  * Helps build lemmy HTTP requests.
@@ -495,9 +497,9 @@ export declare class LemmyHttp extends Controller {
495
497
  */
496
498
  banPerson(form: BanPerson, options?: RequestOptions): Promise<BanPersonResponse>;
497
499
  /**
498
- * @summary Get a list of banned users.
500
+ * @summary Get a list of users.
499
501
  */
500
- listBannedPersons(form?: ListBannedPersonsI, options?: RequestOptions): Promise<BannedPersonsResponse>;
502
+ listUsers(form?: AdminListUsersI, options?: RequestOptions): Promise<AdminListUsersResponse>;
501
503
  /**
502
504
  * @summary Block a person.
503
505
  */
@@ -554,6 +556,14 @@ export declare class LemmyHttp extends Controller {
554
556
  * @summary List your saved content.
555
557
  */
556
558
  listPersonSaved(form: ListPersonSavedI, options?: RequestOptions): Promise<ListPersonSavedResponse>;
559
+ /**
560
+ * @summary List your read content.
561
+ */
562
+ listPersonRead(form: ListPersonReadI, options?: RequestOptions): Promise<ListPersonReadResponse>;
563
+ /**
564
+ * @summary List your hidden content.
565
+ */
566
+ listPersonHidden(form: ListPersonHiddenI, options?: RequestOptions): Promise<ListPersonHiddenResponse>;
557
567
  /**
558
568
  * @summary Add an admin to your site.
559
569
  */
package/dist/http.js CHANGED
@@ -551,10 +551,10 @@ let LemmyHttp = class LemmyHttp extends runtime_1.Controller {
551
551
  return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Post, "/admin/ban", form, options);
552
552
  }
553
553
  /**
554
- * @summary Get a list of banned users.
554
+ * @summary Get a list of users.
555
555
  */
556
- async listBannedPersons(form = {}, options) {
557
- return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Get, "/admin/banned", form, options);
556
+ async listUsers(form = {}, options) {
557
+ return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Get, "/admin/users", form, options);
558
558
  }
559
559
  /**
560
560
  * @summary Block a person.
@@ -640,6 +640,18 @@ let LemmyHttp = class LemmyHttp extends runtime_1.Controller {
640
640
  async listPersonSaved(form, options) {
641
641
  return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Get, "/account/saved", form, options);
642
642
  }
643
+ /**
644
+ * @summary List your read content.
645
+ */
646
+ async listPersonRead(form, options) {
647
+ return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Get, "/account/read", form, options);
648
+ }
649
+ /**
650
+ * @summary List your hidden content.
651
+ */
652
+ async listPersonHidden(form, options) {
653
+ return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Get, "/account/hidden", form, options);
654
+ }
643
655
  /**
644
656
  * @summary Add an admin to your site.
645
657
  */
@@ -1550,11 +1562,11 @@ __decorate([
1550
1562
  ], LemmyHttp.prototype, "banPerson", null);
1551
1563
  __decorate([
1552
1564
  (0, runtime_1.Security)("bearerAuth"),
1553
- (0, runtime_1.Get)("/admin/banned"),
1565
+ (0, runtime_1.Get)("/admin/users"),
1554
1566
  (0, runtime_1.Tags)("Admin", "Miscellaneous"),
1555
1567
  __param(0, (0, runtime_1.Queries)()),
1556
1568
  __param(1, (0, runtime_1.Inject)())
1557
- ], LemmyHttp.prototype, "listBannedPersons", null);
1569
+ ], LemmyHttp.prototype, "listUsers", null);
1558
1570
  __decorate([
1559
1571
  (0, runtime_1.Security)("bearerAuth"),
1560
1572
  (0, runtime_1.Post)("/account/block/person"),
@@ -1647,6 +1659,20 @@ __decorate([
1647
1659
  __param(0, (0, runtime_1.Queries)()),
1648
1660
  __param(1, (0, runtime_1.Inject)())
1649
1661
  ], LemmyHttp.prototype, "listPersonSaved", null);
1662
+ __decorate([
1663
+ (0, runtime_1.Security)("bearerAuth"),
1664
+ (0, runtime_1.Get)("/account/read"),
1665
+ (0, runtime_1.Tags)("Account"),
1666
+ __param(0, (0, runtime_1.Queries)()),
1667
+ __param(1, (0, runtime_1.Inject)())
1668
+ ], LemmyHttp.prototype, "listPersonRead", null);
1669
+ __decorate([
1670
+ (0, runtime_1.Security)("bearerAuth"),
1671
+ (0, runtime_1.Get)("/account/hidden"),
1672
+ (0, runtime_1.Tags)("Account"),
1673
+ __param(0, (0, runtime_1.Queries)()),
1674
+ __param(1, (0, runtime_1.Inject)())
1675
+ ], LemmyHttp.prototype, "listPersonHidden", null);
1650
1676
  __decorate([
1651
1677
  (0, runtime_1.Security)("bearerAuth"),
1652
1678
  (0, runtime_1.Post)("/admin/add"),
package/dist/index.d.ts CHANGED
@@ -13,6 +13,8 @@ export { AdminBlockInstance } from "./types/AdminBlockInstance";
13
13
  export { AdminBlockInstanceId } from "./types/AdminBlockInstanceId";
14
14
  export { AdminBlockInstanceParams } from "./types/AdminBlockInstanceParams";
15
15
  export { AdminBlockInstanceView } from "./types/AdminBlockInstanceView";
16
+ export { AdminListUsers } from "./types/AdminListUsers";
17
+ export { AdminListUsersResponse } from "./types/AdminListUsersResponse";
16
18
  export { AdminPurgeComment } from "./types/AdminPurgeComment";
17
19
  export { AdminPurgeCommentId } from "./types/AdminPurgeCommentId";
18
20
  export { AdminPurgeCommentView } from "./types/AdminPurgeCommentView";
@@ -32,7 +34,6 @@ export { BanFromCommunity } from "./types/BanFromCommunity";
32
34
  export { BanFromCommunityResponse } from "./types/BanFromCommunityResponse";
33
35
  export { BanPerson } from "./types/BanPerson";
34
36
  export { BanPersonResponse } from "./types/BanPersonResponse";
35
- export { BannedPersonsResponse } from "./types/BannedPersonsResponse";
36
37
  export { BlockCommunity } from "./types/BlockCommunity";
37
38
  export { BlockCommunityResponse } from "./types/BlockCommunityResponse";
38
39
  export { BlockPerson } from "./types/BlockPerson";
@@ -156,7 +157,6 @@ export { Language } from "./types/Language";
156
157
  export { LanguageId } from "./types/LanguageId";
157
158
  export { LemmyErrorType } from "./types/LemmyErrorType";
158
159
  export { LinkMetadata } from "./types/LinkMetadata";
159
- export { ListBannedPersons } from "./types/ListBannedPersons";
160
160
  export { ListCommentLikes } from "./types/ListCommentLikes";
161
161
  export { ListCommentLikesResponse } from "./types/ListCommentLikesResponse";
162
162
  export { ListCommunities } from "./types/ListCommunities";
@@ -172,6 +172,10 @@ export { ListMedia } from "./types/ListMedia";
172
172
  export { ListMediaResponse } from "./types/ListMediaResponse";
173
173
  export { ListPersonContent } from "./types/ListPersonContent";
174
174
  export { ListPersonContentResponse } from "./types/ListPersonContentResponse";
175
+ export { ListPersonHidden } from "./types/ListPersonHidden";
176
+ export { ListPersonHiddenResponse } from "./types/ListPersonHiddenResponse";
177
+ export { ListPersonRead } from "./types/ListPersonRead";
178
+ export { ListPersonReadResponse } from "./types/ListPersonReadResponse";
175
179
  export { ListPersonSaved } from "./types/ListPersonSaved";
176
180
  export { ListPersonSavedResponse } from "./types/ListPersonSavedResponse";
177
181
  export { ListPostLikes } from "./types/ListPostLikes";
@@ -332,6 +336,7 @@ export { UpdateTotpResponse } from "./types/UpdateTotpResponse";
332
336
  export { UploadImageResponse } from "./types/UploadImageResponse";
333
337
  export { UserBlockInstanceParams } from "./types/UserBlockInstanceParams";
334
338
  export { VerifyEmail } from "./types/VerifyEmail";
339
+ export { VoteShow } from "./types/VoteShow";
335
340
  export { VoteView } from "./types/VoteView";
336
341
  export { CreateMultiCommunity } from "./types/CreateMultiCommunity";
337
342
  export { UpdateMultiCommunity } from "./types/UpdateMultiCommunity";
@@ -1,3 +1,4 @@
1
+ import { AdminListUsers } from "./types/AdminListUsers";
1
2
  import { CommunityIdQuery } from "./types/CommunityIdQuery";
2
3
  import { DeleteImageParams } from "./types/DeleteImageParams";
3
4
  import { GetComment } from "./types/GetComment";
@@ -12,7 +13,6 @@ import { GetRandomCommunity } from "./types/GetRandomCommunity";
12
13
  import { GetRegistrationApplication } from "./types/GetRegistrationApplication";
13
14
  import { GetReportCount } from "./types/GetReportCount";
14
15
  import { GetSiteMetadata } from "./types/GetSiteMetadata";
15
- import { ListBannedPersons } from "./types/ListBannedPersons";
16
16
  import { ListCommentLikes } from "./types/ListCommentLikes";
17
17
  import { ListCommunities } from "./types/ListCommunities";
18
18
  import { ListCommunityPendingFollows } from "./types/ListCommunityPendingFollows";
@@ -20,6 +20,8 @@ import { ListCustomEmojis } from "./types/ListCustomEmojis";
20
20
  import { ListInbox } from "./types/ListInbox";
21
21
  import { ListMedia } from "./types/ListMedia";
22
22
  import { ListPersonContent } from "./types/ListPersonContent";
23
+ import { ListPersonHidden } from "./types/ListPersonHidden";
24
+ import { ListPersonRead } from "./types/ListPersonRead";
23
25
  import { ListPersonSaved } from "./types/ListPersonSaved";
24
26
  import { ListPostLikes } from "./types/ListPostLikes";
25
27
  import { ListRegistrationApplications } from "./types/ListRegistrationApplications";
@@ -73,6 +75,10 @@ export interface ListInboxI extends ListInbox {
73
75
  }
74
76
  export interface ListPersonSavedI extends ListPersonSaved {
75
77
  }
78
+ export interface ListPersonReadI extends ListPersonRead {
79
+ }
80
+ export interface ListPersonHiddenI extends ListPersonHidden {
81
+ }
76
82
  export interface ListRegistrationApplicationsI extends ListRegistrationApplications {
77
83
  }
78
84
  export interface GetRegistrationApplicationI extends GetRegistrationApplication {
@@ -85,7 +91,7 @@ export interface ListReportsI extends ListReports {
85
91
  }
86
92
  export interface DeleteImageParamsI extends DeleteImageParams {
87
93
  }
88
- export interface ListBannedPersonsI extends ListBannedPersons {
94
+ export interface AdminListUsersI extends AdminListUsers {
89
95
  }
90
96
  export interface CommunityIdQueryI extends CommunityIdQuery {
91
97
  }
@@ -0,0 +1,7 @@
1
+ import type { PaginationCursor } from "./PaginationCursor";
2
+ export type AdminListUsers = {
3
+ banned_only?: boolean;
4
+ page_cursor?: PaginationCursor;
5
+ page_back?: boolean;
6
+ limit?: number;
7
+ };
@@ -0,0 +1,10 @@
1
+ import type { LocalUserView } from "./LocalUserView";
2
+ import type { PaginationCursor } from "./PaginationCursor";
3
+ export type AdminListUsersResponse = {
4
+ users: Array<LocalUserView>;
5
+ /**
6
+ * the pagination cursor to use to fetch the next page
7
+ */
8
+ next_page?: PaginationCursor;
9
+ prev_page?: PaginationCursor;
10
+ };
@@ -42,4 +42,5 @@ export type GetPosts = {
42
42
  page_cursor?: PaginationCursor;
43
43
  page_back?: boolean;
44
44
  limit?: number;
45
+ multi_community_id?: number;
45
46
  };
@@ -1,6 +1,7 @@
1
1
  import type { InstanceId } from "./InstanceId";
2
2
  /**
3
- * A federated instance / site.
3
+ * Basic data about a Fediverse instance which is available for every known domain. Additional
4
+ * data may be available in [[Site]].
4
5
  */
5
6
  export type Instance = {
6
7
  id: InstanceId;
@@ -1,8 +1,8 @@
1
1
  import type { PaginationCursor } from "./PaginationCursor";
2
2
  /**
3
- * List the banned persons.
3
+ * Gets your hidden posts.
4
4
  */
5
- export type ListBannedPersons = {
5
+ export type ListPersonHidden = {
6
6
  page_cursor?: PaginationCursor;
7
7
  page_back?: boolean;
8
8
  limit?: number;
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,10 +1,10 @@
1
1
  import type { PaginationCursor } from "./PaginationCursor";
2
- import type { PersonView } from "./PersonView";
2
+ import type { PostView } from "./PostView";
3
3
  /**
4
- * The list of banned persons.
4
+ * You hidden posts response.
5
5
  */
6
- export type BannedPersonsResponse = {
7
- banned: Array<PersonView>;
6
+ export type ListPersonHiddenResponse = {
7
+ hidden: Array<PostView>;
8
8
  /**
9
9
  * the pagination cursor to use to fetch the next page
10
10
  */
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,9 @@
1
+ import type { PaginationCursor } from "./PaginationCursor";
2
+ /**
3
+ * Gets your read posts.
4
+ */
5
+ export type ListPersonRead = {
6
+ page_cursor?: PaginationCursor;
7
+ page_back?: boolean;
8
+ limit?: number;
9
+ };
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,13 @@
1
+ import type { PaginationCursor } from "./PaginationCursor";
2
+ import type { PostView } from "./PostView";
3
+ /**
4
+ * You read posts response.
5
+ */
6
+ export type ListPersonReadResponse = {
7
+ read: Array<PostView>;
8
+ /**
9
+ * the pagination cursor to use to fetch the next page
10
+ */
11
+ next_page?: PaginationCursor;
12
+ prev_page?: PaginationCursor;
13
+ };
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -5,6 +5,7 @@ import type { PersonId } from "./PersonId";
5
5
  import type { PostListingMode } from "./PostListingMode";
6
6
  import type { PostSortType } from "./PostSortType";
7
7
  import type { SensitiveString } from "./SensitiveString";
8
+ import type { VoteShow } from "./VoteShow";
8
9
  /**
9
10
  * A local user.
10
11
  */
@@ -99,6 +100,6 @@ export type LocalUser = {
99
100
  default_post_time_range_seconds?: number;
100
101
  show_score: boolean;
101
102
  show_upvotes: boolean;
102
- show_downvotes: boolean;
103
+ show_downvotes: VoteShow;
103
104
  show_upvote_percentage: boolean;
104
105
  };
@@ -5,4 +5,5 @@ import type { PostId } from "./PostId";
5
5
  export type LockPost = {
6
6
  post_id: PostId;
7
7
  locked: boolean;
8
+ reason?: string;
8
9
  };
@@ -1,6 +1,9 @@
1
1
  import type { SensitiveString } from "./SensitiveString";
2
2
  /**
3
3
  * Logging into lemmy.
4
+ *
5
+ * Note: Banned users can still log in, to be able to do certain things like delete
6
+ * their account.
4
7
  */
5
8
  export type Login = {
6
9
  username_or_email: SensitiveString;
@@ -10,4 +10,5 @@ export type ModLockPost = {
10
10
  post_id: PostId;
11
11
  locked: boolean;
12
12
  published: string;
13
+ reason?: string;
13
14
  };
@@ -4,6 +4,7 @@ import type { ListingType } from "./ListingType";
4
4
  import type { PostListingMode } from "./PostListingMode";
5
5
  import type { PostSortType } from "./PostSortType";
6
6
  import type { SensitiveString } from "./SensitiveString";
7
+ import type { VoteShow } from "./VoteShow";
7
8
  /**
8
9
  * Saves settings for your user.
9
10
  */
@@ -115,7 +116,7 @@ export type SaveUserSettings = {
115
116
  */
116
117
  show_scores?: boolean;
117
118
  show_upvotes?: boolean;
118
- show_downvotes?: boolean;
119
+ show_downvotes?: VoteShow;
119
120
  show_upvote_percentage?: boolean;
120
121
  /**
121
122
  * Whether to automatically mark fetched posts as read.
@@ -2,7 +2,8 @@ import type { DbUrl } from "./DbUrl";
2
2
  import type { InstanceId } from "./InstanceId";
3
3
  import type { SiteId } from "./SiteId";
4
4
  /**
5
- * The site.
5
+ * Additional data for federated instances. This may be missing for other platforms which are not
6
+ * fully compatible. Basic data is guaranteed to be available via [[Instance]].
6
7
  */
7
8
  export type Site = {
8
9
  id: SiteId;
@@ -0,0 +1,4 @@
1
+ /**
2
+ * Lets you show votes for others only, show all votes, or hide all votes.
3
+ */
4
+ export type VoteShow = "Show" | "ShowForOthers" | "Hide";
@@ -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 });
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-multi-community.4",
4
+ "version": "1.0.0-multi-community.8",
5
5
  "author": "Dessalines",
6
6
  "license": "AGPL-3.0",
7
7
  "main": "./dist/index.js",
@@ -25,13 +25,13 @@
25
25
  "devDependencies": {
26
26
  "@eslint/js": "^9.20.0",
27
27
  "@redocly/cli": "^1.27.2",
28
- "@types/joi": "^17.2.3",
29
28
  "@types/node": "^22.7.4",
30
29
  "@typescript-eslint/eslint-plugin": "^8.7.0",
31
30
  "@typescript-eslint/parser": "^8.7.0",
32
31
  "eslint": "^9.11.1",
33
32
  "eslint-plugin-prettier": "^5.2.1",
34
33
  "husky": "^9.1.4",
34
+ "joi": "^17.13.3",
35
35
  "lint-staged": "^16.0.0",
36
36
  "prettier": "^3.3.3",
37
37
  "prettier-plugin-import-sort": "^0.0.7",
@@ -43,7 +43,7 @@
43
43
  "typescript": "^5.5.4",
44
44
  "typescript-eslint": "^8.7.0"
45
45
  },
46
- "packageManager": "pnpm@10.10.0",
46
+ "packageManager": "pnpm@10.11.0",
47
47
  "types": "./dist/index.d.ts",
48
48
  "lint-staged": {
49
49
  "*.{ts,tsx,js}": [