lemmy-js-client 0.19.0-alpha.14 → 0.19.0-alpha.16
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/http.d.ts +2 -1
- package/dist/http.js +7 -4
- package/dist/index.d.ts +1 -2
- package/dist/types/CommentReplyView.d.ts +1 -0
- package/dist/types/CommentView.d.ts +1 -0
- package/dist/types/LemmyErrorType.d.ts +2 -0
- package/dist/types/PersonAggregates.d.ts +0 -2
- package/dist/types/PersonMentionView.d.ts +1 -0
- package/dist/types/PostView.d.ts +1 -0
- package/package.json +1 -1
- package/dist/types/PersonSortType.d.ts +0 -1
- package/dist/types/PersonSortType.js +0 -3
- package/dist/utils.d.ts +0 -0
- package/dist/utils.js +0 -0
- /package/dist/{types/others.d.ts → other_types.d.ts} +0 -0
- /package/dist/{types/others.js → other_types.js} +0 -0
package/dist/http.d.ts
CHANGED
@@ -119,7 +119,7 @@ import { SearchResponse } from "./types/SearchResponse";
|
|
119
119
|
import { SiteResponse } from "./types/SiteResponse";
|
120
120
|
import { TransferCommunity } from "./types/TransferCommunity";
|
121
121
|
import { VerifyEmail } from "./types/VerifyEmail";
|
122
|
-
import { DeleteImage, UploadImage, UploadImageResponse } from "./
|
122
|
+
import { DeleteImage, UploadImage, UploadImageResponse } from "./other_types";
|
123
123
|
import { HideCommunity } from "./types/HideCommunity";
|
124
124
|
import { BlockInstance } from "./types/BlockInstance";
|
125
125
|
import { BlockInstanceResponse } from "./types/BlockInstanceResponse";
|
@@ -529,6 +529,7 @@ export declare class LemmyHttp {
|
|
529
529
|
* `HTTP.POST /user/login`
|
530
530
|
*/
|
531
531
|
login(form: Login): Promise<LoginResponse>;
|
532
|
+
logout(): Promise<SuccessResponse>;
|
532
533
|
/**
|
533
534
|
* Get the details for a person.
|
534
535
|
*
|
package/dist/http.js
CHANGED
@@ -27,7 +27,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
27
27
|
exports.LemmyHttp = void 0;
|
28
28
|
const cross_fetch_1 = __importDefault(require("cross-fetch"));
|
29
29
|
const form_data_1 = __importDefault(require("form-data"));
|
30
|
-
const
|
30
|
+
const other_types_1 = require("./other_types");
|
31
31
|
var HttpType;
|
32
32
|
(function (HttpType) {
|
33
33
|
HttpType["Get"] = "GET";
|
@@ -49,7 +49,7 @@ class LemmyHttp {
|
|
49
49
|
_LemmyHttp_headers.set(this, {});
|
50
50
|
_LemmyHttp_pictrsUrl.set(this, void 0);
|
51
51
|
_LemmyHttp_fetchFunction.set(this, cross_fetch_1.default);
|
52
|
-
__classPrivateFieldSet(this, _LemmyHttp_apiUrl, `${baseUrl.replace(/\/+$/, "")}/api/${
|
52
|
+
__classPrivateFieldSet(this, _LemmyHttp_apiUrl, `${baseUrl.replace(/\/+$/, "")}/api/${other_types_1.VERSION}`, "f");
|
53
53
|
__classPrivateFieldSet(this, _LemmyHttp_pictrsUrl, `${baseUrl}/pictrs/image`, "f");
|
54
54
|
if (options === null || options === void 0 ? void 0 : options.headers) {
|
55
55
|
__classPrivateFieldSet(this, _LemmyHttp_headers, options.headers, "f");
|
@@ -569,6 +569,9 @@ class LemmyHttp {
|
|
569
569
|
login(form) {
|
570
570
|
return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Post, "/user/login", form);
|
571
571
|
}
|
572
|
+
logout() {
|
573
|
+
return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Post, "/user/logout", {});
|
574
|
+
}
|
572
575
|
/**
|
573
576
|
* Get the details for a person.
|
574
577
|
*
|
@@ -895,10 +898,10 @@ _LemmyHttp_apiUrl = new WeakMap(), _LemmyHttp_headers = new WeakMap(), _LemmyHtt
|
|
895
898
|
json = yield response.json();
|
896
899
|
}
|
897
900
|
catch (error) {
|
898
|
-
throw response.statusText;
|
901
|
+
throw new Error(response.statusText);
|
899
902
|
}
|
900
903
|
if (!response.ok) {
|
901
|
-
throw (_a = json["error"]) !== null && _a !== void 0 ? _a : response.statusText;
|
904
|
+
throw new Error((_a = json["error"]) !== null && _a !== void 0 ? _a : response.statusText);
|
902
905
|
}
|
903
906
|
else {
|
904
907
|
return json;
|
package/dist/index.d.ts
CHANGED
@@ -179,7 +179,6 @@ export { PersonMention } from "./types/PersonMention";
|
|
179
179
|
export { PersonMentionId } from "./types/PersonMentionId";
|
180
180
|
export { PersonMentionResponse } from "./types/PersonMentionResponse";
|
181
181
|
export { PersonMentionView } from "./types/PersonMentionView";
|
182
|
-
export { PersonSortType } from "./types/PersonSortType";
|
183
182
|
export { PersonView } from "./types/PersonView";
|
184
183
|
export { Post } from "./types/Post";
|
185
184
|
export { PostAggregates } from "./types/PostAggregates";
|
@@ -238,4 +237,4 @@ export { TransferCommunity } from "./types/TransferCommunity";
|
|
238
237
|
export { UpdateTotp } from "./types/UpdateTotp";
|
239
238
|
export { UpdateTotpResponse } from "./types/UpdateTotpResponse";
|
240
239
|
export { VerifyEmail } from "./types/VerifyEmail";
|
241
|
-
export { UploadImage, UploadImageResponse, ImageFile, DeleteImage, } from "./
|
240
|
+
export { UploadImage, UploadImageResponse, ImageFile, DeleteImage, } from "./other_types";
|
package/dist/types/PostView.d.ts
CHANGED
package/package.json
CHANGED
@@ -1 +0,0 @@
|
|
1
|
-
export type PersonSortType = "New" | "Old" | "MostComments" | "CommentScore" | "PostScore" | "PostCount";
|
package/dist/utils.d.ts
DELETED
File without changes
|
package/dist/utils.js
DELETED
File without changes
|
File without changes
|
File without changes
|