lemmy-js-client 1.0.0-dont-return-actions.1 → 1.0.0-instance-user-blocking.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.
package/README.md CHANGED
@@ -52,6 +52,12 @@ Use `pnpm add` to develop and test changes locally:
52
52
 
53
53
  `pnpm add path/to/lemmy-js-client`
54
54
 
55
+ Alternatively, use `yalc publish` and `yalc add lemmy-js-client`
56
+
57
+ ## Generating typescript types from lemmy structs
58
+
59
+ Run `./scripts/copy_generated_types_from_lemmy.sh`
60
+
55
61
  ## OpenAPI
56
62
 
57
63
  To generate OpenAPI docs, run `pnpm tsoa`
package/dist/http.d.ts CHANGED
@@ -122,7 +122,6 @@ import { GetCommunityPendingFollowsCountResponse } from "./types/GetCommunityPen
122
122
  import { ListCommunityPendingFollowsResponse } from "./types/ListCommunityPendingFollowsResponse";
123
123
  import { ListReportsResponse } from "./types/ListReportsResponse";
124
124
  import { MyUserInfo } from "./types/MyUserInfo";
125
- import { UserBlockInstanceParams } from "./types/UserBlockInstanceParams";
126
125
  import { AdminAllowInstanceParams } from "./types/AdminAllowInstanceParams";
127
126
  import { AdminBlockInstanceParams } from "./types/AdminBlockInstanceParams";
128
127
  import { ListPersonContentResponse } from "./types/ListPersonContentResponse";
@@ -146,6 +145,9 @@ import { GetMultiCommunityResponse } from "./types/GetMultiCommunityResponse";
146
145
  import { FollowMultiCommunity } from "./types/FollowMultiCommunity";
147
146
  import { ListLoginsResponse } from "./types/ListLoginsResponse";
148
147
  import { ListPersonLikedResponse } from "./types/ListPersonLikedResponse";
148
+ import { NotePerson } from "./types/NotePerson";
149
+ import { UserBlockInstanceCommunitiesParams } from "./types/UserBlockInstanceCommunitiesParams";
150
+ import { UserBlockInstancePersonsParams } from "./types/UserBlockInstancePersonsParams";
149
151
  type RequestOptions = Pick<RequestInit, "signal">;
150
152
  /**
151
153
  * Helps build lemmy HTTP requests.
@@ -485,6 +487,10 @@ export declare class LemmyHttp extends Controller {
485
487
  * @summary List the content for a person.
486
488
  */
487
489
  listPersonContent(form?: ListPersonContentI, options?: RequestOptions): Promise<ListPersonContentResponse>;
490
+ /**
491
+ * @summary Make a note for a person.
492
+ */
493
+ notePerson(form: NotePerson, options?: RequestOptions): Promise<SuccessResponse>;
488
494
  /**
489
495
  * @summary Mark a person mention as read.
490
496
  */
@@ -674,9 +680,13 @@ export declare class LemmyHttp extends Controller {
674
680
  */
675
681
  listReports(form: ListReportsI, options?: RequestOptions): Promise<ListReportsResponse>;
676
682
  /**
677
- * @summary Block an instance as user.
683
+ * @summary Block an instance's communities as a user.
684
+ */
685
+ userBlockInstanceCommunities(form: UserBlockInstanceCommunitiesParams, options?: RequestOptions): Promise<SuccessResponse>;
686
+ /**
687
+ * @summary Block an instance's persons as a user.
678
688
  */
679
- userBlockInstance(form: UserBlockInstanceParams, options?: RequestOptions): Promise<SuccessResponse>;
689
+ userBlockInstancePersons(form: UserBlockInstancePersonsParams, options?: RequestOptions): Promise<SuccessResponse>;
680
690
  /**
681
691
  * @summary Globally block an instance as admin.
682
692
  */
package/dist/http.js CHANGED
@@ -532,6 +532,12 @@ let LemmyHttp = class LemmyHttp extends runtime_1.Controller {
532
532
  async listPersonContent(form = {}, options) {
533
533
  return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Get, "/person/content", form, options);
534
534
  }
535
+ /**
536
+ * @summary Make a note for a person.
537
+ */
538
+ async notePerson(form, options) {
539
+ return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Post, "/person/note", form, options);
540
+ }
535
541
  /**
536
542
  * @summary Mark a person mention as read.
537
543
  */
@@ -815,10 +821,16 @@ let LemmyHttp = class LemmyHttp extends runtime_1.Controller {
815
821
  return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Get, "/report/list", form, options);
816
822
  }
817
823
  /**
818
- * @summary Block an instance as user.
824
+ * @summary Block an instance's communities as a user.
819
825
  */
820
- async userBlockInstance(form, options) {
821
- return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Post, "/account/block/instance", form, options);
826
+ async userBlockInstanceCommunities(form, options) {
827
+ return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Post, "/account/block/instance/communities", form, options);
828
+ }
829
+ /**
830
+ * @summary Block an instance's persons as a user.
831
+ */
832
+ async userBlockInstancePersons(form, options) {
833
+ return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Post, "/account/block/instance/persons", form, options);
822
834
  }
823
835
  /**
824
836
  * @summary Globally block an instance as admin.
@@ -1558,6 +1570,13 @@ __decorate([
1558
1570
  __param(0, (0, runtime_1.Queries)()),
1559
1571
  __param(1, (0, runtime_1.Inject)())
1560
1572
  ], LemmyHttp.prototype, "listPersonContent", null);
1573
+ __decorate([
1574
+ (0, runtime_1.Security)("bearerAuth"),
1575
+ (0, runtime_1.Post)("/person/note"),
1576
+ (0, runtime_1.Tags)("Person"),
1577
+ __param(0, (0, runtime_1.Body)()),
1578
+ __param(1, (0, runtime_1.Inject)())
1579
+ ], LemmyHttp.prototype, "notePerson", null);
1561
1580
  __decorate([
1562
1581
  (0, runtime_1.Security)("bearerAuth"),
1563
1582
  (0, runtime_1.Post)("/account/mention/comment/mark_as_read"),
@@ -1882,11 +1901,18 @@ __decorate([
1882
1901
  ], LemmyHttp.prototype, "listReports", null);
1883
1902
  __decorate([
1884
1903
  (0, runtime_1.Security)("bearerAuth"),
1885
- (0, runtime_1.Post)("/account/block/instance"),
1886
- (0, runtime_1.Tags)("Account"),
1904
+ (0, runtime_1.Post)("/account/block/instance/communities"),
1905
+ (0, runtime_1.Tags)("Account", "Community"),
1906
+ __param(0, (0, runtime_1.Body)()),
1907
+ __param(1, (0, runtime_1.Inject)())
1908
+ ], LemmyHttp.prototype, "userBlockInstanceCommunities", null);
1909
+ __decorate([
1910
+ (0, runtime_1.Security)("bearerAuth"),
1911
+ (0, runtime_1.Post)("/account/block/instance/persons"),
1912
+ (0, runtime_1.Tags)("Account", "Person"),
1887
1913
  __param(0, (0, runtime_1.Body)()),
1888
1914
  __param(1, (0, runtime_1.Inject)())
1889
- ], LemmyHttp.prototype, "userBlockInstance", null);
1915
+ ], LemmyHttp.prototype, "userBlockInstancePersons", null);
1890
1916
  __decorate([
1891
1917
  (0, runtime_1.Security)("bearerAuth"),
1892
1918
  (0, runtime_1.Post)("/admin/instance/block"),
package/dist/index.d.ts CHANGED
@@ -350,7 +350,8 @@ export { UpdateTagline } from "./types/UpdateTagline";
350
350
  export { UpdateTotp } from "./types/UpdateTotp";
351
351
  export { UpdateTotpResponse } from "./types/UpdateTotpResponse";
352
352
  export { UploadImageResponse } from "./types/UploadImageResponse";
353
- export { UserBlockInstanceParams } from "./types/UserBlockInstanceParams";
353
+ export { UserBlockInstanceCommunitiesParams } from "./types/UserBlockInstanceCommunitiesParams";
354
+ export { UserBlockInstancePersonsParams } from "./types/UserBlockInstancePersonsParams";
354
355
  export { VerifyEmail } from "./types/VerifyEmail";
355
356
  export { VoteShow } from "./types/VoteShow";
356
357
  export { VoteView } from "./types/VoteView";
@@ -22,10 +22,11 @@ export type CommentReplyView = {
22
22
  comment_actions?: CommentActions;
23
23
  person_actions?: PersonActions;
24
24
  instance_actions?: InstanceActions;
25
+ creator_home_instance_actions?: InstanceActions;
26
+ creator_local_instance_actions?: InstanceActions;
27
+ creator_community_actions?: CommunityActions;
25
28
  creator_is_admin: boolean;
26
29
  post_tags: TagsView;
27
30
  can_mod: boolean;
28
31
  creator_banned: boolean;
29
- creator_is_moderator: boolean;
30
- creator_banned_from_community: boolean;
31
32
  };
@@ -18,6 +18,7 @@ export type CommentReportView = {
18
18
  comment_creator: Person;
19
19
  comment_actions?: CommentActions;
20
20
  resolver?: Person;
21
+ creator_community_actions?: CommunityActions;
21
22
  person_actions?: PersonActions;
22
23
  community_actions?: CommunityActions;
23
24
  creator_is_admin: boolean;
@@ -1,5 +1,6 @@
1
1
  import type { Comment } from "./Comment";
2
2
  import type { CommentActions } from "./CommentActions";
3
+ import type { CommunityActions } from "./CommunityActions";
3
4
  import type { InstanceActions } from "./InstanceActions";
4
5
  import type { Person } from "./Person";
5
6
  import type { PersonActions } from "./PersonActions";
@@ -11,10 +12,12 @@ export type CommentSlimView = {
11
12
  creator: Person;
12
13
  comment_actions?: CommentActions;
13
14
  person_actions?: PersonActions;
14
- instance_actions?: InstanceActions;
15
+ creator_community_actions?: CommunityActions;
16
+ instance_communities_actions?: InstanceActions;
17
+ instance_persons_actions?: InstanceActions;
18
+ creator_home_instance_actions?: InstanceActions;
19
+ creator_local_instance_actions?: InstanceActions;
15
20
  creator_is_admin: boolean;
16
21
  can_mod: boolean;
17
22
  creator_banned: boolean;
18
- creator_is_moderator: boolean;
19
- creator_banned_from_community: boolean;
20
23
  };
@@ -18,11 +18,13 @@ export type CommentView = {
18
18
  community_actions?: CommunityActions;
19
19
  comment_actions?: CommentActions;
20
20
  person_actions?: PersonActions;
21
- instance_actions?: InstanceActions;
21
+ instance_communities_actions?: InstanceActions;
22
+ instance_persons_actions?: InstanceActions;
23
+ creator_home_instance_actions?: InstanceActions;
24
+ creator_local_instance_actions?: InstanceActions;
25
+ creator_community_actions?: CommunityActions;
22
26
  creator_is_admin: boolean;
23
27
  post_tags: TagsView;
24
28
  can_mod: boolean;
25
29
  creator_banned: boolean;
26
- creator_is_moderator: boolean;
27
- creator_banned_from_community: boolean;
28
30
  };
@@ -1,8 +1,8 @@
1
1
  export type InstanceActions = {
2
2
  /**
3
- * When the instance was blocked.
3
+ * When the instance's communities were blocked.
4
4
  */
5
- blocked_at?: string;
5
+ blocked_communities_at?: string;
6
6
  /**
7
7
  * When this user received a site ban.
8
8
  */
@@ -11,4 +11,8 @@ export type InstanceActions = {
11
11
  * When their ban expires.
12
12
  */
13
13
  ban_expires_at?: string;
14
+ /**
15
+ * When the instance's persons were blocked.
16
+ */
17
+ blocked_persons_at?: string;
14
18
  };
@@ -242,7 +242,9 @@ export type LemmyErrorType = {
242
242
  } | {
243
243
  error: "contradicting_filters";
244
244
  } | {
245
- error: "instance_block_already_exists";
245
+ error: "instance_block_communities_already_exists";
246
+ } | {
247
+ error: "instance_block_persons_already_exists";
246
248
  } | {
247
249
  error: "too_many_items";
248
250
  } | {
@@ -3,7 +3,7 @@ import type { PostId } from "./PostId";
3
3
  export type LocalImage = {
4
4
  pictrs_alias: string;
5
5
  published_at: string;
6
- person_id?: PersonId;
6
+ person_id: PersonId;
7
7
  /**
8
8
  * This means the image is an auto-generated thumbnail, for a post.
9
9
  */
@@ -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,5 +7,5 @@ import type { Person } from "./Person";
6
7
  export type LocalUserView = {
7
8
  local_user: LocalUser;
8
9
  person: Person;
9
- banned: boolean;
10
+ instance_actions?: InstanceActions;
10
11
  };
@@ -13,7 +13,8 @@ export type MyUserInfo = {
13
13
  follows: Array<CommunityFollowerView>;
14
14
  moderates: Array<CommunityModeratorView>;
15
15
  community_blocks: Array<Community>;
16
- instance_blocks: Array<Instance>;
16
+ instance_communities_blocks: Array<Instance>;
17
+ instance_persons_blocks: Array<Instance>;
17
18
  person_blocks: Array<Person>;
18
19
  keyword_blocks: Array<string>;
19
20
  discussion_languages: Array<LanguageId>;
@@ -21,9 +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;
26
+ creator_community_actions?: CommunityActions;
24
27
  creator_is_admin: boolean;
25
28
  can_mod: boolean;
26
29
  creator_banned: boolean;
27
- creator_is_moderator: boolean;
28
- creator_banned_from_community: boolean;
29
30
  };
@@ -22,10 +22,11 @@ export type PersonPostMentionView = {
22
22
  person_actions?: PersonActions;
23
23
  post_actions?: PostActions;
24
24
  instance_actions?: InstanceActions;
25
+ creator_home_instance_actions?: InstanceActions;
26
+ creator_local_instance_actions?: InstanceActions;
27
+ creator_community_actions?: CommunityActions;
25
28
  post_tags: TagsView;
26
29
  creator_is_admin: boolean;
27
30
  can_mod: boolean;
28
31
  creator_banned: boolean;
29
- creator_is_moderator: boolean;
30
- creator_banned_from_community: boolean;
31
32
  };
@@ -1,3 +1,4 @@
1
+ import type { InstanceActions } from "./InstanceActions";
1
2
  import type { Person } from "./Person";
2
3
  import type { PersonActions } from "./PersonActions";
3
4
  /**
@@ -7,5 +8,7 @@ export type PersonView = {
7
8
  person: Person;
8
9
  is_admin: boolean;
9
10
  person_actions?: PersonActions;
11
+ home_instance_actions?: InstanceActions;
12
+ local_instance_actions?: InstanceActions;
10
13
  creator_banned: boolean;
11
14
  };
@@ -14,6 +14,7 @@ export type PostReportView = {
14
14
  community: Community;
15
15
  creator: Person;
16
16
  post_creator: Person;
17
+ creator_community_actions?: CommunityActions;
17
18
  community_actions?: CommunityActions;
18
19
  post_actions?: PostActions;
19
20
  person_actions?: PersonActions;
@@ -18,11 +18,13 @@ export type PostView = {
18
18
  community_actions?: CommunityActions;
19
19
  person_actions?: PersonActions;
20
20
  post_actions?: PostActions;
21
- instance_actions?: InstanceActions;
21
+ instance_communities_actions?: InstanceActions;
22
+ instance_persons_actions?: InstanceActions;
23
+ creator_home_instance_actions?: InstanceActions;
24
+ creator_local_instance_actions?: InstanceActions;
25
+ creator_community_actions?: CommunityActions;
22
26
  creator_is_admin: boolean;
23
27
  tags: TagsView;
24
28
  can_mod: boolean;
25
29
  creator_banned: boolean;
26
- creator_is_moderator: boolean;
27
- creator_banned_from_community: boolean;
28
30
  };
@@ -0,0 +1,8 @@
1
+ import type { InstanceId } from "./InstanceId";
2
+ /**
3
+ * Block an instance's communities.
4
+ */
5
+ export type UserBlockInstanceCommunitiesParams = {
6
+ instance_id: InstanceId;
7
+ block: boolean;
8
+ };
@@ -1,8 +1,8 @@
1
1
  import type { InstanceId } from "./InstanceId";
2
2
  /**
3
- * Block an instance as user
3
+ * Block an instance's persons.
4
4
  */
5
- export type UserBlockInstanceParams = {
5
+ export type UserBlockInstancePersonsParams = {
6
6
  instance_id: InstanceId;
7
7
  block: boolean;
8
8
  };
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ 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-dont-return-actions.1",
4
+ "version": "1.0.0-instance-user-blocking.1",
5
5
  "author": "Dessalines",
6
6
  "license": "AGPL-3.0",
7
7
  "main": "./dist/index.js",