@authing/react-ui-components 3.1.39-beta.0 → 3.1.39-hep.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 (29) hide show
  1. package/dist/asset-manifest.json +18 -18
  2. package/dist/index.html +1 -1
  3. package/dist/static/css/{2.57a1f26c.chunk.css → 2.2cdfb9d1.chunk.css} +2 -2
  4. package/dist/static/css/2.2cdfb9d1.chunk.css.map +1 -0
  5. package/dist/static/css/main.f438f284.chunk.css +2 -0
  6. package/dist/static/css/main.f438f284.chunk.css.map +1 -0
  7. package/dist/static/js/2.9a1287ca.chunk.js +3 -0
  8. package/dist/static/js/{2.63f335a3.chunk.js.LICENSE.txt → 2.9a1287ca.chunk.js.LICENSE.txt} +9 -0
  9. package/dist/static/js/2.9a1287ca.chunk.js.map +1 -0
  10. package/dist/static/js/{3.260dce9f.chunk.js → 3.d3328d89.chunk.js} +2 -2
  11. package/dist/static/js/{3.260dce9f.chunk.js.map → 3.d3328d89.chunk.js.map} +1 -1
  12. package/dist/static/js/main.5735e6f1.chunk.js +2 -0
  13. package/dist/static/js/main.5735e6f1.chunk.js.map +1 -0
  14. package/dist/static/js/{runtime-main.44af0a43.js → runtime-main.e75981a3.js} +2 -2
  15. package/dist/static/js/{runtime-main.44af0a43.js.map → runtime-main.e75981a3.js.map} +1 -1
  16. package/lib/index.d.ts +702 -241
  17. package/lib/index.min.css +1 -1
  18. package/lib/index.min.js +1 -1
  19. package/lib/index.min.js.LICENSE.txt +8 -5
  20. package/package.json +3 -4
  21. package/dist/static/css/2.57a1f26c.chunk.css.map +0 -1
  22. package/dist/static/css/main.766cd019.chunk.css +0 -2
  23. package/dist/static/css/main.766cd019.chunk.css.map +0 -1
  24. package/dist/static/js/2.63f335a3.chunk.js +0 -3
  25. package/dist/static/js/2.63f335a3.chunk.js.map +0 -1
  26. package/dist/static/js/main.fa2f9a3d.chunk.js +0 -2
  27. package/dist/static/js/main.fa2f9a3d.chunk.js.map +0 -1
  28. package/lib/static/media/checkbox-circle-fill.9f67ded4.svg +0 -3
  29. package/lib/static/media/refer-qr-code.a678aa6f.svg +0 -3
package/lib/index.d.ts CHANGED
@@ -1,3 +1,53 @@
1
+ declare module '@authing/react-ui-components/components/AccountMerge/UserRadio' {
2
+ import React from 'react';
3
+ import { UserRadioItemProps, UserRadioProps } from '@authing/react-ui-components/components/AccountMerge/interface';
4
+ import './styles.less';
5
+ export const UserRadioItem: React.FC<UserRadioItemProps>;
6
+ export const UserRadio: React.FC<UserRadioProps>;
7
+
8
+ }
9
+ declare module '@authing/react-ui-components/components/AccountMerge/index' {
10
+ import React from 'react';
11
+ import './styles.less';
12
+ export const GuardAccountMergeView: React.FC;
13
+
14
+ }
15
+ declare module '@authing/react-ui-components/components/AccountMerge/interface' {
16
+ export interface BriefUserInfo {
17
+ displayName: string;
18
+ avatar: string;
19
+ phone: string;
20
+ email: string;
21
+ username: string;
22
+ name: string;
23
+ }
24
+ export interface GuardAccountMergeInitData {
25
+ currentUserInfo: BriefUserInfo;
26
+ existingUserInfo: BriefUserInfo;
27
+ mergeToken?: string;
28
+ }
29
+ export interface UserRadioProps {
30
+ currentUserInfo: BriefUserInfo;
31
+ existingUserInfo: BriefUserInfo;
32
+ onChange?: (value: any) => void;
33
+ value?: any;
34
+ }
35
+ export interface UserRadioItemProps extends BriefUserInfo {
36
+ value: boolean;
37
+ selected: boolean;
38
+ onClick: (value: boolean) => void;
39
+ }
40
+ export enum AuthFlowAction {
41
+ MERGE = "confirm-account-merge"
42
+ }
43
+
44
+ }
45
+ declare module '@authing/react-ui-components/components/AccountMerge/utils' {
46
+ import { User } from 'authing-js-sdk';
47
+ export const getDisplayName: (user: User) => string;
48
+ export const getDisplayNameByEmail: (displayName: string) => string;
49
+
50
+ }
1
51
  declare module '@authing/react-ui-components/components/AuthClientProvider/AuthClientProvider' {
2
52
  import React from 'react';
3
53
  import { AuthClientContextProps } from '@authing/react-ui-components/components/AuthClientProvider/context';
@@ -520,6 +570,9 @@ declare module '@authing/react-ui-components/components/AuthingGuard/api/appConf
520
570
  verifyCodeLength: number;
521
571
  websocket: string;
522
572
  welcomeMessage: any;
573
+ userPortal?: {
574
+ mergeAccount?: boolean;
575
+ };
523
576
  skipComplateFileds: boolean;
524
577
  selfUnlockStrategy: 'captcha' | 'password-captcha';
525
578
  }
@@ -1261,6 +1314,7 @@ declare module '@authing/react-ui-components/components/CompleteInfo/index' {
1261
1314
  }>;
1262
1315
  export const GuardLoginCompleteInfoView: React.FC;
1263
1316
  export const GuardRegisterCompleteInfoView: React.FC;
1317
+ export const GuardAccountMergeCompleteInfoView: React.FC;
1264
1318
 
1265
1319
  }
1266
1320
  declare module '@authing/react-ui-components/components/CompleteInfo/interface' {
@@ -1273,19 +1327,21 @@ declare module '@authing/react-ui-components/components/CompleteInfo/interface'
1273
1327
  onRegisterInfoCompleted?: (user: User, udfs: {
1274
1328
  definition: any;
1275
1329
  value: any;
1276
- }[], authClient: AuthenticationClient) => void;
1330
+ }[], authClient: AuthenticationClient, opts?: {
1331
+ phone?: string;
1332
+ canMergeUser?: boolean;
1333
+ }) => void;
1277
1334
  onRegisterInfoCompletedError?: (error: CommonMessage, udfs: {
1278
1335
  definition: any;
1279
1336
  value: any;
1280
1337
  }[], authClient: AuthenticationClient) => void;
1338
+ onAccountMergeCompleteInfo?: (user: User) => void;
1281
1339
  }
1282
1340
  export interface GuardCompleteInfoProps extends IG2FCProps, CompleteInfoEvents {
1283
1341
  config: Partial<CompleteInfoConfig>;
1284
1342
  }
1285
1343
  export interface GuardCompleteInfoViewProps extends GuardCompleteInfoProps {
1286
1344
  config: CompleteInfoConfig;
1287
- initData: any;
1288
- onLogin?: any;
1289
1345
  }
1290
1346
  export type ExtendsFieldType = 'user' | 'internal';
1291
1347
  export interface ExtendsField {
@@ -1318,6 +1374,7 @@ declare module '@authing/react-ui-components/components/CompleteInfo/interface'
1318
1374
  name: string;
1319
1375
  required: boolean;
1320
1376
  validateRules: CompleteInfoRule[];
1377
+ checkUnique?: boolean;
1321
1378
  options?: CompleteInfoSelectOption[];
1322
1379
  }
1323
1380
  export enum CompleteInfoBaseControls {
@@ -1575,6 +1632,329 @@ declare module '@authing/react-ui-components/components/Guard/config' {
1575
1632
  }
1576
1633
  export const getDefaultGuardLocalConfig: () => GuardLocalConfig;
1577
1634
 
1635
+ }
1636
+ declare module '@authing/react-ui-components/components/Guard/core/hooks/useMultipleAccounts' {
1637
+ /**
1638
+ * 整体的思路:
1639
+ * 在所有登录方式中,当进行登录时保存登录方式(FE侧自定义)
1640
+ * 之后在登录成功(onLogin)中,触发store的方法保存用户信息以及对应的登录方式进入localStorage。
1641
+ * 当用户再次打开页面时,拿出数据进行对比。(主要对比 LoginWay ),TODO: 这里的代码主要显得乱的原因是因为枚举的不正当使用。(主要要和Server端进行互相映射,后续维护时可优化)
1642
+ *
1643
+ * 核心思路:登录成功时,保存的FE侧自定义 LoginWay
1644
+ * 再次打开页面时,初始化时先根据 FE 自定义的 LoginWay 跳转到不同的 tab 下(way)下使用 account 进行回填。TODO: 这里也可优化,应该在登录成功时候就进行 LoginWay 的格式化,而非转来转去。(但是这样无法直观的体现是哪种方式进行登录)
1645
+ */
1646
+ import { SelectOptions } from '@authing/react-ui-components/components/Login/multipleAccounts/panel';
1647
+ export const QR_CODE_WAY: LoginWay[];
1648
+ /**
1649
+ * 登录时所有支持的登录列表(前端定义列表)
1650
+ * 这里稍微有点乱 因为Login中的登录方式和这里的不匹配,暂时放在了一起
1651
+ */
1652
+ 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';
1653
+ /**
1654
+ * when: 多账号页面跳转进入登录页面
1655
+ * 携带的回填数据信息
1656
+ */
1657
+ export interface BackFillMultipleState extends Omit<User, 'id' | 'name' | 'nickname' | 'username' | 'phone' | 'email' | 'photo' | '_updateTime'> {
1658
+ /**
1659
+ * 回填的账号名称 邮箱/用户名/手机
1660
+ */
1661
+ account: string;
1662
+ }
1663
+ /**
1664
+ * Store instance
1665
+ */
1666
+ export type StoreInstance = ReturnType<MultipleAccount['getStore']>;
1667
+ /**
1668
+ * 当前 userId 对应的类型
1669
+ */
1670
+ export interface CurrentStore {
1671
+ [id: string]: User;
1672
+ }
1673
+ export interface User {
1674
+ /**
1675
+ * userId
1676
+ */
1677
+ id: string;
1678
+ /**
1679
+ * Tab 栏状态
1680
+ */
1681
+ tab: 'input' | 'qrcode';
1682
+ /**
1683
+ * 登录方式
1684
+ */
1685
+ way: LoginWay;
1686
+ /**
1687
+ * 姓名
1688
+ */
1689
+ name?: string | null;
1690
+ /**
1691
+ * 昵称
1692
+ */
1693
+ nickname?: string | null;
1694
+ /**
1695
+ * 用户名
1696
+ */
1697
+ username?: string | null;
1698
+ /**
1699
+ * 手机号
1700
+ */
1701
+ phone?: string | null;
1702
+ /**
1703
+ * 邮箱
1704
+ */
1705
+ email?: string | null;
1706
+ /**
1707
+ * 头像
1708
+ */
1709
+ photo?: string | null;
1710
+ /**
1711
+ * qrCodeId 对应的ID
1712
+ */
1713
+ qrCodeId?: string;
1714
+ /**
1715
+ * 国际化短信区号
1716
+ */
1717
+ phoneCountryCode?: string;
1718
+ /**
1719
+ * 国际化短信选择框回填
1720
+ */
1721
+ areaCode?: string;
1722
+ /**
1723
+ * 登录时间
1724
+ */
1725
+ _updateTime?: string;
1726
+ }
1727
+ class MultipleAccount {
1728
+ /**
1729
+ * 原始的登录账号
1730
+ */
1731
+ private originAccount;
1732
+ private originWay;
1733
+ /**
1734
+ * 原始的 localStore 值
1735
+ */
1736
+ private originStore;
1737
+ /**
1738
+ * 当前 AppId Store
1739
+ */
1740
+ private currentStore;
1741
+ /**
1742
+ * 单账号直接回填
1743
+ */
1744
+ private firstBackFillData?;
1745
+ /**
1746
+ * server 返回支持的登录方式
1747
+ */
1748
+ private serverSideLoginMethods;
1749
+ /**
1750
+ * 是否显示多账号登录页面
1751
+ * true 存在
1752
+ */
1753
+ private memberState;
1754
+ /**
1755
+ * 二维码登录时的ID
1756
+ */
1757
+ private qrCodeId?;
1758
+ /**
1759
+ * 国际化短信前缀 区号
1760
+ */
1761
+ private phoneCountryCode?;
1762
+ /**
1763
+ * 国际化短信前缀 选中地区编号
1764
+ */
1765
+ private areaCode?;
1766
+ private tabStatus?;
1767
+ /**
1768
+ * 当前登录二级状态
1769
+ */
1770
+ private loginWay?;
1771
+ private appId;
1772
+ /**
1773
+ * 是否开启国际化短信
1774
+ */
1775
+ private isInternationSms?;
1776
+ constructor();
1777
+ /**
1778
+ * 页面首次加载时初始化 Store
1779
+ * 从 LocalStore 中拿值 放到这里来
1780
+ */
1781
+ private initStore;
1782
+ /**
1783
+ * 初始化记住账号相关信息
1784
+ * @param normalCount
1785
+ * @returns
1786
+ */
1787
+ private initMemberState;
1788
+ /**
1789
+ * 获取当前ID下有效账号个数
1790
+ * @returns qrCount 有效的二维码登录个数 normalCount 有效的账号登录方式
1791
+ */
1792
+ private memberStateCount;
1793
+ /**
1794
+ * 初始化第一次的数据 TODO: 逻辑有点脏 待整理
1795
+ */
1796
+ private initBackfillData;
1797
+ /**
1798
+ * 根据前端存储的登录方式返回后端映射方式
1799
+ * @param front
1800
+ */
1801
+ private getServerLoginMethodByFront;
1802
+ /**
1803
+ * 当前 Store DONE
1804
+ */
1805
+ private getCurrentStore;
1806
+ /**
1807
+ * 国际化短信过滤
1808
+ * true 表示通过 需要保留
1809
+ * false 表示不通过 需要过滤
1810
+ */
1811
+ private validateInternationSms;
1812
+ /**
1813
+ * 校验有效的登录方式账号
1814
+ * @param user
1815
+ * @param serverSideLoginMethods
1816
+ * @returns
1817
+ */
1818
+ private validateMethod;
1819
+ /**
1820
+ *
1821
+ * @param tab 一级Tab状态
1822
+ * @param way 二级Tab状态
1823
+ * @param id 二维码登录时 记录对应的二维码 ID
1824
+ */
1825
+ private setLoginWay;
1826
+ /**
1827
+ * 设置/更新 store 内的用户信息
1828
+ */
1829
+ private setUserInfo;
1830
+ /**
1831
+ * 持久化保存
1832
+ */
1833
+ private saveStore;
1834
+ /**
1835
+ * 根据登录的 account 判断本次登录的方式
1836
+ * @param account 登录输入的账号
1837
+ * @param param1 登录成功返回的相关信息 用户名/手机号/邮箱
1838
+ * @returns
1839
+ */
1840
+ private setLoginWayByHttpData;
1841
+ /**
1842
+ * 根据登录的 account 判断本次LDAP登录方式
1843
+ * @param account 登录输入的账号
1844
+ * @param param1 登录成功返回的相关信息 用户名/手机号/邮箱
1845
+ * @returns
1846
+ */
1847
+ private setLoginWayByLDAPData;
1848
+ /**
1849
+ * 根据用户 ID 删除 localStorage 中当前用户 ID
1850
+ */
1851
+ private delUserById;
1852
+ /**
1853
+ * 获得多账号登录页面的所有用户列表
1854
+ * @param excludeWays
1855
+ */
1856
+ private getMemoUser;
1857
+ /**
1858
+ * 根据 id 获得当前已登录的用户信息
1859
+ * @param userId
1860
+ * @returns User / undefined
1861
+ */
1862
+ private getMemoSingleUser;
1863
+ /**
1864
+ * 该方法仅仅需要回填账号的登录方式,其他都不计入
1865
+ * 当用户名/手机号/邮箱/AD/LDAP 相同时,根据登录顺序匹配不同的账号
1866
+ * 根据记住的用户登录方式获取对应的登录账户名
1867
+ * @param way
1868
+ * @param user
1869
+ * @returns
1870
+ */
1871
+ private getAccountByWay;
1872
+ private _mappingUser;
1873
+ /**
1874
+ * 外部暴露方法
1875
+ */
1876
+ getStore: () => {
1877
+ initStore: (appId: string, options: {
1878
+ serverSideLoginMethods: LoginWay[];
1879
+ isInternationSms: boolean;
1880
+ }) => void;
1881
+ setLoginWay: (tab: 'input' | 'qrcode', way: LoginWay, id?: string | undefined, internation?: {
1882
+ phoneCountryCode: string;
1883
+ areaCode: string;
1884
+ } | undefined) => void;
1885
+ setUserInfo: (user: Pick<User & {
1886
+ id: string;
1887
+ }, "email" | "username" | "phone" | "id" | "nickname" | "photo" | "name" | "_updateTime" | "qrCodeId" | "areaCode">) => void;
1888
+ setLoginWayByHttpData: (account: string, data: {
1889
+ username?: string | undefined;
1890
+ phone?: string | undefined;
1891
+ email?: string | undefined;
1892
+ }) => void;
1893
+ setLoginWayByLDAPData: (account: string, data: {
1894
+ name?: string | undefined;
1895
+ phone?: string | undefined;
1896
+ email?: string | undefined;
1897
+ }) => void;
1898
+ getMemoUser: (excludeWays?: LoginWay[]) => SelectOptions[];
1899
+ getMemoSingleUser: (id: string) => {
1900
+ way: LoginWay;
1901
+ account: string;
1902
+ } | undefined;
1903
+ delUserById: (id: string) => string;
1904
+ getMemberState: () => boolean;
1905
+ getFirstBackFillData: () => BackFillMultipleState | undefined;
1906
+ getOriginAccount: () => string;
1907
+ getOriginWay: () => string;
1908
+ };
1909
+ }
1910
+ /**
1911
+ * MultipleAccounts 相关 Hook
1912
+ * Finally Config 类型过滤
1913
+ */
1914
+ const useMultipleAccounts: ({ appId, finallyConfig }: {
1915
+ appId?: string | undefined;
1916
+ finallyConfig?: any;
1917
+ }) => {
1918
+ instance: {
1919
+ initStore: (appId: string, options: {
1920
+ serverSideLoginMethods: LoginWay[];
1921
+ isInternationSms: boolean;
1922
+ }) => void;
1923
+ setLoginWay: (tab: 'input' | 'qrcode', way: LoginWay, id?: string | undefined, internation?: {
1924
+ phoneCountryCode: string;
1925
+ areaCode: string;
1926
+ } | undefined) => void;
1927
+ setUserInfo: (user: Pick<User & {
1928
+ id: string;
1929
+ }, "email" | "username" | "phone" | "id" | "nickname" | "photo" | "name" | "_updateTime" | "qrCodeId" | "areaCode">) => void;
1930
+ setLoginWayByHttpData: (account: string, data: {
1931
+ username?: string | undefined;
1932
+ phone?: string | undefined;
1933
+ email?: string | undefined;
1934
+ }) => void;
1935
+ setLoginWayByLDAPData: (account: string, data: {
1936
+ name?: string | undefined;
1937
+ phone?: string | undefined;
1938
+ email?: string | undefined;
1939
+ }) => void;
1940
+ getMemoUser: (excludeWays?: LoginWay[]) => SelectOptions[];
1941
+ getMemoSingleUser: (id: string) => {
1942
+ way: LoginWay;
1943
+ account: string;
1944
+ } | undefined;
1945
+ delUserById: (id: string) => string;
1946
+ getMemberState: () => boolean;
1947
+ getFirstBackFillData: () => BackFillMultipleState | undefined;
1948
+ getOriginAccount: () => string;
1949
+ getOriginWay: () => string;
1950
+ } | undefined;
1951
+ isMultipleAccount: boolean;
1952
+ referMultipleState: (type: 'login' | 'multiple', data?: BackFillMultipleState | undefined) => void;
1953
+ multipleAccountData: BackFillMultipleState | undefined;
1954
+ clearBackFillData: () => void;
1955
+ };
1956
+ export default useMultipleAccounts;
1957
+
1578
1958
  }
1579
1959
  declare module '@authing/react-ui-components/components/Guard/core/index' {
1580
1960
  /// <reference types="react" />
@@ -1634,7 +2014,39 @@ declare module '@authing/react-ui-components/components/Guard/event' {
1634
2014
  export interface GuardEvents extends LoginEvents, RegisterEvents, CompleteInfoEvents, ForgetPasswordEvents, IdentityBindingEvents, IdentityBindingAskEvents {
1635
2015
  onBeforeChangeModule?: (key: GuardModuleType, initData?: any) => boolean | Promise<boolean>;
1636
2016
  }
1637
- export const guardEventsFilter: (props: any, openEventsMapping?: boolean | undefined) => GuardEvents;
2017
+ export const guardEventsFilter: (props: any, multipleInstance?: {
2018
+ initStore: (appId: string, options: {
2019
+ serverSideLoginMethods: import("@authing/react-ui-components/components/Guard/core/hooks/useMultipleAccounts").LoginWay[];
2020
+ isInternationSms: boolean;
2021
+ }) => void;
2022
+ setLoginWay: (tab: "input" | "qrcode", way: import("@authing/react-ui-components/components/Guard/core/hooks/useMultipleAccounts").LoginWay, id?: string | undefined, internation?: {
2023
+ phoneCountryCode: string;
2024
+ areaCode: string;
2025
+ } | undefined) => void;
2026
+ setUserInfo: (user: Pick<import("@authing/react-ui-components/components/Guard/core/hooks/useMultipleAccounts").User & {
2027
+ id: string;
2028
+ }, "email" | "username" | "phone" | "id" | "nickname" | "photo" | "name" | "_updateTime" | "qrCodeId" | "areaCode">) => void;
2029
+ setLoginWayByHttpData: (account: string, data: {
2030
+ username?: string | undefined;
2031
+ phone?: string | undefined;
2032
+ email?: string | undefined;
2033
+ }) => void;
2034
+ setLoginWayByLDAPData: (account: string, data: {
2035
+ name?: string | undefined;
2036
+ phone?: string | undefined;
2037
+ email?: string | undefined;
2038
+ }) => void;
2039
+ getMemoUser: (excludeWays?: import("@authing/react-ui-components/components/Guard/core/hooks/useMultipleAccounts").LoginWay[]) => import("../Login/multipleAccounts/panel").SelectOptions[];
2040
+ getMemoSingleUser: (id: string) => {
2041
+ way: import("@authing/react-ui-components/components/Guard/core/hooks/useMultipleAccounts").LoginWay;
2042
+ account: string;
2043
+ } | undefined;
2044
+ delUserById: (id: string) => string;
2045
+ getMemberState: () => boolean;
2046
+ getFirstBackFillData: () => import("@authing/react-ui-components/components/Guard/core/hooks/useMultipleAccounts").BackFillMultipleState | undefined;
2047
+ getOriginAccount: () => string;
2048
+ getOriginWay: () => string;
2049
+ } | undefined, openEventsMapping?: boolean | undefined) => GuardEvents;
1638
2050
  export const guardEventsHijacking: (events: GuardEvents, openEventsMapping?: boolean | undefined) => GuardEvents;
1639
2051
  export const GuardEventsCamelToKebabMapping: {
1640
2052
  readonly onLoad: "load";
@@ -1706,10 +2118,12 @@ declare module '@authing/react-ui-components/components/Guard/module' {
1706
2118
  LOGIN_COMPLETE_INFO = "loginCompleteInfo",
1707
2119
  REGISTER_PASSWORD = "registerPassword",
1708
2120
  REGISTER_COMPLETE_INFO = "registerCompleteInfo",
2121
+ CUSTOM_COMPLETE_INFO = "customCompleteInfo",
1709
2122
  RECOVERY_CODE = "recoveryCode",
1710
2123
  SUBMIT_SUCCESS = "submitSuccess",
1711
2124
  IDENTITY_BINDING_ASK = "identityBindingAsk",
1712
2125
  IDENTITY_BINDING = "identityBinding",
2126
+ ACCOUNT_MERGE = "accountMerge",
1713
2127
  SELF_UNLOCK = "selfUnlock"
1714
2128
  }
1715
2129
  export interface GuardModuleAction {
@@ -1926,6 +2340,7 @@ declare module '@authing/react-ui-components/components/Login/codemap' {
1926
2340
  declare module '@authing/react-ui-components/components/Login/core/withAD' {
1927
2341
  /// <reference types="react" />
1928
2342
  import { Agreement } from '@authing/react-ui-components/components/AuthingGuard/api/index';
2343
+ import { BackFillMultipleState, StoreInstance } from '@authing/react-ui-components/components/Guard/core/hooks/useMultipleAccounts';
1929
2344
  interface LoginWithADProps {
1930
2345
  publicKey: string;
1931
2346
  autoRegister?: boolean;
@@ -1933,6 +2348,14 @@ declare module '@authing/react-ui-components/components/Login/core/withAD' {
1933
2348
  onLoginFailed: any;
1934
2349
  onBeforeLogin: any;
1935
2350
  agreements: Agreement[];
2351
+ /**
2352
+ * 回填的数据
2353
+ */
2354
+ backfillData?: BackFillMultipleState;
2355
+ /**
2356
+ * 根据输入的账号 & 返回获得对应的登录方法
2357
+ */
2358
+ multipleInstance?: StoreInstance;
1936
2359
  }
1937
2360
  export const LoginWithAD: (props: LoginWithADProps) => JSX.Element;
1938
2361
  export {};
@@ -1940,17 +2363,21 @@ declare module '@authing/react-ui-components/components/Login/core/withAD' {
1940
2363
  }
1941
2364
  declare module '@authing/react-ui-components/components/Login/core/withAppQrcode' {
1942
2365
  /// <reference types="react" />
2366
+ import { StoreInstance } from '@authing/react-ui-components/components/Guard/core/hooks/useMultipleAccounts';
1943
2367
  interface LoginWithAppQrcodeProps {
1944
2368
  onLoginSuccess: any;
1945
2369
  canLoop: boolean;
2370
+ qrCodeScanOptions: any;
2371
+ multipleInstance?: StoreInstance;
1946
2372
  }
1947
- export const LoginWithAppQrcode: (props: LoginWithAppQrcodeProps) => JSX.Element | null;
2373
+ export const LoginWithAppQrcode: (props: LoginWithAppQrcodeProps) => JSX.Element;
1948
2374
  export {};
1949
2375
 
1950
2376
  }
1951
2377
  declare module '@authing/react-ui-components/components/Login/core/withLDAP' {
1952
2378
  /// <reference types="react" />
1953
2379
  import { Agreement } from '@authing/react-ui-components/components/AuthingGuard/api/index';
2380
+ import { BackFillMultipleState, StoreInstance } from '@authing/react-ui-components/components/Guard/core/hooks/useMultipleAccounts';
1954
2381
  interface LoginWithLDAPProps {
1955
2382
  publicKey: string;
1956
2383
  autoRegister?: boolean;
@@ -1959,6 +2386,14 @@ declare module '@authing/react-ui-components/components/Login/core/withLDAP' {
1959
2386
  onLoginFailed: any;
1960
2387
  onBeforeLogin: any;
1961
2388
  agreements: Agreement[];
2389
+ /**
2390
+ * 根据输入的账号 & 返回获得对应的登录方法
2391
+ */
2392
+ multipleInstance?: StoreInstance;
2393
+ /**
2394
+ * 多账号回填的数据
2395
+ */
2396
+ backfillData?: BackFillMultipleState;
1962
2397
  }
1963
2398
  export const LoginWithLDAP: (props: LoginWithLDAPProps) => JSX.Element;
1964
2399
  export {};
@@ -1999,6 +2434,7 @@ declare module '@authing/react-ui-components/components/Login/core/withPassword/
1999
2434
  import { Agreement, PasswordLoginMethods } from '@authing/react-ui-components/components/AuthingGuard/api/index';
2000
2435
  import { LoginMethods } from '@authing/react-ui-components/components/index';
2001
2436
  import { AuthingResponse } from '@authing/react-ui-components/components/_utils/http';
2437
+ import { BackFillMultipleState, StoreInstance } from '@authing/react-ui-components/components/Guard/core/hooks/useMultipleAccounts';
2002
2438
  interface LoginWithPasswordProps {
2003
2439
  publicKey: string;
2004
2440
  autoRegister?: boolean;
@@ -2012,6 +2448,14 @@ declare module '@authing/react-ui-components/components/Login/core/withPassword/
2012
2448
  loginWay?: LoginMethods;
2013
2449
  submitButText?: string;
2014
2450
  saveIdentify?: (type: LoginMethods, identity: string) => void;
2451
+ /**
2452
+ * 根据输入的账号 & 返回获得对应的登录方法
2453
+ */
2454
+ multipleInstance?: StoreInstance;
2455
+ /**
2456
+ * 多账号回填的数据
2457
+ */
2458
+ backfillData?: BackFillMultipleState;
2015
2459
  }
2016
2460
  export const LoginWithPassword: (props: LoginWithPasswordProps) => JSX.Element;
2017
2461
  export {};
@@ -2045,6 +2489,10 @@ declare module '@authing/react-ui-components/components/Login/core/withVerifyCod
2045
2489
  import React, { FC } from 'react';
2046
2490
  import './styles.less';
2047
2491
  export interface VirtualDropdownProps {
2492
+ /**
2493
+ * 回填的国际化区号
2494
+ */
2495
+ regionCode?: string;
2048
2496
  value?: string;
2049
2497
  onChange?: (value: string) => void;
2050
2498
  style?: React.CSSProperties;
@@ -2055,7 +2503,8 @@ declare module '@authing/react-ui-components/components/Login/core/withVerifyCod
2055
2503
  declare module '@authing/react-ui-components/components/Login/core/withVerifyCode/index' {
2056
2504
  /// <reference types="react" />
2057
2505
  import './styles.less';
2058
- export const LoginWithVerifyCode: (props: any) => JSX.Element;
2506
+ const LoginWithVerifyCode: (props: any) => JSX.Element;
2507
+ export { LoginWithVerifyCode };
2059
2508
 
2060
2509
  }
2061
2510
  declare module '@authing/react-ui-components/components/Login/core/withVerifyCode/inputIdentify' {
@@ -2070,23 +2519,99 @@ declare module '@authing/react-ui-components/components/Login/core/withVerifyCod
2070
2519
  }
2071
2520
  declare module '@authing/react-ui-components/components/Login/core/withWechatMiniQrcode' {
2072
2521
  /// <reference types="react" />
2522
+ import { StoreInstance } from '@authing/react-ui-components/components/Guard/core/hooks/useMultipleAccounts';
2073
2523
  interface LoginWithWechatMiniQrcodeProps {
2074
2524
  onLoginSuccess: any;
2075
2525
  canLoop: boolean;
2526
+ qrCodeScanOptions: any;
2527
+ id: string;
2528
+ multipleInstance?: StoreInstance;
2076
2529
  }
2077
- export const LoginWithWechatMiniQrcode: (props: LoginWithWechatMiniQrcodeProps) => JSX.Element | null;
2530
+ export const LoginWithWechatMiniQrcode: (props: LoginWithWechatMiniQrcodeProps) => JSX.Element;
2078
2531
  export {};
2079
2532
 
2080
2533
  }
2081
2534
  declare module '@authing/react-ui-components/components/Login/core/withWechatmpQrcode' {
2082
2535
  /// <reference types="react" />
2536
+ import { StoreInstance } from '@authing/react-ui-components/components/Guard/core/hooks/useMultipleAccounts';
2083
2537
  interface LoginWithWechatmpQrcodeProps {
2084
2538
  onLoginSuccess: any;
2085
2539
  canLoop: boolean;
2540
+ qrCodeScanOptions: any;
2541
+ id: string;
2542
+ /**
2543
+ * 多账号存储实例
2544
+ */
2545
+ multipleInstance?: StoreInstance;
2086
2546
  }
2087
- export const LoginWithWechatmpQrcode: (props: LoginWithWechatmpQrcodeProps) => JSX.Element | null;
2547
+ export const LoginWithWechatmpQrcode: (props: LoginWithWechatmpQrcodeProps) => JSX.Element;
2088
2548
  export {};
2089
2549
 
2550
+ }
2551
+ declare module '@authing/react-ui-components/components/Login/hooks/useLoginMultiple' {
2552
+ /// <reference types="react" />
2553
+ import { FormInstance } from 'antd/lib/form';
2554
+ import { BackFillMultipleState, LoginWay } from '@authing/react-ui-components/components/Guard/core/hooks/useMultipleAccounts';
2555
+ /**
2556
+ * 多账号登录下 账户 & 登录方式自动回填
2557
+ * TODO: HOOK 参数有时间整理成为对象,开始没有想到有这么多
2558
+ * 调用地方 core 中需要回填的两个登录方式
2559
+ */
2560
+ function useLoginMultipleBackFill(options: {
2561
+ form: FormInstance<any>;
2562
+ way: LoginWay;
2563
+ formKey: string;
2564
+ backfillData?: BackFillMultipleState;
2565
+ isOnlyInternationSms?: boolean;
2566
+ setAreaCode?: React.Dispatch<React.SetStateAction<string>>;
2567
+ cancelBackfill?: boolean;
2568
+ }): void;
2569
+ /**
2570
+ * 多账号统一状态管理
2571
+ * @param setLoginWay
2572
+ * @returns
2573
+ */
2574
+ function useLoginMultiple(setLoginWay: React.Dispatch<any>): {
2575
+ isMultipleAccount: boolean;
2576
+ multipleInstance: {
2577
+ initStore: (appId: string, options: {
2578
+ serverSideLoginMethods: LoginWay[];
2579
+ isInternationSms: boolean;
2580
+ }) => void;
2581
+ setLoginWay: (tab: "input" | "qrcode", way: LoginWay, id?: string | undefined, internation?: {
2582
+ phoneCountryCode: string;
2583
+ areaCode: string;
2584
+ } | undefined) => void;
2585
+ setUserInfo: (user: Pick<import("@authing/react-ui-components/components/Guard/core/hooks/useMultipleAccounts").User & {
2586
+ id: string;
2587
+ }, "email" | "username" | "phone" | "id" | "nickname" | "photo" | "name" | "_updateTime" | "qrCodeId" | "areaCode">) => void;
2588
+ setLoginWayByHttpData: (account: string, data: {
2589
+ username?: string | undefined;
2590
+ phone?: string | undefined;
2591
+ email?: string | undefined;
2592
+ }) => void;
2593
+ setLoginWayByLDAPData: (account: string, data: {
2594
+ name?: string | undefined;
2595
+ phone?: string | undefined;
2596
+ email?: string | undefined;
2597
+ }) => void;
2598
+ getMemoUser: (excludeWays?: LoginWay[]) => import("@authing/react-ui-components/components/Login/multipleAccounts/panel").SelectOptions[];
2599
+ getMemoSingleUser: (id: string) => {
2600
+ way: LoginWay;
2601
+ account: string;
2602
+ } | undefined;
2603
+ delUserById: (id: string) => string;
2604
+ getMemberState: () => boolean;
2605
+ getFirstBackFillData: () => BackFillMultipleState | undefined;
2606
+ getOriginAccount: () => string;
2607
+ getOriginWay: () => string;
2608
+ } | undefined;
2609
+ referMultipleState: ((type: "login" | "multiple") => void) | undefined;
2610
+ backfillData: BackFillMultipleState | undefined;
2611
+ defaultQrWay: string | undefined;
2612
+ };
2613
+ export { useLoginMultipleBackFill, useLoginMultiple };
2614
+
2090
2615
  }
2091
2616
  declare module '@authing/react-ui-components/components/Login/index' {
2092
2617
  /// <reference types="react" />
@@ -2135,6 +2660,79 @@ declare module '@authing/react-ui-components/components/Login/interface' {
2135
2660
  }
2136
2661
  export const getDefaultLoginConfig: () => LoginConfig;
2137
2662
 
2663
+ }
2664
+ declare module '@authing/react-ui-components/components/Login/multipleAccounts/index' {
2665
+ import React from 'react';
2666
+ import { LoginWay, StoreInstance } from '@authing/react-ui-components/components/Guard/core/hooks/useMultipleAccounts';
2667
+ import { GuardModuleType } from '@authing/react-ui-components/components/Guard/index';
2668
+ interface MultipleAccountsProps {
2669
+ /**
2670
+ * 多账号存储实例
2671
+ */
2672
+ multipleInstance?: StoreInstance;
2673
+ /**
2674
+ * 切换 Guard 方法
2675
+ */
2676
+ changeModule?: (moduleName: GuardModuleType, initData?: any) => Promise<void>;
2677
+ /**
2678
+ * 切换多账号状态
2679
+ */
2680
+ referMultipleState?: (type: 'login' | 'multiple', data?: {
2681
+ account: string;
2682
+ way: LoginWay;
2683
+ }) => void;
2684
+ }
2685
+ const MultipleAccounts: React.NamedExoticComponent<MultipleAccountsProps>;
2686
+ export { MultipleAccounts };
2687
+
2688
+ }
2689
+ declare module '@authing/react-ui-components/components/Login/multipleAccounts/panel' {
2690
+ import React from 'react';
2691
+ import './style.less';
2692
+ interface SelectPanelProps {
2693
+ lists: SelectOptions[];
2694
+ /**
2695
+ * 点击删除
2696
+ */
2697
+ handleDel: (id: string) => void;
2698
+ /**
2699
+ * 点击 li
2700
+ */
2701
+ onClick: (id: string) => void;
2702
+ }
2703
+ export interface SelectOptions {
2704
+ /**
2705
+ * 头像
2706
+ */
2707
+ photo?: string;
2708
+ /**
2709
+ * 标题
2710
+ */
2711
+ title?: string;
2712
+ /**
2713
+ * 描述
2714
+ */
2715
+ description?: string;
2716
+ /**
2717
+ * 用户 ID 唯一标识符
2718
+ */
2719
+ id: string | 'other';
2720
+ /**
2721
+ * 显示操作栏 default: true
2722
+ */
2723
+ operation?: boolean;
2724
+ /**
2725
+ * 登录时间
2726
+ */
2727
+ _updateTime: number;
2728
+ /**
2729
+ * 替代图片元素
2730
+ */
2731
+ element?: React.ReactElement;
2732
+ }
2733
+ const SelectPanel: React.FC<SelectPanelProps>;
2734
+ export { SelectPanel };
2735
+
2138
2736
  }
2139
2737
  declare module '@authing/react-ui-components/components/Login/socialLogin/IdpButton/index' {
2140
2738
  /// <reference types="react" />
@@ -2146,6 +2744,7 @@ declare module '@authing/react-ui-components/components/Login/socialLogin/index'
2146
2744
  import { ApplicationConfig, SocialConnectionItem } from '@authing/react-ui-components/components/AuthingGuard/api/index';
2147
2745
  import './style.less';
2148
2746
  import { GuardLocalConfig } from '@authing/react-ui-components/components/Guard/index';
2747
+ import { StoreInstance } from '@authing/react-ui-components/components/Guard/core/hooks/useMultipleAccounts';
2149
2748
  export interface SocialLoginProps {
2150
2749
  appId: string;
2151
2750
  config: GuardLocalConfig;
@@ -2153,6 +2752,10 @@ declare module '@authing/react-ui-components/components/Login/socialLogin/index'
2153
2752
  onLoginSuccess: any;
2154
2753
  enterpriseConnectionObjs: ApplicationConfig['identityProviders'];
2155
2754
  socialConnectionObjs: SocialConnectionItem[];
2755
+ /**
2756
+ * 根据输入的账号 & 返回获得对应的登录方法
2757
+ */
2758
+ multipleInstance?: StoreInstance;
2156
2759
  }
2157
2760
  export const SocialLogin: React.FC<SocialLoginProps>;
2158
2761
 
@@ -2392,6 +2995,7 @@ declare module '@authing/react-ui-components/components/MFA/interface' {
2392
2995
  nickme?: string;
2393
2996
  username?: string;
2394
2997
  current?: MFAType;
2998
+ thirdPartyOrigin?: boolean;
2395
2999
  }
2396
3000
  export interface GuardMFAProps extends IG2FCProps, MFAEvents {
2397
3001
  config: Partial<MFAConfig>;
@@ -2429,233 +3033,6 @@ declare module '@authing/react-ui-components/components/NeedHelpView/index' {
2429
3033
  /// <reference types="react" />
2430
3034
  export const GuardNeedHelpView: (props: any) => JSX.Element;
2431
3035
 
2432
- }
2433
- declare module '@authing/react-ui-components/components/Qrcode/UiQrCode' {
2434
- import React from 'react';
2435
- import './index.less';
2436
- import { CodeStatusDescriptions } from '@authing/react-ui-components/components/Qrcode/WorkQrCode';
2437
- export type CodeStatus = 'loading' | 'ready' | 'already' | 'success' | 'error' | 'expired' | 'cancel' | 'MFA';
2438
- export const prefix = "refactor";
2439
- export interface UiQrProps {
2440
- /**
2441
- * Loading 组件
2442
- */
2443
- loadingComponent?: React.ReactElement;
2444
- /**
2445
- * 二维码组件三种状态
2446
- * ready 准备状态
2447
- * already 已扫描状态
2448
- * success 扫描成功/登录成功状态
2449
- * error 错误状态(超时、网络错误)
2450
- */
2451
- status: CodeStatus;
2452
- /**
2453
- * 二维码 URL
2454
- */
2455
- src?: string;
2456
- /**
2457
- * 二维码底部内容
2458
- */
2459
- descriptions: CodeStatusDescriptions;
2460
- /**
2461
- * 外层 container 样式
2462
- */
2463
- containerStyle?: React.CSSProperties;
2464
- /**
2465
- * 内层 container 样式(图片)
2466
- */
2467
- imageStyle?: React.CSSProperties;
2468
- /**
2469
- * 二维码图片准备好的回调
2470
- */
2471
- onLoad?: () => void;
2472
- /**
2473
- * 点击遮罩中的内容区
2474
- * status 当前组件所处状态
2475
- */
2476
- onClickMaskEl?: (status: CodeStatus) => void;
2477
- /**
2478
- * 点击全部遮罩区域
2479
- * status 当前组件所处状态
2480
- */
2481
- onMaskContent?: (status: CodeStatus) => void;
2482
- }
2483
- const UiQrCode: React.NamedExoticComponent<UiQrProps>;
2484
- export { UiQrCode };
2485
-
2486
- }
2487
- declare module '@authing/react-ui-components/components/Qrcode/WorkQrCode' {
2488
- import React from 'react';
2489
- import { QrCodeResponse } from '@authing/react-ui-components/components/Qrcode/hooks/usePostQrCode';
2490
- import { CodeStatus, UiQrProps } from '@authing/react-ui-components/components/Qrcode/UiQrCode';
2491
- /**
2492
- * 二维码不同状态下的底部描述文字
2493
- */
2494
- export type CodeStatusDescriptions = Partial<Record<Exclude<CodeStatus, 'loading'>, React.ReactNode | ((referQrCode?: () => void) => React.ReactNode)>>;
2495
- export interface WorkQrCodeRef {
2496
- referQrCode: () => Promise<{
2497
- random: string;
2498
- url: string;
2499
- } | undefined>;
2500
- }
2501
- interface WorkQrCodeProps extends Omit<UiQrProps, 'description' | 'status'> {
2502
- /**
2503
- * 二维码场景
2504
- */
2505
- scene: 'WXAPP_AUTH' | 'APP_AUTH' | 'WECHATMP_AUTH';
2506
- /**
2507
- * 不同状态请求文字
2508
- */
2509
- descriptions: CodeStatusDescriptions;
2510
- /**
2511
- * 睡眠时间 默认 1000
2512
- */
2513
- sleepTime?: number;
2514
- /**
2515
- * 每当状态变化时,触发的 callback 。
2516
- */
2517
- onStatusChange?: (status: CodeStatus, data: QrCodeResponse) => void;
2518
- /**
2519
- * 不同状态下点击遮罩中间区域方法
2520
- */
2521
- onClickMaskContent?: (status: CodeStatus) => void;
2522
- }
2523
- const WorkQrCode: React.ForwardRefExoticComponent<WorkQrCodeProps & React.RefAttributes<any>>;
2524
- export { WorkQrCode };
2525
-
2526
- }
2527
- declare module '@authing/react-ui-components/components/Qrcode/hooks/useImage' {
2528
- const useImage: (src: string | undefined, options: {
2529
- onLoad?: (() => void) | undefined;
2530
- }) => (string | undefined)[];
2531
- export { useImage };
2532
-
2533
- }
2534
- declare module '@authing/react-ui-components/components/Qrcode/hooks/usePostQrCode' {
2535
- /// <reference types="react" />
2536
- import { AuthingGuardResponse, AuthingResponse } from '@authing/react-ui-components/components/_utils/http';
2537
- import { CodeStatus } from '@authing/react-ui-components/components/Qrcode/UiQrCode';
2538
- import { CodeStatusDescriptions } from '@authing/react-ui-components/components/Qrcode/WorkQrCode';
2539
- import { ReducerType, RootState } from '@authing/react-ui-components/components/Qrcode/hooks/usePreQrCode';
2540
- export interface QrCodeResponse {
2541
- /**
2542
- * 根据状态确定不同的流程
2543
- */
2544
- status: number;
2545
- /**
2546
- * 返回的随机值
2547
- */
2548
- random: number;
2549
- /**
2550
- * 返回的用户信息
2551
- */
2552
- userInfo?: any;
2553
- /**
2554
- * 扫码成功后 Tick 换取用户信息
2555
- */
2556
- ticket?: string;
2557
- /**
2558
- * MFA 状态下的返回
2559
- */
2560
- scannedResult?: AuthingResponse;
2561
- }
2562
- /**
2563
- * 二维码请求相关
2564
- */
2565
- interface QrCodeRequest {
2566
- genCodeRequest?: () => Promise<AuthingGuardResponse<{
2567
- random: string;
2568
- url: string;
2569
- }>>;
2570
- /**
2571
- * 未扫码下的请求方法
2572
- */
2573
- readyCheckedRequest?: () => Promise<AuthingGuardResponse<QrCodeResponse>>;
2574
- /**
2575
- * 已经扫码下的请求方法(待确认)
2576
- */
2577
- alreadyCheckedRequest?: () => Promise<AuthingGuardResponse<QrCodeResponse>>;
2578
- /**
2579
- * 使用 ticket 交换用户信息
2580
- */
2581
- exchangeUserInfo?: (ticket: string) => Promise<any>;
2582
- }
2583
- interface QrCodeOptions {
2584
- state: RootState;
2585
- dispatch: React.Dispatch<{
2586
- type: ReducerType;
2587
- payload: Partial<RootState>;
2588
- }>;
2589
- descriptions: CodeStatusDescriptions;
2590
- sleepTime?: number;
2591
- /**
2592
- * 状态改变时触发事件,仅在 Server 返回的二维码状态改变时进行触发
2593
- */
2594
- onStatusChange?: (status: CodeStatus, data: QrCodeResponse) => void;
2595
- }
2596
- /**
2597
- * 二维码处理阶段
2598
- * 二维码处理阶段分为两个主要流程
2599
- * 1. 同一状态下的轮询逻辑处理
2600
- * 2. 根据不同返回状态码进行处理
2601
- */
2602
- export const useQrCode: (options: QrCodeOptions, request: QrCodeRequest) => void;
2603
- export {};
2604
-
2605
- }
2606
- declare module '@authing/react-ui-components/components/Qrcode/hooks/usePreQrCode' {
2607
- /// <reference types="react" />
2608
- import { CodeStatus } from '@authing/react-ui-components/components/Qrcode/UiQrCode';
2609
- export type ReducerType = 'change' | 'changeStatus' | 'changeDesc';
2610
- export type RootState = {
2611
- /**
2612
- * 状态
2613
- */
2614
- status: CodeStatus;
2615
- /**
2616
- * 底部描述
2617
- */
2618
- /**
2619
- * 当前二维码 URL
2620
- */
2621
- src?: string;
2622
- /**
2623
- * 二维码随机值
2624
- */
2625
- random?: string;
2626
- };
2627
- /**
2628
- * QrCode 准备阶段 Hook
2629
- */
2630
- const usePreQrCode: () => {
2631
- state: RootState;
2632
- dispatch: import("react").Dispatch<{
2633
- type: ReducerType;
2634
- payload: Partial<RootState>;
2635
- }>;
2636
- };
2637
- export { usePreQrCode };
2638
-
2639
- }
2640
- declare module '@authing/react-ui-components/components/Qrcode/hooks/useStatus' {
2641
- import { CodeStatus } from '@authing/react-ui-components/components/Qrcode/UiQrCode';
2642
- /**
2643
- * 根据不同状态添加不同的元素
2644
- * 维护不同状态的处理
2645
- */
2646
- const useStatus: (status: CodeStatus) => ({} | null | undefined)[];
2647
- export { useStatus };
2648
-
2649
- }
2650
- declare module '@authing/react-ui-components/components/Qrcode/index' {
2651
- import { UiQrCode } from '@authing/react-ui-components/components/Qrcode/UiQrCode';
2652
- import { WorkQrCode } from '@authing/react-ui-components/components/Qrcode/WorkQrCode';
2653
- type IQrCode = typeof WorkQrCode & {
2654
- UI: typeof UiQrCode;
2655
- };
2656
- const QrCode: IQrCode;
2657
- export { QrCode };
2658
-
2659
3036
  }
2660
3037
  declare module '@authing/react-ui-components/components/RecoveryCode/businessRequest' {
2661
3038
  export enum TotpRecoveryCodeBusinessAction {
@@ -3245,6 +3622,7 @@ declare module '@authing/react-ui-components/components/_utils/context' {
3245
3622
  import React from 'react';
3246
3623
  import { GuardEvents, GuardLocalConfig, GuardModuleType, GuardPageConfig } from '@authing/react-ui-components/components/index';
3247
3624
  import { ApplicationConfig } from '@authing/react-ui-components/components/AuthingGuard/api/index';
3625
+ import { BackFillMultipleState, StoreInstance } from '@authing/react-ui-components/components/Guard/core/hooks/useMultipleAccounts';
3248
3626
  import { ModuleState } from '@authing/react-ui-components/components/Guard/GuardModule/stateMachine';
3249
3627
  import { GuardHttp } from '@authing/react-ui-components/components/_utils/guardHttp';
3250
3628
  export interface IGuardContext {
@@ -3262,6 +3640,29 @@ declare module '@authing/react-ui-components/components/_utils/context' {
3262
3640
  isAuthFlow: boolean;
3263
3641
  contextLoaded: boolean;
3264
3642
  guardPageConfig: Partial<GuardPageConfig>;
3643
+ multipleInstance: {
3644
+ /**
3645
+ * 多账号相关
3646
+ */
3647
+ isMultipleAccount: boolean;
3648
+ /**
3649
+ * when: 多账号页面跳转进入登录页面
3650
+ * 携带的回填数据信息
3651
+ */
3652
+ multipleAccountData?: BackFillMultipleState;
3653
+ /**
3654
+ * 多账号 store 实例
3655
+ */
3656
+ instance?: StoreInstance;
3657
+ /**
3658
+ * 切换多账号 isMultipleAccount 状态
3659
+ */
3660
+ referMultipleState?: (type: 'login' | 'multiple') => void;
3661
+ /**
3662
+ * 清空回填数据
3663
+ */
3664
+ clearBackFillData?: () => void;
3665
+ };
3265
3666
  }
3266
3667
  export const createGuardXContext: () => {
3267
3668
  Provider: React.FC<{
@@ -3299,6 +3700,64 @@ declare module '@authing/react-ui-components/components/_utils/context' {
3299
3700
  export const useGuardContextLoaded: () => boolean;
3300
3701
  export const useGuardIsAuthFlow: () => boolean;
3301
3702
  export const useGuardPageConfig: () => Partial<GuardPageConfig>;
3703
+ /**
3704
+ * 多账号登录 store 实例
3705
+ */
3706
+ export const useGuardMultipleInstance: () => {
3707
+ /**
3708
+ * 多账号相关
3709
+ */
3710
+ isMultipleAccount: boolean;
3711
+ /**
3712
+ * when: 多账号页面跳转进入登录页面
3713
+ * 携带的回填数据信息
3714
+ */
3715
+ multipleAccountData?: BackFillMultipleState | undefined;
3716
+ /**
3717
+ * 多账号 store 实例
3718
+ */
3719
+ instance?: {
3720
+ initStore: (appId: string, options: {
3721
+ serverSideLoginMethods: import("@authing/react-ui-components/components/Guard/core/hooks/useMultipleAccounts").LoginWay[];
3722
+ isInternationSms: boolean;
3723
+ }) => void;
3724
+ setLoginWay: (tab: "input" | "qrcode", way: import("@authing/react-ui-components/components/Guard/core/hooks/useMultipleAccounts").LoginWay, id?: string | undefined, internation?: {
3725
+ phoneCountryCode: string;
3726
+ areaCode: string;
3727
+ } | undefined) => void;
3728
+ setUserInfo: (user: Pick<import("@authing/react-ui-components/components/Guard/core/hooks/useMultipleAccounts").User & {
3729
+ id: string;
3730
+ }, "email" | "username" | "phone" | "id" | "nickname" | "photo" | "name" | "_updateTime" | "qrCodeId" | "areaCode">) => void;
3731
+ setLoginWayByHttpData: (account: string, data: {
3732
+ username?: string | undefined;
3733
+ phone?: string | undefined;
3734
+ email?: string | undefined;
3735
+ }) => void;
3736
+ setLoginWayByLDAPData: (account: string, data: {
3737
+ name?: string | undefined;
3738
+ phone?: string | undefined;
3739
+ email?: string | undefined;
3740
+ }) => void;
3741
+ getMemoUser: (excludeWays?: import("@authing/react-ui-components/components/Guard/core/hooks/useMultipleAccounts").LoginWay[]) => import("../Login/multipleAccounts/panel").SelectOptions[];
3742
+ getMemoSingleUser: (id: string) => {
3743
+ way: import("@authing/react-ui-components/components/Guard/core/hooks/useMultipleAccounts").LoginWay;
3744
+ account: string;
3745
+ } | undefined;
3746
+ delUserById: (id: string) => string;
3747
+ getMemberState: () => boolean;
3748
+ getFirstBackFillData: () => BackFillMultipleState | undefined;
3749
+ getOriginAccount: () => string;
3750
+ getOriginWay: () => string;
3751
+ } | undefined;
3752
+ /**
3753
+ * 切换多账号 isMultipleAccount 状态
3754
+ */
3755
+ referMultipleState?: ((type: 'login' | 'multiple') => void) | undefined;
3756
+ /**
3757
+ * 清空回填数据
3758
+ */
3759
+ clearBackFillData?: (() => void) | undefined;
3760
+ };
3302
3761
 
3303
3762
  }
3304
3763
  declare module '@authing/react-ui-components/components/_utils/corsVerification' {
@@ -3419,10 +3878,6 @@ declare module '@authing/react-ui-components/components/_utils/hooks/index' {
3419
3878
  countryCode: string | undefined;
3420
3879
  phoneNumber: string;
3421
3880
  };
3422
- export enum SocialConnectionEvent {
3423
- Message = "message",
3424
- Auth = "auth"
3425
- }
3426
3881
  /**
3427
3882
  *
3428
3883
  * @param config
@@ -3509,7 +3964,11 @@ declare module '@authing/react-ui-components/components/_utils/index' {
3509
3964
  * @param ...sources
3510
3965
  */
3511
3966
  export function deepMerge<T extends any = any>(target: T, ...sources: any[]): T;
3512
- export const getUserRegisterParams: () => {
3967
+ /**
3968
+ * 在托管页下上传query中指定的用户自定义字段进行补全
3969
+ * @param params 指定上传的用户自定义字段
3970
+ */
3971
+ export const getUserRegisterParams: (params?: string[] | undefined) => {
3513
3972
  key: string;
3514
3973
  value: string | string[] | qs.ParsedQs | qs.ParsedQs[] | undefined;
3515
3974
  }[];
@@ -3657,6 +4116,7 @@ declare module '@authing/react-ui-components/components/_utils/responseManagemen
3657
4116
  FLOW_END = 1600,
3658
4117
  FIRST_LOGIN_PASSWORD = 1639,
3659
4118
  FORCED_PASSWORD_RESET = 2058,
4119
+ ACCOUNT_MERGE = 10000,
3660
4120
  UNSAFE_PASSWORD_TIP = 2061,
3661
4121
  UNSAFE_PASSWORD_RESET = 2071
3662
4122
  }
@@ -3752,6 +4212,7 @@ declare module '@authing/react-ui-components/components/index' {
3752
4212
  export * from '@authing/react-ui-components/components/AuthingGuard/types/index';
3753
4213
  export * from '@authing/react-ui-components/components/AuthingGuard/hooks/index';
3754
4214
  export * from '@authing/react-ui-components/components/AuthingGuard/index';
4215
+ export * from '@authing/react-ui-components/components/SingleComponent/index';
3755
4216
  export * from '@authing/react-ui-components/components/Guard/index';
3756
4217
  export * from '@authing/react-ui-components/components/Type/index';
3757
4218
  export * from '@authing/react-ui-components/components/version/index';
@@ -3763,7 +4224,7 @@ declare module '@authing/react-ui-components/components/version/index' {
3763
4224
 
3764
4225
  }
3765
4226
  declare module '@authing/react-ui-components/components/version/version' {
3766
- const _default: "3.1.39-beta.0";
4227
+ const _default: "3.1.39-hep.0";
3767
4228
  export default _default;
3768
4229
 
3769
4230
  }