lemmy-js-client 1.0.0-alpha.1 → 1.0.0-api-updates-3.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 +110 -49
- package/dist/http.js +280 -84
- package/dist/index.d.ts +66 -38
- package/dist/other_types.d.ts +22 -7
- 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 +7 -2
- package/dist/types/AdminListUsers.d.ts +7 -0
- package/dist/types/AdminListUsersResponse.d.ts +10 -0
- 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/AllLemmyErrors.d.ts +1 -0
- package/dist/types/AllLemmyErrors.js +117 -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 +6 -10
- package/dist/types/CommentActions.js +1 -0
- package/dist/types/CommentReport.d.ts +2 -2
- package/dist/types/CommentReportView.d.ts +5 -1
- package/dist/types/CommentResponse.d.ts +0 -2
- package/dist/types/CommentSlimView.d.ts +2 -6
- package/dist/types/CommentSortType.d.ts +1 -1
- package/dist/types/CommentView.d.ts +4 -5
- package/dist/types/Community.d.ts +2 -2
- package/dist/types/CommunityActions.d.ts +11 -17
- package/dist/types/CommunityFollowerState.d.ts +1 -1
- 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 +6 -0
- package/dist/types/CommunitySortType.d.ts +1 -1
- package/dist/types/CommunityView.d.ts +0 -2
- package/dist/types/CommunityVisibility.d.ts +1 -1
- package/dist/types/CreateCommentLike.d.ts +1 -4
- package/dist/types/CreateCommunityTag.d.ts +3 -1
- package/dist/types/CreateCustomEmoji.d.ts +2 -1
- package/dist/types/CreateCustomEmoji.js +0 -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/CreatePostLike.d.ts +1 -4
- package/dist/types/CreateSite.d.ts +16 -14
- package/dist/types/CustomEmoji.d.ts +2 -2
- package/dist/types/EditCustomEmoji.d.ts +7 -5
- package/dist/types/EditPost.d.ts +1 -1
- package/dist/types/EditSite.d.ts +26 -20
- package/dist/types/ExportDataResponse.d.ts +13 -0
- package/dist/types/FederationBlockList.d.ts +3 -3
- package/dist/types/FederationMode.d.ts +1 -1
- package/dist/types/FollowMultiCommunity.d.ts +5 -0
- package/dist/types/GetComments.d.ts +0 -2
- package/dist/types/GetMultiCommunity.d.ts +5 -0
- package/dist/types/GetMultiCommunityResponse.d.ts +6 -0
- package/dist/types/GetPosts.d.ts +2 -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 +28 -146
- package/dist/types/LikeType.d.ts +4 -0
- package/dist/types/LinkMetadata.d.ts +4 -0
- package/dist/types/ListCommunityPendingFollows.d.ts +1 -1
- package/dist/types/ListCommunityPendingFollowsResponse.d.ts +2 -2
- 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} +3 -3
- package/dist/types/{ListInboxResponse.d.ts → ListNotificationsResponse.d.ts} +3 -3
- package/dist/types/{ListBannedPersons.d.ts → ListPersonHidden.d.ts} +2 -2
- package/dist/types/{BannedPersonsResponse.d.ts → ListPersonHiddenResponse.d.ts} +4 -4
- 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/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 +5 -10
- package/dist/types/LocalSiteRateLimit.d.ts +16 -16
- package/dist/types/LocalSiteUrlBlocklist.d.ts +2 -2
- package/dist/types/LocalUser.d.ts +13 -14
- 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/MarkManyPostsAsRead.d.ts +1 -0
- package/dist/types/MarkNotificationAsRead.d.ts +8 -0
- package/dist/types/{ModAddCommunity.d.ts → ModAddToCommunity.d.ts} +4 -4
- package/dist/types/ModAddToCommunityId.d.ts +1 -0
- package/dist/types/{ModAddCommunityView.d.ts → ModAddToCommunityView.d.ts} +3 -3
- 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/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/MultiCommunityEntry.d.ts +6 -0
- package/dist/types/MultiCommunityEntry.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/MultiCommunityResponse.d.ts +4 -0
- package/dist/types/MultiCommunityResponse.js +2 -0
- package/dist/types/MultiCommunityView.d.ts +8 -0
- package/dist/types/MultiCommunityView.js +2 -0
- package/dist/types/MyUserInfo.d.ts +2 -1
- package/dist/types/NotePerson.d.ts +10 -0
- package/dist/types/NotePerson.js +2 -0
- package/dist/types/Notification.d.ts +36 -0
- package/dist/types/Notification.js +2 -0
- package/dist/types/NotificationData.d.ts +40 -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/NotificationType.d.ts +4 -0
- package/dist/types/NotificationType.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/PendingFollowerView.d.ts +9 -0
- package/dist/types/PendingFollowerView.js +2 -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/PersonContentType.d.ts +1 -1
- package/dist/types/PersonLikedCombinedView.d.ts +7 -0
- package/dist/types/PersonLikedCombinedView.js +2 -0
- package/dist/types/PersonResponse.d.ts +7 -0
- package/dist/types/PersonResponse.js +2 -0
- package/dist/types/PersonView.d.ts +4 -4
- package/dist/types/Post.d.ts +9 -7
- package/dist/types/PostActions.d.ts +15 -17
- package/dist/types/PostFeatureType.d.ts +1 -1
- package/dist/types/PostListingMode.d.ts +1 -1
- 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 +5 -1
- package/dist/types/PostSortType.d.ts +1 -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 +3 -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 +3 -3
- package/dist/types/RegistrationApplication.d.ts +1 -1
- package/dist/types/RegistrationMode.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/ReportType.d.ts +1 -1
- package/dist/types/SaveUserSettings.d.ts +11 -6
- package/dist/types/Search.d.ts +5 -1
- package/dist/types/SearchCombinedView.d.ts +4 -1
- package/dist/types/SearchSortType.d.ts +1 -1
- 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 +2 -2
- package/dist/types/TagsView.d.ts +1 -1
- package/dist/types/UntranslatedError.d.ts +14 -0
- package/dist/types/UntranslatedError.js +3 -0
- 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 +29 -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 +2 -2
- package/package.json +7 -6
- package/dist/types/BanPersonResponse.d.ts +0 -8
- package/dist/types/BlockCommunityResponse.d.ts +0 -8
- package/dist/types/BlockPersonResponse.d.ts +0 -8
- 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/FederationError.d.ts +0 -10
- package/dist/types/GetCommunityPendingFollowsCount.d.ts +0 -4
- 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/ResolveObjectResponse.d.ts +0 -13
- /package/dist/types/{BanPersonResponse.js → AdminAdd.js} +0 -0
- /package/dist/types/{CommentReplyId.js → AdminAddId.js} +0 -0
- /package/dist/types/{BannedPersonsResponse.js → AdminAddView.js} +0 -0
- /package/dist/types/{BlockCommunityResponse.js → AdminBan.js} +0 -0
- /package/dist/types/{FederationError.js → AdminBanId.js} +0 -0
- /package/dist/types/{BlockPersonResponse.js → AdminBanView.js} +0 -0
- /package/dist/types/{CommentReply.js → AdminListUsers.js} +0 -0
- /package/dist/types/{CommentReplyView.js → AdminListUsersResponse.js} +0 -0
- /package/dist/types/{GetCommunityPendingFollowsCount.js → AdminRemoveCommunity.js} +0 -0
- /package/dist/types/{InboxDataType.js → AdminRemoveCommunityId.js} +0 -0
- /package/dist/types/{InboxCombinedView.js → AdminRemoveCommunityView.js} +0 -0
- /package/dist/types/{ListBannedPersons.js → CommunityIdQuery.js} +0 -0
- /package/dist/types/{ModAddCommunityId.js → CommunityNotificationsMode.js} +0 -0
- /package/dist/types/{ModAddId.js → CreateMultiCommunity.js} +0 -0
- /package/dist/types/{ListInbox.js → CreateOrDeleteMultiCommunityEntry.js} +0 -0
- /package/dist/types/{ListInboxResponse.js → ExportDataResponse.js} +0 -0
- /package/dist/types/{MarkCommentReplyAsRead.js → FollowMultiCommunity.js} +0 -0
- /package/dist/types/{MarkPersonCommentMentionAsRead.js → GetMultiCommunity.js} +0 -0
- /package/dist/types/{MarkPersonPostMentionAsRead.js → GetMultiCommunityResponse.js} +0 -0
- /package/dist/types/{ModBanId.js → LikeType.js} +0 -0
- /package/dist/types/{MarkPrivateMessageAsRead.js → ListMultiCommunities.js} +0 -0
- /package/dist/types/{ModAdd.js → ListMultiCommunitiesResponse.js} +0 -0
- /package/dist/types/{ModAddCommunity.js → ListNotifications.js} +0 -0
- /package/dist/types/{ModAddCommunityView.js → ListNotificationsResponse.js} +0 -0
- /package/dist/types/{ModAddView.js → ListPersonHidden.js} +0 -0
- /package/dist/types/{ModBan.js → ListPersonHiddenResponse.js} +0 -0
- /package/dist/types/{ModBanView.js → ListPersonLiked.js} +0 -0
- /package/dist/types/{ModRemoveCommunity.js → ListPersonLikedResponse.js} +0 -0
- /package/dist/types/{ModRemoveCommunityView.js → ListPersonRead.js} +0 -0
- /package/dist/types/{PersonCommentMention.js → ListPersonReadResponse.js} +0 -0
- /package/dist/types/{PersonCommentMentionView.js → LockComment.js} +0 -0
- /package/dist/types/{PersonPostMention.js → MarkNotificationAsRead.js} +0 -0
- /package/dist/types/{PersonPostMentionView.js → ModAddToCommunity.js} +0 -0
- /package/dist/types/{ModRemoveCommunityId.js → ModAddToCommunityId.js} +0 -0
- /package/dist/types/{ResolveObjectResponse.js → ModAddToCommunityView.js} +0 -0
- /package/dist/types/{UserBlockInstanceParams.js → ModEditPost.js} +0 -0
- /package/dist/types/{PersonCommentMentionId.js → ModLockCommentId.js} +0 -0
- /package/dist/types/{PersonPostMentionId.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);
|
|
@@ -205,8 +205,8 @@ let LemmyHttp = class LemmyHttp extends runtime_1.Controller {
|
|
|
205
205
|
/**
|
|
206
206
|
* @summary Get a community's pending follows count.
|
|
207
207
|
*/
|
|
208
|
-
async getCommunityPendingFollowsCount(
|
|
209
|
-
return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Get, "/community/pending_follows/count",
|
|
208
|
+
async getCommunityPendingFollowsCount(options) {
|
|
209
|
+
return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Get, "/community/pending_follows/count", {}, options);
|
|
210
210
|
}
|
|
211
211
|
/**
|
|
212
212
|
* @summary Get a community's pending followers.
|
|
@@ -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 notification 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.
|
|
819
|
+
*/
|
|
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.
|
|
789
825
|
*/
|
|
790
|
-
async
|
|
791
|
-
return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Post, "/account/block/instance", form, options);
|
|
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, response.status);
|
|
949
1019
|
}
|
|
950
1020
|
if (!response.ok) {
|
|
951
|
-
|
|
1021
|
+
console.error(`Request error while calling ${type_} ${endpoint} with ${JSON.stringify(form)}`);
|
|
1022
|
+
let err = new LemmyError(json.error ?? response.statusText, response.status, json.message);
|
|
1023
|
+
throw err;
|
|
952
1024
|
}
|
|
953
1025
|
else {
|
|
954
1026
|
return json;
|
|
@@ -1119,8 +1191,7 @@ __decorate([
|
|
|
1119
1191
|
(0, runtime_1.Security)("bearerAuth"),
|
|
1120
1192
|
(0, runtime_1.Get)("/community/pending_follows/count"),
|
|
1121
1193
|
(0, runtime_1.Tags)("Community"),
|
|
1122
|
-
__param(0, (0, runtime_1.
|
|
1123
|
-
__param(1, (0, runtime_1.Inject)())
|
|
1194
|
+
__param(0, (0, runtime_1.Inject)())
|
|
1124
1195
|
], LemmyHttp.prototype, "getCommunityPendingFollowsCount", null);
|
|
1125
1196
|
__decorate([
|
|
1126
1197
|
(0, runtime_1.Security)("bearerAuth"),
|
|
@@ -1193,6 +1264,20 @@ __decorate([
|
|
|
1193
1264
|
__param(0, (0, runtime_1.Queries)()),
|
|
1194
1265
|
__param(1, (0, runtime_1.Inject)())
|
|
1195
1266
|
], LemmyHttp.prototype, "getRandomCommunity", null);
|
|
1267
|
+
__decorate([
|
|
1268
|
+
(0, runtime_1.Security)("bearerAuth"),
|
|
1269
|
+
(0, runtime_1.Post)("/community/report"),
|
|
1270
|
+
(0, runtime_1.Tags)("Community"),
|
|
1271
|
+
__param(0, (0, runtime_1.Body)()),
|
|
1272
|
+
__param(1, (0, runtime_1.Inject)())
|
|
1273
|
+
], LemmyHttp.prototype, "createCommunityReport", null);
|
|
1274
|
+
__decorate([
|
|
1275
|
+
(0, runtime_1.Security)("bearerAuth"),
|
|
1276
|
+
(0, runtime_1.Put)("/community/report/resolve"),
|
|
1277
|
+
(0, runtime_1.Tags)("Community", "Admin"),
|
|
1278
|
+
__param(0, (0, runtime_1.Body)()),
|
|
1279
|
+
__param(1, (0, runtime_1.Inject)())
|
|
1280
|
+
], LemmyHttp.prototype, "resolveCommunityReport", null);
|
|
1196
1281
|
__decorate([
|
|
1197
1282
|
(0, runtime_1.Security)("bearerAuth"),
|
|
1198
1283
|
(0, runtime_1.Post)("/post"),
|
|
@@ -1215,6 +1300,13 @@ __decorate([
|
|
|
1215
1300
|
__param(0, (0, runtime_1.Body)()),
|
|
1216
1301
|
__param(1, (0, runtime_1.Inject)())
|
|
1217
1302
|
], LemmyHttp.prototype, "editPost", null);
|
|
1303
|
+
__decorate([
|
|
1304
|
+
(0, runtime_1.Security)("bearerAuth"),
|
|
1305
|
+
(0, runtime_1.Put)("/post/mod_update"),
|
|
1306
|
+
(0, runtime_1.Tags)("Post"),
|
|
1307
|
+
__param(0, (0, runtime_1.Body)()),
|
|
1308
|
+
__param(1, (0, runtime_1.Inject)())
|
|
1309
|
+
], LemmyHttp.prototype, "modEditPost", null);
|
|
1218
1310
|
__decorate([
|
|
1219
1311
|
(0, runtime_1.Security)("bearerAuth"),
|
|
1220
1312
|
(0, runtime_1.Post)("/post/delete"),
|
|
@@ -1344,11 +1436,11 @@ __decorate([
|
|
|
1344
1436
|
], LemmyHttp.prototype, "removeComment", null);
|
|
1345
1437
|
__decorate([
|
|
1346
1438
|
(0, runtime_1.Security)("bearerAuth"),
|
|
1347
|
-
(0, runtime_1.Post)("/comment/
|
|
1348
|
-
(0, runtime_1.Tags)("Comment"),
|
|
1439
|
+
(0, runtime_1.Post)("/comment/lock"),
|
|
1440
|
+
(0, runtime_1.Tags)("Comment", "Moderator"),
|
|
1349
1441
|
__param(0, (0, runtime_1.Body)()),
|
|
1350
1442
|
__param(1, (0, runtime_1.Inject)())
|
|
1351
|
-
], LemmyHttp.prototype, "
|
|
1443
|
+
], LemmyHttp.prototype, "lockComment", null);
|
|
1352
1444
|
__decorate([
|
|
1353
1445
|
(0, runtime_1.Security)("bearerAuth"),
|
|
1354
1446
|
(0, runtime_1.Post)("/comment/like"),
|
|
@@ -1436,13 +1528,6 @@ __decorate([
|
|
|
1436
1528
|
__param(0, (0, runtime_1.Body)()),
|
|
1437
1529
|
__param(1, (0, runtime_1.Inject)())
|
|
1438
1530
|
], 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
1531
|
__decorate([
|
|
1447
1532
|
(0, runtime_1.Security)("bearerAuth"),
|
|
1448
1533
|
(0, runtime_1.Post)("/private_message/report"),
|
|
@@ -1493,18 +1578,11 @@ __decorate([
|
|
|
1493
1578
|
], LemmyHttp.prototype, "listPersonContent", null);
|
|
1494
1579
|
__decorate([
|
|
1495
1580
|
(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"),
|
|
1581
|
+
(0, runtime_1.Post)("/person/note"),
|
|
1582
|
+
(0, runtime_1.Tags)("Person"),
|
|
1505
1583
|
__param(0, (0, runtime_1.Body)()),
|
|
1506
1584
|
__param(1, (0, runtime_1.Inject)())
|
|
1507
|
-
], LemmyHttp.prototype, "
|
|
1585
|
+
], LemmyHttp.prototype, "notePerson", null);
|
|
1508
1586
|
__decorate([
|
|
1509
1587
|
(0, runtime_1.Security)("bearerAuth"),
|
|
1510
1588
|
(0, runtime_1.Post)("/admin/ban"),
|
|
@@ -1514,11 +1592,11 @@ __decorate([
|
|
|
1514
1592
|
], LemmyHttp.prototype, "banPerson", null);
|
|
1515
1593
|
__decorate([
|
|
1516
1594
|
(0, runtime_1.Security)("bearerAuth"),
|
|
1517
|
-
(0, runtime_1.Get)("/admin/
|
|
1595
|
+
(0, runtime_1.Get)("/admin/users"),
|
|
1518
1596
|
(0, runtime_1.Tags)("Admin", "Miscellaneous"),
|
|
1519
1597
|
__param(0, (0, runtime_1.Queries)()),
|
|
1520
1598
|
__param(1, (0, runtime_1.Inject)())
|
|
1521
|
-
], LemmyHttp.prototype, "
|
|
1599
|
+
], LemmyHttp.prototype, "listUsers", null);
|
|
1522
1600
|
__decorate([
|
|
1523
1601
|
(0, runtime_1.Security)("bearerAuth"),
|
|
1524
1602
|
(0, runtime_1.Post)("/account/block/person"),
|
|
@@ -1558,6 +1636,13 @@ __decorate([
|
|
|
1558
1636
|
(0, runtime_1.Tags)("Account"),
|
|
1559
1637
|
__param(0, (0, runtime_1.Inject)())
|
|
1560
1638
|
], LemmyHttp.prototype, "markAllNotificationsAsRead", null);
|
|
1639
|
+
__decorate([
|
|
1640
|
+
(0, runtime_1.Security)("bearerAuth"),
|
|
1641
|
+
(0, runtime_1.Post)("/account/mark_as_read"),
|
|
1642
|
+
(0, runtime_1.Tags)("Account"),
|
|
1643
|
+
__param(0, (0, runtime_1.Body)()),
|
|
1644
|
+
__param(1, (0, runtime_1.Inject)())
|
|
1645
|
+
], LemmyHttp.prototype, "markNotificationAsRead", null);
|
|
1561
1646
|
__decorate([
|
|
1562
1647
|
(0, runtime_1.Security)("bearerAuth"),
|
|
1563
1648
|
(0, runtime_1.Put)("/account/settings/save"),
|
|
@@ -1587,11 +1672,11 @@ __decorate([
|
|
|
1587
1672
|
], LemmyHttp.prototype, "getUnreadCount", null);
|
|
1588
1673
|
__decorate([
|
|
1589
1674
|
(0, runtime_1.Security)("bearerAuth"),
|
|
1590
|
-
(0, runtime_1.Get)("/account/
|
|
1675
|
+
(0, runtime_1.Get)("/account/notifications"),
|
|
1591
1676
|
(0, runtime_1.Tags)("Account"),
|
|
1592
1677
|
__param(0, (0, runtime_1.Queries)()),
|
|
1593
1678
|
__param(1, (0, runtime_1.Inject)())
|
|
1594
|
-
], LemmyHttp.prototype, "
|
|
1679
|
+
], LemmyHttp.prototype, "listNotifications", null);
|
|
1595
1680
|
__decorate([
|
|
1596
1681
|
(0, runtime_1.Post)("/account/auth/verify_email"),
|
|
1597
1682
|
(0, runtime_1.Tags)("Account"),
|
|
@@ -1611,6 +1696,27 @@ __decorate([
|
|
|
1611
1696
|
__param(0, (0, runtime_1.Queries)()),
|
|
1612
1697
|
__param(1, (0, runtime_1.Inject)())
|
|
1613
1698
|
], LemmyHttp.prototype, "listPersonSaved", null);
|
|
1699
|
+
__decorate([
|
|
1700
|
+
(0, runtime_1.Security)("bearerAuth"),
|
|
1701
|
+
(0, runtime_1.Get)("/account/read"),
|
|
1702
|
+
(0, runtime_1.Tags)("Account"),
|
|
1703
|
+
__param(0, (0, runtime_1.Queries)()),
|
|
1704
|
+
__param(1, (0, runtime_1.Inject)())
|
|
1705
|
+
], LemmyHttp.prototype, "listPersonRead", null);
|
|
1706
|
+
__decorate([
|
|
1707
|
+
(0, runtime_1.Security)("bearerAuth"),
|
|
1708
|
+
(0, runtime_1.Get)("/account/hidden"),
|
|
1709
|
+
(0, runtime_1.Tags)("Account"),
|
|
1710
|
+
__param(0, (0, runtime_1.Queries)()),
|
|
1711
|
+
__param(1, (0, runtime_1.Inject)())
|
|
1712
|
+
], LemmyHttp.prototype, "listPersonHidden", null);
|
|
1713
|
+
__decorate([
|
|
1714
|
+
(0, runtime_1.Security)("bearerAuth"),
|
|
1715
|
+
(0, runtime_1.Get)("/account/liked"),
|
|
1716
|
+
(0, runtime_1.Tags)("Account"),
|
|
1717
|
+
__param(0, (0, runtime_1.Queries)()),
|
|
1718
|
+
__param(1, (0, runtime_1.Inject)())
|
|
1719
|
+
], LemmyHttp.prototype, "listPersonLiked", null);
|
|
1614
1720
|
__decorate([
|
|
1615
1721
|
(0, runtime_1.Security)("bearerAuth"),
|
|
1616
1722
|
(0, runtime_1.Post)("/admin/add"),
|
|
@@ -1794,11 +1900,18 @@ __decorate([
|
|
|
1794
1900
|
], LemmyHttp.prototype, "listReports", null);
|
|
1795
1901
|
__decorate([
|
|
1796
1902
|
(0, runtime_1.Security)("bearerAuth"),
|
|
1797
|
-
(0, runtime_1.Post)("/account/block/instance"),
|
|
1798
|
-
(0, runtime_1.Tags)("Account"),
|
|
1903
|
+
(0, runtime_1.Post)("/account/block/instance/communities"),
|
|
1904
|
+
(0, runtime_1.Tags)("Account", "Community"),
|
|
1905
|
+
__param(0, (0, runtime_1.Body)()),
|
|
1906
|
+
__param(1, (0, runtime_1.Inject)())
|
|
1907
|
+
], LemmyHttp.prototype, "userBlockInstanceCommunities", null);
|
|
1908
|
+
__decorate([
|
|
1909
|
+
(0, runtime_1.Security)("bearerAuth"),
|
|
1910
|
+
(0, runtime_1.Post)("/account/block/instance/persons"),
|
|
1911
|
+
(0, runtime_1.Tags)("Account", "Person"),
|
|
1799
1912
|
__param(0, (0, runtime_1.Body)()),
|
|
1800
1913
|
__param(1, (0, runtime_1.Inject)())
|
|
1801
|
-
], LemmyHttp.prototype, "
|
|
1914
|
+
], LemmyHttp.prototype, "userBlockInstancePersons", null);
|
|
1802
1915
|
__decorate([
|
|
1803
1916
|
(0, runtime_1.Security)("bearerAuth"),
|
|
1804
1917
|
(0, runtime_1.Post)("/admin/instance/block"),
|
|
@@ -1843,27 +1956,31 @@ __decorate([
|
|
|
1843
1956
|
(0, runtime_1.Security)("bearerAuth"),
|
|
1844
1957
|
(0, runtime_1.Post)("/community/icon"),
|
|
1845
1958
|
(0, runtime_1.Tags)("Community", "Media"),
|
|
1846
|
-
__param(0, (0, runtime_1.
|
|
1847
|
-
__param(1, (0, runtime_1.
|
|
1959
|
+
__param(0, (0, runtime_1.Queries)()),
|
|
1960
|
+
__param(1, (0, runtime_1.UploadedFile)()),
|
|
1961
|
+
__param(2, (0, runtime_1.Inject)())
|
|
1848
1962
|
], LemmyHttp.prototype, "uploadCommunityIcon", null);
|
|
1849
1963
|
__decorate([
|
|
1850
1964
|
(0, runtime_1.Security)("bearerAuth"),
|
|
1851
1965
|
(0, runtime_1.Delete)("/community/icon"),
|
|
1852
1966
|
(0, runtime_1.Tags)("Community", "Media"),
|
|
1853
|
-
__param(0, (0, runtime_1.
|
|
1967
|
+
__param(0, (0, runtime_1.Body)()),
|
|
1968
|
+
__param(1, (0, runtime_1.Inject)())
|
|
1854
1969
|
], LemmyHttp.prototype, "deleteCommunityIcon", null);
|
|
1855
1970
|
__decorate([
|
|
1856
1971
|
(0, runtime_1.Security)("bearerAuth"),
|
|
1857
1972
|
(0, runtime_1.Post)("/community/banner"),
|
|
1858
1973
|
(0, runtime_1.Tags)("Community", "Media"),
|
|
1859
|
-
__param(0, (0, runtime_1.
|
|
1860
|
-
__param(1, (0, runtime_1.
|
|
1974
|
+
__param(0, (0, runtime_1.Queries)()),
|
|
1975
|
+
__param(1, (0, runtime_1.UploadedFile)()),
|
|
1976
|
+
__param(2, (0, runtime_1.Inject)())
|
|
1861
1977
|
], LemmyHttp.prototype, "uploadCommunityBanner", null);
|
|
1862
1978
|
__decorate([
|
|
1863
1979
|
(0, runtime_1.Security)("bearerAuth"),
|
|
1864
1980
|
(0, runtime_1.Delete)("/community/banner"),
|
|
1865
1981
|
(0, runtime_1.Tags)("Community", "Media"),
|
|
1866
|
-
__param(0, (0, runtime_1.
|
|
1982
|
+
__param(0, (0, runtime_1.Body)()),
|
|
1983
|
+
__param(1, (0, runtime_1.Inject)())
|
|
1867
1984
|
], LemmyHttp.prototype, "deleteCommunityBanner", null);
|
|
1868
1985
|
__decorate([
|
|
1869
1986
|
(0, runtime_1.Security)("bearerAuth"),
|
|
@@ -1904,8 +2021,71 @@ __decorate([
|
|
|
1904
2021
|
__param(0, (0, runtime_1.Inject)())
|
|
1905
2022
|
], LemmyHttp.prototype, "imageHealth", null);
|
|
1906
2023
|
__decorate([
|
|
2024
|
+
(0, runtime_1.Security)("bearerAuth"),
|
|
2025
|
+
(0, runtime_1.Post)("/account/donation_dialog_shown"),
|
|
2026
|
+
(0, runtime_1.Tags)("Account"),
|
|
1907
2027
|
__param(0, (0, runtime_1.Inject)())
|
|
1908
|
-
], LemmyHttp.prototype, "
|
|
2028
|
+
], LemmyHttp.prototype, "donationDialogShown", null);
|
|
2029
|
+
__decorate([
|
|
2030
|
+
(0, runtime_1.Security)("bearerAuth"),
|
|
2031
|
+
(0, runtime_1.Post)("/multi_community"),
|
|
2032
|
+
(0, runtime_1.Tags)("Multicommunity"),
|
|
2033
|
+
__param(0, (0, runtime_1.Body)()),
|
|
2034
|
+
__param(1, (0, runtime_1.Inject)())
|
|
2035
|
+
], LemmyHttp.prototype, "createMultiCommunity", null);
|
|
2036
|
+
__decorate([
|
|
2037
|
+
(0, runtime_1.Security)("bearerAuth"),
|
|
2038
|
+
(0, runtime_1.Put)("/multi_community"),
|
|
2039
|
+
(0, runtime_1.Tags)("Multicommunity"),
|
|
2040
|
+
__param(0, (0, runtime_1.Body)()),
|
|
2041
|
+
__param(1, (0, runtime_1.Inject)())
|
|
2042
|
+
], LemmyHttp.prototype, "updateMultiCommunity", null);
|
|
2043
|
+
__decorate([
|
|
2044
|
+
(0, runtime_1.Get)("/multi_community"),
|
|
2045
|
+
(0, runtime_1.Tags)("Multicommunity"),
|
|
2046
|
+
__param(0, (0, runtime_1.Queries)()),
|
|
2047
|
+
__param(1, (0, runtime_1.Inject)())
|
|
2048
|
+
], LemmyHttp.prototype, "getMultiCommunity", null);
|
|
2049
|
+
__decorate([
|
|
2050
|
+
(0, runtime_1.Security)("bearerAuth"),
|
|
2051
|
+
(0, runtime_1.Post)("/multi_community/entry"),
|
|
2052
|
+
(0, runtime_1.Tags)("Multicommunity"),
|
|
2053
|
+
__param(0, (0, runtime_1.Body)()),
|
|
2054
|
+
__param(1, (0, runtime_1.Inject)())
|
|
2055
|
+
], LemmyHttp.prototype, "createMultiCommunityEntry", null);
|
|
2056
|
+
__decorate([
|
|
2057
|
+
(0, runtime_1.Security)("bearerAuth"),
|
|
2058
|
+
(0, runtime_1.Delete)("/multi_community/entry"),
|
|
2059
|
+
(0, runtime_1.Tags)("Multicommunity"),
|
|
2060
|
+
__param(0, (0, runtime_1.Body)()),
|
|
2061
|
+
__param(1, (0, runtime_1.Inject)())
|
|
2062
|
+
], LemmyHttp.prototype, "deleteMultiCommunityEntry", null);
|
|
2063
|
+
__decorate([
|
|
2064
|
+
(0, runtime_1.Get)("/multi_community/list"),
|
|
2065
|
+
(0, runtime_1.Tags)("Multicommunity"),
|
|
2066
|
+
__param(0, (0, runtime_1.Queries)()),
|
|
2067
|
+
__param(1, (0, runtime_1.Inject)())
|
|
2068
|
+
], LemmyHttp.prototype, "listMultiCommunities", null);
|
|
2069
|
+
__decorate([
|
|
2070
|
+
(0, runtime_1.Post)("/multi_community/follow"),
|
|
2071
|
+
(0, runtime_1.Tags)("Multicommunity"),
|
|
2072
|
+
__param(0, (0, runtime_1.Body)()),
|
|
2073
|
+
__param(1, (0, runtime_1.Inject)())
|
|
2074
|
+
], LemmyHttp.prototype, "followMultiCommunity", null);
|
|
2075
|
+
__decorate([
|
|
2076
|
+
(0, runtime_1.Security)("bearerAuth"),
|
|
2077
|
+
(0, runtime_1.Put)("/community/notifications"),
|
|
2078
|
+
(0, runtime_1.Tags)("Community"),
|
|
2079
|
+
__param(0, (0, runtime_1.Body)()),
|
|
2080
|
+
__param(1, (0, runtime_1.Inject)())
|
|
2081
|
+
], LemmyHttp.prototype, "updateCommunityNotifications", null);
|
|
2082
|
+
__decorate([
|
|
2083
|
+
(0, runtime_1.Security)("bearerAuth"),
|
|
2084
|
+
(0, runtime_1.Put)("/post/notifications"),
|
|
2085
|
+
(0, runtime_1.Tags)("Post"),
|
|
2086
|
+
__param(0, (0, runtime_1.Body)()),
|
|
2087
|
+
__param(1, (0, runtime_1.Inject)())
|
|
2088
|
+
], LemmyHttp.prototype, "updatePostNotifications", null);
|
|
1909
2089
|
exports.LemmyHttp = LemmyHttp = __decorate([
|
|
1910
2090
|
(0, runtime_1.Route)("api/v4")
|
|
1911
2091
|
], LemmyHttp);
|
|
@@ -1926,3 +2106,19 @@ function createFormData(image) {
|
|
|
1926
2106
|
}
|
|
1927
2107
|
return formData;
|
|
1928
2108
|
}
|
|
2109
|
+
/**
|
|
2110
|
+
* A Lemmy error type.
|
|
2111
|
+
*
|
|
2112
|
+
* The name is the i18n translatable error code.
|
|
2113
|
+
* The msg is either an empty string, or extra non-translatable info.
|
|
2114
|
+
*/
|
|
2115
|
+
class LemmyError extends Error {
|
|
2116
|
+
constructor(name, status, msg) {
|
|
2117
|
+
super(msg ?? "");
|
|
2118
|
+
this.name = name;
|
|
2119
|
+
this.status = status;
|
|
2120
|
+
// Set the prototype explicitly.
|
|
2121
|
+
Object.setPrototypeOf(this, LemmyError.prototype);
|
|
2122
|
+
}
|
|
2123
|
+
}
|
|
2124
|
+
exports.LemmyError = LemmyError;
|