lemmy-js-client 0.19.0-rc.10 → 0.19.0-rc.12
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/http.d.ts +14 -3
- package/dist/http.js +12 -4
- package/dist/index.d.ts +6 -0
- package/dist/types/BlockInstance.d.ts +5 -0
- package/dist/types/BlockInstance.js +2 -0
- package/dist/types/BlockInstanceResponse.d.ts +3 -0
- package/dist/types/BlockInstanceResponse.js +3 -0
- package/dist/types/Community.d.ts +0 -2
- package/dist/types/DeleteAccountResponse.d.ts +1 -1
- package/dist/types/GetPosts.d.ts +2 -0
- package/dist/types/GetPostsResponse.d.ts +2 -0
- package/dist/types/InstanceBlockView.d.ts +8 -0
- package/dist/types/InstanceBlockView.js +2 -0
- package/dist/types/MyUserInfo.d.ts +2 -0
- package/dist/types/PaginationCursor.d.ts +1 -0
- package/dist/types/PaginationCursor.js +3 -0
- package/dist/types/PasswordResetResponse.d.ts +1 -1
- package/dist/types/Person.d.ts +0 -1
- package/dist/types/PostAggregates.d.ts +3 -0
- package/dist/types/SortType.d.ts +1 -1
- package/dist/types/VerifyEmailResponse.d.ts +1 -1
- package/package.json +1 -1
package/dist/http.d.ts
CHANGED
@@ -31,6 +31,7 @@ import { CreatePrivateMessageReport } from "./types/CreatePrivateMessageReport";
|
|
31
31
|
import { CreateSite } from "./types/CreateSite";
|
32
32
|
import { CustomEmojiResponse } from "./types/CustomEmojiResponse";
|
33
33
|
import { DeleteAccount } from "./types/DeleteAccount";
|
34
|
+
import { DeleteAccountResponse } from "./types/DeleteAccountResponse";
|
34
35
|
import { DeleteComment } from "./types/DeleteComment";
|
35
36
|
import { DeleteCommunity } from "./types/DeleteCommunity";
|
36
37
|
import { DeleteCustomEmoji } from "./types/DeleteCustomEmoji";
|
@@ -92,6 +93,7 @@ import { MarkPostAsRead } from "./types/MarkPostAsRead";
|
|
92
93
|
import { MarkPrivateMessageAsRead } from "./types/MarkPrivateMessageAsRead";
|
93
94
|
import { PasswordChangeAfterReset } from "./types/PasswordChangeAfterReset";
|
94
95
|
import { PasswordReset } from "./types/PasswordReset";
|
96
|
+
import { PasswordResetResponse } from "./types/PasswordResetResponse";
|
95
97
|
import { PersonMentionResponse } from "./types/PersonMentionResponse";
|
96
98
|
import { PostReportResponse } from "./types/PostReportResponse";
|
97
99
|
import { PostResponse } from "./types/PostResponse";
|
@@ -121,8 +123,11 @@ import { SearchResponse } from "./types/SearchResponse";
|
|
121
123
|
import { SiteResponse } from "./types/SiteResponse";
|
122
124
|
import { TransferCommunity } from "./types/TransferCommunity";
|
123
125
|
import { VerifyEmail } from "./types/VerifyEmail";
|
126
|
+
import { VerifyEmailResponse } from "./types/VerifyEmailResponse";
|
124
127
|
import { UploadImage, UploadImageResponse } from "./types/others";
|
125
128
|
import { HideCommunity } from "./types/HideCommunity";
|
129
|
+
import { BlockInstance } from "./types/BlockInstance";
|
130
|
+
import { BlockInstanceResponse } from "./types/BlockInstanceResponse";
|
126
131
|
/**
|
127
132
|
* Helps build lemmy HTTP requests.
|
128
133
|
*/
|
@@ -534,13 +539,13 @@ export declare class LemmyHttp {
|
|
534
539
|
*
|
535
540
|
* `HTTP.POST /user/delete_account`
|
536
541
|
*/
|
537
|
-
deleteAccount(form: DeleteAccount): Promise<
|
542
|
+
deleteAccount(form: DeleteAccount): Promise<DeleteAccountResponse>;
|
538
543
|
/**
|
539
544
|
* Reset your password.
|
540
545
|
*
|
541
546
|
* `HTTP.POST /user/password_reset`
|
542
547
|
*/
|
543
|
-
passwordReset(form: PasswordReset): Promise<
|
548
|
+
passwordReset(form: PasswordReset): Promise<PasswordResetResponse>;
|
544
549
|
/**
|
545
550
|
* Change your password from an email / token based reset.
|
546
551
|
*
|
@@ -582,7 +587,7 @@ export declare class LemmyHttp {
|
|
582
587
|
*
|
583
588
|
* `HTTP.POST /user/verify_email`
|
584
589
|
*/
|
585
|
-
verifyEmail(form: VerifyEmail): Promise<
|
590
|
+
verifyEmail(form: VerifyEmail): Promise<VerifyEmailResponse>;
|
586
591
|
/**
|
587
592
|
* Add an admin to your site.
|
588
593
|
*
|
@@ -655,6 +660,12 @@ export declare class LemmyHttp {
|
|
655
660
|
* `HTTP.Get /federated_instances`
|
656
661
|
*/
|
657
662
|
getFederatedInstances(): Promise<GetFederatedInstancesResponse>;
|
663
|
+
/**
|
664
|
+
* Block an instance.
|
665
|
+
*
|
666
|
+
* `HTTP.Post /site/block`
|
667
|
+
*/
|
668
|
+
blockInstance(form: BlockInstance): Promise<BlockInstanceResponse>;
|
658
669
|
/**
|
659
670
|
* Upload an image to the server.
|
660
671
|
*/
|
package/dist/http.js
CHANGED
@@ -746,6 +746,14 @@ class LemmyHttp {
|
|
746
746
|
getFederatedInstances() {
|
747
747
|
return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Get, "/federated_instances", {});
|
748
748
|
}
|
749
|
+
/**
|
750
|
+
* Block an instance.
|
751
|
+
*
|
752
|
+
* `HTTP.Post /site/block`
|
753
|
+
*/
|
754
|
+
blockInstance(form) {
|
755
|
+
return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Post, "/site/block", form);
|
756
|
+
}
|
749
757
|
/**
|
750
758
|
* Upload an image to the server.
|
751
759
|
*/
|
@@ -753,11 +761,11 @@ class LemmyHttp {
|
|
753
761
|
var _a, _b, _c, _d;
|
754
762
|
return __awaiter(this, void 0, void 0, function* () {
|
755
763
|
const formData = createFormData(image);
|
756
|
-
// If
|
764
|
+
// If auth cookie not already set by browser, set it with passed in auth
|
757
765
|
const headers = {};
|
758
|
-
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("
|
759
|
-
!((_d = (_c = __classPrivateFieldGet(this, _LemmyHttp_headers, "f")) === null || _c === void 0 ? void 0 : _c.Cookie) === null || _d === void 0 ? void 0 : _d.includes("
|
760
|
-
headers.Cookie = `
|
766
|
+
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=")) &&
|
767
|
+
!((_d = (_c = __classPrivateFieldGet(this, _LemmyHttp_headers, "f")) === null || _c === void 0 ? void 0 : _c.Cookie) === null || _d === void 0 ? void 0 : _d.includes("auth="))) {
|
768
|
+
headers.Cookie = `auth=${auth}`;
|
761
769
|
}
|
762
770
|
let url = undefined;
|
763
771
|
let delete_url = undefined;
|
package/dist/index.d.ts
CHANGED
@@ -19,6 +19,8 @@ export { BanPersonResponse } from "./types/BanPersonResponse";
|
|
19
19
|
export { BannedPersonsResponse } from "./types/BannedPersonsResponse";
|
20
20
|
export { BlockCommunity } from "./types/BlockCommunity";
|
21
21
|
export { BlockCommunityResponse } from "./types/BlockCommunityResponse";
|
22
|
+
export { BlockInstance } from "./types/BlockInstance";
|
23
|
+
export { BlockInstanceResponse } from "./types/BlockInstanceResponse";
|
22
24
|
export { BlockPerson } from "./types/BlockPerson";
|
23
25
|
export { BlockPersonResponse } from "./types/BlockPersonResponse";
|
24
26
|
export { CaptchaResponse } from "./types/CaptchaResponse";
|
@@ -111,9 +113,11 @@ export { HideCommunity } from "./types/HideCommunity";
|
|
111
113
|
export { ImageUpload } from "./types/ImageUpload";
|
112
114
|
export { ImageUploadId } from "./types/ImageUploadId";
|
113
115
|
export { Instance } from "./types/Instance";
|
116
|
+
export { InstanceBlockView } from "./types/InstanceBlockView";
|
114
117
|
export { InstanceId } from "./types/InstanceId";
|
115
118
|
export { Language } from "./types/Language";
|
116
119
|
export { LanguageId } from "./types/LanguageId";
|
120
|
+
export { LemmyErrorType } from "./types/LemmyErrorType";
|
117
121
|
export { ListCommentReports } from "./types/ListCommentReports";
|
118
122
|
export { ListCommentReportsResponse } from "./types/ListCommentReportsResponse";
|
119
123
|
export { ListCommunities } from "./types/ListCommunities";
|
@@ -163,6 +167,7 @@ export { ModTransferCommunityView } from "./types/ModTransferCommunityView";
|
|
163
167
|
export { ModlogActionType } from "./types/ModlogActionType";
|
164
168
|
export { ModlogListParams } from "./types/ModlogListParams";
|
165
169
|
export { MyUserInfo } from "./types/MyUserInfo";
|
170
|
+
export { PaginationCursor } from "./types/PaginationCursor";
|
166
171
|
export { PasswordChangeAfterReset } from "./types/PasswordChangeAfterReset";
|
167
172
|
export { PasswordReset } from "./types/PasswordReset";
|
168
173
|
export { PasswordResetResponse } from "./types/PasswordResetResponse";
|
@@ -233,3 +238,4 @@ export { Tagline } from "./types/Tagline";
|
|
233
238
|
export { TransferCommunity } from "./types/TransferCommunity";
|
234
239
|
export { VerifyEmail } from "./types/VerifyEmail";
|
235
240
|
export { VerifyEmailResponse } from "./types/VerifyEmailResponse";
|
241
|
+
export { UploadImage, UploadImageResponse, ImageFile } from "./types/others";
|
@@ -1 +1 @@
|
|
1
|
-
export type DeleteAccountResponse =
|
1
|
+
export type DeleteAccountResponse = Record<string, never>;
|
package/dist/types/GetPosts.d.ts
CHANGED
@@ -1,5 +1,6 @@
|
|
1
1
|
import type { CommunityId } from "./CommunityId";
|
2
2
|
import type { ListingType } from "./ListingType";
|
3
|
+
import type { PaginationCursor } from "./PaginationCursor";
|
3
4
|
import type { SortType } from "./SortType";
|
4
5
|
export interface GetPosts {
|
5
6
|
type_?: ListingType;
|
@@ -11,4 +12,5 @@ export interface GetPosts {
|
|
11
12
|
saved_only?: boolean;
|
12
13
|
liked_only?: boolean;
|
13
14
|
disliked_only?: boolean;
|
15
|
+
page_cursor?: PaginationCursor;
|
14
16
|
}
|
@@ -1,6 +1,7 @@
|
|
1
1
|
import type { CommunityBlockView } from "./CommunityBlockView";
|
2
2
|
import type { CommunityFollowerView } from "./CommunityFollowerView";
|
3
3
|
import type { CommunityModeratorView } from "./CommunityModeratorView";
|
4
|
+
import type { InstanceBlockView } from "./InstanceBlockView";
|
4
5
|
import type { LanguageId } from "./LanguageId";
|
5
6
|
import type { LocalUserView } from "./LocalUserView";
|
6
7
|
import type { PersonBlockView } from "./PersonBlockView";
|
@@ -9,6 +10,7 @@ export interface MyUserInfo {
|
|
9
10
|
follows: Array<CommunityFollowerView>;
|
10
11
|
moderates: Array<CommunityModeratorView>;
|
11
12
|
community_blocks: Array<CommunityBlockView>;
|
13
|
+
instance_blocks: Array<InstanceBlockView>;
|
12
14
|
person_blocks: Array<PersonBlockView>;
|
13
15
|
discussion_languages: Array<LanguageId>;
|
14
16
|
}
|
@@ -0,0 +1 @@
|
|
1
|
+
export type PaginationCursor = string;
|
@@ -1 +1 @@
|
|
1
|
-
export type PasswordResetResponse =
|
1
|
+
export type PasswordResetResponse = Record<string, never>;
|
package/dist/types/Person.d.ts
CHANGED
@@ -1,4 +1,5 @@
|
|
1
1
|
import type { CommunityId } from "./CommunityId";
|
2
|
+
import type { InstanceId } from "./InstanceId";
|
2
3
|
import type { PersonId } from "./PersonId";
|
3
4
|
import type { PostId } from "./PostId";
|
4
5
|
export interface PostAggregates {
|
@@ -18,4 +19,6 @@ export interface PostAggregates {
|
|
18
19
|
community_id: CommunityId;
|
19
20
|
creator_id: PersonId;
|
20
21
|
controversy_rank: number;
|
22
|
+
instance_id: InstanceId;
|
23
|
+
scaled_rank: number;
|
21
24
|
}
|
package/dist/types/SortType.d.ts
CHANGED
@@ -1 +1 @@
|
|
1
|
-
export type SortType = "Active" | "Hot" | "New" | "Old" | "TopDay" | "TopWeek" | "TopMonth" | "TopYear" | "TopAll" | "MostComments" | "NewComments" | "TopHour" | "TopSixHour" | "TopTwelveHour" | "TopThreeMonths" | "TopSixMonths" | "TopNineMonths" | "Controversial";
|
1
|
+
export type SortType = "Active" | "Hot" | "New" | "Old" | "TopDay" | "TopWeek" | "TopMonth" | "TopYear" | "TopAll" | "MostComments" | "NewComments" | "TopHour" | "TopSixHour" | "TopTwelveHour" | "TopThreeMonths" | "TopSixMonths" | "TopNineMonths" | "Controversial" | "Scaled";
|
@@ -1 +1 @@
|
|
1
|
-
export type VerifyEmailResponse =
|
1
|
+
export type VerifyEmailResponse = Record<string, never>;
|
package/package.json
CHANGED