@authing/react-ui-components 2.4.54-alpha.0 → 2.4.55-alpha.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (66) hide show
  1. package/build/asset-manifest.json +18 -18
  2. package/build/index.html +1 -1
  3. package/build/static/css/{2.40c24d2f.chunk.css → 2.e5f4a1ca.chunk.css} +2 -2
  4. package/build/static/css/2.e5f4a1ca.chunk.css.map +1 -0
  5. package/build/static/css/main.4dd73333.chunk.css +2 -0
  6. package/build/static/css/main.4dd73333.chunk.css.map +1 -0
  7. package/build/static/js/2.b28e1968.chunk.js +3 -0
  8. package/build/static/js/2.b28e1968.chunk.js.LICENSE.txt +70 -0
  9. package/build/static/js/2.b28e1968.chunk.js.map +1 -0
  10. package/build/static/js/{3.edcab7cd.chunk.js → 3.584da164.chunk.js} +2 -2
  11. package/build/static/js/{3.edcab7cd.chunk.js.map → 3.584da164.chunk.js.map} +1 -1
  12. package/build/static/js/main.eeb41586.chunk.js +2 -0
  13. package/build/static/js/main.eeb41586.chunk.js.map +1 -0
  14. package/build/static/js/{runtime-main.1b4b9135.js → runtime-main.6174f3e9.js} +2 -2
  15. package/build/static/js/{runtime-main.1b4b9135.js.map → runtime-main.6174f3e9.js.map} +1 -1
  16. package/lib/index.min.css +1 -2
  17. package/lib/index.min.js +1 -1
  18. package/lib/index.min.js.LICENSE.txt +0 -64
  19. package/package.json +3 -5
  20. package/src/common/AuthingDropdown/index.tsx +20 -58
  21. package/src/common/AuthingDropdown/style.less +8 -33
  22. package/src/components/AuthingGuard/AppMFALayout/index.tsx +15 -30
  23. package/src/components/AuthingGuard/Forms/QrCodeLoginForm/index.tsx +3 -1
  24. package/src/components/AuthingGuard/GuardLayout/index.tsx +16 -32
  25. package/src/components/AuthingGuard/GuardLayout/style.less +0 -4
  26. package/src/components/AuthingGuard/Header/index.tsx +5 -2
  27. package/src/components/AuthingGuard/Header/style.less +23 -11
  28. package/src/components/AuthingGuard/IconFont/iconfont.js +74 -1
  29. package/src/components/AuthingGuard/LoginLayout/index.tsx +53 -22
  30. package/src/components/AuthingGuard/api/appConfig.ts +3 -2
  31. package/src/components/AuthingGuard/api/http.ts +32 -9
  32. package/src/components/AuthingGuard/constants.ts +2 -0
  33. package/src/components/AuthingGuard/hooks/index.tsx +0 -37
  34. package/src/components/AuthingGuard/index.tsx +8 -3
  35. package/src/components/AuthingGuard/locales/en/common.json +1 -2
  36. package/src/components/AuthingGuard/locales/en/login.json +1 -1
  37. package/src/components/AuthingGuard/locales/zh/common.json +1 -16
  38. package/src/components/AuthingGuard/types/Forms.ts +1 -2
  39. package/src/components/AuthingGuard/types/GuardConfig.ts +2 -1
  40. package/src/context/global/reducer.tsx +0 -4
  41. package/src/index.tsx +16 -28
  42. package/src/utils/index.ts +0 -23
  43. package/yarn-error.log +19616 -0
  44. package/build/static/css/2.40c24d2f.chunk.css.map +0 -1
  45. package/build/static/css/main.ee0e3901.chunk.css +0 -2
  46. package/build/static/css/main.ee0e3901.chunk.css.map +0 -1
  47. package/build/static/js/2.354276b9.chunk.js +0 -3
  48. package/build/static/js/2.354276b9.chunk.js.LICENSE.txt +0 -156
  49. package/build/static/js/2.354276b9.chunk.js.map +0 -1
  50. package/build/static/js/main.6c028b56.chunk.js +0 -2
  51. package/build/static/js/main.6c028b56.chunk.js.map +0 -1
  52. package/lib/index.d.ts +0 -1374
  53. package/src/components/AuthingGuard/Forms/TotpMfaVerifyForm/BindTotpForm/AppDownload.tsx +0 -198
  54. package/src/components/AuthingGuard/Forms/TotpMfaVerifyForm/BindTotpForm/BindSuccess.tsx +0 -48
  55. package/src/components/AuthingGuard/Forms/TotpMfaVerifyForm/BindTotpForm/CopyIcon.tsx +0 -52
  56. package/src/components/AuthingGuard/Forms/TotpMfaVerifyForm/BindTotpForm/InputSaftyCode.tsx +0 -25
  57. package/src/components/AuthingGuard/Forms/TotpMfaVerifyForm/BindTotpForm/SaveSecretKey.tsx +0 -34
  58. package/src/components/AuthingGuard/Forms/TotpMfaVerifyForm/BindTotpForm/ScanQrcode.tsx +0 -44
  59. package/src/components/AuthingGuard/Forms/TotpMfaVerifyForm/BindTotpForm/index.tsx +0 -40
  60. package/src/components/AuthingGuard/Forms/TotpMfaVerifyForm/BindTotpForm/styles.less +0 -454
  61. package/src/components/AuthingGuard/Forms/TotpMfaVerifyForm/MobileSteps/index.tsx +0 -49
  62. package/src/components/AuthingGuard/Forms/TotpMfaVerifyForm/MobileSteps/style.less +0 -10
  63. package/src/components/AuthingGuard/Forms/TotpMfaVerifyForm/UserMfa/index.tsx +0 -361
  64. package/src/components/AuthingGuard/Forms/TotpMfaVerifyForm/UserMfa/style.less +0 -12
  65. package/src/components/AuthingGuard/Forms/TotpMfaVerifyForm/VerifyTotpForm.tsx +0 -120
  66. package/src/components/AuthingGuard/Forms/TotpMfaVerifyForm/index.tsx +0 -35
package/lib/index.d.ts DELETED
@@ -1,1374 +0,0 @@
1
- declare module '@authing/react-ui-components/common/AuthingDropdown/index' {
2
- import React, { FC } from 'react';
3
- import './style.less';
4
- /**
5
- * 不使用 antd 的 dropdown,因为里面会用 tooltip,体积过大
6
- */
7
- export const AuthingDropdown: FC<{
8
- className?: string;
9
- menus: {
10
- label: React.ReactNode;
11
- key: string | number;
12
- onClick?: (key: string | number, evt: React.MouseEvent<HTMLDivElement, MouseEvent>) => void;
13
- }[];
14
- }>;
15
-
16
- }
17
- declare module '@authing/react-ui-components/common/AuthingTabs/index' {
18
- import React, { FC } from 'react';
19
- import './style.less';
20
- export interface AuthingTabsProps extends React.HTMLAttributes<HTMLDivElement> {
21
- activeKey?: string;
22
- onTabClick: (key: string) => void;
23
- showLen?: number;
24
- tabs: {
25
- key: string;
26
- label: string;
27
- component: JSX.Element;
28
- }[];
29
- }
30
- export const AuthingTabs: FC<AuthingTabsProps>;
31
-
32
- }
33
- declare module '@authing/react-ui-components/common/CopyAbleText/index' {
34
- import React, { FC } from 'react';
35
- import './style.less';
36
- export interface CopyTextProps extends React.HTMLAttributes<HTMLDivElement> {
37
- }
38
- export const CopyAbleText: FC<CopyTextProps>;
39
-
40
- }
41
- declare module '@authing/react-ui-components/common/VerifyCodeInput/index' {
42
- import React, { FC } from 'react';
43
- import './style.less';
44
- interface VerifyCodeInputProps extends React.HTMLAttributes<HTMLDivElement> {
45
- verifyCode: string[];
46
- setVerifyCode: (code: string[]) => void;
47
- length?: number;
48
- onEnter?: Function;
49
- }
50
- export const VerifyCodeInput: FC<VerifyCodeInputProps>;
51
- export {};
52
-
53
- }
54
- declare module '@authing/react-ui-components/components/AuthingGuard/AppMFALayout/index' {
55
- import { FC } from 'react';
56
- import './style.less';
57
- export interface MfaLayoutProps {
58
- }
59
- export const AppMfaLayout: FC<MfaLayoutProps>;
60
-
61
- }
62
- declare module '@authing/react-ui-components/components/AuthingGuard/CompleteUserInfoLayout/index' {
63
- import { FC } from 'react';
64
- import './style.less';
65
- export const CompleteUserInfoLayout: FC;
66
-
67
- }
68
- declare module '@authing/react-ui-components/components/AuthingGuard/Forms/ADLoginForm/index' {
69
- import { FormInstance } from 'antd/lib/form';
70
- import React from 'react';
71
- import { ADLoginFormProps } from '@authing/react-ui-components/components/AuthingGuard/types/index';
72
- export const ADLoginForm: React.ForwardRefExoticComponent<ADLoginFormProps & React.RefAttributes<FormInstance<any>>>;
73
-
74
- }
75
- declare module '@authing/react-ui-components/components/AuthingGuard/Forms/Agreements/index' {
76
- import React, { FC } from 'react';
77
- import { Agreement } from '@authing/react-ui-components/components/AuthingGuard/api/index';
78
- import './style.less';
79
- export interface AgreementsProps {
80
- value?: boolean;
81
- onChange?: (value: boolean) => void;
82
- style?: React.CSSProperties;
83
- agreements: Agreement[];
84
- showError?: boolean;
85
- }
86
- export const Agreements: FC<AgreementsProps>;
87
-
88
- }
89
- declare module '@authing/react-ui-components/components/AuthingGuard/Forms/CompleteUserInfoForm/index' {
90
- import { FC } from 'react';
91
- import { CompleteUserInfoFormProps } from '@authing/react-ui-components/components/AuthingGuard/types/index';
92
- export const CompleteUserInfoForm: FC<CompleteUserInfoFormProps>;
93
-
94
- }
95
- declare module '@authing/react-ui-components/components/AuthingGuard/Forms/EmailMfaVerifyForm/CheckEmailForm' {
96
- import { FC } from 'react';
97
- import { MFACheckEmailFormProps } from '@authing/react-ui-components/components/AuthingGuard/types/index';
98
- import './style.less';
99
- export const CheckEmailForm: FC<MFACheckEmailFormProps>;
100
-
101
- }
102
- declare module '@authing/react-ui-components/components/AuthingGuard/Forms/EmailMfaVerifyForm/VerifyCodeForm' {
103
- import { FC } from 'react';
104
- import { EmailMFAVerifyFormProps } from '@authing/react-ui-components/components/AuthingGuard/types/index';
105
- import './style.less';
106
- export const VerifyCodeForm: FC<EmailMFAVerifyFormProps>;
107
-
108
- }
109
- declare module '@authing/react-ui-components/components/AuthingGuard/Forms/EmailMfaVerifyForm/index' {
110
- import { FC } from 'react';
111
- import { SmsMFAFormProps } from '@authing/react-ui-components/components/AuthingGuard/types/index';
112
- export const EmailMfaVerifyForm: FC<SmsMFAFormProps>;
113
-
114
- }
115
- declare module '@authing/react-ui-components/components/AuthingGuard/Forms/EmailRegisterForm/index' {
116
- import React from 'react';
117
- import { FormInstance } from 'antd/lib/form';
118
- import { EmailRegisterFormProps } from '@authing/react-ui-components/components/AuthingGuard/types/index';
119
- export const EmailRegisterForm: React.ForwardRefExoticComponent<EmailRegisterFormProps & React.RefAttributes<FormInstance<any>>>;
120
-
121
- }
122
- declare module '@authing/react-ui-components/components/AuthingGuard/Forms/LdapLoginForm/index' {
123
- import { FormInstance } from 'antd/lib/form';
124
- import React from 'react';
125
- import { PasswordLoginFormProps } from '@authing/react-ui-components/components/AuthingGuard/types/index';
126
- export const LdapLoginForm: React.ForwardRefExoticComponent<PasswordLoginFormProps & React.RefAttributes<FormInstance<any>>>;
127
-
128
- }
129
- declare module '@authing/react-ui-components/components/AuthingGuard/Forms/LoginFormFooter/index' {
130
- import { FC } from 'react';
131
- import './style.less';
132
- export interface LoginFormFooterProps {
133
- loading: boolean;
134
- needRestPwd?: boolean;
135
- needRegister?: boolean;
136
- }
137
- export const LoginFormFooter: FC<LoginFormFooterProps>;
138
-
139
- }
140
- declare module '@authing/react-ui-components/components/AuthingGuard/Forms/MfaResetCodeForm/Step1' {
141
- import { FC } from 'react';
142
- import { User } from 'authing-js-sdk';
143
- export const MfaResetStep1: FC<{
144
- mfaToken: string;
145
- onSuccess: (user: User & {
146
- recoveryCode: string;
147
- }) => void;
148
- goVerify: () => void;
149
- onFail?: (error: any) => void;
150
- }>;
151
-
152
- }
153
- declare module '@authing/react-ui-components/components/AuthingGuard/Forms/MfaResetCodeForm/Step2' {
154
- import { FC } from 'react';
155
- export interface MfaResetStep2Props {
156
- recoverCode: string;
157
- onFinish: () => void;
158
- }
159
- export const MfaResetStep2: FC<MfaResetStep2Props>;
160
-
161
- }
162
- declare module '@authing/react-ui-components/components/AuthingGuard/Forms/MfaResetCodeForm/index' {
163
- import { FC } from 'react';
164
- import { MfaResetForm } from '@authing/react-ui-components/components/AuthingGuard/types/index';
165
- import './style.less';
166
- export const MfaResetCodeForm: FC<MfaResetForm>;
167
-
168
- }
169
- declare module '@authing/react-ui-components/components/AuthingGuard/Forms/MfaVerifyForm/index' {
170
- import { FC } from 'react';
171
- import { MfaVerifyForm } from '@authing/react-ui-components/components/AuthingGuard/types/index';
172
- import './style.less';
173
- export const MFAVerifyForm: FC<MfaVerifyForm>;
174
-
175
- }
176
- declare module '@authing/react-ui-components/components/AuthingGuard/Forms/PasswordLoginForm/index' {
177
- import { FormInstance } from 'antd/lib/form';
178
- import React from 'react';
179
- import { PasswordLoginFormProps } from '@authing/react-ui-components/components/AuthingGuard/types/index';
180
- export const PasswordLoginForm: React.ForwardRefExoticComponent<PasswordLoginFormProps & React.RefAttributes<FormInstance<any>>>;
181
-
182
- }
183
- declare module '@authing/react-ui-components/components/AuthingGuard/Forms/PhoneCodeLoginForm/index' {
184
- import React from 'react';
185
- import { FormInstance } from 'antd/lib/form';
186
- import { PhoneCodeLoginFormProps } from '@authing/react-ui-components/components/AuthingGuard/types/index';
187
- export const PhoneCodeLoginForm: React.ForwardRefExoticComponent<PhoneCodeLoginFormProps & React.RefAttributes<FormInstance<any>>>;
188
-
189
- }
190
- declare module '@authing/react-ui-components/components/AuthingGuard/Forms/PhoneRegisterForm/index' {
191
- import { FormInstance } from 'antd/lib/form';
192
- import React from 'react';
193
- import { PhoneRegisterFormProps } from '@authing/react-ui-components/components/AuthingGuard/types/index';
194
- export const PhoneRegisterForm: React.ForwardRefExoticComponent<PhoneRegisterFormProps & React.RefAttributes<FormInstance<any>>>;
195
-
196
- }
197
- declare module '@authing/react-ui-components/components/AuthingGuard/Forms/QrCodeLoginForm/index' {
198
- import { FC } from 'react';
199
- import { QrLoginFormProps } from '@authing/react-ui-components/components/AuthingGuard/types/index';
200
- import './style.less';
201
- export const QrCodeLoginForm: FC<QrLoginFormProps>;
202
-
203
- }
204
- declare module '@authing/react-ui-components/components/AuthingGuard/Forms/RegisterFormFooter/index' {
205
- import { FC } from 'react';
206
- import './style.less';
207
- export interface RegisterFormFooterProps {
208
- loading: boolean;
209
- }
210
- export const RegisterFormFooter: FC<RegisterFormFooterProps>;
211
-
212
- }
213
- declare module '@authing/react-ui-components/components/AuthingGuard/Forms/ResetPwdForm/Footer' {
214
- /// <reference types="react" />
215
- export const ResetPwdFormFooter: () => JSX.Element;
216
-
217
- }
218
- declare module '@authing/react-ui-components/components/AuthingGuard/Forms/ResetPwdForm/Step1' {
219
- import { FC } from 'react';
220
- import { ResetPasswordStep1Props } from '@authing/react-ui-components/components/AuthingGuard/types/index';
221
- export const ResetPasswordStep1: FC<ResetPasswordStep1Props>;
222
-
223
- }
224
- declare module '@authing/react-ui-components/components/AuthingGuard/Forms/ResetPwdForm/Step2' {
225
- import { FC } from 'react';
226
- import { ResetPasswordStep2Props } from '@authing/react-ui-components/components/AuthingGuard/types/index';
227
- export const ResetPasswordStep2: FC<ResetPasswordStep2Props>;
228
-
229
- }
230
- declare module '@authing/react-ui-components/components/AuthingGuard/Forms/ResetPwdForm/Step3' {
231
- import { FC } from 'react';
232
- import { ResetPasswordStep3Props } from '@authing/react-ui-components/components/AuthingGuard/types/index';
233
- export const ResetPasswordStep3: FC<ResetPasswordStep3Props>;
234
-
235
- }
236
- declare module '@authing/react-ui-components/components/AuthingGuard/Forms/ResetPwdForm/Step4' {
237
- import { FC } from 'react';
238
- export const ResetPasswordStep4: FC;
239
-
240
- }
241
- declare module '@authing/react-ui-components/components/AuthingGuard/Forms/ResetPwdForm/index' {
242
- import { FC } from 'react';
243
- import { ResetPasswordFormProps } from '@authing/react-ui-components/components/AuthingGuard/types/index';
244
- import './style.less';
245
- export const ResetPasswordForm: FC<ResetPasswordFormProps>;
246
-
247
- }
248
- declare module '@authing/react-ui-components/components/AuthingGuard/Forms/SendPhoneCode/SendCodeBtn' {
249
- import React, { FC } from 'react';
250
- export interface SendCodeProps {
251
- beforeSend: () => Promise<boolean>;
252
- btnRef?: React.RefObject<HTMLButtonElement>;
253
- }
254
- export const SendCodeBtn: FC<SendCodeProps>;
255
-
256
- }
257
- declare module '@authing/react-ui-components/components/AuthingGuard/Forms/SendPhoneCode/index' {
258
- import { FC } from 'react';
259
- import { CommonMessage } from 'authing-js-sdk';
260
- import './style.less';
261
- export interface SendPhoneCodeProps {
262
- phone: string;
263
- onSend?: () => void;
264
- onError?: (error: CommonMessage) => void;
265
- }
266
- export const SendPhoneCode: FC<SendPhoneCodeProps>;
267
-
268
- }
269
- declare module '@authing/react-ui-components/components/AuthingGuard/Forms/SmsMfaVerifyForm/CheckPhoneForm' {
270
- import { FC } from 'react';
271
- import { MFACheckPhoneFormProps } from '@authing/react-ui-components/components/AuthingGuard/types/index';
272
- import './style.less';
273
- export const CheckPhoneForm: FC<MFACheckPhoneFormProps>;
274
-
275
- }
276
- declare module '@authing/react-ui-components/components/AuthingGuard/Forms/SmsMfaVerifyForm/VerifyCodeForm' {
277
- import { FC } from 'react';
278
- import { SmsMFAVerifyFormProps } from '@authing/react-ui-components/components/AuthingGuard/types/index';
279
- import './style.less';
280
- export const VerifyCodeForm: FC<SmsMFAVerifyFormProps>;
281
-
282
- }
283
- declare module '@authing/react-ui-components/components/AuthingGuard/Forms/SmsMfaVerifyForm/index' {
284
- import { FC } from 'react';
285
- import { SmsMFAFormProps } from '@authing/react-ui-components/components/AuthingGuard/types/index';
286
- export const SmsMfaVerifyForm: FC<SmsMFAFormProps>;
287
-
288
- }
289
- declare module '@authing/react-ui-components/components/AuthingGuard/Forms/SocialAndIdpLogin/index' {
290
- import { FC } from 'react';
291
- import { SocialAndIdpLoginProps } from '@authing/react-ui-components/components/AuthingGuard/types/index';
292
- import './style.less';
293
- export const SocialAndIdpLogin: FC<SocialAndIdpLoginProps>;
294
-
295
- }
296
- declare module '@authing/react-ui-components/components/AuthingGuard/Forms/TotpMfaVerifyForm/BindTotpForm/AppDownload' {
297
- import { FC } from 'react';
298
- import './styles.less';
299
- export interface AppDownloadProps {
300
- }
301
- export const download_authenticator_config: {
302
- Android: {
303
- google: string;
304
- microsoft: string;
305
- googleQRcode: string;
306
- microsoftQRcode: string;
307
- };
308
- iOS: {
309
- google: string;
310
- microsoft: string;
311
- googleQRcode: string;
312
- microsoftQRcode: string;
313
- };
314
- };
315
- export const AppDownload: FC<AppDownloadProps>;
316
- export const DOWNLOAD_AUTHENTICATOR_CONFIG: {
317
- Android: {
318
- google: string;
319
- microsoft: string;
320
- };
321
- iOS: {
322
- google: string;
323
- microsoft: string;
324
- };
325
- };
326
- export const MediaAppDownload: FC;
327
-
328
- }
329
- declare module '@authing/react-ui-components/components/AuthingGuard/Forms/TotpMfaVerifyForm/BindTotpForm/BindSuccess' {
330
- import { FC } from 'react';
331
- import { TotpSource } from '@authing/react-ui-components/components/AuthingGuard/Forms/TotpMfaVerifyForm/UserMfa/index';
332
- import { User } from 'authing-js-sdk';
333
- export const BindSuccess: FC<{
334
- totpSource?: TotpSource;
335
- user?: User;
336
- }>;
337
-
338
- }
339
- declare module '@authing/react-ui-components/components/AuthingGuard/Forms/TotpMfaVerifyForm/BindTotpForm/CopyIcon' {
340
- import React, { FC } from 'react';
341
- export interface CopyIconProps {
342
- copyValue: string;
343
- style?: React.CSSProperties;
344
- className?: string;
345
- }
346
- const CopyIcon: FC<CopyIconProps>;
347
- export const copyFunction: (copyValue: string) => void;
348
- export default CopyIcon;
349
-
350
- }
351
- declare module '@authing/react-ui-components/components/AuthingGuard/Forms/TotpMfaVerifyForm/BindTotpForm/InputSaftyCode' {
352
- import { FC } from 'react';
353
- export const InputSaftyCode: FC<{
354
- saftyCode: string[];
355
- isPhoneMedia: boolean;
356
- setSaftyCode: (code: string[]) => void;
357
- }>;
358
-
359
- }
360
- declare module '@authing/react-ui-components/components/AuthingGuard/Forms/TotpMfaVerifyForm/BindTotpForm/SaveSecretKey' {
361
- import { FC } from 'react';
362
- export const SaveSecretKey: FC<{
363
- setIsSaved: Function;
364
- isSaved: boolean;
365
- secret: string;
366
- }>;
367
-
368
- }
369
- declare module '@authing/react-ui-components/components/AuthingGuard/Forms/TotpMfaVerifyForm/BindTotpForm/ScanQrcode' {
370
- import { FC } from 'react';
371
- export const ScanQrcode: FC<{
372
- qrcode: string;
373
- secret: string;
374
- isPhoneMedia: boolean;
375
- userpoolName: string;
376
- }>;
377
-
378
- }
379
- declare module '@authing/react-ui-components/components/AuthingGuard/Forms/TotpMfaVerifyForm/BindTotpForm/index' {
380
- import { FC } from 'react';
381
- export const BindTotpForm: FC<any>;
382
-
383
- }
384
- declare module '@authing/react-ui-components/components/AuthingGuard/Forms/TotpMfaVerifyForm/MobileSteps/index' {
385
- import { ReactNode } from 'react';
386
- import { FC } from 'react';
387
- import './style.less';
388
- export interface MobileStepProps {
389
- title: string;
390
- }
391
- export interface MobileStepsProps {
392
- current: number;
393
- data: ReactNode[];
394
- }
395
- const MobileSteps: FC<MobileStepsProps>;
396
- export { MobileSteps };
397
-
398
- }
399
- declare module '@authing/react-ui-components/components/AuthingGuard/Forms/TotpMfaVerifyForm/UserMfa/index' {
400
- import React from 'react';
401
- import './style.less';
402
- export const ErrorCodes: {
403
- WRONG_PASSWORD: number;
404
- LOGIN_REQUIRED: number;
405
- USER_OR_PASSWORD_WRONG: number;
406
- USER_NOT_EXISTS: number;
407
- OTP_MFA_CODE: number;
408
- MSG_MFA_CODE: number;
409
- MAF_TOKEN_INVALID: number;
410
- FIRST_LOGIN_CODE: number;
411
- ACCOUNT_LOCK: number;
412
- ACCOUNT_LOCKED: number;
413
- PASSWORD_EXPIRED: number;
414
- USED_PASSWORD: number;
415
- };
416
- export enum TotpSource {
417
- SELF = "SELF",
418
- APPLICATION = "APPLICATION"
419
- }
420
- export interface UserMfaProps {
421
- userPoolId: string;
422
- userPoolName: string;
423
- appId: string;
424
- totpSource?: TotpSource;
425
- MFAToken?: string;
426
- className?: string;
427
- }
428
- export const UserMfa: React.FC<any>;
429
-
430
- }
431
- declare module '@authing/react-ui-components/components/AuthingGuard/Forms/TotpMfaVerifyForm/VerifyTotpForm' {
432
- import { FC } from 'react';
433
- export const VerifyTotpForm: FC<any>;
434
-
435
- }
436
- declare module '@authing/react-ui-components/components/AuthingGuard/Forms/TotpMfaVerifyForm/index' {
437
- import { FC } from 'react';
438
- import { TotpMFAFormProps } from '@authing/react-ui-components/components/AuthingGuard/types/index';
439
- export const TotpMfaVerifyForm: FC<TotpMFAFormProps>;
440
-
441
- }
442
- declare module '@authing/react-ui-components/components/AuthingGuard/Forms/UploadImage/index' {
443
- import { FC } from 'react';
444
- export const UploadImage: FC<{
445
- value?: string;
446
- onChange?: (value: string) => void;
447
- }>;
448
-
449
- }
450
- declare module '@authing/react-ui-components/components/AuthingGuard/Forms/index' {
451
- export * from '@authing/react-ui-components/components/AuthingGuard/Forms/ADLoginForm/index';
452
- export * from '@authing/react-ui-components/components/AuthingGuard/Forms/ResetPwdForm/index';
453
- export * from '@authing/react-ui-components/components/AuthingGuard/Forms/MfaVerifyForm/index';
454
- export * from '@authing/react-ui-components/components/AuthingGuard/Forms/LdapLoginForm/index';
455
- export * from '@authing/react-ui-components/components/AuthingGuard/Forms/QrCodeLoginForm/index';
456
- export * from '@authing/react-ui-components/components/AuthingGuard/Forms/MfaResetCodeForm/index';
457
- export * from '@authing/react-ui-components/components/AuthingGuard/Forms/EmailRegisterForm/index';
458
- export * from '@authing/react-ui-components/components/AuthingGuard/Forms/PhoneRegisterForm/index';
459
- export * from '@authing/react-ui-components/components/AuthingGuard/Forms/PasswordLoginForm/index';
460
- export * from '@authing/react-ui-components/components/AuthingGuard/Forms/SocialAndIdpLogin/index';
461
- export * from '@authing/react-ui-components/components/AuthingGuard/Forms/PhoneCodeLoginForm/index';
462
- export * from '@authing/react-ui-components/components/AuthingGuard/Forms/SmsMfaVerifyForm/index';
463
- export * from '@authing/react-ui-components/components/AuthingGuard/Forms/EmailMfaVerifyForm/index';
464
-
465
- }
466
- declare module '@authing/react-ui-components/components/AuthingGuard/GuardLayout/index' {
467
- import React, { FC } from 'react';
468
- import { UserConfig, Lang } from '@authing/react-ui-components/components/AuthingGuard/types/index';
469
- import './style.less';
470
- export const GuardLayout: FC<{
471
- visible?: boolean;
472
- className?: string;
473
- id?: string;
474
- style?: React.CSSProperties;
475
- lang?: Lang;
476
- userConfig: UserConfig;
477
- }>;
478
-
479
- }
480
- declare module '@authing/react-ui-components/components/AuthingGuard/Header/index' {
481
- import React, { FC } from 'react';
482
- import './style.less';
483
- export interface HeaderProps extends React.HTMLAttributes<HTMLDivElement> {
484
- }
485
- export const GuardHeader: FC<HeaderProps>;
486
-
487
- }
488
- declare module '@authing/react-ui-components/components/AuthingGuard/IconFont/iconfont' {
489
-
490
- }
491
- declare module '@authing/react-ui-components/components/AuthingGuard/IconFont/index' {
492
- import React, { FC } from 'react';
493
- import './iconfont';
494
- import './style.less';
495
- export const IconFont: FC<{
496
- type: string;
497
- style?: React.CSSProperties;
498
- className?: string;
499
- }>;
500
-
501
- }
502
- declare module '@authing/react-ui-components/components/AuthingGuard/LoginLayout/index' {
503
- /// <reference types="react" />
504
- import './style.less';
505
- export const LoginLayout: () => JSX.Element;
506
-
507
- }
508
- declare module '@authing/react-ui-components/components/AuthingGuard/MfaLayout/Steps' {
509
- export enum Steps {
510
- Verify = 0,
511
- Reset = 1
512
- }
513
-
514
- }
515
- declare module '@authing/react-ui-components/components/AuthingGuard/MfaLayout/index' {
516
- import { FC } from 'react';
517
- import './style.less';
518
- export interface MfaLayoutProps {
519
- }
520
- export const MfaLayout: FC<MfaLayoutProps>;
521
-
522
- }
523
- declare module '@authing/react-ui-components/components/AuthingGuard/RegisterLayout/index' {
524
- import { FC } from 'react';
525
- export const RegisterLayout: FC;
526
-
527
- }
528
- declare module '@authing/react-ui-components/components/AuthingGuard/ResetPwdLayout/index' {
529
- /// <reference types="react" />
530
- export const ResetPwdLayout: () => JSX.Element;
531
-
532
- }
533
- declare module '@authing/react-ui-components/components/AuthingGuard/ToggleLang/index' {
534
- import { FC } from 'react';
535
- export const ToggleLang: FC;
536
-
537
- }
538
- declare module '@authing/react-ui-components/components/AuthingGuard/api/appConfig' {
539
- import { Lang, Protocol } from '@authing/react-ui-components/components/AuthingGuard/types/index';
540
- import { IAzureAdConnectionConfig, ICasConnectionConfig, ISamlConnectionConfig, OIDCConnectionConfig, SocialConnectionItem } from '@authing/react-ui-components/components/AuthingGuard/api/userPoolConfig';
541
- export enum ApplicationMfaType {
542
- SMS = "SMS",
543
- EMAIL = "EMAIL",
544
- OTP = "OTP"
545
- }
546
- export const ApplicationMfaTypeLabel: () => Record<ApplicationMfaType, string>;
547
- export interface OidcClientMetadata {
548
- grant_types: string[];
549
- client_id: string;
550
- redirect_uris: string[];
551
- scope: string;
552
- response_types: ResponseType[];
553
- }
554
- export interface InternalExtendsField {
555
- type: 'internal';
556
- name: string;
557
- label: string;
558
- inputType: string;
559
- }
560
- export interface UserExtendsField {
561
- type: 'user';
562
- id: string;
563
- name: string;
564
- label: string;
565
- inputType: string;
566
- }
567
- export type ExtendsField = InternalExtendsField | UserExtendsField;
568
- export interface ApplicationPasswordTabConfig {
569
- enabledLoginMethods?: PasswordLoginMethods[];
570
- }
571
- export interface Agreement {
572
- id: number;
573
- title: string;
574
- required: boolean;
575
- lang: Lang;
576
- }
577
- export type PasswordLoginMethods = 'username-password' | 'email-password' | 'phone-password';
578
- export interface ApplicationConfig {
579
- id: string;
580
- cdnBase: string;
581
- userPoolId: string;
582
- rootUserPoolId: string;
583
- publicKey: string;
584
- css: string;
585
- name: string;
586
- logo: string;
587
- redirectUris: string[];
588
- registerDisabled: boolean;
589
- registerTabs: {
590
- list: string[];
591
- default: string;
592
- title: {
593
- [x: string]: string;
594
- };
595
- };
596
- loginTabs: {
597
- list: string[];
598
- default: string;
599
- title: {
600
- [x: string]: string;
601
- };
602
- };
603
- socialConnections: SocialConnectionItem[];
604
- extendsFieldsEnabled: boolean;
605
- extendsFields: ExtendsField[];
606
- identityProviders: {
607
- identifier: string;
608
- protocol: Protocol;
609
- displayName: string;
610
- logo: string;
611
- config: ISamlConnectionConfig | OIDCConnectionConfig | ICasConnectionConfig | IAzureAdConnectionConfig;
612
- }[];
613
- ssoPageComponentDisplay: {
614
- autoRegisterThenLoginHintInfo: boolean;
615
- forgetPasswordBtn: boolean;
616
- idpBtns: boolean;
617
- loginBtn: boolean;
618
- loginByPhoneCodeTab: boolean;
619
- loginByUserPasswordTab: boolean;
620
- loginMethodNav: boolean;
621
- phoneCodeInput: boolean;
622
- registerBtn: boolean;
623
- registerByEmailTab: boolean;
624
- registerByPhoneTab: boolean;
625
- registerMethodNav: boolean;
626
- socialLoginBtns: boolean;
627
- userPasswordInput: boolean;
628
- wxMpScanTab: boolean;
629
- };
630
- protocol: Protocol;
631
- oidcConfig: OidcClientMetadata;
632
- passwordTabConfig: ApplicationPasswordTabConfig;
633
- agreementEnabled: boolean;
634
- agreements: Agreement[];
635
- }
636
- export const fetchAppConfig: (appId: string) => Promise<import("@authing/react-ui-components/components/AuthingGuard/api/http").AuthingResponse<ApplicationConfig>>;
637
-
638
- }
639
- declare module '@authing/react-ui-components/components/AuthingGuard/api/http' {
640
- export const requestClient: {
641
- (input: RequestInfo, init?: RequestInit | undefined): Promise<any>;
642
- get<T>(path: string, query?: Record<string, any>, init?: RequestInit | undefined): Promise<AuthingResponse<T>>;
643
- post<T_1>(path: string, data: any, config?: {
644
- headers: any;
645
- } | undefined): Promise<AuthingResponse<T_1>>;
646
- baseUrl: string;
647
- setBaseUrl(base: string): void;
648
- langHeader: string;
649
- setLangHeader(key: string | undefined): void;
650
- };
651
- export interface AuthingResponse<T = any> {
652
- code: number;
653
- message?: string;
654
- data?: T;
655
- }
656
-
657
- }
658
- declare module '@authing/react-ui-components/components/AuthingGuard/api/index' {
659
- export * from '@authing/react-ui-components/components/AuthingGuard/api/sso';
660
- export * from '@authing/react-ui-components/components/AuthingGuard/api/appConfig';
661
- export * from '@authing/react-ui-components/components/AuthingGuard/api/userPoolConfig';
662
-
663
- }
664
- declare module '@authing/react-ui-components/components/AuthingGuard/api/sso' {
665
- import { User } from '@authing/react-ui-components/components/AuthingGuard/types/index';
666
- export interface SessionData {
667
- session: null | {
668
- _id: string;
669
- cookie: {
670
- originalMaxAge: number;
671
- expires: Date;
672
- secure: boolean;
673
- httpOnly: boolean;
674
- path: string;
675
- sameSite: string;
676
- };
677
- appId?: string;
678
- type: string;
679
- userId: string;
680
- };
681
- userInfo?: User;
682
- }
683
- export const trackSession: () => Promise<import("@authing/react-ui-components/components/AuthingGuard/api/http").AuthingResponse<SessionData>>;
684
-
685
- }
686
- declare module '@authing/react-ui-components/components/AuthingGuard/api/userPoolConfig' {
687
- import { Lang, Protocol } from '@authing/react-ui-components/components/AuthingGuard/types/index';
688
- import { SocialConnectionProvider } from 'authing-js-sdk';
689
- export interface OIDCConnectionConfig {
690
- issuerUrl: string;
691
- authorizationEdpoint: string;
692
- responseType: string;
693
- mode: OIDCConnectionMode;
694
- clientId: string;
695
- clientSecret: string;
696
- scopes: string;
697
- redirectUri: string;
698
- }
699
- export interface IOAuthConnectionConfig {
700
- authEndPoint: string;
701
- tokenEndPoint: string;
702
- scope: string;
703
- clientId: string;
704
- clientSecret: string;
705
- authUrlTemplate: string;
706
- codeToTokenScript: string;
707
- tokenToUserInfoScript: string;
708
- tokenToUserInfoScriptFuncId: string;
709
- codeToTokenScriptFuncId: string;
710
- authUrl?: string;
711
- }
712
- export interface IAzureAdConnectionConfig {
713
- microsoftAzureAdDomain: string;
714
- clientId: string;
715
- syncUserProfileOnLogin: string;
716
- emailVerifiedDefault: boolean;
717
- authorizationUrl: string;
718
- callbackUrl: string;
719
- }
720
- export enum OIDCConnectionMode {
721
- FRONT_CHANNEL = "FRONT_CHANNEL",
722
- BACK_CHANNEL = "BACK_CHANNEL"
723
- }
724
- export interface ISamlConnectionConfig {
725
- signInEndPoint: string;
726
- samlRequest?: string;
727
- samlIdpCert: string;
728
- samlSpCert: string;
729
- samlSpKey: string;
730
- signOutEndPoint: string;
731
- signSamlRequest: boolean;
732
- signatureAlgorithm: string;
733
- digestAlgorithm: string;
734
- protocolBinding: string;
735
- }
736
- export interface ICasConnectionConfig {
737
- casConnectionLoginUrl: string;
738
- }
739
- export interface SocialConnectionItem {
740
- name: string;
741
- logo: string;
742
- description: string;
743
- provider: SocialConnectionProvider;
744
- authorizationUrl: string;
745
- tooltip: Record<Lang, string>;
746
- }
747
- export interface EnterpriseConnectionItem {
748
- id: string;
749
- createdAt: Date;
750
- updatedAt: Date;
751
- userPoolId: string;
752
- protocol: Protocol;
753
- identifier: string;
754
- displayName: string;
755
- logo: string;
756
- enabled: boolean;
757
- config: OIDCConnectionConfig | ISamlConnectionConfig | ICasConnectionConfig | IAzureAdConnectionConfig | IOAuthConnectionConfig;
758
- }
759
- export interface UserPoolConfig {
760
- name: string;
761
- logo: string;
762
- socialConnections: SocialConnectionItem[];
763
- enterpriseConnections: EnterpriseConnectionItem[];
764
- }
765
-
766
- }
767
- declare module '@authing/react-ui-components/components/AuthingGuard/constants' {
768
- import { UserConfig, LoginMethods, RegisterMethods, LocalesConfig } from '@authing/react-ui-components/components/AuthingGuard/types/index';
769
- export const OTP_MFA_CODE = 1635;
770
- export const APP_MFA_CODE = 1636;
771
- export const NEED_CAPTCHA = 2000;
772
- export const LOGIN_METHODS_MAP: () => {
773
- password: string;
774
- "phone-code": string;
775
- "app-qrcode": string;
776
- "wechat-miniprogram-qrcode": string;
777
- ldap: string;
778
- ad: string;
779
- "wechatmp-qrcode": string;
780
- };
781
- export const REGISTER_METHODS_MAP: () => {
782
- email: string;
783
- phone: string;
784
- };
785
- export const HIDE_SOCIALS: string[];
786
- export enum ApplicationMfaType {
787
- SMS = "SMS",
788
- EMAIL = "EMAIL"
789
- }
790
- export const defaultGuardConfig: Partial<UserConfig>;
791
- export const defaultLocalesConfig: LocalesConfig;
792
- export const defaultHeaders: {
793
- 'userpool-id': string;
794
- 'app-id': string;
795
- 'sdk-version': string;
796
- 'request-from': string;
797
- lang: string;
798
- };
799
-
800
- }
801
- declare module '@authing/react-ui-components/components/AuthingGuard/hooks/index' {
802
- import { AuthenticationClient, AuthenticationClientOptions } from 'authing-js-sdk';
803
- export interface AuthClientConfig extends AuthenticationClientOptions {
804
- /**
805
- * @deprecated 使用 appHost
806
- */
807
- appDomain?: string;
808
- /**
809
- * @deprecated 无需传入
810
- */
811
- isSSO?: boolean;
812
- /**
813
- * @deprecated 使用 appHost
814
- */
815
- host?: string;
816
- }
817
- export const initAuthClient: (config: AuthClientConfig) => AuthenticationClient;
818
- export const useAuthing: (config?: AuthClientConfig | undefined) => {
819
- authClient: AuthenticationClient | null;
820
- };
821
- export const getAuthClient: (config?: AuthClientConfig | undefined) => AuthenticationClient | null;
822
- export const useMediaSize: () => {
823
- isPhoneMedia: boolean;
824
- };
825
-
826
- }
827
- declare module '@authing/react-ui-components/components/AuthingGuard/hooks/useScreenSize' {
828
- export enum ScreenSize {
829
- Mobile = "mobile",
830
- Desktop = "desktop"
831
- }
832
- export const SCREEN_SIZE_RANG: {
833
- size: ScreenSize;
834
- range: [number, number];
835
- }[];
836
- export const getScreenSize: () => ScreenSize | ScreenSize.Desktop;
837
- export const useScreenSize: () => ScreenSize[];
838
-
839
- }
840
- declare module '@authing/react-ui-components/components/AuthingGuard/index' {
841
- import { FC } from 'react';
842
- import { UserConfig, GuardEventsHandler } from '@authing/react-ui-components/components/AuthingGuard/types/GuardConfig';
843
- import './style.less';
844
- interface AuthingGuardProps extends GuardEventsHandler {
845
- appId: string;
846
- config?: UserConfig;
847
- visible?: boolean;
848
- className?: string;
849
- id?: string;
850
- }
851
- export const AuthingGuard: FC<AuthingGuardProps>;
852
- export {};
853
-
854
- }
855
- declare module '@authing/react-ui-components/components/AuthingGuard/locales/en/index' {
856
- import common from '@authing/react-ui-components/components/AuthingGuard/locales/en/common/index';
857
- import login from '@authing/react-ui-components/components/AuthingGuard/locales/en/login/index';
858
- import user from '@authing/react-ui-components/components/AuthingGuard/locales/en/user/index';
859
- import map from '@authing/react-ui-components/components/AuthingGuard/locales/en/map/index';
860
- export { common, login, user, map };
861
-
862
- }
863
- declare module '@authing/react-ui-components/components/AuthingGuard/locales/index' {
864
- import i18n from 'i18next';
865
- import { LocalesConfig, Lang } from '@authing/react-ui-components/components/AuthingGuard/types/index';
866
- export const changeLang: (lang: Lang) => void;
867
- const initI18n: (localesConfig: LocalesConfig, lang?: "zh-CN" | "en-US" | undefined) => void;
868
- export { i18n, initI18n };
869
-
870
- }
871
- declare module '@authing/react-ui-components/components/AuthingGuard/locales/zh/index' {
872
- import common from '@authing/react-ui-components/components/AuthingGuard/locales/zh/common/index';
873
- import login from '@authing/react-ui-components/components/AuthingGuard/locales/zh/login/index';
874
- import user from '@authing/react-ui-components/components/AuthingGuard/locales/zh/user/index';
875
- import map from '@authing/react-ui-components/components/AuthingGuard/locales/zh/map/index';
876
- export { common, login, user, map };
877
-
878
- }
879
- declare module '@authing/react-ui-components/components/AuthingGuard/types/Forms' {
880
- /// <reference types="react" />
881
- import { User } from 'authing-js-sdk';
882
- import { LoginMethods } from '@authing/react-ui-components/components/AuthingGuard/types/GuardConfig';
883
- import { ResetPwdMethods } from '@authing/react-ui-components/components/AuthingGuard/types/GuardConfig';
884
- export interface BaseFormProps extends React.HTMLAttributes<HTMLDivElement> {
885
- onSuccess?: (user: User) => void;
886
- onFail?: (error: any) => void;
887
- }
888
- export interface CompleteUserInfoFormProps extends BaseFormProps {
889
- }
890
- export interface PasswordLoginFormProps extends BaseFormProps {
891
- onValidateFail?: (error: any) => void;
892
- }
893
- export interface ADLoginFormProps extends BaseFormProps {
894
- onValidateFail?: (error: any) => void;
895
- }
896
- export interface PhoneCodeLoginFormProps extends BaseFormProps {
897
- onValidateFail?: (error: any) => void;
898
- }
899
- export interface LdapLoginFormProps extends BaseFormProps {
900
- onValidateFail?: (error: any) => void;
901
- }
902
- export interface QrLoginFormProps extends BaseFormProps {
903
- type: LoginMethods.AppQr | LoginMethods.WxMinQr | LoginMethods.WechatMpQrcode;
904
- }
905
- export interface EmailRegisterFormProps extends BaseFormProps {
906
- onValidateFail?: (error: any) => void;
907
- }
908
- export interface PhoneRegisterFormProps extends BaseFormProps {
909
- onValidateFail?: (error: any) => void;
910
- }
911
- export interface ResetPasswordFormProps {
912
- onSuccess?: () => void;
913
- onFail?: (error: any) => void;
914
- }
915
- export interface ResetPasswordStep1Props {
916
- onSuccess: (resetMethod: ResetPwdMethods, val: string) => void;
917
- }
918
- export interface ResetPasswordStep2Props {
919
- phone: string;
920
- onSuccess: () => void;
921
- onFail?: (error: any) => void;
922
- }
923
- export interface ResetPasswordStep3Props {
924
- email: string;
925
- onSuccess: () => void;
926
- onFail?: (error: any) => void;
927
- }
928
- export interface SocialAndIdpLoginProps extends BaseFormProps {
929
- }
930
- export interface MfaVerifyForm extends BaseFormProps {
931
- goReset: () => void;
932
- }
933
- export interface SmsMFAVerifyFormProps extends BaseFormProps {
934
- phone?: string;
935
- mfaToken: string;
936
- sendCodeRef: React.RefObject<HTMLButtonElement>;
937
- }
938
- export interface SmsMFAFormProps extends BaseFormProps {
939
- }
940
- export interface TotpMFAFormProps extends BaseFormProps {
941
- }
942
- export interface MFACheckPhoneFormProps {
943
- mfaToken: string;
944
- onSuccess: (phone: string) => void;
945
- }
946
- export interface EmailMFAVerifyFormProps extends BaseFormProps {
947
- email?: string;
948
- mfaToken: string;
949
- sendCodeRef: React.RefObject<HTMLButtonElement>;
950
- }
951
- export interface EmailMFAFormProps extends BaseFormProps {
952
- }
953
- export interface MFACheckEmailFormProps {
954
- mfaToken: string;
955
- onSuccess: (email: string) => void;
956
- }
957
- export interface MfaResetForm extends BaseFormProps {
958
- goVerify: () => void;
959
- }
960
-
961
- }
962
- declare module '@authing/react-ui-components/components/AuthingGuard/types/GuardConfig' {
963
- import { AuthenticationClient, AuthenticationClientOptions, CommonMessage, SocialConnectionProvider, User } from 'authing-js-sdk';
964
- import { QrCodeAuthenticationClient } from 'authing-js-sdk/build/main/lib/authentication/QrCodeAuthenticationClient';
965
- import { SocialConnectionItem, EnterpriseConnectionItem, ApplicationConfig, PasswordLoginMethods, Agreement } from '@authing/react-ui-components/components/AuthingGuard/api/index';
966
- import { Lang } from '@authing/react-ui-components/components/AuthingGuard/types/Locales';
967
- export type { AuthenticationClient, CommonMessage, User } from 'authing-js-sdk';
968
- export enum GuardMode {
969
- Modal = "modal",
970
- Normal = "normal"
971
- }
972
- export enum LoginMethods {
973
- LDAP = "ldap",
974
- AppQr = "app-qrcode",
975
- Password = "password",
976
- PhoneCode = "phone-code",
977
- WxMinQr = "wechat-miniprogram-qrcode",
978
- AD = "ad",
979
- WechatMpQrcode = "wechatmp-qrcode"
980
- }
981
- export enum RegisterMethods {
982
- Email = "email",
983
- Phone = "phone"
984
- }
985
- export enum GuardScenes {
986
- Login = "login",
987
- Register = "register",
988
- MfaVerify = "mfaVerify",
989
- AppMfaVerify = "appMfaVerify",
990
- RestPassword = "restPassword",
991
- CompleteUserInfo = "completeUserInfo"
992
- }
993
- export enum ResetPwdMethods {
994
- Email = "email",
995
- Phone = "phone"
996
- }
997
- export enum SocialConnections {
998
- Qq = "qq",
999
- Weibo = "weibo",
1000
- Github = "github",
1001
- Google = "google",
1002
- WxPc = "wechat:pc",
1003
- Dingtalk = "dingtalk",
1004
- WxWCorpQr = "wechatwork:corp:qrconnect",
1005
- WxWSPQr = "wechatwork:service-provider:qrconnect",
1006
- WxWSPAuth = "wechatwork:service-provider:authorization",
1007
- AlipayWeb = "alipay:web",
1008
- AppleWeb = "apple:web",
1009
- Baidu = "baidu",
1010
- LarkInternalApp = "lark-internal",
1011
- LarkMarketPlaceApp = "lark-public"
1012
- }
1013
- export enum Protocol {
1014
- AD = "ad",
1015
- CAS = "cas",
1016
- LDAP = "ldap",
1017
- OIDC = "oidc",
1018
- SAML = "saml",
1019
- OAUTH = "oauth",
1020
- AZURE_AD = "azure-ad"
1021
- }
1022
- export const GuardEventsCamelToKebabMap: {
1023
- readonly onLoad: "load";
1024
- readonly onLoadError: "load-error";
1025
- readonly onLogin: "login";
1026
- readonly onBeforeLogin: "before-login";
1027
- readonly onLoginError: "login-error";
1028
- readonly onRegister: "register";
1029
- readonly onBeforeRegister: "before-register";
1030
- readonly onRegisterError: "register-error";
1031
- readonly onPwdEmailSend: "pwd-email-send";
1032
- readonly onPwdEmailSendError: "pwd-email-send-error";
1033
- readonly onPwdPhoneSend: "pwd-phone-send";
1034
- readonly onPwdPhoneSendError: "pwd-phone-send-error";
1035
- readonly onPwdReset: "pwd-reset";
1036
- readonly onPwdResetError: "pwd-reset-error";
1037
- readonly onClose: "close";
1038
- readonly onLoginTabChange: "login-tab-change";
1039
- readonly onRegisterTabChange: "register-tab-change";
1040
- readonly onRegisterInfoCompleted: "register-info-completed";
1041
- readonly onRegisterInfoCompletedError: "register-info-completed-error";
1042
- };
1043
- export interface GuardEventsHandlerKebab {
1044
- load: GuardEventsHandler['onLoad'];
1045
- 'load-error': GuardEventsHandler['onLoadError'];
1046
- 'before-login': GuardEventsHandler['onBeforeLogin'];
1047
- login: GuardEventsHandler['onLogin'];
1048
- 'login-error': GuardEventsHandler['onLoginError'];
1049
- 'before-register': GuardEventsHandler['onBeforeRegister'];
1050
- register: GuardEventsHandler['onRegister'];
1051
- 'register-error': GuardEventsHandler['onRegisterError'];
1052
- 'pwd-email-send': GuardEventsHandler['onPwdEmailSend'];
1053
- 'pwd-email-send-error': GuardEventsHandler['onPwdEmailSendError'];
1054
- 'pwd-phone-send': GuardEventsHandler['onPwdPhoneSend'];
1055
- 'pwd-phone-send-error': GuardEventsHandler['onPwdPhoneSendError'];
1056
- 'pwd-reset': GuardEventsHandler['onPwdReset'];
1057
- 'pwd-reset-error': GuardEventsHandler['onPwdResetError'];
1058
- close: GuardEventsHandler['onClose'];
1059
- 'login-tab-change': GuardEventsHandler['onLoginTabChange'];
1060
- 'register-tab-change': GuardEventsHandler['onRegisterTabChange'];
1061
- 'register-info-completed': GuardEventsHandler['onRegisterInfoCompleted'];
1062
- 'register-info-completed-error': GuardEventsHandler['onRegisterInfoCompletedError'];
1063
- }
1064
- export interface PasswordLoginParams {
1065
- type: LoginMethods.Password;
1066
- data: {
1067
- identity: string;
1068
- password: string;
1069
- captchaCode?: string;
1070
- };
1071
- }
1072
- export interface LDAPLoginParams {
1073
- type: LoginMethods.LDAP;
1074
- data: {
1075
- identity: string;
1076
- password: string;
1077
- captchaCode?: string;
1078
- };
1079
- }
1080
- export interface ADLoginParams {
1081
- type: LoginMethods.AD;
1082
- data: {
1083
- identity: string;
1084
- password: string;
1085
- };
1086
- }
1087
- export interface PhoneCodeLoginParams {
1088
- type: LoginMethods.PhoneCode;
1089
- data: {
1090
- phone: string;
1091
- code: string;
1092
- };
1093
- }
1094
- export interface EmailRegisterParams {
1095
- type: RegisterMethods.Email;
1096
- data: {
1097
- email: string;
1098
- password: string;
1099
- };
1100
- }
1101
- export interface PhoneRegisterParams {
1102
- type: RegisterMethods.Phone;
1103
- data: {
1104
- phone: string;
1105
- password: string;
1106
- code: string;
1107
- };
1108
- }
1109
- export interface GuardEventsHandler {
1110
- onLoad?: (authClient: AuthenticationClient) => void;
1111
- onLoadError?: (error: CommonMessage) => void;
1112
- onBeforeLogin?: (loginInfo: PasswordLoginParams | LDAPLoginParams | ADLoginParams | PhoneCodeLoginParams, authClient: AuthenticationClient) => boolean | Promise<boolean>;
1113
- onLogin?: (user: User, authClient: AuthenticationClient) => void;
1114
- onLoginError?: (user: User, authClient: AuthenticationClient) => void;
1115
- onBeforeRegister?: (registerInfo: EmailRegisterParams | PhoneRegisterParams, authClient: AuthenticationClient) => boolean | Promise<boolean>;
1116
- onRegister?: (user: User, authClient: AuthenticationClient) => void;
1117
- onRegisterError?: (user: User, authClient: AuthenticationClient) => void;
1118
- onPwdEmailSend?: (authClient: AuthenticationClient) => void;
1119
- onPwdEmailSendError?: (error: CommonMessage, authClient: AuthenticationClient) => void;
1120
- onPwdPhoneSend?: (authClient: AuthenticationClient) => void;
1121
- onPwdPhoneSendError?: (error: CommonMessage, authClient: AuthenticationClient) => void;
1122
- onPwdReset?: (authClient: AuthenticationClient) => void;
1123
- onPwdResetError?: (error: CommonMessage, authClient: AuthenticationClient) => void;
1124
- onClose?: () => void;
1125
- onLoginTabChange?: (activeTab: LoginMethods) => void;
1126
- onRegisterTabChange?: (activeTab: RegisterMethods) => void;
1127
- onRegisterInfoCompleted?: (user: User, udfs: {
1128
- definition: any;
1129
- value: any;
1130
- }[], authClient: AuthenticationClient) => void;
1131
- onRegisterInfoCompletedError?: (error: CommonMessage, udfs: {
1132
- definition: any;
1133
- value: any;
1134
- }[], authClient: AuthenticationClient) => void;
1135
- }
1136
- export interface UserConfig {
1137
- logo?: string;
1138
- title?: string;
1139
- zIndex?: number;
1140
- isSSO?: boolean;
1141
- mode?: GuardMode;
1142
- /**
1143
- * @deprecated 使用 appHost
1144
- */
1145
- apiHost?: string;
1146
- /**
1147
- * @deprecated 使用 appHost
1148
- */
1149
- appDomain?: string;
1150
- appHost?: string;
1151
- contentCss?: string;
1152
- text?: {
1153
- loginBtn?: {
1154
- normal?: string;
1155
- loading?: string;
1156
- };
1157
- registerBtn?: {
1158
- normal?: string;
1159
- loading?: string;
1160
- };
1161
- loginTabs?: Partial<Record<LoginMethods, string>>;
1162
- };
1163
- escCloseable?: boolean;
1164
- autoRegister?: boolean;
1165
- clickCloseable?: boolean;
1166
- disableResetPwd?: boolean;
1167
- disableRegister?: boolean;
1168
- defaultScenes?: GuardScenes;
1169
- loginMethods?: LoginMethods[];
1170
- target?: string | HTMLElement;
1171
- enterpriseConnections?: string[];
1172
- defaultLoginMethod?: LoginMethods;
1173
- registerMethods?: RegisterMethods[];
1174
- socialConnections?: (SocialConnections | SocialConnectionProvider)[];
1175
- defaultRegisterMethod?: RegisterMethods;
1176
- qrCodeScanOptions?: Parameters<QrCodeAuthenticationClient['startScanning']>[1];
1177
- /**
1178
- * 国际化处理
1179
- */
1180
- localesConfig?: LocalesConfig;
1181
- lang?: Lang;
1182
- /**
1183
- * 用于去品牌化
1184
- */
1185
- headers?: AuthenticationClientOptions['headers'];
1186
- passwordLoginMethods?: PasswordLoginMethods[];
1187
- }
1188
- export interface GuardConfig extends UserConfig {
1189
- socialConnectionObjs: SocialConnectionItem[];
1190
- enterpriseConnectionObjs: EnterpriseConnectionItem[];
1191
- extendsFields: ApplicationConfig['extendsFields'];
1192
- publicKey: ApplicationConfig['publicKey'];
1193
- agreementEnabled: boolean;
1194
- agreements: Agreement[];
1195
- cdnBase: string;
1196
- }
1197
- export interface LocalesConfig {
1198
- defaultLang?: Lang;
1199
- isShowChange?: boolean;
1200
- onChange?: (lang: Lang) => void;
1201
- }
1202
-
1203
- }
1204
- declare module '@authing/react-ui-components/components/AuthingGuard/types/GuardState' {
1205
- import { LoginMethods, RegisterMethods } from '@authing/react-ui-components/components/AuthingGuard/types/GuardConfig';
1206
- import { GuardScenes } from '@authing/react-ui-components/components/AuthingGuard/types/GuardConfig';
1207
- export interface ActiveTabs {
1208
- [GuardScenes.Login]: LoginMethods;
1209
- [GuardScenes.Register]: RegisterMethods;
1210
- }
1211
-
1212
- }
1213
- declare module '@authing/react-ui-components/components/AuthingGuard/types/Locales' {
1214
- export type Lang = 'zh-CN' | 'en-US';
1215
- export const LANG_MAP: {
1216
- label: string;
1217
- value: string;
1218
- }[];
1219
-
1220
- }
1221
- declare module '@authing/react-ui-components/components/AuthingGuard/types/index' {
1222
- export * from '@authing/react-ui-components/components/AuthingGuard/types/Forms';
1223
- export * from '@authing/react-ui-components/components/AuthingGuard/types/GuardState';
1224
- export * from '@authing/react-ui-components/components/AuthingGuard/types/GuardConfig';
1225
- export * from '@authing/react-ui-components/components/AuthingGuard/types/Locales';
1226
-
1227
- }
1228
- declare module '@authing/react-ui-components/components/index' {
1229
- import { AuthingGuard } from '@authing/react-ui-components/components/AuthingGuard/index';
1230
- export * from '@authing/react-ui-components/components/AuthingGuard/types/index';
1231
- export * from '@authing/react-ui-components/components/AuthingGuard/hooks/index';
1232
- export type { AuthenticationClientOptions } from 'authing-js-sdk';
1233
- export { AuthingGuard };
1234
-
1235
- }
1236
- declare module '@authing/react-ui-components/context/base' {
1237
- import React from 'react';
1238
- export function createBaseContext<C>(): readonly [React.Context<C | undefined>, () => C];
1239
- export interface IBaseAction<ActionType = string> {
1240
- type: ActionType & string;
1241
- payload?: any;
1242
- [key: string]: string;
1243
- }
1244
- export interface IBaseContext<S> {
1245
- state: S;
1246
- [k: string]: any;
1247
- }
1248
- export type BaseContextComponent<Props> = React.PropsWithChildren<Props>;
1249
-
1250
- }
1251
- declare module '@authing/react-ui-components/context/global/context' {
1252
- /// <reference types="react" />
1253
- import { IBaseContext, BaseContextComponent } from '@authing/react-ui-components/context/base';
1254
- import { IState } from '@authing/react-ui-components/context/global/reducer';
1255
- export interface IGuardContext extends IBaseContext<IState> {
1256
- dispatch: Function;
1257
- getValue: (key: keyof IState) => any;
1258
- setValue: (key: keyof IState, value: any) => void;
1259
- }
1260
- export function useGuardContext(): IGuardContext;
1261
- export function GuardContext({ children, value, }: BaseContextComponent<Record<string, any>>): JSX.Element;
1262
-
1263
- }
1264
- declare module '@authing/react-ui-components/context/global/reducer' {
1265
- import { GuardConfig, ActiveTabs, GuardScenes, UserConfig, GuardEventsHandler, LocalesConfig, Lang } from '@authing/react-ui-components/components/AuthingGuard/types/index';
1266
- import { AuthenticationClient } from 'authing-js-sdk';
1267
- import { IBaseAction } from '@authing/react-ui-components/context/base';
1268
- import { ApplicationMfaType } from '@authing/react-ui-components/components/AuthingGuard/api/appConfig';
1269
- export type IState = {
1270
- config: GuardConfig;
1271
- userConfig: UserConfig;
1272
- authClient: AuthenticationClient;
1273
- activeTabs: ActiveTabs;
1274
- guardScenes: GuardScenes;
1275
- guardTitle: string;
1276
- mfaData: {
1277
- mfaToken: string;
1278
- phone?: string;
1279
- email?: string;
1280
- applicationMfa?: {
1281
- status: 0 | 1;
1282
- mfaPolicy: ApplicationMfaType;
1283
- sort: number;
1284
- }[];
1285
- totpMfaEnabled: boolean;
1286
- };
1287
- userPoolId: string;
1288
- appId: string;
1289
- guardEvents: GuardEventsHandler;
1290
- localesConfig: LocalesConfig;
1291
- lang?: Lang;
1292
- realHost: string;
1293
- guardSize: 'large' | 'middle' | 'small';
1294
- showHeader: boolean;
1295
- showBottom: boolean;
1296
- };
1297
- export const reducer: (state: IState, { type, ...payloads }: IBaseAction) => any;
1298
-
1299
- }
1300
- declare module '@authing/react-ui-components/index' {
1301
- export {};
1302
-
1303
- }
1304
- declare module '@authing/react-ui-components/reportWebVitals' {
1305
- import { ReportHandler } from 'web-vitals';
1306
- const reportWebVitals: (onPerfEntry?: ReportHandler | undefined) => void;
1307
- export default reportWebVitals;
1308
-
1309
- }
1310
- declare module '@authing/react-ui-components/setupTests' {
1311
- import '@testing-library/jest-dom';
1312
-
1313
- }
1314
- declare module '@authing/react-ui-components/utils/clipboard' {
1315
- export const copyToClipboard: (str: string) => void;
1316
-
1317
- }
1318
- declare module '@authing/react-ui-components/utils/index' {
1319
- import { Rule } from 'antd/lib/form';
1320
- import qs from 'qs';
1321
- export * from '@authing/react-ui-components/utils/popupCenter';
1322
- export * from '@authing/react-ui-components/utils/clipboard';
1323
- export const VALIDATE_PATTERN: {
1324
- readonly email: RegExp;
1325
- readonly phone: RegExp;
1326
- readonly ip: RegExp;
1327
- readonly host: RegExp;
1328
- };
1329
- export const validate: (type: keyof typeof VALIDATE_PATTERN, val: string) => boolean;
1330
- export const getRequiredRules: (msg: string) => Rule[];
1331
- export function getDeviceName(): string | null;
1332
- export type STYLE_RECORD_KEY = 'appConfig' | 'userConfig';
1333
- export const insertStyles: (styles: string | any, recordKey: STYLE_RECORD_KEY) => void;
1334
- export const removeStyles: (recordKey: STYLE_RECORD_KEY) => void;
1335
- export const useTitle: (title: string, prefix?: string | undefined) => void;
1336
- export const getClassnames: (classnames: (string | boolean | undefined)[]) => string;
1337
- /**
1338
- * https://www.itranslater.com/qa/details/2115518846294557696
1339
- * Simple object check.
1340
- * @param item
1341
- * @returns {boolean}
1342
- */
1343
- export function isObject(item: any): any;
1344
- /**
1345
- * https://www.itranslater.com/qa/details/2115518846294557696
1346
- * Deep merge two objects.
1347
- * @param target
1348
- * @param ...sources
1349
- */
1350
- export function deepMerge<T extends any = any>(target: T, ...sources: any[]): T;
1351
- export const getUserRegisterParams: () => {
1352
- key: string;
1353
- value: string | string[] | qs.ParsedQs | qs.ParsedQs[] | undefined;
1354
- }[];
1355
- export const isWechatBrowser: () => boolean;
1356
- export const getOS: () => string | null;
1357
-
1358
- }
1359
- declare module '@authing/react-ui-components/utils/popupCenter' {
1360
- /**
1361
- * 在屏幕中心弹出新窗口加载 url
1362
- * @param url
1363
- * @param param1
1364
- */
1365
- export const popupCenter: (url: string, { w, h }?: {
1366
- w: number;
1367
- h: number;
1368
- }) => void;
1369
-
1370
- }
1371
- declare module '@authing/react-ui-components' {
1372
- import main = require('@authing/react-ui-components/components/index');
1373
- export = main;
1374
- }