lemmy-js-client 0.19.6-beta.1 → 0.20.0-alpha.10

Sign up to get free protection for your applications and to get access to all the features.
Files changed (70) hide show
  1. package/dist/http.d.ts +29 -0
  2. package/dist/http.js +32 -0
  3. package/dist/index.d.ts +21 -5
  4. package/dist/types/AuthenticateWithOauth.d.ts +8 -0
  5. package/dist/types/BanFromCommunity.d.ts +1 -1
  6. package/dist/types/BanPerson.d.ts +1 -1
  7. package/dist/types/CreateOAuthProvider.d.ts +14 -0
  8. package/dist/types/CreateOAuthProvider.js +3 -0
  9. package/dist/types/CreateSite.d.ts +6 -4
  10. package/dist/types/CreateTagline.d.ts +3 -0
  11. package/dist/types/CreateTagline.js +3 -0
  12. package/dist/types/CustomEmoji.d.ts +0 -2
  13. package/dist/types/DeleteOAuthProvider.d.ts +4 -0
  14. package/dist/types/DeleteTagline.d.ts +4 -0
  15. package/dist/types/EditOAuthProvider.d.ts +14 -0
  16. package/dist/types/EditSite.d.ts +6 -4
  17. package/dist/types/GetPersonDetails.d.ts +2 -2
  18. package/dist/types/GetPosts.d.ts +2 -2
  19. package/dist/types/GetSiteResponse.d.ts +5 -3
  20. package/dist/types/LemmyErrorType.d.ts +16 -30
  21. package/dist/types/ListCommunities.d.ts +2 -2
  22. package/dist/types/ListCustomEmojis.d.ts +6 -0
  23. package/dist/types/ListCustomEmojis.js +3 -0
  24. package/dist/types/ListCustomEmojisResponse.d.ts +4 -0
  25. package/dist/types/ListCustomEmojisResponse.js +2 -0
  26. package/dist/types/ListLoginsResponse.d.ts +4 -0
  27. package/dist/types/ListLoginsResponse.js +2 -0
  28. package/dist/types/ListTaglines.d.ts +4 -0
  29. package/dist/types/ListTaglines.js +3 -0
  30. package/dist/types/ListTaglinesResponse.d.ts +4 -0
  31. package/dist/types/ListTaglinesResponse.js +2 -0
  32. package/dist/types/LocalSite.d.ts +5 -3
  33. package/dist/types/LocalUser.d.ts +4 -3
  34. package/dist/types/LocalUserVoteDisplayMode.d.ts +0 -2
  35. package/dist/types/LocalUserVoteDisplayMode.js +1 -0
  36. package/dist/types/MyUserInfo.d.ts +6 -6
  37. package/dist/types/OAuthAccount.d.ts +9 -0
  38. package/dist/types/OAuthAccount.js +2 -0
  39. package/dist/types/OAuthProvider.d.ts +17 -0
  40. package/dist/types/OAuthProvider.js +2 -0
  41. package/dist/types/OAuthProviderId.d.ts +1 -0
  42. package/dist/types/OAuthProviderId.js +3 -0
  43. package/dist/types/OAuthProviderInsertForm.d.ts +14 -0
  44. package/dist/types/OAuthProviderInsertForm.js +3 -0
  45. package/dist/types/OAuthProviderUpdateForm.d.ts +13 -0
  46. package/dist/types/OAuthProviderUpdateForm.js +3 -0
  47. package/dist/types/PostSortType.d.ts +1 -0
  48. package/dist/types/PostSortType.js +3 -0
  49. package/dist/types/PublicOAuthProvider.d.ts +2 -0
  50. package/dist/types/PublicOAuthProvider.js +2 -0
  51. package/dist/types/SaveUserSettings.d.ts +5 -3
  52. package/dist/types/Search.d.ts +3 -2
  53. package/dist/types/SiteResponse.d.ts +0 -2
  54. package/dist/types/Tagline.d.ts +0 -2
  55. package/dist/types/Tagline.js +1 -0
  56. package/dist/types/TaglineId.d.ts +1 -0
  57. package/dist/types/TaglineId.js +3 -0
  58. package/dist/types/TaglineResponse.d.ts +4 -0
  59. package/dist/types/TaglineResponse.js +2 -0
  60. package/dist/types/UpdateTagline.d.ts +5 -0
  61. package/dist/types/UpdateTagline.js +2 -0
  62. package/package.json +2 -2
  63. package/dist/types/CommunityBlockView.d.ts +0 -6
  64. package/dist/types/InstanceBlockView.d.ts +0 -8
  65. package/dist/types/PersonBlockView.d.ts +0 -5
  66. package/dist/types/SortType.d.ts +0 -1
  67. /package/dist/types/{SortType.js → AuthenticateWithOauth.js} +0 -0
  68. /package/dist/types/{CommunityBlockView.js → DeleteOAuthProvider.js} +0 -0
  69. /package/dist/types/{InstanceBlockView.js → DeleteTagline.js} +0 -0
  70. /package/dist/types/{PersonBlockView.js → EditOAuthProvider.js} +0 -0
package/dist/http.d.ts CHANGED
@@ -22,6 +22,7 @@ import { CreateCommentLike } from "./types/CreateCommentLike";
22
22
  import { CreateCommentReport } from "./types/CreateCommentReport";
23
23
  import { CreateCommunity } from "./types/CreateCommunity";
24
24
  import { CreateCustomEmoji } from "./types/CreateCustomEmoji";
25
+ import { CreateOAuthProvider } from "./types/CreateOAuthProvider";
25
26
  import { CreatePost } from "./types/CreatePost";
26
27
  import { CreatePostLike } from "./types/CreatePostLike";
27
28
  import { CreatePostReport } from "./types/CreatePostReport";
@@ -33,15 +34,18 @@ import { DeleteAccount } from "./types/DeleteAccount";
33
34
  import { DeleteComment } from "./types/DeleteComment";
34
35
  import { DeleteCommunity } from "./types/DeleteCommunity";
35
36
  import { DeleteCustomEmoji } from "./types/DeleteCustomEmoji";
37
+ import { DeleteOAuthProvider } from "./types/DeleteOAuthProvider";
36
38
  import { DeletePost } from "./types/DeletePost";
37
39
  import { DeletePrivateMessage } from "./types/DeletePrivateMessage";
38
40
  import { DistinguishComment } from "./types/DistinguishComment";
39
41
  import { EditComment } from "./types/EditComment";
40
42
  import { EditCommunity } from "./types/EditCommunity";
41
43
  import { EditCustomEmoji } from "./types/EditCustomEmoji";
44
+ import { EditOAuthProvider } from "./types/EditOAuthProvider";
42
45
  import { EditPost } from "./types/EditPost";
43
46
  import { EditPrivateMessage } from "./types/EditPrivateMessage";
44
47
  import { EditSite } from "./types/EditSite";
48
+ import { OAuthProvider } from "./types/OAuthProvider";
45
49
  import { FeaturePost } from "./types/FeaturePost";
46
50
  import { FollowCommunity } from "./types/FollowCommunity";
47
51
  import { GetCaptchaResponse } from "./types/GetCaptchaResponse";
@@ -134,6 +138,7 @@ import { ListCommentLikesResponse } from "./types/ListCommentLikesResponse";
134
138
  import { HidePost } from "./types/HidePost";
135
139
  import { ListMedia } from "./types/ListMedia";
136
140
  import { ListMediaResponse } from "./types/ListMediaResponse";
141
+ import { AuthenticateWithOauth } from "./types/AuthenticateWithOauth";
137
142
  import { GetRegistrationApplication } from "./types/GetRegistrationApplication";
138
143
  /**
139
144
  * Helps build lemmy HTTP requests.
@@ -746,6 +751,30 @@ export declare class LemmyHttp {
746
751
  * `HTTP.Post /custom_emoji/delete`
747
752
  */
748
753
  deleteCustomEmoji(form: DeleteCustomEmoji): Promise<SuccessResponse>;
754
+ /**
755
+ * Create a new oauth provider method
756
+ *
757
+ * `HTTP.POST /oauth_provider`
758
+ */
759
+ createOAuthProvider(form: CreateOAuthProvider): Promise<OAuthProvider>;
760
+ /**
761
+ * Edit an existing oauth provider method
762
+ *
763
+ * `HTTP.PUT /oauth_provider`
764
+ */
765
+ editOAuthProvider(form: EditOAuthProvider): Promise<OAuthProvider>;
766
+ /**
767
+ * Delete an oauth provider method
768
+ *
769
+ * `HTTP.Post /oauth_provider/delete`
770
+ */
771
+ deleteOAuthProvider(form: DeleteOAuthProvider): Promise<SuccessResponse>;
772
+ /**
773
+ * Authenticate with OAuth
774
+ *
775
+ * `HTTP.Post /oauth/authenticate`
776
+ */
777
+ authenticateWithOAuth(form: AuthenticateWithOauth): Promise<LoginResponse>;
749
778
  /**
750
779
  * Fetch federated instances.
751
780
  *
package/dist/http.js CHANGED
@@ -844,6 +844,38 @@ class LemmyHttp {
844
844
  deleteCustomEmoji(form) {
845
845
  return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Post, "/custom_emoji/delete", form);
846
846
  }
847
+ /**
848
+ * Create a new oauth provider method
849
+ *
850
+ * `HTTP.POST /oauth_provider`
851
+ */
852
+ createOAuthProvider(form) {
853
+ return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Post, "/oauth_provider", form);
854
+ }
855
+ /**
856
+ * Edit an existing oauth provider method
857
+ *
858
+ * `HTTP.PUT /oauth_provider`
859
+ */
860
+ editOAuthProvider(form) {
861
+ return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Put, "/oauth_provider", form);
862
+ }
863
+ /**
864
+ * Delete an oauth provider method
865
+ *
866
+ * `HTTP.Post /oauth_provider/delete`
867
+ */
868
+ deleteOAuthProvider(form) {
869
+ return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Post, "/oauth_provider/delete", form);
870
+ }
871
+ /**
872
+ * Authenticate with OAuth
873
+ *
874
+ * `HTTP.Post /oauth/authenticate`
875
+ */
876
+ authenticateWithOAuth(form) {
877
+ return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Post, "/oauth/authenticate", form);
878
+ }
847
879
  /**
848
880
  * Fetch federated instances.
849
881
  *
package/dist/index.d.ts CHANGED
@@ -13,6 +13,7 @@ export { AdminPurgePersonView } from "./types/AdminPurgePersonView";
13
13
  export { AdminPurgePost } from "./types/AdminPurgePost";
14
14
  export { AdminPurgePostView } from "./types/AdminPurgePostView";
15
15
  export { ApproveRegistrationApplication } from "./types/ApproveRegistrationApplication";
16
+ export { AuthenticateWithOauth } from "./types/AuthenticateWithOauth";
16
17
  export { BanFromCommunity } from "./types/BanFromCommunity";
17
18
  export { BanFromCommunityResponse } from "./types/BanFromCommunityResponse";
18
19
  export { BanPerson } from "./types/BanPerson";
@@ -42,7 +43,6 @@ export { CommentSortType } from "./types/CommentSortType";
42
43
  export { CommentView } from "./types/CommentView";
43
44
  export { Community } from "./types/Community";
44
45
  export { CommunityAggregates } from "./types/CommunityAggregates";
45
- export { CommunityBlockView } from "./types/CommunityBlockView";
46
46
  export { CommunityFollowerView } from "./types/CommunityFollowerView";
47
47
  export { CommunityId } from "./types/CommunityId";
48
48
  export { CommunityModeratorView } from "./types/CommunityModeratorView";
@@ -54,12 +54,14 @@ export { CreateCommentLike } from "./types/CreateCommentLike";
54
54
  export { CreateCommentReport } from "./types/CreateCommentReport";
55
55
  export { CreateCommunity } from "./types/CreateCommunity";
56
56
  export { CreateCustomEmoji } from "./types/CreateCustomEmoji";
57
+ export { CreateOAuthProvider } from "./types/CreateOAuthProvider";
57
58
  export { CreatePost } from "./types/CreatePost";
58
59
  export { CreatePostLike } from "./types/CreatePostLike";
59
60
  export { CreatePostReport } from "./types/CreatePostReport";
60
61
  export { CreatePrivateMessage } from "./types/CreatePrivateMessage";
61
62
  export { CreatePrivateMessageReport } from "./types/CreatePrivateMessageReport";
62
63
  export { CreateSite } from "./types/CreateSite";
64
+ export { CreateTagline } from "./types/CreateTagline";
63
65
  export { CustomEmoji } from "./types/CustomEmoji";
64
66
  export { CustomEmojiId } from "./types/CustomEmojiId";
65
67
  export { CustomEmojiKeyword } from "./types/CustomEmojiKeyword";
@@ -69,12 +71,15 @@ export { DeleteAccount } from "./types/DeleteAccount";
69
71
  export { DeleteComment } from "./types/DeleteComment";
70
72
  export { DeleteCommunity } from "./types/DeleteCommunity";
71
73
  export { DeleteCustomEmoji } from "./types/DeleteCustomEmoji";
74
+ export { DeleteOAuthProvider } from "./types/DeleteOAuthProvider";
72
75
  export { DeletePost } from "./types/DeletePost";
73
76
  export { DeletePrivateMessage } from "./types/DeletePrivateMessage";
77
+ export { DeleteTagline } from "./types/DeleteTagline";
74
78
  export { DistinguishComment } from "./types/DistinguishComment";
75
79
  export { EditComment } from "./types/EditComment";
76
80
  export { EditCommunity } from "./types/EditCommunity";
77
81
  export { EditCustomEmoji } from "./types/EditCustomEmoji";
82
+ export { EditOAuthProvider } from "./types/EditOAuthProvider";
78
83
  export { EditPost } from "./types/EditPost";
79
84
  export { EditPrivateMessage } from "./types/EditPrivateMessage";
80
85
  export { EditSite } from "./types/EditSite";
@@ -114,7 +119,6 @@ export { HideCommunity } from "./types/HideCommunity";
114
119
  export { HidePost } from "./types/HidePost";
115
120
  export { ImageDetails } from "./types/ImageDetails";
116
121
  export { Instance } from "./types/Instance";
117
- export { InstanceBlockView } from "./types/InstanceBlockView";
118
122
  export { InstanceId } from "./types/InstanceId";
119
123
  export { InstanceWithFederationState } from "./types/InstanceWithFederationState";
120
124
  export { Language } from "./types/Language";
@@ -127,6 +131,9 @@ export { ListCommentReports } from "./types/ListCommentReports";
127
131
  export { ListCommentReportsResponse } from "./types/ListCommentReportsResponse";
128
132
  export { ListCommunities } from "./types/ListCommunities";
129
133
  export { ListCommunitiesResponse } from "./types/ListCommunitiesResponse";
134
+ export { ListCustomEmojis } from "./types/ListCustomEmojis";
135
+ export { ListCustomEmojisResponse } from "./types/ListCustomEmojisResponse";
136
+ export { ListLoginsResponse } from "./types/ListLoginsResponse";
130
137
  export { ListMedia } from "./types/ListMedia";
131
138
  export { ListMediaResponse } from "./types/ListMediaResponse";
132
139
  export { ListPostLikes } from "./types/ListPostLikes";
@@ -137,6 +144,8 @@ export { ListPrivateMessageReports } from "./types/ListPrivateMessageReports";
137
144
  export { ListPrivateMessageReportsResponse } from "./types/ListPrivateMessageReportsResponse";
138
145
  export { ListRegistrationApplications } from "./types/ListRegistrationApplications";
139
146
  export { ListRegistrationApplicationsResponse } from "./types/ListRegistrationApplicationsResponse";
147
+ export { ListTaglines } from "./types/ListTaglines";
148
+ export { ListTaglinesResponse } from "./types/ListTaglinesResponse";
140
149
  export { ListingType } from "./types/ListingType";
141
150
  export { LocalImage } from "./types/LocalImage";
142
151
  export { LocalImageView } from "./types/LocalImageView";
@@ -181,13 +190,17 @@ export { ModTransferCommunityView } from "./types/ModTransferCommunityView";
181
190
  export { ModlogActionType } from "./types/ModlogActionType";
182
191
  export { ModlogListParams } from "./types/ModlogListParams";
183
192
  export { MyUserInfo } from "./types/MyUserInfo";
193
+ export { OAuthAccount } from "./types/OAuthAccount";
194
+ export { OAuthProvider } from "./types/OAuthProvider";
195
+ export { OAuthProviderId } from "./types/OAuthProviderId";
196
+ export { OAuthProviderInsertForm } from "./types/OAuthProviderInsertForm";
197
+ export { OAuthProviderUpdateForm } from "./types/OAuthProviderUpdateForm";
184
198
  export { OpenGraphData } from "./types/OpenGraphData";
185
199
  export { PaginationCursor } from "./types/PaginationCursor";
186
200
  export { PasswordChangeAfterReset } from "./types/PasswordChangeAfterReset";
187
201
  export { PasswordReset } from "./types/PasswordReset";
188
202
  export { Person } from "./types/Person";
189
203
  export { PersonAggregates } from "./types/PersonAggregates";
190
- export { PersonBlockView } from "./types/PersonBlockView";
191
204
  export { PersonId } from "./types/PersonId";
192
205
  export { PersonMention } from "./types/PersonMention";
193
206
  export { PersonMentionId } from "./types/PersonMentionId";
@@ -204,6 +217,7 @@ export { PostReportId } from "./types/PostReportId";
204
217
  export { PostReportResponse } from "./types/PostReportResponse";
205
218
  export { PostReportView } from "./types/PostReportView";
206
219
  export { PostResponse } from "./types/PostResponse";
220
+ export { PostSortType } from "./types/PostSortType";
207
221
  export { PostView } from "./types/PostView";
208
222
  export { PrivateMessage } from "./types/PrivateMessage";
209
223
  export { PrivateMessageId } from "./types/PrivateMessageId";
@@ -214,6 +228,7 @@ export { PrivateMessageReportView } from "./types/PrivateMessageReportView";
214
228
  export { PrivateMessageResponse } from "./types/PrivateMessageResponse";
215
229
  export { PrivateMessageView } from "./types/PrivateMessageView";
216
230
  export { PrivateMessagesResponse } from "./types/PrivateMessagesResponse";
231
+ export { PublicOAuthProvider } from "./types/PublicOAuthProvider";
217
232
  export { PurgeComment } from "./types/PurgeComment";
218
233
  export { PurgeCommunity } from "./types/PurgeCommunity";
219
234
  export { PurgePerson } from "./types/PurgePerson";
@@ -244,13 +259,14 @@ export { SiteAggregates } from "./types/SiteAggregates";
244
259
  export { SiteId } from "./types/SiteId";
245
260
  export { SiteResponse } from "./types/SiteResponse";
246
261
  export { SiteView } from "./types/SiteView";
247
- export { SortType } from "./types/SortType";
248
262
  export { SubscribedType } from "./types/SubscribedType";
249
263
  export { SuccessResponse } from "./types/SuccessResponse";
250
264
  export { Tagline } from "./types/Tagline";
265
+ export { TaglineId } from "./types/TaglineId";
266
+ export { TaglineResponse } from "./types/TaglineResponse";
251
267
  export { TransferCommunity } from "./types/TransferCommunity";
268
+ export { UpdateTagline } from "./types/UpdateTagline";
252
269
  export { UpdateTotp } from "./types/UpdateTotp";
253
270
  export { UpdateTotpResponse } from "./types/UpdateTotpResponse";
254
271
  export { VerifyEmail } from "./types/VerifyEmail";
255
272
  export { VoteView } from "./types/VoteView";
256
- export { UploadImage, UploadImageResponse, ImageFile, DeleteImage, } from "./other_types";
@@ -0,0 +1,8 @@
1
+ export interface AuthenticateWithOauth {
2
+ code: string;
3
+ oauth_provider_id: string;
4
+ redirect_uri: string;
5
+ show_nsfw?: boolean;
6
+ username?: string;
7
+ answer?: string;
8
+ }
@@ -4,7 +4,7 @@ export interface BanFromCommunity {
4
4
  community_id: CommunityId;
5
5
  person_id: PersonId;
6
6
  ban: boolean;
7
- remove_data?: boolean;
7
+ remove_or_restore_data?: boolean;
8
8
  reason?: string;
9
9
  expires?: number;
10
10
  }
@@ -2,7 +2,7 @@ import type { PersonId } from "./PersonId";
2
2
  export interface BanPerson {
3
3
  person_id: PersonId;
4
4
  ban: boolean;
5
- remove_data?: boolean;
5
+ remove_or_restore_data?: boolean;
6
6
  reason?: string;
7
7
  expires?: number;
8
8
  }
@@ -0,0 +1,14 @@
1
+ export interface CreateOAuthProvider {
2
+ display_name: string;
3
+ issuer: string;
4
+ authorization_endpoint: string;
5
+ token_endpoint: string;
6
+ userinfo_endpoint: string;
7
+ id_claim: string;
8
+ client_id: string;
9
+ client_secret: string;
10
+ scopes: string;
11
+ auto_verify_email: boolean;
12
+ account_linking_enabled: boolean;
13
+ enabled: boolean;
14
+ }
@@ -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 });
@@ -1,8 +1,9 @@
1
+ import type { CommentSortType } from "./CommentSortType";
1
2
  import type { LanguageId } from "./LanguageId";
2
3
  import type { ListingType } from "./ListingType";
3
4
  import type { PostListingMode } from "./PostListingMode";
5
+ import type { PostSortType } from "./PostSortType";
4
6
  import type { RegistrationMode } from "./RegistrationMode";
5
- import type { SortType } from "./SortType";
6
7
  export interface CreateSite {
7
8
  name: string;
8
9
  sidebar?: string;
@@ -17,7 +18,9 @@ export interface CreateSite {
17
18
  private_instance?: boolean;
18
19
  default_theme?: string;
19
20
  default_post_listing_type?: ListingType;
20
- default_sort_type?: SortType;
21
+ default_post_listing_mode?: PostListingMode;
22
+ default_post_sort_type?: PostSortType;
23
+ default_comment_sort_type?: CommentSortType;
21
24
  legal_information?: string;
22
25
  application_email_admins?: boolean;
23
26
  hide_modlog_mod_names?: boolean;
@@ -42,8 +45,7 @@ export interface CreateSite {
42
45
  captcha_difficulty?: string;
43
46
  allowed_instances?: Array<string>;
44
47
  blocked_instances?: Array<string>;
45
- taglines?: Array<string>;
46
48
  registration_mode?: RegistrationMode;
49
+ oauth_registration?: boolean;
47
50
  content_warning?: string;
48
- default_post_listing_mode?: PostListingMode;
49
51
  }
@@ -0,0 +1,3 @@
1
+ export interface CreateTagline {
2
+ content: string;
3
+ }
@@ -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 });
@@ -1,8 +1,6 @@
1
1
  import type { CustomEmojiId } from "./CustomEmojiId";
2
- import type { LocalSiteId } from "./LocalSiteId";
3
2
  export interface CustomEmoji {
4
3
  id: CustomEmojiId;
5
- local_site_id: LocalSiteId;
6
4
  shortcode: string;
7
5
  image_url: string;
8
6
  alt_text: string;
@@ -0,0 +1,4 @@
1
+ import type { OAuthProviderId } from "./OAuthProviderId";
2
+ export interface DeleteOAuthProvider {
3
+ id: OAuthProviderId;
4
+ }
@@ -0,0 +1,4 @@
1
+ import type { TaglineId } from "./TaglineId";
2
+ export interface DeleteTagline {
3
+ id: TaglineId;
4
+ }
@@ -0,0 +1,14 @@
1
+ import type { OAuthProviderId } from "./OAuthProviderId";
2
+ export interface EditOAuthProvider {
3
+ id: OAuthProviderId;
4
+ display_name: string | null;
5
+ authorization_endpoint: string | null;
6
+ token_endpoint: string | null;
7
+ userinfo_endpoint: string | null;
8
+ id_claim: string | null;
9
+ client_secret: string | null;
10
+ scopes: string | null;
11
+ auto_verify_email: boolean | null;
12
+ account_linking_enabled: boolean | null;
13
+ enabled: boolean | null;
14
+ }
@@ -1,8 +1,9 @@
1
+ import type { CommentSortType } from "./CommentSortType";
1
2
  import type { LanguageId } from "./LanguageId";
2
3
  import type { ListingType } from "./ListingType";
3
4
  import type { PostListingMode } from "./PostListingMode";
5
+ import type { PostSortType } from "./PostSortType";
4
6
  import type { RegistrationMode } from "./RegistrationMode";
5
- import type { SortType } from "./SortType";
6
7
  export interface EditSite {
7
8
  name?: string;
8
9
  sidebar?: string;
@@ -17,7 +18,9 @@ export interface EditSite {
17
18
  private_instance?: boolean;
18
19
  default_theme?: string;
19
20
  default_post_listing_type?: ListingType;
20
- default_sort_type?: SortType;
21
+ default_post_listing_mode?: PostListingMode;
22
+ default_post_sort_type?: PostSortType;
23
+ default_comment_sort_type?: CommentSortType;
21
24
  legal_information?: string;
22
25
  application_email_admins?: boolean;
23
26
  hide_modlog_mod_names?: boolean;
@@ -43,9 +46,8 @@ export interface EditSite {
43
46
  allowed_instances?: Array<string>;
44
47
  blocked_instances?: Array<string>;
45
48
  blocked_urls?: Array<string>;
46
- taglines?: Array<string>;
47
49
  registration_mode?: RegistrationMode;
50
+ oauth_registration?: boolean;
48
51
  reports_email_admins?: boolean;
49
52
  content_warning?: string;
50
- default_post_listing_mode?: PostListingMode;
51
53
  }
@@ -1,10 +1,10 @@
1
1
  import type { CommunityId } from "./CommunityId";
2
2
  import type { PersonId } from "./PersonId";
3
- import type { SortType } from "./SortType";
3
+ import type { PostSortType } from "./PostSortType";
4
4
  export interface GetPersonDetails {
5
5
  person_id?: PersonId;
6
6
  username?: string;
7
- sort?: SortType;
7
+ sort?: PostSortType;
8
8
  page?: number;
9
9
  limit?: number;
10
10
  community_id?: CommunityId;
@@ -1,10 +1,10 @@
1
1
  import type { CommunityId } from "./CommunityId";
2
2
  import type { ListingType } from "./ListingType";
3
3
  import type { PaginationCursor } from "./PaginationCursor";
4
- import type { SortType } from "./SortType";
4
+ import type { PostSortType } from "./PostSortType";
5
5
  export interface GetPosts {
6
6
  type_?: ListingType;
7
- sort?: SortType;
7
+ sort?: PostSortType;
8
8
  page?: number;
9
9
  limit?: number;
10
10
  community_id?: CommunityId;
@@ -1,9 +1,10 @@
1
- import type { CustomEmojiView } from "./CustomEmojiView";
2
1
  import type { Language } from "./Language";
3
2
  import type { LanguageId } from "./LanguageId";
4
3
  import type { LocalSiteUrlBlocklist } from "./LocalSiteUrlBlocklist";
5
4
  import type { MyUserInfo } from "./MyUserInfo";
5
+ import type { OAuthProvider } from "./OAuthProvider";
6
6
  import type { PersonView } from "./PersonView";
7
+ import type { PublicOAuthProvider } from "./PublicOAuthProvider";
7
8
  import type { SiteView } from "./SiteView";
8
9
  import type { Tagline } from "./Tagline";
9
10
  export interface GetSiteResponse {
@@ -13,7 +14,8 @@ export interface GetSiteResponse {
13
14
  my_user?: MyUserInfo;
14
15
  all_languages: Array<Language>;
15
16
  discussion_languages: Array<LanguageId>;
16
- taglines: Array<Tagline>;
17
- custom_emojis: Array<CustomEmojiView>;
17
+ tagline?: Tagline;
18
+ oauth_providers?: Array<PublicOAuthProvider>;
19
+ admin_oauth_providers?: Array<OAuthProvider>;
18
20
  blocked_urls: Array<LocalSiteUrlBlocklist>;
19
21
  }
@@ -66,30 +66,6 @@ export type LemmyErrorType = {
66
66
  error: "deleted";
67
67
  } | {
68
68
  error: "banned_from_community";
69
- } | {
70
- error: "couldnt_find_community";
71
- } | {
72
- error: "couldnt_find_person";
73
- } | {
74
- error: "couldnt_find_comment";
75
- } | {
76
- error: "couldnt_find_comment_report";
77
- } | {
78
- error: "couldnt_find_post_report";
79
- } | {
80
- error: "couldnt_find_private_message_report";
81
- } | {
82
- error: "couldnt_find_local_user";
83
- } | {
84
- error: "couldnt_find_person_mention";
85
- } | {
86
- error: "couldnt_find_registration_application";
87
- } | {
88
- error: "couldnt_find_comment_reply";
89
- } | {
90
- error: "couldnt_find_private_message";
91
- } | {
92
- error: "couldnt_find_activity";
93
69
  } | {
94
70
  error: "person_is_blocked";
95
71
  } | {
@@ -130,8 +106,6 @@ export type LemmyErrorType = {
130
106
  error: "couldnt_update_post";
131
107
  } | {
132
108
  error: "no_post_edit_allowed";
133
- } | {
134
- error: "couldnt_find_post";
135
109
  } | {
136
110
  error: "edit_private_message_not_allowed";
137
111
  } | {
@@ -144,8 +118,12 @@ export type LemmyErrorType = {
144
118
  error: "registration_closed";
145
119
  } | {
146
120
  error: "registration_application_answer_required";
121
+ } | {
122
+ error: "registration_username_required";
147
123
  } | {
148
124
  error: "email_already_exists";
125
+ } | {
126
+ error: "username_already_exists";
149
127
  } | {
150
128
  error: "federation_forbidden_by_strict_allow_list";
151
129
  } | {
@@ -239,8 +217,6 @@ export type LemmyErrorType = {
239
217
  error: "person_block_already_exists";
240
218
  } | {
241
219
  error: "user_already_exists";
242
- } | {
243
- error: "token_not_found";
244
220
  } | {
245
221
  error: "couldnt_like_post";
246
222
  } | {
@@ -283,8 +259,6 @@ export type LemmyErrorType = {
283
259
  error: "email_send_failed";
284
260
  } | {
285
261
  error: "slurs";
286
- } | {
287
- error: "couldnt_find_object";
288
262
  } | {
289
263
  error: "registration_denied";
290
264
  message: string | null;
@@ -334,9 +308,21 @@ export type LemmyErrorType = {
334
308
  error: "url_without_domain";
335
309
  } | {
336
310
  error: "inbox_timeout";
311
+ } | {
312
+ error: "oauth_authorization_invalid";
313
+ } | {
314
+ error: "oauth_login_failed";
315
+ } | {
316
+ error: "oauth_registration_closed";
317
+ } | {
318
+ error: "couldnt_delete_oauth_provider";
337
319
  } | {
338
320
  error: "unknown";
339
321
  message: string;
340
322
  } | {
341
323
  error: "cant_delete_site";
324
+ } | {
325
+ error: "url_length_overflow";
326
+ } | {
327
+ error: "not_found";
342
328
  };
@@ -1,8 +1,8 @@
1
1
  import type { ListingType } from "./ListingType";
2
- import type { SortType } from "./SortType";
2
+ import type { PostSortType } from "./PostSortType";
3
3
  export interface ListCommunities {
4
4
  type_?: ListingType;
5
- sort?: SortType;
5
+ sort?: PostSortType;
6
6
  show_nsfw?: boolean;
7
7
  page?: number;
8
8
  limit?: number;
@@ -0,0 +1,6 @@
1
+ export interface ListCustomEmojis {
2
+ page?: number;
3
+ limit?: number;
4
+ category?: string;
5
+ ignore_page_limits?: boolean;
6
+ }
@@ -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 });
@@ -0,0 +1,4 @@
1
+ import type { CustomEmojiView } from "./CustomEmojiView";
2
+ export interface ListCustomEmojisResponse {
3
+ custom_emojis: Array<CustomEmojiView>;
4
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,4 @@
1
+ import type { LoginToken } from "./LoginToken";
2
+ export interface ListLoginsResponse {
3
+ logins: Array<LoginToken>;
4
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,4 @@
1
+ export interface ListTaglines {
2
+ page?: number;
3
+ limit?: number;
4
+ }
@@ -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 });
@@ -0,0 +1,4 @@
1
+ import type { Tagline } from "./Tagline";
2
+ export interface ListTaglinesResponse {
3
+ taglines: Array<Tagline>;
4
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,15 +1,15 @@
1
+ import type { CommentSortType } from "./CommentSortType";
1
2
  import type { ListingType } from "./ListingType";
2
3
  import type { LocalSiteId } from "./LocalSiteId";
3
4
  import type { PostListingMode } from "./PostListingMode";
5
+ import type { PostSortType } from "./PostSortType";
4
6
  import type { RegistrationMode } from "./RegistrationMode";
5
7
  import type { SiteId } from "./SiteId";
6
- import type { SortType } from "./SortType";
7
8
  export interface LocalSite {
8
9
  id: LocalSiteId;
9
10
  site_id: SiteId;
10
11
  site_setup: boolean;
11
12
  enable_downvotes: boolean;
12
- enable_nsfw: boolean;
13
13
  community_creation_admin_only: boolean;
14
14
  require_email_verification: boolean;
15
15
  application_question?: string;
@@ -30,5 +30,7 @@ export interface LocalSite {
30
30
  reports_email_admins: boolean;
31
31
  federation_signed_fetch: boolean;
32
32
  default_post_listing_mode: PostListingMode;
33
- default_sort_type: SortType;
33
+ default_post_sort_type: PostSortType;
34
+ default_comment_sort_type: CommentSortType;
35
+ oauth_registration: boolean;
34
36
  }
@@ -1,20 +1,20 @@
1
+ import type { CommentSortType } from "./CommentSortType";
1
2
  import type { ListingType } from "./ListingType";
2
3
  import type { LocalUserId } from "./LocalUserId";
3
4
  import type { PersonId } from "./PersonId";
4
5
  import type { PostListingMode } from "./PostListingMode";
5
- import type { SortType } from "./SortType";
6
+ import type { PostSortType } from "./PostSortType";
6
7
  export interface LocalUser {
7
8
  id: LocalUserId;
8
9
  person_id: PersonId;
9
10
  email?: string;
10
11
  show_nsfw: boolean;
11
12
  theme: string;
12
- default_sort_type: SortType;
13
+ default_post_sort_type: PostSortType;
13
14
  default_listing_type: ListingType;
14
15
  interface_language: string;
15
16
  show_avatars: boolean;
16
17
  send_notifications_to_email: boolean;
17
- show_scores: boolean;
18
18
  show_bot_accounts: boolean;
19
19
  show_read_posts: boolean;
20
20
  email_verified: boolean;
@@ -29,4 +29,5 @@ export interface LocalUser {
29
29
  enable_keyboard_navigation: boolean;
30
30
  enable_animated_images: boolean;
31
31
  collapse_bot_comments: boolean;
32
+ default_comment_sort_type: CommentSortType;
32
33
  }
@@ -1,6 +1,4 @@
1
- import type { LocalUserId } from "./LocalUserId";
2
1
  export interface LocalUserVoteDisplayMode {
3
- local_user_id: LocalUserId;
4
2
  score: boolean;
5
3
  upvotes: boolean;
6
4
  downvotes: boolean;
@@ -1,2 +1,3 @@
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.
2
3
  Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,16 +1,16 @@
1
- import type { CommunityBlockView } from "./CommunityBlockView";
1
+ import type { Community } from "./Community";
2
2
  import type { CommunityFollowerView } from "./CommunityFollowerView";
3
3
  import type { CommunityModeratorView } from "./CommunityModeratorView";
4
- import type { InstanceBlockView } from "./InstanceBlockView";
4
+ import type { Instance } from "./Instance";
5
5
  import type { LanguageId } from "./LanguageId";
6
6
  import type { LocalUserView } from "./LocalUserView";
7
- import type { PersonBlockView } from "./PersonBlockView";
7
+ import type { Person } from "./Person";
8
8
  export interface MyUserInfo {
9
9
  local_user_view: LocalUserView;
10
10
  follows: Array<CommunityFollowerView>;
11
11
  moderates: Array<CommunityModeratorView>;
12
- community_blocks: Array<CommunityBlockView>;
13
- instance_blocks: Array<InstanceBlockView>;
14
- person_blocks: Array<PersonBlockView>;
12
+ community_blocks: Array<Community>;
13
+ instance_blocks: Array<Instance>;
14
+ person_blocks: Array<Person>;
15
15
  discussion_languages: Array<LanguageId>;
16
16
  }
@@ -0,0 +1,9 @@
1
+ import type { LocalUserId } from "./LocalUserId";
2
+ import type { OAuthProviderId } from "./OAuthProviderId";
3
+ export interface OAuthAccount {
4
+ local_user_id: LocalUserId;
5
+ oauth_provider_id: OAuthProviderId;
6
+ oauth_user_id: string;
7
+ published: string;
8
+ updated?: string;
9
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,17 @@
1
+ import type { OAuthProviderId } from "./OAuthProviderId";
2
+ export interface OAuthProvider {
3
+ id: OAuthProviderId;
4
+ display_name: string;
5
+ issuer: string;
6
+ authorization_endpoint: string;
7
+ token_endpoint: string;
8
+ userinfo_endpoint: string;
9
+ id_claim: string;
10
+ client_id: string;
11
+ scopes: string;
12
+ auto_verify_email: boolean;
13
+ account_linking_enabled: boolean;
14
+ enabled: boolean;
15
+ published: string;
16
+ updated?: string;
17
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1 @@
1
+ export type OAuthProviderId = number;
@@ -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 });
@@ -0,0 +1,14 @@
1
+ export interface OAuthProviderInsertForm {
2
+ display_name: string;
3
+ issuer: string;
4
+ authorization_endpoint: string;
5
+ token_endpoint: string;
6
+ userinfo_endpoint: string;
7
+ id_claim: string;
8
+ client_id: string;
9
+ client_secret: string;
10
+ scopes: string;
11
+ auto_verify_email: boolean;
12
+ account_linking_enabled: boolean;
13
+ enabled: boolean;
14
+ }
@@ -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 });
@@ -0,0 +1,13 @@
1
+ export interface OAuthProviderUpdateForm {
2
+ display_name: string | null;
3
+ authorization_endpoint: string;
4
+ token_endpoint: string;
5
+ userinfo_endpoint: string;
6
+ id_claim: string | null;
7
+ client_secret: string | null;
8
+ scopes: string | null;
9
+ auto_verify_email: boolean | null;
10
+ account_linking_enabled: boolean | null;
11
+ enabled: boolean | null;
12
+ updated: string | null | null;
13
+ }
@@ -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 });
@@ -0,0 +1 @@
1
+ export type PostSortType = "Active" | "Hot" | "New" | "Old" | "TopDay" | "TopWeek" | "TopMonth" | "TopYear" | "TopAll" | "MostComments" | "NewComments" | "TopHour" | "TopSixHour" | "TopTwelveHour" | "TopThreeMonths" | "TopSixMonths" | "TopNineMonths" | "Controversial" | "Scaled";
@@ -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 });
@@ -0,0 +1,2 @@
1
+ import type { OAuthProvider } from "./OAuthProvider";
2
+ export type PublicOAuthProvider = OAuthProvider;
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,14 +1,17 @@
1
+ import type { CommentSortType } from "./CommentSortType";
1
2
  import type { LanguageId } from "./LanguageId";
2
3
  import type { ListingType } from "./ListingType";
3
4
  import type { PostListingMode } from "./PostListingMode";
4
- import type { SortType } from "./SortType";
5
+ import type { PostSortType } from "./PostSortType";
5
6
  export interface SaveUserSettings {
6
7
  show_nsfw?: boolean;
7
8
  blur_nsfw?: boolean;
8
9
  auto_expand?: boolean;
9
10
  theme?: string;
10
- default_sort_type?: SortType;
11
11
  default_listing_type?: ListingType;
12
+ post_listing_mode?: PostListingMode;
13
+ default_post_sort_type?: PostSortType;
14
+ default_comment_sort_type?: CommentSortType;
12
15
  interface_language?: string;
13
16
  avatar?: string;
14
17
  banner?: string;
@@ -24,7 +27,6 @@ export interface SaveUserSettings {
24
27
  discussion_languages?: Array<LanguageId>;
25
28
  open_links_in_new_tab?: boolean;
26
29
  infinite_scroll_enabled?: boolean;
27
- post_listing_mode?: PostListingMode;
28
30
  enable_keyboard_navigation?: boolean;
29
31
  enable_animated_images?: boolean;
30
32
  collapse_bot_comments?: boolean;
@@ -1,16 +1,17 @@
1
1
  import type { CommunityId } from "./CommunityId";
2
2
  import type { ListingType } from "./ListingType";
3
3
  import type { PersonId } from "./PersonId";
4
+ import type { PostSortType } from "./PostSortType";
4
5
  import type { SearchType } from "./SearchType";
5
- import type { SortType } from "./SortType";
6
6
  export interface Search {
7
7
  q: string;
8
8
  community_id?: CommunityId;
9
9
  community_name?: string;
10
10
  creator_id?: PersonId;
11
11
  type_?: SearchType;
12
- sort?: SortType;
12
+ sort?: PostSortType;
13
13
  listing_type?: ListingType;
14
14
  page?: number;
15
15
  limit?: number;
16
+ post_title_only?: boolean;
16
17
  }
@@ -1,6 +1,4 @@
1
1
  import type { SiteView } from "./SiteView";
2
- import type { Tagline } from "./Tagline";
3
2
  export interface SiteResponse {
4
3
  site_view: SiteView;
5
- taglines: Array<Tagline>;
6
4
  }
@@ -1,7 +1,5 @@
1
- import type { LocalSiteId } from "./LocalSiteId";
2
1
  export interface Tagline {
3
2
  id: number;
4
- local_site_id: LocalSiteId;
5
3
  content: string;
6
4
  published: string;
7
5
  updated?: string;
@@ -1,2 +1,3 @@
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.
2
3
  Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1 @@
1
+ export type TaglineId = number;
@@ -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 });
@@ -0,0 +1,4 @@
1
+ import type { Tagline } from "./Tagline";
2
+ export interface TaglineResponse {
3
+ tagline: Tagline;
4
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,5 @@
1
+ import type { TaglineId } from "./TaglineId";
2
+ export interface UpdateTagline {
3
+ id: TaglineId;
4
+ content: string;
5
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ 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": "0.19.6-beta.1",
4
+ "version": "0.20.0-alpha.10",
5
5
  "author": "Dessalines <tyhou13@gmx.com>",
6
6
  "license": "AGPL-3.0",
7
7
  "main": "./dist/index.js",
@@ -35,7 +35,7 @@
35
35
  "typescript": "^5.5.4",
36
36
  "typescript-eslint": "^8.0.0"
37
37
  },
38
- "packageManager": "pnpm@9.6.0",
38
+ "packageManager": "pnpm@9.11.0",
39
39
  "types": "./dist/index.d.ts",
40
40
  "lint-staged": {
41
41
  "*.{ts,tsx,js}": [
@@ -1,6 +0,0 @@
1
- import type { Community } from "./Community";
2
- import type { Person } from "./Person";
3
- export interface CommunityBlockView {
4
- person: Person;
5
- community: Community;
6
- }
@@ -1,8 +0,0 @@
1
- import type { Instance } from "./Instance";
2
- import type { Person } from "./Person";
3
- import type { Site } from "./Site";
4
- export interface InstanceBlockView {
5
- person: Person;
6
- instance: Instance;
7
- site?: Site;
8
- }
@@ -1,5 +0,0 @@
1
- import type { Person } from "./Person";
2
- export interface PersonBlockView {
3
- person: Person;
4
- target: Person;
5
- }
@@ -1 +0,0 @@
1
- export type SortType = "Active" | "Hot" | "New" | "Old" | "TopDay" | "TopWeek" | "TopMonth" | "TopYear" | "TopAll" | "MostComments" | "NewComments" | "TopHour" | "TopSixHour" | "TopTwelveHour" | "TopThreeMonths" | "TopSixMonths" | "TopNineMonths" | "Controversial" | "Scaled";