diff --git a/packages/auth/__tests__/providers/cognito/confirmSignUp.test.ts b/packages/auth/__tests__/providers/cognito/confirmSignUp.test.ts index 2336ea89f81..55657207274 100644 --- a/packages/auth/__tests__/providers/cognito/confirmSignUp.test.ts +++ b/packages/auth/__tests__/providers/cognito/confirmSignUp.test.ts @@ -2,7 +2,6 @@ // SPDX-License-Identifier: Apache-2.0 import { confirmSignUp } from '../../../src/providers/cognito'; -import { AuthSignUpStep } from '../../../src/types'; import * as confirmSignUpClient from '../../../src/providers/cognito/utils/clients/CognitoIdentityProvider'; import { authAPITestParams } from './testUtils/authApiTestParams'; import { AuthValidationErrorCode } from '../../../src/errors/types/validation'; @@ -46,7 +45,7 @@ describe('confirmSignUp API Happy Path Cases:', () => { expect(result).toEqual({ isSignUpComplete: true, nextStep: { - signUpStep: AuthSignUpStep.DONE, + signUpStep: 'DONE', }, }); expect(confirmSignUpClientSpy).toHaveBeenCalledWith( diff --git a/packages/auth/__tests__/providers/cognito/signUp.test.ts b/packages/auth/__tests__/providers/cognito/signUp.test.ts index f847961bc35..c9ceaca4541 100644 --- a/packages/auth/__tests__/providers/cognito/signUp.test.ts +++ b/packages/auth/__tests__/providers/cognito/signUp.test.ts @@ -2,7 +2,6 @@ // SPDX-License-Identifier: Apache-2.0 import { signUp } from '../../../src/providers/cognito'; -import { AuthSignUpStep } from '../../../src/types'; import * as signUpClient from '../../../src/providers/cognito/utils/clients/CognitoIdentityProvider'; import { authAPITestParams } from './testUtils/authApiTestParams'; import { AuthValidationErrorCode } from '../../../src/errors/types/validation'; @@ -46,7 +45,7 @@ describe('SignUp API Happy Path Cases:', () => { expect(result).toEqual({ isSignUpComplete: false, nextStep: { - signUpStep: AuthSignUpStep.CONFIRM_SIGN_UP, + signUpStep: 'CONFIRM_SIGN_UP', codeDeliveryDetails: { destination: user1.email, deliveryMedium: 'EMAIL', diff --git a/packages/auth/package.json b/packages/auth/package.json index 82d7b1342a1..202aeeea487 100644 --- a/packages/auth/package.json +++ b/packages/auth/package.json @@ -25,7 +25,7 @@ "clean:size": "rimraf dual-publish-tmp tmp*", "format": "echo \"Not implemented\"", "lint": "tslint '{src}/**/*.ts' && npm run ts-coverage", - "ts-coverage": "typescript-coverage-report -p ./tsconfig.json -t 91.21" + "ts-coverage": "typescript-coverage-report -p ./tsconfig.json -t 91.20" }, "typesVersions": { ">=3.8": { diff --git a/packages/auth/src/index.ts b/packages/auth/src/index.ts index eaa2471d6e3..c6a19f1fac2 100644 --- a/packages/auth/src/index.ts +++ b/packages/auth/src/index.ts @@ -23,7 +23,6 @@ export { signOut, } from './providers/cognito'; export { - AuthSignUpStep, AuthUpdateAttributeStep } from './types/enums'; diff --git a/packages/auth/src/providers/cognito/apis/confirmSignUp.ts b/packages/auth/src/providers/cognito/apis/confirmSignUp.ts index 8298c0d1485..8ba0ab36f6b 100644 --- a/packages/auth/src/providers/cognito/apis/confirmSignUp.ts +++ b/packages/auth/src/providers/cognito/apis/confirmSignUp.ts @@ -5,7 +5,6 @@ import { Amplify } from '@aws-amplify/core'; import { assertTokenProviderConfig } from '@aws-amplify/core/internals/utils'; import { AuthSignUpResult, - AuthSignUpStep, AuthStandardAttributeKey, ConfirmSignUpRequest, } from '../../../types'; @@ -61,7 +60,7 @@ export async function confirmSignUp( return { isSignUpComplete: true, nextStep: { - signUpStep: AuthSignUpStep.DONE, + signUpStep: 'DONE', }, }; } diff --git a/packages/auth/src/providers/cognito/apis/signUp.ts b/packages/auth/src/providers/cognito/apis/signUp.ts index 500447c3022..79708b6cfce 100644 --- a/packages/auth/src/providers/cognito/apis/signUp.ts +++ b/packages/auth/src/providers/cognito/apis/signUp.ts @@ -5,7 +5,6 @@ import { Amplify } from '@aws-amplify/core'; import { assertTokenProviderConfig } from '@aws-amplify/core/internals/utils'; import { AuthSignUpResult, - AuthSignUpStep, AuthStandardAttributeKey, DeliveryMedium, SignUpRequest, @@ -79,14 +78,14 @@ export async function signUp( return { isSignUpComplete: true, nextStep: { - signUpStep: AuthSignUpStep.DONE, + signUpStep: 'DONE', }, }; } else { return { isSignUpComplete: false, nextStep: { - signUpStep: AuthSignUpStep.CONFIRM_SIGN_UP, + signUpStep: 'CONFIRM_SIGN_UP', codeDeliveryDetails: { deliveryMedium: CodeDeliveryDetails?.DeliveryMedium as DeliveryMedium, destination: CodeDeliveryDetails?.Destination as string, diff --git a/packages/auth/src/types/enums.ts b/packages/auth/src/types/enums.ts index fee46d09578..13fe2b9ce1e 100644 --- a/packages/auth/src/types/enums.ts +++ b/packages/auth/src/types/enums.ts @@ -2,15 +2,6 @@ // SPDX-License-Identifier: Apache-2.0 - -/** - * Denotes the next step in the Sign Up process. - */ -export enum AuthSignUpStep { - CONFIRM_SIGN_UP = 'CONFIRM_SIGN_UP', - DONE = 'DONE', -} - /** * Denotes the next step in the Update User Attribute process. */ diff --git a/packages/auth/src/types/index.ts b/packages/auth/src/types/index.ts index 51310a4ec70..34a3fe28768 100644 --- a/packages/auth/src/types/index.ts +++ b/packages/auth/src/types/index.ts @@ -5,7 +5,6 @@ export * from './Auth'; export { - AuthSignUpStep, AuthUpdateAttributeStep, } from './enums'; @@ -26,6 +25,7 @@ export { AuthUser, TOTPSetupDetails, AuthResetPasswordStep, + AuthSignUpStep } from './models'; export { AuthServiceOptions, AuthSignUpOptions } from './options'; diff --git a/packages/auth/src/types/models.ts b/packages/auth/src/types/models.ts index e01de34b20f..c4c34377098 100644 --- a/packages/auth/src/types/models.ts +++ b/packages/auth/src/types/models.ts @@ -1,7 +1,7 @@ // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 -import { AuthSignUpStep, AuthUpdateAttributeStep } from './enums'; +import { AuthUpdateAttributeStep } from './enums'; /** * Additional data that may be returned from Auth APIs. @@ -230,6 +230,11 @@ export type AuthUserAttribute< */ export type AuthUserAttributeKey = AuthStandardAttributeKey | AnyAttribute; +/** + * Denotes the next step in the Sign Up process. + */ +export type AuthSignUpStep = 'CONFIRM_SIGN_UP' | 'DONE'; + /** * Data encapsulating the next step in the Sign Up process */