@aws-amplify/ui 3.13.1 → 3.13.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/esm/helpers/authenticator/facade.js +1 -1
- package/dist/esm/helpers/authenticator/utils.js +1 -1
- package/dist/esm/index.js +1 -1
- package/dist/esm/machines/authenticator/actors/resetPassword.js +1 -1
- package/dist/esm/machines/authenticator/actors/signIn.js +1 -1
- package/dist/esm/machines/authenticator/actors/signOut.js +1 -1
- package/dist/esm/machines/authenticator/index.js +1 -1
- package/dist/esm/machines/authenticator/signUp.js +1 -1
- package/dist/esm/types/authenticator/user.js +1 -1
- package/dist/index.js +1 -1
- package/dist/styles.css +1 -1
- package/dist/theme.css +1 -1
- package/dist/types/helpers/authenticator/facade.d.ts +25 -50
- package/dist/types/helpers/authenticator/utils.d.ts +1 -0
- package/dist/types/machines/authenticator/defaultServices.d.ts +2 -2
- package/dist/types/types/authenticator/stateMachine/context.d.ts +4 -4
- package/dist/types/types/authenticator/user.d.ts +3 -9
- package/dist/types/types/authenticator/validator.d.ts +0 -2
- package/package.json +2 -2
package/dist/styles.css
CHANGED
package/dist/theme.css
CHANGED
|
@@ -4,7 +4,24 @@
|
|
|
4
4
|
* `useAuthenticator` hook/composable/service.
|
|
5
5
|
*/
|
|
6
6
|
import { Sender } from 'xstate';
|
|
7
|
-
import { AuthEvent, AuthEventData, AuthMachineState } from '../../types';
|
|
7
|
+
import { AuthEvent, AuthEventData, AuthMachineState, CodeDeliveryDetails, CognitoUserAmplify, ValidationError } from '../../types';
|
|
8
|
+
declare type AuthenticatorRoute = 'authenticated' | 'autoSignIn' | 'confirmResetPassword' | 'confirmSignIn' | 'confirmSignUp' | 'confirmVerifyUser' | 'forceNewPassword' | 'idle' | 'resetPassword' | 'setup' | 'signOut' | 'setupTOTP' | 'signIn' | 'signUp' | 'verifyUser';
|
|
9
|
+
declare type AuthenticatorValidationErrors = ValidationError;
|
|
10
|
+
declare type AuthStatus = 'configuring' | 'authenticated' | 'unauthenticated';
|
|
11
|
+
interface AuthenticatorServiceContextFacade {
|
|
12
|
+
authStatus: AuthStatus;
|
|
13
|
+
codeDeliveryDetails: CodeDeliveryDetails;
|
|
14
|
+
error: string;
|
|
15
|
+
hasValidationErrors: boolean;
|
|
16
|
+
isPending: boolean;
|
|
17
|
+
route: AuthenticatorRoute;
|
|
18
|
+
user: CognitoUserAmplify;
|
|
19
|
+
validationErrors: AuthenticatorValidationErrors;
|
|
20
|
+
}
|
|
21
|
+
declare type SendEventAlias = 'resendCode' | 'signOut' | 'submitForm' | 'updateForm' | 'updateBlur' | 'toFederatedSignIn' | 'toResetPassword' | 'toSignIn' | 'toSignUp' | 'skipVerification';
|
|
22
|
+
declare type AuthenticatorSendEventAliases = Record<SendEventAlias, (data?: AuthEventData) => void>;
|
|
23
|
+
export interface AuthenticatorServiceFacade extends AuthenticatorSendEventAliases, AuthenticatorServiceContextFacade {
|
|
24
|
+
}
|
|
8
25
|
/**
|
|
9
26
|
* Creates public facing auth helpers that abstracts out xstate implementation
|
|
10
27
|
* detail. Each framework implementation can export these helpers so that
|
|
@@ -16,52 +33,10 @@ import { AuthEvent, AuthEventData, AuthMachineState } from '../../types';
|
|
|
16
33
|
* submit({ username, password})
|
|
17
34
|
* ```
|
|
18
35
|
*/
|
|
19
|
-
export declare const getSendEventAliases: (send: Sender<AuthEvent>) =>
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
readonly toResetPassword: (data?: AuthEventData) => void;
|
|
27
|
-
readonly toSignIn: (data?: AuthEventData) => void;
|
|
28
|
-
readonly toSignUp: (data?: AuthEventData) => void;
|
|
29
|
-
readonly skipVerification: (data?: AuthEventData) => void;
|
|
30
|
-
};
|
|
31
|
-
export declare const getServiceContextFacade: (state: AuthMachineState) => {
|
|
32
|
-
error: string;
|
|
33
|
-
hasValidationErrors: boolean;
|
|
34
|
-
isPending: boolean;
|
|
35
|
-
route: string;
|
|
36
|
-
authStatus: string;
|
|
37
|
-
user: import("../../types").CognitoUserAmplify;
|
|
38
|
-
validationErrors: {
|
|
39
|
-
[x: string]: string | string[];
|
|
40
|
-
};
|
|
41
|
-
codeDeliveryDetails: import("../../types").CodeDeliveryDetails;
|
|
42
|
-
};
|
|
43
|
-
export declare const getServiceFacade: ({ send, state }: {
|
|
44
|
-
send: any;
|
|
45
|
-
state: any;
|
|
46
|
-
}) => {
|
|
47
|
-
error: string;
|
|
48
|
-
hasValidationErrors: boolean;
|
|
49
|
-
isPending: boolean;
|
|
50
|
-
route: string;
|
|
51
|
-
authStatus: string;
|
|
52
|
-
user: import("../../types").CognitoUserAmplify;
|
|
53
|
-
validationErrors: {
|
|
54
|
-
[x: string]: string | string[];
|
|
55
|
-
};
|
|
56
|
-
codeDeliveryDetails: import("../../types").CodeDeliveryDetails;
|
|
57
|
-
resendCode: (data?: AuthEventData) => void;
|
|
58
|
-
signOut: (data?: AuthEventData) => void;
|
|
59
|
-
submitForm: (data?: AuthEventData) => void;
|
|
60
|
-
updateForm: (data?: AuthEventData) => void;
|
|
61
|
-
updateBlur: (data?: AuthEventData) => void;
|
|
62
|
-
toFederatedSignIn: (data?: AuthEventData) => void;
|
|
63
|
-
toResetPassword: (data?: AuthEventData) => void;
|
|
64
|
-
toSignIn: (data?: AuthEventData) => void;
|
|
65
|
-
toSignUp: (data?: AuthEventData) => void;
|
|
66
|
-
skipVerification: (data?: AuthEventData) => void;
|
|
67
|
-
};
|
|
36
|
+
export declare const getSendEventAliases: (send: Sender<AuthEvent>) => AuthenticatorSendEventAliases;
|
|
37
|
+
export declare const getServiceContextFacade: (state: AuthMachineState) => AuthenticatorServiceContextFacade;
|
|
38
|
+
export declare const getServiceFacade: ({ send, state, }: {
|
|
39
|
+
send: Sender<AuthEvent>;
|
|
40
|
+
state: AuthMachineState;
|
|
41
|
+
}) => AuthenticatorServiceFacade;
|
|
42
|
+
export {};
|
|
@@ -16,3 +16,4 @@ export declare const defaultAuthHubHandler: HubHandler;
|
|
|
16
16
|
*/
|
|
17
17
|
export declare const listenToAuthHub: (service: AuthInterpreter, handler?: HubHandler) => () => void;
|
|
18
18
|
export declare const hasSpecialChars: (password: string) => boolean;
|
|
19
|
+
export declare const getTotpCode: (issuer: string, username: string, secret: string) => string;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { AuthChallengeName, PasswordSettings, SignInResult, ValidatorResult } from '../../types';
|
|
2
2
|
export declare const defaultServices: {
|
|
3
3
|
getAmplifyConfig(): Promise<{}>;
|
|
4
4
|
getCurrentUser(): Promise<any>;
|
|
@@ -10,7 +10,7 @@ export declare const defaultServices: {
|
|
|
10
10
|
handleConfirmSignIn({ user, code, mfaType, }: {
|
|
11
11
|
user: any;
|
|
12
12
|
code: string;
|
|
13
|
-
mfaType:
|
|
13
|
+
mfaType: AuthChallengeName;
|
|
14
14
|
}): Promise<any>;
|
|
15
15
|
handleConfirmSignUp({ username, code, }: {
|
|
16
16
|
username: string;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ValidationError } from '../validator';
|
|
2
2
|
import { AuthFormData, AuthFormFields } from '../form';
|
|
3
|
-
import {
|
|
3
|
+
import { AuthChallengeName, CognitoUserAmplify } from '../user';
|
|
4
4
|
import { CodeDeliveryDetails as CognitoCodeDeliveryDetails } from 'amazon-cognito-identity-js';
|
|
5
5
|
import { LoginMechanism, SignUpAttribute, SocialProvider } from '../attributes';
|
|
6
6
|
import { defaultServices } from '../../../machines/authenticator/defaultServices';
|
|
@@ -35,7 +35,7 @@ export interface AuthContext {
|
|
|
35
35
|
username?: string;
|
|
36
36
|
password?: string;
|
|
37
37
|
code?: string;
|
|
38
|
-
mfaType?:
|
|
38
|
+
mfaType?: 'SMS_MFA' | 'SOFTWARE_TOKEN_MFA';
|
|
39
39
|
actorDoneData?: Omit<ActorDoneData, 'user'>;
|
|
40
40
|
hasSetup?: boolean;
|
|
41
41
|
}
|
|
@@ -48,7 +48,7 @@ interface BaseFormContext {
|
|
|
48
48
|
/** Any user attributes set that needs to persist between states */
|
|
49
49
|
authAttributes?: Record<string, any>;
|
|
50
50
|
/** Current challengeName issued by Cognnito */
|
|
51
|
-
challengeName?:
|
|
51
|
+
challengeName?: AuthChallengeName;
|
|
52
52
|
/** Required attributes for form submission */
|
|
53
53
|
requiredAttributes?: Array<string>;
|
|
54
54
|
/** Maps each input name to tis value */
|
|
@@ -91,7 +91,7 @@ export interface ResetPasswordContext extends BaseFormContext {
|
|
|
91
91
|
}
|
|
92
92
|
export interface SignOutContext {
|
|
93
93
|
authAttributes?: Record<string, any>;
|
|
94
|
-
challengeName?:
|
|
94
|
+
challengeName?: AuthChallengeName;
|
|
95
95
|
unverifiedAttributes?: Record<string, string>;
|
|
96
96
|
user?: CognitoUserAmplify;
|
|
97
97
|
formFields?: AuthFormFields;
|
|
@@ -1,12 +1,6 @@
|
|
|
1
|
-
import { CognitoUser } from 'amazon-cognito-identity-js';
|
|
2
|
-
/**
|
|
3
|
-
export declare
|
|
4
|
-
SMS_MFA = "SMS_MFA",
|
|
5
|
-
SOFTWARE_TOKEN_MFA = "SOFTWARE_TOKEN_MFA",
|
|
6
|
-
NEW_PASSWORD_REQUIRED = "NEW_PASSWORD_REQUIRED",
|
|
7
|
-
RESET_REQUIRED = "RESET_REQUIRED",
|
|
8
|
-
MFA_SETUP = "MFA_SETUP"
|
|
9
|
-
}
|
|
1
|
+
import { ChallengeName, CognitoUser } from 'amazon-cognito-identity-js';
|
|
2
|
+
/** Known challenge names */
|
|
3
|
+
export declare type AuthChallengeName = ChallengeName;
|
|
10
4
|
/** Contact destinations that we can send user confirmation code to */
|
|
11
5
|
export declare type ContactMethod = 'Email' | 'Phone Number';
|
|
12
6
|
/** Federated IDPs that Authenticator supports */
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { PasswordSettings } from '.';
|
|
2
2
|
import { AuthFormData } from './form';
|
|
3
|
-
import { AuthChallengeNames } from './user';
|
|
4
3
|
/**
|
|
5
4
|
* Maps each input to its validation error, if any
|
|
6
5
|
*/
|
|
@@ -14,4 +13,3 @@ export declare type SignInResult = string;
|
|
|
14
13
|
* Validates the given formData. This can be synchronous or asynchronous.
|
|
15
14
|
*/
|
|
16
15
|
export declare type Validator = (formData: AuthFormData, touchData?: AuthFormData, passwordSettings?: PasswordSettings) => ValidatorResult | Promise<ValidatorResult>;
|
|
17
|
-
export declare type SignInTypes = (user: string, code: string, mfaType: AuthChallengeNames.SMS_MFA | AuthChallengeNames.SOFTWARE_TOKEN_MFA) => SignInResult | Promise<SignInResult>;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aws-amplify/ui",
|
|
3
|
-
"version": "3.13.
|
|
3
|
+
"version": "3.13.3",
|
|
4
4
|
"main": "dist/index.js",
|
|
5
5
|
"module": "dist/esm/index.js",
|
|
6
6
|
"exports": {
|
|
@@ -42,7 +42,7 @@
|
|
|
42
42
|
"dependencies": {
|
|
43
43
|
"lodash": "4.17.21",
|
|
44
44
|
"style-dictionary": "3.7.0",
|
|
45
|
-
"xstate": "^4.33.
|
|
45
|
+
"xstate": "^4.33.6",
|
|
46
46
|
"tslib": "2.4.0"
|
|
47
47
|
},
|
|
48
48
|
"devDependencies": {
|