lemmy-js-client 1.0.0-media-fixes.1 → 1.0.0-mod-reason-mandatory.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/README.md +6 -0
- package/dist/http.d.ts +102 -41
- package/dist/http.js +277 -81
- package/dist/index.d.ts +60 -34
- package/dist/other_types.d.ts +22 -4
- package/dist/types/AdminAdd.d.ts +12 -0
- package/dist/types/AdminAddId.d.ts +1 -0
- package/dist/types/{ModAddView.d.ts → AdminAddView.d.ts} +3 -3
- package/dist/types/AdminAllowInstance.d.ts +2 -2
- package/dist/types/AdminAllowInstanceParams.d.ts +1 -1
- package/dist/types/{ModBan.d.ts → AdminBan.d.ts} +6 -6
- package/dist/types/AdminBanId.d.ts +1 -0
- package/dist/types/{ModBanView.d.ts → AdminBanView.d.ts} +3 -3
- package/dist/types/AdminBlockInstance.d.ts +3 -3
- package/dist/types/AdminBlockInstanceParams.d.ts +2 -2
- package/dist/types/AdminListUsers.d.ts +7 -0
- package/dist/types/{BannedPersonsResponse.d.ts → AdminListUsersResponse.d.ts} +4 -6
- package/dist/types/AdminPurgeComment.d.ts +2 -2
- package/dist/types/AdminPurgeCommunity.d.ts +2 -2
- package/dist/types/AdminPurgePerson.d.ts +2 -2
- package/dist/types/AdminPurgePost.d.ts +2 -2
- package/dist/types/{ModRemoveCommunity.d.ts → AdminRemoveCommunity.d.ts} +5 -5
- package/dist/types/AdminRemoveCommunityId.d.ts +1 -0
- package/dist/types/AdminRemoveCommunityView.d.ts +11 -0
- package/dist/types/BanFromCommunity.d.ts +2 -2
- package/dist/types/BanPerson.d.ts +2 -2
- package/dist/types/Comment.d.ts +6 -2
- package/dist/types/CommentActions.d.ts +2 -6
- package/dist/types/CommentActions.js +1 -0
- package/dist/types/CommentReport.d.ts +2 -2
- package/dist/types/CommentReportView.d.ts +3 -1
- package/dist/types/CommentResponse.d.ts +0 -2
- package/dist/types/CommentSlimView.d.ts +2 -6
- package/dist/types/CommentView.d.ts +4 -5
- package/dist/types/Community.d.ts +2 -2
- package/dist/types/CommunityActions.d.ts +7 -13
- package/dist/types/CommunityIdQuery.d.ts +8 -0
- package/dist/types/CommunityNotificationsMode.d.ts +4 -0
- package/dist/types/CommunityReport.d.ts +2 -2
- package/dist/types/CommunityReportView.d.ts +4 -0
- package/dist/types/CommunityView.d.ts +0 -2
- package/dist/types/CreateCommunityTag.d.ts +3 -1
- package/dist/types/CreateMultiCommunity.d.ts +5 -0
- package/dist/types/CreateOrDeleteMultiCommunityEntry.d.ts +6 -0
- package/dist/types/CreatePost.d.ts +1 -1
- package/dist/types/CreateSite.d.ts +17 -14
- package/dist/types/CustomEmoji.d.ts +2 -2
- package/dist/types/EditPost.d.ts +1 -1
- package/dist/types/EditSite.d.ts +30 -20
- package/dist/types/ExportDataResponse.d.ts +13 -0
- package/dist/types/FederationBlockList.d.ts +3 -3
- package/dist/types/FederationError.d.ts +4 -2
- package/dist/types/FollowMultiCommunity.d.ts +5 -0
- package/dist/types/GetComments.d.ts +3 -3
- package/dist/types/GetCommentsResponse.d.ts +3 -0
- package/dist/types/GetCommentsSlimResponse.d.ts +3 -0
- package/dist/types/GetModlog.d.ts +1 -0
- package/dist/types/GetModlogResponse.d.ts +1 -0
- package/dist/types/GetMultiCommunity.d.ts +4 -0
- package/dist/types/GetMultiCommunityResponse.d.ts +6 -0
- package/dist/types/GetPosts.d.ts +5 -11
- package/dist/types/GetPostsResponse.d.ts +3 -2
- package/dist/types/HideCommunity.d.ts +1 -1
- package/dist/types/Instance.d.ts +4 -3
- package/dist/types/InstanceActions.d.ts +8 -8
- package/dist/types/InstanceActions.js +1 -0
- package/dist/types/InstanceWithFederationState.d.ts +2 -2
- package/dist/types/LemmyErrorType.d.ts +29 -81
- package/dist/types/LikeType.d.ts +4 -0
- package/dist/types/LinkMetadata.d.ts +4 -0
- package/dist/types/ListCommentLikes.d.ts +3 -1
- package/dist/types/ListCommentLikesResponse.d.ts +6 -0
- package/dist/types/ListCommunities.d.ts +3 -1
- package/dist/types/ListCommunitiesResponse.d.ts +6 -0
- package/dist/types/ListCommunityPendingFollows.d.ts +3 -1
- package/dist/types/ListCommunityPendingFollows.js +0 -1
- package/dist/types/ListCommunityPendingFollowsResponse.d.ts +6 -0
- package/dist/types/ListCustomEmojis.d.ts +0 -3
- package/dist/types/ListMedia.d.ts +3 -1
- package/dist/types/ListMedia.js +0 -1
- package/dist/types/ListMediaResponse.d.ts +6 -0
- package/dist/types/ListMultiCommunities.d.ts +5 -0
- package/dist/types/ListMultiCommunitiesResponse.d.ts +4 -0
- package/dist/types/{ListInbox.d.ts → ListNotifications.d.ts} +4 -3
- package/dist/types/{ListInboxResponse.d.ts → ListNotificationsResponse.d.ts} +4 -3
- package/dist/types/ListPersonContent.d.ts +1 -0
- package/dist/types/ListPersonContentResponse.d.ts +1 -0
- package/dist/types/{ListBannedPersons.d.ts → ListPersonHidden.d.ts} +2 -2
- package/dist/types/ListPersonHiddenResponse.d.ts +13 -0
- package/dist/types/ListPersonLiked.d.ts +13 -0
- package/dist/types/ListPersonLikedResponse.d.ts +13 -0
- package/dist/types/ListPersonRead.d.ts +9 -0
- package/dist/types/ListPersonReadResponse.d.ts +13 -0
- package/dist/types/ListPersonSaved.d.ts +1 -0
- package/dist/types/ListPersonSavedResponse.d.ts +1 -0
- package/dist/types/ListPostLikes.d.ts +3 -1
- package/dist/types/ListPostLikesResponse.d.ts +6 -0
- package/dist/types/ListRegistrationApplications.d.ts +3 -1
- package/dist/types/ListRegistrationApplications.js +0 -1
- package/dist/types/ListRegistrationApplicationsResponse.d.ts +6 -0
- package/dist/types/ListReports.d.ts +1 -0
- package/dist/types/ListReportsResponse.d.ts +1 -0
- package/dist/types/ListTaglines.d.ts +3 -1
- package/dist/types/ListTaglines.js +0 -1
- package/dist/types/ListTaglinesResponse.d.ts +6 -0
- package/dist/types/ListingType.d.ts +1 -1
- package/dist/types/LocalImage.d.ts +8 -3
- package/dist/types/LocalImageView.d.ts +2 -0
- package/dist/types/LocalSite.d.ts +11 -10
- package/dist/types/LocalSiteRateLimit.d.ts +16 -16
- package/dist/types/LocalSiteUrlBlocklist.d.ts +2 -2
- package/dist/types/LocalUser.d.ts +13 -10
- package/dist/types/LocalUserView.d.ts +2 -2
- package/dist/types/LockComment.d.ts +9 -0
- package/dist/types/LockPost.d.ts +1 -0
- package/dist/types/Login.d.ts +3 -0
- package/dist/types/LoginToken.d.ts +1 -1
- package/dist/types/MarkNotificationAsRead.d.ts +8 -0
- package/dist/types/MarkNotificationAsRead.js +2 -0
- package/dist/types/{ModAddCommunity.d.ts → ModAddToCommunity.d.ts} +4 -4
- package/dist/types/ModAddToCommunity.js +2 -0
- package/dist/types/ModAddToCommunityId.d.ts +1 -0
- package/dist/types/{ModAddCommunityView.d.ts → ModAddToCommunityView.d.ts} +3 -3
- package/dist/types/ModAddToCommunityView.js +2 -0
- package/dist/types/ModBanFromCommunity.d.ts +3 -3
- package/dist/types/ModChangeCommunityVisibility.d.ts +1 -2
- package/dist/types/ModEditPost.d.ts +10 -0
- package/dist/types/ModEditPost.js +2 -0
- package/dist/types/ModFeaturePost.d.ts +1 -1
- package/dist/types/ModLockComment.d.ts +14 -0
- package/dist/types/ModLockComment.js +2 -0
- package/dist/types/ModLockCommentId.d.ts +1 -0
- package/dist/types/ModLockCommentView.d.ts +16 -0
- package/dist/types/ModLockCommentView.js +2 -0
- package/dist/types/ModLockPost.d.ts +2 -1
- package/dist/types/ModRemoveComment.d.ts +2 -2
- package/dist/types/ModRemovePost.d.ts +2 -2
- package/dist/types/ModTransferCommunity.d.ts +1 -1
- package/dist/types/ModlogActionType.d.ts +1 -1
- package/dist/types/ModlogCombinedView.d.ts +16 -13
- package/dist/types/MultiCommunity.d.ts +17 -0
- package/dist/types/MultiCommunity.js +2 -0
- package/dist/types/MultiCommunityFollow.d.ts +8 -0
- package/dist/types/MultiCommunityFollow.js +2 -0
- package/dist/types/MultiCommunityId.d.ts +1 -0
- package/dist/types/MultiCommunityView.d.ts +6 -0
- package/dist/types/MultiCommunityView.js +2 -0
- package/dist/types/MyUserInfo.d.ts +3 -1
- package/dist/types/NotePerson.d.ts +10 -0
- package/dist/types/NotePerson.js +2 -0
- package/dist/types/Notification.d.ts +16 -0
- package/dist/types/Notification.js +2 -0
- package/dist/types/NotificationData.d.ts +10 -0
- package/dist/types/NotificationData.js +2 -0
- package/dist/types/NotificationDataType.d.ts +4 -0
- package/dist/types/NotificationDataType.js +3 -0
- package/dist/types/NotificationId.d.ts +1 -0
- package/dist/types/NotificationId.js +3 -0
- package/dist/types/NotificationTypes.d.ts +4 -0
- package/dist/types/NotificationTypes.js +3 -0
- package/dist/types/NotificationView.d.ts +6 -0
- package/dist/types/NotificationView.js +2 -0
- package/dist/types/OAuthAccount.d.ts +2 -2
- package/dist/types/OAuthProvider.d.ts +2 -2
- package/dist/types/OpenGraphData.d.ts +4 -0
- package/dist/types/Person.d.ts +2 -2
- package/dist/types/PersonActions.d.ts +21 -4
- package/dist/types/PersonActions.js +1 -0
- package/dist/types/PersonLikedCombinedView.d.ts +7 -0
- package/dist/types/PersonLikedCombinedView.js +2 -0
- package/dist/types/PersonView.d.ts +4 -4
- package/dist/types/Post.d.ts +6 -4
- package/dist/types/PostActions.d.ts +7 -9
- package/dist/types/PostNotificationsMode.d.ts +4 -0
- package/dist/types/PostNotificationsMode.js +3 -0
- package/dist/types/PostOrCommentOrPrivateMessage.d.ts +10 -0
- package/dist/types/PostOrCommentOrPrivateMessage.js +2 -0
- package/dist/types/PostReport.d.ts +2 -2
- package/dist/types/PostReportView.d.ts +3 -1
- package/dist/types/PostView.d.ts +4 -5
- package/dist/types/PrivateMessage.d.ts +2 -3
- package/dist/types/PrivateMessageReport.d.ts +2 -2
- package/dist/types/PrivateMessageReportView.d.ts +2 -0
- package/dist/types/PurgeComment.d.ts +1 -1
- package/dist/types/PurgeCommunity.d.ts +1 -1
- package/dist/types/PurgePerson.d.ts +1 -1
- package/dist/types/PurgePost.d.ts +1 -1
- package/dist/types/ReadableFederationState.d.ts +2 -2
- package/dist/types/RegistrationApplication.d.ts +1 -1
- package/dist/types/RemoveComment.d.ts +1 -1
- package/dist/types/RemoveCommunity.d.ts +1 -1
- package/dist/types/RemovePost.d.ts +1 -1
- package/dist/types/SaveUserSettings.d.ts +12 -2
- package/dist/types/Search.d.ts +6 -1
- package/dist/types/SearchCombinedView.d.ts +4 -1
- package/dist/types/SearchResponse.d.ts +1 -0
- package/dist/types/SearchType.d.ts +1 -1
- package/dist/types/Site.d.ts +4 -3
- package/dist/types/SiteResponse.d.ts +0 -4
- package/dist/types/Tag.d.ts +8 -16
- package/dist/types/Tagline.d.ts +4 -3
- package/dist/types/Tagline.js +0 -1
- package/dist/types/TagsView.d.ts +1 -1
- package/dist/types/UpdateCommunityNotifications.d.ts +9 -0
- package/dist/types/UpdateCommunityNotifications.js +2 -0
- package/dist/types/UpdateCommunityTag.d.ts +3 -2
- package/dist/types/UpdateMultiCommunity.d.ts +7 -0
- package/dist/types/UpdateMultiCommunity.js +2 -0
- package/dist/types/UpdatePostNotifications.d.ts +9 -0
- package/dist/types/UpdatePostNotifications.js +2 -0
- package/dist/types/UserBlockInstanceCommunitiesParams.d.ts +8 -0
- package/dist/types/UserBlockInstanceCommunitiesParams.js +2 -0
- package/dist/types/{UserBlockInstanceParams.d.ts → UserBlockInstancePersonsParams.d.ts} +2 -2
- package/dist/types/UserBlockInstancePersonsParams.js +2 -0
- package/dist/types/UserSettingsBackup.d.ts +27 -0
- package/dist/types/UserSettingsBackup.js +2 -0
- package/dist/types/VoteShow.d.ts +4 -0
- package/dist/types/VoteShow.js +3 -0
- package/dist/types/VoteView.d.ts +1 -0
- package/package.json +7 -6
- package/dist/types/CommentReply.d.ts +0 -13
- package/dist/types/CommentReplyId.d.ts +0 -4
- package/dist/types/CommentReplyView.d.ts +0 -32
- package/dist/types/InboxCombinedView.d.ts +0 -13
- package/dist/types/InboxDataType.d.ts +0 -4
- package/dist/types/MarkCommentReplyAsRead.d.ts +0 -8
- package/dist/types/MarkPersonCommentMentionAsRead.d.ts +0 -8
- package/dist/types/MarkPersonPostMentionAsRead.d.ts +0 -8
- package/dist/types/MarkPrivateMessageAsRead.d.ts +0 -8
- package/dist/types/ModAdd.d.ts +0 -12
- package/dist/types/ModAddCommunityId.d.ts +0 -1
- package/dist/types/ModAddId.d.ts +0 -1
- package/dist/types/ModBanId.d.ts +0 -1
- package/dist/types/ModRemoveCommunityId.d.ts +0 -1
- package/dist/types/ModRemoveCommunityView.d.ts +0 -11
- package/dist/types/PersonCommentMention.d.ts +0 -13
- package/dist/types/PersonCommentMentionId.d.ts +0 -4
- package/dist/types/PersonCommentMentionView.d.ts +0 -30
- package/dist/types/PersonPostMention.d.ts +0 -13
- package/dist/types/PersonPostMentionId.d.ts +0 -4
- package/dist/types/PersonPostMentionView.d.ts +0 -32
- package/dist/types/PostPaginationCursor.d.ts +0 -7
- package/dist/types/ResolveObjectResponse.d.ts +0 -13
- /package/dist/types/{BannedPersonsResponse.js → AdminAdd.js} +0 -0
- /package/dist/types/{CommentReplyId.js → AdminAddId.js} +0 -0
- /package/dist/types/{CommentReply.js → AdminAddView.js} +0 -0
- /package/dist/types/{CommentReplyView.js → AdminBan.js} +0 -0
- /package/dist/types/{InboxDataType.js → AdminBanId.js} +0 -0
- /package/dist/types/{InboxCombinedView.js → AdminBanView.js} +0 -0
- /package/dist/types/{ListBannedPersons.js → AdminListUsers.js} +0 -0
- /package/dist/types/{ListInbox.js → AdminListUsersResponse.js} +0 -0
- /package/dist/types/{ListInboxResponse.js → AdminRemoveCommunity.js} +0 -0
- /package/dist/types/{ModAddCommunityId.js → AdminRemoveCommunityId.js} +0 -0
- /package/dist/types/{MarkCommentReplyAsRead.js → AdminRemoveCommunityView.js} +0 -0
- /package/dist/types/{MarkPersonCommentMentionAsRead.js → CommunityIdQuery.js} +0 -0
- /package/dist/types/{ModAddId.js → CommunityNotificationsMode.js} +0 -0
- /package/dist/types/{ModBanId.js → CreateMultiCommunity.js} +0 -0
- /package/dist/types/{MarkPersonPostMentionAsRead.js → CreateOrDeleteMultiCommunityEntry.js} +0 -0
- /package/dist/types/{MarkPrivateMessageAsRead.js → ExportDataResponse.js} +0 -0
- /package/dist/types/{ModAdd.js → FollowMultiCommunity.js} +0 -0
- /package/dist/types/{ModAddCommunity.js → GetMultiCommunity.js} +0 -0
- /package/dist/types/{ModAddCommunityView.js → GetMultiCommunityResponse.js} +0 -0
- /package/dist/types/{ModRemoveCommunityId.js → LikeType.js} +0 -0
- /package/dist/types/{ModAddView.js → ListMultiCommunities.js} +0 -0
- /package/dist/types/{ModBan.js → ListMultiCommunitiesResponse.js} +0 -0
- /package/dist/types/{ModBanView.js → ListNotifications.js} +0 -0
- /package/dist/types/{ModRemoveCommunity.js → ListNotificationsResponse.js} +0 -0
- /package/dist/types/{ModRemoveCommunityView.js → ListPersonHidden.js} +0 -0
- /package/dist/types/{PersonCommentMention.js → ListPersonHiddenResponse.js} +0 -0
- /package/dist/types/{PersonCommentMentionView.js → ListPersonLiked.js} +0 -0
- /package/dist/types/{PersonPostMention.js → ListPersonLikedResponse.js} +0 -0
- /package/dist/types/{PersonPostMentionView.js → ListPersonRead.js} +0 -0
- /package/dist/types/{ResolveObjectResponse.js → ListPersonReadResponse.js} +0 -0
- /package/dist/types/{UserBlockInstanceParams.js → LockComment.js} +0 -0
- /package/dist/types/{PersonCommentMentionId.js → ModAddToCommunityId.js} +0 -0
- /package/dist/types/{PersonPostMentionId.js → ModLockCommentId.js} +0 -0
- /package/dist/types/{PostPaginationCursor.js → MultiCommunityId.js} +0 -0
package/dist/http.js
CHANGED
|
@@ -19,9 +19,9 @@ 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_upload, _LemmyHttp_wrapper;
|
|
22
|
+
var _LemmyHttp_instances, _LemmyHttp_apiUrl, _LemmyHttp_headers, _LemmyHttp_fetchFunction, _LemmyHttp_buildFullUrl, _LemmyHttp_upload, _LemmyHttp_uploadWithQuery, _LemmyHttp_wrapper;
|
|
23
23
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
24
|
-
exports.LemmyHttp = void 0;
|
|
24
|
+
exports.LemmyError = exports.LemmyHttp = void 0;
|
|
25
25
|
const runtime_1 = require("@tsoa/runtime");
|
|
26
26
|
const other_types_1 = require("./other_types");
|
|
27
27
|
var HttpType;
|
|
@@ -161,7 +161,7 @@ let LemmyHttp = class LemmyHttp extends runtime_1.Controller {
|
|
|
161
161
|
return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Get, "/modlog", form, options);
|
|
162
162
|
}
|
|
163
163
|
/**
|
|
164
|
-
* @summary Search lemmy.
|
|
164
|
+
* @summary Search lemmy. If `search_term` is a url it also attempts to fetch it, just like `resolve_object`.
|
|
165
165
|
*/
|
|
166
166
|
async search(form, options) {
|
|
167
167
|
return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Get, "/search", form, options);
|
|
@@ -268,6 +268,18 @@ let LemmyHttp = class LemmyHttp extends runtime_1.Controller {
|
|
|
268
268
|
async getRandomCommunity(form, options) {
|
|
269
269
|
return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Get, "/community/random", form, options);
|
|
270
270
|
}
|
|
271
|
+
/**
|
|
272
|
+
* @summary Create a report for a community.
|
|
273
|
+
*/
|
|
274
|
+
async createCommunityReport(form, options) {
|
|
275
|
+
return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Post, "/community/report", form, options);
|
|
276
|
+
}
|
|
277
|
+
/**
|
|
278
|
+
* @summary Resolve a report for a private message.
|
|
279
|
+
*/
|
|
280
|
+
async resolveCommunityReport(form, options) {
|
|
281
|
+
return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Put, "/community/report/resolve", form, options);
|
|
282
|
+
}
|
|
271
283
|
/**
|
|
272
284
|
* @summary Create a post.
|
|
273
285
|
*/
|
|
@@ -286,6 +298,12 @@ let LemmyHttp = class LemmyHttp extends runtime_1.Controller {
|
|
|
286
298
|
async editPost(form, options) {
|
|
287
299
|
return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Put, "/post", form, options);
|
|
288
300
|
}
|
|
301
|
+
/**
|
|
302
|
+
* @summary Mods can change nsfw flag and tags for a post
|
|
303
|
+
*/
|
|
304
|
+
async modEditPost(form, options) {
|
|
305
|
+
return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Put, "/post/mod_update", form, options);
|
|
306
|
+
}
|
|
289
307
|
/**
|
|
290
308
|
* @summary Delete a post.
|
|
291
309
|
*/
|
|
@@ -395,13 +413,13 @@ let LemmyHttp = class LemmyHttp extends runtime_1.Controller {
|
|
|
395
413
|
return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Post, "/comment/remove", form, options);
|
|
396
414
|
}
|
|
397
415
|
/**
|
|
398
|
-
* @summary
|
|
416
|
+
* @summary A moderator can lock a comment (IE disable replies).
|
|
399
417
|
*/
|
|
400
|
-
async
|
|
401
|
-
return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Post, "/comment/
|
|
418
|
+
async lockComment(form, options) {
|
|
419
|
+
return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Post, "/comment/lock", form, options);
|
|
402
420
|
}
|
|
403
421
|
/**
|
|
404
|
-
* @
|
|
422
|
+
* @Summary Like / vote on a comment.
|
|
405
423
|
*/
|
|
406
424
|
async likeComment(form, options) {
|
|
407
425
|
return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Post, "/comment/like", form, options);
|
|
@@ -472,12 +490,6 @@ let LemmyHttp = class LemmyHttp extends runtime_1.Controller {
|
|
|
472
490
|
async deletePrivateMessage(form, options) {
|
|
473
491
|
return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Post, "/private_message/delete", form, options);
|
|
474
492
|
}
|
|
475
|
-
/**
|
|
476
|
-
* @summary Mark a private message as read.
|
|
477
|
-
*/
|
|
478
|
-
async markPrivateMessageAsRead(form, options) {
|
|
479
|
-
return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Post, "/private_message/mark_as_read", form, options);
|
|
480
|
-
}
|
|
481
493
|
/**
|
|
482
494
|
* @summary Create a report for a private message.
|
|
483
495
|
*/
|
|
@@ -521,16 +533,10 @@ let LemmyHttp = class LemmyHttp extends runtime_1.Controller {
|
|
|
521
533
|
return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Get, "/person/content", form, options);
|
|
522
534
|
}
|
|
523
535
|
/**
|
|
524
|
-
* @summary
|
|
525
|
-
*/
|
|
526
|
-
async markCommentMentionAsRead(form, options) {
|
|
527
|
-
return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Post, "/account/mention/comment/mark_as_read", form, options);
|
|
528
|
-
}
|
|
529
|
-
/**
|
|
530
|
-
* @summary Mark a person post body mention as read.
|
|
536
|
+
* @summary Make a note for a person.
|
|
531
537
|
*/
|
|
532
|
-
async
|
|
533
|
-
return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Post, "/
|
|
538
|
+
async notePerson(form, options) {
|
|
539
|
+
return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Post, "/person/note", form, options);
|
|
534
540
|
}
|
|
535
541
|
/**
|
|
536
542
|
* @summary Ban a person from your site.
|
|
@@ -539,10 +545,10 @@ let LemmyHttp = class LemmyHttp extends runtime_1.Controller {
|
|
|
539
545
|
return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Post, "/admin/ban", form, options);
|
|
540
546
|
}
|
|
541
547
|
/**
|
|
542
|
-
* @summary Get a list of
|
|
548
|
+
* @summary Get a list of users.
|
|
543
549
|
*/
|
|
544
|
-
async
|
|
545
|
-
return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Get, "/admin/
|
|
550
|
+
async listUsers(form = {}, options) {
|
|
551
|
+
return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Get, "/admin/users", form, options);
|
|
546
552
|
}
|
|
547
553
|
/**
|
|
548
554
|
* @summary Block a person.
|
|
@@ -580,6 +586,12 @@ let LemmyHttp = class LemmyHttp extends runtime_1.Controller {
|
|
|
580
586
|
async markAllNotificationsAsRead(options) {
|
|
581
587
|
return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Post, "/account/mark_as_read/all", {}, options);
|
|
582
588
|
}
|
|
589
|
+
/**
|
|
590
|
+
* @summary Mark a comment as read.
|
|
591
|
+
*/
|
|
592
|
+
async markNotificationAsRead(form, options) {
|
|
593
|
+
return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Post, "/account/mark_as_read", form, options);
|
|
594
|
+
}
|
|
583
595
|
/**
|
|
584
596
|
* @summary Save your user settings.
|
|
585
597
|
*/
|
|
@@ -607,8 +619,8 @@ let LemmyHttp = class LemmyHttp extends runtime_1.Controller {
|
|
|
607
619
|
/**
|
|
608
620
|
* @summary Get your inbox (replies, comment mentions, post mentions, and messages)
|
|
609
621
|
*/
|
|
610
|
-
async
|
|
611
|
-
return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Get, "/account/
|
|
622
|
+
async listNotifications(form, options) {
|
|
623
|
+
return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Get, "/account/notifications", form, options);
|
|
612
624
|
}
|
|
613
625
|
/**
|
|
614
626
|
* @summary Verify your email
|
|
@@ -628,6 +640,24 @@ let LemmyHttp = class LemmyHttp extends runtime_1.Controller {
|
|
|
628
640
|
async listPersonSaved(form, options) {
|
|
629
641
|
return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Get, "/account/saved", form, options);
|
|
630
642
|
}
|
|
643
|
+
/**
|
|
644
|
+
* @summary List your read content.
|
|
645
|
+
*/
|
|
646
|
+
async listPersonRead(form, options) {
|
|
647
|
+
return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Get, "/account/read", form, options);
|
|
648
|
+
}
|
|
649
|
+
/**
|
|
650
|
+
* @summary List your hidden content.
|
|
651
|
+
*/
|
|
652
|
+
async listPersonHidden(form, options) {
|
|
653
|
+
return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Get, "/account/hidden", form, options);
|
|
654
|
+
}
|
|
655
|
+
/**
|
|
656
|
+
* @summary List your liked content.
|
|
657
|
+
*/
|
|
658
|
+
async listPersonLiked(form, options) {
|
|
659
|
+
return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Get, "/account/liked", form, options);
|
|
660
|
+
}
|
|
631
661
|
/**
|
|
632
662
|
* @summary Add an admin to your site.
|
|
633
663
|
*/
|
|
@@ -737,10 +767,10 @@ let LemmyHttp = class LemmyHttp extends runtime_1.Controller {
|
|
|
737
767
|
return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Post, "/community/tag", form, options);
|
|
738
768
|
}
|
|
739
769
|
/**
|
|
740
|
-
* @summary
|
|
770
|
+
* @summary Edit a community post tag.
|
|
741
771
|
*/
|
|
742
772
|
updateCommunityTag(form, options) {
|
|
743
|
-
return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.
|
|
773
|
+
return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Post, "/community/tag", form, options);
|
|
744
774
|
}
|
|
745
775
|
/**
|
|
746
776
|
* @summary Delete a post tag in a community.
|
|
@@ -785,10 +815,16 @@ let LemmyHttp = class LemmyHttp extends runtime_1.Controller {
|
|
|
785
815
|
return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Get, "/report/list", form, options);
|
|
786
816
|
}
|
|
787
817
|
/**
|
|
788
|
-
* @summary Block an instance as user.
|
|
818
|
+
* @summary Block an instance's communities as a user.
|
|
789
819
|
*/
|
|
790
|
-
async
|
|
791
|
-
return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Post, "/account/block/instance", form, options);
|
|
820
|
+
async userBlockInstanceCommunities(form, options) {
|
|
821
|
+
return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Post, "/account/block/instance/communities", form, options);
|
|
822
|
+
}
|
|
823
|
+
/**
|
|
824
|
+
* @summary Block an instance's persons as a user.
|
|
825
|
+
*/
|
|
826
|
+
async userBlockInstancePersons(form, options) {
|
|
827
|
+
return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Post, "/account/block/instance/persons", form, options);
|
|
792
828
|
}
|
|
793
829
|
/**
|
|
794
830
|
* @summary Globally block an instance as admin.
|
|
@@ -829,26 +865,26 @@ let LemmyHttp = class LemmyHttp extends runtime_1.Controller {
|
|
|
829
865
|
/**
|
|
830
866
|
* @summary Upload new community icon.
|
|
831
867
|
*/
|
|
832
|
-
async uploadCommunityIcon(image, options) {
|
|
833
|
-
return __classPrivateFieldGet(this, _LemmyHttp_instances, "m",
|
|
868
|
+
async uploadCommunityIcon(query, image, options) {
|
|
869
|
+
return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_uploadWithQuery).call(this, "/community/icon", query, image, options);
|
|
834
870
|
}
|
|
835
871
|
/**
|
|
836
872
|
* @summary Delete the community icon.
|
|
837
873
|
*/
|
|
838
|
-
async deleteCommunityIcon(options) {
|
|
839
|
-
return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Delete, "/community/icon",
|
|
874
|
+
async deleteCommunityIcon(form, options) {
|
|
875
|
+
return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Delete, "/community/icon", form, options);
|
|
840
876
|
}
|
|
841
877
|
/**
|
|
842
878
|
* @summary Upload new community banner.
|
|
843
879
|
*/
|
|
844
|
-
async uploadCommunityBanner(image, options) {
|
|
845
|
-
return __classPrivateFieldGet(this, _LemmyHttp_instances, "m",
|
|
880
|
+
async uploadCommunityBanner(query, image, options) {
|
|
881
|
+
return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_uploadWithQuery).call(this, "/community/banner", query, image, options);
|
|
846
882
|
}
|
|
847
883
|
/**
|
|
848
884
|
* @summary Delete the community banner.
|
|
849
885
|
*/
|
|
850
|
-
async deleteCommunityBanner(options) {
|
|
851
|
-
return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Delete, "/community/banner",
|
|
886
|
+
async deleteCommunityBanner(form, options) {
|
|
887
|
+
return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Delete, "/community/banner", form, options);
|
|
852
888
|
}
|
|
853
889
|
/**
|
|
854
890
|
* @summary Upload new site icon.
|
|
@@ -888,11 +924,42 @@ let LemmyHttp = class LemmyHttp extends runtime_1.Controller {
|
|
|
888
924
|
}
|
|
889
925
|
/**
|
|
890
926
|
* Mark donation dialog as shown, so it isn't displayed anymore.
|
|
891
|
-
*
|
|
892
|
-
* `HTTP.POST /user/donation_dialog_shown`
|
|
893
927
|
*/
|
|
894
|
-
|
|
895
|
-
return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Post, "/
|
|
928
|
+
donationDialogShown(options) {
|
|
929
|
+
return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Post, "/account/donation_dialog_shown", {}, options);
|
|
930
|
+
}
|
|
931
|
+
createMultiCommunity(form, options) {
|
|
932
|
+
return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Post, "/multi_community", form, options);
|
|
933
|
+
}
|
|
934
|
+
updateMultiCommunity(form, options) {
|
|
935
|
+
return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Put, "/multi_community", form, options);
|
|
936
|
+
}
|
|
937
|
+
getMultiCommunity(form, options) {
|
|
938
|
+
return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Get, "/multi_community", form, options);
|
|
939
|
+
}
|
|
940
|
+
createMultiCommunityEntry(form, options) {
|
|
941
|
+
return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Post, "/multi_community/entry", form, options);
|
|
942
|
+
}
|
|
943
|
+
deleteMultiCommunityEntry(form, options) {
|
|
944
|
+
return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Delete, "/multi_community/entry", form, options);
|
|
945
|
+
}
|
|
946
|
+
listMultiCommunities(form, options) {
|
|
947
|
+
return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Get, "/multi_community/list", form, options);
|
|
948
|
+
}
|
|
949
|
+
followMultiCommunity(form, options) {
|
|
950
|
+
return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Post, "/multi_community/follow", form, options);
|
|
951
|
+
}
|
|
952
|
+
/**
|
|
953
|
+
* @summary Change notification settings for a community
|
|
954
|
+
*/
|
|
955
|
+
updateCommunityNotifications(form, options) {
|
|
956
|
+
return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Post, "/community/notifications", form, options);
|
|
957
|
+
}
|
|
958
|
+
/**
|
|
959
|
+
* @summary Change notification settings for a post
|
|
960
|
+
*/
|
|
961
|
+
updatePostNotifications(form, options) {
|
|
962
|
+
return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Post, "/post/notifications", form, options);
|
|
896
963
|
}
|
|
897
964
|
/**
|
|
898
965
|
* Set the headers (can be used to set the auth header)
|
|
@@ -919,6 +986,9 @@ _LemmyHttp_upload = async function _LemmyHttp_upload(path, { image }, options) {
|
|
|
919
986
|
});
|
|
920
987
|
return response.json();
|
|
921
988
|
};
|
|
989
|
+
_LemmyHttp_uploadWithQuery = async function _LemmyHttp_uploadWithQuery(path, query, { image }, options) {
|
|
990
|
+
return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_upload).call(this, `${path}?${encodeGetParams(query)}`, { image }, options);
|
|
991
|
+
};
|
|
922
992
|
_LemmyHttp_wrapper = async function _LemmyHttp_wrapper(type_, endpoint, form, options) {
|
|
923
993
|
let response;
|
|
924
994
|
if (type_ === HttpType.Get) {
|
|
@@ -945,10 +1015,12 @@ _LemmyHttp_wrapper = async function _LemmyHttp_wrapper(type_, endpoint, form, op
|
|
|
945
1015
|
json = await response.json();
|
|
946
1016
|
}
|
|
947
1017
|
catch {
|
|
948
|
-
throw new
|
|
1018
|
+
throw new LemmyError(response.statusText);
|
|
949
1019
|
}
|
|
950
1020
|
if (!response.ok) {
|
|
951
|
-
|
|
1021
|
+
console.error(`Request error while calling ${type_} ${endpoint} with ${form}`);
|
|
1022
|
+
let err = new LemmyError(json.error ?? response.statusText, json.message);
|
|
1023
|
+
throw err;
|
|
952
1024
|
}
|
|
953
1025
|
else {
|
|
954
1026
|
return json;
|
|
@@ -1193,6 +1265,20 @@ __decorate([
|
|
|
1193
1265
|
__param(0, (0, runtime_1.Queries)()),
|
|
1194
1266
|
__param(1, (0, runtime_1.Inject)())
|
|
1195
1267
|
], LemmyHttp.prototype, "getRandomCommunity", null);
|
|
1268
|
+
__decorate([
|
|
1269
|
+
(0, runtime_1.Security)("bearerAuth"),
|
|
1270
|
+
(0, runtime_1.Post)("/community/report"),
|
|
1271
|
+
(0, runtime_1.Tags)("Community"),
|
|
1272
|
+
__param(0, (0, runtime_1.Body)()),
|
|
1273
|
+
__param(1, (0, runtime_1.Inject)())
|
|
1274
|
+
], LemmyHttp.prototype, "createCommunityReport", null);
|
|
1275
|
+
__decorate([
|
|
1276
|
+
(0, runtime_1.Security)("bearerAuth"),
|
|
1277
|
+
(0, runtime_1.Put)("/community/report/resolve"),
|
|
1278
|
+
(0, runtime_1.Tags)("Community", "Admin"),
|
|
1279
|
+
__param(0, (0, runtime_1.Body)()),
|
|
1280
|
+
__param(1, (0, runtime_1.Inject)())
|
|
1281
|
+
], LemmyHttp.prototype, "resolveCommunityReport", null);
|
|
1196
1282
|
__decorate([
|
|
1197
1283
|
(0, runtime_1.Security)("bearerAuth"),
|
|
1198
1284
|
(0, runtime_1.Post)("/post"),
|
|
@@ -1215,6 +1301,13 @@ __decorate([
|
|
|
1215
1301
|
__param(0, (0, runtime_1.Body)()),
|
|
1216
1302
|
__param(1, (0, runtime_1.Inject)())
|
|
1217
1303
|
], LemmyHttp.prototype, "editPost", null);
|
|
1304
|
+
__decorate([
|
|
1305
|
+
(0, runtime_1.Security)("bearerAuth"),
|
|
1306
|
+
(0, runtime_1.Put)("/post/mod_update"),
|
|
1307
|
+
(0, runtime_1.Tags)("Post"),
|
|
1308
|
+
__param(0, (0, runtime_1.Body)()),
|
|
1309
|
+
__param(1, (0, runtime_1.Inject)())
|
|
1310
|
+
], LemmyHttp.prototype, "modEditPost", null);
|
|
1218
1311
|
__decorate([
|
|
1219
1312
|
(0, runtime_1.Security)("bearerAuth"),
|
|
1220
1313
|
(0, runtime_1.Post)("/post/delete"),
|
|
@@ -1344,11 +1437,11 @@ __decorate([
|
|
|
1344
1437
|
], LemmyHttp.prototype, "removeComment", null);
|
|
1345
1438
|
__decorate([
|
|
1346
1439
|
(0, runtime_1.Security)("bearerAuth"),
|
|
1347
|
-
(0, runtime_1.Post)("/comment/
|
|
1348
|
-
(0, runtime_1.Tags)("Comment"),
|
|
1440
|
+
(0, runtime_1.Post)("/comment/lock"),
|
|
1441
|
+
(0, runtime_1.Tags)("Comment", "Moderator"),
|
|
1349
1442
|
__param(0, (0, runtime_1.Body)()),
|
|
1350
1443
|
__param(1, (0, runtime_1.Inject)())
|
|
1351
|
-
], LemmyHttp.prototype, "
|
|
1444
|
+
], LemmyHttp.prototype, "lockComment", null);
|
|
1352
1445
|
__decorate([
|
|
1353
1446
|
(0, runtime_1.Security)("bearerAuth"),
|
|
1354
1447
|
(0, runtime_1.Post)("/comment/like"),
|
|
@@ -1436,13 +1529,6 @@ __decorate([
|
|
|
1436
1529
|
__param(0, (0, runtime_1.Body)()),
|
|
1437
1530
|
__param(1, (0, runtime_1.Inject)())
|
|
1438
1531
|
], LemmyHttp.prototype, "deletePrivateMessage", null);
|
|
1439
|
-
__decorate([
|
|
1440
|
-
(0, runtime_1.Security)("bearerAuth"),
|
|
1441
|
-
(0, runtime_1.Post)("/private_message/mark_as_read"),
|
|
1442
|
-
(0, runtime_1.Tags)("PrivateMessage"),
|
|
1443
|
-
__param(0, (0, runtime_1.Body)()),
|
|
1444
|
-
__param(1, (0, runtime_1.Inject)())
|
|
1445
|
-
], LemmyHttp.prototype, "markPrivateMessageAsRead", null);
|
|
1446
1532
|
__decorate([
|
|
1447
1533
|
(0, runtime_1.Security)("bearerAuth"),
|
|
1448
1534
|
(0, runtime_1.Post)("/private_message/report"),
|
|
@@ -1493,18 +1579,11 @@ __decorate([
|
|
|
1493
1579
|
], LemmyHttp.prototype, "listPersonContent", null);
|
|
1494
1580
|
__decorate([
|
|
1495
1581
|
(0, runtime_1.Security)("bearerAuth"),
|
|
1496
|
-
(0, runtime_1.Post)("/
|
|
1497
|
-
(0, runtime_1.Tags)("
|
|
1498
|
-
__param(0, (0, runtime_1.Body)()),
|
|
1499
|
-
__param(1, (0, runtime_1.Inject)())
|
|
1500
|
-
], LemmyHttp.prototype, "markCommentMentionAsRead", null);
|
|
1501
|
-
__decorate([
|
|
1502
|
-
(0, runtime_1.Security)("bearerAuth"),
|
|
1503
|
-
(0, runtime_1.Post)("/account/mention/post/mark_as_read"),
|
|
1504
|
-
(0, runtime_1.Tags)("Account", "Post"),
|
|
1582
|
+
(0, runtime_1.Post)("/person/note"),
|
|
1583
|
+
(0, runtime_1.Tags)("Person"),
|
|
1505
1584
|
__param(0, (0, runtime_1.Body)()),
|
|
1506
1585
|
__param(1, (0, runtime_1.Inject)())
|
|
1507
|
-
], LemmyHttp.prototype, "
|
|
1586
|
+
], LemmyHttp.prototype, "notePerson", null);
|
|
1508
1587
|
__decorate([
|
|
1509
1588
|
(0, runtime_1.Security)("bearerAuth"),
|
|
1510
1589
|
(0, runtime_1.Post)("/admin/ban"),
|
|
@@ -1514,11 +1593,11 @@ __decorate([
|
|
|
1514
1593
|
], LemmyHttp.prototype, "banPerson", null);
|
|
1515
1594
|
__decorate([
|
|
1516
1595
|
(0, runtime_1.Security)("bearerAuth"),
|
|
1517
|
-
(0, runtime_1.Get)("/admin/
|
|
1596
|
+
(0, runtime_1.Get)("/admin/users"),
|
|
1518
1597
|
(0, runtime_1.Tags)("Admin", "Miscellaneous"),
|
|
1519
1598
|
__param(0, (0, runtime_1.Queries)()),
|
|
1520
1599
|
__param(1, (0, runtime_1.Inject)())
|
|
1521
|
-
], LemmyHttp.prototype, "
|
|
1600
|
+
], LemmyHttp.prototype, "listUsers", null);
|
|
1522
1601
|
__decorate([
|
|
1523
1602
|
(0, runtime_1.Security)("bearerAuth"),
|
|
1524
1603
|
(0, runtime_1.Post)("/account/block/person"),
|
|
@@ -1558,6 +1637,13 @@ __decorate([
|
|
|
1558
1637
|
(0, runtime_1.Tags)("Account"),
|
|
1559
1638
|
__param(0, (0, runtime_1.Inject)())
|
|
1560
1639
|
], LemmyHttp.prototype, "markAllNotificationsAsRead", null);
|
|
1640
|
+
__decorate([
|
|
1641
|
+
(0, runtime_1.Security)("bearerAuth"),
|
|
1642
|
+
(0, runtime_1.Post)("/account/mark_as_read"),
|
|
1643
|
+
(0, runtime_1.Tags)("Account"),
|
|
1644
|
+
__param(0, (0, runtime_1.Body)()),
|
|
1645
|
+
__param(1, (0, runtime_1.Inject)())
|
|
1646
|
+
], LemmyHttp.prototype, "markNotificationAsRead", null);
|
|
1561
1647
|
__decorate([
|
|
1562
1648
|
(0, runtime_1.Security)("bearerAuth"),
|
|
1563
1649
|
(0, runtime_1.Put)("/account/settings/save"),
|
|
@@ -1587,11 +1673,11 @@ __decorate([
|
|
|
1587
1673
|
], LemmyHttp.prototype, "getUnreadCount", null);
|
|
1588
1674
|
__decorate([
|
|
1589
1675
|
(0, runtime_1.Security)("bearerAuth"),
|
|
1590
|
-
(0, runtime_1.Get)("/account/
|
|
1676
|
+
(0, runtime_1.Get)("/account/notifications"),
|
|
1591
1677
|
(0, runtime_1.Tags)("Account"),
|
|
1592
1678
|
__param(0, (0, runtime_1.Queries)()),
|
|
1593
1679
|
__param(1, (0, runtime_1.Inject)())
|
|
1594
|
-
], LemmyHttp.prototype, "
|
|
1680
|
+
], LemmyHttp.prototype, "listNotifications", null);
|
|
1595
1681
|
__decorate([
|
|
1596
1682
|
(0, runtime_1.Post)("/account/auth/verify_email"),
|
|
1597
1683
|
(0, runtime_1.Tags)("Account"),
|
|
@@ -1611,6 +1697,27 @@ __decorate([
|
|
|
1611
1697
|
__param(0, (0, runtime_1.Queries)()),
|
|
1612
1698
|
__param(1, (0, runtime_1.Inject)())
|
|
1613
1699
|
], LemmyHttp.prototype, "listPersonSaved", null);
|
|
1700
|
+
__decorate([
|
|
1701
|
+
(0, runtime_1.Security)("bearerAuth"),
|
|
1702
|
+
(0, runtime_1.Get)("/account/read"),
|
|
1703
|
+
(0, runtime_1.Tags)("Account"),
|
|
1704
|
+
__param(0, (0, runtime_1.Queries)()),
|
|
1705
|
+
__param(1, (0, runtime_1.Inject)())
|
|
1706
|
+
], LemmyHttp.prototype, "listPersonRead", null);
|
|
1707
|
+
__decorate([
|
|
1708
|
+
(0, runtime_1.Security)("bearerAuth"),
|
|
1709
|
+
(0, runtime_1.Get)("/account/hidden"),
|
|
1710
|
+
(0, runtime_1.Tags)("Account"),
|
|
1711
|
+
__param(0, (0, runtime_1.Queries)()),
|
|
1712
|
+
__param(1, (0, runtime_1.Inject)())
|
|
1713
|
+
], LemmyHttp.prototype, "listPersonHidden", null);
|
|
1714
|
+
__decorate([
|
|
1715
|
+
(0, runtime_1.Security)("bearerAuth"),
|
|
1716
|
+
(0, runtime_1.Get)("/account/liked"),
|
|
1717
|
+
(0, runtime_1.Tags)("Account"),
|
|
1718
|
+
__param(0, (0, runtime_1.Queries)()),
|
|
1719
|
+
__param(1, (0, runtime_1.Inject)())
|
|
1720
|
+
], LemmyHttp.prototype, "listPersonLiked", null);
|
|
1614
1721
|
__decorate([
|
|
1615
1722
|
(0, runtime_1.Security)("bearerAuth"),
|
|
1616
1723
|
(0, runtime_1.Post)("/admin/add"),
|
|
@@ -1747,7 +1854,7 @@ __decorate([
|
|
|
1747
1854
|
], LemmyHttp.prototype, "updateCommunityTag", null);
|
|
1748
1855
|
__decorate([
|
|
1749
1856
|
(0, runtime_1.Security)("bearerAuth"),
|
|
1750
|
-
(0, runtime_1.
|
|
1857
|
+
(0, runtime_1.Delete)("/community/tag"),
|
|
1751
1858
|
(0, runtime_1.Tags)("Community"),
|
|
1752
1859
|
__param(0, (0, runtime_1.Body)()),
|
|
1753
1860
|
__param(1, (0, runtime_1.Inject)())
|
|
@@ -1794,11 +1901,18 @@ __decorate([
|
|
|
1794
1901
|
], LemmyHttp.prototype, "listReports", null);
|
|
1795
1902
|
__decorate([
|
|
1796
1903
|
(0, runtime_1.Security)("bearerAuth"),
|
|
1797
|
-
(0, runtime_1.Post)("/account/block/instance"),
|
|
1798
|
-
(0, runtime_1.Tags)("Account"),
|
|
1904
|
+
(0, runtime_1.Post)("/account/block/instance/communities"),
|
|
1905
|
+
(0, runtime_1.Tags)("Account", "Community"),
|
|
1906
|
+
__param(0, (0, runtime_1.Body)()),
|
|
1907
|
+
__param(1, (0, runtime_1.Inject)())
|
|
1908
|
+
], LemmyHttp.prototype, "userBlockInstanceCommunities", null);
|
|
1909
|
+
__decorate([
|
|
1910
|
+
(0, runtime_1.Security)("bearerAuth"),
|
|
1911
|
+
(0, runtime_1.Post)("/account/block/instance/persons"),
|
|
1912
|
+
(0, runtime_1.Tags)("Account", "Person"),
|
|
1799
1913
|
__param(0, (0, runtime_1.Body)()),
|
|
1800
1914
|
__param(1, (0, runtime_1.Inject)())
|
|
1801
|
-
], LemmyHttp.prototype, "
|
|
1915
|
+
], LemmyHttp.prototype, "userBlockInstancePersons", null);
|
|
1802
1916
|
__decorate([
|
|
1803
1917
|
(0, runtime_1.Security)("bearerAuth"),
|
|
1804
1918
|
(0, runtime_1.Post)("/admin/instance/block"),
|
|
@@ -1843,27 +1957,31 @@ __decorate([
|
|
|
1843
1957
|
(0, runtime_1.Security)("bearerAuth"),
|
|
1844
1958
|
(0, runtime_1.Post)("/community/icon"),
|
|
1845
1959
|
(0, runtime_1.Tags)("Community", "Media"),
|
|
1846
|
-
__param(0, (0, runtime_1.
|
|
1847
|
-
__param(1, (0, runtime_1.
|
|
1960
|
+
__param(0, (0, runtime_1.Queries)()),
|
|
1961
|
+
__param(1, (0, runtime_1.UploadedFile)()),
|
|
1962
|
+
__param(2, (0, runtime_1.Inject)())
|
|
1848
1963
|
], LemmyHttp.prototype, "uploadCommunityIcon", null);
|
|
1849
1964
|
__decorate([
|
|
1850
1965
|
(0, runtime_1.Security)("bearerAuth"),
|
|
1851
1966
|
(0, runtime_1.Delete)("/community/icon"),
|
|
1852
1967
|
(0, runtime_1.Tags)("Community", "Media"),
|
|
1853
|
-
__param(0, (0, runtime_1.
|
|
1968
|
+
__param(0, (0, runtime_1.Body)()),
|
|
1969
|
+
__param(1, (0, runtime_1.Inject)())
|
|
1854
1970
|
], LemmyHttp.prototype, "deleteCommunityIcon", null);
|
|
1855
1971
|
__decorate([
|
|
1856
1972
|
(0, runtime_1.Security)("bearerAuth"),
|
|
1857
1973
|
(0, runtime_1.Post)("/community/banner"),
|
|
1858
1974
|
(0, runtime_1.Tags)("Community", "Media"),
|
|
1859
|
-
__param(0, (0, runtime_1.
|
|
1860
|
-
__param(1, (0, runtime_1.
|
|
1975
|
+
__param(0, (0, runtime_1.Queries)()),
|
|
1976
|
+
__param(1, (0, runtime_1.UploadedFile)()),
|
|
1977
|
+
__param(2, (0, runtime_1.Inject)())
|
|
1861
1978
|
], LemmyHttp.prototype, "uploadCommunityBanner", null);
|
|
1862
1979
|
__decorate([
|
|
1863
1980
|
(0, runtime_1.Security)("bearerAuth"),
|
|
1864
1981
|
(0, runtime_1.Delete)("/community/banner"),
|
|
1865
1982
|
(0, runtime_1.Tags)("Community", "Media"),
|
|
1866
|
-
__param(0, (0, runtime_1.
|
|
1983
|
+
__param(0, (0, runtime_1.Body)()),
|
|
1984
|
+
__param(1, (0, runtime_1.Inject)())
|
|
1867
1985
|
], LemmyHttp.prototype, "deleteCommunityBanner", null);
|
|
1868
1986
|
__decorate([
|
|
1869
1987
|
(0, runtime_1.Security)("bearerAuth"),
|
|
@@ -1904,8 +2022,71 @@ __decorate([
|
|
|
1904
2022
|
__param(0, (0, runtime_1.Inject)())
|
|
1905
2023
|
], LemmyHttp.prototype, "imageHealth", null);
|
|
1906
2024
|
__decorate([
|
|
2025
|
+
(0, runtime_1.Security)("bearerAuth"),
|
|
2026
|
+
(0, runtime_1.Post)("/account/donation_dialog_shown"),
|
|
2027
|
+
(0, runtime_1.Tags)("Account"),
|
|
1907
2028
|
__param(0, (0, runtime_1.Inject)())
|
|
1908
|
-
], LemmyHttp.prototype, "
|
|
2029
|
+
], LemmyHttp.prototype, "donationDialogShown", null);
|
|
2030
|
+
__decorate([
|
|
2031
|
+
(0, runtime_1.Security)("bearerAuth"),
|
|
2032
|
+
(0, runtime_1.Post)("/multi_community"),
|
|
2033
|
+
(0, runtime_1.Tags)("Multicommunity"),
|
|
2034
|
+
__param(0, (0, runtime_1.Body)()),
|
|
2035
|
+
__param(1, (0, runtime_1.Inject)())
|
|
2036
|
+
], LemmyHttp.prototype, "createMultiCommunity", null);
|
|
2037
|
+
__decorate([
|
|
2038
|
+
(0, runtime_1.Security)("bearerAuth"),
|
|
2039
|
+
(0, runtime_1.Put)("/multi_community"),
|
|
2040
|
+
(0, runtime_1.Tags)("Multicommunity"),
|
|
2041
|
+
__param(0, (0, runtime_1.Body)()),
|
|
2042
|
+
__param(1, (0, runtime_1.Inject)())
|
|
2043
|
+
], LemmyHttp.prototype, "updateMultiCommunity", null);
|
|
2044
|
+
__decorate([
|
|
2045
|
+
(0, runtime_1.Get)("/multi_community"),
|
|
2046
|
+
(0, runtime_1.Tags)("Multicommunity"),
|
|
2047
|
+
__param(0, (0, runtime_1.Queries)()),
|
|
2048
|
+
__param(1, (0, runtime_1.Inject)())
|
|
2049
|
+
], LemmyHttp.prototype, "getMultiCommunity", null);
|
|
2050
|
+
__decorate([
|
|
2051
|
+
(0, runtime_1.Security)("bearerAuth"),
|
|
2052
|
+
(0, runtime_1.Post)("/multi_community/entry"),
|
|
2053
|
+
(0, runtime_1.Tags)("Multicommunity"),
|
|
2054
|
+
__param(0, (0, runtime_1.Body)()),
|
|
2055
|
+
__param(1, (0, runtime_1.Inject)())
|
|
2056
|
+
], LemmyHttp.prototype, "createMultiCommunityEntry", null);
|
|
2057
|
+
__decorate([
|
|
2058
|
+
(0, runtime_1.Security)("bearerAuth"),
|
|
2059
|
+
(0, runtime_1.Delete)("/multi_community/entry"),
|
|
2060
|
+
(0, runtime_1.Tags)("Multicommunity"),
|
|
2061
|
+
__param(0, (0, runtime_1.Body)()),
|
|
2062
|
+
__param(1, (0, runtime_1.Inject)())
|
|
2063
|
+
], LemmyHttp.prototype, "deleteMultiCommunityEntry", null);
|
|
2064
|
+
__decorate([
|
|
2065
|
+
(0, runtime_1.Get)("/multi_community/list"),
|
|
2066
|
+
(0, runtime_1.Tags)("Multicommunity"),
|
|
2067
|
+
__param(0, (0, runtime_1.Queries)()),
|
|
2068
|
+
__param(1, (0, runtime_1.Inject)())
|
|
2069
|
+
], LemmyHttp.prototype, "listMultiCommunities", null);
|
|
2070
|
+
__decorate([
|
|
2071
|
+
(0, runtime_1.Post)("/multi_community/follow"),
|
|
2072
|
+
(0, runtime_1.Tags)("Multicommunity"),
|
|
2073
|
+
__param(0, (0, runtime_1.Body)()),
|
|
2074
|
+
__param(1, (0, runtime_1.Inject)())
|
|
2075
|
+
], LemmyHttp.prototype, "followMultiCommunity", null);
|
|
2076
|
+
__decorate([
|
|
2077
|
+
(0, runtime_1.Security)("bearerAuth"),
|
|
2078
|
+
(0, runtime_1.Put)("/community/notifications"),
|
|
2079
|
+
(0, runtime_1.Tags)("Community"),
|
|
2080
|
+
__param(0, (0, runtime_1.Body)()),
|
|
2081
|
+
__param(1, (0, runtime_1.Inject)())
|
|
2082
|
+
], LemmyHttp.prototype, "updateCommunityNotifications", null);
|
|
2083
|
+
__decorate([
|
|
2084
|
+
(0, runtime_1.Security)("bearerAuth"),
|
|
2085
|
+
(0, runtime_1.Put)("/post/notifications"),
|
|
2086
|
+
(0, runtime_1.Tags)("Post"),
|
|
2087
|
+
__param(0, (0, runtime_1.Body)()),
|
|
2088
|
+
__param(1, (0, runtime_1.Inject)())
|
|
2089
|
+
], LemmyHttp.prototype, "updatePostNotifications", null);
|
|
1909
2090
|
exports.LemmyHttp = LemmyHttp = __decorate([
|
|
1910
2091
|
(0, runtime_1.Route)("api/v4")
|
|
1911
2092
|
], LemmyHttp);
|
|
@@ -1926,3 +2107,18 @@ function createFormData(image) {
|
|
|
1926
2107
|
}
|
|
1927
2108
|
return formData;
|
|
1928
2109
|
}
|
|
2110
|
+
/**
|
|
2111
|
+
* A Lemmy error type.
|
|
2112
|
+
*
|
|
2113
|
+
* The name is the i18n translatable error code.
|
|
2114
|
+
* The msg is either an empty string, or extra non-translatable info.
|
|
2115
|
+
*/
|
|
2116
|
+
class LemmyError extends Error {
|
|
2117
|
+
constructor(name, msg) {
|
|
2118
|
+
super(msg ?? "");
|
|
2119
|
+
this.name = name;
|
|
2120
|
+
// Set the prototype explicitly.
|
|
2121
|
+
Object.setPrototypeOf(this, LemmyError.prototype);
|
|
2122
|
+
}
|
|
2123
|
+
}
|
|
2124
|
+
exports.LemmyError = LemmyError;
|