@authing/react-ui-components 4.0.6-ynby.0 → 4.0.6

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/react-ui-components",
3
- "version": "4.0.6-ynby.0",
3
+ "version": "4.0.6",
4
4
  "private": false,
5
5
  "main": "lib/index.min.js",
6
6
  "typings": "types/index.d.ts",
@@ -0,0 +1,5 @@
1
+ import React from 'react';
2
+ import { UserRadioItemProps, UserRadioProps } from './interface';
3
+ import './styles.less';
4
+ export declare const UserRadioItem: React.FC<UserRadioItemProps>;
5
+ export declare const UserRadio: React.FC<UserRadioProps>;
@@ -0,0 +1,3 @@
1
+ import React from 'react';
2
+ import './styles.less';
3
+ export declare const GuardAccountMergeView: React.FC;
@@ -0,0 +1,27 @@
1
+ export interface BriefUserInfo {
2
+ displayName: string;
3
+ avatar: string;
4
+ phone: string;
5
+ email: string;
6
+ username: string;
7
+ name: string;
8
+ }
9
+ export interface GuardAccountMergeInitData {
10
+ currentUserInfo: BriefUserInfo;
11
+ existingUserInfo: BriefUserInfo;
12
+ mergeToken?: string;
13
+ }
14
+ export interface UserRadioProps {
15
+ currentUserInfo: BriefUserInfo;
16
+ existingUserInfo: BriefUserInfo;
17
+ onChange?: (value: any) => void;
18
+ value?: any;
19
+ }
20
+ export interface UserRadioItemProps extends BriefUserInfo {
21
+ value: boolean;
22
+ selected: boolean;
23
+ onClick: (value: boolean) => void;
24
+ }
25
+ export declare enum AuthFlowAction {
26
+ MERGE = "confirm-account-merge"
27
+ }
@@ -0,0 +1,3 @@
1
+ import { User } from 'authing-js-sdk';
2
+ export declare const getDisplayName: (user: User) => string;
3
+ export declare const getDisplayNameByEmail: (displayName: string) => string;
@@ -0,0 +1,11 @@
1
+ import React from 'react';
2
+ export declare type OptionType = {
3
+ id: string;
4
+ name: string;
5
+ children: OptionType[];
6
+ };
7
+ interface TreeSelectProps {
8
+ options: OptionType[];
9
+ }
10
+ declare const TreeSelect: React.FC<TreeSelectProps>;
11
+ export default TreeSelect;
@@ -5,11 +5,11 @@ export interface CompleteInfoConfig extends IG2Config {
5
5
  export declare const getDefaultCompleteInfoConfig: () => CompleteInfoConfig;
6
6
  export interface CompleteInfoEvents extends IG2Events {
7
7
  onRegisterInfoCompleted?: (user: User, udfs: {
8
- definition: any;
8
+ key: any;
9
9
  value: any;
10
10
  }[], authClient: AuthenticationClient) => void;
11
11
  onRegisterInfoCompletedError?: (error: CommonMessage, udfs: {
12
- definition: any;
12
+ key: any;
13
13
  value: any;
14
14
  }[], authClient: AuthenticationClient) => void;
15
15
  }
@@ -6,8 +6,6 @@ export declare enum InputMethodMap {
6
6
  interface ResetPasswordProps {
7
7
  onReset: any;
8
8
  publicConfig: any;
9
- onSend: (type: 'email' | 'phone') => void;
10
- onSendError: (type: 'email' | 'phone', error: any) => void;
11
9
  }
12
10
  export declare const ResetPassword: (props: ResetPasswordProps) => JSX.Element;
13
11
  export {};
@@ -1,10 +1,10 @@
1
- import { AuthenticationClient, CommonMessage } from 'authing-js-sdk';
2
- import { IG2Config, IG2Events, IG2FCProps, IG2FCViewProps } from '../Type';
1
+ import { AuthenticationClient, CommonMessage, SceneType } from 'authing-js-sdk';
2
+ import { EmailScene, IG2Config, IG2Events, IG2FCProps, IG2FCViewProps } from '../Type';
3
3
  export interface ForgetPasswordEvents extends IG2Events {
4
- onPwdEmailSend?: (authClient: AuthenticationClient) => void;
5
- onPwdEmailSendError?: (error: CommonMessage, authClient: AuthenticationClient) => void;
6
- onPwdPhoneSend?: (authClient: AuthenticationClient) => void;
7
- onPwdPhoneSendError?: (error: CommonMessage, authClient: AuthenticationClient) => void;
4
+ onEmailSend?: (authClient: AuthenticationClient, sence?: EmailScene) => void;
5
+ onEmailSendError?: (error: CommonMessage, authClient: AuthenticationClient, sence?: EmailScene) => void;
6
+ onPhoneSend?: (authClient: AuthenticationClient, sence?: SceneType) => void;
7
+ onPhoneSendError?: (error: CommonMessage, authClient: AuthenticationClient, sence?: SceneType) => void;
8
8
  onPwdReset?: (authClient: AuthenticationClient) => void;
9
9
  onPwdResetError?: (error: CommonMessage, authClient: AuthenticationClient) => void;
10
10
  }
@@ -29,7 +29,7 @@ export declare class GuardStateMachine {
29
29
  end: () => void;
30
30
  historyPush: (data: ModuleState, actionType?: ActionType) => void;
31
31
  historyBack: (data: ModuleState) => void;
32
- setConfig: (config: GuardLocalConfig) => void;
32
+ setConfig: (config: Partial<GuardLocalConfig>) => void;
33
33
  isUseHistoryHijack: () => boolean;
34
34
  onPopstate: () => void;
35
35
  }
@@ -2,16 +2,6 @@ import { ReactNode } from 'react';
2
2
  import { GuardModuleType } from '.';
3
3
  import { LoginConfig } from '../Login/interface';
4
4
  import { RegisterConfig } from '../Register/interface';
5
- export interface GuardComponentConfig extends Partial<GuardLocalConfig> {
6
- }
7
- export declare enum QrCodeScanType {
8
- appQrcode = "appQrcode",
9
- wechatMiniQrcode = "wechatMiniQrcode",
10
- wechatmpQrcode = "wechatmpQrcode"
11
- }
12
- export interface QrCodeScanOptions {
13
- qrcode: string;
14
- }
15
5
  export interface GuardLocalConfig extends RegisterConfig, LoginConfig {
16
6
  isSSO?: boolean;
17
7
  defaultScenes?: GuardModuleType;
@@ -22,6 +12,5 @@ export interface GuardLocalConfig extends RegisterConfig, LoginConfig {
22
12
  * @description 是否调用 eventsMapping 中的事件
23
13
  */
24
14
  openEventsMapping?: boolean;
25
- _qrCodeScanOptions?: Record<QrCodeScanType, QrCodeScanOptions>;
26
15
  }
27
16
  export declare const getDefaultGuardLocalConfig: () => GuardLocalConfig;
@@ -51,10 +51,10 @@ export declare const GuardEventsCamelToKebabMapping: {
51
51
  readonly onRegister: "register";
52
52
  readonly onBeforeRegister: "before-register";
53
53
  readonly onRegisterError: "register-error";
54
- readonly onPwdEmailSend: "pwd-email-send";
55
- readonly onPwdEmailSendError: "pwd-email-send-error";
56
- readonly onPwdPhoneSend: "pwd-phone-send";
57
- readonly onPwdPhoneSendError: "pwd-phone-send-error";
54
+ readonly onEmailSend: "email-send";
55
+ readonly onEmailSendError: "email-send-error";
56
+ readonly onPhoneSend: "phone-send";
57
+ readonly onPhoneSendError: "phone-send-error";
58
58
  readonly onPwdReset: "pwd-reset";
59
59
  readonly onPwdResetError: "pwd-reset-error";
60
60
  readonly onClose: "close";
@@ -63,6 +63,7 @@ export declare const GuardEventsCamelToKebabMapping: {
63
63
  readonly onRegisterInfoCompleted: "register-info-completed";
64
64
  readonly onRegisterInfoCompletedError: "register-info-completed-error";
65
65
  readonly onLangChange: "lang-change";
66
+ readonly onBeforeChangeModule: "before-change-module";
66
67
  };
67
68
  export interface GuardEventsKebabToCamelType {
68
69
  load: GuardEvents['onLoad'];
@@ -73,10 +74,10 @@ export interface GuardEventsKebabToCamelType {
73
74
  'before-register': GuardEvents['onBeforeRegister'];
74
75
  register: GuardEvents['onRegister'];
75
76
  'register-error': GuardEvents['onRegisterError'];
76
- 'pwd-email-send': GuardEvents['onPwdEmailSend'];
77
- 'pwd-email-send-error': GuardEvents['onPwdEmailSendError'];
78
- 'pwd-phone-send': GuardEvents['onPwdPhoneSend'];
79
- 'pwd-phone-send-error': GuardEvents['onPwdPhoneSendError'];
77
+ 'email-send': GuardEvents['onEmailSend'];
78
+ 'email-send-error': GuardEvents['onEmailSendError'];
79
+ 'phone-send': GuardEvents['onPhoneSend'];
80
+ 'phone-send-error': GuardEvents['onPhoneSendError'];
80
81
  'pwd-reset': GuardEvents['onPwdReset'];
81
82
  'pwd-reset-error': GuardEvents['onPwdResetError'];
82
83
  close: GuardEvents['onClose'];
@@ -85,4 +86,5 @@ export interface GuardEventsKebabToCamelType {
85
86
  'register-info-completed': GuardEvents['onRegisterInfoCompleted'];
86
87
  'register-info-completed-error': GuardEvents['onRegisterInfoCompletedError'];
87
88
  'lang-change': GuardEvents['onLangChange'];
89
+ 'before-change-module': GuardEvents['onBeforeChangeModule'];
88
90
  }
@@ -0,0 +1,2 @@
1
+ /// <reference types="react" />
2
+ export declare const LoginWithWeComQrcode: (props: any) => JSX.Element;
@@ -16,6 +16,10 @@ export interface LoginConfig extends IG2Config {
16
16
  publicKey?: string;
17
17
  agreementEnabled?: boolean;
18
18
  agreements?: Agreement[];
19
+ /**
20
+ * 关闭二维码状态check轮询(console上使用)
21
+ */
22
+ _closeLoopCheckQrcode?: boolean;
19
23
  }
20
24
  export interface LoginEvents extends IG2Events {
21
25
  onLogin?: (user: User, authClient: AuthenticationClient) => void;
@@ -15,7 +15,7 @@ interface WorkQrCodeProps extends Omit<UiQrProps, 'description' | 'status'> {
15
15
  /**
16
16
  * 二维码场景
17
17
  */
18
- scene: 'WXAPP_AUTH' | 'APP_AUTH' | 'WECHATMP_AUTH' | 'LANDRAY_AUTH';
18
+ scene: 'WXAPP_AUTH' | 'APP_AUTH' | 'WECHATMP_AUTH';
19
19
  /**
20
20
  * 不同状态请求文字
21
21
  */
@@ -53,6 +53,9 @@ interface QrCodeOptions {
53
53
  payload: Partial<RootState>;
54
54
  }>;
55
55
  descriptions: CodeStatusDescriptions;
56
+ /**
57
+ * check 轮询间隔时间
58
+ */
56
59
  sleepTime?: number;
57
60
  /**
58
61
  * 状态改变时触发事件,仅在 Server 返回的二维码状态改变时进行触发
@@ -7,8 +7,7 @@ export declare enum LoginMethods {
7
7
  PhoneCode = "phone-code",
8
8
  WxMinQr = "wechat-miniprogram-qrcode",
9
9
  AD = "ad",
10
- WechatMpQrcode = "wechatmp-qrcode",
11
- Landray = "landray"
10
+ WechatMpQrcode = "wechatmp-qrcode"
12
11
  }
13
12
  export declare enum OIDCConnectionMode {
14
13
  FRONT_CHANNEL = "FRONT_CHANNEL",
@@ -48,7 +48,7 @@ export interface IG2Config {
48
48
  }
49
49
  export interface IG2Events {
50
50
  onLoad?: (authClient: AuthenticationClient) => void;
51
- onLoadError?: (error: CommonMessage) => void;
51
+ onLoadError?: (error: any) => void;
52
52
  onClose?: () => void;
53
53
  onLangChange?: (lang: Lang) => void;
54
54
  __changeModule?: (moduleName: GuardModuleType, initData?: any) => void;
@@ -1,96 +1,108 @@
1
1
  /// <reference types="react" />
2
- import { GuardComponentConfig, GuardLocalConfig } from '../../Guard/config';
2
+ import { GuardLocalConfig } from '../../Guard/config';
3
3
  import { GuardHttp } from '../guardHttp';
4
4
  import { GuardPageConfig } from '../../Type';
5
- import { ApplicationConfig, LoginMethods, RegisterMethods } from '../../Type/application';
5
+ import { ApplicationConfig, RegisterMethods } from '../../Type/application';
6
6
  export declare const getPublicConfig: (appId: string) => ApplicationConfig;
7
7
  export declare const setPublicConfig: (appId: string, config: ApplicationConfig) => ApplicationConfig;
8
- export declare const useMergeDefaultConfig: (defaultConfig: GuardLocalConfig, config?: GuardComponentConfig | undefined) => GuardLocalConfig | undefined;
9
- export declare const useMergePublicConfig: (forceUpdate: number, appId?: string | undefined, config?: GuardLocalConfig | undefined, httpClient?: GuardHttp | undefined, setError?: any) => {
10
- host: string;
11
- isSSO?: boolean | undefined;
12
- defaultScenes?: import("../..").GuardModuleType | undefined;
13
- defaultInitData?: any;
14
- showLoading?: boolean | undefined;
15
- loadingComponent?: import("react").ReactNode;
16
- openEventsMapping?: boolean | undefined;
17
- _qrCodeScanOptions?: Record<import("../../Guard/config").QrCodeScanType, import("../../Guard/config").QrCodeScanOptions> | undefined;
18
- disableRegister?: boolean | undefined;
19
- registerMethods?: RegisterMethods[] | undefined;
20
- defaultRegisterMethod?: RegisterMethods | undefined;
21
- publicKey?: string | undefined;
22
- agreementEnabled?: boolean | undefined;
23
- agreements?: import("../../Type").Agreement[] | undefined;
24
- registerContext?: any;
25
- title?: string | undefined;
26
- logo?: string | undefined;
27
- lang?: string | undefined;
28
- langRange?: string[] | undefined;
29
- isHost?: boolean | undefined;
30
- mode: import("../../Type").GuardMode;
31
- clickCloseable: boolean;
32
- escCloseable: boolean;
33
- userpool?: string | undefined;
34
- contentCss?: string | undefined;
35
- target?: string | HTMLElement | undefined;
36
- __internalRequest__?: boolean | undefined;
37
- __singleComponent__?: boolean | undefined;
38
- __unAuthFlow__?: boolean | undefined;
39
- autoRegister?: boolean | undefined;
40
- disableResetPwd?: boolean | undefined;
41
- defaultLoginMethod?: LoginMethods | undefined;
42
- loginMethods?: LoginMethods[] | undefined;
43
- passwordLoginMethods?: import("../../Type").PasswordLoginMethods[] | undefined;
44
- socialConnections?: import("authing-js-sdk").SocialConnectionProvider[] | undefined;
45
- socialConnectionsBtnShape?: "default" | "button" | "icon" | undefined;
46
- enterpriseConnections?: string[] | undefined;
47
- qrCodeScanOptions?: {
48
- extIdpConnId?: string | undefined;
49
- autoExchangeUserInfo?: boolean | undefined;
50
- size?: {
51
- height: number;
52
- width: number;
53
- } | undefined;
54
- containerSize?: {
55
- height: number;
56
- width: number;
57
- } | undefined;
58
- interval?: number | undefined;
59
- onStart?: ((timer: any) => any) | undefined;
60
- onResult?: ((data: import("authing-js-sdk").QRCodeStatus) => any) | undefined;
61
- onScanned?: ((userInfo: import("authing-js-sdk").QRCodeUserInfo) => any) | undefined;
62
- onSuccess?: ((userInfo: import("authing-js-sdk").QRCodeUserInfo, ticket: string) => any) | undefined;
63
- onCancel?: (() => any) | undefined;
64
- onError?: ((message: string) => any) | undefined;
65
- onExpired?: (() => any) | undefined;
66
- onCodeShow?: ((random: string, url: string) => any) | undefined;
67
- onCodeLoaded?: ((random: string, url: string) => any) | undefined;
68
- onCodeLoadFailed?: ((message: string) => any) | undefined;
69
- onCodeDestroyed?: ((random: string) => any) | undefined;
70
- onRetry?: (() => any) | undefined;
71
- onMfa?: ((code: number, message: string, data: Record<string, any>) => {}) | undefined;
72
- tips?: {
73
- title?: string | undefined;
74
- scanned?: string | undefined;
75
- succeed?: string | undefined;
76
- canceled?: string | undefined;
77
- expired?: string | undefined;
78
- retry?: string | undefined;
79
- failed?: string | undefined;
80
- middleTitle?: string | undefined;
81
- referText?: string | undefined;
82
- } | undefined;
83
- onAuthFlow?: ((flow: Record<string, any>) => {}) | undefined;
84
- customData?: {
85
- [x: string]: any;
86
- } | undefined;
87
- context?: {
88
- [x: string]: any;
89
- } | undefined;
90
- withCustomData?: boolean | undefined;
91
- } | undefined;
92
- } | undefined;
93
8
  export declare const getPageConfig: (appId: string) => GuardPageConfig;
94
9
  export declare const setPageConfig: (appId: string, config: GuardPageConfig) => GuardPageConfig;
95
- export declare const requestGuardPageConfig: (appId: string, httpClient: GuardHttp) => Promise<GuardPageConfig>;
96
- export declare const useGuardPageConfig: (forceUpdate: number, appId?: string | undefined, httpClient?: GuardHttp | undefined, serError?: any) => GuardPageConfig | undefined;
10
+ export declare const useMergeDefaultConfig: (defaultConfig: GuardLocalConfig, config?: Partial<GuardLocalConfig> | undefined) => GuardLocalConfig | undefined;
11
+ /**
12
+ * 请求服务console关于guard的配置
13
+ * @param forceUpdate
14
+ * @param appId
15
+ * @param config
16
+ * @param httpClient
17
+ * @param setError
18
+ */
19
+ export declare const useFetchConsoleConfig: (forceUpdate: number, appId?: string | undefined, config?: GuardLocalConfig | undefined, httpClient?: GuardHttp | undefined, setError?: any) => {
20
+ finallyConfig: {
21
+ host: string;
22
+ isSSO?: boolean | undefined;
23
+ defaultScenes?: import("../..").GuardModuleType | undefined;
24
+ defaultInitData?: any;
25
+ showLoading?: boolean | undefined;
26
+ loadingComponent?: import("react").ReactNode;
27
+ openEventsMapping?: boolean | undefined;
28
+ disableRegister?: boolean | undefined;
29
+ registerMethods?: RegisterMethods[] | undefined;
30
+ defaultRegisterMethod?: RegisterMethods | undefined;
31
+ publicKey?: string | undefined;
32
+ agreementEnabled?: boolean | undefined;
33
+ agreements?: import("../../Type").Agreement[] | undefined;
34
+ registerContext?: any;
35
+ title?: string | undefined;
36
+ logo?: string | undefined;
37
+ lang?: string | undefined;
38
+ langRange?: string[] | undefined;
39
+ isHost?: boolean | undefined;
40
+ mode: import("../../Type").GuardMode;
41
+ clickCloseable: boolean;
42
+ escCloseable: boolean;
43
+ userpool?: string | undefined;
44
+ contentCss?: string | undefined;
45
+ target?: string | HTMLElement | undefined;
46
+ __internalRequest__?: boolean | undefined;
47
+ __singleComponent__?: boolean | undefined;
48
+ __unAuthFlow__?: boolean | undefined;
49
+ autoRegister?: boolean | undefined;
50
+ disableResetPwd?: boolean | undefined;
51
+ defaultLoginMethod?: import("../../Type").LoginMethods | undefined;
52
+ loginMethods?: import("../../Type").LoginMethods[] | undefined;
53
+ passwordLoginMethods?: import("../../Type").PasswordLoginMethods[] | undefined;
54
+ socialConnections?: import("authing-js-sdk").SocialConnectionProvider[] | undefined;
55
+ socialConnectionsBtnShape?: "default" | "button" | "icon" | undefined;
56
+ enterpriseConnections?: string[] | undefined;
57
+ qrCodeScanOptions?: {
58
+ extIdpConnId?: string | undefined;
59
+ autoExchangeUserInfo?: boolean | undefined;
60
+ size?: {
61
+ height: number;
62
+ width: number;
63
+ } | undefined;
64
+ containerSize?: {
65
+ height: number;
66
+ width: number;
67
+ } | undefined;
68
+ interval?: number | undefined;
69
+ onStart?: ((timer: any) => any) | undefined;
70
+ onResult?: ((data: import("authing-js-sdk").QRCodeStatus) => any) | undefined;
71
+ onScanned?: ((userInfo: import("authing-js-sdk").QRCodeUserInfo) => any) | undefined;
72
+ onSuccess?: ((userInfo: import("authing-js-sdk").QRCodeUserInfo, ticket: string) => any) | undefined;
73
+ onCancel?: (() => any) | undefined;
74
+ onError?: ((message: string) => any) | undefined;
75
+ onExpired?: (() => any) | undefined;
76
+ onCodeShow?: ((random: string, url: string) => any) | undefined;
77
+ onCodeLoaded?: ((random: string, url: string) => any) | undefined;
78
+ onCodeLoadFailed?: ((message: string) => any) | undefined;
79
+ onCodeDestroyed?: ((random: string) => any) | undefined;
80
+ onRetry?: (() => any) | undefined;
81
+ onMfa?: ((code: number, message: string, data: Record<string, any>) => {}) | undefined;
82
+ tips?: {
83
+ title?: string | undefined;
84
+ scanned?: string | undefined;
85
+ succeed?: string | undefined;
86
+ canceled?: string | undefined;
87
+ expired?: string | undefined;
88
+ retry?: string | undefined;
89
+ failed?: string | undefined;
90
+ middleTitle?: string | undefined;
91
+ referText?: string | undefined;
92
+ } | undefined;
93
+ onAuthFlow?: ((flow: Record<string, any>) => {}) | undefined;
94
+ customData?: {
95
+ [x: string]: any;
96
+ } | undefined;
97
+ context?: {
98
+ [x: string]: any;
99
+ } | undefined;
100
+ withCustomData?: boolean | undefined;
101
+ } | undefined;
102
+ _closeLoopCheckQrcode?: boolean | undefined;
103
+ };
104
+ guardPageConfig: GuardPageConfig;
105
+ } | {
106
+ finallyConfig: undefined;
107
+ guardPageConfig: undefined;
108
+ };
@@ -1,2 +1,2 @@
1
- declare const _default: "4.0.6-ynby.0";
1
+ declare const _default: "4.0.6";
2
2
  export default _default;