@authing/guard-shim-react 6.0.0-alpha.1 → 6.0.0-alpha.11

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.
Files changed (39) hide show
  1. package/dist/{index.min.css → guard.min.css} +1 -1
  2. package/dist/guard.min.js +2 -0
  3. package/dist/typings/src/CommonInput/index.d.ts +2 -0
  4. package/dist/typings/src/CompleteInfo/businessRequest.d.ts +1 -1
  5. package/dist/typings/src/ForgetPassword/core/inputIdentify.d.ts +1 -0
  6. package/dist/typings/src/Guard/Guard.d.ts +1 -1
  7. package/dist/typings/src/Guard/core/hooks/useMultipleAccounts.d.ts +2 -2
  8. package/dist/typings/src/Guard/core/index.d.ts +1 -1
  9. package/dist/typings/src/Guard/core/renderContext.d.ts +1 -1
  10. package/dist/typings/src/Guard/core/renderModule.d.ts +1 -1
  11. package/dist/typings/src/Guard/event.d.ts +1 -1
  12. package/dist/typings/src/IdentityBinding/interface.d.ts +1 -1
  13. package/dist/typings/src/IdentityBindingAsk/interface.d.ts +1 -1
  14. package/dist/typings/src/InputNumber/index.d.ts +2 -0
  15. package/dist/typings/src/Login/core/withPassword/GraphicVerifyCode.d.ts +1 -0
  16. package/dist/typings/src/Login/core/withPassword/InputAccount.d.ts +1 -0
  17. package/dist/typings/src/Login/core/withVerifyCode/InputInternationPhone.d.ts +1 -0
  18. package/dist/typings/src/Login/core/withVerifyCode/inputIdentify.d.ts +1 -0
  19. package/dist/typings/src/Login/hooks/useLoginMultiple.d.ts +1 -1
  20. package/dist/typings/src/MFA/context.d.ts +7 -0
  21. package/dist/typings/src/MFA/index.d.ts +0 -6
  22. package/dist/typings/src/SendCode/SendCodeByEmail.d.ts +1 -0
  23. package/dist/typings/src/SendCode/SendCodeByPhone.d.ts +1 -0
  24. package/dist/typings/src/SendCode/index.d.ts +1 -0
  25. package/dist/typings/src/SingleComponent/SingleComponent.d.ts +2 -1
  26. package/dist/typings/src/Type/application.d.ts +1 -1
  27. package/dist/typings/src/_utils/appendConfig.d.ts +1 -1
  28. package/dist/typings/src/_utils/compute.d.ts +19 -0
  29. package/dist/typings/src/_utils/config/index.d.ts +1 -1
  30. package/dist/typings/src/_utils/context.d.ts +4 -2
  31. package/dist/typings/src/_utils/getVersion.d.ts +1 -0
  32. package/dist/typings/src/_utils/index.d.ts +25 -42
  33. package/dist/typings/src/index.d.ts +2 -2
  34. package/dist/typings/src/types.d.ts +5 -1
  35. package/package.json +2 -2
  36. package/dist/index.min.js +0 -2
  37. package/dist/typings/shim-antd5/index.d.ts +0 -2
  38. package/dist/typings/src/version/index.d.ts +0 -2
  39. package/dist/typings/src/version/version.d.ts +0 -2
@@ -3,4 +3,6 @@ import './styles.less';
3
3
  export declare const CommonInput: (props: InputProps & {
4
4
  fieldcontext?: any;
5
5
  ref?: any;
6
+ } & {
7
+ name: string;
6
8
  }) => JSX.Element;
@@ -6,4 +6,4 @@ export declare enum CompleteInfoAuthFlowAction {
6
6
  }
7
7
  export declare const authFlow: (action: CompleteInfoAuthFlowAction, data?: CompleteInfoRequest) => Promise<import("../_utils/http").AuthingGuardResponse<any>>;
8
8
  export declare const registerSkipMethod: (fnName: RegisterCompleteInfoInitData['businessRequestName'] | string, content: any) => Promise<import("../_utils/http").AuthingGuardResponse<any>>;
9
- export declare const registerRequest: (action: CompleteInfoAuthFlowAction, registerFnName: RegisterCompleteInfoInitData['businessRequestName'], registerContent: any, registerProfile?: any) => Promise<User | import("../_utils/http").AuthingGuardResponse<any> | undefined>;
9
+ export declare const registerRequest: (action: CompleteInfoAuthFlowAction, registerFnName: RegisterCompleteInfoInitData['businessRequestName'], registerContent: any, registerProfile?: any) => Promise<import("../_utils/http").AuthingGuardResponse<any> | User | undefined>;
@@ -3,5 +3,6 @@ import { React } from 'shim-react';
3
3
  import { VerifyLoginMethods } from '../../Type/application';
4
4
  export interface InputIdentifyProps extends InputProps {
5
5
  methods: VerifyLoginMethods[];
6
+ name: string;
6
7
  }
7
8
  export declare const InputIdentify: React.FC<InputIdentifyProps>;
@@ -7,4 +7,4 @@ export interface GuardProps extends GuardEvents, IG2FCProps {
7
7
  config?: Partial<GuardLocalConfig>;
8
8
  appendConfig?: GuardAppendConfig;
9
9
  }
10
- export declare const Guard: React.MemoExoticComponent<(props: GuardProps) => JSX.Element>;
10
+ export declare const GuardComponent: React.MemoExoticComponent<(props: GuardProps) => JSX.Element>;
@@ -249,7 +249,7 @@ declare class MultipleAccount {
249
249
  setUserInfo: (user: Omit<User & {
250
250
  id: string;
251
251
  loginAccount?: string | undefined;
252
- }, "tab" | "way" | "phoneCountryCode">) => void;
252
+ }, "way" | "tab" | "phoneCountryCode">) => 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: Omit<User & {
293
293
  id: string;
294
294
  loginAccount?: string | undefined;
295
- }, "tab" | "way" | "phoneCountryCode">) => void;
295
+ }, "way" | "tab" | "phoneCountryCode">) => void;
296
296
  setLoginWayByHttpData: (account: string, data: {
297
297
  username?: string | undefined;
298
298
  phone?: string | undefined;
@@ -1,4 +1,4 @@
1
- import { GuardProps } from '..';
1
+ import { GuardProps } from '../Guard';
2
2
  import { ModuleState } from '../GuardModule/stateMachine';
3
3
  export interface GuardCoreProps {
4
4
  guardProps: GuardProps;
@@ -1,4 +1,4 @@
1
- import { GuardProps } from '..';
1
+ import { GuardProps } from '../Guard';
2
2
  import { React, ReactNode } from 'shim-react';
3
3
  import { ModuleState } from '../GuardModule/stateMachine';
4
4
  export declare const RenderContext: React.FC<{
@@ -1,5 +1,5 @@
1
1
  import { React } from 'shim-react';
2
- import { GuardProps } from '..';
2
+ import { GuardProps } from '../Guard';
3
3
  import '../styles.less';
4
4
  export declare enum LangMAP {
5
5
  zhCn = "zh-CN",
@@ -1,4 +1,4 @@
1
- import { GuardModuleType } from '.';
1
+ import { GuardModuleType } from '../Guard';
2
2
  import { CompleteInfoEvents } from '../CompleteInfo/interface';
3
3
  import { ForgetPasswordEvents } from '../ForgetPassword/interface';
4
4
  import { IdentityBindingEvents } from '../IdentityBinding/interface';
@@ -1,4 +1,4 @@
1
- import { IG2Config, IG2Events, IG2FCProps, IG2FCViewProps } from '..';
1
+ import { IG2Config, IG2Events, IG2FCProps, IG2FCViewProps } from '../Type';
2
2
  import { AuthenticationClient, User } from 'authing-js-sdk';
3
3
  import { GuardModuleType } from '../Guard';
4
4
  import { Agreement } from '../Type/application';
@@ -1,5 +1,5 @@
1
1
  import { AuthenticationClient, User } from 'authing-js-sdk';
2
- import { IG2Config, IG2Events, IG2FCProps, IG2FCViewProps } from '..';
2
+ import { IG2Config, IG2Events, IG2FCProps, IG2FCViewProps } from '../Type';
3
3
  export interface IdentityBindingAskConfig extends IG2Config {
4
4
  }
5
5
  export interface IdentityBindingAskEvents extends IG2Events {
@@ -1,5 +1,7 @@
1
1
  import { InputProps } from 'shim-antd/lib/input';
2
2
  import { React } from 'shim-react';
3
3
  export interface InputNumberProps extends InputProps {
4
+ name: string;
5
+ showType?: 'normal' | 'new';
4
6
  }
5
7
  export declare const InputNumber: React.ForwardRefExoticComponent<InputNumberProps & React.RefAttributes<any>>;
@@ -3,5 +3,6 @@ import { React } from 'shim-react';
3
3
  export interface GraphicVerifyCodeProps extends InputProps {
4
4
  verifyCodeUrl: string;
5
5
  changeCode: () => void;
6
+ name: string;
6
7
  }
7
8
  export declare const GraphicVerifyCode: React.FC<GraphicVerifyCodeProps>;
@@ -2,5 +2,6 @@ import { InputProps } from 'shim-antd/lib/input';
2
2
  import { React } from 'shim-react';
3
3
  export interface InputAccountProps extends InputProps {
4
4
  passwordLoginMethods: string[];
5
+ name: string;
5
6
  }
6
7
  export declare const InputAccount: React.FC<InputAccountProps>;
@@ -3,5 +3,6 @@ import { React } from 'shim-react';
3
3
  export interface InputInternationPhoneProps extends InputProps {
4
4
  areaCode: string;
5
5
  onAreaCodeChange: (areaCode: string) => void;
6
+ name: string;
6
7
  }
7
8
  export declare const InputInternationPhone: React.FC<InputInternationPhoneProps>;
@@ -3,5 +3,6 @@ import { React } from 'shim-react';
3
3
  import { VerifyLoginMethods } from '../../../Type/application';
4
4
  export interface InputIdentifyProps extends InputProps {
5
5
  methods: VerifyLoginMethods[];
6
+ name: string;
6
7
  }
7
8
  export declare const InputIdentify: React.FC<InputIdentifyProps>;
@@ -35,7 +35,7 @@ declare function useLoginMultiple(setLoginWay: React.Dispatch<any>): {
35
35
  setUserInfo: (user: Omit<import("../../Guard/core/hooks/useMultipleAccounts").User & {
36
36
  id: string;
37
37
  loginAccount?: string | undefined;
38
- }, "tab" | "way" | "phoneCountryCode">) => void;
38
+ }, "way" | "tab" | "phoneCountryCode">) => void;
39
39
  setLoginWayByHttpData: (account: string, data: {
40
40
  username?: string | undefined;
41
41
  phone?: string | undefined;
@@ -0,0 +1,7 @@
1
+ import { React } from 'shim-react';
2
+ interface MFABackStateContextType {
3
+ setMfaBackState: React.Dispatch<React.SetStateAction<string>>;
4
+ mfaBackState: string;
5
+ }
6
+ export declare const MFABackStateContext: React.Context<MFABackStateContextType | undefined>;
7
+ export {};
@@ -1,9 +1,3 @@
1
1
  import { React } from 'shim-react';
2
2
  import './styles.less';
3
- interface MFABackStateContextType {
4
- setMfaBackState: React.Dispatch<React.SetStateAction<string>>;
5
- mfaBackState: string;
6
- }
7
- export declare const MFABackStateContext: React.Context<MFABackStateContextType | undefined>;
8
3
  export declare const GuardMFAView: React.FC;
9
- export {};
@@ -9,5 +9,6 @@ export interface SendCodeByEmailProps extends InputProps {
9
9
  fieldName?: string;
10
10
  autoSubmit?: boolean;
11
11
  scene: EmailScene;
12
+ name: string;
12
13
  }
13
14
  export declare const SendCodeByEmail: React.FC<SendCodeByEmailProps>;
@@ -13,5 +13,6 @@ export interface SendCodeByPhoneProps extends InputProps {
13
13
  isInternationSms?: boolean;
14
14
  codeFieldName?: string;
15
15
  captchaCode?: string;
16
+ name: string;
16
17
  }
17
18
  export declare const SendCodeByPhone: React.FC<SendCodeByPhoneProps>;
@@ -5,5 +5,6 @@ export interface SendPhoneCodeProps extends InputProps {
5
5
  form?: any;
6
6
  beforeSend?: any;
7
7
  autoSubmit?: boolean;
8
+ name: string;
8
9
  }
9
10
  export declare const SendCode: React.FC<SendPhoneCodeProps>;
@@ -1,2 +1,3 @@
1
- import { GuardModuleType, IG2FCProps } from '..';
1
+ import { IG2FCProps } from '../Type';
2
+ import { GuardModuleType } from '../Guard/module';
2
3
  export declare function SingleComponent<T extends IG2FCProps>(props: T, guardModuleType: GuardModuleType, initData?: any): JSX.Element;
@@ -1,4 +1,4 @@
1
- import { Lang } from '..';
1
+ import { Lang } from '../Type';
2
2
  import { PasswordStrength } from '../_utils';
3
3
  export * from 'authing-js-sdk';
4
4
  export declare enum LoginMethods {
@@ -1,4 +1,4 @@
1
- import { GuardAppendConfig } from '..';
1
+ import { GuardAppendConfig } from '../Type';
2
2
  export declare const getAppendConfig: () => GuardAppendConfig;
3
3
  export declare const useAppendConfig: () => GuardAppendConfig;
4
4
  export declare const initAppendConfig: (appendConfig?: GuardAppendConfig) => void;
@@ -0,0 +1,19 @@
1
+ import { RegisterSortMethods } from '../Type';
2
+ export declare const assembledRequestHost: (requestHostname: string, configHost: string) => string;
3
+ export declare const getHundreds: (num: number) => number;
4
+ export declare const transformSortMethod: (method: RegisterSortMethods | string) => string;
5
+ export declare const isWeChatBrowser: () => boolean | null;
6
+ export declare const isLarkBrowser: () => boolean | null;
7
+ export declare const isQtWebEngine: () => boolean | null;
8
+ export declare const isXiaomiBrowser: () => boolean | null;
9
+ export declare const isDingtalkBrowser: () => boolean | null;
10
+ export declare const isQQBrowser: () => boolean | null;
11
+ export declare const isQQBuiltInBrowser: () => boolean | null;
12
+ export declare const isWeWorkBuiltInBrowser: () => boolean | null;
13
+ export declare const isEdgeBrowser: () => boolean;
14
+ export declare const isWeiboBrowser: () => boolean | null;
15
+ export declare const isAlipayBrowser: () => boolean | null;
16
+ export declare const isBaiduBrowser: () => boolean | null;
17
+ export declare const isWeComeBrowser: () => boolean;
18
+ export declare const isMobile: () => RegExpMatchArray | null;
19
+ export declare const isSpecialBrowser: () => boolean;
@@ -53,7 +53,7 @@ export declare const useFetchConsoleConfig: (forceUpdate: number, appId?: string
53
53
  loginMethods?: LoginMethods[] | undefined;
54
54
  passwordLoginMethods?: string[] | undefined;
55
55
  socialConnections?: import("../../Type").SocialConnectionProvider[] | undefined;
56
- socialConnectionsBtnShape?: "button" | "default" | "icon" | undefined;
56
+ socialConnectionsBtnShape?: "default" | "button" | "icon" | undefined;
57
57
  enterpriseConnections?: string[] | undefined;
58
58
  qrCodeScanOptions?: {
59
59
  extIdpConnId?: string | undefined;
@@ -1,5 +1,7 @@
1
1
  import { React, ReactNode } from 'shim-react';
2
- import { GuardEvents, GuardLocalConfig, GuardModuleType, GuardPageConfig, Lang } from '..';
2
+ import { GuardPageConfig, Lang } from '../Type';
3
+ import { GuardModuleType } from '../Guard/module';
4
+ import { GuardEvents, GuardLocalConfig } from '../Guard';
3
5
  import { BackFillMultipleState, StoreInstance } from '../Guard/core/hooks/useMultipleAccounts';
4
6
  import { ModuleState } from '../Guard/GuardModule/stateMachine';
5
7
  import { ApplicationConfig } from '../Type/application';
@@ -119,7 +121,7 @@ export declare const useGuardMultipleInstance: () => {
119
121
  setUserInfo: (user: Omit<import("../Guard/core/hooks/useMultipleAccounts").User & {
120
122
  id: string;
121
123
  loginAccount?: string | undefined;
122
- }, "tab" | "way" | "phoneCountryCode">) => void;
124
+ }, "way" | "tab" | "phoneCountryCode">) => void;
123
125
  setLoginWayByHttpData: (account: string, data: {
124
126
  username?: string | undefined;
125
127
  phone?: string | undefined;
@@ -0,0 +1 @@
1
+ export declare function getVersion(): string;
@@ -4,28 +4,6 @@ import { User } from 'authing-js-sdk';
4
4
  import { GuardProps } from '../Guard';
5
5
  import { ApplicationConfig, ComplateFiledsPlace, LoginMethods, RegisterMethods, RegisterSortMethods, TabFieldsI18nItem } from '../Type/application';
6
6
  import { Lang } from '../Type';
7
- export * from './popupCenter';
8
- export * from './clipboard';
9
- export * from './locales';
10
- export * from './config';
11
- export * from './facePlugin';
12
- export * from './hooks';
13
- export * from './logger';
14
- export * from './responseManagement';
15
- export * from './appendConfig';
16
- export * from './clipboard';
17
- export * from './context';
18
- export * from './corsVerification';
19
- export * from './countryList';
20
- export * from './errorFace';
21
- export * from './flowHandleStorage';
22
- export * from './getCaptchaUrl';
23
- export * from './GuardErrorCode';
24
- export * from './guardHttp';
25
- export * from './initAppId';
26
- export * from './popupCenter';
27
- export * from './tenant';
28
- export * from './useErrorText';
29
7
  export declare const VALIDATE_PATTERN: {
30
8
  readonly email: RegExp;
31
9
  readonly phone: RegExp;
@@ -63,23 +41,6 @@ export declare const getUserRegisterParams: (params?: string[]) => {
63
41
  key: string;
64
42
  value: string | string[] | qs.ParsedQs | qs.ParsedQs[] | undefined;
65
43
  }[];
66
- export declare const isWeChatBrowser: () => boolean | null;
67
- export declare const isLarkBrowser: () => boolean | null;
68
- export declare const isQtWebEngine: () => boolean | null;
69
- export declare const isXiaomiBrowser: () => boolean | null;
70
- export declare const isDingtalkBrowser: () => boolean | null;
71
- export declare const isQQBrowser: () => boolean | null;
72
- export declare const isQQBuiltInBrowser: () => boolean | null;
73
- export declare const isWeWorkBuiltInBrowser: () => boolean | null;
74
- export declare const isEdgeBrowser: () => boolean;
75
- export declare const isWeiboBrowser: () => boolean | null;
76
- export declare const isAlipayBrowser: () => boolean | null;
77
- export declare const isBaiduBrowser: () => boolean | null;
78
- export declare const isWeComeBrowser: () => boolean;
79
- export declare const isMobile: () => RegExpMatchArray | null;
80
- export declare const isSpecialBrowser: () => boolean;
81
- export declare const assembledAppHost: (identifier: string, host: string) => string;
82
- export declare const assembledRequestHost: (requestHostname: string, configHost: string) => string;
83
44
  export declare enum PasswordStrength {
84
45
  NoCheck = 0,
85
46
  Low = 1,
@@ -97,10 +58,8 @@ export declare const getPasswordValidateRules: (strength?: PasswordStrength, cus
97
58
  export declare const sleep: (delay: number) => Promise<unknown>;
98
59
  export declare const shoudGoToComplete: (user: User, contextType: ComplateFiledsPlace, config: ApplicationConfig | undefined, autoRegister?: boolean) => boolean;
99
60
  export declare const transformMethod: (method: RegisterMethods | string) => string;
100
- export declare const transformSortMethod: (method: RegisterSortMethods | string) => string;
101
61
  export declare const mailDesensitization: (mail: string) => string;
102
62
  export declare const phoneDesensitization: (phone: string) => string;
103
- export declare const getHundreds: (num: number) => number;
104
63
  export declare const GuardPropsFilter: (pre: GuardProps, current: GuardProps) => boolean;
105
64
  export declare const getDocumentNode: (node: Node & ParentNode) => Document;
106
65
  export declare const getLoginTypePipe: (publicConfig: ApplicationConfig, registerMethod: RegisterMethods) => {
@@ -116,4 +75,28 @@ export declare const regexFromString: (string: string) => RegExp | null;
116
75
  export declare const getI18nLabel: (method: string | RegisterSortMethods, i18nFields: Map<string, TabFieldsI18nItem>, defaultLanguageConfig: Lang) => string;
117
76
  export declare const getSortLabels: (methods: string[], i18nConfig: Map<string, TabFieldsI18nItem>, defaultLanguageConfig: Lang) => string;
118
77
  export declare const getSortTabs: (tabs: string[], tab?: string) => string[];
119
- export declare const isDisabled: (values: Record<string, any>) => boolean;
78
+ export declare const isDisabled: (values: Record<string, any>, requireNames?: string[]) => boolean;
79
+ export * from './popupCenter';
80
+ export * from './clipboard';
81
+ export * from './locales';
82
+ export * from './config';
83
+ export * from './facePlugin';
84
+ export * from './hooks';
85
+ export * from './logger';
86
+ export * from './responseManagement';
87
+ export * from './appendConfig';
88
+ export * from './clipboard';
89
+ export * from './context';
90
+ export * from './corsVerification';
91
+ export * from './countryList';
92
+ export * from './errorFace';
93
+ export * from './flowHandleStorage';
94
+ export * from './getCaptchaUrl';
95
+ export * from './GuardErrorCode';
96
+ export * from './guardHttp';
97
+ export * from './initAppId';
98
+ export * from './popupCenter';
99
+ export * from './tenant';
100
+ export * from './useErrorText';
101
+ export * from './getVersion';
102
+ export * from './compute';
@@ -1,4 +1,4 @@
1
- import { GuardOptions, GuardEventsKebabToCamelType, StartWithRedirectOptions, AuthenticationClient, JwtTokenStatus, User, Lang, LogoutParams } from './types';
1
+ import { GuardOptions, GuardEventsKebabToCamelType, StartWithRedirectOptions, AuthenticationClient, JwtTokenStatus, User, Lang, LogoutParams, IChangeViewOptions } from './types';
2
2
  export * from './types';
3
3
  export declare class Guard {
4
4
  options: GuardOptions;
@@ -44,7 +44,7 @@ export declare class Guard {
44
44
  currentModule: string | undefined;
45
45
  currentTab: string | undefined;
46
46
  };
47
- changeView(currentView: string): Promise<void>;
47
+ changeView(currentView: string | IChangeViewOptions): Promise<void>;
48
48
  private getAgreementsContext;
49
49
  checkAllAgreements(): void;
50
50
  unCheckAllAgreements(): void;
@@ -4,7 +4,6 @@ import { GuardEventsKebabToCamelType, GuardProps, GuardLocalConfig, GuardModuleT
4
4
  import { CSSProperties } from 'shim-react';
5
5
  export * from './_utils';
6
6
  export * from './AuthClientProvider';
7
- export * from './version';
8
7
  export * from './Guard/core/hooks/useGuardView';
9
8
  export * from './Guard';
10
9
  export * from './Type';
@@ -57,3 +56,8 @@ export interface LogoutParams {
57
56
  redirectUri?: string;
58
57
  quitCurrentDevice?: boolean;
59
58
  }
59
+ export declare type IGuardTabType = 'phone-code' | 'phone-password' | 'password' | 'email-password' | 'username-password' | 'authing-otp-push' | 'ad' | 'ldap' | 'app-qrcode';
60
+ export interface IChangeViewOptions {
61
+ module: IGuardModuleType;
62
+ tab?: IGuardTabType;
63
+ }
package/package.json CHANGED
@@ -1,9 +1,9 @@
1
1
  {
2
2
  "name": "@authing/guard-shim-react",
3
- "version": "6.0.0-alpha.1",
3
+ "version": "6.0.0-alpha.11",
4
4
  "description": "Guard shim for react 16 / 17, only be used to internal",
5
5
  "types": "dist/typings/src/index.d.ts",
6
- "module": "dist/index.min.js",
6
+ "module": "dist/guard.min.js",
7
7
  "files": [
8
8
  "dist",
9
9
  "package.json"