@authing/react18-ui-components 4.1.0-alpha.2
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/README.md +33 -0
- package/lib/index.min.css +2 -0
- package/lib/index.min.js +2 -0
- package/lib/index.min.js.LICENSE.txt +170 -0
- package/lib/static/media/loading.3cf0104f.svg +32 -0
- package/package.json +241 -0
- package/types/AuthClientProvider/AuthClientProvider.d.ts +6 -0
- package/types/AuthClientProvider/context.d.ts +6 -0
- package/types/AuthClientProvider/index.d.ts +1 -0
- package/types/Back/index.d.ts +12 -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 +9 -0
- package/types/ChangePassword/businessRequest.d.ts +9 -0
- package/types/ChangePassword/core/PasswordNotSafeReset.d.ts +6 -0
- package/types/ChangePassword/core/completePassword.d.ts +2 -0
- package/types/ChangePassword/core/firstLoginReset.d.ts +6 -0
- package/types/ChangePassword/core/rotateReset.d.ts +6 -0
- package/types/ChangePassword/index.d.ts +11 -0
- package/types/CompleteInfo/businessRequest.d.ts +9 -0
- package/types/CompleteInfo/core/completeInfo.d.ts +11 -0
- package/types/CompleteInfo/index.d.ts +11 -0
- package/types/CompleteInfo/interface.d.ts +99 -0
- package/types/CompleteInfo/utils.d.ts +18 -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/core/resetPassword.d.ts +10 -0
- package/types/ForgetPassword/index.d.ts +2 -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/authClient.d.ts +14 -0
- package/types/Guard/config.d.ts +16 -0
- package/types/Guard/core/hooks/useMultipleAccounts.d.ts +320 -0
- package/types/Guard/core/index.d.ts +7 -0
- package/types/Guard/core/renderContext.d.ts +8 -0
- package/types/Guard/core/renderModule.d.ts +11 -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 +59 -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 +3 -0
- package/types/IdentityBinding/businessRequest.d.ts +33 -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/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 +1 -0
- package/types/Login/codemap.d.ts +2 -0
- package/types/Login/core/withAD.d.ts +20 -0
- package/types/Login/core/withAppQrcode.d.ts +8 -0
- package/types/Login/core/withLDAP.d.ts +21 -0
- package/types/Login/core/withPassword/FormItemAccount.d.ts +7 -0
- package/types/Login/core/withPassword/GraphicVerifyCode.d.ts +7 -0
- package/types/Login/core/withPassword/InputAccount.d.ts +7 -0
- package/types/Login/core/withPassword/index.d.ts +27 -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 +3 -0
- package/types/Login/core/withVerifyCode/inputIdentify.d.ts +7 -0
- package/types/Login/core/withWechatMiniQrcode.d.ts +10 -0
- package/types/Login/core/withWechatmpQrcode.d.ts +13 -0
- package/types/Login/hooks/useLoginMultiple.d.ts +63 -0
- package/types/Login/index.d.ts +2 -0
- package/types/Login/interface.d.ts +41 -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 +1 -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/businessRequest.d.ts +46 -0
- package/types/MFA/codemap.d.ts +2 -0
- package/types/MFA/core/email.d.ts +23 -0
- package/types/MFA/core/face.d.ts +1 -0
- package/types/MFA/core/face_deps.d.ts +11 -0
- package/types/MFA/core/sms.d.ts +28 -0
- package/types/MFA/core/totp.d.ts +20 -0
- package/types/MFA/index.d.ts +9 -0
- package/types/MFA/interface.d.ts +40 -0
- package/types/MFA/mfaMethods/index.d.ts +8 -0
- package/types/NeedHelpView/core/describeQuestions.d.ts +7 -0
- package/types/NeedHelpView/index.d.ts +1 -0
- package/types/Qrcode/UiQrCode.d.ts +51 -0
- package/types/Qrcode/WorkQrCode.d.ts +41 -0
- package/types/Qrcode/hooks/useImage.d.ts +4 -0
- package/types/Qrcode/hooks/usePostQrCode.d.ts +72 -0
- package/types/Qrcode/hooks/usePreQrCode.d.ts +31 -0
- package/types/Qrcode/hooks/useStatus.d.ts +8 -0
- package/types/Qrcode/index.d.ts +7 -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 +5 -0
- package/types/RecoveryCode/interface.d.ts +8 -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 +17 -0
- package/types/Register/core/WithEmail.d.ts +11 -0
- package/types/Register/core/WithEmailCode.d.ts +11 -0
- package/types/Register/core/WithPhone.d.ts +10 -0
- package/types/Register/index.d.ts +2 -0
- package/types/Register/interface.d.ts +25 -0
- package/types/Register/utils.d.ts +1 -0
- package/types/SelfUnlock/core/selfUnlock.d.ts +8 -0
- package/types/SelfUnlock/index.d.ts +2 -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/index.d.ts +9 -0
- package/types/ShieldSpin/index.d.ts +6 -0
- package/types/SingleComponent/SingleComponent.d.ts +2 -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 +267 -0
- package/types/Type/index.d.ts +84 -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/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/appendConfig.d.ts +4 -0
- package/types/_utils/clipboard.d.ts +1 -0
- package/types/_utils/config/index.d.ts +108 -0
- package/types/_utils/context.d.ts +143 -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.d.ts +33 -0
- package/types/_utils/index.d.ts +92 -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/ja-jp/index.d.ts +4 -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 +3 -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,15 @@
|
|
|
1
|
+
import { AuthenticationClient, CommonMessage } from 'authing-js-sdk';
|
|
2
|
+
import { IG2Config, IG2Events, IG2FCProps } from '../Type';
|
|
3
|
+
export interface ForgetPasswordEvents extends IG2Events {
|
|
4
|
+
onPwdEmailSend?: (authClient: AuthenticationClient) => void;
|
|
5
|
+
onPwdEmailSendError?: (error: CommonMessage, authClient: AuthenticationClient) => void;
|
|
6
|
+
onPwdPhoneSend?: (authClient: AuthenticationClient) => void;
|
|
7
|
+
onPwdPhoneSendError?: (error: CommonMessage, authClient: AuthenticationClient) => void;
|
|
8
|
+
onPwdReset?: (authClient: AuthenticationClient) => void;
|
|
9
|
+
onPwdResetError?: (error: CommonMessage, authClient: AuthenticationClient) => void;
|
|
10
|
+
}
|
|
11
|
+
export interface ForgetPasswordConfig extends IG2Config {
|
|
12
|
+
}
|
|
13
|
+
export interface ForgetPasswordProps extends IG2FCProps, ForgetPasswordEvents {
|
|
14
|
+
config: Partial<IG2Config>;
|
|
15
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import React, { FC } from 'react';
|
|
2
|
+
import './style.less';
|
|
3
|
+
import { ButtonProps } from 'antd/lib/button';
|
|
4
|
+
export interface SendCodeProps extends ButtonProps {
|
|
5
|
+
beforeSend: () => Promise<boolean>;
|
|
6
|
+
btnRef?: React.RefObject<HTMLButtonElement>;
|
|
7
|
+
setSent?: (value: boolean) => void;
|
|
8
|
+
sendDesc?: string;
|
|
9
|
+
}
|
|
10
|
+
export declare const SendCodeBtn: FC<SendCodeProps>;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { FC } from 'react';
|
|
2
|
+
import './style.less';
|
|
3
|
+
import { InputProps } from 'antd/lib/input';
|
|
4
|
+
import { EmailScene } from '../Type';
|
|
5
|
+
export interface SendCodeByEmailProps extends InputProps {
|
|
6
|
+
data?: string;
|
|
7
|
+
form?: any;
|
|
8
|
+
onSendCodeBefore?: any;
|
|
9
|
+
fieldName?: string;
|
|
10
|
+
autoSubmit?: boolean;
|
|
11
|
+
scene: EmailScene;
|
|
12
|
+
}
|
|
13
|
+
export declare const SendCodeByEmail: FC<SendCodeByEmailProps>;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { FC } from 'react';
|
|
2
|
+
import { SceneType } from 'authing-js-sdk';
|
|
3
|
+
import './style.less';
|
|
4
|
+
import { InputProps } from 'antd/lib/input';
|
|
5
|
+
export interface SendCodeByPhoneProps extends InputProps {
|
|
6
|
+
data?: string;
|
|
7
|
+
form?: any;
|
|
8
|
+
onSendCodeBefore?: any;
|
|
9
|
+
fieldName?: string;
|
|
10
|
+
autoSubmit?: boolean;
|
|
11
|
+
scene: SceneType;
|
|
12
|
+
areaCode?: string;
|
|
13
|
+
isInternationSms?: boolean;
|
|
14
|
+
}
|
|
15
|
+
export declare const SendCodeByPhone: FC<SendCodeByPhoneProps>;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { FC } from 'react';
|
|
2
|
+
import './style.less';
|
|
3
|
+
import { InputProps } from 'antd/lib/input';
|
|
4
|
+
export interface SendPhoneCodeProps extends InputProps {
|
|
5
|
+
form?: any;
|
|
6
|
+
beforeSend?: any;
|
|
7
|
+
autoSubmit?: boolean;
|
|
8
|
+
}
|
|
9
|
+
export declare const SendCode: FC<SendPhoneCodeProps>;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { ButtonProps } from 'antd/lib/button';
|
|
3
|
+
interface SubmitButtonProps extends ButtonProps {
|
|
4
|
+
text?: string;
|
|
5
|
+
className?: string;
|
|
6
|
+
onClick?: any;
|
|
7
|
+
disabled?: boolean;
|
|
8
|
+
}
|
|
9
|
+
declare const _default: React.ForwardRefExoticComponent<SubmitButtonProps & React.RefAttributes<unknown>>;
|
|
10
|
+
export default _default;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { GuardModuleType } from '../Guard';
|
|
2
|
+
import { IG2Config, IG2Events, IG2FCViewProps } from '../Type';
|
|
3
|
+
export interface SubmitSuccessEvents extends IG2Events {
|
|
4
|
+
}
|
|
5
|
+
export interface SubmitSuccessConfig extends IG2Config {
|
|
6
|
+
}
|
|
7
|
+
export interface SubmitSuccessInitData {
|
|
8
|
+
title?: string;
|
|
9
|
+
message?: string;
|
|
10
|
+
text?: string;
|
|
11
|
+
countDesc?: string;
|
|
12
|
+
changeModule?: GuardModuleType;
|
|
13
|
+
}
|
|
14
|
+
export interface GuardSubmitSuccessViewProps extends IG2FCViewProps, SubmitSuccessEvents {
|
|
15
|
+
config: SubmitSuccessConfig;
|
|
16
|
+
initData?: SubmitSuccessInitData;
|
|
17
|
+
}
|
|
@@ -0,0 +1,267 @@
|
|
|
1
|
+
import { Lang } from '..';
|
|
2
|
+
import { PasswordStrength } from '../_utils';
|
|
3
|
+
export * from 'authing-js-sdk';
|
|
4
|
+
export declare const enum LoginMethods {
|
|
5
|
+
LDAP = "ldap",
|
|
6
|
+
AppQr = "app-qrcode",
|
|
7
|
+
Password = "password",
|
|
8
|
+
PhoneCode = "phone-code",
|
|
9
|
+
WxMinQr = "wechat-miniprogram-qrcode",
|
|
10
|
+
AD = "ad",
|
|
11
|
+
WechatMpQrcode = "wechatmp-qrcode"
|
|
12
|
+
}
|
|
13
|
+
export declare const enum OIDCConnectionMode {
|
|
14
|
+
FRONT_CHANNEL = "FRONT_CHANNEL",
|
|
15
|
+
BACK_CHANNEL = "BACK_CHANNEL"
|
|
16
|
+
}
|
|
17
|
+
export declare const enum SocialConnectionProvider {
|
|
18
|
+
ALIPAY = "alipay",
|
|
19
|
+
GOOGLE = "google",
|
|
20
|
+
WECHATPC = "wechat:pc",
|
|
21
|
+
WECHATMP = "wechat:webpage-authorization",
|
|
22
|
+
WECHAT_MINIPROGRAM = "wechat:miniprogram:default",
|
|
23
|
+
WECHAT_MINIPROGRAM_QRCODE = "wechat:miniprogram:qrconnect",
|
|
24
|
+
WECHAT_MINIPROGRAM_APPLAUNCH = "wechat:miniprogram:app-launch",
|
|
25
|
+
WECHATMOBILE = "wechat:mobile",
|
|
26
|
+
GITHUB = "github",
|
|
27
|
+
QQ = "qq",
|
|
28
|
+
WECHATWORK_ADDRESS_BOOK = "wechatwork:addressbook",
|
|
29
|
+
WECHATWORK_CORP_QRCONNECT = "wechatwork:corp:qrconnect",
|
|
30
|
+
WECHATWORK_SERVICEPROVIDER_QRCONNECT = "wechatwork:service-provider:qrconnect",
|
|
31
|
+
DINGTALK = "dingtalk",
|
|
32
|
+
WEIBO = "weibo",
|
|
33
|
+
APPLE = "apple",
|
|
34
|
+
APPLE_WEB = "apple:web",
|
|
35
|
+
LARK_PUBLIC = "lark-public",
|
|
36
|
+
LARK_INTERNAL = "lark-internal",
|
|
37
|
+
BAIDU = "baidu",
|
|
38
|
+
LINKEDIN = "linkedin",
|
|
39
|
+
SLACK = "slack",
|
|
40
|
+
YIDUN = "yidun",
|
|
41
|
+
QINGCLOUD = "qingcloud",
|
|
42
|
+
FACEBOOK = "facebook"
|
|
43
|
+
}
|
|
44
|
+
export declare const enum Protocol {
|
|
45
|
+
AD = "ad",
|
|
46
|
+
CAS = "cas",
|
|
47
|
+
LDAP = "ldap",
|
|
48
|
+
OIDC = "oidc",
|
|
49
|
+
SAML = "saml",
|
|
50
|
+
OAUTH = "oauth",
|
|
51
|
+
AZURE_AD = "azure-ad",
|
|
52
|
+
AD_KERBEROS = "ad-kerberos"
|
|
53
|
+
}
|
|
54
|
+
export interface IOAuthConnectionConfig {
|
|
55
|
+
authEndPoint: string;
|
|
56
|
+
tokenEndPoint: string;
|
|
57
|
+
scope: string;
|
|
58
|
+
clientId: string;
|
|
59
|
+
clientSecret: string;
|
|
60
|
+
authUrlTemplate: string;
|
|
61
|
+
codeToTokenScript: string;
|
|
62
|
+
tokenToUserInfoScript: string;
|
|
63
|
+
tokenToUserInfoScriptFuncId: string;
|
|
64
|
+
codeToTokenScriptFuncId: string;
|
|
65
|
+
authUrl?: string;
|
|
66
|
+
}
|
|
67
|
+
export interface IAzureAdConnectionConfig {
|
|
68
|
+
microsoftAzureAdDomain: string;
|
|
69
|
+
clientId: string;
|
|
70
|
+
syncUserProfileOnLogin: string;
|
|
71
|
+
emailVerifiedDefault: boolean;
|
|
72
|
+
authorizationUrl: string;
|
|
73
|
+
callbackUrl: string;
|
|
74
|
+
}
|
|
75
|
+
export interface ISamlConnectionConfig {
|
|
76
|
+
signInEndPoint: string;
|
|
77
|
+
samlRequest?: string;
|
|
78
|
+
samlIdpCert: string;
|
|
79
|
+
samlSpCert: string;
|
|
80
|
+
samlSpKey: string;
|
|
81
|
+
signOutEndPoint: string;
|
|
82
|
+
signSamlRequest: boolean;
|
|
83
|
+
signatureAlgorithm: string;
|
|
84
|
+
digestAlgorithm: string;
|
|
85
|
+
protocolBinding: string;
|
|
86
|
+
}
|
|
87
|
+
export interface ICasConnectionConfig {
|
|
88
|
+
casConnectionLoginUrl: string;
|
|
89
|
+
}
|
|
90
|
+
export interface SocialConnectionItem {
|
|
91
|
+
name: string;
|
|
92
|
+
name_en: string;
|
|
93
|
+
displayName: string;
|
|
94
|
+
logo: string;
|
|
95
|
+
description: string;
|
|
96
|
+
identifier: string;
|
|
97
|
+
provider: SocialConnectionProvider;
|
|
98
|
+
authorizationUrl: string;
|
|
99
|
+
tooltip: Record<Lang, string>;
|
|
100
|
+
}
|
|
101
|
+
export declare const enum RegisterMethods {
|
|
102
|
+
Email = "email",
|
|
103
|
+
Phone = "phone",
|
|
104
|
+
EmailCode = "emailCode"
|
|
105
|
+
}
|
|
106
|
+
export declare type QrcodeTabsSettings = Record<LoginMethods, Array<{
|
|
107
|
+
id: string;
|
|
108
|
+
title: string;
|
|
109
|
+
isDefault?: boolean;
|
|
110
|
+
}>>;
|
|
111
|
+
export interface OidcClientMetadata {
|
|
112
|
+
grant_types: string[];
|
|
113
|
+
client_id: string;
|
|
114
|
+
redirect_uris: string[];
|
|
115
|
+
scope: string;
|
|
116
|
+
response_types: ResponseType[];
|
|
117
|
+
}
|
|
118
|
+
export interface OIDCConnectionConfig {
|
|
119
|
+
issuerUrl: string;
|
|
120
|
+
authorizationEdpoint: string;
|
|
121
|
+
responseType: string;
|
|
122
|
+
mode: OIDCConnectionMode;
|
|
123
|
+
clientId: string;
|
|
124
|
+
clientSecret: string;
|
|
125
|
+
scopes: string;
|
|
126
|
+
redirectUri: string;
|
|
127
|
+
}
|
|
128
|
+
export interface InternalExtendsField {
|
|
129
|
+
type: 'internal';
|
|
130
|
+
name: string;
|
|
131
|
+
label: string;
|
|
132
|
+
inputType: string;
|
|
133
|
+
required: boolean;
|
|
134
|
+
validateRules: any[];
|
|
135
|
+
}
|
|
136
|
+
export interface UserExtendsField {
|
|
137
|
+
type: 'user';
|
|
138
|
+
id: string;
|
|
139
|
+
name: string;
|
|
140
|
+
label: string;
|
|
141
|
+
inputType: string;
|
|
142
|
+
required: boolean;
|
|
143
|
+
validateRules: any[];
|
|
144
|
+
}
|
|
145
|
+
export declare type ExtendsField = InternalExtendsField | UserExtendsField;
|
|
146
|
+
export interface ApplicationPasswordTabConfig {
|
|
147
|
+
enabledLoginMethods?: PasswordLoginMethods[];
|
|
148
|
+
}
|
|
149
|
+
export interface ApplicationVerifyCodeTabConfig {
|
|
150
|
+
enabledLoginMethods: VerifyLoginMethods[];
|
|
151
|
+
}
|
|
152
|
+
export interface Agreement {
|
|
153
|
+
id: number;
|
|
154
|
+
title: string;
|
|
155
|
+
required: boolean;
|
|
156
|
+
lang: Lang;
|
|
157
|
+
availableAt?: number;
|
|
158
|
+
}
|
|
159
|
+
export declare type PasswordLoginMethods = 'username-password' | 'email-password' | 'phone-password';
|
|
160
|
+
export declare type VerifyLoginMethods = 'email-code' | 'phone-code';
|
|
161
|
+
export declare type ComplateFiledsPlace = 'register' | 'login';
|
|
162
|
+
export interface ApplicationConfig {
|
|
163
|
+
id: string;
|
|
164
|
+
allowedOrigins: string[];
|
|
165
|
+
corsWhitelist: string[];
|
|
166
|
+
cdnBase: string;
|
|
167
|
+
userPoolId: string;
|
|
168
|
+
rootUserPoolId: string;
|
|
169
|
+
publicKey: string;
|
|
170
|
+
internationalSmsConfig?: {
|
|
171
|
+
enabled: boolean;
|
|
172
|
+
defaultISOType: string;
|
|
173
|
+
};
|
|
174
|
+
css: string;
|
|
175
|
+
customLoading?: string;
|
|
176
|
+
name: string;
|
|
177
|
+
logo: string;
|
|
178
|
+
description?: string;
|
|
179
|
+
redirectUris: string[];
|
|
180
|
+
registerDisabled: boolean;
|
|
181
|
+
mergeAdAndAccountPasswordLogin: boolean;
|
|
182
|
+
registerTabs: {
|
|
183
|
+
list: string[];
|
|
184
|
+
default: string;
|
|
185
|
+
title: {
|
|
186
|
+
[x: string]: string;
|
|
187
|
+
};
|
|
188
|
+
};
|
|
189
|
+
registerTabsConfig: {
|
|
190
|
+
list: string[];
|
|
191
|
+
default: string;
|
|
192
|
+
title: {
|
|
193
|
+
[x: string]: string;
|
|
194
|
+
};
|
|
195
|
+
registerTypeConfig: {
|
|
196
|
+
emailRegisterType?: RegisterMethods[];
|
|
197
|
+
phoneRegisterType?: RegisterMethods[];
|
|
198
|
+
};
|
|
199
|
+
};
|
|
200
|
+
qrcodeTabsSettings: QrcodeTabsSettings;
|
|
201
|
+
loginTabs: {
|
|
202
|
+
list: string[];
|
|
203
|
+
default: string;
|
|
204
|
+
defaultV2?: string;
|
|
205
|
+
title: {
|
|
206
|
+
[x: string]: string;
|
|
207
|
+
};
|
|
208
|
+
};
|
|
209
|
+
socialConnections: SocialConnectionItem[];
|
|
210
|
+
complateFiledsPlace: ComplateFiledsPlace[];
|
|
211
|
+
extendsFieldsEnabled: boolean;
|
|
212
|
+
extendsFields: ExtendsField[];
|
|
213
|
+
extendsFieldsI18n?: {
|
|
214
|
+
[key: string]: Record<Lang, {
|
|
215
|
+
enabled: boolean;
|
|
216
|
+
value: string;
|
|
217
|
+
}>;
|
|
218
|
+
};
|
|
219
|
+
identifier: string;
|
|
220
|
+
requestHostname: string;
|
|
221
|
+
identityProviders: {
|
|
222
|
+
identifier: string;
|
|
223
|
+
protocol: Protocol;
|
|
224
|
+
displayName: string;
|
|
225
|
+
logo: string;
|
|
226
|
+
config: ISamlConnectionConfig | OIDCConnectionConfig | ICasConnectionConfig | IAzureAdConnectionConfig | IOAuthConnectionConfig;
|
|
227
|
+
}[];
|
|
228
|
+
ssoPageComponentDisplay: {
|
|
229
|
+
autoRegisterThenLoginHintInfo: boolean;
|
|
230
|
+
forgetPasswordBtn: boolean;
|
|
231
|
+
idpBtns: boolean;
|
|
232
|
+
loginBtn: boolean;
|
|
233
|
+
loginByPhoneCodeTab: boolean;
|
|
234
|
+
loginByUserPasswordTab: boolean;
|
|
235
|
+
loginMethodNav: boolean;
|
|
236
|
+
phoneCodeInput: boolean;
|
|
237
|
+
registerBtn: boolean;
|
|
238
|
+
registerByEmailTab: boolean;
|
|
239
|
+
registerByPhoneTab: boolean;
|
|
240
|
+
registerMethodNav: boolean;
|
|
241
|
+
socialLoginBtns: boolean;
|
|
242
|
+
userPasswordInput: boolean;
|
|
243
|
+
wxMpScanTab: boolean;
|
|
244
|
+
};
|
|
245
|
+
protocol: Protocol;
|
|
246
|
+
oidcConfig: OidcClientMetadata;
|
|
247
|
+
passwordTabConfig: ApplicationPasswordTabConfig;
|
|
248
|
+
verifyCodeTabConfig?: ApplicationVerifyCodeTabConfig;
|
|
249
|
+
agreementEnabled: boolean;
|
|
250
|
+
agreements: Agreement[];
|
|
251
|
+
customPasswordStrength: any;
|
|
252
|
+
passwordStrength: PasswordStrength;
|
|
253
|
+
verifyCodeLength: number;
|
|
254
|
+
websocket: string;
|
|
255
|
+
welcomeMessage: any;
|
|
256
|
+
skipComplateFileds: boolean;
|
|
257
|
+
selfUnlockStrategy: 'captcha' | 'password-captcha';
|
|
258
|
+
defaultLanguageConfig: Lang;
|
|
259
|
+
/**
|
|
260
|
+
* 是否开启账号切换
|
|
261
|
+
*/
|
|
262
|
+
enableLoginAccountSwitch: boolean;
|
|
263
|
+
/**
|
|
264
|
+
* 是否开启注册密码补全
|
|
265
|
+
*/
|
|
266
|
+
enableCompletePassword: boolean;
|
|
267
|
+
}
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
import { AuthenticationClient, CommonMessage, User } from 'authing-js-sdk';
|
|
2
|
+
import { GuardModuleType } from '../Guard/module';
|
|
3
|
+
import { FacePlugin } from '../_utils/facePlugin/interface';
|
|
4
|
+
import { ApplicationConfig } from './application';
|
|
5
|
+
export * from './application';
|
|
6
|
+
export type { CommonMessage, User };
|
|
7
|
+
export declare type Lang = 'zh-CN' | 'en-US' | 'zh-TW' | 'ja-JP';
|
|
8
|
+
export declare const enum GuardMode {
|
|
9
|
+
Modal = "modal",
|
|
10
|
+
Normal = "normal"
|
|
11
|
+
}
|
|
12
|
+
export interface IG2FCProps extends IG2Events {
|
|
13
|
+
appId?: string;
|
|
14
|
+
tenantId?: string;
|
|
15
|
+
config?: Partial<IG2Config>;
|
|
16
|
+
visible?: boolean;
|
|
17
|
+
initData?: any;
|
|
18
|
+
appendConfig?: GuardAppendConfig;
|
|
19
|
+
facePlugin?: FacePlugin;
|
|
20
|
+
authClient?: AuthenticationClient;
|
|
21
|
+
}
|
|
22
|
+
export interface GuardAppendConfig {
|
|
23
|
+
internalRequest?: boolean;
|
|
24
|
+
singleComponent?: boolean;
|
|
25
|
+
unAuthFlow?: boolean;
|
|
26
|
+
publicConfig?: ApplicationConfig;
|
|
27
|
+
pageConfig?: GuardPageConfig;
|
|
28
|
+
}
|
|
29
|
+
export interface IG2FCViewProps extends IG2FCProps {
|
|
30
|
+
config: IG2Config;
|
|
31
|
+
}
|
|
32
|
+
export interface IG2Config {
|
|
33
|
+
title?: string;
|
|
34
|
+
logo?: string;
|
|
35
|
+
lang?: string;
|
|
36
|
+
langRange?: Lang[];
|
|
37
|
+
host: string;
|
|
38
|
+
isHost?: boolean;
|
|
39
|
+
mode: GuardMode;
|
|
40
|
+
clickCloseable: boolean;
|
|
41
|
+
escCloseable: boolean;
|
|
42
|
+
userpool?: string;
|
|
43
|
+
contentCss?: string;
|
|
44
|
+
target?: HTMLElement | string;
|
|
45
|
+
__internalRequest__?: boolean;
|
|
46
|
+
__singleComponent__?: boolean;
|
|
47
|
+
__unAuthFlow__?: boolean;
|
|
48
|
+
}
|
|
49
|
+
export interface IG2Events {
|
|
50
|
+
onLoad?: (authClient: AuthenticationClient) => void;
|
|
51
|
+
onLoadError?: (error: any) => void;
|
|
52
|
+
onClose?: () => void;
|
|
53
|
+
onLangChange?: (lang: Lang) => void;
|
|
54
|
+
__changeModule?: (moduleName: GuardModuleType, initData?: any) => void;
|
|
55
|
+
}
|
|
56
|
+
export declare const getDefaultG2Config: () => IG2Config;
|
|
57
|
+
export declare const LanguageMap: any;
|
|
58
|
+
export declare const enum InputMethod {
|
|
59
|
+
EmailCode = "email-code",
|
|
60
|
+
PhoneCode = "phone-code"
|
|
61
|
+
}
|
|
62
|
+
export declare const enum GuardPageSene {
|
|
63
|
+
Global = "global"
|
|
64
|
+
}
|
|
65
|
+
export interface GuardPageConfig {
|
|
66
|
+
[GuardPageSene.Global]: {
|
|
67
|
+
showChangeLanguage: boolean;
|
|
68
|
+
defaultLanguage: Lang | 'browser';
|
|
69
|
+
};
|
|
70
|
+
}
|
|
71
|
+
export declare const enum EmailScene {
|
|
72
|
+
WELCOME_EMAIL = "WELCOME_EMAIL",
|
|
73
|
+
FIRST_CREATED_USER = "FIRST_CREATED_USER",
|
|
74
|
+
REGISTER_VERIFY_CODE = "REGISTER_VERIFY_CODE",
|
|
75
|
+
LOGIN_VERIFY_CODE = "LOGIN_VERIFY_CODE",
|
|
76
|
+
MFA_VERIFY_CODE = "MFA_VERIFY_CODE",
|
|
77
|
+
INFORMATION_COMPLETION_VERIFY_CODE = "INFORMATION_COMPLETION_VERIFY_CODE",
|
|
78
|
+
FIRST_EMAIL_LOGIN_VERIFY = "FIRST_EMAIL_LOGIN_VERIFY",
|
|
79
|
+
CONSOLE_CONDUCTED_VERIFY = "CONSOLE_CONDUCTED_VERIFY",
|
|
80
|
+
RESET_PASSWORD_VERIFY_CODE = "RESET_PASSWORD_VERIFY_CODE",
|
|
81
|
+
EMAIL_BIND_VERIFY_CODE = "EMAIL_BIND_VERIFY_CODE",
|
|
82
|
+
EMAIL_UNBIND_VERIFY_CODE = "EMAIL_UNBIND_VERIFY_CODE",
|
|
83
|
+
SELF_UNLOCKING_VERIFY_CODE = "SELF_UNLOCKING_VERIFY_CODE"
|
|
84
|
+
}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { ValidatorFormItemProps } from '.';
|
|
3
|
+
export declare const EmailFormItem: React.FC<ValidatorFormItemProps>;
|
|
4
|
+
export declare const PhoneFormItem: React.FC<ValidatorFormItemProps>;
|
|
5
|
+
export declare const UserNameFormItem: React.FC<ValidatorFormItemProps>;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { FormInstance, FormItemProps } from 'antd/lib/form';
|
|
2
|
+
import FormItem from 'antd/lib/form/FormItem';
|
|
3
|
+
import { PasswordFormItem } from './PasswordFormItem';
|
|
4
|
+
import { EmailFormItem, PhoneFormItem, UserNameFormItem } from './ValidatorFormItem';
|
|
5
|
+
export interface ValidatorFormItemProps extends FormItemProps {
|
|
6
|
+
form?: FormInstance;
|
|
7
|
+
checkRepeat?: boolean;
|
|
8
|
+
checkExist?: boolean;
|
|
9
|
+
areaCode?: string;
|
|
10
|
+
/**
|
|
11
|
+
* 控制内部FormItem组件关于pattern的校验规则
|
|
12
|
+
*/
|
|
13
|
+
isCheckPattern?: boolean;
|
|
14
|
+
}
|
|
15
|
+
export interface ValidatorFormItemMetaProps extends ValidatorFormItemProps {
|
|
16
|
+
method: 'email' | 'phone' | 'username';
|
|
17
|
+
}
|
|
18
|
+
export interface PasswordFormItemProps extends FormItemProps {
|
|
19
|
+
}
|
|
20
|
+
export interface ICheckProps {
|
|
21
|
+
check: (values: any) => void;
|
|
22
|
+
}
|
|
23
|
+
declare type InternalFormItemType = typeof FormItem;
|
|
24
|
+
interface FormItemInterface extends InternalFormItemType {
|
|
25
|
+
Password: typeof PasswordFormItem;
|
|
26
|
+
Email: typeof EmailFormItem;
|
|
27
|
+
Phone: typeof PhoneFormItem;
|
|
28
|
+
UserName: typeof UserNameFormItem;
|
|
29
|
+
}
|
|
30
|
+
declare const CustomFormItem: FormItemInterface;
|
|
31
|
+
export default CustomFormItem;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const useCheckRepeat: (checkFn: (value: any, resolve: (value: unknown) => void, reject: (reason?: any) => void) => void) => (_: any, value: any) => Promise<unknown>;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import React, { FC } from 'react';
|
|
2
|
+
import './style.less';
|
|
3
|
+
interface VerifyCodeInputProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
4
|
+
verifyCode: string[];
|
|
5
|
+
setVerifyCode: (code: string[]) => void;
|
|
6
|
+
length?: number;
|
|
7
|
+
onEnter?: Function;
|
|
8
|
+
}
|
|
9
|
+
export declare const VerifyCodeInput: FC<VerifyCodeInputProps>;
|
|
10
|
+
export {};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export declare const enum ErrorCode {
|
|
2
|
+
OTP_MFA_CODE = 1635,
|
|
3
|
+
APP_MFA_CODE = 1636,
|
|
4
|
+
INPUT_CAPTCHACODE = 2000,
|
|
5
|
+
USER_EXISTENCE = 2026,
|
|
6
|
+
LOGIN_INVALID = 2021,
|
|
7
|
+
PASSWORD_ERROR = 2333,
|
|
8
|
+
USER_NOT_EXIST = 2004,
|
|
9
|
+
MULTIPLE_ERROR_LOCK = 2057,
|
|
10
|
+
ACCOUNT_LOCK = 2005
|
|
11
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const copyToClipboard: (str: string) => void;
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { GuardLocalConfig } from '../../Guard/config';
|
|
3
|
+
import { GuardHttp } from '../guardHttp';
|
|
4
|
+
import { GuardPageConfig } from '../../Type';
|
|
5
|
+
import { ApplicationConfig, LoginMethods, RegisterMethods } from '../../Type/application';
|
|
6
|
+
export declare const getPublicConfig: (appId: string) => ApplicationConfig;
|
|
7
|
+
export declare const setPublicConfig: (appId: string, config: ApplicationConfig) => ApplicationConfig;
|
|
8
|
+
export declare const getPageConfig: (appId: string) => GuardPageConfig;
|
|
9
|
+
export declare const setPageConfig: (appId: string, config: GuardPageConfig) => GuardPageConfig;
|
|
10
|
+
export declare const useMergeDefaultConfig: (defaultConfig: GuardLocalConfig, config?: Partial<GuardLocalConfig>) => GuardLocalConfig | undefined;
|
|
11
|
+
/**
|
|
12
|
+
* 请求服务console关于guard的配置
|
|
13
|
+
* @param forceUpdate
|
|
14
|
+
* @param appId
|
|
15
|
+
* @param config
|
|
16
|
+
* @param httpClient
|
|
17
|
+
* @param setError
|
|
18
|
+
*/
|
|
19
|
+
export declare const useFetchConsoleConfig: (forceUpdate: number, appId?: string, config?: GuardLocalConfig, httpClient?: GuardHttp, setError?: any) => {
|
|
20
|
+
finallyConfig: {
|
|
21
|
+
host: string;
|
|
22
|
+
isSSO?: boolean | undefined;
|
|
23
|
+
defaultScenes?: import("../..").GuardModuleType | undefined;
|
|
24
|
+
defaultInitData?: any;
|
|
25
|
+
showLoading?: boolean | undefined;
|
|
26
|
+
loadingComponent?: import("react").ReactNode;
|
|
27
|
+
openEventsMapping?: boolean | undefined;
|
|
28
|
+
disableRegister?: boolean | undefined;
|
|
29
|
+
registerMethods?: RegisterMethods[] | undefined;
|
|
30
|
+
defaultRegisterMethod?: RegisterMethods | undefined;
|
|
31
|
+
publicKey?: string | undefined;
|
|
32
|
+
agreementEnabled?: boolean | undefined;
|
|
33
|
+
agreements?: import("../../Type").Agreement[] | undefined;
|
|
34
|
+
registerContext?: any;
|
|
35
|
+
title?: string | undefined;
|
|
36
|
+
logo?: string | undefined;
|
|
37
|
+
lang?: string | undefined;
|
|
38
|
+
langRange?: import("../../Type").Lang[] | undefined;
|
|
39
|
+
isHost?: boolean | undefined;
|
|
40
|
+
mode: import("../../Type").GuardMode;
|
|
41
|
+
clickCloseable: boolean;
|
|
42
|
+
escCloseable: boolean;
|
|
43
|
+
userpool?: string | undefined;
|
|
44
|
+
contentCss?: string | undefined;
|
|
45
|
+
target?: string | HTMLElement | undefined;
|
|
46
|
+
__internalRequest__?: boolean | undefined;
|
|
47
|
+
__singleComponent__?: boolean | undefined;
|
|
48
|
+
__unAuthFlow__?: boolean | undefined;
|
|
49
|
+
autoRegister?: boolean | undefined;
|
|
50
|
+
disableResetPwd?: boolean | undefined;
|
|
51
|
+
defaultLoginMethod?: LoginMethods | undefined;
|
|
52
|
+
loginMethods?: LoginMethods[] | undefined;
|
|
53
|
+
passwordLoginMethods?: import("../../Type").PasswordLoginMethods[] | undefined;
|
|
54
|
+
socialConnections?: import("../../Type").SocialConnectionProvider[] | undefined;
|
|
55
|
+
socialConnectionsBtnShape?: "default" | "button" | "icon" | undefined;
|
|
56
|
+
enterpriseConnections?: string[] | undefined;
|
|
57
|
+
qrCodeScanOptions?: {
|
|
58
|
+
extIdpConnId?: string | undefined;
|
|
59
|
+
autoExchangeUserInfo?: boolean | undefined;
|
|
60
|
+
size?: {
|
|
61
|
+
height: number;
|
|
62
|
+
width: number;
|
|
63
|
+
} | undefined;
|
|
64
|
+
containerSize?: {
|
|
65
|
+
height: number;
|
|
66
|
+
width: number;
|
|
67
|
+
} | undefined;
|
|
68
|
+
interval?: number | undefined;
|
|
69
|
+
onStart?: ((timer: any) => any) | undefined;
|
|
70
|
+
onResult?: ((data: import("authing-js-sdk/build/main/lib/authentication/types").QRCodeStatus) => any) | undefined;
|
|
71
|
+
onScanned?: ((userInfo: import("authing-js-sdk/build/main/lib/authentication/types").QRCodeUserInfo) => any) | undefined;
|
|
72
|
+
onSuccess?: ((userInfo: import("authing-js-sdk/build/main/lib/authentication/types").QRCodeUserInfo, ticket: string) => any) | undefined;
|
|
73
|
+
onCancel?: (() => any) | undefined;
|
|
74
|
+
onError?: ((message: string) => any) | undefined;
|
|
75
|
+
onExpired?: (() => any) | undefined;
|
|
76
|
+
onCodeShow?: ((random: string, url: string) => any) | undefined;
|
|
77
|
+
onCodeLoaded?: ((random: string, url: string) => any) | undefined;
|
|
78
|
+
onCodeLoadFailed?: ((message: string) => any) | undefined;
|
|
79
|
+
onCodeDestroyed?: ((random: string) => any) | undefined;
|
|
80
|
+
onRetry?: (() => any) | undefined;
|
|
81
|
+
onMfa?: ((code: number, message: string, data: Record<string, any>) => {}) | undefined;
|
|
82
|
+
tips?: {
|
|
83
|
+
title?: string | undefined;
|
|
84
|
+
scanned?: string | undefined;
|
|
85
|
+
succeed?: string | undefined;
|
|
86
|
+
canceled?: string | undefined;
|
|
87
|
+
expired?: string | undefined;
|
|
88
|
+
retry?: string | undefined;
|
|
89
|
+
failed?: string | undefined;
|
|
90
|
+
middleTitle?: string | undefined;
|
|
91
|
+
referText?: string | undefined;
|
|
92
|
+
} | undefined;
|
|
93
|
+
onAuthFlow?: ((flow: Record<string, any>) => {}) | undefined;
|
|
94
|
+
customData?: {
|
|
95
|
+
[x: string]: any;
|
|
96
|
+
} | undefined;
|
|
97
|
+
context?: {
|
|
98
|
+
[x: string]: any;
|
|
99
|
+
} | undefined;
|
|
100
|
+
withCustomData?: boolean | undefined;
|
|
101
|
+
} | undefined;
|
|
102
|
+
_closeLoopCheckQrcode?: boolean | undefined;
|
|
103
|
+
};
|
|
104
|
+
guardPageConfig: GuardPageConfig;
|
|
105
|
+
} | {
|
|
106
|
+
finallyConfig: undefined;
|
|
107
|
+
guardPageConfig: undefined;
|
|
108
|
+
};
|