UNPKG

@aws-sdk/client-cognito-identity-provider

Version:

AWS SDK for JavaScript Cognito Identity Provider Client for Node.js, Browser and React Native

1,292 lines 379 kB
import { ExceptionOptionType as __ExceptionOptionType } from "@smithy/smithy-client"; import { CognitoIdentityProviderServiceException as __BaseException } from "./CognitoIdentityProviderServiceException"; /** * @public * @enum */ export declare const RecoveryOptionNameType: { readonly ADMIN_ONLY: "admin_only"; readonly VERIFIED_EMAIL: "verified_email"; readonly VERIFIED_PHONE_NUMBER: "verified_phone_number"; }; /** * @public */ export type RecoveryOptionNameType = (typeof RecoveryOptionNameType)[keyof typeof RecoveryOptionNameType]; /** * <p>A map containing a priority as a key, and recovery method name as a value.</p> * @public */ export interface RecoveryOptionType { /** * <p>A positive integer specifying priority of a method with 1 being the highest * priority.</p> * @public */ Priority: number | undefined; /** * <p>The recovery method for a user.</p> * @public */ Name: RecoveryOptionNameType | undefined; } /** * <p>The data type for <code>AccountRecoverySetting</code>.</p> * @public */ export interface AccountRecoverySettingType { /** * <p>The list of <code>RecoveryOptionTypes</code>.</p> * @public */ RecoveryMechanisms?: RecoveryOptionType[]; } /** * @public * @enum */ export declare const AccountTakeoverEventActionType: { readonly BLOCK: "BLOCK"; readonly MFA_IF_CONFIGURED: "MFA_IF_CONFIGURED"; readonly MFA_REQUIRED: "MFA_REQUIRED"; readonly NO_ACTION: "NO_ACTION"; }; /** * @public */ export type AccountTakeoverEventActionType = (typeof AccountTakeoverEventActionType)[keyof typeof AccountTakeoverEventActionType]; /** * <p>Account takeover action type.</p> * @public */ export interface AccountTakeoverActionType { /** * <p>Flag specifying whether to send a notification.</p> * @public */ Notify: boolean | undefined; /** * <p>The action to take in response to the account takeover action. Valid values are as * follows:</p> * <ul> * <li> * <p> * <code>BLOCK</code> Choosing this action will block the request.</p> * </li> * <li> * <p> * <code>MFA_IF_CONFIGURED</code> Present an MFA challenge if user has configured * it, else allow the request.</p> * </li> * <li> * <p> * <code>MFA_REQUIRED</code> Present an MFA challenge if user has configured it, * else block the request.</p> * </li> * <li> * <p> * <code>NO_ACTION</code> Allow the user to sign in.</p> * </li> * </ul> * @public */ EventAction: AccountTakeoverEventActionType | undefined; } /** * <p>Account takeover actions type.</p> * @public */ export interface AccountTakeoverActionsType { /** * <p>Action to take for a low risk.</p> * @public */ LowAction?: AccountTakeoverActionType; /** * <p>Action to take for a medium risk.</p> * @public */ MediumAction?: AccountTakeoverActionType; /** * <p>Action to take for a high risk.</p> * @public */ HighAction?: AccountTakeoverActionType; } /** * <p>The notify email type.</p> * @public */ export interface NotifyEmailType { /** * <p>The email subject.</p> * @public */ Subject: string | undefined; /** * <p>The email HTML body.</p> * @public */ HtmlBody?: string; /** * <p>The email text body.</p> * @public */ TextBody?: string; } /** * <p>The notify configuration type.</p> * @public */ export interface NotifyConfigurationType { /** * <p>The email address that is sending the email. The address must be either individually * verified with Amazon Simple Email Service, or from a domain that has been verified with Amazon SES.</p> * @public */ From?: string; /** * <p>The destination to which the receiver of an email should reply to.</p> * @public */ ReplyTo?: string; /** * <p>The Amazon Resource Name (ARN) of the identity that is associated with the sending * authorization policy. This identity permits Amazon Cognito to send for the email address * specified in the <code>From</code> parameter.</p> * @public */ SourceArn: string | undefined; /** * <p>Email template used when a detected risk event is blocked.</p> * @public */ BlockEmail?: NotifyEmailType; /** * <p>The email template used when a detected risk event is allowed.</p> * @public */ NoActionEmail?: NotifyEmailType; /** * <p>The multi-factor authentication (MFA) email template used when MFA is challenged as * part of a detected risk.</p> * @public */ MfaEmail?: NotifyEmailType; } /** * <p>Configuration for mitigation actions and notification for different levels of risk * detected for a potential account takeover.</p> * @public */ export interface AccountTakeoverRiskConfigurationType { /** * <p>The notify configuration used to construct email notifications.</p> * @public */ NotifyConfiguration?: NotifyConfigurationType; /** * <p>Account takeover risk configuration actions.</p> * @public */ Actions: AccountTakeoverActionsType | undefined; } /** * @public * @enum */ export declare const AttributeDataType: { readonly BOOLEAN: "Boolean"; readonly DATETIME: "DateTime"; readonly NUMBER: "Number"; readonly STRING: "String"; }; /** * @public */ export type AttributeDataType = (typeof AttributeDataType)[keyof typeof AttributeDataType]; /** * <p>The minimum and maximum values of an attribute that is of the number data type.</p> * @public */ export interface NumberAttributeConstraintsType { /** * <p>The minimum value of an attribute that is of the number data type.</p> * @public */ MinValue?: string; /** * <p>The maximum length of a number attribute value. Must be a number less than or equal to * <code>2^1023</code>, represented as a string with a length of 131072 characters or * fewer.</p> * @public */ MaxValue?: string; } /** * <p>The constraints associated with a string attribute.</p> * @public */ export interface StringAttributeConstraintsType { /** * <p>The minimum length.</p> * @public */ MinLength?: string; /** * <p>The maximum length of a string attribute value. Must be a number less than or equal to * <code>2^1023</code>, represented as a string with a length of 131072 characters or * fewer.</p> * @public */ MaxLength?: string; } /** * <p>A list of the user attributes and their properties in your user pool. The attribute * schema contains standard attributes, custom attributes with a <code>custom:</code> * prefix, and developer attributes with a <code>dev:</code> prefix. For more information, * see <a href="https://docs.aws.amazon.com/cognito/latest/developerguide/user-pool-settings-attributes.html">User pool * attributes</a>.</p> * <p>Developer-only attributes are a legacy feature of user pools, are read-only to all app * clients. You can create and update developer-only attributes only with IAM-authenticated * API operations. Use app client read/write permissions instead.</p> * @public */ export interface SchemaAttributeType { /** * <p>The name of your user pool attribute. When you create or update a user pool, adding a * schema attribute creates a custom or developer-only attribute. When you add an attribute * with a <code>Name</code> value of <code>MyAttribute</code>, Amazon Cognito creates the custom * attribute <code>custom:MyAttribute</code>. When <code>DeveloperOnlyAttribute</code> is * <code>true</code>, Amazon Cognito creates your attribute as <code>dev:MyAttribute</code>. In * an operation that describes a user pool, Amazon Cognito returns this value as <code>value</code> * for standard attributes, <code>custom:value</code> for custom attributes, and * <code>dev:value</code> for developer-only attributes..</p> * @public */ Name?: string; /** * <p>The data format of the values for your attribute. When you choose an * <code>AttributeDataType</code>, Amazon Cognito validates the input against the data type. A * custom attribute value in your user's ID token is always a string, for example * <code>"custom:isMember" : "true"</code> or <code>"custom:YearsAsMember" : * "12"</code>. </p> * @public */ AttributeDataType?: AttributeDataType; /** * <note> * <p>You should use <a href="https://docs.aws.amazon.com/cognito-user-identity-pools/latest/APIReference/API_UserPoolClientType.html#CognitoUserPools-Type-UserPoolClientType-WriteAttributes">WriteAttributes</a> in the user pool client to control how attributes can * be mutated for new use cases instead of using * <code>DeveloperOnlyAttribute</code>.</p> * </note> * <p>Specifies whether the attribute type is developer only. This attribute can only be * modified by an administrator. Users won't be able to modify this attribute using their * access token. For example, <code>DeveloperOnlyAttribute</code> can be modified using * AdminUpdateUserAttributes but can't be updated using UpdateUserAttributes.</p> * @public */ DeveloperOnlyAttribute?: boolean; /** * <p>Specifies whether the value of the attribute can be changed.</p> * <p>Any user pool attribute whose value you map from an IdP attribute must be mutable, * with a parameter value of <code>true</code>. Amazon Cognito updates mapped attributes when users * sign in to your application through an IdP. If an attribute is immutable, Amazon Cognito throws * an error when it attempts to update the attribute. For more information, see <a href="https://docs.aws.amazon.com/cognito/latest/developerguide/cognito-user-pools-specifying-attribute-mapping.html">Specifying Identity Provider Attribute Mappings for Your User * Pool</a>.</p> * @public */ Mutable?: boolean; /** * <p>Specifies whether a user pool attribute is required. If the attribute is required and * the user doesn't provide a value, registration or sign-in will fail.</p> * @public */ Required?: boolean; /** * <p>Specifies the constraints for an attribute of the number type.</p> * @public */ NumberAttributeConstraints?: NumberAttributeConstraintsType; /** * <p>Specifies the constraints for an attribute of the string type.</p> * @public */ StringAttributeConstraints?: StringAttributeConstraintsType; } /** * <p>Represents the request to add custom attributes.</p> * @public */ export interface AddCustomAttributesRequest { /** * <p>The user pool ID for the user pool where you want to add custom attributes.</p> * @public */ UserPoolId: string | undefined; /** * <p>An array of custom attributes, such as Mutable and Name.</p> * @public */ CustomAttributes: SchemaAttributeType[] | undefined; } /** * <p>Represents the response from the server for the request to add custom * attributes.</p> * @public */ export interface AddCustomAttributesResponse { } /** * <p>This exception is thrown when Amazon Cognito encounters an internal error.</p> * @public */ export declare class InternalErrorException extends __BaseException { readonly name: "InternalErrorException"; readonly $fault: "server"; /** * @internal */ constructor(opts: __ExceptionOptionType<InternalErrorException, __BaseException>); } /** * <p>This exception is thrown when the Amazon Cognito service encounters an invalid * parameter.</p> * @public */ export declare class InvalidParameterException extends __BaseException { readonly name: "InvalidParameterException"; readonly $fault: "client"; /** * @internal */ constructor(opts: __ExceptionOptionType<InvalidParameterException, __BaseException>); } /** * <p>This exception is thrown when a user isn't authorized.</p> * @public */ export declare class NotAuthorizedException extends __BaseException { readonly name: "NotAuthorizedException"; readonly $fault: "client"; /** * @internal */ constructor(opts: __ExceptionOptionType<NotAuthorizedException, __BaseException>); } /** * <p>This exception is thrown when the Amazon Cognito service can't find the requested * resource.</p> * @public */ export declare class ResourceNotFoundException extends __BaseException { readonly name: "ResourceNotFoundException"; readonly $fault: "client"; /** * @internal */ constructor(opts: __ExceptionOptionType<ResourceNotFoundException, __BaseException>); } /** * <p>This exception is thrown when the user has made too many requests for a given * operation.</p> * @public */ export declare class TooManyRequestsException extends __BaseException { readonly name: "TooManyRequestsException"; readonly $fault: "client"; /** * @internal */ constructor(opts: __ExceptionOptionType<TooManyRequestsException, __BaseException>); } /** * <p>This exception is thrown when you're trying to modify a user pool while a user import * job is in progress for that pool.</p> * @public */ export declare class UserImportInProgressException extends __BaseException { readonly name: "UserImportInProgressException"; readonly $fault: "client"; /** * @internal */ constructor(opts: __ExceptionOptionType<UserImportInProgressException, __BaseException>); } /** * @public */ export interface AdminAddUserToGroupRequest { /** * <p>The user pool ID for the user pool.</p> * @public */ UserPoolId: string | undefined; /** * <p>The username of the user that you want to query or modify. The value of this parameter * is typically your user's username, but it can be any of their alias attributes. If * <code>username</code> isn't an alias attribute in your user pool, this value * must be the <code>sub</code> of a local user or the username of a user from a * third-party IdP.</p> * @public */ Username: string | undefined; /** * <p>The name of the group that you want to add your user to.</p> * @public */ GroupName: string | undefined; } /** * <p>This exception is thrown when a user isn't found.</p> * @public */ export declare class UserNotFoundException extends __BaseException { readonly name: "UserNotFoundException"; readonly $fault: "client"; /** * @internal */ constructor(opts: __ExceptionOptionType<UserNotFoundException, __BaseException>); } /** * <p>Confirm a user's registration as a user pool administrator.</p> * @public */ export interface AdminConfirmSignUpRequest { /** * <p>The user pool ID for which you want to confirm user registration.</p> * @public */ UserPoolId: string | undefined; /** * <p>The username of the user that you want to query or modify. The value of this parameter * is typically your user's username, but it can be any of their alias attributes. If * <code>username</code> isn't an alias attribute in your user pool, this value * must be the <code>sub</code> of a local user or the username of a user from a * third-party IdP.</p> * @public */ Username: string | undefined; /** * <p>A map of custom key-value pairs that you can provide as input for any custom workflows * that this action triggers.</p> * <p>If your user pool configuration includes triggers, the AdminConfirmSignUp API action * invokes the Lambda function that is specified for the <i>post * confirmation</i> trigger. When Amazon Cognito invokes this function, it passes a JSON * payload, which the function receives as input. In this payload, the * <code>clientMetadata</code> attribute provides the data that you assigned to the * ClientMetadata parameter in your AdminConfirmSignUp request. In your function code in * Lambda, you can process the ClientMetadata value to enhance your workflow for your * specific needs.</p> * <p>For more information, see <a href="https://docs.aws.amazon.com/cognito/latest/developerguide/cognito-user-identity-pools-working-with-aws-lambda-triggers.html"> * Customizing user pool Workflows with Lambda Triggers</a> in the <i>Amazon Cognito Developer Guide</i>.</p> * <note> * <p>When you use the ClientMetadata parameter, remember that Amazon Cognito won't do the * following:</p> * <ul> * <li> * <p>Store the ClientMetadata value. This data is available only to Lambda * triggers that are assigned to a user pool to support custom workflows. If * your user pool configuration doesn't include triggers, the ClientMetadata * parameter serves no purpose.</p> * </li> * <li> * <p>Validate the ClientMetadata value.</p> * </li> * <li> * <p>Encrypt the ClientMetadata value. Don't use Amazon Cognito to provide sensitive * information.</p> * </li> * </ul> * </note> * @public */ ClientMetadata?: Record<string, string>; } /** * <p>Represents the response from the server for the request to confirm * registration.</p> * @public */ export interface AdminConfirmSignUpResponse { } /** * <p>This exception is thrown when Amazon Cognito encounters an invalid Lambda response.</p> * @public */ export declare class InvalidLambdaResponseException extends __BaseException { readonly name: "InvalidLambdaResponseException"; readonly $fault: "client"; /** * @internal */ constructor(opts: __ExceptionOptionType<InvalidLambdaResponseException, __BaseException>); } /** * <p>This exception is thrown when a user exceeds the limit for a requested Amazon Web Services * resource.</p> * @public */ export declare class LimitExceededException extends __BaseException { readonly name: "LimitExceededException"; readonly $fault: "client"; /** * @internal */ constructor(opts: __ExceptionOptionType<LimitExceededException, __BaseException>); } /** * <p>This exception is thrown when the user has made too many failed attempts for a given * action, such as sign-in.</p> * @public */ export declare class TooManyFailedAttemptsException extends __BaseException { readonly name: "TooManyFailedAttemptsException"; readonly $fault: "client"; /** * @internal */ constructor(opts: __ExceptionOptionType<TooManyFailedAttemptsException, __BaseException>); } /** * <p>This exception is thrown when Amazon Cognito encounters an unexpected exception with * Lambda.</p> * @public */ export declare class UnexpectedLambdaException extends __BaseException { readonly name: "UnexpectedLambdaException"; readonly $fault: "client"; /** * @internal */ constructor(opts: __ExceptionOptionType<UnexpectedLambdaException, __BaseException>); } /** * <p>This exception is thrown when the Amazon Cognito service encounters a user validation exception * with the Lambda service.</p> * @public */ export declare class UserLambdaValidationException extends __BaseException { readonly name: "UserLambdaValidationException"; readonly $fault: "client"; /** * @internal */ constructor(opts: __ExceptionOptionType<UserLambdaValidationException, __BaseException>); } /** * @public * @enum */ export declare const DeliveryMediumType: { readonly EMAIL: "EMAIL"; readonly SMS: "SMS"; }; /** * @public */ export type DeliveryMediumType = (typeof DeliveryMediumType)[keyof typeof DeliveryMediumType]; /** * @public * @enum */ export declare const MessageActionType: { readonly RESEND: "RESEND"; readonly SUPPRESS: "SUPPRESS"; }; /** * @public */ export type MessageActionType = (typeof MessageActionType)[keyof typeof MessageActionType]; /** * <p>Specifies whether the attribute is standard or custom.</p> * @public */ export interface AttributeType { /** * <p>The name of the attribute.</p> * @public */ Name: string | undefined; /** * <p>The value of the attribute.</p> * @public */ Value?: string; } /** * <p>Represents the request to create a user in the specified user pool.</p> * @public */ export interface AdminCreateUserRequest { /** * <p>The user pool ID for the user pool where the user will be created.</p> * @public */ UserPoolId: string | undefined; /** * <p>The value that you want to set as the username sign-in attribute. The following * conditions apply to the username parameter.</p> * <ul> * <li> * <p>The username can't be a duplicate of another username in the same user * pool.</p> * </li> * <li> * <p>You can't change the value of a username after you create it.</p> * </li> * <li> * <p>You can only provide a value if usernames are a valid sign-in attribute for * your user pool. If your user pool only supports phone numbers or email addresses * as sign-in attributes, Amazon Cognito automatically generates a username value. For more * information, see <a href="https://docs.aws.amazon.com/cognito/latest/developerguide/user-pool-settings-attributes.html#user-pool-settings-aliases">Customizing sign-in attributes</a>.</p> * </li> * </ul> * @public */ Username: string | undefined; /** * <p>An array of name-value pairs that contain user attributes and attribute values to be * set for the user to be created. You can create a user without specifying any attributes * other than <code>Username</code>. However, any attributes that you specify as required * (when creating a user pool or in the <b>Attributes</b> tab of * the console) either you should supply (in your call to <code>AdminCreateUser</code>) or * the user should supply (when they sign up in response to your welcome message).</p> * <p>For custom attributes, you must prepend the <code>custom:</code> prefix to the * attribute name.</p> * <p>To send a message inviting the user to sign up, you must specify the user's email * address or phone number. You can do this in your call to AdminCreateUser or in the * <b>Users</b> tab of the Amazon Cognito console for managing your * user pools.</p> * <p>In your call to <code>AdminCreateUser</code>, you can set the * <code>email_verified</code> attribute to <code>True</code>, and you can set the * <code>phone_number_verified</code> attribute to <code>True</code>. You can also do * this by calling <a href="https://docs.aws.amazon.com/cognito-user-identity-pools/latest/APIReference/API_AdminUpdateUserAttributes.html">AdminUpdateUserAttributes</a>.</p> * <ul> * <li> * <p> * <b>email</b>: The email address of the user to whom * the message that contains the code and username will be sent. Required if the * <code>email_verified</code> attribute is set to <code>True</code>, or if * <code>"EMAIL"</code> is specified in the <code>DesiredDeliveryMediums</code> * parameter.</p> * </li> * <li> * <p> * <b>phone_number</b>: The phone number of the user to * whom the message that contains the code and username will be sent. Required if * the <code>phone_number_verified</code> attribute is set to <code>True</code>, or * if <code>"SMS"</code> is specified in the <code>DesiredDeliveryMediums</code> * parameter.</p> * </li> * </ul> * @public */ UserAttributes?: AttributeType[]; /** * <p>Temporary user attributes that contribute to the outcomes of your pre sign-up Lambda * trigger. This set of key-value pairs are for custom validation of information that you * collect from your users but don't need to retain.</p> * <p>Your Lambda function can analyze this additional data and act on it. Your function * might perform external API operations like logging user attributes and validation data * to Amazon CloudWatch Logs. Validation data might also affect the response that your function returns * to Amazon Cognito, like automatically confirming the user if they sign up from within your * network.</p> * <p>For more information about the pre sign-up Lambda trigger, see <a href="https://docs.aws.amazon.com/cognito/latest/developerguide/user-pool-lambda-pre-sign-up.html">Pre sign-up Lambda trigger</a>.</p> * @public */ ValidationData?: AttributeType[]; /** * <p>The user's temporary password. This password must conform to the password policy that * you specified when you created the user pool.</p> * <p>The temporary password is valid only once. To complete the Admin Create User flow, the * user must enter the temporary password in the sign-in page, along with a new password to * be used in all future sign-ins.</p> * <p>This parameter isn't required. If you don't specify a value, Amazon Cognito generates one for * you.</p> * <p>The temporary password can only be used until the user account expiration limit that * you set for your user pool. To reset the account after that time limit, you must call * <code>AdminCreateUser</code> again and specify <code>RESEND</code> for the * <code>MessageAction</code> parameter.</p> * @public */ TemporaryPassword?: string; /** * <p>This parameter is used only if the <code>phone_number_verified</code> or * <code>email_verified</code> attribute is set to <code>True</code>. Otherwise, it is * ignored.</p> * <p>If this parameter is set to <code>True</code> and the phone number or email address * specified in the UserAttributes parameter already exists as an alias with a different * user, the API call will migrate the alias from the previous user to the newly created * user. The previous user will no longer be able to log in using that alias.</p> * <p>If this parameter is set to <code>False</code>, the API throws an * <code>AliasExistsException</code> error if the alias already exists. The default * value is <code>False</code>.</p> * @public */ ForceAliasCreation?: boolean; /** * <p>Set to <code>RESEND</code> to resend the invitation message to a user that already * exists and reset the expiration limit on the user's account. Set to * <code>SUPPRESS</code> to suppress sending the message. You can specify only one * value.</p> * @public */ MessageAction?: MessageActionType; /** * <p>Specify <code>"EMAIL"</code> if email will be used to send the welcome message. * Specify <code>"SMS"</code> if the phone number will be used. The default value is * <code>"SMS"</code>. You can specify more than one value.</p> * @public */ DesiredDeliveryMediums?: DeliveryMediumType[]; /** * <p>A map of custom key-value pairs that you can provide as input for any custom workflows * that this action triggers.</p> * <p>You create custom workflows by assigning Lambda functions to user pool triggers. * When you use the AdminCreateUser API action, Amazon Cognito invokes the function that is assigned * to the <i>pre sign-up</i> trigger. When Amazon Cognito invokes this function, it * passes a JSON payload, which the function receives as input. This payload contains a * <code>clientMetadata</code> attribute, which provides the data that you assigned to * the ClientMetadata parameter in your AdminCreateUser request. In your function code in * Lambda, you can process the <code>clientMetadata</code> value to enhance your * workflow for your specific needs.</p> * <p>For more information, see <a href="https://docs.aws.amazon.com/cognito/latest/developerguide/cognito-user-identity-pools-working-with-aws-lambda-triggers.html"> * Customizing user pool Workflows with Lambda Triggers</a> in the <i>Amazon Cognito Developer Guide</i>.</p> * <note> * <p>When you use the ClientMetadata parameter, remember that Amazon Cognito won't do the * following:</p> * <ul> * <li> * <p>Store the ClientMetadata value. This data is available only to Lambda * triggers that are assigned to a user pool to support custom workflows. If * your user pool configuration doesn't include triggers, the ClientMetadata * parameter serves no purpose.</p> * </li> * <li> * <p>Validate the ClientMetadata value.</p> * </li> * <li> * <p>Encrypt the ClientMetadata value. Don't use Amazon Cognito to provide sensitive * information.</p> * </li> * </ul> * </note> * @public */ ClientMetadata?: Record<string, string>; } /** * <p> * <i>This data type is no longer supported.</i> Applies only to SMS * multi-factor authentication (MFA) configurations. Does not apply to time-based one-time * password (TOTP) software token MFA configurations.</p> * @public */ export interface MFAOptionType { /** * <p>The delivery medium to send the MFA code. You can use this parameter to set only the * <code>SMS</code> delivery medium value.</p> * @public */ DeliveryMedium?: DeliveryMediumType; /** * <p>The attribute name of the MFA option type. The only valid value is * <code>phone_number</code>.</p> * @public */ AttributeName?: string; } /** * @public * @enum */ export declare const UserStatusType: { readonly ARCHIVED: "ARCHIVED"; readonly COMPROMISED: "COMPROMISED"; readonly CONFIRMED: "CONFIRMED"; readonly EXTERNAL_PROVIDER: "EXTERNAL_PROVIDER"; readonly FORCE_CHANGE_PASSWORD: "FORCE_CHANGE_PASSWORD"; readonly RESET_REQUIRED: "RESET_REQUIRED"; readonly UNCONFIRMED: "UNCONFIRMED"; readonly UNKNOWN: "UNKNOWN"; }; /** * @public */ export type UserStatusType = (typeof UserStatusType)[keyof typeof UserStatusType]; /** * <p>A user profile in a Amazon Cognito user pool.</p> * @public */ export interface UserType { /** * <p>The user name of the user you want to describe.</p> * @public */ Username?: string; /** * <p>A container with information about the user type attributes.</p> * @public */ Attributes?: AttributeType[]; /** * <p>The creation date of the user.</p> * @public */ UserCreateDate?: Date; /** * <p>The date and time when the item was modified. Amazon Cognito returns this timestamp in UNIX epoch time format. Your SDK might render the output in a * human-readable format like ISO 8601 or a Java <code>Date</code> object.</p> * @public */ UserLastModifiedDate?: Date; /** * <p>Specifies whether the user is enabled.</p> * @public */ Enabled?: boolean; /** * <p>The user status. This can be one of the following:</p> * <ul> * <li> * <p>UNCONFIRMED - User has been created but not confirmed.</p> * </li> * <li> * <p>CONFIRMED - User has been confirmed.</p> * </li> * <li> * <p>EXTERNAL_PROVIDER - User signed in with a third-party IdP.</p> * </li> * <li> * <p>UNKNOWN - User status isn't known.</p> * </li> * <li> * <p>RESET_REQUIRED - User is confirmed, but the user must request a code and reset * their password before they can sign in.</p> * </li> * <li> * <p>FORCE_CHANGE_PASSWORD - The user is confirmed and the user can sign in using a * temporary password, but on first sign-in, the user must change their password to * a new value before doing anything else. </p> * </li> * </ul> * @public */ UserStatus?: UserStatusType; /** * <p>The MFA options for the user.</p> * @public */ MFAOptions?: MFAOptionType[]; } /** * <p>Represents the response from the server to the request to create the user.</p> * @public */ export interface AdminCreateUserResponse { /** * <p>The newly created user.</p> * @public */ User?: UserType; } /** * <p>This exception is thrown when a verification code fails to deliver * successfully.</p> * @public */ export declare class CodeDeliveryFailureException extends __BaseException { readonly name: "CodeDeliveryFailureException"; readonly $fault: "client"; /** * @internal */ constructor(opts: __ExceptionOptionType<CodeDeliveryFailureException, __BaseException>); } /** * <p>This exception is thrown when Amazon Cognito encounters an invalid password.</p> * @public */ export declare class InvalidPasswordException extends __BaseException { readonly name: "InvalidPasswordException"; readonly $fault: "client"; /** * @internal */ constructor(opts: __ExceptionOptionType<InvalidPasswordException, __BaseException>); } /** * <p>This exception is returned when the role provided for SMS configuration doesn't have * permission to publish using Amazon SNS.</p> * @public */ export declare class InvalidSmsRoleAccessPolicyException extends __BaseException { readonly name: "InvalidSmsRoleAccessPolicyException"; readonly $fault: "client"; /** * @internal */ constructor(opts: __ExceptionOptionType<InvalidSmsRoleAccessPolicyException, __BaseException>); } /** * <p>This exception is thrown when the trust relationship is not valid for the role * provided for SMS configuration. This can happen if you don't trust * <code>cognito-idp.amazonaws.com</code> or the external ID provided in the role does * not match what is provided in the SMS configuration for the user pool.</p> * @public */ export declare class InvalidSmsRoleTrustRelationshipException extends __BaseException { readonly name: "InvalidSmsRoleTrustRelationshipException"; readonly $fault: "client"; /** * @internal */ constructor(opts: __ExceptionOptionType<InvalidSmsRoleTrustRelationshipException, __BaseException>); } /** * <p>This exception is thrown when a precondition is not met.</p> * @public */ export declare class PreconditionNotMetException extends __BaseException { readonly name: "PreconditionNotMetException"; readonly $fault: "client"; /** * @internal */ constructor(opts: __ExceptionOptionType<PreconditionNotMetException, __BaseException>); } /** * <p>The request failed because the user is in an unsupported state.</p> * @public */ export declare class UnsupportedUserStateException extends __BaseException { readonly name: "UnsupportedUserStateException"; readonly $fault: "client"; /** * @internal */ constructor(opts: __ExceptionOptionType<UnsupportedUserStateException, __BaseException>); } /** * <p>This exception is thrown when Amazon Cognito encounters a user name that already * exists in the user pool.</p> * @public */ export declare class UsernameExistsException extends __BaseException { readonly name: "UsernameExistsException"; readonly $fault: "client"; /** * @internal */ constructor(opts: __ExceptionOptionType<UsernameExistsException, __BaseException>); } /** * <p>The message template structure.</p> * @public */ export interface MessageTemplateType { /** * <p>The message template for SMS messages.</p> * @public */ SMSMessage?: string; /** * <p>The message template for email messages. EmailMessage is allowed only if <a href="https://docs.aws.amazon.com/cognito-user-identity-pools/latest/APIReference/API_EmailConfigurationType.html#CognitoUserPools-Type-EmailConfigurationType-EmailSendingAccount">EmailSendingAccount</a> is DEVELOPER. </p> * @public */ EmailMessage?: string; /** * <p>The subject line for email messages. EmailSubject is allowed only if <a href="https://docs.aws.amazon.com/cognito-user-identity-pools/latest/APIReference/API_EmailConfigurationType.html#CognitoUserPools-Type-EmailConfigurationType-EmailSendingAccount">EmailSendingAccount</a> is DEVELOPER. </p> * @public */ EmailSubject?: string; } /** * <p>The configuration for creating a new user profile.</p> * @public */ export interface AdminCreateUserConfigType { /** * <p>Set to <code>True</code> if only the administrator is allowed to create user profiles. * Set to <code>False</code> if users can sign themselves up via an app.</p> * @public */ AllowAdminCreateUserOnly?: boolean; /** * <p>The user account expiration limit, in days, after which a new account that hasn't * signed in is no longer usable. To reset the account after that time limit, you must call * <code>AdminCreateUser</code> again, specifying <code>"RESEND"</code> for the * <code>MessageAction</code> parameter. The default value for this parameter is * 7.</p> * <note> * <p>If you set a value for <code>TemporaryPasswordValidityDays</code> in * <code>PasswordPolicy</code>, that value will be used, and * <code>UnusedAccountValidityDays</code> will be no longer be an available * parameter for that user pool.</p> * </note> * @public */ UnusedAccountValidityDays?: number; /** * <p>The message template to be used for the welcome message to new users.</p> * <p>See also <a href="https://docs.aws.amazon.com/cognito/latest/developerguide/cognito-user-pool-settings-message-customizations.html#cognito-user-pool-settings-user-invitation-message-customization">Customizing User Invitation Messages</a>.</p> * @public */ InviteMessageTemplate?: MessageTemplateType; } /** * <p>Represents the request to delete a user as an administrator.</p> * @public */ export interface AdminDeleteUserRequest { /** * <p>The user pool ID for the user pool where you want to delete the user.</p> * @public */ UserPoolId: string | undefined; /** * <p>The username of the user that you want to query or modify. The value of this parameter * is typically your user's username, but it can be any of their alias attributes. If * <code>username</code> isn't an alias attribute in your user pool, this value * must be the <code>sub</code> of a local user or the username of a user from a * third-party IdP.</p> * @public */ Username: string | undefined; } /** * <p>Represents the request to delete user attributes as an administrator.</p> * @public */ export interface AdminDeleteUserAttributesRequest { /** * <p>The user pool ID for the user pool where you want to delete user attributes.</p> * @public */ UserPoolId: string | undefined; /** * <p>The username of the user that you want to query or modify. The value of this parameter * is typically your user's username, but it can be any of their alias attributes. If * <code>username</code> isn't an alias attribute in your user pool, this value * must be the <code>sub</code> of a local user or the username of a user from a * third-party IdP.</p> * @public */ Username: string | undefined; /** * <p>An array of strings representing the user attribute names you want to delete.</p> * <p>For custom attributes, you must prepend the <code>custom:</code> prefix to the * attribute name.</p> * @public */ UserAttributeNames: string[] | undefined; } /** * <p>Represents the response received from the server for a request to delete user * attributes.</p> * @public */ export interface AdminDeleteUserAttributesResponse { } /** * <p>A container for information about an IdP for a user pool.</p> * @public */ export interface ProviderUserIdentifierType { /** * <p>The name of the provider, such as Facebook, Google, or Login with Amazon.</p> * @public */ ProviderName?: string; /** * <p>The name of the provider attribute to link to, such as <code>NameID</code>.</p> * @public */ ProviderAttributeName?: string; /** * <p>The value of the provider attribute to link to, such as * <code>xxxxx_account</code>.</p> * @public */ ProviderAttributeValue?: string; } /** * @public */ export interface AdminDisableProviderForUserRequest { /** * <p>The user pool ID for the user pool.</p> * @public */ UserPoolId: string | undefined; /** * <p>The user to be disabled.</p> * @public */ User: ProviderUserIdentifierType | undefined; } /** * @public */ export interface AdminDisableProviderForUserResponse { } /** * <p>This exception is thrown when a user tries to confirm the account with an email * address or phone number that has already been supplied as an alias for a different user * profile. This exception indicates that an account with this email address or phone * already exists in a user pool that you've configured to use email address or phone * number as a sign-in alias.</p> * @public */ export declare class AliasExistsException extends __BaseException { readonly name: "AliasExistsException"; readonly $fault: "client"; /** * @internal */ constructor(opts: __ExceptionOptionType<AliasExistsException, __BaseException>); } /** * <p>Represents the request to disable the user as an administrator.</p> * @public */ export interface AdminDisableUserRequest { /** * <p>The user pool ID for the user pool where you want to disable the user.</p> * @public */ UserPoolId: string | undefined; /** * <p>The username of the user that you want to query or modify. The value of this parameter * is typically your user's username, but it can be any of their alias attributes. If * <code>username</code> isn't an alias attribute in your user pool, this value * must be the <code>sub</code> of a local user or the username of a user from a * third-party IdP.</p> * @public */ Username: string | undefined; } /** * <p>Represents the response received from the server to disable the user as an * administrator.</p> * @public */ export interface AdminDisableUserResponse { } /** * <p>Represents the request that enables the user as an administrator.</p> * @public */ export interface AdminEnableUserRequest { /** * <p>The user pool ID for the user pool where you want to enable the user.</p> * @public */ UserPoolId: string | undefined; /** * <p>The username of the user that you want to query or modify. The value of this parameter * is typically your user's username, but it can be any of their alias attributes. If * <code>username</code> isn't an alias attribute in your user pool, this value * must be the <code>sub</code> of a local user or the username of a user from a * third-party IdP.</p> * @public */ Username: string | undefined; } /** * <p>Represents the response from the server for the request to enable a user as an * administrator.</p> * @public */ export interface AdminEnableUserResponse { } /** * <p>Sends the forgot device request, as an administrator.</p> * @public */ export interface AdminForgetDeviceRequest { /** * <p>The user pool ID.</p> * @public */ UserPoolId: string | undefined; /** * <p>The username of the user that you want to query or modify. The value of this parameter * is typically your user's username, but it can be any of their alias attributes. If * <code>username</code> isn't an alias attribute in your user pool, this value * must be the <code>sub</code> of a local user or the username of a user from a * third-party IdP.</p> * @public */ Username: string | undefined; /** * <p>The device key.</p> * @public */ DeviceKey: string | undefined; } /** * <p>This exception is thrown when the user pool configuration is not valid.</p> * @public */ export declare class InvalidUserPoolConfigurationException extends __BaseException { readonly name: "InvalidUserPoolConfigurationException"; readonly $fault: "client"; /** * @internal */ constructor(opts: __ExceptionOptionType<InvalidUserPoolConfigurationException, __BaseException>); } /** * <p>Represents the request to get the device, as an administrator.</p> * @public */ export interface AdminGetDeviceRequest { /** * <p>The device key.</p> * @public */ DeviceKey: string | undefined; /** * <p>The user pool ID.</p> * @public */ UserPoolId: string | undefined; /** * <p>The username of the user that you want to query or modify. The value of this parameter * is typically your user's username, but it can be any of their alias attributes. If * <code>username</code> isn't an alias attribute in your user pool, this value * must be the <code>sub</code> of a local user or the username of a user from a * third-party IdP.</p> * @public */ Username: string | undefined; } /** * <p>The device type.</p> * @public */ export interface DeviceType { /** * <p>The device key.</p> * @public */ DeviceKey?: string; /** * <p>The device attributes.</p> * @public */ DeviceAttributes?: AttributeType[]; /** * <p>The creation date of the device.</p> * @public */ DeviceCreateDate?: Date; /** * <p>The date and time when the item was modified. Amazon Cognito returns this timestamp in UNIX epoch time format. Your SDK might render the output in a * human-readable format like ISO 8601 or a Java <code>Date</code> object.</p> * @public */ DeviceLastMod