lemmy-js-client 1.0.0-enum-for-api.6 → 1.0.0-enum-variants-snake-case.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/dist/http.d.ts +11 -9
- package/dist/http.js +3 -3
- package/dist/index.d.ts +3 -3
- package/dist/types/AllLemmyErrors.js +4 -1
- package/dist/types/BanPersonResponse.d.ts +8 -0
- package/dist/types/BlockCommunityResponse.d.ts +8 -0
- package/dist/types/BlockPersonResponse.d.ts +8 -0
- package/dist/types/BlockPersonResponse.js +2 -0
- package/dist/types/CommentSortType.d.ts +1 -1
- package/dist/types/CommunityFollowerState.d.ts +1 -1
- package/dist/types/CommunityNotificationsMode.d.ts +1 -1
- package/dist/types/CommunityVisibility.d.ts +1 -1
- package/dist/types/FederationMode.d.ts +1 -1
- package/dist/types/GetComments.d.ts +3 -5
- package/dist/types/GetCommunity.d.ts +5 -4
- package/dist/types/GetMultiCommunity.d.ts +2 -2
- package/dist/types/GetPersonDetails.d.ts +6 -3
- package/dist/types/GetPosts.d.ts +5 -6
- package/dist/types/LemmyErrorType.d.ts +8 -3
- package/dist/types/ListPersonContent.d.ts +6 -3
- package/dist/types/ListingType.d.ts +1 -1
- package/dist/types/MultiCommunityView.d.ts +0 -2
- package/dist/types/NotificationType.d.ts +1 -1
- package/dist/types/PostListingMode.d.ts +1 -1
- package/dist/types/PostNotificationsMode.d.ts +1 -1
- package/dist/types/PostSortType.d.ts +1 -1
- package/dist/types/RegistrationMode.d.ts +1 -1
- package/dist/types/UntranslatedError.d.ts +1 -1
- package/dist/types/VoteShow.d.ts +1 -1
- package/package.json +2 -2
- package/dist/types/MultiCommunityResponse.d.ts +0 -4
- package/dist/types/NameOrId.d.ts +0 -8
- package/dist/types/NameOrId.js +0 -3
- package/dist/types/PersonResponse.d.ts +0 -7
- /package/dist/types/{MultiCommunityResponse.js → BanPersonResponse.js} +0 -0
- /package/dist/types/{PersonResponse.js → BlockCommunityResponse.js} +0 -0
package/dist/http.d.ts
CHANGED
|
@@ -9,8 +9,11 @@ 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";
|
|
12
13
|
import { BlockCommunity } from "./types/BlockCommunity";
|
|
14
|
+
import { BlockCommunityResponse } from "./types/BlockCommunityResponse";
|
|
13
15
|
import { BlockPerson } from "./types/BlockPerson";
|
|
16
|
+
import { BlockPersonResponse } from "./types/BlockPersonResponse";
|
|
14
17
|
import { ChangePassword } from "./types/ChangePassword";
|
|
15
18
|
import { CommentReportResponse } from "./types/CommentReportResponse";
|
|
16
19
|
import { CommentResponse } from "./types/CommentResponse";
|
|
@@ -146,7 +149,6 @@ import { ListNotificationsResponse } from "./types/ListNotificationsResponse";
|
|
|
146
149
|
import { ModEditPost } from "./types/ModEditPost";
|
|
147
150
|
import { UpdateCommunityNotifications } from "./types/UpdateCommunityNotifications";
|
|
148
151
|
import { UpdatePostNotifications } from "./types/UpdatePostNotifications";
|
|
149
|
-
import { PersonResponse } from "./types/PersonResponse";
|
|
150
152
|
type RequestOptions = Pick<RequestInit, "signal">;
|
|
151
153
|
/**
|
|
152
154
|
* Helps build lemmy HTTP requests.
|
|
@@ -253,7 +255,7 @@ export declare class LemmyHttp extends Controller {
|
|
|
253
255
|
/**
|
|
254
256
|
* @summary Get / fetch a community.
|
|
255
257
|
*/
|
|
256
|
-
getCommunity(form
|
|
258
|
+
getCommunity(form?: GetCommunityI, options?: RequestOptions): Promise<GetCommunityResponse>;
|
|
257
259
|
/**
|
|
258
260
|
* @summary Edit a community.
|
|
259
261
|
*/
|
|
@@ -281,7 +283,7 @@ export declare class LemmyHttp extends Controller {
|
|
|
281
283
|
/**
|
|
282
284
|
* @summary Block a community.
|
|
283
285
|
*/
|
|
284
|
-
blockCommunity(form: BlockCommunity, options?: RequestOptions): Promise<
|
|
286
|
+
blockCommunity(form: BlockCommunity, options?: RequestOptions): Promise<BlockCommunityResponse>;
|
|
285
287
|
/**
|
|
286
288
|
* @summary Delete a community.
|
|
287
289
|
*/
|
|
@@ -481,11 +483,11 @@ export declare class LemmyHttp extends Controller {
|
|
|
481
483
|
/**
|
|
482
484
|
* @summary Get the details for a person.
|
|
483
485
|
*/
|
|
484
|
-
getPersonDetails(form
|
|
486
|
+
getPersonDetails(form?: GetPersonDetailsI, options?: RequestOptions): Promise<GetPersonDetailsResponse>;
|
|
485
487
|
/**
|
|
486
488
|
* @summary List the content for a person.
|
|
487
489
|
*/
|
|
488
|
-
listPersonContent(form
|
|
490
|
+
listPersonContent(form?: ListPersonContentI, options?: RequestOptions): Promise<ListPersonContentResponse>;
|
|
489
491
|
/**
|
|
490
492
|
* @summary Make a note for a person.
|
|
491
493
|
*/
|
|
@@ -493,7 +495,7 @@ export declare class LemmyHttp extends Controller {
|
|
|
493
495
|
/**
|
|
494
496
|
* @summary Ban a person from your site.
|
|
495
497
|
*/
|
|
496
|
-
banPerson(form: BanPerson, options?: RequestOptions): Promise<
|
|
498
|
+
banPerson(form: BanPerson, options?: RequestOptions): Promise<BanPersonResponse>;
|
|
497
499
|
/**
|
|
498
500
|
* @summary Get a list of users.
|
|
499
501
|
*/
|
|
@@ -501,7 +503,7 @@ export declare class LemmyHttp extends Controller {
|
|
|
501
503
|
/**
|
|
502
504
|
* @summary Block a person.
|
|
503
505
|
*/
|
|
504
|
-
blockPerson(form: BlockPerson, options?: RequestOptions): Promise<
|
|
506
|
+
blockPerson(form: BlockPerson, options?: RequestOptions): Promise<BlockPersonResponse>;
|
|
505
507
|
/**
|
|
506
508
|
* @summary Fetch a Captcha.
|
|
507
509
|
*/
|
|
@@ -779,7 +781,7 @@ export declare class LemmyHttp extends Controller {
|
|
|
779
781
|
* The msg is either an empty string, or extra non-translatable info.
|
|
780
782
|
*/
|
|
781
783
|
export declare class LemmyError extends Error {
|
|
782
|
-
status
|
|
783
|
-
constructor(name: string, status
|
|
784
|
+
status: number;
|
|
785
|
+
constructor(name: string, status: number, msg?: string);
|
|
784
786
|
}
|
|
785
787
|
export {};
|
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,8 +43,11 @@ 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";
|
|
46
47
|
export { BlockCommunity } from "./types/BlockCommunity";
|
|
48
|
+
export { BlockCommunityResponse } from "./types/BlockCommunityResponse";
|
|
47
49
|
export { BlockPerson } from "./types/BlockPerson";
|
|
50
|
+
export { BlockPersonResponse } from "./types/BlockPersonResponse";
|
|
48
51
|
export { CaptchaResponse } from "./types/CaptchaResponse";
|
|
49
52
|
export { ChangePassword } from "./types/ChangePassword";
|
|
50
53
|
export { Comment } from "./types/Comment";
|
|
@@ -250,10 +253,8 @@ export { ModlogCombinedView } from "./types/ModlogCombinedView";
|
|
|
250
253
|
export { MultiCommunity } from "./types/MultiCommunity";
|
|
251
254
|
export { MultiCommunityFollow } from "./types/MultiCommunityFollow";
|
|
252
255
|
export { MultiCommunityId } from "./types/MultiCommunityId";
|
|
253
|
-
export { MultiCommunityResponse } from "./types/MultiCommunityResponse";
|
|
254
256
|
export { MultiCommunityView } from "./types/MultiCommunityView";
|
|
255
257
|
export { MyUserInfo } from "./types/MyUserInfo";
|
|
256
|
-
export { NameOrId } from "./types/NameOrId";
|
|
257
258
|
export { NotePerson } from "./types/NotePerson";
|
|
258
259
|
export { Notification } from "./types/Notification";
|
|
259
260
|
export { NotificationData } from "./types/NotificationData";
|
|
@@ -275,7 +276,6 @@ export { PersonContentCombinedView } from "./types/PersonContentCombinedView";
|
|
|
275
276
|
export { PersonContentType } from "./types/PersonContentType";
|
|
276
277
|
export { PersonId } from "./types/PersonId";
|
|
277
278
|
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";
|
|
@@ -20,10 +20,12 @@ exports.AllLemmyErrors = [
|
|
|
20
20
|
"cannot_leave_mod",
|
|
21
21
|
"cannot_leave_mod",
|
|
22
22
|
"cannot_leave_mod",
|
|
23
|
-
"
|
|
23
|
+
"image_url_missing_path_segments",
|
|
24
|
+
"image_url_missing_last_path_segment",
|
|
24
25
|
"pictrs_api_key_not_provided",
|
|
25
26
|
"no_content_type_header",
|
|
26
27
|
"not_an_image_type",
|
|
28
|
+
"invalid_image_upload",
|
|
27
29
|
"image_upload_disabled",
|
|
28
30
|
"not_a_mod_or_admin",
|
|
29
31
|
"not_top_mod",
|
|
@@ -57,6 +59,7 @@ exports.AllLemmyErrors = [
|
|
|
57
59
|
"email_already_taken",
|
|
58
60
|
"username_already_taken",
|
|
59
61
|
"person_is_banned_from_community",
|
|
62
|
+
"no_id_given",
|
|
60
63
|
"incorrect_login",
|
|
61
64
|
"no_email_setup",
|
|
62
65
|
"local_site_not_setup",
|
|
@@ -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 = "
|
|
4
|
+
export type CommentSortType = "hot" | "top" | "new" | "old" | "controversial";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export type CommunityFollowerState = "
|
|
1
|
+
export type CommunityFollowerState = "accepted" | "pending" | "approval_required";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Available settings for community notifications
|
|
3
3
|
*/
|
|
4
|
-
export type CommunityNotificationsMode = "
|
|
4
|
+
export type CommunityNotificationsMode = "all_posts_and_comments" | "all_posts" | "replies_and_mentions" | "mute";
|
|
@@ -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 = "
|
|
4
|
+
export type CommunityVisibility = "public" | "unlisted" | "local_only_public" | "local_only_private" | "private";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { CommentId } from "./CommentId";
|
|
2
2
|
import type { CommentSortType } from "./CommentSortType";
|
|
3
|
+
import type { CommunityId } from "./CommunityId";
|
|
3
4
|
import type { ListingType } from "./ListingType";
|
|
4
|
-
import type { NameOrId } from "./NameOrId";
|
|
5
5
|
import type { PaginationCursor } from "./PaginationCursor";
|
|
6
6
|
import type { PostId } from "./PostId";
|
|
7
7
|
/**
|
|
@@ -19,10 +19,8 @@ export type GetComments = {
|
|
|
19
19
|
page_cursor?: PaginationCursor;
|
|
20
20
|
page_back?: boolean;
|
|
21
21
|
limit?: number;
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
*/
|
|
25
|
-
community_name_or_id?: NameOrId;
|
|
22
|
+
community_id?: CommunityId;
|
|
23
|
+
community_name?: string;
|
|
26
24
|
post_id?: PostId;
|
|
27
25
|
parent_id?: CommentId;
|
|
28
26
|
};
|
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { CommunityId } from "./CommunityId";
|
|
2
2
|
/**
|
|
3
|
-
* Get a community. Must provide either an id, or a name
|
|
3
|
+
* Get a community. Must provide either an id, or a name.
|
|
4
4
|
*/
|
|
5
5
|
export type GetCommunity = {
|
|
6
|
+
id?: CommunityId;
|
|
6
7
|
/**
|
|
7
|
-
* Example:
|
|
8
|
+
* Example: star_trek , or star_trek@xyz.tld
|
|
8
9
|
*/
|
|
9
|
-
|
|
10
|
+
name?: string;
|
|
10
11
|
};
|
|
@@ -1,10 +1,13 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { PersonId } from "./PersonId";
|
|
2
2
|
/**
|
|
3
3
|
* Gets a person's details.
|
|
4
|
+
*
|
|
5
|
+
* Either person_id, or username are required.
|
|
4
6
|
*/
|
|
5
7
|
export type GetPersonDetails = {
|
|
8
|
+
person_id?: PersonId;
|
|
6
9
|
/**
|
|
7
|
-
* Example:
|
|
10
|
+
* Example: dessalines , or dessalines@xyz.tld
|
|
8
11
|
*/
|
|
9
|
-
|
|
12
|
+
username?: string;
|
|
10
13
|
};
|
package/dist/types/GetPosts.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
|
+
import type { CommunityId } from "./CommunityId";
|
|
1
2
|
import type { ListingType } from "./ListingType";
|
|
2
|
-
import type {
|
|
3
|
+
import type { MultiCommunityId } from "./MultiCommunityId";
|
|
3
4
|
import type { PaginationCursor } from "./PaginationCursor";
|
|
4
5
|
import type { PostSortType } from "./PostSortType";
|
|
5
6
|
/**
|
|
@@ -14,11 +15,9 @@ export type GetPosts = {
|
|
|
14
15
|
* Use Zero to override the local_site and local_user time_range.
|
|
15
16
|
*/
|
|
16
17
|
time_range_seconds?: number;
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
community_name_or_id?: NameOrId;
|
|
21
|
-
multi_community_name_or_id?: NameOrId;
|
|
18
|
+
community_id?: CommunityId;
|
|
19
|
+
community_name?: string;
|
|
20
|
+
multi_community_id?: MultiCommunityId;
|
|
22
21
|
show_hidden?: boolean;
|
|
23
22
|
/**
|
|
24
23
|
* If true, then show the read posts (even if your user setting is to hide them)
|
|
@@ -41,14 +41,17 @@ export type LemmyErrorType = {
|
|
|
41
41
|
error: "pictrs_purge_response_error";
|
|
42
42
|
message: string;
|
|
43
43
|
} | {
|
|
44
|
-
error: "
|
|
44
|
+
error: "image_url_missing_path_segments";
|
|
45
45
|
} | {
|
|
46
|
-
error: "
|
|
47
|
-
|
|
46
|
+
error: "image_url_missing_last_path_segment";
|
|
47
|
+
} | {
|
|
48
|
+
error: "pictrs_api_key_not_provided";
|
|
48
49
|
} | {
|
|
49
50
|
error: "no_content_type_header";
|
|
50
51
|
} | {
|
|
51
52
|
error: "not_an_image_type";
|
|
53
|
+
} | {
|
|
54
|
+
error: "invalid_image_upload";
|
|
52
55
|
} | {
|
|
53
56
|
error: "image_upload_disabled";
|
|
54
57
|
} | {
|
|
@@ -115,6 +118,8 @@ export type LemmyErrorType = {
|
|
|
115
118
|
error: "username_already_taken";
|
|
116
119
|
} | {
|
|
117
120
|
error: "person_is_banned_from_community";
|
|
121
|
+
} | {
|
|
122
|
+
error: "no_id_given";
|
|
118
123
|
} | {
|
|
119
124
|
error: "incorrect_login";
|
|
120
125
|
} | {
|
|
@@ -1,15 +1,18 @@
|
|
|
1
|
-
import type { NameOrId } from "./NameOrId";
|
|
2
1
|
import type { PaginationCursor } from "./PaginationCursor";
|
|
3
2
|
import type { PersonContentType } from "./PersonContentType";
|
|
3
|
+
import type { PersonId } from "./PersonId";
|
|
4
4
|
/**
|
|
5
5
|
* Gets a person's content (posts and comments)
|
|
6
|
+
*
|
|
7
|
+
* Either person_id, or username are required.
|
|
6
8
|
*/
|
|
7
9
|
export type ListPersonContent = {
|
|
8
10
|
type_?: PersonContentType;
|
|
11
|
+
person_id?: PersonId;
|
|
9
12
|
/**
|
|
10
|
-
* Example:
|
|
13
|
+
* Example: dessalines , or dessalines@xyz.tld
|
|
11
14
|
*/
|
|
12
|
-
|
|
15
|
+
username?: string;
|
|
13
16
|
page_cursor?: PaginationCursor;
|
|
14
17
|
page_back?: boolean;
|
|
15
18
|
limit?: number;
|
|
@@ -1,8 +1,6 @@
|
|
|
1
|
-
import type { CommunityFollowerState } from "./CommunityFollowerState";
|
|
2
1
|
import type { MultiCommunity } from "./MultiCommunity";
|
|
3
2
|
import type { Person } from "./Person";
|
|
4
3
|
export type MultiCommunityView = {
|
|
5
4
|
multi: MultiCommunity;
|
|
6
|
-
follow_state?: CommunityFollowerState;
|
|
7
5
|
owner: Person;
|
|
8
6
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Types of notifications which can be received in inbox
|
|
3
3
|
*/
|
|
4
|
-
export type NotificationType = "
|
|
4
|
+
export type NotificationType = "mention" | "reply" | "subscribed" | "private_message" | "mod_action";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* The post sort types. See here for descriptions: https://join-lemmy.org/docs/en/users/03-votes-and-ranking.html
|
|
3
3
|
*/
|
|
4
|
-
export type PostSortType = "
|
|
4
|
+
export type PostSortType = "active" | "hot" | "new" | "old" | "top" | "most_comments" | "new_comments" | "controversial" | "scaled";
|
|
@@ -9,4 +9,4 @@ export type UntranslatedError = "InvalidCommunity" | "CannotCreatePostOrCommentI
|
|
|
9
9
|
DomainNotInAllowList: string;
|
|
10
10
|
} | "FederationDisabledByStrictAllowList" | "ContradictingFilters" | "UrlWithoutDomain" | "InboxTimeout" | "CantDeleteSite" | "ObjectIsNotPublic" | "ObjectIsNotPrivate" | {
|
|
11
11
|
InvalidFollow: string;
|
|
12
|
-
} | "
|
|
12
|
+
} | "Unreachable" | "CouldntSendWebmention" | "CommunityHasNoFollowers";
|
package/dist/types/VoteShow.d.ts
CHANGED
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-enum-
|
|
4
|
+
"version": "1.0.0-enum-variants-snake-case.0",
|
|
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.18.
|
|
47
|
+
"packageManager": "pnpm@10.18.2",
|
|
48
48
|
"types": "./dist/index.d.ts",
|
|
49
49
|
"lint-staged": {
|
|
50
50
|
"*.{ts,tsx,js}": [
|
package/dist/types/NameOrId.d.ts
DELETED
package/dist/types/NameOrId.js
DELETED
|
File without changes
|
|
File without changes
|