@authing/react-ui-components 4.4.3-gf.0 → 4.4.3-wecom.0

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 (41) hide show
  1. package/package.json +4 -3
  2. package/types/CompleteInfo/core/completeInfo.d.ts +8 -0
  3. package/types/CompleteInfo/interface.d.ts +4 -0
  4. package/types/CompleteInfo/utils.d.ts +13 -0
  5. package/types/EY/CheckCaptcha/index.d.ts +2 -0
  6. package/types/EY/Error/index.d.ts +2 -0
  7. package/types/EY/ForgetPassword/index.d.ts +2 -0
  8. package/types/EY/InviteComplete/index.d.ts +2 -0
  9. package/types/EY/InviteIdentityBind/component/WeComQrcode.d.ts +2 -0
  10. package/types/EY/InviteIdentityBind/index.d.ts +2 -0
  11. package/types/EY/InviteLoading/index.d.ts +2 -0
  12. package/types/EY/Login/components/EyLoginWithWeComQrcode.d.ts +2 -0
  13. package/types/EY/Login/core/EmailVerify.d.ts +7 -0
  14. package/types/EY/Login/core/ScanCode.d.ts +7 -0
  15. package/types/EY/Login/index.d.ts +7 -0
  16. package/types/EY/PreCheckEmail/index.d.ts +2 -0
  17. package/types/EY/Protocol/index.d.ts +2 -0
  18. package/types/EY/components/EmailFormItem.d.ts +2 -0
  19. package/types/EY/components/GoBack.d.ts +2 -0
  20. package/types/EY/components/ResetPassword.d.ts +16 -0
  21. package/types/EY/interface.d.ts +74 -0
  22. package/types/ForgetPassword/core/resetPassword.d.ts +3 -0
  23. package/types/Guard/config.d.ts +1 -0
  24. package/types/Guard/module.d.ts +29 -1
  25. package/types/Login/core/withVerifyCode/index.d.ts +4 -0
  26. package/types/Login/core/withWeComQrcode.d.ts +2 -0
  27. package/types/Login/index.d.ts +4 -0
  28. package/types/MFA/VerifyCodeInput/ey.d.ts +15 -0
  29. package/types/MFA/VerifyCodeInput/index.d.ts +1 -0
  30. package/types/SendCode/SendCodeBtn.d.ts +2 -2
  31. package/types/Type/application.d.ts +13 -1
  32. package/types/Type/index.d.ts +1 -1
  33. package/types/_utils/config/index.d.ts +1 -0
  34. package/types/_utils/http.d.ts +1 -1
  35. package/types/_utils/index.d.ts +2 -1
  36. package/types/_utils/responseManagement/interface.d.ts +13 -1
  37. package/types/version/version.d.ts +1 -1
  38. package/lib/index.min.css +0 -2
  39. package/lib/index.min.js +0 -2
  40. package/lib/index.min.js.LICENSE.txt +0 -59
  41. package/lib/static/media/loading.3cf0104f.svg +0 -32
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@authing/react-ui-components",
3
- "version": "4.4.3-gf.0",
3
+ "version": "4.4.3-wecom.0",
4
4
  "private": false,
5
5
  "main": "lib/index.min.js",
6
6
  "typings": "types/index.d.ts",
@@ -10,6 +10,7 @@
10
10
  "types"
11
11
  ],
12
12
  "dependencies": {
13
+ "@wecom/jssdk": "^1.4.3",
13
14
  "antd": "^4.8.0",
14
15
  "authing-js-sdk": "4.23.48",
15
16
  "classnames": "^2.3.1",
@@ -42,7 +43,7 @@
42
43
  "prebuild:lib": "yarn log-tag && yarn generate-version && yarn generate-examples",
43
44
  "prepare": "cd ../.. && husky install packages/react-components/.husky",
44
45
  "pub": "yarn build:lib && node ./scripts/publish.js",
45
- "start": "cross-env PORT=1221 node ./scripts/start.js",
46
+ "start": "cross-env PORT=443 node ./scripts/start.js",
46
47
  "vite": "vite",
47
48
  "generate-version": "node ./scripts/generate-version",
48
49
  "generate-examples": "node ./scripts/generate-examples.js",
@@ -237,4 +238,4 @@
237
238
  "webpack-manifest-plugin": "2.2.0",
238
239
  "workbox-webpack-plugin": "5.1.4"
239
240
  }
240
- }
241
+ }
@@ -1,8 +1,16 @@
1
1
  import React from 'react';
2
2
  import { CompleteInfoMetaData, CompleteInfoRequest } from '../interface';
3
+ import { Lang } from '../../Type';
3
4
  export interface CompleteInfoProps {
4
5
  metaData: CompleteInfoMetaData[];
5
6
  businessRequest: (data: CompleteInfoRequest) => Promise<void>;
7
+ submitText?: string;
8
+ extendsFieldsI18n?: {
9
+ [key: string]: Record<Lang, {
10
+ enabled: boolean;
11
+ value: string;
12
+ }>;
13
+ };
6
14
  }
7
15
  export interface FieldMetadata {
8
16
  key: string;
@@ -93,6 +93,10 @@ export interface CompleteInfoRequest {
93
93
  name: string;
94
94
  value: string;
95
95
  code?: string;
96
+ /**
97
+ * 国际手机区号
98
+ */
99
+ phoneCountryCode?: string;
96
100
  }[];
97
101
  }
98
102
  export declare enum OmitCompleteInfo {
@@ -9,10 +9,23 @@ export declare const extendsFieldsToMetaData: (extendsFields: import("../Type/ap
9
9
  label: string;
10
10
  }[];
11
11
  }[]) => CompleteInfoMetaData[];
12
+ export declare const eyFieldValuesToRegisterProfile: (extendsFields: ApplicationConfig['extendsFields'], fieldValues?: {
13
+ name: string;
14
+ value: string;
15
+ code?: string | undefined;
16
+ phoneCountryCode?: string | undefined;
17
+ }[] | undefined) => {
18
+ registerProfile: Record<string, any>;
19
+ udf: {
20
+ key: string;
21
+ value: string;
22
+ }[];
23
+ };
12
24
  export declare const fieldValuesToRegisterProfile: (extendsFields: ApplicationConfig['extendsFields'], fieldValues?: {
13
25
  name: string;
14
26
  value: string;
15
27
  code?: string | undefined;
28
+ phoneCountryCode?: string | undefined;
16
29
  }[] | undefined) => {
17
30
  registerProfile: Record<string, any>;
18
31
  udf: {
@@ -0,0 +1,2 @@
1
+ /// <reference types="react" />
2
+ export declare const EyGuardCheckCaptchaView: () => JSX.Element;
@@ -0,0 +1,2 @@
1
+ /// <reference types="react" />
2
+ export declare const EyGuardInviteExpireView: () => JSX.Element;
@@ -0,0 +1,2 @@
1
+ import React from 'react';
2
+ export declare const EyGuardForgetPassword: React.FC;
@@ -0,0 +1,2 @@
1
+ /// <reference types="react" />
2
+ export declare const EyGuardInviteCompleteView: () => JSX.Element;
@@ -0,0 +1,2 @@
1
+ /// <reference types="react" />
2
+ export declare const WeComQrcode: (props: any) => JSX.Element;
@@ -0,0 +1,2 @@
1
+ /// <reference types="react" />
2
+ export declare const EyGuardIviteIdentityBindView: () => JSX.Element;
@@ -0,0 +1,2 @@
1
+ /// <reference types="react" />
2
+ export declare const EyGuardInviteLoadingView: () => JSX.Element;
@@ -0,0 +1,2 @@
1
+ /// <reference types="react" />
2
+ export declare const EyLoginWithWeComQrcode: (props: any) => JSX.Element;
@@ -0,0 +1,7 @@
1
+ import React from 'react';
2
+ import { EyLoginProps } from '../../interface';
3
+ interface EmailVerifySceneProps extends EyLoginProps {
4
+ scene: 'password' | 'verifyCode';
5
+ }
6
+ export declare const EmailVerifyScene: React.FC<EmailVerifySceneProps>;
7
+ export {};
@@ -0,0 +1,7 @@
1
+ import React from 'react';
2
+ import { EyLoginProps } from '../../interface';
3
+ interface ScanCodeSceneProps extends EyLoginProps {
4
+ refreshQrcode: number;
5
+ }
6
+ export declare const ScanCodeScene: React.FC<ScanCodeSceneProps>;
7
+ export {};
@@ -0,0 +1,7 @@
1
+ /// <reference types="react" />
2
+ export interface GuardLoginInitData {
3
+ scene: 'password' | 'qrcode' | 'verifyCode';
4
+ noBack: boolean;
5
+ verifyAccount?: string;
6
+ }
7
+ export declare const EyGuardLoginView: () => JSX.Element;
@@ -0,0 +1,2 @@
1
+ /// <reference types="react" />
2
+ export declare const EyGuardPreCheckEmailView: () => JSX.Element;
@@ -0,0 +1,2 @@
1
+ /// <reference types="react" />
2
+ export declare const EyGuardProtocolView: () => JSX.Element;
@@ -0,0 +1,2 @@
1
+ /// <reference types="react" />
2
+ export declare const EmailFormItem: (props: any) => JSX.Element;
@@ -0,0 +1,2 @@
1
+ /// <reference types="react" />
2
+ export declare const GoBack: (props: any) => JSX.Element;
@@ -0,0 +1,16 @@
1
+ import React from 'react';
2
+ export declare enum InputMethodMap {
3
+ email = "email-code",
4
+ phone = "phone-code"
5
+ }
6
+ interface ResetPasswordProps {
7
+ publicConfig: any;
8
+ setControlShow: any;
9
+ setPolicyStrength: any;
10
+ setCustomPasswordStrength: any;
11
+ setPhoneOrEmailText: any;
12
+ setResetToken: React.Dispatch<React.SetStateAction<string>>;
13
+ setUserId: React.Dispatch<React.SetStateAction<string>>;
14
+ }
15
+ export declare const ResetPassword: (props: ResetPasswordProps) => JSX.Element;
16
+ export {};
@@ -0,0 +1,74 @@
1
+ import { GuardModuleType, Lang } from '..';
2
+ export interface InviteContext {
3
+ autoLogin: boolean;
4
+ email: string | null;
5
+ ticket: string;
6
+ enabledIdentifierCodeConfig: boolean;
7
+ enabledRegisterFillInfo: boolean;
8
+ enabledExtIdpBind: boolean;
9
+ allowSkipBindExtIdp: boolean;
10
+ sendIdentifierCodeMethod: 'prioritySMS' | 'priorityEmail' | 'SMS' | 'email';
11
+ receiverType: 'emailCode' | 'phoneCode';
12
+ phone: string | null;
13
+ username: string | null;
14
+ name: string | null;
15
+ verifyCodeMaxLength: number;
16
+ verifyCodeMaxErrCount: number;
17
+ extendsFieldsI18n?: {
18
+ [key: string]: Record<Lang, {
19
+ enabled: boolean;
20
+ value: string;
21
+ }>;
22
+ };
23
+ extendsFieldsOptions?: {
24
+ key: string;
25
+ options: {
26
+ value: string;
27
+ label: string;
28
+ }[];
29
+ }[];
30
+ extendsFields: any;
31
+ qrCodeBindMethods: Record<string, {
32
+ QRConfig: any;
33
+ id: string;
34
+ isDefault: boolean;
35
+ title: string;
36
+ }[]>;
37
+ socialConnections: any[];
38
+ registerInfoFillMsg?: string;
39
+ extIdpBindMsg?: string;
40
+ }
41
+ export interface EyGuardInviteLoginInitData extends Partial<InviteContext> {
42
+ canBack?: boolean;
43
+ verifyAccount: string;
44
+ context: any;
45
+ originModule: GuardModuleType;
46
+ originContext: any;
47
+ }
48
+ export interface EyGuardInviteCompleteInitData extends Partial<EyGuardInviteLoginInitData> {
49
+ metaData: any;
50
+ }
51
+ export interface EyGuardInviteIdentityBindInitData extends Partial<EyGuardInviteLoginInitData> {
52
+ weComConfig: {
53
+ QRConfig: any;
54
+ id: string;
55
+ isDefault: boolean;
56
+ title: string;
57
+ };
58
+ socialConnections: any[];
59
+ }
60
+ export interface EyGuardProtocolInitData {
61
+ onAcceptHandle: () => void;
62
+ onRejectHandle: () => void;
63
+ mode: 'Guard' | 'Portal';
64
+ }
65
+ export interface EyLoginProps {
66
+ onBeforeLogin?: (loginInfo: any) => void;
67
+ onLoginSuccess?: (data: any, message?: string) => void;
68
+ onLoginFailed?: (code: number, data: any, message?: string) => void;
69
+ }
70
+ export declare const useRegisterHandleHook: (initData: any, submitButtonRef?: {
71
+ current: {
72
+ onSpin: (arg0: boolean) => void;
73
+ };
74
+ } | undefined) => (context: any) => Promise<void>;
@@ -1,4 +1,5 @@
1
1
  import React from 'react';
2
+ import { VerifyLoginMethods } from '../../Type';
2
3
  export declare enum InputMethodMap {
3
4
  email = "email-code",
4
5
  phone = "phone-code"
@@ -11,6 +12,8 @@ interface ResetPasswordProps {
11
12
  setPhoneOrEmailText: any;
12
13
  setResetToken: React.Dispatch<React.SetStateAction<string>>;
13
14
  setUserId: React.Dispatch<React.SetStateAction<string>>;
15
+ supportMethods?: VerifyLoginMethods[];
16
+ firstValidate?: 'phone' | 'email';
14
17
  }
15
18
  export declare const ResetPassword: (props: ResetPasswordProps) => JSX.Element;
16
19
  export {};
@@ -4,6 +4,7 @@ import { ForgetPasswordConfig } from '../ForgetPassword/interface';
4
4
  import { LoginConfig } from '../Login/interface';
5
5
  import { RegisterConfig } from '../Register/interface';
6
6
  export interface GuardLocalConfig extends RegisterConfig, LoginConfig, ForgetPasswordConfig {
7
+ isInvited?: boolean;
7
8
  isSSO?: boolean;
8
9
  defaultScenes?: GuardModuleType;
9
10
  defaultInitData?: any;
@@ -25,7 +25,35 @@ export declare enum GuardModuleType {
25
25
  /** 多租户门户选择页 */
26
26
  TENANT_PORTAL = "tenant-portal",
27
27
  New_SUBMIT_SUCCESS = "newSubmitSuccess",
28
- RESET_ACCOUNT_NAME = "resetAccountName"
28
+ RESET_ACCOUNT_NAME = "resetAccountName",
29
+ /**
30
+ * pre check email
31
+ */
32
+ EY_PRE_CHECK_EMAIL = "ey_pre_check_email",
33
+ /**
34
+ * protocols
35
+ */
36
+ EY_PROTOCOLS = "ey_protocols",
37
+ /**
38
+ * check captcha
39
+ */
40
+ EY_CHECK_CAPTCHA = "ey_check_captcha",
41
+ /**
42
+ * invite expire
43
+ */
44
+ EY_INVITE_EXPIRE = "ey_invite_expire",
45
+ /**
46
+ * invite loading
47
+ */
48
+ EY_INVITE_LOADING = "ey_invite_loading",
49
+ /**
50
+ * identity bind
51
+ */
52
+ EY_IDENTITY_BIND = "ey_identity_bind",
53
+ /**
54
+ * invite complete
55
+ */
56
+ EY_INVITE_COMPLETE = "ey_invite_complete"
29
57
  }
30
58
  export interface GuardModuleAction {
31
59
  action: string;
@@ -1,4 +1,8 @@
1
1
  /// <reference types="react" />
2
2
  import './styles.less';
3
+ export declare enum SpecifyCodeMethods {
4
+ Phone = "phone",
5
+ Email = "email"
6
+ }
3
7
  declare const LoginWithVerifyCode: (props: any) => JSX.Element;
4
8
  export { LoginWithVerifyCode };
@@ -0,0 +1,2 @@
1
+ /// <reference types="react" />
2
+ export declare const LoginWithWeComQrcode: (props: any) => JSX.Element;
@@ -1,5 +1,9 @@
1
1
  import { FC } from 'react';
2
2
  import './styles.less';
3
+ export declare const useDisables: (data: any) => {
4
+ disableResetPwd: any;
5
+ disableRegister: any;
6
+ };
3
7
  export declare const GuardLoginView: FC<{
4
8
  isResetPage?: boolean;
5
9
  }>;
@@ -0,0 +1,15 @@
1
+ import React from 'react';
2
+ import './style.less';
3
+ interface VerifyCodeInputProps extends React.HTMLAttributes<HTMLDivElement> {
4
+ length?: number;
5
+ size?: string;
6
+ gutter?: string;
7
+ onEenter?: Function;
8
+ showDivider?: boolean;
9
+ onChange?: any;
10
+ value?: Array<number | string>;
11
+ onFinish?: any;
12
+ beforeSend: () => Promise<boolean>;
13
+ }
14
+ export declare const EyVerifyCodeInput: React.ForwardRefExoticComponent<Pick<any, string | number | symbol> & React.RefAttributes<VerifyCodeInputProps>>;
15
+ export {};
@@ -9,6 +9,7 @@ interface VerifyCodeInputProps extends React.HTMLAttributes<HTMLDivElement> {
9
9
  onChange?: any;
10
10
  value?: Array<number | string>;
11
11
  onFinish?: any;
12
+ ResentBtnSort?: () => JSX.Element;
12
13
  }
13
14
  export declare const VerifyCodeInput: FC<VerifyCodeInputProps>;
14
15
  export {};
@@ -1,4 +1,4 @@
1
- import React, { FC } from 'react';
1
+ import React from 'react';
2
2
  import './style.less';
3
3
  import { ButtonProps } from 'antd/lib/button';
4
4
  export interface SendCodeProps extends ButtonProps {
@@ -7,4 +7,4 @@ export interface SendCodeProps extends ButtonProps {
7
7
  setSent?: (value: boolean) => void;
8
8
  sendDesc?: string;
9
9
  }
10
- export declare const SendCodeBtn: FC<SendCodeProps>;
10
+ export declare const SendCodeBtn: React.ForwardRefExoticComponent<SendCodeProps & React.RefAttributes<unknown>>;
@@ -6,10 +6,12 @@ export declare enum LoginMethods {
6
6
  AppQr = "app-qrcode",
7
7
  Password = "password",
8
8
  PhoneCode = "phone-code",
9
+ EmailCode = "email-code",
9
10
  WxMinQr = "wechat-miniprogram-qrcode",
10
11
  AD = "ad",
11
12
  WechatMpQrcode = "wechatmp-qrcode",
12
- AuthingOtpPush = "authing-otp-push"
13
+ AuthingOtpPush = "authing-otp-push",
14
+ WechatworkCorpQrconnect = "wechatwork-service-provider-qrconnect"
13
15
  }
14
16
  export declare enum OIDCConnectionMode {
15
17
  FRONT_CHANNEL = "FRONT_CHANNEL",
@@ -113,6 +115,12 @@ export interface QrCodeItem {
113
115
  id: string;
114
116
  title: string;
115
117
  isDefault?: boolean;
118
+ QRConfig?: {
119
+ corpId: string;
120
+ agentId: string;
121
+ redirectUrl: string;
122
+ identifier: string;
123
+ };
116
124
  }
117
125
  export declare type QrcodeTabsSettings = Record<LoginMethods, Array<QrCodeItem>>;
118
126
  export interface OidcClientMetadata {
@@ -334,4 +342,8 @@ export interface ApplicationConfig {
334
342
  appRobotVerify: 'always_enable' | 'disable' | 'condition_set';
335
343
  /** 用户池的人机验证策略,始终开启、不开启、设置条件触发 */
336
344
  userpoolRobotVerify: 'always_enable' | 'disable' | 'condition_set';
345
+ /**
346
+ * 是否为官方应用
347
+ */
348
+ isOfficial?: boolean;
337
349
  }
@@ -5,7 +5,7 @@ import { FacePlugin } from '../_utils/facePlugin/interface';
5
5
  import { ApplicationConfig } from './application';
6
6
  export * from './application';
7
7
  export type { CommonMessage, User };
8
- export declare type Lang = 'zh-CN' | 'en-US' | 'zh-TW' | 'ja-JP';
8
+ export declare type Lang = 'zh-CN' | 'en-US';
9
9
  export declare enum GuardMode {
10
10
  Modal = "modal",
11
11
  Normal = "normal"
@@ -19,6 +19,7 @@ export declare const useMergeDefaultConfig: (defaultConfig: GuardLocalConfig, co
19
19
  export declare const useFetchConsoleConfig: (forceUpdate: number, appId?: string | undefined, config?: GuardLocalConfig | undefined, httpClient?: GuardHttp | undefined, setError?: any) => {
20
20
  finallyConfig: {
21
21
  host: string;
22
+ isInvited?: boolean | undefined;
22
23
  isSSO?: boolean | undefined;
23
24
  defaultScenes?: import("../..").GuardModuleType | undefined;
24
25
  defaultInitData?: any;
@@ -28,6 +28,6 @@ export interface AuthingResponse<T = any> {
28
28
  flowHandle?: string;
29
29
  }
30
30
  export interface AuthingGuardResponse<T = any> extends AuthingResponse<T> {
31
- onGuardHandling?: () => CodeAction;
31
+ onGuardHandling?: (initData?: any) => CodeAction;
32
32
  isFlowEnd?: boolean;
33
33
  }
@@ -27,7 +27,7 @@ export declare const getClassnames: (classnames: (string | boolean | undefined)[
27
27
  * @param item
28
28
  * @returns {boolean}
29
29
  */
30
- export declare function isObject(item: any): any;
30
+ export declare function isObject(item: any): boolean;
31
31
  /**
32
32
  * https://www.itranslater.com/qa/details/2115518846294557696
33
33
  * Deep merge two objects.
@@ -97,3 +97,4 @@ export declare const regexFromString: (string: string) => RegExp | null;
97
97
  export declare const getI18nLabel: (method: string | RegisterSortMethods, i18nFields: Map<string, TabFieldsI18nItem>, defaultLanguageConfig: Lang) => string;
98
98
  export declare const getSortLabels: (methods: string[], i18nConfig: Map<string, TabFieldsI18nItem>, defaultLanguageConfig: Lang) => string;
99
99
  export declare const getSortTabs: (tabs: string[], tab?: string | undefined) => string[];
100
+ export declare const isWeComOrigin: (event: MessageEvent) => boolean;
@@ -21,6 +21,18 @@ export declare enum ApiCode {
21
21
  FLOW_SELECT_ACCOUNT = 2921,
22
22
  SELECT_ACCOUNT_2_LOGIN = 2930,
23
23
  TENANT_PORTAL = 1644,
24
- RESET_ACCOUNT_NAME = 1108
24
+ RESET_ACCOUNT_NAME = 1108,
25
+ /**
26
+ * ey 登录协议条款
27
+ */
28
+ EY_PROTOCOLS = 1008,
29
+ /**
30
+ * ey 邀请码过期
31
+ */
32
+ EY_INVITE_EXPIRE = 4032,
33
+ /**
34
+ * 链接超时
35
+ */
36
+ EY_LINK_EXPIRE = 4033
25
37
  }
26
38
  export declare const ChangeModuleApiCodeMapping: Record<string, GuardModuleType>;
@@ -1,2 +1,2 @@
1
- declare const _default: "4.4.2";
1
+ declare const _default: "4.4.3-wecom.0";
2
2
  export default _default;