lemmy-js-client 0.19.0-rc.12 → 0.19.0-rc.13
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/http.d.ts +21 -0
- package/dist/http.js +22 -0
- package/dist/index.d.ts +3 -0
- 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
@@ -128,6 +128,9 @@ import { UploadImage, UploadImageResponse } from "./types/others";
|
|
128
128
|
import { HideCommunity } from "./types/HideCommunity";
|
129
129
|
import { BlockInstance } from "./types/BlockInstance";
|
130
130
|
import { BlockInstanceResponse } from "./types/BlockInstanceResponse";
|
131
|
+
import { GenerateTotpSecretResponse } from "./types/GenerateTotpSecretResponse";
|
132
|
+
import { UpdateTotp } from "./types/UpdateTotp";
|
133
|
+
import { UpdateTotpResponse } from "./types/UpdateTotpResponse";
|
131
134
|
/**
|
132
135
|
* Helps build lemmy HTTP requests.
|
133
136
|
*/
|
@@ -168,6 +171,24 @@ export declare class LemmyHttp {
|
|
168
171
|
* `HTTP.POST /user/leave_admin`
|
169
172
|
*/
|
170
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>;
|
171
192
|
/**
|
172
193
|
* Get the modlog.
|
173
194
|
*
|
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
|
*
|
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