@authing/guard-shim-react 4.5.40-hep.16 → 4.5.40-hep.18

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.
@@ -250,7 +250,7 @@ declare class MultipleAccount {
250
250
  id: string;
251
251
  loginAccount?: string | undefined;
252
252
  usertype?: string | undefined;
253
- }, "way" | "tab" | "phoneCountryCode">) => void;
253
+ }, "tab" | "way" | "phoneCountryCode">) => void;
254
254
  setLoginWayByHttpData: (account: string, data: {
255
255
  username?: string | undefined;
256
256
  phone?: string | undefined;
@@ -294,7 +294,7 @@ declare const useSelectAccounts: ({ appId, finallyConfig }: {
294
294
  id: string;
295
295
  loginAccount?: string | undefined;
296
296
  usertype?: string | undefined;
297
- }, "way" | "tab" | "phoneCountryCode">) => void;
297
+ }, "tab" | "way" | "phoneCountryCode">) => void;
298
298
  setLoginWayByHttpData: (account: string, data: {
299
299
  username?: string | undefined;
300
300
  phone?: string | undefined;
@@ -0,0 +1,83 @@
1
+ import { React } from 'shim-react';
2
+ import { GuardEventsKebabToCamelType, GuardModuleType, GuardMode, IG2FCProps, IG2Config, User, Lang, AuthenticationClient } from '../';
3
+ export * from '../';
4
+ export interface GuardFactoryOptions extends IG2FCProps {
5
+ appId: string;
6
+ host?: string;
7
+ redirectUri?: string;
8
+ mode?: GuardMode;
9
+ defaultScene?: GuardModuleType;
10
+ tenantId?: string;
11
+ lang?: Lang;
12
+ isSSO?: boolean;
13
+ config?: Partial<IG2Config>;
14
+ style?: React.CSSProperties;
15
+ }
16
+ export interface GuardEventListeners {
17
+ [key: string]: Function[];
18
+ }
19
+ export interface StartWithRedirectOptions {
20
+ codeChallengeMethod?: 'S256' | 'plain';
21
+ scope?: string;
22
+ state?: string;
23
+ responseType?: 'code' | 'code id_token token' | 'code id_token' | 'code token' | 'id_token token' | 'id_token' | 'none';
24
+ responseMode?: 'query' | 'fragment' | 'form_post';
25
+ nonce?: string;
26
+ }
27
+ export interface LogoutParams {
28
+ redirectUri?: string;
29
+ quitCurrentDevice?: boolean;
30
+ }
31
+ export declare class GuardFactory {
32
+ options: GuardFactoryOptions;
33
+ private visible;
34
+ private then;
35
+ private publicConfig?;
36
+ constructor(options: GuardFactoryOptions);
37
+ private adaptOptions;
38
+ private getRequestHost;
39
+ private getPublicConfig;
40
+ getAuthClient(): Promise<AuthenticationClient>;
41
+ static getGuardContainer(selector?: string | HTMLElement): Element | null;
42
+ private eventListeners;
43
+ /**
44
+ * 启动嵌入模式
45
+ * @param el String
46
+ * @returns Promise
47
+ */
48
+ start(el?: string): Promise<User>;
49
+ startRegister(): void;
50
+ checkLoginStatus(): Promise<any | undefined>;
51
+ changeLang(lang: Lang): void;
52
+ changeContentCSS(contentCSS: string): void;
53
+ /**
54
+ * 启动跳转模式
55
+ */
56
+ startWithRedirect(options?: StartWithRedirectOptions): Promise<void>;
57
+ handleRedirectCallback(): Promise<void>;
58
+ private getAccessTokenByCode;
59
+ private getCodeAndCodeChallenge;
60
+ private setTokenCache;
61
+ private clearTokenCache;
62
+ private clearLoginCache;
63
+ private parseUrlQuery;
64
+ /**
65
+ * 获取当前用户信息
66
+ */
67
+ trackSession(): Promise<User | null>;
68
+ logout(params?: LogoutParams): Promise<void>;
69
+ render(): Promise<void | Element | React.Component<any, any, any>>;
70
+ on<T extends keyof GuardEventsKebabToCamelType>(evt: T, handler: (userInfo: User) => void): void;
71
+ show(): void;
72
+ hide(): void;
73
+ unmount(): void;
74
+ getCurrentView(): {
75
+ currentModule: any;
76
+ currentTab: any;
77
+ };
78
+ changeView(currentView: string): Promise<void>;
79
+ private getAgreementsContext;
80
+ checkAllAgreements(): void;
81
+ unCheckAllAgreements(): void;
82
+ }
83
+ export default GuardFactory;
@@ -39,7 +39,7 @@ declare function useLoginSelectAccount(setLoginWay: React.Dispatch<any>): {
39
39
  id: string;
40
40
  loginAccount?: string | undefined;
41
41
  usertype?: string | undefined;
42
- }, "way" | "tab" | "phoneCountryCode">) => void;
42
+ }, "tab" | "way" | "phoneCountryCode">) => void;
43
43
  setLoginWayByHttpData: (account: string, data: {
44
44
  username?: string | undefined;
45
45
  phone?: string | undefined;
@@ -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" | "default" | "icon" | undefined;
56
+ socialConnectionsBtnShape?: "default" | "button" | "icon" | undefined;
57
57
  enterpriseConnections?: string[] | undefined;
58
58
  qrCodeScanOptions?: {
59
59
  extIdpConnId?: string | undefined;
@@ -123,7 +123,7 @@ export declare const useGuardAccountSelectInstance: () => {
123
123
  id: string;
124
124
  loginAccount?: string | undefined;
125
125
  usertype?: string | undefined;
126
- }, "way" | "tab" | "phoneCountryCode">) => void;
126
+ }, "tab" | "way" | "phoneCountryCode">) => void;
127
127
  setLoginWayByHttpData: (account: string, data: {
128
128
  username?: string | undefined;
129
129
  phone?: string | undefined;
@@ -10,6 +10,7 @@ export declare const requestClient: {
10
10
  headers: any;
11
11
  }): Promise<AuthingResponse<T_2>>;
12
12
  baseUrl: string;
13
+ initialLanguage: string;
13
14
  setBaseUrl(base: string): void;
14
15
  langHeader: string;
15
16
  tenantHeader: string;
@@ -0,0 +1,4 @@
1
+ import { GuardFactory as GuardFactoryClass } from './GuardFactory';
2
+ export { GuardFactoryClass as GuardFactory, GuardFactoryClass as Guard };
3
+ export * from './GuardFactory';
4
+ export default GuardFactoryClass;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@authing/guard-shim-react",
3
- "version": "4.5.40-hep.16",
3
+ "version": "4.5.40-hep.18",
4
4
  "description": "Guard shim for react 16 / 17, only be used to internal",
5
5
  "types": "dist/typings/src/index.d.ts",
6
6
  "module": "dist/guard.min.js",