lemmy-js-client 0.20.0-image-api-rework.4 → 0.20.0-image-api-rework.6

Sign up to get free protection for your applications and to get access to all the features.
package/dist/http.js CHANGED
@@ -997,7 +997,7 @@ class LemmyHttp {
997
997
  uploadImage(_a, options_1) {
998
998
  return __awaiter(this, arguments, void 0, function* ({ image }, options) {
999
999
  const formData = createFormData(image);
1000
- const response = yield __classPrivateFieldGet(this, _LemmyHttp_fetchFunction, "f").call(this, "/api/v4/image", Object.assign(Object.assign({}, options), { method: HttpType.Post, body: formData, headers: __classPrivateFieldGet(this, _LemmyHttp_headers, "f") }));
1000
+ const response = yield __classPrivateFieldGet(this, _LemmyHttp_fetchFunction, "f").call(this, __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_buildFullUrl).call(this, "/image"), Object.assign(Object.assign({}, options), { method: HttpType.Post, body: formData, headers: __classPrivateFieldGet(this, _LemmyHttp_headers, "f") }));
1001
1001
  return response.json();
1002
1002
  });
1003
1003
  }
@@ -1009,7 +1009,7 @@ class LemmyHttp {
1009
1009
  userUploadAvatar(_a, options_1) {
1010
1010
  return __awaiter(this, arguments, void 0, function* ({ image }, options) {
1011
1011
  const formData = createFormData(image);
1012
- const response = yield __classPrivateFieldGet(this, _LemmyHttp_fetchFunction, "f").call(this, "/api/v4/account/avatar", Object.assign(Object.assign({}, options), { method: HttpType.Post, body: formData, headers: __classPrivateFieldGet(this, _LemmyHttp_headers, "f") }));
1012
+ const response = yield __classPrivateFieldGet(this, _LemmyHttp_fetchFunction, "f").call(this, __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_buildFullUrl).call(this, "/account/avatar"), Object.assign(Object.assign({}, options), { method: HttpType.Post, body: formData, headers: __classPrivateFieldGet(this, _LemmyHttp_headers, "f") }));
1013
1013
  return response.json();
1014
1014
  });
1015
1015
  }
@@ -12,8 +12,6 @@ export type CreateSite = {
12
12
  name: string;
13
13
  sidebar?: string;
14
14
  description?: string;
15
- icon?: string;
16
- banner?: string;
17
15
  enable_nsfw?: boolean;
18
16
  community_creation_admin_only?: boolean;
19
17
  require_email_verification?: boolean;
@@ -18,14 +18,6 @@ export type EditCommunity = {
18
18
  * A shorter, one line description of your community.
19
19
  */
20
20
  description?: string;
21
- /**
22
- * An icon URL.
23
- */
24
- icon?: string;
25
- /**
26
- * A banner URL.
27
- */
28
- banner?: string;
29
21
  /**
30
22
  * Whether its an NSFW community.
31
23
  */
@@ -18,14 +18,6 @@ export type EditSite = {
18
18
  * A shorter, one line description of your site.
19
19
  */
20
20
  description?: string;
21
- /**
22
- * A url for your site's icon.
23
- */
24
- icon?: string;
25
- /**
26
- * A url for your site's banner.
27
- */
28
- banner?: string;
29
21
  /**
30
22
  * Whether to enable NSFW.
31
23
  */
@@ -33,4 +33,5 @@ export type GetSiteResponse = {
33
33
  oauth_providers?: Array<PublicOAuthProvider>;
34
34
  admin_oauth_providers?: Array<OAuthProvider>;
35
35
  blocked_urls: Array<LocalSiteUrlBlocklist>;
36
+ image_upload_disabled: boolean;
36
37
  };
@@ -43,6 +43,8 @@ export type LemmyErrorType = {
43
43
  error: "not_an_image_type";
44
44
  } | {
45
45
  error: "invalid_image_upload";
46
+ } | {
47
+ error: "image_upload_disabled";
46
48
  } | {
47
49
  error: "not_a_mod_or_admin";
48
50
  } | {
@@ -40,10 +40,6 @@ export type SaveUserSettings = {
40
40
  * The language of the lemmy interface
41
41
  */
42
42
  interface_language?: string;
43
- /**
44
- * A URL for your banner.
45
- */
46
- banner?: string;
47
43
  /**
48
44
  * Your display name, which can contain strange characters, and does not need to be unique.
49
45
  */
@@ -5,7 +5,7 @@ import type { SiteView } from "./SiteView";
5
5
  export type SiteResponse = {
6
6
  site_view: SiteView;
7
7
  /**
8
- * deprecated, use field `tagline` or /api/v3/tagline/list
8
+ * deprecated, use field `tagline` or /api/v4/tagline/list
9
9
  */
10
10
  taglines: Array<null>;
11
11
  };
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.20.0-image-api-rework.4",
4
+ "version": "0.20.0-image-api-rework.6",
5
5
  "author": "Dessalines <tyhou13@gmx.com>",
6
6
  "license": "AGPL-3.0",
7
7
  "main": "./dist/index.js",