lemmy-js-client 0.20.0-reports-combined.2 → 0.20.0-reports-combined.3
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 +53 -33
- package/dist/http.js +88 -64
- package/dist/other_types.d.ts +1 -1
- package/dist/other_types.js +1 -1
- package/dist/types/GetSiteResponse.d.ts +0 -2
- package/package.json +2 -2
package/dist/http.d.ts
CHANGED
@@ -5,6 +5,7 @@ import { AddModToCommunityResponse } from "./types/AddModToCommunityResponse";
|
|
5
5
|
import { ApproveRegistrationApplication } from "./types/ApproveRegistrationApplication";
|
6
6
|
import { BanFromCommunity } from "./types/BanFromCommunity";
|
7
7
|
import { BanFromCommunityResponse } from "./types/BanFromCommunityResponse";
|
8
|
+
import { MarkManyPostsAsRead } from "./types/MarkManyPostsAsRead";
|
8
9
|
import { BanPerson } from "./types/BanPerson";
|
9
10
|
import { BanPersonResponse } from "./types/BanPersonResponse";
|
10
11
|
import { BannedPersonsResponse } from "./types/BannedPersonsResponse";
|
@@ -148,6 +149,7 @@ import { ListCommunityPendingFollows } from "./types/ListCommunityPendingFollows
|
|
148
149
|
import { CommunityId } from "./types/CommunityId";
|
149
150
|
import { ListReports } from "./types/ListReports";
|
150
151
|
import { ListReportsResponse } from "./types/ListReportsResponse";
|
152
|
+
import { MyUserInfo } from "./types/MyUserInfo";
|
151
153
|
import { UserBlockInstanceParams } from "./types/UserBlockInstanceParams";
|
152
154
|
import { AdminAllowInstanceParams } from "./types/AdminAllowInstanceParams";
|
153
155
|
import { AdminBlockInstanceParams } from "./types/AdminBlockInstanceParams";
|
@@ -189,40 +191,46 @@ export declare class LemmyHttp {
|
|
189
191
|
/**
|
190
192
|
* Leave the Site admins.
|
191
193
|
*
|
192
|
-
* `HTTP.POST /
|
194
|
+
* `HTTP.POST /admin/leave`
|
193
195
|
*/
|
194
196
|
leaveAdmin(options?: RequestOptions): Promise<GetSiteResponse>;
|
195
197
|
/**
|
196
198
|
* Generate a TOTP / two-factor secret.
|
197
199
|
*
|
198
|
-
* Afterwards you need to call `/
|
200
|
+
* Afterwards you need to call `/account/auth/totp/update` with a valid token to enable it.
|
199
201
|
*
|
200
|
-
* `HTTP.POST /
|
202
|
+
* `HTTP.POST /account/auth/totp/generate`
|
201
203
|
*/
|
202
204
|
generateTotpSecret(options?: RequestOptions): Promise<GenerateTotpSecretResponse>;
|
205
|
+
/**
|
206
|
+
* Get data of current user.
|
207
|
+
*
|
208
|
+
* `HTTP.GET /account`
|
209
|
+
*/
|
210
|
+
getMyUser(options?: RequestOptions): Promise<MyUserInfo>;
|
203
211
|
/**
|
204
212
|
* Export a backup of your user settings, including your saved content,
|
205
213
|
* followed communities, and blocks.
|
206
214
|
*
|
207
|
-
* `HTTP.GET /
|
215
|
+
* `HTTP.GET /account/settings/export`
|
208
216
|
*/
|
209
217
|
exportSettings(options?: RequestOptions): Promise<string>;
|
210
218
|
/**
|
211
219
|
* Import a backup of your user settings.
|
212
220
|
*
|
213
|
-
* `HTTP.POST /
|
221
|
+
* `HTTP.POST /account/settings/import`
|
214
222
|
*/
|
215
223
|
importSettings(form: any, options?: RequestOptions): Promise<SuccessResponse>;
|
216
224
|
/**
|
217
225
|
* List login tokens for your user
|
218
226
|
*
|
219
|
-
* `HTTP.GET /
|
227
|
+
* `HTTP.GET /account/list_logins`
|
220
228
|
*/
|
221
229
|
listLogins(options?: RequestOptions): Promise<LoginToken[]>;
|
222
230
|
/**
|
223
231
|
* Returns an error message if your auth token is invalid
|
224
232
|
*
|
225
|
-
* `HTTP.GET /
|
233
|
+
* `HTTP.GET /account/validate_auth`
|
226
234
|
*/
|
227
235
|
validateAuth(options?: RequestOptions): Promise<SuccessResponse>;
|
228
236
|
/**
|
@@ -240,11 +248,11 @@ export declare class LemmyHttp {
|
|
240
248
|
/**
|
241
249
|
* Enable / Disable TOTP / two-factor authentication.
|
242
250
|
*
|
243
|
-
* To enable, you need to first call `/
|
251
|
+
* To enable, you need to first call `/account/auth/totp/generate` and then pass a valid token to this.
|
244
252
|
*
|
245
253
|
* Disabling is only possible if 2FA was previously enabled. Again it is necessary to pass a valid token.
|
246
254
|
*
|
247
|
-
* `HTTP.POST /
|
255
|
+
* `HTTP.POST /account/auth/totp/update`
|
248
256
|
*/
|
249
257
|
updateTotp(form: UpdateTotp, options?: RequestOptions): Promise<UpdateTotpResponse>;
|
250
258
|
/**
|
@@ -301,7 +309,7 @@ export declare class LemmyHttp {
|
|
301
309
|
/**
|
302
310
|
* Block a community.
|
303
311
|
*
|
304
|
-
* `HTTP.POST /
|
312
|
+
* `HTTP.POST /account/block/community`
|
305
313
|
*/
|
306
314
|
blockCommunity(form: BlockCommunity, options?: RequestOptions): Promise<BlockCommunityResponse>;
|
307
315
|
/**
|
@@ -382,6 +390,12 @@ export declare class LemmyHttp {
|
|
382
390
|
* `HTTP.POST /post/mark_as_read`
|
383
391
|
*/
|
384
392
|
markPostAsRead(form: MarkPostAsRead, options?: RequestOptions): Promise<SuccessResponse>;
|
393
|
+
/**
|
394
|
+
* Mark multiple posts as read.
|
395
|
+
*
|
396
|
+
* `HTTP.POST /post/mark_as_read/many`
|
397
|
+
*/
|
398
|
+
markManyPostAsRead(form: MarkManyPostsAsRead, options?: RequestOptions): Promise<SuccessResponse>;
|
385
399
|
/**
|
386
400
|
* Hide a post from list views.
|
387
401
|
*
|
@@ -565,121 +579,127 @@ export declare class LemmyHttp {
|
|
565
579
|
/**
|
566
580
|
* Register a new user.
|
567
581
|
*
|
568
|
-
* `HTTP.POST /
|
582
|
+
* `HTTP.POST /account/auth/register`
|
569
583
|
*/
|
570
584
|
register(form: Register, options?: RequestOptions): Promise<LoginResponse>;
|
571
585
|
/**
|
572
586
|
* Log into lemmy.
|
573
587
|
*
|
574
|
-
* `HTTP.POST /
|
588
|
+
* `HTTP.POST /account/auth/login`
|
575
589
|
*/
|
576
590
|
login(form: Login, options?: RequestOptions): Promise<LoginResponse>;
|
577
591
|
/**
|
578
592
|
* Invalidate the currently used auth token.
|
579
593
|
*
|
580
|
-
* `HTTP.POST /
|
594
|
+
* `HTTP.POST /account/auth/logout`
|
581
595
|
*/
|
582
596
|
logout(options?: RequestOptions): Promise<SuccessResponse>;
|
583
597
|
/**
|
584
598
|
* Get the details for a person.
|
585
599
|
*
|
586
|
-
* `HTTP.GET /
|
600
|
+
* `HTTP.GET /person`
|
587
601
|
*/
|
588
602
|
getPersonDetails(form?: GetPersonDetails, options?: RequestOptions): Promise<GetPersonDetailsResponse>;
|
589
603
|
/**
|
590
604
|
* Get mentions for your user.
|
591
605
|
*
|
592
|
-
* `HTTP.GET /
|
606
|
+
* `HTTP.GET /account/mention`
|
593
607
|
*/
|
594
608
|
getPersonMentions(form: GetPersonMentions, options?: RequestOptions): Promise<GetPersonMentionsResponse>;
|
595
609
|
/**
|
596
610
|
* Mark a person mention as read.
|
597
611
|
*
|
598
|
-
* `HTTP.POST /
|
612
|
+
* `HTTP.POST /account/mention/mark_as_read`
|
599
613
|
*/
|
600
614
|
markPersonMentionAsRead(form: MarkPersonMentionAsRead, options?: RequestOptions): Promise<PersonMentionResponse>;
|
615
|
+
/**
|
616
|
+
* Mark a person mention as read.
|
617
|
+
*
|
618
|
+
* `HTTP.POST /account/mention/mark_as_read`
|
619
|
+
*/
|
620
|
+
markPersonAllMentionAsRead(options?: RequestOptions): Promise<PersonMentionResponse>;
|
601
621
|
/**
|
602
622
|
* Get comment replies.
|
603
623
|
*
|
604
|
-
* `HTTP.GET /
|
624
|
+
* `HTTP.GET /account/replies`
|
605
625
|
*/
|
606
626
|
getReplies(form: GetReplies, options?: RequestOptions): Promise<GetRepliesResponse>;
|
607
627
|
/**
|
608
628
|
* Ban a person from your site.
|
609
629
|
*
|
610
|
-
* `HTTP.POST /
|
630
|
+
* `HTTP.POST /admin/ban`
|
611
631
|
*/
|
612
632
|
banPerson(form: BanPerson, options?: RequestOptions): Promise<BanPersonResponse>;
|
613
633
|
/**
|
614
634
|
* Get a list of banned users
|
615
635
|
*
|
616
|
-
* `HTTP.GET /
|
636
|
+
* `HTTP.GET /admin/banned`
|
617
637
|
*/
|
618
638
|
getBannedPersons(options?: RequestOptions): Promise<BannedPersonsResponse>;
|
619
639
|
/**
|
620
640
|
* Block a person.
|
621
641
|
*
|
622
|
-
* `HTTP.POST /
|
642
|
+
* `HTTP.POST /account/block/person`
|
623
643
|
*/
|
624
644
|
blockPerson(form: BlockPerson, options?: RequestOptions): Promise<BlockPersonResponse>;
|
625
645
|
/**
|
626
646
|
* Fetch a Captcha.
|
627
647
|
*
|
628
|
-
* `HTTP.GET /
|
648
|
+
* `HTTP.GET /account/auth/get_captcha`
|
629
649
|
*/
|
630
650
|
getCaptcha(options?: RequestOptions): Promise<GetCaptchaResponse>;
|
631
651
|
/**
|
632
652
|
* Delete your account.
|
633
653
|
*
|
634
|
-
* `HTTP.POST /
|
654
|
+
* `HTTP.POST /account/delete`
|
635
655
|
*/
|
636
656
|
deleteAccount(form: DeleteAccount, options?: RequestOptions): Promise<SuccessResponse>;
|
637
657
|
/**
|
638
658
|
* Reset your password.
|
639
659
|
*
|
640
|
-
* `HTTP.POST /
|
660
|
+
* `HTTP.POST /account/auth/password_reset`
|
641
661
|
*/
|
642
662
|
passwordReset(form: PasswordReset, options?: RequestOptions): Promise<SuccessResponse>;
|
643
663
|
/**
|
644
664
|
* Change your password from an email / token based reset.
|
645
665
|
*
|
646
|
-
* `HTTP.POST /
|
666
|
+
* `HTTP.POST /account/auth/password_change`
|
647
667
|
*/
|
648
668
|
passwordChangeAfterReset(form: PasswordChangeAfterReset, options?: RequestOptions): Promise<SuccessResponse>;
|
649
669
|
/**
|
650
670
|
* Mark all replies as read.
|
651
671
|
*
|
652
|
-
* `HTTP.POST /
|
672
|
+
* `HTTP.POST /account/mention/mark_as_read/all`
|
653
673
|
*/
|
654
674
|
markAllAsRead(options?: RequestOptions): Promise<GetRepliesResponse>;
|
655
675
|
/**
|
656
676
|
* Save your user settings.
|
657
677
|
*
|
658
|
-
* `HTTP.PUT /
|
678
|
+
* `HTTP.PUT /account/settings/save`
|
659
679
|
*/
|
660
680
|
saveUserSettings(form: SaveUserSettings, options?: RequestOptions): Promise<SuccessResponse>;
|
661
681
|
/**
|
662
682
|
* Change your user password.
|
663
683
|
*
|
664
|
-
* `HTTP.PUT /
|
684
|
+
* `HTTP.PUT /account/auth/change_password`
|
665
685
|
*/
|
666
686
|
changePassword(form: ChangePassword, options?: RequestOptions): Promise<LoginResponse>;
|
667
687
|
/**
|
668
688
|
* Get counts for your reports
|
669
689
|
*
|
670
|
-
* `HTTP.GET /
|
690
|
+
* `HTTP.GET /account/report_count`
|
671
691
|
*/
|
672
692
|
getReportCount(form: GetReportCount, options?: RequestOptions): Promise<GetReportCountResponse>;
|
673
693
|
/**
|
674
694
|
* Get your unread counts
|
675
695
|
*
|
676
|
-
* `HTTP.GET /
|
696
|
+
* `HTTP.GET /account/unread_count`
|
677
697
|
*/
|
678
698
|
getUnreadCount(options?: RequestOptions): Promise<GetUnreadCountResponse>;
|
679
699
|
/**
|
680
700
|
* Verify your email
|
681
701
|
*
|
682
|
-
* `HTTP.POST /
|
702
|
+
* `HTTP.POST /account/auth/verify_email`
|
683
703
|
*/
|
684
704
|
verifyEmail(form: VerifyEmail, options?: RequestOptions): Promise<SuccessResponse>;
|
685
705
|
/**
|
@@ -823,19 +843,19 @@ export declare class LemmyHttp {
|
|
823
843
|
/**
|
824
844
|
* Block an instance as user.
|
825
845
|
*
|
826
|
-
* `HTTP.Post /
|
846
|
+
* `HTTP.Post /account/block/instance`
|
827
847
|
*/
|
828
848
|
userBlockInstance(form: UserBlockInstanceParams, options?: RequestOptions): Promise<SuccessResponse>;
|
829
849
|
/**
|
830
850
|
* Globally block an instance as admin.
|
831
851
|
*
|
832
|
-
* `HTTP.Post /admin/
|
852
|
+
* `HTTP.Post /admin/instance/block`
|
833
853
|
*/
|
834
854
|
adminBlockInstance(form: AdminBlockInstanceParams, options?: RequestOptions): Promise<SuccessResponse>;
|
835
855
|
/**
|
836
856
|
* Globally allow an instance as admin.
|
837
857
|
*
|
838
|
-
* `HTTP.Post /admin/
|
858
|
+
* `HTTP.Post /admin/instance/allow`
|
839
859
|
*/
|
840
860
|
adminAllowInstance(form: AdminAllowInstanceParams, options?: RequestOptions): Promise<SuccessResponse>;
|
841
861
|
/**
|
package/dist/http.js
CHANGED
@@ -80,53 +80,61 @@ class LemmyHttp {
|
|
80
80
|
/**
|
81
81
|
* Leave the Site admins.
|
82
82
|
*
|
83
|
-
* `HTTP.POST /
|
83
|
+
* `HTTP.POST /admin/leave`
|
84
84
|
*/
|
85
85
|
leaveAdmin(options) {
|
86
|
-
return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Post, "/
|
86
|
+
return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Post, "/admin/leave", {}, options);
|
87
87
|
}
|
88
88
|
/**
|
89
89
|
* Generate a TOTP / two-factor secret.
|
90
90
|
*
|
91
|
-
* Afterwards you need to call `/
|
91
|
+
* Afterwards you need to call `/account/auth/totp/update` with a valid token to enable it.
|
92
92
|
*
|
93
|
-
* `HTTP.POST /
|
93
|
+
* `HTTP.POST /account/auth/totp/generate`
|
94
94
|
*/
|
95
95
|
generateTotpSecret(options) {
|
96
|
-
return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Post, "/
|
96
|
+
return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Post, "/account/auth/totp/generate", {}, options);
|
97
|
+
}
|
98
|
+
/**
|
99
|
+
* Get data of current user.
|
100
|
+
*
|
101
|
+
* `HTTP.GET /account`
|
102
|
+
*/
|
103
|
+
getMyUser(options) {
|
104
|
+
return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Get, "/account", {}, options);
|
97
105
|
}
|
98
106
|
/**
|
99
107
|
* Export a backup of your user settings, including your saved content,
|
100
108
|
* followed communities, and blocks.
|
101
109
|
*
|
102
|
-
* `HTTP.GET /
|
110
|
+
* `HTTP.GET /account/settings/export`
|
103
111
|
*/
|
104
112
|
exportSettings(options) {
|
105
|
-
return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Get, "/
|
113
|
+
return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Get, "/account/settings/export", {}, options);
|
106
114
|
}
|
107
115
|
/**
|
108
116
|
* Import a backup of your user settings.
|
109
117
|
*
|
110
|
-
* `HTTP.POST /
|
118
|
+
* `HTTP.POST /account/settings/import`
|
111
119
|
*/
|
112
120
|
importSettings(form, options) {
|
113
|
-
return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Post, "/
|
121
|
+
return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Post, "/account/settings/import", form, options);
|
114
122
|
}
|
115
123
|
/**
|
116
124
|
* List login tokens for your user
|
117
125
|
*
|
118
|
-
* `HTTP.GET /
|
126
|
+
* `HTTP.GET /account/list_logins`
|
119
127
|
*/
|
120
128
|
listLogins(options) {
|
121
|
-
return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Get, "/
|
129
|
+
return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Get, "/account/list_logins", {}, options);
|
122
130
|
}
|
123
131
|
/**
|
124
132
|
* Returns an error message if your auth token is invalid
|
125
133
|
*
|
126
|
-
* `HTTP.GET /
|
134
|
+
* `HTTP.GET /account/validate_auth`
|
127
135
|
*/
|
128
136
|
validateAuth(options) {
|
129
|
-
return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Get, "/
|
137
|
+
return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Get, "/account/validate_auth", {}, options);
|
130
138
|
}
|
131
139
|
/**
|
132
140
|
* List all the media for your user
|
@@ -147,14 +155,14 @@ class LemmyHttp {
|
|
147
155
|
/**
|
148
156
|
* Enable / Disable TOTP / two-factor authentication.
|
149
157
|
*
|
150
|
-
* To enable, you need to first call `/
|
158
|
+
* To enable, you need to first call `/account/auth/totp/generate` and then pass a valid token to this.
|
151
159
|
*
|
152
160
|
* Disabling is only possible if 2FA was previously enabled. Again it is necessary to pass a valid token.
|
153
161
|
*
|
154
|
-
* `HTTP.POST /
|
162
|
+
* `HTTP.POST /account/auth/totp/update`
|
155
163
|
*/
|
156
164
|
updateTotp(form, options) {
|
157
|
-
return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Post, "/
|
165
|
+
return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Post, "/account/auth/totp/update", form, options);
|
158
166
|
}
|
159
167
|
/**
|
160
168
|
* Get the modlog.
|
@@ -233,10 +241,10 @@ class LemmyHttp {
|
|
233
241
|
/**
|
234
242
|
* Block a community.
|
235
243
|
*
|
236
|
-
* `HTTP.POST /
|
244
|
+
* `HTTP.POST /account/block/community`
|
237
245
|
*/
|
238
246
|
blockCommunity(form, options) {
|
239
|
-
return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Post, "/
|
247
|
+
return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Post, "/account/block/community", form, options);
|
240
248
|
}
|
241
249
|
/**
|
242
250
|
* Delete a community.
|
@@ -342,6 +350,14 @@ class LemmyHttp {
|
|
342
350
|
markPostAsRead(form, options) {
|
343
351
|
return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Post, "/post/mark_as_read", form, options);
|
344
352
|
}
|
353
|
+
/**
|
354
|
+
* Mark multiple posts as read.
|
355
|
+
*
|
356
|
+
* `HTTP.POST /post/mark_as_read/many`
|
357
|
+
*/
|
358
|
+
markManyPostAsRead(form, options) {
|
359
|
+
return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Post, "/post/mark_as_read/many", form, options);
|
360
|
+
}
|
345
361
|
/**
|
346
362
|
* Hide a post from list views.
|
347
363
|
*
|
@@ -585,162 +601,170 @@ class LemmyHttp {
|
|
585
601
|
/**
|
586
602
|
* Register a new user.
|
587
603
|
*
|
588
|
-
* `HTTP.POST /
|
604
|
+
* `HTTP.POST /account/auth/register`
|
589
605
|
*/
|
590
606
|
register(form, options) {
|
591
|
-
return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Post, "/
|
607
|
+
return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Post, "/account/auth/register", form, options);
|
592
608
|
}
|
593
609
|
/**
|
594
610
|
* Log into lemmy.
|
595
611
|
*
|
596
|
-
* `HTTP.POST /
|
612
|
+
* `HTTP.POST /account/auth/login`
|
597
613
|
*/
|
598
614
|
login(form, options) {
|
599
|
-
return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Post, "/
|
615
|
+
return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Post, "/account/auth/login", form, options);
|
600
616
|
}
|
601
617
|
/**
|
602
618
|
* Invalidate the currently used auth token.
|
603
619
|
*
|
604
|
-
* `HTTP.POST /
|
620
|
+
* `HTTP.POST /account/auth/logout`
|
605
621
|
*/
|
606
622
|
logout(options) {
|
607
|
-
return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Post, "/
|
623
|
+
return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Post, "/account/auth/logout", {}, options);
|
608
624
|
}
|
609
625
|
/**
|
610
626
|
* Get the details for a person.
|
611
627
|
*
|
612
|
-
* `HTTP.GET /
|
628
|
+
* `HTTP.GET /person`
|
613
629
|
*/
|
614
630
|
getPersonDetails(form = {}, options) {
|
615
|
-
return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Get, "/
|
631
|
+
return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Get, "/person", form, options);
|
616
632
|
}
|
617
633
|
/**
|
618
634
|
* Get mentions for your user.
|
619
635
|
*
|
620
|
-
* `HTTP.GET /
|
636
|
+
* `HTTP.GET /account/mention`
|
621
637
|
*/
|
622
638
|
getPersonMentions(form, options) {
|
623
|
-
return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Get, "/
|
639
|
+
return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Get, "/account/mention", form, options);
|
624
640
|
}
|
625
641
|
/**
|
626
642
|
* Mark a person mention as read.
|
627
643
|
*
|
628
|
-
* `HTTP.POST /
|
644
|
+
* `HTTP.POST /account/mention/mark_as_read`
|
629
645
|
*/
|
630
646
|
markPersonMentionAsRead(form, options) {
|
631
|
-
return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Post, "/
|
647
|
+
return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Post, "/account/mention/mark_as_read", form, options);
|
648
|
+
}
|
649
|
+
/**
|
650
|
+
* Mark a person mention as read.
|
651
|
+
*
|
652
|
+
* `HTTP.POST /account/mention/mark_as_read`
|
653
|
+
*/
|
654
|
+
markPersonAllMentionAsRead(options) {
|
655
|
+
return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Post, "/account/mention/mark_as_read", {}, options);
|
632
656
|
}
|
633
657
|
/**
|
634
658
|
* Get comment replies.
|
635
659
|
*
|
636
|
-
* `HTTP.GET /
|
660
|
+
* `HTTP.GET /account/replies`
|
637
661
|
*/
|
638
662
|
getReplies(form, options) {
|
639
|
-
return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Get, "/
|
663
|
+
return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Get, "/account/replies", form, options);
|
640
664
|
}
|
641
665
|
/**
|
642
666
|
* Ban a person from your site.
|
643
667
|
*
|
644
|
-
* `HTTP.POST /
|
668
|
+
* `HTTP.POST /admin/ban`
|
645
669
|
*/
|
646
670
|
banPerson(form, options) {
|
647
|
-
return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Post, "/
|
671
|
+
return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Post, "/admin/ban", form, options);
|
648
672
|
}
|
649
673
|
/**
|
650
674
|
* Get a list of banned users
|
651
675
|
*
|
652
|
-
* `HTTP.GET /
|
676
|
+
* `HTTP.GET /admin/banned`
|
653
677
|
*/
|
654
678
|
getBannedPersons(options) {
|
655
|
-
return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Get, "/
|
679
|
+
return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Get, "/admin/banned", {}, options);
|
656
680
|
}
|
657
681
|
/**
|
658
682
|
* Block a person.
|
659
683
|
*
|
660
|
-
* `HTTP.POST /
|
684
|
+
* `HTTP.POST /account/block/person`
|
661
685
|
*/
|
662
686
|
blockPerson(form, options) {
|
663
|
-
return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Post, "/
|
687
|
+
return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Post, "/account/block/person", form, options);
|
664
688
|
}
|
665
689
|
/**
|
666
690
|
* Fetch a Captcha.
|
667
691
|
*
|
668
|
-
* `HTTP.GET /
|
692
|
+
* `HTTP.GET /account/auth/get_captcha`
|
669
693
|
*/
|
670
694
|
getCaptcha(options) {
|
671
|
-
return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Get, "/
|
695
|
+
return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Get, "/account/auth/get_captcha", {}, options);
|
672
696
|
}
|
673
697
|
/**
|
674
698
|
* Delete your account.
|
675
699
|
*
|
676
|
-
* `HTTP.POST /
|
700
|
+
* `HTTP.POST /account/delete`
|
677
701
|
*/
|
678
702
|
deleteAccount(form, options) {
|
679
|
-
return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Post, "/
|
703
|
+
return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Post, "/account/delete", form, options);
|
680
704
|
}
|
681
705
|
/**
|
682
706
|
* Reset your password.
|
683
707
|
*
|
684
|
-
* `HTTP.POST /
|
708
|
+
* `HTTP.POST /account/auth/password_reset`
|
685
709
|
*/
|
686
710
|
passwordReset(form, options) {
|
687
|
-
return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Post, "/
|
711
|
+
return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Post, "/account/auth/password_reset", form, options);
|
688
712
|
}
|
689
713
|
/**
|
690
714
|
* Change your password from an email / token based reset.
|
691
715
|
*
|
692
|
-
* `HTTP.POST /
|
716
|
+
* `HTTP.POST /account/auth/password_change`
|
693
717
|
*/
|
694
718
|
passwordChangeAfterReset(form, options) {
|
695
|
-
return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Post, "/
|
719
|
+
return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Post, "/account/auth/password_change", form, options);
|
696
720
|
}
|
697
721
|
/**
|
698
722
|
* Mark all replies as read.
|
699
723
|
*
|
700
|
-
* `HTTP.POST /
|
724
|
+
* `HTTP.POST /account/mention/mark_as_read/all`
|
701
725
|
*/
|
702
726
|
markAllAsRead(options) {
|
703
|
-
return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Post, "/
|
727
|
+
return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Post, "/account/mention/mark_as_read/all", {}, options);
|
704
728
|
}
|
705
729
|
/**
|
706
730
|
* Save your user settings.
|
707
731
|
*
|
708
|
-
* `HTTP.PUT /
|
732
|
+
* `HTTP.PUT /account/settings/save`
|
709
733
|
*/
|
710
734
|
saveUserSettings(form, options) {
|
711
|
-
return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Put, "/
|
735
|
+
return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Put, "/account/settings/save", form, options);
|
712
736
|
}
|
713
737
|
/**
|
714
738
|
* Change your user password.
|
715
739
|
*
|
716
|
-
* `HTTP.PUT /
|
740
|
+
* `HTTP.PUT /account/auth/change_password`
|
717
741
|
*/
|
718
742
|
changePassword(form, options) {
|
719
|
-
return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Put, "/
|
743
|
+
return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Put, "/account/auth/change_password", form, options);
|
720
744
|
}
|
721
745
|
/**
|
722
746
|
* Get counts for your reports
|
723
747
|
*
|
724
|
-
* `HTTP.GET /
|
748
|
+
* `HTTP.GET /account/report_count`
|
725
749
|
*/
|
726
750
|
getReportCount(form, options) {
|
727
|
-
return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Get, "/
|
751
|
+
return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Get, "/account/report_count", form, options);
|
728
752
|
}
|
729
753
|
/**
|
730
754
|
* Get your unread counts
|
731
755
|
*
|
732
|
-
* `HTTP.GET /
|
756
|
+
* `HTTP.GET /account/unread_count`
|
733
757
|
*/
|
734
758
|
getUnreadCount(options) {
|
735
|
-
return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Get, "/
|
759
|
+
return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Get, "/account/unread_count", {}, options);
|
736
760
|
}
|
737
761
|
/**
|
738
762
|
* Verify your email
|
739
763
|
*
|
740
|
-
* `HTTP.POST /
|
764
|
+
* `HTTP.POST /account/auth/verify_email`
|
741
765
|
*/
|
742
766
|
verifyEmail(form, options) {
|
743
|
-
return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Post, "/
|
767
|
+
return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Post, "/account/auth/verify_email", form, options);
|
744
768
|
}
|
745
769
|
/**
|
746
770
|
* Add an admin to your site.
|
@@ -929,26 +953,26 @@ class LemmyHttp {
|
|
929
953
|
/**
|
930
954
|
* Block an instance as user.
|
931
955
|
*
|
932
|
-
* `HTTP.Post /
|
956
|
+
* `HTTP.Post /account/block/instance`
|
933
957
|
*/
|
934
958
|
userBlockInstance(form, options) {
|
935
|
-
return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Post, "/
|
959
|
+
return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Post, "/account/block/instance", form, options);
|
936
960
|
}
|
937
961
|
/**
|
938
962
|
* Globally block an instance as admin.
|
939
963
|
*
|
940
|
-
* `HTTP.Post /admin/
|
964
|
+
* `HTTP.Post /admin/instance/block`
|
941
965
|
*/
|
942
966
|
adminBlockInstance(form, options) {
|
943
|
-
return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Post, "/admin/
|
967
|
+
return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Post, "/admin/instance/block", form, options);
|
944
968
|
}
|
945
969
|
/**
|
946
970
|
* Globally allow an instance as admin.
|
947
971
|
*
|
948
|
-
* `HTTP.Post /admin/
|
972
|
+
* `HTTP.Post /admin/instance/allow`
|
949
973
|
*/
|
950
974
|
adminAllowInstance(form, options) {
|
951
|
-
return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Post, "/admin/
|
975
|
+
return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Post, "/admin/instance/allow", form, options);
|
952
976
|
}
|
953
977
|
/**
|
954
978
|
* Upload an image to the server.
|
package/dist/other_types.d.ts
CHANGED
package/dist/other_types.js
CHANGED
@@ -1,7 +1,6 @@
|
|
1
1
|
import type { Language } from "./Language";
|
2
2
|
import type { LanguageId } from "./LanguageId";
|
3
3
|
import type { LocalSiteUrlBlocklist } from "./LocalSiteUrlBlocklist";
|
4
|
-
import type { MyUserInfo } from "./MyUserInfo";
|
5
4
|
import type { OAuthProvider } from "./OAuthProvider";
|
6
5
|
import type { PersonView } from "./PersonView";
|
7
6
|
import type { PublicOAuthProvider } from "./PublicOAuthProvider";
|
@@ -14,7 +13,6 @@ export type GetSiteResponse = {
|
|
14
13
|
site_view: SiteView;
|
15
14
|
admins: Array<PersonView>;
|
16
15
|
version: string;
|
17
|
-
my_user?: MyUserInfo;
|
18
16
|
all_languages: Array<Language>;
|
19
17
|
discussion_languages: Array<LanguageId>;
|
20
18
|
/**
|
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.20.0-reports-combined.
|
4
|
+
"version": "0.20.0-reports-combined.3",
|
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.7.0"
|
37
37
|
},
|
38
|
-
"packageManager": "pnpm@9.
|
38
|
+
"packageManager": "pnpm@9.15.0",
|
39
39
|
"types": "./dist/index.d.ts",
|
40
40
|
"lint-staged": {
|
41
41
|
"*.{ts,tsx,js}": [
|