lemmy-js-client 1.0.0-emoji-shortcode.1 → 1.0.0-emoji-shortcode.2
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 +3 -2
- package/dist/http.js +5 -4
- package/dist/index.d.ts +1 -0
- package/dist/index.js +3 -0
- package/dist/types/AllLemmyErrors.d.ts +1 -0
- package/dist/types/AllLemmyErrors.js +119 -0
- package/package.json +2 -2
package/dist/http.d.ts
CHANGED
|
@@ -525,7 +525,7 @@ export declare class LemmyHttp extends Controller {
|
|
|
525
525
|
*/
|
|
526
526
|
markAllNotificationsAsRead(options?: RequestOptions): Promise<SuccessResponse>;
|
|
527
527
|
/**
|
|
528
|
-
* @summary Mark a
|
|
528
|
+
* @summary Mark a notification as read.
|
|
529
529
|
*/
|
|
530
530
|
markNotificationAsRead(form: MarkNotificationAsRead, options?: RequestOptions): Promise<SuccessResponse>;
|
|
531
531
|
/**
|
|
@@ -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
|
-
|
|
784
|
+
status: number;
|
|
785
|
+
constructor(name: string, status: number, msg?: string);
|
|
785
786
|
}
|
|
786
787
|
export {};
|
package/dist/http.js
CHANGED
|
@@ -587,7 +587,7 @@ let LemmyHttp = class LemmyHttp extends runtime_1.Controller {
|
|
|
587
587
|
return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Post, "/account/mark_as_read/all", {}, options);
|
|
588
588
|
}
|
|
589
589
|
/**
|
|
590
|
-
* @summary Mark a
|
|
590
|
+
* @summary Mark a notification as read.
|
|
591
591
|
*/
|
|
592
592
|
async markNotificationAsRead(form, options) {
|
|
593
593
|
return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Post, "/account/mark_as_read", form, options);
|
|
@@ -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
|
@@ -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";
|
package/dist/index.js
CHANGED
|
@@ -14,4 +14,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
14
14
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
exports.AllLemmyErrors = void 0;
|
|
17
18
|
__exportStar(require("./http"), exports);
|
|
19
|
+
var AllLemmyErrors_1 = require("./types/AllLemmyErrors");
|
|
20
|
+
Object.defineProperty(exports, "AllLemmyErrors", { enumerable: true, get: function () { return AllLemmyErrors_1.AllLemmyErrors; } });
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare let AllLemmyErrors: string[];
|
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.AllLemmyErrors = void 0;
|
|
4
|
+
exports.AllLemmyErrors = [
|
|
5
|
+
"block_keyword_too_short",
|
|
6
|
+
"block_keyword_too_long",
|
|
7
|
+
"couldnt_update",
|
|
8
|
+
"couldnt_create",
|
|
9
|
+
"report_reason_required",
|
|
10
|
+
"report_too_long",
|
|
11
|
+
"not_a_moderator",
|
|
12
|
+
"not_an_admin",
|
|
13
|
+
"cant_block_yourself",
|
|
14
|
+
"cant_note_yourself",
|
|
15
|
+
"cant_block_admin",
|
|
16
|
+
"passwords_do_not_match",
|
|
17
|
+
"email_not_verified",
|
|
18
|
+
"email_required",
|
|
19
|
+
"cannot_leave_admin",
|
|
20
|
+
"cannot_leave_admin",
|
|
21
|
+
"cannot_leave_admin",
|
|
22
|
+
"image_url_missing_path_segments",
|
|
23
|
+
"image_url_missing_last_path_segment",
|
|
24
|
+
"pictrs_api_key_not_provided",
|
|
25
|
+
"no_content_type_header",
|
|
26
|
+
"not_an_image_type",
|
|
27
|
+
"invalid_image_upload",
|
|
28
|
+
"image_upload_disabled",
|
|
29
|
+
"not_a_mod_or_admin",
|
|
30
|
+
"not_top_mod",
|
|
31
|
+
"not_logged_in",
|
|
32
|
+
"not_higher_mod",
|
|
33
|
+
"not_higher_admin",
|
|
34
|
+
"site_ban",
|
|
35
|
+
"deleted",
|
|
36
|
+
"person_is_blocked",
|
|
37
|
+
"community_is_blocked",
|
|
38
|
+
"instance_is_blocked",
|
|
39
|
+
"instance_is_private",
|
|
40
|
+
"invalid_password",
|
|
41
|
+
"site_description_length_overflow",
|
|
42
|
+
"honeypot_failed",
|
|
43
|
+
"registration_application_is_pending",
|
|
44
|
+
"locked",
|
|
45
|
+
"max_comment_depth_reached",
|
|
46
|
+
"no_comment_edit_allowed",
|
|
47
|
+
"only_admins_can_create_communities",
|
|
48
|
+
"already_exists",
|
|
49
|
+
"language_not_allowed",
|
|
50
|
+
"no_post_edit_allowed",
|
|
51
|
+
"nsfw_not_allowed",
|
|
52
|
+
"edit_private_message_not_allowed",
|
|
53
|
+
"application_question_required",
|
|
54
|
+
"invalid_default_post_listing_type",
|
|
55
|
+
"registration_closed",
|
|
56
|
+
"registration_application_answer_required",
|
|
57
|
+
"registration_username_required",
|
|
58
|
+
"email_already_taken",
|
|
59
|
+
"username_already_taken",
|
|
60
|
+
"person_is_banned_from_community",
|
|
61
|
+
"no_id_given",
|
|
62
|
+
"incorrect_login",
|
|
63
|
+
"no_email_setup",
|
|
64
|
+
"local_site_not_setup",
|
|
65
|
+
"local_site_not_setup",
|
|
66
|
+
"invalid_name",
|
|
67
|
+
"invalid_code_verifier",
|
|
68
|
+
"invalid_display_name",
|
|
69
|
+
"invalid_matrix_id",
|
|
70
|
+
"invalid_post_title",
|
|
71
|
+
"invalid_body_field",
|
|
72
|
+
"bio_length_overflow",
|
|
73
|
+
"alt_text_length_overflow",
|
|
74
|
+
"couldnt_parse_totp_secret",
|
|
75
|
+
"couldnt_generate_totp",
|
|
76
|
+
"missing_totp_token",
|
|
77
|
+
"missing_totp_secret",
|
|
78
|
+
"incorrect_totp_token",
|
|
79
|
+
"totp_already_enabled",
|
|
80
|
+
"blocked_url",
|
|
81
|
+
"invalid_url",
|
|
82
|
+
"email_send_failed",
|
|
83
|
+
"slurs",
|
|
84
|
+
"slurs",
|
|
85
|
+
"site_name_required",
|
|
86
|
+
"site_name_length_overflow",
|
|
87
|
+
"permissive_regex",
|
|
88
|
+
"invalid_regex",
|
|
89
|
+
"captcha_incorrect",
|
|
90
|
+
"couldnt_create_audio_captcha",
|
|
91
|
+
"couldnt_create_image_captcha",
|
|
92
|
+
"invalid_url_scheme",
|
|
93
|
+
"couldnt_send_webmention",
|
|
94
|
+
"contradicting_filters",
|
|
95
|
+
"too_many_items",
|
|
96
|
+
"ban_expiration_in_past",
|
|
97
|
+
"invalid_unix_time",
|
|
98
|
+
"invalid_bot_action",
|
|
99
|
+
"tag_not_in_community",
|
|
100
|
+
"cant_block_local_instance",
|
|
101
|
+
"cant_block_local_instance",
|
|
102
|
+
"url_length_overflow",
|
|
103
|
+
"oauth_authorization_invalid",
|
|
104
|
+
"oauth_login_failed",
|
|
105
|
+
"oauth_registration_closed",
|
|
106
|
+
"not_found",
|
|
107
|
+
"community_has_no_followers",
|
|
108
|
+
"post_schedule_time_must_be_in_future",
|
|
109
|
+
"too_many_scheduled_posts",
|
|
110
|
+
"cannot_combine_federation_blocklist_and_allowlist",
|
|
111
|
+
"cannot_combine_federation_blocklist_and_allowlist",
|
|
112
|
+
"couldnt_parse_pagination_token",
|
|
113
|
+
"couldnt_parse_pagination_token",
|
|
114
|
+
"invalid_fetch_limit",
|
|
115
|
+
"email_notifications_disabled",
|
|
116
|
+
"multi_community_update_wrong_user",
|
|
117
|
+
"cannot_combine_community_id_and_multi_community_id",
|
|
118
|
+
"multi_community_entry_limit_reached",
|
|
119
|
+
];
|
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.
|
|
4
|
+
"version": "1.0.0-emoji-shortcode.2",
|
|
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.17.1",
|
|
48
48
|
"types": "./dist/index.d.ts",
|
|
49
49
|
"lint-staged": {
|
|
50
50
|
"*.{ts,tsx,js}": [
|