lemmy-js-client 0.19.0-rc.13 → 0.19.0-rc.15
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 +47 -20
- package/dist/http.js +56 -14
- package/dist/index.d.ts +6 -9
- package/dist/{types/others.d.ts → other_types.d.ts} +4 -4
- package/dist/types/ActivityId.d.ts +1 -0
- package/dist/types/CommentAggregates.d.ts +0 -3
- package/dist/types/CommentReplyView.d.ts +2 -0
- package/dist/types/CommentView.d.ts +2 -0
- package/dist/types/CommunityAggregates.d.ts +0 -2
- package/dist/types/CustomEmojiKeyword.d.ts +0 -1
- package/dist/types/FederatedInstances.d.ts +4 -4
- package/dist/types/ImageUpload.d.ts +0 -2
- package/dist/types/InstanceWithFederationState.d.ts +11 -0
- package/dist/types/LemmyErrorType.d.ts +171 -138
- package/dist/types/LocalSite.d.ts +1 -0
- package/dist/types/LocalSiteRateLimit.d.ts +2 -1
- package/dist/types/LocalUser.d.ts +3 -2
- package/dist/types/LoginToken.d.ts +7 -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/PersonAggregates.d.ts +0 -3
- package/dist/types/PersonMentionView.d.ts +2 -0
- package/dist/types/PersonView.d.ts +1 -0
- package/dist/types/PostAggregates.d.ts +0 -15
- package/dist/types/PostView.d.ts +2 -0
- package/dist/types/ReadableFederationState.d.ts +10 -0
- package/dist/types/ReadableFederationState.js +2 -0
- package/dist/types/RemoveCommunity.d.ts +0 -1
- package/dist/types/SaveUserSettings.d.ts +5 -1
- package/dist/types/SiteAggregates.d.ts +0 -1
- package/dist/types/SuccessResponse.d.ts +3 -0
- package/package.json +1 -1
- package/dist/types/CommunityBlockId.d.ts +0 -1
- package/dist/types/DeleteAccountResponse.d.ts +0 -1
- package/dist/types/DeleteCustomEmojiResponse.d.ts +0 -5
- package/dist/types/ImageUploadId.d.ts +0 -1
- package/dist/types/ImageUploadId.js +0 -3
- package/dist/types/PasswordResetResponse.d.ts +0 -1
- package/dist/types/PasswordResetResponse.js +0 -3
- package/dist/types/PersonSortType.d.ts +0 -1
- package/dist/types/PersonSortType.js +0 -3
- package/dist/types/PurgeItemResponse.d.ts +0 -3
- package/dist/types/PurgeItemResponse.js +0 -3
- package/dist/types/VerifyEmailResponse.d.ts +0 -1
- package/dist/types/VerifyEmailResponse.js +0 -3
- package/dist/utils.d.ts +0 -0
- package/dist/utils.js +0 -0
- /package/dist/{types/others.js → other_types.js} +0 -0
- /package/dist/types/{CommunityBlockId.js → ActivityId.js} +0 -0
- /package/dist/types/{DeleteCustomEmojiResponse.js → InstanceWithFederationState.js} +0 -0
- /package/dist/types/{DeleteAccountResponse.js → SuccessResponse.js} +0 -0
package/dist/http.d.ts
CHANGED
@@ -31,11 +31,9 @@ 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";
|
35
34
|
import { DeleteComment } from "./types/DeleteComment";
|
36
35
|
import { DeleteCommunity } from "./types/DeleteCommunity";
|
37
36
|
import { DeleteCustomEmoji } from "./types/DeleteCustomEmoji";
|
38
|
-
import { DeleteCustomEmojiResponse } from "./types/DeleteCustomEmojiResponse";
|
39
37
|
import { DeletePost } from "./types/DeletePost";
|
40
38
|
import { DeletePrivateMessage } from "./types/DeletePrivateMessage";
|
41
39
|
import { DistinguishComment } from "./types/DistinguishComment";
|
@@ -93,7 +91,6 @@ import { MarkPostAsRead } from "./types/MarkPostAsRead";
|
|
93
91
|
import { MarkPrivateMessageAsRead } from "./types/MarkPrivateMessageAsRead";
|
94
92
|
import { PasswordChangeAfterReset } from "./types/PasswordChangeAfterReset";
|
95
93
|
import { PasswordReset } from "./types/PasswordReset";
|
96
|
-
import { PasswordResetResponse } from "./types/PasswordResetResponse";
|
97
94
|
import { PersonMentionResponse } from "./types/PersonMentionResponse";
|
98
95
|
import { PostReportResponse } from "./types/PostReportResponse";
|
99
96
|
import { PostResponse } from "./types/PostResponse";
|
@@ -102,7 +99,6 @@ import { PrivateMessageResponse } from "./types/PrivateMessageResponse";
|
|
102
99
|
import { PrivateMessagesResponse } from "./types/PrivateMessagesResponse";
|
103
100
|
import { PurgeComment } from "./types/PurgeComment";
|
104
101
|
import { PurgeCommunity } from "./types/PurgeCommunity";
|
105
|
-
import { PurgeItemResponse } from "./types/PurgeItemResponse";
|
106
102
|
import { PurgePerson } from "./types/PurgePerson";
|
107
103
|
import { PurgePost } from "./types/PurgePost";
|
108
104
|
import { Register } from "./types/Register";
|
@@ -123,14 +119,15 @@ import { SearchResponse } from "./types/SearchResponse";
|
|
123
119
|
import { SiteResponse } from "./types/SiteResponse";
|
124
120
|
import { TransferCommunity } from "./types/TransferCommunity";
|
125
121
|
import { VerifyEmail } from "./types/VerifyEmail";
|
126
|
-
import {
|
127
|
-
import { UploadImage, UploadImageResponse } from "./types/others";
|
122
|
+
import { DeleteImage, UploadImage, UploadImageResponse } from "./other_types";
|
128
123
|
import { HideCommunity } from "./types/HideCommunity";
|
129
124
|
import { BlockInstance } from "./types/BlockInstance";
|
130
125
|
import { BlockInstanceResponse } from "./types/BlockInstanceResponse";
|
131
126
|
import { GenerateTotpSecretResponse } from "./types/GenerateTotpSecretResponse";
|
132
127
|
import { UpdateTotp } from "./types/UpdateTotp";
|
133
128
|
import { UpdateTotpResponse } from "./types/UpdateTotpResponse";
|
129
|
+
import { SuccessResponse } from "./types/SuccessResponse";
|
130
|
+
import { LoginToken } from "./types/LoginToken";
|
134
131
|
/**
|
135
132
|
* Helps build lemmy HTTP requests.
|
136
133
|
*/
|
@@ -179,6 +176,31 @@ export declare class LemmyHttp {
|
|
179
176
|
* `HTTP.POST /user/totp/generate`
|
180
177
|
*/
|
181
178
|
generateTotpSecret(): Promise<GenerateTotpSecretResponse>;
|
179
|
+
/**
|
180
|
+
* Export a backup of your user settings, including your saved content,
|
181
|
+
* followed communities, and blocks.
|
182
|
+
*
|
183
|
+
* `HTTP.GET /user/export_settings`
|
184
|
+
*/
|
185
|
+
exportSettings(): Promise<any>;
|
186
|
+
/**
|
187
|
+
* Import a backup of your user settings.
|
188
|
+
*
|
189
|
+
* `HTTP.POST /user/import_settings`
|
190
|
+
*/
|
191
|
+
importSettings(form: any): Promise<SuccessResponse>;
|
192
|
+
/**
|
193
|
+
* List login tokens for your user
|
194
|
+
*
|
195
|
+
* `HTTP.GET /user/list_logins`
|
196
|
+
*/
|
197
|
+
listLogins(): Promise<LoginToken[]>;
|
198
|
+
/**
|
199
|
+
* Returns an error message if your auth token is invalid
|
200
|
+
*
|
201
|
+
* `HTTP.GET /user/validate_auth`
|
202
|
+
*/
|
203
|
+
validateAuth(): Promise<SuccessResponse>;
|
182
204
|
/**
|
183
205
|
* Enable / Disable TOTP / two-factor authentication.
|
184
206
|
*
|
@@ -250,11 +272,11 @@ export declare class LemmyHttp {
|
|
250
272
|
*/
|
251
273
|
deleteCommunity(form: DeleteCommunity): Promise<CommunityResponse>;
|
252
274
|
/**
|
253
|
-
* Hide a community from public view.
|
275
|
+
* Hide a community from public / "All" view. Admins only.
|
254
276
|
*
|
255
277
|
* `HTTP.PUT /community/hide`
|
256
278
|
*/
|
257
|
-
hideCommunity(form: HideCommunity): Promise<
|
279
|
+
hideCommunity(form: HideCommunity): Promise<SuccessResponse>;
|
258
280
|
/**
|
259
281
|
* A moderator remove for a community.
|
260
282
|
*
|
@@ -314,7 +336,7 @@ export declare class LemmyHttp {
|
|
314
336
|
*
|
315
337
|
* `HTTP.POST /post/mark_as_read`
|
316
338
|
*/
|
317
|
-
markPostAsRead(form: MarkPostAsRead): Promise<
|
339
|
+
markPostAsRead(form: MarkPostAsRead): Promise<SuccessResponse>;
|
318
340
|
/**
|
319
341
|
* A moderator can lock a post ( IE disable new comments ).
|
320
342
|
*
|
@@ -507,6 +529,7 @@ export declare class LemmyHttp {
|
|
507
529
|
* `HTTP.POST /user/login`
|
508
530
|
*/
|
509
531
|
login(form: Login): Promise<LoginResponse>;
|
532
|
+
logout(): Promise<SuccessResponse>;
|
510
533
|
/**
|
511
534
|
* Get the details for a person.
|
512
535
|
*
|
@@ -560,19 +583,19 @@ export declare class LemmyHttp {
|
|
560
583
|
*
|
561
584
|
* `HTTP.POST /user/delete_account`
|
562
585
|
*/
|
563
|
-
deleteAccount(form: DeleteAccount): Promise<
|
586
|
+
deleteAccount(form: DeleteAccount): Promise<SuccessResponse>;
|
564
587
|
/**
|
565
588
|
* Reset your password.
|
566
589
|
*
|
567
590
|
* `HTTP.POST /user/password_reset`
|
568
591
|
*/
|
569
|
-
passwordReset(form: PasswordReset): Promise<
|
592
|
+
passwordReset(form: PasswordReset): Promise<SuccessResponse>;
|
570
593
|
/**
|
571
594
|
* Change your password from an email / token based reset.
|
572
595
|
*
|
573
596
|
* `HTTP.POST /user/password_change`
|
574
597
|
*/
|
575
|
-
passwordChangeAfterReset(form: PasswordChangeAfterReset): Promise<
|
598
|
+
passwordChangeAfterReset(form: PasswordChangeAfterReset): Promise<SuccessResponse>;
|
576
599
|
/**
|
577
600
|
* Mark all replies as read.
|
578
601
|
*
|
@@ -584,7 +607,7 @@ export declare class LemmyHttp {
|
|
584
607
|
*
|
585
608
|
* `HTTP.PUT /user/save_user_settings`
|
586
609
|
*/
|
587
|
-
saveUserSettings(form: SaveUserSettings): Promise<
|
610
|
+
saveUserSettings(form: SaveUserSettings): Promise<SuccessResponse>;
|
588
611
|
/**
|
589
612
|
* Change your user password.
|
590
613
|
*
|
@@ -608,7 +631,7 @@ export declare class LemmyHttp {
|
|
608
631
|
*
|
609
632
|
* `HTTP.POST /user/verify_email`
|
610
633
|
*/
|
611
|
-
verifyEmail(form: VerifyEmail): Promise<
|
634
|
+
verifyEmail(form: VerifyEmail): Promise<SuccessResponse>;
|
612
635
|
/**
|
613
636
|
* Add an admin to your site.
|
614
637
|
*
|
@@ -638,25 +661,25 @@ export declare class LemmyHttp {
|
|
638
661
|
*
|
639
662
|
* `HTTP.POST /admin/purge/person`
|
640
663
|
*/
|
641
|
-
purgePerson(form: PurgePerson): Promise<
|
664
|
+
purgePerson(form: PurgePerson): Promise<SuccessResponse>;
|
642
665
|
/**
|
643
666
|
* Purge / Delete a community from the database.
|
644
667
|
*
|
645
668
|
* `HTTP.POST /admin/purge/community`
|
646
669
|
*/
|
647
|
-
purgeCommunity(form: PurgeCommunity): Promise<
|
670
|
+
purgeCommunity(form: PurgeCommunity): Promise<SuccessResponse>;
|
648
671
|
/**
|
649
672
|
* Purge / Delete a post from the database.
|
650
673
|
*
|
651
674
|
* `HTTP.POST /admin/purge/post`
|
652
675
|
*/
|
653
|
-
purgePost(form: PurgePost): Promise<
|
676
|
+
purgePost(form: PurgePost): Promise<SuccessResponse>;
|
654
677
|
/**
|
655
678
|
* Purge / Delete a comment from the database.
|
656
679
|
*
|
657
680
|
* `HTTP.POST /admin/purge/comment`
|
658
681
|
*/
|
659
|
-
purgeComment(form: PurgeComment): Promise<
|
682
|
+
purgeComment(form: PurgeComment): Promise<SuccessResponse>;
|
660
683
|
/**
|
661
684
|
* Create a new custom emoji
|
662
685
|
*
|
@@ -674,7 +697,7 @@ export declare class LemmyHttp {
|
|
674
697
|
*
|
675
698
|
* `HTTP.Post /custom_emoji/delete`
|
676
699
|
*/
|
677
|
-
deleteCustomEmoji(form: DeleteCustomEmoji): Promise<
|
700
|
+
deleteCustomEmoji(form: DeleteCustomEmoji): Promise<SuccessResponse>;
|
678
701
|
/**
|
679
702
|
* Fetch federated instances.
|
680
703
|
*
|
@@ -690,7 +713,11 @@ export declare class LemmyHttp {
|
|
690
713
|
/**
|
691
714
|
* Upload an image to the server.
|
692
715
|
*/
|
693
|
-
uploadImage({ image
|
716
|
+
uploadImage({ image }: UploadImage): Promise<UploadImageResponse>;
|
717
|
+
/**
|
718
|
+
* Delete a pictrs image
|
719
|
+
*/
|
720
|
+
deleteImage({ token, filename }: DeleteImage): Promise<boolean>;
|
694
721
|
/**
|
695
722
|
* Set the headers (can be used to set the auth header)
|
696
723
|
*/
|
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");
|
@@ -100,6 +100,39 @@ class LemmyHttp {
|
|
100
100
|
generateTotpSecret() {
|
101
101
|
return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Post, "/user/totp/generate", {});
|
102
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
|
+
}
|
103
136
|
/**
|
104
137
|
* Enable / Disable TOTP / two-factor authentication.
|
105
138
|
*
|
@@ -193,7 +226,7 @@ class LemmyHttp {
|
|
193
226
|
return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Post, "/community/delete", form);
|
194
227
|
}
|
195
228
|
/**
|
196
|
-
* Hide a community from public view.
|
229
|
+
* Hide a community from public / "All" view. Admins only.
|
197
230
|
*
|
198
231
|
* `HTTP.PUT /community/hide`
|
199
232
|
*/
|
@@ -536,6 +569,9 @@ class LemmyHttp {
|
|
536
569
|
login(form) {
|
537
570
|
return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Post, "/user/login", form);
|
538
571
|
}
|
572
|
+
logout() {
|
573
|
+
return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Post, "/user/logout", {});
|
574
|
+
}
|
539
575
|
/**
|
540
576
|
* Get the details for a person.
|
541
577
|
*
|
@@ -779,22 +815,15 @@ class LemmyHttp {
|
|
779
815
|
/**
|
780
816
|
* Upload an image to the server.
|
781
817
|
*/
|
782
|
-
uploadImage({ image
|
783
|
-
var _a, _b, _c, _d;
|
818
|
+
uploadImage({ image }) {
|
784
819
|
return __awaiter(this, void 0, void 0, function* () {
|
785
820
|
const formData = createFormData(image);
|
786
|
-
// If auth cookie not already set by browser, set it with passed in auth
|
787
|
-
const headers = {};
|
788
|
-
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=")) &&
|
789
|
-
!((_d = (_c = __classPrivateFieldGet(this, _LemmyHttp_headers, "f")) === null || _c === void 0 ? void 0 : _c.Cookie) === null || _d === void 0 ? void 0 : _d.includes("auth="))) {
|
790
|
-
headers.Cookie = `auth=${auth}`;
|
791
|
-
}
|
792
821
|
let url = undefined;
|
793
822
|
let delete_url = undefined;
|
794
823
|
const response = yield __classPrivateFieldGet(this, _LemmyHttp_fetchFunction, "f").call(this, __classPrivateFieldGet(this, _LemmyHttp_pictrsUrl, "f"), {
|
795
824
|
method: HttpType.Post,
|
796
825
|
body: formData,
|
797
|
-
headers:
|
826
|
+
headers: __classPrivateFieldGet(this, _LemmyHttp_headers, "f"),
|
798
827
|
});
|
799
828
|
if (response.status === 413) {
|
800
829
|
return { msg: "too_large" };
|
@@ -809,6 +838,19 @@ class LemmyHttp {
|
|
809
838
|
delete_url });
|
810
839
|
});
|
811
840
|
}
|
841
|
+
/**
|
842
|
+
* Delete a pictrs image
|
843
|
+
*/
|
844
|
+
deleteImage({ token, filename }) {
|
845
|
+
return __awaiter(this, void 0, void 0, function* () {
|
846
|
+
const deleteUrl = `${__classPrivateFieldGet(this, _LemmyHttp_pictrsUrl, "f")}/delete/${token}/${filename}`;
|
847
|
+
const response = yield __classPrivateFieldGet(this, _LemmyHttp_fetchFunction, "f").call(this, deleteUrl, {
|
848
|
+
method: HttpType.Get,
|
849
|
+
headers: __classPrivateFieldGet(this, _LemmyHttp_headers, "f"),
|
850
|
+
});
|
851
|
+
return (yield response.status) == 204;
|
852
|
+
});
|
853
|
+
}
|
812
854
|
/**
|
813
855
|
* Set the headers (can be used to set the auth header)
|
814
856
|
*/
|
@@ -842,10 +884,10 @@ _LemmyHttp_apiUrl = new WeakMap(), _LemmyHttp_headers = new WeakMap(), _LemmyHtt
|
|
842
884
|
json = yield response.json();
|
843
885
|
}
|
844
886
|
catch (error) {
|
845
|
-
throw response.statusText;
|
887
|
+
throw new Error(response.statusText);
|
846
888
|
}
|
847
889
|
if (!response.ok) {
|
848
|
-
throw (_a = json["error"]) !== null && _a !== void 0 ? _a : response.statusText;
|
890
|
+
throw new Error((_a = json["error"]) !== null && _a !== void 0 ? _a : response.statusText);
|
849
891
|
}
|
850
892
|
else {
|
851
893
|
return json;
|
package/dist/index.d.ts
CHANGED
@@ -1,4 +1,5 @@
|
|
1
1
|
export * from "./http";
|
2
|
+
export { ActivityId } from "./types/ActivityId";
|
2
3
|
export { AddAdmin } from "./types/AddAdmin";
|
3
4
|
export { AddAdminResponse } from "./types/AddAdminResponse";
|
4
5
|
export { AddModToCommunity } from "./types/AddModToCommunity";
|
@@ -41,7 +42,6 @@ export { CommentSortType } from "./types/CommentSortType";
|
|
41
42
|
export { CommentView } from "./types/CommentView";
|
42
43
|
export { Community } from "./types/Community";
|
43
44
|
export { CommunityAggregates } from "./types/CommunityAggregates";
|
44
|
-
export { CommunityBlockId } from "./types/CommunityBlockId";
|
45
45
|
export { CommunityBlockView } from "./types/CommunityBlockView";
|
46
46
|
export { CommunityFollowerView } from "./types/CommunityFollowerView";
|
47
47
|
export { CommunityId } from "./types/CommunityId";
|
@@ -65,11 +65,9 @@ export { CustomEmojiKeyword } from "./types/CustomEmojiKeyword";
|
|
65
65
|
export { CustomEmojiResponse } from "./types/CustomEmojiResponse";
|
66
66
|
export { CustomEmojiView } from "./types/CustomEmojiView";
|
67
67
|
export { DeleteAccount } from "./types/DeleteAccount";
|
68
|
-
export { DeleteAccountResponse } from "./types/DeleteAccountResponse";
|
69
68
|
export { DeleteComment } from "./types/DeleteComment";
|
70
69
|
export { DeleteCommunity } from "./types/DeleteCommunity";
|
71
70
|
export { DeleteCustomEmoji } from "./types/DeleteCustomEmoji";
|
72
|
-
export { DeleteCustomEmojiResponse } from "./types/DeleteCustomEmojiResponse";
|
73
71
|
export { DeletePost } from "./types/DeletePost";
|
74
72
|
export { DeletePrivateMessage } from "./types/DeletePrivateMessage";
|
75
73
|
export { DistinguishComment } from "./types/DistinguishComment";
|
@@ -112,10 +110,10 @@ export { GetUnreadCountResponse } from "./types/GetUnreadCountResponse";
|
|
112
110
|
export { GetUnreadRegistrationApplicationCountResponse } from "./types/GetUnreadRegistrationApplicationCountResponse";
|
113
111
|
export { HideCommunity } from "./types/HideCommunity";
|
114
112
|
export { ImageUpload } from "./types/ImageUpload";
|
115
|
-
export { ImageUploadId } from "./types/ImageUploadId";
|
116
113
|
export { Instance } from "./types/Instance";
|
117
114
|
export { InstanceBlockView } from "./types/InstanceBlockView";
|
118
115
|
export { InstanceId } from "./types/InstanceId";
|
116
|
+
export { InstanceWithFederationState } from "./types/InstanceWithFederationState";
|
119
117
|
export { Language } from "./types/Language";
|
120
118
|
export { LanguageId } from "./types/LanguageId";
|
121
119
|
export { LemmyErrorType } from "./types/LemmyErrorType";
|
@@ -139,6 +137,7 @@ export { LocalUserView } from "./types/LocalUserView";
|
|
139
137
|
export { LockPost } from "./types/LockPost";
|
140
138
|
export { Login } from "./types/Login";
|
141
139
|
export { LoginResponse } from "./types/LoginResponse";
|
140
|
+
export { LoginToken } from "./types/LoginToken";
|
142
141
|
export { MarkCommentReplyAsRead } from "./types/MarkCommentReplyAsRead";
|
143
142
|
export { MarkPersonMentionAsRead } from "./types/MarkPersonMentionAsRead";
|
144
143
|
export { MarkPostAsRead } from "./types/MarkPostAsRead";
|
@@ -171,7 +170,6 @@ export { MyUserInfo } from "./types/MyUserInfo";
|
|
171
170
|
export { PaginationCursor } from "./types/PaginationCursor";
|
172
171
|
export { PasswordChangeAfterReset } from "./types/PasswordChangeAfterReset";
|
173
172
|
export { PasswordReset } from "./types/PasswordReset";
|
174
|
-
export { PasswordResetResponse } from "./types/PasswordResetResponse";
|
175
173
|
export { Person } from "./types/Person";
|
176
174
|
export { PersonAggregates } from "./types/PersonAggregates";
|
177
175
|
export { PersonBlockId } from "./types/PersonBlockId";
|
@@ -181,7 +179,6 @@ export { PersonMention } from "./types/PersonMention";
|
|
181
179
|
export { PersonMentionId } from "./types/PersonMentionId";
|
182
180
|
export { PersonMentionResponse } from "./types/PersonMentionResponse";
|
183
181
|
export { PersonMentionView } from "./types/PersonMentionView";
|
184
|
-
export { PersonSortType } from "./types/PersonSortType";
|
185
182
|
export { PersonView } from "./types/PersonView";
|
186
183
|
export { Post } from "./types/Post";
|
187
184
|
export { PostAggregates } from "./types/PostAggregates";
|
@@ -205,9 +202,9 @@ export { PrivateMessageView } from "./types/PrivateMessageView";
|
|
205
202
|
export { PrivateMessagesResponse } from "./types/PrivateMessagesResponse";
|
206
203
|
export { PurgeComment } from "./types/PurgeComment";
|
207
204
|
export { PurgeCommunity } from "./types/PurgeCommunity";
|
208
|
-
export { PurgeItemResponse } from "./types/PurgeItemResponse";
|
209
205
|
export { PurgePerson } from "./types/PurgePerson";
|
210
206
|
export { PurgePost } from "./types/PurgePost";
|
207
|
+
export { ReadableFederationState } from "./types/ReadableFederationState";
|
211
208
|
export { Register } from "./types/Register";
|
212
209
|
export { RegistrationApplication } from "./types/RegistrationApplication";
|
213
210
|
export { RegistrationApplicationResponse } from "./types/RegistrationApplicationResponse";
|
@@ -235,10 +232,10 @@ export { SiteResponse } from "./types/SiteResponse";
|
|
235
232
|
export { SiteView } from "./types/SiteView";
|
236
233
|
export { SortType } from "./types/SortType";
|
237
234
|
export { SubscribedType } from "./types/SubscribedType";
|
235
|
+
export { SuccessResponse } from "./types/SuccessResponse";
|
238
236
|
export { Tagline } from "./types/Tagline";
|
239
237
|
export { TransferCommunity } from "./types/TransferCommunity";
|
240
238
|
export { UpdateTotp } from "./types/UpdateTotp";
|
241
239
|
export { UpdateTotpResponse } from "./types/UpdateTotpResponse";
|
242
240
|
export { VerifyEmail } from "./types/VerifyEmail";
|
243
|
-
export {
|
244
|
-
export { UploadImage, UploadImageResponse, ImageFile } from "./types/others";
|
241
|
+
export { UploadImage, UploadImageResponse, ImageFile, DeleteImage, } from "./other_types";
|
@@ -2,10 +2,6 @@
|
|
2
2
|
export declare const VERSION = "v3";
|
3
3
|
export interface UploadImage {
|
4
4
|
image: File | Buffer;
|
5
|
-
/**
|
6
|
-
* Optional if cookie with jwt set is already present. Otherwise, auth is required.
|
7
|
-
*/
|
8
|
-
auth?: string;
|
9
5
|
}
|
10
6
|
export interface UploadImageResponse {
|
11
7
|
/**
|
@@ -20,3 +16,7 @@ export interface ImageFile {
|
|
20
16
|
file: string;
|
21
17
|
delete_token: string;
|
22
18
|
}
|
19
|
+
export interface DeleteImage {
|
20
|
+
token: string;
|
21
|
+
filename: string;
|
22
|
+
}
|
@@ -0,0 +1 @@
|
|
1
|
+
export type ActivityId = number;
|
@@ -1,12 +1,9 @@
|
|
1
1
|
import type { CommentId } from "./CommentId";
|
2
2
|
export interface CommentAggregates {
|
3
|
-
id: number;
|
4
3
|
comment_id: CommentId;
|
5
4
|
score: number;
|
6
5
|
upvotes: number;
|
7
6
|
downvotes: number;
|
8
7
|
published: string;
|
9
8
|
child_count: number;
|
10
|
-
hot_rank: number;
|
11
|
-
controversy_rank: number;
|
12
9
|
}
|
@@ -14,6 +14,8 @@ export interface CommentReplyView {
|
|
14
14
|
recipient: Person;
|
15
15
|
counts: CommentAggregates;
|
16
16
|
creator_banned_from_community: boolean;
|
17
|
+
creator_is_moderator: boolean;
|
18
|
+
creator_is_admin: boolean;
|
17
19
|
subscribed: SubscribedType;
|
18
20
|
saved: boolean;
|
19
21
|
creator_blocked: boolean;
|
@@ -11,6 +11,8 @@ export interface CommentView {
|
|
11
11
|
community: Community;
|
12
12
|
counts: CommentAggregates;
|
13
13
|
creator_banned_from_community: boolean;
|
14
|
+
creator_is_moderator: boolean;
|
15
|
+
creator_is_admin: boolean;
|
14
16
|
subscribed: SubscribedType;
|
15
17
|
saved: boolean;
|
16
18
|
creator_blocked: boolean;
|
@@ -1,6 +1,5 @@
|
|
1
1
|
import type { CommunityId } from "./CommunityId";
|
2
2
|
export interface CommunityAggregates {
|
3
|
-
id: number;
|
4
3
|
community_id: CommunityId;
|
5
4
|
subscribers: number;
|
6
5
|
posts: number;
|
@@ -10,5 +9,4 @@ export interface CommunityAggregates {
|
|
10
9
|
users_active_week: number;
|
11
10
|
users_active_month: number;
|
12
11
|
users_active_half_year: number;
|
13
|
-
hot_rank: number;
|
14
12
|
}
|
@@ -1,6 +1,6 @@
|
|
1
|
-
import type {
|
1
|
+
import type { InstanceWithFederationState } from "./InstanceWithFederationState";
|
2
2
|
export interface FederatedInstances {
|
3
|
-
linked: Array<
|
4
|
-
allowed: Array<
|
5
|
-
blocked: Array<
|
3
|
+
linked: Array<InstanceWithFederationState>;
|
4
|
+
allowed: Array<InstanceWithFederationState>;
|
5
|
+
blocked: Array<InstanceWithFederationState>;
|
6
6
|
}
|
@@ -0,0 +1,11 @@
|
|
1
|
+
import type { InstanceId } from "./InstanceId";
|
2
|
+
import type { ReadableFederationState } from "./ReadableFederationState";
|
3
|
+
export interface InstanceWithFederationState {
|
4
|
+
id: InstanceId;
|
5
|
+
domain: string;
|
6
|
+
published: string;
|
7
|
+
updated?: string;
|
8
|
+
software?: string;
|
9
|
+
version?: string;
|
10
|
+
federation_state?: ReadableFederationState;
|
11
|
+
}
|