From 65806981f0d587a47cc06106a4333fe0aa965140 Mon Sep 17 00:00:00 2001 From: osama-rizk Date: Tue, 28 Oct 2025 14:09:23 +0100 Subject: [PATCH 01/10] feat(auth): Add email MFA support to Amplify Auth construct --- .changeset/cuddly-clowns-guess.md | 8 +++ packages/auth-construct/API.md | 9 +++ packages/auth-construct/README.md | 30 ++++++++++ packages/auth-construct/src/construct.test.ts | 56 +++++++++++++++++++ packages/auth-construct/src/construct.ts | 35 +++++++++++- packages/auth-construct/src/index.ts | 1 + packages/auth-construct/src/types.ts | 14 ++++- .../src/lambda/reference_auth_initializer.ts | 4 ++ packages/client-config/API.md | 10 ++-- .../client_config_v1.1.ts | 2 +- .../client_config_v1.2.ts | 2 +- .../client_config_v1.3.ts | 2 +- .../client_config_v1.4.ts | 2 +- .../client-config-schema/client_config_v1.ts | 2 +- .../src/client-config-schema/schema_v1.4.json | 2 +- packages/seed/src/auth-seed/config_reader.ts | 2 +- 16 files changed, 165 insertions(+), 16 deletions(-) create mode 100644 .changeset/cuddly-clowns-guess.md diff --git a/.changeset/cuddly-clowns-guess.md b/.changeset/cuddly-clowns-guess.md new file mode 100644 index 00000000000..0f8cfecc53b --- /dev/null +++ b/.changeset/cuddly-clowns-guess.md @@ -0,0 +1,8 @@ +--- +'@aws-amplify/auth-construct': minor +'@aws-amplify/client-config': minor +'@aws-amplify/backend-auth': minor +'@aws-amplify/seed': minor +--- + +feat(auth): Added support for email-MFA in Amplify Auth construct diff --git a/packages/auth-construct/API.md b/packages/auth-construct/API.md index 6c2a137ce37..cfce6840c45 100644 --- a/packages/auth-construct/API.md +++ b/packages/auth-construct/API.md @@ -144,13 +144,22 @@ export type MFA = { mode: 'OPTIONAL' | 'REQUIRED'; } & MFASettings); +// @public +export type MFAEmailSettings = boolean; + // @public export type MFASettings = { + totp?: MFATotpSettings; + sms?: MFASmsSettings; + email: MFAEmailSettings; +} | { totp?: MFATotpSettings; sms: MFASmsSettings; + email?: MFAEmailSettings; } | { totp: MFATotpSettings; sms?: MFASmsSettings; + email?: MFAEmailSettings; }; // @public diff --git a/packages/auth-construct/README.md b/packages/auth-construct/README.md index 90d6b814e3b..b7e5f701af8 100644 --- a/packages/auth-construct/README.md +++ b/packages/auth-construct/README.md @@ -47,6 +47,36 @@ new AmplifyAuth(stack, 'Auth', { }); ``` +### Email login with email MFA + +In this example, you will create a stack with email login and email MFA enabled. Note that email MFA requires an email sender configuration. + +```ts +import { App, Stack } from 'aws-cdk-lib'; +import { AmplifyAuth } from '@aws-amplify/auth-construct'; + +const app = new App(); +const stack = new Stack(app, 'AuthStack'); + +new AmplifyAuth(stack, 'Auth', { + loginWith: { + email: true, + }, + multifactor: { + mode: 'OPTIONAL', + email: true, + sms: false, + totp: false, + }, + senders: { + email: { + fromEmail: 'noreply@example.com', + fromName: 'My App', + }, + }, +}); +``` + ### Customized email and phone login with external login providers In this example, you will create a stack with email, phone, and external login providers. Additionally, you can customize the email and phone verification messages. diff --git a/packages/auth-construct/src/construct.test.ts b/packages/auth-construct/src/construct.test.ts index 35a65167e06..b24607c6e3c 100644 --- a/packages/auth-construct/src/construct.test.ts +++ b/packages/auth-construct/src/construct.test.ts @@ -1169,6 +1169,62 @@ void describe('Auth construct', () => { assert.equal(outputs['mfaConfiguration']['Value'], 'ON'); }); + void it('enables email MFA when email is set to true', () => { + new AmplifyAuth(stack, 'test', { + loginWith: { email: true }, + multifactor: { mode: 'OPTIONAL', email: true }, + senders: { + email: { + fromEmail: 'noreply@example.com', + fromName: 'Example.com', + }, + }, + }); + + const template = Template.fromStack(stack); + template.hasResourceProperties('AWS::Cognito::UserPool', { + EnabledMfas: ['EMAIL_OTP'], + }); + const outputs = template.findOutputs('*'); + assert.equal(outputs['mfaTypes']['Value'], '["EMAIL"]'); + assert.equal(outputs['mfaConfiguration']['Value'], 'OPTIONAL'); + }); + + void it('enables multiple MFA types including email', () => { + new AmplifyAuth(stack, 'test', { + loginWith: { email: true }, + multifactor: { mode: 'REQUIRED', sms: true, totp: true, email: true }, + senders: { + email: { + fromEmail: 'noreply@example.com', + fromName: 'Example.com', + }, + }, + }); + + const template = Template.fromStack(stack); + template.hasResourceProperties('AWS::Cognito::UserPool', { + EnabledMfas: ['SMS_MFA', 'SOFTWARE_TOKEN_MFA', 'EMAIL_OTP'], + }); + const outputs = template.findOutputs('*'); + assert.equal(outputs['mfaTypes']['Value'], '["SMS","TOTP","EMAIL"]'); + assert.equal(outputs['mfaConfiguration']['Value'], 'ON'); + }); + + void it('does not enable email MFA when email is set to false', () => { + new AmplifyAuth(stack, 'test', { + loginWith: { email: true }, + multifactor: { mode: 'OPTIONAL', sms: true, email: false }, + }); + + const template = Template.fromStack(stack); + template.hasResourceProperties('AWS::Cognito::UserPool', { + EnabledMfas: ['SMS_MFA'], + }); + const outputs = template.findOutputs('*'); + assert.equal(outputs['mfaTypes']['Value'], '["SMS"]'); + }); + void it('updates socialProviders and oauth outputs when external providers are present', () => { new AmplifyAuth(stack, 'test', { loginWith: { diff --git a/packages/auth-construct/src/construct.ts b/packages/auth-construct/src/construct.ts index 417475262f9..ce90febca88 100644 --- a/packages/auth-construct/src/construct.ts +++ b/packages/auth-construct/src/construct.ts @@ -231,6 +231,10 @@ export class AmplifyAuth if (!(cfnUserPool instanceof CfnUserPool)) { throw Error('Could not find CfnUserPool resource in stack.'); } + + // Configure email MFA if enabled + this.configureEmailMFA(props.multifactor, cfnUserPool); + const cfnUserPoolClient = userPoolClient.node.findChild( 'Resource', ) as CfnUserPoolClient; @@ -810,7 +814,7 @@ export class AmplifyAuth * Convert user friendly Mfa type to cognito Mfa type. * This eliminates the need for users to import cognito.Mfa. * @param mfa - MFA settings - * @returns cognito MFA type (sms or totp) + * @returns cognito MFA type (sms, totp, or email) */ private getMFAType = ( mfa: AuthProps['multifactor'], @@ -819,6 +823,7 @@ export class AmplifyAuth ? { sms: mfa.sms ? true : false, otp: mfa.totp ? true : false, + email: mfa.email ? true : false, } : undefined; }; @@ -858,6 +863,28 @@ export class AmplifyAuth return undefined; }; + /** + * Configure email MFA if enabled + * @param mfa - MFA settings + * @param cfnUserPool - CloudFormation UserPool resource + */ + private configureEmailMFA = ( + mfa: AuthProps['multifactor'], + cfnUserPool: CfnUserPool, + ): void => { + const enabledMfas = cfnUserPool.enabledMfas || []; + const shouldEnableEmail = mfa && mfa.mode !== 'OFF' && mfa.email; + const hasEmailOtp = enabledMfas.includes('EMAIL_OTP'); + + if (shouldEnableEmail && !hasEmailOtp) { + cfnUserPool.enabledMfas = [...enabledMfas, 'EMAIL_OTP']; + } else if (!shouldEnableEmail && hasEmailOtp) { + cfnUserPool.enabledMfas = enabledMfas.filter( + (mfa) => mfa !== 'EMAIL_OTP', + ); + } + }; + /** * Setup External Providers (OAuth/OIDC/SAML) and related settings * such as OAuth settings and User Pool Domains @@ -1222,14 +1249,18 @@ export class AmplifyAuth // extract the MFA types from the UserPool resource output.mfaTypes = Lazy.string({ produce: () => { + const enabledMfas = cfnUserPool.enabledMfas ?? []; const mfaTypes: string[] = []; - (cfnUserPool.enabledMfas ?? []).forEach((type) => { + enabledMfas.forEach((type: string) => { if (type === 'SMS_MFA') { mfaTypes.push('SMS'); } if (type === 'SOFTWARE_TOKEN_MFA') { mfaTypes.push('TOTP'); } + if (type === 'EMAIL_OTP') { + mfaTypes.push('EMAIL'); + } }); return JSON.stringify(mfaTypes); }, diff --git a/packages/auth-construct/src/index.ts b/packages/auth-construct/src/index.ts index 86f3dd3a4a0..f156c6a24ea 100644 --- a/packages/auth-construct/src/index.ts +++ b/packages/auth-construct/src/index.ts @@ -13,6 +13,7 @@ export { VerificationEmailWithLink, MFA, MFASmsSettings, + MFAEmailSettings, MFATotpSettings, MFASettings, PhoneNumberLogin, diff --git a/packages/auth-construct/src/types.ts b/packages/auth-construct/src/types.ts index 3823690c098..02f314621ce 100644 --- a/packages/auth-construct/src/types.ts +++ b/packages/auth-construct/src/types.ts @@ -120,20 +120,30 @@ export type MFASmsSettings = */ smsMessage: (createCode: () => string) => string; }; +/** + * If true, the MFA token is sent to the user via email. + */ +export type MFAEmailSettings = boolean; /** * If true, the MFA token is a time-based one time password that is generated by a hardware or software token * @see - https://docs.aws.amazon.com/cognito/latest/developerguide/user-pool-settings-mfa-totp.html */ export type MFATotpSettings = boolean; /** - * Configure the MFA types that users can use. At least one of totp or sms is required. + * Configure the MFA types that users can use. At least one of totp, sms, or email is required. */ export type MFASettings = + | { + totp?: MFATotpSettings; + sms?: MFASmsSettings; + email: MFAEmailSettings; + } | { totp?: MFATotpSettings; sms: MFASmsSettings; + email?: MFAEmailSettings; } - | { totp: MFATotpSettings; sms?: MFASmsSettings }; + | { totp: MFATotpSettings; sms?: MFASmsSettings; email?: MFAEmailSettings }; /** * MFA configuration. MFA settings are required if the mode is either "OPTIONAL" or "REQUIRED" diff --git a/packages/backend-auth/src/lambda/reference_auth_initializer.ts b/packages/backend-auth/src/lambda/reference_auth_initializer.ts index f25e0c4ec0a..35ae897c529 100644 --- a/packages/backend-auth/src/lambda/reference_auth_initializer.ts +++ b/packages/backend-auth/src/lambda/reference_auth_initializer.ts @@ -430,6 +430,10 @@ export class ReferenceAuthInitializer { if (userPoolMFA.SoftwareTokenMfaConfiguration?.Enabled) { mfaTypes.push('TOTP'); } + + if (userPoolMFA.EmailMfaConfiguration) { + mfaTypes.push('EMAIL_MFA'); + } // social providers const socialProviders: string[] = []; if (userPoolProviders) { diff --git a/packages/client-config/API.md b/packages/client-config/API.md index 2c1f6d22c9e..56f5a1c5226 100644 --- a/packages/client-config/API.md +++ b/packages/client-config/API.md @@ -253,7 +253,7 @@ interface AWSAmplifyBackendOutputs { user_verification_types?: ('email' | 'phone_number')[]; unauthenticated_identities_enabled?: boolean; mfa_configuration?: 'NONE' | 'OPTIONAL' | 'REQUIRED'; - mfa_methods?: ('SMS' | 'TOTP')[]; + mfa_methods?: ('SMS' | 'TOTP' | 'EMAIL')[]; groups?: { [k: string]: AmplifyUserGroupConfig; }[]; @@ -334,7 +334,7 @@ interface AWSAmplifyBackendOutputs_2 { user_verification_types?: ('email' | 'phone_number')[]; unauthenticated_identities_enabled?: boolean; mfa_configuration?: 'NONE' | 'OPTIONAL' | 'REQUIRED'; - mfa_methods?: ('SMS' | 'TOTP')[]; + mfa_methods?: ('SMS' | 'TOTP' | 'EMAIL')[]; groups?: { [k: string]: AmplifyUserGroupConfig_2; }[]; @@ -415,7 +415,7 @@ interface AWSAmplifyBackendOutputs_3 { user_verification_types?: ('email' | 'phone_number')[]; unauthenticated_identities_enabled?: boolean; mfa_configuration?: 'NONE' | 'OPTIONAL' | 'REQUIRED'; - mfa_methods?: ('SMS' | 'TOTP')[]; + mfa_methods?: ('SMS' | 'TOTP' | 'EMAIL')[]; }; custom?: { [k: string]: unknown; @@ -493,7 +493,7 @@ interface AWSAmplifyBackendOutputs_4 { user_verification_types?: ('email' | 'phone_number')[]; unauthenticated_identities_enabled?: boolean; mfa_configuration?: 'NONE' | 'OPTIONAL' | 'REQUIRED'; - mfa_methods?: ('SMS' | 'TOTP')[]; + mfa_methods?: ('SMS' | 'TOTP' | 'EMAIL')[]; }; custom?: { [k: string]: unknown; @@ -571,7 +571,7 @@ interface AWSAmplifyBackendOutputs_5 { user_verification_types?: ('email' | 'phone_number')[]; unauthenticated_identities_enabled?: boolean; mfa_configuration?: 'NONE' | 'OPTIONAL' | 'REQUIRED'; - mfa_methods?: ('SMS' | 'TOTP')[]; + mfa_methods?: ('SMS' | 'TOTP' | 'EMAIL')[]; }; custom?: { [k: string]: unknown; diff --git a/packages/client-config/src/client-config-schema/client_config_v1.1.ts b/packages/client-config/src/client-config-schema/client_config_v1.1.ts index 0bce94d1a4b..e969a6d9dd7 100644 --- a/packages/client-config/src/client-config-schema/client_config_v1.1.ts +++ b/packages/client-config/src/client-config-schema/client_config_v1.1.ts @@ -146,7 +146,7 @@ export interface AWSAmplifyBackendOutputs { user_verification_types?: ('email' | 'phone_number')[]; unauthenticated_identities_enabled?: boolean; mfa_configuration?: 'NONE' | 'OPTIONAL' | 'REQUIRED'; - mfa_methods?: ('SMS' | 'TOTP')[]; + mfa_methods?: ('SMS' | 'TOTP' | 'EMAIL')[]; }; /** * Outputs generated from defineData diff --git a/packages/client-config/src/client-config-schema/client_config_v1.2.ts b/packages/client-config/src/client-config-schema/client_config_v1.2.ts index f9aa397d970..a5de06aa242 100644 --- a/packages/client-config/src/client-config-schema/client_config_v1.2.ts +++ b/packages/client-config/src/client-config-schema/client_config_v1.2.ts @@ -152,7 +152,7 @@ export interface AWSAmplifyBackendOutputs { user_verification_types?: ('email' | 'phone_number')[]; unauthenticated_identities_enabled?: boolean; mfa_configuration?: 'NONE' | 'OPTIONAL' | 'REQUIRED'; - mfa_methods?: ('SMS' | 'TOTP')[]; + mfa_methods?: ('SMS' | 'TOTP' | 'EMAIL')[]; }; /** * Outputs generated from defineData diff --git a/packages/client-config/src/client-config-schema/client_config_v1.3.ts b/packages/client-config/src/client-config-schema/client_config_v1.3.ts index 560b0773ec5..2dac9a8edb5 100644 --- a/packages/client-config/src/client-config-schema/client_config_v1.3.ts +++ b/packages/client-config/src/client-config-schema/client_config_v1.3.ts @@ -152,7 +152,7 @@ export interface AWSAmplifyBackendOutputs { user_verification_types?: ('email' | 'phone_number')[]; unauthenticated_identities_enabled?: boolean; mfa_configuration?: 'NONE' | 'OPTIONAL' | 'REQUIRED'; - mfa_methods?: ('SMS' | 'TOTP')[]; + mfa_methods?: ('SMS' | 'TOTP' | 'EMAIL')[]; groups?: { [k: string]: AmplifyUserGroupConfig; }[]; diff --git a/packages/client-config/src/client-config-schema/client_config_v1.4.ts b/packages/client-config/src/client-config-schema/client_config_v1.4.ts index e84598d88c6..73a2be938fc 100644 --- a/packages/client-config/src/client-config-schema/client_config_v1.4.ts +++ b/packages/client-config/src/client-config-schema/client_config_v1.4.ts @@ -185,7 +185,7 @@ export interface AWSAmplifyBackendOutputs { user_verification_types?: ('email' | 'phone_number')[]; unauthenticated_identities_enabled?: boolean; mfa_configuration?: 'NONE' | 'OPTIONAL' | 'REQUIRED'; - mfa_methods?: ('SMS' | 'TOTP')[]; + mfa_methods?: ('SMS' | 'TOTP' | 'EMAIL')[]; groups?: { [k: string]: AmplifyUserGroupConfig; }[]; diff --git a/packages/client-config/src/client-config-schema/client_config_v1.ts b/packages/client-config/src/client-config-schema/client_config_v1.ts index eff8e488364..842247d4dc9 100644 --- a/packages/client-config/src/client-config-schema/client_config_v1.ts +++ b/packages/client-config/src/client-config-schema/client_config_v1.ts @@ -146,7 +146,7 @@ export interface AWSAmplifyBackendOutputs { user_verification_types?: ('email' | 'phone_number')[]; unauthenticated_identities_enabled?: boolean; mfa_configuration?: 'NONE' | 'OPTIONAL' | 'REQUIRED'; - mfa_methods?: ('SMS' | 'TOTP')[]; + mfa_methods?: ('SMS' | 'TOTP' | 'EMAIL')[]; }; /** * Outputs generated from defineData diff --git a/packages/client-config/src/client-config-schema/schema_v1.4.json b/packages/client-config/src/client-config-schema/schema_v1.4.json index 9205353c421..66037e44776 100644 --- a/packages/client-config/src/client-config-schema/schema_v1.4.json +++ b/packages/client-config/src/client-config-schema/schema_v1.4.json @@ -187,7 +187,7 @@ "mfa_methods": { "type": "array", "items": { - "enum": ["SMS", "TOTP"] + "enum": ["SMS", "TOTP", "EMAIL"] } }, "groups": { diff --git a/packages/seed/src/auth-seed/config_reader.ts b/packages/seed/src/auth-seed/config_reader.ts index 37544bbee56..aa7438dd631 100644 --- a/packages/seed/src/auth-seed/config_reader.ts +++ b/packages/seed/src/auth-seed/config_reader.ts @@ -3,7 +3,7 @@ import { AmplifyUserError } from '@aws-amplify/platform-core'; export type AuthConfiguration = { userPoolId: string; - mfaMethods?: ('SMS' | 'TOTP')[]; + mfaMethods?: ('SMS' | 'TOTP' | 'EMAIL')[]; mfaConfig?: 'NONE' | 'REQUIRED' | 'OPTIONAL'; groups?: string[]; }; From 4feaba4720ef219762dcb55d34e19ac56aa429e2 Mon Sep 17 00:00:00 2001 From: osama-rizk Date: Tue, 28 Oct 2025 14:24:39 +0100 Subject: [PATCH 02/10] fix: add @aws-amplify/backend to changeset --- .changeset/cuddly-clowns-guess.md | 1 + 1 file changed, 1 insertion(+) diff --git a/.changeset/cuddly-clowns-guess.md b/.changeset/cuddly-clowns-guess.md index 0f8cfecc53b..1c64c047e7d 100644 --- a/.changeset/cuddly-clowns-guess.md +++ b/.changeset/cuddly-clowns-guess.md @@ -2,6 +2,7 @@ '@aws-amplify/auth-construct': minor '@aws-amplify/client-config': minor '@aws-amplify/backend-auth': minor +'@aws-amplify/backend': minor '@aws-amplify/seed': minor --- From 968c3513d3c58de9bd69b2349df979aba3fce6b8 Mon Sep 17 00:00:00 2001 From: osama-rizk Date: Wed, 29 Oct 2025 12:04:29 +0100 Subject: [PATCH 03/10] Remove redundant code --- packages/auth-construct/src/construct.ts | 25 ------------------------ 1 file changed, 25 deletions(-) diff --git a/packages/auth-construct/src/construct.ts b/packages/auth-construct/src/construct.ts index ce90febca88..f2e1f61df24 100644 --- a/packages/auth-construct/src/construct.ts +++ b/packages/auth-construct/src/construct.ts @@ -232,9 +232,6 @@ export class AmplifyAuth throw Error('Could not find CfnUserPool resource in stack.'); } - // Configure email MFA if enabled - this.configureEmailMFA(props.multifactor, cfnUserPool); - const cfnUserPoolClient = userPoolClient.node.findChild( 'Resource', ) as CfnUserPoolClient; @@ -863,28 +860,6 @@ export class AmplifyAuth return undefined; }; - /** - * Configure email MFA if enabled - * @param mfa - MFA settings - * @param cfnUserPool - CloudFormation UserPool resource - */ - private configureEmailMFA = ( - mfa: AuthProps['multifactor'], - cfnUserPool: CfnUserPool, - ): void => { - const enabledMfas = cfnUserPool.enabledMfas || []; - const shouldEnableEmail = mfa && mfa.mode !== 'OFF' && mfa.email; - const hasEmailOtp = enabledMfas.includes('EMAIL_OTP'); - - if (shouldEnableEmail && !hasEmailOtp) { - cfnUserPool.enabledMfas = [...enabledMfas, 'EMAIL_OTP']; - } else if (!shouldEnableEmail && hasEmailOtp) { - cfnUserPool.enabledMfas = enabledMfas.filter( - (mfa) => mfa !== 'EMAIL_OTP', - ); - } - }; - /** * Setup External Providers (OAuth/OIDC/SAML) and related settings * such as OAuth settings and User Pool Domains From 02a8b01605886f29226fb243ed0c47c95267eb3f Mon Sep 17 00:00:00 2001 From: osama-rizk Date: Wed, 29 Oct 2025 15:37:46 +0100 Subject: [PATCH 04/10] regenerate the schema files --- packages/auth-construct/src/construct.ts | 2 +- packages/client-config/API.md | 178 +++++++++--------- .../client_config_v1.1.ts | 35 ++-- .../client_config_v1.2.ts | 23 ++- .../client_config_v1.3.ts | 23 ++- .../client_config_v1.4.ts | 26 ++- .../client-config-schema/client_config_v1.ts | 37 ++-- .../src/client-config-schema/schema_v1.1.json | 2 +- .../src/client-config-schema/schema_v1.2.json | 2 +- .../src/client-config-schema/schema_v1.3.json | 2 +- .../src/client-config-schema/schema_v1.json | 2 +- 11 files changed, 181 insertions(+), 151 deletions(-) diff --git a/packages/auth-construct/src/construct.ts b/packages/auth-construct/src/construct.ts index f2e1f61df24..c192dc07a15 100644 --- a/packages/auth-construct/src/construct.ts +++ b/packages/auth-construct/src/construct.ts @@ -1226,7 +1226,7 @@ export class AmplifyAuth produce: () => { const enabledMfas = cfnUserPool.enabledMfas ?? []; const mfaTypes: string[] = []; - enabledMfas.forEach((type: string) => { + enabledMfas.forEach((type) => { if (type === 'SMS_MFA') { mfaTypes.push('SMS'); } diff --git a/packages/client-config/API.md b/packages/client-config/API.md index 56f5a1c5226..66c6c5e1085 100644 --- a/packages/client-config/API.md +++ b/packages/client-config/API.md @@ -11,73 +11,68 @@ import { DeployedBackendIdentifier } from '@aws-amplify/deployed-backend-client' import { S3Client } from '@aws-sdk/client-s3'; // @public -type AmazonCognitoStandardAttributes = 'address' | 'birthdate' | 'email' | 'family_name' | 'gender' | 'given_name' | 'locale' | 'middle_name' | 'name' | 'nickname' | 'phone_number' | 'picture' | 'preferred_username' | 'profile' | 'sub' | 'updated_at' | 'website' | 'zoneinfo'; +type AmazonCognitoStandardAttributes = "address" | "birthdate" | "email" | "family_name" | "gender" | "given_name" | "locale" | "middle_name" | "name" | "nickname" | "phone_number" | "picture" | "preferred_username" | "profile" | "sub" | "updated_at" | "website" | "zoneinfo"; // @public -type AmazonCognitoStandardAttributes_2 = 'address' | 'birthdate' | 'email' | 'family_name' | 'gender' | 'given_name' | 'locale' | 'middle_name' | 'name' | 'nickname' | 'phone_number' | 'picture' | 'preferred_username' | 'profile' | 'sub' | 'updated_at' | 'website' | 'zoneinfo'; +type AmazonCognitoStandardAttributes_2 = "address" | "birthdate" | "email" | "family_name" | "gender" | "given_name" | "locale" | "middle_name" | "name" | "nickname" | "phone_number" | "picture" | "preferred_username" | "profile" | "sub" | "updated_at" | "website" | "zoneinfo"; // @public -type AmazonCognitoStandardAttributes_3 = 'address' | 'birthdate' | 'email' | 'family_name' | 'gender' | 'given_name' | 'locale' | 'middle_name' | 'name' | 'nickname' | 'phone_number' | 'picture' | 'preferred_username' | 'profile' | 'sub' | 'updated_at' | 'website' | 'zoneinfo'; +type AmazonCognitoStandardAttributes_3 = "address" | "birthdate" | "email" | "family_name" | "gender" | "given_name" | "locale" | "middle_name" | "name" | "nickname" | "phone_number" | "picture" | "preferred_username" | "profile" | "sub" | "updated_at" | "website" | "zoneinfo"; // @public -type AmazonCognitoStandardAttributes_4 = 'address' | 'birthdate' | 'email' | 'family_name' | 'gender' | 'given_name' | 'locale' | 'middle_name' | 'name' | 'nickname' | 'phone_number' | 'picture' | 'preferred_username' | 'profile' | 'sub' | 'updated_at' | 'website' | 'zoneinfo'; +type AmazonCognitoStandardAttributes_4 = "address" | "birthdate" | "email" | "family_name" | "gender" | "given_name" | "locale" | "middle_name" | "name" | "nickname" | "phone_number" | "picture" | "preferred_username" | "profile" | "sub" | "updated_at" | "website" | "zoneinfo"; // @public -type AmazonCognitoStandardAttributes_5 = 'address' | 'birthdate' | 'email' | 'family_name' | 'gender' | 'given_name' | 'locale' | 'middle_name' | 'name' | 'nickname' | 'phone_number' | 'picture' | 'preferred_username' | 'profile' | 'sub' | 'updated_at' | 'website' | 'zoneinfo'; +type AmazonCognitoStandardAttributes_5 = "address" | "birthdate" | "email" | "family_name" | "gender" | "given_name" | "locale" | "middle_name" | "name" | "nickname" | "phone_number" | "picture" | "preferred_username" | "profile" | "sub" | "updated_at" | "website" | "zoneinfo"; // @public interface AmazonLocationServiceConfig { - name?: string; style?: string; } // @public interface AmazonLocationServiceConfig_2 { - name?: string; style?: string; } // @public interface AmazonLocationServiceConfig_3 { - name?: string; style?: string; } // @public interface AmazonLocationServiceConfig_4 { - name?: string; style?: string; } // @public interface AmazonLocationServiceConfig_5 { - name?: string; style?: string; } // @public -type AmazonPinpointChannels = 'IN_APP_MESSAGING' | 'FCM' | 'APNS' | 'EMAIL' | 'SMS'; +type AmazonPinpointChannels = "IN_APP_MESSAGING" | "FCM" | "APNS" | "EMAIL" | "SMS"; // @public -type AmazonPinpointChannels_2 = 'IN_APP_MESSAGING' | 'FCM' | 'APNS' | 'EMAIL' | 'SMS'; +type AmazonPinpointChannels_2 = "IN_APP_MESSAGING" | "FCM" | "APNS" | "EMAIL" | "SMS"; // @public -type AmazonPinpointChannels_3 = 'IN_APP_MESSAGING' | 'FCM' | 'APNS' | 'EMAIL' | 'SMS'; +type AmazonPinpointChannels_3 = "IN_APP_MESSAGING" | "FCM" | "APNS" | "EMAIL" | "SMS"; // @public -type AmazonPinpointChannels_4 = 'IN_APP_MESSAGING' | 'FCM' | 'APNS' | 'EMAIL' | 'SMS'; +type AmazonPinpointChannels_4 = "IN_APP_MESSAGING" | "FCM" | "APNS" | "EMAIL" | "SMS"; // @public -type AmazonPinpointChannels_5 = 'IN_APP_MESSAGING' | 'FCM' | 'APNS' | 'EMAIL' | 'SMS'; +type AmazonPinpointChannels_5 = "IN_APP_MESSAGING" | "FCM" | "APNS" | "EMAIL" | "SMS"; // @public -type AmplifyStorageAccessActions = 'read' | 'get' | 'list' | 'write' | 'delete'; +type AmplifyStorageAccessActions = "read" | "get" | "list" | "write" | "delete"; // @public (undocumented) -type AmplifyStorageAccessActions_2 = 'read' | 'get' | 'list' | 'write' | 'delete'; +type AmplifyStorageAccessActions_2 = "read" | "get" | "list" | "write" | "delete"; // @public (undocumented) -type AmplifyStorageAccessActions_3 = 'read' | 'get' | 'list' | 'write' | 'delete'; +type AmplifyStorageAccessActions_3 = "read" | "get" | "list" | "write" | "delete"; // @public type AmplifyStorageAccessRule = { @@ -222,6 +217,7 @@ export type AuthClientConfig = { // @public interface AWSAmplifyBackendOutputs { + $schema?: string; analytics?: { amazon_pinpoint?: { aws_region: string; @@ -241,19 +237,19 @@ interface AWSAmplifyBackendOutputs { require_symbols: boolean; }; oauth?: { - identity_providers: ('GOOGLE' | 'FACEBOOK' | 'LOGIN_WITH_AMAZON' | 'SIGN_IN_WITH_APPLE')[]; + identity_providers: ("GOOGLE" | "FACEBOOK" | "LOGIN_WITH_AMAZON" | "SIGN_IN_WITH_APPLE")[]; domain: string; scopes: string[]; - redirect_sign_in_uri: string[]; - redirect_sign_out_uri: string[]; - response_type: 'code' | 'token'; + redirect_sign_in_uri: [string, ...string[]]; + redirect_sign_out_uri: [string, ...string[]]; + response_type: "code" | "token"; }; standard_required_attributes?: AmazonCognitoStandardAttributes[]; - username_attributes?: ('email' | 'phone_number' | 'username')[]; - user_verification_types?: ('email' | 'phone_number')[]; + username_attributes?: ["email" | "phone_number" | "username", ...("email" | "phone_number" | "username")[]]; + user_verification_types?: ("email" | "phone_number")[]; unauthenticated_identities_enabled?: boolean; - mfa_configuration?: 'NONE' | 'OPTIONAL' | 'REQUIRED'; - mfa_methods?: ('SMS' | 'TOTP' | 'EMAIL')[]; + mfa_configuration?: "NONE" | "OPTIONAL" | "REQUIRED"; + mfa_methods?: ("SMS" | "TOTP" | "EMAIL")[]; groups?: { [k: string]: AmplifyUserGroupConfig; }[]; @@ -280,29 +276,30 @@ interface AWSAmplifyBackendOutputs { default: string; }; search_indices?: { - items: string[]; + items: [string, ...string[]]; default: string; }; geofence_collections?: { - items: string[]; + items: [string, ...string[]]; default: string; }; }; notifications?: { aws_region: AwsRegion; amazon_pinpoint_app_id: string; - channels: AmazonPinpointChannels[]; + channels: [AmazonPinpointChannels, ...AmazonPinpointChannels[]]; }; storage?: { aws_region: AwsRegion; bucket_name: string; buckets?: AmplifyStorageBucket[]; }; - version: '1.4'; + version: "1.4"; } // @public interface AWSAmplifyBackendOutputs_2 { + $schema?: string; analytics?: { amazon_pinpoint?: { aws_region: string; @@ -322,19 +319,19 @@ interface AWSAmplifyBackendOutputs_2 { require_symbols: boolean; }; oauth?: { - identity_providers: ('GOOGLE' | 'FACEBOOK' | 'LOGIN_WITH_AMAZON' | 'SIGN_IN_WITH_APPLE')[]; + identity_providers: ("GOOGLE" | "FACEBOOK" | "LOGIN_WITH_AMAZON" | "SIGN_IN_WITH_APPLE")[]; domain: string; scopes: string[]; - redirect_sign_in_uri: string[]; - redirect_sign_out_uri: string[]; - response_type: 'code' | 'token'; + redirect_sign_in_uri: [string, ...string[]]; + redirect_sign_out_uri: [string, ...string[]]; + response_type: "code" | "token"; }; standard_required_attributes?: AmazonCognitoStandardAttributes_2[]; - username_attributes?: ('email' | 'phone_number' | 'username')[]; - user_verification_types?: ('email' | 'phone_number')[]; + username_attributes?: ["email" | "phone_number" | "username", ...("email" | "phone_number" | "username")[]]; + user_verification_types?: ("email" | "phone_number")[]; unauthenticated_identities_enabled?: boolean; - mfa_configuration?: 'NONE' | 'OPTIONAL' | 'REQUIRED'; - mfa_methods?: ('SMS' | 'TOTP' | 'EMAIL')[]; + mfa_configuration?: "NONE" | "OPTIONAL" | "REQUIRED"; + mfa_methods?: ("SMS" | "TOTP" | "EMAIL")[]; groups?: { [k: string]: AmplifyUserGroupConfig_2; }[]; @@ -361,29 +358,30 @@ interface AWSAmplifyBackendOutputs_2 { default: string; }; search_indices?: { - items: string[]; + items: [string, ...string[]]; default: string; }; geofence_collections?: { - items: string[]; + items: [string, ...string[]]; default: string; }; }; notifications?: { aws_region: AwsRegion_2; amazon_pinpoint_app_id: string; - channels: AmazonPinpointChannels_2[]; + channels: [AmazonPinpointChannels_2, ...AmazonPinpointChannels_2[]]; }; storage?: { aws_region: AwsRegion_2; bucket_name: string; buckets?: AmplifyStorageBucket_2[]; }; - version: '1.3'; + version: "1.3"; } // @public interface AWSAmplifyBackendOutputs_3 { + $schema?: string; analytics?: { amazon_pinpoint?: { aws_region: string; @@ -403,19 +401,19 @@ interface AWSAmplifyBackendOutputs_3 { require_symbols: boolean; }; oauth?: { - identity_providers: ('GOOGLE' | 'FACEBOOK' | 'LOGIN_WITH_AMAZON' | 'SIGN_IN_WITH_APPLE')[]; + identity_providers: ("GOOGLE" | "FACEBOOK" | "LOGIN_WITH_AMAZON" | "SIGN_IN_WITH_APPLE")[]; domain: string; scopes: string[]; - redirect_sign_in_uri: string[]; - redirect_sign_out_uri: string[]; - response_type: 'code' | 'token'; + redirect_sign_in_uri: [string, ...string[]]; + redirect_sign_out_uri: [string, ...string[]]; + response_type: "code" | "token"; }; standard_required_attributes?: AmazonCognitoStandardAttributes_3[]; - username_attributes?: ('email' | 'phone_number' | 'username')[]; - user_verification_types?: ('email' | 'phone_number')[]; + username_attributes?: ["email" | "phone_number" | "username", ...("email" | "phone_number" | "username")[]]; + user_verification_types?: ("email" | "phone_number")[]; unauthenticated_identities_enabled?: boolean; - mfa_configuration?: 'NONE' | 'OPTIONAL' | 'REQUIRED'; - mfa_methods?: ('SMS' | 'TOTP' | 'EMAIL')[]; + mfa_configuration?: "NONE" | "OPTIONAL" | "REQUIRED"; + mfa_methods?: ("SMS" | "TOTP" | "EMAIL")[]; }; custom?: { [k: string]: unknown; @@ -439,37 +437,38 @@ interface AWSAmplifyBackendOutputs_3 { default: string; }; search_indices?: { - items: string[]; + items: [string, ...string[]]; default: string; }; geofence_collections?: { - items: string[]; + items: [string, ...string[]]; default: string; }; }; notifications?: { aws_region: AwsRegion_3; amazon_pinpoint_app_id: string; - channels: AmazonPinpointChannels_3[]; + channels: [AmazonPinpointChannels_3, ...AmazonPinpointChannels_3[]]; }; storage?: { aws_region: AwsRegion_3; bucket_name: string; buckets?: AmplifyStorageBucket_3[]; }; - version: '1.2'; + version: "1.2"; } // @public interface AWSAmplifyBackendOutputs_4 { + $schema?: string; analytics?: { amazon_pinpoint?: { - aws_region: AwsRegion_4; + aws_region: string; app_id: string; }; }; auth?: { - aws_region: AwsRegion_4; + aws_region: string; user_pool_id: string; user_pool_client_id: string; identity_pool_id?: string; @@ -481,19 +480,19 @@ interface AWSAmplifyBackendOutputs_4 { require_symbols: boolean; }; oauth?: { - identity_providers: ('GOOGLE' | 'FACEBOOK' | 'LOGIN_WITH_AMAZON' | 'SIGN_IN_WITH_APPLE')[]; + identity_providers: ("GOOGLE" | "FACEBOOK" | "LOGIN_WITH_AMAZON" | "SIGN_IN_WITH_APPLE")[]; domain: string; scopes: string[]; - redirect_sign_in_uri: string[]; - redirect_sign_out_uri: string[]; - response_type: 'code' | 'token'; + redirect_sign_in_uri: [string, ...string[]]; + redirect_sign_out_uri: [string, ...string[]]; + response_type: "code" | "token"; }; standard_required_attributes?: AmazonCognitoStandardAttributes_4[]; - username_attributes?: ('email' | 'phone_number' | 'username')[]; - user_verification_types?: ('email' | 'phone_number')[]; + username_attributes?: ["email" | "phone_number" | "username", ...("email" | "phone_number" | "username")[]]; + user_verification_types?: ("email" | "phone_number")[]; unauthenticated_identities_enabled?: boolean; - mfa_configuration?: 'NONE' | 'OPTIONAL' | 'REQUIRED'; - mfa_methods?: ('SMS' | 'TOTP' | 'EMAIL')[]; + mfa_configuration?: "NONE" | "OPTIONAL" | "REQUIRED"; + mfa_methods?: ("SMS" | "TOTP" | "EMAIL")[]; }; custom?: { [k: string]: unknown; @@ -509,7 +508,7 @@ interface AWSAmplifyBackendOutputs_4 { authorization_types: AwsAppsyncAuthorizationType_4[]; }; geo?: { - aws_region: AwsRegion_4; + aws_region: string; maps?: { items: { [k: string]: AmazonLocationServiceConfig_4; @@ -517,37 +516,38 @@ interface AWSAmplifyBackendOutputs_4 { default: string; }; search_indices?: { - items: string[]; + items: [string, ...string[]]; default: string; }; geofence_collections?: { - items: string[]; + items: [string, ...string[]]; default: string; }; }; notifications?: { aws_region: AwsRegion_4; amazon_pinpoint_app_id: string; - channels: AmazonPinpointChannels_4[]; + channels: [AmazonPinpointChannels_4, ...AmazonPinpointChannels_4[]]; }; storage?: { aws_region: AwsRegion_4; bucket_name: string; buckets?: AmplifyStorageBucket_4[]; }; - version: '1.1'; + version: "1.1"; } // @public interface AWSAmplifyBackendOutputs_5 { + $schema?: string; analytics?: { amazon_pinpoint?: { - aws_region: AwsRegion_5; + aws_region: string; app_id: string; }; }; auth?: { - aws_region: AwsRegion_5; + aws_region: string; user_pool_id: string; user_pool_client_id: string; identity_pool_id?: string; @@ -559,19 +559,19 @@ interface AWSAmplifyBackendOutputs_5 { require_symbols: boolean; }; oauth?: { - identity_providers: ('GOOGLE' | 'FACEBOOK' | 'LOGIN_WITH_AMAZON' | 'SIGN_IN_WITH_APPLE')[]; + identity_providers: ("GOOGLE" | "FACEBOOK" | "LOGIN_WITH_AMAZON" | "SIGN_IN_WITH_APPLE")[]; domain: string; scopes: string[]; - redirect_sign_in_uri: string[]; - redirect_sign_out_uri: string[]; - response_type: 'code' | 'token'; + redirect_sign_in_uri: [string, ...string[]]; + redirect_sign_out_uri: [string, ...string[]]; + response_type: "code" | "token"; }; standard_required_attributes?: AmazonCognitoStandardAttributes_5[]; - username_attributes?: ('email' | 'phone_number' | 'username')[]; - user_verification_types?: ('email' | 'phone_number')[]; + username_attributes?: ["email" | "phone_number" | "username", ...("email" | "phone_number" | "username")[]]; + user_verification_types?: ("email" | "phone_number")[]; unauthenticated_identities_enabled?: boolean; - mfa_configuration?: 'NONE' | 'OPTIONAL' | 'REQUIRED'; - mfa_methods?: ('SMS' | 'TOTP' | 'EMAIL')[]; + mfa_configuration?: "NONE" | "OPTIONAL" | "REQUIRED"; + mfa_methods?: ("SMS" | "TOTP" | "EMAIL")[]; }; custom?: { [k: string]: unknown; @@ -587,7 +587,7 @@ interface AWSAmplifyBackendOutputs_5 { authorization_types: AwsAppsyncAuthorizationType_5[]; }; geo?: { - aws_region: AwsRegion_5; + aws_region: string; maps?: { items: { [k: string]: AmazonLocationServiceConfig_5; @@ -595,40 +595,40 @@ interface AWSAmplifyBackendOutputs_5 { default: string; }; search_indices?: { - items: string[]; + items: [string, ...string[]]; default: string; }; geofence_collections?: { - items: string[]; + items: [string, ...string[]]; default: string; }; }; notifications?: { aws_region: AwsRegion_5; amazon_pinpoint_app_id: string; - channels: AmazonPinpointChannels_5[]; + channels: [AmazonPinpointChannels_5, ...AmazonPinpointChannels_5[]]; }; storage?: { aws_region: AwsRegion_5; bucket_name: string; }; - version: '1'; + version: "1.1"; } // @public -type AwsAppsyncAuthorizationType = 'AMAZON_COGNITO_USER_POOLS' | 'API_KEY' | 'AWS_IAM' | 'AWS_LAMBDA' | 'OPENID_CONNECT'; +type AwsAppsyncAuthorizationType = "AMAZON_COGNITO_USER_POOLS" | "API_KEY" | "AWS_IAM" | "AWS_LAMBDA" | "OPENID_CONNECT"; // @public -type AwsAppsyncAuthorizationType_2 = 'AMAZON_COGNITO_USER_POOLS' | 'API_KEY' | 'AWS_IAM' | 'AWS_LAMBDA' | 'OPENID_CONNECT'; +type AwsAppsyncAuthorizationType_2 = "AMAZON_COGNITO_USER_POOLS" | "API_KEY" | "AWS_IAM" | "AWS_LAMBDA" | "OPENID_CONNECT"; // @public -type AwsAppsyncAuthorizationType_3 = 'AMAZON_COGNITO_USER_POOLS' | 'API_KEY' | 'AWS_IAM' | 'AWS_LAMBDA' | 'OPENID_CONNECT'; +type AwsAppsyncAuthorizationType_3 = "AMAZON_COGNITO_USER_POOLS" | "API_KEY" | "AWS_IAM" | "AWS_LAMBDA" | "OPENID_CONNECT"; // @public -type AwsAppsyncAuthorizationType_4 = 'AMAZON_COGNITO_USER_POOLS' | 'API_KEY' | 'AWS_IAM' | 'AWS_LAMBDA' | 'OPENID_CONNECT'; +type AwsAppsyncAuthorizationType_4 = "AMAZON_COGNITO_USER_POOLS" | "API_KEY" | "AWS_IAM" | "AWS_LAMBDA" | "OPENID_CONNECT"; // @public -type AwsAppsyncAuthorizationType_5 = 'AMAZON_COGNITO_USER_POOLS' | 'API_KEY' | 'AWS_IAM' | 'AWS_LAMBDA' | 'OPENID_CONNECT'; +type AwsAppsyncAuthorizationType_5 = "AMAZON_COGNITO_USER_POOLS" | "API_KEY" | "AWS_IAM" | "AWS_LAMBDA" | "OPENID_CONNECT"; // @public type AwsRegion = string; diff --git a/packages/client-config/src/client-config-schema/client_config_v1.1.ts b/packages/client-config/src/client-config-schema/client_config_v1.1.ts index e969a6d9dd7..8711abc2313 100644 --- a/packages/client-config/src/client-config-schema/client_config_v1.1.ts +++ b/packages/client-config/src/client-config-schema/client_config_v1.1.ts @@ -51,6 +51,10 @@ export type AmazonPinpointChannels = * Config format for Amplify Gen 2 client libraries to communicate with backend services. */ export interface AWSAmplifyBackendOutputs { + /** + * JSON schema + */ + $schema?: string; /** * Version of this schema */ @@ -63,7 +67,7 @@ export interface AWSAmplifyBackendOutputs { /** * AWS Region of Amazon Pinpoint resources */ - aws_region: AwsRegion; + aws_region: string; app_id: string; }; }; @@ -74,7 +78,7 @@ export interface AWSAmplifyBackendOutputs { /** * AWS Region of Amazon Cognito resources */ - aws_region: AwsRegion; + aws_region: string; /** * Cognito User Pool ID */ @@ -122,13 +126,13 @@ export interface AWSAmplifyBackendOutputs { * * @minItems 1 */ - redirect_sign_in_uri: string[]; + redirect_sign_in_uri: [string, ...string[]]; /** * URIs used to redirect after signing out * * @minItems 1 */ - redirect_sign_out_uri: string[]; + redirect_sign_out_uri: [string, ...string[]]; response_type: 'code' | 'token'; }; /** @@ -142,7 +146,10 @@ export interface AWSAmplifyBackendOutputs { * * @minItems 1 */ - username_attributes?: ('email' | 'phone_number' | 'username')[]; + username_attributes?: [ + 'email' | 'phone_number' | 'username', + ...('email' | 'phone_number' | 'username')[], + ]; user_verification_types?: ('email' | 'phone_number')[]; unauthenticated_identities_enabled?: boolean; mfa_configuration?: 'NONE' | 'OPTIONAL' | 'REQUIRED'; @@ -174,7 +181,7 @@ export interface AWSAmplifyBackendOutputs { /** * AWS Region of Amazon Location Service resources */ - aws_region: AwsRegion; + aws_region: string; /** * Maps from Amazon Location Service */ @@ -188,14 +195,20 @@ export interface AWSAmplifyBackendOutputs { * Location search (search by places, addresses, coordinates) */ search_indices?: { - items: string[]; + /** + * @minItems 1 + */ + items: [string, ...string[]]; default: string; }; /** * Geofencing (visualize virtual perimeters) */ geofence_collections?: { - items: string[]; + /** + * @minItems 1 + */ + items: [string, ...string[]]; default: string; }; }; @@ -208,7 +221,7 @@ export interface AWSAmplifyBackendOutputs { /** * @minItems 1 */ - channels: AmazonPinpointChannels[]; + channels: [AmazonPinpointChannels, ...AmazonPinpointChannels[]]; }; /** * Outputs generated from defineStorage @@ -230,10 +243,6 @@ export interface AWSAmplifyBackendOutputs { * via the `patternProperty` ".*". */ export interface AmazonLocationServiceConfig { - /** - * Map resource name - */ - name?: string; /** * Map style */ diff --git a/packages/client-config/src/client-config-schema/client_config_v1.2.ts b/packages/client-config/src/client-config-schema/client_config_v1.2.ts index a5de06aa242..8e15a84a4ba 100644 --- a/packages/client-config/src/client-config-schema/client_config_v1.2.ts +++ b/packages/client-config/src/client-config-schema/client_config_v1.2.ts @@ -57,6 +57,10 @@ export type AmplifyStorageAccessActions = * Config format for Amplify Gen 2 client libraries to communicate with backend services. */ export interface AWSAmplifyBackendOutputs { + /** + * JSON schema + */ + $schema?: string; /** * Version of this schema */ @@ -128,13 +132,13 @@ export interface AWSAmplifyBackendOutputs { * * @minItems 1 */ - redirect_sign_in_uri: string[]; + redirect_sign_in_uri: [string, ...string[]]; /** * URIs used to redirect after signing out * * @minItems 1 */ - redirect_sign_out_uri: string[]; + redirect_sign_out_uri: [string, ...string[]]; response_type: 'code' | 'token'; }; /** @@ -148,7 +152,10 @@ export interface AWSAmplifyBackendOutputs { * * @minItems 1 */ - username_attributes?: ('email' | 'phone_number' | 'username')[]; + username_attributes?: [ + 'email' | 'phone_number' | 'username', + ...('email' | 'phone_number' | 'username')[], + ]; user_verification_types?: ('email' | 'phone_number')[]; unauthenticated_identities_enabled?: boolean; mfa_configuration?: 'NONE' | 'OPTIONAL' | 'REQUIRED'; @@ -197,7 +204,7 @@ export interface AWSAmplifyBackendOutputs { /** * @minItems 1 */ - items: string[]; + items: [string, ...string[]]; default: string; }; /** @@ -207,7 +214,7 @@ export interface AWSAmplifyBackendOutputs { /** * @minItems 1 */ - items: string[]; + items: [string, ...string[]]; default: string; }; }; @@ -220,7 +227,7 @@ export interface AWSAmplifyBackendOutputs { /** * @minItems 1 */ - channels: AmazonPinpointChannels[]; + channels: [AmazonPinpointChannels, ...AmazonPinpointChannels[]]; }; /** * Outputs generated from defineStorage @@ -242,10 +249,6 @@ export interface AWSAmplifyBackendOutputs { * via the `patternProperty` ".*". */ export interface AmazonLocationServiceConfig { - /** - * Map resource name - */ - name?: string; /** * Map style */ diff --git a/packages/client-config/src/client-config-schema/client_config_v1.3.ts b/packages/client-config/src/client-config-schema/client_config_v1.3.ts index 2dac9a8edb5..a72817d0a0c 100644 --- a/packages/client-config/src/client-config-schema/client_config_v1.3.ts +++ b/packages/client-config/src/client-config-schema/client_config_v1.3.ts @@ -57,6 +57,10 @@ export type AmplifyStorageAccessActions = * Config format for Amplify Gen 2 client libraries to communicate with backend services. */ export interface AWSAmplifyBackendOutputs { + /** + * JSON schema + */ + $schema?: string; /** * Version of this schema */ @@ -128,13 +132,13 @@ export interface AWSAmplifyBackendOutputs { * * @minItems 1 */ - redirect_sign_in_uri: string[]; + redirect_sign_in_uri: [string, ...string[]]; /** * URIs used to redirect after signing out * * @minItems 1 */ - redirect_sign_out_uri: string[]; + redirect_sign_out_uri: [string, ...string[]]; response_type: 'code' | 'token'; }; /** @@ -148,7 +152,10 @@ export interface AWSAmplifyBackendOutputs { * * @minItems 1 */ - username_attributes?: ('email' | 'phone_number' | 'username')[]; + username_attributes?: [ + 'email' | 'phone_number' | 'username', + ...('email' | 'phone_number' | 'username')[], + ]; user_verification_types?: ('email' | 'phone_number')[]; unauthenticated_identities_enabled?: boolean; mfa_configuration?: 'NONE' | 'OPTIONAL' | 'REQUIRED'; @@ -200,7 +207,7 @@ export interface AWSAmplifyBackendOutputs { /** * @minItems 1 */ - items: string[]; + items: [string, ...string[]]; default: string; }; /** @@ -210,7 +217,7 @@ export interface AWSAmplifyBackendOutputs { /** * @minItems 1 */ - items: string[]; + items: [string, ...string[]]; default: string; }; }; @@ -223,7 +230,7 @@ export interface AWSAmplifyBackendOutputs { /** * @minItems 1 */ - channels: AmazonPinpointChannels[]; + channels: [AmazonPinpointChannels, ...AmazonPinpointChannels[]]; }; /** * Outputs generated from defineStorage @@ -252,10 +259,6 @@ export interface AmplifyUserGroupConfig { * via the `patternProperty` ".*". */ export interface AmazonLocationServiceConfig { - /** - * Map resource name - */ - name?: string; /** * Map style */ diff --git a/packages/client-config/src/client-config-schema/client_config_v1.4.ts b/packages/client-config/src/client-config-schema/client_config_v1.4.ts index 73a2be938fc..51a66efb37a 100644 --- a/packages/client-config/src/client-config-schema/client_config_v1.4.ts +++ b/packages/client-config/src/client-config-schema/client_config_v1.4.ts @@ -3,6 +3,9 @@ * This file was automatically generated by json-schema-to-typescript. * DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, * and run json-schema-to-typescript to regenerate this file. + * + * WARNING: For schema_v1.4, run json-schema-to-typescript with --unreachableDefinitions + * to ensure all types are properly generated. */ /** @@ -90,6 +93,10 @@ export type AmplifyStorageAccessActions = * Config format for Amplify Gen 2 client libraries to communicate with backend services. */ export interface AWSAmplifyBackendOutputs { + /** + * JSON schema + */ + $schema?: string; /** * Version of this schema */ @@ -161,13 +168,13 @@ export interface AWSAmplifyBackendOutputs { * * @minItems 1 */ - redirect_sign_in_uri: string[]; + redirect_sign_in_uri: [string, ...string[]]; /** * URIs used to redirect after signing out * * @minItems 1 */ - redirect_sign_out_uri: string[]; + redirect_sign_out_uri: [string, ...string[]]; response_type: 'code' | 'token'; }; /** @@ -181,7 +188,10 @@ export interface AWSAmplifyBackendOutputs { * * @minItems 1 */ - username_attributes?: ('email' | 'phone_number' | 'username')[]; + username_attributes?: [ + 'email' | 'phone_number' | 'username', + ...('email' | 'phone_number' | 'username')[], + ]; user_verification_types?: ('email' | 'phone_number')[]; unauthenticated_identities_enabled?: boolean; mfa_configuration?: 'NONE' | 'OPTIONAL' | 'REQUIRED'; @@ -233,7 +243,7 @@ export interface AWSAmplifyBackendOutputs { /** * @minItems 1 */ - items: string[]; + items: [string, ...string[]]; default: string; }; /** @@ -243,7 +253,7 @@ export interface AWSAmplifyBackendOutputs { /** * @minItems 1 */ - items: string[]; + items: [string, ...string[]]; default: string; }; }; @@ -256,7 +266,7 @@ export interface AWSAmplifyBackendOutputs { /** * @minItems 1 */ - channels: AmazonPinpointChannels[]; + channels: [AmazonPinpointChannels, ...AmazonPinpointChannels[]]; }; /** * Outputs generated from defineStorage @@ -291,10 +301,6 @@ export interface AmplifyUserGroupConfig { * via the `definition` "amazon_location_service_config". */ export interface AmazonLocationServiceConfig { - /** - * Map resource name - */ - name?: string; /** * Map style */ diff --git a/packages/client-config/src/client-config-schema/client_config_v1.ts b/packages/client-config/src/client-config-schema/client_config_v1.ts index 842247d4dc9..2103f81b71b 100644 --- a/packages/client-config/src/client-config-schema/client_config_v1.ts +++ b/packages/client-config/src/client-config-schema/client_config_v1.ts @@ -51,10 +51,14 @@ export type AmazonPinpointChannels = * Config format for Amplify Gen 2 client libraries to communicate with backend services. */ export interface AWSAmplifyBackendOutputs { + /** + * JSON schema + */ + $schema?: string; /** * Version of this schema */ - version: '1'; + version: '1.1'; /** * Outputs manually specified by developers for use with frontend library */ @@ -63,7 +67,7 @@ export interface AWSAmplifyBackendOutputs { /** * AWS Region of Amazon Pinpoint resources */ - aws_region: AwsRegion; + aws_region: string; app_id: string; }; }; @@ -74,7 +78,7 @@ export interface AWSAmplifyBackendOutputs { /** * AWS Region of Amazon Cognito resources */ - aws_region: AwsRegion; + aws_region: string; /** * Cognito User Pool ID */ @@ -122,13 +126,13 @@ export interface AWSAmplifyBackendOutputs { * * @minItems 1 */ - redirect_sign_in_uri: string[]; + redirect_sign_in_uri: [string, ...string[]]; /** * URIs used to redirect after signing out * * @minItems 1 */ - redirect_sign_out_uri: string[]; + redirect_sign_out_uri: [string, ...string[]]; response_type: 'code' | 'token'; }; /** @@ -142,7 +146,10 @@ export interface AWSAmplifyBackendOutputs { * * @minItems 1 */ - username_attributes?: ('email' | 'phone_number' | 'username')[]; + username_attributes?: [ + 'email' | 'phone_number' | 'username', + ...('email' | 'phone_number' | 'username')[], + ]; user_verification_types?: ('email' | 'phone_number')[]; unauthenticated_identities_enabled?: boolean; mfa_configuration?: 'NONE' | 'OPTIONAL' | 'REQUIRED'; @@ -174,7 +181,7 @@ export interface AWSAmplifyBackendOutputs { /** * AWS Region of Amazon Location Service resources */ - aws_region: AwsRegion; + aws_region: string; /** * Maps from Amazon Location Service */ @@ -188,14 +195,20 @@ export interface AWSAmplifyBackendOutputs { * Location search (search by places, addresses, coordinates) */ search_indices?: { - items: string[]; + /** + * @minItems 1 + */ + items: [string, ...string[]]; default: string; }; /** * Geofencing (visualize virtual perimeters) */ geofence_collections?: { - items: string[]; + /** + * @minItems 1 + */ + items: [string, ...string[]]; default: string; }; }; @@ -208,7 +221,7 @@ export interface AWSAmplifyBackendOutputs { /** * @minItems 1 */ - channels: AmazonPinpointChannels[]; + channels: [AmazonPinpointChannels, ...AmazonPinpointChannels[]]; }; /** * Outputs generated from defineStorage @@ -229,10 +242,6 @@ export interface AWSAmplifyBackendOutputs { * via the `patternProperty` ".*". */ export interface AmazonLocationServiceConfig { - /** - * Map resource name - */ - name?: string; /** * Map style */ diff --git a/packages/client-config/src/client-config-schema/schema_v1.1.json b/packages/client-config/src/client-config-schema/schema_v1.1.json index cad1cf7a4b6..cf50532bf18 100644 --- a/packages/client-config/src/client-config-schema/schema_v1.1.json +++ b/packages/client-config/src/client-config-schema/schema_v1.1.json @@ -187,7 +187,7 @@ "mfa_methods": { "type": "array", "items": { - "enum": ["SMS", "TOTP"] + "enum": ["SMS", "TOTP", "EMAIL"] } } }, diff --git a/packages/client-config/src/client-config-schema/schema_v1.2.json b/packages/client-config/src/client-config-schema/schema_v1.2.json index b85a10ff30c..b10ec7c1ea2 100644 --- a/packages/client-config/src/client-config-schema/schema_v1.2.json +++ b/packages/client-config/src/client-config-schema/schema_v1.2.json @@ -187,7 +187,7 @@ "mfa_methods": { "type": "array", "items": { - "enum": ["SMS", "TOTP"] + "enum": ["SMS", "TOTP", "EMAIL"] } } }, diff --git a/packages/client-config/src/client-config-schema/schema_v1.3.json b/packages/client-config/src/client-config-schema/schema_v1.3.json index bf89de55040..817a444a0f1 100644 --- a/packages/client-config/src/client-config-schema/schema_v1.3.json +++ b/packages/client-config/src/client-config-schema/schema_v1.3.json @@ -187,7 +187,7 @@ "mfa_methods": { "type": "array", "items": { - "enum": ["SMS", "TOTP"] + "enum": ["SMS", "TOTP", "EMAIL"] } }, "groups": { diff --git a/packages/client-config/src/client-config-schema/schema_v1.json b/packages/client-config/src/client-config-schema/schema_v1.json index 5ca97e2d201..99deb8f279e 100644 --- a/packages/client-config/src/client-config-schema/schema_v1.json +++ b/packages/client-config/src/client-config-schema/schema_v1.json @@ -187,7 +187,7 @@ "mfa_methods": { "type": "array", "items": { - "enum": ["SMS", "TOTP"] + "enum": ["SMS", "TOTP", "EMAIL"] } } }, From 2e8c356cb5cfac505c59c51fa67c2e6f905f5b7a Mon Sep 17 00:00:00 2001 From: osama-rizk Date: Wed, 29 Oct 2025 16:14:46 +0100 Subject: [PATCH 05/10] revert schema changes --- .changeset/cuddly-clowns-guess.md | 1 - packages/client-config/API.md | 178 +++++++++--------- .../client_config_v1.1.ts | 37 ++-- .../client_config_v1.2.ts | 25 ++- .../client_config_v1.3.ts | 25 ++- .../client_config_v1.4.ts | 28 ++- .../client-config-schema/client_config_v1.ts | 39 ++-- .../src/client-config-schema/schema_v1.1.json | 2 +- .../src/client-config-schema/schema_v1.2.json | 2 +- .../src/client-config-schema/schema_v1.3.json | 2 +- .../src/client-config-schema/schema_v1.4.json | 2 +- .../src/client-config-schema/schema_v1.json | 2 +- 12 files changed, 156 insertions(+), 187 deletions(-) diff --git a/.changeset/cuddly-clowns-guess.md b/.changeset/cuddly-clowns-guess.md index 1c64c047e7d..3319c6f0bca 100644 --- a/.changeset/cuddly-clowns-guess.md +++ b/.changeset/cuddly-clowns-guess.md @@ -1,6 +1,5 @@ --- '@aws-amplify/auth-construct': minor -'@aws-amplify/client-config': minor '@aws-amplify/backend-auth': minor '@aws-amplify/backend': minor '@aws-amplify/seed': minor diff --git a/packages/client-config/API.md b/packages/client-config/API.md index 66c6c5e1085..2c1f6d22c9e 100644 --- a/packages/client-config/API.md +++ b/packages/client-config/API.md @@ -11,68 +11,73 @@ import { DeployedBackendIdentifier } from '@aws-amplify/deployed-backend-client' import { S3Client } from '@aws-sdk/client-s3'; // @public -type AmazonCognitoStandardAttributes = "address" | "birthdate" | "email" | "family_name" | "gender" | "given_name" | "locale" | "middle_name" | "name" | "nickname" | "phone_number" | "picture" | "preferred_username" | "profile" | "sub" | "updated_at" | "website" | "zoneinfo"; +type AmazonCognitoStandardAttributes = 'address' | 'birthdate' | 'email' | 'family_name' | 'gender' | 'given_name' | 'locale' | 'middle_name' | 'name' | 'nickname' | 'phone_number' | 'picture' | 'preferred_username' | 'profile' | 'sub' | 'updated_at' | 'website' | 'zoneinfo'; // @public -type AmazonCognitoStandardAttributes_2 = "address" | "birthdate" | "email" | "family_name" | "gender" | "given_name" | "locale" | "middle_name" | "name" | "nickname" | "phone_number" | "picture" | "preferred_username" | "profile" | "sub" | "updated_at" | "website" | "zoneinfo"; +type AmazonCognitoStandardAttributes_2 = 'address' | 'birthdate' | 'email' | 'family_name' | 'gender' | 'given_name' | 'locale' | 'middle_name' | 'name' | 'nickname' | 'phone_number' | 'picture' | 'preferred_username' | 'profile' | 'sub' | 'updated_at' | 'website' | 'zoneinfo'; // @public -type AmazonCognitoStandardAttributes_3 = "address" | "birthdate" | "email" | "family_name" | "gender" | "given_name" | "locale" | "middle_name" | "name" | "nickname" | "phone_number" | "picture" | "preferred_username" | "profile" | "sub" | "updated_at" | "website" | "zoneinfo"; +type AmazonCognitoStandardAttributes_3 = 'address' | 'birthdate' | 'email' | 'family_name' | 'gender' | 'given_name' | 'locale' | 'middle_name' | 'name' | 'nickname' | 'phone_number' | 'picture' | 'preferred_username' | 'profile' | 'sub' | 'updated_at' | 'website' | 'zoneinfo'; // @public -type AmazonCognitoStandardAttributes_4 = "address" | "birthdate" | "email" | "family_name" | "gender" | "given_name" | "locale" | "middle_name" | "name" | "nickname" | "phone_number" | "picture" | "preferred_username" | "profile" | "sub" | "updated_at" | "website" | "zoneinfo"; +type AmazonCognitoStandardAttributes_4 = 'address' | 'birthdate' | 'email' | 'family_name' | 'gender' | 'given_name' | 'locale' | 'middle_name' | 'name' | 'nickname' | 'phone_number' | 'picture' | 'preferred_username' | 'profile' | 'sub' | 'updated_at' | 'website' | 'zoneinfo'; // @public -type AmazonCognitoStandardAttributes_5 = "address" | "birthdate" | "email" | "family_name" | "gender" | "given_name" | "locale" | "middle_name" | "name" | "nickname" | "phone_number" | "picture" | "preferred_username" | "profile" | "sub" | "updated_at" | "website" | "zoneinfo"; +type AmazonCognitoStandardAttributes_5 = 'address' | 'birthdate' | 'email' | 'family_name' | 'gender' | 'given_name' | 'locale' | 'middle_name' | 'name' | 'nickname' | 'phone_number' | 'picture' | 'preferred_username' | 'profile' | 'sub' | 'updated_at' | 'website' | 'zoneinfo'; // @public interface AmazonLocationServiceConfig { + name?: string; style?: string; } // @public interface AmazonLocationServiceConfig_2 { + name?: string; style?: string; } // @public interface AmazonLocationServiceConfig_3 { + name?: string; style?: string; } // @public interface AmazonLocationServiceConfig_4 { + name?: string; style?: string; } // @public interface AmazonLocationServiceConfig_5 { + name?: string; style?: string; } // @public -type AmazonPinpointChannels = "IN_APP_MESSAGING" | "FCM" | "APNS" | "EMAIL" | "SMS"; +type AmazonPinpointChannels = 'IN_APP_MESSAGING' | 'FCM' | 'APNS' | 'EMAIL' | 'SMS'; // @public -type AmazonPinpointChannels_2 = "IN_APP_MESSAGING" | "FCM" | "APNS" | "EMAIL" | "SMS"; +type AmazonPinpointChannels_2 = 'IN_APP_MESSAGING' | 'FCM' | 'APNS' | 'EMAIL' | 'SMS'; // @public -type AmazonPinpointChannels_3 = "IN_APP_MESSAGING" | "FCM" | "APNS" | "EMAIL" | "SMS"; +type AmazonPinpointChannels_3 = 'IN_APP_MESSAGING' | 'FCM' | 'APNS' | 'EMAIL' | 'SMS'; // @public -type AmazonPinpointChannels_4 = "IN_APP_MESSAGING" | "FCM" | "APNS" | "EMAIL" | "SMS"; +type AmazonPinpointChannels_4 = 'IN_APP_MESSAGING' | 'FCM' | 'APNS' | 'EMAIL' | 'SMS'; // @public -type AmazonPinpointChannels_5 = "IN_APP_MESSAGING" | "FCM" | "APNS" | "EMAIL" | "SMS"; +type AmazonPinpointChannels_5 = 'IN_APP_MESSAGING' | 'FCM' | 'APNS' | 'EMAIL' | 'SMS'; // @public -type AmplifyStorageAccessActions = "read" | "get" | "list" | "write" | "delete"; +type AmplifyStorageAccessActions = 'read' | 'get' | 'list' | 'write' | 'delete'; // @public (undocumented) -type AmplifyStorageAccessActions_2 = "read" | "get" | "list" | "write" | "delete"; +type AmplifyStorageAccessActions_2 = 'read' | 'get' | 'list' | 'write' | 'delete'; // @public (undocumented) -type AmplifyStorageAccessActions_3 = "read" | "get" | "list" | "write" | "delete"; +type AmplifyStorageAccessActions_3 = 'read' | 'get' | 'list' | 'write' | 'delete'; // @public type AmplifyStorageAccessRule = { @@ -217,7 +222,6 @@ export type AuthClientConfig = { // @public interface AWSAmplifyBackendOutputs { - $schema?: string; analytics?: { amazon_pinpoint?: { aws_region: string; @@ -237,19 +241,19 @@ interface AWSAmplifyBackendOutputs { require_symbols: boolean; }; oauth?: { - identity_providers: ("GOOGLE" | "FACEBOOK" | "LOGIN_WITH_AMAZON" | "SIGN_IN_WITH_APPLE")[]; + identity_providers: ('GOOGLE' | 'FACEBOOK' | 'LOGIN_WITH_AMAZON' | 'SIGN_IN_WITH_APPLE')[]; domain: string; scopes: string[]; - redirect_sign_in_uri: [string, ...string[]]; - redirect_sign_out_uri: [string, ...string[]]; - response_type: "code" | "token"; + redirect_sign_in_uri: string[]; + redirect_sign_out_uri: string[]; + response_type: 'code' | 'token'; }; standard_required_attributes?: AmazonCognitoStandardAttributes[]; - username_attributes?: ["email" | "phone_number" | "username", ...("email" | "phone_number" | "username")[]]; - user_verification_types?: ("email" | "phone_number")[]; + username_attributes?: ('email' | 'phone_number' | 'username')[]; + user_verification_types?: ('email' | 'phone_number')[]; unauthenticated_identities_enabled?: boolean; - mfa_configuration?: "NONE" | "OPTIONAL" | "REQUIRED"; - mfa_methods?: ("SMS" | "TOTP" | "EMAIL")[]; + mfa_configuration?: 'NONE' | 'OPTIONAL' | 'REQUIRED'; + mfa_methods?: ('SMS' | 'TOTP')[]; groups?: { [k: string]: AmplifyUserGroupConfig; }[]; @@ -276,30 +280,29 @@ interface AWSAmplifyBackendOutputs { default: string; }; search_indices?: { - items: [string, ...string[]]; + items: string[]; default: string; }; geofence_collections?: { - items: [string, ...string[]]; + items: string[]; default: string; }; }; notifications?: { aws_region: AwsRegion; amazon_pinpoint_app_id: string; - channels: [AmazonPinpointChannels, ...AmazonPinpointChannels[]]; + channels: AmazonPinpointChannels[]; }; storage?: { aws_region: AwsRegion; bucket_name: string; buckets?: AmplifyStorageBucket[]; }; - version: "1.4"; + version: '1.4'; } // @public interface AWSAmplifyBackendOutputs_2 { - $schema?: string; analytics?: { amazon_pinpoint?: { aws_region: string; @@ -319,19 +322,19 @@ interface AWSAmplifyBackendOutputs_2 { require_symbols: boolean; }; oauth?: { - identity_providers: ("GOOGLE" | "FACEBOOK" | "LOGIN_WITH_AMAZON" | "SIGN_IN_WITH_APPLE")[]; + identity_providers: ('GOOGLE' | 'FACEBOOK' | 'LOGIN_WITH_AMAZON' | 'SIGN_IN_WITH_APPLE')[]; domain: string; scopes: string[]; - redirect_sign_in_uri: [string, ...string[]]; - redirect_sign_out_uri: [string, ...string[]]; - response_type: "code" | "token"; + redirect_sign_in_uri: string[]; + redirect_sign_out_uri: string[]; + response_type: 'code' | 'token'; }; standard_required_attributes?: AmazonCognitoStandardAttributes_2[]; - username_attributes?: ["email" | "phone_number" | "username", ...("email" | "phone_number" | "username")[]]; - user_verification_types?: ("email" | "phone_number")[]; + username_attributes?: ('email' | 'phone_number' | 'username')[]; + user_verification_types?: ('email' | 'phone_number')[]; unauthenticated_identities_enabled?: boolean; - mfa_configuration?: "NONE" | "OPTIONAL" | "REQUIRED"; - mfa_methods?: ("SMS" | "TOTP" | "EMAIL")[]; + mfa_configuration?: 'NONE' | 'OPTIONAL' | 'REQUIRED'; + mfa_methods?: ('SMS' | 'TOTP')[]; groups?: { [k: string]: AmplifyUserGroupConfig_2; }[]; @@ -358,30 +361,29 @@ interface AWSAmplifyBackendOutputs_2 { default: string; }; search_indices?: { - items: [string, ...string[]]; + items: string[]; default: string; }; geofence_collections?: { - items: [string, ...string[]]; + items: string[]; default: string; }; }; notifications?: { aws_region: AwsRegion_2; amazon_pinpoint_app_id: string; - channels: [AmazonPinpointChannels_2, ...AmazonPinpointChannels_2[]]; + channels: AmazonPinpointChannels_2[]; }; storage?: { aws_region: AwsRegion_2; bucket_name: string; buckets?: AmplifyStorageBucket_2[]; }; - version: "1.3"; + version: '1.3'; } // @public interface AWSAmplifyBackendOutputs_3 { - $schema?: string; analytics?: { amazon_pinpoint?: { aws_region: string; @@ -401,19 +403,19 @@ interface AWSAmplifyBackendOutputs_3 { require_symbols: boolean; }; oauth?: { - identity_providers: ("GOOGLE" | "FACEBOOK" | "LOGIN_WITH_AMAZON" | "SIGN_IN_WITH_APPLE")[]; + identity_providers: ('GOOGLE' | 'FACEBOOK' | 'LOGIN_WITH_AMAZON' | 'SIGN_IN_WITH_APPLE')[]; domain: string; scopes: string[]; - redirect_sign_in_uri: [string, ...string[]]; - redirect_sign_out_uri: [string, ...string[]]; - response_type: "code" | "token"; + redirect_sign_in_uri: string[]; + redirect_sign_out_uri: string[]; + response_type: 'code' | 'token'; }; standard_required_attributes?: AmazonCognitoStandardAttributes_3[]; - username_attributes?: ["email" | "phone_number" | "username", ...("email" | "phone_number" | "username")[]]; - user_verification_types?: ("email" | "phone_number")[]; + username_attributes?: ('email' | 'phone_number' | 'username')[]; + user_verification_types?: ('email' | 'phone_number')[]; unauthenticated_identities_enabled?: boolean; - mfa_configuration?: "NONE" | "OPTIONAL" | "REQUIRED"; - mfa_methods?: ("SMS" | "TOTP" | "EMAIL")[]; + mfa_configuration?: 'NONE' | 'OPTIONAL' | 'REQUIRED'; + mfa_methods?: ('SMS' | 'TOTP')[]; }; custom?: { [k: string]: unknown; @@ -437,38 +439,37 @@ interface AWSAmplifyBackendOutputs_3 { default: string; }; search_indices?: { - items: [string, ...string[]]; + items: string[]; default: string; }; geofence_collections?: { - items: [string, ...string[]]; + items: string[]; default: string; }; }; notifications?: { aws_region: AwsRegion_3; amazon_pinpoint_app_id: string; - channels: [AmazonPinpointChannels_3, ...AmazonPinpointChannels_3[]]; + channels: AmazonPinpointChannels_3[]; }; storage?: { aws_region: AwsRegion_3; bucket_name: string; buckets?: AmplifyStorageBucket_3[]; }; - version: "1.2"; + version: '1.2'; } // @public interface AWSAmplifyBackendOutputs_4 { - $schema?: string; analytics?: { amazon_pinpoint?: { - aws_region: string; + aws_region: AwsRegion_4; app_id: string; }; }; auth?: { - aws_region: string; + aws_region: AwsRegion_4; user_pool_id: string; user_pool_client_id: string; identity_pool_id?: string; @@ -480,19 +481,19 @@ interface AWSAmplifyBackendOutputs_4 { require_symbols: boolean; }; oauth?: { - identity_providers: ("GOOGLE" | "FACEBOOK" | "LOGIN_WITH_AMAZON" | "SIGN_IN_WITH_APPLE")[]; + identity_providers: ('GOOGLE' | 'FACEBOOK' | 'LOGIN_WITH_AMAZON' | 'SIGN_IN_WITH_APPLE')[]; domain: string; scopes: string[]; - redirect_sign_in_uri: [string, ...string[]]; - redirect_sign_out_uri: [string, ...string[]]; - response_type: "code" | "token"; + redirect_sign_in_uri: string[]; + redirect_sign_out_uri: string[]; + response_type: 'code' | 'token'; }; standard_required_attributes?: AmazonCognitoStandardAttributes_4[]; - username_attributes?: ["email" | "phone_number" | "username", ...("email" | "phone_number" | "username")[]]; - user_verification_types?: ("email" | "phone_number")[]; + username_attributes?: ('email' | 'phone_number' | 'username')[]; + user_verification_types?: ('email' | 'phone_number')[]; unauthenticated_identities_enabled?: boolean; - mfa_configuration?: "NONE" | "OPTIONAL" | "REQUIRED"; - mfa_methods?: ("SMS" | "TOTP" | "EMAIL")[]; + mfa_configuration?: 'NONE' | 'OPTIONAL' | 'REQUIRED'; + mfa_methods?: ('SMS' | 'TOTP')[]; }; custom?: { [k: string]: unknown; @@ -508,7 +509,7 @@ interface AWSAmplifyBackendOutputs_4 { authorization_types: AwsAppsyncAuthorizationType_4[]; }; geo?: { - aws_region: string; + aws_region: AwsRegion_4; maps?: { items: { [k: string]: AmazonLocationServiceConfig_4; @@ -516,38 +517,37 @@ interface AWSAmplifyBackendOutputs_4 { default: string; }; search_indices?: { - items: [string, ...string[]]; + items: string[]; default: string; }; geofence_collections?: { - items: [string, ...string[]]; + items: string[]; default: string; }; }; notifications?: { aws_region: AwsRegion_4; amazon_pinpoint_app_id: string; - channels: [AmazonPinpointChannels_4, ...AmazonPinpointChannels_4[]]; + channels: AmazonPinpointChannels_4[]; }; storage?: { aws_region: AwsRegion_4; bucket_name: string; buckets?: AmplifyStorageBucket_4[]; }; - version: "1.1"; + version: '1.1'; } // @public interface AWSAmplifyBackendOutputs_5 { - $schema?: string; analytics?: { amazon_pinpoint?: { - aws_region: string; + aws_region: AwsRegion_5; app_id: string; }; }; auth?: { - aws_region: string; + aws_region: AwsRegion_5; user_pool_id: string; user_pool_client_id: string; identity_pool_id?: string; @@ -559,19 +559,19 @@ interface AWSAmplifyBackendOutputs_5 { require_symbols: boolean; }; oauth?: { - identity_providers: ("GOOGLE" | "FACEBOOK" | "LOGIN_WITH_AMAZON" | "SIGN_IN_WITH_APPLE")[]; + identity_providers: ('GOOGLE' | 'FACEBOOK' | 'LOGIN_WITH_AMAZON' | 'SIGN_IN_WITH_APPLE')[]; domain: string; scopes: string[]; - redirect_sign_in_uri: [string, ...string[]]; - redirect_sign_out_uri: [string, ...string[]]; - response_type: "code" | "token"; + redirect_sign_in_uri: string[]; + redirect_sign_out_uri: string[]; + response_type: 'code' | 'token'; }; standard_required_attributes?: AmazonCognitoStandardAttributes_5[]; - username_attributes?: ["email" | "phone_number" | "username", ...("email" | "phone_number" | "username")[]]; - user_verification_types?: ("email" | "phone_number")[]; + username_attributes?: ('email' | 'phone_number' | 'username')[]; + user_verification_types?: ('email' | 'phone_number')[]; unauthenticated_identities_enabled?: boolean; - mfa_configuration?: "NONE" | "OPTIONAL" | "REQUIRED"; - mfa_methods?: ("SMS" | "TOTP" | "EMAIL")[]; + mfa_configuration?: 'NONE' | 'OPTIONAL' | 'REQUIRED'; + mfa_methods?: ('SMS' | 'TOTP')[]; }; custom?: { [k: string]: unknown; @@ -587,7 +587,7 @@ interface AWSAmplifyBackendOutputs_5 { authorization_types: AwsAppsyncAuthorizationType_5[]; }; geo?: { - aws_region: string; + aws_region: AwsRegion_5; maps?: { items: { [k: string]: AmazonLocationServiceConfig_5; @@ -595,40 +595,40 @@ interface AWSAmplifyBackendOutputs_5 { default: string; }; search_indices?: { - items: [string, ...string[]]; + items: string[]; default: string; }; geofence_collections?: { - items: [string, ...string[]]; + items: string[]; default: string; }; }; notifications?: { aws_region: AwsRegion_5; amazon_pinpoint_app_id: string; - channels: [AmazonPinpointChannels_5, ...AmazonPinpointChannels_5[]]; + channels: AmazonPinpointChannels_5[]; }; storage?: { aws_region: AwsRegion_5; bucket_name: string; }; - version: "1.1"; + version: '1'; } // @public -type AwsAppsyncAuthorizationType = "AMAZON_COGNITO_USER_POOLS" | "API_KEY" | "AWS_IAM" | "AWS_LAMBDA" | "OPENID_CONNECT"; +type AwsAppsyncAuthorizationType = 'AMAZON_COGNITO_USER_POOLS' | 'API_KEY' | 'AWS_IAM' | 'AWS_LAMBDA' | 'OPENID_CONNECT'; // @public -type AwsAppsyncAuthorizationType_2 = "AMAZON_COGNITO_USER_POOLS" | "API_KEY" | "AWS_IAM" | "AWS_LAMBDA" | "OPENID_CONNECT"; +type AwsAppsyncAuthorizationType_2 = 'AMAZON_COGNITO_USER_POOLS' | 'API_KEY' | 'AWS_IAM' | 'AWS_LAMBDA' | 'OPENID_CONNECT'; // @public -type AwsAppsyncAuthorizationType_3 = "AMAZON_COGNITO_USER_POOLS" | "API_KEY" | "AWS_IAM" | "AWS_LAMBDA" | "OPENID_CONNECT"; +type AwsAppsyncAuthorizationType_3 = 'AMAZON_COGNITO_USER_POOLS' | 'API_KEY' | 'AWS_IAM' | 'AWS_LAMBDA' | 'OPENID_CONNECT'; // @public -type AwsAppsyncAuthorizationType_4 = "AMAZON_COGNITO_USER_POOLS" | "API_KEY" | "AWS_IAM" | "AWS_LAMBDA" | "OPENID_CONNECT"; +type AwsAppsyncAuthorizationType_4 = 'AMAZON_COGNITO_USER_POOLS' | 'API_KEY' | 'AWS_IAM' | 'AWS_LAMBDA' | 'OPENID_CONNECT'; // @public -type AwsAppsyncAuthorizationType_5 = "AMAZON_COGNITO_USER_POOLS" | "API_KEY" | "AWS_IAM" | "AWS_LAMBDA" | "OPENID_CONNECT"; +type AwsAppsyncAuthorizationType_5 = 'AMAZON_COGNITO_USER_POOLS' | 'API_KEY' | 'AWS_IAM' | 'AWS_LAMBDA' | 'OPENID_CONNECT'; // @public type AwsRegion = string; diff --git a/packages/client-config/src/client-config-schema/client_config_v1.1.ts b/packages/client-config/src/client-config-schema/client_config_v1.1.ts index 8711abc2313..0bce94d1a4b 100644 --- a/packages/client-config/src/client-config-schema/client_config_v1.1.ts +++ b/packages/client-config/src/client-config-schema/client_config_v1.1.ts @@ -51,10 +51,6 @@ export type AmazonPinpointChannels = * Config format for Amplify Gen 2 client libraries to communicate with backend services. */ export interface AWSAmplifyBackendOutputs { - /** - * JSON schema - */ - $schema?: string; /** * Version of this schema */ @@ -67,7 +63,7 @@ export interface AWSAmplifyBackendOutputs { /** * AWS Region of Amazon Pinpoint resources */ - aws_region: string; + aws_region: AwsRegion; app_id: string; }; }; @@ -78,7 +74,7 @@ export interface AWSAmplifyBackendOutputs { /** * AWS Region of Amazon Cognito resources */ - aws_region: string; + aws_region: AwsRegion; /** * Cognito User Pool ID */ @@ -126,13 +122,13 @@ export interface AWSAmplifyBackendOutputs { * * @minItems 1 */ - redirect_sign_in_uri: [string, ...string[]]; + redirect_sign_in_uri: string[]; /** * URIs used to redirect after signing out * * @minItems 1 */ - redirect_sign_out_uri: [string, ...string[]]; + redirect_sign_out_uri: string[]; response_type: 'code' | 'token'; }; /** @@ -146,14 +142,11 @@ export interface AWSAmplifyBackendOutputs { * * @minItems 1 */ - username_attributes?: [ - 'email' | 'phone_number' | 'username', - ...('email' | 'phone_number' | 'username')[], - ]; + username_attributes?: ('email' | 'phone_number' | 'username')[]; user_verification_types?: ('email' | 'phone_number')[]; unauthenticated_identities_enabled?: boolean; mfa_configuration?: 'NONE' | 'OPTIONAL' | 'REQUIRED'; - mfa_methods?: ('SMS' | 'TOTP' | 'EMAIL')[]; + mfa_methods?: ('SMS' | 'TOTP')[]; }; /** * Outputs generated from defineData @@ -181,7 +174,7 @@ export interface AWSAmplifyBackendOutputs { /** * AWS Region of Amazon Location Service resources */ - aws_region: string; + aws_region: AwsRegion; /** * Maps from Amazon Location Service */ @@ -195,20 +188,14 @@ export interface AWSAmplifyBackendOutputs { * Location search (search by places, addresses, coordinates) */ search_indices?: { - /** - * @minItems 1 - */ - items: [string, ...string[]]; + items: string[]; default: string; }; /** * Geofencing (visualize virtual perimeters) */ geofence_collections?: { - /** - * @minItems 1 - */ - items: [string, ...string[]]; + items: string[]; default: string; }; }; @@ -221,7 +208,7 @@ export interface AWSAmplifyBackendOutputs { /** * @minItems 1 */ - channels: [AmazonPinpointChannels, ...AmazonPinpointChannels[]]; + channels: AmazonPinpointChannels[]; }; /** * Outputs generated from defineStorage @@ -243,6 +230,10 @@ export interface AWSAmplifyBackendOutputs { * via the `patternProperty` ".*". */ export interface AmazonLocationServiceConfig { + /** + * Map resource name + */ + name?: string; /** * Map style */ diff --git a/packages/client-config/src/client-config-schema/client_config_v1.2.ts b/packages/client-config/src/client-config-schema/client_config_v1.2.ts index 8e15a84a4ba..f9aa397d970 100644 --- a/packages/client-config/src/client-config-schema/client_config_v1.2.ts +++ b/packages/client-config/src/client-config-schema/client_config_v1.2.ts @@ -57,10 +57,6 @@ export type AmplifyStorageAccessActions = * Config format for Amplify Gen 2 client libraries to communicate with backend services. */ export interface AWSAmplifyBackendOutputs { - /** - * JSON schema - */ - $schema?: string; /** * Version of this schema */ @@ -132,13 +128,13 @@ export interface AWSAmplifyBackendOutputs { * * @minItems 1 */ - redirect_sign_in_uri: [string, ...string[]]; + redirect_sign_in_uri: string[]; /** * URIs used to redirect after signing out * * @minItems 1 */ - redirect_sign_out_uri: [string, ...string[]]; + redirect_sign_out_uri: string[]; response_type: 'code' | 'token'; }; /** @@ -152,14 +148,11 @@ export interface AWSAmplifyBackendOutputs { * * @minItems 1 */ - username_attributes?: [ - 'email' | 'phone_number' | 'username', - ...('email' | 'phone_number' | 'username')[], - ]; + username_attributes?: ('email' | 'phone_number' | 'username')[]; user_verification_types?: ('email' | 'phone_number')[]; unauthenticated_identities_enabled?: boolean; mfa_configuration?: 'NONE' | 'OPTIONAL' | 'REQUIRED'; - mfa_methods?: ('SMS' | 'TOTP' | 'EMAIL')[]; + mfa_methods?: ('SMS' | 'TOTP')[]; }; /** * Outputs generated from defineData @@ -204,7 +197,7 @@ export interface AWSAmplifyBackendOutputs { /** * @minItems 1 */ - items: [string, ...string[]]; + items: string[]; default: string; }; /** @@ -214,7 +207,7 @@ export interface AWSAmplifyBackendOutputs { /** * @minItems 1 */ - items: [string, ...string[]]; + items: string[]; default: string; }; }; @@ -227,7 +220,7 @@ export interface AWSAmplifyBackendOutputs { /** * @minItems 1 */ - channels: [AmazonPinpointChannels, ...AmazonPinpointChannels[]]; + channels: AmazonPinpointChannels[]; }; /** * Outputs generated from defineStorage @@ -249,6 +242,10 @@ export interface AWSAmplifyBackendOutputs { * via the `patternProperty` ".*". */ export interface AmazonLocationServiceConfig { + /** + * Map resource name + */ + name?: string; /** * Map style */ diff --git a/packages/client-config/src/client-config-schema/client_config_v1.3.ts b/packages/client-config/src/client-config-schema/client_config_v1.3.ts index a72817d0a0c..560b0773ec5 100644 --- a/packages/client-config/src/client-config-schema/client_config_v1.3.ts +++ b/packages/client-config/src/client-config-schema/client_config_v1.3.ts @@ -57,10 +57,6 @@ export type AmplifyStorageAccessActions = * Config format for Amplify Gen 2 client libraries to communicate with backend services. */ export interface AWSAmplifyBackendOutputs { - /** - * JSON schema - */ - $schema?: string; /** * Version of this schema */ @@ -132,13 +128,13 @@ export interface AWSAmplifyBackendOutputs { * * @minItems 1 */ - redirect_sign_in_uri: [string, ...string[]]; + redirect_sign_in_uri: string[]; /** * URIs used to redirect after signing out * * @minItems 1 */ - redirect_sign_out_uri: [string, ...string[]]; + redirect_sign_out_uri: string[]; response_type: 'code' | 'token'; }; /** @@ -152,14 +148,11 @@ export interface AWSAmplifyBackendOutputs { * * @minItems 1 */ - username_attributes?: [ - 'email' | 'phone_number' | 'username', - ...('email' | 'phone_number' | 'username')[], - ]; + username_attributes?: ('email' | 'phone_number' | 'username')[]; user_verification_types?: ('email' | 'phone_number')[]; unauthenticated_identities_enabled?: boolean; mfa_configuration?: 'NONE' | 'OPTIONAL' | 'REQUIRED'; - mfa_methods?: ('SMS' | 'TOTP' | 'EMAIL')[]; + mfa_methods?: ('SMS' | 'TOTP')[]; groups?: { [k: string]: AmplifyUserGroupConfig; }[]; @@ -207,7 +200,7 @@ export interface AWSAmplifyBackendOutputs { /** * @minItems 1 */ - items: [string, ...string[]]; + items: string[]; default: string; }; /** @@ -217,7 +210,7 @@ export interface AWSAmplifyBackendOutputs { /** * @minItems 1 */ - items: [string, ...string[]]; + items: string[]; default: string; }; }; @@ -230,7 +223,7 @@ export interface AWSAmplifyBackendOutputs { /** * @minItems 1 */ - channels: [AmazonPinpointChannels, ...AmazonPinpointChannels[]]; + channels: AmazonPinpointChannels[]; }; /** * Outputs generated from defineStorage @@ -259,6 +252,10 @@ export interface AmplifyUserGroupConfig { * via the `patternProperty` ".*". */ export interface AmazonLocationServiceConfig { + /** + * Map resource name + */ + name?: string; /** * Map style */ diff --git a/packages/client-config/src/client-config-schema/client_config_v1.4.ts b/packages/client-config/src/client-config-schema/client_config_v1.4.ts index 51a66efb37a..e84598d88c6 100644 --- a/packages/client-config/src/client-config-schema/client_config_v1.4.ts +++ b/packages/client-config/src/client-config-schema/client_config_v1.4.ts @@ -3,9 +3,6 @@ * This file was automatically generated by json-schema-to-typescript. * DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, * and run json-schema-to-typescript to regenerate this file. - * - * WARNING: For schema_v1.4, run json-schema-to-typescript with --unreachableDefinitions - * to ensure all types are properly generated. */ /** @@ -93,10 +90,6 @@ export type AmplifyStorageAccessActions = * Config format for Amplify Gen 2 client libraries to communicate with backend services. */ export interface AWSAmplifyBackendOutputs { - /** - * JSON schema - */ - $schema?: string; /** * Version of this schema */ @@ -168,13 +161,13 @@ export interface AWSAmplifyBackendOutputs { * * @minItems 1 */ - redirect_sign_in_uri: [string, ...string[]]; + redirect_sign_in_uri: string[]; /** * URIs used to redirect after signing out * * @minItems 1 */ - redirect_sign_out_uri: [string, ...string[]]; + redirect_sign_out_uri: string[]; response_type: 'code' | 'token'; }; /** @@ -188,14 +181,11 @@ export interface AWSAmplifyBackendOutputs { * * @minItems 1 */ - username_attributes?: [ - 'email' | 'phone_number' | 'username', - ...('email' | 'phone_number' | 'username')[], - ]; + username_attributes?: ('email' | 'phone_number' | 'username')[]; user_verification_types?: ('email' | 'phone_number')[]; unauthenticated_identities_enabled?: boolean; mfa_configuration?: 'NONE' | 'OPTIONAL' | 'REQUIRED'; - mfa_methods?: ('SMS' | 'TOTP' | 'EMAIL')[]; + mfa_methods?: ('SMS' | 'TOTP')[]; groups?: { [k: string]: AmplifyUserGroupConfig; }[]; @@ -243,7 +233,7 @@ export interface AWSAmplifyBackendOutputs { /** * @minItems 1 */ - items: [string, ...string[]]; + items: string[]; default: string; }; /** @@ -253,7 +243,7 @@ export interface AWSAmplifyBackendOutputs { /** * @minItems 1 */ - items: [string, ...string[]]; + items: string[]; default: string; }; }; @@ -266,7 +256,7 @@ export interface AWSAmplifyBackendOutputs { /** * @minItems 1 */ - channels: [AmazonPinpointChannels, ...AmazonPinpointChannels[]]; + channels: AmazonPinpointChannels[]; }; /** * Outputs generated from defineStorage @@ -301,6 +291,10 @@ export interface AmplifyUserGroupConfig { * via the `definition` "amazon_location_service_config". */ export interface AmazonLocationServiceConfig { + /** + * Map resource name + */ + name?: string; /** * Map style */ diff --git a/packages/client-config/src/client-config-schema/client_config_v1.ts b/packages/client-config/src/client-config-schema/client_config_v1.ts index 2103f81b71b..eff8e488364 100644 --- a/packages/client-config/src/client-config-schema/client_config_v1.ts +++ b/packages/client-config/src/client-config-schema/client_config_v1.ts @@ -51,14 +51,10 @@ export type AmazonPinpointChannels = * Config format for Amplify Gen 2 client libraries to communicate with backend services. */ export interface AWSAmplifyBackendOutputs { - /** - * JSON schema - */ - $schema?: string; /** * Version of this schema */ - version: '1.1'; + version: '1'; /** * Outputs manually specified by developers for use with frontend library */ @@ -67,7 +63,7 @@ export interface AWSAmplifyBackendOutputs { /** * AWS Region of Amazon Pinpoint resources */ - aws_region: string; + aws_region: AwsRegion; app_id: string; }; }; @@ -78,7 +74,7 @@ export interface AWSAmplifyBackendOutputs { /** * AWS Region of Amazon Cognito resources */ - aws_region: string; + aws_region: AwsRegion; /** * Cognito User Pool ID */ @@ -126,13 +122,13 @@ export interface AWSAmplifyBackendOutputs { * * @minItems 1 */ - redirect_sign_in_uri: [string, ...string[]]; + redirect_sign_in_uri: string[]; /** * URIs used to redirect after signing out * * @minItems 1 */ - redirect_sign_out_uri: [string, ...string[]]; + redirect_sign_out_uri: string[]; response_type: 'code' | 'token'; }; /** @@ -146,14 +142,11 @@ export interface AWSAmplifyBackendOutputs { * * @minItems 1 */ - username_attributes?: [ - 'email' | 'phone_number' | 'username', - ...('email' | 'phone_number' | 'username')[], - ]; + username_attributes?: ('email' | 'phone_number' | 'username')[]; user_verification_types?: ('email' | 'phone_number')[]; unauthenticated_identities_enabled?: boolean; mfa_configuration?: 'NONE' | 'OPTIONAL' | 'REQUIRED'; - mfa_methods?: ('SMS' | 'TOTP' | 'EMAIL')[]; + mfa_methods?: ('SMS' | 'TOTP')[]; }; /** * Outputs generated from defineData @@ -181,7 +174,7 @@ export interface AWSAmplifyBackendOutputs { /** * AWS Region of Amazon Location Service resources */ - aws_region: string; + aws_region: AwsRegion; /** * Maps from Amazon Location Service */ @@ -195,20 +188,14 @@ export interface AWSAmplifyBackendOutputs { * Location search (search by places, addresses, coordinates) */ search_indices?: { - /** - * @minItems 1 - */ - items: [string, ...string[]]; + items: string[]; default: string; }; /** * Geofencing (visualize virtual perimeters) */ geofence_collections?: { - /** - * @minItems 1 - */ - items: [string, ...string[]]; + items: string[]; default: string; }; }; @@ -221,7 +208,7 @@ export interface AWSAmplifyBackendOutputs { /** * @minItems 1 */ - channels: [AmazonPinpointChannels, ...AmazonPinpointChannels[]]; + channels: AmazonPinpointChannels[]; }; /** * Outputs generated from defineStorage @@ -242,6 +229,10 @@ export interface AWSAmplifyBackendOutputs { * via the `patternProperty` ".*". */ export interface AmazonLocationServiceConfig { + /** + * Map resource name + */ + name?: string; /** * Map style */ diff --git a/packages/client-config/src/client-config-schema/schema_v1.1.json b/packages/client-config/src/client-config-schema/schema_v1.1.json index cf50532bf18..cad1cf7a4b6 100644 --- a/packages/client-config/src/client-config-schema/schema_v1.1.json +++ b/packages/client-config/src/client-config-schema/schema_v1.1.json @@ -187,7 +187,7 @@ "mfa_methods": { "type": "array", "items": { - "enum": ["SMS", "TOTP", "EMAIL"] + "enum": ["SMS", "TOTP"] } } }, diff --git a/packages/client-config/src/client-config-schema/schema_v1.2.json b/packages/client-config/src/client-config-schema/schema_v1.2.json index b10ec7c1ea2..b85a10ff30c 100644 --- a/packages/client-config/src/client-config-schema/schema_v1.2.json +++ b/packages/client-config/src/client-config-schema/schema_v1.2.json @@ -187,7 +187,7 @@ "mfa_methods": { "type": "array", "items": { - "enum": ["SMS", "TOTP", "EMAIL"] + "enum": ["SMS", "TOTP"] } } }, diff --git a/packages/client-config/src/client-config-schema/schema_v1.3.json b/packages/client-config/src/client-config-schema/schema_v1.3.json index 817a444a0f1..bf89de55040 100644 --- a/packages/client-config/src/client-config-schema/schema_v1.3.json +++ b/packages/client-config/src/client-config-schema/schema_v1.3.json @@ -187,7 +187,7 @@ "mfa_methods": { "type": "array", "items": { - "enum": ["SMS", "TOTP", "EMAIL"] + "enum": ["SMS", "TOTP"] } }, "groups": { diff --git a/packages/client-config/src/client-config-schema/schema_v1.4.json b/packages/client-config/src/client-config-schema/schema_v1.4.json index 66037e44776..9205353c421 100644 --- a/packages/client-config/src/client-config-schema/schema_v1.4.json +++ b/packages/client-config/src/client-config-schema/schema_v1.4.json @@ -187,7 +187,7 @@ "mfa_methods": { "type": "array", "items": { - "enum": ["SMS", "TOTP", "EMAIL"] + "enum": ["SMS", "TOTP"] } }, "groups": { diff --git a/packages/client-config/src/client-config-schema/schema_v1.json b/packages/client-config/src/client-config-schema/schema_v1.json index 99deb8f279e..5ca97e2d201 100644 --- a/packages/client-config/src/client-config-schema/schema_v1.json +++ b/packages/client-config/src/client-config-schema/schema_v1.json @@ -187,7 +187,7 @@ "mfa_methods": { "type": "array", "items": { - "enum": ["SMS", "TOTP", "EMAIL"] + "enum": ["SMS", "TOTP"] } } }, From 27b9c2cadf5f61997c86ef9cf8735ee61f32edb5 Mon Sep 17 00:00:00 2001 From: osama-rizk Date: Wed, 29 Oct 2025 17:32:47 +0100 Subject: [PATCH 06/10] update schema config 1.4 --- .changeset/cuddly-clowns-guess.md | 1 + packages/client-config/API.md | 4 ++-- .../src/client-config-schema/client_config_v1.4.ts | 10 +++++----- .../src/client-config-schema/schema_v1.4.json | 2 +- 4 files changed, 9 insertions(+), 8 deletions(-) diff --git a/.changeset/cuddly-clowns-guess.md b/.changeset/cuddly-clowns-guess.md index 3319c6f0bca..1c64c047e7d 100644 --- a/.changeset/cuddly-clowns-guess.md +++ b/.changeset/cuddly-clowns-guess.md @@ -1,5 +1,6 @@ --- '@aws-amplify/auth-construct': minor +'@aws-amplify/client-config': minor '@aws-amplify/backend-auth': minor '@aws-amplify/backend': minor '@aws-amplify/seed': minor diff --git a/packages/client-config/API.md b/packages/client-config/API.md index 2c1f6d22c9e..9914cfeb16b 100644 --- a/packages/client-config/API.md +++ b/packages/client-config/API.md @@ -27,7 +27,6 @@ type AmazonCognitoStandardAttributes_5 = 'address' | 'birthdate' | 'email' | 'fa // @public interface AmazonLocationServiceConfig { - name?: string; style?: string; } @@ -222,6 +221,7 @@ export type AuthClientConfig = { // @public interface AWSAmplifyBackendOutputs { + $schema?: string; analytics?: { amazon_pinpoint?: { aws_region: string; @@ -253,7 +253,7 @@ interface AWSAmplifyBackendOutputs { user_verification_types?: ('email' | 'phone_number')[]; unauthenticated_identities_enabled?: boolean; mfa_configuration?: 'NONE' | 'OPTIONAL' | 'REQUIRED'; - mfa_methods?: ('SMS' | 'TOTP')[]; + mfa_methods?: ('SMS' | 'TOTP' | 'EMAIL')[]; groups?: { [k: string]: AmplifyUserGroupConfig; }[]; diff --git a/packages/client-config/src/client-config-schema/client_config_v1.4.ts b/packages/client-config/src/client-config-schema/client_config_v1.4.ts index e84598d88c6..7a49364c710 100644 --- a/packages/client-config/src/client-config-schema/client_config_v1.4.ts +++ b/packages/client-config/src/client-config-schema/client_config_v1.4.ts @@ -90,6 +90,10 @@ export type AmplifyStorageAccessActions = * Config format for Amplify Gen 2 client libraries to communicate with backend services. */ export interface AWSAmplifyBackendOutputs { + /** + * JSON schema + */ + $schema?: string; /** * Version of this schema */ @@ -185,7 +189,7 @@ export interface AWSAmplifyBackendOutputs { user_verification_types?: ('email' | 'phone_number')[]; unauthenticated_identities_enabled?: boolean; mfa_configuration?: 'NONE' | 'OPTIONAL' | 'REQUIRED'; - mfa_methods?: ('SMS' | 'TOTP')[]; + mfa_methods?: ('SMS' | 'TOTP' | 'EMAIL')[]; groups?: { [k: string]: AmplifyUserGroupConfig; }[]; @@ -291,10 +295,6 @@ export interface AmplifyUserGroupConfig { * via the `definition` "amazon_location_service_config". */ export interface AmazonLocationServiceConfig { - /** - * Map resource name - */ - name?: string; /** * Map style */ diff --git a/packages/client-config/src/client-config-schema/schema_v1.4.json b/packages/client-config/src/client-config-schema/schema_v1.4.json index 9205353c421..66037e44776 100644 --- a/packages/client-config/src/client-config-schema/schema_v1.4.json +++ b/packages/client-config/src/client-config-schema/schema_v1.4.json @@ -187,7 +187,7 @@ "mfa_methods": { "type": "array", "items": { - "enum": ["SMS", "TOTP"] + "enum": ["SMS", "TOTP", "EMAIL"] } }, "groups": { From 10637f2d6ee439b34579c0717ef91f7e74070990 Mon Sep 17 00:00:00 2001 From: osama-rizk Date: Thu, 30 Oct 2025 10:26:59 +0100 Subject: [PATCH 07/10] Update client config --- .../src/client-config-schema/client_config_v1.4.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/client-config/src/client-config-schema/client_config_v1.4.ts b/packages/client-config/src/client-config-schema/client_config_v1.4.ts index 7a49364c710..73a2be938fc 100644 --- a/packages/client-config/src/client-config-schema/client_config_v1.4.ts +++ b/packages/client-config/src/client-config-schema/client_config_v1.4.ts @@ -90,10 +90,6 @@ export type AmplifyStorageAccessActions = * Config format for Amplify Gen 2 client libraries to communicate with backend services. */ export interface AWSAmplifyBackendOutputs { - /** - * JSON schema - */ - $schema?: string; /** * Version of this schema */ @@ -295,6 +291,10 @@ export interface AmplifyUserGroupConfig { * via the `definition` "amazon_location_service_config". */ export interface AmazonLocationServiceConfig { + /** + * Map resource name + */ + name?: string; /** * Map style */ From 0b7171c2737fb75598212aa6e9058427d7f1cf28 Mon Sep 17 00:00:00 2001 From: osama-rizk Date: Thu, 30 Oct 2025 11:10:11 +0100 Subject: [PATCH 08/10] update api doc. --- packages/client-config/API.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/client-config/API.md b/packages/client-config/API.md index 9914cfeb16b..55795591afd 100644 --- a/packages/client-config/API.md +++ b/packages/client-config/API.md @@ -27,6 +27,7 @@ type AmazonCognitoStandardAttributes_5 = 'address' | 'birthdate' | 'email' | 'fa // @public interface AmazonLocationServiceConfig { + name?: string; style?: string; } @@ -221,7 +222,6 @@ export type AuthClientConfig = { // @public interface AWSAmplifyBackendOutputs { - $schema?: string; analytics?: { amazon_pinpoint?: { aws_region: string; From 3fcd4656183c5edc2a83e754187e1518245aa9ad Mon Sep 17 00:00:00 2001 From: osama-rizk Date: Mon, 3 Nov 2025 13:16:58 +0100 Subject: [PATCH 09/10] feat: add featurePlan support to auth construct --- packages/auth-construct/API.md | 1 + packages/auth-construct/src/construct.ts | 1 + packages/auth-construct/src/types.ts | 5 +++++ 3 files changed, 7 insertions(+) diff --git a/packages/auth-construct/API.md b/packages/auth-construct/API.md index cfce6840c45..9508c7c6a9c 100644 --- a/packages/auth-construct/API.md +++ b/packages/auth-construct/API.md @@ -42,6 +42,7 @@ export type AttributeMapping = { // @public export type AuthProps = { name?: string; + featurePlan?: aws_cognito.FeaturePlan; loginWith: { email?: EmailLogin; phone?: PhoneNumberLogin; diff --git a/packages/auth-construct/src/construct.ts b/packages/auth-construct/src/construct.ts index c192dc07a15..b1f122f7bf6 100644 --- a/packages/auth-construct/src/construct.ts +++ b/packages/auth-construct/src/construct.ts @@ -615,6 +615,7 @@ export class AmplifyAuth snsRegion: smsConfiguration?.snsRegion, enableSmsRole: smsConfiguration?.enableSMSRole, selfSignUpEnabled: DEFAULTS.ALLOW_SELF_SIGN_UP, + featurePlan: props?.featurePlan, mfa: mfaMode, mfaMessage: this.getMFAMessage(props.multifactor), mfaSecondFactor: mfaType, diff --git a/packages/auth-construct/src/types.ts b/packages/auth-construct/src/types.ts index 02f314621ce..06267a58a0a 100644 --- a/packages/auth-construct/src/types.ts +++ b/packages/auth-construct/src/types.ts @@ -441,6 +441,11 @@ export type AuthProps = { * Specify a name which will aid in generating resource names. */ name?: string; + /** + * Specify the feature plan for the user pool. + * @example cognito.FeaturePlan.PLUS + */ + featurePlan?: cognito.FeaturePlan; /** * Specify how you would like users to log in. You can choose from email, phone, and even external providers such as LoginWithAmazon. */ From f7e7e369490de466ccff389a90f26d59b3afaaea Mon Sep 17 00:00:00 2001 From: osama-rizk Date: Mon, 3 Nov 2025 13:25:52 +0100 Subject: [PATCH 10/10] Add unit tests --- packages/auth-construct/src/construct.test.ts | 25 +++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/packages/auth-construct/src/construct.test.ts b/packages/auth-construct/src/construct.test.ts index b24607c6e3c..2942bd2b28c 100644 --- a/packages/auth-construct/src/construct.test.ts +++ b/packages/auth-construct/src/construct.test.ts @@ -3144,4 +3144,29 @@ void describe('Auth construct', () => { UserPoolName: Match.absent(), }); }); + + void it('sets featurePlan when provided', () => { + const app = new App(); + const stack = new Stack(app); + new AmplifyAuth(stack, 'test', { + loginWith: { email: true }, + featurePlan: aws_cognito.FeaturePlan.ESSENTIALS, + }); + const template = Template.fromStack(stack); + template.hasResourceProperties('AWS::Cognito::UserPool', { + UserPoolTier: 'ESSENTIALS', + }); + }); + + void it('does not set featurePlan when not provided', () => { + const app = new App(); + const stack = new Stack(app); + new AmplifyAuth(stack, 'test', { + loginWith: { email: true }, + }); + const template = Template.fromStack(stack); + template.hasResourceProperties('AWS::Cognito::UserPool', { + UserPoolTier: Match.absent(), + }); + }); });