@authing/guard-shim-react18 4.5.22-alpha.0 → 4.5.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.
- package/dist/guard.min.css +1 -1
- package/dist/guard.min.js +2207 -2231
- package/dist/typings/src/ChangeLanguage/index.d.ts +2 -2
- package/dist/typings/src/CompleteInfo/core/completeInfo.d.ts +0 -1
- package/dist/typings/src/CompleteInfo/interface.d.ts +1 -1
- package/dist/typings/src/Guard/GuardModule/stateMachine.d.ts +1 -1
- package/dist/typings/src/Guard/authClient.d.ts +4 -6
- package/dist/typings/src/Guard/core/hooks/useMultipleAccounts.d.ts +21 -21
- package/dist/typings/src/Guard/module.d.ts +25 -32
- package/dist/typings/src/Login/core/withAuthingOtpPush/types.d.ts +4 -3
- package/dist/typings/src/Login/socialLogin/postMessage.d.ts +3 -7
- package/dist/typings/src/MFA/businessRequest.d.ts +33 -12
- package/dist/typings/src/MFA/core/passkey.d.ts +14 -0
- package/dist/typings/src/MFA/interface.d.ts +2 -1
- package/dist/typings/src/Qrcode/UiQrCode.d.ts +1 -1
- package/dist/typings/src/Qrcode/WorkQrCode.d.ts +1 -1
- package/dist/typings/src/Qrcode/hooks/useImage.d.ts +1 -1
- package/dist/typings/src/Qrcode/hooks/usePreQrCode.d.ts +2 -2
- package/dist/typings/src/Qrcode/index.d.ts +2 -2
- package/dist/typings/src/Register/components/Agreements/index.d.ts +1 -1
- package/dist/typings/src/SelfUnlock/core/selfUnlock.d.ts +1 -1
- package/dist/typings/src/TenantPortalSelect/interface.d.ts +1 -1
- package/dist/typings/src/Type/application.d.ts +17 -15
- package/dist/typings/src/Type/index.d.ts +6 -2
- package/dist/typings/src/ValidatorRules/index.d.ts +1 -1
- package/dist/typings/src/_utils/compute.d.ts +3 -2
- package/dist/typings/src/_utils/context.d.ts +3 -0
- package/dist/typings/src/_utils/http.d.ts +1 -1
- package/dist/typings/src/_utils/index.d.ts +1 -1
- package/dist/typings/src/_utils/locales/index.d.ts +1 -0
- package/dist/typings/src/_utils/passkey.d.ts +3 -0
- package/dist/typings/src/_utils/responseManagement/interface.d.ts +1 -3
- package/package.json +1 -1
- package/dist/typings/src/Invitation/Application/index.d.ts +0 -2
- package/dist/typings/src/Invitation/AuthenticationBind/index.d.ts +0 -2
- package/dist/typings/src/Invitation/Complete/index.d.ts +0 -2
- package/dist/typings/src/Invitation/Error/index.d.ts +0 -2
- package/dist/typings/src/Invitation/Success/index.d.ts +0 -1
- package/dist/typings/src/Invitation/interface.d.ts +0 -66
- package/dist/typings/src/Message/index.d.ts +0 -9
|
@@ -4,6 +4,6 @@ export declare const LngTextMapping: Record<Lang, {
|
|
|
4
4
|
label: string;
|
|
5
5
|
}>;
|
|
6
6
|
export declare const ChangeLanguage: (props: {
|
|
7
|
-
onLangChange?: (
|
|
8
|
-
langRange?: Lang[]
|
|
7
|
+
onLangChange?: (lang: Lang) => void;
|
|
8
|
+
langRange?: Lang[];
|
|
9
9
|
}) => JSX.Element | null;
|
|
@@ -3,7 +3,6 @@ import { CompleteInfoMetaData, CompleteInfoRequest } from '../interface';
|
|
|
3
3
|
export interface CompleteInfoProps {
|
|
4
4
|
metaData: CompleteInfoMetaData[];
|
|
5
5
|
businessRequest: (data: CompleteInfoRequest) => Promise<void>;
|
|
6
|
-
extendsFieldsI18n?: any;
|
|
7
6
|
}
|
|
8
7
|
export interface FieldMetadata {
|
|
9
8
|
key: string;
|
|
@@ -21,7 +21,7 @@ export interface GuardCompleteInfoViewProps extends GuardCompleteInfoProps {
|
|
|
21
21
|
initData: any;
|
|
22
22
|
onLogin?: any;
|
|
23
23
|
}
|
|
24
|
-
export
|
|
24
|
+
export type ExtendsFieldType = 'user' | 'internal';
|
|
25
25
|
export interface ExtendsField {
|
|
26
26
|
type: ExtendsFieldType;
|
|
27
27
|
name: string;
|
|
@@ -14,7 +14,7 @@ export interface StateMachineLog {
|
|
|
14
14
|
date: number;
|
|
15
15
|
dataSource: ModuleState;
|
|
16
16
|
}
|
|
17
|
-
export
|
|
17
|
+
export type ChangeModuleEvent = (nextModule: GuardModuleType, initData?: any) => void;
|
|
18
18
|
export declare class GuardStateMachine {
|
|
19
19
|
private order;
|
|
20
20
|
private config;
|
|
@@ -1,14 +1,12 @@
|
|
|
1
1
|
import { AuthenticationClient } from 'authing-js-sdk';
|
|
2
2
|
import { GuardLocalConfig } from './config';
|
|
3
|
-
declare let authClient: AuthenticationClient;
|
|
4
3
|
export declare const initGuardAuthClient: (config: GuardLocalConfig, appId: string, tenantId?: string) => AuthenticationClient;
|
|
5
4
|
export declare const useInitGuardAuthClient: (props: {
|
|
6
|
-
config?: GuardLocalConfig
|
|
7
|
-
appId?: string
|
|
8
|
-
authClient?: AuthenticationClient
|
|
5
|
+
config?: GuardLocalConfig;
|
|
6
|
+
appId?: string;
|
|
7
|
+
authClient?: AuthenticationClient;
|
|
9
8
|
setError?: any;
|
|
10
|
-
tenantId?: string
|
|
9
|
+
tenantId?: string;
|
|
11
10
|
}) => AuthenticationClient | undefined;
|
|
12
11
|
export declare const getGuardAuthClient: () => AuthenticationClient;
|
|
13
12
|
export declare const useGuardAuthClient: () => AuthenticationClient;
|
|
14
|
-
export {};
|
|
@@ -13,7 +13,7 @@ export declare const QR_CODE_WAY: LoginWay[];
|
|
|
13
13
|
* 登录时所有支持的登录列表(前端定义列表)
|
|
14
14
|
* 这里稍微有点乱 因为Login中的登录方式和这里的不匹配,暂时放在了一起
|
|
15
15
|
*/
|
|
16
|
-
export
|
|
16
|
+
export type LoginWay = 'email' | 'phone' | 'password' | 'phone-code' | 'email-code' | 'social' | 'wechat-miniprogram-qrcode' | 'wechatmp-qrcode' | 'app-qrcode' | 'zjzwfw-qrcode' | 'ad' | 'ldap' | 'ldap-password' | 'ldap-email' | 'ldap-phone' | 'authing-otp-push';
|
|
17
17
|
/**
|
|
18
18
|
* when: 多账号页面跳转进入登录页面
|
|
19
19
|
* 携带的回填数据信息
|
|
@@ -27,7 +27,7 @@ export interface BackFillMultipleState extends Omit<User, 'id' | 'name' | 'nickn
|
|
|
27
27
|
/**
|
|
28
28
|
* Store instance
|
|
29
29
|
*/
|
|
30
|
-
export
|
|
30
|
+
export type StoreInstance = ReturnType<MultipleAccount['getStore']>;
|
|
31
31
|
/**
|
|
32
32
|
* 当前 userId 对应的类型
|
|
33
33
|
*/
|
|
@@ -248,18 +248,18 @@ declare class MultipleAccount {
|
|
|
248
248
|
}) => void;
|
|
249
249
|
setUserInfo: (user: Omit<User & {
|
|
250
250
|
id: string;
|
|
251
|
-
loginAccount?: string
|
|
252
|
-
usertype?: string
|
|
253
|
-
},
|
|
251
|
+
loginAccount?: string;
|
|
252
|
+
usertype?: string;
|
|
253
|
+
}, 'way' | 'tab' | 'phoneCountryCode'>) => void;
|
|
254
254
|
setLoginWayByHttpData: (account: string, data: {
|
|
255
|
-
username?: string
|
|
256
|
-
phone?: string
|
|
257
|
-
email?: string
|
|
255
|
+
username?: string;
|
|
256
|
+
phone?: string;
|
|
257
|
+
email?: string;
|
|
258
258
|
}) => void;
|
|
259
259
|
setLoginWayByLDAPData: (account: string, data: {
|
|
260
|
-
name?: string
|
|
261
|
-
phone?: string
|
|
262
|
-
email?: string
|
|
260
|
+
name?: string;
|
|
261
|
+
phone?: string;
|
|
262
|
+
email?: string;
|
|
263
263
|
}) => void;
|
|
264
264
|
getMemoUser: (excludeWays?: LoginWay[]) => SelectOptions[];
|
|
265
265
|
getMemoSingleUser: (id: string) => {
|
|
@@ -278,7 +278,7 @@ declare class MultipleAccount {
|
|
|
278
278
|
* Finally Config 类型过滤
|
|
279
279
|
*/
|
|
280
280
|
declare const useMultipleAccounts: ({ appId, finallyConfig }: {
|
|
281
|
-
appId?: string
|
|
281
|
+
appId?: string;
|
|
282
282
|
finallyConfig?: any;
|
|
283
283
|
}) => {
|
|
284
284
|
instance: {
|
|
@@ -292,18 +292,18 @@ declare const useMultipleAccounts: ({ appId, finallyConfig }: {
|
|
|
292
292
|
}) => void;
|
|
293
293
|
setUserInfo: (user: Omit<User & {
|
|
294
294
|
id: string;
|
|
295
|
-
loginAccount?: string
|
|
296
|
-
usertype?: string
|
|
297
|
-
},
|
|
295
|
+
loginAccount?: string;
|
|
296
|
+
usertype?: string;
|
|
297
|
+
}, 'way' | 'tab' | 'phoneCountryCode'>) => void;
|
|
298
298
|
setLoginWayByHttpData: (account: string, data: {
|
|
299
|
-
username?: string
|
|
300
|
-
phone?: string
|
|
301
|
-
email?: string
|
|
299
|
+
username?: string;
|
|
300
|
+
phone?: string;
|
|
301
|
+
email?: string;
|
|
302
302
|
}) => void;
|
|
303
303
|
setLoginWayByLDAPData: (account: string, data: {
|
|
304
|
-
name?: string
|
|
305
|
-
phone?: string
|
|
306
|
-
email?: string
|
|
304
|
+
name?: string;
|
|
305
|
+
phone?: string;
|
|
306
|
+
email?: string;
|
|
307
307
|
}) => void;
|
|
308
308
|
getMemoUser: (excludeWays?: LoginWay[]) => SelectOptions[];
|
|
309
309
|
getMemoSingleUser: (id: string) => {
|
|
@@ -1,38 +1,31 @@
|
|
|
1
1
|
export declare enum GuardModuleType {
|
|
2
|
-
ERROR = "error"
|
|
3
|
-
LOGIN = "login"
|
|
4
|
-
REGISTER = "register"
|
|
5
|
-
MFA = "mfa"
|
|
6
|
-
FORGET_PWD = "forgetPassword"
|
|
7
|
-
FORCED_PASSWORD_RESET = "forcedPasswordReset"
|
|
8
|
-
NOTICE_PASSWORD_RESET = "noticePasswordReset"
|
|
9
|
-
FIRST_LOGIN_PASSWORD = "firstLoginPassword"
|
|
10
|
-
UNSAFE_PASSWORD_RESET = "unsafePasswordReset"
|
|
11
|
-
DOWNLOAD_AT = "downloadAT"
|
|
12
|
-
BIND_TOTP = "bindTotp"
|
|
13
|
-
ANY_QUESTIONS = "anyQuestions"
|
|
14
|
-
LOGIN_COMPLETE_INFO = "loginCompleteInfo"
|
|
15
|
-
REGISTER_PASSWORD = "registerPassword"
|
|
16
|
-
REGISTER_COMPLETE_INFO = "registerCompleteInfo"
|
|
17
|
-
RECOVERY_CODE = "recoveryCode"
|
|
18
|
-
SUBMIT_SUCCESS = "submitSuccess"
|
|
19
|
-
IDENTITY_BINDING_ASK = "identityBindingAsk"
|
|
20
|
-
IDENTITY_BINDING = "identityBinding"
|
|
21
|
-
IDENTITY_BINDING_NO_ASK = "identityBindingNoAsk"
|
|
22
|
-
SELF_UNLOCK = "selfUnlock"
|
|
23
|
-
FLOW_SELECT_ACCOUNT = "flowSelectAccount"
|
|
2
|
+
ERROR = "error",//错误页
|
|
3
|
+
LOGIN = "login",//登录页
|
|
4
|
+
REGISTER = "register",//注册页
|
|
5
|
+
MFA = "mfa",// 二次 mfa 认证页
|
|
6
|
+
FORGET_PWD = "forgetPassword",// 忘记密码页
|
|
7
|
+
FORCED_PASSWORD_RESET = "forcedPasswordReset",// 登陆安全策略 密码轮换页
|
|
8
|
+
NOTICE_PASSWORD_RESET = "noticePasswordReset",//提示修改密码页
|
|
9
|
+
FIRST_LOGIN_PASSWORD = "firstLoginPassword",//首次登录修改密码页
|
|
10
|
+
UNSAFE_PASSWORD_RESET = "unsafePasswordReset",// 密码强度不符合要求修改密码页
|
|
11
|
+
DOWNLOAD_AT = "downloadAT",//下载 Authenticator 页
|
|
12
|
+
BIND_TOTP = "bindTotp",// 绑定 TOTP页
|
|
13
|
+
ANY_QUESTIONS = "anyQuestions",// 问题反馈页
|
|
14
|
+
LOGIN_COMPLETE_INFO = "loginCompleteInfo",// 登录信息补全
|
|
15
|
+
REGISTER_PASSWORD = "registerPassword",// 验证码注册拉起密码补全页
|
|
16
|
+
REGISTER_COMPLETE_INFO = "registerCompleteInfo",//注册信息补全页
|
|
17
|
+
RECOVERY_CODE = "recoveryCode",// MFA 恢复码展示页
|
|
18
|
+
SUBMIT_SUCCESS = "submitSuccess",// 提交成功展示页
|
|
19
|
+
IDENTITY_BINDING_ASK = "identityBindingAsk",// 身份源绑定 问询页
|
|
20
|
+
IDENTITY_BINDING = "identityBinding",// 身份源绑定页
|
|
21
|
+
IDENTITY_BINDING_NO_ASK = "identityBindingNoAsk",// 身份源绑定页不问询
|
|
22
|
+
SELF_UNLOCK = "selfUnlock",// 自助解锁页
|
|
23
|
+
FLOW_SELECT_ACCOUNT = "flowSelectAccount",// 选择登录账号
|
|
24
24
|
/** 多租户门户选择页 */
|
|
25
25
|
TENANT_PORTAL = "tenant-portal",
|
|
26
|
-
New_SUBMIT_SUCCESS = "newSubmitSuccess"
|
|
27
|
-
SELECT_ACCOUNT_2_LOGIN = "selectAccout2Login"
|
|
28
|
-
RESET_ACCOUNT_NAME = "resetAccountName"
|
|
29
|
-
APPLY_INVITATION = "applyInvitation",
|
|
30
|
-
MESSAGE = "message",
|
|
31
|
-
INVITE_AUTH = "inviteAuth",
|
|
32
|
-
INVITE_COMPLETE = "inviteComplete",
|
|
33
|
-
INVITE_EXPIRE = "inviteExpire",
|
|
34
|
-
INVITE_PAGE_EXPIRE = "invitePageExpire",
|
|
35
|
-
INVITE_SUCCESS = "inviteSuccess"
|
|
26
|
+
New_SUBMIT_SUCCESS = "newSubmitSuccess",// 提交成功展示页
|
|
27
|
+
SELECT_ACCOUNT_2_LOGIN = "selectAccout2Login",// 选择登录身份
|
|
28
|
+
RESET_ACCOUNT_NAME = "resetAccountName"
|
|
36
29
|
}
|
|
37
30
|
export interface GuardModuleAction {
|
|
38
31
|
action: string;
|
|
@@ -8,8 +8,9 @@ export interface CheckPushCodeStatusProps {
|
|
|
8
8
|
}
|
|
9
9
|
export interface OnLoginProps {
|
|
10
10
|
account: string;
|
|
11
|
+
agreementIds?: (string | number)[];
|
|
11
12
|
}
|
|
12
|
-
export
|
|
13
|
+
export type LoginStatus = 'before' | 'pending';
|
|
13
14
|
export interface LoginWithAuthingOtpPushProps {
|
|
14
15
|
onLoginSuccess?: any;
|
|
15
16
|
multipleInstance?: StoreInstance;
|
|
@@ -20,9 +21,9 @@ export interface PushLoginGudeModalProps {
|
|
|
20
21
|
visible: boolean;
|
|
21
22
|
onClose: () => void;
|
|
22
23
|
}
|
|
23
|
-
export
|
|
24
|
+
export type Selector = 'howUsePushLogin' | 'howBindClient' | 'howGetAppLoginUrl';
|
|
24
25
|
export interface SelectorOption {
|
|
25
26
|
value: Selector;
|
|
26
27
|
label: string;
|
|
27
28
|
}
|
|
28
|
-
export
|
|
29
|
+
export type SelectorOptions = SelectorOption[];
|
|
@@ -1,7 +1,3 @@
|
|
|
1
|
-
import { AuthingResponse } from '../../_utils/http';
|
|
2
|
-
export declare const usePostMessage: () => (evt: MessageEvent) =>
|
|
3
|
-
|
|
4
|
-
data: any;
|
|
5
|
-
onGuardHandling: undefined;
|
|
6
|
-
} | undefined;
|
|
7
|
-
export declare const useErrorHandling: () => (res: AuthingResponse) => import("../../_utils/http").AuthingGuardResponse<any>;
|
|
1
|
+
import { AuthingGuardResponse, AuthingResponse } from '../../_utils/http';
|
|
2
|
+
export declare const usePostMessage: () => (evt: MessageEvent) => AuthingGuardResponse | undefined;
|
|
3
|
+
export declare const useErrorHandling: () => (res: AuthingResponse) => AuthingGuardResponse<any>;
|
|
@@ -1,11 +1,15 @@
|
|
|
1
|
+
import { CredentialCreationOptionsJSON, CredentialRequestOptionsJSON, PublicKeyCredentialWithAssertionJSON, PublicKeyCredentialWithAttestationJSON } from '@github/webauthn-json';
|
|
2
|
+
import { AuthingGuardResponse } from '../_utils/http';
|
|
1
3
|
export declare enum MfaBusinessAction {
|
|
2
4
|
VerifyEmail = "verify-email",
|
|
3
5
|
VerifySms = "verify-sms",
|
|
4
6
|
VerifyTotp = "verify-totp",
|
|
5
7
|
VerifyFace = "verify-face",
|
|
6
|
-
AssociateFace = "associate-face"
|
|
8
|
+
AssociateFace = "associate-face",
|
|
9
|
+
PasskeyBind = "passkey-bind",
|
|
10
|
+
PasskeyVerify = "passkey-verify"
|
|
7
11
|
}
|
|
8
|
-
export declare const authFlow: (action: MfaBusinessAction, content: any) => Promise<
|
|
12
|
+
export declare const authFlow: (action: MfaBusinessAction, content: any) => Promise<AuthingGuardResponse<any>>;
|
|
9
13
|
interface VerifySmsContent {
|
|
10
14
|
phone: string;
|
|
11
15
|
code: string;
|
|
@@ -31,16 +35,33 @@ interface AssociateFaceContent {
|
|
|
31
35
|
isExternalPhoto?: boolean;
|
|
32
36
|
mfaToken?: string;
|
|
33
37
|
}
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
38
|
+
type BindPasskeyContent = PublicKeyCredentialWithAttestationJSON;
|
|
39
|
+
interface VerifyPasskeyContent {
|
|
40
|
+
credential: PublicKeyCredentialWithAssertionJSON;
|
|
41
|
+
ticket: string;
|
|
42
|
+
}
|
|
43
|
+
interface GetPasskeyBindChallengeParams {
|
|
44
|
+
mfaToken: string;
|
|
45
|
+
}
|
|
46
|
+
interface GetPasskeyVerifyChallengeParams {
|
|
47
|
+
mfaToken: string;
|
|
48
|
+
}
|
|
49
|
+
export declare const VerifyEmail: (content: VerifyEmailContent) => Promise<AuthingGuardResponse<any>>;
|
|
50
|
+
export declare const VerifySms: (content: VerifySmsContent) => Promise<AuthingGuardResponse<any>>;
|
|
51
|
+
export declare const VerifyTotp: (content: VerifyTotpContent) => Promise<AuthingGuardResponse<any>>;
|
|
52
|
+
export declare const VerifyFace: (content: VerifyFaceContent) => Promise<AuthingGuardResponse<any>>;
|
|
53
|
+
export declare const AssociateFace: (content: AssociateFaceContent) => Promise<AuthingGuardResponse<any>>;
|
|
54
|
+
export declare const GetPasskeyBindChallenge: (content: GetPasskeyBindChallengeParams) => Promise<AuthingGuardResponse<CredentialCreationOptionsJSON>>;
|
|
55
|
+
export declare const GetPasskeyVerifyChallenge: (content: GetPasskeyVerifyChallengeParams) => Promise<AuthingGuardResponse<CredentialRequestOptionsJSON & {
|
|
56
|
+
ticket: string;
|
|
57
|
+
}>>;
|
|
39
58
|
export declare const useMfaBusinessRequest: () => {
|
|
40
|
-
"verify-email": (content: VerifyEmailContent) => Promise<
|
|
41
|
-
"verify-sms": (content: VerifySmsContent) => Promise<
|
|
42
|
-
"verify-totp": (content: VerifyTotpContent) => Promise<
|
|
43
|
-
"verify-face": (content: VerifyFaceContent) => Promise<
|
|
44
|
-
"associate-face": (content: AssociateFaceContent) => Promise<
|
|
59
|
+
"verify-email": (content: VerifyEmailContent) => Promise<AuthingGuardResponse<any>>;
|
|
60
|
+
"verify-sms": (content: VerifySmsContent) => Promise<AuthingGuardResponse<any>>;
|
|
61
|
+
"verify-totp": (content: VerifyTotpContent) => Promise<AuthingGuardResponse<any>>;
|
|
62
|
+
"verify-face": (content: VerifyFaceContent) => Promise<AuthingGuardResponse<any>>;
|
|
63
|
+
"associate-face": (content: AssociateFaceContent) => Promise<AuthingGuardResponse<any>>;
|
|
64
|
+
"passkey-bind": (content: BindPasskeyContent) => Promise<AuthingGuardResponse<any>> | null;
|
|
65
|
+
"passkey-verify": (content: VerifyPasskeyContent) => Promise<AuthingGuardResponse<any>> | null;
|
|
45
66
|
};
|
|
46
67
|
export {};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { React } from 'shim-react';
|
|
2
|
+
interface BindPasskeyProps {
|
|
3
|
+
mfaToken: string;
|
|
4
|
+
mfaLogin: (code: any, data: any, message?: string) => void;
|
|
5
|
+
}
|
|
6
|
+
interface VerifyPasskeyProps {
|
|
7
|
+
mfaToken: string;
|
|
8
|
+
mfaLogin: (code: any, data: any, message?: string) => void;
|
|
9
|
+
}
|
|
10
|
+
export type MFAPasskeyProps = BindPasskeyProps & VerifyPasskeyProps & {
|
|
11
|
+
passkeyEnabled: boolean;
|
|
12
|
+
};
|
|
13
|
+
export declare const MFAPasskey: React.FC<MFAPasskeyProps>;
|
|
14
|
+
export {};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { React } from 'shim-react';
|
|
2
2
|
import './index.less';
|
|
3
3
|
import { CodeStatusDescriptions } from './WorkQrCode';
|
|
4
|
-
export
|
|
4
|
+
export type CodeStatus = 'loading' | 'ready' | 'already' | 'success' | 'error' | 'expired' | 'cancel' | 'MFA';
|
|
5
5
|
export declare const prefix = "refactor";
|
|
6
6
|
export interface UiQrProps {
|
|
7
7
|
/**
|
|
@@ -4,7 +4,7 @@ import { CodeStatus, UiQrProps } from './UiQrCode';
|
|
|
4
4
|
/**
|
|
5
5
|
* 二维码不同状态下的底部描述文字
|
|
6
6
|
*/
|
|
7
|
-
export
|
|
7
|
+
export type CodeStatusDescriptions = Partial<Record<Exclude<CodeStatus, 'loading'>, React.ReactNode | ((referQrCode?: () => void) => React.ReactNode)>>;
|
|
8
8
|
export interface WorkQrCodeRef {
|
|
9
9
|
referQrCode: () => Promise<{
|
|
10
10
|
random: string;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { React } from 'shim-react';
|
|
2
2
|
import { CodeStatus } from '../UiQrCode';
|
|
3
|
-
export
|
|
4
|
-
export
|
|
3
|
+
export type ReducerType = 'change' | 'changeStatus' | 'changeDesc';
|
|
4
|
+
export type RootState = {
|
|
5
5
|
/**
|
|
6
6
|
* 状态
|
|
7
7
|
*/
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { UiQrCode, LinkQrcode } from './UiQrCode';
|
|
2
2
|
import { WorkQrCode, WorkGeneQrCode } from './WorkQrCode';
|
|
3
|
-
|
|
3
|
+
type IQrCode = typeof WorkQrCode & {
|
|
4
4
|
UI: typeof UiQrCode;
|
|
5
5
|
};
|
|
6
|
-
|
|
6
|
+
type IGeneQrCode = typeof WorkGeneQrCode & {
|
|
7
7
|
UI: typeof LinkQrcode;
|
|
8
8
|
};
|
|
9
9
|
declare const QrCode: IQrCode;
|
|
@@ -3,7 +3,7 @@ import './style.less';
|
|
|
3
3
|
import { Agreement } from '../../../Type/application';
|
|
4
4
|
export interface AgreementsProps {
|
|
5
5
|
value?: boolean;
|
|
6
|
-
onChange?: (value: boolean) => void;
|
|
6
|
+
onChange?: (value: boolean, acceptList: (string | number)[]) => void;
|
|
7
7
|
style?: React.CSSProperties;
|
|
8
8
|
agreements: Agreement[];
|
|
9
9
|
showError?: boolean;
|
|
@@ -31,7 +31,7 @@ export interface TenantPortalEvents extends IG2Events {
|
|
|
31
31
|
/** 租户门户选择回调 */
|
|
32
32
|
onTenantSelect?: (data?: TenantPortalSelectType) => void;
|
|
33
33
|
}
|
|
34
|
-
export
|
|
34
|
+
export type TenantView = 'default' | 'join' | 'create';
|
|
35
35
|
export interface TenantButtonProps {
|
|
36
36
|
className?: string;
|
|
37
37
|
onClick?: () => void;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export
|
|
2
|
-
import { MFAType } from '
|
|
1
|
+
export type Lang = 'zh-CN' | 'en-US' | 'zh-TW' | 'ja-JP';
|
|
2
|
+
import { MFAType } from 'src/MFA/interface';
|
|
3
3
|
import { PasswordStrength } from '../_utils';
|
|
4
4
|
export * from 'authing-js-sdk';
|
|
5
5
|
export declare enum LoginMethods {
|
|
@@ -7,14 +7,14 @@ export declare enum LoginMethods {
|
|
|
7
7
|
AppQr = "app-qrcode",
|
|
8
8
|
Password = "password",
|
|
9
9
|
PhoneCode = "phone-code",
|
|
10
|
-
EmailCode = "email-code"
|
|
11
|
-
WxMinQr = "wechat-miniprogram-qrcode"
|
|
12
|
-
AD = "ad"
|
|
13
|
-
WechatMpQrcode = "wechatmp-qrcode"
|
|
14
|
-
AuthingOtpPush = "authing-otp-push"
|
|
15
|
-
WechatworkCorpQrconnect = "wechatwork-corp-qrconnect"
|
|
16
|
-
DingTalkQrcode = "dingtalk-qrcode"
|
|
17
|
-
Passkey = "passkey"
|
|
10
|
+
EmailCode = "email-code",// 这是前端单独加的,后端只会返回 phone-code
|
|
11
|
+
WxMinQr = "wechat-miniprogram-qrcode",// 对应社会化登录的 wechat:miniprogram:qrconnect(小程序扫码登录)
|
|
12
|
+
AD = "ad",// 对应企业身份源的 Windows AD 登录
|
|
13
|
+
WechatMpQrcode = "wechatmp-qrcode",// 微信扫码关注登录
|
|
14
|
+
AuthingOtpPush = "authing-otp-push",// App 扫码登录
|
|
15
|
+
WechatworkCorpQrconnect = "wechatwork-corp-qrconnect",// 微信企业扫码关注登录
|
|
16
|
+
DingTalkQrcode = "dingtalk-qrcode",//钉钉扫码
|
|
17
|
+
Passkey = "passkey",// passkey
|
|
18
18
|
ZJZWFWQrcode = "zjzwfw-qrcode"
|
|
19
19
|
}
|
|
20
20
|
export declare enum OIDCConnectionMode {
|
|
@@ -130,7 +130,7 @@ export interface QrCodeItem {
|
|
|
130
130
|
authorizationUrl?: string;
|
|
131
131
|
};
|
|
132
132
|
}
|
|
133
|
-
export
|
|
133
|
+
export type QrcodeTabsSettings = Record<LoginMethods, Array<QrCodeItem>>;
|
|
134
134
|
export interface OidcClientMetadata {
|
|
135
135
|
grant_types: string[];
|
|
136
136
|
client_id: string;
|
|
@@ -165,7 +165,7 @@ export interface UserExtendsField {
|
|
|
165
165
|
required: boolean;
|
|
166
166
|
validateRules: any[];
|
|
167
167
|
}
|
|
168
|
-
export
|
|
168
|
+
export type ExtendsField = InternalExtendsField | UserExtendsField;
|
|
169
169
|
export interface ApplicationPasswordTabConfig {
|
|
170
170
|
enabledLoginMethods?: PasswordLoginMethods[];
|
|
171
171
|
validRegisterMethods?: string[];
|
|
@@ -183,9 +183,9 @@ export interface Agreement {
|
|
|
183
183
|
lang: Lang;
|
|
184
184
|
availableAt?: number;
|
|
185
185
|
}
|
|
186
|
-
export
|
|
187
|
-
export
|
|
188
|
-
export
|
|
186
|
+
export type PasswordLoginMethods = 'username-password' | 'email-password' | 'phone-password';
|
|
187
|
+
export type VerifyLoginMethods = 'email-code' | 'phone-code';
|
|
188
|
+
export type ComplateFiledsPlace = 'register' | 'login';
|
|
189
189
|
export interface TabFieldsI18nItem {
|
|
190
190
|
key: string;
|
|
191
191
|
label: string;
|
|
@@ -377,4 +377,6 @@ export interface ApplicationConfig {
|
|
|
377
377
|
switch: 'OFF' | 'ON' | 'CONDON';
|
|
378
378
|
};
|
|
379
379
|
};
|
|
380
|
+
/** 特殊浏览器匹配字符串 */
|
|
381
|
+
specialBrowserSymbols?: string[];
|
|
380
382
|
}
|
|
@@ -82,6 +82,10 @@ export declare enum EmailScene {
|
|
|
82
82
|
RESET_PASSWORD_VERIFY_CODE = "RESET_PASSWORD_VERIFY_CODE",
|
|
83
83
|
EMAIL_BIND_VERIFY_CODE = "EMAIL_BIND_VERIFY_CODE",
|
|
84
84
|
EMAIL_UNBIND_VERIFY_CODE = "EMAIL_UNBIND_VERIFY_CODE",
|
|
85
|
-
SELF_UNLOCKING_VERIFY_CODE = "SELF_UNLOCKING_VERIFY_CODE"
|
|
86
|
-
|
|
85
|
+
SELF_UNLOCKING_VERIFY_CODE = "SELF_UNLOCKING_VERIFY_CODE"
|
|
86
|
+
}
|
|
87
|
+
export declare enum ForcedModifyPwdCycleUnit {
|
|
88
|
+
Day = "DAY",
|
|
89
|
+
Month = "MONTH",
|
|
90
|
+
Year = "YEAR"
|
|
87
91
|
}
|
|
@@ -21,7 +21,7 @@ export interface ValidatorFormItemMetaProps extends ValidatorFormItemProps {
|
|
|
21
21
|
export interface ICheckProps {
|
|
22
22
|
check: (values: any) => void;
|
|
23
23
|
}
|
|
24
|
-
|
|
24
|
+
type InternalFormItemType = typeof Form.Item;
|
|
25
25
|
interface FormItemInterface extends InternalFormItemType {
|
|
26
26
|
Password: typeof PasswordFormItem;
|
|
27
27
|
Email: typeof EmailFormItem;
|
|
@@ -16,6 +16,7 @@ export declare const isAlipayBrowser: () => boolean | null;
|
|
|
16
16
|
export declare const isBaiduBrowser: () => boolean | null;
|
|
17
17
|
export declare const isWeComeBrowser: () => boolean;
|
|
18
18
|
export declare const isMobile: () => RegExpMatchArray | null;
|
|
19
|
-
export declare const isWebview: () =>
|
|
20
|
-
export declare const
|
|
19
|
+
export declare const isWebview: () => boolean | null;
|
|
20
|
+
export declare const isLenovoNetdisk: () => boolean | null;
|
|
21
|
+
export declare const computeIsSpecialBrowser: (specialBrowserSymbol?: string[]) => boolean;
|
|
21
22
|
export declare const getPhoneInLoginPageContext: () => any;
|
|
@@ -49,6 +49,8 @@ export interface IGuardContext {
|
|
|
49
49
|
defaultLanguageConfig: Lang;
|
|
50
50
|
/** 租户信息获取和操作处理相关 */
|
|
51
51
|
tenantInstance?: MultipleTenant;
|
|
52
|
+
/** 特殊浏览器,身份源无法弹窗,非托管模式不显示身份源图标 */
|
|
53
|
+
isSpecialBrowser: boolean;
|
|
52
54
|
}
|
|
53
55
|
export declare const createGuardXContext: () => {
|
|
54
56
|
Provider: React.FC<{
|
|
@@ -76,6 +78,7 @@ export declare const useGuardButtonContext: () => {
|
|
|
76
78
|
export declare const useGuardButtonState: () => IGuardContextProvider;
|
|
77
79
|
export declare const useGuardPublicConfig: () => ApplicationConfig;
|
|
78
80
|
export declare const useGuardHttpClient: () => GuardHttp;
|
|
81
|
+
export declare const useIsSpecialBrowser: () => boolean;
|
|
79
82
|
export declare const useGuardDefaultMergedConfig: () => GuardLocalConfig;
|
|
80
83
|
export declare const useGuardAppId: () => string;
|
|
81
84
|
export declare const useGuardTenantId: () => string | undefined;
|
|
@@ -5,7 +5,7 @@ export declare const requestClient: {
|
|
|
5
5
|
get<T>(path: string, query?: Record<string, any>, init?: AxiosRequestConfig): Promise<AuthingResponse<T>>;
|
|
6
6
|
post<T_1>(path: string, data: any, config?: {
|
|
7
7
|
headers: any;
|
|
8
|
-
}
|
|
8
|
+
}): Promise<AuthingResponse<T_1>>;
|
|
9
9
|
postForm<T_2>(path: string, formData: any, config?: {
|
|
10
10
|
headers: any;
|
|
11
11
|
}): Promise<AuthingResponse<T_2>>;
|
|
@@ -15,7 +15,7 @@ export declare const validate: (type: keyof typeof VALIDATE_PATTERN, val: string
|
|
|
15
15
|
export declare const getRequiredRules: (msg: string) => Rule[];
|
|
16
16
|
export declare const fieldRequiredRule: (fieldRequiredRule: string, fieldRequiredRuleMessage?: string) => Rule[];
|
|
17
17
|
export declare function getDeviceName(): string | null | undefined;
|
|
18
|
-
export
|
|
18
|
+
export type STYLE_RECORD_KEY = 'appConfig' | 'userConfig';
|
|
19
19
|
export declare const insertStyles: (styles: string | any, recordKey?: STYLE_RECORD_KEY) => void;
|
|
20
20
|
export declare const removeStyles: (recordKey: STYLE_RECORD_KEY) => void;
|
|
21
21
|
export declare const getClassnames: (classnames: (string | boolean | undefined)[]) => string;
|
|
@@ -6,4 +6,5 @@ export interface InitGuardI18nOptions {
|
|
|
6
6
|
}
|
|
7
7
|
export declare const fallbackLng: (code?: string) => string[];
|
|
8
8
|
export declare const initGuardI18n: (options: InitGuardI18nOptions, callback: React.Dispatch<React.SetStateAction<boolean>>) => Promise<void>;
|
|
9
|
+
export declare const resolvedLanguage: string;
|
|
9
10
|
export { i18n };
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { CredentialCreationOptionsJSON, CredentialRequestOptionsJSON } from '@github/webauthn-json';
|
|
2
|
+
export declare const registerPasskey: (challenge: CredentialCreationOptionsJSON) => Promise<import("@github/webauthn-json").PublicKeyCredentialWithAttestationJSON | undefined>;
|
|
3
|
+
export declare const verifyPasskey: (challenge: CredentialRequestOptionsJSON) => Promise<import("@github/webauthn-json").PublicKeyCredentialWithAssertionJSON | undefined>;
|
|
@@ -22,8 +22,6 @@ export declare enum ApiCode {
|
|
|
22
22
|
FLOW_SELECT_ACCOUNT = 2921,
|
|
23
23
|
TENANT_PORTAL = 1644,
|
|
24
24
|
SELECT_ACCOUNT_2_LOGIN = 2930,
|
|
25
|
-
RESET_ACCOUNT_NAME = 1108
|
|
26
|
-
INVITE_EXPIRE = 4032,
|
|
27
|
-
INVITE_PAGE_EXPIRE = 4033
|
|
25
|
+
RESET_ACCOUNT_NAME = 1108
|
|
28
26
|
}
|
|
29
27
|
export declare const ChangeModuleApiCodeMapping: Record<string, GuardModuleType>;
|
package/package.json
CHANGED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const GuardInviteSuccessView: () => JSX.Element;
|