lemmy-js-client 1.0.0-emoji-shortcode.1 → 1.0.0-error-status-code.0

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
@@ -781,6 +781,7 @@ export declare class LemmyHttp extends Controller {
781
781
  * The msg is either an empty string, or extra non-translatable info.
782
782
  */
783
783
  export declare class LemmyError extends Error {
784
- constructor(name: string, msg?: string);
784
+ status: number;
785
+ constructor(name: string, status: number, msg?: string);
785
786
  }
786
787
  export {};
package/dist/http.js CHANGED
@@ -1015,11 +1015,11 @@ _LemmyHttp_wrapper = async function _LemmyHttp_wrapper(type_, endpoint, form, op
1015
1015
  json = await response.json();
1016
1016
  }
1017
1017
  catch {
1018
- throw new LemmyError(response.statusText);
1018
+ throw new LemmyError(response.statusText, response.status);
1019
1019
  }
1020
1020
  if (!response.ok) {
1021
1021
  console.error(`Request error while calling ${type_} ${endpoint} with ${form}`);
1022
- let err = new LemmyError(json.error ?? response.statusText, json.message);
1022
+ let err = new LemmyError(json.error ?? response.statusText, response.status, json.message);
1023
1023
  throw err;
1024
1024
  }
1025
1025
  else {
@@ -2114,9 +2114,10 @@ function createFormData(image) {
2114
2114
  * The msg is either an empty string, or extra non-translatable info.
2115
2115
  */
2116
2116
  class LemmyError extends Error {
2117
- constructor(name, msg) {
2117
+ constructor(name, status, msg) {
2118
2118
  super(msg ?? "");
2119
2119
  this.name = name;
2120
+ this.status = status;
2120
2121
  // Set the prototype explicitly.
2121
2122
  Object.setPrototypeOf(this, LemmyError.prototype);
2122
2123
  }
package/dist/index.d.ts CHANGED
@@ -260,7 +260,7 @@ export { Notification } from "./types/Notification";
260
260
  export { NotificationData } from "./types/NotificationData";
261
261
  export { NotificationDataType } from "./types/NotificationDataType";
262
262
  export { NotificationId } from "./types/NotificationId";
263
- export { NotificationType } from "./types/NotificationType";
263
+ export { NotificationTypes } from "./types/NotificationTypes";
264
264
  export { NotificationView } from "./types/NotificationView";
265
265
  export { OAuthAccount } from "./types/OAuthAccount";
266
266
  export { OAuthProvider } from "./types/OAuthProvider";
@@ -1,11 +1,10 @@
1
- import type { DbUrl } from "./DbUrl";
2
1
  /**
3
2
  * Create a custom emoji.
4
3
  */
5
4
  export type CreateCustomEmoji = {
6
5
  category: string;
7
6
  shortcode: string;
8
- image_url: DbUrl;
7
+ image_url: string;
9
8
  alt_text: string;
10
9
  keywords: Array<string>;
11
10
  };
@@ -1,2 +1,3 @@
1
1
  "use strict";
2
+ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
2
3
  Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,13 +1,11 @@
1
1
  import type { CustomEmojiId } from "./CustomEmojiId";
2
- import type { DbUrl } from "./DbUrl";
3
2
  /**
4
- * Edit a custom emoji.
3
+ * Edit a custom emoji.
5
4
  */
6
5
  export type EditCustomEmoji = {
7
6
  id: CustomEmojiId;
8
- category?: string;
9
- shortcode?: string;
10
- image_url?: DbUrl;
11
- alt_text?: string;
12
- keywords?: Array<string>;
7
+ category: string;
8
+ image_url: string;
9
+ alt_text: string;
10
+ keywords: Array<string>;
13
11
  };
@@ -3,6 +3,7 @@ import type { FederationMode } from "./FederationMode";
3
3
  import type { ListingType } from "./ListingType";
4
4
  import type { LocalSiteId } from "./LocalSiteId";
5
5
  import type { MultiCommunityId } from "./MultiCommunityId";
6
+ import type { PersonId } from "./PersonId";
6
7
  import type { PostListingMode } from "./PostListingMode";
7
8
  import type { PostSortType } from "./PostSortType";
8
9
  import type { RegistrationMode } from "./RegistrationMode";
@@ -139,5 +140,6 @@ export type LocalSite = {
139
140
  */
140
141
  disable_email_notifications: boolean;
141
142
  suggested_communities?: MultiCommunityId;
143
+ multi_comm_follower: PersonId;
142
144
  default_items_per_page: number;
143
145
  };
@@ -63,6 +63,10 @@ export type LocalUser = {
63
63
  */
64
64
  post_listing_mode: PostListingMode;
65
65
  totp_2fa_enabled: boolean;
66
+ /**
67
+ * Whether to allow keyboard navigation (for browsing and interacting with posts and comments).
68
+ */
69
+ enable_keyboard_navigation: boolean;
66
70
  /**
67
71
  * Whether user avatars and inline images in the UI that are gifs should be allowed to play or
68
72
  * should be paused
@@ -1,6 +1,6 @@
1
1
  import type { CommentId } from "./CommentId";
2
2
  import type { NotificationId } from "./NotificationId";
3
- import type { NotificationType } from "./NotificationType";
3
+ import type { NotificationTypes } from "./NotificationTypes";
4
4
  import type { PersonId } from "./PersonId";
5
5
  import type { PostId } from "./PostId";
6
6
  import type { PrivateMessageId } from "./PrivateMessageId";
@@ -10,7 +10,7 @@ export type Notification = {
10
10
  comment_id?: CommentId;
11
11
  read: boolean;
12
12
  published_at: string;
13
- kind: NotificationType;
13
+ kind: NotificationTypes;
14
14
  post_id?: PostId;
15
15
  private_message_id?: PrivateMessageId;
16
16
  };
@@ -0,0 +1,4 @@
1
+ /**
2
+ * Types of notifications which can be received in inbox
3
+ */
4
+ export type NotificationTypes = "Mention" | "Reply" | "Subscribed" | "PrivateMessage";
@@ -4,7 +4,7 @@ export type ReadableFederationState = {
4
4
  /**
5
5
  * timestamp of the next retry attempt (null if fail count is 0)
6
6
  */
7
- next_retry_at?: string;
7
+ next_retry?: string;
8
8
  instance_id: InstanceId;
9
9
  /**
10
10
  * the last successfully sent activity id
@@ -98,6 +98,10 @@ export type SaveUserSettings = {
98
98
  * Enable infinite scroll
99
99
  */
100
100
  infinite_scroll_enabled?: boolean;
101
+ /**
102
+ * Whether to allow keyboard navigation (for browsing and interacting with posts and comments).
103
+ */
104
+ enable_keyboard_navigation?: boolean;
101
105
  /**
102
106
  * Whether user avatars or inline images in the UI that are gifs should be allowed to play or
103
107
  * should be paused
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-emoji-shortcode.1",
4
+ "version": "1.0.0-error-status-code.0",
5
5
  "author": "Dessalines",
6
6
  "license": "AGPL-3.0",
7
7
  "main": "./dist/index.js",
@@ -1,4 +0,0 @@
1
- /**
2
- * Types of notifications which can be received in inbox
3
- */
4
- export type NotificationType = "Mention" | "Reply" | "Subscribed" | "PrivateMessage";