@authing/react-ui-components 4.3.1-rc.2 → 4.3.2-3.rc-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.css +1 -1
- package/lib/index.min.js +1 -1
- package/lib/index.min.js.LICENSE.txt +6 -0
- package/package.json +3 -2
- package/types/CompleteInfo/interface.d.ts +4 -1
- package/types/CompleteInfo/utils.d.ts +6 -0
- package/types/ForgetPassword/core/resetPassword.d.ts +2 -2
- package/types/ForgetPassword/interface.d.ts +1 -0
- package/types/Guard/config.d.ts +2 -2
- package/types/Guard/core/hooks/useAgreements.d.ts +14 -0
- package/types/Guard/core/hooks/useGuardView.d.ts +7 -0
- package/types/Guard/core/hooks/useMultipleAccounts.d.ts +1 -1
- package/types/Guard/event.d.ts +12 -1
- package/types/LazyloadImage/index.d.ts +12 -0
- package/types/Login/core/withAuthingOtpPush/BeforeLogin.d.ts +17 -0
- package/types/Login/core/withAuthingOtpPush/HowBindClient.d.ts +2 -0
- package/types/Login/core/withAuthingOtpPush/HowGetAppLoginUrl.d.ts +2 -0
- package/types/Login/core/withAuthingOtpPush/HowUsePushLogin.d.ts +2 -0
- package/types/Login/core/withAuthingOtpPush/PendingLogin.d.ts +7 -0
- package/types/Login/core/withAuthingOtpPush/PushLoginGuideModal.d.ts +3 -0
- package/types/Login/core/withAuthingOtpPush/PushLoginGuideSelector.d.ts +9 -0
- package/types/Login/core/withAuthingOtpPush/index.d.ts +3 -0
- package/types/Login/core/withAuthingOtpPush/types.d.ts +28 -0
- package/types/Login/core/withWeComQrcode.d.ts +2 -0
- package/types/Login/multipleAccounts/panel.d.ts +1 -0
- package/types/NewSubmitSuccess/interface.d.ts +2 -1
- package/types/SendCode/SendCodeByPhone.d.ts +2 -0
- package/types/TenantPortalSelect/index.d.ts +0 -13
- package/types/TenantPortalSelect/interface.d.ts +33 -0
- package/types/Type/application.d.ts +28 -1
- package/types/Type/index.d.ts +3 -0
- package/types/_utils/config/index.d.ts +2 -1
- package/types/_utils/context.d.ts +7 -0
- package/types/_utils/guardHttp.d.ts +1 -0
- package/types/_utils/index.d.ts +4 -3
- package/types/index.d.ts +1 -0
- package/types/version/version.d.ts +1 -1
|
@@ -25,6 +25,12 @@
|
|
|
25
25
|
* Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
|
|
26
26
|
*/
|
|
27
27
|
|
|
28
|
+
/**
|
|
29
|
+
* @license qrcode.react
|
|
30
|
+
* Copyright (c) Paul O'Shannessy
|
|
31
|
+
* SPDX-License-Identifier: ISC
|
|
32
|
+
*/
|
|
33
|
+
|
|
28
34
|
/** @license React v16.13.1
|
|
29
35
|
* react-is.production.min.js
|
|
30
36
|
*
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@authing/react-ui-components",
|
|
3
|
-
"version": "4.3.1
|
|
3
|
+
"version": "4.3.23.rc-1",
|
|
4
4
|
"private": false,
|
|
5
5
|
"main": "lib/index.min.js",
|
|
6
6
|
"typings": "types/index.d.ts",
|
|
@@ -11,12 +11,13 @@
|
|
|
11
11
|
],
|
|
12
12
|
"dependencies": {
|
|
13
13
|
"antd": "^4.8.0",
|
|
14
|
-
"authing-js-sdk": "4.23.
|
|
14
|
+
"authing-js-sdk": "4.23.48",
|
|
15
15
|
"classnames": "^2.3.1",
|
|
16
16
|
"fastclick": "^1.0.6",
|
|
17
17
|
"global": "^4.4.0",
|
|
18
18
|
"phone": "^3.1.12",
|
|
19
19
|
"prompt": "^1.3.0",
|
|
20
|
+
"qrcode.react": "^3.1.0",
|
|
20
21
|
"qs": "^6.9.4",
|
|
21
22
|
"react-responsive": "^9.0.0-beta.5",
|
|
22
23
|
"react-use": "^17.3.1",
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { AuthenticationClient, CommonMessage, User } from 'authing-js-sdk';
|
|
2
|
-
import { IG2Config, IG2Events, IG2FCProps } from '../Type';
|
|
2
|
+
import { IG2Config, IG2Events, IG2FCProps, Lang } from '../Type';
|
|
3
3
|
export interface CompleteInfoConfig extends IG2Config {
|
|
4
4
|
}
|
|
5
5
|
export declare const getDefaultCompleteInfoConfig: () => CompleteInfoConfig;
|
|
@@ -41,6 +41,9 @@ export interface CompleteInfoRule {
|
|
|
41
41
|
type: FormValidateRule;
|
|
42
42
|
content: string;
|
|
43
43
|
errorMessage?: string;
|
|
44
|
+
i18n?: {
|
|
45
|
+
errorMessage: Record<Lang, []>;
|
|
46
|
+
};
|
|
44
47
|
}
|
|
45
48
|
export interface CompleteInfoSelectOption {
|
|
46
49
|
value: string;
|
|
@@ -20,3 +20,9 @@ export declare const fieldValuesToRegisterProfile: (extendsFields: ApplicationCo
|
|
|
20
20
|
value: string;
|
|
21
21
|
}[];
|
|
22
22
|
};
|
|
23
|
+
/**
|
|
24
|
+
* @description 获取对应key的国际化value
|
|
25
|
+
* @param record :example {key:"",i18n:{key:{zh_CN:{enabled:true,value:""}}}
|
|
26
|
+
* @param key
|
|
27
|
+
*/
|
|
28
|
+
export declare const getI18nValue: (record: any, key: string) => any;
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
|
|
1
|
+
import React from 'react';
|
|
2
2
|
export declare enum InputMethodMap {
|
|
3
3
|
email = "email-code",
|
|
4
4
|
phone = "phone-code"
|
|
5
5
|
}
|
|
6
6
|
interface ResetPasswordProps {
|
|
7
7
|
publicConfig: any;
|
|
8
|
-
setPhoneOrEmail: any;
|
|
9
8
|
setControlShow: any;
|
|
10
9
|
setPolicyStrength: any;
|
|
11
10
|
setCustomPasswordStrength: any;
|
|
12
11
|
setPhoneOrEmailText: any;
|
|
12
|
+
setResetToken: React.Dispatch<React.SetStateAction<string>>;
|
|
13
13
|
}
|
|
14
14
|
export declare const ResetPassword: (props: ResetPasswordProps) => JSX.Element;
|
|
15
15
|
export {};
|
|
@@ -9,6 +9,7 @@ export interface ForgetPasswordEvents extends IG2Events {
|
|
|
9
9
|
onPwdResetError?: (error: CommonMessage, authClient: AuthenticationClient) => void;
|
|
10
10
|
}
|
|
11
11
|
export interface ForgetPasswordConfig extends IG2Config {
|
|
12
|
+
goBack?: null | (() => void);
|
|
12
13
|
}
|
|
13
14
|
export interface ForgetPasswordProps extends IG2FCProps, ForgetPasswordEvents {
|
|
14
15
|
config: Partial<IG2Config>;
|
package/types/Guard/config.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { ReactNode } from 'react';
|
|
2
2
|
import { GuardModuleType } from '.';
|
|
3
|
+
import { ForgetPasswordConfig } from '../ForgetPassword/interface';
|
|
3
4
|
import { LoginConfig } from '../Login/interface';
|
|
4
5
|
import { RegisterConfig } from '../Register/interface';
|
|
5
|
-
|
|
6
|
-
export interface GuardLocalConfig extends RegisterConfig, LoginConfig, SubmitSuccessConfig {
|
|
6
|
+
export interface GuardLocalConfig extends RegisterConfig, LoginConfig, ForgetPasswordConfig {
|
|
7
7
|
isSSO?: boolean;
|
|
8
8
|
defaultScenes?: GuardModuleType;
|
|
9
9
|
defaultInitData?: any;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { Agreement } from '../../../Type';
|
|
2
|
+
interface Options {
|
|
3
|
+
agreements: Agreement[];
|
|
4
|
+
checkedAgreements: (string | number)[];
|
|
5
|
+
checkAllAgreements: () => void;
|
|
6
|
+
unCheckAllAgreements: () => void;
|
|
7
|
+
}
|
|
8
|
+
export declare function useAgreements(options: Options): {
|
|
9
|
+
agreements: Agreement[];
|
|
10
|
+
checkedAgreements: (string | number)[];
|
|
11
|
+
checkAllAgreements: () => void;
|
|
12
|
+
unCheckAllAgreements: () => void;
|
|
13
|
+
};
|
|
14
|
+
export {};
|
|
@@ -13,7 +13,7 @@ export declare const QR_CODE_WAY: LoginWay[];
|
|
|
13
13
|
* 登录时所有支持的登录列表(前端定义列表)
|
|
14
14
|
* 这里稍微有点乱 因为Login中的登录方式和这里的不匹配,暂时放在了一起
|
|
15
15
|
*/
|
|
16
|
-
export declare type LoginWay = 'email' | 'phone' | 'password' | 'phone-code' | 'email-code' | 'social' | 'wechat-miniprogram-qrcode' | 'wechatmp-qrcode' | 'app-qrcode' | 'ad' | 'ldap' | 'ldap-password' | 'ldap-email' | 'ldap-phone';
|
|
16
|
+
export declare type LoginWay = 'email' | 'phone' | 'password' | 'phone-code' | 'email-code' | 'social' | 'wechat-miniprogram-qrcode' | 'wechatmp-qrcode' | 'app-qrcode' | 'ad' | 'ldap' | 'ldap-password' | 'ldap-email' | 'ldap-phone' | 'authing-otp-push';
|
|
17
17
|
/**
|
|
18
18
|
* when: 多账号页面跳转进入登录页面
|
|
19
19
|
* 携带的回填数据信息
|
package/types/Guard/event.d.ts
CHANGED
|
@@ -5,8 +5,16 @@ import { IdentityBindingEvents } from '../IdentityBinding/interface';
|
|
|
5
5
|
import { IdentityBindingAskEvents } from '../IdentityBindingAsk';
|
|
6
6
|
import { LoginEvents } from '../Login/interface';
|
|
7
7
|
import { RegisterEvents } from '../Register/interface';
|
|
8
|
-
|
|
8
|
+
import { TenantPortalEvents } from '../TenantPortalSelect/interface';
|
|
9
|
+
interface OnAfterChangeModuleOptions {
|
|
10
|
+
currentView: string;
|
|
11
|
+
currentModule: GuardModuleType;
|
|
12
|
+
currentTab?: string;
|
|
13
|
+
data?: any;
|
|
14
|
+
}
|
|
15
|
+
export interface GuardEvents extends LoginEvents, RegisterEvents, CompleteInfoEvents, ForgetPasswordEvents, IdentityBindingEvents, IdentityBindingAskEvents, TenantPortalEvents {
|
|
9
16
|
onBeforeChangeModule?: (key: GuardModuleType, initData?: any) => boolean | Promise<boolean>;
|
|
17
|
+
onAfterChangeModule?: (options: OnAfterChangeModuleOptions) => void;
|
|
10
18
|
}
|
|
11
19
|
export declare const guardEventsFilter: (props: any, multipleInstance?: {
|
|
12
20
|
initStore: (appId: string, options: {
|
|
@@ -65,6 +73,7 @@ export declare const GuardEventsCamelToKebabMapping: {
|
|
|
65
73
|
readonly onRegisterInfoCompletedError: "register-info-completed-error";
|
|
66
74
|
readonly onLangChange: "lang-change";
|
|
67
75
|
readonly onBeforeChangeModule: "before-change-module";
|
|
76
|
+
readonly onAfterChangeModule: "after-change-module";
|
|
68
77
|
};
|
|
69
78
|
export interface GuardEventsKebabToCamelType {
|
|
70
79
|
load: GuardEvents['onLoad'];
|
|
@@ -88,4 +97,6 @@ export interface GuardEventsKebabToCamelType {
|
|
|
88
97
|
'register-info-completed-error': GuardEvents['onRegisterInfoCompletedError'];
|
|
89
98
|
'lang-change': GuardEvents['onLangChange'];
|
|
90
99
|
'before-change-module': GuardEvents['onBeforeChangeModule'];
|
|
100
|
+
'after-change-module': GuardEvents['onAfterChangeModule'];
|
|
91
101
|
}
|
|
102
|
+
export {};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { CSSProperties, ReactNode } from 'react';
|
|
2
|
+
interface LazyloadImageProps {
|
|
3
|
+
src: string;
|
|
4
|
+
placeholder: ReactNode;
|
|
5
|
+
className?: string;
|
|
6
|
+
style?: CSSProperties;
|
|
7
|
+
alt?: string;
|
|
8
|
+
width?: string;
|
|
9
|
+
height?: string;
|
|
10
|
+
}
|
|
11
|
+
export declare function LazyloadImage(props: LazyloadImageProps): JSX.Element;
|
|
12
|
+
export {};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { OnPushSuccessProps, OnLoginProps } from './types';
|
|
3
|
+
import { AuthingGuardResponse } from '../../../_utils/http';
|
|
4
|
+
import { Agreement } from '../../../Type';
|
|
5
|
+
interface BeforeLoginProps {
|
|
6
|
+
onPushSuccess: (props: OnPushSuccessProps) => void;
|
|
7
|
+
signinByPush: (props: OnLoginProps) => Promise<AuthingGuardResponse<{
|
|
8
|
+
pushCodeId: string;
|
|
9
|
+
}>>;
|
|
10
|
+
pushLoginStatus: boolean;
|
|
11
|
+
onchangePushLoginStatus: () => void;
|
|
12
|
+
defaultAccount: string;
|
|
13
|
+
setAccount: React.Dispatch<any>;
|
|
14
|
+
agreements: Agreement[];
|
|
15
|
+
}
|
|
16
|
+
export declare function BeforeLogin(props: BeforeLoginProps): JSX.Element;
|
|
17
|
+
export {};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { SelectorOptions, Selector } from './types';
|
|
3
|
+
interface PushLoginGuideSelectorProps {
|
|
4
|
+
defaultValue: Selector;
|
|
5
|
+
onChange: (value: Selector) => void;
|
|
6
|
+
options: SelectorOptions;
|
|
7
|
+
}
|
|
8
|
+
export declare function PushLoginGuideSelector(props: PushLoginGuideSelectorProps): JSX.Element;
|
|
9
|
+
export {};
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { BackFillMultipleState, StoreInstance } from '../../../Guard/core/hooks/useMultipleAccounts';
|
|
2
|
+
import { Agreement } from '../../../Type';
|
|
3
|
+
export interface OnPushSuccessProps {
|
|
4
|
+
pushCodeId: string;
|
|
5
|
+
}
|
|
6
|
+
export interface CheckPushCodeStatusProps {
|
|
7
|
+
pushCodeId: string;
|
|
8
|
+
}
|
|
9
|
+
export interface OnLoginProps {
|
|
10
|
+
account: string;
|
|
11
|
+
}
|
|
12
|
+
export declare type LoginStatus = 'before' | 'pending';
|
|
13
|
+
export interface LoginWithAuthingOtpPushProps {
|
|
14
|
+
onLoginSuccess?: any;
|
|
15
|
+
multipleInstance?: StoreInstance;
|
|
16
|
+
initData?: BackFillMultipleState;
|
|
17
|
+
agreements: Agreement[];
|
|
18
|
+
}
|
|
19
|
+
export interface PushLoginGudeModalProps {
|
|
20
|
+
visible: boolean;
|
|
21
|
+
onClose: () => void;
|
|
22
|
+
}
|
|
23
|
+
export declare type Selector = 'howUsePushLogin' | 'howBindClient' | 'howGetAppLoginUrl';
|
|
24
|
+
export interface SelectorOption {
|
|
25
|
+
value: Selector;
|
|
26
|
+
label: string;
|
|
27
|
+
}
|
|
28
|
+
export declare type SelectorOptions = SelectorOption[];
|
|
@@ -3,7 +3,6 @@ import { IG2Config, IG2Events, IG2FCViewProps } from '../Type';
|
|
|
3
3
|
export interface SubmitSuccessEvents extends IG2Events {
|
|
4
4
|
}
|
|
5
5
|
export interface SubmitSuccessConfig extends IG2Config {
|
|
6
|
-
IsReturn?: boolean;
|
|
7
6
|
}
|
|
8
7
|
export interface SubmitSuccessInitData {
|
|
9
8
|
title?: string;
|
|
@@ -11,6 +10,8 @@ export interface SubmitSuccessInitData {
|
|
|
11
10
|
text?: string;
|
|
12
11
|
countDesc?: string;
|
|
13
12
|
changeModule?: GuardModuleType;
|
|
13
|
+
needBack?: boolean;
|
|
14
|
+
goBack?: () => void;
|
|
14
15
|
}
|
|
15
16
|
export interface GuardNewSubmitSuccessViewProps extends IG2FCViewProps, SubmitSuccessEvents {
|
|
16
17
|
config: SubmitSuccessConfig;
|
|
@@ -1,16 +1,3 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import './styles.less';
|
|
3
|
-
/** 租户门户选择状态机返回数据类型 */
|
|
4
|
-
export interface TenantPortalSelectType {
|
|
5
|
-
title: string;
|
|
6
|
-
description: string;
|
|
7
|
-
logo: string;
|
|
8
|
-
list: {
|
|
9
|
-
tenantName: string;
|
|
10
|
-
tenantId: string;
|
|
11
|
-
tenantLogo: string;
|
|
12
|
-
host: string;
|
|
13
|
-
userName: string;
|
|
14
|
-
}[];
|
|
15
|
-
}
|
|
16
3
|
export declare const GuardTenantPortalSelectView: () => JSX.Element;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { AvatarProps } from 'antd/lib/avatar';
|
|
3
|
+
import { AuthenticationClient, IG2Events, User } from '../Type';
|
|
4
|
+
export interface TenantPortalListType {
|
|
5
|
+
tenantName: string;
|
|
6
|
+
tenantId: string;
|
|
7
|
+
tenantLogo: string;
|
|
8
|
+
host: string;
|
|
9
|
+
description: string;
|
|
10
|
+
/** 是否为用户池 */
|
|
11
|
+
isUserPool: boolean;
|
|
12
|
+
userName?: string;
|
|
13
|
+
}
|
|
14
|
+
export interface TenantPortalSelectType extends Omit<TenantPortalListType, 'userName'> {
|
|
15
|
+
}
|
|
16
|
+
/** 租户门户选择状态机返回数据类型 */
|
|
17
|
+
export interface TenantPortalDataType {
|
|
18
|
+
title: string;
|
|
19
|
+
description: string;
|
|
20
|
+
logo: string;
|
|
21
|
+
list: TenantPortalListType[];
|
|
22
|
+
}
|
|
23
|
+
export interface TenantPortalDataItem extends TenantPortalListType {
|
|
24
|
+
avatar?: AvatarProps;
|
|
25
|
+
extra?: React.ReactNode;
|
|
26
|
+
title?: string;
|
|
27
|
+
}
|
|
28
|
+
/** 租户门户相关事件 */
|
|
29
|
+
export interface TenantPortalEvents extends IG2Events {
|
|
30
|
+
onLogin?: (user: User, authClient: AuthenticationClient) => void;
|
|
31
|
+
/** 租户门户选择回调 */
|
|
32
|
+
onTenantSelect?: (data?: TenantPortalSelectType) => void;
|
|
33
|
+
}
|
|
@@ -8,7 +8,8 @@ export declare enum LoginMethods {
|
|
|
8
8
|
PhoneCode = "phone-code",
|
|
9
9
|
WxMinQr = "wechat-miniprogram-qrcode",
|
|
10
10
|
AD = "ad",
|
|
11
|
-
WechatMpQrcode = "wechatmp-qrcode"
|
|
11
|
+
WechatMpQrcode = "wechatmp-qrcode",
|
|
12
|
+
AuthingOtpPush = "authing-otp-push"
|
|
12
13
|
}
|
|
13
14
|
export declare enum OIDCConnectionMode {
|
|
14
15
|
FRONT_CHANNEL = "FRONT_CHANNEL",
|
|
@@ -177,6 +178,14 @@ export interface TabFieldsI18nItem {
|
|
|
177
178
|
[propName in Lang]?: string;
|
|
178
179
|
};
|
|
179
180
|
}
|
|
181
|
+
interface LoginTypeI18nProps {
|
|
182
|
+
tab: {
|
|
183
|
+
default: string;
|
|
184
|
+
i18n: {
|
|
185
|
+
[propName: string]: string;
|
|
186
|
+
};
|
|
187
|
+
};
|
|
188
|
+
}
|
|
180
189
|
export interface ApplicationConfig {
|
|
181
190
|
id: string;
|
|
182
191
|
allowedOrigins: string[];
|
|
@@ -194,6 +203,7 @@ export interface ApplicationConfig {
|
|
|
194
203
|
name: string;
|
|
195
204
|
logo: string;
|
|
196
205
|
description?: string;
|
|
206
|
+
deviceFuncEnabled?: boolean;
|
|
197
207
|
redirectUris: string[];
|
|
198
208
|
registerDisabled: boolean;
|
|
199
209
|
mergeAdAndAccountPasswordLogin: boolean;
|
|
@@ -262,6 +272,12 @@ export interface ApplicationConfig {
|
|
|
262
272
|
socialLoginBtns: boolean;
|
|
263
273
|
userPasswordInput: boolean;
|
|
264
274
|
wxMpScanTab: boolean;
|
|
275
|
+
loginMethodsI18nDisplaySettings: {
|
|
276
|
+
password?: LoginTypeI18nProps;
|
|
277
|
+
verifyCode?: LoginTypeI18nProps;
|
|
278
|
+
ad?: LoginTypeI18nProps;
|
|
279
|
+
ldap?: LoginTypeI18nProps;
|
|
280
|
+
};
|
|
265
281
|
};
|
|
266
282
|
protocol: Protocol;
|
|
267
283
|
oidcConfig: OidcClientMetadata;
|
|
@@ -307,4 +323,15 @@ export interface ApplicationConfig {
|
|
|
307
323
|
mfa: {
|
|
308
324
|
faceScore: number;
|
|
309
325
|
};
|
|
326
|
+
authingOtpPushTabConfig: {
|
|
327
|
+
enabledLoginMethods: Array<string> | null;
|
|
328
|
+
validLoginMethods: Array<string> | null;
|
|
329
|
+
validRegisterMethods: Array<string> | null;
|
|
330
|
+
};
|
|
331
|
+
/** 是否开启自定义安全规则 */
|
|
332
|
+
customSecurityEnabled: boolean;
|
|
333
|
+
/** 应用的人机验证策略,始终开启、不开启、设置条件触发 */
|
|
334
|
+
appRobotVerify: 'always_enable' | 'disable' | 'condition_set';
|
|
335
|
+
/** 用户池的人机验证策略,始终开启、不开启、设置条件触发 */
|
|
336
|
+
userpoolRobotVerify: 'always_enable' | 'disable' | 'condition_set';
|
|
310
337
|
}
|
package/types/Type/index.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import React from 'react';
|
|
1
2
|
import { AuthenticationClient, CommonMessage, User } from 'authing-js-sdk';
|
|
2
3
|
import { GuardModuleType } from '../Guard/module';
|
|
3
4
|
import { FacePlugin } from '../_utils/facePlugin/interface';
|
|
@@ -12,6 +13,7 @@ export declare enum GuardMode {
|
|
|
12
13
|
export interface IG2FCProps extends IG2Events {
|
|
13
14
|
appId?: string;
|
|
14
15
|
tenantId?: string;
|
|
16
|
+
deviceId?: string;
|
|
15
17
|
config?: Partial<IG2Config>;
|
|
16
18
|
visible?: boolean;
|
|
17
19
|
initData?: any;
|
|
@@ -42,6 +44,7 @@ export interface IG2Config {
|
|
|
42
44
|
userpool?: string;
|
|
43
45
|
contentCss?: string;
|
|
44
46
|
target?: HTMLElement | string;
|
|
47
|
+
style?: React.CSSProperties;
|
|
45
48
|
__internalRequest__?: boolean;
|
|
46
49
|
__singleComponent__?: boolean;
|
|
47
50
|
__unAuthFlow__?: boolean;
|
|
@@ -43,6 +43,7 @@ export declare const useFetchConsoleConfig: (forceUpdate: number, appId?: string
|
|
|
43
43
|
userpool?: string | undefined;
|
|
44
44
|
contentCss?: string | undefined;
|
|
45
45
|
target?: string | HTMLElement | undefined;
|
|
46
|
+
style?: import("react").CSSProperties | undefined;
|
|
46
47
|
__internalRequest__?: boolean | undefined;
|
|
47
48
|
__singleComponent__?: boolean | undefined;
|
|
48
49
|
__unAuthFlow__?: boolean | undefined;
|
|
@@ -100,7 +101,7 @@ export declare const useFetchConsoleConfig: (forceUpdate: number, appId?: string
|
|
|
100
101
|
withCustomData?: boolean | undefined;
|
|
101
102
|
} | undefined;
|
|
102
103
|
_closeLoopCheckQrcode?: boolean | undefined;
|
|
103
|
-
|
|
104
|
+
goBack?: (() => void) | null | undefined;
|
|
104
105
|
};
|
|
105
106
|
guardPageConfig: GuardPageConfig;
|
|
106
107
|
} | {
|
|
@@ -47,6 +47,8 @@ export interface IGuardContext {
|
|
|
47
47
|
defaultLanguageConfig: Lang;
|
|
48
48
|
/** 租户信息获取和操作处理相关 */
|
|
49
49
|
tenantInstance?: MultipleTenant;
|
|
50
|
+
/** 判断是否是国外的用户池 */
|
|
51
|
+
isForeignUserpool: boolean;
|
|
50
52
|
}
|
|
51
53
|
export declare const createGuardXContext: () => {
|
|
52
54
|
Provider: React.FC<{
|
|
@@ -83,6 +85,7 @@ export declare const useGuardEvents: () => Partial<GuardEvents>;
|
|
|
83
85
|
export declare const useGuardModule: () => {
|
|
84
86
|
changeModule: ((moduleName: GuardModuleType, initData?: any) => Promise<void>) | undefined;
|
|
85
87
|
backModule: (() => void) | undefined;
|
|
88
|
+
currentModule: ModuleState;
|
|
86
89
|
};
|
|
87
90
|
export declare const useGuardFinallyConfig: () => GuardLocalConfig;
|
|
88
91
|
export declare const useGuardContextLoaded: () => boolean;
|
|
@@ -154,3 +157,7 @@ export declare const useGuardPhoneRegex: () => RegExp | null;
|
|
|
154
157
|
export declare const useGuardDefaultLanguage: () => Lang;
|
|
155
158
|
/** 用来操作和获取租户相关的内容 */
|
|
156
159
|
export declare const useGuardTenantProvider: () => MultipleTenant | undefined;
|
|
160
|
+
/** 当前人机验证策略 */
|
|
161
|
+
export declare const useRobotVerify: () => "always_enable" | "disable" | "condition_set";
|
|
162
|
+
/** 当前用户池是否是国外用户池 */
|
|
163
|
+
export declare const useIsForeignUserpool: () => boolean;
|
|
@@ -9,6 +9,7 @@ export declare class GuardHttp {
|
|
|
9
9
|
setUserpoolId(userpoolId: string): this;
|
|
10
10
|
setAppId(appId: string): this;
|
|
11
11
|
setTenantId(tenantId: string): this;
|
|
12
|
+
setDeviceId(deviceId: string): this;
|
|
12
13
|
setBaseUrl(baseUrl: string): this;
|
|
13
14
|
getHeaders: () => Record<string, string>;
|
|
14
15
|
get: <T = any>(path: string, query?: Record<string, any>, config?: any) => Promise<AuthingGuardResponse<T>>;
|
package/types/_utils/index.d.ts
CHANGED
|
@@ -65,15 +65,16 @@ export declare enum PasswordStrength {
|
|
|
65
65
|
Low = 1,
|
|
66
66
|
Middle = 2,
|
|
67
67
|
High = 3,
|
|
68
|
-
AUTO = 4
|
|
68
|
+
AUTO = 4,
|
|
69
|
+
Custom = 5
|
|
69
70
|
}
|
|
70
71
|
export declare const PASSWORD_STRENGTH_TEXT_MAP: Record<PasswordStrength, {
|
|
71
72
|
placeholder: () => string;
|
|
72
73
|
validateMessage: () => string;
|
|
73
74
|
}>;
|
|
74
75
|
export declare const getSymbolTypeLength: (pwd: string) => number;
|
|
75
|
-
export declare const getPasswordValidate: (strength?: PasswordStrength, customPasswordStrength?: any, fieldRequiredRuleMessage?: string | undefined) => Rule[];
|
|
76
|
-
export declare const getPasswordValidateRules: (strength?: PasswordStrength, customPasswordStrength?: any, customValidateTrigger?: string | undefined, fieldRequiredRuleMessage?: string | undefined) => Rule[];
|
|
76
|
+
export declare const getPasswordValidate: (strength?: PasswordStrength, customPasswordStrength?: any, fieldRequiredRuleMessage?: string | undefined, userId?: string | undefined) => Rule[];
|
|
77
|
+
export declare const getPasswordValidateRules: (strength?: PasswordStrength, customPasswordStrength?: any, customValidateTrigger?: string | undefined, fieldRequiredRuleMessage?: string | undefined, userId?: string | undefined) => Rule[];
|
|
77
78
|
export declare const sleep: (delay: number) => Promise<unknown>;
|
|
78
79
|
export declare const shoudGoToComplete: (user: User, contextType: ComplateFiledsPlace, config: ApplicationConfig | undefined, autoRegister?: boolean | undefined) => boolean;
|
|
79
80
|
export declare const transformMethod: (method: RegisterMethods | string) => string;
|
package/types/index.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
declare const _default: "4.3.1
|
|
1
|
+
declare const _default: "4.3.23.rc-1";
|
|
2
2
|
export default _default;
|