@aws-amplify/auth 4.6.2-next.13 → 4.6.2-next.32

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 (46) hide show
  1. package/CHANGELOG.md +43 -0
  2. package/lib/.tsbuildinfo +3 -0
  3. package/lib/Auth.js +65 -129
  4. package/lib/Auth.js.map +1 -1
  5. package/lib/Errors.js +3 -15
  6. package/lib/Errors.js.map +1 -1
  7. package/lib/OAuth/OAuth.js +34 -106
  8. package/lib/OAuth/OAuth.js.map +1 -1
  9. package/lib/types/index.js +2 -4
  10. package/lib/types/index.js.map +1 -1
  11. package/lib/urlListener.native.js +7 -64
  12. package/lib/urlListener.native.js.map +1 -1
  13. package/lib-esm/.tsbuildinfo +3 -0
  14. package/lib-esm/Auth.d.ts +2 -1
  15. package/lib-esm/Auth.js +5 -66
  16. package/lib-esm/Auth.js.map +1 -1
  17. package/lib-esm/Errors.js +1 -13
  18. package/lib-esm/Errors.js.map +1 -1
  19. package/lib-esm/OAuth/OAuth.js +11 -73
  20. package/lib-esm/OAuth/OAuth.js.map +1 -1
  21. package/lib-esm/urlListener.native.js +1 -58
  22. package/lib-esm/urlListener.native.js.map +1 -1
  23. package/package.json +12 -6
  24. package/src/Auth.ts +4 -3
  25. package/src/OAuth/OAuth.ts +25 -25
  26. package/build.js +0 -5
  27. package/dist/aws-amplify-auth.js +0 -16358
  28. package/dist/aws-amplify-auth.js.map +0 -1
  29. package/dist/aws-amplify-auth.min.js +0 -44
  30. package/dist/aws-amplify-auth.min.js.map +0 -1
  31. package/index.js +0 -7
  32. package/lib/Auth.d.ts +0 -300
  33. package/lib/Errors.d.ts +0 -9
  34. package/lib/OAuth/OAuth.d.ts +0 -29
  35. package/lib/OAuth/oauthStorage.d.ts +0 -5
  36. package/lib/OAuth/oauthStorage.native.d.ts +0 -5
  37. package/lib/OAuth/urlOpener.d.ts +0 -1
  38. package/lib/OAuth/urlOpener.native.d.ts +0 -1
  39. package/lib/common/AuthErrorStrings.d.ts +0 -17
  40. package/lib/index.d.ts +0 -9
  41. package/lib/types/Auth.d.ts +0 -170
  42. package/lib/types/index.d.ts +0 -1
  43. package/lib/urlListener.d.ts +0 -2
  44. package/lib/urlListener.native.d.ts +0 -2
  45. package/testSequencer.js +0 -24
  46. package/webpack.config.dev.js +0 -6
package/index.js DELETED
@@ -1,7 +0,0 @@
1
- 'use strict';
2
-
3
- if (process.env.NODE_ENV === 'production') {
4
- module.exports = require('./dist/aws-amplify-auth.min.js');
5
- } else {
6
- module.exports = require('./dist/aws-amplify-auth.js');
7
- }
package/lib/Auth.d.ts DELETED
@@ -1,300 +0,0 @@
1
- import { AuthOptions, FederatedResponse, SignUpParams, FederatedUser, ConfirmSignUpOptions, SignOutOpts, CurrentUserOpts, GetPreferredMFAOpts, SignInOpts, FederatedSignInOptionsCustom, LegacyProvider, FederatedSignInOptions, ClientMetaData } from './types';
2
- import { ICredentials } from '@aws-amplify/core';
3
- import { ISignUpResult, CognitoUser, MFAOption, CognitoUserSession, CognitoUserAttribute, NodeCallback } from 'amazon-cognito-identity-js';
4
- import { AuthError } from './Errors';
5
- import { IAuthDevice } from './types/Auth';
6
- /**
7
- * Provide authentication steps
8
- */
9
- export declare class AuthClass {
10
- private _config;
11
- private userPool;
12
- private user;
13
- private _oAuthHandler;
14
- private _storage;
15
- private _storageSync;
16
- private oAuthFlowInProgress;
17
- private pendingSignIn;
18
- private autoSignInInitiated;
19
- Credentials: import("@aws-amplify/core").CredentialsClass;
20
- /**
21
- * Initialize Auth with AWS configurations
22
- * @param {Object} config - Configuration of the Auth
23
- */
24
- constructor(config: AuthOptions);
25
- getModuleName(): string;
26
- configure(config?: any): AuthOptions;
27
- wrapRefreshSessionCallback: (callback: NodeCallback<Error, any>) => NodeCallback<Error, any>;
28
- /**
29
- * Sign up with username, password and other attributes like phone, email
30
- * @param {String | object} params - The user attributes used for signin
31
- * @param {String[]} restOfAttrs - for the backward compatability
32
- * @return - A promise resolves callback data if success
33
- */
34
- signUp(params: string | SignUpParams, ...restOfAttrs: string[]): Promise<ISignUpResult>;
35
- private handleAutoSignIn;
36
- private handleCodeAutoSignIn;
37
- private handleLinkAutoSignIn;
38
- private signInAfterUserConfirmed;
39
- /**
40
- * Send the verification code to confirm sign up
41
- * @param {String} username - The username to be confirmed
42
- * @param {String} code - The verification code
43
- * @param {ConfirmSignUpOptions} options - other options for confirm signup
44
- * @return - A promise resolves callback data if success
45
- */
46
- confirmSignUp(username: string, code: string, options?: ConfirmSignUpOptions): Promise<any>;
47
- private isTrueStorageValue;
48
- /**
49
- * Resend the verification code
50
- * @param {String} username - The username to be confirmed
51
- * @param {ClientMetadata} clientMetadata - Metadata to be passed to Cognito Lambda triggers
52
- * @return - A promise resolves code delivery details if successful
53
- */
54
- resendSignUp(username: string, clientMetadata?: ClientMetaData): Promise<any>;
55
- /**
56
- * Sign in
57
- * @param {String | SignInOpts} usernameOrSignInOpts - The username to be signed in or the sign in options
58
- * @param {String} password - The password of the username
59
- * @return - A promise resolves the CognitoUser
60
- */
61
- signIn(usernameOrSignInOpts: string | SignInOpts, pw?: string, clientMetadata?: ClientMetaData): Promise<CognitoUser | any>;
62
- /**
63
- * Return an object with the authentication callbacks
64
- * @param {CognitoUser} user - the cognito user object
65
- * @param {} resolve - function called when resolving the current step
66
- * @param {} reject - function called when rejecting the current step
67
- * @return - an object with the callback methods for user authentication
68
- */
69
- private authCallbacks;
70
- /**
71
- * Sign in with a password
72
- * @private
73
- * @param {AuthenticationDetails} authDetails - the user sign in data
74
- * @return - A promise resolves the CognitoUser object if success or mfa required
75
- */
76
- private signInWithPassword;
77
- /**
78
- * Sign in without a password
79
- * @private
80
- * @param {AuthenticationDetails} authDetails - the user sign in data
81
- * @return - A promise resolves the CognitoUser object if success or mfa required
82
- */
83
- private signInWithoutPassword;
84
- /**
85
- * This was previously used by an authenticated user to get MFAOptions,
86
- * but no longer returns a meaningful response. Refer to the documentation for
87
- * how to setup and use MFA: https://docs.amplify.aws/lib/auth/mfa/q/platform/js
88
- * @deprecated
89
- * @param {CognitoUser} user - the current user
90
- * @return - A promise resolves the current preferred mfa option if success
91
- */
92
- getMFAOptions(user: CognitoUser | any): Promise<MFAOption[]>;
93
- /**
94
- * get preferred mfa method
95
- * @param {CognitoUser} user - the current cognito user
96
- * @param {GetPreferredMFAOpts} params - options for getting the current user preferred MFA
97
- */
98
- getPreferredMFA(user: CognitoUser | any, params?: GetPreferredMFAOpts): Promise<string>;
99
- private _getMfaTypeFromUserData;
100
- private _getUserData;
101
- /**
102
- * set preferred MFA method
103
- * @param {CognitoUser} user - the current Cognito user
104
- * @param {string} mfaMethod - preferred mfa method
105
- * @return - A promise resolve if success
106
- */
107
- setPreferredMFA(user: CognitoUser | any, mfaMethod: 'TOTP' | 'SMS' | 'NOMFA' | 'SMS_MFA' | 'SOFTWARE_TOKEN_MFA'): Promise<string>;
108
- /**
109
- * disable SMS
110
- * @deprecated
111
- * @param {CognitoUser} user - the current user
112
- * @return - A promise resolves is success
113
- */
114
- disableSMS(user: CognitoUser): Promise<string>;
115
- /**
116
- * enable SMS
117
- * @deprecated
118
- * @param {CognitoUser} user - the current user
119
- * @return - A promise resolves is success
120
- */
121
- enableSMS(user: CognitoUser): Promise<string>;
122
- /**
123
- * Setup TOTP
124
- * @param {CognitoUser} user - the current user
125
- * @return - A promise resolves with the secret code if success
126
- */
127
- setupTOTP(user: CognitoUser | any): Promise<string>;
128
- /**
129
- * verify TOTP setup
130
- * @param {CognitoUser} user - the current user
131
- * @param {string} challengeAnswer - challenge answer
132
- * @return - A promise resolves is success
133
- */
134
- verifyTotpToken(user: CognitoUser | any, challengeAnswer: string): Promise<CognitoUserSession>;
135
- /**
136
- * Send MFA code to confirm sign in
137
- * @param {Object} user - The CognitoUser object
138
- * @param {String} code - The confirmation code
139
- */
140
- confirmSignIn(user: CognitoUser | any, code: string, mfaType?: 'SMS_MFA' | 'SOFTWARE_TOKEN_MFA' | null, clientMetadata?: ClientMetaData): Promise<CognitoUser | any>;
141
- completeNewPassword(user: CognitoUser | any, password: string, requiredAttributes?: any, clientMetadata?: ClientMetaData): Promise<CognitoUser | any>;
142
- /**
143
- * Send the answer to a custom challenge
144
- * @param {CognitoUser} user - The CognitoUser object
145
- * @param {String} challengeResponses - The confirmation code
146
- */
147
- sendCustomChallengeAnswer(user: CognitoUser | any, challengeResponses: string, clientMetadata?: ClientMetaData): Promise<CognitoUser | any>;
148
- /**
149
- * Delete an authenticated users' attributes
150
- * @param {CognitoUser} - The currently logged in user object
151
- * @return {Promise}
152
- **/
153
- deleteUserAttributes(user: CognitoUser | any, attributeNames: string[]): Promise<unknown>;
154
- /**
155
- * Delete the current authenticated user
156
- * @return {Promise}
157
- **/
158
- deleteUser(): Promise<string | void>;
159
- /**
160
- * Update an authenticated users' attributes
161
- * @param {CognitoUser} - The currently logged in user object
162
- * @return {Promise}
163
- **/
164
- updateUserAttributes(user: CognitoUser | any, attributes: object, clientMetadata?: ClientMetaData): Promise<string>;
165
- /**
166
- * Return user attributes
167
- * @param {Object} user - The CognitoUser object
168
- * @return - A promise resolves to user attributes if success
169
- */
170
- userAttributes(user: CognitoUser | any): Promise<CognitoUserAttribute[]>;
171
- verifiedContact(user: CognitoUser | any): Promise<{
172
- verified: {};
173
- unverified: {};
174
- }>;
175
- private isErrorWithMessage;
176
- private isTokenRevokedError;
177
- private isRefreshTokenRevokedError;
178
- private isUserDisabledError;
179
- private isUserDoesNotExistError;
180
- private isRefreshTokenExpiredError;
181
- private isSignedInHostedUI;
182
- private isSessionInvalid;
183
- private cleanUpInvalidSession;
184
- /**
185
- * Get current authenticated user
186
- * @return - A promise resolves to current authenticated CognitoUser if success
187
- */
188
- currentUserPoolUser(params?: CurrentUserOpts): Promise<CognitoUser | any>;
189
- private isOAuthInProgress;
190
- /**
191
- * Get current authenticated user
192
- * @param {CurrentUserOpts} - options for getting the current user
193
- * @return - A promise resolves to current authenticated CognitoUser if success
194
- */
195
- currentAuthenticatedUser(params?: CurrentUserOpts): Promise<CognitoUser | any>;
196
- /**
197
- * Get current user's session
198
- * @return - A promise resolves to session object if success
199
- */
200
- currentSession(): Promise<CognitoUserSession>;
201
- /**
202
- * Get the corresponding user session
203
- * @param {Object} user - The CognitoUser object
204
- * @return - A promise resolves to the session
205
- */
206
- userSession(user: any): Promise<CognitoUserSession>;
207
- /**
208
- * Get authenticated credentials of current user.
209
- * @return - A promise resolves to be current user's credentials
210
- */
211
- currentUserCredentials(): Promise<ICredentials>;
212
- currentCredentials(): Promise<ICredentials>;
213
- /**
214
- * Initiate an attribute confirmation request
215
- * @param {Object} user - The CognitoUser
216
- * @param {Object} attr - The attributes to be verified
217
- * @return - A promise resolves to callback data if success
218
- */
219
- verifyUserAttribute(user: CognitoUser | any, attr: string, clientMetadata?: ClientMetaData): Promise<void>;
220
- /**
221
- * Confirm an attribute using a confirmation code
222
- * @param {Object} user - The CognitoUser
223
- * @param {Object} attr - The attribute to be verified
224
- * @param {String} code - The confirmation code
225
- * @return - A promise resolves to callback data if success
226
- */
227
- verifyUserAttributeSubmit(user: CognitoUser | any, attr: string, code: string): Promise<string>;
228
- verifyCurrentUserAttribute(attr: string): Promise<void>;
229
- /**
230
- * Confirm current user's attribute using a confirmation code
231
- * @param {Object} attr - The attribute to be verified
232
- * @param {String} code - The confirmation code
233
- * @return - A promise resolves to callback data if success
234
- */
235
- verifyCurrentUserAttributeSubmit(attr: string, code: string): Promise<string>;
236
- private cognitoIdentitySignOut;
237
- private oAuthSignOutRedirect;
238
- private oAuthSignOutAndResolve;
239
- private oAuthSignOutRedirectOrReject;
240
- /**
241
- * Sign out method
242
- * @
243
- * @return - A promise resolved if success
244
- */
245
- signOut(opts?: SignOutOpts): Promise<any>;
246
- private cleanCachedItems;
247
- /**
248
- * Change a password for an authenticated user
249
- * @param {Object} user - The CognitoUser object
250
- * @param {String} oldPassword - the current password
251
- * @param {String} newPassword - the requested new password
252
- * @return - A promise resolves if success
253
- */
254
- changePassword(user: CognitoUser | any, oldPassword: string, newPassword: string, clientMetadata?: ClientMetaData): Promise<'SUCCESS'>;
255
- /**
256
- * Initiate a forgot password request
257
- * @param {String} username - the username to change password
258
- * @return - A promise resolves if success
259
- */
260
- forgotPassword(username: string, clientMetadata?: ClientMetaData): Promise<any>;
261
- /**
262
- * Confirm a new password using a confirmation Code
263
- * @param {String} username - The username
264
- * @param {String} code - The confirmation code
265
- * @param {String} password - The new password
266
- * @return - A promise that resolves if success
267
- */
268
- forgotPasswordSubmit(username: string, code: string, password: string, clientMetadata?: ClientMetaData): Promise<string>;
269
- /**
270
- * Get user information
271
- * @async
272
- * @return {Object }- current User's information
273
- */
274
- currentUserInfo(): Promise<any>;
275
- federatedSignIn(options?: FederatedSignInOptions): Promise<ICredentials>;
276
- federatedSignIn(provider: LegacyProvider, response: FederatedResponse, user: FederatedUser): Promise<ICredentials>;
277
- federatedSignIn(options?: FederatedSignInOptionsCustom): Promise<ICredentials>;
278
- /**
279
- * Used to complete the OAuth flow with or without the Cognito Hosted UI
280
- * @param {String} URL - optional parameter for customers to pass in the response URL
281
- */
282
- private _handleAuthResponse;
283
- /**
284
- * Compact version of credentials
285
- * @param {Object} credentials
286
- * @return {Object} - Credentials
287
- */
288
- essentialCredentials(credentials: any): ICredentials;
289
- private attributesToObject;
290
- private isTruthyString;
291
- private createCognitoUser;
292
- private _isValidAuthStorage;
293
- private noUserPoolErrorHandler;
294
- private rejectAuthError;
295
- private rejectNoUserPool;
296
- rememberDevice(): Promise<string | AuthError>;
297
- forgetDevice(): Promise<void>;
298
- fetchDevices(): Promise<IAuthDevice[]>;
299
- }
300
- export declare const Auth: AuthClass;
package/lib/Errors.d.ts DELETED
@@ -1,9 +0,0 @@
1
- import { AuthErrorMessages, AuthErrorTypes } from './types';
2
- export declare class AuthError extends Error {
3
- log: string;
4
- constructor(type: AuthErrorTypes);
5
- }
6
- export declare class NoUserPoolError extends AuthError {
7
- constructor(type: AuthErrorTypes);
8
- }
9
- export declare const authErrorMessages: AuthErrorMessages;
@@ -1,29 +0,0 @@
1
- import { OAuthOpts, CognitoHostedUIIdentityProvider } from '../types/Auth';
2
- export default class OAuth {
3
- private _urlOpener;
4
- private _config;
5
- private _cognitoClientId;
6
- private _scopes;
7
- constructor({ config, cognitoClientId, scopes, }: {
8
- scopes: string[];
9
- config: OAuthOpts;
10
- cognitoClientId: string;
11
- });
12
- private isValidScopes;
13
- oauthSignIn(responseType: string, domain: string, redirectSignIn: string, clientId: string, provider?: CognitoHostedUIIdentityProvider | string, customState?: string): void;
14
- private _handleCodeFlow;
15
- private _handleImplicitFlow;
16
- handleAuthResponse(currentUrl?: string): Promise<{
17
- state: string;
18
- accessToken: any;
19
- refreshToken: any;
20
- idToken: any;
21
- }>;
22
- private _validateState;
23
- signOut(): Promise<any>;
24
- private _generateState;
25
- private _generateChallenge;
26
- private _base64URL;
27
- private _generateRandom;
28
- private _bufferToString;
29
- }
@@ -1,5 +0,0 @@
1
- export declare const setState: (state: string) => void;
2
- export declare const getState: () => string;
3
- export declare const setPKCE: (private_key: string) => void;
4
- export declare const getPKCE: () => string;
5
- export declare const clearAll: () => void;
@@ -1,5 +0,0 @@
1
- export declare const setState: (state: string) => void;
2
- export declare const getState: () => string;
3
- export declare const setPKCE: (private_key: string) => void;
4
- export declare const getPKCE: () => string;
5
- export declare const clearAll: () => void;
@@ -1 +0,0 @@
1
- export declare const launchUri: (url: string) => Promise<Window>;
@@ -1 +0,0 @@
1
- export declare const launchUri: (url: any) => any;
@@ -1,17 +0,0 @@
1
- export declare enum AuthErrorStrings {
2
- DEFAULT_MSG = "Authentication Error",
3
- EMPTY_EMAIL = "Email cannot be empty",
4
- EMPTY_PHONE = "Phone number cannot be empty",
5
- EMPTY_USERNAME = "Username cannot be empty",
6
- INVALID_USERNAME = "The username should either be a string or one of the sign in types",
7
- EMPTY_PASSWORD = "Password cannot be empty",
8
- EMPTY_CODE = "Confirmation code cannot be empty",
9
- SIGN_UP_ERROR = "Error creating account",
10
- NO_MFA = "No valid MFA method provided",
11
- INVALID_MFA = "Invalid MFA type",
12
- EMPTY_CHALLENGE = "Challenge response cannot be empty",
13
- NO_USER_SESSION = "Failed to get the session because the user is empty",
14
- NETWORK_ERROR = "Network Error",
15
- DEVICE_CONFIG = "Device tracking has not been configured in this User Pool",
16
- AUTOSIGNIN_ERROR = "Please use your credentials to sign in"
17
- }
package/lib/index.d.ts DELETED
@@ -1,9 +0,0 @@
1
- import { Auth } from './Auth';
2
- import { CognitoHostedUIIdentityProvider, SignUpParams, GRAPHQL_AUTH_MODE } from './types/Auth';
3
- import { CognitoUser, CookieStorage, appendToCognitoUserAgent } from 'amazon-cognito-identity-js';
4
- import { AuthErrorStrings } from './common/AuthErrorStrings';
5
- /**
6
- * @deprecated use named import
7
- */
8
- export default Auth;
9
- export { Auth, CognitoUser, CookieStorage, CognitoHostedUIIdentityProvider, SignUpParams, appendToCognitoUserAgent, AuthErrorStrings, GRAPHQL_AUTH_MODE, };
@@ -1,170 +0,0 @@
1
- import { ICookieStorageData, ICognitoStorage } from 'amazon-cognito-identity-js';
2
- /**
3
- * Parameters for user sign up
4
- */
5
- export interface SignUpParams {
6
- username: string;
7
- password: string;
8
- attributes?: object;
9
- validationData?: {
10
- [key: string]: any;
11
- };
12
- clientMetadata?: {
13
- [key: string]: string;
14
- };
15
- autoSignIn?: AutoSignInOptions;
16
- }
17
- export interface AuthCache {
18
- setItem(): any;
19
- getItem(): any;
20
- removeItem(): any;
21
- }
22
- /**
23
- * Auth instance options
24
- */
25
- export interface AuthOptions {
26
- userPoolId?: string;
27
- userPoolWebClientId?: string;
28
- identityPoolId?: string;
29
- region?: string;
30
- mandatorySignIn?: boolean;
31
- cookieStorage?: ICookieStorageData;
32
- oauth?: OAuthOpts;
33
- refreshHandlers?: object;
34
- storage?: ICognitoStorage;
35
- authenticationFlowType?: string;
36
- identityPoolRegion?: string;
37
- clientMetadata?: any;
38
- endpoint?: string;
39
- signUpVerificationMethod?: 'code' | 'link';
40
- }
41
- export declare enum CognitoHostedUIIdentityProvider {
42
- Cognito = "COGNITO",
43
- Google = "Google",
44
- Facebook = "Facebook",
45
- Amazon = "LoginWithAmazon",
46
- Apple = "SignInWithApple"
47
- }
48
- export declare type LegacyProvider = 'google' | 'facebook' | 'amazon' | 'developer' | string;
49
- export declare type FederatedSignInOptions = {
50
- provider: CognitoHostedUIIdentityProvider;
51
- customState?: string;
52
- };
53
- export declare type FederatedSignInOptionsCustom = {
54
- customProvider: string;
55
- customState?: string;
56
- };
57
- export declare function isFederatedSignInOptions(obj: any): obj is FederatedSignInOptions;
58
- export declare function isFederatedSignInOptionsCustom(obj: any): obj is FederatedSignInOptionsCustom;
59
- export declare function hasCustomState(obj: any): boolean;
60
- /**
61
- * Details for multi-factor authentication
62
- */
63
- export interface MfaRequiredDetails {
64
- challengeName: any;
65
- challengeParameters: any;
66
- }
67
- /**
68
- * interface for federatedResponse
69
- */
70
- export interface FederatedResponse {
71
- token: string;
72
- identity_id?: string;
73
- expires_at: number;
74
- }
75
- /**
76
- * interface for federatedUser
77
- */
78
- export interface FederatedUser {
79
- name: string;
80
- email?: string;
81
- picture?: string;
82
- }
83
- export interface AwsCognitoOAuthOpts {
84
- domain: string;
85
- scope: Array<string>;
86
- redirectSignIn: string;
87
- redirectSignOut: string;
88
- responseType: string;
89
- options?: object;
90
- urlOpener?: (url: string, redirectUrl: string) => Promise<any>;
91
- }
92
- export declare function isCognitoHostedOpts(oauth: OAuthOpts): oauth is AwsCognitoOAuthOpts;
93
- export interface Auth0OAuthOpts {
94
- domain: string;
95
- clientID: string;
96
- scope: string;
97
- redirectUri: string;
98
- audience: string;
99
- responseType: string;
100
- returnTo: string;
101
- urlOpener?: (url: string, redirectUrl: string) => Promise<any>;
102
- }
103
- export declare type OAuthOpts = AwsCognitoOAuthOpts | Auth0OAuthOpts;
104
- export interface ConfirmSignUpOptions {
105
- forceAliasCreation?: boolean;
106
- clientMetadata?: ClientMetaData;
107
- }
108
- export interface SignOutOpts {
109
- global?: boolean;
110
- }
111
- export interface CurrentUserOpts {
112
- bypassCache: boolean;
113
- }
114
- export interface GetPreferredMFAOpts {
115
- bypassCache: boolean;
116
- }
117
- export declare type UsernamePasswordOpts = {
118
- username: string;
119
- password: string;
120
- validationData?: {
121
- [key: string]: any;
122
- };
123
- };
124
- export declare enum AuthErrorTypes {
125
- NoConfig = "noConfig",
126
- MissingAuthConfig = "missingAuthConfig",
127
- EmptyUsername = "emptyUsername",
128
- InvalidUsername = "invalidUsername",
129
- EmptyPassword = "emptyPassword",
130
- EmptyCode = "emptyCode",
131
- SignUpError = "signUpError",
132
- NoMFA = "noMFA",
133
- InvalidMFA = "invalidMFA",
134
- EmptyChallengeResponse = "emptyChallengeResponse",
135
- NoUserSession = "noUserSession",
136
- Default = "default",
137
- DeviceConfig = "deviceConfig",
138
- NetworkError = "networkError",
139
- AutoSignInError = "autoSignInError"
140
- }
141
- export declare type AuthErrorMessages = {
142
- [key in AuthErrorTypes]: AuthErrorMessage;
143
- };
144
- export interface AuthErrorMessage {
145
- message: string;
146
- log?: string;
147
- }
148
- export declare type SignInOpts = UsernamePasswordOpts;
149
- export declare type ClientMetaData = {
150
- [key: string]: string;
151
- } | undefined;
152
- export declare function isUsernamePasswordOpts(obj: any): obj is UsernamePasswordOpts;
153
- export interface IAuthDevice {
154
- id: string;
155
- name: string;
156
- }
157
- export interface AutoSignInOptions {
158
- enabled: boolean;
159
- clientMetaData?: ClientMetaData;
160
- validationData?: {
161
- [key: string]: any;
162
- };
163
- }
164
- export declare enum GRAPHQL_AUTH_MODE {
165
- API_KEY = "API_KEY",
166
- AWS_IAM = "AWS_IAM",
167
- OPENID_CONNECT = "OPENID_CONNECT",
168
- AMAZON_COGNITO_USER_POOLS = "AMAZON_COGNITO_USER_POOLS",
169
- AWS_LAMBDA = "AWS_LAMBDA"
170
- }
@@ -1 +0,0 @@
1
- export * from './Auth';
@@ -1,2 +0,0 @@
1
- declare const _default: (callback: any) => void;
2
- export default _default;
@@ -1,2 +0,0 @@
1
- declare const _default: (callback: any) => Promise<void>;
2
- export default _default;
package/testSequencer.js DELETED
@@ -1,24 +0,0 @@
1
- const Sequencer = require('@jest/test-sequencer').default;
2
-
3
- class CustomSequencer extends Sequencer {
4
- sort(tests) {
5
- // Test structure information
6
- // https://github.com/facebook/jest/blob/6b8b1404a1d9254e7d5d90a8934087a9c9899dab/packages/jest-runner/src/types.ts#L17-L21
7
- const copyTests = Array.from(tests);
8
- return copyTests.sort((testA, testB) => {
9
- // TODO: Remove @jest/test-sequencer
10
- // `auth-unit-test` currently causes intended side-effects related to `Credentials`
11
- // which is causing other tests to fail. As a temporary change, we are ordering the tests
12
- // alphabetically but putting `auth-unit-test` at the end to ensure no other tests
13
- // are affected.
14
- if (testA.path.includes('auth-unit-test.ts')) {
15
- return 1;
16
- } else if (testB.path.includes('auth-unit-test.ts')) {
17
- return -1;
18
- }
19
- return testA.path > testB.path ? 1 : -1;
20
- });
21
- }
22
- }
23
-
24
- module.exports = CustomSequencer;
@@ -1,6 +0,0 @@
1
- var config = require('./webpack.config.js');
2
-
3
- var entry = {
4
- 'aws-amplify-auth': './lib-esm/index.js',
5
- };
6
- module.exports = Object.assign(config, { entry, mode: 'development' });