lemmy-js-client 1.0.0-error-status-code.0 → 1.0.0-error-status-public.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.
Files changed (80) hide show
  1. package/dist/http.d.ts +13 -14
  2. package/dist/http.js +5 -6
  3. package/dist/index.d.ts +7 -6
  4. package/dist/other_types.d.ts +0 -3
  5. package/dist/types/AdminBlockInstanceParams.d.ts +6 -1
  6. package/dist/types/AllLemmyErrors.d.ts +1 -0
  7. package/dist/types/AllLemmyErrors.js +117 -0
  8. package/dist/types/CommentActions.d.ts +6 -6
  9. package/dist/types/CommentReportView.d.ts +2 -0
  10. package/dist/types/CommentSortType.d.ts +1 -1
  11. package/dist/types/CommunityActions.d.ts +4 -4
  12. package/dist/types/CommunityFollowerState.d.ts +1 -1
  13. package/dist/types/CommunityNotificationsMode.d.ts +1 -1
  14. package/dist/types/CommunityReportView.d.ts +2 -0
  15. package/dist/types/CommunitySortType.d.ts +1 -1
  16. package/dist/types/CommunityVisibility.d.ts +1 -1
  17. package/dist/types/CreateCommentLike.d.ts +1 -4
  18. package/dist/types/CreateCustomEmoji.d.ts +2 -1
  19. package/dist/types/CreateCustomEmoji.js +0 -1
  20. package/dist/types/CreatePostLike.d.ts +1 -4
  21. package/dist/types/EditCustomEmoji.d.ts +7 -5
  22. package/dist/types/FederationMode.d.ts +1 -1
  23. package/dist/types/GetMultiCommunity.d.ts +2 -1
  24. package/dist/types/LemmyErrorType.d.ts +11 -13
  25. package/dist/types/LikeType.d.ts +1 -1
  26. package/dist/types/ListCommunityPendingFollows.d.ts +1 -1
  27. package/dist/types/ListCommunityPendingFollowsResponse.d.ts +2 -2
  28. package/dist/types/ListingType.d.ts +1 -1
  29. package/dist/types/LocalSite.d.ts +0 -2
  30. package/dist/types/LocalUser.d.ts +0 -4
  31. package/dist/types/MarkManyPostsAsRead.d.ts +1 -0
  32. package/dist/types/ModlogActionType.d.ts +1 -1
  33. package/dist/types/ModlogCombinedView.d.ts +18 -18
  34. package/dist/types/MultiCommunityEntry.d.ts +6 -0
  35. package/dist/types/MultiCommunityResponse.d.ts +4 -0
  36. package/dist/types/MultiCommunityView.d.ts +2 -0
  37. package/dist/types/Notification.d.ts +22 -2
  38. package/dist/types/NotificationData.d.ts +34 -4
  39. package/dist/types/NotificationDataType.d.ts +1 -1
  40. package/dist/types/NotificationType.d.ts +4 -0
  41. package/dist/types/PendingFollowerView.d.ts +9 -0
  42. package/dist/types/PersonContentCombinedView.d.ts +2 -2
  43. package/dist/types/PersonContentType.d.ts +1 -1
  44. package/dist/types/PersonLikedCombinedView.d.ts +2 -2
  45. package/dist/types/PersonResponse.d.ts +7 -0
  46. package/dist/types/PersonSavedCombinedView.d.ts +2 -2
  47. package/dist/types/Post.d.ts +4 -4
  48. package/dist/types/PostActions.d.ts +11 -11
  49. package/dist/types/PostFeatureType.d.ts +1 -1
  50. package/dist/types/PostListingMode.d.ts +1 -1
  51. package/dist/types/PostNotificationsMode.d.ts +1 -1
  52. package/dist/types/PostOrCommentOrPrivateMessage.d.ts +3 -3
  53. package/dist/types/PostReportView.d.ts +2 -0
  54. package/dist/types/PostSortType.d.ts +1 -1
  55. package/dist/types/PrivateMessageReportView.d.ts +1 -0
  56. package/dist/types/ReadableFederationState.d.ts +1 -1
  57. package/dist/types/RegistrationMode.d.ts +1 -1
  58. package/dist/types/ReportCombinedView.d.ts +4 -4
  59. package/dist/types/ReportType.d.ts +1 -1
  60. package/dist/types/SaveUserSettings.d.ts +0 -4
  61. package/dist/types/SearchCombinedView.d.ts +5 -5
  62. package/dist/types/SearchSortType.d.ts +1 -1
  63. package/dist/types/SearchType.d.ts +1 -1
  64. package/dist/types/UntranslatedError.d.ts +14 -0
  65. package/dist/types/UserSettingsBackup.d.ts +2 -0
  66. package/dist/types/VoteShow.d.ts +1 -1
  67. package/dist/types/VoteView.d.ts +1 -1
  68. package/package.json +2 -2
  69. package/dist/types/BanPersonResponse.d.ts +0 -8
  70. package/dist/types/BlockCommunityResponse.d.ts +0 -8
  71. package/dist/types/BlockPersonResponse.d.ts +0 -8
  72. package/dist/types/FederationError.d.ts +0 -12
  73. package/dist/types/GetCommunityPendingFollowsCount.d.ts +0 -4
  74. package/dist/types/NotificationTypes.d.ts +0 -4
  75. /package/dist/types/{BanPersonResponse.js → MultiCommunityEntry.js} +0 -0
  76. /package/dist/types/{BlockCommunityResponse.js → MultiCommunityResponse.js} +0 -0
  77. /package/dist/types/{FederationError.js → NotificationType.js} +0 -0
  78. /package/dist/types/{BlockPersonResponse.js → PendingFollowerView.js} +0 -0
  79. /package/dist/types/{GetCommunityPendingFollowsCount.js → PersonResponse.js} +0 -0
  80. /package/dist/types/{NotificationTypes.js → UntranslatedError.js} +0 -0
package/dist/http.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import { Controller } from "@tsoa/runtime";
2
- import { AdminListUsersI, CommunityIdQueryI, DeleteImageParamsI, GetCommentI, GetCommentsI, GetCommunityI, GetCommunityPendingFollowsCountI, GetModlogI, GetMultiCommunityI, GetPersonDetailsI, GetPostI, GetPostsI, GetRandomCommunityI, GetRegistrationApplicationI, GetReportCountI, GetSiteMetadataI, ListCommentLikesI, ListCommunitiesI, ListCommunityPendingFollowsI, ListCustomEmojisI, ListNotificationsI, ListMediaI, ListMultiCommunitiesI, ListPersonContentI, ListPersonHiddenI, ListPersonLikedI, ListPersonReadI, ListPersonSavedI, ListPostLikesI, ListRegistrationApplicationsI, ListReportsI, ListTaglinesI, ResolveObjectI, SearchI, UploadImage } from "./other_types";
2
+ import { AdminListUsersI, CommunityIdQueryI, DeleteImageParamsI, GetCommentI, GetCommentsI, GetCommunityI, GetModlogI, GetMultiCommunityI, GetPersonDetailsI, GetPostI, GetPostsI, GetRandomCommunityI, GetRegistrationApplicationI, GetReportCountI, GetSiteMetadataI, ListCommentLikesI, ListCommunitiesI, ListCommunityPendingFollowsI, ListCustomEmojisI, ListNotificationsI, ListMediaI, ListMultiCommunitiesI, ListPersonContentI, ListPersonHiddenI, ListPersonLikedI, ListPersonReadI, ListPersonSavedI, ListPostLikesI, ListRegistrationApplicationsI, ListReportsI, ListTaglinesI, ResolveObjectI, SearchI, UploadImage } from "./other_types";
3
3
  import { AddAdmin } from "./types/AddAdmin";
4
4
  import { AddAdminResponse } from "./types/AddAdminResponse";
5
5
  import { AddModToCommunity } from "./types/AddModToCommunity";
@@ -9,11 +9,8 @@ import { BanFromCommunity } from "./types/BanFromCommunity";
9
9
  import { BanFromCommunityResponse } from "./types/BanFromCommunityResponse";
10
10
  import { MarkManyPostsAsRead } from "./types/MarkManyPostsAsRead";
11
11
  import { BanPerson } from "./types/BanPerson";
12
- import { BanPersonResponse } from "./types/BanPersonResponse";
13
12
  import { BlockCommunity } from "./types/BlockCommunity";
14
- import { BlockCommunityResponse } from "./types/BlockCommunityResponse";
15
13
  import { BlockPerson } from "./types/BlockPerson";
16
- import { BlockPersonResponse } from "./types/BlockPersonResponse";
17
14
  import { ChangePassword } from "./types/ChangePassword";
18
15
  import { CommentReportResponse } from "./types/CommentReportResponse";
19
16
  import { CommentResponse } from "./types/CommentResponse";
@@ -149,6 +146,8 @@ import { ListNotificationsResponse } from "./types/ListNotificationsResponse";
149
146
  import { ModEditPost } from "./types/ModEditPost";
150
147
  import { UpdateCommunityNotifications } from "./types/UpdateCommunityNotifications";
151
148
  import { UpdatePostNotifications } from "./types/UpdatePostNotifications";
149
+ import { MultiCommunityResponse } from "./types/MultiCommunityResponse";
150
+ import { PersonResponse } from "./types/PersonResponse";
152
151
  type RequestOptions = Pick<RequestInit, "signal">;
153
152
  /**
154
153
  * Helps build lemmy HTTP requests.
@@ -271,7 +270,7 @@ export declare class LemmyHttp extends Controller {
271
270
  /**
272
271
  * @summary Get a community's pending follows count.
273
272
  */
274
- getCommunityPendingFollowsCount(form: GetCommunityPendingFollowsCountI, options?: RequestOptions): Promise<GetCommunityPendingFollowsCountResponse>;
273
+ getCommunityPendingFollowsCount(options?: RequestOptions): Promise<GetCommunityPendingFollowsCountResponse>;
275
274
  /**
276
275
  * @summary Get a community's pending followers.
277
276
  */
@@ -283,7 +282,7 @@ export declare class LemmyHttp extends Controller {
283
282
  /**
284
283
  * @summary Block a community.
285
284
  */
286
- blockCommunity(form: BlockCommunity, options?: RequestOptions): Promise<BlockCommunityResponse>;
285
+ blockCommunity(form: BlockCommunity, options?: RequestOptions): Promise<CommunityResponse>;
287
286
  /**
288
287
  * @summary Delete a community.
289
288
  */
@@ -355,7 +354,7 @@ export declare class LemmyHttp extends Controller {
355
354
  /**
356
355
  * @summary Hide a post from list views.
357
356
  */
358
- hidePost(form: HidePost, options?: RequestOptions): Promise<SuccessResponse>;
357
+ hidePost(form: HidePost, options?: RequestOptions): Promise<PostResponse>;
359
358
  /**
360
359
  * @summary A moderator can lock a post ( IE disable new comments ).
361
360
  */
@@ -495,7 +494,7 @@ export declare class LemmyHttp extends Controller {
495
494
  /**
496
495
  * @summary Ban a person from your site.
497
496
  */
498
- banPerson(form: BanPerson, options?: RequestOptions): Promise<BanPersonResponse>;
497
+ banPerson(form: BanPerson, options?: RequestOptions): Promise<PersonResponse>;
499
498
  /**
500
499
  * @summary Get a list of users.
501
500
  */
@@ -503,7 +502,7 @@ export declare class LemmyHttp extends Controller {
503
502
  /**
504
503
  * @summary Block a person.
505
504
  */
506
- blockPerson(form: BlockPerson, options?: RequestOptions): Promise<BlockPersonResponse>;
505
+ blockPerson(form: BlockPerson, options?: RequestOptions): Promise<PersonResponse>;
507
506
  /**
508
507
  * @summary Fetch a Captcha.
509
508
  */
@@ -525,7 +524,7 @@ export declare class LemmyHttp extends Controller {
525
524
  */
526
525
  markAllNotificationsAsRead(options?: RequestOptions): Promise<SuccessResponse>;
527
526
  /**
528
- * @summary Mark a comment as read.
527
+ * @summary Mark a notification as read.
529
528
  */
530
529
  markNotificationAsRead(form: MarkNotificationAsRead, options?: RequestOptions): Promise<SuccessResponse>;
531
530
  /**
@@ -752,13 +751,13 @@ export declare class LemmyHttp extends Controller {
752
751
  * Mark donation dialog as shown, so it isn't displayed anymore.
753
752
  */
754
753
  donationDialogShown(options?: RequestOptions): Promise<SuccessResponse>;
755
- createMultiCommunity(form: CreateMultiCommunity, options?: RequestOptions): Promise<GetMultiCommunityResponse>;
756
- updateMultiCommunity(form: UpdateMultiCommunity, options?: RequestOptions): Promise<SuccessResponse>;
754
+ createMultiCommunity(form: CreateMultiCommunity, options?: RequestOptions): Promise<MultiCommunityResponse>;
755
+ updateMultiCommunity(form: UpdateMultiCommunity, options?: RequestOptions): Promise<MultiCommunityResponse>;
757
756
  getMultiCommunity(form: GetMultiCommunityI, options?: RequestOptions): Promise<GetMultiCommunityResponse>;
758
- createMultiCommunityEntry(form: CreateOrDeleteMultiCommunityEntry, options?: RequestOptions): Promise<SuccessResponse>;
757
+ createMultiCommunityEntry(form: CreateOrDeleteMultiCommunityEntry, options?: RequestOptions): Promise<CommunityResponse>;
759
758
  deleteMultiCommunityEntry(form: CreateOrDeleteMultiCommunityEntry, options?: RequestOptions): Promise<SuccessResponse>;
760
759
  listMultiCommunities(form: ListMultiCommunitiesI, options?: RequestOptions): Promise<ListMultiCommunitiesResponse>;
761
- followMultiCommunity(form: FollowMultiCommunity, options?: RequestOptions): Promise<SuccessResponse>;
760
+ followMultiCommunity(form: FollowMultiCommunity, options?: RequestOptions): Promise<MultiCommunityResponse>;
762
761
  /**
763
762
  * @summary Change notification settings for a community
764
763
  */
package/dist/http.js CHANGED
@@ -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(form, options) {
209
- return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Get, "/community/pending_follows/count", form, options);
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.
@@ -587,7 +587,7 @@ let LemmyHttp = class LemmyHttp extends runtime_1.Controller {
587
587
  return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Post, "/account/mark_as_read/all", {}, options);
588
588
  }
589
589
  /**
590
- * @summary Mark a comment as read.
590
+ * @summary Mark a notification as read.
591
591
  */
592
592
  async markNotificationAsRead(form, options) {
593
593
  return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Post, "/account/mark_as_read", form, options);
@@ -1018,7 +1018,7 @@ _LemmyHttp_wrapper = async function _LemmyHttp_wrapper(type_, endpoint, form, op
1018
1018
  throw new LemmyError(response.statusText, response.status);
1019
1019
  }
1020
1020
  if (!response.ok) {
1021
- console.error(`Request error while calling ${type_} ${endpoint} with ${form}`);
1021
+ console.error(`Request error while calling ${type_} ${endpoint} with ${JSON.stringify(form)}`);
1022
1022
  let err = new LemmyError(json.error ?? response.statusText, response.status, json.message);
1023
1023
  throw err;
1024
1024
  }
@@ -1191,8 +1191,7 @@ __decorate([
1191
1191
  (0, runtime_1.Security)("bearerAuth"),
1192
1192
  (0, runtime_1.Get)("/community/pending_follows/count"),
1193
1193
  (0, runtime_1.Tags)("Community"),
1194
- __param(0, (0, runtime_1.Queries)()),
1195
- __param(1, (0, runtime_1.Inject)())
1194
+ __param(0, (0, runtime_1.Inject)())
1196
1195
  ], LemmyHttp.prototype, "getCommunityPendingFollowsCount", null);
1197
1196
  __decorate([
1198
1197
  (0, runtime_1.Security)("bearerAuth"),
package/dist/index.d.ts CHANGED
@@ -36,17 +36,15 @@ export { AdminPurgePostView } from "./types/AdminPurgePostView";
36
36
  export { AdminRemoveCommunity } from "./types/AdminRemoveCommunity";
37
37
  export { AdminRemoveCommunityId } from "./types/AdminRemoveCommunityId";
38
38
  export { AdminRemoveCommunityView } from "./types/AdminRemoveCommunityView";
39
+ export {} from "./types/AllLemmyErrors";
39
40
  export { ApproveCommunityPendingFollower } from "./types/ApproveCommunityPendingFollower";
40
41
  export { ApproveRegistrationApplication } from "./types/ApproveRegistrationApplication";
41
42
  export { AuthenticateWithOauth } from "./types/AuthenticateWithOauth";
42
43
  export { BanFromCommunity } from "./types/BanFromCommunity";
43
44
  export { BanFromCommunityResponse } from "./types/BanFromCommunityResponse";
44
45
  export { BanPerson } from "./types/BanPerson";
45
- export { BanPersonResponse } from "./types/BanPersonResponse";
46
46
  export { BlockCommunity } from "./types/BlockCommunity";
47
- export { BlockCommunityResponse } from "./types/BlockCommunityResponse";
48
47
  export { BlockPerson } from "./types/BlockPerson";
49
- export { BlockPersonResponse } from "./types/BlockPersonResponse";
50
48
  export { CaptchaResponse } from "./types/CaptchaResponse";
51
49
  export { ChangePassword } from "./types/ChangePassword";
52
50
  export { Comment } from "./types/Comment";
@@ -121,7 +119,6 @@ export { ExportDataResponse } from "./types/ExportDataResponse";
121
119
  export { FeaturePost } from "./types/FeaturePost";
122
120
  export { FederatedInstances } from "./types/FederatedInstances";
123
121
  export { FederationBlockList } from "./types/FederationBlockList";
124
- export { FederationError } from "./types/FederationError";
125
122
  export { FederationMode } from "./types/FederationMode";
126
123
  export { FollowCommunity } from "./types/FollowCommunity";
127
124
  export { FollowMultiCommunity } from "./types/FollowMultiCommunity";
@@ -132,7 +129,6 @@ export { GetComments } from "./types/GetComments";
132
129
  export { GetCommentsResponse } from "./types/GetCommentsResponse";
133
130
  export { GetCommentsSlimResponse } from "./types/GetCommentsSlimResponse";
134
131
  export { GetCommunity } from "./types/GetCommunity";
135
- export { GetCommunityPendingFollowsCount } from "./types/GetCommunityPendingFollowsCount";
136
132
  export { GetCommunityPendingFollowsCountResponse } from "./types/GetCommunityPendingFollowsCountResponse";
137
133
  export { GetCommunityResponse } from "./types/GetCommunityResponse";
138
134
  export { GetFederatedInstancesResponse } from "./types/GetFederatedInstancesResponse";
@@ -251,8 +247,10 @@ export { ModTransferCommunityView } from "./types/ModTransferCommunityView";
251
247
  export { ModlogActionType } from "./types/ModlogActionType";
252
248
  export { ModlogCombinedView } from "./types/ModlogCombinedView";
253
249
  export { MultiCommunity } from "./types/MultiCommunity";
250
+ export { MultiCommunityEntry } from "./types/MultiCommunityEntry";
254
251
  export { MultiCommunityFollow } from "./types/MultiCommunityFollow";
255
252
  export { MultiCommunityId } from "./types/MultiCommunityId";
253
+ export { MultiCommunityResponse } from "./types/MultiCommunityResponse";
256
254
  export { MultiCommunityView } from "./types/MultiCommunityView";
257
255
  export { MyUserInfo } from "./types/MyUserInfo";
258
256
  export { NotePerson } from "./types/NotePerson";
@@ -260,7 +258,7 @@ export { Notification } from "./types/Notification";
260
258
  export { NotificationData } from "./types/NotificationData";
261
259
  export { NotificationDataType } from "./types/NotificationDataType";
262
260
  export { NotificationId } from "./types/NotificationId";
263
- export { NotificationTypes } from "./types/NotificationTypes";
261
+ export { NotificationType } from "./types/NotificationType";
264
262
  export { NotificationView } from "./types/NotificationView";
265
263
  export { OAuthAccount } from "./types/OAuthAccount";
266
264
  export { OAuthProvider } from "./types/OAuthProvider";
@@ -270,12 +268,14 @@ export { PaginationCursor } from "./types/PaginationCursor";
270
268
  export { PasswordChangeAfterReset } from "./types/PasswordChangeAfterReset";
271
269
  export { PasswordReset } from "./types/PasswordReset";
272
270
  export { PendingFollow } from "./types/PendingFollow";
271
+ export { PendingFollowerView } from "./types/PendingFollowerView";
273
272
  export { Person } from "./types/Person";
274
273
  export { PersonActions } from "./types/PersonActions";
275
274
  export { PersonContentCombinedView } from "./types/PersonContentCombinedView";
276
275
  export { PersonContentType } from "./types/PersonContentType";
277
276
  export { PersonId } from "./types/PersonId";
278
277
  export { PersonLikedCombinedView } from "./types/PersonLikedCombinedView";
278
+ export { PersonResponse } from "./types/PersonResponse";
279
279
  export { PersonSavedCombinedView } from "./types/PersonSavedCombinedView";
280
280
  export { PersonView } from "./types/PersonView";
281
281
  export { PluginMetadata } from "./types/PluginMetadata";
@@ -345,6 +345,7 @@ export { TaglineId } from "./types/TaglineId";
345
345
  export { TaglineResponse } from "./types/TaglineResponse";
346
346
  export { TagsView } from "./types/TagsView";
347
347
  export { TransferCommunity } from "./types/TransferCommunity";
348
+ export { UntranslatedError } from "./types/UntranslatedError";
348
349
  export { UpdateCommunityNotifications } from "./types/UpdateCommunityNotifications";
349
350
  export { UpdateCommunityTag } from "./types/UpdateCommunityTag";
350
351
  export { UpdateMultiCommunity } from "./types/UpdateMultiCommunity";
@@ -4,7 +4,6 @@ import { DeleteImageParams } from "./types/DeleteImageParams";
4
4
  import { GetComment } from "./types/GetComment";
5
5
  import { GetComments } from "./types/GetComments";
6
6
  import { GetCommunity } from "./types/GetCommunity";
7
- import { GetCommunityPendingFollowsCount } from "./types/GetCommunityPendingFollowsCount";
8
7
  import { GetModlog } from "./types/GetModlog";
9
8
  import { GetMultiCommunity } from "./types/GetMultiCommunity";
10
9
  import { GetPersonDetails } from "./types/GetPersonDetails";
@@ -48,8 +47,6 @@ export interface GetCommunityI extends GetCommunity {
48
47
  }
49
48
  export interface ListCommunitiesI extends ListCommunities {
50
49
  }
51
- export interface GetCommunityPendingFollowsCountI extends GetCommunityPendingFollowsCount {
52
- }
53
50
  export interface ListCommunityPendingFollowsI extends ListCommunityPendingFollows {
54
51
  }
55
52
  export interface GetRandomCommunityI extends GetRandomCommunity {
@@ -2,5 +2,10 @@ export type AdminBlockInstanceParams = {
2
2
  instance: string;
3
3
  block: boolean;
4
4
  reason: string;
5
- expires_at?: string;
5
+ /**
6
+ * A time that the block will expire, in unix epoch seconds.
7
+ *
8
+ * An i64 unix timestamp is used for a simpler API client implementation.
9
+ */
10
+ expires_at?: number;
6
11
  };
@@ -0,0 +1 @@
1
+ export declare const AllLemmyErrors: string[];
@@ -0,0 +1,117 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.AllLemmyErrors = void 0;
4
+ exports.AllLemmyErrors = [
5
+ "block_keyword_too_short",
6
+ "block_keyword_too_long",
7
+ "couldnt_update",
8
+ "couldnt_create",
9
+ "report_reason_required",
10
+ "report_too_long",
11
+ "not_a_moderator",
12
+ "not_an_admin",
13
+ "cant_block_yourself",
14
+ "cant_note_yourself",
15
+ "cant_block_admin",
16
+ "passwords_do_not_match",
17
+ "email_not_verified",
18
+ "email_required",
19
+ "cannot_leave_admin",
20
+ "cannot_leave_mod",
21
+ "cannot_leave_mod",
22
+ "cannot_leave_mod",
23
+ "pictrs_api_key_not_provided",
24
+ "pictrs_api_key_not_provided",
25
+ "no_content_type_header",
26
+ "not_an_image_type",
27
+ "image_upload_disabled",
28
+ "not_a_mod_or_admin",
29
+ "not_top_mod",
30
+ "not_logged_in",
31
+ "not_higher_mod",
32
+ "not_higher_admin",
33
+ "site_ban",
34
+ "deleted",
35
+ "person_is_blocked",
36
+ "community_is_blocked",
37
+ "instance_is_blocked",
38
+ "instance_is_private",
39
+ "invalid_password",
40
+ "site_description_length_overflow",
41
+ "honeypot_failed",
42
+ "registration_application_is_pending",
43
+ "locked",
44
+ "max_comment_depth_reached",
45
+ "no_comment_edit_allowed",
46
+ "only_admins_can_create_communities",
47
+ "already_exists",
48
+ "language_not_allowed",
49
+ "no_post_edit_allowed",
50
+ "nsfw_not_allowed",
51
+ "edit_private_message_not_allowed",
52
+ "application_question_required",
53
+ "invalid_default_post_listing_type",
54
+ "registration_closed",
55
+ "registration_application_answer_required",
56
+ "registration_username_required",
57
+ "email_already_taken",
58
+ "username_already_taken",
59
+ "person_is_banned_from_community",
60
+ "no_id_given",
61
+ "incorrect_login",
62
+ "no_email_setup",
63
+ "local_site_not_setup",
64
+ "local_site_not_setup",
65
+ "invalid_name",
66
+ "invalid_code_verifier",
67
+ "invalid_display_name",
68
+ "invalid_matrix_id",
69
+ "invalid_post_title",
70
+ "invalid_body_field",
71
+ "bio_length_overflow",
72
+ "alt_text_length_overflow",
73
+ "couldnt_parse_totp_secret",
74
+ "couldnt_generate_totp",
75
+ "missing_totp_token",
76
+ "missing_totp_secret",
77
+ "incorrect_totp_token",
78
+ "totp_already_enabled",
79
+ "blocked_url",
80
+ "invalid_url",
81
+ "email_send_failed",
82
+ "slurs",
83
+ "slurs",
84
+ "site_name_required",
85
+ "site_name_length_overflow",
86
+ "permissive_regex",
87
+ "invalid_regex",
88
+ "captcha_incorrect",
89
+ "couldnt_create_audio_captcha",
90
+ "couldnt_create_image_captcha",
91
+ "invalid_url_scheme",
92
+ "contradicting_filters",
93
+ "too_many_items",
94
+ "ban_expiration_in_past",
95
+ "invalid_unix_time",
96
+ "invalid_bot_action",
97
+ "tag_not_in_community",
98
+ "cant_block_local_instance",
99
+ "cant_block_local_instance",
100
+ "url_length_overflow",
101
+ "oauth_authorization_invalid",
102
+ "oauth_login_failed",
103
+ "oauth_registration_closed",
104
+ "not_found",
105
+ "post_schedule_time_must_be_in_future",
106
+ "too_many_scheduled_posts",
107
+ "cannot_combine_federation_blocklist_and_allowlist",
108
+ "cannot_combine_federation_blocklist_and_allowlist",
109
+ "couldnt_parse_pagination_token",
110
+ "couldnt_parse_pagination_token",
111
+ "invalid_fetch_limit",
112
+ "email_notifications_disabled",
113
+ "multi_community_update_wrong_user",
114
+ "cannot_combine_community_id_and_multi_community_id",
115
+ "multi_community_entry_limit_reached",
116
+ "too_many_requests",
117
+ ];
@@ -1,14 +1,14 @@
1
1
  export type CommentActions = {
2
2
  /**
3
- * The like / score for the comment.
3
+ * When the comment was upvoted or downvoted.
4
4
  */
5
- like_score?: number;
6
- /**
7
- * When the comment was liked.
8
- */
9
- liked_at?: string;
5
+ voted_at?: string;
10
6
  /**
11
7
  * When the comment was saved.
12
8
  */
13
9
  saved_at?: string;
10
+ /**
11
+ * True if upvoted, false if downvoted. Upvote is greater than downvote.
12
+ */
13
+ vote_is_upvote?: boolean;
14
14
  };
@@ -23,5 +23,7 @@ export type CommentReportView = {
23
23
  creator_is_admin: boolean;
24
24
  creator_is_moderator: boolean;
25
25
  creator_banned: boolean;
26
+ creator_ban_expires_at?: string;
26
27
  creator_banned_from_community: boolean;
28
+ creator_community_ban_expires_at?: string;
27
29
  };
@@ -1,4 +1,4 @@
1
1
  /**
2
2
  * The comment sort types. See here for descriptions: https://join-lemmy.org/docs/en/users/03-votes-and-ranking.html
3
3
  */
4
- export type CommentSortType = "Hot" | "Top" | "New" | "Old" | "Controversial";
4
+ export type CommentSortType = "hot" | "top" | "new" | "old" | "controversial";
@@ -5,10 +5,6 @@ export type CommunityActions = {
5
5
  * When the community was followed.
6
6
  */
7
7
  followed_at?: string;
8
- /**
9
- * The state of the community follow.
10
- */
11
- follow_state?: CommunityFollowerState;
12
8
  /**
13
9
  * When the community was blocked.
14
10
  */
@@ -25,5 +21,9 @@ export type CommunityActions = {
25
21
  * When their ban expires.
26
22
  */
27
23
  ban_expires_at?: string;
24
+ /**
25
+ * The state of the community follow.
26
+ */
27
+ follow_state?: CommunityFollowerState;
28
28
  notifications?: CommunityNotificationsMode;
29
29
  };
@@ -1 +1 @@
1
- export type CommunityFollowerState = "Accepted" | "Pending" | "ApprovalRequired";
1
+ export type CommunityFollowerState = "accepted" | "pending" | "approval_required" | "denied";
@@ -1,4 +1,4 @@
1
1
  /**
2
2
  * Available settings for community notifications
3
3
  */
4
- export type CommunityNotificationsMode = "AllPostsAndComments" | "AllPosts" | "RepliesAndMentions" | "Mute";
4
+ export type CommunityNotificationsMode = "all_posts_and_comments" | "all_posts" | "replies_and_mentions" | "mute";
@@ -12,5 +12,7 @@ export type CommunityReportView = {
12
12
  creator_is_admin: boolean;
13
13
  creator_is_moderator: boolean;
14
14
  creator_banned: boolean;
15
+ creator_ban_expires_at?: string;
15
16
  creator_banned_from_community: boolean;
17
+ creator_community_ban_expires_at?: string;
16
18
  };
@@ -1,4 +1,4 @@
1
1
  /**
2
2
  * The community sort types. See here for descriptions: https://join-lemmy.org/docs/en/users/03-votes-and-ranking.html
3
3
  */
4
- export type CommunitySortType = "ActiveSixMonths" | "ActiveMonthly" | "ActiveWeekly" | "ActiveDaily" | "Hot" | "New" | "Old" | "NameAsc" | "NameDesc" | "Comments" | "Posts" | "Subscribers" | "SubscribersLocal";
4
+ export type CommunitySortType = "active_six_months" | "active_monthly" | "active_weekly" | "active_daily" | "hot" | "new" | "old" | "name_asc" | "name_desc" | "comments" | "posts" | "subscribers" | "subscribers_local";
@@ -1,4 +1,4 @@
1
1
  /**
2
2
  * Defines who can browse and interact with content in a community.
3
3
  */
4
- export type CommunityVisibility = "Public" | "Unlisted" | "LocalOnlyPublic" | "LocalOnlyPrivate" | "Private";
4
+ export type CommunityVisibility = "public" | "unlisted" | "local_only_public" | "local_only_private" | "private";
@@ -4,8 +4,5 @@ import type { CommentId } from "./CommentId";
4
4
  */
5
5
  export type CreateCommentLike = {
6
6
  comment_id: CommentId;
7
- /**
8
- * Must be -1, 0, or 1 .
9
- */
10
- score: number;
7
+ is_upvote?: boolean;
11
8
  };
@@ -1,10 +1,11 @@
1
+ import type { DbUrl } from "./DbUrl";
1
2
  /**
2
3
  * Create a custom emoji.
3
4
  */
4
5
  export type CreateCustomEmoji = {
5
6
  category: string;
6
7
  shortcode: string;
7
- image_url: string;
8
+ image_url: DbUrl;
8
9
  alt_text: string;
9
10
  keywords: Array<string>;
10
11
  };
@@ -1,3 +1,2 @@
1
1
  "use strict";
2
- // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
3
2
  Object.defineProperty(exports, "__esModule", { value: true });
@@ -4,8 +4,5 @@ import type { PostId } from "./PostId";
4
4
  */
5
5
  export type CreatePostLike = {
6
6
  post_id: PostId;
7
- /**
8
- * Score must be -1, 0, or 1.
9
- */
10
- score: number;
7
+ is_upvote?: boolean;
11
8
  };
@@ -1,11 +1,13 @@
1
1
  import type { CustomEmojiId } from "./CustomEmojiId";
2
+ import type { DbUrl } from "./DbUrl";
2
3
  /**
3
- * Edit a custom emoji.
4
+ * Edit a custom emoji.
4
5
  */
5
6
  export type EditCustomEmoji = {
6
7
  id: CustomEmojiId;
7
- category: string;
8
- image_url: string;
9
- alt_text: string;
10
- keywords: Array<string>;
8
+ category?: string;
9
+ shortcode?: string;
10
+ image_url?: DbUrl;
11
+ alt_text?: string;
12
+ keywords?: Array<string>;
11
13
  };
@@ -1,4 +1,4 @@
1
1
  /**
2
2
  * The federation mode for an item
3
3
  */
4
- export type FederationMode = "All" | "Local" | "Disable";
4
+ export type FederationMode = "all" | "local" | "disable";
@@ -1,4 +1,5 @@
1
1
  import type { MultiCommunityId } from "./MultiCommunityId";
2
2
  export type GetMultiCommunity = {
3
- id: MultiCommunityId;
3
+ id?: MultiCommunityId;
4
+ name?: string;
4
5
  };
@@ -1,4 +1,7 @@
1
- import type { FederationError } from "./FederationError";
1
+ import type { UntranslatedError } from "./UntranslatedError";
2
+ /**
3
+ * Errors used in the API, all of these are translated in lemmy-ui.
4
+ */
2
5
  export type LemmyErrorType = {
3
6
  error: "block_keyword_too_short";
4
7
  } | {
@@ -37,18 +40,15 @@ export type LemmyErrorType = {
37
40
  } | {
38
41
  error: "pictrs_purge_response_error";
39
42
  message: string;
40
- } | {
41
- error: "image_url_missing_path_segments";
42
- } | {
43
- error: "image_url_missing_last_path_segment";
44
43
  } | {
45
44
  error: "pictrs_api_key_not_provided";
45
+ } | {
46
+ error: "pictrs_invalid_image_upload";
47
+ message: string;
46
48
  } | {
47
49
  error: "no_content_type_header";
48
50
  } | {
49
51
  error: "not_an_image_type";
50
- } | {
51
- error: "invalid_image_upload";
52
52
  } | {
53
53
  error: "image_upload_disabled";
54
54
  } | {
@@ -183,8 +183,6 @@ export type LemmyErrorType = {
183
183
  error: "couldnt_create_image_captcha";
184
184
  } | {
185
185
  error: "invalid_url_scheme";
186
- } | {
187
- error: "couldnt_send_webmention";
188
186
  } | {
189
187
  error: "contradicting_filters";
190
188
  } | {
@@ -212,8 +210,6 @@ export type LemmyErrorType = {
212
210
  error: "oauth_registration_closed";
213
211
  } | {
214
212
  error: "not_found";
215
- } | {
216
- error: "community_has_no_followers";
217
213
  } | {
218
214
  error: "post_schedule_time_must_be_in_future";
219
215
  } | {
@@ -221,9 +217,9 @@ export type LemmyErrorType = {
221
217
  } | {
222
218
  error: "cannot_combine_federation_blocklist_and_allowlist";
223
219
  } | {
224
- error: "federation_error";
220
+ error: "untranslated_error";
225
221
  message: {
226
- error?: FederationError;
222
+ error?: UntranslatedError;
227
223
  };
228
224
  } | {
229
225
  error: "couldnt_parse_pagination_token";
@@ -240,4 +236,6 @@ export type LemmyErrorType = {
240
236
  error: "cannot_combine_community_id_and_multi_community_id";
241
237
  } | {
242
238
  error: "multi_community_entry_limit_reached";
239
+ } | {
240
+ error: "too_many_requests";
243
241
  };
@@ -1,4 +1,4 @@
1
1
  /**
2
2
  * The like_type for a persons liked content.
3
3
  */
4
- export type LikeType = "All" | "LikedOnly" | "DislikedOnly";
4
+ export type LikeType = "all" | "liked_only" | "disliked_only";
@@ -3,7 +3,7 @@ export type ListCommunityPendingFollows = {
3
3
  /**
4
4
  * Only shows the unapproved applications
5
5
  */
6
- pending_only?: boolean;
6
+ unread_only?: boolean;
7
7
  all_communities?: boolean;
8
8
  page_cursor?: PaginationCursor;
9
9
  page_back?: boolean;
@@ -1,7 +1,7 @@
1
1
  import type { PaginationCursor } from "./PaginationCursor";
2
- import type { PendingFollow } from "./PendingFollow";
2
+ import type { PendingFollowerView } from "./PendingFollowerView";
3
3
  export type ListCommunityPendingFollowsResponse = {
4
- items: Array<PendingFollow>;
4
+ items: Array<PendingFollowerView>;
5
5
  /**
6
6
  * the pagination cursor to use to fetch the next page
7
7
  */
@@ -1,4 +1,4 @@
1
1
  /**
2
2
  * A listing type for post and comment list fetches.
3
3
  */
4
- export type ListingType = "All" | "Local" | "Subscribed" | "ModeratorView" | "Suggested";
4
+ export type ListingType = "all" | "local" | "subscribed" | "moderator_view" | "suggested";