From 220c8f192fa39c7c829e9c684dc59f4b34489ab1 Mon Sep 17 00:00:00 2001 From: Erin Beal Date: Mon, 11 Dec 2023 09:18:09 -0700 Subject: [PATCH] chore: collapse Input/Output into Accordion --- .../auth/auth-migration-guide/index.mdx | 3728 +++++++++-------- 1 file changed, 1912 insertions(+), 1816 deletions(-) diff --git a/src/pages/[platform]/build-a-backend/auth/auth-migration-guide/index.mdx b/src/pages/[platform]/build-a-backend/auth/auth-migration-guide/index.mdx index eb027a2c22a..fbee9084e1e 100644 --- a/src/pages/[platform]/build-a-backend/auth/auth-migration-guide/index.mdx +++ b/src/pages/[platform]/build-a-backend/auth/auth-migration-guide/index.mdx @@ -29,112 +29,115 @@ export function getStaticProps(context) { + signUp: (input: SignUpInput) => Promise; ``` -### Input + - -
- **V5** - - ``` - // Standard - params: SignUpParams { - username: string; - password: string; - attributes?: object; - validationData?: { - [key: string]: string; - } - clientMetadata?: { [key: string]: string; }; - autoSignIn?: { - enabled: boolean; - clientMetaData?: { [key: string]: string; }; + #### Input + + +
+ **V5** + + ``` + // Standard + params: SignUpParams { + username: string; + password: string; + attributes?: object; validationData?: { [key: string]: string; } - }; - } + clientMetadata?: { [key: string]: string; }; + autoSignIn?: { + enabled: boolean; + clientMetaData?: { [key: string]: string; }; + validationData?: { + [key: string]: string; + } + }; + } - // Legacy - username: string - password: string - email: string - phone_number: string - ``` + // Legacy + username: string + password: string + email: string + phone_number: string + ``` -
-
- **V6** - - ``` - input: SignUpInput { - username: string; - password: string; - options?: { - userAttributes?: { [key: string]?: string; } - validationData?: { [key: string]: string; }; - clientMetadata?: { [key: string]: string; }; - autoSignIn?: boolean | { - authFlowType?: - | 'USER_SRP_AUTH' - | 'CUSTOM_WITH_SRP' - | 'CUSTOM_WITHOUT_SRP' - | 'USER_PASSWORD_AUTH'; +
+
+ **V6** + + ``` + input: SignUpInput { + username: string; + password: string; + options?: { + userAttributes?: { [key: string]?: string; } + validationData?: { [key: string]: string; }; clientMetadata?: { [key: string]: string; }; + autoSignIn?: boolean | { + authFlowType?: + | 'USER_SRP_AUTH' + | 'CUSTOM_WITH_SRP' + | 'CUSTOM_WITHOUT_SRP' + | 'USER_PASSWORD_AUTH'; + clientMetadata?: { [key: string]: string; }; + }; }; - }; - } - ``` + } + ``` -
-
+
+
-### Output + #### Output - -
- **V5** - - ``` - ISignUpResult { - user: CognitoUser; - userConfirmed: boolean; - userSub: string; - codeDeliveryDetails: { - AttributeName: string; - DeliveryMedium: string; - Destination: string; - }; - } - ``` + +
+ **V5** + + ``` + ISignUpResult { + user: CognitoUser; + userConfirmed: boolean; + userSub: string; + codeDeliveryDetails: { + AttributeName: string; + DeliveryMedium: string; + Destination: string; + }; + } + ``` -
-
- **V6** +
+
+ **V6** + + ``` + SignUpOutput { + isSignUpComplete: boolean; + userId?: string; + nextStep: { + signUpStep: + | 'DONE' + | 'CONFIRM_SIGN_UP' + | 'COMPLETE_AUTO_SIGN_IN', + codeDeliveryDetails: { // Not included when signUpStep is 'DONE' + destination?: string; + deliveryMedium?: + | 'EMAIL' + | 'SMS' + | 'PHONE' + | 'UNKNOWN'; + attributeName?: UserAttributeKey; + } + }; + } + ``` - ``` - SignUpOutput { - isSignUpComplete: boolean; - userId?: string; - nextStep: { - signUpStep: - | 'DONE' - | 'CONFIRM_SIGN_UP' - | 'COMPLETE_AUTO_SIGN_IN', - codeDeliveryDetails: { // Not included when signUpStep is 'DONE' - destination?: string; - deliveryMedium?: - | 'EMAIL' - | 'SMS' - | 'PHONE' - | 'UNKNOWN'; - attributeName?: UserAttributeKey; - } - }; - } - ``` - -
-
+
+
+
### Example 1 (Standard) @@ -381,77 +384,80 @@ NOTE: autoSignIn is no longer triggered automatically in v6 + confirmSignUp: (input: ConfirmSignUpInput) => Promise; ``` -### Input + - -
- **V5** - - ``` - username: string - code: string - options?: ConfirmSignUpOptions { - forceAliasCreation?: boolean; - clientMetadata?: { [key: string]: string; }; - } - ``` + #### Input -
-
- **V6** - - ``` - input: ConfirmSignUpInput = { - username: string; - confirmationCode: string; - options?: { - clientMetadata?: { [key: string]: string; }; - forceAliasCreation?: boolean; - }; - } - ``` + +
+ **V5** + + ``` + username: string + code: string + options?: ConfirmSignUpOptions { + forceAliasCreation?: boolean; + clientMetadata?: { [key: string]: string; }; + } + ``` -
-
+
+
+ **V6** + + ``` + input: ConfirmSignUpInput = { + username: string; + confirmationCode: string; + options?: { + clientMetadata?: { [key: string]: string; }; + forceAliasCreation?: boolean; + }; + } + ``` -### Output +
+
- -
- **V5** - - ``` - 'SUCCESS' - ``` + #### Output -
-
- **V6** + +
+ **V5** + + ``` + 'SUCCESS' + ``` + +
+
+ **V6** + + ``` + type ConfirmSignUpOutput = { + isSignUpComplete: boolean; + userId?: string | undefined; + nextStep: { + signUpStep: + | 'DONE' + | 'CONFIRM_SIGN_UP' + | 'COMPLETE_AUTO_SIGN_IN', + codeDeliveryDetails: { // Not included when signUpStep is 'DONE' + destination?: string; + deliveryMedium?: + | 'EMAIL' + | 'SMS' + | 'PHONE' + | 'UNKNOWN'; + attributeName?: UserAttributeKey; + } + }; + } + ``` - ``` - type ConfirmSignUpOutput = { - isSignUpComplete: boolean; - userId?: string | undefined; - nextStep: { - signUpStep: - | 'DONE' - | 'CONFIRM_SIGN_UP' - | 'COMPLETE_AUTO_SIGN_IN', - codeDeliveryDetails: { // Not included when signUpStep is 'DONE' - destination?: string; - deliveryMedium?: - | 'EMAIL' - | 'SMS' - | 'PHONE' - | 'UNKNOWN'; - attributeName?: UserAttributeKey; - } - }; - } - ``` - -
-
+
+
+
### Example 1 (Standard) @@ -563,67 +569,70 @@ Note that forceAliasCreation defaulted to `true` in v5 but is left `undefined` b + resendSignUpCode: (input: ResendSignUpCodeInput) => Promise; ``` -### Input + - -
- **V5** - - ``` - username: string - clientMetadata?: ClientMetaData { - [key: string]: string; - } - ``` + #### Input -
-
- **V6** - - ``` - input: ResendSignUpCodeInput { - username: string; - options?: { - clientMetadata?: { [key: string]: string; }; - }; - } - ``` -
-
+ +
+ **V5** + + ``` + username: string + clientMetadata?: ClientMetaData { + [key: string]: string; + } + ``` + +
+
+ **V6** + + ``` + input: ResendSignUpCodeInput { + username: string; + options?: { + clientMetadata?: { [key: string]: string; }; + }; + } + ``` +
+
-### Output + #### Output - -
- **V5** - - ``` - { - CodeDeliveryDetails: { - AttributeName: string, - DeliveryMedium: string, - Destination: string + +
+ **V5** + + ``` + { + CodeDeliveryDetails: { + AttributeName: string, + DeliveryMedium: string, + Destination: string + } } - } - ``` - -
-
- **V6** + ``` - ``` - ResendSignUpCodeOutput { - destination?: string; - deliveryMedium?: - | 'EMAIL' - | 'SMS' - | 'PHONE' - | 'UNKNOWN'; - attributeName?: AuthVerifiableAttributeKey; - } - ``` -
-
+
+
+ **V6** + + ``` + ResendSignUpCodeOutput { + destination?: string; + deliveryMedium?: + | 'EMAIL' + | 'SMS' + | 'PHONE' + | 'UNKNOWN'; + attributeName?: AuthVerifiableAttributeKey; + } + ``` +
+
+
### Example @@ -664,100 +673,103 @@ Note that forceAliasCreation defaulted to `true` in v5 but is left `undefined` b + signIn: (input: SignInInput) => Promise; ``` -### Input + - -
- **V5** - - ``` - // Standard - usernameOrSignInOpts: SignInOpts { - username: string; - password: string; - validationData?: { - [key: string]: any; - }; - } - pw?: undefined - clientMetadata?: ClientMetaData { - [key: string]: string; - } + #### Input - // Legacy - usernameOrSignInOpts: string - pw?: string - clientMetadata?: ClientMetaData { - [key: string]: string; - } - ``` + +
+ **V5** + + ``` + // Standard + usernameOrSignInOpts: SignInOpts { + username: string; + password: string; + validationData?: { + [key: string]: any; + }; + } + pw?: undefined + clientMetadata?: ClientMetaData { + [key: string]: string; + } -
-
- **V6** - - ``` - input: SignInInput { - username: string; - password?: string; - options?: { - authFlowType?: - | 'USER_SRP_AUTH' - | 'CUSTOM_WITH_SRP' - | 'CUSTOM_WITHOUT_SRP' - | 'USER_PASSWORD_AUTH'; - clientMetadata?: ClientMetaData { - [key: string]: string; - } - }; - } - ``` -
-
+ // Legacy + usernameOrSignInOpts: string + pw?: string + clientMetadata?: ClientMetaData { + [key: string]: string; + } + ``` -### Output +
+
+ **V6** + + ``` + input: SignInInput { + username: string; + password?: string; + options?: { + authFlowType?: + | 'USER_SRP_AUTH' + | 'CUSTOM_WITH_SRP' + | 'CUSTOM_WITHOUT_SRP' + | 'USER_PASSWORD_AUTH'; + clientMetadata?: ClientMetaData { + [key: string]: string; + } + }; + } + ``` +
+
- -
- **V5** - - ``` - CognitoUser { - challengeName?: string; - challengeParam?: string; - username: string; - signInUserSession: { - idToken: string; - refreshToken: string; - accessToken: string; - clockDrift: number; - } | null; - authenticationFlowType: string; - } - ``` + #### Output -
-
- **V6** - - ``` - type SignInOutput = { - isSignedIn: boolean; - nextStep: // See Example 2 for more details on nextStep types - | ContinueSignInWithMFASelection - | ContinueSignInWithTOTPSetup - | ConfirmSignInWithSMSCode - | ConfirmSignInWithTOTPCode - | ConfirmSignInWithCustomChallenge - | ConfirmSignInWithNewPasswordRequired - | ConfirmSignUpStep - | ResetPasswordStep - | DoneSignInStep; - } - ``` + +
+ **V5** + + ``` + CognitoUser { + challengeName?: string; + challengeParam?: string; + username: string; + signInUserSession: { + idToken: string; + refreshToken: string; + accessToken: string; + clockDrift: number; + } | null; + authenticationFlowType: string; + } + ``` -
-
+
+
+ **V6** + + ``` + type SignInOutput = { + isSignedIn: boolean; + nextStep: // See Example 2 for more details on nextStep types + | ContinueSignInWithMFASelection + | ContinueSignInWithTOTPSetup + | ConfirmSignInWithSMSCode + | ConfirmSignInWithTOTPCode + | ConfirmSignInWithCustomChallenge + | ConfirmSignInWithNewPasswordRequired + | ConfirmSignUpStep + | ResetPasswordStep + | DoneSignInStep; + } + ``` + +
+
+
### Example 1 (Standard) @@ -1025,97 +1037,100 @@ NOTE: signIn no longer accepts validationData in v6 + signInWithRedirect: (input?: SignInWithRedirectInput) => Promise; ``` -### Input + - -
- **V5** - - ``` - // Standard - options?: FederatedSignInOptions { - provider: { // enum - Cognito = 'COGNITO', - Google = 'Google', - Facebook = 'Facebook', - Amazon = 'LoginWithAmazon', - Apple = 'SignInWithApple', - }; - customState?: string; - } + #### Input - // Custom Provider - options?: FederatedSignInOptionsCustom { - customProvider: string; - customState?: string; - } + +
+ **V5** + + ``` + // Standard + options?: FederatedSignInOptions { + provider: { // enum + Cognito = 'COGNITO', + Google = 'Google', + Facebook = 'Facebook', + Amazon = 'LoginWithAmazon', + Apple = 'SignInWithApple', + }; + customState?: string; + } - // Legacy - provider: - | 'google' - | 'facebook' - | 'amazon' - | 'developer' - | string - response: FederatedResponse { - token: string; - identity_id?: string; - expires_at: number; - } - user: FederatedUser { - name: string; - email?: string; - picture?: string; - } - ``` + // Custom Provider + options?: FederatedSignInOptionsCustom { + customProvider: string; + customState?: string; + } -
-
- **V6** + // Legacy + provider: + | 'google' + | 'facebook' + | 'amazon' + | 'developer' + | string + response: FederatedResponse { + token: string; + identity_id?: string; + expires_at: number; + } + user: FederatedUser { + name: string; + email?: string; + picture?: string; + } + ``` + +
+
+ **V6** + + ``` + input?: SignInWithRedirectInput { + provider?: + | 'Amazon' + | 'Apple' + | 'Facebook' + | 'Google' + | { custom: string; }; + customState?: string; + options?: { + preferPrivateSession?: boolean; + }; + } + ``` - ``` - input?: SignInWithRedirectInput { - provider?: - | 'Amazon' - | 'Apple' - | 'Facebook' - | 'Google' - | { custom: string; }; - customState?: string; - options?: { - preferPrivateSession?: boolean; - }; - } - ``` - -
-
+
+
-### Output + #### Output - -
- **V5** + +
+ **V5** + + ``` + ICredentials { + accessKeyId: string; + sessionToken: string; + secretAccessKey: string; + identityId: string; + authenticated: boolean; + expiration?: Date; + } + ``` - ``` - ICredentials { - accessKeyId: string; - sessionToken: string; - secretAccessKey: string; - identityId: string; - authenticated: boolean; - expiration?: Date; - } - ``` - -
-
- **V6** +
+
+ **V6** - No output in v6 + No output in v6 -
-
+
+
+
### Example 1 (Standard) @@ -1271,82 +1286,85 @@ NOTE: signIn no longer accepts validationData in v6 + confirmSignIn: (input: ConfirmSignInInput) => Promise; ``` -### Input + - -
- **V5** - - ``` - user: CognitoUser - code: string - mfaType?: 'SMS_MFA' | 'SOFTWARE_TOKEN_MFA' | null - clientMetadata?: ClientMetaData { - [key: string]: string; - } - ``` + #### Input -
-
- **V6** - - ``` - input: ConfirmSignInInput { - challengeResponse: string; - options?: { - userAttributes?: AuthUserAttributes; - clientMetadata?: ClientMetaData { - [key: string]: string; - } - friendlyDeviceName?: string; - }; - } - ``` -
-
+ +
+ **V5** + + ``` + user: CognitoUser + code: string + mfaType?: 'SMS_MFA' | 'SOFTWARE_TOKEN_MFA' | null + clientMetadata?: ClientMetaData { + [key: string]: string; + } + ``` -### Output +
+
+ **V6** + + ``` + input: ConfirmSignInInput { + challengeResponse: string; + options?: { + userAttributes?: AuthUserAttributes; + clientMetadata?: ClientMetaData { + [key: string]: string; + } + friendlyDeviceName?: string; + }; + } + ``` +
+
- -
- **V5** - - ``` - CognitoUser { - challengeName?: string; - challengeParam?: string; - username: string; - signInUserSession: { - idToken: string; - refreshToken: string; - accessToken: string; - clockDrift: number; - } | null; - authenticationFlowType: string; - } - ``` + #### Output -
-
- **V6** - - ``` - ConfirmSignInOutput { - isSignedIn: boolean; - nextStep: - | ContinueSignInWithMFASelection - | ContinueSignInWithTOTPSetup - | ConfirmSignInWithSMSCode - | ConfirmSignInWithTOTPCode - | ConfirmSignInWithCustomChallenge - | ConfirmSignInWithNewPasswordRequired - | ConfirmSignUpStep - | ResetPasswordStep - | DoneSignInStep; - } - ``` -
-
+ +
+ **V5** + + ``` + CognitoUser { + challengeName?: string; + challengeParam?: string; + username: string; + signInUserSession: { + idToken: string; + refreshToken: string; + accessToken: string; + clockDrift: number; + } | null; + authenticationFlowType: string; + } + ``` + +
+
+ **V6** + + ``` + ConfirmSignInOutput { + isSignedIn: boolean; + nextStep: + | ContinueSignInWithMFASelection + | ContinueSignInWithTOTPSetup + | ConfirmSignInWithSMSCode + | ConfirmSignInWithTOTPCode + | ConfirmSignInWithCustomChallenge + | ConfirmSignInWithNewPasswordRequired + | ConfirmSignUpStep + | ResetPasswordStep + | DoneSignInStep; + } + ``` +
+
+
### Example @@ -1399,48 +1417,51 @@ NOTE: signIn no longer accepts validationData in v6 + setUpTOTP: () => Promise; ``` -### Input + - -
- **V5** + #### Input - ``` - user: CognitoUser - ``` + +
+ **V5** -
-
- **V6** + ``` + user: CognitoUser + ``` - No input in v6 +
+
+ **V6** -
-
+ No input in v6 -### Output +
+
- -
- **V5** - - ``` - string // secretCode - ``` + #### Output -
-
- **V6** + +
+ **V5** + + ``` + string // secretCode + ``` - ``` - SetUpTOTPOutput { - sharedSecret: string; - getSetupUri: (appName: string, accountName?: string | undefined) => URL; - } - ``` +
+
+ **V6** -
-
+ ``` + SetUpTOTPOutput { + sharedSecret: string; + getSetupUri: (appName: string, accountName?: string | undefined) => URL; + } + ``` + +
+
+
### Example @@ -1484,56 +1505,59 @@ NOTE: signIn no longer accepts validationData in v6 + verifyTOTPSetup: (input: VerifyTOTPSetupInput) => Promise; ``` -### Input + - -
- **V5** - - ``` - user: CognitoUser - challengeAnswer: string - ``` + #### Input -
-
- **V6** - - ``` - input: VerifyTOTPSetupInput { - code: string; - options?: { - friendlyDeviceName?: string; + +
+ **V5** + + ``` + user: CognitoUser + challengeAnswer: string + ``` + +
+
+ **V6** + + ``` + input: VerifyTOTPSetupInput { + code: string; + options?: { + friendlyDeviceName?: string; + } } - } - ``` + ``` -
-
+
+
-### Output + #### Output - -
- **V5** - - ``` - CognitoUserSession { - idToken: string; - refreshToken: string; - accessToken: string; - clockDrift: number; - } - ``` + +
+ **V5** + + ``` + CognitoUserSession { + idToken: string; + refreshToken: string; + accessToken: string; + clockDrift: number; + } + ``` -
-
- **V6** +
+
+ **V6** - No output in v6 + No output in v6 -
-
+
+
+
### Example @@ -1577,84 +1601,87 @@ This API has been deprecated: existing use cases can be migrated to the `confirm + confirmSignIn: (input: ConfirmSignInInput) => Promise; ``` -### Input + - -
- **V5** - - ``` - user: CognitoUser - password: string - requiredAttributes?: any - clientMetadata?: ClientMetaData { - [key: string]: string; - } - ``` + #### Input -
-
- **V6** + +
+ **V5** + + ``` + user: CognitoUser + password: string + requiredAttributes?: any + clientMetadata?: ClientMetaData { + [key: string]: string; + } + ``` + +
+
+ **V6** + + ``` + input: ConfirmSignInInput { + challengeResponse: string; + options?: { + userAttributes?: AuthUserAttributes; + clientMetadata?: ClientMetaData { + [key: string]: string; + } + friendlyDeviceName?: string; + }; + } + ``` - ``` - input: ConfirmSignInInput { - challengeResponse: string; - options?: { - userAttributes?: AuthUserAttributes; - clientMetadata?: ClientMetaData { - [key: string]: string; - } - friendlyDeviceName?: string; - }; - } - ``` - -
-
+
+
-### Output + #### Output - -
- **V5** - - ``` - CognitoUser { - challengeName?: string; - challengeParam?: string; - username: string; - signInUserSession: { - idToken: string; - refreshToken: string; - accessToken: string; - clockDrift: number; - } | null; - authenticationFlowType: string; - } - ``` + +
+ **V5** + + ``` + CognitoUser { + challengeName?: string; + challengeParam?: string; + username: string; + signInUserSession: { + idToken: string; + refreshToken: string; + accessToken: string; + clockDrift: number; + } | null; + authenticationFlowType: string; + } + ``` -
-
- **V6** +
+
+ **V6** + + ``` + ConfirmSignInOutput { + isSignedIn: boolean; + nextStep: // See Auth.signIn Example 2 for more details on nextStep types + | ContinueSignInWithMFASelection + | ContinueSignInWithTOTPSetup + | ConfirmSignInWithSMSCode + | ConfirmSignInWithTOTPCode + | ConfirmSignInWithCustomChallenge + | ConfirmSignInWithNewPasswordRequired + | ConfirmSignUpStep + | ResetPasswordStep + | DoneSignInStep; + } + ``` - ``` - ConfirmSignInOutput { - isSignedIn: boolean; - nextStep: // See Auth.signIn Example 2 for more details on nextStep types - | ContinueSignInWithMFASelection - | ContinueSignInWithTOTPSetup - | ConfirmSignInWithSMSCode - | ConfirmSignInWithTOTPCode - | ConfirmSignInWithCustomChallenge - | ConfirmSignInWithNewPasswordRequired - | ConfirmSignUpStep - | ResetPasswordStep - | DoneSignInStep; - } - ``` - -
-
+
+
+
### Example @@ -1708,83 +1735,86 @@ This API has been deprecated: existing use cases can be migrated to the `confirm + confirmSignIn: (input: ConfirmSignInInput) => Promise; ``` -### Input + - -
- **V5** - - ``` - user: CognitoUser - challengeResponses: string - clientMetadata?: ClientMetaData { - [key: string]: string; - } - ``` + #### Input -
-
- **V6** - - ``` - input: ConfirmSignInInput { - challengeResponse: string; - options?: { - userAttributes?: AuthUserAttributes; - clientMetadata?: ClientMetaData { - [key: string]: string; - } - friendlyDeviceName?: string; - }; - } - ``` + +
+ **V5** + + ``` + user: CognitoUser + challengeResponses: string + clientMetadata?: ClientMetaData { + [key: string]: string; + } + ``` -
-
+
+
+ **V6** + + ``` + input: ConfirmSignInInput { + challengeResponse: string; + options?: { + userAttributes?: AuthUserAttributes; + clientMetadata?: ClientMetaData { + [key: string]: string; + } + friendlyDeviceName?: string; + }; + } + ``` -### Output +
+
- -
- **V5** - - ``` - CognitoUser { - challengeName?: string; - challengeParam?: string; - username: string; - signInUserSession: { - idToken: string; - refreshToken: string; - accessToken: string; - clockDrift: number; - } | null; - authenticationFlowType: string; - } - ``` + #### Output -
-
- **V6** - - ``` - ConfirmSignInOutput { - isSignedIn: boolean; - nextStep: // See Auth.signIn Example 2 for more details on nextStep types - | ContinueSignInWithMFASelection - | ContinueSignInWithTOTPSetup - | ConfirmSignInWithSMSCode - | ConfirmSignInWithTOTPCode - | ConfirmSignInWithCustomChallenge - | ConfirmSignInWithNewPasswordRequired - | ConfirmSignUpStep - | ResetPasswordStep - | DoneSignInStep; - } - ``` + +
+ **V5** + + ``` + CognitoUser { + challengeName?: string; + challengeParam?: string; + username: string; + signInUserSession: { + idToken: string; + refreshToken: string; + accessToken: string; + clockDrift: number; + } | null; + authenticationFlowType: string; + } + ``` -
-
+
+
+ **V6** + + ``` + ConfirmSignInOutput { + isSignedIn: boolean; + nextStep: // See Auth.signIn Example 2 for more details on nextStep types + | ContinueSignInWithMFASelection + | ContinueSignInWithTOTPSetup + | ConfirmSignInWithSMSCode + | ConfirmSignInWithTOTPCode + | ConfirmSignInWithCustomChallenge + | ConfirmSignInWithNewPasswordRequired + | ConfirmSignUpStep + | ResetPasswordStep + | DoneSignInStep; + } + ``` + +
+
+
### Example @@ -1834,50 +1864,53 @@ This API has been deprecated: existing use cases can be migrated to the `confirm + fetchMFAPreference: () => Promise; ``` -### Input + - -
- **V5** - - ``` - user: CognitoUser - params?: GetPreferredMFAOpts { - bypassCache: boolean; - } - ``` -
-
- **V6** + #### Input + + +
+ **V5** + + ``` + user: CognitoUser + params?: GetPreferredMFAOpts { + bypassCache: boolean; + } + ``` +
+
+ **V6** - No input in v6 + No input in v6 -
-
+
+
-### Output + #### Output - -
- **V5** - - ``` - 'SMS' | 'TOTP' - ``` + +
+ **V5** + + ``` + 'SMS' | 'TOTP' + ``` -
-
- **V6** - - ``` - FetchMFAPreferenceOutput: { - enabled?: ('SMS' | 'TOTP')[]; - preferred?: 'SMS' | 'TOTP'; - } - ``` +
+
+ **V6** + + ``` + FetchMFAPreferenceOutput: { + enabled?: ('SMS' | 'TOTP')[]; + preferred?: 'SMS' | 'TOTP'; + } + ``` -
-
+
+
+
### Example @@ -1920,61 +1953,64 @@ This API has been deprecated: existing use cases can be migrated to the `confirm + updateMFAPreference: (input: UpdateMFAPreferenceInput) => Promise; ``` -### Input + - -
- **V5** - - ``` - user: CognitoUser - mfaMethod: - | 'TOTP' - | 'SMS' - | 'NOMFA' - | 'SMS_MFA' - | 'SOFTWARE_TOKEN_MFA' - ``` + #### Input -
-
- **V6** - - ``` - input: UpdateMFAPreferenceInput { - sms?: - | 'ENABLED' - | 'DISABLED' - | 'PREFERRED' - | 'NOT_PREFERRED' - mfa?: - | 'ENABLED' - | 'DISABLED' - | 'PREFERRED' - | 'NOT_PREFERRED' - } - ``` -
-
+ +
+ **V5** + + ``` + user: CognitoUser + mfaMethod: + | 'TOTP' + | 'SMS' + | 'NOMFA' + | 'SMS_MFA' + | 'SOFTWARE_TOKEN_MFA' + ``` + +
+
+ **V6** + + ``` + input: UpdateMFAPreferenceInput { + sms?: + | 'ENABLED' + | 'DISABLED' + | 'PREFERRED' + | 'NOT_PREFERRED' + mfa?: + | 'ENABLED' + | 'DISABLED' + | 'PREFERRED' + | 'NOT_PREFERRED' + } + ``` +
+
-### Output + #### Output - -
- **V5** + +
+ **V5** - ``` - 'No change for mfa type' | 'SUCCESS' - ``` + ``` + 'No change for mfa type' | 'SUCCESS' + ``` -
-
- **V6** +
+
+ **V6** - No output in v6 + No output in v6 -
-
+
+
+
### Example @@ -2017,51 +2053,54 @@ This API has been deprecated and results apply only to SMS MFA configurations: e + fetchMFAPreference: () => Promise ``` -### Input + - -
- **V5** - - ``` - user: CognitoUser - ``` + #### Input -
-
- **V6** + +
+ **V5** + + ``` + user: CognitoUser + ``` - No input in v6 +
+
+ **V6** -
-
+ No input in v6 -### Output +
+
- -
- **V5** - - ``` - MFAOption[]: { - DeliveryMedium: 'SMS' | ~~'EMAIL'~~; - AttributeName: string; - }[] - ``` + #### Output -
-
- **V6** - - ``` - FetchMFAPreferenceOutput: { - enabled?: ('SMS' | 'TOTP')[]; - preferred?: 'SMS' | 'TOTP'; - } - ``` + +
+ **V5** + + ``` + MFAOption[]: { + DeliveryMedium: 'SMS' | ~~'EMAIL'~~; + AttributeName: string; + }[] + ``` -
-
+
+
+ **V6** + + ``` + FetchMFAPreferenceOutput: { + enabled?: ('SMS' | 'TOTP')[]; + preferred?: 'SMS' | 'TOTP'; + } + ``` + +
+
+
### Example @@ -2108,30 +2147,30 @@ This API has been deprecated and results apply only to SMS MFA configurations: e + signOut: (input?: SignOutInput) => Promise; ``` -### Input - - -
- **V5** - - ``` - opts?: SignOutOpts { - global?: boolean; - } - ``` + + +
+ **V5** + + ``` + opts?: SignOutOpts { + global?: boolean; + } + ``` -
-
- **V6** +
+
+ **V6** + + ``` + input?: SignOutInput { + global: boolean; + } + ``` - ``` - input?: SignOutInput { - global: boolean; - } - ``` - -
-
+
+
+ ### Example @@ -2172,52 +2211,55 @@ This API has been deprecated and results apply only to SMS MFA configurations: e + updatePassword: (input: UpdatePasswordInput) => Promise; ``` -### Input + - -
- **V5** - - ``` - user: CognitoUser - oldPassword: string - newPassword: string - clientMetadata?: ClientMetaData { - [key: string]: string - } - ``` + #### Input -
-
- **V6** - - ``` - input: UpdatePasswordInput { - oldPassword: string; - newPassword: string; - } - ``` -
-
+ +
+ **V5** + + ``` + user: CognitoUser + oldPassword: string + newPassword: string + clientMetadata?: ClientMetaData { + [key: string]: string + } + ``` -### Output +
+
+ **V6** + + ``` + input: UpdatePasswordInput { + oldPassword: string; + newPassword: string; + } + ``` +
+
- -
- **V5** - - ``` - 'SUCCESS' - ``` - -
-
- **V6** + #### Output - No output in v6 + +
+ **V5** + + ``` + 'SUCCESS' + ``` + +
+
+ **V6** -
-
+ No output in v6 + +
+
+
### Example @@ -2272,82 +2314,85 @@ This API has been deprecated and results apply only to SMS MFA configurations: e + resetPassword: (input: ResetPasswordInput) => Promise; ``` -### Input + - -
- **V5** - - ``` - username: string - clientMetadata?: ClientMetaData { - [key: string]: string; - } - ``` + #### Input -
-
- **V6** - - ``` - input: ResetPasswordInput { - username: string; - options?: { - clientMetadata?: { - [key: string]: string; + +
+ **V5** + + ``` + username: string + clientMetadata?: ClientMetaData { + [key: string]: string; + } + ``` + +
+
+ **V6** + + ``` + input: ResetPasswordInput { + username: string; + options?: { + clientMetadata?: { + [key: string]: string; + }; }; - }; - } - ``` + } + ``` -
-
+
+
-### Output + #### Output - -
- **V5** - - ``` - { - CodeDeliveryDetails: { - AttributeName: string; - DeliveryMedium: string; - Destination: string; + +
+ **V5** + + ``` + { + CodeDeliveryDetails: { + AttributeName: string; + DeliveryMedium: string; + Destination: string; + } } - } - ``` + ``` -
-
- **V6** - - ``` - ResetPasswordOutput { - isPasswordReset: boolean; - nextStep: { - resetPasswordStep: - | 'CONFIRM_RESET_PASSWORD_WITH_CODE' - | 'DONE'; - additionalInfo?: { - [key: string]: string; - }; - codeDeliveryDetails: { - destination?: string; - deliveryMedium?: - | 'EMAIL' - | 'SMS' - | 'PHONE' - | 'UNKNOWN'; - attributeName?: 'email' | 'phone_number'; - }; - }; - } - ``` - -
-
+
+
+ **V6** + + ``` + ResetPasswordOutput { + isPasswordReset: boolean; + nextStep: { + resetPasswordStep: + | 'CONFIRM_RESET_PASSWORD_WITH_CODE' + | 'DONE'; + additionalInfo?: { + [key: string]: string; + }; + codeDeliveryDetails: { + destination?: string; + deliveryMedium?: + | 'EMAIL' + | 'SMS' + | 'PHONE' + | 'UNKNOWN'; + attributeName?: 'email' | 'phone_number'; + }; + }; + } + ``` + +
+
+
### Example @@ -2413,58 +2458,61 @@ This API has been deprecated and results apply only to SMS MFA configurations: e + confirmResetPassword: (input: ConfirmResetPasswordInput) => Promise; ``` -### Input + - -
- **V5** - - ``` - username: string - code: string - password: string - clientMetadata?: ClientMetaData { - [key: string]: string; - }; - ``` - -
-
- **V6** + #### Input + + +
+ **V5** + + ``` + username: string + code: string + password: string + clientMetadata?: ClientMetaData { + [key: string]: string; + }; + ``` - ``` - input: ConfirmResetPasswordInput { - username: string; - newPassword: string; - confirmationCode: string; - options?: { - clientMetadata?: { - [key: string]: string; +
+
+ **V6** + + ``` + input: ConfirmResetPasswordInput { + username: string; + newPassword: string; + confirmationCode: string; + options?: { + clientMetadata?: { + [key: string]: string; + }; }; - }; - } - ``` + } + ``` -
-
+
+
-### Output + #### Output - -
- **V5** - ``` - 'SUCCESS' - ``` - -
-
- **V6** + +
+ **V5** + ``` + 'SUCCESS' + ``` + +
+
+ **V6** - No output in v6 + No output in v6 -
-
+
+
+
### Example @@ -2571,89 +2619,92 @@ This API has been deprecated: existing use cases can be migrated to a combinatio + fetchAuthSession: (options?: FetchAuthSessionOptions) => Promise; ``` -### Input + - -
- **V5** - - ``` - params?: CurrentUserOpts { - bypassCache: boolean; - } - ``` + #### Input -
-
- **V6** - - ``` - // fetchAuthSession - options?: FetchAuthSessionOptions { - forceRefresh?: boolean; - } - ``` + +
+ **V5** + + ``` + params?: CurrentUserOpts { + bypassCache: boolean; + } + ``` -
-
+
+
+ **V6** + + ``` + // fetchAuthSession + options?: FetchAuthSessionOptions { + forceRefresh?: boolean; + } + ``` -### Output +
+
- -
- **V5** - - ``` - CognitoUser { - username: string; - signInUserSession: { - idToken: string; - refreshToken: string; - accessToken: string; - clockDrift: number; - } | null; - authenticationFlowType: string; - } - ``` + #### Output -
-
- **V6** - - ``` - // getCurrentUser - GetCurrentUserOutput: { - username: string; - userId: string; - signInDetails?: { - loginId?: string; - authFlowType?: - | 'USER_SRP_AUTH' - | 'CUSTOM_WITH_SRP' - | 'CUSTOM_WITHOUT_SRP' - | 'USER_PASSWORD_AUTH';; - }; - } + +
+ **V5** + + ``` + CognitoUser { + username: string; + signInUserSession: { + idToken: string; + refreshToken: string; + accessToken: string; + clockDrift: number; + } | null; + authenticationFlowType: string; + } + ``` - // fetchAuthSession - AuthSession { - tokens?: { - idToken?: JWT; - accessToken: JWT; - }; - credentials?: { - accessKeyId: string; - secretAccessKey: string; - sessionToken?: string; - expiration?: Date; - }; - identityId?: string; - userSub?: string; - } - ``` +
+
+ **V6** + + ``` + // getCurrentUser + GetCurrentUserOutput: { + username: string; + userId: string; + signInDetails?: { + loginId?: string; + authFlowType?: + | 'USER_SRP_AUTH' + | 'CUSTOM_WITH_SRP' + | 'CUSTOM_WITHOUT_SRP' + | 'USER_PASSWORD_AUTH';; + }; + } -
-
+ // fetchAuthSession + AuthSession { + tokens?: { + idToken?: JWT; + accessToken: JWT; + }; + credentials?: { + accessKeyId: string; + secretAccessKey: string; + sessionToken?: string; + expiration?: Date; + }; + identityId?: string; + userSub?: string; + } + ``` + +
+
+
### Example @@ -2724,89 +2775,92 @@ This API has been deprecated: existing use cases can be migrated to a combinatio + fetchAuthSession: (options?: FetchAuthSessionOptions) => Promise; ``` -### Input + - -
- **V5** - - ``` - params?: CurrentUserOpts { - bypassCache: boolean; - } - ``` + #### Input -
-
- **V6** - - ``` - // fetchAuthSession - options?: FetchAuthSessionOptions { - forceRefresh?: boolean; - } - ``` + +
+ **V5** + + ``` + params?: CurrentUserOpts { + bypassCache: boolean; + } + ``` -
-
+
+
+ **V6** + + ``` + // fetchAuthSession + options?: FetchAuthSessionOptions { + forceRefresh?: boolean; + } + ``` -### Output +
+
- -
- **V5** - - ``` - CognitoUser { - username: string; - signInUserSession: { - idToken: string; - refreshToken: string; - accessToken: string; - clockDrift: number; - } | null; - authenticationFlowType: string; - } - ``` + #### Output -
-
- **V6** - - ``` - // getCurrentUser - GetCurrentUserOutput: { - username: string; - userId: string; - signInDetails?: { - loginId?: string; - authFlowType?: - | 'USER_SRP_AUTH' - | 'CUSTOM_WITH_SRP' - | 'CUSTOM_WITHOUT_SRP' - | 'USER_PASSWORD_AUTH';; - }; - } + +
+ **V5** + + ``` + CognitoUser { + username: string; + signInUserSession: { + idToken: string; + refreshToken: string; + accessToken: string; + clockDrift: number; + } | null; + authenticationFlowType: string; + } + ``` - // fetchAuthSession - AuthSession { - tokens?: { - idToken?: JWT; - accessToken: JWT; - }; - credentials?: { - accessKeyId: string; - secretAccessKey: string; - sessionToken?: string; - expiration?: Date; - }; - identityId?: string; - userSub?: string; - } - ``` +
+
+ **V6** + + ``` + // getCurrentUser + GetCurrentUserOutput: { + username: string; + userId: string; + signInDetails?: { + loginId?: string; + authFlowType?: + | 'USER_SRP_AUTH' + | 'CUSTOM_WITH_SRP' + | 'CUSTOM_WITHOUT_SRP' + | 'USER_PASSWORD_AUTH';; + }; + } -
-
+ // fetchAuthSession + AuthSession { + tokens?: { + idToken?: JWT; + accessToken: JWT; + }; + credentials?: { + accessKeyId: string; + secretAccessKey: string; + sessionToken?: string; + expiration?: Date; + }; + identityId?: string; + userSub?: string; + } + ``` + +
+
+
### Example @@ -2864,65 +2918,68 @@ This API has been deprecated: existing use cases can be migrated to a combinatio + fetchAuthSession: (options?: FetchAuthSessionOptions) => Promise; ``` -### Input + - -
- **V5** - - No input in v5 + #### Input -
-
- **V6** - - ``` - options?: FetchAuthSessionOptions { - forceRefresh?: boolean; - } - ``` - -
-
+ +
+ **V5** -### Output + No input in v5 - -
- **V5** +
+
+ **V6** + + ``` + options?: FetchAuthSessionOptions { + forceRefresh?: boolean; + } + ``` - ``` - CognitoUserSession { - idToken: string; - refreshToken: string; - accessToken: string; - clockDrift: number; - } - ``` +
+
-
-
- **V6** - - ``` - AuthSession { - tokens?: { - idToken?: JWT; - accessToken: JWT; - }; - credentials?: { - accessKeyId: string; - secretAccessKey: string; - sessionToken?: string; - expiration?: Date; - }; - identityId?: string; - userSub?: string; - } - ``` + #### Output + + +
+ **V5** + + ``` + CognitoUserSession { + idToken: string; + refreshToken: string; + accessToken: string; + clockDrift: number; + } + ``` -
-
+
+
+ **V6** + + ``` + AuthSession { + tokens?: { + idToken?: JWT; + accessToken: JWT; + }; + credentials?: { + accessKeyId: string; + secretAccessKey: string; + sessionToken?: string; + expiration?: Date; + }; + identityId?: string; + userSub?: string; + } + ``` + +
+
+
### Example @@ -2980,67 +3037,70 @@ This API has been deprecated: existing use cases can be migrated to a combinatio + fetchAuthSession: (options?: FetchAuthSessionOptions) => Promise; ``` -### Input + - -
- **V5** - - ``` - user: CognitoUser - ``` + #### Input -
-
- **V6** - - ``` - options?: FetchAuthSessionOptions { - forceRefresh?: boolean; - } - ``` + +
+ **V5** + + ``` + user: CognitoUser + ``` -
-
+
+
+ **V6** + + ``` + options?: FetchAuthSessionOptions { + forceRefresh?: boolean; + } + ``` -### Output +
+
- -
- **V5** - - ``` - CognitoUserSession { - idToken: string; - refreshToken: string; - accessToken: string; - clockDrift: number; - } - ``` + #### Output -
-
- **V6** - - ``` - AuthSession { - tokens?: { - idToken?: JWT; - accessToken: JWT; - }; - credentials?: { - accessKeyId: string; - secretAccessKey: string; - sessionToken?: string; - expiration?: Date; - }; - identityId?: string; - userSub?: string; - } - ``` + +
+ **V5** + + ``` + CognitoUserSession { + idToken: string; + refreshToken: string; + accessToken: string; + clockDrift: number; + } + ``` -
-
+
+
+ **V6** + + ``` + AuthSession { + tokens?: { + idToken?: JWT; + accessToken: JWT; + }; + credentials?: { + accessKeyId: string; + secretAccessKey: string; + sessionToken?: string; + expiration?: Date; + }; + identityId?: string; + userSub?: string; + } + ``` + +
+
+
### Example @@ -3096,50 +3156,53 @@ This API has been deprecated: existing use cases can be migrated to a combinatio + fetchUserAttributes: () => Promise; ``` -### Input + - -
- **V5** - - ``` - user: CognitoUser - ``` + #### Input -
-
- **V6** + +
+ **V5** + + ``` + user: CognitoUser + ``` - No input in v6 +
+
+ **V6** -
-
+ No input in v6 -### Output +
+
- -
- **V5** - - ``` - CognitoUserAttribute[]: { - Name: string; - Value: string; - }[] - ``` + #### Output -
-
- **V6** - - ``` - FetchUserAttributesOutput { - [key: string]?: string; - } - ``` + +
+ **V5** + + ``` + CognitoUserAttribute[]: { + Name: string; + Value: string; + }[] + ``` -
-
+
+
+ **V6** + + ``` + FetchUserAttributesOutput { + [key: string]?: string; + } + ``` + +
+
+
### Example @@ -3185,76 +3248,79 @@ This API has been deprecated: existing use cases can be migrated to a combinatio + updateUserAttributes: (input: UpdateUserAttributesInput) => Promise; ``` -### Input + - -
- **V5** - - ``` - user: CognitoUser - attributes: object - clientMetadata?: ClientMetaData { - [key: string]: string; - } - ``` + #### Input -
-
- **V6** - - ``` - input: UpdateUserAttributesInput { - userAttributes: { - [key: string]?: string; - }; - options?: { - clientMetadata?: ClientMetaData { - [key: string]: string; - } - }; - } - ``` -
-
+ +
+ **V5** + + ``` + user: CognitoUser + attributes: object + clientMetadata?: ClientMetaData { + [key: string]: string; + } + ``` -### Output +
+
+ **V6** + + ``` + input: UpdateUserAttributesInput { + userAttributes: { + [key: string]?: string; + }; + options?: { + clientMetadata?: ClientMetaData { + [key: string]: string; + } + }; + } + ``` +
+
- -
- **V5** - - ``` - 'SUCCESS' - ``` + #### Output -
-
- **V6** - - ``` - UpdateUserAttributesOutput { - [authKey in UserAttributeKey]: { - isUpdated: boolean; - nextStep: { - updateAttributeStep: - | 'CONFIRM_ATTRIBUTE_WITH_CODE' - | 'DONE'; - codeDeliveryDetails?: { - destination?: string; - deliveryMedium?: - | 'EMAIL' - | 'SMS' - | 'PHONE' - | 'UNKNOWN'; - attributeName?: UserAttributeKey; + +
+ **V5** + + ``` + 'SUCCESS' + ``` + +
+
+ **V6** + + ``` + UpdateUserAttributesOutput { + [authKey in UserAttributeKey]: { + isUpdated: boolean; + nextStep: { + updateAttributeStep: + | 'CONFIRM_ATTRIBUTE_WITH_CODE' + | 'DONE'; + codeDeliveryDetails?: { + destination?: string; + deliveryMedium?: + | 'EMAIL' + | 'SMS' + | 'PHONE' + | 'UNKNOWN'; + attributeName?: UserAttributeKey; + }; }; }; - }; - } - ``` -
-
+ } + ``` +
+
+
### Example @@ -3301,48 +3367,51 @@ This API has been deprecated: existing use cases can be migrated to a combinatio + deleteUserAttributes: (input: DeleteUserAttributesInput) => Promise; ``` -### Input + - -
- **V5** - - ``` - user: CognitoUser - attributeNames: string[] - ``` + #### Input -
-
- **V6** - - ``` - input: DeleteUserAttributesInput { - userAttributeKeys: [UserAttributeKey, ...UserAttributeKey[]]; - } - ``` + +
+ **V5** + + ``` + user: CognitoUser + attributeNames: string[] + ``` -
-
+
+
+ **V6** + + ``` + input: DeleteUserAttributesInput { + userAttributeKeys: [UserAttributeKey, ...UserAttributeKey[]]; + } + ``` -### Output +
+
- -
- **V5** - - ``` - 'SUCCESS' - ``` + #### Output -
-
- **V6** + +
+ **V5** + + ``` + 'SUCCESS' + ``` + +
+
+ **V6** - No output in v6 + No output in v6 -
-
+
+
+
### Example @@ -3388,64 +3457,67 @@ This API has been deprecated: existing use cases can be migrated to a combinatio + sendUserAttributeVerificationCode: (input: SendUserAttributeVerificationCodeInput) => Promise; ``` -### Input + - -
- **V5** - - ``` - user: CognitoUser - attr: string - clientMetadata?: ClientMetadata { - [key: string]: string; - } - ``` + #### Input -
-
- **V6** - - ``` - input: SendUserAttributeVerificationCodeInput { - userAttributeKey: 'email' | 'phone_number'; - options?: { - clientMetadata?: { - [key: string]: string; + +
+ **V5** + + ``` + user: CognitoUser + attr: string + clientMetadata?: ClientMetadata { + [key: string]: string; + } + ``` + +
+
+ **V6** + + ``` + input: SendUserAttributeVerificationCodeInput { + userAttributeKey: 'email' | 'phone_number'; + options?: { + clientMetadata?: { + [key: string]: string; + }; }; - }; - } - ``` + } + ``` -
-
+
+
-### Output + #### Output - -
- **V5** + +
+ **V5** - No output in v5 + No output in v5 -
-
- **V6** +
+
+ **V6** + + ``` + SendUserAttributeVerificationCodeOutput { + destination?: string; + deliveryMedium?: + | 'EMAIL' + | 'SMS' + | 'PHONE' + | 'UNKNOWN'; + attributeName?: 'email' | 'phone_number'; + } + ``` - ``` - SendUserAttributeVerificationCodeOutput { - destination?: string; - deliveryMedium?: - | 'EMAIL' - | 'SMS' - | 'PHONE' - | 'UNKNOWN'; - attributeName?: 'email' | 'phone_number'; - } - ``` - -
-
+
+
+
### Example @@ -3502,50 +3574,53 @@ This API has been deprecated: existing use cases can be migrated to a combinatio + confirmUserAttribute: (input: ConfirmUserAttributeInput) => Promise; ``` -### Input + - -
- **V5** - - ``` - user: CognitoUser - attr: string - code: string - ``` + #### Input -
-
- **V6** - - ``` - input: ConfirmUserAttributeInput { - userAttributeKey: 'email' | 'phone_number'; - confirmationCode: string; - } - ``` + +
+ **V5** + + ``` + user: CognitoUser + attr: string + code: string + ``` -
-
+
+
+ **V6** + + ``` + input: ConfirmUserAttributeInput { + userAttributeKey: 'email' | 'phone_number'; + confirmationCode: string; + } + ``` -### Output +
+
- -
- **V5** + #### Output - ``` - 'SUCCESS' - ``` + +
+ **V5** -
-
- **V6** + ``` + 'SUCCESS' + ``` + +
+
+ **V6** - No output in v6 + No output in v6 -
-
+
+
+
### Example @@ -3600,59 +3675,62 @@ This API has been deprecated: existing use cases can be migrated to a combinatio + sendUserAttributeVerificationCode: (input: SendUserAttributeVerificationCodeInput) => Promise; ``` -### Input + - -
- **V5** - - ``` - attr: string - ``` + #### Input -
-
- **V6** - - ``` - input: SendUserAttributeVerificationCodeInput { - userAttributeKey: 'email' | 'phone_number'; - options?: { - clientMetadata?: { - [key: string]: string; + +
+ **V5** + + ``` + attr: string + ``` + +
+
+ **V6** + + ``` + input: SendUserAttributeVerificationCodeInput { + userAttributeKey: 'email' | 'phone_number'; + options?: { + clientMetadata?: { + [key: string]: string; + }; }; - }; - } - ``` - -
-
+ } + ``` + +
+
-### Output + #### Output - -
- **V5** + +
+ **V5** - No output in v5 + No output in v5 -
-
- **V6** - - ``` - SendUserAttributeVerificationCodeOutput { - destination?: string; - deliveryMedium?: - | 'EMAIL' - | 'SMS' - | 'PHONE' - | 'UNKNOWN'; - attributeName?: 'email' | 'phone_number'; - } - ``` -
-
+
+
+ **V6** + + ``` + SendUserAttributeVerificationCodeOutput { + destination?: string; + deliveryMedium?: + | 'EMAIL' + | 'SMS' + | 'PHONE' + | 'UNKNOWN'; + attributeName?: 'email' | 'phone_number'; + } + ``` +
+
+
### Example @@ -3699,48 +3777,51 @@ This API has been deprecated: existing use cases can be migrated to a combinatio + confirmUserAttribute: (input: ConfirmUserAttributeInput) => Promise; ``` -### Input + - -
- **V5** - - ``` - attr: string - code: string - ``` + #### Input -
-
- **V6** - - ``` - input: ConfirmUserAttributeInput { - userAttributeKey: 'email' | 'phone_number'; - confirmationCode: string; - } - ``` -
-
+ +
+ **V5** + + ``` + attr: string + code: string + ``` + +
+
+ **V6** + + ``` + input: ConfirmUserAttributeInput { + userAttributeKey: 'email' | 'phone_number'; + confirmationCode: string; + } + ``` +
+
-### Output + #### Output - -
- **V5** - - ``` - 'SUCCESS' - ``` - -
-
- **V6** + +
+ **V5** + + ``` + 'SUCCESS' + ``` + +
+
+ **V6** - No output in v6 + No output in v6 -
-
+
+
+
### Example @@ -3793,24 +3874,24 @@ This API has been deprecated: existing use cases can be migrated to a combinatio + rememberDevice: () => Promise; ``` -### Output - - -
- **V5** - - ``` - 'SUCCESS' - ``` - -
-
- **V6** + + +
+ **V5** + + ``` + 'SUCCESS' + ``` + +
+
+ **V6** - No output in v6 + No output in v6 -
-
+
+
+ ### Example @@ -3851,28 +3932,28 @@ This API has been deprecated: existing use cases can be migrated to a combinatio + forgetDevice: (input?: ForgetDeviceInput) => Promise; ``` -### Input - - -
- **V5** + + +
+ **V5** - No input in v5 + No input in v5 -
-
- **V6** - - ``` - input?: ForgetDeviceInput { - device?: { - id: string; +
+
+ **V6** + + ``` + input?: ForgetDeviceInput { + device?: { + id: string; + } } - } - ``` + ``` -
-
+
+
+ ### Example @@ -3915,67 +3996,70 @@ This API has been deprecated: existing use cases can be migrated to the `fetchAu + fetchAuthSession: (options?: FetchAuthSessionOptions) => Promise; ``` -### Input - - -
- **V5** + - No input in v5 + #### Input -
-
- **V6** - - ``` - options?: FetchAuthSessionOptions { - forceRefresh?: boolean; - } - ``` + +
+ **V5** -
-
+ No input in v5 -### Output +
+
+ **V6** + + ``` + options?: FetchAuthSessionOptions { + forceRefresh?: boolean; + } + ``` - -
- **V5** - - ``` - ICredentials { - accessKeyId: string; - sessionToken: string; - secretAccessKey: string; - identityId: string; - authenticated: boolean; - expiration?: Date; - } - ``` +
+
-
-
- **V6** - - ``` - AuthSession { - tokens?: { - idToken?: JWT; - accessToken: JWT; - }; - credentials?: { + #### Output + + +
+ **V5** + + ``` + ICredentials { accessKeyId: string; + sessionToken: string; secretAccessKey: string; - sessionToken?: string; + identityId: string; + authenticated: boolean; expiration?: Date; - }; - identityId?: string; - userSub?: string; - } - ``` + } + ``` -
-
+
+
+ **V6** + + ``` + AuthSession { + tokens?: { + idToken?: JWT; + accessToken: JWT; + }; + credentials?: { + accessKeyId: string; + secretAccessKey: string; + sessionToken?: string; + expiration?: Date; + }; + identityId?: string; + userSub?: string; + } + ``` + +
+
+ ### Example @@ -4045,66 +4129,69 @@ This API has been deprecated: existing use cases can be migrated to the `fetchAu + fetchAuthSession: (options?: FetchAuthSessionOptions) => Promise; ``` -### Input - - -
- **V5** + - No input in v5 + #### Input -
-
- **V6** - - ``` - options?: FetchAuthSessionOptions { - forceRefresh?: boolean; - } - ``` - -
-
+ +
+ **V5** -### Output + No input in v5 - -
- **V5** +
+
+ **V6** + + ``` + options?: FetchAuthSessionOptions { + forceRefresh?: boolean; + } + ``` - ``` - ICredentials { - accessKeyId: string; - sessionToken: string; - secretAccessKey: string; - identityId: string; - authenticated: boolean; - expiration?: Date; - } - ``` +
+
-
-
- **V6** - - ``` - AuthSession { - tokens?: { - idToken?: JWT; - accessToken: JWT; - }; - credentials?: { + #### Output + + +
+ **V5** + + ``` + ICredentials { accessKeyId: string; + sessionToken: string; secretAccessKey: string; - sessionToken?: string; + identityId: string; + authenticated: boolean; expiration?: Date; - }; - identityId?: string; - userSub?: string; - } - ``` -
-
+ } + ``` + +
+
+ **V6** + + ``` + AuthSession { + tokens?: { + idToken?: JWT; + accessToken: JWT; + }; + credentials?: { + accessKeyId: string; + secretAccessKey: string; + sessionToken?: string; + expiration?: Date; + }; + identityId?: string; + userSub?: string; + } + ``` +
+
+ ### Example @@ -4175,49 +4262,49 @@ This API has been deprecated: existing use cases can be migrated by using a comb + fetchUserAttributes: () => Promise; ``` -### Output - - -
- **V5** - - ``` - { - id?: string; - username: string; - attributes: { - [key: string]: string; - }; - } - ``` - -
-
- **V6** + + +
+ **V5** + + ``` + { + id?: string; + username: string; + attributes: { + [key: string]: string; + }; + } + ``` - ``` - // getCurrentUser - GetCurrentUserOutput: { - username: string; - userId: string; - signInDetails?: { - loginId?: string; - authFlowType?: - | 'USER_SRP_AUTH' - | 'CUSTOM_WITH_SRP' - | 'CUSTOM_WITHOUT_SRP' - | 'USER_PASSWORD_AUTH';; - }; - } +
+
+ **V6** + + ``` + // getCurrentUser + GetCurrentUserOutput: { + username: string; + userId: string; + signInDetails?: { + loginId?: string; + authFlowType?: + | 'USER_SRP_AUTH' + | 'CUSTOM_WITH_SRP' + | 'CUSTOM_WITHOUT_SRP' + | 'USER_PASSWORD_AUTH';; + }; + } - // fetchUserAttributes - FetchUserAttributesOutput { - [key: string]?: string; - } - ``` + // fetchUserAttributes + FetchUserAttributesOutput { + [key: string]?: string; + } + ``` -
-
+
+
+ ### Example @@ -4275,56 +4362,59 @@ This API has been deprecated: existing use cases can be migrated to the `fetchUs + fetchUserAttributes: () => Promise; ``` -### Input + - -
- **V5** - - ``` - user: CognitoUser - ``` - -
-
- **V6** + #### Input - No input in v6 + +
+ **V5** + + ``` + user: CognitoUser + ``` + +
+
+ **V6** -
-
+ No input in v6 -### Output +
+
- -
- **V5** - - ``` - { - verified: { - email?: boolean; - phone_number?: boolean; - }, - unverified: { - email?: boolean; - phone_number?: boolean; + #### Output + + +
+ **V5** + + ``` + { + verified: { + email?: boolean; + phone_number?: boolean; + }, + unverified: { + email?: boolean; + phone_number?: boolean; + } } - } - ``` + ``` -
-
- **V6** +
+
+ **V6** - ``` - FetchUserAttributesOutput { - [key: string]?: string; - } - ``` + ``` + FetchUserAttributesOutput { + [key: string]?: string; + } + ``` -
-
+
+
+
### Example @@ -4379,56 +4469,59 @@ This API has been deprecated: existing use cases can be migrated to the `updateM + updateMFAPreference: (input: UpdateMFAPreferenceInput) => Promise; ``` -### Input + - -
- **V5** - - ``` - user: CognitoUser - ``` + #### Input -
-
- **V6** - - ``` - input: UpdateMFAPreferenceInput { - sms?: - | 'ENABLED' - | 'DISABLED' - | 'PREFERRED' - | 'NOT_PREFERRED' - mfa?: - | 'ENABLED' - | 'DISABLED' - | 'PREFERRED' - | 'NOT_PREFERRED' - } - ``` + +
+ **V5** + + ``` + user: CognitoUser + ``` -
-
+
+
+ **V6** + + ``` + input: UpdateMFAPreferenceInput { + sms?: + | 'ENABLED' + | 'DISABLED' + | 'PREFERRED' + | 'NOT_PREFERRED' + mfa?: + | 'ENABLED' + | 'DISABLED' + | 'PREFERRED' + | 'NOT_PREFERRED' + } + ``` -### Output +
+
- -
- **V5** + #### Output + + +
+ **V5** + + ``` + 'SUCCESS' + ``` - ``` - 'SUCCESS' - ``` - -
-
- **V6** +
+
+ **V6** - No output in v6 + No output in v6 -
-
+
+
+
### Example @@ -4471,56 +4564,59 @@ This API has been deprecated: existing use cases can be migrated to the `updateM + updateMFAPreference: (input: UpdateMFAPreferenceInput) => Promise; ``` -### Input + - -
- **V5** - - ``` - user: CognitoUser - ``` + #### Input -
-
- **V6** - - ``` - input: UpdateMFAPreferenceInput { - sms?: - | 'ENABLED' - | 'DISABLED' - | 'PREFERRED' - | 'NOT_PREFERRED' - mfa?: - | 'ENABLED' - | 'DISABLED' - | 'PREFERRED' - | 'NOT_PREFERRED' - } - ``` + +
+ **V5** + + ``` + user: CognitoUser + ``` -
-
+
+
+ **V6** + + ``` + input: UpdateMFAPreferenceInput { + sms?: + | 'ENABLED' + | 'DISABLED' + | 'PREFERRED' + | 'NOT_PREFERRED' + mfa?: + | 'ENABLED' + | 'DISABLED' + | 'PREFERRED' + | 'NOT_PREFERRED' + } + ``` -### Output +
+
- -
- **V5** - - ``` - 'SUCCESS' - ``` + #### Output -
-
- **V6** + +
+ **V5** + + ``` + 'SUCCESS' + ``` + +
+
+ **V6** - No output in v6 + No output in v6 -
-
+
+
+
### Example