@authing/guard-shim-react 4.5.53 → 4.5.54-shjw.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.
@@ -3,5 +3,11 @@ import { React } from 'shim-react';
3
3
  export interface GraphicVerifyCodeProps extends InputProps {
4
4
  verifyCodeUrl: string;
5
5
  changeCode: () => void;
6
+ imageLoading?: boolean;
7
+ imageHeight?: number;
8
+ imageError?: boolean;
9
+ refreshDisabled?: boolean;
10
+ onImageLoad?: React.ImgHTMLAttributes<HTMLImageElement>['onLoad'];
11
+ onImageError?: React.ImgHTMLAttributes<HTMLImageElement>['onError'];
6
12
  }
7
13
  export declare const GraphicVerifyCode: React.FC<GraphicVerifyCodeProps>;
@@ -4,6 +4,7 @@ import { VerifyLoginMethods } from '../../../Type/application';
4
4
  export interface FormItemIdentifyProps extends FormItemProps {
5
5
  checkRepeat?: boolean;
6
6
  checkExist?: boolean;
7
+ isExistenceVerified?: (value: string) => boolean;
7
8
  methods: VerifyLoginMethods[];
8
9
  currentMethod: 'phone-code' | 'email-code';
9
10
  areaCode?: string;
@@ -10,6 +10,7 @@ export interface SendCodeByEmailProps extends InputProps {
10
10
  autoSubmit?: boolean;
11
11
  scene: EmailScene;
12
12
  captchaCode?: string;
13
+ onSendCodeSuccess?: (account: string) => void;
13
14
  onSendCodeError?: any;
14
15
  codeFieldName?: string;
15
16
  }
@@ -7,6 +7,7 @@ export interface SendCodeByPhoneProps extends InputProps {
7
7
  form?: any;
8
8
  onSendCodeBefore?: any;
9
9
  onSendCodeAfter?: any;
10
+ onSendCodeSuccess?: (account: string) => void;
10
11
  onSendCodeError?: any;
11
12
  fieldName?: string;
12
13
  autoSubmit?: boolean;
@@ -0,0 +1,2 @@
1
+ import { ApplicationConfig } from '../Type/application';
2
+ export declare const needsSendCodeCaptcha: (config: ApplicationConfig, channel: 'phone' | 'email', scene: string) => boolean;
@@ -438,9 +438,9 @@ export interface ApplicationConfig {
438
438
  desc: I18nLang;
439
439
  };
440
440
  noticePwdCustomLogo?: string;
441
- /**
442
- * 开启延迟校验用户是否存在功能
443
- */
441
+ /** 手机号和邮箱存在性查询是否需要图形验证码 */
442
+ enableUserExistenceCheckCaptcha?: boolean;
443
+ /** 开启延迟校验用户是否存在功能 */
444
444
  closeCheckSendUser?: boolean;
445
445
  resetPwdLinkCustomLogo?: string;
446
446
  resetPwdLinkTipsConfig?: {
@@ -0,0 +1,4 @@
1
+ import { GuardHttp } from '../_utils/guardHttp';
2
+ import { ApplicationConfig } from '../Type/application';
3
+ import { AuthingGuardResponse } from '../_utils/http';
4
+ export declare const findUserWithCaptcha: (get: GuardHttp['get'], config: ApplicationConfig, key: string, type: string, challenge: (request: (captchaCode: string) => Promise<AuthingGuardResponse<boolean>>) => Promise<AuthingGuardResponse<boolean>>) => Promise<AuthingGuardResponse<boolean>>;
@@ -9,6 +9,8 @@ export interface ValidatorFormItemProps extends FormItemProps {
9
9
  form?: FormInstance;
10
10
  checkRepeat?: boolean;
11
11
  checkExist?: boolean;
12
+ isUserCheckVerified?: (value: string) => boolean;
13
+ isExistenceVerified?: (value: string) => boolean;
12
14
  areaCode?: string;
13
15
  /**
14
16
  * 控制内部FormItem组件关于pattern的校验规则
@@ -0,0 +1,5 @@
1
+ export declare const createSentAccountCheck: () => {
2
+ mark: (value: string) => void;
3
+ matches: (value: string) => boolean;
4
+ clear: () => void;
5
+ };
@@ -1 +1 @@
1
- export declare const useCheckRepeat: (checkFn: (value: any, resolve: (value: unknown) => void, reject: (reason?: any) => void) => void) => (_: any, value: any) => Promise<unknown>;
1
+ export declare const useCheckRepeat: (checkFn: (value: any, resolve: (value: unknown) => void, reject: (reason?: any) => void) => void, scope?: string) => (_: any, value: any) => Promise<unknown>;
@@ -0,0 +1,4 @@
1
+ export declare const useFindUser: (enabled?: boolean, type?: string) => {
2
+ findUser: (key: string, type: string) => Promise<import("../_utils/http").AuthingGuardResponse<boolean>>;
3
+ captchaField: JSX.Element | null;
4
+ };
@@ -0,0 +1,5 @@
1
+ export declare const useSentAccountCheck: (scope: string) => {
2
+ clear: () => void;
3
+ mark: (value: string) => void;
4
+ matches: (value: string) => boolean;
5
+ };
@@ -0,0 +1,30 @@
1
+ export declare const createCaptchaImage: () => {
2
+ snapshot: () => {
3
+ url: string;
4
+ loading: boolean;
5
+ error: boolean;
6
+ version: number;
7
+ owner: symbol | undefined;
8
+ };
9
+ subscribe: (listener: () => void) => () => void;
10
+ ensure: (host: string, poolId: string, owner?: symbol) => void;
11
+ refresh: (host: string, poolId: string, owner?: symbol) => void;
12
+ consume: (owner: symbol) => void;
13
+ claim: (owner: symbol) => void;
14
+ release: (owner: symbol) => void;
15
+ };
16
+ export declare const captchaImage: {
17
+ snapshot: () => {
18
+ url: string;
19
+ loading: boolean;
20
+ error: boolean;
21
+ version: number;
22
+ owner: symbol | undefined;
23
+ };
24
+ subscribe: (listener: () => void) => () => void;
25
+ ensure: (host: string, poolId: string, owner?: symbol) => void;
26
+ refresh: (host: string, poolId: string, owner?: symbol) => void;
27
+ consume: (owner: symbol) => void;
28
+ claim: (owner: symbol) => void;
29
+ release: (owner: symbol) => void;
30
+ };
@@ -0,0 +1 @@
1
+ export declare const enqueueCaptchaRequest: <T>(request: () => Promise<T>) => Promise<T>;
@@ -164,7 +164,7 @@ export declare const useGuardDefaultLanguage: () => Lang;
164
164
  export declare const useGuardTenantProvider: () => MultipleTenant | undefined;
165
165
  /** 当前人机验证策略 */
166
166
  export declare const useRobotVerify: () => "always_enable" | "disable" | "condition_set";
167
- /** 当前应用短信是否开启人机验证策略 */
167
+ /** 短信的内联图形验证码;开启存在性验证码时由发送组件按请求展开验证区。 */
168
168
  export declare const useSmsCaptchaCheck: (sence: 'login' | 'register' | 'forget-password') => boolean;
169
- /** 当前应用邮件是否开启人机验证策略 */
169
+ /** 邮件的内联图形验证码;开启存在性验证码时由发送组件按请求展开验证区。 */
170
170
  export declare const useEmailCaptchaCheck: (sence: 'login' | 'register' | 'forget-password') => boolean;
@@ -1 +1 @@
1
- export declare const getCaptchaUrl: (host: string) => string;
1
+ export declare const getCaptchaUrl: (host: string, userPoolId?: string) => string;
@@ -31,3 +31,7 @@ export interface AuthingGuardResponse<T = any> extends AuthingResponse<T> {
31
31
  onGuardHandling?: () => CodeAction;
32
32
  isFlowEnd?: boolean;
33
33
  }
34
+ export declare enum HttpStatusCode {
35
+ OK = 200,
36
+ TOO_MANY_REQUESTS = 429
37
+ }
@@ -0,0 +1,5 @@
1
+ import './inlineCaptcha.less';
2
+ export declare const useCaptchaRequest: (eager?: boolean) => {
3
+ runWithCaptcha: <T>(request: (captchaCode: string) => Promise<T>) => Promise<T>;
4
+ captchaField: JSX.Element | null;
5
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@authing/guard-shim-react",
3
- "version": "4.5.53",
3
+ "version": "4.5.54-shjw.1",
4
4
  "description": "Guard shim for react 16 / 17, only be used to internal",
5
5
  "types": "dist/typings/src/index.d.ts",
6
6
  "module": "dist/guard.min.js",