@authing/react-ui-components 4.0.4-alpha.0 → 4.0.4-alpha.1
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/lib/index.min.js +1 -1
- package/package.json +1 -1
- package/types/AuthClientProvider/AuthClientProvider.d.ts +4 -0
- package/types/AuthClientProvider/context.d.ts +6 -0
- package/types/AuthClientProvider/index.d.ts +1 -0
- package/types/Back/index.d.ts +10 -0
- package/types/BindTotp/api/constant.d.ts +2 -0
- package/types/BindTotp/api/index.d.ts +19 -0
- package/types/BindTotp/businessRequest.d.ts +5 -0
- package/types/BindTotp/core/bindSuccess.d.ts +6 -0
- package/types/BindTotp/core/securityCode.d.ts +8 -0
- package/types/BindTotp/index.d.ts +3 -0
- package/types/BindTotp/interface.d.ts +20 -0
- package/types/ChangeLanguage/index.d.ts +10 -0
- package/types/ChangePassword/api/index.d.ts +3 -0
- package/types/ChangePassword/businessRequest.d.ts +10 -0
- package/types/ChangePassword/core/PasswordNotSafeReset.d.ts +6 -0
- package/types/ChangePassword/core/completePassword.d.ts +8 -0
- package/types/ChangePassword/core/firstLoginReset.d.ts +6 -0
- package/types/ChangePassword/core/rotateReset.d.ts +7 -0
- package/types/ChangePassword/index.d.ts +22 -0
- package/types/CompleteInfo/api/constant.d.ts +1 -0
- package/types/CompleteInfo/api/index.d.ts +4 -0
- package/types/CompleteInfo/api/request.d.ts +8 -0
- package/types/CompleteInfo/businessRequest.d.ts +15 -0
- package/types/CompleteInfo/core/completeInfo.d.ts +16 -0
- package/types/CompleteInfo/index.d.ts +22 -0
- package/types/CompleteInfo/interface.d.ts +99 -0
- package/types/CompleteInfo/utils.d.ts +16 -0
- package/types/CopyAbleText/index.d.ts +5 -0
- package/types/DownloadAuthenticator/index.d.ts +3 -0
- package/types/DownloadAuthenticator/interface.d.ts +12 -0
- package/types/Error/index.d.ts +6 -0
- package/types/Error/interface.d.ts +8 -0
- package/types/ForgetPassword/api/constant.d.ts +1 -0
- package/types/ForgetPassword/api/index.d.ts +1 -0
- package/types/ForgetPassword/api/request.d.ts +24 -0
- package/types/ForgetPassword/core/resetPassword.d.ts +13 -0
- package/types/ForgetPassword/index.d.ts +5 -0
- package/types/ForgetPassword/interface.d.ts +18 -0
- package/types/Guard/Guard.d.ts +10 -0
- package/types/Guard/GuardModule/stateMachine.d.ts +38 -0
- package/types/Guard/api/constant.d.ts +2 -0
- package/types/Guard/api/index.d.ts +13 -0
- package/types/Guard/authClient.d.ts +14 -0
- package/types/Guard/config.d.ts +27 -0
- package/types/Guard/core/componentsMapping.d.ts +8 -0
- package/types/Guard/core/hooks/useBusinessRequest.d.ts +14 -0
- package/types/Guard/core/hooks/useCss.d.ts +5 -0
- package/types/Guard/core/hooks/useEvents.d.ts +15 -0
- package/types/Guard/core/hooks/useFDA.d.ts +20 -0
- package/types/Guard/core/hooks/useModule.d.ts +16 -0
- package/types/Guard/core/hooks/useMultipleAccounts.d.ts +320 -0
- package/types/Guard/core/index.d.ts +8 -0
- package/types/Guard/core/renderContext.d.ts +7 -0
- package/types/Guard/core/renderModule.d.ts +10 -0
- package/types/Guard/core/useAppendConfig.d.ts +4 -0
- package/types/Guard/core/usePlugin.d.ts +3 -0
- package/types/Guard/event.d.ts +88 -0
- package/types/Guard/index.d.ts +4 -0
- package/types/Guard/module.d.ts +28 -0
- package/types/Guard/sso.d.ts +19 -0
- package/types/GuardButton/GuardButton.d.ts +6 -0
- package/types/GuardButton/index.d.ts +1 -0
- package/types/IconFont/iconfont.d.ts +1 -0
- package/types/IconFont/index.d.ts +8 -0
- package/types/IconFont/useGuardIconfont.d.ts +1 -0
- package/types/IdentityBinding/IdentityBinding.d.ts +8 -0
- package/types/IdentityBinding/api/index.d.ts +1 -0
- package/types/IdentityBinding/api/request.d.ts +1 -0
- package/types/IdentityBinding/businessRequest.d.ts +30 -0
- package/types/IdentityBinding/index.d.ts +2 -0
- package/types/IdentityBinding/interface.d.ts +27 -0
- package/types/IdentityBindingAsk/IdentityBindingAsk.d.ts +3 -0
- package/types/IdentityBindingAsk/api/index.d.ts +9 -0
- package/types/IdentityBindingAsk/index.d.ts +2 -0
- package/types/IdentityBindingAsk/interface.d.ts +21 -0
- package/types/ImagePro/index.d.ts +14 -0
- package/types/InputNumber/index.d.ts +5 -0
- package/types/InputPassword/index.d.ts +4 -0
- package/types/Login/api/constant.d.ts +6 -0
- package/types/Login/api/index.d.ts +1 -0
- package/types/Login/api/request.d.ts +114 -0
- package/types/Login/codemap.d.ts +2 -0
- package/types/Login/core/withAD.d.ts +21 -0
- package/types/Login/core/withAppQrcode.d.ts +9 -0
- package/types/Login/core/withLDAP.d.ts +22 -0
- package/types/Login/core/withPassword/FormItemAccount.d.ts +12 -0
- package/types/Login/core/withPassword/GraphicVerifyCode.d.ts +12 -0
- package/types/Login/core/withPassword/InputAccount.d.ts +11 -0
- package/types/Login/core/withPassword/index.d.ts +33 -0
- package/types/Login/core/withVerifyCode/FormItemIdentify.d.ts +11 -0
- package/types/Login/core/withVerifyCode/InputInternationPhone.d.ts +7 -0
- package/types/Login/core/withVerifyCode/VirtualDropdown.d.ts +12 -0
- package/types/Login/core/withVerifyCode/index.d.ts +4 -0
- package/types/Login/core/withVerifyCode/inputIdentify.d.ts +7 -0
- package/types/Login/core/withWechatMiniQrcode.d.ts +11 -0
- package/types/Login/core/withWechatmpQrcode.d.ts +14 -0
- package/types/Login/hooks/useLoginMultiple.d.ts +62 -0
- package/types/Login/index.d.ts +3 -0
- package/types/Login/interface.d.ts +37 -0
- package/types/Login/multipleAccounts/index.d.ts +22 -0
- package/types/Login/multipleAccounts/panel.d.ts +45 -0
- package/types/Login/socialLogin/IdpButton/index.d.ts +2 -0
- package/types/Login/socialLogin/index.d.ts +18 -0
- package/types/Login/socialLogin/postMessage.d.ts +7 -0
- package/types/MFA/VerifyCodeInput/VerifyCodeFormItem.d.ts +8 -0
- package/types/MFA/VerifyCodeInput/index.d.ts +14 -0
- package/types/MFA/api/constant.d.ts +6 -0
- package/types/MFA/api/index.d.ts +2 -0
- package/types/MFA/api/request.d.ts +50 -0
- package/types/MFA/businessRequest.d.ts +57 -0
- package/types/MFA/codemap.d.ts +2 -0
- package/types/MFA/core/email.d.ts +38 -0
- package/types/MFA/core/face.d.ts +7 -0
- package/types/MFA/core/face_deps.d.ts +17 -0
- package/types/MFA/core/sms.d.ts +38 -0
- package/types/MFA/core/totp.d.ts +37 -0
- package/types/MFA/index.d.ts +13 -0
- package/types/MFA/interface.d.ts +40 -0
- package/types/MFA/mfaMethods/index.d.ts +8 -0
- package/types/NeedHelpView/api/constant.d.ts +1 -0
- package/types/NeedHelpView/api/index.d.ts +1 -0
- package/types/NeedHelpView/api/request.d.ts +12 -0
- package/types/NeedHelpView/core/describeQuestions.d.ts +8 -0
- package/types/NeedHelpView/index.d.ts +2 -0
- package/types/Qrcode/UiQrCode.d.ts +51 -0
- package/types/Qrcode/WorkQrCode.d.ts +41 -0
- package/types/Qrcode/api/constant.d.ts +3 -0
- package/types/Qrcode/api/index.d.ts +1 -0
- package/types/Qrcode/api/request.d.ts +44 -0
- package/types/Qrcode/hooks/useImage.d.ts +4 -0
- package/types/Qrcode/hooks/usePostQrCode.d.ts +69 -0
- package/types/Qrcode/hooks/usePreQrCode.d.ts +31 -0
- package/types/Qrcode/hooks/useStatus.d.ts +7 -0
- package/types/Qrcode/index.d.ts +7 -0
- package/types/RecoveryCode/api/constant.d.ts +1 -0
- package/types/RecoveryCode/api/index.d.ts +1 -0
- package/types/RecoveryCode/api/request.d.ts +10 -0
- package/types/RecoveryCode/businessRequest.d.ts +5 -0
- package/types/RecoveryCode/core/saveCode.d.ts +5 -0
- package/types/RecoveryCode/core/useCode.d.ts +7 -0
- package/types/RecoveryCode/index.d.ts +8 -0
- package/types/RecoveryCode/interface.d.ts +8 -0
- package/types/Register/api/constant.d.ts +2 -0
- package/types/Register/api/index.d.ts +2 -0
- package/types/Register/api/request.d.ts +57 -0
- package/types/Register/codemap.d.ts +2 -0
- package/types/Register/components/Agreements/index.d.ts +11 -0
- package/types/Register/core/WithCode.d.ts +18 -0
- package/types/Register/core/WithEmail.d.ts +17 -0
- package/types/Register/index.d.ts +2 -0
- package/types/Register/interface.d.ts +41 -0
- package/types/Register/utils.d.ts +1 -0
- package/types/SelfUnlock/api/index.d.ts +1 -0
- package/types/SelfUnlock/core/selfUnlock.d.ts +8 -0
- package/types/SelfUnlock/index.d.ts +6 -0
- package/types/SelfUnlock/interface.d.ts +15 -0
- package/types/SendCode/SendCodeBtn.d.ts +10 -0
- package/types/SendCode/SendCodeByEmail.d.ts +13 -0
- package/types/SendCode/SendCodeByPhone.d.ts +15 -0
- package/types/SendCode/api/index.d.ts +1 -0
- package/types/SendCode/index.d.ts +9 -0
- package/types/ShieldSpin/index.d.ts +7 -0
- package/types/SingleComponent/SingleComponent.d.ts +3 -0
- package/types/SingleComponent/index.d.ts +3 -0
- package/types/SubmitButton/index.d.ts +10 -0
- package/types/SubmitSuccess/index.d.ts +2 -0
- package/types/SubmitSuccess/interface.d.ts +17 -0
- package/types/Type/application.d.ts +265 -0
- package/types/Type/index.d.ts +98 -0
- package/types/UploadImage/index.d.ts +5 -0
- package/types/ValidatorRules/PasswordFormItem.d.ts +6 -0
- package/types/ValidatorRules/ValidatorFormItem.d.ts +5 -0
- package/types/ValidatorRules/api/index.d.ts +1 -0
- package/types/ValidatorRules/index.d.ts +31 -0
- package/types/ValidatorRules/useCheckRepeat.d.ts +1 -0
- package/types/VerifyCodeInput/index.d.ts +10 -0
- package/types/_utils/GuardErrorCode.d.ts +11 -0
- package/types/_utils/actions/index.d.ts +23 -0
- package/types/_utils/appendConfig.d.ts +4 -0
- package/types/_utils/clipboard.d.ts +1 -0
- package/types/_utils/config/index.d.ts +104 -0
- package/types/_utils/context.d.ts +139 -0
- package/types/_utils/corsVerification.d.ts +1 -0
- package/types/_utils/countryList.d.ts +7 -0
- package/types/_utils/errorFace.d.ts +12 -0
- package/types/_utils/facePlugin/index.d.ts +4 -0
- package/types/_utils/facePlugin/interface.d.ts +5 -0
- package/types/_utils/flowHandleStorage.d.ts +4 -0
- package/types/_utils/guardDocument.d.ts +3 -0
- package/types/_utils/guardHttp.d.ts +27 -0
- package/types/_utils/hooks/index.d.ts +43 -0
- package/types/_utils/http/api/constant.d.ts +7 -0
- package/types/_utils/http/api/index.d.ts +1 -0
- package/types/_utils/http/api/request.d.ts +72 -0
- package/types/_utils/http/base/index.d.ts +10 -0
- package/types/_utils/http/constant.d.ts +46 -0
- package/types/_utils/http/events/index.d.ts +16 -0
- package/types/_utils/http/events/modal/login.d.ts +62 -0
- package/types/_utils/http/events/modal/register.d.ts +73 -0
- package/types/_utils/http/events/utils.d.ts +25 -0
- package/types/_utils/http/header/index.d.ts +41 -0
- package/types/_utils/http/index.d.ts +6 -0
- package/types/_utils/http/instance.d.ts +2 -0
- package/types/_utils/http/interceptors/request.d.ts +6 -0
- package/types/_utils/http/interceptors/response.d.ts +43 -0
- package/types/_utils/http/utils.d.ts +20 -0
- package/types/_utils/http.d.ts +50 -0
- package/types/_utils/index.d.ts +107 -0
- package/types/_utils/initAppId.d.ts +7 -0
- package/types/_utils/locales/en-us/index.d.ts +4 -0
- package/types/_utils/locales/index.d.ts +8 -0
- package/types/_utils/locales/zh-cn/index.d.ts +4 -0
- package/types/_utils/locales/zh-tw/index.d.ts +4 -0
- package/types/_utils/logger/index.d.ts +15 -0
- package/types/_utils/logger/interface.d.ts +5 -0
- package/types/_utils/popupCenter.d.ts +9 -0
- package/types/_utils/responseManagement/index.d.ts +9 -0
- package/types/_utils/responseManagement/interface.d.ts +21 -0
- package/types/_utils/useErrorText.d.ts +5 -0
- package/types/index.d.ts +6 -0
- package/types/version/index.d.ts +2 -0
- package/types/version/version.d.ts +2 -0
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import React, { FC } from 'react';
|
|
2
|
+
import './style.less';
|
|
3
|
+
interface VerifyCodeInputProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
4
|
+
length?: number;
|
|
5
|
+
size?: string;
|
|
6
|
+
gutter?: string;
|
|
7
|
+
onEenter?: Function;
|
|
8
|
+
showDivider?: boolean;
|
|
9
|
+
onChange?: any;
|
|
10
|
+
value?: Array<number | string>;
|
|
11
|
+
onFinish?: any;
|
|
12
|
+
}
|
|
13
|
+
export declare const VerifyCodeInput: FC<VerifyCodeInputProps>;
|
|
14
|
+
export {};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export declare const uploadFaceUrl: () => string;
|
|
2
|
+
export declare const verifyEmailUrl: () => string;
|
|
3
|
+
export declare const verifySmsUrl: () => string;
|
|
4
|
+
export declare const verifyTotpUrl: () => string;
|
|
5
|
+
export declare const verifyFaceUrl: () => string;
|
|
6
|
+
export declare const faceAssociateUrl: () => string;
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { AxiosRequestConfig } from 'axios';
|
|
2
|
+
/**
|
|
3
|
+
* 上传绑定人脸识别的照片
|
|
4
|
+
*/
|
|
5
|
+
export declare const uploadFaceImageByAxios: <T = any>(data: FormData, config?: AxiosRequestConfig<any> | undefined) => Promise<import("../../_utils/http").AuthingGuardResponse<T>>;
|
|
6
|
+
/**
|
|
7
|
+
* 邮箱 mfa 认证
|
|
8
|
+
* @param data
|
|
9
|
+
* @param config
|
|
10
|
+
*/
|
|
11
|
+
export declare const verifyEmailMfaByAxios: (data: {
|
|
12
|
+
email: string;
|
|
13
|
+
code: string;
|
|
14
|
+
}, config?: AxiosRequestConfig<any> | undefined) => Promise<import("../../_utils/http").AuthingGuardResponse<any>>;
|
|
15
|
+
/**
|
|
16
|
+
* 短信 mfa 认证
|
|
17
|
+
* @param data
|
|
18
|
+
* @param config
|
|
19
|
+
*/
|
|
20
|
+
export declare const verifySmsMfaByAxios: (data: {
|
|
21
|
+
phone: string;
|
|
22
|
+
code: string;
|
|
23
|
+
phoneCountryCode?: string;
|
|
24
|
+
}, config?: AxiosRequestConfig<any> | undefined) => Promise<import("../../_utils/http").AuthingGuardResponse<any>>;
|
|
25
|
+
/**
|
|
26
|
+
* totp mfa 认证
|
|
27
|
+
* @param data
|
|
28
|
+
* @param config
|
|
29
|
+
*/
|
|
30
|
+
export declare const verifyTotpMfaByAxios: (data: {
|
|
31
|
+
totp: string;
|
|
32
|
+
}, config?: AxiosRequestConfig<any> | undefined) => Promise<import("../../_utils/http").AuthingGuardResponse<any>>;
|
|
33
|
+
/**
|
|
34
|
+
* 人脸识别 mfa 认证
|
|
35
|
+
* @param data
|
|
36
|
+
* @param config
|
|
37
|
+
*/
|
|
38
|
+
export declare const verifyFaceMfaByAxios: (data: {
|
|
39
|
+
photo: string;
|
|
40
|
+
}, config?: AxiosRequestConfig<any> | undefined) => Promise<import("../../_utils/http").AuthingGuardResponse<any>>;
|
|
41
|
+
/**
|
|
42
|
+
* 人脸对比绑定
|
|
43
|
+
* @param data
|
|
44
|
+
* @param config
|
|
45
|
+
*/
|
|
46
|
+
export declare const bindFaceMfaByAxios: (data: {
|
|
47
|
+
photoA: string;
|
|
48
|
+
photoB: string;
|
|
49
|
+
isExternalPhoto?: boolean;
|
|
50
|
+
}, config?: AxiosRequestConfig<any> | undefined) => Promise<import("../../_utils/http").AuthingGuardResponse<any>>;
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
export declare enum MfaBusinessAction {
|
|
2
|
+
VerifyEmail = "verify-email",
|
|
3
|
+
VerifySms = "verify-sms",
|
|
4
|
+
VerifyTotp = "verify-totp",
|
|
5
|
+
VerifyFace = "verify-face",
|
|
6
|
+
AssociateFace = "associate-face"
|
|
7
|
+
}
|
|
8
|
+
export declare const authFlow: (action: MfaBusinessAction, content: any) => Promise<import("../_utils/http").AuthingGuardResponse<any>>;
|
|
9
|
+
interface VerifySmsContent {
|
|
10
|
+
phone: string;
|
|
11
|
+
code: string;
|
|
12
|
+
mfaToken?: string;
|
|
13
|
+
phoneCountryCode?: string;
|
|
14
|
+
}
|
|
15
|
+
interface VerifyEmailContent {
|
|
16
|
+
email: string;
|
|
17
|
+
code: string;
|
|
18
|
+
mfaToken?: string;
|
|
19
|
+
}
|
|
20
|
+
interface VerifyTotpContent {
|
|
21
|
+
totp: string;
|
|
22
|
+
mfaToken?: string;
|
|
23
|
+
}
|
|
24
|
+
interface VerifyFaceContent {
|
|
25
|
+
photo: string;
|
|
26
|
+
mfaToken?: string;
|
|
27
|
+
}
|
|
28
|
+
interface AssociateFaceContent {
|
|
29
|
+
photoA: string;
|
|
30
|
+
photoB: string;
|
|
31
|
+
isExternalPhoto?: boolean;
|
|
32
|
+
mfaToken?: string;
|
|
33
|
+
}
|
|
34
|
+
export declare const VerifyEmail: (content: VerifyEmailContent) => Promise<import("../_utils/http").AuthingGuardResponse<any>>;
|
|
35
|
+
export declare const VerifySms: (content: VerifySmsContent) => Promise<import("../_utils/http").AuthingGuardResponse<any>>;
|
|
36
|
+
export declare const VerifyTotp: (content: VerifyTotpContent) => Promise<import("../_utils/http").AuthingGuardResponse<any>>;
|
|
37
|
+
export declare const VerifyFace: (content: VerifyFaceContent) => Promise<import("../_utils/http").AuthingGuardResponse<any>>;
|
|
38
|
+
export declare const AssociateFace: (content: AssociateFaceContent) => Promise<import("../_utils/http").AuthingGuardResponse<any>>;
|
|
39
|
+
export declare const useMfaBusinessRequest: () => {
|
|
40
|
+
"verify-email": (content: VerifyEmailContent) => Promise<import("../_utils/http").AuthingGuardResponse<any>>;
|
|
41
|
+
"verify-sms": (content: VerifySmsContent) => Promise<import("../_utils/http").AuthingGuardResponse<any>>;
|
|
42
|
+
/**
|
|
43
|
+
* Totp 状态请求
|
|
44
|
+
* @param content
|
|
45
|
+
* @returns
|
|
46
|
+
*/
|
|
47
|
+
"verify-totp": (content: VerifyTotpContent) => Promise<import("../_utils/http").AuthingGuardResponse<any>>;
|
|
48
|
+
/**
|
|
49
|
+
* 人脸验证
|
|
50
|
+
*/
|
|
51
|
+
"verify-face": (content: VerifyFaceContent) => Promise<import("../_utils/http").AuthingGuardResponse<any>>;
|
|
52
|
+
/**
|
|
53
|
+
* 人脸绑定
|
|
54
|
+
*/
|
|
55
|
+
"associate-face": (content: AssociateFaceContent) => Promise<import("../_utils/http").AuthingGuardResponse<any>>;
|
|
56
|
+
};
|
|
57
|
+
export {};
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { MFAConfig } from '../interface';
|
|
3
|
+
interface BindMFAEmailProps {
|
|
4
|
+
mfaToken: string;
|
|
5
|
+
onBind: (email: string) => void;
|
|
6
|
+
config: any;
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* 绑定邮箱页面
|
|
10
|
+
* @param param0
|
|
11
|
+
* @returns
|
|
12
|
+
*/
|
|
13
|
+
export declare const BindMFAEmail: React.FC<BindMFAEmailProps>;
|
|
14
|
+
interface VerifyMFAEmailProps {
|
|
15
|
+
email: string;
|
|
16
|
+
mfaToken: string;
|
|
17
|
+
onVerify: (code: number, data: any) => void;
|
|
18
|
+
sendCodeRef: React.RefObject<HTMLButtonElement>;
|
|
19
|
+
codeLength: number;
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* 验证邮箱
|
|
23
|
+
* @param param0
|
|
24
|
+
* @returns
|
|
25
|
+
*/
|
|
26
|
+
export declare const VerifyMFAEmail: React.FC<VerifyMFAEmailProps>;
|
|
27
|
+
/**
|
|
28
|
+
* 邮箱验证方式
|
|
29
|
+
* @param param0
|
|
30
|
+
* @returns
|
|
31
|
+
*/
|
|
32
|
+
export declare const MFAEmail: React.FC<{
|
|
33
|
+
mfaToken: string;
|
|
34
|
+
email?: string;
|
|
35
|
+
mfaLogin: any;
|
|
36
|
+
config: MFAConfig;
|
|
37
|
+
}>;
|
|
38
|
+
export {};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export declare const devicesConstraints: {
|
|
2
|
+
video: {
|
|
3
|
+
width: number;
|
|
4
|
+
height: number;
|
|
5
|
+
};
|
|
6
|
+
};
|
|
7
|
+
export declare const FACE_SCORE = 0.65;
|
|
8
|
+
/**
|
|
9
|
+
* 人脸检测配置
|
|
10
|
+
*/
|
|
11
|
+
export declare function getFaceDetectorOptions(): any;
|
|
12
|
+
/**
|
|
13
|
+
* 获取 facePlugin tinyFaceDetector 微型人脸探测(三种方式之一)
|
|
14
|
+
*/
|
|
15
|
+
export declare function getCurrentFaceDetectionNet(): any;
|
|
16
|
+
export declare function isFaceDetectionModelLoaded(): boolean;
|
|
17
|
+
export declare function dataURItoBlob(base64Data: any): Blob;
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { GuardMFAInitData, MFAConfig } from '../interface';
|
|
3
|
+
export interface BindMFASmsProps {
|
|
4
|
+
mfaToken: string;
|
|
5
|
+
onBind: (phone: string) => void;
|
|
6
|
+
config: any;
|
|
7
|
+
areaCode: string;
|
|
8
|
+
setAreaCode: (areaCode: string) => void;
|
|
9
|
+
isInternationSms: boolean;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* 绑定手机号
|
|
13
|
+
* @param param0
|
|
14
|
+
* @returns
|
|
15
|
+
*/
|
|
16
|
+
export declare const BindMFASms: React.FC<BindMFASmsProps>;
|
|
17
|
+
export interface VerifyMFASmsProps {
|
|
18
|
+
mfaToken: string;
|
|
19
|
+
phone: string;
|
|
20
|
+
onVerify: (code: number, data: any) => void;
|
|
21
|
+
sendCodeRef: React.RefObject<HTMLButtonElement>;
|
|
22
|
+
codeLength: number;
|
|
23
|
+
areaCode: string;
|
|
24
|
+
phoneCountryCode?: string;
|
|
25
|
+
isInternationSms: boolean;
|
|
26
|
+
userPhone?: string;
|
|
27
|
+
}
|
|
28
|
+
export declare const VerifyMFASms: React.FC<VerifyMFASmsProps>;
|
|
29
|
+
/**
|
|
30
|
+
* 手机 MFA
|
|
31
|
+
* @param param0
|
|
32
|
+
* @returns
|
|
33
|
+
*/
|
|
34
|
+
export declare const MFASms: React.FC<{
|
|
35
|
+
mfaLogin: any;
|
|
36
|
+
config: MFAConfig;
|
|
37
|
+
initData: GuardMFAInitData;
|
|
38
|
+
}>;
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { GuardMFAInitData, MFAConfig } from '../interface';
|
|
3
|
+
export interface BindMFATotpProps {
|
|
4
|
+
initData: GuardMFAInitData;
|
|
5
|
+
changeModule: any;
|
|
6
|
+
}
|
|
7
|
+
/**
|
|
8
|
+
* 绑定 ToTp 页面 跳转 Totp
|
|
9
|
+
* @param param0
|
|
10
|
+
* @returns
|
|
11
|
+
*/
|
|
12
|
+
export declare const BindMFATotp: React.FC<BindMFATotpProps>;
|
|
13
|
+
export interface VerifyMFATotpProps {
|
|
14
|
+
mfaToken: string;
|
|
15
|
+
mfaLogin: any;
|
|
16
|
+
changeModule: any;
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Totp 验证页面
|
|
20
|
+
* @param param0
|
|
21
|
+
* @returns
|
|
22
|
+
*/
|
|
23
|
+
export declare const VerifyMFATotp: React.FC<VerifyMFATotpProps>;
|
|
24
|
+
export interface MFATotpProps {
|
|
25
|
+
changeModule: any;
|
|
26
|
+
config: MFAConfig;
|
|
27
|
+
initData: GuardMFAInitData;
|
|
28
|
+
mfaLogin: any;
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* MFA Totp 页面
|
|
32
|
+
* 开启 => 渲染 VerifyMFATotp 绑定
|
|
33
|
+
* 不开启 => 渲染绑定页面
|
|
34
|
+
* @param param
|
|
35
|
+
* @returns
|
|
36
|
+
*/
|
|
37
|
+
export declare const MFATotp: React.FC<MFATotpProps>;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import './styles.less';
|
|
3
|
+
interface MFABackStateContextType {
|
|
4
|
+
setMfaBackState: React.Dispatch<React.SetStateAction<string>>;
|
|
5
|
+
mfaBackState: string;
|
|
6
|
+
}
|
|
7
|
+
export declare const MFABackStateContext: React.Context<MFABackStateContextType | undefined>;
|
|
8
|
+
/**
|
|
9
|
+
* MFA 相关页面
|
|
10
|
+
* @returns
|
|
11
|
+
*/
|
|
12
|
+
export declare const GuardMFAView: React.FC;
|
|
13
|
+
export {};
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { IG2Config, IG2Events, IG2FCProps } from '../Type';
|
|
2
|
+
import { AuthenticationClient, User } from 'authing-js-sdk';
|
|
3
|
+
export interface MFAConfig extends IG2Config {
|
|
4
|
+
autoRegister: boolean;
|
|
5
|
+
}
|
|
6
|
+
export declare const getDefaultMFAConfig: () => MFAConfig;
|
|
7
|
+
export interface MFAEvents extends IG2Events {
|
|
8
|
+
onLogin?: (user: User, authClient: AuthenticationClient) => void;
|
|
9
|
+
}
|
|
10
|
+
export declare enum MFAType {
|
|
11
|
+
SMS = "SMS",
|
|
12
|
+
EMAIL = "EMAIL",
|
|
13
|
+
TOTP = "OTP",
|
|
14
|
+
FACE = "FACE"
|
|
15
|
+
}
|
|
16
|
+
export interface GuardMFAInitData {
|
|
17
|
+
mfaToken: string;
|
|
18
|
+
applicationMfa: {
|
|
19
|
+
mfaPolicy: MFAType;
|
|
20
|
+
sort: number;
|
|
21
|
+
status: 0 | 1;
|
|
22
|
+
}[];
|
|
23
|
+
phoneCountryCode?: string;
|
|
24
|
+
faceMfaEnabled: boolean;
|
|
25
|
+
totpMfaEnabled: boolean;
|
|
26
|
+
email?: string;
|
|
27
|
+
phone?: string;
|
|
28
|
+
avatar?: string;
|
|
29
|
+
nickme?: string;
|
|
30
|
+
username?: string;
|
|
31
|
+
current?: MFAType;
|
|
32
|
+
}
|
|
33
|
+
export interface GuardMFAProps extends IG2FCProps, MFAEvents {
|
|
34
|
+
config: Partial<MFAConfig>;
|
|
35
|
+
initData: GuardMFAInitData;
|
|
36
|
+
}
|
|
37
|
+
export interface GuardMFAViewProps extends GuardMFAProps {
|
|
38
|
+
config: MFAConfig;
|
|
39
|
+
initData: GuardMFAInitData;
|
|
40
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const feedbackUrl: () => string;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './request';
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 问题反馈
|
|
3
|
+
* @param data
|
|
4
|
+
* @returns
|
|
5
|
+
*/
|
|
6
|
+
export declare const feedbackByAxios: (data: {
|
|
7
|
+
type: number;
|
|
8
|
+
description: string;
|
|
9
|
+
phone: string;
|
|
10
|
+
images: string[];
|
|
11
|
+
appId: string;
|
|
12
|
+
}) => Promise<import("../../_utils/http").AuthingGuardResponse<any>>;
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import './index.less';
|
|
3
|
+
import { CodeStatusDescriptions } from './WorkQrCode';
|
|
4
|
+
export declare type CodeStatus = 'loading' | 'ready' | 'already' | 'success' | 'error' | 'expired' | 'cancel' | 'MFA';
|
|
5
|
+
export declare const prefix = "refactor";
|
|
6
|
+
export interface UiQrProps {
|
|
7
|
+
/**
|
|
8
|
+
* Loading 组件
|
|
9
|
+
*/
|
|
10
|
+
loadingComponent?: React.ReactElement;
|
|
11
|
+
/**
|
|
12
|
+
* 二维码组件三种状态
|
|
13
|
+
* ready 准备状态
|
|
14
|
+
* already 已扫描状态
|
|
15
|
+
* success 扫描成功/登录成功状态
|
|
16
|
+
* error 错误状态(超时、网络错误)
|
|
17
|
+
*/
|
|
18
|
+
status: CodeStatus;
|
|
19
|
+
/**
|
|
20
|
+
* 二维码 URL
|
|
21
|
+
*/
|
|
22
|
+
src?: string;
|
|
23
|
+
/**
|
|
24
|
+
* 二维码底部内容
|
|
25
|
+
*/
|
|
26
|
+
descriptions: CodeStatusDescriptions;
|
|
27
|
+
/**
|
|
28
|
+
* 外层 container 样式
|
|
29
|
+
*/
|
|
30
|
+
containerStyle?: React.CSSProperties;
|
|
31
|
+
/**
|
|
32
|
+
* 内层 container 样式(图片)
|
|
33
|
+
*/
|
|
34
|
+
imageStyle?: React.CSSProperties;
|
|
35
|
+
/**
|
|
36
|
+
* 二维码图片准备好的回调
|
|
37
|
+
*/
|
|
38
|
+
onLoad?: () => void;
|
|
39
|
+
/**
|
|
40
|
+
* 点击遮罩中的内容区
|
|
41
|
+
* status 当前组件所处状态
|
|
42
|
+
*/
|
|
43
|
+
onClickMaskEl?: (status: CodeStatus) => void;
|
|
44
|
+
/**
|
|
45
|
+
* 点击全部遮罩区域
|
|
46
|
+
* status 当前组件所处状态
|
|
47
|
+
*/
|
|
48
|
+
onMaskContent?: (status: CodeStatus) => void;
|
|
49
|
+
}
|
|
50
|
+
declare const UiQrCode: React.NamedExoticComponent<UiQrProps>;
|
|
51
|
+
export { UiQrCode };
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { QrCodeResponse } from './hooks/usePostQrCode';
|
|
3
|
+
import { CodeStatus, UiQrProps } from './UiQrCode';
|
|
4
|
+
/**
|
|
5
|
+
* 二维码不同状态下的底部描述文字
|
|
6
|
+
*/
|
|
7
|
+
export declare type CodeStatusDescriptions = Partial<Record<Exclude<CodeStatus, 'loading'>, React.ReactNode | ((referQrCode?: () => void) => React.ReactNode)>>;
|
|
8
|
+
export interface WorkQrCodeRef {
|
|
9
|
+
referQrCode: () => Promise<{
|
|
10
|
+
random: string;
|
|
11
|
+
url: string;
|
|
12
|
+
} | undefined>;
|
|
13
|
+
}
|
|
14
|
+
export interface WorkQrCodeProps extends Omit<UiQrProps, 'description' | 'status'> {
|
|
15
|
+
/**
|
|
16
|
+
* 二维码场景
|
|
17
|
+
*/
|
|
18
|
+
scene: 'WXAPP_AUTH' | 'APP_AUTH' | 'WECHATMP_AUTH';
|
|
19
|
+
/**
|
|
20
|
+
* 不同状态请求文字
|
|
21
|
+
*/
|
|
22
|
+
descriptions: CodeStatusDescriptions;
|
|
23
|
+
/**
|
|
24
|
+
* 睡眠时间 默认 1000
|
|
25
|
+
*/
|
|
26
|
+
sleepTime?: number;
|
|
27
|
+
/**
|
|
28
|
+
* 每当状态变化时,触发的 callback 。
|
|
29
|
+
*/
|
|
30
|
+
onStatusChange?: (status: CodeStatus, data: QrCodeResponse) => void;
|
|
31
|
+
/**
|
|
32
|
+
* 不同状态下点击遮罩中间区域方法
|
|
33
|
+
*/
|
|
34
|
+
onClickMaskContent?: (status: CodeStatus) => void;
|
|
35
|
+
/**
|
|
36
|
+
* 不同二维码下生成配置
|
|
37
|
+
*/
|
|
38
|
+
qrCodeScanOptions?: any;
|
|
39
|
+
}
|
|
40
|
+
declare const WorkQrCode: React.ForwardRefExoticComponent<WorkQrCodeProps & React.RefAttributes<any>>;
|
|
41
|
+
export { WorkQrCode };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './request';
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { AxiosRequestConfig } from 'axios';
|
|
2
|
+
import { WorkQrCodeProps } from '../WorkQrCode';
|
|
3
|
+
/**
|
|
4
|
+
* 二维码状态check
|
|
5
|
+
* @param ticket
|
|
6
|
+
* @param config
|
|
7
|
+
*/
|
|
8
|
+
export declare const qrcodeStatusCheckByAxios: (ticket: string) => Promise<import("../../_utils/http").AuthingGuardResponse<any>>;
|
|
9
|
+
/**
|
|
10
|
+
* ticket 换用户信息
|
|
11
|
+
* @param data
|
|
12
|
+
* @param config
|
|
13
|
+
*/
|
|
14
|
+
export declare const exChangeUserInfoByAxios: (data: {
|
|
15
|
+
ticket: string;
|
|
16
|
+
}, config?: AxiosRequestConfig<any> | undefined) => Promise<import("../../_utils/http").AuthingGuardResponse<any>>;
|
|
17
|
+
/**
|
|
18
|
+
* 二维码生成
|
|
19
|
+
* @param data
|
|
20
|
+
* @param config
|
|
21
|
+
*/
|
|
22
|
+
export declare const geneQrcodeByAxios: <T = {
|
|
23
|
+
random: string;
|
|
24
|
+
url: string;
|
|
25
|
+
}>(data: {
|
|
26
|
+
autoMergeQrCode: boolean;
|
|
27
|
+
scene: WorkQrCodeProps['scene'];
|
|
28
|
+
/**
|
|
29
|
+
* 请求上下文,将会传递到 Pipeline 中
|
|
30
|
+
*/
|
|
31
|
+
context: any;
|
|
32
|
+
/**
|
|
33
|
+
* 是否获取用户自定义数据
|
|
34
|
+
*/
|
|
35
|
+
params: any;
|
|
36
|
+
/**
|
|
37
|
+
* 是否获取用户自定义数据
|
|
38
|
+
*/
|
|
39
|
+
withCustomData: any;
|
|
40
|
+
/**
|
|
41
|
+
* 多租户用的额外的 Idp Id。
|
|
42
|
+
*/
|
|
43
|
+
extIdpConnId: string;
|
|
44
|
+
}, config?: AxiosRequestConfig<any> | undefined) => Promise<import("../../_utils/http").AuthingGuardResponse<T>>;
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { AuthingGuardResponse, AuthingResponse } from '../../_utils/http';
|
|
3
|
+
import { CodeStatus } from '../UiQrCode';
|
|
4
|
+
import { CodeStatusDescriptions } from '../WorkQrCode';
|
|
5
|
+
import { ReducerType, RootState } from './usePreQrCode';
|
|
6
|
+
export interface QrCodeResponse {
|
|
7
|
+
/**
|
|
8
|
+
* 根据状态确定不同的流程
|
|
9
|
+
*/
|
|
10
|
+
status: number;
|
|
11
|
+
/**
|
|
12
|
+
* 返回的随机值
|
|
13
|
+
*/
|
|
14
|
+
random: number;
|
|
15
|
+
/**
|
|
16
|
+
* 返回的用户信息
|
|
17
|
+
*/
|
|
18
|
+
userInfo?: any;
|
|
19
|
+
/**
|
|
20
|
+
* 扫码成功后 Tick 换取用户信息
|
|
21
|
+
*/
|
|
22
|
+
ticket?: string;
|
|
23
|
+
/**
|
|
24
|
+
* MFA 状态下的返回
|
|
25
|
+
*/
|
|
26
|
+
scannedResult?: AuthingResponse;
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* 二维码请求相关
|
|
30
|
+
*/
|
|
31
|
+
interface QrCodeRequest {
|
|
32
|
+
genCodeRequest?: () => Promise<AuthingGuardResponse<{
|
|
33
|
+
random: string;
|
|
34
|
+
url: string;
|
|
35
|
+
}>>;
|
|
36
|
+
/**
|
|
37
|
+
* 未扫码下的请求方法
|
|
38
|
+
*/
|
|
39
|
+
readyCheckedRequest?: () => Promise<AuthingGuardResponse<QrCodeResponse>>;
|
|
40
|
+
/**
|
|
41
|
+
* 已经扫码下的请求方法(待确认)
|
|
42
|
+
*/
|
|
43
|
+
alreadyCheckedRequest?: () => Promise<AuthingGuardResponse<QrCodeResponse>>;
|
|
44
|
+
/**
|
|
45
|
+
* 使用 ticket 交换用户信息
|
|
46
|
+
*/
|
|
47
|
+
exchangeUserInfo?: (ticket: string) => Promise<any>;
|
|
48
|
+
}
|
|
49
|
+
interface QrCodeOptions {
|
|
50
|
+
state: RootState;
|
|
51
|
+
dispatch: React.Dispatch<{
|
|
52
|
+
type: ReducerType;
|
|
53
|
+
payload: Partial<RootState>;
|
|
54
|
+
}>;
|
|
55
|
+
descriptions: CodeStatusDescriptions;
|
|
56
|
+
sleepTime?: number;
|
|
57
|
+
/**
|
|
58
|
+
* 状态改变时触发事件,仅在 Server 返回的二维码状态改变时进行触发
|
|
59
|
+
*/
|
|
60
|
+
onStatusChange?: (status: CodeStatus, data: QrCodeResponse) => void;
|
|
61
|
+
}
|
|
62
|
+
/**
|
|
63
|
+
* 二维码处理阶段
|
|
64
|
+
* 二维码处理阶段分为两个主要流程
|
|
65
|
+
* 1. 同一状态下的轮询逻辑处理
|
|
66
|
+
* 2. 根据不同返回状态码进行处理
|
|
67
|
+
*/
|
|
68
|
+
export declare const useQrCode: (options: QrCodeOptions, request: QrCodeRequest) => void;
|
|
69
|
+
export {};
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { CodeStatus } from '../UiQrCode';
|
|
3
|
+
export declare type ReducerType = 'change' | 'changeStatus' | 'changeDesc';
|
|
4
|
+
export declare type RootState = {
|
|
5
|
+
/**
|
|
6
|
+
* 状态
|
|
7
|
+
*/
|
|
8
|
+
status: CodeStatus;
|
|
9
|
+
/**
|
|
10
|
+
* 底部描述
|
|
11
|
+
*/
|
|
12
|
+
/**
|
|
13
|
+
* 当前二维码 URL
|
|
14
|
+
*/
|
|
15
|
+
src?: string;
|
|
16
|
+
/**
|
|
17
|
+
* 二维码随机值
|
|
18
|
+
*/
|
|
19
|
+
random?: string;
|
|
20
|
+
};
|
|
21
|
+
/**
|
|
22
|
+
* QrCode 准备阶段 Hook
|
|
23
|
+
*/
|
|
24
|
+
declare const usePreQrCode: () => {
|
|
25
|
+
state: RootState;
|
|
26
|
+
dispatch: import("react").Dispatch<{
|
|
27
|
+
type: ReducerType;
|
|
28
|
+
payload: Partial<RootState>;
|
|
29
|
+
}>;
|
|
30
|
+
};
|
|
31
|
+
export { usePreQrCode };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const recoverCodeUrl: () => string;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { authFlowByAxios } from 'service/api';
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { AxiosRequestConfig } from 'axios';
|
|
2
|
+
/**
|
|
3
|
+
* 不在流程中(AuthFlow)请求恢复 Totp 请求
|
|
4
|
+
* @param data
|
|
5
|
+
* @param config
|
|
6
|
+
* @returns
|
|
7
|
+
*/
|
|
8
|
+
export declare const recoverCodeByAxios: (data: {
|
|
9
|
+
recoveryCode: string;
|
|
10
|
+
}, config?: AxiosRequestConfig<any> | undefined) => Promise<import("../../_utils/http").AuthingGuardResponse<any>>;
|