@authing/react-ui-components 4.0.6-zhihu.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-zhihu.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,8 +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
5
  export interface GuardLocalConfig extends RegisterConfig, LoginConfig {
8
6
  isSSO?: boolean;
9
7
  defaultScenes?: GuardModuleType;
@@ -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
  }
@@ -1,8 +1,8 @@
1
1
  import React from 'react';
2
2
  import './style.less';
3
3
  import { GuardLocalConfig } from '../../Guard';
4
+ import { ApplicationConfig, SocialConnectionItem } from '../../Type/application';
4
5
  import { StoreInstance } from '../../Guard/core/hooks/useMultipleAccounts';
5
- import { ApplicationConfig, SocialConnectionItem } from '../../Type';
6
6
  export interface SocialLoginProps {
7
7
  appId: string;
8
8
  config: GuardLocalConfig;
@@ -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
- WechatworkCorpQrconnect = "wechatwork-corp-qrconnect"
10
+ WechatMpQrcode = "wechatmp-qrcode"
12
11
  }
13
12
  export declare enum OIDCConnectionMode {
14
13
  FRONT_CHANNEL = "FRONT_CHANNEL",
@@ -107,12 +106,6 @@ export declare type QrcodeTabsSettings = Record<LoginMethods, Array<{
107
106
  id: string;
108
107
  title: string;
109
108
  isDefault?: boolean;
110
- QRConfig?: {
111
- corpId: string;
112
- agentId: string;
113
- redirectUrl: string;
114
- identifier: string;
115
- };
116
109
  }>>;
117
110
  export interface OidcClientMetadata {
118
111
  grant_types: string[];
@@ -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
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
- disableRegister?: boolean | undefined;
18
- registerMethods?: RegisterMethods[] | undefined;
19
- defaultRegisterMethod?: RegisterMethods | undefined;
20
- publicKey?: string | undefined;
21
- agreementEnabled?: boolean | undefined;
22
- agreements?: import("../../Type").Agreement[] | undefined;
23
- registerContext?: any;
24
- title?: string | undefined;
25
- logo?: string | undefined;
26
- lang?: string | undefined;
27
- langRange?: string[] | undefined;
28
- isHost?: boolean | undefined;
29
- mode: import("../../Type").GuardMode;
30
- clickCloseable: boolean;
31
- escCloseable: boolean;
32
- userpool?: string | undefined;
33
- contentCss?: string | undefined;
34
- target?: string | HTMLElement | undefined;
35
- __internalRequest__?: boolean | undefined;
36
- __singleComponent__?: boolean | undefined;
37
- __unAuthFlow__?: boolean | undefined;
38
- autoRegister?: boolean | undefined;
39
- disableResetPwd?: boolean | undefined;
40
- defaultLoginMethod?: import("../../Type").LoginMethods | undefined;
41
- loginMethods?: import("../../Type").LoginMethods[] | undefined;
42
- passwordLoginMethods?: import("../../Type").PasswordLoginMethods[] | undefined;
43
- socialConnections?: import("authing-js-sdk").SocialConnectionProvider[] | undefined;
44
- socialConnectionsBtnShape?: "default" | "button" | "icon" | undefined;
45
- enterpriseConnections?: string[] | undefined;
46
- qrCodeScanOptions?: {
47
- extIdpConnId?: string | undefined;
48
- autoExchangeUserInfo?: boolean | undefined;
49
- size?: {
50
- height: number;
51
- width: number;
52
- } | undefined;
53
- containerSize?: {
54
- height: number;
55
- width: number;
56
- } | undefined;
57
- interval?: number | undefined;
58
- onStart?: ((timer: any) => any) | undefined;
59
- onResult?: ((data: import("authing-js-sdk").QRCodeStatus) => any) | undefined;
60
- onScanned?: ((userInfo: import("authing-js-sdk").QRCodeUserInfo) => any) | undefined;
61
- onSuccess?: ((userInfo: import("authing-js-sdk").QRCodeUserInfo, ticket: string) => any) | undefined;
62
- onCancel?: (() => any) | undefined;
63
- onError?: ((message: string) => any) | undefined;
64
- onExpired?: (() => any) | undefined;
65
- onCodeShow?: ((random: string, url: string) => any) | undefined;
66
- onCodeLoaded?: ((random: string, url: string) => any) | undefined;
67
- onCodeLoadFailed?: ((message: string) => any) | undefined;
68
- onCodeDestroyed?: ((random: string) => any) | undefined;
69
- onRetry?: (() => any) | undefined;
70
- onMfa?: ((code: number, message: string, data: Record<string, any>) => {}) | undefined;
71
- tips?: {
72
- title?: string | undefined;
73
- scanned?: string | undefined;
74
- succeed?: string | undefined;
75
- canceled?: string | undefined;
76
- expired?: string | undefined;
77
- retry?: string | undefined;
78
- failed?: string | undefined;
79
- middleTitle?: string | undefined;
80
- referText?: string | undefined;
81
- } | undefined;
82
- onAuthFlow?: ((flow: Record<string, any>) => {}) | undefined;
83
- customData?: {
84
- [x: string]: any;
85
- } | undefined;
86
- context?: {
87
- [x: string]: any;
88
- } | undefined;
89
- withCustomData?: boolean | undefined;
90
- } | undefined;
91
- _closeLoopCheckQrcode?: boolean | 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
+ };
@@ -90,5 +90,3 @@ export declare const getLoginTypePipe: (publicConfig: ApplicationConfig, registe
90
90
  } | undefined;
91
91
  export declare const getPasswordIdentify: (identity: string) => string;
92
92
  export declare const getCurrentLng: () => Lang;
93
- export declare const isDingTalkOrigin: (origin: string) => boolean;
94
- export declare const isWeComOrigin: (event: MessageEvent) => boolean;
@@ -1,2 +1,2 @@
1
- declare const _default: "4.0.6-zhihu.0";
1
+ declare const _default: "4.0.6";
2
2
  export default _default;