lemmy-js-client 1.0.0-post-notifications.5 → 1.0.0-post-tags.3

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
@@ -25,6 +25,7 @@ import { CreateCommentReport } from "./types/CreateCommentReport";
25
25
  import { CreateCommunity } from "./types/CreateCommunity";
26
26
  import { CreateCommunityReport } from "./types/CreateCommunityReport";
27
27
  import { CreateCommunityTag } from "./types/CreateCommunityTag";
28
+ import { UpdateCommunityTag } from "./types/UpdateCommunityTag";
28
29
  import { CreateCustomEmoji } from "./types/CreateCustomEmoji";
29
30
  import { CreateOAuthProvider } from "./types/CreateOAuthProvider";
30
31
  import { CreatePost } from "./types/CreatePost";
@@ -98,7 +99,6 @@ import { SaveUserSettings } from "./types/SaveUserSettings";
98
99
  import { SearchResponse } from "./types/SearchResponse";
99
100
  import { SiteResponse } from "./types/SiteResponse";
100
101
  import { TransferCommunity } from "./types/TransferCommunity";
101
- import { UpdateCommunityTag } from "./types/UpdateCommunityTag";
102
102
  import { VerifyEmail } from "./types/VerifyEmail";
103
103
  import { HideCommunity } from "./types/HideCommunity";
104
104
  import { GenerateTotpSecretResponse } from "./types/GenerateTotpSecretResponse";
@@ -144,6 +144,7 @@ import { ListLoginsResponse } from "./types/ListLoginsResponse";
144
144
  import { ListPersonLikedResponse } from "./types/ListPersonLikedResponse";
145
145
  import { MarkNotificationAsRead } from "./types/MarkNotificationAsRead";
146
146
  import { ListNotificationsResponse } from "./types/ListNotificationsResponse";
147
+ import { ModEditPost } from "./types/ModEditPost";
147
148
  type RequestOptions = Pick<RequestInit, "signal">;
148
149
  /**
149
150
  * Helps build lemmy HTTP requests.
@@ -327,6 +328,10 @@ export declare class LemmyHttp extends Controller {
327
328
  * @summary Edit a post.
328
329
  */
329
330
  editPost(form: EditPost, options?: RequestOptions): Promise<PostResponse>;
331
+ /**
332
+ * @summary Mods can change nsfw flag and tags for a post
333
+ */
334
+ modEditPost(form: ModEditPost, options?: RequestOptions): Promise<PostResponse>;
330
335
  /**
331
336
  * @summary Delete a post.
332
337
  */
@@ -632,7 +637,7 @@ export declare class LemmyHttp extends Controller {
632
637
  */
633
638
  createCommunityTag(form: CreateCommunityTag, options?: RequestOptions): Promise<Tag>;
634
639
  /**
635
- * @summary Update a community post tag.
640
+ * @summary Edit a community post tag.
636
641
  */
637
642
  updateCommunityTag(form: UpdateCommunityTag, options?: RequestOptions): Promise<Tag>;
638
643
  /**
package/dist/http.js CHANGED
@@ -298,6 +298,12 @@ let LemmyHttp = class LemmyHttp extends runtime_1.Controller {
298
298
  async editPost(form, options) {
299
299
  return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Put, "/post", form, options);
300
300
  }
301
+ /**
302
+ * @summary Mods can change nsfw flag and tags for a post
303
+ */
304
+ async modEditPost(form, options) {
305
+ return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Put, "/post/mod_update", form, options);
306
+ }
301
307
  /**
302
308
  * @summary Delete a post.
303
309
  */
@@ -755,10 +761,10 @@ let LemmyHttp = class LemmyHttp extends runtime_1.Controller {
755
761
  return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Post, "/community/tag", form, options);
756
762
  }
757
763
  /**
758
- * @summary Update a community post tag.
764
+ * @summary Edit a community post tag.
759
765
  */
760
766
  updateCommunityTag(form, options) {
761
- return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Put, "/community/tag", form, options);
767
+ return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Post, "/community/tag", form, options);
762
768
  }
763
769
  /**
764
770
  * @summary Delete a post tag in a community.
@@ -1270,6 +1276,13 @@ __decorate([
1270
1276
  __param(0, (0, runtime_1.Body)()),
1271
1277
  __param(1, (0, runtime_1.Inject)())
1272
1278
  ], LemmyHttp.prototype, "editPost", null);
1279
+ __decorate([
1280
+ (0, runtime_1.Security)("bearerAuth"),
1281
+ (0, runtime_1.Put)("/post/mod_update"),
1282
+ (0, runtime_1.Tags)("Post"),
1283
+ __param(0, (0, runtime_1.Body)()),
1284
+ __param(1, (0, runtime_1.Inject)())
1285
+ ], LemmyHttp.prototype, "modEditPost", null);
1273
1286
  __decorate([
1274
1287
  (0, runtime_1.Security)("bearerAuth"),
1275
1288
  (0, runtime_1.Post)("/post/delete"),
@@ -1972,44 +1985,52 @@ __decorate([
1972
1985
  __decorate([
1973
1986
  (0, runtime_1.Security)("bearerAuth"),
1974
1987
  (0, runtime_1.Post)("/user/donation_dialog_shown"),
1988
+ (0, runtime_1.Tags)("Miscellaneous"),
1975
1989
  __param(0, (0, runtime_1.Inject)())
1976
1990
  ], LemmyHttp.prototype, "donationDialogShown", null);
1977
1991
  __decorate([
1978
1992
  (0, runtime_1.Security)("bearerAuth"),
1979
1993
  (0, runtime_1.Post)("/multi_community"),
1994
+ (0, runtime_1.Tags)("Multicommunity"),
1980
1995
  __param(0, (0, runtime_1.Body)()),
1981
1996
  __param(1, (0, runtime_1.Inject)())
1982
1997
  ], LemmyHttp.prototype, "createMultiCommunity", null);
1983
1998
  __decorate([
1984
1999
  (0, runtime_1.Security)("bearerAuth"),
1985
2000
  (0, runtime_1.Put)("/multi_community"),
2001
+ (0, runtime_1.Tags)("Multicommunity"),
1986
2002
  __param(0, (0, runtime_1.Body)()),
1987
2003
  __param(1, (0, runtime_1.Inject)())
1988
2004
  ], LemmyHttp.prototype, "updateMultiCommunity", null);
1989
2005
  __decorate([
1990
2006
  (0, runtime_1.Get)("/multi_community"),
2007
+ (0, runtime_1.Tags)("Multicommunity"),
1991
2008
  __param(0, (0, runtime_1.Queries)()),
1992
2009
  __param(1, (0, runtime_1.Inject)())
1993
2010
  ], LemmyHttp.prototype, "getMultiCommunity", null);
1994
2011
  __decorate([
1995
2012
  (0, runtime_1.Security)("bearerAuth"),
1996
2013
  (0, runtime_1.Post)("/multi_community/entry"),
2014
+ (0, runtime_1.Tags)("Multicommunity"),
1997
2015
  __param(0, (0, runtime_1.Body)()),
1998
2016
  __param(1, (0, runtime_1.Inject)())
1999
2017
  ], LemmyHttp.prototype, "createMultiCommunityEntry", null);
2000
2018
  __decorate([
2001
2019
  (0, runtime_1.Security)("bearerAuth"),
2002
2020
  (0, runtime_1.Delete)("/multi_community/entry"),
2021
+ (0, runtime_1.Tags)("Multicommunity"),
2003
2022
  __param(0, (0, runtime_1.Body)()),
2004
2023
  __param(1, (0, runtime_1.Inject)())
2005
2024
  ], LemmyHttp.prototype, "deleteMultiCommunityEntry", null);
2006
2025
  __decorate([
2007
2026
  (0, runtime_1.Get)("/multi_community/list"),
2027
+ (0, runtime_1.Tags)("Multicommunity"),
2008
2028
  __param(0, (0, runtime_1.Queries)()),
2009
2029
  __param(1, (0, runtime_1.Inject)())
2010
2030
  ], LemmyHttp.prototype, "listMultiCommunities", null);
2011
2031
  __decorate([
2012
2032
  (0, runtime_1.Post)("/multi_community/follow"),
2033
+ (0, runtime_1.Tags)("Multicommunity"),
2013
2034
  __param(0, (0, runtime_1.Body)()),
2014
2035
  __param(1, (0, runtime_1.Inject)())
2015
2036
  ], LemmyHttp.prototype, "followMultiCommunity", null);
package/dist/index.d.ts CHANGED
@@ -229,6 +229,7 @@ export { ModBanView } from "./types/ModBanView";
229
229
  export { ModChangeCommunityVisibility } from "./types/ModChangeCommunityVisibility";
230
230
  export { ModChangeCommunityVisibilityId } from "./types/ModChangeCommunityVisibilityId";
231
231
  export { ModChangeCommunityVisibilityView } from "./types/ModChangeCommunityVisibilityView";
232
+ export { ModEditPost } from "./types/ModEditPost";
232
233
  export { ModFeaturePost } from "./types/ModFeaturePost";
233
234
  export { ModFeaturePostId } from "./types/ModFeaturePostId";
234
235
  export { ModFeaturePostView } from "./types/ModFeaturePostView";
@@ -21,4 +21,7 @@ export type CommentReportView = {
21
21
  person_actions?: PersonActions;
22
22
  community_actions?: CommunityActions;
23
23
  creator_is_admin: boolean;
24
+ creator_is_moderator: boolean;
25
+ creator_banned: boolean;
26
+ creator_banned_from_community: boolean;
24
27
  };
@@ -9,4 +9,8 @@ export type CommunityReportView = {
9
9
  community: Community;
10
10
  creator: Person;
11
11
  resolver?: Person;
12
+ creator_is_admin: boolean;
13
+ creator_is_moderator: boolean;
14
+ creator_banned: boolean;
15
+ creator_banned_from_community: boolean;
12
16
  };
@@ -4,5 +4,7 @@ import type { CommunityId } from "./CommunityId";
4
4
  */
5
5
  export type CreateCommunityTag = {
6
6
  community_id: CommunityId;
7
- display_name: string;
7
+ name: string;
8
+ display_name?: string;
9
+ description?: string;
8
10
  };
@@ -245,8 +245,6 @@ export type LemmyErrorType = {
245
245
  error: "invalid_unix_time";
246
246
  } | {
247
247
  error: "invalid_bot_action";
248
- } | {
249
- error: "invalid_tag_name";
250
248
  } | {
251
249
  error: "tag_not_in_community";
252
250
  } | {
@@ -314,8 +312,6 @@ export type LemmyErrorType = {
314
312
  error: "couldnt_update_tag";
315
313
  } | {
316
314
  error: "couldnt_create_post_tag";
317
- } | {
318
- error: "couldnt_update_post_tag";
319
315
  } | {
320
316
  error: "couldnt_create_tagline";
321
317
  } | {
@@ -0,0 +1,10 @@
1
+ import type { PostId } from "./PostId";
2
+ import type { TagId } from "./TagId";
3
+ /**
4
+ * Mods can change some metadata for posts
5
+ */
6
+ export type ModEditPost = {
7
+ post_id: PostId;
8
+ nsfw?: boolean;
9
+ tags?: Array<TagId>;
10
+ };
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -19,4 +19,7 @@ export type PostReportView = {
19
19
  person_actions?: PersonActions;
20
20
  resolver?: Person;
21
21
  creator_is_admin: boolean;
22
+ creator_is_moderator: boolean;
23
+ creator_banned: boolean;
24
+ creator_banned_from_community: boolean;
22
25
  };
@@ -10,7 +10,6 @@ export type PrivateMessage = {
10
10
  recipient_id: PersonId;
11
11
  content: string;
12
12
  deleted: boolean;
13
- read: boolean;
14
13
  published_at: string;
15
14
  updated_at?: string;
16
15
  ap_id: DbUrl;
@@ -10,4 +10,6 @@ export type PrivateMessageReportView = {
10
10
  creator: Person;
11
11
  private_message_creator: Person;
12
12
  resolver?: Person;
13
+ creator_is_admin: boolean;
14
+ creator_banned: boolean;
13
15
  };
@@ -2,25 +2,17 @@ import type { CommunityId } from "./CommunityId";
2
2
  import type { DbUrl } from "./DbUrl";
3
3
  import type { TagId } from "./TagId";
4
4
  /**
5
- * A tag that can be assigned to a post within a community.
6
- * The tag object is created by the community moderators.
7
- * The assignment happens by the post creator and can be updated by the community moderators.
8
- *
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 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.
5
+ * A tag that is created by community moderators, and assigned to posts by the creator
6
+ * or by mods.
17
7
  */
18
8
  export type Tag = {
19
9
  id: TagId;
20
10
  ap_id: DbUrl;
21
- display_name: string;
11
+ name: string;
12
+ display_name?: string;
13
+ description?: string;
22
14
  /**
23
- * the community that owns this tag
15
+ * The community that this tag belongs to
24
16
  */
25
17
  community_id: CommunityId;
26
18
  published_at: string;
@@ -1,5 +1,5 @@
1
1
  import type { Tag } from "./Tag";
2
2
  /**
3
- * we wrap this in a struct so we can implement FromSqlRow<Json> for it
3
+ * We wrap this in a struct so we can implement FromSqlRow<Json> for it
4
4
  */
5
5
  export type TagsView = Array<Tag>;
@@ -1,8 +1,9 @@
1
1
  import type { TagId } from "./TagId";
2
2
  /**
3
- * Update a community tag.
3
+ * Make changes to a community tag
4
4
  */
5
5
  export type UpdateCommunityTag = {
6
6
  tag_id: TagId;
7
- display_name: string;
7
+ display_name?: string;
8
+ description?: string;
8
9
  };
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.5",
4
+ "version": "1.0.0-post-tags.3",
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.12.4",
46
+ "packageManager": "pnpm@10.13.1",
47
47
  "types": "./dist/index.d.ts",
48
48
  "lint-staged": {
49
49
  "*.{ts,tsx,js}": [