@authing/react-ui-components 4.3.3-rc.0 → 4.3.4-alpha.0
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/package.json +1 -1
- package/types/AppOtpVerify/DownloadVerifier.d.ts +2 -0
- package/types/AppOtpVerify/LoginApp.d.ts +2 -0
- package/types/AppOtpVerify/ScanQrcode.d.ts +2 -0
- package/types/AppOtpVerify/Steps.d.ts +11 -0
- package/types/AppOtpVerify/index.d.ts +3 -0
- package/types/ForgetPassword/core/resetPassword.d.ts +2 -2
- package/types/ForgetPassword/interface.d.ts +0 -1
- package/types/Guard/config.d.ts +1 -2
- package/types/Guard/core/hooks/useAgreements.d.ts +15 -0
- package/types/Guard/core/hooks/useGuardView.d.ts +7 -0
- package/types/Guard/core/hooks/useMultipleAccounts.d.ts +3 -3
- package/types/Guard/event.d.ts +12 -3
- package/types/Guard/module.d.ts +1 -0
- package/types/LazyloadImage/index.d.ts +12 -0
- package/types/Login/core/withAuthingOtpPush/BeforeLogin.d.ts +17 -0
- package/types/Login/core/withAuthingOtpPush/PendingLogin.d.ts +7 -0
- package/types/Login/core/withAuthingOtpPush/index.d.ts +3 -0
- package/types/Login/core/withAuthingOtpPush/types.d.ts +18 -0
- package/types/Login/hooks/useLoginMultiple.d.ts +1 -1
- package/types/Login/hooks/useOtpPushLogin.d.ts +10 -0
- package/types/Login/multipleAccounts/panel.d.ts +1 -0
- package/types/NewSubmitSuccess/interface.d.ts +0 -2
- package/types/TenantPortalSelect/index.d.ts +13 -0
- package/types/Type/application.d.ts +7 -7
- package/types/_utils/config/index.d.ts +0 -1
- package/types/_utils/context.d.ts +2 -3
- package/types/index.d.ts +1 -0
- package/types/version/version.d.ts +1 -1
- package/types/TenantPortalSelect/interface.d.ts +0 -33
package/package.json
CHANGED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
import './steps.styles.less';
|
|
3
|
+
interface StepsProps {
|
|
4
|
+
current: number;
|
|
5
|
+
items: StepItem[];
|
|
6
|
+
}
|
|
7
|
+
interface StepItem {
|
|
8
|
+
title: ReactNode;
|
|
9
|
+
}
|
|
10
|
+
export declare function Steps(props: StepsProps): JSX.Element;
|
|
11
|
+
export {};
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
|
|
1
|
+
/// <reference types="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;
|
|
8
9
|
setControlShow: any;
|
|
9
10
|
setPolicyStrength: any;
|
|
10
11
|
setCustomPasswordStrength: any;
|
|
11
12
|
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,7 +9,6 @@ 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);
|
|
13
12
|
}
|
|
14
13
|
export interface ForgetPasswordProps extends IG2FCProps, ForgetPasswordEvents {
|
|
15
14
|
config: Partial<IG2Config>;
|
package/types/Guard/config.d.ts
CHANGED
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import { ReactNode } from 'react';
|
|
2
2
|
import { GuardModuleType } from '.';
|
|
3
|
-
import { ForgetPasswordConfig } from '../ForgetPassword/interface';
|
|
4
3
|
import { LoginConfig } from '../Login/interface';
|
|
5
4
|
import { RegisterConfig } from '../Register/interface';
|
|
6
|
-
export interface GuardLocalConfig extends RegisterConfig, LoginConfig
|
|
5
|
+
export interface GuardLocalConfig extends RegisterConfig, LoginConfig {
|
|
7
6
|
isSSO?: boolean;
|
|
8
7
|
defaultScenes?: GuardModuleType;
|
|
9
8
|
defaultInitData?: any;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { Agreement } from '../../../Type';
|
|
3
|
+
interface Options {
|
|
4
|
+
agreements: Agreement[];
|
|
5
|
+
checkedAgreements: (string | number)[];
|
|
6
|
+
checkAllAgreements: () => void;
|
|
7
|
+
unCheckAllAgreements: () => void;
|
|
8
|
+
}
|
|
9
|
+
export declare function useAgreements(options: Options): {
|
|
10
|
+
agreements: Agreement[];
|
|
11
|
+
checkedAgreements: import("react").ReactText[];
|
|
12
|
+
checkAllAgreements: () => void;
|
|
13
|
+
unCheckAllAgreements: () => void;
|
|
14
|
+
};
|
|
15
|
+
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
|
* 携带的回填数据信息
|
|
@@ -249,7 +249,7 @@ declare class MultipleAccount {
|
|
|
249
249
|
setUserInfo: (user: Pick<User & {
|
|
250
250
|
id: string;
|
|
251
251
|
loginAccount?: string | undefined;
|
|
252
|
-
}, "email" | "username" | "phone" | "photo" | "id" | "name" | "nickname" | "
|
|
252
|
+
}, "email" | "username" | "phone" | "photo" | "id" | "name" | "nickname" | "qrCodeId" | "areaCode" | "_updateTime" | "loginAccount">) => void;
|
|
253
253
|
setLoginWayByHttpData: (account: string, data: {
|
|
254
254
|
username?: string | undefined;
|
|
255
255
|
phone?: string | undefined;
|
|
@@ -292,7 +292,7 @@ declare const useMultipleAccounts: ({ appId, finallyConfig, }: {
|
|
|
292
292
|
setUserInfo: (user: Pick<User & {
|
|
293
293
|
id: string;
|
|
294
294
|
loginAccount?: string | undefined;
|
|
295
|
-
}, "email" | "username" | "phone" | "photo" | "id" | "name" | "nickname" | "
|
|
295
|
+
}, "email" | "username" | "phone" | "photo" | "id" | "name" | "nickname" | "qrCodeId" | "areaCode" | "_updateTime" | "loginAccount">) => void;
|
|
296
296
|
setLoginWayByHttpData: (account: string, data: {
|
|
297
297
|
username?: string | undefined;
|
|
298
298
|
phone?: string | undefined;
|
package/types/Guard/event.d.ts
CHANGED
|
@@ -5,9 +5,15 @@ 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
|
-
|
|
9
|
-
|
|
8
|
+
interface OnAfterChangeModuleOptions {
|
|
9
|
+
currentView: string;
|
|
10
|
+
currentModule: GuardModuleType;
|
|
11
|
+
currentTab?: string;
|
|
12
|
+
data?: any;
|
|
13
|
+
}
|
|
14
|
+
export interface GuardEvents extends LoginEvents, RegisterEvents, CompleteInfoEvents, ForgetPasswordEvents, IdentityBindingEvents, IdentityBindingAskEvents {
|
|
10
15
|
onBeforeChangeModule?: (key: GuardModuleType, initData?: any) => boolean | Promise<boolean>;
|
|
16
|
+
onAfterChangeModule?: (options: OnAfterChangeModuleOptions) => void;
|
|
11
17
|
}
|
|
12
18
|
export declare const guardEventsFilter: (props: any, multipleInstance?: {
|
|
13
19
|
initStore: (appId: string, options: {
|
|
@@ -21,7 +27,7 @@ export declare const guardEventsFilter: (props: any, multipleInstance?: {
|
|
|
21
27
|
setUserInfo: (user: Pick<import("./core/hooks/useMultipleAccounts").User & {
|
|
22
28
|
id: string;
|
|
23
29
|
loginAccount?: string | undefined;
|
|
24
|
-
}, "email" | "username" | "phone" | "photo" | "id" | "name" | "nickname" | "
|
|
30
|
+
}, "email" | "username" | "phone" | "photo" | "id" | "name" | "nickname" | "qrCodeId" | "areaCode" | "_updateTime" | "loginAccount">) => void;
|
|
25
31
|
setLoginWayByHttpData: (account: string, data: {
|
|
26
32
|
username?: string | undefined;
|
|
27
33
|
phone?: string | undefined;
|
|
@@ -66,6 +72,7 @@ export declare const GuardEventsCamelToKebabMapping: {
|
|
|
66
72
|
readonly onRegisterInfoCompletedError: "register-info-completed-error";
|
|
67
73
|
readonly onLangChange: "lang-change";
|
|
68
74
|
readonly onBeforeChangeModule: "before-change-module";
|
|
75
|
+
readonly onAfterChangeModule: "after-change-module";
|
|
69
76
|
};
|
|
70
77
|
export interface GuardEventsKebabToCamelType {
|
|
71
78
|
load: GuardEvents['onLoad'];
|
|
@@ -89,4 +96,6 @@ export interface GuardEventsKebabToCamelType {
|
|
|
89
96
|
'register-info-completed-error': GuardEvents['onRegisterInfoCompletedError'];
|
|
90
97
|
'lang-change': GuardEvents['onLangChange'];
|
|
91
98
|
'before-change-module': GuardEvents['onBeforeChangeModule'];
|
|
99
|
+
'after-change-module': GuardEvents['onAfterChangeModule'];
|
|
92
100
|
}
|
|
101
|
+
export {};
|
package/types/Guard/module.d.ts
CHANGED
|
@@ -21,6 +21,7 @@ export declare enum GuardModuleType {
|
|
|
21
21
|
IDENTITY_BINDING_NO_ASK = "identityBindingNoAsk",
|
|
22
22
|
SELF_UNLOCK = "selfUnlock",
|
|
23
23
|
FLOW_SELECT_ACCOUNT = "flowSelectAccount",
|
|
24
|
+
APP_OTP_VERIFY = "appOtpVerify",
|
|
24
25
|
/** 多租户门户选择页 */
|
|
25
26
|
TENANT_PORTAL = "tenant-portal",
|
|
26
27
|
New_SUBMIT_SUCCESS = "newSubmitSuccess",
|
|
@@ -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,18 @@
|
|
|
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
|
+
}
|
|
@@ -35,7 +35,7 @@ declare function useLoginMultiple(setLoginWay: React.Dispatch<any>): {
|
|
|
35
35
|
setUserInfo: (user: Pick<import("../../Guard/core/hooks/useMultipleAccounts").User & {
|
|
36
36
|
id: string;
|
|
37
37
|
loginAccount?: string | undefined;
|
|
38
|
-
}, "email" | "username" | "phone" | "photo" | "id" | "name" | "nickname" | "
|
|
38
|
+
}, "email" | "username" | "phone" | "photo" | "id" | "name" | "nickname" | "qrCodeId" | "areaCode" | "_updateTime" | "loginAccount">) => void;
|
|
39
39
|
setLoginWayByHttpData: (account: string, data: {
|
|
40
40
|
username?: string | undefined;
|
|
41
41
|
phone?: string | undefined;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
export declare function useOtpPushLoginWay(setLoginWay: React.Dispatch<any>): void;
|
|
3
|
+
export declare function useOtpPushLoginCache(): {
|
|
4
|
+
getCachedOtpLoginAccount: typeof getCachedOtpLoginAccount;
|
|
5
|
+
cacheOtpLoginAccount: typeof cacheOtpLoginAccount;
|
|
6
|
+
clearOtpLoginAccountCache: typeof clearOtpLoginAccountCache;
|
|
7
|
+
};
|
|
8
|
+
export declare function cacheOtpLoginAccount(account: string): void;
|
|
9
|
+
export declare function getCachedOtpLoginAccount(): string;
|
|
10
|
+
export declare function clearOtpLoginAccountCache(): void;
|
|
@@ -10,8 +10,6 @@ export interface SubmitSuccessInitData {
|
|
|
10
10
|
text?: string;
|
|
11
11
|
countDesc?: string;
|
|
12
12
|
changeModule?: GuardModuleType;
|
|
13
|
-
needBack?: boolean;
|
|
14
|
-
goBack?: () => void;
|
|
15
13
|
}
|
|
16
14
|
export interface GuardNewSubmitSuccessViewProps extends IG2FCViewProps, SubmitSuccessEvents {
|
|
17
15
|
config: SubmitSuccessConfig;
|
|
@@ -1,3 +1,16 @@
|
|
|
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
|
+
}
|
|
3
16
|
export declare const GuardTenantPortalSelectView: () => JSX.Element;
|
|
@@ -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",
|
|
@@ -307,10 +308,9 @@ export interface ApplicationConfig {
|
|
|
307
308
|
mfa: {
|
|
308
309
|
faceScore: number;
|
|
309
310
|
};
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
userpoolRobotVerify: 'always_enable' | 'disable' | 'condition_set';
|
|
311
|
+
authingOtpPushTabConfig: {
|
|
312
|
+
enabledLoginMethods: Array<string> | null;
|
|
313
|
+
validLoginMethods: Array<string> | null;
|
|
314
|
+
validRegisterMethods: Array<string> | null;
|
|
315
|
+
};
|
|
316
316
|
}
|
|
@@ -100,7 +100,6 @@ export declare const useFetchConsoleConfig: (forceUpdate: number, appId?: string
|
|
|
100
100
|
withCustomData?: boolean | undefined;
|
|
101
101
|
} | undefined;
|
|
102
102
|
_closeLoopCheckQrcode?: boolean | undefined;
|
|
103
|
-
goBack?: (() => void) | null | undefined;
|
|
104
103
|
};
|
|
105
104
|
guardPageConfig: GuardPageConfig;
|
|
106
105
|
} | {
|
|
@@ -83,6 +83,7 @@ export declare const useGuardEvents: () => Partial<GuardEvents>;
|
|
|
83
83
|
export declare const useGuardModule: () => {
|
|
84
84
|
changeModule: ((moduleName: GuardModuleType, initData?: any) => Promise<void>) | undefined;
|
|
85
85
|
backModule: (() => void) | undefined;
|
|
86
|
+
currentModule: ModuleState;
|
|
86
87
|
};
|
|
87
88
|
export declare const useGuardFinallyConfig: () => GuardLocalConfig;
|
|
88
89
|
export declare const useGuardContextLoaded: () => boolean;
|
|
@@ -116,7 +117,7 @@ export declare const useGuardMultipleInstance: () => {
|
|
|
116
117
|
setUserInfo: (user: Pick<import("../Guard/core/hooks/useMultipleAccounts").User & {
|
|
117
118
|
id: string;
|
|
118
119
|
loginAccount?: string | undefined;
|
|
119
|
-
}, "email" | "username" | "phone" | "photo" | "id" | "name" | "nickname" | "
|
|
120
|
+
}, "email" | "username" | "phone" | "photo" | "id" | "name" | "nickname" | "qrCodeId" | "areaCode" | "_updateTime" | "loginAccount">) => void;
|
|
120
121
|
setLoginWayByHttpData: (account: string, data: {
|
|
121
122
|
username?: string | undefined;
|
|
122
123
|
phone?: string | undefined;
|
|
@@ -154,5 +155,3 @@ export declare const useGuardPhoneRegex: () => RegExp | null;
|
|
|
154
155
|
export declare const useGuardDefaultLanguage: () => Lang;
|
|
155
156
|
/** 用来操作和获取租户相关的内容 */
|
|
156
157
|
export declare const useGuardTenantProvider: () => MultipleTenant | undefined;
|
|
157
|
-
/** 当前人机验证策略 */
|
|
158
|
-
export declare const useRobotVerify: () => "always_enable" | "disable" | "condition_set";
|
package/types/index.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
declare const _default: "4.3.3-
|
|
1
|
+
declare const _default: "4.3.3-alpha.0";
|
|
2
2
|
export default _default;
|
|
@@ -1,33 +0,0 @@
|
|
|
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
|
-
}
|