lemmy-js-client 0.19.0-rc.11 → 0.19.0-rc.13
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 +29 -0
- package/dist/http.js +30 -0
- package/dist/index.d.ts +3 -0
- package/dist/types/BlockInstance.d.ts +0 -1
- package/dist/types/GenerateTotpSecretResponse.d.ts +3 -0
- package/dist/types/GenerateTotpSecretResponse.js +3 -0
- package/dist/types/LocalUser.d.ts +1 -1
- package/dist/types/SaveUserSettings.d.ts +0 -1
- package/dist/types/UpdateTotp.d.ts +4 -0
- package/dist/types/UpdateTotp.js +3 -0
- package/dist/types/UpdateTotpResponse.d.ts +3 -0
- package/dist/types/UpdateTotpResponse.js +3 -0
- package/package.json +1 -1
package/dist/http.d.ts
CHANGED
@@ -126,6 +126,11 @@ import { VerifyEmail } from "./types/VerifyEmail";
|
|
126
126
|
import { VerifyEmailResponse } from "./types/VerifyEmailResponse";
|
127
127
|
import { UploadImage, UploadImageResponse } from "./types/others";
|
128
128
|
import { HideCommunity } from "./types/HideCommunity";
|
129
|
+
import { BlockInstance } from "./types/BlockInstance";
|
130
|
+
import { BlockInstanceResponse } from "./types/BlockInstanceResponse";
|
131
|
+
import { GenerateTotpSecretResponse } from "./types/GenerateTotpSecretResponse";
|
132
|
+
import { UpdateTotp } from "./types/UpdateTotp";
|
133
|
+
import { UpdateTotpResponse } from "./types/UpdateTotpResponse";
|
129
134
|
/**
|
130
135
|
* Helps build lemmy HTTP requests.
|
131
136
|
*/
|
@@ -166,6 +171,24 @@ export declare class LemmyHttp {
|
|
166
171
|
* `HTTP.POST /user/leave_admin`
|
167
172
|
*/
|
168
173
|
leaveAdmin(): Promise<GetSiteResponse>;
|
174
|
+
/**
|
175
|
+
* Generate a TOTP / two-factor secret.
|
176
|
+
*
|
177
|
+
* Afterwards you need to call `/user/totp/update` with a valid token to enable it.
|
178
|
+
*
|
179
|
+
* `HTTP.POST /user/totp/generate`
|
180
|
+
*/
|
181
|
+
generateTotpSecret(): Promise<GenerateTotpSecretResponse>;
|
182
|
+
/**
|
183
|
+
* Enable / Disable TOTP / two-factor authentication.
|
184
|
+
*
|
185
|
+
* To enable, you need to first call `/user/totp/generate` and then pass a valid token to this.
|
186
|
+
*
|
187
|
+
* Disabling is only possible if 2FA was previously enabled. Again it is necessary to pass a valid token.
|
188
|
+
*
|
189
|
+
* `HTTP.POST /user/totp/update`
|
190
|
+
*/
|
191
|
+
updateTotp(form: UpdateTotp): Promise<UpdateTotpResponse>;
|
169
192
|
/**
|
170
193
|
* Get the modlog.
|
171
194
|
*
|
@@ -658,6 +681,12 @@ export declare class LemmyHttp {
|
|
658
681
|
* `HTTP.Get /federated_instances`
|
659
682
|
*/
|
660
683
|
getFederatedInstances(): Promise<GetFederatedInstancesResponse>;
|
684
|
+
/**
|
685
|
+
* Block an instance.
|
686
|
+
*
|
687
|
+
* `HTTP.Post /site/block`
|
688
|
+
*/
|
689
|
+
blockInstance(form: BlockInstance): Promise<BlockInstanceResponse>;
|
661
690
|
/**
|
662
691
|
* Upload an image to the server.
|
663
692
|
*/
|
package/dist/http.js
CHANGED
@@ -90,6 +90,28 @@ class LemmyHttp {
|
|
90
90
|
leaveAdmin() {
|
91
91
|
return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Post, "/user/leave_admin", {});
|
92
92
|
}
|
93
|
+
/**
|
94
|
+
* Generate a TOTP / two-factor secret.
|
95
|
+
*
|
96
|
+
* Afterwards you need to call `/user/totp/update` with a valid token to enable it.
|
97
|
+
*
|
98
|
+
* `HTTP.POST /user/totp/generate`
|
99
|
+
*/
|
100
|
+
generateTotpSecret() {
|
101
|
+
return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Post, "/user/totp/generate", {});
|
102
|
+
}
|
103
|
+
/**
|
104
|
+
* Enable / Disable TOTP / two-factor authentication.
|
105
|
+
*
|
106
|
+
* To enable, you need to first call `/user/totp/generate` and then pass a valid token to this.
|
107
|
+
*
|
108
|
+
* Disabling is only possible if 2FA was previously enabled. Again it is necessary to pass a valid token.
|
109
|
+
*
|
110
|
+
* `HTTP.POST /user/totp/update`
|
111
|
+
*/
|
112
|
+
updateTotp(form) {
|
113
|
+
return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Post, "/user/totp/update", form);
|
114
|
+
}
|
93
115
|
/**
|
94
116
|
* Get the modlog.
|
95
117
|
*
|
@@ -746,6 +768,14 @@ class LemmyHttp {
|
|
746
768
|
getFederatedInstances() {
|
747
769
|
return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Get, "/federated_instances", {});
|
748
770
|
}
|
771
|
+
/**
|
772
|
+
* Block an instance.
|
773
|
+
*
|
774
|
+
* `HTTP.Post /site/block`
|
775
|
+
*/
|
776
|
+
blockInstance(form) {
|
777
|
+
return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Post, "/site/block", form);
|
778
|
+
}
|
749
779
|
/**
|
750
780
|
* Upload an image to the server.
|
751
781
|
*/
|
package/dist/index.d.ts
CHANGED
@@ -82,6 +82,7 @@ export { EditSite } from "./types/EditSite";
|
|
82
82
|
export { FeaturePost } from "./types/FeaturePost";
|
83
83
|
export { FederatedInstances } from "./types/FederatedInstances";
|
84
84
|
export { FollowCommunity } from "./types/FollowCommunity";
|
85
|
+
export { GenerateTotpSecretResponse } from "./types/GenerateTotpSecretResponse";
|
85
86
|
export { GetCaptchaResponse } from "./types/GetCaptchaResponse";
|
86
87
|
export { GetComment } from "./types/GetComment";
|
87
88
|
export { GetComments } from "./types/GetComments";
|
@@ -236,6 +237,8 @@ export { SortType } from "./types/SortType";
|
|
236
237
|
export { SubscribedType } from "./types/SubscribedType";
|
237
238
|
export { Tagline } from "./types/Tagline";
|
238
239
|
export { TransferCommunity } from "./types/TransferCommunity";
|
240
|
+
export { UpdateTotp } from "./types/UpdateTotp";
|
241
|
+
export { UpdateTotpResponse } from "./types/UpdateTotpResponse";
|
239
242
|
export { VerifyEmail } from "./types/VerifyEmail";
|
240
243
|
export { VerifyEmailResponse } from "./types/VerifyEmailResponse";
|
241
244
|
export { UploadImage, UploadImageResponse, ImageFile } from "./types/others";
|
@@ -21,11 +21,11 @@ export interface LocalUser {
|
|
21
21
|
show_new_post_notifs: boolean;
|
22
22
|
email_verified: boolean;
|
23
23
|
accepted_application: boolean;
|
24
|
-
totp_2fa_url?: string;
|
25
24
|
open_links_in_new_tab: boolean;
|
26
25
|
blur_nsfw: boolean;
|
27
26
|
auto_expand: boolean;
|
28
27
|
infinite_scroll_enabled: boolean;
|
29
28
|
admin: boolean;
|
30
29
|
post_listing_mode: PostListingMode;
|
30
|
+
totp_2fa_enabled: boolean;
|
31
31
|
}
|
package/package.json
CHANGED