lemmy-js-client 0.19.4-alpha.14 → 0.19.4-alpha.17

Sign up to get free protection for your applications and to get access to all the features.
package/README.md CHANGED
@@ -35,18 +35,8 @@ let jwt = await client.login(loginForm).jwt;
35
35
 
36
36
  ## Development
37
37
 
38
- You can use [yalc](https://github.com/wclr/yalc) to develop and test changes locally:
38
+ Use `pnpm add` to develop and test changes locally:
39
39
 
40
40
  ```
41
- pnpm i --global add yalc
42
-
43
- # Go to lemmy-js-client dir
44
- yalc publish --push
45
-
46
- # Go to your client dir
47
- yalc add lemmy-js-client
48
-
49
- # To do updates, go back to the lemmy-js-client dir
50
- # This also updates it, in every dir you've added it.
51
- yalc publish --push
41
+ pnpm add path/to/lemmy-js-client
52
42
  ```
package/dist/http.d.ts CHANGED
@@ -132,6 +132,8 @@ import { ListPostLikesResponse } from "./types/ListPostLikesResponse";
132
132
  import { ListCommentLikes } from "./types/ListCommentLikes";
133
133
  import { ListCommentLikesResponse } from "./types/ListCommentLikesResponse";
134
134
  import { HidePost } from "./types/HidePost";
135
+ import { ListMedia } from "./types/ListMedia";
136
+ import { ListMediaResponse } from "./types/ListMediaResponse";
135
137
  /**
136
138
  * Helps build lemmy HTTP requests.
137
139
  */
@@ -205,6 +207,18 @@ export declare class LemmyHttp {
205
207
  * `HTTP.GET /user/validate_auth`
206
208
  */
207
209
  validateAuth(): Promise<SuccessResponse>;
210
+ /**
211
+ * List all the media for your user
212
+ *
213
+ * `HTTP.GET /account/list_media`
214
+ */
215
+ listMedia(form?: ListMedia): Promise<ListMediaResponse>;
216
+ /**
217
+ * List all the media known to your instance.
218
+ *
219
+ * `HTTP.GET /admin/list_all_media`
220
+ */
221
+ listAllMedia(form?: ListMedia): Promise<ListMediaResponse>;
208
222
  /**
209
223
  * Enable / Disable TOTP / two-factor authentication.
210
224
  *
@@ -551,6 +565,11 @@ export declare class LemmyHttp {
551
565
  * `HTTP.POST /user/login`
552
566
  */
553
567
  login(form: Login): Promise<LoginResponse>;
568
+ /**
569
+ * Invalidate the currently used auth token.
570
+ *
571
+ * `HTTP.POST /user/logout`
572
+ */
554
573
  logout(): Promise<SuccessResponse>;
555
574
  /**
556
575
  * Get the details for a person.
package/dist/http.js CHANGED
@@ -128,6 +128,22 @@ class LemmyHttp {
128
128
  validateAuth() {
129
129
  return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Get, "/user/validate_auth", {});
130
130
  }
131
+ /**
132
+ * List all the media for your user
133
+ *
134
+ * `HTTP.GET /account/list_media`
135
+ */
136
+ listMedia(form = {}) {
137
+ return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Get, "/account/list_media", form);
138
+ }
139
+ /**
140
+ * List all the media known to your instance.
141
+ *
142
+ * `HTTP.GET /admin/list_all_media`
143
+ */
144
+ listAllMedia(form = {}) {
145
+ return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Get, "/admin/list_all_media", form);
146
+ }
131
147
  /**
132
148
  * Enable / Disable TOTP / two-factor authentication.
133
149
  *
@@ -588,6 +604,11 @@ class LemmyHttp {
588
604
  login(form) {
589
605
  return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Post, "/user/login", form);
590
606
  }
607
+ /**
608
+ * Invalidate the currently used auth token.
609
+ *
610
+ * `HTTP.POST /user/logout`
611
+ */
591
612
  logout() {
592
613
  return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Post, "/user/logout", {});
593
614
  }
@@ -915,7 +936,7 @@ _LemmyHttp_apiUrl = new WeakMap(), _LemmyHttp_headers = new WeakMap(), _LemmyHtt
915
936
  };
916
937
  function encodeGetParams(p) {
917
938
  return Object.entries(p)
918
- .filter(kv => !!kv[1])
939
+ .filter(kv => kv[1] !== undefined && kv[1] !== null)
919
940
  .map(kv => kv.map(encodeURIComponent).join("="))
920
941
  .join("&");
921
942
  }
package/dist/index.d.ts CHANGED
@@ -125,6 +125,8 @@ export { ListCommentReports } from "./types/ListCommentReports";
125
125
  export { ListCommentReportsResponse } from "./types/ListCommentReportsResponse";
126
126
  export { ListCommunities } from "./types/ListCommunities";
127
127
  export { ListCommunitiesResponse } from "./types/ListCommunitiesResponse";
128
+ export { ListMedia } from "./types/ListMedia";
129
+ export { ListMediaResponse } from "./types/ListMediaResponse";
128
130
  export { ListPostLikes } from "./types/ListPostLikes";
129
131
  export { ListPostLikesResponse } from "./types/ListPostLikesResponse";
130
132
  export { ListPostReports } from "./types/ListPostReports";
@@ -134,6 +136,8 @@ export { ListPrivateMessageReportsResponse } from "./types/ListPrivateMessageRep
134
136
  export { ListRegistrationApplications } from "./types/ListRegistrationApplications";
135
137
  export { ListRegistrationApplicationsResponse } from "./types/ListRegistrationApplicationsResponse";
136
138
  export { ListingType } from "./types/ListingType";
139
+ export { LocalImage } from "./types/LocalImage";
140
+ export { LocalImageView } from "./types/LocalImageView";
137
141
  export { LocalSite } from "./types/LocalSite";
138
142
  export { LocalSiteId } from "./types/LocalSiteId";
139
143
  export { LocalSiteRateLimit } from "./types/LocalSiteRateLimit";
@@ -14,6 +14,7 @@ export interface CommentReplyView {
14
14
  recipient: Person;
15
15
  counts: CommentAggregates;
16
16
  creator_banned_from_community: boolean;
17
+ banned_from_community: boolean;
17
18
  creator_is_moderator: boolean;
18
19
  creator_is_admin: boolean;
19
20
  subscribed: SubscribedType;
@@ -0,0 +1,4 @@
1
+ export interface ListMedia {
2
+ page?: number;
3
+ limit?: number;
4
+ }
@@ -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 });
@@ -0,0 +1,4 @@
1
+ import type { LocalImageView } from "./LocalImageView";
2
+ export interface ListMediaResponse {
3
+ images: Array<LocalImageView>;
4
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,7 @@
1
+ import type { LocalUserId } from "./LocalUserId";
2
+ export interface LocalImage {
3
+ local_user_id?: LocalUserId;
4
+ pictrs_alias: string;
5
+ pictrs_delete_token: string;
6
+ published: string;
7
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,8 @@
1
+ import type { LocalImage } from "./LocalImage";
2
+ import type { LocalUser } from "./LocalUser";
3
+ import type { Person } from "./Person";
4
+ export interface LocalImageView {
5
+ local_image: LocalImage;
6
+ local_user: LocalUser;
7
+ person: Person;
8
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -14,6 +14,7 @@ export interface PersonMentionView {
14
14
  recipient: Person;
15
15
  counts: CommentAggregates;
16
16
  creator_banned_from_community: boolean;
17
+ banned_from_community: boolean;
17
18
  creator_is_moderator: boolean;
18
19
  creator_is_admin: boolean;
19
20
  subscribed: SubscribedType;
@@ -12,6 +12,7 @@ export interface Site {
12
12
  actor_id: string;
13
13
  last_refreshed_at: string;
14
14
  inbox_url: string;
15
+ public_key: string;
15
16
  instance_id: InstanceId;
16
17
  content_warning?: string;
17
18
  }
@@ -1,5 +1,6 @@
1
1
  import type { Person } from "./Person";
2
2
  export interface VoteView {
3
3
  creator: Person;
4
+ creator_banned_from_community: boolean;
4
5
  score: number;
5
6
  }
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": "0.19.4-alpha.14",
4
+ "version": "0.19.4-alpha.17",
5
5
  "author": "Dessalines <tyhou13@gmx.com>",
6
6
  "license": "AGPL-3.0",
7
7
  "main": "./dist/index.js",