@authing/guard-shim-react18 4.5.40-alpha.9 → 4.5.40-ey.1
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 +4452 -4914
- package/dist/typings/src/ChangeLanguage/index.d.ts +2 -2
- package/dist/typings/src/CompleteInfo/core/completeInfo.d.ts +8 -1
- package/dist/typings/src/CompleteInfo/interface.d.ts +5 -1
- package/dist/typings/src/CompleteInfo/utils.d.ts +7 -0
- package/dist/typings/src/EY/CheckCaptcha/index.d.ts +1 -0
- package/dist/typings/src/EY/Error/index.d.ts +1 -0
- package/dist/typings/src/EY/ForgetPassword/index.d.ts +2 -0
- package/dist/typings/src/EY/InviteComplete/index.d.ts +1 -0
- package/dist/typings/src/EY/InviteIdentityBind/component/WeComQrcode.d.ts +2 -0
- package/dist/typings/src/EY/InviteIdentityBind/component/WeComQrcodeNew.d.ts +1 -0
- package/dist/typings/src/EY/InviteIdentityBind/index.d.ts +1 -0
- package/dist/typings/src/EY/InviteLoading/index.d.ts +1 -0
- package/dist/typings/src/EY/Login/components/EyLoginWithWeComQrcode.d.ts +1 -0
- package/dist/typings/src/EY/Login/components/EyLoginWithWeComQrcodeNew.d.ts +1 -0
- package/dist/typings/src/EY/Login/core/EmailVerify.d.ts +7 -0
- package/dist/typings/src/EY/Login/core/ScanCode.d.ts +7 -0
- package/dist/typings/src/EY/Login/index.d.ts +6 -0
- package/dist/typings/src/EY/PreCheckEmail/index.d.ts +1 -0
- package/dist/typings/src/EY/Protocol/index.d.ts +1 -0
- package/dist/typings/src/EY/components/EmailFormItem.d.ts +2 -0
- package/dist/typings/src/EY/components/GoBack.d.ts +1 -0
- package/dist/typings/src/EY/components/ResetPassword.d.ts +16 -0
- package/dist/typings/src/EY/interface.d.ts +75 -0
- package/dist/typings/src/ForgetPassword/core/resetPassword.d.ts +3 -0
- 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/config.d.ts +1 -0
- package/dist/typings/src/Guard/core/hooks/useMultipleAccounts.d.ts +21 -21
- package/dist/typings/src/Guard/module.d.ts +59 -28
- package/dist/typings/src/Invitation/interface.d.ts +1 -1
- package/dist/typings/src/Login/core/eyWithWeComQrcode.d.ts +1 -0
- package/dist/typings/src/Login/core/withAuthingOtpPush/types.d.ts +3 -3
- package/dist/typings/src/Login/index.d.ts +4 -0
- package/dist/typings/src/MFA/BindPreCheck/index.d.ts +2 -0
- package/dist/typings/src/MFA/VerifyCodeInput/ey.d.ts +16 -0
- package/dist/typings/src/MFA/VerifyCodeInput/index.d.ts +5 -0
- package/dist/typings/src/MFA/businessRequest.d.ts +2 -1
- package/dist/typings/src/MFA/core/email.d.ts +1 -0
- package/dist/typings/src/MFA/core/passkey.d.ts +1 -1
- package/dist/typings/src/MFA/core/sms.d.ts +1 -0
- package/dist/typings/src/MFA/core/totp.d.ts +1 -0
- package/dist/typings/src/MFA/mfaMethods/index.d.ts +1 -0
- 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/SelfUnlock/core/selfUnlock.d.ts +1 -1
- package/dist/typings/src/SendCode/SendCodeBtn.d.ts +2 -1
- package/dist/typings/src/SendCode/index.d.ts +1 -0
- package/dist/typings/src/TenantPortalSelect/interface.d.ts +1 -1
- package/dist/typings/src/Type/application.d.ts +28 -19
- package/dist/typings/src/ValidatorRules/index.d.ts +1 -1
- package/dist/typings/src/_utils/config/index.d.ts +1 -0
- package/dist/typings/src/_utils/context.d.ts +151 -1
- package/dist/typings/src/_utils/http.d.ts +4 -4
- package/dist/typings/src/_utils/index.d.ts +3 -1
- package/dist/typings/src/_utils/responseManagement/interface.d.ts +15 -5
- package/dist/typings/src/_utils/signRequestParams.d.ts +8 -0
- package/package.json +2 -2
|
@@ -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;
|
|
@@ -6,5 +6,6 @@ export interface SendCodeProps extends ButtonProps {
|
|
|
6
6
|
btnRef?: React.RefObject<HTMLButtonElement>;
|
|
7
7
|
setSent?: (value: boolean) => void;
|
|
8
8
|
sendDesc?: string;
|
|
9
|
+
timerTime?: number;
|
|
9
10
|
}
|
|
10
|
-
export declare const SendCodeBtn: React.
|
|
11
|
+
export declare const SendCodeBtn: React.ForwardRefExoticComponent<SendCodeProps & React.RefAttributes<unknown>>;
|
|
@@ -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,4 +1,4 @@
|
|
|
1
|
-
export
|
|
1
|
+
export type Lang = 'zh-CN' | 'en-US';
|
|
2
2
|
import { MFAType } from '../MFA/interface';
|
|
3
3
|
import { PasswordStrength } from '../_utils';
|
|
4
4
|
export * from 'authing-js-sdk';
|
|
@@ -7,17 +7,22 @@ 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
|
-
WECHATWORKQRCONNECTOFAUTHINGAGENCY = "wechatwork-authing-agency-qrcode"
|
|
17
|
-
WECHATWORKAGENCYQRCONNECT = "wechatwork-agency-qrcode"
|
|
18
|
-
DingTalkQrcode = "dingtalk-qrcode"
|
|
19
|
-
Passkey = "passkey"
|
|
20
|
-
ZJZWFWQrcode = "zjzwfw-qrcode"
|
|
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
|
+
WECHATWORKQRCONNECTOFAUTHINGAGENCY = "wechatwork-authing-agency-qrcode",// 代开发形式的以 authing 作为内部应用
|
|
17
|
+
WECHATWORKAGENCYQRCONNECT = "wechatwork-agency-qrcode",// 代开发形式的内部应用
|
|
18
|
+
DingTalkQrcode = "dingtalk-qrcode",//钉钉扫码
|
|
19
|
+
Passkey = "passkey",// passkey
|
|
20
|
+
ZJZWFWQrcode = "zjzwfw-qrcode",// 浙江政务钉
|
|
21
|
+
/**
|
|
22
|
+
* ey
|
|
23
|
+
*/
|
|
24
|
+
EYWechatworkCorpQrconnect = "wechatwork-service-provider-qrconnect",// 微信企业扫码关注登录
|
|
25
|
+
WechatworkCorpQrconnectNew = "wechatwork-service-provider-qrconnect-v2"
|
|
21
26
|
}
|
|
22
27
|
export declare enum OIDCConnectionMode {
|
|
23
28
|
FRONT_CHANNEL = "FRONT_CHANNEL",
|
|
@@ -37,8 +42,8 @@ export declare enum SocialConnectionProvider {
|
|
|
37
42
|
WECHATWORK_ADDRESS_BOOK = "wechatwork:addressbook",
|
|
38
43
|
WECHATWORK_CORP_QRCONNECT = "wechatwork:corp:qrconnect",
|
|
39
44
|
WECHATWORK_SERVICEPROVIDER_QRCONNECT = "wechatwork:service-provider:qrconnect",
|
|
40
|
-
WECHATWORK_QRCONNECT_OF_AUTHING_AGENCY = "wechatwork:qrconnect:of:authing:agency"
|
|
41
|
-
WECHATWORK_AGENCY_QRCONNECT = "wechatwork:agency:qrconnect"
|
|
45
|
+
WECHATWORK_QRCONNECT_OF_AUTHING_AGENCY = "wechatwork:qrconnect:of:authing:agency",// 代开发形式的以 authing 作为内部应用
|
|
46
|
+
WECHATWORK_AGENCY_QRCONNECT = "wechatwork:agency:qrconnect",// 代开发形式的内部应用
|
|
42
47
|
DINGTALK = "dingtalk",
|
|
43
48
|
WEIBO = "weibo",
|
|
44
49
|
APPLE = "apple",
|
|
@@ -135,7 +140,7 @@ export interface QrCodeItem {
|
|
|
135
140
|
authorizationUrl?: string;
|
|
136
141
|
};
|
|
137
142
|
}
|
|
138
|
-
export
|
|
143
|
+
export type QrcodeTabsSettings = Record<LoginMethods, Array<QrCodeItem>>;
|
|
139
144
|
export interface OidcClientMetadata {
|
|
140
145
|
grant_types: string[];
|
|
141
146
|
client_id: string;
|
|
@@ -170,7 +175,7 @@ export interface UserExtendsField {
|
|
|
170
175
|
required: boolean;
|
|
171
176
|
validateRules: any[];
|
|
172
177
|
}
|
|
173
|
-
export
|
|
178
|
+
export type ExtendsField = InternalExtendsField | UserExtendsField;
|
|
174
179
|
export interface ApplicationPasswordTabConfig {
|
|
175
180
|
enabledLoginMethods?: PasswordLoginMethods[];
|
|
176
181
|
validRegisterMethods?: string[];
|
|
@@ -188,9 +193,9 @@ export interface Agreement {
|
|
|
188
193
|
lang: Lang;
|
|
189
194
|
availableAt?: number;
|
|
190
195
|
}
|
|
191
|
-
export
|
|
192
|
-
export
|
|
193
|
-
export
|
|
196
|
+
export type PasswordLoginMethods = 'username-password' | 'email-password' | 'phone-password';
|
|
197
|
+
export type VerifyLoginMethods = 'email-code' | 'phone-code';
|
|
198
|
+
export type ComplateFiledsPlace = 'register' | 'login';
|
|
194
199
|
export interface TabFieldsI18nItem {
|
|
195
200
|
key: string;
|
|
196
201
|
label: string;
|
|
@@ -362,6 +367,10 @@ export interface ApplicationConfig {
|
|
|
362
367
|
appRobotVerify: 'always_enable' | 'disable' | 'condition_set';
|
|
363
368
|
/** 用户池的人机验证策略,始终开启、不开启、设置条件触发 */
|
|
364
369
|
userpoolRobotVerify: 'always_enable' | 'disable' | 'condition_set';
|
|
370
|
+
/**
|
|
371
|
+
* 是否为官方应用
|
|
372
|
+
*/
|
|
373
|
+
isOfficial?: boolean;
|
|
365
374
|
/** 加入租户校验企业邮箱 */
|
|
366
375
|
enableVerifyDomainInJoinTenant: boolean;
|
|
367
376
|
passkeyEnabled: boolean;
|
|
@@ -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;
|
|
@@ -19,6 +19,7 @@ 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
|
+
isInvited?: boolean | undefined;
|
|
22
23
|
isSSO?: boolean | undefined;
|
|
23
24
|
defaultScenes?: import("../..").GuardModuleType | undefined;
|
|
24
25
|
defaultInitData?: any;
|
|
@@ -51,6 +51,8 @@ export interface IGuardContext {
|
|
|
51
51
|
tenantInstance?: MultipleTenant;
|
|
52
52
|
/** 特殊浏览器,身份源无法弹窗,非托管模式不显示身份源图标 */
|
|
53
53
|
isSpecialBrowser: boolean;
|
|
54
|
+
/** 判断是否是国外的用户池 */
|
|
55
|
+
isForeignUserpool: boolean;
|
|
54
56
|
}
|
|
55
57
|
export declare const createGuardXContext: () => {
|
|
56
58
|
Provider: React.FC<{
|
|
@@ -90,7 +92,96 @@ export declare const useGuardModule: () => {
|
|
|
90
92
|
backModule: (() => void) | undefined;
|
|
91
93
|
currentModule: ModuleState;
|
|
92
94
|
};
|
|
93
|
-
export declare const useGuardFinallyConfig: () =>
|
|
95
|
+
export declare const useGuardFinallyConfig: () => {
|
|
96
|
+
title: string;
|
|
97
|
+
isInvited?: boolean | undefined;
|
|
98
|
+
isSSO?: boolean | undefined;
|
|
99
|
+
defaultScenes?: GuardModuleType | undefined;
|
|
100
|
+
defaultInitData?: any;
|
|
101
|
+
showLoading?: boolean | undefined;
|
|
102
|
+
loadingComponent?: React.ReactNode;
|
|
103
|
+
openEventsMapping?: boolean | undefined;
|
|
104
|
+
disableRegister?: boolean | undefined;
|
|
105
|
+
registerMethods?: string[] | undefined;
|
|
106
|
+
defaultRegisterMethod?: string | undefined;
|
|
107
|
+
publicKey?: string | undefined;
|
|
108
|
+
agreementEnabled?: boolean | undefined;
|
|
109
|
+
agreements?: import("../Type").Agreement[] | undefined;
|
|
110
|
+
registerContext?: any;
|
|
111
|
+
logo?: string | undefined;
|
|
112
|
+
lang?: string | undefined;
|
|
113
|
+
langRange?: Lang[] | undefined;
|
|
114
|
+
host: string;
|
|
115
|
+
isHost?: boolean | undefined;
|
|
116
|
+
mode: import("../Type").GuardMode;
|
|
117
|
+
clickCloseable: boolean;
|
|
118
|
+
escCloseable: boolean;
|
|
119
|
+
userpool?: string | undefined;
|
|
120
|
+
contentCss?: string | undefined;
|
|
121
|
+
target?: string | HTMLElement | undefined;
|
|
122
|
+
style?: React.CSSProperties | undefined;
|
|
123
|
+
__internalRequest__?: boolean | undefined;
|
|
124
|
+
__singleComponent__?: boolean | undefined; /**
|
|
125
|
+
* 切换多账号 isMultipleAccount 状态
|
|
126
|
+
*/
|
|
127
|
+
__unAuthFlow__?: boolean | undefined;
|
|
128
|
+
autoRegister?: boolean | undefined;
|
|
129
|
+
disableResetPwd?: boolean | undefined;
|
|
130
|
+
defaultLoginMethod?: import("../Type").LoginMethods | undefined;
|
|
131
|
+
loginMethods?: import("../Type").LoginMethods[] | undefined;
|
|
132
|
+
passwordLoginMethods?: string[] | undefined;
|
|
133
|
+
socialConnections?: import("../Type").SocialConnectionProvider[] | undefined;
|
|
134
|
+
socialConnectionsBtnShape?: "button" | "default" | "icon" | undefined;
|
|
135
|
+
enterpriseConnections?: string[] | undefined;
|
|
136
|
+
qrCodeScanOptions?: {
|
|
137
|
+
extIdpConnId?: string | undefined;
|
|
138
|
+
autoExchangeUserInfo?: boolean | undefined;
|
|
139
|
+
size?: {
|
|
140
|
+
height: number;
|
|
141
|
+
width: number;
|
|
142
|
+
} | undefined;
|
|
143
|
+
containerSize?: {
|
|
144
|
+
height: number;
|
|
145
|
+
width: number;
|
|
146
|
+
} | undefined;
|
|
147
|
+
interval?: number | undefined;
|
|
148
|
+
onStart?: ((timer: any) => any) | undefined;
|
|
149
|
+
onResult?: ((data: import("authing-js-sdk/build/main/lib/authentication/types").QRCodeStatus) => any) | undefined;
|
|
150
|
+
onScanned?: ((userInfo: import("authing-js-sdk/build/main/lib/authentication/types").QRCodeUserInfo) => any) | undefined;
|
|
151
|
+
onSuccess?: ((userInfo: import("authing-js-sdk/build/main/lib/authentication/types").QRCodeUserInfo, ticket: string) => any) | undefined;
|
|
152
|
+
onCancel?: (() => any) | undefined;
|
|
153
|
+
onError?: ((message: string) => any) | undefined;
|
|
154
|
+
onExpired?: (() => any) | undefined;
|
|
155
|
+
onCodeShow?: ((random: string, url: string) => any) | undefined;
|
|
156
|
+
onCodeLoaded?: ((random: string, url: string) => any) | undefined;
|
|
157
|
+
onCodeLoadFailed?: ((message: string) => any) | undefined;
|
|
158
|
+
onCodeDestroyed?: ((random: string) => any) | undefined;
|
|
159
|
+
onRetry?: (() => any) | undefined;
|
|
160
|
+
onMfa?: ((code: number, message: string, data: Record<string, any>) => {}) | undefined;
|
|
161
|
+
tips?: {
|
|
162
|
+
title?: string | undefined;
|
|
163
|
+
scanned?: string | undefined;
|
|
164
|
+
succeed?: string | undefined;
|
|
165
|
+
canceled?: string | undefined;
|
|
166
|
+
expired?: string | undefined;
|
|
167
|
+
retry?: string | undefined;
|
|
168
|
+
failed?: string | undefined;
|
|
169
|
+
middleTitle?: string | undefined;
|
|
170
|
+
referText?: string | undefined;
|
|
171
|
+
} | undefined;
|
|
172
|
+
onAuthFlow?: ((flow: Record<string, any>) => {}) | undefined;
|
|
173
|
+
customData?: {
|
|
174
|
+
[x: string]: any;
|
|
175
|
+
} | undefined;
|
|
176
|
+
context?: {
|
|
177
|
+
[x: string]: any;
|
|
178
|
+
} | undefined;
|
|
179
|
+
withCustomData?: boolean | undefined;
|
|
180
|
+
} | undefined;
|
|
181
|
+
_closeLoopCheckQrcode?: boolean | undefined;
|
|
182
|
+
loginHint?: string | undefined;
|
|
183
|
+
goBack?: (() => void) | null | undefined;
|
|
184
|
+
};
|
|
94
185
|
export declare const useGuardContextLoaded: () => boolean;
|
|
95
186
|
export declare const useGuardIsAuthFlow: () => boolean;
|
|
96
187
|
export declare const useGuardPageConfig: () => Partial<GuardPageConfig>;
|
|
@@ -154,6 +245,63 @@ export declare const useGuardAccountSelectInstance: () => {
|
|
|
154
245
|
*/
|
|
155
246
|
clearBackFillData?: (() => void) | undefined;
|
|
156
247
|
};
|
|
248
|
+
export declare const useGuardMultipleInstance: () => {
|
|
249
|
+
/**
|
|
250
|
+
* 多账号相关
|
|
251
|
+
*/
|
|
252
|
+
isMultipleAccount: boolean;
|
|
253
|
+
/**
|
|
254
|
+
* when: 多账号页面跳转进入登录页面
|
|
255
|
+
* 携带的回填数据信息
|
|
256
|
+
*/
|
|
257
|
+
multipleAccountData?: BackFillMultipleState | undefined;
|
|
258
|
+
/**
|
|
259
|
+
* 多账号 store 实例
|
|
260
|
+
*/
|
|
261
|
+
instance?: {
|
|
262
|
+
initStore: (appId: string, options: {
|
|
263
|
+
serverSideLoginMethods: import("../Guard/core/hooks/useMultipleAccounts").LoginWay[];
|
|
264
|
+
isInternationSms: boolean;
|
|
265
|
+
}) => void;
|
|
266
|
+
setLoginWay: (tab: "input" | "qrcode", way: import("../Guard/core/hooks/useMultipleAccounts").LoginWay, id?: string | undefined, internation?: {
|
|
267
|
+
phoneCountryCode: string;
|
|
268
|
+
areaCode: string;
|
|
269
|
+
} | undefined) => void;
|
|
270
|
+
setUserInfo: (user: Omit<import("../Guard/core/hooks/useMultipleAccounts").User & {
|
|
271
|
+
id: string;
|
|
272
|
+
loginAccount?: string | undefined;
|
|
273
|
+
usertype?: string | undefined;
|
|
274
|
+
}, "way" | "tab" | "phoneCountryCode">) => void;
|
|
275
|
+
setLoginWayByHttpData: (account: string, data: {
|
|
276
|
+
username?: string | undefined;
|
|
277
|
+
phone?: string | undefined;
|
|
278
|
+
email?: string | undefined;
|
|
279
|
+
}) => void;
|
|
280
|
+
setLoginWayByLDAPData: (account: string, data: {
|
|
281
|
+
name?: string | undefined;
|
|
282
|
+
phone?: string | undefined;
|
|
283
|
+
email?: string | undefined;
|
|
284
|
+
}) => void;
|
|
285
|
+
getMemoUser: (excludeWays?: import("../Guard/core/hooks/useMultipleAccounts").LoginWay[]) => import("../Login/multipleAccounts/panel").SelectOptions[];
|
|
286
|
+
getMemoSingleUser: (id: string) => {
|
|
287
|
+
way: import("../Guard/core/hooks/useMultipleAccounts").LoginWay;
|
|
288
|
+
account: string;
|
|
289
|
+
} | undefined;
|
|
290
|
+
delUserById: (id: string) => string;
|
|
291
|
+
getMemberState: () => boolean;
|
|
292
|
+
getFirstBackFillData: () => BackFillMultipleState | undefined;
|
|
293
|
+
getOriginAccount: () => string;
|
|
294
|
+
getOriginWay: () => string;
|
|
295
|
+
} | undefined;
|
|
296
|
+
/**
|
|
297
|
+
* 切换多账号 isMultipleAccount 状态
|
|
298
|
+
*/
|
|
299
|
+
referMultipleState?: ((type: 'login' | 'multiple') => void) | undefined;
|
|
300
|
+
/**
|
|
301
|
+
* 清空回填数据
|
|
302
|
+
*/
|
|
303
|
+
clearBackFillData?: (() => void) | undefined;
|
|
304
|
+
};
|
|
157
305
|
export declare const useGuardPhoneRegex: () => RegExp | null;
|
|
158
306
|
/**
|
|
159
307
|
* 默认语言
|
|
@@ -163,5 +311,7 @@ export declare const useGuardDefaultLanguage: () => Lang;
|
|
|
163
311
|
export declare const useGuardTenantProvider: () => MultipleTenant | undefined;
|
|
164
312
|
/** 当前人机验证策略 */
|
|
165
313
|
export declare const useRobotVerify: () => "always_enable" | "disable" | "condition_set";
|
|
314
|
+
/** 当前用户池是否是国外用户池 */
|
|
315
|
+
export declare const useIsForeignUserpool: () => boolean;
|
|
166
316
|
/** 当前应用是否开启人机验证策略 */
|
|
167
317
|
export declare const useCaptchaCheck: (sence: 'login' | 'register') => boolean;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { CodeAction } from './responseManagement/interface';
|
|
2
2
|
import { AxiosRequestConfig } from 'axios';
|
|
3
3
|
export declare const requestClient: {
|
|
4
|
-
(input:
|
|
4
|
+
(input: URL | RequestInfo, init?: RequestInit | undefined): Promise<any>;
|
|
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>>;
|
|
@@ -19,7 +19,7 @@ export declare const requestClient: {
|
|
|
19
19
|
setTenantId(tenantId: string): void;
|
|
20
20
|
};
|
|
21
21
|
export interface AuthingResponse<T = any> {
|
|
22
|
-
code
|
|
22
|
+
code?: number;
|
|
23
23
|
statusCode?: number;
|
|
24
24
|
apiCode?: number;
|
|
25
25
|
data?: T;
|
|
@@ -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
|
}
|
|
@@ -14,7 +14,7 @@ export declare const validate: (type: keyof typeof VALIDATE_PATTERN, val: string
|
|
|
14
14
|
export declare const getRequiredRules: (msg: string) => Rule[];
|
|
15
15
|
export declare const fieldRequiredRule: (fieldRequiredRule: string, fieldRequiredRuleMessage?: string) => Rule[];
|
|
16
16
|
export declare function getDeviceName(): string | null | undefined;
|
|
17
|
-
export
|
|
17
|
+
export type STYLE_RECORD_KEY = 'appConfig' | 'userConfig';
|
|
18
18
|
export declare const insertStyles: (styles: string | any, recordKey?: STYLE_RECORD_KEY) => void;
|
|
19
19
|
export declare const removeStyles: (recordKey: STYLE_RECORD_KEY) => void;
|
|
20
20
|
export declare const getClassnames: (classnames: (string | boolean | undefined)[]) => string;
|
|
@@ -57,8 +57,10 @@ export declare const getPasswordValidateRules: (strength?: PasswordStrength, cus
|
|
|
57
57
|
export declare const sleep: (delay: number) => Promise<unknown>;
|
|
58
58
|
export declare const shoudGoToComplete: (user: User, contextType: ComplateFiledsPlace, config: ApplicationConfig | undefined, autoRegister?: boolean) => boolean;
|
|
59
59
|
export declare const transformMethod: (method: RegisterMethods | string) => string;
|
|
60
|
+
export declare const transformSortMethod: (method: RegisterSortMethods | string) => string;
|
|
60
61
|
export declare const mailDesensitization: (mail: string) => string;
|
|
61
62
|
export declare const phoneDesensitization: (phone: string) => string;
|
|
63
|
+
export declare const getHundreds: (num: number) => number;
|
|
62
64
|
export declare const GuardPropsFilter: (pre: GuardProps, current: GuardProps) => boolean;
|
|
63
65
|
export declare const getDocumentNode: (node: Node & ParentNode) => Document;
|
|
64
66
|
export declare const getLoginTypePipe: (publicConfig: ApplicationConfig, registerMethod: RegisterMethods) => {
|
|
@@ -12,18 +12,28 @@ export declare enum ApiCode {
|
|
|
12
12
|
MFA = 1635,
|
|
13
13
|
ABORT_FLOW = 1699,
|
|
14
14
|
COMPLETE_INFO = 1642,
|
|
15
|
-
TENANT_COMPLETE_INFO = 1645,
|
|
16
15
|
UNLOCK = 1643,
|
|
16
|
+
TENANT_COMPLETE_INFO = 1645,
|
|
17
17
|
FLOW_END = 1600,
|
|
18
18
|
FIRST_LOGIN_PASSWORD = 1639,
|
|
19
19
|
FORCED_PASSWORD_RESET = 2058,
|
|
20
20
|
UNSAFE_PASSWORD_TIP = 2061,
|
|
21
21
|
UNSAFE_PASSWORD_RESET = 2071,
|
|
22
22
|
FLOW_SELECT_ACCOUNT = 2921,
|
|
23
|
-
TENANT_PORTAL = 1644,
|
|
24
23
|
SELECT_ACCOUNT_2_LOGIN = 2930,
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
24
|
+
TENANT_PORTAL = 1644,
|
|
25
|
+
RESET_ACCOUNT_NAME = 1108,// 用户名重复
|
|
26
|
+
/**
|
|
27
|
+
* ey 登录协议条款
|
|
28
|
+
*/
|
|
29
|
+
EY_PROTOCOLS = 1008,
|
|
30
|
+
/**
|
|
31
|
+
* ey 邀请码过期
|
|
32
|
+
*/
|
|
33
|
+
EY_INVITE_EXPIRE = 4032,
|
|
34
|
+
/**
|
|
35
|
+
* 链接超时
|
|
36
|
+
*/
|
|
37
|
+
EY_LINK_EXPIRE = 4033
|
|
28
38
|
}
|
|
29
39
|
export declare const ChangeModuleApiCodeMapping: Record<string, GuardModuleType>;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export declare const generateRandomStr: (length?: number) => string;
|
|
2
|
+
export declare const md5: (text: string) => string;
|
|
3
|
+
export declare const signRequestParams: (params: Record<string, any>) => Record<string, any> & {
|
|
4
|
+
_random: string;
|
|
5
|
+
_timestamp: number;
|
|
6
|
+
} & {
|
|
7
|
+
_sign: string;
|
|
8
|
+
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@authing/guard-shim-react18",
|
|
3
|
-
"version": "4.5.40-
|
|
3
|
+
"version": "4.5.40-ey.1",
|
|
4
4
|
"description": "Guard shim for react 18, only be used to internal",
|
|
5
5
|
"types": "dist/typings/src/index.d.ts",
|
|
6
6
|
"module": "dist/guard.min.js",
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
"release:alpha": "npm publish --verbose --tag=alpha --access public"
|
|
15
15
|
},
|
|
16
16
|
"peerDependencies": {
|
|
17
|
-
"authing-js-sdk": "
|
|
17
|
+
"authing-js-sdk": "4.23.50"
|
|
18
18
|
},
|
|
19
19
|
"author": "https://github.com/authing",
|
|
20
20
|
"license": "MIT"
|