lemmy-js-client 1.0.0-emoji-shortcode.2 → 1.0.0-enum-for-api.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (34) hide show
  1. package/dist/http.d.ts +8 -10
  2. package/dist/http.js +3 -3
  3. package/dist/index.d.ts +4 -4
  4. package/dist/types/AllLemmyErrors.d.ts +1 -1
  5. package/dist/types/AllLemmyErrors.js +5 -8
  6. package/dist/types/CommentReportView.d.ts +2 -0
  7. package/dist/types/CommunityReportView.d.ts +2 -0
  8. package/dist/types/GetComments.d.ts +5 -2
  9. package/dist/types/GetCommunity.d.ts +4 -4
  10. package/dist/types/GetMultiCommunity.d.ts +2 -1
  11. package/dist/types/GetPersonDetails.d.ts +3 -5
  12. package/dist/types/GetPosts.d.ts +6 -3
  13. package/dist/types/LemmyErrorType.d.ts +11 -15
  14. package/dist/types/ListPersonContent.d.ts +3 -5
  15. package/dist/types/MultiCommunityResponse.d.ts +4 -0
  16. package/dist/types/MultiCommunityView.d.ts +2 -0
  17. package/dist/types/NameOrId.d.ts +4 -0
  18. package/dist/types/Notification.d.ts +20 -0
  19. package/dist/types/NotificationData.d.ts +31 -1
  20. package/dist/types/NotificationType.d.ts +1 -1
  21. package/dist/types/PersonResponse.d.ts +7 -0
  22. package/dist/types/PostReportView.d.ts +2 -0
  23. package/dist/types/PrivateMessageReportView.d.ts +1 -0
  24. package/dist/types/UntranslatedError.d.ts +12 -0
  25. package/dist/types/UntranslatedError.js +3 -0
  26. package/package.json +2 -2
  27. package/dist/types/BanPersonResponse.d.ts +0 -8
  28. package/dist/types/BlockCommunityResponse.d.ts +0 -8
  29. package/dist/types/BlockPersonResponse.d.ts +0 -8
  30. package/dist/types/BlockPersonResponse.js +0 -2
  31. package/dist/types/FederationError.d.ts +0 -12
  32. /package/dist/types/{BanPersonResponse.js → MultiCommunityResponse.js} +0 -0
  33. /package/dist/types/{FederationError.js → NameOrId.js} +0 -0
  34. /package/dist/types/{BlockCommunityResponse.js → PersonResponse.js} +0 -0
package/dist/http.d.ts CHANGED
@@ -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,7 @@ 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 { PersonResponse } from "./types/PersonResponse";
152
150
  type RequestOptions = Pick<RequestInit, "signal">;
153
151
  /**
154
152
  * Helps build lemmy HTTP requests.
@@ -255,7 +253,7 @@ export declare class LemmyHttp extends Controller {
255
253
  /**
256
254
  * @summary Get / fetch a community.
257
255
  */
258
- getCommunity(form?: GetCommunityI, options?: RequestOptions): Promise<GetCommunityResponse>;
256
+ getCommunity(form: GetCommunityI, options?: RequestOptions): Promise<GetCommunityResponse>;
259
257
  /**
260
258
  * @summary Edit a community.
261
259
  */
@@ -283,7 +281,7 @@ export declare class LemmyHttp extends Controller {
283
281
  /**
284
282
  * @summary Block a community.
285
283
  */
286
- blockCommunity(form: BlockCommunity, options?: RequestOptions): Promise<BlockCommunityResponse>;
284
+ blockCommunity(form: BlockCommunity, options?: RequestOptions): Promise<CommunityResponse>;
287
285
  /**
288
286
  * @summary Delete a community.
289
287
  */
@@ -355,7 +353,7 @@ export declare class LemmyHttp extends Controller {
355
353
  /**
356
354
  * @summary Hide a post from list views.
357
355
  */
358
- hidePost(form: HidePost, options?: RequestOptions): Promise<SuccessResponse>;
356
+ hidePost(form: HidePost, options?: RequestOptions): Promise<PostResponse>;
359
357
  /**
360
358
  * @summary A moderator can lock a post ( IE disable new comments ).
361
359
  */
@@ -483,11 +481,11 @@ export declare class LemmyHttp extends Controller {
483
481
  /**
484
482
  * @summary Get the details for a person.
485
483
  */
486
- getPersonDetails(form?: GetPersonDetailsI, options?: RequestOptions): Promise<GetPersonDetailsResponse>;
484
+ getPersonDetails(form: GetPersonDetailsI, options?: RequestOptions): Promise<GetPersonDetailsResponse>;
487
485
  /**
488
486
  * @summary List the content for a person.
489
487
  */
490
- listPersonContent(form?: ListPersonContentI, options?: RequestOptions): Promise<ListPersonContentResponse>;
488
+ listPersonContent(form: ListPersonContentI, options?: RequestOptions): Promise<ListPersonContentResponse>;
491
489
  /**
492
490
  * @summary Make a note for a person.
493
491
  */
@@ -495,7 +493,7 @@ export declare class LemmyHttp extends Controller {
495
493
  /**
496
494
  * @summary Ban a person from your site.
497
495
  */
498
- banPerson(form: BanPerson, options?: RequestOptions): Promise<BanPersonResponse>;
496
+ banPerson(form: BanPerson, options?: RequestOptions): Promise<PersonResponse>;
499
497
  /**
500
498
  * @summary Get a list of users.
501
499
  */
@@ -503,7 +501,7 @@ export declare class LemmyHttp extends Controller {
503
501
  /**
504
502
  * @summary Block a person.
505
503
  */
506
- blockPerson(form: BlockPerson, options?: RequestOptions): Promise<BlockPersonResponse>;
504
+ blockPerson(form: BlockPerson, options?: RequestOptions): Promise<PersonResponse>;
507
505
  /**
508
506
  * @summary Fetch a Captcha.
509
507
  */
package/dist/http.js CHANGED
@@ -181,7 +181,7 @@ let LemmyHttp = class LemmyHttp extends runtime_1.Controller {
181
181
  /**
182
182
  * @summary Get / fetch a community.
183
183
  */
184
- async getCommunity(form = {}, options) {
184
+ async getCommunity(form, options) {
185
185
  return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Get, "/community", form, options);
186
186
  }
187
187
  /**
@@ -523,13 +523,13 @@ let LemmyHttp = class LemmyHttp extends runtime_1.Controller {
523
523
  /**
524
524
  * @summary Get the details for a person.
525
525
  */
526
- async getPersonDetails(form = {}, options) {
526
+ async getPersonDetails(form, options) {
527
527
  return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Get, "/person", form, options);
528
528
  }
529
529
  /**
530
530
  * @summary List the content for a person.
531
531
  */
532
- async listPersonContent(form = {}, options) {
532
+ async listPersonContent(form, options) {
533
533
  return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Get, "/person/content", form, options);
534
534
  }
535
535
  /**
package/dist/index.d.ts CHANGED
@@ -43,11 +43,8 @@ export { AuthenticateWithOauth } from "./types/AuthenticateWithOauth";
43
43
  export { BanFromCommunity } from "./types/BanFromCommunity";
44
44
  export { BanFromCommunityResponse } from "./types/BanFromCommunityResponse";
45
45
  export { BanPerson } from "./types/BanPerson";
46
- export { BanPersonResponse } from "./types/BanPersonResponse";
47
46
  export { BlockCommunity } from "./types/BlockCommunity";
48
- export { BlockCommunityResponse } from "./types/BlockCommunityResponse";
49
47
  export { BlockPerson } from "./types/BlockPerson";
50
- export { BlockPersonResponse } from "./types/BlockPersonResponse";
51
48
  export { CaptchaResponse } from "./types/CaptchaResponse";
52
49
  export { ChangePassword } from "./types/ChangePassword";
53
50
  export { Comment } from "./types/Comment";
@@ -122,7 +119,6 @@ export { ExportDataResponse } from "./types/ExportDataResponse";
122
119
  export { FeaturePost } from "./types/FeaturePost";
123
120
  export { FederatedInstances } from "./types/FederatedInstances";
124
121
  export { FederationBlockList } from "./types/FederationBlockList";
125
- export { FederationError } from "./types/FederationError";
126
122
  export { FederationMode } from "./types/FederationMode";
127
123
  export { FollowCommunity } from "./types/FollowCommunity";
128
124
  export { FollowMultiCommunity } from "./types/FollowMultiCommunity";
@@ -254,8 +250,10 @@ export { ModlogCombinedView } from "./types/ModlogCombinedView";
254
250
  export { MultiCommunity } from "./types/MultiCommunity";
255
251
  export { MultiCommunityFollow } from "./types/MultiCommunityFollow";
256
252
  export { MultiCommunityId } from "./types/MultiCommunityId";
253
+ export { MultiCommunityResponse } from "./types/MultiCommunityResponse";
257
254
  export { MultiCommunityView } from "./types/MultiCommunityView";
258
255
  export { MyUserInfo } from "./types/MyUserInfo";
256
+ export { NameOrId } from "./types/NameOrId";
259
257
  export { NotePerson } from "./types/NotePerson";
260
258
  export { Notification } from "./types/Notification";
261
259
  export { NotificationData } from "./types/NotificationData";
@@ -277,6 +275,7 @@ export { PersonContentCombinedView } from "./types/PersonContentCombinedView";
277
275
  export { PersonContentType } from "./types/PersonContentType";
278
276
  export { PersonId } from "./types/PersonId";
279
277
  export { PersonLikedCombinedView } from "./types/PersonLikedCombinedView";
278
+ export { PersonResponse } from "./types/PersonResponse";
280
279
  export { PersonSavedCombinedView } from "./types/PersonSavedCombinedView";
281
280
  export { PersonView } from "./types/PersonView";
282
281
  export { PluginMetadata } from "./types/PluginMetadata";
@@ -346,6 +345,7 @@ export { TaglineId } from "./types/TaglineId";
346
345
  export { TaglineResponse } from "./types/TaglineResponse";
347
346
  export { TagsView } from "./types/TagsView";
348
347
  export { TransferCommunity } from "./types/TransferCommunity";
348
+ export { UntranslatedError } from "./types/UntranslatedError";
349
349
  export { UpdateCommunityNotifications } from "./types/UpdateCommunityNotifications";
350
350
  export { UpdateCommunityTag } from "./types/UpdateCommunityTag";
351
351
  export { UpdateMultiCommunity } from "./types/UpdateMultiCommunity";
@@ -1 +1 @@
1
- export declare let AllLemmyErrors: string[];
1
+ export declare const AllLemmyErrors: string[];
@@ -17,14 +17,13 @@ exports.AllLemmyErrors = [
17
17
  "email_not_verified",
18
18
  "email_required",
19
19
  "cannot_leave_admin",
20
- "cannot_leave_admin",
21
- "cannot_leave_admin",
22
- "image_url_missing_path_segments",
23
- "image_url_missing_last_path_segment",
20
+ "cannot_leave_mod",
21
+ "cannot_leave_mod",
22
+ "cannot_leave_mod",
23
+ "pictrs_api_key_not_provided",
24
24
  "pictrs_api_key_not_provided",
25
25
  "no_content_type_header",
26
26
  "not_an_image_type",
27
- "invalid_image_upload",
28
27
  "image_upload_disabled",
29
28
  "not_a_mod_or_admin",
30
29
  "not_top_mod",
@@ -58,7 +57,6 @@ exports.AllLemmyErrors = [
58
57
  "email_already_taken",
59
58
  "username_already_taken",
60
59
  "person_is_banned_from_community",
61
- "no_id_given",
62
60
  "incorrect_login",
63
61
  "no_email_setup",
64
62
  "local_site_not_setup",
@@ -90,7 +88,6 @@ exports.AllLemmyErrors = [
90
88
  "couldnt_create_audio_captcha",
91
89
  "couldnt_create_image_captcha",
92
90
  "invalid_url_scheme",
93
- "couldnt_send_webmention",
94
91
  "contradicting_filters",
95
92
  "too_many_items",
96
93
  "ban_expiration_in_past",
@@ -104,7 +101,6 @@ exports.AllLemmyErrors = [
104
101
  "oauth_login_failed",
105
102
  "oauth_registration_closed",
106
103
  "not_found",
107
- "community_has_no_followers",
108
104
  "post_schedule_time_must_be_in_future",
109
105
  "too_many_scheduled_posts",
110
106
  "cannot_combine_federation_blocklist_and_allowlist",
@@ -116,4 +112,5 @@ exports.AllLemmyErrors = [
116
112
  "multi_community_update_wrong_user",
117
113
  "cannot_combine_community_id_and_multi_community_id",
118
114
  "multi_community_entry_limit_reached",
115
+ "too_many_requests",
119
116
  ];
@@ -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
  };
@@ -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
  };
@@ -2,6 +2,7 @@ import type { CommentId } from "./CommentId";
2
2
  import type { CommentSortType } from "./CommentSortType";
3
3
  import type { CommunityId } from "./CommunityId";
4
4
  import type { ListingType } from "./ListingType";
5
+ import type { NameOrId } from "./NameOrId";
5
6
  import type { PaginationCursor } from "./PaginationCursor";
6
7
  import type { PostId } from "./PostId";
7
8
  /**
@@ -19,8 +20,10 @@ export type GetComments = {
19
20
  page_cursor?: PaginationCursor;
20
21
  page_back?: boolean;
21
22
  limit?: number;
22
- community_id?: CommunityId;
23
- community_name?: string;
23
+ /**
24
+ * Example: `star_trek`, or `star_trek@xyz.tld` or `12`
25
+ */
26
+ community_name_or_id?: NameOrId<CommunityId>;
24
27
  post_id?: PostId;
25
28
  parent_id?: CommentId;
26
29
  };
@@ -1,11 +1,11 @@
1
1
  import type { CommunityId } from "./CommunityId";
2
+ import type { NameOrId } from "./NameOrId";
2
3
  /**
3
- * Get a community. Must provide either an id, or a name.
4
+ * Get a community. Must provide either an id, or a name (eg star_trek or star_trek@xyz.tld).
4
5
  */
5
6
  export type GetCommunity = {
6
- id?: CommunityId;
7
7
  /**
8
- * Example: star_trek , or star_trek@xyz.tld
8
+ * Example: `star_trek`, or `star_trek@xyz.tld` or `12`
9
9
  */
10
- name?: string;
10
+ name_or_id: NameOrId<CommunityId>;
11
11
  };
@@ -1,4 +1,5 @@
1
1
  import type { MultiCommunityId } from "./MultiCommunityId";
2
+ import type { NameOrId } from "./NameOrId";
2
3
  export type GetMultiCommunity = {
3
- id: MultiCommunityId;
4
+ name_or_id: NameOrId<MultiCommunityId>;
4
5
  };
@@ -1,13 +1,11 @@
1
+ import type { NameOrId } from "./NameOrId";
1
2
  import type { PersonId } from "./PersonId";
2
3
  /**
3
4
  * Gets a person's details.
4
- *
5
- * Either person_id, or username are required.
6
5
  */
7
6
  export type GetPersonDetails = {
8
- person_id?: PersonId;
9
7
  /**
10
- * Example: dessalines , or dessalines@xyz.tld
8
+ * Example: `dessalines`, or `dessalines@xyz.tld`, or `12`
11
9
  */
12
- username?: string;
10
+ person_name_or_id: NameOrId<PersonId>;
13
11
  };
@@ -1,6 +1,7 @@
1
1
  import type { CommunityId } from "./CommunityId";
2
2
  import type { ListingType } from "./ListingType";
3
3
  import type { MultiCommunityId } from "./MultiCommunityId";
4
+ import type { NameOrId } from "./NameOrId";
4
5
  import type { PaginationCursor } from "./PaginationCursor";
5
6
  import type { PostSortType } from "./PostSortType";
6
7
  /**
@@ -15,9 +16,11 @@ export type GetPosts = {
15
16
  * Use Zero to override the local_site and local_user time_range.
16
17
  */
17
18
  time_range_seconds?: number;
18
- community_id?: CommunityId;
19
- community_name?: string;
20
- multi_community_id?: MultiCommunityId;
19
+ /**
20
+ * Example: `star_trek`, or `star_trek@xyz.tld` or `12`
21
+ */
22
+ community_name_or_id?: NameOrId<CommunityId>;
23
+ multi_community_name_or_id?: NameOrId<MultiCommunityId>;
21
24
  show_hidden?: boolean;
22
25
  /**
23
26
  * If true, then show the read posts (even if your user setting is to hide them)
@@ -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
  } | {
@@ -115,8 +115,6 @@ export type LemmyErrorType = {
115
115
  error: "username_already_taken";
116
116
  } | {
117
117
  error: "person_is_banned_from_community";
118
- } | {
119
- error: "no_id_given";
120
118
  } | {
121
119
  error: "incorrect_login";
122
120
  } | {
@@ -183,8 +181,6 @@ export type LemmyErrorType = {
183
181
  error: "couldnt_create_image_captcha";
184
182
  } | {
185
183
  error: "invalid_url_scheme";
186
- } | {
187
- error: "couldnt_send_webmention";
188
184
  } | {
189
185
  error: "contradicting_filters";
190
186
  } | {
@@ -212,8 +208,6 @@ export type LemmyErrorType = {
212
208
  error: "oauth_registration_closed";
213
209
  } | {
214
210
  error: "not_found";
215
- } | {
216
- error: "community_has_no_followers";
217
211
  } | {
218
212
  error: "post_schedule_time_must_be_in_future";
219
213
  } | {
@@ -221,9 +215,9 @@ export type LemmyErrorType = {
221
215
  } | {
222
216
  error: "cannot_combine_federation_blocklist_and_allowlist";
223
217
  } | {
224
- error: "federation_error";
218
+ error: "untranslated_error";
225
219
  message: {
226
- error?: FederationError;
220
+ error?: UntranslatedError;
227
221
  };
228
222
  } | {
229
223
  error: "couldnt_parse_pagination_token";
@@ -240,4 +234,6 @@ export type LemmyErrorType = {
240
234
  error: "cannot_combine_community_id_and_multi_community_id";
241
235
  } | {
242
236
  error: "multi_community_entry_limit_reached";
237
+ } | {
238
+ error: "too_many_requests";
243
239
  };
@@ -1,18 +1,16 @@
1
+ import type { NameOrId } from "./NameOrId";
1
2
  import type { PaginationCursor } from "./PaginationCursor";
2
3
  import type { PersonContentType } from "./PersonContentType";
3
4
  import type { PersonId } from "./PersonId";
4
5
  /**
5
6
  * Gets a person's content (posts and comments)
6
- *
7
- * Either person_id, or username are required.
8
7
  */
9
8
  export type ListPersonContent = {
10
9
  type_?: PersonContentType;
11
- person_id?: PersonId;
12
10
  /**
13
- * Example: dessalines , or dessalines@xyz.tld
11
+ * Example: `dessalines`, or `dessalines@xyz.tld`, or `12`
14
12
  */
15
- username?: string;
13
+ person_name_or_id: NameOrId<PersonId>;
16
14
  page_cursor?: PaginationCursor;
17
15
  page_back?: boolean;
18
16
  limit?: number;
@@ -0,0 +1,4 @@
1
+ import type { MultiCommunityView } from "./MultiCommunityView";
2
+ export type MultiCommunityResponse = {
3
+ multi_community_view: MultiCommunityView;
4
+ };
@@ -1,6 +1,8 @@
1
+ import type { CommunityFollowerState } from "./CommunityFollowerState";
1
2
  import type { MultiCommunity } from "./MultiCommunity";
2
3
  import type { Person } from "./Person";
3
4
  export type MultiCommunityView = {
4
5
  multi: MultiCommunity;
6
+ follow_state?: CommunityFollowerState;
5
7
  owner: Person;
6
8
  };
@@ -0,0 +1,4 @@
1
+ /**
2
+ * Takes either a name or a numeric ID. For example `main`, `main@lemmy.ml` or `12`.
3
+ */
4
+ export type NameOrId<T> = string | T;
@@ -1,4 +1,14 @@
1
+ import type { AdminAddId } from "./AdminAddId";
2
+ import type { AdminBanId } from "./AdminBanId";
3
+ import type { AdminRemoveCommunityId } from "./AdminRemoveCommunityId";
1
4
  import type { CommentId } from "./CommentId";
5
+ import type { ModAddToCommunityId } from "./ModAddToCommunityId";
6
+ import type { ModBanFromCommunityId } from "./ModBanFromCommunityId";
7
+ import type { ModLockCommentId } from "./ModLockCommentId";
8
+ import type { ModLockPostId } from "./ModLockPostId";
9
+ import type { ModRemoveCommentId } from "./ModRemoveCommentId";
10
+ import type { ModRemovePostId } from "./ModRemovePostId";
11
+ import type { ModTransferCommunityId } from "./ModTransferCommunityId";
2
12
  import type { NotificationId } from "./NotificationId";
3
13
  import type { NotificationType } from "./NotificationType";
4
14
  import type { PersonId } from "./PersonId";
@@ -13,4 +23,14 @@ export type Notification = {
13
23
  kind: NotificationType;
14
24
  post_id?: PostId;
15
25
  private_message_id?: PrivateMessageId;
26
+ admin_add_id?: AdminAddId;
27
+ mod_add_to_community_id?: ModAddToCommunityId;
28
+ admin_ban_id?: AdminBanId;
29
+ mod_ban_from_community_id?: ModBanFromCommunityId;
30
+ mod_lock_post_id?: ModLockPostId;
31
+ mod_remove_comment_id?: ModRemoveCommentId;
32
+ admin_remove_community_id?: AdminRemoveCommunityId;
33
+ mod_remove_post_id?: ModRemovePostId;
34
+ mod_lock_comment_id?: ModLockCommentId;
35
+ mod_transfer_community_id?: ModTransferCommunityId;
16
36
  };
@@ -1,4 +1,14 @@
1
+ import type { AdminAdd } from "./AdminAdd";
2
+ import type { AdminBan } from "./AdminBan";
3
+ import type { AdminRemoveCommunity } from "./AdminRemoveCommunity";
1
4
  import type { CommentView } from "./CommentView";
5
+ import type { ModAddToCommunity } from "./ModAddToCommunity";
6
+ import type { ModBanFromCommunity } from "./ModBanFromCommunity";
7
+ import type { ModLockComment } from "./ModLockComment";
8
+ import type { ModLockPost } from "./ModLockPost";
9
+ import type { ModRemoveComment } from "./ModRemoveComment";
10
+ import type { ModRemovePost } from "./ModRemovePost";
11
+ import type { ModTransferCommunity } from "./ModTransferCommunity";
2
12
  import type { PostView } from "./PostView";
3
13
  import type { PrivateMessageView } from "./PrivateMessageView";
4
14
  export type NotificationData = ({
@@ -7,4 +17,24 @@ export type NotificationData = ({
7
17
  type_: "Post";
8
18
  } & PostView) | ({
9
19
  type_: "PrivateMessage";
10
- } & PrivateMessageView);
20
+ } & PrivateMessageView) | ({
21
+ type_: "AdminAdd";
22
+ } & AdminAdd) | ({
23
+ type_: "ModAddToCommunity";
24
+ } & ModAddToCommunity) | ({
25
+ type_: "AdminBan";
26
+ } & AdminBan) | ({
27
+ type_: "ModBanFromCommunity";
28
+ } & ModBanFromCommunity) | ({
29
+ type_: "ModLockPost";
30
+ } & ModLockPost) | ({
31
+ type_: "ModLockComment";
32
+ } & ModLockComment) | ({
33
+ type_: "ModRemovePost";
34
+ } & ModRemovePost) | ({
35
+ type_: "ModRemoveComment";
36
+ } & ModRemoveComment) | ({
37
+ type_: "AdminRemoveCommunity";
38
+ } & AdminRemoveCommunity) | ({
39
+ type_: "ModTransferCommunity";
40
+ } & ModTransferCommunity);
@@ -1,4 +1,4 @@
1
1
  /**
2
2
  * Types of notifications which can be received in inbox
3
3
  */
4
- export type NotificationType = "Mention" | "Reply" | "Subscribed" | "PrivateMessage";
4
+ export type NotificationType = "Mention" | "Reply" | "Subscribed" | "PrivateMessage" | "ModAction";
@@ -0,0 +1,7 @@
1
+ import type { PersonView } from "./PersonView";
2
+ /**
3
+ * A person response for actions done to a person.
4
+ */
5
+ export type PersonResponse = {
6
+ person_view: PersonView;
7
+ };
@@ -21,5 +21,7 @@ export type PostReportView = {
21
21
  creator_is_admin: boolean;
22
22
  creator_is_moderator: boolean;
23
23
  creator_banned: boolean;
24
+ creator_ban_expires_at?: string;
24
25
  creator_banned_from_community: boolean;
26
+ creator_community_ban_expires_at?: string;
25
27
  };
@@ -12,4 +12,5 @@ export type PrivateMessageReportView = {
12
12
  resolver?: Person;
13
13
  creator_is_admin: boolean;
14
14
  creator_banned: boolean;
15
+ creator_ban_expires_at?: string;
15
16
  };
@@ -0,0 +1,12 @@
1
+ /**
2
+ * These errors are only used for federation or internally and dont need to be translated.
3
+ */
4
+ export type UntranslatedError = "InvalidCommunity" | "CannotCreatePostOrCommentInDeletedOrRemovedCommunity" | "CannotReceivePage" | "OnlyLocalAdminCanRemoveCommunity" | "OnlyLocalAdminCanRestoreCommunity" | "PostIsLocked" | {
5
+ PersonIsBannedFromSite: string;
6
+ } | "InvalidVoteValue" | "PageDoesNotSpecifyCreator" | "FederationDisabled" | {
7
+ DomainBlocked: string;
8
+ } | {
9
+ DomainNotInAllowList: string;
10
+ } | "FederationDisabledByStrictAllowList" | "ContradictingFilters" | "UrlWithoutDomain" | "InboxTimeout" | "CantDeleteSite" | "ObjectIsNotPublic" | "ObjectIsNotPrivate" | {
11
+ InvalidFollow: string;
12
+ } | "PurgeInvalidImageUrl" | "Unreachable" | "CouldntSendWebmention" | "CommunityHasNoFollowers";
@@ -0,0 +1,3 @@
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
+ Object.defineProperty(exports, "__esModule", { value: true });
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "lemmy-js-client",
3
3
  "description": "A javascript / typescript client for Lemmy",
4
- "version": "1.0.0-emoji-shortcode.2",
4
+ "version": "1.0.0-enum-for-api.1",
5
5
  "author": "Dessalines",
6
6
  "license": "AGPL-3.0",
7
7
  "main": "./dist/index.js",
@@ -44,7 +44,7 @@
44
44
  "typescript": "^5.5.4",
45
45
  "typescript-eslint": "^8.7.0"
46
46
  },
47
- "packageManager": "pnpm@10.17.1",
47
+ "packageManager": "pnpm@10.18.0",
48
48
  "types": "./dist/index.d.ts",
49
49
  "lint-staged": {
50
50
  "*.{ts,tsx,js}": [
@@ -1,8 +0,0 @@
1
- import type { PersonView } from "./PersonView";
2
- /**
3
- * A response for a banned person.
4
- */
5
- export type BanPersonResponse = {
6
- person_view: PersonView;
7
- banned: boolean;
8
- };
@@ -1,8 +0,0 @@
1
- import type { CommunityView } from "./CommunityView";
2
- /**
3
- * The block community response.
4
- */
5
- export type BlockCommunityResponse = {
6
- community_view: CommunityView;
7
- blocked: boolean;
8
- };
@@ -1,8 +0,0 @@
1
- import type { PersonView } from "./PersonView";
2
- /**
3
- * The response for a person block.
4
- */
5
- export type BlockPersonResponse = {
6
- person_view: PersonView;
7
- blocked: boolean;
8
- };
@@ -1,2 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,12 +0,0 @@
1
- /**
2
- * Federation related errors, these dont need to be translated.
3
- */
4
- export type FederationError = "InvalidCommunity" | "CannotCreatePostOrCommentInDeletedOrRemovedCommunity" | "CannotReceivePage" | "OnlyLocalAdminCanRemoveCommunity" | "OnlyLocalAdminCanRestoreCommunity" | "PostIsLocked" | {
5
- PersonIsBannedFromSite: string;
6
- } | "InvalidVoteValue" | "PageDoesNotSpecifyCreator" | "FederationDisabled" | {
7
- DomainBlocked: string;
8
- } | {
9
- DomainNotInAllowList: string;
10
- } | "FederationDisabledByStrictAllowList" | "ContradictingFilters" | "UrlWithoutDomain" | "InboxTimeout" | "CantDeleteSite" | "ObjectIsNotPublic" | "ObjectIsNotPrivate" | {
11
- InvalidFollow: string;
12
- } | "Unreachable";
File without changes