@authing/guard-shim-react18 4.5.51-eak.14 → 4.5.51-eak.17

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.
@@ -3,6 +3,7 @@ export declare const GuardChangePassword: React.FC<{
3
3
  title: string;
4
4
  explain: string;
5
5
  children: ReactNode;
6
+ logo?: string;
6
7
  }>;
7
8
  export declare const GuardFirstLoginPasswordResetView: React.FC;
8
9
  export declare const GuardPasswordNotSafeResetView: React.FC;
@@ -13,5 +13,6 @@ export interface GuardLocalConfig extends RegisterConfig, LoginConfig, ForgetPas
13
13
  * @description 是否调用 eventsMapping 中的事件
14
14
  */
15
15
  openEventsMapping?: boolean;
16
+ autoFocus?: boolean;
16
17
  }
17
18
  export declare const getDefaultGuardLocalConfig: () => GuardLocalConfig;
@@ -8,6 +8,7 @@
8
8
  * 再次打开页面时,初始化时先根据 FE 自定义的 LoginWay 跳转到不同的 tab 下(way)下使用 account 进行回填。TODO: 这里也可优化,应该在登录成功时候就进行 LoginWay 的格式化,而非转来转去。(但是这样无法直观的体现是哪种方式进行登录)
9
9
  */
10
10
  import { SelectOptions } from '../../../Login/multipleAccounts/panel';
11
+ export declare const LAST_USED_IDP = "__authing_last_used_idp__";
11
12
  export declare const QR_CODE_WAY: LoginWay[];
12
13
  /**
13
14
  * 登录时所有支持的登录列表(前端定义列表)
@@ -117,6 +118,7 @@ declare class MultipleAccount {
117
118
  private memberState;
118
119
  /**
119
120
  * 二维码登录时的ID
121
+ *「loginWay = "social"」社会化身份源登录时 其 id 表示为「唯一标识」
120
122
  */
121
123
  private qrCodeId?;
122
124
  /**
@@ -137,6 +139,10 @@ declare class MultipleAccount {
137
139
  * 是否开启国际化短信
138
140
  */
139
141
  private isInternationSms?;
142
+ /**
143
+ * 社会化登录列表 主要是为了做「置顶上次登录」
144
+ */
145
+ private socialLoginWays?;
140
146
  constructor();
141
147
  /**
142
148
  * 页面首次加载时初始化 Store
@@ -238,6 +244,7 @@ declare class MultipleAccount {
238
244
  * 外部暴露方法
239
245
  */
240
246
  getStore: () => {
247
+ getSocialLoginWays: () => User[] | undefined;
241
248
  initStore: (appId: string, options: {
242
249
  serverSideLoginMethods: LoginWay[];
243
250
  isInternationSms: boolean;
@@ -282,6 +289,7 @@ declare const useSelectAccounts: ({ appId, finallyConfig }: {
282
289
  finallyConfig?: any;
283
290
  }) => {
284
291
  instance: {
292
+ getSocialLoginWays: () => User[] | undefined;
285
293
  initStore: (appId: string, options: {
286
294
  serverSideLoginMethods: LoginWay[];
287
295
  isInternationSms: boolean;
@@ -1,7 +1,6 @@
1
1
  import { React } from 'shim-react';
2
2
  import { GuardProps } from '../Guard';
3
3
  import '../styles.less';
4
- import '../genauth.less';
5
4
  export declare enum LangMAP {
6
5
  zhCn = "zh-CN",
7
6
  enUs = "en-US",
@@ -33,7 +33,8 @@ export declare enum GuardModuleType {
33
33
  INVITE_EXPIRE = "inviteExpire",// 邀请链接过期
34
34
  INVITE_PAGE_EXPIRE = "invitePageExpire",// 页面过期
35
35
  INVITE_SUCCESS = "inviteSuccess",// 邀请成功
36
- RESET_PASSWORD = "resetPassword"
36
+ RESET_PASSWORD = "resetPassword",
37
+ REGISTER_ACCOUNT_TYPE_SELECT = "accountTypeSelect"
37
38
  }
38
39
  export interface GuardModuleAction {
39
40
  action: string;
@@ -27,6 +27,7 @@ declare function useLoginAccountBackFill(options: {
27
27
  declare function useLoginSelectAccount(setLoginWay: React.Dispatch<any>): {
28
28
  isMultipleAccount: boolean;
29
29
  multipleInstance: {
30
+ getSocialLoginWays: () => import("../../Guard/core/hooks/useMultipleAccounts").User[] | undefined;
30
31
  initStore: (appId: string, options: {
31
32
  serverSideLoginMethods: LoginWay[];
32
33
  isInternationSms: boolean;
@@ -39,7 +40,7 @@ declare function useLoginSelectAccount(setLoginWay: React.Dispatch<any>): {
39
40
  id: string;
40
41
  loginAccount?: string | undefined;
41
42
  usertype?: string | undefined;
42
- }, "way" | "tab" | "phoneCountryCode">) => void;
43
+ }, "tab" | "way" | "phoneCountryCode">) => void;
43
44
  setLoginWayByHttpData: (account: string, data: {
44
45
  username?: string | undefined;
45
46
  phone?: string | undefined;
@@ -42,3 +42,4 @@ export interface GuardLoginInitData {
42
42
  export declare const getDefaultLoginConfig: () => LoginConfig;
43
43
  export declare const baseLoginPathMapping: Partial<Record<Protocol, string | null>>;
44
44
  export declare const loginUrlFieldMapping: Partial<Record<Protocol, string>>;
45
+ export type ValidateStatus = undefined | 'validating';
@@ -1 +1,5 @@
1
+ import { ApplicationConfig } from '../../../Type/application';
1
2
  export declare const IdpButton: (props: any) => JSX.Element | null;
3
+ export declare const MoreIdpButton: (props: {
4
+ idps: ApplicationConfig['identityProviders'];
5
+ }) => JSX.Element;
@@ -8,6 +8,7 @@ interface BindPasskeyProps {
8
8
  interface VerifyPasskeyProps {
9
9
  mfaToken: string;
10
10
  mfaLogin: (code: any, data: any, message?: string) => void;
11
+ mfaConfigsMap: Map<MFAType, boolean>;
11
12
  }
12
13
  export type MFAPasskeyProps = BindPasskeyProps & VerifyPasskeyProps & {
13
14
  passkeyEnabled: boolean;
@@ -0,0 +1,3 @@
1
+ import { React } from 'shim-react';
2
+ import './style.less';
3
+ export declare const GuardRegisterAccountTypeView: React.FC;
@@ -8,4 +8,7 @@ export interface RegisterWithEmailCodeProps {
8
8
  publicConfig?: ApplicationConfig;
9
9
  registeContext?: any;
10
10
  }
11
+ /**
12
+ * @deprecated 废弃 🚒
13
+ */
11
14
  export declare const RegisterWithEmailCode: React.FC<RegisterWithEmailCodeProps>;
@@ -7,4 +7,7 @@ export interface RegisterWithPhoneProps {
7
7
  publicConfig?: ApplicationConfig;
8
8
  registeContext?: any;
9
9
  }
10
+ /**
11
+ * @deprecated 废弃 🚒
12
+ */
10
13
  export declare const RegisterWithPhone: React.FC<RegisterWithPhoneProps>;
@@ -9,5 +9,8 @@ export interface SendCodeByEmailProps extends InputProps {
9
9
  fieldName?: string;
10
10
  autoSubmit?: boolean;
11
11
  scene: EmailScene;
12
+ captchaCode?: string;
13
+ onSendCodeError?: any;
14
+ codeFieldName?: string;
12
15
  }
13
16
  export declare const SendCodeByEmail: React.FC<SendCodeByEmailProps>;
@@ -7,6 +7,7 @@ export interface SendCodeByPhoneProps extends InputProps {
7
7
  form?: any;
8
8
  onSendCodeBefore?: any;
9
9
  onSendCodeAfter?: any;
10
+ onSendCodeError?: any;
10
11
  fieldName?: string;
11
12
  autoSubmit?: boolean;
12
13
  scene: SceneType;
@@ -1,3 +1,5 @@
1
+ import { React } from 'shim-react';
2
+ export declare const ShieldSpinLoading: (props: JSX.IntrinsicAttributes & React.ClassAttributes<HTMLEmbedElement> & React.EmbedHTMLAttributes<HTMLEmbedElement>) => JSX.Element;
1
3
  interface IG2SpinProps {
2
4
  size?: number;
3
5
  className?: string;
@@ -207,6 +207,15 @@ interface LoginTypeI18nProps {
207
207
  };
208
208
  };
209
209
  }
210
+ interface I18nLang {
211
+ default: string;
212
+ i18n: {
213
+ [lang: string]: {
214
+ value: string;
215
+ enabled: boolean;
216
+ };
217
+ };
218
+ }
210
219
  export interface ApplicationConfig {
211
220
  id: string;
212
221
  allowedOrigins: string[];
@@ -276,9 +285,12 @@ export interface ApplicationConfig {
276
285
  protocol: Protocol;
277
286
  displayName: string;
278
287
  logo: string;
288
+ id: string;
279
289
  config: ISamlConnectionConfig | OIDCConnectionConfig | ICasConnectionConfig | IAzureAdConnectionConfig | IOAuthConnectionConfig;
280
290
  /** 是否开启内嵌模式 */
281
291
  embedded?: boolean;
292
+ tags?: string[];
293
+ tagsStatus?: boolean;
282
294
  }[];
283
295
  ssoPageComponentDisplay: {
284
296
  autoRegisterThenLoginHintInfo: boolean;
@@ -302,6 +314,11 @@ export interface ApplicationConfig {
302
314
  ad?: LoginTypeI18nProps;
303
315
  ldap?: LoginTypeI18nProps;
304
316
  };
317
+ idpLayout?: {
318
+ maxConns: number;
319
+ topLastUsed: boolean;
320
+ customMoreI18n: I18nLang;
321
+ };
305
322
  };
306
323
  protocol: Protocol;
307
324
  oidcConfig: OidcClientMetadata;
@@ -327,8 +344,12 @@ export interface ApplicationConfig {
327
344
  enableCompletePassword: boolean;
328
345
  /** 是否开启手机密码注册手机号验证 */
329
346
  enabledPPRegisterValid?: boolean;
347
+ /** 是否开启邮箱密码注册验证 */
348
+ enabledMailPwdRegisterValid?: boolean;
330
349
  /** 是否开启邮箱域名匹配登录 */
331
350
  enabledMatchEmailDomain?: boolean;
351
+ /** 注册是否开启账号类型选择 */
352
+ enableAccountTypeSelect?: boolean;
332
353
  /**
333
354
  * 登录注册排序
334
355
  */
@@ -384,6 +405,47 @@ export interface ApplicationConfig {
384
405
  switch: 'OFF' | 'ON' | 'CONDON';
385
406
  };
386
407
  };
408
+ forgetPasswordSmsConfig?: {
409
+ robot: {
410
+ switch: 'OFF' | 'ON' | 'CONDON';
411
+ };
412
+ };
413
+ /** 注册阶段邮件安全配置 */
414
+ registerEmailConfig?: {
415
+ robot: {
416
+ switch: 'OFF' | 'ON' | 'CONDON';
417
+ };
418
+ };
419
+ /** 登录阶段邮件安全配置 */
420
+ loginEmailConfig?: {
421
+ robot: {
422
+ switch: 'OFF' | 'ON' | 'CONDON';
423
+ };
424
+ };
425
+ forgetPasswordEmailConfig?: {
426
+ robot: {
427
+ switch: 'OFF' | 'ON' | 'CONDON';
428
+ };
429
+ };
387
430
  /** 特殊浏览器匹配字符串 */
388
431
  specialBrowserSymbols?: string[];
432
+ resetPwdTipsConfig?: {
433
+ title: I18nLang;
434
+ desc: I18nLang;
435
+ };
436
+ noticePwdTipsConfig?: {
437
+ title: I18nLang;
438
+ desc: I18nLang;
439
+ };
440
+ noticePwdCustomLogo?: string;
441
+ /**
442
+ * 开启延迟校验用户是否存在功能
443
+ */
444
+ closeCheckSendUser?: boolean;
445
+ resetPwdLinkCustomLogo?: string;
446
+ resetPwdLinkTipsConfig?: {
447
+ title: I18nLang;
448
+ desc: I18nLang;
449
+ };
450
+ resetPwdSelectEmailPhone?: 'email' | 'phone' | 'email_and_phone';
389
451
  }
@@ -25,6 +25,7 @@ export declare const useFetchConsoleConfig: (forceUpdate: number, appId?: string
25
25
  showLoading?: boolean | undefined;
26
26
  loadingComponent?: React.ReactNode;
27
27
  openEventsMapping?: boolean | undefined;
28
+ autoFocus?: boolean | undefined;
28
29
  disableRegister?: boolean | undefined;
29
30
  registerMethods?: string[] | undefined;
30
31
  defaultRegisterMethod?: string | undefined;
@@ -111,6 +111,7 @@ export declare const useGuardAccountSelectInstance: () => {
111
111
  * 多账号 store 实例
112
112
  */
113
113
  instance?: {
114
+ getSocialLoginWays: () => import("../Guard/core/hooks/useMultipleAccounts").User[] | undefined;
114
115
  initStore: (appId: string, options: {
115
116
  serverSideLoginMethods: import("../Guard/core/hooks/useMultipleAccounts").LoginWay[];
116
117
  isInternationSms: boolean;
@@ -123,7 +124,7 @@ export declare const useGuardAccountSelectInstance: () => {
123
124
  id: string;
124
125
  loginAccount?: string | undefined;
125
126
  usertype?: string | undefined;
126
- }, "way" | "tab" | "phoneCountryCode">) => void;
127
+ }, "tab" | "way" | "phoneCountryCode">) => void;
127
128
  setLoginWayByHttpData: (account: string, data: {
128
129
  username?: string | undefined;
129
130
  phone?: string | undefined;
@@ -163,5 +164,7 @@ export declare const useGuardDefaultLanguage: () => Lang;
163
164
  export declare const useGuardTenantProvider: () => MultipleTenant | undefined;
164
165
  /** 当前人机验证策略 */
165
166
  export declare const useRobotVerify: () => "always_enable" | "disable" | "condition_set";
166
- /** 当前应用是否开启人机验证策略 */
167
- export declare const useCaptchaCheck: (sence: 'login' | 'register') => boolean;
167
+ /** 当前应用短信是否开启人机验证策略 */
168
+ export declare const useSmsCaptchaCheck: (sence: 'login' | 'register' | 'forget-password') => boolean;
169
+ /** 当前应用邮件是否开启人机验证策略 */
170
+ export declare const useEmailCaptchaCheck: (sence: 'login' | 'register' | 'forget-password') => boolean;
@@ -14,6 +14,9 @@ export declare const useDebounce: (fn: any, delay: number) => (...args: any[]) =
14
14
  export declare const useMediaSize: () => {
15
15
  isPhoneMedia: boolean;
16
16
  };
17
+ export declare const useAutoFocus: () => {
18
+ autoFocus: boolean;
19
+ };
17
20
  export declare const useShaking: () => {
18
21
  MountShaking: () => void;
19
22
  UnMountShaking: () => void;
@@ -25,7 +28,10 @@ export declare const useShaking: () => {
25
28
  * @returns
26
29
  */
27
30
  export declare const parsePhone: (isInternationSms: boolean, fieldValue: string, areaCode?: string) => {
28
- countryCode: string | undefined;
31
+ phoneNumber: string;
32
+ countryCode: undefined;
33
+ } | {
34
+ countryCode: string;
29
35
  phoneNumber: string;
30
36
  };
31
37
  export declare enum SocialConnectionEvent {
@@ -7,3 +7,7 @@ export declare const popupCenter: (url: string, { w, h }?: {
7
7
  w: number;
8
8
  h: number;
9
9
  }) => void;
10
+ export declare const larkPopupCenter: (url: string, { w, h }?: {
11
+ w: number;
12
+ h: number;
13
+ }) => void;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@authing/guard-shim-react18",
3
- "version": "4.5.51-eak.14",
3
+ "version": "4.5.51-eak.17",
4
4
  "description": "Guard shim for react 18, only be used to internal",
5
5
  "types": "dist/typings/src/index.d.ts",
6
6
  "module": "dist/guard.min.js",