@authing/guard-shim-react 4.5.47-bg.21 → 4.5.47-bg.22

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.
@@ -2,8 +2,8 @@ import './index.less';
2
2
  export * from 'antd';
3
3
  export * from '@ant-design/icons';
4
4
  export declare const antdLocales: {
5
- zhCN: import("antd/lib/locale-provider").Locale;
6
- enUS: import("antd/lib/locale-provider").Locale;
7
- jaJP: import("antd/lib/locale-provider").Locale;
8
- zhTW: import("antd/lib/locale-provider").Locale;
5
+ zhCN: import("shim-antd/lib/locale-provider").Locale;
6
+ enUS: import("shim-antd/lib/locale-provider").Locale;
7
+ jaJP: import("shim-antd/lib/locale-provider").Locale;
8
+ zhTW: import("shim-antd/lib/locale-provider").Locale;
9
9
  };
@@ -4,5 +4,5 @@ export declare enum CompleteInfoAuthFlowAction {
4
4
  Skip = "skip-completion"
5
5
  }
6
6
  export declare const authFlow: (action: CompleteInfoAuthFlowAction, data?: CompleteInfoRequest) => Promise<import("../_utils/http").AuthingGuardResponse<any>>;
7
- export declare const registerSkipMethod: (fnName: RegisterCompleteInfoInitData['businessRequestName'] | string, content: any) => Promise<import("../_utils/http").AuthingGuardResponse<any>>;
8
- export declare const registerRequest: (action: CompleteInfoAuthFlowAction, registerFnName: RegisterCompleteInfoInitData['businessRequestName'], registerContent: any, registerProfile?: any) => Promise<import("../_utils/http").AuthingGuardResponse<any> | undefined>;
7
+ export declare const registerSkipMethod: (fnName: RegisterCompleteInfoInitData["businessRequestName"] | string, content: any) => Promise<import("../_utils/http").AuthingGuardResponse<any>>;
8
+ export declare const registerRequest: (action: CompleteInfoAuthFlowAction, registerFnName: RegisterCompleteInfoInitData["businessRequestName"], registerContent: any, registerProfile?: any) => Promise<import("../_utils/http").AuthingGuardResponse<any> | undefined>;
@@ -2,14 +2,14 @@ import { User } from 'authing-js-sdk';
2
2
  import { CompleteInfoMetaData, CompleteInfoRequest, ExtendsField } from './interface';
3
3
  import { ApplicationConfig } from '../Type/application';
4
4
  export declare const completeFieldsFilter: (user: User, field: ExtendsField) => boolean;
5
- export declare const extendsFieldsToMetaData: (extendsFields: import("../Type/application").ExtendsField[] | undefined, selectOptions: {
5
+ export declare const extendsFieldsToMetaData: (extendsFields: ApplicationConfig["extendsFields"] | undefined, selectOptions: {
6
6
  key: string;
7
7
  options: {
8
8
  value: string;
9
9
  label: string;
10
10
  }[];
11
11
  }[]) => CompleteInfoMetaData[];
12
- export declare const fieldValuesToRegisterProfile: (extendsFields: ApplicationConfig['extendsFields'], fieldValues?: CompleteInfoRequest['fieldValues']) => {
12
+ export declare const fieldValuesToRegisterProfile: (extendsFields: ApplicationConfig["extendsFields"], fieldValues?: CompleteInfoRequest["fieldValues"]) => {
13
13
  registerProfile: Record<string, any>;
14
14
  udf: {
15
15
  key: string;
@@ -249,7 +249,7 @@ declare class MultipleAccount {
249
249
  serverSideLoginMethods: LoginWay[];
250
250
  isInternationSms: boolean;
251
251
  }) => void;
252
- setLoginWay: (tab: 'input' | 'qrcode', way: LoginWay, id?: string, internation?: {
252
+ setLoginWay: (tab: "input" | "qrcode", way: LoginWay, id?: string, internation?: {
253
253
  phoneCountryCode: string;
254
254
  areaCode: string;
255
255
  }) => void;
@@ -257,7 +257,7 @@ declare class MultipleAccount {
257
257
  id: string;
258
258
  loginAccount?: string;
259
259
  usertype?: string;
260
- }, 'way' | 'tab' | 'phoneCountryCode'>) => void;
260
+ }, "way" | "tab" | "phoneCountryCode">) => void;
261
261
  setLoginWayByHttpData: (account: string, data: {
262
262
  username?: string;
263
263
  phone?: string;
@@ -294,7 +294,7 @@ declare const useSelectAccounts: ({ appId, finallyConfig }: {
294
294
  serverSideLoginMethods: LoginWay[];
295
295
  isInternationSms: boolean;
296
296
  }) => void;
297
- setLoginWay: (tab: 'input' | 'qrcode', way: LoginWay, id?: string, internation?: {
297
+ setLoginWay: (tab: "input" | "qrcode", way: LoginWay, id?: string, internation?: {
298
298
  phoneCountryCode: string;
299
299
  areaCode: string;
300
300
  }) => void;
@@ -302,7 +302,7 @@ declare const useSelectAccounts: ({ appId, finallyConfig }: {
302
302
  id: string;
303
303
  loginAccount?: string;
304
304
  usertype?: string;
305
- }, 'way' | 'tab' | 'phoneCountryCode'>) => void;
305
+ }, "way" | "tab" | "phoneCountryCode">) => void;
306
306
  setLoginWayByHttpData: (account: string, data: {
307
307
  username?: string;
308
308
  phone?: string;
@@ -325,7 +325,7 @@ declare const useSelectAccounts: ({ appId, finallyConfig }: {
325
325
  getOriginWay: () => string;
326
326
  } | undefined;
327
327
  isMultipleAccount: boolean;
328
- referMultipleState: (type: 'login' | 'multiple', data?: BackFillMultipleState) => void;
328
+ referMultipleState: (type: "login" | "multiple", data?: BackFillMultipleState) => void;
329
329
  multipleAccountData: BackFillMultipleState | undefined;
330
330
  clearBackFillData: () => void;
331
331
  };
@@ -29,7 +29,7 @@ export declare enum IdentityBindingAction {
29
29
  export declare const PhoneCode: (params: PhoneCodeParams) => Promise<import("../_utils/http").AuthingGuardResponse<any>>;
30
30
  export declare const EmailCode: (params: EmailCodeParams) => Promise<import("../_utils/http").AuthingGuardResponse<any>>;
31
31
  export declare const Password: (params: PasswordParams) => Promise<import("../_utils/http").AuthingGuardResponse<any>>;
32
- export declare const useIdentityBindingBusinessRequest: (type?: 'register' | 'bind') => {
32
+ export declare const useIdentityBindingBusinessRequest: (type?: "register" | "bind") => {
33
33
  "phone-code": (params: PhoneCodeParams) => Promise<import("../_utils/http").AuthingGuardResponse<any>>;
34
34
  "emial-code": (params: EmailCodeParams) => Promise<import("../_utils/http").AuthingGuardResponse<any>>;
35
35
  password: (params: PasswordParams) => Promise<import("../_utils/http").AuthingGuardResponse<any>>;
@@ -32,24 +32,24 @@ declare function useLoginSelectAccount(setLoginWay: React.Dispatch<any>): {
32
32
  serverSideLoginMethods: LoginWay[];
33
33
  isInternationSms: boolean;
34
34
  }) => void;
35
- setLoginWay: (tab: "input" | "qrcode", way: LoginWay, id?: string | undefined, internation?: {
35
+ setLoginWay: (tab: "input" | "qrcode", way: LoginWay, id?: string, internation?: {
36
36
  phoneCountryCode: string;
37
37
  areaCode: string;
38
- } | undefined) => void;
38
+ }) => void;
39
39
  setUserInfo: (user: Omit<import("../../Guard/core/hooks/useMultipleAccounts").User & {
40
40
  id: string;
41
- loginAccount?: string | undefined;
42
- usertype?: string | undefined;
43
- }, "tab" | "way" | "phoneCountryCode">) => void;
41
+ loginAccount?: string;
42
+ usertype?: string;
43
+ }, "way" | "tab" | "phoneCountryCode">) => void;
44
44
  setLoginWayByHttpData: (account: string, data: {
45
- username?: string | undefined;
46
- phone?: string | undefined;
47
- email?: string | undefined;
45
+ username?: string;
46
+ phone?: string;
47
+ email?: string;
48
48
  }) => void;
49
49
  setLoginWayByLDAPData: (account: string, data: {
50
- name?: string | undefined;
51
- phone?: string | undefined;
52
- email?: string | undefined;
50
+ name?: string;
51
+ phone?: string;
52
+ email?: string;
53
53
  }) => void;
54
54
  getMemoUser: (excludeWays?: LoginWay[]) => import("../multipleAccounts/panel").SelectOptions[];
55
55
  getMemoSingleUser: (id: string) => {
@@ -62,7 +62,7 @@ declare function useLoginSelectAccount(setLoginWay: React.Dispatch<any>): {
62
62
  getOriginAccount: () => string;
63
63
  getOriginWay: () => string;
64
64
  } | undefined;
65
- referMultipleState: ((type: "multiple" | "login") => void) | undefined;
65
+ referMultipleState: ((type: "login" | "multiple") => void) | undefined;
66
66
  backfillData: BackFillMultipleState | undefined;
67
67
  defaultQrWay: string | undefined;
68
68
  };
@@ -1,5 +1,5 @@
1
1
  import { ApplicationConfig } from '../../../Type/application';
2
2
  export declare const IdpButton: (props: any) => JSX.Element | null;
3
3
  export declare const MoreIdpButton: (props: {
4
- idps: ApplicationConfig['identityProviders'];
4
+ idps: ApplicationConfig["identityProviders"];
5
5
  }) => JSX.Element;
@@ -14,5 +14,5 @@ interface AwsFaceLivenessDetectorProps {
14
14
  /**
15
15
  * AWS Face Liveness 检测组件
16
16
  */
17
- export declare const AwsFaceLivenessDetector: React.FC<AwsFaceLivenessDetectorProps>;
17
+ export declare const AwsFaceLivenessDetector: ({ sessionId, region, onAnalysisComplete, onError, credentials }: AwsFaceLivenessDetectorProps) => React.JSX.Element;
18
18
  export default AwsFaceLivenessDetector;
@@ -39,6 +39,6 @@ interface WorkQrCodeProps extends Omit<UiQrProps, 'description' | 'status'> {
39
39
  }
40
40
  declare const WorkQrCode: React.ForwardRefExoticComponent<WorkQrCodeProps & React.RefAttributes<any>>;
41
41
  declare const WorkGeneQrCode: React.ForwardRefExoticComponent<WorkQrCodeProps & {
42
- authorizationUrl?: string | undefined;
42
+ authorizationUrl?: string;
43
43
  } & React.RefAttributes<any>>;
44
44
  export { WorkQrCode, WorkGeneQrCode };
@@ -1 +1 @@
1
- export declare const useIsChangeComplete: (currentMode: 'phone' | 'email' | string) => boolean;
1
+ export declare const useIsChangeComplete: (currentMode: "phone" | "email" | string) => boolean;
@@ -19,93 +19,49 @@ export declare const useMergeDefaultConfig: (defaultConfig: GuardLocalConfig, co
19
19
  export declare const useFetchConsoleConfig: (forceUpdate: number, appId?: string, config?: GuardLocalConfig, httpClient?: GuardHttp, setError?: any) => {
20
20
  finallyConfig: {
21
21
  host: string;
22
- isSSO?: boolean | undefined;
23
- defaultScenes?: import("../..").GuardModuleType | undefined;
22
+ isSSO?: boolean;
23
+ defaultScenes?: import("../..").GuardModuleType;
24
24
  defaultInitData?: any;
25
- showLoading?: boolean | undefined;
25
+ showLoading?: boolean;
26
26
  loadingComponent?: React.ReactNode;
27
- openEventsMapping?: boolean | undefined;
28
- autoFocus?: boolean | undefined;
29
- disableRegister?: boolean | undefined;
30
- registerMethods?: string[] | undefined;
31
- defaultRegisterMethod?: string | undefined;
32
- publicKey?: string | undefined;
33
- agreementEnabled?: boolean | undefined;
34
- agreements?: import("../../Type").Agreement[] | undefined;
27
+ openEventsMapping?: boolean;
28
+ autoFocus?: boolean;
29
+ disableRegister?: boolean;
30
+ registerMethods?: string[];
31
+ defaultRegisterMethod?: string;
32
+ publicKey?: string;
33
+ agreementEnabled?: boolean;
34
+ agreements?: import("../../Type").Agreement[];
35
35
  registerContext?: any;
36
- title?: string | undefined;
37
- logo?: string | undefined;
38
- lang?: string | undefined;
39
- langRange?: import("../../Type").Lang[] | undefined;
40
- isHost?: boolean | undefined;
36
+ title?: string;
37
+ logo?: string;
38
+ lang?: string;
39
+ langRange?: import("../../Type").Lang[];
40
+ isHost?: boolean;
41
41
  mode: import("../../Type").GuardMode;
42
42
  clickCloseable: boolean;
43
43
  escCloseable: boolean;
44
- userpool?: string | undefined;
45
- contentCss?: string | undefined;
46
- target?: string | HTMLElement | undefined;
47
- style?: React.CSSProperties | undefined;
48
- __internalRequest__?: boolean | undefined;
49
- __singleComponent__?: boolean | undefined;
50
- __unAuthFlow__?: boolean | undefined;
51
- autoRegister?: boolean | undefined;
52
- disableResetPwd?: boolean | undefined;
53
- defaultLoginMethod?: LoginMethods | undefined;
54
- loginMethods?: LoginMethods[] | undefined;
55
- defaultLoginTab?: LoginMethods | undefined;
56
- loginTabs?: LoginMethods[] | undefined;
57
- passwordLoginMethods?: string[] | undefined;
58
- socialConnections?: import("../../Type").SocialConnectionProvider[] | undefined;
59
- socialConnectionsBtnShape?: "button" | "default" | "icon" | undefined;
60
- enterpriseConnections?: string[] | undefined;
61
- qrCodeScanOptions?: {
62
- extIdpConnId?: string | undefined;
63
- autoExchangeUserInfo?: boolean | undefined;
64
- size?: {
65
- height: number;
66
- width: number;
67
- } | undefined;
68
- containerSize?: {
69
- height: number;
70
- width: number;
71
- } | undefined;
72
- interval?: number | undefined;
73
- onStart?: ((timer: any) => any) | undefined;
74
- onResult?: ((data: import("authing-js-sdk/build/main/lib/authentication/types").QRCodeStatus) => any) | undefined;
75
- onScanned?: ((userInfo: import("authing-js-sdk/build/main/lib/authentication/types").QRCodeUserInfo) => any) | undefined;
76
- onSuccess?: ((userInfo: import("authing-js-sdk/build/main/lib/authentication/types").QRCodeUserInfo, ticket: string) => any) | undefined;
77
- onCancel?: (() => any) | undefined;
78
- onError?: ((message: string) => any) | undefined;
79
- onExpired?: (() => any) | undefined;
80
- onCodeShow?: ((random: string, url: string) => any) | undefined;
81
- onCodeLoaded?: ((random: string, url: string) => any) | undefined;
82
- onCodeLoadFailed?: ((message: string) => any) | undefined;
83
- onCodeDestroyed?: ((random: string) => any) | undefined;
84
- onRetry?: (() => any) | undefined;
85
- onMfa?: ((code: number, message: string, data: Record<string, any>) => {}) | undefined;
86
- tips?: {
87
- title?: string | undefined;
88
- scanned?: string | undefined;
89
- succeed?: string | undefined;
90
- canceled?: string | undefined;
91
- expired?: string | undefined;
92
- retry?: string | undefined;
93
- failed?: string | undefined;
94
- middleTitle?: string | undefined;
95
- referText?: string | undefined;
96
- } | undefined;
97
- onAuthFlow?: ((flow: Record<string, any>) => {}) | undefined;
98
- customData?: {
99
- [x: string]: any;
100
- } | undefined;
101
- context?: {
102
- [x: string]: any;
103
- } | undefined;
104
- withCustomData?: boolean | undefined;
105
- } | undefined;
106
- _closeLoopCheckQrcode?: boolean | undefined;
107
- loginHint?: string | undefined;
108
- goBack?: (() => void) | null | undefined;
44
+ userpool?: string;
45
+ contentCss?: string;
46
+ target?: HTMLElement | string;
47
+ style?: React.CSSProperties;
48
+ __internalRequest__?: boolean;
49
+ __singleComponent__?: boolean;
50
+ __unAuthFlow__?: boolean;
51
+ autoRegister?: boolean;
52
+ disableResetPwd?: boolean;
53
+ defaultLoginMethod?: LoginMethods;
54
+ loginMethods?: LoginMethods[];
55
+ defaultLoginTab?: LoginMethods;
56
+ loginTabs?: LoginMethods[];
57
+ passwordLoginMethods?: string[];
58
+ socialConnections?: import("../../Type").SocialConnectionProvider[];
59
+ socialConnectionsBtnShape?: "default" | "button" | "icon";
60
+ enterpriseConnections?: string[];
61
+ qrCodeScanOptions?: Parameters<import("authing-js-sdk/build/main/lib/authentication/QrCodeAuthenticationClient").QrCodeAuthenticationClient["startScanning"]>[1];
62
+ _closeLoopCheckQrcode?: boolean;
63
+ loginHint?: string;
64
+ goBack?: null | (() => void);
109
65
  };
110
66
  guardPageConfig: GuardPageConfig;
111
67
  } | {
@@ -106,54 +106,19 @@ export declare const useGuardAccountSelectInstance: () => {
106
106
  * when: 多账号页面跳转进入登录页面
107
107
  * 携带的回填数据信息
108
108
  */
109
- multipleAccountData?: BackFillMultipleState | undefined;
109
+ multipleAccountData?: BackFillMultipleState;
110
110
  /**
111
111
  * 多账号 store 实例
112
112
  */
113
- instance?: {
114
- getSocialLoginWays: () => import("../Guard/core/hooks/useMultipleAccounts").User[] | undefined;
115
- initStore: (appId: string, options: {
116
- serverSideLoginMethods: import("../Guard/core/hooks/useMultipleAccounts").LoginWay[];
117
- isInternationSms: boolean;
118
- }) => void;
119
- setLoginWay: (tab: "input" | "qrcode", way: import("../Guard/core/hooks/useMultipleAccounts").LoginWay, id?: string | undefined, internation?: {
120
- phoneCountryCode: string;
121
- areaCode: string;
122
- } | undefined) => void;
123
- setUserInfo: (user: Omit<import("../Guard/core/hooks/useMultipleAccounts").User & {
124
- id: string;
125
- loginAccount?: string | undefined;
126
- usertype?: string | undefined;
127
- }, "tab" | "way" | "phoneCountryCode">) => void;
128
- setLoginWayByHttpData: (account: string, data: {
129
- username?: string | undefined;
130
- phone?: string | undefined;
131
- email?: string | undefined;
132
- }) => void;
133
- setLoginWayByLDAPData: (account: string, data: {
134
- name?: string | undefined;
135
- phone?: string | undefined;
136
- email?: string | undefined;
137
- }) => void;
138
- getMemoUser: (excludeWays?: import("../Guard/core/hooks/useMultipleAccounts").LoginWay[]) => import("../Login/multipleAccounts/panel").SelectOptions[];
139
- getMemoSingleUser: (id: string) => {
140
- way: import("../Guard/core/hooks/useMultipleAccounts").LoginWay;
141
- account: string;
142
- } | undefined;
143
- delUserById: (id: string) => string;
144
- getMemberState: () => boolean;
145
- getFirstBackFillData: () => BackFillMultipleState | undefined;
146
- getOriginAccount: () => string;
147
- getOriginWay: () => string;
148
- } | undefined;
113
+ instance?: StoreInstance;
149
114
  /**
150
115
  * 切换多账号 isMultipleAccount 状态
151
116
  */
152
- referMultipleState?: ((type: 'login' | 'multiple') => void) | undefined;
117
+ referMultipleState?: (type: "login" | "multiple") => void;
153
118
  /**
154
119
  * 清空回填数据
155
120
  */
156
- clearBackFillData?: (() => void) | undefined;
121
+ clearBackFillData?: () => void;
157
122
  };
158
123
  export declare const useGuardPhoneRegex: () => RegExp | null;
159
124
  /**
@@ -165,4 +130,4 @@ export declare const useGuardTenantProvider: () => MultipleTenant | undefined;
165
130
  /** 当前人机验证策略 */
166
131
  export declare const useRobotVerify: () => "always_enable" | "disable" | "condition_set";
167
132
  /** 当前应用是否开启人机验证策略 */
168
- export declare const useCaptchaCheck: (sence: 'login' | 'register' | 'forget-password') => boolean;
133
+ export declare const useCaptchaCheck: (sence: "login" | "register" | "forget-password") => boolean;
@@ -1,14 +1,14 @@
1
1
  import { CodeAction } from './responseManagement/interface';
2
2
  import { AxiosRequestConfig } from 'axios';
3
3
  export declare const requestClient: {
4
- (input: URL | RequestInfo, init?: RequestInit | undefined): Promise<any>;
4
+ (input: string | URL | Request, init?: RequestInit | undefined): Promise<any>;
5
5
  get<T>(path: string, query?: Record<string, any>, init?: AxiosRequestConfig): Promise<AuthingResponse<T>>;
6
- post<T_1>(path: string, data: any, config?: {
6
+ post<T>(path: string, data: any, config?: {
7
7
  headers: any;
8
- }): Promise<AuthingResponse<T_1>>;
9
- postForm<T_2>(path: string, formData: any, config?: {
8
+ }): Promise<AuthingResponse<T>>;
9
+ postForm<T>(path: string, formData: any, config?: {
10
10
  headers: any;
11
- }): Promise<AuthingResponse<T_2>>;
11
+ }): Promise<AuthingResponse<T>>;
12
12
  baseUrl: string;
13
13
  setBaseUrl(base: string): void;
14
14
  langHeader: string;
@@ -76,7 +76,7 @@ export declare const getSortLabels: (methods: string[], i18nConfig: Map<string,
76
76
  export declare const getSortTabs: (tabs: string[], tab?: string) => string[];
77
77
  export declare const isDisabled: (values: Record<string, any>, requireNames?: string[]) => boolean;
78
78
  export declare const isWeComOrigin: (event: MessageEvent) => boolean;
79
- export declare const isDingTalkOrigin: (origin: string) => boolean;
79
+ export declare const isDingTalkOrigin: (origin: string) => origin is "https://login.dingtalk.com";
80
80
  export * from './popupCenter';
81
81
  export * from './clipboard';
82
82
  export * from './locales';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@authing/guard-shim-react",
3
- "version": "4.5.47-bg.21",
3
+ "version": "4.5.47-bg.22",
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",