lemmy-js-client 0.19.0-rc.2 → 0.19.0-rc.5

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
@@ -130,6 +130,8 @@ import { SiteResponse } from "./types/SiteResponse";
130
130
  import { TransferCommunity } from "./types/TransferCommunity";
131
131
  import { VerifyEmail } from "./types/VerifyEmail";
132
132
  import { UploadImage, UploadImageResponse } from "./types/others";
133
+ import { BlockInstance } from "./types/BlockInstance";
134
+ import { BlockInstanceResponse } from "./types/BlockInstanceResponse";
133
135
  /**
134
136
  * Helps build lemmy HTTP requests.
135
137
  */
@@ -656,6 +658,12 @@ export declare class LemmyHttp {
656
658
  * `HTTP.Get /federated_instances`
657
659
  */
658
660
  getFederatedInstances(form?: GetFederatedInstances): Promise<GetFederatedInstancesResponse>;
661
+ /**
662
+ * Block an instance
663
+ *
664
+ * `HTTP.POST /site/block`
665
+ */
666
+ blockInstance(form: BlockInstance): Promise<BlockInstanceResponse>;
659
667
  /**
660
668
  * Upload an image to the server.
661
669
  */
package/dist/http.js CHANGED
@@ -712,9 +712,7 @@ class LemmyHttp {
712
712
  * `HTTP.POST /custom_emoji`
713
713
  */
714
714
  createCustomEmoji(form) {
715
- return __awaiter(this, void 0, void 0, function* () {
716
- return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Post, "/custom_emoji", form);
717
- });
715
+ return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Post, "/custom_emoji", form);
718
716
  }
719
717
  /**
720
718
  * Edit an existing custom emoji
@@ -722,9 +720,7 @@ class LemmyHttp {
722
720
  * `HTTP.PUT /custom_emoji`
723
721
  */
724
722
  editCustomEmoji(form) {
725
- return __awaiter(this, void 0, void 0, function* () {
726
- return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Put, "/custom_emoji", form);
727
- });
723
+ return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Put, "/custom_emoji", form);
728
724
  }
729
725
  /**
730
726
  * Delete a custom emoji
@@ -732,9 +728,7 @@ class LemmyHttp {
732
728
  * `HTTP.Post /custom_emoji/delete`
733
729
  */
734
730
  deleteCustomEmoji(form) {
735
- return __awaiter(this, void 0, void 0, function* () {
736
- return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Post, "/custom_emoji/delete", form);
737
- });
731
+ return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Post, "/custom_emoji/delete", form);
738
732
  }
739
733
  /**
740
734
  * Fetch federated instances.
@@ -742,9 +736,15 @@ class LemmyHttp {
742
736
  * `HTTP.Get /federated_instances`
743
737
  */
744
738
  getFederatedInstances(form = {}) {
745
- return __awaiter(this, void 0, void 0, function* () {
746
- return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Get, "/federated_instances", form);
747
- });
739
+ return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Get, "/federated_instances", form);
740
+ }
741
+ /**
742
+ * Block an instance
743
+ *
744
+ * `HTTP.POST /site/block`
745
+ */
746
+ blockInstance(form) {
747
+ return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Post, "/site/block", form);
748
748
  }
749
749
  /**
750
750
  * Upload an image to the server.
package/dist/index.d.ts CHANGED
@@ -19,6 +19,8 @@ export { BanPersonResponse } from "./types/BanPersonResponse";
19
19
  export { BannedPersonsResponse } from "./types/BannedPersonsResponse";
20
20
  export { BlockCommunity } from "./types/BlockCommunity";
21
21
  export { BlockCommunityResponse } from "./types/BlockCommunityResponse";
22
+ export { BlockInstance } from "./types/BlockInstance";
23
+ export { BlockInstanceResponse } from "./types/BlockInstanceResponse";
22
24
  export { BlockPerson } from "./types/BlockPerson";
23
25
  export { BlockPersonResponse } from "./types/BlockPersonResponse";
24
26
  export { CaptchaResponse } from "./types/CaptchaResponse";
@@ -117,6 +119,7 @@ export { GetUnreadRegistrationApplicationCount } from "./types/GetUnreadRegistra
117
119
  export { GetUnreadRegistrationApplicationCountResponse } from "./types/GetUnreadRegistrationApplicationCountResponse";
118
120
  export { HideCommunity } from "./types/HideCommunity";
119
121
  export { Instance } from "./types/Instance";
122
+ export { InstanceBlockView } from "./types/InstanceBlockView";
120
123
  export { InstanceId } from "./types/InstanceId";
121
124
  export { Language } from "./types/Language";
122
125
  export { LanguageId } from "./types/LanguageId";
@@ -194,6 +197,7 @@ export { PostFeatureType } from "./types/PostFeatureType";
194
197
  export { PostId } from "./types/PostId";
195
198
  export { PostJoin } from "./types/PostJoin";
196
199
  export { PostJoinResponse } from "./types/PostJoinResponse";
200
+ export { PostListingMode } from "./types/PostListingMode";
197
201
  export { PostOrCommentId } from "./types/PostOrCommentId";
198
202
  export { PostReport } from "./types/PostReport";
199
203
  export { PostReportId } from "./types/PostReportId";
@@ -1,6 +1,6 @@
1
- import type { PersonId } from "./PersonId";
1
+ import type { LocalUserId } from "./LocalUserId";
2
2
  export interface AddAdmin {
3
- person_id: PersonId;
3
+ local_user_id: LocalUserId;
4
4
  added: boolean;
5
5
  auth: string;
6
6
  }
@@ -0,0 +1,6 @@
1
+ import type { InstanceId } from "./InstanceId";
2
+ export interface BlockInstance {
3
+ instance_id: InstanceId;
4
+ block: boolean;
5
+ auth: string;
6
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,3 @@
1
+ export interface BlockInstanceResponse {
2
+ blocked: boolean;
3
+ }
@@ -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 });
@@ -14,5 +14,7 @@ export interface GetComments {
14
14
  post_id?: PostId;
15
15
  parent_id?: CommentId;
16
16
  saved_only?: boolean;
17
+ liked_only?: boolean;
18
+ disliked_only?: boolean;
17
19
  auth?: string;
18
20
  }
@@ -9,6 +9,7 @@ export interface GetPosts {
9
9
  community_id?: CommunityId;
10
10
  community_name?: string;
11
11
  saved_only?: boolean;
12
- moderator_view?: boolean;
12
+ liked_only?: boolean;
13
+ disliked_only?: boolean;
13
14
  auth?: string;
14
15
  }
@@ -1,6 +1,8 @@
1
+ import type { PersonId } from "./PersonId";
1
2
  export interface GetPrivateMessages {
2
3
  unread_only?: boolean;
3
4
  page?: number;
4
5
  limit?: number;
6
+ creator_id?: PersonId;
5
7
  auth: string;
6
8
  }
@@ -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,8 @@
1
+ import type { Instance } from "./Instance";
2
+ import type { Person } from "./Person";
3
+ import type { Site } from "./Site";
4
+ export interface InstanceBlockView {
5
+ person: Person;
6
+ instance: Instance;
7
+ site: Site | null;
8
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -1 +1 @@
1
- export type ListingType = "All" | "Local" | "Subscribed";
1
+ export type ListingType = "All" | "Local" | "Subscribed" | "ModeratorView";
@@ -1,6 +1,7 @@
1
1
  import type { ListingType } from "./ListingType";
2
2
  import type { LocalUserId } from "./LocalUserId";
3
3
  import type { PersonId } from "./PersonId";
4
+ import type { PostListingMode } from "./PostListingMode";
4
5
  import type { SortType } from "./SortType";
5
6
  export interface LocalUser {
6
7
  id: LocalUserId;
@@ -25,4 +26,6 @@ export interface LocalUser {
25
26
  blur_nsfw: boolean;
26
27
  auto_expand: boolean;
27
28
  infinite_scroll_enabled: boolean;
29
+ admin: boolean;
30
+ post_listing_mode: PostListingMode;
28
31
  }
@@ -1,6 +1,7 @@
1
1
  import type { CommunityBlockView } from "./CommunityBlockView";
2
2
  import type { CommunityFollowerView } from "./CommunityFollowerView";
3
3
  import type { CommunityModeratorView } from "./CommunityModeratorView";
4
+ import type { InstanceBlockView } from "./InstanceBlockView";
4
5
  import type { LanguageId } from "./LanguageId";
5
6
  import type { LocalUserView } from "./LocalUserView";
6
7
  import type { PersonBlockView } from "./PersonBlockView";
@@ -9,6 +10,7 @@ export interface MyUserInfo {
9
10
  follows: Array<CommunityFollowerView>;
10
11
  moderates: Array<CommunityModeratorView>;
11
12
  community_blocks: Array<CommunityBlockView>;
13
+ instance_blocks: Array<InstanceBlockView>;
12
14
  person_blocks: Array<PersonBlockView>;
13
15
  discussion_languages: Array<LanguageId>;
14
16
  }
@@ -15,7 +15,6 @@ export interface Person {
15
15
  deleted: boolean;
16
16
  inbox_url: string;
17
17
  matrix_user_id?: string;
18
- admin: boolean;
19
18
  bot_account: boolean;
20
19
  ban_expires?: string;
21
20
  instance_id: InstanceId;
@@ -1,4 +1,5 @@
1
1
  import type { CommunityId } from "./CommunityId";
2
+ import type { InstanceId } from "./InstanceId";
2
3
  import type { PersonId } from "./PersonId";
3
4
  import type { PostId } from "./PostId";
4
5
  export interface PostAggregates {
@@ -18,4 +19,5 @@ export interface PostAggregates {
18
19
  community_id: CommunityId;
19
20
  creator_id: PersonId;
20
21
  controversy_rank: number;
22
+ instance_id: InstanceId;
21
23
  }
@@ -0,0 +1 @@
1
+ export type PostListingMode = "List" | "Card" | "SmallCard";
@@ -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,6 +1,6 @@
1
1
  {
2
2
  "name": "lemmy-js-client",
3
- "version": "0.19.0-rc.2",
3
+ "version": "0.19.0-rc.5",
4
4
  "description": "A javascript / typescript client for Lemmy",
5
5
  "repository": "https://github.com/LemmyNet/lemmy-js-client",
6
6
  "license": "AGPL-3.0",