lemmy-js-client 1.0.0-emoji-shortcode.1 → 1.0.0-errors-array.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.js +0 -1
- package/dist/index.d.ts +2 -1
- package/dist/types/AdminAllowInstance.d.ts +1 -1
- package/dist/types/AdminAllowInstanceParams.d.ts +1 -1
- package/dist/types/AdminBan.d.ts +1 -1
- package/dist/types/AdminBlockInstance.d.ts +1 -1
- package/dist/types/AdminBlockInstanceParams.d.ts +1 -1
- package/dist/types/AdminPurgeComment.d.ts +1 -1
- package/dist/types/AdminPurgeCommunity.d.ts +1 -1
- package/dist/types/AdminPurgePerson.d.ts +1 -1
- package/dist/types/AdminPurgePost.d.ts +1 -1
- package/dist/types/AdminRemoveCommunity.d.ts +1 -1
- package/dist/types/AllLemmyErrors.d.ts +116 -0
- package/dist/types/AllLemmyErrors.js +2 -0
- package/dist/types/BanFromCommunity.d.ts +1 -1
- package/dist/types/BanPerson.d.ts +1 -1
- package/dist/types/CreateCustomEmoji.d.ts +1 -2
- package/dist/types/CreateCustomEmoji.js +1 -0
- package/dist/types/CreateSite.d.ts +1 -0
- package/dist/types/EditCustomEmoji.d.ts +5 -7
- package/dist/types/EditSite.d.ts +4 -0
- package/dist/types/HideCommunity.d.ts +1 -1
- package/dist/types/LemmyErrorType.d.ts +0 -2
- package/dist/types/LocalSite.d.ts +6 -0
- package/dist/types/LocalUser.d.ts +13 -9
- package/dist/types/LockComment.d.ts +1 -4
- package/dist/types/LockPost.d.ts +1 -1
- package/dist/types/ModBanFromCommunity.d.ts +1 -1
- package/dist/types/ModLockComment.d.ts +5 -5
- package/dist/types/ModLockCommentView.d.ts +0 -2
- package/dist/types/ModLockPost.d.ts +1 -1
- package/dist/types/ModRemoveComment.d.ts +1 -1
- package/dist/types/ModRemovePost.d.ts +1 -1
- package/dist/types/Notification.d.ts +2 -2
- package/dist/types/NotificationTypes.d.ts +4 -0
- package/dist/types/Post.d.ts +0 -2
- package/dist/types/PostOrCommentOrPrivateMessage.d.ts +7 -7
- package/dist/types/PurgeComment.d.ts +1 -1
- package/dist/types/PurgeCommunity.d.ts +1 -1
- package/dist/types/PurgePerson.d.ts +1 -1
- package/dist/types/PurgePost.d.ts +1 -1
- package/dist/types/ReadableFederationState.d.ts +1 -1
- package/dist/types/RemoveComment.d.ts +1 -1
- package/dist/types/RemoveCommunity.d.ts +1 -1
- package/dist/types/RemovePost.d.ts +1 -1
- package/dist/types/SaveUserSettings.d.ts +5 -1
- package/package.json +2 -2
- package/dist/types/NotificationType.d.ts +0 -4
- /package/dist/types/{NotificationType.js → NotificationTypes.js} +0 -0
package/dist/http.js
CHANGED
|
@@ -1018,7 +1018,6 @@ _LemmyHttp_wrapper = async function _LemmyHttp_wrapper(type_, endpoint, form, op
|
|
|
1018
1018
|
throw new LemmyError(response.statusText);
|
|
1019
1019
|
}
|
|
1020
1020
|
if (!response.ok) {
|
|
1021
|
-
console.error(`Request error while calling ${type_} ${endpoint} with ${form}`);
|
|
1022
1021
|
let err = new LemmyError(json.error ?? response.statusText, json.message);
|
|
1023
1022
|
throw err;
|
|
1024
1023
|
}
|
package/dist/index.d.ts
CHANGED
|
@@ -36,6 +36,7 @@ export { AdminPurgePostView } from "./types/AdminPurgePostView";
|
|
|
36
36
|
export { AdminRemoveCommunity } from "./types/AdminRemoveCommunity";
|
|
37
37
|
export { AdminRemoveCommunityId } from "./types/AdminRemoveCommunityId";
|
|
38
38
|
export { AdminRemoveCommunityView } from "./types/AdminRemoveCommunityView";
|
|
39
|
+
export { AllLemmyErrors } from "./types/AllLemmyErrors";
|
|
39
40
|
export { ApproveCommunityPendingFollower } from "./types/ApproveCommunityPendingFollower";
|
|
40
41
|
export { ApproveRegistrationApplication } from "./types/ApproveRegistrationApplication";
|
|
41
42
|
export { AuthenticateWithOauth } from "./types/AuthenticateWithOauth";
|
|
@@ -260,7 +261,7 @@ export { Notification } from "./types/Notification";
|
|
|
260
261
|
export { NotificationData } from "./types/NotificationData";
|
|
261
262
|
export { NotificationDataType } from "./types/NotificationDataType";
|
|
262
263
|
export { NotificationId } from "./types/NotificationId";
|
|
263
|
-
export {
|
|
264
|
+
export { NotificationTypes } from "./types/NotificationTypes";
|
|
264
265
|
export { NotificationView } from "./types/NotificationView";
|
|
265
266
|
export { OAuthAccount } from "./types/OAuthAccount";
|
|
266
267
|
export { OAuthProvider } from "./types/OAuthProvider";
|
package/dist/types/AdminBan.d.ts
CHANGED
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
export type AllLemmyErrors = [
|
|
2
|
+
"block_keyword_too_short",
|
|
3
|
+
"block_keyword_too_long",
|
|
4
|
+
"couldnt_update",
|
|
5
|
+
"couldnt_create",
|
|
6
|
+
"report_reason_required",
|
|
7
|
+
"report_too_long",
|
|
8
|
+
"not_a_moderator",
|
|
9
|
+
"not_an_admin",
|
|
10
|
+
"cant_block_yourself",
|
|
11
|
+
"cant_note_yourself",
|
|
12
|
+
"cant_block_admin",
|
|
13
|
+
"passwords_do_not_match",
|
|
14
|
+
"email_not_verified",
|
|
15
|
+
"email_required",
|
|
16
|
+
"cannot_leave_admin",
|
|
17
|
+
"cannot_leave_admin",
|
|
18
|
+
"cannot_leave_admin",
|
|
19
|
+
"image_url_missing_path_segments",
|
|
20
|
+
"image_url_missing_last_path_segment",
|
|
21
|
+
"pictrs_api_key_not_provided",
|
|
22
|
+
"no_content_type_header",
|
|
23
|
+
"not_an_image_type",
|
|
24
|
+
"invalid_image_upload",
|
|
25
|
+
"image_upload_disabled",
|
|
26
|
+
"not_a_mod_or_admin",
|
|
27
|
+
"not_top_mod",
|
|
28
|
+
"not_logged_in",
|
|
29
|
+
"not_higher_mod",
|
|
30
|
+
"not_higher_admin",
|
|
31
|
+
"site_ban",
|
|
32
|
+
"deleted",
|
|
33
|
+
"person_is_blocked",
|
|
34
|
+
"community_is_blocked",
|
|
35
|
+
"instance_is_blocked",
|
|
36
|
+
"instance_is_private",
|
|
37
|
+
"invalid_password",
|
|
38
|
+
"site_description_length_overflow",
|
|
39
|
+
"honeypot_failed",
|
|
40
|
+
"registration_application_is_pending",
|
|
41
|
+
"locked",
|
|
42
|
+
"max_comment_depth_reached",
|
|
43
|
+
"no_comment_edit_allowed",
|
|
44
|
+
"only_admins_can_create_communities",
|
|
45
|
+
"already_exists",
|
|
46
|
+
"language_not_allowed",
|
|
47
|
+
"no_post_edit_allowed",
|
|
48
|
+
"nsfw_not_allowed",
|
|
49
|
+
"edit_private_message_not_allowed",
|
|
50
|
+
"application_question_required",
|
|
51
|
+
"invalid_default_post_listing_type",
|
|
52
|
+
"registration_closed",
|
|
53
|
+
"registration_application_answer_required",
|
|
54
|
+
"registration_username_required",
|
|
55
|
+
"email_already_taken",
|
|
56
|
+
"username_already_taken",
|
|
57
|
+
"person_is_banned_from_community",
|
|
58
|
+
"no_id_given",
|
|
59
|
+
"incorrect_login",
|
|
60
|
+
"no_email_setup",
|
|
61
|
+
"local_site_not_setup",
|
|
62
|
+
"local_site_not_setup",
|
|
63
|
+
"invalid_name",
|
|
64
|
+
"invalid_code_verifier",
|
|
65
|
+
"invalid_display_name",
|
|
66
|
+
"invalid_matrix_id",
|
|
67
|
+
"invalid_post_title",
|
|
68
|
+
"invalid_body_field",
|
|
69
|
+
"bio_length_overflow",
|
|
70
|
+
"alt_text_length_overflow",
|
|
71
|
+
"couldnt_parse_totp_secret",
|
|
72
|
+
"couldnt_generate_totp",
|
|
73
|
+
"missing_totp_token",
|
|
74
|
+
"missing_totp_secret",
|
|
75
|
+
"incorrect_totp_token",
|
|
76
|
+
"totp_already_enabled",
|
|
77
|
+
"blocked_url",
|
|
78
|
+
"invalid_url",
|
|
79
|
+
"email_send_failed",
|
|
80
|
+
"slurs",
|
|
81
|
+
"slurs",
|
|
82
|
+
"site_name_required",
|
|
83
|
+
"site_name_length_overflow",
|
|
84
|
+
"permissive_regex",
|
|
85
|
+
"invalid_regex",
|
|
86
|
+
"captcha_incorrect",
|
|
87
|
+
"couldnt_create_audio_captcha",
|
|
88
|
+
"couldnt_create_image_captcha",
|
|
89
|
+
"invalid_url_scheme",
|
|
90
|
+
"couldnt_send_webmention",
|
|
91
|
+
"contradicting_filters",
|
|
92
|
+
"too_many_items",
|
|
93
|
+
"ban_expiration_in_past",
|
|
94
|
+
"invalid_unix_time",
|
|
95
|
+
"invalid_bot_action",
|
|
96
|
+
"tag_not_in_community",
|
|
97
|
+
"cant_block_local_instance",
|
|
98
|
+
"cant_block_local_instance",
|
|
99
|
+
"url_length_overflow",
|
|
100
|
+
"oauth_authorization_invalid",
|
|
101
|
+
"oauth_login_failed",
|
|
102
|
+
"oauth_registration_closed",
|
|
103
|
+
"not_found",
|
|
104
|
+
"community_has_no_followers",
|
|
105
|
+
"post_schedule_time_must_be_in_future",
|
|
106
|
+
"too_many_scheduled_posts",
|
|
107
|
+
"cannot_combine_federation_blocklist_and_allowlist",
|
|
108
|
+
"cannot_combine_federation_blocklist_and_allowlist",
|
|
109
|
+
"couldnt_parse_pagination_token",
|
|
110
|
+
"couldnt_parse_pagination_token",
|
|
111
|
+
"invalid_fetch_limit",
|
|
112
|
+
"email_notifications_disabled",
|
|
113
|
+
"multi_community_update_wrong_user",
|
|
114
|
+
"cannot_combine_community_id_and_multi_community_id",
|
|
115
|
+
"multi_community_entry_limit_reached"
|
|
116
|
+
];
|
|
@@ -12,7 +12,7 @@ export type BanFromCommunity = {
|
|
|
12
12
|
* If ban is true, then this means remove. If ban is false, it means restore.
|
|
13
13
|
*/
|
|
14
14
|
remove_or_restore_data?: boolean;
|
|
15
|
-
reason
|
|
15
|
+
reason?: string;
|
|
16
16
|
/**
|
|
17
17
|
* A time that the ban will expire, in unix epoch seconds.
|
|
18
18
|
*
|
|
@@ -10,7 +10,7 @@ export type BanPerson = {
|
|
|
10
10
|
* If ban is true, then this means remove. If ban is false, it means restore.
|
|
11
11
|
*/
|
|
12
12
|
remove_or_restore_data?: boolean;
|
|
13
|
-
reason
|
|
13
|
+
reason?: string;
|
|
14
14
|
/**
|
|
15
15
|
* A time that the ban will expire, in unix epoch seconds.
|
|
16
16
|
*
|
|
@@ -27,6 +27,7 @@ export type CreateSite = {
|
|
|
27
27
|
application_email_admins?: boolean;
|
|
28
28
|
discussion_languages?: Array<LanguageId>;
|
|
29
29
|
slur_filter_regex?: string;
|
|
30
|
+
actor_name_max_length?: number;
|
|
30
31
|
rate_limit_message_max_requests?: number;
|
|
31
32
|
rate_limit_message_interval_seconds?: number;
|
|
32
33
|
rate_limit_post_max_requests?: number;
|
|
@@ -1,13 +1,11 @@
|
|
|
1
1
|
import type { CustomEmojiId } from "./CustomEmojiId";
|
|
2
|
-
import type { DbUrl } from "./DbUrl";
|
|
3
2
|
/**
|
|
4
|
-
* Edit
|
|
3
|
+
* Edit a custom emoji.
|
|
5
4
|
*/
|
|
6
5
|
export type EditCustomEmoji = {
|
|
7
6
|
id: CustomEmojiId;
|
|
8
|
-
category
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
keywords?: Array<string>;
|
|
7
|
+
category: string;
|
|
8
|
+
image_url: string;
|
|
9
|
+
alt_text: string;
|
|
10
|
+
keywords: Array<string>;
|
|
13
11
|
};
|
package/dist/types/EditSite.d.ts
CHANGED
|
@@ -79,6 +79,10 @@ export type EditSite = {
|
|
|
79
79
|
* A regex string of items to filter.
|
|
80
80
|
*/
|
|
81
81
|
slur_filter_regex?: string;
|
|
82
|
+
/**
|
|
83
|
+
* The max length of actor names.
|
|
84
|
+
*/
|
|
85
|
+
actor_name_max_length?: number;
|
|
82
86
|
/**
|
|
83
87
|
* The number of messages allowed in a given time frame.
|
|
84
88
|
*/
|
|
@@ -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";
|
|
@@ -50,6 +51,10 @@ export type LocalSite = {
|
|
|
50
51
|
* An optional regex to filter words.
|
|
51
52
|
*/
|
|
52
53
|
slur_filter_regex?: string;
|
|
54
|
+
/**
|
|
55
|
+
* The max actor name length.
|
|
56
|
+
*/
|
|
57
|
+
actor_name_max_length: number;
|
|
53
58
|
/**
|
|
54
59
|
* Whether federation is enabled.
|
|
55
60
|
*/
|
|
@@ -139,5 +144,6 @@ export type LocalSite = {
|
|
|
139
144
|
*/
|
|
140
145
|
disable_email_notifications: boolean;
|
|
141
146
|
suggested_communities?: MultiCommunityId;
|
|
147
|
+
multi_comm_follower: PersonId;
|
|
142
148
|
default_items_per_page: number;
|
|
143
149
|
};
|
|
@@ -63,29 +63,33 @@ 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
|
|
69
73
|
*/
|
|
70
74
|
enable_animated_images: boolean;
|
|
71
|
-
/**
|
|
72
|
-
* Whether to auto-collapse bot comments.
|
|
73
|
-
*/
|
|
74
|
-
collapse_bot_comments: boolean;
|
|
75
|
-
/**
|
|
76
|
-
* The last time a donation request was shown to this user. If this is more than a year ago,
|
|
77
|
-
* a new notification request should be shown.
|
|
78
|
-
*/
|
|
79
|
-
last_donation_notification_at: string;
|
|
80
75
|
/**
|
|
81
76
|
* Whether a user can send / receive private messages
|
|
82
77
|
*/
|
|
83
78
|
enable_private_messages: boolean;
|
|
79
|
+
/**
|
|
80
|
+
* Whether to auto-collapse bot comments.
|
|
81
|
+
*/
|
|
82
|
+
collapse_bot_comments: boolean;
|
|
84
83
|
default_comment_sort_type: CommentSortType;
|
|
85
84
|
/**
|
|
86
85
|
* Whether to automatically mark fetched posts as read.
|
|
87
86
|
*/
|
|
88
87
|
auto_mark_fetched_posts_as_read: boolean;
|
|
88
|
+
/**
|
|
89
|
+
* The last time a donation request was shown to this user. If this is more than a year ago,
|
|
90
|
+
* a new notification request should be shown.
|
|
91
|
+
*/
|
|
92
|
+
last_donation_notification_at: string;
|
|
89
93
|
/**
|
|
90
94
|
* Whether to hide posts containing images/videos
|
|
91
95
|
*/
|
package/dist/types/LockPost.d.ts
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
import type { ModLockCommentId } from "./ModLockCommentId";
|
|
1
|
+
import type { ModLockPostId } from "./ModLockPostId";
|
|
3
2
|
import type { PersonId } from "./PersonId";
|
|
3
|
+
import type { PostId } from "./PostId";
|
|
4
4
|
/**
|
|
5
5
|
* When a moderator locks a comment (prevents new replies to a comment or its children).
|
|
6
6
|
*/
|
|
7
7
|
export type ModLockComment = {
|
|
8
|
-
id:
|
|
8
|
+
id: ModLockPostId;
|
|
9
9
|
mod_person_id: PersonId;
|
|
10
|
-
comment_id:
|
|
10
|
+
comment_id: PostId;
|
|
11
11
|
locked: boolean;
|
|
12
|
-
reason
|
|
12
|
+
reason?: string;
|
|
13
13
|
published_at: string;
|
|
14
14
|
};
|
|
@@ -2,7 +2,6 @@ import type { Comment } from "./Comment";
|
|
|
2
2
|
import type { Community } from "./Community";
|
|
3
3
|
import type { ModLockComment } from "./ModLockComment";
|
|
4
4
|
import type { Person } from "./Person";
|
|
5
|
-
import type { Post } from "./Post";
|
|
6
5
|
/**
|
|
7
6
|
* When a moderator locks a comment (prevents replies to it or its children).
|
|
8
7
|
*/
|
|
@@ -11,6 +10,5 @@ export type ModLockCommentView = {
|
|
|
11
10
|
moderator?: Person;
|
|
12
11
|
other_person: Person;
|
|
13
12
|
comment: Comment;
|
|
14
|
-
post: Post;
|
|
15
13
|
community: Community;
|
|
16
14
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { CommentId } from "./CommentId";
|
|
2
2
|
import type { NotificationId } from "./NotificationId";
|
|
3
|
-
import type {
|
|
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:
|
|
13
|
+
kind: NotificationTypes;
|
|
14
14
|
post_id?: PostId;
|
|
15
15
|
private_message_id?: PrivateMessageId;
|
|
16
16
|
};
|
package/dist/types/Post.d.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import type { Comment } from "./Comment";
|
|
2
2
|
import type { Post } from "./Post";
|
|
3
3
|
import type { PrivateMessage } from "./PrivateMessage";
|
|
4
|
-
export type PostOrCommentOrPrivateMessage =
|
|
5
|
-
|
|
6
|
-
}
|
|
7
|
-
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
}
|
|
4
|
+
export type PostOrCommentOrPrivateMessage = {
|
|
5
|
+
Post: Post;
|
|
6
|
+
} | {
|
|
7
|
+
Comment: Comment;
|
|
8
|
+
} | {
|
|
9
|
+
PrivateMessage: PrivateMessage;
|
|
10
|
+
};
|
|
@@ -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
|
|
@@ -114,7 +118,7 @@ export type SaveUserSettings = {
|
|
|
114
118
|
/**
|
|
115
119
|
* Some vote display mode settings
|
|
116
120
|
*/
|
|
117
|
-
|
|
121
|
+
show_scores?: boolean;
|
|
118
122
|
show_upvotes?: boolean;
|
|
119
123
|
show_downvotes?: VoteShow;
|
|
120
124
|
show_upvote_percentage?: boolean;
|
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-
|
|
4
|
+
"version": "1.0.0-errors-array.0",
|
|
5
5
|
"author": "Dessalines",
|
|
6
6
|
"license": "AGPL-3.0",
|
|
7
7
|
"main": "./dist/index.js",
|
|
@@ -44,7 +44,7 @@
|
|
|
44
44
|
"typescript": "^5.5.4",
|
|
45
45
|
"typescript-eslint": "^8.7.0"
|
|
46
46
|
},
|
|
47
|
-
"packageManager": "pnpm@10.
|
|
47
|
+
"packageManager": "pnpm@10.15.1",
|
|
48
48
|
"types": "./dist/index.d.ts",
|
|
49
49
|
"lint-staged": {
|
|
50
50
|
"*.{ts,tsx,js}": [
|
|
File without changes
|