lemmy-js-client 0.19.0-rc.12 → 0.19.0-rc.14
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 +54 -2
- package/dist/http.js +76 -1
- package/dist/index.d.ts +6 -1
- package/dist/types/CommentAggregates.d.ts +0 -2
- package/dist/types/CommunityAggregates.d.ts +0 -1
- package/dist/types/GenerateTotpSecretResponse.d.ts +3 -0
- package/dist/types/GenerateTotpSecretResponse.js +3 -0
- package/dist/types/LemmyErrorType.d.ts +165 -138
- package/dist/types/LocalSiteRateLimit.d.ts +2 -0
- package/dist/types/LocalUser.d.ts +3 -3
- package/dist/types/LoginToken.d.ts +8 -0
- package/dist/types/LoginToken.js +2 -0
- package/dist/types/MarkPostAsRead.d.ts +2 -1
- package/dist/types/ModRemoveCommunity.d.ts +0 -1
- package/dist/types/PostAggregates.d.ts +0 -14
- package/dist/types/RemoveCommunity.d.ts +0 -1
- package/dist/types/SaveUserSettings.d.ts +4 -1
- package/dist/types/SuccessResponse.d.ts +3 -0
- package/dist/types/SuccessResponse.js +3 -0
- package/dist/types/UpdateTotp.d.ts +4 -0
- package/dist/types/UpdateTotp.js +3 -0
- package/dist/types/UpdateTotpResponse.d.ts +3 -0
- package/dist/types/UpdateTotpResponse.js +3 -0
- package/dist/types/others.d.ts +8 -0
- package/package.json +1 -1
package/dist/http.d.ts
CHANGED
@@ -124,10 +124,15 @@ import { SiteResponse } from "./types/SiteResponse";
|
|
124
124
|
import { TransferCommunity } from "./types/TransferCommunity";
|
125
125
|
import { VerifyEmail } from "./types/VerifyEmail";
|
126
126
|
import { VerifyEmailResponse } from "./types/VerifyEmailResponse";
|
127
|
-
import { UploadImage, UploadImageResponse } from "./types/others";
|
127
|
+
import { DeleteImage, UploadImage, UploadImageResponse } from "./types/others";
|
128
128
|
import { HideCommunity } from "./types/HideCommunity";
|
129
129
|
import { BlockInstance } from "./types/BlockInstance";
|
130
130
|
import { BlockInstanceResponse } from "./types/BlockInstanceResponse";
|
131
|
+
import { GenerateTotpSecretResponse } from "./types/GenerateTotpSecretResponse";
|
132
|
+
import { UpdateTotp } from "./types/UpdateTotp";
|
133
|
+
import { UpdateTotpResponse } from "./types/UpdateTotpResponse";
|
134
|
+
import { SuccessResponse } from "./types/SuccessResponse";
|
135
|
+
import { LoginToken } from "./types/LoginToken";
|
131
136
|
/**
|
132
137
|
* Helps build lemmy HTTP requests.
|
133
138
|
*/
|
@@ -168,6 +173,49 @@ export declare class LemmyHttp {
|
|
168
173
|
* `HTTP.POST /user/leave_admin`
|
169
174
|
*/
|
170
175
|
leaveAdmin(): Promise<GetSiteResponse>;
|
176
|
+
/**
|
177
|
+
* Generate a TOTP / two-factor secret.
|
178
|
+
*
|
179
|
+
* Afterwards you need to call `/user/totp/update` with a valid token to enable it.
|
180
|
+
*
|
181
|
+
* `HTTP.POST /user/totp/generate`
|
182
|
+
*/
|
183
|
+
generateTotpSecret(): Promise<GenerateTotpSecretResponse>;
|
184
|
+
/**
|
185
|
+
* Export a backup of your user settings, including your saved content,
|
186
|
+
* followed communities, and blocks.
|
187
|
+
*
|
188
|
+
* `HTTP.GET /user/export_settings`
|
189
|
+
*/
|
190
|
+
exportSettings(): Promise<any>;
|
191
|
+
/**
|
192
|
+
* Import a backup of your user settings.
|
193
|
+
*
|
194
|
+
* `HTTP.POST /user/import_settings`
|
195
|
+
*/
|
196
|
+
importSettings(form: any): Promise<SuccessResponse>;
|
197
|
+
/**
|
198
|
+
* List login tokens for your user
|
199
|
+
*
|
200
|
+
* `HTTP.GET /user/list_logins`
|
201
|
+
*/
|
202
|
+
listLogins(): Promise<LoginToken[]>;
|
203
|
+
/**
|
204
|
+
* Returns an error message if your auth token is invalid
|
205
|
+
*
|
206
|
+
* `HTTP.GET /user/validate_auth`
|
207
|
+
*/
|
208
|
+
validateAuth(): Promise<SuccessResponse>;
|
209
|
+
/**
|
210
|
+
* Enable / Disable TOTP / two-factor authentication.
|
211
|
+
*
|
212
|
+
* To enable, you need to first call `/user/totp/generate` and then pass a valid token to this.
|
213
|
+
*
|
214
|
+
* Disabling is only possible if 2FA was previously enabled. Again it is necessary to pass a valid token.
|
215
|
+
*
|
216
|
+
* `HTTP.POST /user/totp/update`
|
217
|
+
*/
|
218
|
+
updateTotp(form: UpdateTotp): Promise<UpdateTotpResponse>;
|
171
219
|
/**
|
172
220
|
* Get the modlog.
|
173
221
|
*
|
@@ -229,7 +277,7 @@ export declare class LemmyHttp {
|
|
229
277
|
*/
|
230
278
|
deleteCommunity(form: DeleteCommunity): Promise<CommunityResponse>;
|
231
279
|
/**
|
232
|
-
* Hide a community from public view.
|
280
|
+
* Hide a community from public / "All" view. Admins only.
|
233
281
|
*
|
234
282
|
* `HTTP.PUT /community/hide`
|
235
283
|
*/
|
@@ -670,6 +718,10 @@ export declare class LemmyHttp {
|
|
670
718
|
* Upload an image to the server.
|
671
719
|
*/
|
672
720
|
uploadImage({ image, auth, }: UploadImage): Promise<UploadImageResponse>;
|
721
|
+
/**
|
722
|
+
* Delete a pictrs image
|
723
|
+
*/
|
724
|
+
deleteImage({ token, filename, auth }: DeleteImage): Promise<any>;
|
673
725
|
/**
|
674
726
|
* Set the headers (can be used to set the auth header)
|
675
727
|
*/
|
package/dist/http.js
CHANGED
@@ -90,6 +90,61 @@ class LemmyHttp {
|
|
90
90
|
leaveAdmin() {
|
91
91
|
return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Post, "/user/leave_admin", {});
|
92
92
|
}
|
93
|
+
/**
|
94
|
+
* Generate a TOTP / two-factor secret.
|
95
|
+
*
|
96
|
+
* Afterwards you need to call `/user/totp/update` with a valid token to enable it.
|
97
|
+
*
|
98
|
+
* `HTTP.POST /user/totp/generate`
|
99
|
+
*/
|
100
|
+
generateTotpSecret() {
|
101
|
+
return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Post, "/user/totp/generate", {});
|
102
|
+
}
|
103
|
+
/**
|
104
|
+
* Export a backup of your user settings, including your saved content,
|
105
|
+
* followed communities, and blocks.
|
106
|
+
*
|
107
|
+
* `HTTP.GET /user/export_settings`
|
108
|
+
*/
|
109
|
+
exportSettings() {
|
110
|
+
return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Get, "/user/export_settings", {});
|
111
|
+
}
|
112
|
+
/**
|
113
|
+
* Import a backup of your user settings.
|
114
|
+
*
|
115
|
+
* `HTTP.POST /user/import_settings`
|
116
|
+
*/
|
117
|
+
importSettings(form) {
|
118
|
+
return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Post, "/user/import_settings", form);
|
119
|
+
}
|
120
|
+
/**
|
121
|
+
* List login tokens for your user
|
122
|
+
*
|
123
|
+
* `HTTP.GET /user/list_logins`
|
124
|
+
*/
|
125
|
+
listLogins() {
|
126
|
+
return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Get, "/user/list_logins", {});
|
127
|
+
}
|
128
|
+
/**
|
129
|
+
* Returns an error message if your auth token is invalid
|
130
|
+
*
|
131
|
+
* `HTTP.GET /user/validate_auth`
|
132
|
+
*/
|
133
|
+
validateAuth() {
|
134
|
+
return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Get, "/user/validate_auth", {});
|
135
|
+
}
|
136
|
+
/**
|
137
|
+
* Enable / Disable TOTP / two-factor authentication.
|
138
|
+
*
|
139
|
+
* To enable, you need to first call `/user/totp/generate` and then pass a valid token to this.
|
140
|
+
*
|
141
|
+
* Disabling is only possible if 2FA was previously enabled. Again it is necessary to pass a valid token.
|
142
|
+
*
|
143
|
+
* `HTTP.POST /user/totp/update`
|
144
|
+
*/
|
145
|
+
updateTotp(form) {
|
146
|
+
return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Post, "/user/totp/update", form);
|
147
|
+
}
|
93
148
|
/**
|
94
149
|
* Get the modlog.
|
95
150
|
*
|
@@ -171,7 +226,7 @@ class LemmyHttp {
|
|
171
226
|
return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Post, "/community/delete", form);
|
172
227
|
}
|
173
228
|
/**
|
174
|
-
* Hide a community from public view.
|
229
|
+
* Hide a community from public / "All" view. Admins only.
|
175
230
|
*
|
176
231
|
* `HTTP.PUT /community/hide`
|
177
232
|
*/
|
@@ -787,6 +842,26 @@ class LemmyHttp {
|
|
787
842
|
delete_url });
|
788
843
|
});
|
789
844
|
}
|
845
|
+
/**
|
846
|
+
* Delete a pictrs image
|
847
|
+
*/
|
848
|
+
deleteImage({ token, filename, auth }) {
|
849
|
+
var _a, _b, _c, _d;
|
850
|
+
return __awaiter(this, void 0, void 0, function* () {
|
851
|
+
// If auth cookie not already set by browser, set it with passed in auth
|
852
|
+
const headers = {};
|
853
|
+
if (!((_b = (_a = globalThis === null || globalThis === void 0 ? void 0 : globalThis.document) === null || _a === void 0 ? void 0 : _a.cookie) === null || _b === void 0 ? void 0 : _b.includes("auth=")) &&
|
854
|
+
!((_d = (_c = __classPrivateFieldGet(this, _LemmyHttp_headers, "f")) === null || _c === void 0 ? void 0 : _c.Cookie) === null || _d === void 0 ? void 0 : _d.includes("auth="))) {
|
855
|
+
headers.Cookie = `auth=${auth}`;
|
856
|
+
}
|
857
|
+
const deleteUrl = `${__classPrivateFieldGet(this, _LemmyHttp_pictrsUrl, "f")}/delete/${token}/${filename}`;
|
858
|
+
const response = yield __classPrivateFieldGet(this, _LemmyHttp_fetchFunction, "f").call(this, deleteUrl, {
|
859
|
+
method: HttpType.Get,
|
860
|
+
headers: Object.assign(Object.assign({}, __classPrivateFieldGet(this, _LemmyHttp_headers, "f")), headers),
|
861
|
+
});
|
862
|
+
return yield response.json();
|
863
|
+
});
|
864
|
+
}
|
790
865
|
/**
|
791
866
|
* Set the headers (can be used to set the auth header)
|
792
867
|
*/
|
package/dist/index.d.ts
CHANGED
@@ -82,6 +82,7 @@ export { EditSite } from "./types/EditSite";
|
|
82
82
|
export { FeaturePost } from "./types/FeaturePost";
|
83
83
|
export { FederatedInstances } from "./types/FederatedInstances";
|
84
84
|
export { FollowCommunity } from "./types/FollowCommunity";
|
85
|
+
export { GenerateTotpSecretResponse } from "./types/GenerateTotpSecretResponse";
|
85
86
|
export { GetCaptchaResponse } from "./types/GetCaptchaResponse";
|
86
87
|
export { GetComment } from "./types/GetComment";
|
87
88
|
export { GetComments } from "./types/GetComments";
|
@@ -138,6 +139,7 @@ export { LocalUserView } from "./types/LocalUserView";
|
|
138
139
|
export { LockPost } from "./types/LockPost";
|
139
140
|
export { Login } from "./types/Login";
|
140
141
|
export { LoginResponse } from "./types/LoginResponse";
|
142
|
+
export { LoginToken } from "./types/LoginToken";
|
141
143
|
export { MarkCommentReplyAsRead } from "./types/MarkCommentReplyAsRead";
|
142
144
|
export { MarkPersonMentionAsRead } from "./types/MarkPersonMentionAsRead";
|
143
145
|
export { MarkPostAsRead } from "./types/MarkPostAsRead";
|
@@ -234,8 +236,11 @@ export { SiteResponse } from "./types/SiteResponse";
|
|
234
236
|
export { SiteView } from "./types/SiteView";
|
235
237
|
export { SortType } from "./types/SortType";
|
236
238
|
export { SubscribedType } from "./types/SubscribedType";
|
239
|
+
export { SuccessResponse } from "./types/SuccessResponse";
|
237
240
|
export { Tagline } from "./types/Tagline";
|
238
241
|
export { TransferCommunity } from "./types/TransferCommunity";
|
242
|
+
export { UpdateTotp } from "./types/UpdateTotp";
|
243
|
+
export { UpdateTotpResponse } from "./types/UpdateTotpResponse";
|
239
244
|
export { VerifyEmail } from "./types/VerifyEmail";
|
240
245
|
export { VerifyEmailResponse } from "./types/VerifyEmailResponse";
|
241
|
-
export { UploadImage, UploadImageResponse, ImageFile } from "./types/others";
|
246
|
+
export { UploadImage, UploadImageResponse, ImageFile, DeleteImage, } from "./types/others";
|
@@ -1,277 +1,304 @@
|
|
1
1
|
export type LemmyErrorType = {
|
2
|
-
|
2
|
+
error: "report_reason_required";
|
3
3
|
} | {
|
4
|
-
|
4
|
+
error: "report_too_long";
|
5
5
|
} | {
|
6
|
-
|
6
|
+
error: "not_a_moderator";
|
7
7
|
} | {
|
8
|
-
|
8
|
+
error: "not_an_admin";
|
9
9
|
} | {
|
10
|
-
|
10
|
+
error: "cant_block_yourself";
|
11
11
|
} | {
|
12
|
-
|
12
|
+
error: "cant_block_admin";
|
13
13
|
} | {
|
14
|
-
|
14
|
+
error: "couldnt_update_user";
|
15
15
|
} | {
|
16
|
-
|
16
|
+
error: "passwords_do_not_match";
|
17
17
|
} | {
|
18
|
-
|
18
|
+
error: "email_not_verified";
|
19
19
|
} | {
|
20
|
-
|
20
|
+
error: "email_required";
|
21
21
|
} | {
|
22
|
-
|
22
|
+
error: "couldnt_update_comment";
|
23
23
|
} | {
|
24
|
-
|
24
|
+
error: "couldnt_update_private_message";
|
25
25
|
} | {
|
26
|
-
|
26
|
+
error: "cannot_leave_admin";
|
27
27
|
} | {
|
28
|
-
|
28
|
+
error: "no_lines_in_html";
|
29
29
|
} | {
|
30
|
-
|
30
|
+
error: "site_metadata_page_is_not_doctype_html";
|
31
31
|
} | {
|
32
|
-
|
33
|
-
} | {
|
34
|
-
error_type: "PictrsResponseError";
|
32
|
+
error: "pictrs_response_error";
|
35
33
|
message: string;
|
36
34
|
} | {
|
37
|
-
|
35
|
+
error: "pictrs_purge_response_error";
|
38
36
|
message: string;
|
39
37
|
} | {
|
40
|
-
|
38
|
+
error: "pictrs_caching_disabled";
|
41
39
|
} | {
|
42
|
-
|
40
|
+
error: "image_url_missing_path_segments";
|
43
41
|
} | {
|
44
|
-
|
42
|
+
error: "image_url_missing_last_path_segment";
|
45
43
|
} | {
|
46
|
-
|
44
|
+
error: "pictrs_api_key_not_provided";
|
47
45
|
} | {
|
48
|
-
|
46
|
+
error: "no_content_type_header";
|
49
47
|
} | {
|
50
|
-
|
48
|
+
error: "not_an_image_type";
|
51
49
|
} | {
|
52
|
-
|
50
|
+
error: "not_a_mod_or_admin";
|
53
51
|
} | {
|
54
|
-
|
52
|
+
error: "no_admins";
|
55
53
|
} | {
|
56
|
-
|
54
|
+
error: "not_top_admin";
|
57
55
|
} | {
|
58
|
-
|
56
|
+
error: "not_top_mod";
|
59
57
|
} | {
|
60
|
-
|
58
|
+
error: "not_logged_in";
|
61
59
|
} | {
|
62
|
-
|
60
|
+
error: "site_ban";
|
63
61
|
} | {
|
64
|
-
|
62
|
+
error: "deleted";
|
65
63
|
} | {
|
66
|
-
|
64
|
+
error: "banned_from_community";
|
67
65
|
} | {
|
68
|
-
|
66
|
+
error: "couldnt_find_community";
|
69
67
|
} | {
|
70
|
-
|
68
|
+
error: "couldnt_find_person";
|
71
69
|
} | {
|
72
|
-
|
70
|
+
error: "person_is_blocked";
|
73
71
|
} | {
|
74
|
-
|
72
|
+
error: "downvotes_are_disabled";
|
75
73
|
} | {
|
76
|
-
|
74
|
+
error: "instance_is_private";
|
77
75
|
} | {
|
78
|
-
|
76
|
+
error: "invalid_password";
|
79
77
|
} | {
|
80
|
-
|
78
|
+
error: "site_description_length_overflow";
|
81
79
|
} | {
|
82
|
-
|
80
|
+
error: "honeypot_failed";
|
83
81
|
} | {
|
84
|
-
|
82
|
+
error: "registration_application_is_pending";
|
85
83
|
} | {
|
86
|
-
|
84
|
+
error: "cant_enable_private_instance_and_federation_together";
|
87
85
|
} | {
|
88
|
-
|
86
|
+
error: "locked";
|
89
87
|
} | {
|
90
|
-
|
88
|
+
error: "couldnt_create_comment";
|
91
89
|
} | {
|
92
|
-
|
90
|
+
error: "max_comment_depth_reached";
|
93
91
|
} | {
|
94
|
-
|
92
|
+
error: "no_comment_edit_allowed";
|
95
93
|
} | {
|
96
|
-
|
94
|
+
error: "only_admins_can_create_communities";
|
97
95
|
} | {
|
98
|
-
|
96
|
+
error: "community_already_exists";
|
99
97
|
} | {
|
100
|
-
|
98
|
+
error: "language_not_allowed";
|
101
99
|
} | {
|
102
|
-
|
100
|
+
error: "only_mods_can_post_in_community";
|
103
101
|
} | {
|
104
|
-
|
102
|
+
error: "couldnt_update_post";
|
105
103
|
} | {
|
106
|
-
|
104
|
+
error: "no_post_edit_allowed";
|
107
105
|
} | {
|
108
|
-
|
106
|
+
error: "couldnt_find_post";
|
109
107
|
} | {
|
110
|
-
|
108
|
+
error: "edit_private_message_not_allowed";
|
111
109
|
} | {
|
112
|
-
|
110
|
+
error: "site_already_exists";
|
113
111
|
} | {
|
114
|
-
|
112
|
+
error: "application_question_required";
|
115
113
|
} | {
|
116
|
-
|
114
|
+
error: "invalid_default_post_listing_type";
|
117
115
|
} | {
|
118
|
-
|
116
|
+
error: "registration_closed";
|
119
117
|
} | {
|
120
|
-
|
121
|
-
|
118
|
+
error: "registration_application_answer_required";
|
119
|
+
} | {
|
120
|
+
error: "email_already_exists";
|
121
|
+
} | {
|
122
|
+
error: "federation_forbidden_by_strict_allow_list";
|
123
|
+
} | {
|
124
|
+
error: "person_is_banned_from_community";
|
122
125
|
} | {
|
123
|
-
|
126
|
+
error: "object_is_not_public";
|
124
127
|
} | {
|
125
|
-
|
128
|
+
error: "invalid_community";
|
126
129
|
} | {
|
127
|
-
|
130
|
+
error: "cannot_create_post_or_comment_in_deleted_or_removed_community";
|
128
131
|
} | {
|
129
|
-
|
132
|
+
error: "cannot_receive_page";
|
130
133
|
} | {
|
131
|
-
|
134
|
+
error: "new_post_cannot_be_locked";
|
132
135
|
} | {
|
133
|
-
|
136
|
+
error: "only_local_admin_can_remove_community";
|
134
137
|
} | {
|
135
|
-
|
138
|
+
error: "only_local_admin_can_restore_community";
|
136
139
|
} | {
|
137
|
-
|
140
|
+
error: "no_id_given";
|
138
141
|
} | {
|
139
|
-
|
142
|
+
error: "incorrect_login";
|
140
143
|
} | {
|
141
|
-
|
144
|
+
error: "invalid_query";
|
145
|
+
} | {
|
146
|
+
error: "object_not_local";
|
147
|
+
} | {
|
148
|
+
error: "post_is_locked";
|
149
|
+
} | {
|
150
|
+
error: "person_is_banned_from_site";
|
151
|
+
message: string;
|
142
152
|
} | {
|
143
|
-
|
153
|
+
error: "invalid_vote_value";
|
144
154
|
} | {
|
145
|
-
|
155
|
+
error: "page_does_not_specify_creator";
|
146
156
|
} | {
|
147
|
-
|
157
|
+
error: "page_does_not_specify_group";
|
148
158
|
} | {
|
149
|
-
|
159
|
+
error: "no_community_found_in_cc";
|
150
160
|
} | {
|
151
|
-
|
161
|
+
error: "no_email_setup";
|
152
162
|
} | {
|
153
|
-
|
163
|
+
error: "email_smtp_server_needs_a_port";
|
154
164
|
} | {
|
155
|
-
|
165
|
+
error: "missing_an_email";
|
156
166
|
} | {
|
157
|
-
|
167
|
+
error: "rate_limit_error";
|
158
168
|
} | {
|
159
|
-
|
169
|
+
error: "invalid_name";
|
160
170
|
} | {
|
161
|
-
|
171
|
+
error: "invalid_display_name";
|
162
172
|
} | {
|
163
|
-
|
173
|
+
error: "invalid_matrix_id";
|
164
174
|
} | {
|
165
|
-
|
175
|
+
error: "invalid_post_title";
|
166
176
|
} | {
|
167
|
-
|
177
|
+
error: "invalid_body_field";
|
168
178
|
} | {
|
169
|
-
|
179
|
+
error: "bio_length_overflow";
|
170
180
|
} | {
|
171
|
-
|
181
|
+
error: "missing_totp_token";
|
172
182
|
} | {
|
173
|
-
|
183
|
+
error: "missing_totp_secret";
|
174
184
|
} | {
|
175
|
-
|
185
|
+
error: "incorrect_totp_token";
|
176
186
|
} | {
|
177
|
-
|
187
|
+
error: "couldnt_parse_totp_secret";
|
178
188
|
} | {
|
179
|
-
|
189
|
+
error: "couldnt_generate_totp";
|
180
190
|
} | {
|
181
|
-
|
191
|
+
error: "totp_already_enabled";
|
182
192
|
} | {
|
183
|
-
|
193
|
+
error: "couldnt_like_comment";
|
184
194
|
} | {
|
185
|
-
|
195
|
+
error: "couldnt_save_comment";
|
186
196
|
} | {
|
187
|
-
|
197
|
+
error: "couldnt_create_report";
|
188
198
|
} | {
|
189
|
-
|
199
|
+
error: "couldnt_resolve_report";
|
190
200
|
} | {
|
191
|
-
|
201
|
+
error: "community_moderator_already_exists";
|
192
202
|
} | {
|
193
|
-
|
203
|
+
error: "community_user_already_banned";
|
194
204
|
} | {
|
195
|
-
|
205
|
+
error: "community_block_already_exists";
|
196
206
|
} | {
|
197
|
-
|
207
|
+
error: "community_follower_already_exists";
|
198
208
|
} | {
|
199
|
-
|
209
|
+
error: "couldnt_update_community_hidden_status";
|
200
210
|
} | {
|
201
|
-
|
211
|
+
error: "person_block_already_exists";
|
202
212
|
} | {
|
203
|
-
|
213
|
+
error: "user_already_exists";
|
204
214
|
} | {
|
205
|
-
|
215
|
+
error: "token_not_found";
|
206
216
|
} | {
|
207
|
-
|
217
|
+
error: "couldnt_like_post";
|
208
218
|
} | {
|
209
|
-
|
219
|
+
error: "couldnt_save_post";
|
210
220
|
} | {
|
211
|
-
|
221
|
+
error: "couldnt_mark_post_as_read";
|
212
222
|
} | {
|
213
|
-
|
223
|
+
error: "couldnt_update_community";
|
214
224
|
} | {
|
215
|
-
|
225
|
+
error: "couldnt_update_replies";
|
216
226
|
} | {
|
217
|
-
|
227
|
+
error: "couldnt_update_person_mentions";
|
218
228
|
} | {
|
219
|
-
|
229
|
+
error: "post_title_too_long";
|
220
230
|
} | {
|
221
|
-
|
231
|
+
error: "couldnt_create_post";
|
222
232
|
} | {
|
223
|
-
|
233
|
+
error: "couldnt_create_private_message";
|
224
234
|
} | {
|
225
|
-
|
235
|
+
error: "couldnt_update_private";
|
226
236
|
} | {
|
227
|
-
|
237
|
+
error: "system_err_login";
|
228
238
|
} | {
|
229
|
-
|
239
|
+
error: "couldnt_set_all_registrations_accepted";
|
230
240
|
} | {
|
231
|
-
|
241
|
+
error: "couldnt_set_all_email_verified";
|
232
242
|
} | {
|
233
|
-
|
243
|
+
error: "banned";
|
234
244
|
} | {
|
235
|
-
|
245
|
+
error: "couldnt_get_comments";
|
236
246
|
} | {
|
237
|
-
|
247
|
+
error: "couldnt_get_posts";
|
238
248
|
} | {
|
239
|
-
|
249
|
+
error: "invalid_url";
|
240
250
|
} | {
|
241
|
-
|
251
|
+
error: "email_send_failed";
|
242
252
|
} | {
|
243
|
-
|
253
|
+
error: "slurs";
|
244
254
|
} | {
|
245
|
-
|
255
|
+
error: "couldnt_find_object";
|
246
256
|
} | {
|
247
|
-
|
257
|
+
error: "registration_denied";
|
258
|
+
message: string | null;
|
248
259
|
} | {
|
249
|
-
|
260
|
+
error: "federation_disabled";
|
250
261
|
} | {
|
251
|
-
|
262
|
+
error: "domain_blocked";
|
263
|
+
message: string;
|
252
264
|
} | {
|
253
|
-
|
265
|
+
error: "domain_not_in_allow_list";
|
254
266
|
message: string;
|
255
267
|
} | {
|
256
|
-
|
268
|
+
error: "federation_disabled_by_strict_allow_list";
|
269
|
+
} | {
|
270
|
+
error: "site_name_required";
|
271
|
+
} | {
|
272
|
+
error: "site_name_length_overflow";
|
273
|
+
} | {
|
274
|
+
error: "permissive_regex";
|
275
|
+
} | {
|
276
|
+
error: "invalid_regex";
|
257
277
|
} | {
|
258
|
-
|
278
|
+
error: "captcha_incorrect";
|
259
279
|
} | {
|
260
|
-
|
280
|
+
error: "password_reset_limit_reached";
|
261
281
|
} | {
|
262
|
-
|
282
|
+
error: "couldnt_create_audio_captcha";
|
263
283
|
} | {
|
264
|
-
|
284
|
+
error: "invalid_url_scheme";
|
265
285
|
} | {
|
266
|
-
|
286
|
+
error: "couldnt_send_webmention";
|
267
287
|
} | {
|
268
|
-
|
288
|
+
error: "contradicting_filters";
|
269
289
|
} | {
|
270
|
-
|
290
|
+
error: "instance_block_already_exists";
|
271
291
|
} | {
|
272
|
-
|
292
|
+
error: "auth_cookie_insecure";
|
273
293
|
} | {
|
274
|
-
|
294
|
+
error: "too_many_items";
|
275
295
|
} | {
|
276
|
-
|
296
|
+
error: "community_has_no_followers";
|
297
|
+
} | {
|
298
|
+
error: "ban_expiration_in_past";
|
299
|
+
} | {
|
300
|
+
error: "invalid_unix_time";
|
301
|
+
} | {
|
302
|
+
error: "unknown";
|
303
|
+
message: string;
|
277
304
|
};
|
@@ -14,18 +14,18 @@ export interface LocalUser {
|
|
14
14
|
interface_language: string;
|
15
15
|
show_avatars: boolean;
|
16
16
|
send_notifications_to_email: boolean;
|
17
|
-
validator_time: string;
|
18
17
|
show_scores: boolean;
|
19
18
|
show_bot_accounts: boolean;
|
20
19
|
show_read_posts: boolean;
|
21
|
-
show_new_post_notifs: boolean;
|
22
20
|
email_verified: boolean;
|
23
21
|
accepted_application: boolean;
|
24
|
-
totp_2fa_url?: string;
|
25
22
|
open_links_in_new_tab: boolean;
|
26
23
|
blur_nsfw: boolean;
|
27
24
|
auto_expand: boolean;
|
28
25
|
infinite_scroll_enabled: boolean;
|
29
26
|
admin: boolean;
|
30
27
|
post_listing_mode: PostListingMode;
|
28
|
+
totp_2fa_enabled: boolean;
|
29
|
+
enable_keyboard_navigation: boolean;
|
30
|
+
enable_animated_images: boolean;
|
31
31
|
}
|
@@ -1,6 +1,3 @@
|
|
1
|
-
import type { CommunityId } from "./CommunityId";
|
2
|
-
import type { InstanceId } from "./InstanceId";
|
3
|
-
import type { PersonId } from "./PersonId";
|
4
1
|
import type { PostId } from "./PostId";
|
5
2
|
export interface PostAggregates {
|
6
3
|
id: number;
|
@@ -10,15 +7,4 @@ export interface PostAggregates {
|
|
10
7
|
upvotes: number;
|
11
8
|
downvotes: number;
|
12
9
|
published: string;
|
13
|
-
newest_comment_time_necro: string;
|
14
|
-
newest_comment_time: string;
|
15
|
-
featured_community: boolean;
|
16
|
-
featured_local: boolean;
|
17
|
-
hot_rank: number;
|
18
|
-
hot_rank_active: number;
|
19
|
-
community_id: CommunityId;
|
20
|
-
creator_id: PersonId;
|
21
|
-
controversy_rank: number;
|
22
|
-
instance_id: InstanceId;
|
23
|
-
scaled_rank: number;
|
24
10
|
}
|
@@ -1,5 +1,6 @@
|
|
1
1
|
import type { LanguageId } from "./LanguageId";
|
2
2
|
import type { ListingType } from "./ListingType";
|
3
|
+
import type { PostListingMode } from "./PostListingMode";
|
3
4
|
import type { SortType } from "./SortType";
|
4
5
|
export interface SaveUserSettings {
|
5
6
|
show_nsfw?: boolean;
|
@@ -23,7 +24,9 @@ export interface SaveUserSettings {
|
|
23
24
|
show_read_posts?: boolean;
|
24
25
|
show_new_post_notifs?: boolean;
|
25
26
|
discussion_languages?: Array<LanguageId>;
|
26
|
-
generate_totp_2fa?: boolean;
|
27
27
|
open_links_in_new_tab?: boolean;
|
28
28
|
infinite_scroll_enabled?: boolean;
|
29
|
+
post_listing_mode?: PostListingMode;
|
30
|
+
enable_keyboard_navigation?: boolean;
|
31
|
+
enable_animated_images?: boolean;
|
29
32
|
}
|
package/dist/types/others.d.ts
CHANGED
@@ -20,3 +20,11 @@ export interface ImageFile {
|
|
20
20
|
file: string;
|
21
21
|
delete_token: string;
|
22
22
|
}
|
23
|
+
export interface DeleteImage {
|
24
|
+
token: string;
|
25
|
+
filename: string;
|
26
|
+
/**
|
27
|
+
* Optional if cookie with jwt set is already present. Otherwise, auth is required.
|
28
|
+
*/
|
29
|
+
auth?: string;
|
30
|
+
}
|
package/package.json
CHANGED