lemmy-js-client 1.0.0-emoji-shortcode.2 → 1.0.0-enum-for-api.4
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/dist/http.d.ts +8 -10
- package/dist/http.js +3 -3
- package/dist/index.d.ts +4 -4
- package/dist/types/AllLemmyErrors.d.ts +1 -1
- package/dist/types/AllLemmyErrors.js +5 -8
- package/dist/types/CommentReportView.d.ts +2 -0
- package/dist/types/CommunityReportView.d.ts +2 -0
- package/dist/types/GetComments.d.ts +5 -2
- package/dist/types/GetCommunity.d.ts +4 -4
- package/dist/types/GetMultiCommunity.d.ts +2 -1
- package/dist/types/GetPersonDetails.d.ts +3 -5
- package/dist/types/GetPosts.d.ts +6 -3
- package/dist/types/LemmyErrorType.d.ts +11 -15
- package/dist/types/ListPersonContent.d.ts +3 -5
- package/dist/types/MultiCommunityResponse.d.ts +4 -0
- package/dist/types/MultiCommunityView.d.ts +2 -0
- package/dist/types/NameOrId.d.ts +4 -0
- package/dist/types/Notification.d.ts +20 -0
- package/dist/types/NotificationData.d.ts +31 -1
- package/dist/types/NotificationType.d.ts +1 -1
- package/dist/types/PersonResponse.d.ts +7 -0
- package/dist/types/PostReportView.d.ts +2 -0
- package/dist/types/PrivateMessageReportView.d.ts +1 -0
- package/dist/types/UntranslatedError.d.ts +12 -0
- package/dist/types/UntranslatedError.js +3 -0
- package/package.json +2 -2
- 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/BlockPersonResponse.js +0 -2
- package/dist/types/FederationError.d.ts +0 -12
- /package/dist/types/{BanPersonResponse.js → MultiCommunityResponse.js} +0 -0
- /package/dist/types/{FederationError.js → NameOrId.js} +0 -0
- /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
|
|
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<
|
|
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<
|
|
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
|
|
484
|
+
getPersonDetails(form: GetPersonDetailsI, options?: RequestOptions): Promise<GetPersonDetailsResponse>;
|
|
487
485
|
/**
|
|
488
486
|
* @summary List the content for a person.
|
|
489
487
|
*/
|
|
490
|
-
listPersonContent(form
|
|
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<
|
|
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<
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
-
"
|
|
21
|
-
"
|
|
22
|
-
"
|
|
23
|
-
"
|
|
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
|
];
|
|
@@ -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
|
-
|
|
23
|
-
|
|
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
|
|
8
|
+
* Example: `star_trek`, or `star_trek@xyz.tld` or `12`
|
|
9
9
|
*/
|
|
10
|
-
|
|
10
|
+
name_or_id: NameOrId<CommunityId>;
|
|
11
11
|
};
|
|
@@ -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
|
|
8
|
+
* Example: `dessalines`, or `dessalines@xyz.tld`, or `12`
|
|
11
9
|
*/
|
|
12
|
-
|
|
10
|
+
person_name_or_id: NameOrId<PersonId>;
|
|
13
11
|
};
|
package/dist/types/GetPosts.d.ts
CHANGED
|
@@ -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
|
-
|
|
19
|
-
|
|
20
|
-
|
|
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 {
|
|
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: "
|
|
218
|
+
error: "untranslated_error";
|
|
225
219
|
message: {
|
|
226
|
-
error?:
|
|
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
|
|
11
|
+
* Example: `dessalines`, or `dessalines@xyz.tld`, or `12`
|
|
14
12
|
*/
|
|
15
|
-
|
|
13
|
+
person_name_or_id: NameOrId<PersonId>;
|
|
16
14
|
page_cursor?: PaginationCursor;
|
|
17
15
|
page_back?: boolean;
|
|
18
16
|
limit?: number;
|
|
@@ -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
|
};
|
|
@@ -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);
|
|
@@ -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";
|
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-
|
|
4
|
+
"version": "1.0.0-enum-for-api.4",
|
|
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.
|
|
47
|
+
"packageManager": "pnpm@10.18.0",
|
|
48
48
|
"types": "./dist/index.d.ts",
|
|
49
49
|
"lint-staged": {
|
|
50
50
|
"*.{ts,tsx,js}": [
|
|
@@ -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
|
|
File without changes
|
|
File without changes
|