lemmy-js-client 0.20.0-image-api-rework.6 → 0.20.0-image-api-rework.8
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 +80 -30
- package/dist/http.js +135 -39
- package/dist/index.d.ts +6 -6
- package/dist/types/AdminAllowInstance.d.ts +1 -1
- package/dist/types/AdminBlockInstance.d.ts +1 -1
- package/dist/types/AuthenticateWithOauth.d.ts +1 -1
- package/dist/types/GetPosts.d.ts +1 -0
- package/dist/types/GetReportCountResponse.d.ts +1 -5
- package/dist/types/GetReportCountResponse.js +1 -0
- package/dist/types/{ListCommentReports.d.ts → ListReports.d.ts} +5 -6
- package/dist/types/ListReportsResponse.d.ts +7 -0
- package/dist/types/ReportCombined.d.ts +14 -0
- package/dist/types/ReportCombinedId.d.ts +4 -0
- package/dist/types/ReportCombinedPaginationCursor.d.ts +4 -0
- package/dist/types/ReportCombinedPaginationCursor.js +3 -0
- package/dist/types/ReportCombinedView.d.ts +10 -0
- package/package.json +2 -2
- package/dist/types/ListCommentReportsResponse.d.ts +0 -7
- package/dist/types/ListPostReports.d.ts +0 -18
- package/dist/types/ListPostReportsResponse.d.ts +0 -7
- package/dist/types/ListPrivateMessageReports.d.ts +0 -11
- package/dist/types/ListPrivateMessageReportsResponse.d.ts +0 -7
- package/dist/types/ListPrivateMessageReportsResponse.js +0 -2
- /package/dist/types/{ListCommentReports.js → ListReports.js} +0 -0
- /package/dist/types/{ListCommentReportsResponse.js → ListReportsResponse.js} +0 -0
- /package/dist/types/{ListPostReports.js → ReportCombined.js} +0 -0
- /package/dist/types/{ListPrivateMessageReports.js → ReportCombinedId.js} +0 -0
- /package/dist/types/{ListPostReportsResponse.js → ReportCombinedView.js} +0 -0
package/dist/http.d.ts
CHANGED
@@ -76,14 +76,8 @@ import { GetSiteMetadataResponse } from "./types/GetSiteMetadataResponse";
|
|
76
76
|
import { GetSiteResponse } from "./types/GetSiteResponse";
|
77
77
|
import { GetUnreadCountResponse } from "./types/GetUnreadCountResponse";
|
78
78
|
import { GetUnreadRegistrationApplicationCountResponse } from "./types/GetUnreadRegistrationApplicationCountResponse";
|
79
|
-
import { ListCommentReports } from "./types/ListCommentReports";
|
80
|
-
import { ListCommentReportsResponse } from "./types/ListCommentReportsResponse";
|
81
79
|
import { ListCommunities } from "./types/ListCommunities";
|
82
80
|
import { ListCommunitiesResponse } from "./types/ListCommunitiesResponse";
|
83
|
-
import { ListPostReports } from "./types/ListPostReports";
|
84
|
-
import { ListPostReportsResponse } from "./types/ListPostReportsResponse";
|
85
|
-
import { ListPrivateMessageReports } from "./types/ListPrivateMessageReports";
|
86
|
-
import { ListPrivateMessageReportsResponse } from "./types/ListPrivateMessageReportsResponse";
|
87
81
|
import { ListRegistrationApplications } from "./types/ListRegistrationApplications";
|
88
82
|
import { ListRegistrationApplicationsResponse } from "./types/ListRegistrationApplicationsResponse";
|
89
83
|
import { LockPost } from "./types/LockPost";
|
@@ -153,6 +147,8 @@ import { GetCommunityPendingFollowsCountResponse } from "./types/GetCommunityPen
|
|
153
147
|
import { ListCommunityPendingFollowsResponse } from "./types/ListCommunityPendingFollowsResponse";
|
154
148
|
import { ListCommunityPendingFollows } from "./types/ListCommunityPendingFollows";
|
155
149
|
import { CommunityId } from "./types/CommunityId";
|
150
|
+
import { ListReports } from "./types/ListReports";
|
151
|
+
import { ListReportsResponse } from "./types/ListReportsResponse";
|
156
152
|
import { MyUserInfo } from "./types/MyUserInfo";
|
157
153
|
import { UserBlockInstanceParams } from "./types/UserBlockInstanceParams";
|
158
154
|
import { AdminAllowInstanceParams } from "./types/AdminAllowInstanceParams";
|
@@ -456,12 +452,6 @@ export declare class LemmyHttp {
|
|
456
452
|
* `HTTP.PUT /post/report/resolve`
|
457
453
|
*/
|
458
454
|
resolvePostReport(form: ResolvePostReport, options?: RequestOptions): Promise<PostReportResponse>;
|
459
|
-
/**
|
460
|
-
* List post reports.
|
461
|
-
*
|
462
|
-
* `HTTP.GET /post/report/list`
|
463
|
-
*/
|
464
|
-
listPostReports(form: ListPostReports, options?: RequestOptions): Promise<ListPostReportsResponse>;
|
465
455
|
/**
|
466
456
|
* Fetch metadata for any given site.
|
467
457
|
*
|
@@ -546,12 +536,6 @@ export declare class LemmyHttp {
|
|
546
536
|
* `HTTP.PUT /comment/report/resolve`
|
547
537
|
*/
|
548
538
|
resolveCommentReport(form: ResolveCommentReport, options?: RequestOptions): Promise<CommentReportResponse>;
|
549
|
-
/**
|
550
|
-
* List comment reports.
|
551
|
-
*
|
552
|
-
* `HTTP.GET /comment/report/list`
|
553
|
-
*/
|
554
|
-
listCommentReports(form: ListCommentReports, options?: RequestOptions): Promise<ListCommentReportsResponse>;
|
555
539
|
/**
|
556
540
|
* Get / fetch private messages.
|
557
541
|
*
|
@@ -594,12 +578,6 @@ export declare class LemmyHttp {
|
|
594
578
|
* `HTTP.PUT /private_message/report/resolve`
|
595
579
|
*/
|
596
580
|
resolvePrivateMessageReport(form: ResolvePrivateMessageReport, options?: RequestOptions): Promise<PrivateMessageReportResponse>;
|
597
|
-
/**
|
598
|
-
* List private message reports.
|
599
|
-
*
|
600
|
-
* `HTTP.GET /private_message/report/list`
|
601
|
-
*/
|
602
|
-
listPrivateMessageReports(form: ListPrivateMessageReports, options?: RequestOptions): Promise<ListPrivateMessageReportsResponse>;
|
603
581
|
/**
|
604
582
|
* Register a new user.
|
605
583
|
*
|
@@ -858,6 +836,12 @@ export declare class LemmyHttp {
|
|
858
836
|
* `HTTP.Get /federated_instances`
|
859
837
|
*/
|
860
838
|
getFederatedInstances(options?: RequestOptions): Promise<GetFederatedInstancesResponse>;
|
839
|
+
/**
|
840
|
+
* List user reports.
|
841
|
+
*
|
842
|
+
* `HTTP.GET /report/list`
|
843
|
+
*/
|
844
|
+
listReports(form: ListReports, options?: RequestOptions): Promise<ListReportsResponse>;
|
861
845
|
/**
|
862
846
|
* Block an instance as user.
|
863
847
|
*
|
@@ -877,17 +861,83 @@ export declare class LemmyHttp {
|
|
877
861
|
*/
|
878
862
|
adminAllowInstance(form: AdminAllowInstanceParams, options?: RequestOptions): Promise<SuccessResponse>;
|
879
863
|
/**
|
880
|
-
* Upload
|
864
|
+
* Upload new user avatar.
|
881
865
|
*
|
882
|
-
* `HTTP.Post /
|
866
|
+
* `HTTP.Post /account/avatar`
|
883
867
|
*/
|
884
|
-
|
868
|
+
uploadUserAvatar(image: UploadImage, options?: RequestOptions): Promise<SuccessResponse>;
|
885
869
|
/**
|
886
|
-
*
|
870
|
+
* Delete the user avatar.
|
887
871
|
*
|
888
|
-
* `HTTP.
|
872
|
+
* `HTTP.Delete /account/avatar`
|
873
|
+
*/
|
874
|
+
deleteUserAvatar(options?: RequestOptions): Promise<SuccessResponse>;
|
875
|
+
/**
|
876
|
+
* Upload new user banner.
|
877
|
+
*
|
878
|
+
* `HTTP.Post /account/banner`
|
879
|
+
*/
|
880
|
+
uploadUserBanner(image: UploadImage, options?: RequestOptions): Promise<SuccessResponse>;
|
881
|
+
/**
|
882
|
+
* Delete the user banner.
|
883
|
+
*
|
884
|
+
* `HTTP.Delete /account/banner`
|
885
|
+
*/
|
886
|
+
deleteUserBanner(options?: RequestOptions): Promise<SuccessResponse>;
|
887
|
+
/**
|
888
|
+
* Upload new community icon.
|
889
|
+
*
|
890
|
+
* `HTTP.Post /community/icon`
|
891
|
+
*/
|
892
|
+
uploadCommunityIcon(image: UploadImage, options?: RequestOptions): Promise<SuccessResponse>;
|
893
|
+
/**
|
894
|
+
* Delete the community icon.
|
895
|
+
*
|
896
|
+
* `HTTP.Delete /community/icon`
|
897
|
+
*/
|
898
|
+
deleteCommunityIcon(options?: RequestOptions): Promise<SuccessResponse>;
|
899
|
+
/**
|
900
|
+
* Upload new community banner.
|
901
|
+
*
|
902
|
+
* `HTTP.Post /community/banner`
|
903
|
+
*/
|
904
|
+
uploadCommunityBanner(image: UploadImage, options?: RequestOptions): Promise<SuccessResponse>;
|
905
|
+
/**
|
906
|
+
* Delete the community banner.
|
907
|
+
*
|
908
|
+
* `HTTP.Delete /community/banner`
|
909
|
+
*/
|
910
|
+
deleteCommunityBanner(options?: RequestOptions): Promise<SuccessResponse>;
|
911
|
+
/**
|
912
|
+
* Upload new site icon.
|
913
|
+
*
|
914
|
+
* `HTTP.Post /site/icon`
|
915
|
+
*/
|
916
|
+
uploadSiteIcon(image: UploadImage, options?: RequestOptions): Promise<SuccessResponse>;
|
917
|
+
/**
|
918
|
+
* Delete the site icon.
|
919
|
+
*
|
920
|
+
* `HTTP.Delete /site/icon`
|
921
|
+
*/
|
922
|
+
deleteSiteIcon(options?: RequestOptions): Promise<SuccessResponse>;
|
923
|
+
/**
|
924
|
+
* Upload new site banner.
|
925
|
+
*
|
926
|
+
* `HTTP.Post /site/banner`
|
927
|
+
*/
|
928
|
+
uploadSiteBanner(image: UploadImage, options?: RequestOptions): Promise<SuccessResponse>;
|
929
|
+
/**
|
930
|
+
* Delete the site banner.
|
931
|
+
*
|
932
|
+
* `HTTP.Delete /site/banner`
|
933
|
+
*/
|
934
|
+
deleteSiteBanner(options?: RequestOptions): Promise<SuccessResponse>;
|
935
|
+
/**
|
936
|
+
* Upload an image to the server.
|
937
|
+
*
|
938
|
+
* `HTTP.Post /image`
|
889
939
|
*/
|
890
|
-
|
940
|
+
uploadImage(image: UploadImage, options?: RequestOptions): Promise<UploadImageResponse>;
|
891
941
|
/**
|
892
942
|
* Delete a pictrs image
|
893
943
|
*
|
package/dist/http.js
CHANGED
@@ -19,7 +19,7 @@ var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (
|
|
19
19
|
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
20
20
|
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
21
21
|
};
|
22
|
-
var _LemmyHttp_instances, _LemmyHttp_apiUrl, _LemmyHttp_headers, _LemmyHttp_fetchFunction, _LemmyHttp_buildFullUrl, _LemmyHttp_wrapper;
|
22
|
+
var _LemmyHttp_instances, _LemmyHttp_apiUrl, _LemmyHttp_headers, _LemmyHttp_fetchFunction, _LemmyHttp_buildFullUrl, _LemmyHttp_upload, _LemmyHttp_wrapper;
|
23
23
|
Object.defineProperty(exports, "__esModule", { value: true });
|
24
24
|
exports.LemmyHttp = void 0;
|
25
25
|
const other_types_1 = require("./other_types");
|
@@ -429,14 +429,6 @@ class LemmyHttp {
|
|
429
429
|
resolvePostReport(form, options) {
|
430
430
|
return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Put, "/post/report/resolve", form, options);
|
431
431
|
}
|
432
|
-
/**
|
433
|
-
* List post reports.
|
434
|
-
*
|
435
|
-
* `HTTP.GET /post/report/list`
|
436
|
-
*/
|
437
|
-
listPostReports(form, options) {
|
438
|
-
return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Get, "/post/report/list", form, options);
|
439
|
-
}
|
440
432
|
/**
|
441
433
|
* Fetch metadata for any given site.
|
442
434
|
*
|
@@ -549,14 +541,6 @@ class LemmyHttp {
|
|
549
541
|
resolveCommentReport(form, options) {
|
550
542
|
return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Put, "/comment/report/resolve", form, options);
|
551
543
|
}
|
552
|
-
/**
|
553
|
-
* List comment reports.
|
554
|
-
*
|
555
|
-
* `HTTP.GET /comment/report/list`
|
556
|
-
*/
|
557
|
-
listCommentReports(form, options) {
|
558
|
-
return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Get, "/comment/report/list", form, options);
|
559
|
-
}
|
560
544
|
/**
|
561
545
|
* Get / fetch private messages.
|
562
546
|
*
|
@@ -613,14 +597,6 @@ class LemmyHttp {
|
|
613
597
|
resolvePrivateMessageReport(form, options) {
|
614
598
|
return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Put, "/private_message/report/resolve", form, options);
|
615
599
|
}
|
616
|
-
/**
|
617
|
-
* List private message reports.
|
618
|
-
*
|
619
|
-
* `HTTP.GET /private_message/report/list`
|
620
|
-
*/
|
621
|
-
listPrivateMessageReports(form, options) {
|
622
|
-
return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Get, "/private_message/report/list", form, options);
|
623
|
-
}
|
624
600
|
/**
|
625
601
|
* Register a new user.
|
626
602
|
*
|
@@ -965,6 +941,14 @@ class LemmyHttp {
|
|
965
941
|
getFederatedInstances(options) {
|
966
942
|
return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Get, "/federated_instances", {}, options);
|
967
943
|
}
|
944
|
+
/**
|
945
|
+
* List user reports.
|
946
|
+
*
|
947
|
+
* `HTTP.GET /report/list`
|
948
|
+
*/
|
949
|
+
listReports(form, options) {
|
950
|
+
return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Get, "/report/list", form, options);
|
951
|
+
}
|
968
952
|
/**
|
969
953
|
* Block an instance as user.
|
970
954
|
*
|
@@ -990,27 +974,133 @@ class LemmyHttp {
|
|
990
974
|
return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Post, "/admin/instance/allow", form, options);
|
991
975
|
}
|
992
976
|
/**
|
993
|
-
* Upload
|
977
|
+
* Upload new user avatar.
|
994
978
|
*
|
995
|
-
* `HTTP.Post /
|
979
|
+
* `HTTP.Post /account/avatar`
|
996
980
|
*/
|
997
|
-
|
998
|
-
return __awaiter(this,
|
999
|
-
|
1000
|
-
const response = yield __classPrivateFieldGet(this, _LemmyHttp_fetchFunction, "f").call(this, __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_buildFullUrl).call(this, "/image"), Object.assign(Object.assign({}, options), { method: HttpType.Post, body: formData, headers: __classPrivateFieldGet(this, _LemmyHttp_headers, "f") }));
|
1001
|
-
return response.json();
|
981
|
+
uploadUserAvatar(image, options) {
|
982
|
+
return __awaiter(this, void 0, void 0, function* () {
|
983
|
+
return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_upload).call(this, "/account/avatar", image, options);
|
1002
984
|
});
|
1003
985
|
}
|
1004
986
|
/**
|
1005
|
-
*
|
987
|
+
* Delete the user avatar.
|
1006
988
|
*
|
1007
|
-
* `HTTP.
|
989
|
+
* `HTTP.Delete /account/avatar`
|
1008
990
|
*/
|
1009
|
-
|
1010
|
-
return __awaiter(this,
|
1011
|
-
|
1012
|
-
|
1013
|
-
|
991
|
+
deleteUserAvatar(options) {
|
992
|
+
return __awaiter(this, void 0, void 0, function* () {
|
993
|
+
return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Delete, "/account/avatar", {}, options);
|
994
|
+
});
|
995
|
+
}
|
996
|
+
/**
|
997
|
+
* Upload new user banner.
|
998
|
+
*
|
999
|
+
* `HTTP.Post /account/banner`
|
1000
|
+
*/
|
1001
|
+
uploadUserBanner(image, options) {
|
1002
|
+
return __awaiter(this, void 0, void 0, function* () {
|
1003
|
+
return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_upload).call(this, "/account/banner", image, options);
|
1004
|
+
});
|
1005
|
+
}
|
1006
|
+
/**
|
1007
|
+
* Delete the user banner.
|
1008
|
+
*
|
1009
|
+
* `HTTP.Delete /account/banner`
|
1010
|
+
*/
|
1011
|
+
deleteUserBanner(options) {
|
1012
|
+
return __awaiter(this, void 0, void 0, function* () {
|
1013
|
+
return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Delete, "/account/banner", {}, options);
|
1014
|
+
});
|
1015
|
+
}
|
1016
|
+
/**
|
1017
|
+
* Upload new community icon.
|
1018
|
+
*
|
1019
|
+
* `HTTP.Post /community/icon`
|
1020
|
+
*/
|
1021
|
+
uploadCommunityIcon(image, options) {
|
1022
|
+
return __awaiter(this, void 0, void 0, function* () {
|
1023
|
+
return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_upload).call(this, "/community/icon", image, options);
|
1024
|
+
});
|
1025
|
+
}
|
1026
|
+
/**
|
1027
|
+
* Delete the community icon.
|
1028
|
+
*
|
1029
|
+
* `HTTP.Delete /community/icon`
|
1030
|
+
*/
|
1031
|
+
deleteCommunityIcon(options) {
|
1032
|
+
return __awaiter(this, void 0, void 0, function* () {
|
1033
|
+
return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Delete, "/community/icon", {}, options);
|
1034
|
+
});
|
1035
|
+
}
|
1036
|
+
/**
|
1037
|
+
* Upload new community banner.
|
1038
|
+
*
|
1039
|
+
* `HTTP.Post /community/banner`
|
1040
|
+
*/
|
1041
|
+
uploadCommunityBanner(image, options) {
|
1042
|
+
return __awaiter(this, void 0, void 0, function* () {
|
1043
|
+
return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_upload).call(this, "/community/banner", image, options);
|
1044
|
+
});
|
1045
|
+
}
|
1046
|
+
/**
|
1047
|
+
* Delete the community banner.
|
1048
|
+
*
|
1049
|
+
* `HTTP.Delete /community/banner`
|
1050
|
+
*/
|
1051
|
+
deleteCommunityBanner(options) {
|
1052
|
+
return __awaiter(this, void 0, void 0, function* () {
|
1053
|
+
return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Delete, "/community/banner", {}, options);
|
1054
|
+
});
|
1055
|
+
}
|
1056
|
+
/**
|
1057
|
+
* Upload new site icon.
|
1058
|
+
*
|
1059
|
+
* `HTTP.Post /site/icon`
|
1060
|
+
*/
|
1061
|
+
uploadSiteIcon(image, options) {
|
1062
|
+
return __awaiter(this, void 0, void 0, function* () {
|
1063
|
+
return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_upload).call(this, "/site/icon", image, options);
|
1064
|
+
});
|
1065
|
+
}
|
1066
|
+
/**
|
1067
|
+
* Delete the site icon.
|
1068
|
+
*
|
1069
|
+
* `HTTP.Delete /site/icon`
|
1070
|
+
*/
|
1071
|
+
deleteSiteIcon(options) {
|
1072
|
+
return __awaiter(this, void 0, void 0, function* () {
|
1073
|
+
return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Delete, "/site/icon", {}, options);
|
1074
|
+
});
|
1075
|
+
}
|
1076
|
+
/**
|
1077
|
+
* Upload new site banner.
|
1078
|
+
*
|
1079
|
+
* `HTTP.Post /site/banner`
|
1080
|
+
*/
|
1081
|
+
uploadSiteBanner(image, options) {
|
1082
|
+
return __awaiter(this, void 0, void 0, function* () {
|
1083
|
+
return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_upload).call(this, "/site/banner", image, options);
|
1084
|
+
});
|
1085
|
+
}
|
1086
|
+
/**
|
1087
|
+
* Delete the site banner.
|
1088
|
+
*
|
1089
|
+
* `HTTP.Delete /site/banner`
|
1090
|
+
*/
|
1091
|
+
deleteSiteBanner(options) {
|
1092
|
+
return __awaiter(this, void 0, void 0, function* () {
|
1093
|
+
return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Delete, "/site/banner", {}, options);
|
1094
|
+
});
|
1095
|
+
}
|
1096
|
+
/**
|
1097
|
+
* Upload an image to the server.
|
1098
|
+
*
|
1099
|
+
* `HTTP.Post /image`
|
1100
|
+
*/
|
1101
|
+
uploadImage(image, options) {
|
1102
|
+
return __awaiter(this, void 0, void 0, function* () {
|
1103
|
+
return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_upload).call(this, "/image", image, options);
|
1014
1104
|
});
|
1015
1105
|
}
|
1016
1106
|
/**
|
@@ -1043,6 +1133,12 @@ class LemmyHttp {
|
|
1043
1133
|
exports.LemmyHttp = LemmyHttp;
|
1044
1134
|
_LemmyHttp_apiUrl = new WeakMap(), _LemmyHttp_headers = new WeakMap(), _LemmyHttp_fetchFunction = new WeakMap(), _LemmyHttp_instances = new WeakSet(), _LemmyHttp_buildFullUrl = function _LemmyHttp_buildFullUrl(endpoint) {
|
1045
1135
|
return `${__classPrivateFieldGet(this, _LemmyHttp_apiUrl, "f")}${endpoint}`;
|
1136
|
+
}, _LemmyHttp_upload = function _LemmyHttp_upload(path_1, _a, options_1) {
|
1137
|
+
return __awaiter(this, arguments, void 0, function* (path, { image }, options) {
|
1138
|
+
const formData = createFormData(image);
|
1139
|
+
const response = yield __classPrivateFieldGet(this, _LemmyHttp_fetchFunction, "f").call(this, __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_buildFullUrl).call(this, path), Object.assign(Object.assign({}, options), { method: HttpType.Post, body: formData, headers: __classPrivateFieldGet(this, _LemmyHttp_headers, "f") }));
|
1140
|
+
return response.json();
|
1141
|
+
});
|
1046
1142
|
}, _LemmyHttp_wrapper = function _LemmyHttp_wrapper(type_, endpoint, form, options) {
|
1047
1143
|
return __awaiter(this, void 0, void 0, function* () {
|
1048
1144
|
var _a;
|
package/dist/index.d.ts
CHANGED
@@ -145,8 +145,6 @@ export { LemmyErrorType } from "./types/LemmyErrorType";
|
|
145
145
|
export { LinkMetadata } from "./types/LinkMetadata";
|
146
146
|
export { ListCommentLikes } from "./types/ListCommentLikes";
|
147
147
|
export { ListCommentLikesResponse } from "./types/ListCommentLikesResponse";
|
148
|
-
export { ListCommentReports } from "./types/ListCommentReports";
|
149
|
-
export { ListCommentReportsResponse } from "./types/ListCommentReportsResponse";
|
150
148
|
export { ListCommunities } from "./types/ListCommunities";
|
151
149
|
export { ListCommunitiesResponse } from "./types/ListCommunitiesResponse";
|
152
150
|
export { ListCommunityPendingFollows } from "./types/ListCommunityPendingFollows";
|
@@ -158,12 +156,10 @@ export { ListMedia } from "./types/ListMedia";
|
|
158
156
|
export { ListMediaResponse } from "./types/ListMediaResponse";
|
159
157
|
export { ListPostLikes } from "./types/ListPostLikes";
|
160
158
|
export { ListPostLikesResponse } from "./types/ListPostLikesResponse";
|
161
|
-
export { ListPostReports } from "./types/ListPostReports";
|
162
|
-
export { ListPostReportsResponse } from "./types/ListPostReportsResponse";
|
163
|
-
export { ListPrivateMessageReports } from "./types/ListPrivateMessageReports";
|
164
|
-
export { ListPrivateMessageReportsResponse } from "./types/ListPrivateMessageReportsResponse";
|
165
159
|
export { ListRegistrationApplications } from "./types/ListRegistrationApplications";
|
166
160
|
export { ListRegistrationApplicationsResponse } from "./types/ListRegistrationApplicationsResponse";
|
161
|
+
export { ListReports } from "./types/ListReports";
|
162
|
+
export { ListReportsResponse } from "./types/ListReportsResponse";
|
167
163
|
export { ListTaglines } from "./types/ListTaglines";
|
168
164
|
export { ListTaglinesResponse } from "./types/ListTaglinesResponse";
|
169
165
|
export { ListingType } from "./types/ListingType";
|
@@ -263,6 +259,10 @@ export { RegistrationMode } from "./types/RegistrationMode";
|
|
263
259
|
export { RemoveComment } from "./types/RemoveComment";
|
264
260
|
export { RemoveCommunity } from "./types/RemoveCommunity";
|
265
261
|
export { RemovePost } from "./types/RemovePost";
|
262
|
+
export { ReportCombined } from "./types/ReportCombined";
|
263
|
+
export { ReportCombinedId } from "./types/ReportCombinedId";
|
264
|
+
export { ReportCombinedPaginationCursor } from "./types/ReportCombinedPaginationCursor";
|
265
|
+
export { ReportCombinedView } from "./types/ReportCombinedView";
|
266
266
|
export { ResolveCommentReport } from "./types/ResolveCommentReport";
|
267
267
|
export { ResolveObject } from "./types/ResolveObject";
|
268
268
|
export { ResolveObjectResponse } from "./types/ResolveObjectResponse";
|
@@ -4,7 +4,6 @@ import type { OAuthProviderId } from "./OAuthProviderId";
|
|
4
4
|
*/
|
5
5
|
export type AuthenticateWithOauth = {
|
6
6
|
code: string;
|
7
|
-
pkce_code_verifier?: string;
|
8
7
|
oauth_provider_id: OAuthProviderId;
|
9
8
|
redirect_uri: string;
|
10
9
|
show_nsfw?: boolean;
|
@@ -16,4 +15,5 @@ export type AuthenticateWithOauth = {
|
|
16
15
|
* An answer is mandatory if require application is enabled on the server
|
17
16
|
*/
|
18
17
|
answer?: string;
|
18
|
+
pkce_code_verifier?: string;
|
19
19
|
};
|
package/dist/types/GetPosts.d.ts
CHANGED
@@ -1,10 +1,6 @@
|
|
1
|
-
import type { CommunityId } from "./CommunityId";
|
2
1
|
/**
|
3
2
|
* A response for the number of reports.
|
4
3
|
*/
|
5
4
|
export type GetReportCountResponse = {
|
6
|
-
|
7
|
-
comment_reports: number;
|
8
|
-
post_reports: number;
|
9
|
-
private_message_reports?: number;
|
5
|
+
count: number;
|
10
6
|
};
|
@@ -1,12 +1,9 @@
|
|
1
|
-
import type { CommentId } from "./CommentId";
|
2
1
|
import type { CommunityId } from "./CommunityId";
|
2
|
+
import type { ReportCombinedPaginationCursor } from "./ReportCombinedPaginationCursor";
|
3
3
|
/**
|
4
|
-
* List
|
4
|
+
* List reports.
|
5
5
|
*/
|
6
|
-
export type
|
7
|
-
comment_id?: CommentId;
|
8
|
-
page?: number;
|
9
|
-
limit?: number;
|
6
|
+
export type ListReports = {
|
10
7
|
/**
|
11
8
|
* Only shows the unresolved reports
|
12
9
|
*/
|
@@ -15,4 +12,6 @@ export type ListCommentReports = {
|
|
15
12
|
* if no community is given, it returns reports for all communities moderated by the auth user
|
16
13
|
*/
|
17
14
|
community_id?: CommunityId;
|
15
|
+
page_cursor?: ReportCombinedPaginationCursor;
|
16
|
+
page_back?: boolean;
|
18
17
|
};
|
@@ -0,0 +1,14 @@
|
|
1
|
+
import type { CommentReportId } from "./CommentReportId";
|
2
|
+
import type { PostReportId } from "./PostReportId";
|
3
|
+
import type { PrivateMessageReportId } from "./PrivateMessageReportId";
|
4
|
+
import type { ReportCombinedId } from "./ReportCombinedId";
|
5
|
+
/**
|
6
|
+
* A combined reports table.
|
7
|
+
*/
|
8
|
+
export type ReportCombined = {
|
9
|
+
id: ReportCombinedId;
|
10
|
+
published: string;
|
11
|
+
post_report_id?: PostReportId;
|
12
|
+
comment_report_id?: CommentReportId;
|
13
|
+
private_message_report_id?: PrivateMessageReportId;
|
14
|
+
};
|
@@ -0,0 +1,10 @@
|
|
1
|
+
import type { CommentReportView } from "./CommentReportView";
|
2
|
+
import type { PostReportView } from "./PostReportView";
|
3
|
+
import type { PrivateMessageReportView } from "./PrivateMessageReportView";
|
4
|
+
export type ReportCombinedView = ({
|
5
|
+
type_: "Post";
|
6
|
+
} & PostReportView) | ({
|
7
|
+
type_: "Comment";
|
8
|
+
} & CommentReportView) | ({
|
9
|
+
type_: "PrivateMessage";
|
10
|
+
} & PrivateMessageReportView);
|
package/package.json
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
{
|
2
2
|
"name": "lemmy-js-client",
|
3
3
|
"description": "A javascript / typescript client for Lemmy",
|
4
|
-
"version": "0.20.0-image-api-rework.
|
4
|
+
"version": "0.20.0-image-api-rework.8",
|
5
5
|
"author": "Dessalines <tyhou13@gmx.com>",
|
6
6
|
"license": "AGPL-3.0",
|
7
7
|
"main": "./dist/index.js",
|
@@ -35,7 +35,7 @@
|
|
35
35
|
"typescript": "^5.5.4",
|
36
36
|
"typescript-eslint": "^8.7.0"
|
37
37
|
},
|
38
|
-
"packageManager": "pnpm@9.15.
|
38
|
+
"packageManager": "pnpm@9.15.2",
|
39
39
|
"types": "./dist/index.d.ts",
|
40
40
|
"lint-staged": {
|
41
41
|
"*.{ts,tsx,js}": [
|
@@ -1,18 +0,0 @@
|
|
1
|
-
import type { CommunityId } from "./CommunityId";
|
2
|
-
import type { PostId } from "./PostId";
|
3
|
-
/**
|
4
|
-
* List post reports.
|
5
|
-
*/
|
6
|
-
export type ListPostReports = {
|
7
|
-
page?: number;
|
8
|
-
limit?: number;
|
9
|
-
/**
|
10
|
-
* Only shows the unresolved reports
|
11
|
-
*/
|
12
|
-
unresolved_only?: boolean;
|
13
|
-
/**
|
14
|
-
* if no community is given, it returns reports for all communities moderated by the auth user
|
15
|
-
*/
|
16
|
-
community_id?: CommunityId;
|
17
|
-
post_id?: PostId;
|
18
|
-
};
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|