@authing/react-ui-components 4.0.17-rc.2 → 4.1.0-hep.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@authing/react-ui-components",
3
- "version": "4.0.17-rc.2",
3
+ "version": "4.1.0-hep.0",
4
4
  "private": false,
5
5
  "main": "lib/index.min.js",
6
6
  "typings": "types/index.d.ts",
@@ -0,0 +1,5 @@
1
+ import React from 'react';
2
+ import { UserRadioItemProps, UserRadioProps } from './interface';
3
+ import './styles.less';
4
+ export declare const UserRadioItem: React.FC<UserRadioItemProps>;
5
+ export declare const UserRadio: React.FC<UserRadioProps>;
@@ -0,0 +1,3 @@
1
+ import React from 'react';
2
+ import './styles.less';
3
+ export declare const GuardAccountMergeView: React.FC;
@@ -0,0 +1,27 @@
1
+ export interface BriefUserInfo {
2
+ displayName: string;
3
+ avatar: string;
4
+ phone: string;
5
+ email: string;
6
+ username: string;
7
+ name: string;
8
+ }
9
+ export interface GuardAccountMergeInitData {
10
+ currentUserInfo: BriefUserInfo;
11
+ existingUserInfo: BriefUserInfo;
12
+ mergeToken?: string;
13
+ }
14
+ export interface UserRadioProps {
15
+ currentUserInfo: BriefUserInfo;
16
+ existingUserInfo: BriefUserInfo;
17
+ onChange?: (value: any) => void;
18
+ value?: any;
19
+ }
20
+ export interface UserRadioItemProps extends BriefUserInfo {
21
+ value: boolean;
22
+ selected: boolean;
23
+ onClick: (value: boolean) => void;
24
+ }
25
+ export declare enum AuthFlowAction {
26
+ MERGE = "confirm-account-merge"
27
+ }
@@ -0,0 +1,3 @@
1
+ import { User } from 'authing-js-sdk';
2
+ export declare const getDisplayName: (user: User) => string;
3
+ export declare const getDisplayNameByEmail: (displayName: string) => string;
@@ -0,0 +1,3 @@
1
+ /// <reference types="react" />
2
+ import './style.less';
3
+ export declare const GuardChangeAccoutTypesView: () => JSX.Element;
@@ -0,0 +1,11 @@
1
+ import React from 'react';
2
+ export declare type OptionType = {
3
+ id: string;
4
+ name: string;
5
+ children: OptionType[];
6
+ };
7
+ interface TreeSelectProps {
8
+ options: OptionType[];
9
+ }
10
+ declare const TreeSelect: React.FC<TreeSelectProps>;
11
+ export default TreeSelect;
@@ -9,3 +9,4 @@ export declare const GuardCompleteInfo: React.FC<{
9
9
  }>;
10
10
  export declare const GuardLoginCompleteInfoView: React.FC;
11
11
  export declare const GuardRegisterCompleteInfoView: React.FC;
12
+ export declare const GuardAccountMergeCompleteInfoView: React.FC;
@@ -7,19 +7,21 @@ export interface CompleteInfoEvents extends IG2Events {
7
7
  onRegisterInfoCompleted?: (user: User, udfs: {
8
8
  key: any;
9
9
  value: any;
10
- }[], authClient: AuthenticationClient) => void;
10
+ }[], authClient: AuthenticationClient, opts?: {
11
+ phone?: string;
12
+ canMergeUser?: boolean;
13
+ }) => void;
11
14
  onRegisterInfoCompletedError?: (error: CommonMessage, udfs: {
12
15
  key: any;
13
16
  value: any;
14
17
  }[], authClient: AuthenticationClient) => void;
18
+ onAccountMergeCompleteInfo?: (user: User) => void;
15
19
  }
16
20
  export interface GuardCompleteInfoProps extends IG2FCProps, CompleteInfoEvents {
17
21
  config: Partial<CompleteInfoConfig>;
18
22
  }
19
23
  export interface GuardCompleteInfoViewProps extends GuardCompleteInfoProps {
20
24
  config: CompleteInfoConfig;
21
- initData: any;
22
- onLogin?: any;
23
25
  }
24
26
  export declare type ExtendsFieldType = 'user' | 'internal';
25
27
  export interface ExtendsField {
@@ -52,6 +54,7 @@ export interface CompleteInfoMetaData {
52
54
  name: string;
53
55
  required: boolean;
54
56
  validateRules: CompleteInfoRule[];
57
+ checkUnique?: boolean;
55
58
  options?: CompleteInfoSelectOption[];
56
59
  }
57
60
  export declare enum CompleteInfoBaseControls {
@@ -70,7 +73,8 @@ export declare enum CompleteInfoExtendsControls {
70
73
  STRING = "string",
71
74
  TEXT = "text",
72
75
  GENDER = "gender",
73
- COUNTRY = "country"
76
+ COUNTRY = "country",
77
+ TREE = "tree"
74
78
  }
75
79
  export interface CompleteInfoInitData {
76
80
  skip: boolean;
@@ -14,12 +14,16 @@ export declare const enum GuardModuleType {
14
14
  LOGIN_COMPLETE_INFO = "loginCompleteInfo",
15
15
  REGISTER_PASSWORD = "registerPassword",
16
16
  REGISTER_COMPLETE_INFO = "registerCompleteInfo",
17
+ CUSTOM_COMPLETE_INFO = "customCompleteInfo",
17
18
  RECOVERY_CODE = "recoveryCode",
18
19
  SUBMIT_SUCCESS = "submitSuccess",
19
20
  IDENTITY_BINDING_ASK = "identityBindingAsk",
20
21
  IDENTITY_BINDING = "identityBinding",
22
+ ACCOUNT_MERGE = "accountMerge",
21
23
  SELF_UNLOCK = "selfUnlock",
22
- FLOW_SELECT_ACCOUNT = "flowSelectAccount"
24
+ FLOW_SELECT_ACCOUNT = "flowSelectAccount",
25
+ /** 多租户门户选择页 */
26
+ TENANT_PORTAL = "tenant-portal"
23
27
  }
24
28
  export interface GuardModuleAction {
25
29
  action: string;
@@ -0,0 +1,16 @@
1
+ import './styles.less';
2
+ import { AvatarProps } from 'antd/lib/avatar';
3
+ import { TagProps } from 'antd/lib/tag';
4
+ import React from 'react';
5
+ export interface GuardFaceProps {
6
+ /** 顶部 avatar 头像展示 */
7
+ avatar: AvatarProps | string;
8
+ /** 标题头部 */
9
+ title: React.ReactNode;
10
+ /** 标题描述 */
11
+ description?: React.ReactNode;
12
+ /** 标签功能 */
13
+ tags?: TagProps[];
14
+ }
15
+ /** 顶部通用区域封装,同时兼容样式的层叠和功能的自定义 */
16
+ export declare const GuardFace: (props: GuardFaceProps) => JSX.Element;
@@ -0,0 +1,29 @@
1
+ import './styles.less';
2
+ import { AvatarProps } from 'antd/lib/avatar';
3
+ import { ListItemProps, ListProps } from 'antd/lib/list';
4
+ import React, { CSSProperties } from 'react';
5
+ export interface GuardSelectItem {
6
+ /** avatar 头像展示 */
7
+ avatar?: AvatarProps | string;
8
+ /** 标题 */
9
+ title?: React.ReactNode;
10
+ /** 描述 */
11
+ description?: React.ReactNode;
12
+ /** 右侧操作组 */
13
+ actions?: ListItemProps['actions'];
14
+ /** 右侧额外的渲染内容 */
15
+ extra?: ListItemProps['extra'];
16
+ /** 数据项子内容,便于自定义 */
17
+ children?: React.ReactNode;
18
+ /** 其他元字段 */
19
+ [key: string]: any;
20
+ }
21
+ export interface GuardSelectProps<T = any> extends ListProps<any> {
22
+ /**数据项之间的间隙,默认`20px` */
23
+ gap?: CSSProperties['marginBottom'];
24
+ /** 数据源 */
25
+ dataSource: T[];
26
+ onSelect?: (item?: T, index?: number) => void;
27
+ }
28
+ /** 选择列表组件 兼容绝大多数选择场景 */
29
+ export declare const GuardSelect: <D extends GuardSelectItem = any>(props: GuardSelectProps<D>) => JSX.Element;
@@ -0,0 +1,2 @@
1
+ /// <reference types="react" />
2
+ export declare const LoginWithWeComQrcode: (props: any) => JSX.Element;
@@ -29,9 +29,7 @@ export interface GuardMFAInitData {
29
29
  nickme?: string;
30
30
  username?: string;
31
31
  current?: MFAType;
32
- mfaPhoneCountryCode?: string;
33
- mfaPhone?: string;
34
- mfaEmail?: string;
32
+ thirdPartyOrigin?: boolean;
35
33
  }
36
34
  export interface GuardMFAProps extends IG2FCProps, MFAEvents {
37
35
  config: Partial<MFAConfig>;
@@ -0,0 +1,16 @@
1
+ /// <reference types="react" />
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
+ export declare const GuardTenantPortalSelectView: () => JSX.Element;
@@ -253,6 +253,9 @@ export interface ApplicationConfig {
253
253
  verifyCodeLength: number;
254
254
  websocket: string;
255
255
  welcomeMessage: any;
256
+ userPortal?: {
257
+ mergeAccount?: boolean;
258
+ };
256
259
  skipComplateFileds: boolean;
257
260
  selfUnlockStrategy: 'captcha' | 'password-captcha';
258
261
  defaultLanguageConfig: Lang;
@@ -264,4 +267,10 @@ export interface ApplicationConfig {
264
267
  * 是否开启注册密码补全
265
268
  */
266
269
  enableCompletePassword: boolean;
270
+ /** 是否为租户控制台应用 */
271
+ isTenantConsole?: boolean;
272
+ /** 是否默认为租户应用面板应用 */
273
+ isTenantDefault?: boolean;
274
+ /** 租户详情 */
275
+ tenantInfo?: Record<string, any>;
267
276
  }
@@ -4,6 +4,7 @@ import { BackFillMultipleState, StoreInstance } from '../Guard/core/hooks/useMul
4
4
  import { ModuleState } from '../Guard/GuardModule/stateMachine';
5
5
  import { ApplicationConfig } from '../Type/application';
6
6
  import { GuardHttp } from './guardHttp';
7
+ import { MultipleTenant } from './tenant';
7
8
  export interface IGuardContext {
8
9
  finallyConfig: GuardLocalConfig;
9
10
  defaultMergedConfig: GuardLocalConfig;
@@ -42,6 +43,8 @@ export interface IGuardContext {
42
43
  */
43
44
  clearBackFillData?: () => void;
44
45
  };
46
+ /** 租户信息获取和操作处理相关 */
47
+ tenantInstance?: MultipleTenant;
45
48
  }
46
49
  export declare const createGuardXContext: () => {
47
50
  Provider: React.FC<{
@@ -137,3 +140,5 @@ export declare const useGuardMultipleInstance: () => {
137
140
  */
138
141
  clearBackFillData?: (() => void) | undefined;
139
142
  };
143
+ /** 用来操作和获取租户相关的内容 */
144
+ export declare const useGuardTenantProvider: () => MultipleTenant | undefined;
@@ -28,10 +28,6 @@ export declare const parsePhone: (isInternationSms: boolean, fieldValue: string,
28
28
  countryCode: string | undefined;
29
29
  phoneNumber: string;
30
30
  };
31
- export declare const enum SocialConnectionEvent {
32
- Message = "message",
33
- Auth = "auth"
34
- }
35
31
  /**
36
32
  *
37
33
  * @param config
@@ -15,8 +15,10 @@ export declare const enum ApiCode {
15
15
  FLOW_END = 1600,
16
16
  FIRST_LOGIN_PASSWORD = 1639,
17
17
  FORCED_PASSWORD_RESET = 2058,
18
+ ACCOUNT_MERGE = 10000,
18
19
  UNSAFE_PASSWORD_TIP = 2061,
19
20
  UNSAFE_PASSWORD_RESET = 2071,
20
- FLOW_SELECT_ACCOUNT = 2921
21
+ FLOW_SELECT_ACCOUNT = 2921,
22
+ TENANT_PORTAL = 1644
21
23
  }
22
24
  export declare const ChangeModuleApiCodeMapping: Record<string, GuardModuleType>;
@@ -0,0 +1,19 @@
1
+ import { ApplicationConfig } from '../Type';
2
+ /** **当前租户应用** 下的租户信息获取和操作处理,将租户相关的处理收拢 */
3
+ export declare class MultipleTenant {
4
+ private $config;
5
+ private $tenantId;
6
+ constructor(tenantId: string, config: ApplicationConfig);
7
+ /** 获取租户ID */
8
+ getCurrentTenantId: () => string | null;
9
+ /** 获取租户详情 */
10
+ getCurrentTenantInfo: () => Record<string, any> | undefined;
11
+ /**是否为【租户控制台】 */
12
+ isTenantConsole: () => boolean | undefined;
13
+ /** 是否为租户【单点登录】 */
14
+ isTenantSSO: () => boolean | "" | null;
15
+ /** 是否为租户【单点登录面板】 */
16
+ isTenantSSOLaunchPad: () => boolean | "" | null;
17
+ }
18
+ /** 初始化多租户实例 */
19
+ export declare const useMultipleTenant: (tenantId: string, publicConfig: ApplicationConfig) => MultipleTenant | undefined;
@@ -1,2 +1,2 @@
1
- declare const _default: "4.0.17-rc.2";
1
+ declare const _default: "4.1.0-hep.0";
2
2
  export default _default;