@authing/guard-shim-react18 4.4.0-alpha.8 → 4.5.0-alpha.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.
- package/dist/guard.min.css +1 -1
- package/dist/guard.min.js +5375 -4365
- package/dist/typings/src/CompleteInfo/interface.d.ts +1 -1
- package/dist/typings/src/Guard/Guard.d.ts +1 -2
- package/dist/typings/src/Guard/GuardModule/stateMachine.d.ts +1 -1
- package/dist/typings/src/Guard/core/hooks/useMultipleAccounts.d.ts +7 -5
- package/dist/typings/src/Guard/module.d.ts +1 -0
- package/dist/typings/src/Login/core/withAuthingOtpPush/types.d.ts +3 -3
- package/dist/typings/src/Login/core/withVerifyCode/index.d.ts +4 -0
- package/dist/typings/src/Login/hooks/useLoginMultiple.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/usePreQrCode.d.ts +2 -2
- package/dist/typings/src/Qrcode/index.d.ts +1 -1
- package/dist/typings/src/SelectAccount2Login/index.d.ts +2 -0
- package/dist/typings/src/Type/application.d.ts +8 -6
- package/dist/typings/src/ValidatorRules/index.d.ts +1 -1
- package/dist/typings/src/_utils/GuardErrorCode.d.ts +1 -0
- package/dist/typings/src/_utils/compute.d.ts +1 -0
- package/dist/typings/src/_utils/config/index.d.ts +1 -1
- package/dist/typings/src/_utils/context.d.ts +2 -1
- package/dist/typings/src/_utils/index.d.ts +1 -1
- package/dist/typings/src/_utils/responseManagement/interface.d.ts +1 -0
- package/package.json +4 -1
|
@@ -21,7 +21,7 @@ export interface GuardCompleteInfoViewProps extends GuardCompleteInfoProps {
|
|
|
21
21
|
initData: any;
|
|
22
22
|
onLogin?: any;
|
|
23
23
|
}
|
|
24
|
-
export type ExtendsFieldType = 'user' | 'internal';
|
|
24
|
+
export declare type ExtendsFieldType = 'user' | 'internal';
|
|
25
25
|
export interface ExtendsField {
|
|
26
26
|
type: ExtendsFieldType;
|
|
27
27
|
name: string;
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { React } from 'shim-react';
|
|
2
1
|
import { GuardEvents } from './event';
|
|
3
2
|
import { GuardAppendConfig, IG2FCProps } from '../Type';
|
|
4
3
|
import { GuardLocalConfig } from './config';
|
|
@@ -7,4 +6,4 @@ export interface GuardProps extends GuardEvents, IG2FCProps {
|
|
|
7
6
|
config?: Partial<GuardLocalConfig>;
|
|
8
7
|
appendConfig?: GuardAppendConfig;
|
|
9
8
|
}
|
|
10
|
-
export declare
|
|
9
|
+
export declare function Guard(props: GuardProps): JSX.Element;
|
|
@@ -14,7 +14,7 @@ export interface StateMachineLog {
|
|
|
14
14
|
date: number;
|
|
15
15
|
dataSource: ModuleState;
|
|
16
16
|
}
|
|
17
|
-
export type ChangeModuleEvent = (nextModule: GuardModuleType, initData?: any) => void;
|
|
17
|
+
export declare type ChangeModuleEvent = (nextModule: GuardModuleType, initData?: any) => void;
|
|
18
18
|
export declare class GuardStateMachine {
|
|
19
19
|
private order;
|
|
20
20
|
private config;
|
|
@@ -13,7 +13,7 @@ export declare const QR_CODE_WAY: LoginWay[];
|
|
|
13
13
|
* 登录时所有支持的登录列表(前端定义列表)
|
|
14
14
|
* 这里稍微有点乱 因为Login中的登录方式和这里的不匹配,暂时放在了一起
|
|
15
15
|
*/
|
|
16
|
-
export type LoginWay = 'email' | 'phone' | 'password' | 'phone-code' | 'email-code' | 'social' | 'wechat-miniprogram-qrcode' | 'wechatmp-qrcode' | 'app-qrcode' | 'ad' | 'ldap' | 'ldap-password' | 'ldap-email' | 'ldap-phone' | 'authing-otp-push';
|
|
16
|
+
export declare type LoginWay = 'email' | 'phone' | 'password' | 'phone-code' | 'email-code' | 'social' | 'wechat-miniprogram-qrcode' | 'wechatmp-qrcode' | 'app-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 type StoreInstance = ReturnType<MultipleAccount['getStore']>;
|
|
30
|
+
export declare type StoreInstance = ReturnType<MultipleAccount['getStore']>;
|
|
31
31
|
/**
|
|
32
32
|
* 当前 userId 对应的类型
|
|
33
33
|
*/
|
|
@@ -249,7 +249,8 @@ declare class MultipleAccount {
|
|
|
249
249
|
setUserInfo: (user: Omit<User & {
|
|
250
250
|
id: string;
|
|
251
251
|
loginAccount?: string | undefined;
|
|
252
|
-
|
|
252
|
+
usertype?: string | undefined;
|
|
253
|
+
}, "tab" | "way" | "phoneCountryCode">) => void;
|
|
253
254
|
setLoginWayByHttpData: (account: string, data: {
|
|
254
255
|
username?: string | undefined;
|
|
255
256
|
phone?: string | undefined;
|
|
@@ -276,7 +277,7 @@ declare class MultipleAccount {
|
|
|
276
277
|
* MultipleAccounts 相关 Hook
|
|
277
278
|
* Finally Config 类型过滤
|
|
278
279
|
*/
|
|
279
|
-
declare const useMultipleAccounts: ({ appId, finallyConfig
|
|
280
|
+
declare const useMultipleAccounts: ({ appId, finallyConfig }: {
|
|
280
281
|
appId?: string | undefined;
|
|
281
282
|
finallyConfig?: any;
|
|
282
283
|
}) => {
|
|
@@ -292,7 +293,8 @@ declare const useMultipleAccounts: ({ appId, finallyConfig, }: {
|
|
|
292
293
|
setUserInfo: (user: Omit<User & {
|
|
293
294
|
id: string;
|
|
294
295
|
loginAccount?: string | undefined;
|
|
295
|
-
|
|
296
|
+
usertype?: string | undefined;
|
|
297
|
+
}, "tab" | "way" | "phoneCountryCode">) => void;
|
|
296
298
|
setLoginWayByHttpData: (account: string, data: {
|
|
297
299
|
username?: string | undefined;
|
|
298
300
|
phone?: string | undefined;
|
|
@@ -24,6 +24,7 @@ export declare enum GuardModuleType {
|
|
|
24
24
|
/** 多租户门户选择页 */
|
|
25
25
|
TENANT_PORTAL = "tenant-portal",
|
|
26
26
|
New_SUBMIT_SUCCESS = "newSubmitSuccess",
|
|
27
|
+
SELECT_ACCOUNT_2_LOGIN = "selectAccout2Login",
|
|
27
28
|
RESET_ACCOUNT_NAME = "resetAccountName"
|
|
28
29
|
}
|
|
29
30
|
export interface GuardModuleAction {
|
|
@@ -9,7 +9,7 @@ export interface CheckPushCodeStatusProps {
|
|
|
9
9
|
export interface OnLoginProps {
|
|
10
10
|
account: string;
|
|
11
11
|
}
|
|
12
|
-
export type LoginStatus = 'before' | 'pending';
|
|
12
|
+
export declare type LoginStatus = 'before' | 'pending';
|
|
13
13
|
export interface LoginWithAuthingOtpPushProps {
|
|
14
14
|
onLoginSuccess?: any;
|
|
15
15
|
multipleInstance?: StoreInstance;
|
|
@@ -20,9 +20,9 @@ export interface PushLoginGudeModalProps {
|
|
|
20
20
|
visible: boolean;
|
|
21
21
|
onClose: () => void;
|
|
22
22
|
}
|
|
23
|
-
export type Selector = 'howUsePushLogin' | 'howBindClient' | 'howGetAppLoginUrl';
|
|
23
|
+
export declare type Selector = 'howUsePushLogin' | 'howBindClient' | 'howGetAppLoginUrl';
|
|
24
24
|
export interface SelectorOption {
|
|
25
25
|
value: Selector;
|
|
26
26
|
label: string;
|
|
27
27
|
}
|
|
28
|
-
export type SelectorOptions = SelectorOption[];
|
|
28
|
+
export declare type SelectorOptions = SelectorOption[];
|
|
@@ -35,7 +35,8 @@ declare function useLoginMultiple(setLoginWay: React.Dispatch<any>): {
|
|
|
35
35
|
setUserInfo: (user: Omit<import("../../Guard/core/hooks/useMultipleAccounts").User & {
|
|
36
36
|
id: string;
|
|
37
37
|
loginAccount?: string | undefined;
|
|
38
|
-
|
|
38
|
+
usertype?: string | undefined;
|
|
39
|
+
}, "tab" | "way" | "phoneCountryCode">) => void;
|
|
39
40
|
setLoginWayByHttpData: (account: string, data: {
|
|
40
41
|
username?: string | undefined;
|
|
41
42
|
phone?: string | undefined;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { React } from 'shim-react';
|
|
2
2
|
import './index.less';
|
|
3
3
|
import { CodeStatusDescriptions } from './WorkQrCode';
|
|
4
|
-
export type CodeStatus = 'loading' | 'ready' | 'already' | 'success' | 'error' | 'expired' | 'cancel' | 'MFA';
|
|
4
|
+
export declare 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 type CodeStatusDescriptions = Partial<Record<Exclude<CodeStatus, 'loading'>, React.ReactNode | ((referQrCode?: () => void) => React.ReactNode)>>;
|
|
7
|
+
export declare 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 type ReducerType = 'change' | 'changeStatus' | 'changeDesc';
|
|
4
|
-
export type RootState = {
|
|
3
|
+
export declare type ReducerType = 'change' | 'changeStatus' | 'changeDesc';
|
|
4
|
+
export declare type RootState = {
|
|
5
5
|
/**
|
|
6
6
|
* 状态
|
|
7
7
|
*/
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export type Lang = 'zh-CN' | 'en-US' | 'zh-TW' | 'ja-JP';
|
|
1
|
+
export declare type Lang = 'zh-CN' | 'en-US' | 'zh-TW' | 'ja-JP';
|
|
2
2
|
import { PasswordStrength } from '../_utils';
|
|
3
3
|
export * from 'authing-js-sdk';
|
|
4
4
|
export declare enum LoginMethods {
|
|
@@ -6,6 +6,7 @@ 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",
|
|
@@ -114,7 +115,7 @@ export interface QrCodeItem {
|
|
|
114
115
|
title: string;
|
|
115
116
|
isDefault?: boolean;
|
|
116
117
|
}
|
|
117
|
-
export type QrcodeTabsSettings = Record<LoginMethods, Array<QrCodeItem>>;
|
|
118
|
+
export declare type QrcodeTabsSettings = Record<LoginMethods, Array<QrCodeItem>>;
|
|
118
119
|
export interface OidcClientMetadata {
|
|
119
120
|
grant_types: string[];
|
|
120
121
|
client_id: string;
|
|
@@ -149,7 +150,7 @@ export interface UserExtendsField {
|
|
|
149
150
|
required: boolean;
|
|
150
151
|
validateRules: any[];
|
|
151
152
|
}
|
|
152
|
-
export type ExtendsField = InternalExtendsField | UserExtendsField;
|
|
153
|
+
export declare type ExtendsField = InternalExtendsField | UserExtendsField;
|
|
153
154
|
export interface ApplicationPasswordTabConfig {
|
|
154
155
|
enabledLoginMethods?: PasswordLoginMethods[];
|
|
155
156
|
validRegisterMethods?: string[];
|
|
@@ -167,9 +168,9 @@ export interface Agreement {
|
|
|
167
168
|
lang: Lang;
|
|
168
169
|
availableAt?: number;
|
|
169
170
|
}
|
|
170
|
-
export type PasswordLoginMethods = 'username-password' | 'email-password' | 'phone-password';
|
|
171
|
-
export type VerifyLoginMethods = 'email-code' | 'phone-code';
|
|
172
|
-
export type ComplateFiledsPlace = 'register' | 'login';
|
|
171
|
+
export declare type PasswordLoginMethods = 'username-password' | 'email-password' | 'phone-password';
|
|
172
|
+
export declare type VerifyLoginMethods = 'email-code' | 'phone-code';
|
|
173
|
+
export declare type ComplateFiledsPlace = 'register' | 'login';
|
|
173
174
|
export interface TabFieldsI18nItem {
|
|
174
175
|
key: string;
|
|
175
176
|
label: string;
|
|
@@ -203,6 +204,7 @@ export interface ApplicationConfig {
|
|
|
203
204
|
name: string;
|
|
204
205
|
logo: string;
|
|
205
206
|
description?: string;
|
|
207
|
+
deviceFuncEnabled?: boolean;
|
|
206
208
|
redirectUris: string[];
|
|
207
209
|
registerDisabled: boolean;
|
|
208
210
|
mergeAdAndAccountPasswordLogin: boolean;
|
|
@@ -21,7 +21,7 @@ export interface ValidatorFormItemMetaProps extends ValidatorFormItemProps {
|
|
|
21
21
|
export interface ICheckProps {
|
|
22
22
|
check: (values: any) => void;
|
|
23
23
|
}
|
|
24
|
-
type InternalFormItemType = typeof Form.Item;
|
|
24
|
+
declare type InternalFormItemType = typeof Form.Item;
|
|
25
25
|
interface FormItemInterface extends InternalFormItemType {
|
|
26
26
|
Password: typeof PasswordFormItem;
|
|
27
27
|
Email: typeof EmailFormItem;
|
|
@@ -17,3 +17,4 @@ export declare const isBaiduBrowser: () => boolean | null;
|
|
|
17
17
|
export declare const isWeComeBrowser: () => boolean;
|
|
18
18
|
export declare const isMobile: () => RegExpMatchArray | null;
|
|
19
19
|
export declare const isSpecialBrowser: () => boolean;
|
|
20
|
+
export declare const getPhoneInLoginPageContext: () => any;
|
|
@@ -53,7 +53,7 @@ export declare const useFetchConsoleConfig: (forceUpdate: number, appId?: string
|
|
|
53
53
|
loginMethods?: LoginMethods[] | undefined;
|
|
54
54
|
passwordLoginMethods?: string[] | undefined;
|
|
55
55
|
socialConnections?: import("../../Type").SocialConnectionProvider[] | undefined;
|
|
56
|
-
socialConnectionsBtnShape?: "button" | "
|
|
56
|
+
socialConnectionsBtnShape?: "button" | "icon" | "default" | undefined;
|
|
57
57
|
enterpriseConnections?: string[] | undefined;
|
|
58
58
|
qrCodeScanOptions?: {
|
|
59
59
|
extIdpConnId?: string | undefined;
|
|
@@ -121,7 +121,8 @@ export declare const useGuardMultipleInstance: () => {
|
|
|
121
121
|
setUserInfo: (user: Omit<import("../Guard/core/hooks/useMultipleAccounts").User & {
|
|
122
122
|
id: string;
|
|
123
123
|
loginAccount?: string | undefined;
|
|
124
|
-
|
|
124
|
+
usertype?: string | undefined;
|
|
125
|
+
}, "tab" | "way" | "phoneCountryCode">) => void;
|
|
125
126
|
setLoginWayByHttpData: (account: string, data: {
|
|
126
127
|
username?: string | undefined;
|
|
127
128
|
phone?: string | undefined;
|
|
@@ -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 type STYLE_RECORD_KEY = 'appConfig' | 'userConfig';
|
|
18
|
+
export declare 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;
|
|
@@ -20,6 +20,7 @@ export declare enum ApiCode {
|
|
|
20
20
|
UNSAFE_PASSWORD_RESET = 2071,
|
|
21
21
|
FLOW_SELECT_ACCOUNT = 2921,
|
|
22
22
|
TENANT_PORTAL = 1644,
|
|
23
|
+
SELECT_ACCOUNT_2_LOGIN = 2930,
|
|
23
24
|
RESET_ACCOUNT_NAME = 1108
|
|
24
25
|
}
|
|
25
26
|
export declare const ChangeModuleApiCodeMapping: Record<string, GuardModuleType>;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@authing/guard-shim-react18",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.5.0-alpha.0",
|
|
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",
|
|
@@ -13,6 +13,9 @@
|
|
|
13
13
|
"release:official": "npm publish --verbose --access public",
|
|
14
14
|
"release:alpha": "npm publish --verbose --tag=alpha --access public"
|
|
15
15
|
},
|
|
16
|
+
"peerDependencies": {
|
|
17
|
+
"authing-js-sdk": "^4.23.44"
|
|
18
|
+
},
|
|
16
19
|
"author": "https://github.com/authing",
|
|
17
20
|
"license": "MIT"
|
|
18
21
|
}
|