@authing/react-ui-components 3.1.29-alpha.1 → 3.1.30-beta.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/lib/index.d.ts CHANGED
@@ -521,6 +521,7 @@ declare module '@authing/react-ui-components/components/AuthingGuard/api/appConf
521
521
  websocket: string;
522
522
  welcomeMessage: any;
523
523
  skipComplateFileds: boolean;
524
+ selfUnlockStrategy: 'captcha' | 'password-captcha';
524
525
  }
525
526
  export const fetchAppConfig: (appId: string) => Promise<import("@authing/react-ui-components/components/_utils/http").AuthingResponse<ApplicationConfig>>;
526
527
 
@@ -1101,6 +1102,33 @@ declare module '@authing/react-ui-components/components/Back/index' {
1101
1102
  }
1102
1103
  export const BackCustom: React.FC<BackCustomProps>;
1103
1104
 
1105
+ }
1106
+ declare module '@authing/react-ui-components/components/BindTotp/api/constant' {
1107
+ export const mfaAuthenticatorUrl: () => string;
1108
+ export const mfaTotpAssociateUrl: () => string;
1109
+
1110
+ }
1111
+ declare module '@authing/react-ui-components/components/BindTotp/api/index' {
1112
+ import { AxiosRequestConfig } from 'axios';
1113
+ export { authFlowByAxios } from 'service/api';
1114
+ /**
1115
+ * 验证是否已登陆
1116
+ * @param data
1117
+ * @param config
1118
+ */
1119
+ export const mfaTotpAuthenticatorByAxios: (params: {
1120
+ source: string;
1121
+ }, config: AxiosRequestConfig) => Promise<import("@authing/react-ui-components/components/_utils/http").AuthingGuardResponse<any>>;
1122
+ /**
1123
+ * 已登陆 totp 拉取二维码、Secret 信息
1124
+ * @param data
1125
+ * @param config
1126
+ * @returns
1127
+ */
1128
+ export const mfaTotpAssociateByAxios: (data: {
1129
+ source: string;
1130
+ }, config: AxiosRequestConfig) => Promise<import("@authing/react-ui-components/components/_utils/http").AuthingGuardResponse<any>>;
1131
+
1104
1132
  }
1105
1133
  declare module '@authing/react-ui-components/components/BindTotp/businessRequest' {
1106
1134
  export enum BindTotpBusinessAction {
@@ -1163,8 +1191,15 @@ declare module '@authing/react-ui-components/components/ChangeLanguage/index' {
1163
1191
  /// <reference types="react" />
1164
1192
  export const ChangeLanguage: (props: any) => JSX.Element | null;
1165
1193
 
1194
+ }
1195
+ declare module '@authing/react-ui-components/components/ChangePassword/api/index' {
1196
+ import { registerEmailCodeByAxios } from '@authing/react-ui-components/components/Register/api/index';
1197
+ import { authFlowByAxios } from 'service/api';
1198
+ export { authFlowByAxios, registerEmailCodeByAxios };
1199
+
1166
1200
  }
1167
1201
  declare module '@authing/react-ui-components/components/ChangePassword/businessRequest' {
1202
+ import { AxiosRequestConfig } from 'axios';
1168
1203
  export enum ChangePasswordBusinessAction {
1169
1204
  ResetPassword = "reset-password-first-time",
1170
1205
  FirstLoginReset = "reset-password-forced",
@@ -1173,7 +1208,7 @@ declare module '@authing/react-ui-components/components/ChangePassword/businessR
1173
1208
  export const authFlow: (action: ChangePasswordBusinessAction, content: {
1174
1209
  password: string;
1175
1210
  oldPassword?: string;
1176
- }) => Promise<import("@authing/react-ui-components/components/_utils/http").AuthingGuardResponse<any>>;
1211
+ }, config?: AxiosRequestConfig<any> | undefined) => Promise<import("@authing/react-ui-components/components/_utils/http").AuthingGuardResponse<any>>;
1177
1212
 
1178
1213
  }
1179
1214
  declare module '@authing/react-ui-components/components/ChangePassword/core/PasswordNotSafeReset' {
@@ -1187,6 +1222,12 @@ declare module '@authing/react-ui-components/components/ChangePassword/core/Pass
1187
1222
  }
1188
1223
  declare module '@authing/react-ui-components/components/ChangePassword/core/completePassword' {
1189
1224
  import React from 'react';
1225
+ /**
1226
+ * 注册补全密码
1227
+ * 进入流程:
1228
+ * 1. 控制台登陆方式 短信验证码 && 手机号密码
1229
+ * 2. 注册方式 短信验证码
1230
+ */
1190
1231
  export const CompletePassword: React.FC;
1191
1232
 
1192
1233
  }
@@ -1215,23 +1256,63 @@ declare module '@authing/react-ui-components/components/ChangePassword/index' {
1215
1256
  title: string;
1216
1257
  explain: string;
1217
1258
  }>;
1259
+ /**
1260
+ * 首次登陆重制密码
1261
+ * @returns
1262
+ */
1218
1263
  export const GuardFirstLoginPasswordResetView: React.FC;
1219
1264
  export const GuardPasswordNotSafeResetView: React.FC;
1220
1265
  export const GuardForcedPasswordResetView: React.FC;
1266
+ /**
1267
+ * 提示修改密码
1268
+ * @returns
1269
+ */
1221
1270
  export const GuardNoticePasswordResetView: React.FC;
1271
+ /**
1272
+ * 注册密码补全
1273
+ * @returns
1274
+ */
1222
1275
  export const GuardRegisterCompletePasswordView: React.FC;
1223
1276
 
1277
+ }
1278
+ declare module '@authing/react-ui-components/components/CompleteInfo/api/constant' {
1279
+ export const getCompletionMetaDataUrl: () => string;
1280
+
1281
+ }
1282
+ declare module '@authing/react-ui-components/components/CompleteInfo/api/index' {
1283
+ import { authFlowByAxios, getCountryLists, validateAccountByAxios, validateEmailCodeByAxios, validatePhoneCodeByAxios } from 'service/api';
1284
+ import { registerEmailCodeByAxios } from '@authing/react-ui-components/components/Register/api/index';
1285
+ import { getRegisterMetadata } from '@authing/react-ui-components/components/CompleteInfo/api/request';
1286
+ export { registerEmailCodeByAxios, authFlowByAxios, getCountryLists, validateAccountByAxios, validateEmailCodeByAxios, validatePhoneCodeByAxios, getRegisterMetadata, };
1287
+
1288
+ }
1289
+ declare module '@authing/react-ui-components/components/CompleteInfo/api/request' {
1290
+ import { AxiosRequestConfig } from 'axios';
1291
+ /**
1292
+ * 获取注册信息补全元数据
1293
+ * @param params
1294
+ * @param config
1295
+ * @returns
1296
+ */
1297
+ export const getRegisterMetadata: (params?: any, config?: AxiosRequestConfig<any> | undefined) => Promise<import("@authing/react-ui-components/components/_utils/http").AuthingGuardResponse<any>>;
1298
+
1224
1299
  }
1225
1300
  declare module '@authing/react-ui-components/components/CompleteInfo/businessRequest' {
1226
- import { User } from 'authing-js-sdk';
1301
+ import { AxiosRequestConfig } from 'axios';
1227
1302
  import { CompleteInfoRequest, RegisterCompleteInfoInitData } from '@authing/react-ui-components/components/CompleteInfo/interface';
1228
1303
  export enum CompleteInfoAuthFlowAction {
1229
1304
  Complete = "complete-completion",
1230
1305
  Skip = "skip-completion"
1231
1306
  }
1232
- export const authFlow: (action: CompleteInfoAuthFlowAction, data?: CompleteInfoRequest | undefined) => Promise<import("@authing/react-ui-components/components/_utils/http").AuthingGuardResponse<any>>;
1233
- export const registerSkipMethod: (fnName: RegisterCompleteInfoInitData['businessRequestName'], content: any) => Promise<import("@authing/react-ui-components/components/_utils/http").AuthingGuardResponse<any>> | Promise<User> | undefined;
1234
- export const registerRequest: (action: CompleteInfoAuthFlowAction, registerFnName: RegisterCompleteInfoInitData['businessRequestName'], registerContent: any, registerProfile?: any) => Promise<User | import("@authing/react-ui-components/components/_utils/http").AuthingGuardResponse<any> | undefined>;
1307
+ export const authFlow: (action: CompleteInfoAuthFlowAction, data?: CompleteInfoRequest | undefined, config?: AxiosRequestConfig<any> | undefined) => Promise<import("@authing/react-ui-components/components/_utils/http").AuthingGuardResponse<any>>;
1308
+ /**
1309
+ * 注册点击跳过
1310
+ * @param fnName
1311
+ * @param content
1312
+ * @returns
1313
+ */
1314
+ export const registerSkipMethod: (fnName: RegisterCompleteInfoInitData['businessRequestName'], content: any) => Promise<import("@authing/react-ui-components/components/_utils/http").AuthingGuardResponse<any>> | Promise<import("authing-js-sdk").User> | undefined;
1315
+ export const registerRequest: (action: CompleteInfoAuthFlowAction, registerFnName: RegisterCompleteInfoInitData['businessRequestName'], registerContent: any, registerProfile?: any) => Promise<import("authing-js-sdk").User | import("../_utils/http").AuthingGuardResponse<any> | undefined>;
1235
1316
 
1236
1317
  }
1237
1318
  declare module '@authing/react-ui-components/components/CompleteInfo/core/completeInfo' {
@@ -1245,6 +1326,11 @@ declare module '@authing/react-ui-components/components/CompleteInfo/core/comple
1245
1326
  key: string;
1246
1327
  options: any;
1247
1328
  }
1329
+ /**
1330
+ * 信息补全
1331
+ * @param props
1332
+ * @returns
1333
+ */
1248
1334
  export const CompleteInfo: React.FC<CompleteInfoProps>;
1249
1335
 
1250
1336
  }
@@ -1253,12 +1339,23 @@ declare module '@authing/react-ui-components/components/CompleteInfo/index' {
1253
1339
  import { CompleteInfoMetaData, CompleteInfoRequest } from '@authing/react-ui-components/components/CompleteInfo/interface';
1254
1340
  import './styles.less';
1255
1341
  import { CompleteInfoAuthFlowAction } from '@authing/react-ui-components/components/CompleteInfo/businessRequest';
1342
+ /**
1343
+ * 登录时信息补全
1344
+ * @param param0
1345
+ * @returns
1346
+ */
1256
1347
  export const GuardCompleteInfo: React.FC<{
1257
1348
  metaData: CompleteInfoMetaData[];
1258
1349
  skipComplateFileds: boolean;
1259
1350
  businessRequest: (action: CompleteInfoAuthFlowAction, data?: CompleteInfoRequest) => Promise<void>;
1260
1351
  }>;
1352
+ /**
1353
+ * 登录信息补全
1354
+ */
1261
1355
  export const GuardLoginCompleteInfoView: React.FC;
1356
+ /**
1357
+ * 注册信息补全
1358
+ */
1262
1359
  export const GuardRegisterCompleteInfoView: React.FC;
1263
1360
 
1264
1361
  }
@@ -1450,6 +1547,9 @@ declare module '@authing/react-ui-components/components/ForgetPassword/core/rese
1450
1547
  }
1451
1548
  declare module '@authing/react-ui-components/components/ForgetPassword/index' {
1452
1549
  import React from 'react';
1550
+ /**
1551
+ * 忘记密码
1552
+ */
1453
1553
  export const GuardForgetPassword: React.FC;
1454
1554
 
1455
1555
  }
@@ -1527,6 +1627,27 @@ declare module '@authing/react-ui-components/components/Guard/GuardModule/stateM
1527
1627
  export const getGuardStateMachine: () => GuardStateMachine;
1528
1628
  export const useGuardStateMachine: () => GuardStateMachine;
1529
1629
 
1630
+ }
1631
+ declare module '@authing/react-ui-components/components/Guard/api/constant' {
1632
+ export const publishConfig: (appId: string) => string;
1633
+ export const pageConfig: (appId: string) => string;
1634
+
1635
+ }
1636
+ declare module '@authing/react-ui-components/components/Guard/api/index' {
1637
+ import { AxiosRequestConfig } from 'axios';
1638
+ /**
1639
+ * 获取应用配置信息
1640
+ * @param appId 当前应用配置信息
1641
+ * @returns
1642
+ */
1643
+ export const getPublishConfigByAxios: <T>(appId: string, config?: AxiosRequestConfig<any> | undefined) => Promise<import("@authing/react-ui-components/components/_utils/http").AuthingGuardResponse<T>>;
1644
+ /**
1645
+ * 获取页面配置
1646
+ * @param appId 当前应用配置信息
1647
+ * @returns
1648
+ */
1649
+ export const getPageConfigByAxios: <T>(appId: string, config?: AxiosRequestConfig<any> | undefined) => Promise<import("@authing/react-ui-components/components/_utils/http").AuthingGuardResponse<T>>;
1650
+
1530
1651
  }
1531
1652
  declare module '@authing/react-ui-components/components/Guard/authClient' {
1532
1653
  import { AuthenticationClient } from 'authing-js-sdk';
@@ -1575,291 +1696,105 @@ declare module '@authing/react-ui-components/components/Guard/config' {
1575
1696
  export const getDefaultGuardLocalConfig: () => GuardLocalConfig;
1576
1697
 
1577
1698
  }
1578
- declare module '@authing/react-ui-components/components/Guard/core/hooks/useMultipleAccounts' {
1579
- import { SelectOptions } from '@authing/react-ui-components/components/Login/multipleAccounts/panel';
1580
- export const QR_CODE_WAY: LoginWay[];
1699
+ declare module '@authing/react-ui-components/components/Guard/core/componentsMapping' {
1700
+ import React from 'react';
1701
+ import { GuardModuleType } from '@authing/react-ui-components/components/Guard/module';
1581
1702
  /**
1582
- * 登录时所有支持的登录列表(前端定义列表)
1703
+ * 组件映射表
1704
+ * TODO: 斟酌下是否和上层 module.ts 放在一起的单个文件夹中 感觉可放可不放
1583
1705
  */
1584
- export type LoginWay = 'email' | 'phone' | 'password' | 'phone-code' | 'email-code' | 'social' | 'wechat-miniprogram-qrcode' | 'wechatmp-qrcode' | 'app-qrcode' | 'ad' | 'ldap';
1706
+ const ComponentsMapping: Record<GuardModuleType, (key: string) => React.ReactNode>;
1707
+ export default ComponentsMapping;
1708
+
1709
+ }
1710
+ declare module '@authing/react-ui-components/components/Guard/core/hooks/useBusinessRequest' {
1711
+ import { AuthenticationClient } from 'authing-js-sdk';
1712
+ import { GuardLocalConfig } from 'components/Guard/config';
1713
+ import { GuardEvents } from 'components/Guard/event';
1714
+ import { GuardHttp } from 'components/_utils/guardHttp';
1715
+ export default function useBusinessRequestByAxios(appId: string | undefined, options: {
1716
+ events?: GuardEvents;
1717
+ tenantId?: string;
1718
+ sdkClient?: AuthenticationClient;
1719
+ defaultMergedConfig?: GuardLocalConfig;
1720
+ httpClient?: GuardHttp;
1721
+ finallyConfig?: any;
1722
+ }): {
1723
+ axiosClient: boolean | undefined;
1724
+ };
1725
+
1726
+ }
1727
+ declare module '@authing/react-ui-components/components/Guard/core/hooks/useCss' {
1585
1728
  /**
1586
- * when: 多账号页面跳转进入登录页面
1587
- * 携带的回填数据信息
1729
+ * 自定义 CSS 相关,finallyConfig 类型待补充
1730
+ * @param finallyConfig
1588
1731
  */
1589
- export interface BackFillMultipleState extends Omit<User, 'id' | 'name' | 'nickname' | 'username' | 'phone' | 'email' | 'photo' | '_updateTime'> {
1590
- /**
1591
- * 回填的账号名称 邮箱/用户名/手机
1592
- */
1593
- account: string;
1594
- }
1732
+ export default function useCss(finallyConfig: any): void;
1733
+
1734
+ }
1735
+ declare module '@authing/react-ui-components/components/Guard/core/hooks/useEvents' {
1736
+ /// <reference types="react" />
1737
+ import { GuardEvents } from '@authing/react-ui-components/components/Guard/event';
1738
+ import { GuardProps } from '@authing/react-ui-components/components/Guard/Guard';
1595
1739
  /**
1596
- * Store instance
1740
+ * 初始化事件
1741
+ * @param guardProps
1742
+ * @param openEventsMapping
1743
+ * @returns
1597
1744
  */
1598
- export type StoreInstance = ReturnType<MultipleAccount['getStore']>;
1745
+ export default function useEvents(guardProps: GuardProps, openEventsMapping?: boolean): {
1746
+ events: GuardEvents | undefined;
1747
+ setEvents: import("react").Dispatch<import("react").SetStateAction<GuardEvents | undefined>>;
1748
+ initEvents: () => void;
1749
+ };
1750
+
1751
+ }
1752
+ declare module '@authing/react-ui-components/components/Guard/core/hooks/useFDA' {
1753
+ /// <reference types="react" />
1754
+ import { GuardEvents } from '@authing/react-ui-components/components/Guard/event';
1755
+ import { GuardStateMachine, ModuleState } from '@authing/react-ui-components/components/Guard/GuardModule/stateMachine';
1756
+ import { GuardModuleType } from '@authing/react-ui-components/components/Guard/module';
1757
+ import { ChangeModuleCore } from '@authing/react-ui-components/components/Guard/core/hooks/useModule';
1599
1758
  /**
1600
- * 当前 userId 对应的类型
1759
+ * 初始化 FDA ,后续 Guard 渲染全部按照 FDA API 执行
1760
+ * @param onChangeModule FDA 内部更新组件核心方法
1761
+ * @param initState 初始化状态
1762
+ * @returns { guardStateMachine,setGuardStateMachine }
1601
1763
  */
1602
- export interface CurrentStore {
1603
- [id: string]: User;
1604
- }
1605
- export interface User {
1606
- /**
1607
- * userId
1608
- */
1609
- id: string;
1610
- /**
1611
- * Tab 栏状态
1612
- */
1613
- tab: 'input' | 'qrcode';
1614
- /**
1615
- * 登录方式
1616
- */
1617
- way: LoginWay;
1618
- /**
1619
- * 姓名
1620
- */
1621
- name?: string | null;
1622
- /**
1623
- * 昵称
1624
- */
1625
- nickname?: string | null;
1626
- /**
1627
- * 用户名
1628
- */
1629
- username?: string | null;
1630
- /**
1631
- * 手机号
1632
- */
1633
- phone?: string | null;
1634
- /**
1635
- * 邮箱
1636
- */
1637
- email?: string | null;
1638
- /**
1639
- * 头像
1640
- */
1641
- photo?: string | null;
1642
- /**
1643
- * qrCodeId 对应的ID
1644
- */
1645
- qrCodeId?: string;
1646
- /**
1647
- * 国际化短信区号
1648
- */
1649
- phoneCountryCode?: string;
1650
- /**
1651
- * 国际化短信选择框回填
1652
- */
1653
- areaCode?: string;
1654
- /**
1655
- * 登录时间
1656
- */
1657
- _updateTime?: string;
1658
- }
1659
- class MultipleAccount {
1660
- /**
1661
- * 原始的 localStore 值
1662
- */
1663
- private originStore;
1664
- /**
1665
- * 当前 AppId Store
1666
- */
1667
- private currentStore;
1668
- /**
1669
- * 单账号直接回填
1670
- */
1671
- private firstBackFillData?;
1672
- /**
1673
- * server 返回支持的登录方式
1674
- */
1675
- private serverSideLoginMethods;
1676
- /**
1677
- * 是否显示多账号登录页面
1678
- * true 存在
1679
- */
1680
- private memberState;
1681
- /**
1682
- * 二维码登录时的ID
1683
- */
1684
- private qrCodeId?;
1685
- /**
1686
- * 国际化短信前缀 区号
1687
- */
1688
- private phoneCountryCode?;
1689
- /**
1690
- * 国际化短信前缀 选中地区编号
1691
- */
1692
- private areaCode?;
1693
- private tabStatus?;
1694
- /**
1695
- * 当前登录二级状态
1696
- */
1697
- private loginWay?;
1698
- private appId;
1699
- /**
1700
- * 是否开启国际化短信
1701
- */
1702
- private isInternationSms?;
1703
- constructor();
1704
- /**
1705
- * 页面首次加载时初始化 Store
1706
- * 从 LocalStore 中拿值 放到这里来
1707
- */
1708
- private initStore;
1709
- /**
1710
- * 初始化记住账号相关信息
1711
- * @param normalCount
1712
- * @returns
1713
- */
1714
- private initMemberState;
1715
- /**
1716
- * 获取当前ID下有效账号个数
1717
- * @returns qrCount 有效的二维码登录个数 normalCount 有效的账号登录方式
1718
- */
1719
- private memberStateCount;
1720
- /**
1721
- * 初始化第一次的数据 TODO: 逻辑有点脏 待整理
1722
- */
1723
- private initBackfillData;
1724
- /**
1725
- * 根据前端存储的登录方式返回后端映射方式
1726
- * @param front
1727
- */
1728
- private getServerLoginMethodByFront;
1729
- /**
1730
- * 当前 Store DONE
1731
- */
1732
- private getCurrentStore;
1733
- /**
1734
- * 国际化短信过滤
1735
- * true 表示通过 需要保留
1736
- * false 表示不通过 需要过滤
1737
- */
1738
- private validateInternationSms;
1739
- /**
1740
- * 校验有效的登录方式账号
1741
- * @param user
1742
- * @param serverSideLoginMethods
1743
- * @returns
1744
- */
1745
- private validateMethod;
1746
- /**
1747
- *
1748
- * @param tab 一级Tab状态
1749
- * @param way 二级Tab状态
1750
- * @param id 二维码登录时 记录对应的二维码 ID
1751
- */
1752
- private setLoginWay;
1753
- /**
1754
- * 设置/更新 store 内的用户信息
1755
- */
1756
- private setUserInfo;
1757
- /**
1758
- * 持久化保存
1759
- */
1760
- private saveStore;
1761
- /**
1762
- * 根据登录的 account 判断本次登录的方式
1763
- * @param account 登录输入的账号
1764
- * @param param1 登录成功返回的相关信息 用户名/手机号/邮箱
1765
- * @returns
1766
- */
1767
- private setLoginWayByHttpData;
1768
- /**
1769
- * 根据用户 ID 删除 localStorage 中当前用户 ID
1770
- */
1771
- private delUserById;
1772
- /**
1773
- * 获得多账号登录页面的所有用户列表
1774
- * @param excludeWays
1775
- */
1776
- private getMemoUser;
1777
- /**
1778
- * 根据 id 获得当前已登录的用户信息
1779
- * @param userId
1780
- * @returns User / undefined
1781
- */
1782
- private getMemoSingleUser;
1783
- /**
1784
- * 该方法仅仅需要回填账号的登录方式,其他都不计入
1785
- * 当用户名/手机号/邮箱/AD/LDAP 相同时,根据登录顺序匹配不同的账号
1786
- * 根据记住的用户登录方式获取对应的登录账户名
1787
- * @param way
1788
- * @param user
1789
- * @returns
1790
- */
1791
- private getAccountByWay;
1792
- private _mappingUser;
1793
- /**
1794
- * 外部暴露方法
1795
- */
1796
- getStore: () => {
1797
- initStore: (appId: string, options: {
1798
- serverSideLoginMethods: LoginWay[];
1799
- isInternationSms: boolean;
1800
- }) => void;
1801
- setLoginWay: (tab: 'input' | 'qrcode', way: LoginWay, id?: string | undefined, internation?: {
1802
- phoneCountryCode: string;
1803
- areaCode: string;
1804
- } | undefined) => void;
1805
- setUserInfo: (user: Pick<User & {
1806
- id: string;
1807
- }, "email" | "username" | "phone" | "id" | "nickname" | "photo" | "name" | "_updateTime" | "qrCodeId" | "areaCode">) => void;
1808
- setLoginWayByHttpData: (account: string, data: {
1809
- username?: string | undefined;
1810
- phone?: string | undefined;
1811
- email?: string | undefined;
1812
- }) => void;
1813
- getMemoUser: (excludeWays?: LoginWay[]) => SelectOptions[];
1814
- getMemoSingleUser: (id: string) => {
1815
- way: LoginWay;
1816
- account: string;
1817
- } | undefined;
1818
- delUserById: (id: string) => string;
1819
- getMemberState: () => boolean;
1820
- getFirstBackFillData: () => BackFillMultipleState | undefined;
1821
- };
1764
+ export default function useFDA(onChangeModule: ChangeModuleCore, initState: ModuleState, events?: GuardEvents, authFlow?: boolean): {
1765
+ isAuthFlow: boolean;
1766
+ guardStateMachine: GuardStateMachine | undefined;
1767
+ setGuardStateMachine: import("react").Dispatch<import("react").SetStateAction<GuardStateMachine | undefined>>;
1768
+ moduleEvents: {
1769
+ changeModule: (moduleName: GuardModuleType, initData?: any) => Promise<void>;
1770
+ backModule: () => void;
1771
+ } | undefined;
1772
+ };
1773
+
1774
+ }
1775
+ declare module '@authing/react-ui-components/components/Guard/core/hooks/useI18n' {
1776
+ import { GuardLocalConfig } from 'components/Guard/config';
1777
+ const useI18i: (config?: Partial<GuardLocalConfig> | undefined) => void;
1778
+ export { useI18i };
1779
+
1780
+ }
1781
+ declare module '@authing/react-ui-components/components/Guard/core/hooks/useModule' {
1782
+ import { GuardEvents } from '@authing/react-ui-components/components/Guard/event';
1783
+ import { ModuleState } from '@authing/react-ui-components/components/Guard/GuardModule/stateMachine';
1784
+ import { GuardModuleType } from '@authing/react-ui-components/components/Guard/module';
1785
+ export interface ChangeModuleCore {
1786
+ (type: GuardModuleType, initData?: any): Promise<void>;
1822
1787
  }
1823
1788
  /**
1824
- * MultipleAccounts 相关 Hook
1825
- * Finally Config 类型过滤
1789
+ * Guard 组件渲染状态
1790
+ * @param initializeState 初始化数据
1791
+ * @param events Guard 事件对象
1792
+ * @returns moduleState 组件当前渲染状态,onChangeModule 切换状态方法
1826
1793
  */
1827
- const useMultipleAccounts: ({ appId, finallyConfig }: {
1828
- appId?: string | undefined;
1829
- finallyConfig?: any;
1830
- }) => {
1831
- instance: {
1832
- initStore: (appId: string, options: {
1833
- serverSideLoginMethods: LoginWay[];
1834
- isInternationSms: boolean;
1835
- }) => void;
1836
- setLoginWay: (tab: 'input' | 'qrcode', way: LoginWay, id?: string | undefined, internation?: {
1837
- phoneCountryCode: string;
1838
- areaCode: string;
1839
- } | undefined) => void;
1840
- setUserInfo: (user: Pick<User & {
1841
- id: string;
1842
- }, "email" | "username" | "phone" | "id" | "nickname" | "photo" | "name" | "_updateTime" | "qrCodeId" | "areaCode">) => void;
1843
- setLoginWayByHttpData: (account: string, data: {
1844
- username?: string | undefined;
1845
- phone?: string | undefined;
1846
- email?: string | undefined;
1847
- }) => void;
1848
- getMemoUser: (excludeWays?: LoginWay[]) => SelectOptions[];
1849
- getMemoSingleUser: (id: string) => {
1850
- way: LoginWay;
1851
- account: string;
1852
- } | undefined;
1853
- delUserById: (id: string) => string;
1854
- getMemberState: () => boolean;
1855
- getFirstBackFillData: () => BackFillMultipleState | undefined;
1856
- } | undefined;
1857
- isMultipleAccount: boolean;
1858
- referMultipleState: (type: 'login' | 'multiple', data?: BackFillMultipleState | undefined) => void;
1859
- multipleAccountData: BackFillMultipleState | undefined;
1860
- clearBackFillData: () => void;
1794
+ export default function useModule(initializeState: ModuleState, events?: GuardEvents): {
1795
+ moduleState: ModuleState;
1796
+ onChangeModule: ChangeModuleCore;
1861
1797
  };
1862
- export default useMultipleAccounts;
1863
1798
 
1864
1799
  }
1865
1800
  declare module '@authing/react-ui-components/components/Guard/core/index' {
@@ -1873,7 +1808,7 @@ declare module '@authing/react-ui-components/components/Guard/core/index' {
1873
1808
  export const GuardCore: (props: GuardCoreProps) => JSX.Element;
1874
1809
 
1875
1810
  }
1876
- declare module '@authing/react-ui-components/components/Guard/core/renderContext' {
1811
+ declare module '@authing/react-ui-components/components/Guard/core/renderContext-1' {
1877
1812
  import { GuardProps } from '@authing/react-ui-components/components/Guard/index';
1878
1813
  import React from 'react';
1879
1814
  import { ModuleState } from '@authing/react-ui-components/components/Guard/GuardModule/stateMachine';
@@ -1920,32 +1855,7 @@ declare module '@authing/react-ui-components/components/Guard/event' {
1920
1855
  export interface GuardEvents extends LoginEvents, RegisterEvents, CompleteInfoEvents, ForgetPasswordEvents, IdentityBindingEvents, IdentityBindingAskEvents {
1921
1856
  onBeforeChangeModule?: (key: GuardModuleType, initData?: any) => boolean | Promise<boolean>;
1922
1857
  }
1923
- export const guardEventsFilter: (props: any, multipleInstance?: {
1924
- initStore: (appId: string, options: {
1925
- serverSideLoginMethods: import("@authing/react-ui-components/components/Guard/core/hooks/useMultipleAccounts").LoginWay[];
1926
- isInternationSms: boolean;
1927
- }) => void;
1928
- setLoginWay: (tab: "input" | "qrcode", way: import("@authing/react-ui-components/components/Guard/core/hooks/useMultipleAccounts").LoginWay, id?: string | undefined, internation?: {
1929
- phoneCountryCode: string;
1930
- areaCode: string;
1931
- } | undefined) => void;
1932
- setUserInfo: (user: Pick<import("@authing/react-ui-components/components/Guard/core/hooks/useMultipleAccounts").User & {
1933
- id: string;
1934
- }, "email" | "username" | "phone" | "id" | "nickname" | "photo" | "name" | "_updateTime" | "qrCodeId" | "areaCode">) => void;
1935
- setLoginWayByHttpData: (account: string, data: {
1936
- username?: string | undefined;
1937
- phone?: string | undefined;
1938
- email?: string | undefined;
1939
- }) => void;
1940
- getMemoUser: (excludeWays?: import("@authing/react-ui-components/components/Guard/core/hooks/useMultipleAccounts").LoginWay[]) => import("../Login/multipleAccounts/panel").SelectOptions[];
1941
- getMemoSingleUser: (id: string) => {
1942
- way: import("@authing/react-ui-components/components/Guard/core/hooks/useMultipleAccounts").LoginWay;
1943
- account: string;
1944
- } | undefined;
1945
- delUserById: (id: string) => string;
1946
- getMemberState: () => boolean;
1947
- getFirstBackFillData: () => import("@authing/react-ui-components/components/Guard/core/hooks/useMultipleAccounts").BackFillMultipleState | undefined;
1948
- } | undefined, openEventsMapping?: boolean | undefined) => GuardEvents;
1858
+ export const guardEventsFilter: (props: any, openEventsMapping?: boolean | undefined) => GuardEvents;
1949
1859
  export const guardEventsHijacking: (events: GuardEvents, openEventsMapping?: boolean | undefined) => GuardEvents;
1950
1860
  export const GuardEventsCamelToKebabMapping: {
1951
1861
  readonly onLoad: "load";
@@ -2088,8 +1998,21 @@ declare module '@authing/react-ui-components/components/IconFont/useGuardIconfon
2088
1998
  declare module '@authing/react-ui-components/components/IdentityBinding/IdentityBinding' {
2089
1999
  import React from 'react';
2090
2000
  import './styles.less';
2001
+ /**
2002
+ * 身份源绑定 第三方登陆时
2003
+ * 需要身份源绑定相关 Authing 账号
2004
+ * @returns
2005
+ */
2091
2006
  export const GuardIdentityBindingView: React.FC;
2092
2007
 
2008
+ }
2009
+ declare module '@authing/react-ui-components/components/IdentityBinding/api/index' {
2010
+ export * from '@authing/react-ui-components/components/IdentityBinding/api/request';
2011
+
2012
+ }
2013
+ declare module '@authing/react-ui-components/components/IdentityBinding/api/request' {
2014
+ export { authFlowByAxios } from 'service/api';
2015
+
2093
2016
  }
2094
2017
  declare module '@authing/react-ui-components/components/IdentityBinding/businessRequest' {
2095
2018
  export enum IdentityBindingBusinessAction {
@@ -2117,13 +2040,10 @@ declare module '@authing/react-ui-components/components/IdentityBinding/business
2117
2040
  BindByPhoneCode = "bind-identity-by-phone-code",
2118
2041
  BindByEmailCode = "bind-identity-by-email-code"
2119
2042
  }
2120
- export const PhoneCode: (params: PhoneCodeParams) => Promise<import("@authing/react-ui-components/components/_utils/http").AuthingGuardResponse<any>>;
2121
- export const EmailCode: (params: EmailCodeParams) => Promise<import("@authing/react-ui-components/components/_utils/http").AuthingGuardResponse<any>>;
2122
- export const Password: (params: PasswordParams) => Promise<import("@authing/react-ui-components/components/_utils/http").AuthingGuardResponse<any>>;
2123
2043
  export const useIdentityBindingBusinessRequest: () => {
2124
- "phone-code": (params: PhoneCodeParams) => Promise<import("@authing/react-ui-components/components/_utils/http").AuthingGuardResponse<any>>;
2125
- "emial-code": (params: EmailCodeParams) => Promise<import("@authing/react-ui-components/components/_utils/http").AuthingGuardResponse<any>>;
2126
- password: (params: PasswordParams) => Promise<import("@authing/react-ui-components/components/_utils/http").AuthingGuardResponse<any>>;
2044
+ "phone-code": (data: PhoneCodeParams) => Promise<import("@authing/react-ui-components/components/_utils/http").AuthingGuardResponse<any>>;
2045
+ "emial-code": (data: EmailCodeParams) => Promise<import("@authing/react-ui-components/components/_utils/http").AuthingGuardResponse<any>>;
2046
+ password: (data: PasswordParams) => Promise<import("@authing/react-ui-components/components/_utils/http").AuthingGuardResponse<any>>;
2127
2047
  };
2128
2048
 
2129
2049
  }
@@ -2167,6 +2087,18 @@ declare module '@authing/react-ui-components/components/IdentityBindingAsk/Ident
2167
2087
  import './styles.less';
2168
2088
  export const GuardIdentityBindingAskView: React.FC;
2169
2089
 
2090
+ }
2091
+ declare module '@authing/react-ui-components/components/IdentityBindingAsk/api/index' {
2092
+ import { AxiosRequestConfig } from 'axios';
2093
+ /**
2094
+ * 状态机
2095
+ * @param action
2096
+ * @param config
2097
+ * @returns
2098
+ */
2099
+ const authFlow: (action: string, config?: AxiosRequestConfig<any> | undefined) => Promise<import("@authing/react-ui-components/components/_utils/http").AuthingGuardResponse<any>>;
2100
+ export { authFlow };
2101
+
2170
2102
  }
2171
2103
  declare module '@authing/react-ui-components/components/IdentityBindingAsk/index' {
2172
2104
  export * from '@authing/react-ui-components/components/IdentityBindingAsk/IdentityBindingAsk';
@@ -2229,43 +2161,162 @@ declare module '@authing/react-ui-components/components/InputPassword/index' {
2229
2161
  export const InputPassword: React.ForwardRefExoticComponent<PasswordProps & React.RefAttributes<React.RefObject<Input>>>;
2230
2162
 
2231
2163
  }
2232
- declare module '@authing/react-ui-components/components/Login/codemap' {
2233
- import { GuardModuleAction } from '@authing/react-ui-components/components/Guard/module';
2234
- export const codeMap: Record<number, GuardModuleAction>;
2164
+ declare module '@authing/react-ui-components/components/Login/api/constant' {
2165
+ export const loginUrlByPassword: (isAdWay: boolean) => "/api/v2/login/ad-all-in-one" | "/api/v2/login/account";
2166
+ export const loginUrlByPhoneCode: () => string;
2167
+ export const loginUrlByEmailCode: () => string;
2168
+ export const loginUrlByAD: () => string;
2169
+ export const loginUrlByLDAP: () => string;
2170
+ export const preLoginUrlByOIDC: () => string;
2235
2171
 
2236
2172
  }
2237
- declare module '@authing/react-ui-components/components/Login/core/withAD' {
2238
- /// <reference types="react" />
2239
- import { Agreement } from '@authing/react-ui-components/components/AuthingGuard/api/index';
2240
- import { BackFillMultipleState, StoreInstance } from '@authing/react-ui-components/components/Guard/core/hooks/useMultipleAccounts';
2241
- interface LoginWithADProps {
2242
- publicKey: string;
2173
+ declare module '@authing/react-ui-components/components/Login/api/index' {
2174
+ export * from '@authing/react-ui-components/components/Login/api/request';
2175
+
2176
+ }
2177
+ declare module '@authing/react-ui-components/components/Login/api/request' {
2178
+ import { AxiosRequestConfig } from 'axios';
2179
+ export interface LoginParams<T = any> {
2180
+ /**
2181
+ * 登陆自定义参数
2182
+ */
2183
+ customData: T;
2184
+ /**
2185
+ * 是否自动注册
2186
+ */
2243
2187
  autoRegister?: boolean;
2244
- onLoginSuccess: any;
2245
- onLoginFailed: any;
2246
- onBeforeLogin: any;
2247
- agreements: Agreement[];
2248
2188
  /**
2249
- * 回填的数据
2189
+ * 是否携带自定义数据
2190
+ */
2191
+ withCustomData?: boolean;
2192
+ }
2193
+ /**
2194
+ * 密码登陆请求参数
2195
+ */
2196
+ export interface LoginParamsWithPassword<T = any> extends LoginParams<T> {
2197
+ /**
2198
+ * 账号
2199
+ */
2200
+ account: string;
2201
+ /**
2202
+ * 密码
2250
2203
  */
2251
- backfillData?: BackFillMultipleState;
2204
+ password: string;
2252
2205
  /**
2253
- * 根据输入的账号 & 返回获得对应的登录方法
2206
+ * 验证码
2254
2207
  */
2255
- multipleInstance?: StoreInstance;
2208
+ captchaCode: string;
2256
2209
  }
2257
- export const LoginWithAD: (props: LoginWithADProps) => JSX.Element;
2258
- export {};
2259
-
2260
- }
2261
- declare module '@authing/react-ui-components/components/Login/core/withAppQrcode' {
2262
- /// <reference types="react" />
2263
- import { StoreInstance } from '@authing/react-ui-components/components/Guard/core/hooks/useMultipleAccounts';
2264
- interface LoginWithAppQrcodeProps {
2265
- onLoginSuccess: any;
2266
- canLoop: boolean;
2210
+ /**
2211
+ * 密码登陆
2212
+ */
2213
+ export const loginRequestByAxios: <T>(data: LoginParams, way?: boolean, config?: AxiosRequestConfig<any> | undefined) => Promise<import("@authing/react-ui-components/components/_utils/http").AuthingGuardResponse<T>>;
2214
+ /**
2215
+ * 手机登陆请求参数
2216
+ */
2217
+ export interface LoginParamsWithPhone<T = any> extends LoginParams<T> {
2218
+ /**
2219
+ * 手机号
2220
+ */
2221
+ phone: string;
2222
+ /**
2223
+ * 验证码
2224
+ */
2225
+ code: string;
2226
+ /**
2227
+ * 手机前位数
2228
+ */
2229
+ phoneCountryCode?: number;
2230
+ }
2231
+ /**
2232
+ * 手机验证码登陆
2233
+ * @param data
2234
+ * @returns
2235
+ */
2236
+ export const mobileLoginByAxios: (data: LoginParamsWithPhone, config?: AxiosRequestConfig<any> | undefined) => Promise<import("@authing/react-ui-components/components/_utils/http").AuthingGuardResponse<any>>;
2237
+ /**
2238
+ * 手机登陆请求参数
2239
+ */
2240
+ export interface LoginParamsWithEmail<T = any> extends LoginParams<T> {
2241
+ /**
2242
+ * 邮箱号
2243
+ */
2244
+ email: string;
2245
+ /**
2246
+ * 验证码
2247
+ */
2248
+ code: string;
2249
+ }
2250
+ /**
2251
+ * 邮箱登陆
2252
+ * @param data
2253
+ * @param config
2254
+ * @returns
2255
+ */
2256
+ export const emailLoginByAxios: (data: LoginParamsWithEmail, config?: AxiosRequestConfig<any> | undefined) => Promise<import("@authing/react-ui-components/components/_utils/http").AuthingGuardResponse<any>>;
2257
+ /**
2258
+ * AD 登陆
2259
+ * @param data
2260
+ * @returns
2261
+ */
2262
+ export const adLoginByAxios: (data: {
2263
+ username: string;
2264
+ password: string;
2265
+ }, config?: AxiosRequestConfig<any> | undefined) => Promise<import("@authing/react-ui-components/components/_utils/http").AuthingGuardResponse<any>>;
2266
+ /**
2267
+ * LDAP 登陆
2268
+ * @param data
2269
+ * @returns
2270
+ */
2271
+ export const ldapLoginByAxios: (data: {
2272
+ username: string;
2273
+ password: string;
2274
+ }, config?: AxiosRequestConfig<any> | undefined) => Promise<import("@authing/react-ui-components/components/_utils/http").AuthingGuardResponse<any>>;
2275
+ interface PreOIDCParams {
2276
+ state: string;
2277
+ protocol: string;
2278
+ userPoolId: string;
2279
+ appId: string;
2280
+ referer: string;
2281
+ connection: {
2282
+ providerIentifier: any;
2283
+ };
2284
+ }
2285
+ /**
2286
+ * IDO -> OIDC 登陆前校验
2287
+ * @param data
2288
+ * @returns
2289
+ */
2290
+ export const preLoginOIDCByAxios: (data: PreOIDCParams, config?: AxiosRequestConfig<any> | undefined) => Promise<import("@authing/react-ui-components/components/_utils/http").AuthingGuardResponse<any>>;
2291
+ export {};
2292
+
2293
+ }
2294
+ declare module '@authing/react-ui-components/components/Login/codemap' {
2295
+ import { GuardModuleAction } from '@authing/react-ui-components/components/Guard/module';
2296
+ export const codeMap: Record<number, GuardModuleAction>;
2297
+
2298
+ }
2299
+ declare module '@authing/react-ui-components/components/Login/core/withAD' {
2300
+ /// <reference types="react" />
2301
+ import { Agreement } from '@authing/react-ui-components/components/AuthingGuard/api/index';
2302
+ interface LoginWithADProps {
2303
+ publicKey: string;
2304
+ autoRegister?: boolean;
2305
+ onLoginSuccess: any;
2306
+ onLoginFailed: any;
2307
+ onBeforeLogin: any;
2308
+ agreements: Agreement[];
2309
+ }
2310
+ export const LoginWithAD: (props: LoginWithADProps) => JSX.Element;
2311
+ export {};
2312
+
2313
+ }
2314
+ declare module '@authing/react-ui-components/components/Login/core/withAppQrcode' {
2315
+ /// <reference types="react" />
2316
+ interface LoginWithAppQrcodeProps {
2317
+ onLoginSuccess: any;
2318
+ canLoop: boolean;
2267
2319
  qrCodeScanOptions: any;
2268
- multipleInstance?: StoreInstance;
2269
2320
  }
2270
2321
  export const LoginWithAppQrcode: (props: LoginWithAppQrcodeProps) => JSX.Element;
2271
2322
  export {};
@@ -2274,7 +2325,6 @@ declare module '@authing/react-ui-components/components/Login/core/withAppQrcode
2274
2325
  declare module '@authing/react-ui-components/components/Login/core/withLDAP' {
2275
2326
  /// <reference types="react" />
2276
2327
  import { Agreement } from '@authing/react-ui-components/components/AuthingGuard/api/index';
2277
- import { BackFillMultipleState, StoreInstance } from '@authing/react-ui-components/components/Guard/core/hooks/useMultipleAccounts';
2278
2328
  interface LoginWithLDAPProps {
2279
2329
  publicKey: string;
2280
2330
  autoRegister?: boolean;
@@ -2283,14 +2333,6 @@ declare module '@authing/react-ui-components/components/Login/core/withLDAP' {
2283
2333
  onLoginFailed: any;
2284
2334
  onBeforeLogin: any;
2285
2335
  agreements: Agreement[];
2286
- /**
2287
- * 根据输入的账号 & 返回获得对应的登录方法
2288
- */
2289
- multipleInstance?: StoreInstance;
2290
- /**
2291
- * 多账号回填的数据
2292
- */
2293
- backfillData?: BackFillMultipleState;
2294
2336
  }
2295
2337
  export const LoginWithLDAP: (props: LoginWithLDAPProps) => JSX.Element;
2296
2338
  export {};
@@ -2303,6 +2345,11 @@ declare module '@authing/react-ui-components/components/Login/core/withPassword/
2303
2345
  export interface FormItemAccountProps extends FormItemProps {
2304
2346
  passwordLoginMethods: PasswordLoginMethods[];
2305
2347
  }
2348
+ /**
2349
+ * 根据对应的配置:邮箱/用户名/Email渲染FormItem
2350
+ * @param props
2351
+ * @returns
2352
+ */
2306
2353
  export const FormItemAccount: React.FC<FormItemAccountProps>;
2307
2354
 
2308
2355
  }
@@ -2313,6 +2360,11 @@ declare module '@authing/react-ui-components/components/Login/core/withPassword/
2313
2360
  verifyCodeUrl: string;
2314
2361
  changeCode: () => void;
2315
2362
  }
2363
+ /**
2364
+ * 图形验证码
2365
+ * @param props
2366
+ * @returns
2367
+ */
2316
2368
  export const GraphicVerifyCode: React.FC<GraphicVerifyCodeProps>;
2317
2369
 
2318
2370
  }
@@ -2320,6 +2372,10 @@ declare module '@authing/react-ui-components/components/Login/core/withPassword/
2320
2372
  import { InputProps } from 'antd/lib/input';
2321
2373
  import React from 'react';
2322
2374
  import { PasswordLoginMethods } from '@authing/react-ui-components/components/AuthingGuard/api/index';
2375
+ /**
2376
+ * 账号输入框
2377
+ * 根据邮箱/手机号/密码配置自适应
2378
+ */
2323
2379
  export interface InputAccountProps extends InputProps {
2324
2380
  passwordLoginMethods: PasswordLoginMethods[];
2325
2381
  }
@@ -2331,7 +2387,6 @@ declare module '@authing/react-ui-components/components/Login/core/withPassword/
2331
2387
  import { Agreement, PasswordLoginMethods } from '@authing/react-ui-components/components/AuthingGuard/api/index';
2332
2388
  import { LoginMethods } from '@authing/react-ui-components/components/index';
2333
2389
  import { AuthingResponse } from '@authing/react-ui-components/components/_utils/http';
2334
- import { BackFillMultipleState, StoreInstance } from '@authing/react-ui-components/components/Guard/core/hooks/useMultipleAccounts';
2335
2390
  interface LoginWithPasswordProps {
2336
2391
  publicKey: string;
2337
2392
  autoRegister?: boolean;
@@ -2345,15 +2400,12 @@ declare module '@authing/react-ui-components/components/Login/core/withPassword/
2345
2400
  loginWay?: LoginMethods;
2346
2401
  submitButText?: string;
2347
2402
  saveIdentify?: (type: LoginMethods, identity: string) => void;
2348
- /**
2349
- * 根据输入的账号 & 返回获得对应的登录方法
2350
- */
2351
- multipleInstance?: StoreInstance;
2352
- /**
2353
- * 多账号回填的数据
2354
- */
2355
- backfillData?: BackFillMultipleState;
2356
2403
  }
2404
+ /**
2405
+ * 密码登陆
2406
+ * @param props
2407
+ * @returns
2408
+ */
2357
2409
  export const LoginWithPassword: (props: LoginWithPasswordProps) => JSX.Element;
2358
2410
  export {};
2359
2411
 
@@ -2386,10 +2438,6 @@ declare module '@authing/react-ui-components/components/Login/core/withVerifyCod
2386
2438
  import React, { FC } from 'react';
2387
2439
  import './styles.less';
2388
2440
  export interface VirtualDropdownProps {
2389
- /**
2390
- * 回填的国际化区号
2391
- */
2392
- regionCode?: string;
2393
2441
  value?: string;
2394
2442
  onChange?: (value: string) => void;
2395
2443
  style?: React.CSSProperties;
@@ -2400,8 +2448,7 @@ declare module '@authing/react-ui-components/components/Login/core/withVerifyCod
2400
2448
  declare module '@authing/react-ui-components/components/Login/core/withVerifyCode/index' {
2401
2449
  /// <reference types="react" />
2402
2450
  import './styles.less';
2403
- const LoginWithVerifyCode: (props: any) => JSX.Element;
2404
- export { LoginWithVerifyCode };
2451
+ export const LoginWithVerifyCode: (props: any) => JSX.Element;
2405
2452
 
2406
2453
  }
2407
2454
  declare module '@authing/react-ui-components/components/Login/core/withVerifyCode/inputIdentify' {
@@ -2416,13 +2463,10 @@ declare module '@authing/react-ui-components/components/Login/core/withVerifyCod
2416
2463
  }
2417
2464
  declare module '@authing/react-ui-components/components/Login/core/withWechatMiniQrcode' {
2418
2465
  /// <reference types="react" />
2419
- import { StoreInstance } from '@authing/react-ui-components/components/Guard/core/hooks/useMultipleAccounts';
2420
2466
  interface LoginWithWechatMiniQrcodeProps {
2421
2467
  onLoginSuccess: any;
2422
2468
  canLoop: boolean;
2423
2469
  qrCodeScanOptions: any;
2424
- id: string;
2425
- multipleInstance?: StoreInstance;
2426
2470
  }
2427
2471
  export const LoginWithWechatMiniQrcode: (props: LoginWithWechatMiniQrcodeProps) => JSX.Element;
2428
2472
  export {};
@@ -2430,78 +2474,14 @@ declare module '@authing/react-ui-components/components/Login/core/withWechatMin
2430
2474
  }
2431
2475
  declare module '@authing/react-ui-components/components/Login/core/withWechatmpQrcode' {
2432
2476
  /// <reference types="react" />
2433
- import { StoreInstance } from '@authing/react-ui-components/components/Guard/core/hooks/useMultipleAccounts';
2434
2477
  interface LoginWithWechatmpQrcodeProps {
2435
2478
  onLoginSuccess: any;
2436
2479
  canLoop: boolean;
2437
2480
  qrCodeScanOptions: any;
2438
- id: string;
2439
- /**
2440
- * 多账号存储实例
2441
- */
2442
- multipleInstance?: StoreInstance;
2443
2481
  }
2444
2482
  export const LoginWithWechatmpQrcode: (props: LoginWithWechatmpQrcodeProps) => JSX.Element;
2445
2483
  export {};
2446
2484
 
2447
- }
2448
- declare module '@authing/react-ui-components/components/Login/hooks/useLoginMultiple' {
2449
- /// <reference types="react" />
2450
- import { FormInstance } from 'antd/lib/form';
2451
- import { BackFillMultipleState, LoginWay } from '@authing/react-ui-components/components/Guard/core/hooks/useMultipleAccounts';
2452
- /**
2453
- * 多账号登录下 账户 & 登录方式自动回填
2454
- * TODO: HOOK 参数有时间整理成为对象,开始没有想到有这么多
2455
- * 调用地方 core 中需要回填的两个登录方式
2456
- */
2457
- function useLoginMultipleBackFill(options: {
2458
- form: FormInstance<any>;
2459
- way: LoginWay;
2460
- formKey: string;
2461
- backfillData?: BackFillMultipleState;
2462
- isOnlyInternationSms?: boolean;
2463
- setAreaCode?: React.Dispatch<React.SetStateAction<string>>;
2464
- cancelBackfill?: boolean;
2465
- }): void;
2466
- /**
2467
- * 多账号统一状态管理
2468
- * @param setLoginWay
2469
- * @returns
2470
- */
2471
- function useLoginMultiple(setLoginWay: React.Dispatch<any>): {
2472
- isMultipleAccount: boolean;
2473
- multipleInstance: {
2474
- initStore: (appId: string, options: {
2475
- serverSideLoginMethods: LoginWay[];
2476
- isInternationSms: boolean;
2477
- }) => void;
2478
- setLoginWay: (tab: "input" | "qrcode", way: LoginWay, id?: string | undefined, internation?: {
2479
- phoneCountryCode: string;
2480
- areaCode: string;
2481
- } | undefined) => void;
2482
- setUserInfo: (user: Pick<import("@authing/react-ui-components/components/Guard/core/hooks/useMultipleAccounts").User & {
2483
- id: string;
2484
- }, "email" | "username" | "phone" | "id" | "nickname" | "photo" | "name" | "_updateTime" | "qrCodeId" | "areaCode">) => void;
2485
- setLoginWayByHttpData: (account: string, data: {
2486
- username?: string | undefined;
2487
- phone?: string | undefined;
2488
- email?: string | undefined;
2489
- }) => void;
2490
- getMemoUser: (excludeWays?: LoginWay[]) => import("@authing/react-ui-components/components/Login/multipleAccounts/panel").SelectOptions[];
2491
- getMemoSingleUser: (id: string) => {
2492
- way: LoginWay;
2493
- account: string;
2494
- } | undefined;
2495
- delUserById: (id: string) => string;
2496
- getMemberState: () => boolean;
2497
- getFirstBackFillData: () => BackFillMultipleState | undefined;
2498
- } | undefined;
2499
- referMultipleState: ((type: "login" | "multiple") => void) | undefined;
2500
- backfillData: BackFillMultipleState | undefined;
2501
- defaultQrWay: string | undefined;
2502
- };
2503
- export { useLoginMultipleBackFill, useLoginMultiple };
2504
-
2505
2485
  }
2506
2486
  declare module '@authing/react-ui-components/components/Login/index' {
2507
2487
  /// <reference types="react" />
@@ -2550,79 +2530,6 @@ declare module '@authing/react-ui-components/components/Login/interface' {
2550
2530
  }
2551
2531
  export const getDefaultLoginConfig: () => LoginConfig;
2552
2532
 
2553
- }
2554
- declare module '@authing/react-ui-components/components/Login/multipleAccounts/index' {
2555
- import React from 'react';
2556
- import { LoginWay, StoreInstance } from '@authing/react-ui-components/components/Guard/core/hooks/useMultipleAccounts';
2557
- import { GuardModuleType } from '@authing/react-ui-components/components/Guard/index';
2558
- interface MultipleAccountsProps {
2559
- /**
2560
- * 多账号存储实例
2561
- */
2562
- multipleInstance?: StoreInstance;
2563
- /**
2564
- * 切换 Guard 方法
2565
- */
2566
- changeModule?: (moduleName: GuardModuleType, initData?: any) => Promise<void>;
2567
- /**
2568
- * 切换多账号状态
2569
- */
2570
- referMultipleState?: (type: 'login' | 'multiple', data?: {
2571
- account: string;
2572
- way: LoginWay;
2573
- }) => void;
2574
- }
2575
- const MultipleAccounts: React.NamedExoticComponent<MultipleAccountsProps>;
2576
- export { MultipleAccounts };
2577
-
2578
- }
2579
- declare module '@authing/react-ui-components/components/Login/multipleAccounts/panel' {
2580
- import React from 'react';
2581
- import './style.less';
2582
- interface SelectPanelProps {
2583
- lists: SelectOptions[];
2584
- /**
2585
- * 点击删除
2586
- */
2587
- handleDel: (id: string) => void;
2588
- /**
2589
- * 点击 li
2590
- */
2591
- onClick: (id: string) => void;
2592
- }
2593
- export interface SelectOptions {
2594
- /**
2595
- * 头像
2596
- */
2597
- photo?: string;
2598
- /**
2599
- * 标题
2600
- */
2601
- title?: string;
2602
- /**
2603
- * 描述
2604
- */
2605
- description?: string;
2606
- /**
2607
- * 用户 ID 唯一标识符
2608
- */
2609
- id: string | 'other';
2610
- /**
2611
- * 显示操作栏 default: true
2612
- */
2613
- operation?: boolean;
2614
- /**
2615
- * 登录时间
2616
- */
2617
- _updateTime: number;
2618
- /**
2619
- * 替代图片元素
2620
- */
2621
- element?: React.ReactElement;
2622
- }
2623
- const SelectPanel: React.FC<SelectPanelProps>;
2624
- export { SelectPanel };
2625
-
2626
2533
  }
2627
2534
  declare module '@authing/react-ui-components/components/Login/socialLogin/IdpButton/index' {
2628
2535
  /// <reference types="react" />
@@ -2634,7 +2541,6 @@ declare module '@authing/react-ui-components/components/Login/socialLogin/index'
2634
2541
  import { ApplicationConfig, SocialConnectionItem } from '@authing/react-ui-components/components/AuthingGuard/api/index';
2635
2542
  import './style.less';
2636
2543
  import { GuardLocalConfig } from '@authing/react-ui-components/components/Guard/index';
2637
- import { StoreInstance } from '@authing/react-ui-components/components/Guard/core/hooks/useMultipleAccounts';
2638
2544
  export interface SocialLoginProps {
2639
2545
  appId: string;
2640
2546
  config: GuardLocalConfig;
@@ -2642,10 +2548,6 @@ declare module '@authing/react-ui-components/components/Login/socialLogin/index'
2642
2548
  onLoginSuccess: any;
2643
2549
  enterpriseConnectionObjs: ApplicationConfig['identityProviders'];
2644
2550
  socialConnectionObjs: SocialConnectionItem[];
2645
- /**
2646
- * 根据输入的账号 & 返回获得对应的登录方法
2647
- */
2648
- multipleInstance?: StoreInstance;
2649
2551
  }
2650
2552
  export const SocialLogin: React.FC<SocialLoginProps>;
2651
2553
 
@@ -2687,6 +2589,23 @@ declare module '@authing/react-ui-components/components/MFA/VerifyCodeInput/inde
2687
2589
  export const VerifyCodeInput: FC<VerifyCodeInputProps>;
2688
2590
  export {};
2689
2591
 
2592
+ }
2593
+ declare module '@authing/react-ui-components/components/MFA/api/constant' {
2594
+ export const uploadFaceUrl: () => string;
2595
+
2596
+ }
2597
+ declare module '@authing/react-ui-components/components/MFA/api/index' {
2598
+ export { sendEmailCodeByAxios } from 'service/api';
2599
+ export * from '@authing/react-ui-components/components/MFA/api/request';
2600
+
2601
+ }
2602
+ declare module '@authing/react-ui-components/components/MFA/api/request' {
2603
+ import { AxiosRequestConfig } from 'axios';
2604
+ /**
2605
+ * 上传绑定人脸识别的照片
2606
+ */
2607
+ export const uploadFaceImageByAxios: <T = any>(data: FormData, config?: AxiosRequestConfig<any> | undefined) => Promise<import("@authing/react-ui-components/components/_utils/http").AuthingGuardResponse<T>>;
2608
+
2690
2609
  }
2691
2610
  declare module '@authing/react-ui-components/components/MFA/businessRequest' {
2692
2611
  export enum MfaBusinessAction {
@@ -2730,8 +2649,19 @@ declare module '@authing/react-ui-components/components/MFA/businessRequest' {
2730
2649
  export const useMfaBusinessRequest: () => {
2731
2650
  "verify-email": (content: VerifyEmailContent) => Promise<import("@authing/react-ui-components/components/_utils/http").AuthingGuardResponse<any>>;
2732
2651
  "verify-sms": (content: VerifySmsContent) => Promise<import("@authing/react-ui-components/components/_utils/http").AuthingGuardResponse<any>>;
2652
+ /**
2653
+ * Totp 状态请求
2654
+ * @param content
2655
+ * @returns
2656
+ */
2733
2657
  "verify-totp": (content: VerifyTotpContent) => Promise<import("@authing/react-ui-components/components/_utils/http").AuthingGuardResponse<any>>;
2658
+ /**
2659
+ * 人脸验证
2660
+ */
2734
2661
  "verify-face": (content: VerifyFaceContent) => Promise<import("@authing/react-ui-components/components/_utils/http").AuthingGuardResponse<any>>;
2662
+ /**
2663
+ * 人脸绑定
2664
+ */
2735
2665
  "associate-face": (content: AssociateFaceContent) => Promise<import("@authing/react-ui-components/components/_utils/http").AuthingGuardResponse<any>>;
2736
2666
  };
2737
2667
  export {};
@@ -2750,6 +2680,11 @@ declare module '@authing/react-ui-components/components/MFA/core/email' {
2750
2680
  onBind: (email: string) => void;
2751
2681
  config: any;
2752
2682
  }
2683
+ /**
2684
+ * 绑定邮箱页面
2685
+ * @param param0
2686
+ * @returns
2687
+ */
2753
2688
  export const BindMFAEmail: React.FC<BindMFAEmailProps>;
2754
2689
  interface VerifyMFAEmailProps {
2755
2690
  email: string;
@@ -2758,7 +2693,17 @@ declare module '@authing/react-ui-components/components/MFA/core/email' {
2758
2693
  sendCodeRef: React.RefObject<HTMLButtonElement>;
2759
2694
  codeLength: number;
2760
2695
  }
2696
+ /**
2697
+ * 验证邮箱
2698
+ * @param param0
2699
+ * @returns
2700
+ */
2761
2701
  export const VerifyMFAEmail: React.FC<VerifyMFAEmailProps>;
2702
+ /**
2703
+ * 邮箱验证方式
2704
+ * @param param0
2705
+ * @returns
2706
+ */
2762
2707
  export const MFAEmail: React.FC<{
2763
2708
  mfaToken: string;
2764
2709
  email?: string;
@@ -2770,6 +2715,11 @@ declare module '@authing/react-ui-components/components/MFA/core/email' {
2770
2715
  }
2771
2716
  declare module '@authing/react-ui-components/components/MFA/core/face' {
2772
2717
  /// <reference types="react" />
2718
+ /**
2719
+ * 面部认证
2720
+ * @param props
2721
+ * @returns
2722
+ */
2773
2723
  export const MFAFace: (props: any) => JSX.Element;
2774
2724
 
2775
2725
  }
@@ -2781,7 +2731,13 @@ declare module '@authing/react-ui-components/components/MFA/core/face_deps' {
2781
2731
  };
2782
2732
  };
2783
2733
  export const FACE_SCORE = 0.65;
2734
+ /**
2735
+ * 人脸检测配置
2736
+ */
2784
2737
  export function getFaceDetectorOptions(): any;
2738
+ /**
2739
+ * 获取 facePlugin tinyFaceDetector 微型人脸探测(三种方式之一)
2740
+ */
2785
2741
  export function getCurrentFaceDetectionNet(): any;
2786
2742
  export function isFaceDetectionModelLoaded(): boolean;
2787
2743
  export function dataURItoBlob(base64Data: any): Blob;
@@ -2798,6 +2754,11 @@ declare module '@authing/react-ui-components/components/MFA/core/sms' {
2798
2754
  setAreaCode: (areaCode: string) => void;
2799
2755
  isInternationSms: boolean;
2800
2756
  }
2757
+ /**
2758
+ * 绑定手机号
2759
+ * @param param0
2760
+ * @returns
2761
+ */
2801
2762
  export const BindMFASms: React.FC<BindMFASmsProps>;
2802
2763
  export interface VerifyMFASmsProps {
2803
2764
  mfaToken: string;
@@ -2811,6 +2772,11 @@ declare module '@authing/react-ui-components/components/MFA/core/sms' {
2811
2772
  userPhone?: string;
2812
2773
  }
2813
2774
  export const VerifyMFASms: React.FC<VerifyMFASmsProps>;
2775
+ /**
2776
+ * 手机 MFA
2777
+ * @param param0
2778
+ * @returns
2779
+ */
2814
2780
  export const MFASms: React.FC<{
2815
2781
  mfaLogin: any;
2816
2782
  config: MFAConfig;
@@ -2825,12 +2791,22 @@ declare module '@authing/react-ui-components/components/MFA/core/totp' {
2825
2791
  initData: GuardMFAInitData;
2826
2792
  changeModule: any;
2827
2793
  }
2794
+ /**
2795
+ * 绑定 ToTp 页面 跳转 Totp
2796
+ * @param param0
2797
+ * @returns
2798
+ */
2828
2799
  export const BindMFATotp: React.FC<BindMFATotpProps>;
2829
2800
  export interface VerifyMFATotpProps {
2830
2801
  mfaToken: string;
2831
2802
  mfaLogin: any;
2832
2803
  changeModule: any;
2833
2804
  }
2805
+ /**
2806
+ * Totp 验证页面
2807
+ * @param param0
2808
+ * @returns
2809
+ */
2834
2810
  export const VerifyMFATotp: React.FC<VerifyMFATotpProps>;
2835
2811
  export interface MFATotpProps {
2836
2812
  changeModule: any;
@@ -2838,6 +2814,13 @@ declare module '@authing/react-ui-components/components/MFA/core/totp' {
2838
2814
  initData: GuardMFAInitData;
2839
2815
  mfaLogin: any;
2840
2816
  }
2817
+ /**
2818
+ * MFA Totp 页面
2819
+ * 开启 => 渲染 VerifyMFATotp 绑定
2820
+ * 不开启 => 渲染绑定页面
2821
+ * @param param
2822
+ * @returns
2823
+ */
2841
2824
  export const MFATotp: React.FC<MFATotpProps>;
2842
2825
 
2843
2826
  }
@@ -2849,6 +2832,10 @@ declare module '@authing/react-ui-components/components/MFA/index' {
2849
2832
  mfaBackState: string;
2850
2833
  }
2851
2834
  export const MFABackStateContext: React.Context<MFABackStateContextType | undefined>;
2835
+ /**
2836
+ * MFA 相关页面
2837
+ * @returns
2838
+ */
2852
2839
  export const GuardMFAView: React.FC;
2853
2840
  export {};
2854
2841
 
@@ -2906,6 +2893,29 @@ declare module '@authing/react-ui-components/components/MFA/mfaMethods/index' {
2906
2893
  }
2907
2894
  export const MFAMethods: React.FC<MFAMethodsProps>;
2908
2895
 
2896
+ }
2897
+ declare module '@authing/react-ui-components/components/NeedHelpView/api/constant' {
2898
+ export const feedbackUrl: () => string;
2899
+
2900
+ }
2901
+ declare module '@authing/react-ui-components/components/NeedHelpView/api/index' {
2902
+ export * from '@authing/react-ui-components/components/NeedHelpView/api/request';
2903
+
2904
+ }
2905
+ declare module '@authing/react-ui-components/components/NeedHelpView/api/request' {
2906
+ /**
2907
+ * 问题反馈
2908
+ * @param data
2909
+ * @returns
2910
+ */
2911
+ export const feedbackByAxios: (data: {
2912
+ type: number;
2913
+ description: string;
2914
+ phone: string;
2915
+ images: string[];
2916
+ appId: string;
2917
+ }) => Promise<import("@authing/react-ui-components/components/_utils/http").AuthingGuardResponse<any>>;
2918
+
2909
2919
  }
2910
2920
  declare module '@authing/react-ui-components/components/NeedHelpView/core/describeQuestions' {
2911
2921
  /// <reference types="react" />
@@ -2922,13 +2932,34 @@ declare module '@authing/react-ui-components/components/NeedHelpView/index' {
2922
2932
  /// <reference types="react" />
2923
2933
  export const GuardNeedHelpView: (props: any) => JSX.Element;
2924
2934
 
2935
+ }
2936
+ declare module '@authing/react-ui-components/components/RecoveryCode/api/constant' {
2937
+ export const recoverCodeUrl: () => string;
2938
+
2939
+ }
2940
+ declare module '@authing/react-ui-components/components/RecoveryCode/api/index' {
2941
+ export { authFlowByAxios } from 'service/api';
2942
+
2943
+ }
2944
+ declare module '@authing/react-ui-components/components/RecoveryCode/api/request' {
2945
+ import { AxiosRequestConfig } from 'axios';
2946
+ /**
2947
+ * 不在流程中(AuthFlow)请求恢复 Totp 请求
2948
+ * @param data
2949
+ * @param config
2950
+ * @returns
2951
+ */
2952
+ export const recoverCodeByAxios: (data: {
2953
+ recoveryCode: string;
2954
+ }, config?: AxiosRequestConfig<any> | undefined) => Promise<import("@authing/react-ui-components/components/_utils/http").AuthingGuardResponse<any>>;
2955
+
2925
2956
  }
2926
2957
  declare module '@authing/react-ui-components/components/RecoveryCode/businessRequest' {
2927
2958
  export enum TotpRecoveryCodeBusinessAction {
2928
2959
  RecoveryTotp = "recovery-totp",
2929
2960
  ConfirmTotpRecoveryCode = "confirm-totp-recovery-code"
2930
2961
  }
2931
- export function authFlow<T>(action: TotpRecoveryCodeBusinessAction, content: any): Promise<import("@authing/react-ui-components/components/_utils/http").AuthingGuardResponse<T>>;
2962
+ export function authFlow<T>(action: TotpRecoveryCodeBusinessAction, data: any): Promise<import("@authing/react-ui-components/components/_utils/http").AuthingGuardResponse<T>>;
2932
2963
 
2933
2964
  }
2934
2965
  declare module '@authing/react-ui-components/components/RecoveryCode/core/saveCode' {
@@ -2953,6 +2984,9 @@ declare module '@authing/react-ui-components/components/RecoveryCode/index' {
2953
2984
  import React from 'react';
2954
2985
  import './style.less';
2955
2986
  export const RecoveryCode: React.FC;
2987
+ /**
2988
+ * authFlow 中恢复
2989
+ */
2956
2990
  export const RecoveryCodeAuthFlow: React.FC;
2957
2991
  export const GuardRecoveryCodeView: React.FC;
2958
2992
 
@@ -2967,6 +3001,37 @@ declare module '@authing/react-ui-components/components/RecoveryCode/interface'
2967
3001
  onLogin?: (user: User, authClient: AuthenticationClient) => void;
2968
3002
  }
2969
3003
 
3004
+ }
3005
+ declare module '@authing/react-ui-components/components/Register/api/constant' {
3006
+ export const registerEmailCodeUrl: () => string;
3007
+
3008
+ }
3009
+ declare module '@authing/react-ui-components/components/Register/api/index' {
3010
+ import { registerEmailCodeByAxios } from '@authing/react-ui-components/components/Register/api/request';
3011
+ import { validatePhoneCodeByAxios, validateEmailCodeByAxios } from 'service/api';
3012
+ export { validatePhoneCodeByAxios, validateEmailCodeByAxios, registerEmailCodeByAxios, };
3013
+
3014
+ }
3015
+ declare module '@authing/react-ui-components/components/Register/api/request' {
3016
+ import { AxiosRequestConfig } from 'axios';
3017
+ /**
3018
+ * 邮箱注册
3019
+ * @param data
3020
+ * @param config
3021
+ * @returns
3022
+ */
3023
+ export const registerEmailCodeByAxios: (data: {
3024
+ email: string;
3025
+ code: string;
3026
+ profile: {
3027
+ browser: string | null;
3028
+ device: string | null | undefined;
3029
+ };
3030
+ context: string;
3031
+ generateToken: boolean;
3032
+ password?: string;
3033
+ }, config?: AxiosRequestConfig<any> | undefined) => Promise<import("@authing/react-ui-components/components/_utils/http").AuthingGuardResponse<any>>;
3034
+
2970
3035
  }
2971
3036
  declare module '@authing/react-ui-components/components/Register/codemap' {
2972
3037
  import { GuardModuleAction } from '@authing/react-ui-components/components/Guard/module';
@@ -2990,67 +3055,52 @@ declare module '@authing/react-ui-components/components/Register/components/Agre
2990
3055
  declare module '@authing/react-ui-components/components/Register/core/WithCode' {
2991
3056
  import React from 'react';
2992
3057
  import { Agreement, ApplicationConfig } from '@authing/react-ui-components/components/AuthingGuard/api/index';
3058
+ import { GetRegisterEvent } from '@authing/react-ui-components/components/Register/interface';
2993
3059
  export interface RegisterWithCodeProps {
2994
3060
  onRegisterSuccess: Function;
2995
3061
  onRegisterFailed: Function;
2996
- onBeforeRegister?: Function;
3062
+ onBeforeRegister?: GetRegisterEvent<'onBeforeRegister'>;
2997
3063
  agreements: Agreement[];
2998
3064
  publicConfig?: ApplicationConfig;
2999
3065
  registeContext?: any;
3000
3066
  methods: any[];
3001
3067
  }
3068
+ /**
3069
+ * 验证码方式注册
3070
+ * @param param
3071
+ * @returns
3072
+ */
3002
3073
  export const RegisterWithCode: React.FC<RegisterWithCodeProps>;
3003
3074
 
3004
3075
  }
3005
3076
  declare module '@authing/react-ui-components/components/Register/core/WithEmail' {
3006
3077
  import React from 'react';
3007
3078
  import { Agreement, ApplicationConfig } from '@authing/react-ui-components/components/AuthingGuard/api/index';
3079
+ import { GetRegisterEvent } from '@authing/react-ui-components/components/Register/interface';
3008
3080
  export interface RegisterWithEmailProps {
3009
3081
  onRegisterSuccess: Function;
3010
3082
  onRegisterFailed: Function;
3011
- onBeforeRegister?: Function;
3083
+ onBeforeRegister?: GetRegisterEvent<'onBeforeRegister'>;
3012
3084
  publicConfig?: ApplicationConfig;
3013
3085
  agreements: Agreement[];
3014
3086
  registeContext?: any;
3015
3087
  }
3088
+ /**
3089
+ * 邮箱 + 密码注册 头部显示密码注册
3090
+ * @param param
3091
+ * @returns
3092
+ */
3016
3093
  export const RegisterWithEmail: React.FC<RegisterWithEmailProps>;
3017
3094
 
3018
3095
  }
3019
- declare module '@authing/react-ui-components/components/Register/core/WithEmailCode' {
3020
- import React from 'react';
3021
- import { Agreement, ApplicationConfig } from '@authing/react-ui-components/components/AuthingGuard/api/index';
3022
- export interface RegisterWithEmailCodeProps {
3023
- onRegisterSuccess: Function;
3024
- onRegisterFailed: Function;
3025
- onBeforeRegister?: Function;
3026
- agreements: Agreement[];
3027
- publicConfig?: ApplicationConfig;
3028
- registeContext?: any;
3029
- }
3030
- export const RegisterWithEmailCode: React.FC<RegisterWithEmailCodeProps>;
3031
-
3032
- }
3033
- declare module '@authing/react-ui-components/components/Register/core/WithPhone' {
3034
- import React from 'react';
3035
- import { Agreement, ApplicationConfig } from '@authing/react-ui-components/components/AuthingGuard/api/index';
3036
- export interface RegisterWithPhoneProps {
3037
- onRegisterSuccess: Function;
3038
- onRegisterFailed: Function;
3039
- agreements: Agreement[];
3040
- publicConfig?: ApplicationConfig;
3041
- registeContext?: any;
3042
- }
3043
- export const RegisterWithPhone: React.FC<RegisterWithPhoneProps>;
3044
-
3045
- }
3046
- declare module '@authing/react-ui-components/components/Register/index' {
3096
+ declare module '@authing/react-ui-components/components/Register/index' {
3047
3097
  import React from 'react';
3048
3098
  export const GuardRegisterView: React.FC;
3049
3099
 
3050
3100
  }
3051
3101
  declare module '@authing/react-ui-components/components/Register/interface' {
3052
3102
  import { IG2FCProps, IG2Config, IG2Events } from '@authing/react-ui-components/components/Type/index';
3053
- import { AuthenticationClient, User, EmailRegisterParams, PhoneRegisterParams, RegisterMethods } from '@authing/react-ui-components/components/index';
3103
+ import { AuthenticationClient, User, RegisterMethods } from '@authing/react-ui-components/components/index';
3054
3104
  import { Agreement } from '@authing/react-ui-components/components/AuthingGuard/api/index';
3055
3105
  export interface RegisterConfig extends IG2Config {
3056
3106
  disableRegister?: boolean;
@@ -3061,8 +3111,24 @@ declare module '@authing/react-ui-components/components/Register/interface' {
3061
3111
  agreements?: Agreement[];
3062
3112
  registerContext?: any;
3063
3113
  }
3114
+ export type SupportRegisterMethods = 'email' | 'email-code' | 'phone-code';
3115
+ /**
3116
+ * 注册前回调事件接受参数
3117
+ */
3118
+ export interface onBeforeRegisterParams {
3119
+ type: SupportRegisterMethods;
3120
+ data: {
3121
+ account: string;
3122
+ password?: string;
3123
+ code?: string;
3124
+ };
3125
+ }
3126
+ /**
3127
+ * 获取用户注册事件的类型
3128
+ */
3129
+ export type GetRegisterEvent<T extends keyof RegisterEvents> = RegisterEvents[T];
3064
3130
  export interface RegisterEvents extends IG2Events {
3065
- onBeforeRegister?: (registerInfo: EmailRegisterParams | PhoneRegisterParams, authClient: AuthenticationClient) => boolean | Promise<boolean>;
3131
+ onBeforeRegister?: (registerInfo: onBeforeRegisterParams, authClient: AuthenticationClient) => boolean | Promise<boolean>;
3066
3132
  onRegister?: (user: User, authClient: AuthenticationClient) => void;
3067
3133
  onRegisterError?: (error: any) => void;
3068
3134
  onRegisterTabChange?: (activeTab: RegisterMethods) => void;
@@ -3079,6 +3145,10 @@ declare module '@authing/react-ui-components/components/Register/interface' {
3079
3145
  declare module '@authing/react-ui-components/components/Register/utils' {
3080
3146
  export const useIsChangeComplete: (currentMode: 'phone' | 'email') => boolean;
3081
3147
 
3148
+ }
3149
+ declare module '@authing/react-ui-components/components/SelfUnlock/api/index' {
3150
+ export { authFlowByAxios } from 'service/api';
3151
+
3082
3152
  }
3083
3153
  declare module '@authing/react-ui-components/components/SelfUnlock/core/selfUnlock' {
3084
3154
  import React from 'react';
@@ -3093,6 +3163,10 @@ declare module '@authing/react-ui-components/components/SelfUnlock/core/selfUnlo
3093
3163
  }
3094
3164
  declare module '@authing/react-ui-components/components/SelfUnlock/index' {
3095
3165
  import React from 'react';
3166
+ /**
3167
+ * 自助解锁
3168
+ * @returns
3169
+ */
3096
3170
  export const GuardUnlockView: React.FC;
3097
3171
 
3098
3172
  }
@@ -3160,6 +3234,10 @@ declare module '@authing/react-ui-components/components/SendCode/SendCodeByPhone
3160
3234
  }
3161
3235
  export const SendCodeByPhone: FC<SendCodeByPhoneProps>;
3162
3236
 
3237
+ }
3238
+ declare module '@authing/react-ui-components/components/SendCode/api/index' {
3239
+ export { sendEmailCodeByAxios } from 'service/api';
3240
+
3163
3241
  }
3164
3242
  declare module '@authing/react-ui-components/components/SendCode/index' {
3165
3243
  import { FC } from 'react';
@@ -3330,6 +3408,10 @@ declare module '@authing/react-ui-components/components/ValidatorRules/Validator
3330
3408
  export const PhoneFormItem: React.FC<ValidatorFormItemProps>;
3331
3409
  export const UserNameFormItem: React.FC<ValidatorFormItemProps>;
3332
3410
 
3411
+ }
3412
+ declare module '@authing/react-ui-components/components/ValidatorRules/api/index' {
3413
+ export { validateAccountByAxios } from 'service/api';
3414
+
3333
3415
  }
3334
3416
  declare module '@authing/react-ui-components/components/ValidatorRules/index' {
3335
3417
  import { FormInstance, FormItemProps } from 'antd/lib/form';
@@ -3392,6 +3474,32 @@ declare module '@authing/react-ui-components/components/_utils/GuardErrorCode' {
3392
3474
  ACCOUNT_LOCK = 2005
3393
3475
  }
3394
3476
 
3477
+ }
3478
+ declare module '@authing/react-ui-components/components/_utils/actions/index' {
3479
+ /**
3480
+ * Response Action 是否为渲染信息
3481
+ * @param parseStatusCode
3482
+ * @returns
3483
+ */
3484
+ export const isRenderMessageByStatusCode: (parseStatusCode: number) => boolean;
3485
+ /**
3486
+ * Response Action 是否为内部流程状态处理(交由业务处理)
3487
+ * @param parseStatusCode
3488
+ * @param apiCode
3489
+ */
3490
+ export const isFlowBusinessByStatusCode: (parseStatusCode: number) => boolean;
3491
+ /**
3492
+ * Response Action 是否为流程结束
3493
+ * @param parseStatusCode
3494
+ * @param apiCode
3495
+ */
3496
+ export const isFlowEndByStatusCode: (parseStatusCode: number, apiCode: number) => boolean;
3497
+ /**
3498
+ * Response Action 是否为下个流程
3499
+ * @param parseStatusCode
3500
+ */
3501
+ export const isNextFlowByStatusCode: (parseStatusCode: number, apiCode: number) => boolean;
3502
+
3395
3503
  }
3396
3504
  declare module '@authing/react-ui-components/components/_utils/appendConfig' {
3397
3505
  import { GuardAppendConfig } from '@authing/react-ui-components/components/index';
@@ -3414,6 +3522,14 @@ declare module '@authing/react-ui-components/components/_utils/config/index' {
3414
3522
  export const getPublicConfig: (appId: string) => ApplicationConfig;
3415
3523
  export const setPublicConfig: (appId: string, config: ApplicationConfig) => ApplicationConfig;
3416
3524
  export const useMergeDefaultConfig: (defaultConfig: GuardLocalConfig, config?: GuardComponentConfig | undefined) => GuardLocalConfig | undefined;
3525
+ /**
3526
+ *
3527
+ * @param appId
3528
+ * @param config 默认配置
3529
+ * @param httpClient
3530
+ * @param setError
3531
+ * @returns 合并后的 finallyConfig
3532
+ */
3417
3533
  export const useMergePublicConfig: (appId?: string | undefined, config?: GuardLocalConfig | undefined, httpClient?: GuardHttp | undefined, setError?: any) => {
3418
3534
  host: string;
3419
3535
  isSSO?: boolean | undefined;
@@ -3498,15 +3614,14 @@ declare module '@authing/react-ui-components/components/_utils/config/index' {
3498
3614
  } | undefined;
3499
3615
  export const getPageConfig: (appId: string) => GuardPageConfig;
3500
3616
  export const setPageConfig: (appId: string, config: GuardPageConfig) => GuardPageConfig;
3501
- export const requestGuardPageConfig: (appId: string, httpClient: GuardHttp) => Promise<GuardPageConfig>;
3502
- export const useGuardPageConfig: (appId?: string | undefined, httpClient?: GuardHttp | undefined, serError?: any) => GuardPageConfig | undefined;
3617
+ export const requestGuardPageConfig: (appId: string, baseURL?: string | undefined) => Promise<GuardPageConfig>;
3618
+ export const useGuardPageConfig: (appId?: string | undefined, defaultConfig?: GuardLocalConfig | undefined, serError?: any) => GuardPageConfig | undefined;
3503
3619
 
3504
3620
  }
3505
3621
  declare module '@authing/react-ui-components/components/_utils/context' {
3506
3622
  import React from 'react';
3507
3623
  import { GuardEvents, GuardLocalConfig, GuardModuleType, GuardPageConfig } from '@authing/react-ui-components/components/index';
3508
3624
  import { ApplicationConfig } from '@authing/react-ui-components/components/AuthingGuard/api/index';
3509
- import { BackFillMultipleState, StoreInstance } from '@authing/react-ui-components/components/Guard/core/hooks/useMultipleAccounts';
3510
3625
  import { ModuleState } from '@authing/react-ui-components/components/Guard/GuardModule/stateMachine';
3511
3626
  import { GuardHttp } from '@authing/react-ui-components/components/_utils/guardHttp';
3512
3627
  export interface IGuardContext {
@@ -3524,29 +3639,6 @@ declare module '@authing/react-ui-components/components/_utils/context' {
3524
3639
  isAuthFlow: boolean;
3525
3640
  contextLoaded: boolean;
3526
3641
  guardPageConfig: Partial<GuardPageConfig>;
3527
- multipleInstance: {
3528
- /**
3529
- * 多账号相关
3530
- */
3531
- isMultipleAccount: boolean;
3532
- /**
3533
- * when: 多账号页面跳转进入登录页面
3534
- * 携带的回填数据信息
3535
- */
3536
- multipleAccountData?: BackFillMultipleState;
3537
- /**
3538
- * 多账号 store 实例
3539
- */
3540
- instance?: StoreInstance;
3541
- /**
3542
- * 切换多账号 isMultipleAccount 状态
3543
- */
3544
- referMultipleState?: (type: 'login' | 'multiple') => void;
3545
- /**
3546
- * 清空回填数据
3547
- */
3548
- clearBackFillData?: () => void;
3549
- };
3550
3642
  }
3551
3643
  export const createGuardXContext: () => {
3552
3644
  Provider: React.FC<{
@@ -3584,60 +3676,6 @@ declare module '@authing/react-ui-components/components/_utils/context' {
3584
3676
  export const useGuardContextLoaded: () => boolean;
3585
3677
  export const useGuardIsAuthFlow: () => boolean;
3586
3678
  export const useGuardPageConfig: () => Partial<GuardPageConfig>;
3587
- /**
3588
- * 多账号登录 store 实例
3589
- */
3590
- export const useGuardMultipleInstance: () => {
3591
- /**
3592
- * 多账号相关
3593
- */
3594
- isMultipleAccount: boolean;
3595
- /**
3596
- * when: 多账号页面跳转进入登录页面
3597
- * 携带的回填数据信息
3598
- */
3599
- multipleAccountData?: BackFillMultipleState | undefined;
3600
- /**
3601
- * 多账号 store 实例
3602
- */
3603
- instance?: {
3604
- initStore: (appId: string, options: {
3605
- serverSideLoginMethods: import("@authing/react-ui-components/components/Guard/core/hooks/useMultipleAccounts").LoginWay[];
3606
- isInternationSms: boolean;
3607
- }) => void;
3608
- setLoginWay: (tab: "input" | "qrcode", way: import("@authing/react-ui-components/components/Guard/core/hooks/useMultipleAccounts").LoginWay, id?: string | undefined, internation?: {
3609
- phoneCountryCode: string;
3610
- areaCode: string;
3611
- } | undefined) => void;
3612
- setUserInfo: (user: Pick<import("@authing/react-ui-components/components/Guard/core/hooks/useMultipleAccounts").User & {
3613
- id: string;
3614
- }, "email" | "username" | "phone" | "id" | "nickname" | "photo" | "name" | "_updateTime" | "qrCodeId" | "areaCode">) => void;
3615
- setLoginWayByHttpData: (account: string, data: {
3616
- username?: string | undefined;
3617
- phone?: string | undefined;
3618
- email?: string | undefined;
3619
- }) => void;
3620
- getMemoUser: (excludeWays?: import("@authing/react-ui-components/components/Guard/core/hooks/useMultipleAccounts").LoginWay[]) => import("../Login/multipleAccounts/panel").SelectOptions[];
3621
- getMemoSingleUser: (id: string) => {
3622
- way: import("@authing/react-ui-components/components/Guard/core/hooks/useMultipleAccounts").LoginWay;
3623
- account: string;
3624
- } | undefined;
3625
- delUserById: (id: string) => string;
3626
- getMemberState: () => boolean;
3627
- getFirstBackFillData: () => BackFillMultipleState | undefined;
3628
- } | undefined;
3629
- /**
3630
- * 切换多账号 isMultipleAccount 状态
3631
- */
3632
- referMultipleState?: ((type: 'login' | 'multiple') => void) | undefined;
3633
- /**
3634
- * 清空回填数据
3635
- */
3636
- clearBackFillData?: (() => void) | undefined;
3637
- };
3638
- /**
3639
- * 登录页面状态
3640
- // */
3641
3679
 
3642
3680
  }
3643
3681
  declare module '@authing/react-ui-components/components/_utils/corsVerification' {
@@ -3772,6 +3810,475 @@ declare module '@authing/react-ui-components/components/_utils/hooks/index' {
3772
3810
  publicConfig: ApplicationConfig;
3773
3811
  }) => any;
3774
3812
 
3813
+ }
3814
+ declare module '@authing/react-ui-components/components/_utils/http/api/constant' {
3815
+ export const authFlowUrl: () => string;
3816
+ export const VerifyEmailUrl: () => string;
3817
+ export const validateAccountUrl: () => string;
3818
+ export const countryListsUrl: () => string;
3819
+ export const validatePhoneCodeUrl: () => string;
3820
+ export const validateEmailCodeUrl: () => string;
3821
+
3822
+ }
3823
+ declare module '@authing/react-ui-components/components/_utils/http/api/index' {
3824
+ export * from '@authing/react-ui-components/components/_utils/http/api/request';
3825
+
3826
+ }
3827
+ declare module '@authing/react-ui-components/components/_utils/http/api/request' {
3828
+ import { AxiosRequestConfig } from 'axios';
3829
+ import { EmailScene } from 'components/Type';
3830
+ /**
3831
+ * AuthFlow 相关请求
3832
+ * @param data
3833
+ */
3834
+ export const authFlowByAxios: <A = string, T = any>(data: {
3835
+ action: A;
3836
+ data?: any;
3837
+ }, config?: AxiosRequestConfig<any> | undefined) => Promise<import("@authing/react-ui-components/components/_utils/http").AuthingGuardResponse<T>>;
3838
+ /**
3839
+ * 发送邮箱验证码
3840
+ * @param data
3841
+ */
3842
+ export const sendEmailCodeByAxios: (data: {
3843
+ email: string;
3844
+ scene: EmailScene;
3845
+ }, config?: AxiosRequestConfig<any> | undefined) => Promise<import("@authing/react-ui-components/components/_utils/http").AuthingGuardResponse<any>>;
3846
+ /**
3847
+ * 账号登陆前置校验
3848
+ */
3849
+ export interface ValidateAccountParams<T = any> {
3850
+ /**
3851
+ * publicConfig.userPoolId
3852
+ */
3853
+ userPoolId?: string;
3854
+ /**
3855
+ * 校验的输入值
3856
+ */
3857
+ key: T;
3858
+ /**
3859
+ * 本次校验类型
3860
+ */
3861
+ type: 'phone' | 'email' | 'username';
3862
+ }
3863
+ /**
3864
+ * 登陆/注册 前置,校验(用户/手机/邮箱)是否存在/用户是否不存在
3865
+ * @param params
3866
+ * @returns {Promise<boolean>} 是否通过
3867
+ */
3868
+ export const validateAccountByAxios: <T = boolean>(params: ValidateAccountParams) => Promise<import("@authing/react-ui-components/components/_utils/http").AuthingGuardResponse<T>>;
3869
+ /**
3870
+ * 拉取国家列表
3871
+ */
3872
+ export const getCountryLists: <T extends string>() => Promise<import("@authing/react-ui-components/components/_utils/http").AuthingGuardResponse<Record<T, {
3873
+ zh: {
3874
+ [props: string]: string;
3875
+ };
3876
+ cn: {
3877
+ [props: string]: string;
3878
+ };
3879
+ }>>>;
3880
+ /**
3881
+ * 验证手机号验证码是否正确
3882
+ */
3883
+ export const validatePhoneCodeByAxios: (data: {
3884
+ phone: number | string;
3885
+ phoneCode: number | string;
3886
+ phoneCountryCode?: number | string;
3887
+ }, config?: AxiosRequestConfig<any> | undefined) => Promise<import("@authing/react-ui-components/components/_utils/http").AuthingGuardResponse<any>>;
3888
+ /**
3889
+ * 验证邮箱验证码是否正确
3890
+ */
3891
+ export const validateEmailCodeByAxios: (data: {
3892
+ email: number | string;
3893
+ emailCode: number | string;
3894
+ }, config?: AxiosRequestConfig<any> | undefined) => Promise<import("@authing/react-ui-components/components/_utils/http").AuthingGuardResponse<any>>;
3895
+
3896
+ }
3897
+ declare module '@authing/react-ui-components/components/_utils/http/base/index' {
3898
+ import { AuthenticationClient } from 'authing-js-sdk';
3899
+ /**
3900
+ * 修改 baseUrl 配置
3901
+ */
3902
+ export const setBaseUrl: (baseUrl: string) => void;
3903
+ export const setAuthClient: (client: AuthenticationClient) => void;
3904
+ /**
3905
+ * 设置加密公钥
3906
+ */
3907
+ export const setPublishByEncrypt: (publishKey?: string | undefined) => void;
3908
+
3909
+ }
3910
+ declare module '@authing/react-ui-components/components/_utils/http/constant' {
3911
+ import { AuthingResponse } from '@authing/react-ui-components/components/_utils/http/interceptors/response';
3912
+ import { GuardModuleType } from '@authing/react-ui-components/components/Guard/module';
3913
+ import JSEncrypt from 'jsencrypt';
3914
+ /**
3915
+ * 加密实例
3916
+ */
3917
+ export const encryptedInstance: JSEncrypt;
3918
+ export enum CodeAction {
3919
+ CHANGE_MODULE = "changeModule",
3920
+ RENDER_MESSAGE = "renderMessage",
3921
+ INNER_MODULE = "innerModule",
3922
+ FLOW_END = "flowEnd"
3923
+ }
3924
+ export enum ApiCode {
3925
+ IDENTITY_BINDING_ASK = 1641,
3926
+ IDENTITY_BINDING = 1640,
3927
+ APP_MFA = 1636,
3928
+ MFA = 1635,
3929
+ ABORT_FLOW = 1699,
3930
+ COMPLETE_INFO = 1642,
3931
+ UNLOCK = 1643,
3932
+ FLOW_END = 1600,
3933
+ FIRST_LOGIN_PASSWORD = 1639,
3934
+ FORCED_PASSWORD_RESET = 2058
3935
+ }
3936
+ /**
3937
+ * APi Code 对应的模块映射
3938
+ */
3939
+ export const ChangeModuleApiCodeMapping: Record<string, GuardModuleType>;
3940
+ /**
3941
+ * 高阶函数 记录每次请求的 responseData
3942
+ * 同时根据返回的 apiCode 对应的 action 处理
3943
+ * @param responseData
3944
+ * @returns
3945
+ */
3946
+ export const getCodeActionMapping: (responseData: AuthingResponse) => {
3947
+ /**
3948
+ * 返回的 apiCode 匹配跳转模块时
3949
+ * @param responseData
3950
+ * @returns
3951
+ */
3952
+ changeModule: () => CodeAction;
3953
+ renderMessage: () => CodeAction;
3954
+ innerModule: () => CodeAction;
3955
+ flowEnd: () => CodeAction;
3956
+ };
3957
+
3958
+ }
3959
+ declare module '@authing/react-ui-components/components/_utils/http/events/index' {
3960
+ import { AxiosRequestConfig, AxiosResponse } from 'axios';
3961
+ import { AuthingGuardResponse } from 'components/_utils/http';
3962
+ import { setLoginEvents, setRegisterEvents } from '@authing/react-ui-components/components/_utils/http/events/utils';
3963
+ /**
3964
+ * 请求前置事件处理
3965
+ * 比如 beforeLogin / beforeRegister
3966
+ * @param config
3967
+ * @returns
3968
+ */
3969
+ const processBeforeRequestEvent: (config: AxiosRequestConfig) => Promise<boolean>;
3970
+ /**
3971
+ * 响应器拦截 Events
3972
+ * @param response
3973
+ */
3974
+ const processEventsByResponse: (response: AxiosResponse<AuthingGuardResponse>) => void;
3975
+ export { setLoginEvents, setRegisterEvents, processEventsByResponse, processBeforeRequestEvent, };
3976
+
3977
+ }
3978
+ declare module '@authing/react-ui-components/components/_utils/http/events/modal/login' {
3979
+ import { AuthenticationClient } from 'authing-js-sdk';
3980
+ import { AuthingResponse } from 'service/interceptors/response';
3981
+ class LoginEventsManage {
3982
+ private static instance;
3983
+ private successEvent;
3984
+ private failEvent;
3985
+ private constructor();
3986
+ /**
3987
+ * 设置登录成功的回调函数
3988
+ */
3989
+ private setSuccessEvent;
3990
+ /**
3991
+ * 设置失败成功的回调函数
3992
+ */
3993
+ private setFailEvent;
3994
+ /**
3995
+ * 获取登录成功的回调函数
3996
+ */
3997
+ private getSuccessEvents;
3998
+ /**
3999
+ * 获取失败成功的回调函数
4000
+ */
4001
+ private getFailEvents;
4002
+ /**
4003
+ * 判断本次响应是否算做成功的方法
4004
+ */
4005
+ private isLoginSuccess;
4006
+ /**
4007
+ * 触发登录成功事件
4008
+ * @param responseData
4009
+ */
4010
+ private emitSuccessEvent;
4011
+ /**
4012
+ * 触发登录失败事件
4013
+ * @param responseData
4014
+ */
4015
+ private emitFailEvent;
4016
+ /**
4017
+ * 当前是否请求失败
4018
+ * statusCode 4xx 5xx 请求失败
4019
+ */
4020
+ private isLoginFail;
4021
+ /**
4022
+ * 统一触发事件
4023
+ * @param responseData
4024
+ * @param client
4025
+ */
4026
+ private emitEvents;
4027
+ /**
4028
+ * 获取登录事件实例
4029
+ */
4030
+ static getInstance: () => LoginEventsManage;
4031
+ getCallableMethod(): {
4032
+ getSuccessEvents: () => ((user: import("authing-js-sdk").User, authClient: AuthenticationClient) => void) | null | undefined;
4033
+ setSuccessEvent: (successEvents: ((user: import("authing-js-sdk").User, authClient: AuthenticationClient) => void) | undefined) => void;
4034
+ setFailEvent: (failEvent: ((errorMessages: any) => void) | undefined) => void;
4035
+ emitSuccessEvent: (responseData: AuthingResponse<any>, client: AuthenticationClient) => void;
4036
+ emitFailEvent: (responseData: AuthingResponse<any>) => void;
4037
+ emitEvents: (responseData: AuthingResponse<any>, client: AuthenticationClient) => void;
4038
+ };
4039
+ }
4040
+ export { LoginEventsManage };
4041
+
4042
+ }
4043
+ declare module '@authing/react-ui-components/components/_utils/http/events/modal/register' {
4044
+ import { AuthenticationClient } from 'authing-js-sdk';
4045
+ import { AuthingResponse } from 'service/interceptors/response';
4046
+ type ConditionTypeFunction = (responseData: AuthingResponse) => boolean;
4047
+ class RegisterEventsManage {
4048
+ private static instance;
4049
+ private successEvent;
4050
+ private failEvent;
4051
+ private constructor();
4052
+ /**
4053
+ * 设置注册成功的回调函数
4054
+ */
4055
+ private setSuccessEvent;
4056
+ /**
4057
+ * 设置失败成功的回调函数
4058
+ */
4059
+ private setFailEvent;
4060
+ /**
4061
+ * 获取注册成功的回调函数
4062
+ */
4063
+ private getSuccessEvents;
4064
+ /**
4065
+ * 获取失败成功的回调函数
4066
+ */
4067
+ private getFailEvents;
4068
+ /**
4069
+ * 内置校验:判断本次响应是否算做成功的方法
4070
+ */
4071
+ private isRegisterSuccess;
4072
+ /**
4073
+ * 触发注册成功事件
4074
+ * @param responseData
4075
+ * @param successCondition 自定义的注册成功事件
4076
+ */
4077
+ private emitSuccessEvent;
4078
+ /**
4079
+ * 触发注册失败事件
4080
+ * @param responseData
4081
+ * @param failCondition 自定义的请求失败条件
4082
+ */
4083
+ private emitFailEvent;
4084
+ /**
4085
+ * 内置校验:当前是否请求失败
4086
+ */
4087
+ private isRegisterFail;
4088
+ /**
4089
+ * 统一触发事件
4090
+ * @param responseData
4091
+ * @param client
4092
+ */
4093
+ private emitEvents;
4094
+ /**
4095
+ * 获取注册事件实例
4096
+ */
4097
+ static getInstance: () => RegisterEventsManage;
4098
+ getCallableMethod(): {
4099
+ setSuccessEvent: (successEvents: ((user: import("authing-js-sdk").User, authClient: AuthenticationClient) => void) | undefined) => void;
4100
+ setFailEvent: (failEvent: ((error: any) => void) | undefined) => void;
4101
+ emitSuccessEvent: (params: {
4102
+ responseData: AuthingResponse<any>;
4103
+ client: AuthenticationClient;
4104
+ condition?: ConditionTypeFunction | undefined;
4105
+ }) => void;
4106
+ emitFailEvent: (params: {
4107
+ responseData: AuthingResponse<any>;
4108
+ condition?: ConditionTypeFunction | undefined;
4109
+ }) => void;
4110
+ emitEvents: (responseData: AuthingResponse<any>, client: AuthenticationClient, options?: {
4111
+ successCondition?: ConditionTypeFunction | undefined;
4112
+ failCondition?: ConditionTypeFunction | undefined;
4113
+ } | undefined) => void;
4114
+ };
4115
+ }
4116
+ export { RegisterEventsManage };
4117
+
4118
+ }
4119
+ declare module '@authing/react-ui-components/components/_utils/http/events/utils' {
4120
+ import { LoginEventsManage } from '@authing/react-ui-components/components/_utils/http/events/modal/login';
4121
+ import { RegisterEventsManage } from '@authing/react-ui-components/components/_utils/http/events/modal/register';
4122
+ /**
4123
+ * 内置的登录类型
4124
+ */
4125
+ export const instanceEventMap: {
4126
+ login: typeof LoginEventsManage;
4127
+ register: typeof RegisterEventsManage;
4128
+ };
4129
+ /**
4130
+ * 设置登录事件
4131
+ * @returns
4132
+ */
4133
+ export const setLoginEvents: () => {
4134
+ setSuccessEvent: ((successEvents: ((user: import("authing-js-sdk").User, authClient: import("authing-js-sdk").AuthenticationClient) => void) | undefined) => void) | ((successEvents: ((user: import("authing-js-sdk").User, authClient: import("authing-js-sdk").AuthenticationClient) => void) | undefined) => void);
4135
+ setFailEvent: ((failEvent: ((errorMessages: any) => void) | undefined) => void) | ((failEvent: ((error: any) => void) | undefined) => void);
4136
+ };
4137
+ /**
4138
+ * 设置注册事件
4139
+ * @returns
4140
+ */
4141
+ export const setRegisterEvents: () => {
4142
+ setSuccessEvent: ((successEvents: ((user: import("authing-js-sdk").User, authClient: import("authing-js-sdk").AuthenticationClient) => void) | undefined) => void) | ((successEvents: ((user: import("authing-js-sdk").User, authClient: import("authing-js-sdk").AuthenticationClient) => void) | undefined) => void);
4143
+ setFailEvent: ((failEvent: ((errorMessages: any) => void) | undefined) => void) | ((failEvent: ((error: any) => void) | undefined) => void);
4144
+ };
4145
+
4146
+ }
4147
+ declare module '@authing/react-ui-components/components/_utils/http/header/index' {
4148
+ /**
4149
+ * 设置 version
4150
+ * @param value
4151
+ * @param key
4152
+ */
4153
+ export const setVersionByHeader: (value: string, key?: string) => void;
4154
+ /**
4155
+ * 设置 sdk version
4156
+ * @param value
4157
+ * @param key
4158
+ */
4159
+ export const setSdkVersionByHeader: (value: string, key?: string) => void;
4160
+ /**
4161
+ * 设置 AppId
4162
+ * @param value
4163
+ * @param key
4164
+ */
4165
+ export const setAppIdByRequestHeader: (value: string, key?: string) => void;
4166
+ /**
4167
+ * 设置 x-authing-app-tenant-id 请求头
4168
+ * @param value
4169
+ * @param key
4170
+ */
4171
+ export const setTenantIdByRequestHeader: (value?: string | undefined, key?: string) => void;
4172
+ /**
4173
+ * 根据 publishConfig 中的 userid 设置
4174
+ * @param value
4175
+ * @param key
4176
+ */
4177
+ export const setUserPoolIdByRequestHeader: (value: string, key?: string) => void;
4178
+ export const setLanguageInRequestHeader: () => void;
4179
+ /**
4180
+ * 获取当前所有 headers
4181
+ */
4182
+ export const getHeader: () => import("axios").HeadersDefaults;
4183
+ /**
4184
+ * 修改/设置请求头
4185
+ * @param key
4186
+ * @param value
4187
+ */
4188
+ export const _setRequestHeader: (key: string, value: string) => void;
4189
+
4190
+ }
4191
+ declare module '@authing/react-ui-components/components/_utils/http/index' {
4192
+ import instance from '@authing/react-ui-components/components/_utils/http/instance';
4193
+ import * as httpHeaderMethods from '@authing/react-ui-components/components/_utils/http/header/index';
4194
+ import * as httpEvents from '@authing/react-ui-components/components/_utils/http/events/index';
4195
+ import * as httpBaseConfig from '@authing/react-ui-components/components/_utils/http/base/index';
4196
+ import * as commonRequest from '@authing/react-ui-components/components/_utils/http/api/index';
4197
+ export { instance, httpHeaderMethods, httpEvents, httpBaseConfig, commonRequest, };
4198
+
4199
+ }
4200
+ declare module '@authing/react-ui-components/components/_utils/http/instance' {
4201
+ const instance: import("axios").AxiosInstance;
4202
+ export default instance;
4203
+
4204
+ }
4205
+ declare module '@authing/react-ui-components/components/_utils/http/interceptors/request' {
4206
+ import { AxiosInstance } from 'axios';
4207
+ /**
4208
+ * 初始化请求拦截器
4209
+ * @param instance
4210
+ */
4211
+ export const initRequestInterceptors: (instance: AxiosInstance) => void;
4212
+
4213
+ }
4214
+ declare module '@authing/react-ui-components/components/_utils/http/interceptors/response' {
4215
+ import { AxiosInstance } from 'axios';
4216
+ export interface AuthingResponse<T = any> {
4217
+ /**
4218
+ * 错误码
4219
+ */
4220
+ code?: number;
4221
+ /**
4222
+ * 返回状态
4223
+ * 3XX:状态机流转
4224
+ * 4XX|6XX:错误处理
4225
+ */
4226
+ statusCode?: number;
4227
+ /**
4228
+ * statusCode 3XX 时下个阶段的 code 码
4229
+ */
4230
+ apiCode?: number;
4231
+ /**
4232
+ * 返回的数据
4233
+ */
4234
+ data?: T;
4235
+ /**
4236
+ *
4237
+ */
4238
+ messages?: string;
4239
+ /**
4240
+ *
4241
+ */
4242
+ message?: string;
4243
+ /**
4244
+ * 当前流程 ID
4245
+ * ResponseData 返回则更新当前流程 ID
4246
+ */
4247
+ flowHandle?: string;
4248
+ /**
4249
+ * 响应是否为当前业务内小状态处理
4250
+ * statusCode === 200 下进入该状态
4251
+ */
4252
+ isBusiness?: boolean;
4253
+ }
4254
+ /**
4255
+ * 初始化响应拦截器
4256
+ */
4257
+ export const initResponseInterceptors: (instance: AxiosInstance) => void;
4258
+
4259
+ }
4260
+ declare module '@authing/react-ui-components/components/_utils/http/utils' {
4261
+ import { AxiosRequestConfig, AxiosResponse } from 'axios';
4262
+ import { AuthingResponse } from '@authing/react-ui-components/components/_utils/http/interceptors/response';
4263
+ /**
4264
+ * 根据 Response 中的 apiCode & statusCode 做拦截
4265
+ * @param response
4266
+ * @returns
4267
+ */
4268
+ export const processCodeByResponse: (response: AxiosResponse<AuthingResponse>) => AuthingResponse<any>;
4269
+ /**
4270
+ * 处理请求加密字段
4271
+ * @param config
4272
+ * @returns
4273
+ */
4274
+ export const processEncryptRequestKey: (config: AxiosRequestConfig) => Promise<any>;
4275
+ /**
4276
+ * 处理 flowHandler
4277
+ * @param response
4278
+ * @returns
4279
+ */
4280
+ export const processFlowHandler: (response: AuthingResponse) => AuthingResponse<any>;
4281
+
3775
4282
  }
3776
4283
  declare module '@authing/react-ui-components/components/_utils/http' {
3777
4284
  import { CodeAction } from '@authing/react-ui-components/components/_utils/responseManagement/interface';
@@ -3804,18 +4311,36 @@ declare module '@authing/react-ui-components/components/_utils/http' {
3804
4311
  flowHandle?: string;
3805
4312
  }
3806
4313
  export interface AuthingGuardResponse<T = any> extends AuthingResponse<T> {
4314
+ /**
4315
+ * 根据 Server 返回状态进行的状态流转函数
4316
+ * 默认响应拦截器中自动调用
4317
+ */
3807
4318
  onGuardHandling?: () => CodeAction;
4319
+ /**
4320
+ * Response 返回 actions 是否需要模块内部处理
4321
+ * 根据 status === 200 判断
4322
+ */
4323
+ isBusiness?: boolean;
4324
+ /**
4325
+ * 流程是否结束(兼容老版本字段)
4326
+ */
3808
4327
  isFlowEnd?: boolean;
4328
+ /**
4329
+ * 本次响应 Action 类型
4330
+ * see: packages/react-components/components/_utils/responseManagement/interface.ts
4331
+ */
4332
+ responseActionType?: CodeAction;
3809
4333
  }
3810
4334
 
3811
4335
  }
3812
4336
  declare module '@authing/react-ui-components/components/_utils/index' {
3813
- import { Rule } from 'antd/lib/form';
4337
+ import { FormInstance, Rule, RuleObject } from 'antd/lib/form';
3814
4338
  import qs from 'qs';
3815
4339
  import { User } from 'authing-js-sdk';
3816
4340
  import { ApplicationConfig, ComplateFiledsPlace } from '@authing/react-ui-components/components/AuthingGuard/api/index';
3817
4341
  import { GuardProps } from '@authing/react-ui-components/components/Guard/index';
3818
4342
  import { LoginMethods, RegisterMethods } from '@authing/react-ui-components/components/AuthingGuard/types/index';
4343
+ import { InputMethod } from 'components';
3819
4344
  export * from '@authing/react-ui-components/components/_utils/popupCenter';
3820
4345
  export * from '@authing/react-ui-components/components/_utils/clipboard';
3821
4346
  export const VALIDATE_PATTERN: {
@@ -3828,6 +4353,20 @@ declare module '@authing/react-ui-components/components/_utils/index' {
3828
4353
  export const validate: (type: keyof typeof VALIDATE_PATTERN, val: string) => boolean;
3829
4354
  export const getRequiredRules: (msg: string) => Rule[];
3830
4355
  export const fieldRequiredRule: (fieldRequiredRule: string, fieldRequiredRuleMessage?: string | undefined) => Rule[];
4356
+ /**
4357
+ * 验证码是否正确
4358
+ * @param form form 实例
4359
+ * @param key 当前 FormItem 对应值的 key,比如当前为邮箱验证码就传入邮箱输入框的 formItem name
4360
+ * @returns Array
4361
+ */
4362
+ export const fieldCodeCorrect: (form: FormInstance, key: string | undefined, options: {
4363
+ currentMethod: InputMethod;
4364
+ areaCode: string;
4365
+ isInternationSms?: boolean | undefined;
4366
+ }) => {
4367
+ validateTrigger: string[];
4368
+ validator: (rule: RuleObject, value: string) => Promise<void>;
4369
+ }[];
3831
4370
  export function getDeviceName(): string | null | undefined;
3832
4371
  export type STYLE_RECORD_KEY = 'appConfig' | 'userConfig';
3833
4372
  export const insertStyles: (styles: string | any, recordKey?: "userConfig" | "appConfig" | undefined) => void;
@@ -3975,6 +4514,12 @@ declare module '@authing/react-ui-components/components/_utils/popupCenter' {
3975
4514
  declare module '@authing/react-ui-components/components/_utils/responseManagement/index' {
3976
4515
  import { AuthingGuardResponse, AuthingResponse } from '@authing/react-ui-components/components/_utils/http';
3977
4516
  import { CodeAction } from '@authing/react-ui-components/components/_utils/responseManagement/interface';
4517
+ /**
4518
+ * 全局的错误拦截器
4519
+ * @param res
4520
+ * @param callBack
4521
+ * @returns
4522
+ */
3978
4523
  export const errorCodeInterceptor: (res: AuthingResponse<any>, callBack: (code: CodeAction, res: AuthingResponse) => AuthingGuardResponse) => AuthingResponse<any>;
3979
4524
 
3980
4525
  }
@@ -4102,7 +4647,7 @@ declare module '@authing/react-ui-components/components/version/index' {
4102
4647
 
4103
4648
  }
4104
4649
  declare module '@authing/react-ui-components/components/version/version' {
4105
- const _default: "3.1.29-alpha.1";
4650
+ const _default: "3.1.30-beta.0";
4106
4651
  export default _default;
4107
4652
 
4108
4653
  }
@@ -4231,11 +4776,13 @@ declare module '@authing/react-ui-components/config/webpack.config' {
4231
4776
  modules: string[];
4232
4777
  extensions: string[];
4233
4778
  alias: {
4779
+ service: string;
4234
4780
  src?: undefined;
4235
4781
  'react-dom$'?: string;
4236
4782
  'scheduler/tracing'?: string;
4237
4783
  'react-native': string;
4238
4784
  } | {
4785
+ service: string;
4239
4786
  src: string;
4240
4787
  'react-dom$'?: string;
4241
4788
  'scheduler/tracing'?: string;