@authing/react18-ui-components 4.2.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@authing/react18-ui-components",
3
- "version": "4.2.0",
3
+ "version": "4.3.4-alpha.0",
4
4
  "private": false,
5
5
  "main": "lib/index.min.js",
6
6
  "typings": "types/index.d.ts",
@@ -1,14 +1,15 @@
1
+ import React from 'react';
1
2
  export declare enum InputMethodMap {
2
3
  email = "email-code",
3
4
  phone = "phone-code"
4
5
  }
5
6
  interface ResetPasswordProps {
6
7
  publicConfig: any;
7
- setPhoneOrEmail: any;
8
8
  setControlShow: any;
9
9
  setPolicyStrength: any;
10
10
  setCustomPasswordStrength: any;
11
11
  setPhoneOrEmailText: any;
12
+ setResetToken: React.Dispatch<React.SetStateAction<string>>;
12
13
  }
13
14
  export declare const ResetPassword: (props: ResetPasswordProps) => JSX.Element;
14
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>;
@@ -1,8 +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
- export interface GuardLocalConfig extends RegisterConfig, LoginConfig {
6
+ export interface GuardLocalConfig extends RegisterConfig, LoginConfig, ForgetPasswordConfig {
6
7
  isSSO?: boolean;
7
8
  defaultScenes?: GuardModuleType;
8
9
  defaultInitData?: any;
@@ -5,8 +5,9 @@ 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
+ import { TenantPortalEvents } from '../TenantPortalSelect/interface';
8
9
  import { StoreInstance } from './core/hooks/useMultipleAccounts';
9
- export interface GuardEvents extends LoginEvents, RegisterEvents, CompleteInfoEvents, ForgetPasswordEvents, IdentityBindingEvents, IdentityBindingAskEvents {
10
+ export interface GuardEvents extends LoginEvents, RegisterEvents, CompleteInfoEvents, ForgetPasswordEvents, IdentityBindingEvents, IdentityBindingAskEvents, TenantPortalEvents {
10
11
  onBeforeChangeModule?: (key: GuardModuleType, initData?: any) => boolean | Promise<boolean>;
11
12
  }
12
13
  export declare const guardEventsFilter: (props: any, multipleInstance?: StoreInstance, openEventsMapping?: boolean) => GuardEvents;
@@ -18,11 +18,13 @@ export declare enum GuardModuleType {
18
18
  SUBMIT_SUCCESS = "submitSuccess",
19
19
  IDENTITY_BINDING_ASK = "identityBindingAsk",
20
20
  IDENTITY_BINDING = "identityBinding",
21
+ IDENTITY_BINDING_NO_ASK = "identityBindingNoAsk",
21
22
  SELF_UNLOCK = "selfUnlock",
22
23
  FLOW_SELECT_ACCOUNT = "flowSelectAccount",
23
24
  /** 多租户门户选择页 */
24
25
  TENANT_PORTAL = "tenant-portal",
25
- New_SUBMIT_SUCCESS = "newSubmitSuccess"
26
+ New_SUBMIT_SUCCESS = "newSubmitSuccess",
27
+ RESET_ACCOUNT_NAME = "resetAccountName"
26
28
  }
27
29
  export interface GuardModuleAction {
28
30
  action: string;
@@ -1,3 +1,5 @@
1
1
  import React from 'react';
2
2
  import './styles.less';
3
- export declare const GuardIdentityBindingView: React.FC;
3
+ export declare const GuardIdentityBindingView: React.FC<{
4
+ skipAsk?: boolean;
5
+ }>;
@@ -21,12 +21,15 @@ export declare enum IdentityBindingAction {
21
21
  CreateUser = "create-federation-account",
22
22
  BindByPassword = "bind-identity-by-password",
23
23
  BindByPhoneCode = "bind-identity-by-phone-code",
24
- BindByEmailCode = "bind-identity-by-email-code"
24
+ BindByEmailCode = "bind-identity-by-email-code",
25
+ RegisterByPassword = "register-bind-by-password",
26
+ RegisterByPhoneCode = "register-bind-by-phone-code",
27
+ RegisterByEmailCode = "register-bind-by-email-code"
25
28
  }
26
29
  export declare const PhoneCode: (params: PhoneCodeParams) => Promise<import("../_utils/http").AuthingGuardResponse<any>>;
27
30
  export declare const EmailCode: (params: EmailCodeParams) => Promise<import("../_utils/http").AuthingGuardResponse<any>>;
28
31
  export declare const Password: (params: PasswordParams) => Promise<import("../_utils/http").AuthingGuardResponse<any>>;
29
- export declare const useIdentityBindingBusinessRequest: () => {
32
+ export declare const useIdentityBindingBusinessRequest: (type?: 'register' | 'bind') => {
30
33
  "phone-code": (params: PhoneCodeParams) => Promise<import("../_utils/http").AuthingGuardResponse<any>>;
31
34
  "emial-code": (params: EmailCodeParams) => Promise<import("../_utils/http").AuthingGuardResponse<any>>;
32
35
  password: (params: PasswordParams) => Promise<import("../_utils/http").AuthingGuardResponse<any>>;
@@ -1,2 +1,5 @@
1
+ import { FC } from 'react';
1
2
  import './styles.less';
2
- export declare const GuardLoginView: () => JSX.Element;
3
+ export declare const GuardLoginView: FC<{
4
+ isResetPage?: boolean;
5
+ }>;
@@ -0,0 +1,6 @@
1
+ export declare const enum ResetAccountBusinessAction {
2
+ ResetName = "reset-username-before-auth"
3
+ }
4
+ export declare const authFlow: (action: ResetAccountBusinessAction, content: {
5
+ username: string;
6
+ }) => Promise<import("../../_utils/http").AuthingGuardResponse<any>>;
@@ -0,0 +1,3 @@
1
+ import { FC } from 'react';
2
+ import './style.less';
3
+ export declare const ResetAccountName: FC;
@@ -10,6 +10,8 @@ export interface SubmitSuccessInitData {
10
10
  text?: string;
11
11
  countDesc?: string;
12
12
  changeModule?: GuardModuleType;
13
+ needBack?: boolean;
14
+ goBack?: () => void;
13
15
  }
14
16
  export interface GuardNewSubmitSuccessViewProps extends IG2FCViewProps, SubmitSuccessEvents {
15
17
  config: SubmitSuccessConfig;
@@ -1,15 +1,2 @@
1
1
  import './styles.less';
2
- /** 租户门户选择状态机返回数据类型 */
3
- export interface TenantPortalSelectType {
4
- title: string;
5
- description: string;
6
- logo: string;
7
- list: {
8
- tenantName: string;
9
- tenantId: string;
10
- tenantLogo: string;
11
- host: string;
12
- userName: string;
13
- }[];
14
- }
15
2
  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
+ }
@@ -177,6 +177,14 @@ export interface TabFieldsI18nItem {
177
177
  [propName in Lang]?: string;
178
178
  };
179
179
  }
180
+ interface LoginTypeI18nProps {
181
+ tab: {
182
+ default: string;
183
+ i18n: {
184
+ [propName: string]: string;
185
+ };
186
+ };
187
+ }
180
188
  export interface ApplicationConfig {
181
189
  id: string;
182
190
  allowedOrigins: string[];
@@ -262,6 +270,12 @@ export interface ApplicationConfig {
262
270
  socialLoginBtns: boolean;
263
271
  userPasswordInput: boolean;
264
272
  wxMpScanTab: boolean;
273
+ loginMethodsI18nDisplaySettings: {
274
+ password?: LoginTypeI18nProps;
275
+ verifyCode?: LoginTypeI18nProps;
276
+ ad?: LoginTypeI18nProps;
277
+ ldap?: LoginTypeI18nProps;
278
+ };
265
279
  };
266
280
  protocol: Protocol;
267
281
  oidcConfig: OidcClientMetadata;
@@ -292,6 +306,11 @@ export interface ApplicationConfig {
292
306
  loginMethodsSort: string[];
293
307
  };
294
308
  tabMethodsFields: TabFieldsI18nItem[];
309
+ regexRules?: {
310
+ key: string;
311
+ appLevel: string;
312
+ userpoolLevel: string;
313
+ }[];
295
314
  /** 是否为租户控制台应用 */
296
315
  isTenantConsole?: boolean;
297
316
  /** 是否默认为租户应用面板应用 */
@@ -302,4 +321,10 @@ export interface ApplicationConfig {
302
321
  mfa: {
303
322
  faceScore: number;
304
323
  };
324
+ /** 是否开启自定义安全规则 */
325
+ customSecurityEnabled: boolean;
326
+ /** 应用的人机验证策略,始终开启、不开启、设置条件触发 */
327
+ appRobotVerify: 'always_enable' | 'disable' | 'condition_set';
328
+ /** 用户池的人机验证策略,始终开启、不开启、设置条件触发 */
329
+ userpoolRobotVerify: 'always_enable' | 'disable' | 'condition_set';
305
330
  }
@@ -100,6 +100,7 @@ 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;
103
104
  };
104
105
  guardPageConfig: GuardPageConfig;
105
106
  } | {
@@ -43,6 +43,7 @@ export interface IGuardContext {
43
43
  */
44
44
  clearBackFillData?: () => void;
45
45
  };
46
+ phoneRegex: RegExp | null;
46
47
  defaultLanguageConfig: Lang;
47
48
  /** 租户信息获取和操作处理相关 */
48
49
  tenantInstance?: MultipleTenant;
@@ -146,9 +147,12 @@ export declare const useGuardMultipleInstance: () => {
146
147
  */
147
148
  clearBackFillData?: (() => void) | undefined;
148
149
  };
150
+ export declare const useGuardPhoneRegex: () => RegExp | null;
149
151
  /**
150
152
  * 默认语言
151
153
  */
152
154
  export declare const useGuardDefaultLanguage: () => Lang;
153
155
  /** 用来操作和获取租户相关的内容 */
154
156
  export declare const useGuardTenantProvider: () => MultipleTenant | undefined;
157
+ /** 当前人机验证策略 */
158
+ export declare const useRobotVerify: () => "always_enable" | "disable" | "condition_set";
@@ -0,0 +1 @@
1
+ export declare const getCaptchaUrl: (host: string) => string;
@@ -92,6 +92,7 @@ export declare const getLoginTypePipe: (publicConfig: ApplicationConfig, registe
92
92
  } | undefined;
93
93
  export declare const getPasswordIdentify: (identity: string) => string;
94
94
  export declare const getCurrentLng: () => Lang;
95
+ export declare const regexFromString: (string: string) => RegExp | null;
95
96
  export declare const getI18nLabel: (method: string | RegisterSortMethods, i18nFields: Map<string, TabFieldsI18nItem>, defaultLanguageConfig: Lang) => string;
96
97
  export declare const getSortLabels: (methods: string[], i18nConfig: Map<string, TabFieldsI18nItem>, defaultLanguageConfig: Lang) => string;
97
98
  export declare const getSortTabs: (tabs: string[], tab?: string) => string[];
@@ -7,6 +7,7 @@ export declare enum CodeAction {
7
7
  export declare enum ApiCode {
8
8
  IDENTITY_BINDING_ASK = 1641,
9
9
  IDENTITY_BINDING = 1640,
10
+ IDENTITY_BINDING_NO_ASK = 1666,
10
11
  APP_MFA = 1636,
11
12
  MFA = 1635,
12
13
  ABORT_FLOW = 1699,
@@ -18,6 +19,7 @@ export declare enum ApiCode {
18
19
  UNSAFE_PASSWORD_TIP = 2061,
19
20
  UNSAFE_PASSWORD_RESET = 2071,
20
21
  FLOW_SELECT_ACCOUNT = 2921,
21
- TENANT_PORTAL = 1644
22
+ TENANT_PORTAL = 1644,
23
+ RESET_ACCOUNT_NAME = 1108
22
24
  }
23
25
  export declare const ChangeModuleApiCodeMapping: Record<string, GuardModuleType>;
@@ -1,2 +1,2 @@
1
- declare const _default: "4.2.0";
1
+ declare const _default: "4.3.4-alpha.0";
2
2
  export default _default;