lemmy-js-client 1.0.0-post-tags.1 → 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";
@@ -143,6 +144,7 @@ import { ListLoginsResponse } from "./types/ListLoginsResponse";
143
144
  import { ListPersonLikedResponse } from "./types/ListPersonLikedResponse";
144
145
  import { MarkNotificationAsRead } from "./types/MarkNotificationAsRead";
145
146
  import { ListNotificationsResponse } from "./types/ListNotificationsResponse";
147
+ import { ModEditPost } from "./types/ModEditPost";
146
148
  type RequestOptions = Pick<RequestInit, "signal">;
147
149
  /**
148
150
  * Helps build lemmy HTTP requests.
@@ -326,6 +328,10 @@ export declare class LemmyHttp extends Controller {
326
328
  * @summary Edit a post.
327
329
  */
328
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>;
329
335
  /**
330
336
  * @summary Delete a post.
331
337
  */
@@ -630,6 +636,10 @@ export declare class LemmyHttp extends Controller {
630
636
  * @summary Create a community post tag.
631
637
  */
632
638
  createCommunityTag(form: CreateCommunityTag, options?: RequestOptions): Promise<Tag>;
639
+ /**
640
+ * @summary Edit a community post tag.
641
+ */
642
+ updateCommunityTag(form: UpdateCommunityTag, options?: RequestOptions): Promise<Tag>;
633
643
  /**
634
644
  * @summary Delete a post tag in a community.
635
645
  */
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
  */
@@ -754,6 +760,12 @@ let LemmyHttp = class LemmyHttp extends runtime_1.Controller {
754
760
  createCommunityTag(form, options) {
755
761
  return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Post, "/community/tag", form, options);
756
762
  }
763
+ /**
764
+ * @summary Edit a community post tag.
765
+ */
766
+ updateCommunityTag(form, options) {
767
+ return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Post, "/community/tag", form, options);
768
+ }
757
769
  /**
758
770
  * @summary Delete a post tag in a community.
759
771
  */
@@ -1264,6 +1276,13 @@ __decorate([
1264
1276
  __param(0, (0, runtime_1.Body)()),
1265
1277
  __param(1, (0, runtime_1.Inject)())
1266
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);
1267
1286
  __decorate([
1268
1287
  (0, runtime_1.Security)("bearerAuth"),
1269
1288
  (0, runtime_1.Post)("/post/delete"),
@@ -1794,6 +1813,13 @@ __decorate([
1794
1813
  __param(0, (0, runtime_1.Body)()),
1795
1814
  __param(1, (0, runtime_1.Inject)())
1796
1815
  ], LemmyHttp.prototype, "createCommunityTag", null);
1816
+ __decorate([
1817
+ (0, runtime_1.Security)("bearerAuth"),
1818
+ (0, runtime_1.Put)("/community/tag"),
1819
+ (0, runtime_1.Tags)("Community"),
1820
+ __param(0, (0, runtime_1.Body)()),
1821
+ __param(1, (0, runtime_1.Inject)())
1822
+ ], LemmyHttp.prototype, "updateCommunityTag", null);
1797
1823
  __decorate([
1798
1824
  (0, runtime_1.Security)("bearerAuth"),
1799
1825
  (0, runtime_1.Delete)("/community/tag"),
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";
@@ -351,6 +352,7 @@ export { TaglineResponse } from "./types/TaglineResponse";
351
352
  export { TagsView } from "./types/TagsView";
352
353
  export { TransferCommunity } from "./types/TransferCommunity";
353
354
  export { UpdateCommunityNotifications } from "./types/UpdateCommunityNotifications";
355
+ export { UpdateCommunityTag } from "./types/UpdateCommunityTag";
354
356
  export { UpdateMultiCommunity } from "./types/UpdateMultiCommunity";
355
357
  export { UpdatePostNotifications } from "./types/UpdatePostNotifications";
356
358
  export { UpdateTagline } from "./types/UpdateTagline";
@@ -5,4 +5,6 @@ import type { CommunityId } from "./CommunityId";
5
5
  export type CreateCommunityTag = {
6
6
  community_id: CommunityId;
7
7
  name: string;
8
+ display_name?: string;
9
+ description?: string;
8
10
  };
@@ -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 });
@@ -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 federated 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
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>;
@@ -0,0 +1,9 @@
1
+ import type { TagId } from "./TagId";
2
+ /**
3
+ * Make changes to a community tag
4
+ */
5
+ export type UpdateCommunityTag = {
6
+ tag_id: TagId;
7
+ display_name?: string;
8
+ description?: string;
9
+ };
@@ -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-post-tags.1",
4
+ "version": "1.0.0-post-tags.3",
5
5
  "author": "Dessalines",
6
6
  "license": "AGPL-3.0",
7
7
  "main": "./dist/index.js",