lemmy-js-client 0.18.3-rc.2 → 0.18.3-rc.3
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/http.js +7 -1
- package/dist/index.d.ts +2 -1
- package/dist/types/LemmyErrorType.d.ts +277 -0
- package/dist/types/LemmyErrorType.js +3 -0
- package/package.json +2 -2
package/dist/http.js
CHANGED
@@ -801,7 +801,13 @@ _LemmyHttp_apiUrl = new WeakMap(), _LemmyHttp_headers = new WeakMap(), _LemmyHtt
|
|
801
801
|
body: JSON.stringify(form),
|
802
802
|
});
|
803
803
|
}
|
804
|
-
|
804
|
+
let json = undefined;
|
805
|
+
try {
|
806
|
+
json = yield response.json();
|
807
|
+
}
|
808
|
+
catch (error) {
|
809
|
+
throw response.statusText;
|
810
|
+
}
|
805
811
|
if (!response.ok) {
|
806
812
|
throw (_a = json["error"]) !== null && _a !== void 0 ? _a : response.statusText;
|
807
813
|
}
|
package/dist/index.d.ts
CHANGED
@@ -121,6 +121,7 @@ export { InstanceId } from "./types/InstanceId";
|
|
121
121
|
export { Language } from "./types/Language";
|
122
122
|
export { LanguageId } from "./types/LanguageId";
|
123
123
|
export { LeaveAdmin } from "./types/LeaveAdmin";
|
124
|
+
export { LemmyErrorType } from "./types/LemmyErrorType";
|
124
125
|
export { ListCommentReports } from "./types/ListCommentReports";
|
125
126
|
export { ListCommentReportsResponse } from "./types/ListCommentReportsResponse";
|
126
127
|
export { ListCommunities } from "./types/ListCommunities";
|
@@ -246,4 +247,4 @@ export { UserJoin } from "./types/UserJoin";
|
|
246
247
|
export { UserJoinResponse } from "./types/UserJoinResponse";
|
247
248
|
export { VerifyEmail } from "./types/VerifyEmail";
|
248
249
|
export { VerifyEmailResponse } from "./types/VerifyEmailResponse";
|
249
|
-
export {
|
250
|
+
export { UploadImage, UploadImageResponse, ImageFile } from "./types/others";
|
@@ -0,0 +1,277 @@
|
|
1
|
+
export type LemmyErrorType = {
|
2
|
+
error_type: "ReportReasonRequired";
|
3
|
+
} | {
|
4
|
+
error_type: "ReportTooLong";
|
5
|
+
} | {
|
6
|
+
error_type: "NotAModerator";
|
7
|
+
} | {
|
8
|
+
error_type: "NotAnAdmin";
|
9
|
+
} | {
|
10
|
+
error_type: "CannotBlockYourself";
|
11
|
+
} | {
|
12
|
+
error_type: "CannotBlockAdmin";
|
13
|
+
} | {
|
14
|
+
error_type: "CouldNotUpdateUser";
|
15
|
+
} | {
|
16
|
+
error_type: "PasswordsDoNotMatch";
|
17
|
+
} | {
|
18
|
+
error_type: "PasswordIncorrect";
|
19
|
+
} | {
|
20
|
+
error_type: "EmailNotVerified";
|
21
|
+
} | {
|
22
|
+
error_type: "EmailRequired";
|
23
|
+
} | {
|
24
|
+
error_type: "CouldNotUpdateComment";
|
25
|
+
} | {
|
26
|
+
error_type: "CouldNotUpdatePrivateMessage";
|
27
|
+
} | {
|
28
|
+
error_type: "CannotLeaveAdmin";
|
29
|
+
} | {
|
30
|
+
error_type: "NoLinesInHtml";
|
31
|
+
} | {
|
32
|
+
error_type: "SiteMetadataPageIsNotDoctypeHtml";
|
33
|
+
} | {
|
34
|
+
error_type: "PictrsResponseError";
|
35
|
+
message: string;
|
36
|
+
} | {
|
37
|
+
error_type: "PictrsPurgeResponseError";
|
38
|
+
message: string;
|
39
|
+
} | {
|
40
|
+
error_type: "ImageUrlMissingPathSegments";
|
41
|
+
} | {
|
42
|
+
error_type: "ImageUrlMissingLastPathSegment";
|
43
|
+
} | {
|
44
|
+
error_type: "PictrsApiKeyNotProvided";
|
45
|
+
} | {
|
46
|
+
error_type: "NoContentTypeHeader";
|
47
|
+
} | {
|
48
|
+
error_type: "NotAnImageType";
|
49
|
+
} | {
|
50
|
+
error_type: "NotAModOrAdmin";
|
51
|
+
} | {
|
52
|
+
error_type: "NoAdmins";
|
53
|
+
} | {
|
54
|
+
error_type: "NotTopAdmin";
|
55
|
+
} | {
|
56
|
+
error_type: "NotTopMod";
|
57
|
+
} | {
|
58
|
+
error_type: "NotLoggedIn";
|
59
|
+
} | {
|
60
|
+
error_type: "SiteBan";
|
61
|
+
} | {
|
62
|
+
error_type: "Deleted";
|
63
|
+
} | {
|
64
|
+
error_type: "BannedFromCommunity";
|
65
|
+
} | {
|
66
|
+
error_type: "CouldNotFindCommunity";
|
67
|
+
} | {
|
68
|
+
error_type: "PersonIsBlocked";
|
69
|
+
} | {
|
70
|
+
error_type: "DownvotesAreDisabled";
|
71
|
+
} | {
|
72
|
+
error_type: "InstanceIsPrivate";
|
73
|
+
} | {
|
74
|
+
error_type: "InvalidPassword";
|
75
|
+
} | {
|
76
|
+
error_type: "SiteDescriptionLengthOverflow";
|
77
|
+
} | {
|
78
|
+
error_type: "HoneypotFailed";
|
79
|
+
} | {
|
80
|
+
error_type: "RegistrationApplicationIsPending";
|
81
|
+
} | {
|
82
|
+
error_type: "PrivateInstanceCannotHaveFederationEnabled";
|
83
|
+
} | {
|
84
|
+
error_type: "Locked";
|
85
|
+
} | {
|
86
|
+
error_type: "CouldNotCreateComment";
|
87
|
+
} | {
|
88
|
+
error_type: "MaxCommentDepthReached";
|
89
|
+
} | {
|
90
|
+
error_type: "EditCommentNotAllowed";
|
91
|
+
} | {
|
92
|
+
error_type: "OnlyAdminsCanCreateCommunities";
|
93
|
+
} | {
|
94
|
+
error_type: "CommunityAlreadyExists";
|
95
|
+
} | {
|
96
|
+
error_type: "LanguageNotAllowed";
|
97
|
+
} | {
|
98
|
+
error_type: "OnlyModsCanPostInCommunity";
|
99
|
+
} | {
|
100
|
+
error_type: "CouldNotUpdatePost";
|
101
|
+
} | {
|
102
|
+
error_type: "EditPostNotAllowed";
|
103
|
+
} | {
|
104
|
+
error_type: "CouldNotFindPost";
|
105
|
+
} | {
|
106
|
+
error_type: "EditPrivateMessageNotAllowed";
|
107
|
+
} | {
|
108
|
+
error_type: "SiteAlreadyExists";
|
109
|
+
} | {
|
110
|
+
error_type: "ApplicationQuestionRequired";
|
111
|
+
} | {
|
112
|
+
error_type: "InvalidDefaultPostListingType";
|
113
|
+
} | {
|
114
|
+
error_type: "RegistrationClosed";
|
115
|
+
} | {
|
116
|
+
error_type: "RegistrationApplicationAnswerRequired";
|
117
|
+
} | {
|
118
|
+
error_type: "EmailAlreadyExists";
|
119
|
+
} | {
|
120
|
+
error_type: "FederationError";
|
121
|
+
message: string;
|
122
|
+
} | {
|
123
|
+
error_type: "FederationForbiddenByStrictAllowList";
|
124
|
+
} | {
|
125
|
+
error_type: "PersonIsBannedFromCommunity";
|
126
|
+
} | {
|
127
|
+
error_type: "ObjectIsNotPublic";
|
128
|
+
} | {
|
129
|
+
error_type: "InvalidCommunity";
|
130
|
+
} | {
|
131
|
+
error_type: "CannotCreatePostOrCommentInDeletedOrRemovedCommunity";
|
132
|
+
} | {
|
133
|
+
error_type: "CannotReceivePage";
|
134
|
+
} | {
|
135
|
+
error_type: "NewPostCannotBeLocked";
|
136
|
+
} | {
|
137
|
+
error_type: "OnlyLocalAdminCanRemoveCommunity";
|
138
|
+
} | {
|
139
|
+
error_type: "OnlyLocalAdminCanRestoreCommunity";
|
140
|
+
} | {
|
141
|
+
error_type: "NoIdGiven";
|
142
|
+
} | {
|
143
|
+
error_type: "CouldNotFindUsernameOrEmail";
|
144
|
+
} | {
|
145
|
+
error_type: "InvalidQuery";
|
146
|
+
} | {
|
147
|
+
error_type: "ObjectNotLocal";
|
148
|
+
} | {
|
149
|
+
error_type: "PostIsLocked";
|
150
|
+
} | {
|
151
|
+
error_type: "PersonIsBannedFromSite";
|
152
|
+
} | {
|
153
|
+
error_type: "InvalidVoteValue";
|
154
|
+
} | {
|
155
|
+
error_type: "PageDoesNotSpecifyCreator";
|
156
|
+
} | {
|
157
|
+
error_type: "PageDoesNotSpecifyGroup";
|
158
|
+
} | {
|
159
|
+
error_type: "NoCommunityFoundInCC";
|
160
|
+
} | {
|
161
|
+
error_type: "NoEmailSetup";
|
162
|
+
} | {
|
163
|
+
error_type: "EmailSmtpServerNeedsAPort";
|
164
|
+
} | {
|
165
|
+
error_type: "MissingAnEmail";
|
166
|
+
} | {
|
167
|
+
error_type: "RateLimitError";
|
168
|
+
} | {
|
169
|
+
error_type: "InvalidName";
|
170
|
+
} | {
|
171
|
+
error_type: "InvalidDisplayName";
|
172
|
+
} | {
|
173
|
+
error_type: "InvalidMatrixId";
|
174
|
+
} | {
|
175
|
+
error_type: "InvalidPostTitle";
|
176
|
+
} | {
|
177
|
+
error_type: "InvalidBodyField";
|
178
|
+
} | {
|
179
|
+
error_type: "BioLengthOverflow";
|
180
|
+
} | {
|
181
|
+
error_type: "MissingTotpToken";
|
182
|
+
} | {
|
183
|
+
error_type: "IncorrectTotpToken";
|
184
|
+
} | {
|
185
|
+
error_type: "CouldNotParseTotpSecret";
|
186
|
+
} | {
|
187
|
+
error_type: "CouldNotLikeComment";
|
188
|
+
} | {
|
189
|
+
error_type: "CouldNotSaveComment";
|
190
|
+
} | {
|
191
|
+
error_type: "CouldNotCreateReport";
|
192
|
+
} | {
|
193
|
+
error_type: "CouldNotResolveReport";
|
194
|
+
} | {
|
195
|
+
error_type: "CommunityModeratorAlreadyExists";
|
196
|
+
} | {
|
197
|
+
error_type: "CommunityUserIsAlreadyBanned";
|
198
|
+
} | {
|
199
|
+
error_type: "CommunityBlockAlreadyExists";
|
200
|
+
} | {
|
201
|
+
error_type: "CommunityFollowerAlreadyExists";
|
202
|
+
} | {
|
203
|
+
error_type: "CouldNotUpdateCommunityHiddenStatus";
|
204
|
+
} | {
|
205
|
+
error_type: "PersonBlockAlreadyExists";
|
206
|
+
} | {
|
207
|
+
error_type: "UserAlreadyExists";
|
208
|
+
} | {
|
209
|
+
error_type: "TokenNotFound";
|
210
|
+
} | {
|
211
|
+
error_type: "CouldNotLikePost";
|
212
|
+
} | {
|
213
|
+
error_type: "CouldNotSavePost";
|
214
|
+
} | {
|
215
|
+
error_type: "CouldNotMarkPostAsRead";
|
216
|
+
} | {
|
217
|
+
error_type: "CouldNotUpdateCommunity";
|
218
|
+
} | {
|
219
|
+
error_type: "CouldNotUpdateReplies";
|
220
|
+
} | {
|
221
|
+
error_type: "CouldNotUpdatePersonMentions";
|
222
|
+
} | {
|
223
|
+
error_type: "PostTitleTooLong";
|
224
|
+
} | {
|
225
|
+
error_type: "CouldNotCreatePost";
|
226
|
+
} | {
|
227
|
+
error_type: "CouldNotCreatePrivateMessage";
|
228
|
+
} | {
|
229
|
+
error_type: "CouldNotUpdatePrivate";
|
230
|
+
} | {
|
231
|
+
error_type: "SystemErrLogin";
|
232
|
+
} | {
|
233
|
+
error_type: "CouldNotSetAllRegistrationsAccepted";
|
234
|
+
} | {
|
235
|
+
error_type: "CouldNotSetAllEmailVerified";
|
236
|
+
} | {
|
237
|
+
error_type: "Banned";
|
238
|
+
} | {
|
239
|
+
error_type: "CouldNotGetComments";
|
240
|
+
} | {
|
241
|
+
error_type: "CouldNotGetPosts";
|
242
|
+
} | {
|
243
|
+
error_type: "InvalidUrl";
|
244
|
+
} | {
|
245
|
+
error_type: "EmailSendFailed";
|
246
|
+
} | {
|
247
|
+
error_type: "Slurs";
|
248
|
+
} | {
|
249
|
+
error_type: "CouldNotGenerateTotp";
|
250
|
+
} | {
|
251
|
+
error_type: "CouldNotFindObject";
|
252
|
+
} | {
|
253
|
+
error_type: "RegistrationDenied";
|
254
|
+
message: string;
|
255
|
+
} | {
|
256
|
+
error_type: "FederationDisabled";
|
257
|
+
} | {
|
258
|
+
error_type: "DomainBlocked";
|
259
|
+
} | {
|
260
|
+
error_type: "DomainNotInAllowList";
|
261
|
+
} | {
|
262
|
+
error_type: "FederationDisabledByStrictAllowList";
|
263
|
+
} | {
|
264
|
+
error_type: "SiteNameRequired";
|
265
|
+
} | {
|
266
|
+
error_type: "SiteNameLengthOverflow";
|
267
|
+
} | {
|
268
|
+
error_type: "PermissiveRegex";
|
269
|
+
} | {
|
270
|
+
error_type: "InvalidRegex";
|
271
|
+
} | {
|
272
|
+
error_type: "CaptchaIncorrect";
|
273
|
+
} | {
|
274
|
+
error_type: "PasswordResetLimitReached";
|
275
|
+
} | {
|
276
|
+
error_type: "CouldNotCreateAudioCaptcha";
|
277
|
+
};
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "lemmy-js-client",
|
3
|
-
"version": "0.18.3-rc.
|
3
|
+
"version": "0.18.3-rc.3",
|
4
4
|
"description": "A javascript / typescript client for Lemmy",
|
5
5
|
"repository": "https://github.com/LemmyNet/lemmy-js-client",
|
6
6
|
"license": "AGPL-3.0",
|
@@ -37,7 +37,7 @@
|
|
37
37
|
"eslint-plugin-prettier": "^4.2.1",
|
38
38
|
"husky": "^8.0.3",
|
39
39
|
"lint-staged": "^13.2.2",
|
40
|
-
"prettier": "^
|
40
|
+
"prettier": "^3.0.0",
|
41
41
|
"prettier-plugin-import-sort": "^0.0.7",
|
42
42
|
"prettier-plugin-organize-imports": "^3.2.2",
|
43
43
|
"prettier-plugin-packagejson": "^2.4.3",
|