lemmy-js-client 0.20.0-show-mod-reports.2 → 1.0.0-post-tags.0
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 +27 -0
- package/dist/http.js +140 -101
- package/dist/index.d.ts +7 -0
- package/dist/types/Community.d.ts +2 -2
- package/dist/types/CommunityTagResponse.d.ts +7 -0
- package/dist/types/CommunityTagResponse.js +2 -0
- package/dist/types/CreateCommunityTag.d.ts +9 -0
- package/dist/types/CreateCommunityTag.js +2 -0
- package/dist/types/DeleteCommunityTag.d.ts +7 -0
- package/dist/types/DeleteCommunityTag.js +2 -0
- package/dist/types/EditPost.d.ts +0 -2
- package/dist/types/ListCommunityTags.d.ts +7 -0
- package/dist/types/ListCommunityTags.js +2 -0
- package/dist/types/ListCommunityTagsResponse.d.ts +4 -0
- package/dist/types/ListCommunityTagsResponse.js +2 -0
- package/dist/types/ListReports.d.ts +0 -4
- package/dist/types/Person.d.ts +2 -2
- package/dist/types/PostTags.d.ts +1 -3
- package/dist/types/Site.d.ts +2 -2
- package/dist/types/UpdateCommunityTag.d.ts +8 -0
- package/dist/types/UpdateCommunityTag.js +2 -0
- package/dist/types/UpdatePostTags.d.ts +9 -0
- package/dist/types/UpdatePostTags.js +2 -0
- package/package.json +1 -1
package/dist/http.d.ts
CHANGED
@@ -21,6 +21,7 @@ import { CreateComment } from "./types/CreateComment";
|
|
21
21
|
import { CreateCommentLike } from "./types/CreateCommentLike";
|
22
22
|
import { CreateCommentReport } from "./types/CreateCommentReport";
|
23
23
|
import { CreateCommunity } from "./types/CreateCommunity";
|
24
|
+
import { CreateCommunityTag } from "./types/CreateCommunityTag";
|
24
25
|
import { CreateCustomEmoji } from "./types/CreateCustomEmoji";
|
25
26
|
import { CreateOAuthProvider } from "./types/CreateOAuthProvider";
|
26
27
|
import { CreatePost } from "./types/CreatePost";
|
@@ -33,6 +34,7 @@ import { CustomEmojiResponse } from "./types/CustomEmojiResponse";
|
|
33
34
|
import { DeleteAccount } from "./types/DeleteAccount";
|
34
35
|
import { DeleteComment } from "./types/DeleteComment";
|
35
36
|
import { DeleteCommunity } from "./types/DeleteCommunity";
|
37
|
+
import { DeleteCommunityTag } from "./types/DeleteCommunityTag";
|
36
38
|
import { DeleteCustomEmoji } from "./types/DeleteCustomEmoji";
|
37
39
|
import { DeleteOAuthProvider } from "./types/DeleteOAuthProvider";
|
38
40
|
import { DeletePost } from "./types/DeletePost";
|
@@ -62,6 +64,8 @@ import { GetSiteResponse } from "./types/GetSiteResponse";
|
|
62
64
|
import { GetUnreadCountResponse } from "./types/GetUnreadCountResponse";
|
63
65
|
import { GetUnreadRegistrationApplicationCountResponse } from "./types/GetUnreadRegistrationApplicationCountResponse";
|
64
66
|
import { ListCommunitiesResponse } from "./types/ListCommunitiesResponse";
|
67
|
+
import { ListCommunityTags } from "./types/ListCommunityTags";
|
68
|
+
import { ListCommunityTagsResponse } from "./types/ListCommunityTagsResponse";
|
65
69
|
import { ListRegistrationApplicationsResponse } from "./types/ListRegistrationApplicationsResponse";
|
66
70
|
import { LockPost } from "./types/LockPost";
|
67
71
|
import { Login } from "./types/Login";
|
@@ -94,6 +98,8 @@ import { SaveUserSettings } from "./types/SaveUserSettings";
|
|
94
98
|
import { SearchResponse } from "./types/SearchResponse";
|
95
99
|
import { SiteResponse } from "./types/SiteResponse";
|
96
100
|
import { TransferCommunity } from "./types/TransferCommunity";
|
101
|
+
import { UpdateCommunityTag } from "./types/UpdateCommunityTag";
|
102
|
+
import { UpdatePostTags } from "./types/UpdatePostTags";
|
97
103
|
import { VerifyEmail } from "./types/VerifyEmail";
|
98
104
|
import { DeleteImageParamsI, GetCommentI, GetCommentsI, GetCommunityI, GetCommunityPendingFollowsCountI, GetModlogI, GetPersonDetailsI, GetPostI, GetPostsI, GetRandomCommunityI, GetRegistrationApplicationI, GetReportCountI, GetSiteMetadataI, ListCommentLikesI, ListCommunitiesI, ListCommunityPendingFollowsI, ListCustomEmojisI, ListInboxI, ListMediaI, ListPersonContentI, ListPersonSavedI, ListPostLikesI, ListRegistrationApplicationsI, ListReportsI, ListTaglinesI, ResolveObjectI, SearchI, UploadImage } from "./other_types";
|
99
105
|
import { HideCommunity } from "./types/HideCommunity";
|
@@ -129,6 +135,7 @@ import { MarkPersonCommentMentionAsRead } from "./types/MarkPersonCommentMention
|
|
129
135
|
import { MarkPersonPostMentionAsRead } from "./types/MarkPersonPostMentionAsRead";
|
130
136
|
import { GetCommentsSlimResponse } from "./types/GetCommentsSlimResponse";
|
131
137
|
import { Controller } from "tsoa";
|
138
|
+
import { CommunityTagResponse } from "./types/CommunityTagResponse";
|
132
139
|
type RequestOptions = Pick<RequestInit, "signal">;
|
133
140
|
/**
|
134
141
|
* Helps build lemmy HTTP requests.
|
@@ -588,6 +595,26 @@ export declare class LemmyHttp extends Controller {
|
|
588
595
|
* @summary List taglines.
|
589
596
|
*/
|
590
597
|
listTaglines(form: ListTaglinesI, options?: RequestOptions): Promise<ListTaglinesResponse>;
|
598
|
+
/**
|
599
|
+
* @summary Create a community tag.
|
600
|
+
*/
|
601
|
+
createCommunityTag(form: CreateCommunityTag, options?: RequestOptions): Promise<CommunityTagResponse>;
|
602
|
+
/**
|
603
|
+
* @summary Update a community tag.
|
604
|
+
*/
|
605
|
+
updateCommunityTag(form: UpdateCommunityTag, options?: RequestOptions): Promise<CommunityTagResponse>;
|
606
|
+
/**
|
607
|
+
* @summary List community tags.
|
608
|
+
*/
|
609
|
+
listCommunityTags(form: ListCommunityTags, options?: RequestOptions): Promise<ListCommunityTagsResponse>;
|
610
|
+
/**
|
611
|
+
* @summary Delete a community tag.
|
612
|
+
*/
|
613
|
+
deleteCommunityTag(form: DeleteCommunityTag, options?: RequestOptions): Promise<CommunityTagResponse>;
|
614
|
+
/**
|
615
|
+
* @summary Update post tags.
|
616
|
+
*/
|
617
|
+
updatePostTags(form: UpdatePostTags, options?: RequestOptions): Promise<PostResponse>;
|
591
618
|
/**
|
592
619
|
* @summary Create a new oauth provider method
|
593
620
|
*/
|
package/dist/http.js
CHANGED
@@ -8,15 +8,6 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
8
8
|
var __param = (this && this.__param) || function (paramIndex, decorator) {
|
9
9
|
return function (target, key) { decorator(target, key, paramIndex); }
|
10
10
|
};
|
11
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
12
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
13
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
14
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
15
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
16
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
17
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
18
|
-
});
|
19
|
-
};
|
20
11
|
var __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
|
21
12
|
if (kind === "m") throw new TypeError("Private method is not writable");
|
22
13
|
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
|
@@ -56,10 +47,10 @@ let LemmyHttp = class LemmyHttp extends tsoa_1.Controller {
|
|
56
47
|
_LemmyHttp_headers.set(this, {});
|
57
48
|
_LemmyHttp_fetchFunction.set(this, fetch.bind(globalThis));
|
58
49
|
__classPrivateFieldSet(this, _LemmyHttp_apiUrl, `${baseUrl.replace(/\/+$/, "")}/api/${other_types_1.VERSION}`, "f");
|
59
|
-
if (options
|
50
|
+
if (options?.headers) {
|
60
51
|
__classPrivateFieldSet(this, _LemmyHttp_headers, options.headers, "f");
|
61
52
|
}
|
62
|
-
if (options
|
53
|
+
if (options?.fetchFunction) {
|
63
54
|
__classPrivateFieldSet(this, _LemmyHttp_fetchFunction, options.fetchFunction, "f");
|
64
55
|
}
|
65
56
|
}
|
@@ -721,6 +712,36 @@ let LemmyHttp = class LemmyHttp extends tsoa_1.Controller {
|
|
721
712
|
listTaglines(form, options) {
|
722
713
|
return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Get, "/admin/tagline/list", form, options);
|
723
714
|
}
|
715
|
+
/**
|
716
|
+
* @summary Create a community tag.
|
717
|
+
*/
|
718
|
+
createCommunityTag(form, options) {
|
719
|
+
return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Post, "/community/post_tag", form, options);
|
720
|
+
}
|
721
|
+
/**
|
722
|
+
* @summary Update a community tag.
|
723
|
+
*/
|
724
|
+
updateCommunityTag(form, options) {
|
725
|
+
return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Put, "/community/post_tag", form, options);
|
726
|
+
}
|
727
|
+
/**
|
728
|
+
* @summary List community tags.
|
729
|
+
*/
|
730
|
+
listCommunityTags(form, options) {
|
731
|
+
return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Get, "/community/post_tag/list", form, options);
|
732
|
+
}
|
733
|
+
/**
|
734
|
+
* @summary Delete a community tag.
|
735
|
+
*/
|
736
|
+
deleteCommunityTag(form, options) {
|
737
|
+
return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Delete, "/community/post_tag", form, options);
|
738
|
+
}
|
739
|
+
/**
|
740
|
+
* @summary Update post tags.
|
741
|
+
*/
|
742
|
+
updatePostTags(form, options) {
|
743
|
+
return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Put, "/post/tags", form, options);
|
744
|
+
}
|
724
745
|
/**
|
725
746
|
* @summary Create a new oauth provider method
|
726
747
|
*/
|
@@ -778,122 +799,92 @@ let LemmyHttp = class LemmyHttp extends tsoa_1.Controller {
|
|
778
799
|
/**
|
779
800
|
* @summary Upload new user avatar.
|
780
801
|
*/
|
781
|
-
uploadUserAvatar(image, options) {
|
782
|
-
return
|
783
|
-
return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_upload).call(this, "/account/avatar", image, options);
|
784
|
-
});
|
802
|
+
async uploadUserAvatar(image, options) {
|
803
|
+
return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_upload).call(this, "/account/avatar", image, options);
|
785
804
|
}
|
786
805
|
/**
|
787
806
|
* @summary Delete the user avatar.
|
788
807
|
*/
|
789
|
-
deleteUserAvatar(options) {
|
790
|
-
return
|
791
|
-
return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Delete, "/account/avatar", {}, options);
|
792
|
-
});
|
808
|
+
async deleteUserAvatar(options) {
|
809
|
+
return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Delete, "/account/avatar", {}, options);
|
793
810
|
}
|
794
811
|
/**
|
795
812
|
* @summary Upload new user banner.
|
796
813
|
*/
|
797
|
-
uploadUserBanner(image, options) {
|
798
|
-
return
|
799
|
-
return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_upload).call(this, "/account/banner", image, options);
|
800
|
-
});
|
814
|
+
async uploadUserBanner(image, options) {
|
815
|
+
return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_upload).call(this, "/account/banner", image, options);
|
801
816
|
}
|
802
817
|
/**
|
803
818
|
* @summary Delete the user banner.
|
804
819
|
*/
|
805
|
-
deleteUserBanner(options) {
|
806
|
-
return
|
807
|
-
return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Delete, "/account/banner", {}, options);
|
808
|
-
});
|
820
|
+
async deleteUserBanner(options) {
|
821
|
+
return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Delete, "/account/banner", {}, options);
|
809
822
|
}
|
810
823
|
/**
|
811
824
|
* @summary Upload new community icon.
|
812
825
|
*/
|
813
|
-
uploadCommunityIcon(image, options) {
|
814
|
-
return
|
815
|
-
return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_upload).call(this, "/community/icon", image, options);
|
816
|
-
});
|
826
|
+
async uploadCommunityIcon(image, options) {
|
827
|
+
return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_upload).call(this, "/community/icon", image, options);
|
817
828
|
}
|
818
829
|
/**
|
819
830
|
* @summary Delete the community icon.
|
820
831
|
*/
|
821
|
-
deleteCommunityIcon(options) {
|
822
|
-
return
|
823
|
-
return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Delete, "/community/icon", {}, options);
|
824
|
-
});
|
832
|
+
async deleteCommunityIcon(options) {
|
833
|
+
return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Delete, "/community/icon", {}, options);
|
825
834
|
}
|
826
835
|
/**
|
827
836
|
* @summary Upload new community banner.
|
828
837
|
*/
|
829
|
-
uploadCommunityBanner(image, options) {
|
830
|
-
return
|
831
|
-
return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_upload).call(this, "/community/banner", image, options);
|
832
|
-
});
|
838
|
+
async uploadCommunityBanner(image, options) {
|
839
|
+
return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_upload).call(this, "/community/banner", image, options);
|
833
840
|
}
|
834
841
|
/**
|
835
842
|
* @summary Delete the community banner.
|
836
843
|
*/
|
837
|
-
deleteCommunityBanner(options) {
|
838
|
-
return
|
839
|
-
return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Delete, "/community/banner", {}, options);
|
840
|
-
});
|
844
|
+
async deleteCommunityBanner(options) {
|
845
|
+
return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Delete, "/community/banner", {}, options);
|
841
846
|
}
|
842
847
|
/**
|
843
848
|
* @summary Upload new site icon.
|
844
849
|
*/
|
845
|
-
uploadSiteIcon(image, options) {
|
846
|
-
return
|
847
|
-
return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_upload).call(this, "/site/icon", image, options);
|
848
|
-
});
|
850
|
+
async uploadSiteIcon(image, options) {
|
851
|
+
return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_upload).call(this, "/site/icon", image, options);
|
849
852
|
}
|
850
853
|
/**
|
851
854
|
* @summary Delete the site icon.
|
852
855
|
*/
|
853
|
-
deleteSiteIcon(options) {
|
854
|
-
return
|
855
|
-
return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Delete, "/site/icon", {}, options);
|
856
|
-
});
|
856
|
+
async deleteSiteIcon(options) {
|
857
|
+
return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Delete, "/site/icon", {}, options);
|
857
858
|
}
|
858
859
|
/**
|
859
860
|
* @summary Upload new site banner.
|
860
861
|
*/
|
861
|
-
uploadSiteBanner(image, options) {
|
862
|
-
return
|
863
|
-
return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_upload).call(this, "/site/banner", image, options);
|
864
|
-
});
|
862
|
+
async uploadSiteBanner(image, options) {
|
863
|
+
return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_upload).call(this, "/site/banner", image, options);
|
865
864
|
}
|
866
865
|
/**
|
867
866
|
* @summary Delete the site banner.
|
868
867
|
*/
|
869
|
-
deleteSiteBanner(options) {
|
870
|
-
return
|
871
|
-
return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Delete, "/site/banner", {}, options);
|
872
|
-
});
|
868
|
+
async deleteSiteBanner(options) {
|
869
|
+
return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Delete, "/site/banner", {}, options);
|
873
870
|
}
|
874
871
|
/**
|
875
872
|
* @summary Upload an image to the server.
|
876
873
|
*/
|
877
|
-
uploadImage(image, options) {
|
878
|
-
return
|
879
|
-
return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_upload).call(this, "/image", image, options);
|
880
|
-
});
|
874
|
+
async uploadImage(image, options) {
|
875
|
+
return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_upload).call(this, "/image", image, options);
|
881
876
|
}
|
882
877
|
/**
|
883
878
|
* @summary Delete a pictrs image
|
884
879
|
*/
|
885
|
-
deleteImage(form, options) {
|
886
|
-
return
|
887
|
-
return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Delete, "/image", form, options);
|
888
|
-
});
|
880
|
+
async deleteImage(form, options) {
|
881
|
+
return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Delete, "/image", form, options);
|
889
882
|
}
|
890
883
|
/**
|
891
884
|
* @summary Health check for image functionality
|
892
885
|
*/
|
893
|
-
imageHealth(options) {
|
894
|
-
return
|
895
|
-
return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Get, "/image/health", {}, options);
|
896
|
-
});
|
886
|
+
async imageHealth(options) {
|
887
|
+
return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Get, "/image/health", {}, options);
|
897
888
|
}
|
898
889
|
/**
|
899
890
|
* Set the headers (can be used to set the auth header)
|
@@ -910,38 +901,50 @@ _LemmyHttp_instances = new WeakSet();
|
|
910
901
|
_LemmyHttp_buildFullUrl = function _LemmyHttp_buildFullUrl(endpoint) {
|
911
902
|
return `${__classPrivateFieldGet(this, _LemmyHttp_apiUrl, "f")}${endpoint}`;
|
912
903
|
};
|
913
|
-
_LemmyHttp_upload = function _LemmyHttp_upload(
|
914
|
-
|
915
|
-
|
916
|
-
|
917
|
-
|
904
|
+
_LemmyHttp_upload = async function _LemmyHttp_upload(path, { image }, options) {
|
905
|
+
const formData = createFormData(image);
|
906
|
+
const response = await __classPrivateFieldGet(this, _LemmyHttp_fetchFunction, "f").call(this, __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_buildFullUrl).call(this, path), {
|
907
|
+
...options,
|
908
|
+
method: HttpType.Post,
|
909
|
+
body: formData,
|
910
|
+
headers: __classPrivateFieldGet(this, _LemmyHttp_headers, "f"),
|
918
911
|
});
|
912
|
+
return response.json();
|
919
913
|
};
|
920
|
-
_LemmyHttp_wrapper = function _LemmyHttp_wrapper(type_, endpoint, form, options) {
|
921
|
-
|
922
|
-
|
923
|
-
|
924
|
-
|
925
|
-
|
926
|
-
|
927
|
-
|
928
|
-
|
929
|
-
|
930
|
-
|
931
|
-
|
932
|
-
|
933
|
-
|
934
|
-
|
935
|
-
|
936
|
-
|
937
|
-
|
938
|
-
|
939
|
-
|
940
|
-
|
941
|
-
|
942
|
-
|
943
|
-
|
944
|
-
}
|
914
|
+
_LemmyHttp_wrapper = async function _LemmyHttp_wrapper(type_, endpoint, form, options) {
|
915
|
+
let response;
|
916
|
+
if (type_ === HttpType.Get) {
|
917
|
+
const getUrl = `${__classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_buildFullUrl).call(this, endpoint)}?${encodeGetParams(form)}`;
|
918
|
+
response = await __classPrivateFieldGet(this, _LemmyHttp_fetchFunction, "f").call(this, getUrl, {
|
919
|
+
...options,
|
920
|
+
method: HttpType.Get,
|
921
|
+
headers: __classPrivateFieldGet(this, _LemmyHttp_headers, "f"),
|
922
|
+
});
|
923
|
+
}
|
924
|
+
else {
|
925
|
+
response = await __classPrivateFieldGet(this, _LemmyHttp_fetchFunction, "f").call(this, __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_buildFullUrl).call(this, endpoint), {
|
926
|
+
...options,
|
927
|
+
method: type_,
|
928
|
+
headers: {
|
929
|
+
"Content-Type": "application/json",
|
930
|
+
...__classPrivateFieldGet(this, _LemmyHttp_headers, "f"),
|
931
|
+
},
|
932
|
+
body: JSON.stringify(form),
|
933
|
+
});
|
934
|
+
}
|
935
|
+
let json = undefined;
|
936
|
+
try {
|
937
|
+
json = await response.json();
|
938
|
+
}
|
939
|
+
catch {
|
940
|
+
throw new Error(response.statusText);
|
941
|
+
}
|
942
|
+
if (!response.ok) {
|
943
|
+
throw new Error(json["error"] ?? response.statusText);
|
944
|
+
}
|
945
|
+
else {
|
946
|
+
return json;
|
947
|
+
}
|
945
948
|
};
|
946
949
|
__decorate([
|
947
950
|
(0, tsoa_1.Security)("bearerAuth"),
|
@@ -1699,6 +1702,42 @@ __decorate([
|
|
1699
1702
|
__param(0, (0, tsoa_1.Queries)()),
|
1700
1703
|
__param(1, (0, tsoa_1.Inject)())
|
1701
1704
|
], LemmyHttp.prototype, "listTaglines", null);
|
1705
|
+
__decorate([
|
1706
|
+
(0, tsoa_1.Security)("bearerAuth"),
|
1707
|
+
(0, tsoa_1.Post)("/community/post_tag"),
|
1708
|
+
(0, tsoa_1.Tags)("Community"),
|
1709
|
+
__param(0, (0, tsoa_1.Body)()),
|
1710
|
+
__param(1, (0, tsoa_1.Inject)())
|
1711
|
+
], LemmyHttp.prototype, "createCommunityTag", null);
|
1712
|
+
__decorate([
|
1713
|
+
(0, tsoa_1.Security)("bearerAuth"),
|
1714
|
+
(0, tsoa_1.Put)("/community/post_tag"),
|
1715
|
+
(0, tsoa_1.Tags)("Community"),
|
1716
|
+
__param(0, (0, tsoa_1.Body)()),
|
1717
|
+
__param(1, (0, tsoa_1.Inject)())
|
1718
|
+
], LemmyHttp.prototype, "updateCommunityTag", null);
|
1719
|
+
__decorate([
|
1720
|
+
(0, tsoa_1.Security)("bearerAuth"),
|
1721
|
+
(0, tsoa_1.Security)({}),
|
1722
|
+
(0, tsoa_1.Get)("/community/post_tag/list"),
|
1723
|
+
(0, tsoa_1.Tags)("Community"),
|
1724
|
+
__param(0, (0, tsoa_1.Queries)()),
|
1725
|
+
__param(1, (0, tsoa_1.Inject)())
|
1726
|
+
], LemmyHttp.prototype, "listCommunityTags", null);
|
1727
|
+
__decorate([
|
1728
|
+
(0, tsoa_1.Security)("bearerAuth"),
|
1729
|
+
(0, tsoa_1.Post)("/community/post_tag"),
|
1730
|
+
(0, tsoa_1.Tags)("Community"),
|
1731
|
+
__param(0, (0, tsoa_1.Body)()),
|
1732
|
+
__param(1, (0, tsoa_1.Inject)())
|
1733
|
+
], LemmyHttp.prototype, "deleteCommunityTag", null);
|
1734
|
+
__decorate([
|
1735
|
+
(0, tsoa_1.Security)("bearerAuth"),
|
1736
|
+
(0, tsoa_1.Put)("/post/tags"),
|
1737
|
+
(0, tsoa_1.Tags)("Post"),
|
1738
|
+
__param(0, (0, tsoa_1.Body)()),
|
1739
|
+
__param(1, (0, tsoa_1.Inject)())
|
1740
|
+
], LemmyHttp.prototype, "updatePostTags", null);
|
1702
1741
|
__decorate([
|
1703
1742
|
(0, tsoa_1.Security)("bearerAuth"),
|
1704
1743
|
(0, tsoa_1.Post)("/oauth_provider"),
|
package/dist/index.d.ts
CHANGED
@@ -64,12 +64,14 @@ export { CommunityReportId } from "./types/CommunityReportId";
|
|
64
64
|
export { CommunityReportView } from "./types/CommunityReportView";
|
65
65
|
export { CommunityResponse } from "./types/CommunityResponse";
|
66
66
|
export { CommunitySortType } from "./types/CommunitySortType";
|
67
|
+
export { CommunityTagResponse } from "./types/CommunityTagResponse";
|
67
68
|
export { CommunityView } from "./types/CommunityView";
|
68
69
|
export { CommunityVisibility } from "./types/CommunityVisibility";
|
69
70
|
export { CreateComment } from "./types/CreateComment";
|
70
71
|
export { CreateCommentLike } from "./types/CreateCommentLike";
|
71
72
|
export { CreateCommentReport } from "./types/CreateCommentReport";
|
72
73
|
export { CreateCommunity } from "./types/CreateCommunity";
|
74
|
+
export { CreateCommunityTag } from "./types/CreateCommunityTag";
|
73
75
|
export { CreateCustomEmoji } from "./types/CreateCustomEmoji";
|
74
76
|
export { CreateOAuthProvider } from "./types/CreateOAuthProvider";
|
75
77
|
export { CreatePost } from "./types/CreatePost";
|
@@ -88,6 +90,7 @@ export { DbUrl } from "./types/DbUrl";
|
|
88
90
|
export { DeleteAccount } from "./types/DeleteAccount";
|
89
91
|
export { DeleteComment } from "./types/DeleteComment";
|
90
92
|
export { DeleteCommunity } from "./types/DeleteCommunity";
|
93
|
+
export { DeleteCommunityTag } from "./types/DeleteCommunityTag";
|
91
94
|
export { DeleteCustomEmoji } from "./types/DeleteCustomEmoji";
|
92
95
|
export { DeleteImageParams } from "./types/DeleteImageParams";
|
93
96
|
export { DeleteOAuthProvider } from "./types/DeleteOAuthProvider";
|
@@ -157,6 +160,8 @@ export { ListCommunities } from "./types/ListCommunities";
|
|
157
160
|
export { ListCommunitiesResponse } from "./types/ListCommunitiesResponse";
|
158
161
|
export { ListCommunityPendingFollows } from "./types/ListCommunityPendingFollows";
|
159
162
|
export { ListCommunityPendingFollowsResponse } from "./types/ListCommunityPendingFollowsResponse";
|
163
|
+
export { ListCommunityTags } from "./types/ListCommunityTags";
|
164
|
+
export { ListCommunityTagsResponse } from "./types/ListCommunityTagsResponse";
|
160
165
|
export { ListCustomEmojis } from "./types/ListCustomEmojis";
|
161
166
|
export { ListCustomEmojisResponse } from "./types/ListCustomEmojisResponse";
|
162
167
|
export { ListInbox } from "./types/ListInbox";
|
@@ -323,6 +328,8 @@ export { Tagline } from "./types/Tagline";
|
|
323
328
|
export { TaglineId } from "./types/TaglineId";
|
324
329
|
export { TaglineResponse } from "./types/TaglineResponse";
|
325
330
|
export { TransferCommunity } from "./types/TransferCommunity";
|
331
|
+
export { UpdateCommunityTag } from "./types/UpdateCommunityTag";
|
332
|
+
export { UpdatePostTags } from "./types/UpdatePostTags";
|
326
333
|
export { UpdateTagline } from "./types/UpdateTagline";
|
327
334
|
export { UpdateTotp } from "./types/UpdateTotp";
|
328
335
|
export { UpdateTotpResponse } from "./types/UpdateTotpResponse";
|
package/dist/types/EditPost.d.ts
CHANGED
@@ -1,6 +1,5 @@
|
|
1
1
|
import type { LanguageId } from "./LanguageId";
|
2
2
|
import type { PostId } from "./PostId";
|
3
|
-
import type { TagId } from "./TagId";
|
4
3
|
/**
|
5
4
|
* Edit a post.
|
6
5
|
*/
|
@@ -22,7 +21,6 @@ export type EditPost = {
|
|
22
21
|
* Instead of fetching a thumbnail, use a custom one.
|
23
22
|
*/
|
24
23
|
custom_thumbnail?: string;
|
25
|
-
tags?: Array<TagId>;
|
26
24
|
/**
|
27
25
|
* Time when this post should be scheduled. Null means publish immediately.
|
28
26
|
*/
|
@@ -24,8 +24,4 @@ export type ListReports = {
|
|
24
24
|
community_id?: CommunityId;
|
25
25
|
page_cursor?: ReportCombinedPaginationCursor;
|
26
26
|
page_back?: boolean;
|
27
|
-
/**
|
28
|
-
* Only for admins: also show reports with `violates_instance_rules=false`
|
29
|
-
*/
|
30
|
-
show_community_rule_violations?: boolean;
|
31
27
|
};
|
package/dist/types/Person.d.ts
CHANGED
package/dist/types/PostTags.d.ts
CHANGED
package/dist/types/Site.d.ts
CHANGED
package/package.json
CHANGED