lemmy-js-client 1.0.0-post-tags.0 → 1.0.0-site-person-ban.1
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/README.md +12 -3
- package/dist/http.d.ts +8 -30
- package/dist/http.js +119 -145
- package/dist/index.d.ts +15 -24
- package/dist/other_types.d.ts +3 -0
- package/dist/types/BannedPersonsResponse.d.ts +5 -0
- package/dist/types/Comment.d.ts +9 -0
- package/dist/types/CommentActions.d.ts +18 -0
- package/dist/types/CommentReplyView.d.ts +12 -11
- package/dist/types/CommentReport.d.ts +1 -0
- package/dist/types/CommentReportView.d.ts +8 -10
- package/dist/types/CommentSlimView.d.ts +10 -10
- package/dist/types/CommentView.d.ts +11 -10
- package/dist/types/Community.d.ts +25 -6
- package/dist/types/CommunityActions.d.ts +35 -0
- package/dist/types/CommunityReportResponse.d.ts +7 -0
- package/dist/types/CommunityReportView.d.ts +0 -4
- package/dist/types/CommunitySortType.d.ts +1 -1
- package/dist/types/CommunityView.d.ts +5 -6
- package/dist/types/CommunityVisibility.d.ts +1 -1
- package/dist/types/CreateCommentReport.d.ts +1 -0
- package/dist/types/CreateCommunityReport.d.ts +8 -0
- package/dist/types/CreatePostReport.d.ts +1 -0
- package/dist/types/CreateSite.d.ts +2 -0
- package/dist/types/EditPost.d.ts +2 -0
- package/dist/types/EditSite.d.ts +8 -0
- package/dist/types/FederationError.d.ts +1 -1
- package/dist/types/GetComments.d.ts +5 -0
- package/dist/types/GetModlog.d.ts +26 -2
- package/dist/types/GetModlogResponse.d.ts +5 -0
- package/dist/types/GetPostResponse.d.ts +0 -2
- package/dist/types/GetPosts.d.ts +8 -2
- package/dist/types/GetPostsResponse.d.ts +2 -2
- package/dist/types/GetSiteResponse.d.ts +2 -2
- package/dist/types/ImageDetails.d.ts +1 -0
- package/dist/types/Instance.d.ts +9 -0
- package/dist/types/InstanceActions.d.ts +18 -0
- package/dist/types/InstanceWithFederationState.d.ts +9 -0
- package/dist/types/LemmyErrorType.d.ts +6 -4
- package/dist/types/ListBannedPersons.d.ts +9 -0
- package/dist/types/ListCommunities.d.ts +5 -0
- package/dist/types/ListInbox.d.ts +2 -2
- package/dist/types/ListInboxResponse.d.ts +5 -0
- package/dist/types/ListPersonContent.d.ts +2 -2
- package/dist/types/ListPersonContentResponse.d.ts +5 -0
- package/dist/types/ListPersonSaved.d.ts +2 -2
- package/dist/types/ListPersonSavedResponse.d.ts +7 -2
- package/dist/types/ListReports.d.ts +10 -2
- package/dist/types/ListReportsResponse.d.ts +5 -0
- package/dist/types/LocalSite.d.ts +28 -0
- package/dist/types/LocalUser.d.ts +8 -0
- package/dist/types/LocalUserView.d.ts +2 -4
- package/dist/types/ModBan.d.ts +2 -0
- package/dist/types/ModChangeCommunityVisibility.d.ts +12 -0
- package/dist/types/ModChangeCommunityVisibilityId.d.ts +1 -0
- package/dist/types/ModChangeCommunityVisibilityView.d.ts +11 -0
- package/dist/types/ModlogActionType.d.ts +1 -1
- package/dist/types/ModlogCombinedView.d.ts +3 -3
- package/dist/types/PaginationCursor.d.ts +1 -4
- package/dist/types/PendingFollow.d.ts +2 -2
- package/dist/types/Person.d.ts +4 -10
- package/dist/types/PersonActions.d.ts +9 -0
- package/dist/types/PersonCommentMentionView.d.ts +12 -11
- package/dist/types/PersonPostMentionView.d.ts +12 -16
- package/dist/types/PersonSavedCombinedView.d.ts +7 -0
- package/dist/types/PersonView.d.ts +3 -2
- package/dist/types/Post.d.ts +10 -0
- package/dist/types/PostActions.d.ts +35 -0
- package/dist/types/PostPaginationCursor.d.ts +7 -0
- package/dist/types/PostReport.d.ts +1 -0
- package/dist/types/PostReportView.d.ts +8 -13
- package/dist/types/PostSortType.d.ts +1 -1
- package/dist/types/PostView.d.ts +11 -15
- package/dist/types/PrivateMessage.d.ts +1 -0
- package/dist/types/PrivateMessageReportView.d.ts +1 -1
- package/dist/types/ResendVerificationEmail.d.ts +7 -0
- package/dist/types/ResolveCommunityReport.d.ts +8 -0
- package/dist/types/SaveUserSettings.d.ts +4 -0
- package/dist/types/Search.d.ts +7 -2
- package/dist/types/SearchResponse.d.ts +5 -0
- package/dist/types/Site.d.ts +2 -2
- package/dist/types/SiteView.d.ts +2 -2
- package/package.json +3 -3
- package/dist/types/CommentAggregates.d.ts +0 -17
- package/dist/types/CommunityAggregates.d.ts +0 -30
- package/dist/types/CommunityTagResponse.d.ts +0 -7
- package/dist/types/CreateCommunityTag.d.ts +0 -9
- package/dist/types/DeleteCommunityTag.d.ts +0 -7
- package/dist/types/InboxCombinedPaginationCursor.d.ts +0 -4
- package/dist/types/ListCommunityTags.d.ts +0 -7
- package/dist/types/ListCommunityTagsResponse.d.ts +0 -4
- package/dist/types/LocalUserVoteDisplayMode.d.ts +0 -9
- package/dist/types/ModHideCommunity.d.ts +0 -14
- package/dist/types/ModHideCommunityId.d.ts +0 -1
- package/dist/types/ModHideCommunityId.js +0 -3
- package/dist/types/ModHideCommunityView.d.ts +0 -11
- package/dist/types/ModlogCombinedPaginationCursor.d.ts +0 -4
- package/dist/types/ModlogCombinedPaginationCursor.js +0 -3
- package/dist/types/PersonAggregates.d.ts +0 -9
- package/dist/types/PersonContentCombinedPaginationCursor.d.ts +0 -4
- package/dist/types/PersonContentCombinedPaginationCursor.js +0 -3
- package/dist/types/PersonSavedCombinedPaginationCursor.d.ts +0 -4
- package/dist/types/PersonSavedCombinedPaginationCursor.js +0 -3
- package/dist/types/PostAggregates.d.ts +0 -18
- package/dist/types/PostTags.d.ts +0 -5
- package/dist/types/ReportCombinedPaginationCursor.d.ts +0 -4
- package/dist/types/ReportCombinedPaginationCursor.js +0 -3
- package/dist/types/SearchCombinedPaginationCursor.d.ts +0 -4
- package/dist/types/SearchCombinedPaginationCursor.js +0 -3
- package/dist/types/SiteAggregates.d.ts +0 -27
- package/dist/types/SubscribedType.d.ts +0 -4
- package/dist/types/SubscribedType.js +0 -3
- package/dist/types/UpdateCommunityTag.d.ts +0 -8
- package/dist/types/UpdateCommunityTag.js +0 -2
- package/dist/types/UpdatePostTags.d.ts +0 -9
- package/dist/types/UpdatePostTags.js +0 -2
- /package/dist/types/{CommentAggregates.js → CommentActions.js} +0 -0
- /package/dist/types/{CommunityAggregates.js → CommunityActions.js} +0 -0
- /package/dist/types/{CommunityTagResponse.js → CommunityReportResponse.js} +0 -0
- /package/dist/types/{CreateCommunityTag.js → CreateCommunityReport.js} +0 -0
- /package/dist/types/{DeleteCommunityTag.js → InstanceActions.js} +0 -0
- /package/dist/types/{ListCommunityTags.js → ListBannedPersons.js} +0 -0
- /package/dist/types/{ListCommunityTagsResponse.js → ModChangeCommunityVisibility.js} +0 -0
- /package/dist/types/{InboxCombinedPaginationCursor.js → ModChangeCommunityVisibilityId.js} +0 -0
- /package/dist/types/{ModHideCommunity.js → ModChangeCommunityVisibilityView.js} +0 -0
- /package/dist/types/{ModHideCommunityView.js → PersonActions.js} +0 -0
- /package/dist/types/{PersonAggregates.js → PersonSavedCombinedView.js} +0 -0
- /package/dist/types/{PostAggregates.js → PostActions.js} +0 -0
- /package/dist/types/{LocalUserVoteDisplayMode.js → PostPaginationCursor.js} +0 -0
- /package/dist/types/{PostTags.js → ResendVerificationEmail.js} +0 -0
- /package/dist/types/{SiteAggregates.js → ResolveCommunityReport.js} +0 -0
package/README.md
CHANGED
@@ -50,6 +50,15 @@ const posts = await client.getPosts(getPostsForm);
|
|
50
50
|
|
51
51
|
Use `pnpm add` to develop and test changes locally:
|
52
52
|
|
53
|
-
|
54
|
-
|
55
|
-
|
53
|
+
`pnpm add path/to/lemmy-js-client`
|
54
|
+
|
55
|
+
## OpenAPI
|
56
|
+
|
57
|
+
To generate OpenAPI docs, run `pnpm tsoa`
|
58
|
+
|
59
|
+
This creates two files:
|
60
|
+
|
61
|
+
- `redoc-static.html` - A static html rendering of the OpenAPI docs.
|
62
|
+
- `tsoa_build/swagger.json` - An OpenAPI / Swagger json file.
|
63
|
+
|
64
|
+
To contribute, check out the [tsoa docs](https://tsoa-community.github.io/docs/).
|
package/dist/http.d.ts
CHANGED
@@ -1,3 +1,5 @@
|
|
1
|
+
import { Controller } from "tsoa";
|
2
|
+
import { DeleteImageParamsI, GetCommentI, GetCommentsI, GetCommunityI, GetCommunityPendingFollowsCountI, GetModlogI, GetPersonDetailsI, GetPostI, GetPostsI, GetRandomCommunityI, GetRegistrationApplicationI, GetReportCountI, GetSiteMetadataI, ListBannedPersonsI, ListCommentLikesI, ListCommunitiesI, ListCommunityPendingFollowsI, ListCustomEmojisI, ListInboxI, ListMediaI, ListPersonContentI, ListPersonSavedI, ListPostLikesI, ListRegistrationApplicationsI, ListReportsI, ListTaglinesI, ResolveObjectI, SearchI, UploadImage } from "./other_types";
|
1
3
|
import { AddAdmin } from "./types/AddAdmin";
|
2
4
|
import { AddAdminResponse } from "./types/AddAdminResponse";
|
3
5
|
import { AddModToCommunity } from "./types/AddModToCommunity";
|
@@ -21,7 +23,6 @@ import { CreateComment } from "./types/CreateComment";
|
|
21
23
|
import { CreateCommentLike } from "./types/CreateCommentLike";
|
22
24
|
import { CreateCommentReport } from "./types/CreateCommentReport";
|
23
25
|
import { CreateCommunity } from "./types/CreateCommunity";
|
24
|
-
import { CreateCommunityTag } from "./types/CreateCommunityTag";
|
25
26
|
import { CreateCustomEmoji } from "./types/CreateCustomEmoji";
|
26
27
|
import { CreateOAuthProvider } from "./types/CreateOAuthProvider";
|
27
28
|
import { CreatePost } from "./types/CreatePost";
|
@@ -34,7 +35,6 @@ import { CustomEmojiResponse } from "./types/CustomEmojiResponse";
|
|
34
35
|
import { DeleteAccount } from "./types/DeleteAccount";
|
35
36
|
import { DeleteComment } from "./types/DeleteComment";
|
36
37
|
import { DeleteCommunity } from "./types/DeleteCommunity";
|
37
|
-
import { DeleteCommunityTag } from "./types/DeleteCommunityTag";
|
38
38
|
import { DeleteCustomEmoji } from "./types/DeleteCustomEmoji";
|
39
39
|
import { DeleteOAuthProvider } from "./types/DeleteOAuthProvider";
|
40
40
|
import { DeletePost } from "./types/DeletePost";
|
@@ -64,8 +64,6 @@ import { GetSiteResponse } from "./types/GetSiteResponse";
|
|
64
64
|
import { GetUnreadCountResponse } from "./types/GetUnreadCountResponse";
|
65
65
|
import { GetUnreadRegistrationApplicationCountResponse } from "./types/GetUnreadRegistrationApplicationCountResponse";
|
66
66
|
import { ListCommunitiesResponse } from "./types/ListCommunitiesResponse";
|
67
|
-
import { ListCommunityTags } from "./types/ListCommunityTags";
|
68
|
-
import { ListCommunityTagsResponse } from "./types/ListCommunityTagsResponse";
|
69
67
|
import { ListRegistrationApplicationsResponse } from "./types/ListRegistrationApplicationsResponse";
|
70
68
|
import { LockPost } from "./types/LockPost";
|
71
69
|
import { Login } from "./types/Login";
|
@@ -98,10 +96,7 @@ import { SaveUserSettings } from "./types/SaveUserSettings";
|
|
98
96
|
import { SearchResponse } from "./types/SearchResponse";
|
99
97
|
import { SiteResponse } from "./types/SiteResponse";
|
100
98
|
import { TransferCommunity } from "./types/TransferCommunity";
|
101
|
-
import { UpdateCommunityTag } from "./types/UpdateCommunityTag";
|
102
|
-
import { UpdatePostTags } from "./types/UpdatePostTags";
|
103
99
|
import { VerifyEmail } from "./types/VerifyEmail";
|
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";
|
105
100
|
import { HideCommunity } from "./types/HideCommunity";
|
106
101
|
import { GenerateTotpSecretResponse } from "./types/GenerateTotpSecretResponse";
|
107
102
|
import { UpdateTotp } from "./types/UpdateTotp";
|
@@ -134,8 +129,7 @@ import { ListInboxResponse } from "./types/ListInboxResponse";
|
|
134
129
|
import { MarkPersonCommentMentionAsRead } from "./types/MarkPersonCommentMentionAsRead";
|
135
130
|
import { MarkPersonPostMentionAsRead } from "./types/MarkPersonPostMentionAsRead";
|
136
131
|
import { GetCommentsSlimResponse } from "./types/GetCommentsSlimResponse";
|
137
|
-
import {
|
138
|
-
import { CommunityTagResponse } from "./types/CommunityTagResponse";
|
132
|
+
import { ResendVerificationEmail } from "./types/ResendVerificationEmail";
|
139
133
|
type RequestOptions = Pick<RequestInit, "signal">;
|
140
134
|
/**
|
141
135
|
* Helps build lemmy HTTP requests.
|
@@ -474,7 +468,7 @@ export declare class LemmyHttp extends Controller {
|
|
474
468
|
/**
|
475
469
|
* @summary Get a list of banned users.
|
476
470
|
*/
|
477
|
-
|
471
|
+
listBannedPersons(form?: ListBannedPersonsI, options?: RequestOptions): Promise<BannedPersonsResponse>;
|
478
472
|
/**
|
479
473
|
* @summary Block a person.
|
480
474
|
*/
|
@@ -523,6 +517,10 @@ export declare class LemmyHttp extends Controller {
|
|
523
517
|
* @summary Verify your email
|
524
518
|
*/
|
525
519
|
verifyEmail(form: VerifyEmail, options?: RequestOptions): Promise<SuccessResponse>;
|
520
|
+
/**
|
521
|
+
* @summary Resend a verification email.
|
522
|
+
*/
|
523
|
+
resendVerificationEmail(form: ResendVerificationEmail, options?: RequestOptions): Promise<SuccessResponse>;
|
526
524
|
/**
|
527
525
|
* @summary List your saved content.
|
528
526
|
*/
|
@@ -595,26 +593,6 @@ export declare class LemmyHttp extends Controller {
|
|
595
593
|
* @summary List taglines.
|
596
594
|
*/
|
597
595
|
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>;
|
618
596
|
/**
|
619
597
|
* @summary Create a new oauth provider method
|
620
598
|
*/
|
package/dist/http.js
CHANGED
@@ -8,6 +8,15 @@ 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
|
+
};
|
11
20
|
var __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
|
12
21
|
if (kind === "m") throw new TypeError("Private method is not writable");
|
13
22
|
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
|
@@ -22,8 +31,8 @@ var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (
|
|
22
31
|
var _LemmyHttp_instances, _LemmyHttp_apiUrl, _LemmyHttp_headers, _LemmyHttp_fetchFunction, _LemmyHttp_buildFullUrl, _LemmyHttp_upload, _LemmyHttp_wrapper;
|
23
32
|
Object.defineProperty(exports, "__esModule", { value: true });
|
24
33
|
exports.LemmyHttp = void 0;
|
25
|
-
const other_types_1 = require("./other_types");
|
26
34
|
const tsoa_1 = require("tsoa");
|
35
|
+
const other_types_1 = require("./other_types");
|
27
36
|
var HttpType;
|
28
37
|
(function (HttpType) {
|
29
38
|
HttpType["Get"] = "GET";
|
@@ -47,10 +56,10 @@ let LemmyHttp = class LemmyHttp extends tsoa_1.Controller {
|
|
47
56
|
_LemmyHttp_headers.set(this, {});
|
48
57
|
_LemmyHttp_fetchFunction.set(this, fetch.bind(globalThis));
|
49
58
|
__classPrivateFieldSet(this, _LemmyHttp_apiUrl, `${baseUrl.replace(/\/+$/, "")}/api/${other_types_1.VERSION}`, "f");
|
50
|
-
if (options
|
59
|
+
if (options === null || options === void 0 ? void 0 : options.headers) {
|
51
60
|
__classPrivateFieldSet(this, _LemmyHttp_headers, options.headers, "f");
|
52
61
|
}
|
53
|
-
if (options
|
62
|
+
if (options === null || options === void 0 ? void 0 : options.fetchFunction) {
|
54
63
|
__classPrivateFieldSet(this, _LemmyHttp_fetchFunction, options.fetchFunction, "f");
|
55
64
|
}
|
56
65
|
}
|
@@ -529,8 +538,8 @@ let LemmyHttp = class LemmyHttp extends tsoa_1.Controller {
|
|
529
538
|
/**
|
530
539
|
* @summary Get a list of banned users.
|
531
540
|
*/
|
532
|
-
|
533
|
-
return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Get, "/admin/banned",
|
541
|
+
listBannedPersons(form = {}, options) {
|
542
|
+
return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Get, "/admin/banned", form, options);
|
534
543
|
}
|
535
544
|
/**
|
536
545
|
* @summary Block a person.
|
@@ -604,6 +613,12 @@ let LemmyHttp = class LemmyHttp extends tsoa_1.Controller {
|
|
604
613
|
verifyEmail(form, options) {
|
605
614
|
return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Post, "/account/auth/verify_email", form, options);
|
606
615
|
}
|
616
|
+
/**
|
617
|
+
* @summary Resend a verification email.
|
618
|
+
*/
|
619
|
+
resendVerificationEmail(form, options) {
|
620
|
+
return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Post, "/account/auth/resend_verification_email", form, options);
|
621
|
+
}
|
607
622
|
/**
|
608
623
|
* @summary List your saved content.
|
609
624
|
*/
|
@@ -712,36 +727,6 @@ let LemmyHttp = class LemmyHttp extends tsoa_1.Controller {
|
|
712
727
|
listTaglines(form, options) {
|
713
728
|
return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Get, "/admin/tagline/list", form, options);
|
714
729
|
}
|
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
|
-
}
|
745
730
|
/**
|
746
731
|
* @summary Create a new oauth provider method
|
747
732
|
*/
|
@@ -799,92 +784,122 @@ let LemmyHttp = class LemmyHttp extends tsoa_1.Controller {
|
|
799
784
|
/**
|
800
785
|
* @summary Upload new user avatar.
|
801
786
|
*/
|
802
|
-
|
803
|
-
return
|
787
|
+
uploadUserAvatar(image, options) {
|
788
|
+
return __awaiter(this, void 0, void 0, function* () {
|
789
|
+
return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_upload).call(this, "/account/avatar", image, options);
|
790
|
+
});
|
804
791
|
}
|
805
792
|
/**
|
806
793
|
* @summary Delete the user avatar.
|
807
794
|
*/
|
808
|
-
|
809
|
-
return
|
795
|
+
deleteUserAvatar(options) {
|
796
|
+
return __awaiter(this, void 0, void 0, function* () {
|
797
|
+
return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Delete, "/account/avatar", {}, options);
|
798
|
+
});
|
810
799
|
}
|
811
800
|
/**
|
812
801
|
* @summary Upload new user banner.
|
813
802
|
*/
|
814
|
-
|
815
|
-
return
|
803
|
+
uploadUserBanner(image, options) {
|
804
|
+
return __awaiter(this, void 0, void 0, function* () {
|
805
|
+
return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_upload).call(this, "/account/banner", image, options);
|
806
|
+
});
|
816
807
|
}
|
817
808
|
/**
|
818
809
|
* @summary Delete the user banner.
|
819
810
|
*/
|
820
|
-
|
821
|
-
return
|
811
|
+
deleteUserBanner(options) {
|
812
|
+
return __awaiter(this, void 0, void 0, function* () {
|
813
|
+
return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Delete, "/account/banner", {}, options);
|
814
|
+
});
|
822
815
|
}
|
823
816
|
/**
|
824
817
|
* @summary Upload new community icon.
|
825
818
|
*/
|
826
|
-
|
827
|
-
return
|
819
|
+
uploadCommunityIcon(image, options) {
|
820
|
+
return __awaiter(this, void 0, void 0, function* () {
|
821
|
+
return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_upload).call(this, "/community/icon", image, options);
|
822
|
+
});
|
828
823
|
}
|
829
824
|
/**
|
830
825
|
* @summary Delete the community icon.
|
831
826
|
*/
|
832
|
-
|
833
|
-
return
|
827
|
+
deleteCommunityIcon(options) {
|
828
|
+
return __awaiter(this, void 0, void 0, function* () {
|
829
|
+
return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Delete, "/community/icon", {}, options);
|
830
|
+
});
|
834
831
|
}
|
835
832
|
/**
|
836
833
|
* @summary Upload new community banner.
|
837
834
|
*/
|
838
|
-
|
839
|
-
return
|
835
|
+
uploadCommunityBanner(image, options) {
|
836
|
+
return __awaiter(this, void 0, void 0, function* () {
|
837
|
+
return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_upload).call(this, "/community/banner", image, options);
|
838
|
+
});
|
840
839
|
}
|
841
840
|
/**
|
842
841
|
* @summary Delete the community banner.
|
843
842
|
*/
|
844
|
-
|
845
|
-
return
|
843
|
+
deleteCommunityBanner(options) {
|
844
|
+
return __awaiter(this, void 0, void 0, function* () {
|
845
|
+
return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Delete, "/community/banner", {}, options);
|
846
|
+
});
|
846
847
|
}
|
847
848
|
/**
|
848
849
|
* @summary Upload new site icon.
|
849
850
|
*/
|
850
|
-
|
851
|
-
return
|
851
|
+
uploadSiteIcon(image, options) {
|
852
|
+
return __awaiter(this, void 0, void 0, function* () {
|
853
|
+
return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_upload).call(this, "/site/icon", image, options);
|
854
|
+
});
|
852
855
|
}
|
853
856
|
/**
|
854
857
|
* @summary Delete the site icon.
|
855
858
|
*/
|
856
|
-
|
857
|
-
return
|
859
|
+
deleteSiteIcon(options) {
|
860
|
+
return __awaiter(this, void 0, void 0, function* () {
|
861
|
+
return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Delete, "/site/icon", {}, options);
|
862
|
+
});
|
858
863
|
}
|
859
864
|
/**
|
860
865
|
* @summary Upload new site banner.
|
861
866
|
*/
|
862
|
-
|
863
|
-
return
|
867
|
+
uploadSiteBanner(image, options) {
|
868
|
+
return __awaiter(this, void 0, void 0, function* () {
|
869
|
+
return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_upload).call(this, "/site/banner", image, options);
|
870
|
+
});
|
864
871
|
}
|
865
872
|
/**
|
866
873
|
* @summary Delete the site banner.
|
867
874
|
*/
|
868
|
-
|
869
|
-
return
|
875
|
+
deleteSiteBanner(options) {
|
876
|
+
return __awaiter(this, void 0, void 0, function* () {
|
877
|
+
return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Delete, "/site/banner", {}, options);
|
878
|
+
});
|
870
879
|
}
|
871
880
|
/**
|
872
881
|
* @summary Upload an image to the server.
|
873
882
|
*/
|
874
|
-
|
875
|
-
return
|
883
|
+
uploadImage(image, options) {
|
884
|
+
return __awaiter(this, void 0, void 0, function* () {
|
885
|
+
return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_upload).call(this, "/image", image, options);
|
886
|
+
});
|
876
887
|
}
|
877
888
|
/**
|
878
889
|
* @summary Delete a pictrs image
|
879
890
|
*/
|
880
|
-
|
881
|
-
return
|
891
|
+
deleteImage(form, options) {
|
892
|
+
return __awaiter(this, void 0, void 0, function* () {
|
893
|
+
return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Delete, "/image", form, options);
|
894
|
+
});
|
882
895
|
}
|
883
896
|
/**
|
884
897
|
* @summary Health check for image functionality
|
885
898
|
*/
|
886
|
-
|
887
|
-
return
|
899
|
+
imageHealth(options) {
|
900
|
+
return __awaiter(this, void 0, void 0, function* () {
|
901
|
+
return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Get, "/image/health", {}, options);
|
902
|
+
});
|
888
903
|
}
|
889
904
|
/**
|
890
905
|
* Set the headers (can be used to set the auth header)
|
@@ -901,50 +916,38 @@ _LemmyHttp_instances = new WeakSet();
|
|
901
916
|
_LemmyHttp_buildFullUrl = function _LemmyHttp_buildFullUrl(endpoint) {
|
902
917
|
return `${__classPrivateFieldGet(this, _LemmyHttp_apiUrl, "f")}${endpoint}`;
|
903
918
|
};
|
904
|
-
_LemmyHttp_upload =
|
905
|
-
|
906
|
-
|
907
|
-
|
908
|
-
|
909
|
-
body: formData,
|
910
|
-
headers: __classPrivateFieldGet(this, _LemmyHttp_headers, "f"),
|
919
|
+
_LemmyHttp_upload = function _LemmyHttp_upload(path_1, _a, options_1) {
|
920
|
+
return __awaiter(this, arguments, void 0, function* (path, { image }, options) {
|
921
|
+
const formData = createFormData(image);
|
922
|
+
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") }));
|
923
|
+
return response.json();
|
911
924
|
});
|
912
|
-
return response.json();
|
913
925
|
};
|
914
|
-
_LemmyHttp_wrapper =
|
915
|
-
|
916
|
-
|
917
|
-
|
918
|
-
|
919
|
-
|
920
|
-
method: HttpType.Get,
|
921
|
-
|
922
|
-
|
923
|
-
|
924
|
-
|
925
|
-
|
926
|
-
|
927
|
-
|
928
|
-
|
929
|
-
|
930
|
-
|
931
|
-
|
932
|
-
|
933
|
-
|
934
|
-
|
935
|
-
|
936
|
-
|
937
|
-
|
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
|
-
}
|
926
|
+
_LemmyHttp_wrapper = function _LemmyHttp_wrapper(type_, endpoint, form, options) {
|
927
|
+
return __awaiter(this, void 0, void 0, function* () {
|
928
|
+
var _a;
|
929
|
+
let response;
|
930
|
+
if (type_ === HttpType.Get) {
|
931
|
+
const getUrl = `${__classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_buildFullUrl).call(this, endpoint)}?${encodeGetParams(form)}`;
|
932
|
+
response = yield __classPrivateFieldGet(this, _LemmyHttp_fetchFunction, "f").call(this, getUrl, Object.assign(Object.assign({}, options), { method: HttpType.Get, headers: __classPrivateFieldGet(this, _LemmyHttp_headers, "f") }));
|
933
|
+
}
|
934
|
+
else {
|
935
|
+
response = yield __classPrivateFieldGet(this, _LemmyHttp_fetchFunction, "f").call(this, __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_buildFullUrl).call(this, endpoint), Object.assign(Object.assign({}, options), { method: type_, headers: Object.assign({ "Content-Type": "application/json" }, __classPrivateFieldGet(this, _LemmyHttp_headers, "f")), body: JSON.stringify(form) }));
|
936
|
+
}
|
937
|
+
let json = undefined;
|
938
|
+
try {
|
939
|
+
json = yield response.json();
|
940
|
+
}
|
941
|
+
catch (_b) {
|
942
|
+
throw new Error(response.statusText);
|
943
|
+
}
|
944
|
+
if (!response.ok) {
|
945
|
+
throw new Error((_a = json["error"]) !== null && _a !== void 0 ? _a : response.statusText);
|
946
|
+
}
|
947
|
+
else {
|
948
|
+
return json;
|
949
|
+
}
|
950
|
+
});
|
948
951
|
};
|
949
952
|
__decorate([
|
950
953
|
(0, tsoa_1.Security)("bearerAuth"),
|
@@ -1494,8 +1497,9 @@ __decorate([
|
|
1494
1497
|
(0, tsoa_1.Security)("bearerAuth"),
|
1495
1498
|
(0, tsoa_1.Get)("/admin/banned"),
|
1496
1499
|
(0, tsoa_1.Tags)("Admin", "Miscellaneous"),
|
1497
|
-
__param(0, (0, tsoa_1.
|
1498
|
-
|
1500
|
+
__param(0, (0, tsoa_1.Queries)()),
|
1501
|
+
__param(1, (0, tsoa_1.Inject)())
|
1502
|
+
], LemmyHttp.prototype, "listBannedPersons", null);
|
1499
1503
|
__decorate([
|
1500
1504
|
(0, tsoa_1.Security)("bearerAuth"),
|
1501
1505
|
(0, tsoa_1.Post)("/account/block/person"),
|
@@ -1575,6 +1579,12 @@ __decorate([
|
|
1575
1579
|
__param(0, (0, tsoa_1.Body)()),
|
1576
1580
|
__param(1, (0, tsoa_1.Inject)())
|
1577
1581
|
], LemmyHttp.prototype, "verifyEmail", null);
|
1582
|
+
__decorate([
|
1583
|
+
(0, tsoa_1.Post)("/account/auth/resend_verification_email"),
|
1584
|
+
(0, tsoa_1.Tags)("Account"),
|
1585
|
+
__param(0, (0, tsoa_1.Body)()),
|
1586
|
+
__param(1, (0, tsoa_1.Inject)())
|
1587
|
+
], LemmyHttp.prototype, "resendVerificationEmail", null);
|
1578
1588
|
__decorate([
|
1579
1589
|
(0, tsoa_1.Security)("bearerAuth"),
|
1580
1590
|
(0, tsoa_1.Get)("/account/auth/saved"),
|
@@ -1702,42 +1712,6 @@ __decorate([
|
|
1702
1712
|
__param(0, (0, tsoa_1.Queries)()),
|
1703
1713
|
__param(1, (0, tsoa_1.Inject)())
|
1704
1714
|
], 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);
|
1741
1715
|
__decorate([
|
1742
1716
|
(0, tsoa_1.Security)("bearerAuth"),
|
1743
1717
|
(0, tsoa_1.Post)("/oauth_provider"),
|