From 0ecad3ff993fa3af67633f674b9abc064845d2e0 Mon Sep 17 00:00:00 2001 From: Sanay Yogesh Shah Date: Thu, 3 Oct 2024 11:22:29 -0700 Subject: [PATCH 1/5] feat: storage and functions codegen integration tests --- .../__tests__/migration_codegen_e2e.test.ts | 25 ++++- .../src/helpers.ts | 93 +++++++++++++++++-- 2 files changed, 109 insertions(+), 9 deletions(-) diff --git a/packages/amplify-migration-codegen-e2e/src/__tests__/migration_codegen_e2e.test.ts b/packages/amplify-migration-codegen-e2e/src/__tests__/migration_codegen_e2e.test.ts index 481d26b595..25e7946bbb 100644 --- a/packages/amplify-migration-codegen-e2e/src/__tests__/migration_codegen_e2e.test.ts +++ b/packages/amplify-migration-codegen-e2e/src/__tests__/migration_codegen_e2e.test.ts @@ -1,6 +1,6 @@ import path from 'node:path'; import assert from 'node:assert'; -import { createNewProjectDir } from '@aws-amplify/amplify-e2e-core'; +import { createNewProjectDir, sleep } from '@aws-amplify/amplify-e2e-core'; import { cleanupProjects, setupAndPushGen1Project, @@ -8,6 +8,9 @@ import { runCodegenCommand, runGen2SandboxCommand, assertUserPoolResource, + assertStorageResource, + assertFunctionResource, + copyTsFile, } from '../helpers'; void describe('Migration Codegen E2E tests', () => { @@ -21,11 +24,27 @@ void describe('Migration Codegen E2E tests', () => { await cleanupProjects(projRoot); }); - void it('performs full migration codegen flow with Auth backend', async () => { + void it('performs full migration codegen flow with backend', async () => { await setupAndPushGen1Project(projRoot, 'CodegenTest'); - const { gen1UserPoolId, gen1Region } = await assertGen1Setup(projRoot); + const { gen1UserPoolId, gen1FunctionName, gen1BucketName, gen1Region } = await assertGen1Setup(projRoot); await assert.doesNotReject(runCodegenCommand(projRoot), 'Codegen failed'); + await sleep(10000); // 10 seconds + const gen1FunctionPath = path.join( + projRoot, + '.amplify', + 'migration', + 'amplify', + 'backend', + 'function', + gen1FunctionName.split('-')[0], + 'src', + 'index.js', + ); + const gen2FunctionPath = path.join(projRoot, 'amplify', 'function', gen1FunctionName.split('-')[0], 'handler.ts'); + await copyTsFile(gen1FunctionPath, gen2FunctionPath); await assert.doesNotReject(runGen2SandboxCommand(projRoot), 'Gen2 CDK deployment failed'); await assertUserPoolResource(projRoot, gen1UserPoolId, gen1Region); + await assertStorageResource(projRoot, gen1BucketName, gen1Region); + await assertFunctionResource(projRoot, gen1FunctionName, gen1Region); }); }); diff --git a/packages/amplify-migration-codegen-e2e/src/helpers.ts b/packages/amplify-migration-codegen-e2e/src/helpers.ts index 80662174dd..e6110c8280 100644 --- a/packages/amplify-migration-codegen-e2e/src/helpers.ts +++ b/packages/amplify-migration-codegen-e2e/src/helpers.ts @@ -9,15 +9,42 @@ import { npmInstall, getNpxPath, nspawn as spawn, + addS3WithGuestAccess, + checkIfBucketExists, + addFunction, + functionBuild, + getFunction, } from '@aws-amplify/amplify-e2e-core'; import * as fs from 'fs-extra'; import { $TSAny } from '@aws-amplify/amplify-cli-core'; import path from 'node:path'; -import { CloudControlClient, GetResourceCommand } from '@aws-sdk/client-cloudcontrol'; +import { CloudControlClient, GetResourceCommand, ListResourcesCommand, ListResourcesCommandOutput } from '@aws-sdk/client-cloudcontrol'; import { unset } from 'lodash'; const pushTimeoutMS = 1000 * 60 * 20; // 20 minutes; +export async function copyTsFile(sourcePath: string, destinationPath: string): Promise { + const content = await fs.readFile(sourcePath, 'utf8'); + + // Replace the first occurrence of 'event' with 'event: any' + const modifiedContent = content.replace(/(exports\.handler\s*=\s*async\s*\(\s*)event(\s*\))/, '$1event: any$2'); + + await fs.writeFile(destinationPath, modifiedContent, 'utf8'); +} + +async function listResourcesByType(typeName: string, region: string) { + const client = new CloudControlClient({ region }); + const resources = []; + const command = new ListResourcesCommand({ + TypeName: typeName, + }); + const response: ListResourcesCommandOutput = await client.send(command); + if (response.ResourceDescriptions) { + resources.push(...response.ResourceDescriptions.map((rd) => JSON.parse(rd.Properties ?? ''))); + } + return resources; +} + async function getResourceDetails(typeName: string, identifier: string, region: string) { const client = new CloudControlClient({ region }); const command = new GetResourceCommand({ @@ -61,18 +88,35 @@ function deleteGen2Sandbox(cwd: string) { } export async function setupAndPushGen1Project(projRoot: string, projectName: string) { - await initJSProjectWithProfile(projRoot, { name: projectName, disableAmplifyAppCreation: false }); + await initJSProjectWithProfile(projRoot, { name: projectName, disableAmplifyAppCreation: false, includeGen2RecommendationPrompt: false }); await addAuthWithDefault(projRoot); + await addFunction(projRoot, { functionTemplate: 'Hello World' }, 'nodejs'); + await functionBuild(projRoot); + await addS3WithGuestAccess(projRoot); await amplifyPushAuth(projRoot); } export async function assertGen1Setup(projRoot: string) { const gen1Meta = getProjectMeta(projRoot); - const gen1UserPoolId = Object.keys(gen1Meta.auth).map((key) => gen1Meta.auth[key])[0].output.UserPoolId; const gen1Region = gen1Meta.providers.awscloudformation.Region; - const userPool = await getUserPool(gen1UserPoolId, gen1Region); - expect(userPool.UserPool).toBeDefined(); - return { gen1UserPoolId, gen1Region }; + const { UserPoolId: gen1UserPoolId } = Object.keys(gen1Meta.auth).map((key) => gen1Meta.auth[key])[0].output; + const { Arn: gen1FunctionArn, Name: gen1FunctionName } = Object.keys(gen1Meta.function).map((key) => gen1Meta.function[key])[0].output; + const { BucketName: gen1BucketName } = Object.keys(gen1Meta.storage).map((key) => gen1Meta.storage[key])[0].output; + + expect(gen1Region).toBeDefined(); + + const cloudUserPool = await getUserPool(gen1UserPoolId, gen1Region); + expect(cloudUserPool.UserPool).toBeDefined(); + + expect(gen1FunctionArn).toBeDefined(); + expect(gen1FunctionName).toBeDefined(); + const cloudFunction = await getFunction(gen1FunctionName, gen1Region); + expect(cloudFunction.Configuration?.FunctionArn).toEqual(gen1FunctionArn); + + expect(gen1BucketName).toBeDefined(); + const bucketExists = await checkIfBucketExists(gen1BucketName, gen1Region); + expect(bucketExists).toMatchObject({}); + return { gen1UserPoolId, gen1FunctionName, gen1BucketName, gen1Region }; } export async function assertUserPoolResource(projRoot: string, gen1UserPoolId: string, gen1Region: string) { @@ -106,6 +150,43 @@ export async function assertUserPoolResource(projRoot: string, gen1UserPoolId: s expect(gen2Resource).toEqual(gen1Resource); } +export async function assertStorageResource(projRoot: string, gen1BucketName: string, gen1Region: string) { + const gen1Resource = await getResourceDetails('AWS::S3::Bucket', gen1BucketName, gen1Region); + removeProperties(gen1Resource, ['DualStackDomainName', 'DomainName', 'BucketName', 'Arn', 'RegionalDomainName', 'Tags', 'WebsiteURL']); + // TODO: remove below line after CorsConfiguration.CorsRules[0].Id inconsistency is fixed + removeProperties(gen1Resource, ['CorsConfiguration.CorsRules[0].Id']); + + const gen2Meta = getProjectOutputs(projRoot); + const gen2BucketName = gen2Meta.storage.bucket_name; + const gen2Region = gen2Meta.storage.aws_region; + const gen2Resource = await getResourceDetails('AWS::S3::Bucket', gen2BucketName, gen2Region); + removeProperties(gen2Resource, ['DualStackDomainName', 'DomainName', 'BucketName', 'Arn', 'RegionalDomainName', 'Tags', 'WebsiteURL']); + + expect(gen2Resource).toEqual(gen1Resource); +} + +export async function assertFunctionResource(projRoot: string, gen1FunctionName: string, gen1Region: string) { + const gen1Resource = await getResourceDetails('AWS::Lambda::Function', gen1FunctionName, gen1Region); + removeProperties(gen1Resource, ['Arn', 'FunctionName', 'LoggingConfig.LogGroup', 'Role']); + // TODO: remove below line after RecursiveLoop, RuntimeManagementConfig, Tags is fixed + removeProperties(gen1Resource, ['RecursiveLoop', 'RuntimeManagementConfig', 'Tags']); + + const gen2Meta = getProjectOutputs(projRoot); + const gen2Region = gen2Meta.auth.aws_region; + + // Workaround as amplify_outputs.json file doesn't have function metadata + const gen2Resources = await listResourcesByType('AWS::Lambda::Function', gen2Region); + const gen2Resource = gen2Resources.find((resource) => { + const functionName = resource.FunctionName; + return functionName.includes('amplify-mygen2app') && functionName.includes(gen1FunctionName.split('-')[0]); + }); + removeProperties(gen2Resource, ['Arn', 'FunctionName', 'LoggingConfig.LogGroup', 'Role']); + // TODO: remove below line after Environment.Variables.AMPLIFY_SSM_ENV_CONFIG inconsistency is fixed + removeProperties(gen2Resource, ['Environment.Variables.AMPLIFY_SSM_ENV_CONFIG']); + + expect(gen2Resource).toEqual(gen1Resource); +} + function removeProperties(obj: Record, propertiesToRemove: string[]) { propertiesToRemove.forEach((prop) => unset(obj, prop)); } From cf325ba9d0efcd45b8812db08c6476734617c914 Mon Sep 17 00:00:00 2001 From: Sanay Yogesh Shah Date: Tue, 8 Oct 2024 01:51:27 -0700 Subject: [PATCH 2/5] feat: add data category integration test --- .eslint-dictionary.json | 3 + .../package.json | 1 + .../__tests__/migration_codegen_e2e.test.ts | 25 +- .../src/helpers.ts | 228 +++++++- yarn.lock | 533 ++++++++++++++++++ 5 files changed, 745 insertions(+), 45 deletions(-) diff --git a/.eslint-dictionary.json b/.eslint-dictionary.json index f8c9d0ca70..e662b50e81 100644 --- a/.eslint-dictionary.json +++ b/.eslint-dictionary.json @@ -88,6 +88,7 @@ "cname", "codebase", "codegen", + "codegentest", "codepipeline", "codesuite", "cognito", @@ -138,6 +139,7 @@ "ejs", "elasticsearch", "emacs", + "enablegen2migration", "endian", "enode", "entrypoint", @@ -425,6 +427,7 @@ "uploader", "upsert", "upvotes", + "uris", "urlencoded", "urls", "userpool", diff --git a/packages/amplify-migration-codegen-e2e/package.json b/packages/amplify-migration-codegen-e2e/package.json index db46d32e15..4f7fc3f512 100644 --- a/packages/amplify-migration-codegen-e2e/package.json +++ b/packages/amplify-migration-codegen-e2e/package.json @@ -7,6 +7,7 @@ "@aws-amplify/amplify-cli-core": "4.4.0-gen2-migration-test-alpha.0", "@aws-amplify/amplify-e2e-core": "5.5.11-gen2-migration-test-alpha.0", "@aws-amplify/amplify-gen2-codegen": "0.1.0-gen2-migration-test-alpha.0", + "@aws-sdk/client-appsync": "^3.666.0", "@aws-sdk/client-cloudcontrol": "^3.658.1", "fs-extra": "^8.1.0", "lodash": "^4.17.21" diff --git a/packages/amplify-migration-codegen-e2e/src/__tests__/migration_codegen_e2e.test.ts b/packages/amplify-migration-codegen-e2e/src/__tests__/migration_codegen_e2e.test.ts index 25e7946bbb..900069fcae 100644 --- a/packages/amplify-migration-codegen-e2e/src/__tests__/migration_codegen_e2e.test.ts +++ b/packages/amplify-migration-codegen-e2e/src/__tests__/migration_codegen_e2e.test.ts @@ -1,6 +1,6 @@ import path from 'node:path'; import assert from 'node:assert'; -import { createNewProjectDir, sleep } from '@aws-amplify/amplify-e2e-core'; +import { createNewProjectDir } from '@aws-amplify/amplify-e2e-core'; import { cleanupProjects, setupAndPushGen1Project, @@ -10,7 +10,9 @@ import { assertUserPoolResource, assertStorageResource, assertFunctionResource, - copyTsFile, + assertDataResource, + copyFunctionFile, + copyGen1Schema, } from '../helpers'; void describe('Migration Codegen E2E tests', () => { @@ -26,25 +28,14 @@ void describe('Migration Codegen E2E tests', () => { void it('performs full migration codegen flow with backend', async () => { await setupAndPushGen1Project(projRoot, 'CodegenTest'); - const { gen1UserPoolId, gen1FunctionName, gen1BucketName, gen1Region } = await assertGen1Setup(projRoot); + const { gen1UserPoolId, gen1FunctionName, gen1BucketName, gen1GraphQLAPIId, gen1Region } = await assertGen1Setup(projRoot); await assert.doesNotReject(runCodegenCommand(projRoot), 'Codegen failed'); - await sleep(10000); // 10 seconds - const gen1FunctionPath = path.join( - projRoot, - '.amplify', - 'migration', - 'amplify', - 'backend', - 'function', - gen1FunctionName.split('-')[0], - 'src', - 'index.js', - ); - const gen2FunctionPath = path.join(projRoot, 'amplify', 'function', gen1FunctionName.split('-')[0], 'handler.ts'); - await copyTsFile(gen1FunctionPath, gen2FunctionPath); + await copyFunctionFile(projRoot, gen1FunctionName); + await copyGen1Schema(projRoot); await assert.doesNotReject(runGen2SandboxCommand(projRoot), 'Gen2 CDK deployment failed'); await assertUserPoolResource(projRoot, gen1UserPoolId, gen1Region); await assertStorageResource(projRoot, gen1BucketName, gen1Region); await assertFunctionResource(projRoot, gen1FunctionName, gen1Region); + await assertDataResource(projRoot, gen1GraphQLAPIId, gen1Region); }); }); diff --git a/packages/amplify-migration-codegen-e2e/src/helpers.ts b/packages/amplify-migration-codegen-e2e/src/helpers.ts index e6110c8280..536e84ca27 100644 --- a/packages/amplify-migration-codegen-e2e/src/helpers.ts +++ b/packages/amplify-migration-codegen-e2e/src/helpers.ts @@ -3,7 +3,7 @@ import { deleteProjectDir, initJSProjectWithProfile, addAuthWithDefault, - amplifyPushAuth, + amplifyPush, getProjectMeta, getUserPool, npmInstall, @@ -14,16 +14,85 @@ import { addFunction, functionBuild, getFunction, + addApiWithoutSchema, + updateApiSchema, + getAppSyncApi, + amplifyPushForce, + describeCloudFormationStack, } from '@aws-amplify/amplify-e2e-core'; import * as fs from 'fs-extra'; import { $TSAny } from '@aws-amplify/amplify-cli-core'; import path from 'node:path'; -import { CloudControlClient, GetResourceCommand, ListResourcesCommand, ListResourcesCommandOutput } from '@aws-sdk/client-cloudcontrol'; +import { CloudControlClient, GetResourceCommand } from '@aws-sdk/client-cloudcontrol'; +import { AppSyncClient, GetDataSourceCommand } from '@aws-sdk/client-appsync'; import { unset } from 'lodash'; +import { createHash } from 'crypto'; +import { userInfo } from 'os'; +type AppId = string; +type ProjectName = string; +type BranchName = string; +type SandboxName = string; + +type BackendIdentifier = + | { + namespace: Readonly; + name: Readonly; + type: Readonly<'branch'>; + hash?: Readonly; + } + | { + namespace: Readonly; + name: Readonly; + type: Readonly<'sandbox'>; + hash?: Readonly; + }; + +const STACK_NAME_LENGTH_LIMIT = 128; +const AMPLIFY_PREFIX = 'amplify'; +const HASH_LENGTH = 10; +const NUM_DASHES = 4; const pushTimeoutMS = 1000 * 60 * 20; // 20 minutes; -export async function copyTsFile(sourcePath: string, destinationPath: string): Promise { +function toStackName(backendId: BackendIdentifier): string { + const hash = getHash(backendId); + + // only take the first 50 chars here to make sure there is room in the stack name for the namespace as well + const name = sanitizeChars(backendId.name).slice(0, 50); + + const namespaceMaxLength = + STACK_NAME_LENGTH_LIMIT - AMPLIFY_PREFIX.length - backendId.type.length - name.length - NUM_DASHES - HASH_LENGTH; + + const namespace = sanitizeChars(backendId.namespace).slice(0, namespaceMaxLength - 1); + + return ['amplify', namespace, name, backendId.type, hash].join('-'); +} + +const getHash = (backendId: BackendIdentifier): string => + backendId.hash ?? + // md5 would be sufficient here because this hash does not need to be cryptographically secure, but this ensures that we don't get unnecessarily flagged by some security scanner + createHash('sha512').update(backendId.namespace).update(backendId.name).digest('hex').slice(0, HASH_LENGTH); + +/** + * Remove all non-alphanumeric characters from the input string + */ +const sanitizeChars = (str: string): string => { + return str.replace(/[^A-Za-z0-9]/g, ''); +}; + +export async function copyFunctionFile(projRoot: string, gen1FunctionName: string): Promise { + const sourcePath = path.join( + projRoot, + '.amplify', + 'migration', + 'amplify', + 'backend', + 'function', + gen1FunctionName.split('-')[0], + 'src', + 'index.js', + ); + const destinationPath = path.join(projRoot, 'amplify', 'function', gen1FunctionName.split('-')[0], 'handler.ts'); const content = await fs.readFile(sourcePath, 'utf8'); // Replace the first occurrence of 'event' with 'event: any' @@ -32,17 +101,64 @@ export async function copyTsFile(sourcePath: string, destinationPath: string): P await fs.writeFile(destinationPath, modifiedContent, 'utf8'); } -async function listResourcesByType(typeName: string, region: string) { - const client = new CloudControlClient({ region }); - const resources = []; - const command = new ListResourcesCommand({ - TypeName: typeName, - }); - const response: ListResourcesCommandOutput = await client.send(command); - if (response.ResourceDescriptions) { - resources.push(...response.ResourceDescriptions.map((rd) => JSON.parse(rd.Properties ?? ''))); +export async function copyGen1Schema(projRoot: string): Promise { + const gen1SchemaPath = path.join(projRoot, '.amplify', 'migration', 'amplify', 'backend', 'api', 'codegentest', 'schema.graphql'); + const gen1Schema = await fs.readFile(gen1SchemaPath, 'utf-8'); + const dataResourcePath = path.join(projRoot, 'amplify', 'data', 'resource.ts'); + const dataResourceContent = await fs.readFile(dataResourcePath, 'utf-8'); + const backendPath = path.join(projRoot, 'amplify', 'backend.ts'); + let backendContent = await fs.readFile(backendPath, 'utf-8'); + + const schemaRegex = /"TODO: Add your existing graphql schema here"/; + const updatedContent = dataResourceContent.replace(schemaRegex, `\`${gen1Schema.trim()}\``); + + const errorRegex = /throw new Error\("TODO: Add Gen 1 GraphQL schema"\);?\s*/; + const finalContent = updatedContent.replace(errorRegex, ''); + + await fs.writeFile(dataResourcePath, finalContent, 'utf-8'); + + const linesToAdd = ` + const todoTable = backend.data.resources.cfnResources.additionalCfnResources['Todo']; + todoTable.addOverride('Properties.sseSpecification', { sseEnabled: false }); + `; + + backendContent += linesToAdd; + await fs.writeFile(backendPath, backendContent, 'utf-8'); +} + +async function setEnableGen2MigrationFeatureFlag(projectRoot: string): Promise { + const cliJsonPath = path.join(projectRoot, 'amplify', 'cli.json'); + const cliJson = await fs.readJSON(cliJsonPath); + if (!cliJson.features) { + cliJson.features = {}; + } + if (!cliJson.features.graphqltransformer) { + cliJson.features.graphqltransformer = {}; } - return resources; + cliJson.features.graphqltransformer.enablegen2migration = true; + await fs.writeJSON(cliJsonPath, cliJson, { spaces: 2 }); +} + +async function updatePackageJsonDependency(cwd: string, dependencyName: string, version: string): Promise { + const packageJsonPath = path.join(cwd, 'package.json'); + const packageJsonContent = await fs.readFile(packageJsonPath, 'utf-8'); + const packageJson = JSON.parse(packageJsonContent); + + packageJson.devDependencies = packageJson.devDependencies || {}; + packageJson.devDependencies[dependencyName] = version; + + const updatedContent = JSON.stringify(packageJson, null, 2); + await fs.writeFile(packageJsonPath, updatedContent, 'utf-8'); +} + +async function getAppSyncDataSource(apiId: string, dataSourceName: string, region: string) { + const client = new AppSyncClient({ region }); + const command = new GetDataSourceCommand({ + apiId: apiId, + name: dataSourceName, + }); + const response = await client.send(command); + return response.dataSource; } async function getResourceDetails(typeName: string, identifier: string, region: string) { @@ -55,7 +171,8 @@ async function getResourceDetails(typeName: string, identifier: string, region: return JSON.parse(response.ResourceDescription.Properties); } -export function runGen2SandboxCommand(cwd: string) { +export async function runGen2SandboxCommand(cwd: string) { + await updatePackageJsonDependency(cwd, '@aws-amplify/backend', '0.0.0-test-20241003180022'); npmInstall(cwd); return spawn(getNpxPath(), ['ampx', 'sandbox', '--once'], { cwd, @@ -88,12 +205,16 @@ function deleteGen2Sandbox(cwd: string) { } export async function setupAndPushGen1Project(projRoot: string, projectName: string) { - await initJSProjectWithProfile(projRoot, { name: projectName, disableAmplifyAppCreation: false, includeGen2RecommendationPrompt: false }); + await initJSProjectWithProfile(projRoot, { name: projectName, disableAmplifyAppCreation: false }); await addAuthWithDefault(projRoot); await addFunction(projRoot, { functionTemplate: 'Hello World' }, 'nodejs'); await functionBuild(projRoot); await addS3WithGuestAccess(projRoot); - await amplifyPushAuth(projRoot); + await addApiWithoutSchema(projRoot, { transformerVersion: 2 }); + await updateApiSchema(projRoot, projectName, 'simple_model.graphql'); + await amplifyPush(projRoot); + await setEnableGen2MigrationFeatureFlag(projRoot); + await amplifyPushForce(projRoot); } export async function assertGen1Setup(projRoot: string) { @@ -102,6 +223,12 @@ export async function assertGen1Setup(projRoot: string) { const { UserPoolId: gen1UserPoolId } = Object.keys(gen1Meta.auth).map((key) => gen1Meta.auth[key])[0].output; const { Arn: gen1FunctionArn, Name: gen1FunctionName } = Object.keys(gen1Meta.function).map((key) => gen1Meta.function[key])[0].output; const { BucketName: gen1BucketName } = Object.keys(gen1Meta.storage).map((key) => gen1Meta.storage[key])[0].output; + const { + GraphQLAPIIdOutput: gen1GraphQLAPIId, + GraphQLAPIEndpointOutput, + GraphQLAPIKeyOutput, + } = Object.keys(gen1Meta.api).map((key) => gen1Meta.api[key])[0].output; + const { graphqlApi } = await getAppSyncApi(gen1GraphQLAPIId, gen1Region); expect(gen1Region).toBeDefined(); @@ -116,7 +243,14 @@ export async function assertGen1Setup(projRoot: string) { expect(gen1BucketName).toBeDefined(); const bucketExists = await checkIfBucketExists(gen1BucketName, gen1Region); expect(bucketExists).toMatchObject({}); - return { gen1UserPoolId, gen1FunctionName, gen1BucketName, gen1Region }; + + expect(gen1GraphQLAPIId).toBeDefined(); + expect(GraphQLAPIEndpointOutput).toBeDefined(); + expect(GraphQLAPIKeyOutput).toBeDefined(); + + expect(graphqlApi).toBeDefined(); + expect(graphqlApi?.apiId).toEqual(gen1GraphQLAPIId); + return { gen1UserPoolId, gen1FunctionName, gen1BucketName, gen1GraphQLAPIId, gen1Region }; } export async function assertUserPoolResource(projRoot: string, gen1UserPoolId: string, gen1Region: string) { @@ -168,25 +302,63 @@ export async function assertStorageResource(projRoot: string, gen1BucketName: st export async function assertFunctionResource(projRoot: string, gen1FunctionName: string, gen1Region: string) { const gen1Resource = await getResourceDetails('AWS::Lambda::Function', gen1FunctionName, gen1Region); removeProperties(gen1Resource, ['Arn', 'FunctionName', 'LoggingConfig.LogGroup', 'Role']); - // TODO: remove below line after RecursiveLoop, RuntimeManagementConfig, Tags is fixed - removeProperties(gen1Resource, ['RecursiveLoop', 'RuntimeManagementConfig', 'Tags']); + // TODO: remove below line after Tags inconsistency is fixed + removeProperties(gen1Resource, ['Tags']); const gen2Meta = getProjectOutputs(projRoot); const gen2Region = gen2Meta.auth.aws_region; - - // Workaround as amplify_outputs.json file doesn't have function metadata - const gen2Resources = await listResourcesByType('AWS::Lambda::Function', gen2Region); - const gen2Resource = gen2Resources.find((resource) => { - const functionName = resource.FunctionName; - return functionName.includes('amplify-mygen2app') && functionName.includes(gen1FunctionName.split('-')[0]); - }); + const gen2StackName = toStackName({ name: userInfo().username, namespace: 'my-gen2-app', type: 'sandbox' }); + const outputs = (await describeCloudFormationStack(gen2StackName, gen2Region)).Outputs; + const gen2FunctionName = JSON.parse( + outputs?.find((output: { OutputKey: string }) => output.OutputKey === 'definedFunctions')?.OutputValue ?? '[]', + )[0]; + const gen2Resource = await getResourceDetails('AWS::Lambda::Function', gen2FunctionName, gen2Region); removeProperties(gen2Resource, ['Arn', 'FunctionName', 'LoggingConfig.LogGroup', 'Role']); - // TODO: remove below line after Environment.Variables.AMPLIFY_SSM_ENV_CONFIG inconsistency is fixed - removeProperties(gen2Resource, ['Environment.Variables.AMPLIFY_SSM_ENV_CONFIG']); + // TODO: remove below line after Environment.Variables.AMPLIFY_SSM_ENV_CONFIG, Tags inconsistency is fixed + removeProperties(gen2Resource, ['Environment.Variables.AMPLIFY_SSM_ENV_CONFIG', 'Tags']); expect(gen2Resource).toEqual(gen1Resource); } +export async function assertDataResource(projRoot: string, gen1GraphQLAPIId: string, gen1Region: string) { + const gen1Resource = await getAppSyncApi(gen1GraphQLAPIId, gen1Region); + const gen1DataSource = (await getAppSyncDataSource(gen1GraphQLAPIId, 'TodoTable', gen1Region)) as Record; + removeProperties(gen1DataSource, ['dataSourceArn', 'serviceRoleArn']); + removeProperties(gen1Resource, [ + 'graphqlApi.name', + 'graphqlApi.apiId', + 'graphqlApi.arn', + 'graphqlApi.uris', + 'graphqlApi.tags', + 'graphqlApi.dns', + ]); + // TODO: remove below line after authenticationType inconsistency is fixed + removeProperties(gen1Resource, ['graphqlApi.authenticationType']); + + const gen2Meta = getProjectOutputs(projRoot); + const gen2Region = gen2Meta.data.aws_region; + const gen2StackName = toStackName({ name: userInfo().username, namespace: 'my-gen2-app', type: 'sandbox' }); + const outputs = (await describeCloudFormationStack(gen2StackName, gen2Region)).Outputs; + const gen2GraphQLAPIId = outputs?.find((output: { OutputKey: string }) => output.OutputKey === 'awsAppsyncApiId')?.OutputValue ?? ''; + const gen2Resource = await getAppSyncApi(gen2GraphQLAPIId, gen2Region); + const gen2DataSource = (await getAppSyncDataSource(gen2GraphQLAPIId, 'TodoTable', gen1Region)) as Record; + removeProperties(gen2DataSource, ['dataSourceArn', 'serviceRoleArn']); + removeProperties(gen2Resource, [ + 'graphqlApi.name', + 'graphqlApi.apiId', + 'graphqlApi.arn', + 'graphqlApi.uris', + 'graphqlApi.tags', + 'graphqlApi.additionalAuthenticationProviders', + 'graphqlApi.dns', + ]); + // TODO: remove below line after authenticationType, userPoolConfig inconsistency is fixed + removeProperties(gen2Resource, ['graphqlApi.authenticationType', 'graphqlApi.userPoolConfig']); + + expect(gen2DataSource).toEqual(gen1DataSource); + expect(gen2Resource).toEqual(gen2Resource); +} + function removeProperties(obj: Record, propertiesToRemove: string[]) { propertiesToRemove.forEach((prop) => unset(obj, prop)); } diff --git a/yarn.lock b/yarn.lock index f31c248b3f..8266e1acb7 100644 --- a/yarn.lock +++ b/yarn.lock @@ -838,6 +838,7 @@ __metadata: "@aws-amplify/amplify-cli-core": 4.4.0-gen2-migration-test-alpha.0 "@aws-amplify/amplify-e2e-core": 5.5.11-gen2-migration-test-alpha.0 "@aws-amplify/amplify-gen2-codegen": 0.1.0-gen2-migration-test-alpha.0 + "@aws-sdk/client-appsync": ^3.666.0 "@aws-sdk/client-cloudcontrol": ^3.658.1 fs-extra: ^8.1.0 jest: ^29.5.0 @@ -2471,6 +2472,56 @@ __metadata: languageName: node linkType: hard +"@aws-sdk/client-appsync@npm:^3.666.0": + version: 3.666.0 + resolution: "@aws-sdk/client-appsync@npm:3.666.0" + dependencies: + "@aws-crypto/sha256-browser": 5.2.0 + "@aws-crypto/sha256-js": 5.2.0 + "@aws-sdk/client-sso-oidc": 3.666.0 + "@aws-sdk/client-sts": 3.666.0 + "@aws-sdk/core": 3.666.0 + "@aws-sdk/credential-provider-node": 3.666.0 + "@aws-sdk/middleware-host-header": 3.664.0 + "@aws-sdk/middleware-logger": 3.664.0 + "@aws-sdk/middleware-recursion-detection": 3.664.0 + "@aws-sdk/middleware-user-agent": 3.666.0 + "@aws-sdk/region-config-resolver": 3.664.0 + "@aws-sdk/types": 3.664.0 + "@aws-sdk/util-endpoints": 3.664.0 + "@aws-sdk/util-user-agent-browser": 3.664.0 + "@aws-sdk/util-user-agent-node": 3.666.0 + "@smithy/config-resolver": ^3.0.9 + "@smithy/core": ^2.4.8 + "@smithy/fetch-http-handler": ^3.2.9 + "@smithy/hash-node": ^3.0.7 + "@smithy/invalid-dependency": ^3.0.7 + "@smithy/middleware-content-length": ^3.0.9 + "@smithy/middleware-endpoint": ^3.1.4 + "@smithy/middleware-retry": ^3.0.23 + "@smithy/middleware-serde": ^3.0.7 + "@smithy/middleware-stack": ^3.0.7 + "@smithy/node-config-provider": ^3.1.8 + "@smithy/node-http-handler": ^3.2.4 + "@smithy/protocol-http": ^4.1.4 + "@smithy/smithy-client": ^3.4.0 + "@smithy/types": ^3.5.0 + "@smithy/url-parser": ^3.0.7 + "@smithy/util-base64": ^3.0.0 + "@smithy/util-body-length-browser": ^3.0.0 + "@smithy/util-body-length-node": ^3.0.0 + "@smithy/util-defaults-mode-browser": ^3.0.23 + "@smithy/util-defaults-mode-node": ^3.0.23 + "@smithy/util-endpoints": ^2.1.3 + "@smithy/util-middleware": ^3.0.7 + "@smithy/util-retry": ^3.0.7 + "@smithy/util-stream": ^3.1.9 + "@smithy/util-utf8": ^3.0.0 + tslib: ^2.6.2 + checksum: 7075fec77621221dd1bb552c852f8b9a5fe4eb817cbd9906a848cf3c74a45306b49a3dbfb5b617eef5e551a4ea047b4191ae76ba18c498af9660d440b5657467 + languageName: node + linkType: hard + "@aws-sdk/client-cloudcontrol@npm:^3.658.1": version: 3.658.1 resolution: "@aws-sdk/client-cloudcontrol@npm:3.658.1" @@ -3907,6 +3958,55 @@ __metadata: languageName: node linkType: hard +"@aws-sdk/client-sso-oidc@npm:3.666.0": + version: 3.666.0 + resolution: "@aws-sdk/client-sso-oidc@npm:3.666.0" + dependencies: + "@aws-crypto/sha256-browser": 5.2.0 + "@aws-crypto/sha256-js": 5.2.0 + "@aws-sdk/core": 3.666.0 + "@aws-sdk/credential-provider-node": 3.666.0 + "@aws-sdk/middleware-host-header": 3.664.0 + "@aws-sdk/middleware-logger": 3.664.0 + "@aws-sdk/middleware-recursion-detection": 3.664.0 + "@aws-sdk/middleware-user-agent": 3.666.0 + "@aws-sdk/region-config-resolver": 3.664.0 + "@aws-sdk/types": 3.664.0 + "@aws-sdk/util-endpoints": 3.664.0 + "@aws-sdk/util-user-agent-browser": 3.664.0 + "@aws-sdk/util-user-agent-node": 3.666.0 + "@smithy/config-resolver": ^3.0.9 + "@smithy/core": ^2.4.8 + "@smithy/fetch-http-handler": ^3.2.9 + "@smithy/hash-node": ^3.0.7 + "@smithy/invalid-dependency": ^3.0.7 + "@smithy/middleware-content-length": ^3.0.9 + "@smithy/middleware-endpoint": ^3.1.4 + "@smithy/middleware-retry": ^3.0.23 + "@smithy/middleware-serde": ^3.0.7 + "@smithy/middleware-stack": ^3.0.7 + "@smithy/node-config-provider": ^3.1.8 + "@smithy/node-http-handler": ^3.2.4 + "@smithy/protocol-http": ^4.1.4 + "@smithy/smithy-client": ^3.4.0 + "@smithy/types": ^3.5.0 + "@smithy/url-parser": ^3.0.7 + "@smithy/util-base64": ^3.0.0 + "@smithy/util-body-length-browser": ^3.0.0 + "@smithy/util-body-length-node": ^3.0.0 + "@smithy/util-defaults-mode-browser": ^3.0.23 + "@smithy/util-defaults-mode-node": ^3.0.23 + "@smithy/util-endpoints": ^2.1.3 + "@smithy/util-middleware": ^3.0.7 + "@smithy/util-retry": ^3.0.7 + "@smithy/util-utf8": ^3.0.0 + tslib: ^2.6.2 + peerDependencies: + "@aws-sdk/client-sts": ^3.666.0 + checksum: 60bfba9c68fad93c52765df2ad1a3b3a8c8a31659c0b6184a813d80acc3891da86f80b5ccaa85efde9bfce22a0d2d4f99daae8722f10a728dbdfa7662e6d49af + languageName: node + linkType: hard + "@aws-sdk/client-sso@npm:3.186.0": version: 3.186.0 resolution: "@aws-sdk/client-sso@npm:3.186.0" @@ -4211,6 +4311,52 @@ __metadata: languageName: node linkType: hard +"@aws-sdk/client-sso@npm:3.666.0": + version: 3.666.0 + resolution: "@aws-sdk/client-sso@npm:3.666.0" + dependencies: + "@aws-crypto/sha256-browser": 5.2.0 + "@aws-crypto/sha256-js": 5.2.0 + "@aws-sdk/core": 3.666.0 + "@aws-sdk/middleware-host-header": 3.664.0 + "@aws-sdk/middleware-logger": 3.664.0 + "@aws-sdk/middleware-recursion-detection": 3.664.0 + "@aws-sdk/middleware-user-agent": 3.666.0 + "@aws-sdk/region-config-resolver": 3.664.0 + "@aws-sdk/types": 3.664.0 + "@aws-sdk/util-endpoints": 3.664.0 + "@aws-sdk/util-user-agent-browser": 3.664.0 + "@aws-sdk/util-user-agent-node": 3.666.0 + "@smithy/config-resolver": ^3.0.9 + "@smithy/core": ^2.4.8 + "@smithy/fetch-http-handler": ^3.2.9 + "@smithy/hash-node": ^3.0.7 + "@smithy/invalid-dependency": ^3.0.7 + "@smithy/middleware-content-length": ^3.0.9 + "@smithy/middleware-endpoint": ^3.1.4 + "@smithy/middleware-retry": ^3.0.23 + "@smithy/middleware-serde": ^3.0.7 + "@smithy/middleware-stack": ^3.0.7 + "@smithy/node-config-provider": ^3.1.8 + "@smithy/node-http-handler": ^3.2.4 + "@smithy/protocol-http": ^4.1.4 + "@smithy/smithy-client": ^3.4.0 + "@smithy/types": ^3.5.0 + "@smithy/url-parser": ^3.0.7 + "@smithy/util-base64": ^3.0.0 + "@smithy/util-body-length-browser": ^3.0.0 + "@smithy/util-body-length-node": ^3.0.0 + "@smithy/util-defaults-mode-browser": ^3.0.23 + "@smithy/util-defaults-mode-node": ^3.0.23 + "@smithy/util-endpoints": ^2.1.3 + "@smithy/util-middleware": ^3.0.7 + "@smithy/util-retry": ^3.0.7 + "@smithy/util-utf8": ^3.0.0 + tslib: ^2.6.2 + checksum: 2b11bd44291901310e7c80252b1b048cf7ebcb6895f86c632d5573023ad3842247f505166d49b7b2b5869b4659126558d16bbffea230943c44afdc29605e7ba6 + languageName: node + linkType: hard + "@aws-sdk/client-sts@npm:3.186.3": version: 3.186.3 resolution: "@aws-sdk/client-sts@npm:3.186.3" @@ -4488,6 +4634,54 @@ __metadata: languageName: node linkType: hard +"@aws-sdk/client-sts@npm:3.666.0": + version: 3.666.0 + resolution: "@aws-sdk/client-sts@npm:3.666.0" + dependencies: + "@aws-crypto/sha256-browser": 5.2.0 + "@aws-crypto/sha256-js": 5.2.0 + "@aws-sdk/client-sso-oidc": 3.666.0 + "@aws-sdk/core": 3.666.0 + "@aws-sdk/credential-provider-node": 3.666.0 + "@aws-sdk/middleware-host-header": 3.664.0 + "@aws-sdk/middleware-logger": 3.664.0 + "@aws-sdk/middleware-recursion-detection": 3.664.0 + "@aws-sdk/middleware-user-agent": 3.666.0 + "@aws-sdk/region-config-resolver": 3.664.0 + "@aws-sdk/types": 3.664.0 + "@aws-sdk/util-endpoints": 3.664.0 + "@aws-sdk/util-user-agent-browser": 3.664.0 + "@aws-sdk/util-user-agent-node": 3.666.0 + "@smithy/config-resolver": ^3.0.9 + "@smithy/core": ^2.4.8 + "@smithy/fetch-http-handler": ^3.2.9 + "@smithy/hash-node": ^3.0.7 + "@smithy/invalid-dependency": ^3.0.7 + "@smithy/middleware-content-length": ^3.0.9 + "@smithy/middleware-endpoint": ^3.1.4 + "@smithy/middleware-retry": ^3.0.23 + "@smithy/middleware-serde": ^3.0.7 + "@smithy/middleware-stack": ^3.0.7 + "@smithy/node-config-provider": ^3.1.8 + "@smithy/node-http-handler": ^3.2.4 + "@smithy/protocol-http": ^4.1.4 + "@smithy/smithy-client": ^3.4.0 + "@smithy/types": ^3.5.0 + "@smithy/url-parser": ^3.0.7 + "@smithy/util-base64": ^3.0.0 + "@smithy/util-body-length-browser": ^3.0.0 + "@smithy/util-body-length-node": ^3.0.0 + "@smithy/util-defaults-mode-browser": ^3.0.23 + "@smithy/util-defaults-mode-node": ^3.0.23 + "@smithy/util-endpoints": ^2.1.3 + "@smithy/util-middleware": ^3.0.7 + "@smithy/util-retry": ^3.0.7 + "@smithy/util-utf8": ^3.0.0 + tslib: ^2.6.2 + checksum: 435186cc306b6dbe668bcb5aa67458436bece864e109d58df91fc8df0ed29aea44021d65c19662471752c4397531f8b19025d029b544762c2d7bbb5d26c9e8ee + languageName: node + linkType: hard + "@aws-sdk/client-sts@npm:^3.303.0, @aws-sdk/client-sts@npm:^3.465.0, @aws-sdk/client-sts@npm:^3.658.1": version: 3.662.0 resolution: "@aws-sdk/client-sts@npm:3.662.0" @@ -4722,6 +4916,25 @@ __metadata: languageName: node linkType: hard +"@aws-sdk/core@npm:3.666.0": + version: 3.666.0 + resolution: "@aws-sdk/core@npm:3.666.0" + dependencies: + "@aws-sdk/types": 3.664.0 + "@smithy/core": ^2.4.8 + "@smithy/node-config-provider": ^3.1.8 + "@smithy/property-provider": ^3.1.7 + "@smithy/protocol-http": ^4.1.4 + "@smithy/signature-v4": ^4.2.0 + "@smithy/smithy-client": ^3.4.0 + "@smithy/types": ^3.5.0 + "@smithy/util-middleware": ^3.0.7 + fast-xml-parser: 4.4.1 + tslib: ^2.6.2 + checksum: ac0ce560009acbf46a2b1364c3f979cdbc5aaba8fe2c5d939122738982bbe30dc2d9c2a3e516c37ecf7481ff626a6cf6f198c43ca97b83ae3e9a14ea44da3429 + languageName: node + linkType: hard + "@aws-sdk/credential-provider-cognito-identity@npm:3.382.0": version: 3.382.0 resolution: "@aws-sdk/credential-provider-cognito-identity@npm:3.382.0" @@ -4828,6 +5041,18 @@ __metadata: languageName: node linkType: hard +"@aws-sdk/credential-provider-env@npm:3.664.0": + version: 3.664.0 + resolution: "@aws-sdk/credential-provider-env@npm:3.664.0" + dependencies: + "@aws-sdk/types": 3.664.0 + "@smithy/property-provider": ^3.1.7 + "@smithy/types": ^3.5.0 + tslib: ^2.6.2 + checksum: ca30668ef79e380f9107ea03c941929ac0e791e523dd9e160ec784ec32a82b86565901ed01030005737c2e75a004842e00dbcf61fd8b58c3cc2e4496889d48ab + languageName: node + linkType: hard + "@aws-sdk/credential-provider-http@npm:3.622.0": version: 3.622.0 resolution: "@aws-sdk/credential-provider-http@npm:3.622.0" @@ -4896,6 +5121,23 @@ __metadata: languageName: node linkType: hard +"@aws-sdk/credential-provider-http@npm:3.666.0": + version: 3.666.0 + resolution: "@aws-sdk/credential-provider-http@npm:3.666.0" + dependencies: + "@aws-sdk/types": 3.664.0 + "@smithy/fetch-http-handler": ^3.2.9 + "@smithy/node-http-handler": ^3.2.4 + "@smithy/property-provider": ^3.1.7 + "@smithy/protocol-http": ^4.1.4 + "@smithy/smithy-client": ^3.4.0 + "@smithy/types": ^3.5.0 + "@smithy/util-stream": ^3.1.9 + tslib: ^2.6.2 + checksum: f6e0e677431c58618f1c5609cd043109c4e18b11b4c4d143a8afc05d78237017e3878ee7af63a3c5990e79faab007a715a55f83e2ec00405ed69b38309864fb7 + languageName: node + linkType: hard + "@aws-sdk/credential-provider-imds@npm:3.186.0": version: 3.186.0 resolution: "@aws-sdk/credential-provider-imds@npm:3.186.0" @@ -5080,6 +5322,27 @@ __metadata: languageName: node linkType: hard +"@aws-sdk/credential-provider-ini@npm:3.666.0": + version: 3.666.0 + resolution: "@aws-sdk/credential-provider-ini@npm:3.666.0" + dependencies: + "@aws-sdk/credential-provider-env": 3.664.0 + "@aws-sdk/credential-provider-http": 3.666.0 + "@aws-sdk/credential-provider-process": 3.664.0 + "@aws-sdk/credential-provider-sso": 3.666.0 + "@aws-sdk/credential-provider-web-identity": 3.664.0 + "@aws-sdk/types": 3.664.0 + "@smithy/credential-provider-imds": ^3.2.4 + "@smithy/property-provider": ^3.1.7 + "@smithy/shared-ini-file-loader": ^3.1.8 + "@smithy/types": ^3.5.0 + tslib: ^2.6.2 + peerDependencies: + "@aws-sdk/client-sts": ^3.666.0 + checksum: 2969c9be770a9557cbca5b90d44883da61ed229a3df35fc1d3ea6e634bc5d75e0882289b3fc8c20378ddf0231dd594f4bea100f15c7b4d2c94d372d68734f903 + languageName: node + linkType: hard + "@aws-sdk/credential-provider-node@npm:3.186.0": version: 3.186.0 resolution: "@aws-sdk/credential-provider-node@npm:3.186.0" @@ -5231,6 +5494,26 @@ __metadata: languageName: node linkType: hard +"@aws-sdk/credential-provider-node@npm:3.666.0": + version: 3.666.0 + resolution: "@aws-sdk/credential-provider-node@npm:3.666.0" + dependencies: + "@aws-sdk/credential-provider-env": 3.664.0 + "@aws-sdk/credential-provider-http": 3.666.0 + "@aws-sdk/credential-provider-ini": 3.666.0 + "@aws-sdk/credential-provider-process": 3.664.0 + "@aws-sdk/credential-provider-sso": 3.666.0 + "@aws-sdk/credential-provider-web-identity": 3.664.0 + "@aws-sdk/types": 3.664.0 + "@smithy/credential-provider-imds": ^3.2.4 + "@smithy/property-provider": ^3.1.7 + "@smithy/shared-ini-file-loader": ^3.1.8 + "@smithy/types": ^3.5.0 + tslib: ^2.6.2 + checksum: 08826cc33a168626e4e3adf827a27fe169e83489e2cc5bd7d75aefa1bebb9c528f90442f17829ddfd45faf06104f81aac4fd28901cd1e9cf853be7d605e7c0d0 + languageName: node + linkType: hard + "@aws-sdk/credential-provider-process@npm:3.186.0": version: 3.186.0 resolution: "@aws-sdk/credential-provider-process@npm:3.186.0" @@ -5333,6 +5616,19 @@ __metadata: languageName: node linkType: hard +"@aws-sdk/credential-provider-process@npm:3.664.0": + version: 3.664.0 + resolution: "@aws-sdk/credential-provider-process@npm:3.664.0" + dependencies: + "@aws-sdk/types": 3.664.0 + "@smithy/property-provider": ^3.1.7 + "@smithy/shared-ini-file-loader": ^3.1.8 + "@smithy/types": ^3.5.0 + tslib: ^2.6.2 + checksum: 52ef8f55bbf98d43cc36a214f0fbcde68ff06fae75b5f22fd9bcc87cead6cf687b6b64ac746b08d4ca4df2d6970d923fe0aa89c9c9f8183d8d40e1b8253144ed + languageName: node + linkType: hard + "@aws-sdk/credential-provider-sso@npm:3.186.0": version: 3.186.0 resolution: "@aws-sdk/credential-provider-sso@npm:3.186.0" @@ -5435,6 +5731,21 @@ __metadata: languageName: node linkType: hard +"@aws-sdk/credential-provider-sso@npm:3.666.0": + version: 3.666.0 + resolution: "@aws-sdk/credential-provider-sso@npm:3.666.0" + dependencies: + "@aws-sdk/client-sso": 3.666.0 + "@aws-sdk/token-providers": 3.664.0 + "@aws-sdk/types": 3.664.0 + "@smithy/property-provider": ^3.1.7 + "@smithy/shared-ini-file-loader": ^3.1.8 + "@smithy/types": ^3.5.0 + tslib: ^2.6.2 + checksum: 16333336e55a3cd00e5ec6b8d7c688581d253ad75d1bc9be74a19ff74db4e799762bce7d098bba1e050c924c0358faf07b8b9c4d0bff0be73406f399dd236e80 + languageName: node + linkType: hard + "@aws-sdk/credential-provider-web-identity@npm:3.186.0": version: 3.186.0 resolution: "@aws-sdk/credential-provider-web-identity@npm:3.186.0" @@ -5525,6 +5836,20 @@ __metadata: languageName: node linkType: hard +"@aws-sdk/credential-provider-web-identity@npm:3.664.0": + version: 3.664.0 + resolution: "@aws-sdk/credential-provider-web-identity@npm:3.664.0" + dependencies: + "@aws-sdk/types": 3.664.0 + "@smithy/property-provider": ^3.1.7 + "@smithy/types": ^3.5.0 + tslib: ^2.6.2 + peerDependencies: + "@aws-sdk/client-sts": ^3.664.0 + checksum: 4bda5192952b56114a1a5d4fc16d89353908665217970d9a90f4491e18e0f5bc49a110565958d7015a6009e1834021adb55114af138fa86bfdbeecd6eaba3376 + languageName: node + linkType: hard + "@aws-sdk/credential-providers@npm:^3.303.0": version: 3.382.0 resolution: "@aws-sdk/credential-providers@npm:3.382.0" @@ -6056,6 +6381,18 @@ __metadata: languageName: node linkType: hard +"@aws-sdk/middleware-host-header@npm:3.664.0": + version: 3.664.0 + resolution: "@aws-sdk/middleware-host-header@npm:3.664.0" + dependencies: + "@aws-sdk/types": 3.664.0 + "@smithy/protocol-http": ^4.1.4 + "@smithy/types": ^3.5.0 + tslib: ^2.6.2 + checksum: 897ebe1d3f498240016bc8c6cc1b7a4c2ae6e3cb4d706ebd28aae6602478e677976f86079b31c7f25e2dce336488c804a47b87f2773dd86db22365fa892c6ed2 + languageName: node + linkType: hard + "@aws-sdk/middleware-location-constraint@npm:3.649.0": version: 3.649.0 resolution: "@aws-sdk/middleware-location-constraint@npm:3.649.0" @@ -6152,6 +6489,17 @@ __metadata: languageName: node linkType: hard +"@aws-sdk/middleware-logger@npm:3.664.0": + version: 3.664.0 + resolution: "@aws-sdk/middleware-logger@npm:3.664.0" + dependencies: + "@aws-sdk/types": 3.664.0 + "@smithy/types": ^3.5.0 + tslib: ^2.6.2 + checksum: 85997583e1f42407291311d99191e99caad7abb5bdd8b840aeb6c94ad292cdcdfa9d73be750eea64e1ad65c6f43b155eba9bec0cb85dc260ebb4be80210d205b + languageName: node + linkType: hard + "@aws-sdk/middleware-recursion-detection@npm:3.186.0": version: 3.186.0 resolution: "@aws-sdk/middleware-recursion-detection@npm:3.186.0" @@ -6234,6 +6582,18 @@ __metadata: languageName: node linkType: hard +"@aws-sdk/middleware-recursion-detection@npm:3.664.0": + version: 3.664.0 + resolution: "@aws-sdk/middleware-recursion-detection@npm:3.664.0" + dependencies: + "@aws-sdk/types": 3.664.0 + "@smithy/protocol-http": ^4.1.4 + "@smithy/types": ^3.5.0 + tslib: ^2.6.2 + checksum: e2f297a6cd70d5f7cae927db094396ba5ea949247f98e7d3fa64e225169737241212440cf8c22ca92fc7498f369191c0153b8c6d692aa21ed3173c41276698b1 + languageName: node + linkType: hard + "@aws-sdk/middleware-retry@npm:3.186.0": version: 3.186.0 resolution: "@aws-sdk/middleware-retry@npm:3.186.0" @@ -6589,6 +6949,21 @@ __metadata: languageName: node linkType: hard +"@aws-sdk/middleware-user-agent@npm:3.666.0": + version: 3.666.0 + resolution: "@aws-sdk/middleware-user-agent@npm:3.666.0" + dependencies: + "@aws-sdk/core": 3.666.0 + "@aws-sdk/types": 3.664.0 + "@aws-sdk/util-endpoints": 3.664.0 + "@smithy/core": ^2.4.8 + "@smithy/protocol-http": ^4.1.4 + "@smithy/types": ^3.5.0 + tslib: ^2.6.2 + checksum: b67df482966c1b9527dbc7ca2f19c15adcda54cdef0fc528c3ef2e3dda6983db925dc8141ea0f528ccb23580cf5303f5dfaf3dcfc98393a5f01a66662ce22279 + languageName: node + linkType: hard + "@aws-sdk/node-config-provider@npm:3.186.0": version: 3.186.0 resolution: "@aws-sdk/node-config-provider@npm:3.186.0" @@ -6843,6 +7218,20 @@ __metadata: languageName: node linkType: hard +"@aws-sdk/region-config-resolver@npm:3.664.0": + version: 3.664.0 + resolution: "@aws-sdk/region-config-resolver@npm:3.664.0" + dependencies: + "@aws-sdk/types": 3.664.0 + "@smithy/node-config-provider": ^3.1.8 + "@smithy/types": ^3.5.0 + "@smithy/util-config-provider": ^3.0.0 + "@smithy/util-middleware": ^3.0.7 + tslib: ^2.6.2 + checksum: 1359e699a60078dd3091c424550f95497968a9b6bbb2b31ddf9d4a737fb7b1412da82eb5aec696ba5ef4bf0a774f08f0574b4363ca08f61f6034c5da2e78c890 + languageName: node + linkType: hard + "@aws-sdk/service-error-classification@npm:3.186.0": version: 3.186.0 resolution: "@aws-sdk/service-error-classification@npm:3.186.0" @@ -7069,6 +7458,21 @@ __metadata: languageName: node linkType: hard +"@aws-sdk/token-providers@npm:3.664.0": + version: 3.664.0 + resolution: "@aws-sdk/token-providers@npm:3.664.0" + dependencies: + "@aws-sdk/types": 3.664.0 + "@smithy/property-provider": ^3.1.7 + "@smithy/shared-ini-file-loader": ^3.1.8 + "@smithy/types": ^3.5.0 + tslib: ^2.6.2 + peerDependencies: + "@aws-sdk/client-sso-oidc": ^3.664.0 + checksum: 9537333e5f945b68c5d01a49f8a4f8ca5d4ae739f4080c02e2a65211a8ce3274741092ac5abe5834fe2de88ddd31818ac4ce3868c3c9db1af9ebf7cb82bc244e + languageName: node + linkType: hard + "@aws-sdk/types@npm:3.186.0": version: 3.186.0 resolution: "@aws-sdk/types@npm:3.186.0" @@ -7151,6 +7555,16 @@ __metadata: languageName: node linkType: hard +"@aws-sdk/types@npm:3.664.0": + version: 3.664.0 + resolution: "@aws-sdk/types@npm:3.664.0" + dependencies: + "@smithy/types": ^3.5.0 + tslib: ^2.6.2 + checksum: 0f56e2dfc2990ded7fe3c3344a3ae0e21f835b4a251d309def04bf122b1da2336baf66fa78d6b9c4a82166d6ccd9cadcd4186f0c7bf7423e4db973dac63f2d74 + languageName: node + linkType: hard + "@aws-sdk/url-parser-native@npm:3.6.1": version: 3.6.1 resolution: "@aws-sdk/url-parser-native@npm:3.6.1" @@ -7475,6 +7889,18 @@ __metadata: languageName: node linkType: hard +"@aws-sdk/util-endpoints@npm:3.664.0": + version: 3.664.0 + resolution: "@aws-sdk/util-endpoints@npm:3.664.0" + dependencies: + "@aws-sdk/types": 3.664.0 + "@smithy/types": ^3.5.0 + "@smithy/util-endpoints": ^2.1.3 + tslib: ^2.6.2 + checksum: 050304dcb9783cf69b232d5b1651357db491b6460ad4163cb69a282fba7f3ec0b841f96c9209eab4d55fd1cc0709b63841779362522d9ae0bf6b896dd1736ec7 + languageName: node + linkType: hard + "@aws-sdk/util-format-url@npm:3.609.0": version: 3.609.0 resolution: "@aws-sdk/util-format-url@npm:3.609.0" @@ -7671,6 +8097,18 @@ __metadata: languageName: node linkType: hard +"@aws-sdk/util-user-agent-browser@npm:3.664.0": + version: 3.664.0 + resolution: "@aws-sdk/util-user-agent-browser@npm:3.664.0" + dependencies: + "@aws-sdk/types": 3.664.0 + "@smithy/types": ^3.5.0 + bowser: ^2.11.0 + tslib: ^2.6.2 + checksum: e50f8d9728abec2b10febbaea3daaa5a8385614ac07776eb6d416023ed021bd6b735e9c85f8ebbc942ae9d8cde1638cfa2ed99d11d661d03433c46a60c0899c0 + languageName: node + linkType: hard + "@aws-sdk/util-user-agent-node@npm:3.186.0": version: 3.186.0 resolution: "@aws-sdk/util-user-agent-node@npm:3.186.0" @@ -7799,6 +8237,24 @@ __metadata: languageName: node linkType: hard +"@aws-sdk/util-user-agent-node@npm:3.666.0": + version: 3.666.0 + resolution: "@aws-sdk/util-user-agent-node@npm:3.666.0" + dependencies: + "@aws-sdk/middleware-user-agent": 3.666.0 + "@aws-sdk/types": 3.664.0 + "@smithy/node-config-provider": ^3.1.8 + "@smithy/types": ^3.5.0 + tslib: ^2.6.2 + peerDependencies: + aws-crt: ">=1.0.0" + peerDependenciesMeta: + aws-crt: + optional: true + checksum: 36e35dc316a7cefb7c0a1b71134265aa9265c66ef64e7ef96ed7695e188bfdba37b7f8770b91b7818ecb6e6d535c8d6c7501f8bd8ce06272ed31018a193645b6 + languageName: node + linkType: hard + "@aws-sdk/util-utf8-browser@npm:3.186.0, @aws-sdk/util-utf8-browser@npm:^3.0.0": version: 3.186.0 resolution: "@aws-sdk/util-utf8-browser@npm:3.186.0" @@ -11988,6 +12444,24 @@ __metadata: languageName: node linkType: hard +"@smithy/core@npm:^2.4.8": + version: 2.4.8 + resolution: "@smithy/core@npm:2.4.8" + dependencies: + "@smithy/middleware-endpoint": ^3.1.4 + "@smithy/middleware-retry": ^3.0.23 + "@smithy/middleware-serde": ^3.0.7 + "@smithy/protocol-http": ^4.1.4 + "@smithy/smithy-client": ^3.4.0 + "@smithy/types": ^3.5.0 + "@smithy/util-body-length-browser": ^3.0.0 + "@smithy/util-middleware": ^3.0.7 + "@smithy/util-utf8": ^3.0.0 + tslib: ^2.6.2 + checksum: cb2a93fa3e6bb6f6a2e269d1f392fa729d5bb9a5acf05f7bbd1ba0b270e0741b9aed4bf69b436984f9c17d0b4b5d54ff22cbc46f7e0562c19822c29a1d9f156d + languageName: node + linkType: hard + "@smithy/credential-provider-imds@npm:^2.0.0, @smithy/credential-provider-imds@npm:^2.0.1": version: 2.0.1 resolution: "@smithy/credential-provider-imds@npm:2.0.1" @@ -12285,6 +12759,23 @@ __metadata: languageName: node linkType: hard +"@smithy/middleware-retry@npm:^3.0.23": + version: 3.0.23 + resolution: "@smithy/middleware-retry@npm:3.0.23" + dependencies: + "@smithy/node-config-provider": ^3.1.8 + "@smithy/protocol-http": ^4.1.4 + "@smithy/service-error-classification": ^3.0.7 + "@smithy/smithy-client": ^3.4.0 + "@smithy/types": ^3.5.0 + "@smithy/util-middleware": ^3.0.7 + "@smithy/util-retry": ^3.0.7 + tslib: ^2.6.2 + uuid: ^9.0.1 + checksum: 80e2a6e19439ecd138a15bd5d1a61d24c4e0a4d02dc28e0783bc3eb832215f8a25845231a7d6e2ad24fb00d8ff9db78fa04bfa91aae5619e1cee9dfa3be553e5 + languageName: node + linkType: hard + "@smithy/middleware-serde@npm:^2.0.1": version: 2.0.1 resolution: "@smithy/middleware-serde@npm:2.0.1" @@ -12550,6 +13041,20 @@ __metadata: languageName: node linkType: hard +"@smithy/smithy-client@npm:^3.4.0": + version: 3.4.0 + resolution: "@smithy/smithy-client@npm:3.4.0" + dependencies: + "@smithy/middleware-endpoint": ^3.1.4 + "@smithy/middleware-stack": ^3.0.7 + "@smithy/protocol-http": ^4.1.4 + "@smithy/types": ^3.5.0 + "@smithy/util-stream": ^3.1.9 + tslib: ^2.6.2 + checksum: ed2bd1ad2e0ddc6f3eee5ec7697d2ece7b022a3528c5f20b9c2a4d1687635816500aae022ca315af14fb2045ebf2ad1bce43f97d2dc28f4185096843862bd7bb + languageName: node + linkType: hard + "@smithy/types@npm:^2.0.2": version: 2.0.2 resolution: "@smithy/types@npm:2.0.2" @@ -12710,6 +13215,19 @@ __metadata: languageName: node linkType: hard +"@smithy/util-defaults-mode-browser@npm:^3.0.23": + version: 3.0.23 + resolution: "@smithy/util-defaults-mode-browser@npm:3.0.23" + dependencies: + "@smithy/property-provider": ^3.1.7 + "@smithy/smithy-client": ^3.4.0 + "@smithy/types": ^3.5.0 + bowser: ^2.11.0 + tslib: ^2.6.2 + checksum: fec9d5d159e6db8ae9c3ac0785b571ed810bcd0e950658036ea9685c3d2cfe0e43649860785b18aec67e833a0d3354063515aa624507540f789227ea8ca626b5 + languageName: node + linkType: hard + "@smithy/util-defaults-mode-node@npm:^2.0.1": version: 2.0.1 resolution: "@smithy/util-defaults-mode-node@npm:2.0.1" @@ -12739,6 +13257,21 @@ __metadata: languageName: node linkType: hard +"@smithy/util-defaults-mode-node@npm:^3.0.23": + version: 3.0.23 + resolution: "@smithy/util-defaults-mode-node@npm:3.0.23" + dependencies: + "@smithy/config-resolver": ^3.0.9 + "@smithy/credential-provider-imds": ^3.2.4 + "@smithy/node-config-provider": ^3.1.8 + "@smithy/property-provider": ^3.1.7 + "@smithy/smithy-client": ^3.4.0 + "@smithy/types": ^3.5.0 + tslib: ^2.6.2 + checksum: 84cf4608f5aa7e619d455ff6e159a9f80bc870c48c3ab1786590e0a14df1958502a093ca8681c123900a010d8d69a4d2740c528c07aa82366629fa9f1f6e1604 + languageName: node + linkType: hard + "@smithy/util-endpoints@npm:^2.0.5, @smithy/util-endpoints@npm:^2.1.0, @smithy/util-endpoints@npm:^2.1.2, @smithy/util-endpoints@npm:^2.1.3": version: 2.1.3 resolution: "@smithy/util-endpoints@npm:2.1.3" From f8bf86088eb418ecb8affdf15e65a2b22d99d68b Mon Sep 17 00:00:00 2001 From: Sanay Yogesh Shah Date: Tue, 8 Oct 2024 02:16:16 -0700 Subject: [PATCH 3/5] fix: resolve dedupe error --- yarn.lock | 537 +----------------------------------------------------- 1 file changed, 8 insertions(+), 529 deletions(-) diff --git a/yarn.lock b/yarn.lock index 8266e1acb7..b2878efe2f 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2429,50 +2429,7 @@ __metadata: languageName: node linkType: hard -"@aws-sdk/client-appsync@npm:^3.303.0": - version: 3.319.0 - resolution: "@aws-sdk/client-appsync@npm:3.319.0" - dependencies: - "@aws-crypto/sha256-browser": 3.0.0 - "@aws-crypto/sha256-js": 3.0.0 - "@aws-sdk/client-sts": 3.319.0 - "@aws-sdk/config-resolver": 3.310.0 - "@aws-sdk/credential-provider-node": 3.319.0 - "@aws-sdk/fetch-http-handler": 3.310.0 - "@aws-sdk/hash-node": 3.310.0 - "@aws-sdk/invalid-dependency": 3.310.0 - "@aws-sdk/middleware-content-length": 3.310.0 - "@aws-sdk/middleware-endpoint": 3.310.0 - "@aws-sdk/middleware-host-header": 3.310.0 - "@aws-sdk/middleware-logger": 3.310.0 - "@aws-sdk/middleware-recursion-detection": 3.310.0 - "@aws-sdk/middleware-retry": 3.310.0 - "@aws-sdk/middleware-serde": 3.310.0 - "@aws-sdk/middleware-signing": 3.310.0 - "@aws-sdk/middleware-stack": 3.310.0 - "@aws-sdk/middleware-user-agent": 3.319.0 - "@aws-sdk/node-config-provider": 3.310.0 - "@aws-sdk/node-http-handler": 3.310.0 - "@aws-sdk/protocol-http": 3.310.0 - "@aws-sdk/smithy-client": 3.316.0 - "@aws-sdk/types": 3.310.0 - "@aws-sdk/url-parser": 3.310.0 - "@aws-sdk/util-base64": 3.310.0 - "@aws-sdk/util-body-length-browser": 3.310.0 - "@aws-sdk/util-body-length-node": 3.310.0 - "@aws-sdk/util-defaults-mode-browser": 3.316.0 - "@aws-sdk/util-defaults-mode-node": 3.316.0 - "@aws-sdk/util-endpoints": 3.319.0 - "@aws-sdk/util-retry": 3.310.0 - "@aws-sdk/util-user-agent-browser": 3.310.0 - "@aws-sdk/util-user-agent-node": 3.310.0 - "@aws-sdk/util-utf8": 3.310.0 - tslib: ^2.5.0 - checksum: ba242b7dbb214ea6150f7034334e7cc9bc3b0b6b6674e8e3e8c7b6a043b5996085a323541a206ccf1c6d1bbae071813aa91186362429fb6a9bd6718901f3a66b - languageName: node - linkType: hard - -"@aws-sdk/client-appsync@npm:^3.666.0": +"@aws-sdk/client-appsync@npm:^3.303.0, @aws-sdk/client-appsync@npm:^3.666.0": version: 3.666.0 resolution: "@aws-sdk/client-appsync@npm:3.666.0" dependencies: @@ -3909,55 +3866,6 @@ __metadata: languageName: node linkType: hard -"@aws-sdk/client-sso-oidc@npm:3.662.0": - version: 3.662.0 - resolution: "@aws-sdk/client-sso-oidc@npm:3.662.0" - dependencies: - "@aws-crypto/sha256-browser": 5.2.0 - "@aws-crypto/sha256-js": 5.2.0 - "@aws-sdk/core": 3.662.0 - "@aws-sdk/credential-provider-node": 3.662.0 - "@aws-sdk/middleware-host-header": 3.662.0 - "@aws-sdk/middleware-logger": 3.662.0 - "@aws-sdk/middleware-recursion-detection": 3.662.0 - "@aws-sdk/middleware-user-agent": 3.662.0 - "@aws-sdk/region-config-resolver": 3.662.0 - "@aws-sdk/types": 3.662.0 - "@aws-sdk/util-endpoints": 3.662.0 - "@aws-sdk/util-user-agent-browser": 3.662.0 - "@aws-sdk/util-user-agent-node": 3.662.0 - "@smithy/config-resolver": ^3.0.9 - "@smithy/core": ^2.4.7 - "@smithy/fetch-http-handler": ^3.2.9 - "@smithy/hash-node": ^3.0.7 - "@smithy/invalid-dependency": ^3.0.7 - "@smithy/middleware-content-length": ^3.0.9 - "@smithy/middleware-endpoint": ^3.1.4 - "@smithy/middleware-retry": ^3.0.22 - "@smithy/middleware-serde": ^3.0.7 - "@smithy/middleware-stack": ^3.0.7 - "@smithy/node-config-provider": ^3.1.8 - "@smithy/node-http-handler": ^3.2.4 - "@smithy/protocol-http": ^4.1.4 - "@smithy/smithy-client": ^3.3.6 - "@smithy/types": ^3.5.0 - "@smithy/url-parser": ^3.0.7 - "@smithy/util-base64": ^3.0.0 - "@smithy/util-body-length-browser": ^3.0.0 - "@smithy/util-body-length-node": ^3.0.0 - "@smithy/util-defaults-mode-browser": ^3.0.22 - "@smithy/util-defaults-mode-node": ^3.0.22 - "@smithy/util-endpoints": ^2.1.3 - "@smithy/util-middleware": ^3.0.7 - "@smithy/util-retry": ^3.0.7 - "@smithy/util-utf8": ^3.0.0 - tslib: ^2.6.2 - peerDependencies: - "@aws-sdk/client-sts": ^3.662.0 - checksum: 8da2e46cba4a308f0b0adc77fb1409126e41cbe33b4e1f5e9f041c77182b079732368ba292188021e00eacee796c3ebe1b18665a72b0a33272f43590fb10bb70 - languageName: node - linkType: hard - "@aws-sdk/client-sso-oidc@npm:3.666.0": version: 3.666.0 resolution: "@aws-sdk/client-sso-oidc@npm:3.666.0" @@ -4265,52 +4173,6 @@ __metadata: languageName: node linkType: hard -"@aws-sdk/client-sso@npm:3.662.0": - version: 3.662.0 - resolution: "@aws-sdk/client-sso@npm:3.662.0" - dependencies: - "@aws-crypto/sha256-browser": 5.2.0 - "@aws-crypto/sha256-js": 5.2.0 - "@aws-sdk/core": 3.662.0 - "@aws-sdk/middleware-host-header": 3.662.0 - "@aws-sdk/middleware-logger": 3.662.0 - "@aws-sdk/middleware-recursion-detection": 3.662.0 - "@aws-sdk/middleware-user-agent": 3.662.0 - "@aws-sdk/region-config-resolver": 3.662.0 - "@aws-sdk/types": 3.662.0 - "@aws-sdk/util-endpoints": 3.662.0 - "@aws-sdk/util-user-agent-browser": 3.662.0 - "@aws-sdk/util-user-agent-node": 3.662.0 - "@smithy/config-resolver": ^3.0.9 - "@smithy/core": ^2.4.7 - "@smithy/fetch-http-handler": ^3.2.9 - "@smithy/hash-node": ^3.0.7 - "@smithy/invalid-dependency": ^3.0.7 - "@smithy/middleware-content-length": ^3.0.9 - "@smithy/middleware-endpoint": ^3.1.4 - "@smithy/middleware-retry": ^3.0.22 - "@smithy/middleware-serde": ^3.0.7 - "@smithy/middleware-stack": ^3.0.7 - "@smithy/node-config-provider": ^3.1.8 - "@smithy/node-http-handler": ^3.2.4 - "@smithy/protocol-http": ^4.1.4 - "@smithy/smithy-client": ^3.3.6 - "@smithy/types": ^3.5.0 - "@smithy/url-parser": ^3.0.7 - "@smithy/util-base64": ^3.0.0 - "@smithy/util-body-length-browser": ^3.0.0 - "@smithy/util-body-length-node": ^3.0.0 - "@smithy/util-defaults-mode-browser": ^3.0.22 - "@smithy/util-defaults-mode-node": ^3.0.22 - "@smithy/util-endpoints": ^2.1.3 - "@smithy/util-middleware": ^3.0.7 - "@smithy/util-retry": ^3.0.7 - "@smithy/util-utf8": ^3.0.0 - tslib: ^2.6.2 - checksum: 3717b9425c74edeff722f41f4bddb2e1b44d4a020998b9e3a384a45576a0a36954b3b98d464dcb3505aa8c824c522e5fa4fd26fade24b0c10a593c0ecc8e7d7e - languageName: node - linkType: hard - "@aws-sdk/client-sso@npm:3.666.0": version: 3.666.0 resolution: "@aws-sdk/client-sso@npm:3.666.0" @@ -4634,7 +4496,7 @@ __metadata: languageName: node linkType: hard -"@aws-sdk/client-sts@npm:3.666.0": +"@aws-sdk/client-sts@npm:3.666.0, @aws-sdk/client-sts@npm:^3.303.0, @aws-sdk/client-sts@npm:^3.465.0, @aws-sdk/client-sts@npm:^3.658.1": version: 3.666.0 resolution: "@aws-sdk/client-sts@npm:3.666.0" dependencies: @@ -4682,54 +4544,6 @@ __metadata: languageName: node linkType: hard -"@aws-sdk/client-sts@npm:^3.303.0, @aws-sdk/client-sts@npm:^3.465.0, @aws-sdk/client-sts@npm:^3.658.1": - version: 3.662.0 - resolution: "@aws-sdk/client-sts@npm:3.662.0" - dependencies: - "@aws-crypto/sha256-browser": 5.2.0 - "@aws-crypto/sha256-js": 5.2.0 - "@aws-sdk/client-sso-oidc": 3.662.0 - "@aws-sdk/core": 3.662.0 - "@aws-sdk/credential-provider-node": 3.662.0 - "@aws-sdk/middleware-host-header": 3.662.0 - "@aws-sdk/middleware-logger": 3.662.0 - "@aws-sdk/middleware-recursion-detection": 3.662.0 - "@aws-sdk/middleware-user-agent": 3.662.0 - "@aws-sdk/region-config-resolver": 3.662.0 - "@aws-sdk/types": 3.662.0 - "@aws-sdk/util-endpoints": 3.662.0 - "@aws-sdk/util-user-agent-browser": 3.662.0 - "@aws-sdk/util-user-agent-node": 3.662.0 - "@smithy/config-resolver": ^3.0.9 - "@smithy/core": ^2.4.7 - "@smithy/fetch-http-handler": ^3.2.9 - "@smithy/hash-node": ^3.0.7 - "@smithy/invalid-dependency": ^3.0.7 - "@smithy/middleware-content-length": ^3.0.9 - "@smithy/middleware-endpoint": ^3.1.4 - "@smithy/middleware-retry": ^3.0.22 - "@smithy/middleware-serde": ^3.0.7 - "@smithy/middleware-stack": ^3.0.7 - "@smithy/node-config-provider": ^3.1.8 - "@smithy/node-http-handler": ^3.2.4 - "@smithy/protocol-http": ^4.1.4 - "@smithy/smithy-client": ^3.3.6 - "@smithy/types": ^3.5.0 - "@smithy/url-parser": ^3.0.7 - "@smithy/util-base64": ^3.0.0 - "@smithy/util-body-length-browser": ^3.0.0 - "@smithy/util-body-length-node": ^3.0.0 - "@smithy/util-defaults-mode-browser": ^3.0.22 - "@smithy/util-defaults-mode-node": ^3.0.22 - "@smithy/util-endpoints": ^2.1.3 - "@smithy/util-middleware": ^3.0.7 - "@smithy/util-retry": ^3.0.7 - "@smithy/util-utf8": ^3.0.0 - tslib: ^2.6.2 - checksum: 36e8a76a8d95ecc11cff35b5071ab2040978854e86013822bda5c1a78bce3a30b5fa3842a28aec850457f782d2d793445642777eb05619948dd17702a5418623 - languageName: node - linkType: hard - "@aws-sdk/client-textract@npm:3.6.1": version: 3.6.1 resolution: "@aws-sdk/client-textract@npm:3.6.1" @@ -4898,24 +4712,6 @@ __metadata: languageName: node linkType: hard -"@aws-sdk/core@npm:3.662.0": - version: 3.662.0 - resolution: "@aws-sdk/core@npm:3.662.0" - dependencies: - "@smithy/core": ^2.4.7 - "@smithy/node-config-provider": ^3.1.8 - "@smithy/property-provider": ^3.1.7 - "@smithy/protocol-http": ^4.1.4 - "@smithy/signature-v4": ^4.2.0 - "@smithy/smithy-client": ^3.3.6 - "@smithy/types": ^3.5.0 - "@smithy/util-middleware": ^3.0.7 - fast-xml-parser: 4.4.1 - tslib: ^2.6.2 - checksum: 4cbc9f0a230e26d33d92e0816ba72c2f123bcbe805bd2e5b6487e479d97566d57a7274e509da72d2d4eba6aa8a796f794ee0022225150068029a68e5457802fb - languageName: node - linkType: hard - "@aws-sdk/core@npm:3.666.0": version: 3.666.0 resolution: "@aws-sdk/core@npm:3.666.0" @@ -5029,18 +4825,6 @@ __metadata: languageName: node linkType: hard -"@aws-sdk/credential-provider-env@npm:3.662.0": - version: 3.662.0 - resolution: "@aws-sdk/credential-provider-env@npm:3.662.0" - dependencies: - "@aws-sdk/types": 3.662.0 - "@smithy/property-provider": ^3.1.7 - "@smithy/types": ^3.5.0 - tslib: ^2.6.2 - checksum: 001b340d1e04f6ae9662d3ffcd12ed79a21dea1c3f5e89ae3a7595a4d6812e8e73aab1dcd082cc1bfbf31e71dd0e3af191e4b7659bc5f6a56ba8bfa45bb3bdae - languageName: node - linkType: hard - "@aws-sdk/credential-provider-env@npm:3.664.0": version: 3.664.0 resolution: "@aws-sdk/credential-provider-env@npm:3.664.0" @@ -5104,23 +4888,6 @@ __metadata: languageName: node linkType: hard -"@aws-sdk/credential-provider-http@npm:3.662.0": - version: 3.662.0 - resolution: "@aws-sdk/credential-provider-http@npm:3.662.0" - dependencies: - "@aws-sdk/types": 3.662.0 - "@smithy/fetch-http-handler": ^3.2.9 - "@smithy/node-http-handler": ^3.2.4 - "@smithy/property-provider": ^3.1.7 - "@smithy/protocol-http": ^4.1.4 - "@smithy/smithy-client": ^3.3.6 - "@smithy/types": ^3.5.0 - "@smithy/util-stream": ^3.1.9 - tslib: ^2.6.2 - checksum: 2671078c877f7b4dd2bd36fd1f543e08c2f3ff3a4c5499036d81a735a343cb98759d3d8b9ad184b22c42676ada0b3441e6d02d2e9abb24e933b90986671507eb - languageName: node - linkType: hard - "@aws-sdk/credential-provider-http@npm:3.666.0": version: 3.666.0 resolution: "@aws-sdk/credential-provider-http@npm:3.666.0" @@ -5301,27 +5068,6 @@ __metadata: languageName: node linkType: hard -"@aws-sdk/credential-provider-ini@npm:3.662.0": - version: 3.662.0 - resolution: "@aws-sdk/credential-provider-ini@npm:3.662.0" - dependencies: - "@aws-sdk/credential-provider-env": 3.662.0 - "@aws-sdk/credential-provider-http": 3.662.0 - "@aws-sdk/credential-provider-process": 3.662.0 - "@aws-sdk/credential-provider-sso": 3.662.0 - "@aws-sdk/credential-provider-web-identity": 3.662.0 - "@aws-sdk/types": 3.662.0 - "@smithy/credential-provider-imds": ^3.2.4 - "@smithy/property-provider": ^3.1.7 - "@smithy/shared-ini-file-loader": ^3.1.8 - "@smithy/types": ^3.5.0 - tslib: ^2.6.2 - peerDependencies: - "@aws-sdk/client-sts": ^3.662.0 - checksum: 347214a343460a55bde1ea35765f57db2a226a6528ed564d297419ad1f91307f5e424e2d9202cda376bf32f12fc699742f3d43ecdae24642d8163ca880b68f9f - languageName: node - linkType: hard - "@aws-sdk/credential-provider-ini@npm:3.666.0": version: 3.666.0 resolution: "@aws-sdk/credential-provider-ini@npm:3.666.0" @@ -5474,26 +5220,6 @@ __metadata: languageName: node linkType: hard -"@aws-sdk/credential-provider-node@npm:3.662.0": - version: 3.662.0 - resolution: "@aws-sdk/credential-provider-node@npm:3.662.0" - dependencies: - "@aws-sdk/credential-provider-env": 3.662.0 - "@aws-sdk/credential-provider-http": 3.662.0 - "@aws-sdk/credential-provider-ini": 3.662.0 - "@aws-sdk/credential-provider-process": 3.662.0 - "@aws-sdk/credential-provider-sso": 3.662.0 - "@aws-sdk/credential-provider-web-identity": 3.662.0 - "@aws-sdk/types": 3.662.0 - "@smithy/credential-provider-imds": ^3.2.4 - "@smithy/property-provider": ^3.1.7 - "@smithy/shared-ini-file-loader": ^3.1.8 - "@smithy/types": ^3.5.0 - tslib: ^2.6.2 - checksum: 904842a2da5f066debb3973a6b3b4ff09959cfdba6857bd9cfff3046445c02a937ebf3bccff7d43e5cdcb84b952dce7923807d6993d0020101115e594d202391 - languageName: node - linkType: hard - "@aws-sdk/credential-provider-node@npm:3.666.0": version: 3.666.0 resolution: "@aws-sdk/credential-provider-node@npm:3.666.0" @@ -5603,19 +5329,6 @@ __metadata: languageName: node linkType: hard -"@aws-sdk/credential-provider-process@npm:3.662.0": - version: 3.662.0 - resolution: "@aws-sdk/credential-provider-process@npm:3.662.0" - dependencies: - "@aws-sdk/types": 3.662.0 - "@smithy/property-provider": ^3.1.7 - "@smithy/shared-ini-file-loader": ^3.1.8 - "@smithy/types": ^3.5.0 - tslib: ^2.6.2 - checksum: 987c8271d2dccc3a3c1a18c3232e0d7df44342eb984ef461df4ea192c7414d4fa18c9b9250e070176aecae73bcd6fb2f1137a07385f0519795c4c5be53e52d1e - languageName: node - linkType: hard - "@aws-sdk/credential-provider-process@npm:3.664.0": version: 3.664.0 resolution: "@aws-sdk/credential-provider-process@npm:3.664.0" @@ -5716,21 +5429,6 @@ __metadata: languageName: node linkType: hard -"@aws-sdk/credential-provider-sso@npm:3.662.0": - version: 3.662.0 - resolution: "@aws-sdk/credential-provider-sso@npm:3.662.0" - dependencies: - "@aws-sdk/client-sso": 3.662.0 - "@aws-sdk/token-providers": 3.662.0 - "@aws-sdk/types": 3.662.0 - "@smithy/property-provider": ^3.1.7 - "@smithy/shared-ini-file-loader": ^3.1.8 - "@smithy/types": ^3.5.0 - tslib: ^2.6.2 - checksum: f1e60f41dbf88b46c39d9c5ff8e1b171220360189e504b16b660f18334eaa42162f4cc7f43a0b2710b33457f0e84db69f46d7097dcb1c769a4cb69d4a539f3af - languageName: node - linkType: hard - "@aws-sdk/credential-provider-sso@npm:3.666.0": version: 3.666.0 resolution: "@aws-sdk/credential-provider-sso@npm:3.666.0" @@ -5822,20 +5520,6 @@ __metadata: languageName: node linkType: hard -"@aws-sdk/credential-provider-web-identity@npm:3.662.0": - version: 3.662.0 - resolution: "@aws-sdk/credential-provider-web-identity@npm:3.662.0" - dependencies: - "@aws-sdk/types": 3.662.0 - "@smithy/property-provider": ^3.1.7 - "@smithy/types": ^3.5.0 - tslib: ^2.6.2 - peerDependencies: - "@aws-sdk/client-sts": ^3.662.0 - checksum: 568cc4ff03eb71e0a1466ef76f84d4884b6cb647800766d1e27892d8f1fa4f1e154aa2680463bb74d8452aaf3db7efa49e736e86f0b55d6914d7ca6b4102bd04 - languageName: node - linkType: hard - "@aws-sdk/credential-provider-web-identity@npm:3.664.0": version: 3.664.0 resolution: "@aws-sdk/credential-provider-web-identity@npm:3.664.0" @@ -6369,18 +6053,6 @@ __metadata: languageName: node linkType: hard -"@aws-sdk/middleware-host-header@npm:3.662.0": - version: 3.662.0 - resolution: "@aws-sdk/middleware-host-header@npm:3.662.0" - dependencies: - "@aws-sdk/types": 3.662.0 - "@smithy/protocol-http": ^4.1.4 - "@smithy/types": ^3.5.0 - tslib: ^2.6.2 - checksum: 076c42bd9f95950546e930189dacdf65643a922cd2844751cce6eb66c56ce6657d525ac31dfb7fb6a8a7110693a6dd34f727c89890e88aec65c6ed80cfbdd0b7 - languageName: node - linkType: hard - "@aws-sdk/middleware-host-header@npm:3.664.0": version: 3.664.0 resolution: "@aws-sdk/middleware-host-header@npm:3.664.0" @@ -6478,17 +6150,6 @@ __metadata: languageName: node linkType: hard -"@aws-sdk/middleware-logger@npm:3.662.0": - version: 3.662.0 - resolution: "@aws-sdk/middleware-logger@npm:3.662.0" - dependencies: - "@aws-sdk/types": 3.662.0 - "@smithy/types": ^3.5.0 - tslib: ^2.6.2 - checksum: 0d15b9194285be80d5582d21dcb799f23e99613ac0cb3612b84693b26a52a62cef64fd7b0d954da43d0137f4b82e2e32eb1af8936485df0b3f1f74468bbc43b9 - languageName: node - linkType: hard - "@aws-sdk/middleware-logger@npm:3.664.0": version: 3.664.0 resolution: "@aws-sdk/middleware-logger@npm:3.664.0" @@ -6570,18 +6231,6 @@ __metadata: languageName: node linkType: hard -"@aws-sdk/middleware-recursion-detection@npm:3.662.0": - version: 3.662.0 - resolution: "@aws-sdk/middleware-recursion-detection@npm:3.662.0" - dependencies: - "@aws-sdk/types": 3.662.0 - "@smithy/protocol-http": ^4.1.4 - "@smithy/types": ^3.5.0 - tslib: ^2.6.2 - checksum: 85ad0a284b418a54eb83ca66d51406fa9ad174c01ce2919ae5e932f733d0ae897a11d13332e59abbfe1f8c4f2857b56a38b794195583bfb0b560a4432c95e7cf - languageName: node - linkType: hard - "@aws-sdk/middleware-recursion-detection@npm:3.664.0": version: 3.664.0 resolution: "@aws-sdk/middleware-recursion-detection@npm:3.664.0" @@ -6936,19 +6585,6 @@ __metadata: languageName: node linkType: hard -"@aws-sdk/middleware-user-agent@npm:3.662.0": - version: 3.662.0 - resolution: "@aws-sdk/middleware-user-agent@npm:3.662.0" - dependencies: - "@aws-sdk/types": 3.662.0 - "@aws-sdk/util-endpoints": 3.662.0 - "@smithy/protocol-http": ^4.1.4 - "@smithy/types": ^3.5.0 - tslib: ^2.6.2 - checksum: b6888ceaba4abf65d705d97778ac440ec09228dd49dbc3eb80402a51482e085b366ec71e91b6f68ea3ee563d734dcd1483f863e94fe1be1f3626ed37c55ccb0f - languageName: node - linkType: hard - "@aws-sdk/middleware-user-agent@npm:3.666.0": version: 3.666.0 resolution: "@aws-sdk/middleware-user-agent@npm:3.666.0" @@ -7204,20 +6840,6 @@ __metadata: languageName: node linkType: hard -"@aws-sdk/region-config-resolver@npm:3.662.0": - version: 3.662.0 - resolution: "@aws-sdk/region-config-resolver@npm:3.662.0" - dependencies: - "@aws-sdk/types": 3.662.0 - "@smithy/node-config-provider": ^3.1.8 - "@smithy/types": ^3.5.0 - "@smithy/util-config-provider": ^3.0.0 - "@smithy/util-middleware": ^3.0.7 - tslib: ^2.6.2 - checksum: d73eea8ce455a54f96797c9d6f53bb187094685391c9ce17900df34f38ac4aee80342b41513f664f65472ca1fde84dd6a61dec93cde4678e7300438f535c1439 - languageName: node - linkType: hard - "@aws-sdk/region-config-resolver@npm:3.664.0": version: 3.664.0 resolution: "@aws-sdk/region-config-resolver@npm:3.664.0" @@ -7443,21 +7065,6 @@ __metadata: languageName: node linkType: hard -"@aws-sdk/token-providers@npm:3.662.0": - version: 3.662.0 - resolution: "@aws-sdk/token-providers@npm:3.662.0" - dependencies: - "@aws-sdk/types": 3.662.0 - "@smithy/property-provider": ^3.1.7 - "@smithy/shared-ini-file-loader": ^3.1.8 - "@smithy/types": ^3.5.0 - tslib: ^2.6.2 - peerDependencies: - "@aws-sdk/client-sso-oidc": ^3.662.0 - checksum: 45fcff8ff38500e1310372aa1c632943acee0e8f7c6652cb6ceca03d08135c35250d5f010120b6d52bcd407400602b0edcb9763ef0de4737e62cf9f54e575275 - languageName: node - linkType: hard - "@aws-sdk/token-providers@npm:3.664.0": version: 3.664.0 resolution: "@aws-sdk/token-providers@npm:3.664.0" @@ -7545,17 +7152,7 @@ __metadata: languageName: node linkType: hard -"@aws-sdk/types@npm:3.662.0, @aws-sdk/types@npm:^3.1.0, @aws-sdk/types@npm:^3.222.0, @aws-sdk/types@npm:^3.25.0": - version: 3.662.0 - resolution: "@aws-sdk/types@npm:3.662.0" - dependencies: - "@smithy/types": ^3.5.0 - tslib: ^2.6.2 - checksum: c6df992bc3f58c6fe91228c59042a5bbeec1353eb99af4ec23e380432c7d3ed3d3d36a3fa98d2d0744bcf806645df45a2d74c0d75acee59e3125485bb45d500a - languageName: node - linkType: hard - -"@aws-sdk/types@npm:3.664.0": +"@aws-sdk/types@npm:3.664.0, @aws-sdk/types@npm:^3.1.0, @aws-sdk/types@npm:^3.222.0, @aws-sdk/types@npm:^3.25.0": version: 3.664.0 resolution: "@aws-sdk/types@npm:3.664.0" dependencies: @@ -7877,18 +7474,6 @@ __metadata: languageName: node linkType: hard -"@aws-sdk/util-endpoints@npm:3.662.0": - version: 3.662.0 - resolution: "@aws-sdk/util-endpoints@npm:3.662.0" - dependencies: - "@aws-sdk/types": 3.662.0 - "@smithy/types": ^3.5.0 - "@smithy/util-endpoints": ^2.1.3 - tslib: ^2.6.2 - checksum: d360a4a2ed44215a6ea8675eb8b6439620411a2469a7551541bf1dd056be838a7b1192c6600ba66e0b22633ee368fcd74d8b7663a5a37f1f26253c2c9d47fc77 - languageName: node - linkType: hard - "@aws-sdk/util-endpoints@npm:3.664.0": version: 3.664.0 resolution: "@aws-sdk/util-endpoints@npm:3.664.0" @@ -8085,18 +7670,6 @@ __metadata: languageName: node linkType: hard -"@aws-sdk/util-user-agent-browser@npm:3.662.0": - version: 3.662.0 - resolution: "@aws-sdk/util-user-agent-browser@npm:3.662.0" - dependencies: - "@aws-sdk/types": 3.662.0 - "@smithy/types": ^3.5.0 - bowser: ^2.11.0 - tslib: ^2.6.2 - checksum: 6de7705b174acc2d8eea8d98fa0f50886acdfe78c9de18b8a143fbdf8e539e60328457591f71ea14844b8d97e1279596dbb29e0bff7b4b87a7c5b0133d09fccf - languageName: node - linkType: hard - "@aws-sdk/util-user-agent-browser@npm:3.664.0": version: 3.664.0 resolution: "@aws-sdk/util-user-agent-browser@npm:3.664.0" @@ -8220,23 +7793,6 @@ __metadata: languageName: node linkType: hard -"@aws-sdk/util-user-agent-node@npm:3.662.0": - version: 3.662.0 - resolution: "@aws-sdk/util-user-agent-node@npm:3.662.0" - dependencies: - "@aws-sdk/types": 3.662.0 - "@smithy/node-config-provider": ^3.1.8 - "@smithy/types": ^3.5.0 - tslib: ^2.6.2 - peerDependencies: - aws-crt: ">=1.0.0" - peerDependenciesMeta: - aws-crt: - optional: true - checksum: e8de89ed58a55fbba75e60d1bd4bb41bd4a1ce06d402fdde11ba523739d1d7d5d91138ec1a7c20c790b58897c6a8468f34440c75fddf0c775590431889f0eb17 - languageName: node - linkType: hard - "@aws-sdk/util-user-agent-node@npm:3.666.0": version: 3.666.0 resolution: "@aws-sdk/util-user-agent-node@npm:3.666.0" @@ -12426,25 +11982,7 @@ __metadata: languageName: node linkType: hard -"@smithy/core@npm:^2.3.2, @smithy/core@npm:^2.4.1, @smithy/core@npm:^2.4.6, @smithy/core@npm:^2.4.7": - version: 2.4.7 - resolution: "@smithy/core@npm:2.4.7" - dependencies: - "@smithy/middleware-endpoint": ^3.1.4 - "@smithy/middleware-retry": ^3.0.22 - "@smithy/middleware-serde": ^3.0.7 - "@smithy/protocol-http": ^4.1.4 - "@smithy/smithy-client": ^3.3.6 - "@smithy/types": ^3.5.0 - "@smithy/util-body-length-browser": ^3.0.0 - "@smithy/util-middleware": ^3.0.7 - "@smithy/util-utf8": ^3.0.0 - tslib: ^2.6.2 - checksum: 0d7760bbdad7c886e90d3122cd17660048725bc9013cddfe4920e0e7e979ac35ed4cf1658065b9639d2914fcbf69c1c2cd536b08e76681271ea25c05fc5ce0f6 - languageName: node - linkType: hard - -"@smithy/core@npm:^2.4.8": +"@smithy/core@npm:^2.3.2, @smithy/core@npm:^2.4.1, @smithy/core@npm:^2.4.6, @smithy/core@npm:^2.4.8": version: 2.4.8 resolution: "@smithy/core@npm:2.4.8" dependencies: @@ -12742,24 +12280,7 @@ __metadata: languageName: node linkType: hard -"@smithy/middleware-retry@npm:^3.0.14, @smithy/middleware-retry@npm:^3.0.16, @smithy/middleware-retry@npm:^3.0.21, @smithy/middleware-retry@npm:^3.0.22": - version: 3.0.22 - resolution: "@smithy/middleware-retry@npm:3.0.22" - dependencies: - "@smithy/node-config-provider": ^3.1.8 - "@smithy/protocol-http": ^4.1.4 - "@smithy/service-error-classification": ^3.0.7 - "@smithy/smithy-client": ^3.3.6 - "@smithy/types": ^3.5.0 - "@smithy/util-middleware": ^3.0.7 - "@smithy/util-retry": ^3.0.7 - tslib: ^2.6.2 - uuid: ^9.0.1 - checksum: 62e88bf5358eb843a21e812ff191d217bb241cb0e4115c2bb55635ef2e53ba4bfe8d704e42074faf9f5627af89f25faa6fb5f8eec5a5186f79f075afd18de511 - languageName: node - linkType: hard - -"@smithy/middleware-retry@npm:^3.0.23": +"@smithy/middleware-retry@npm:^3.0.14, @smithy/middleware-retry@npm:^3.0.16, @smithy/middleware-retry@npm:^3.0.21, @smithy/middleware-retry@npm:^3.0.23": version: 3.0.23 resolution: "@smithy/middleware-retry@npm:3.0.23" dependencies: @@ -13027,21 +12548,7 @@ __metadata: languageName: node linkType: hard -"@smithy/smithy-client@npm:^3.1.12, @smithy/smithy-client@npm:^3.3.0, @smithy/smithy-client@npm:^3.3.5, @smithy/smithy-client@npm:^3.3.6": - version: 3.3.6 - resolution: "@smithy/smithy-client@npm:3.3.6" - dependencies: - "@smithy/middleware-endpoint": ^3.1.4 - "@smithy/middleware-stack": ^3.0.7 - "@smithy/protocol-http": ^4.1.4 - "@smithy/types": ^3.5.0 - "@smithy/util-stream": ^3.1.9 - tslib: ^2.6.2 - checksum: 82e07e629a93b16238071bb7a66cfba74eca85d9d7b63b60644d3feb62a9688a6b6608b152cbb3efd49b86022e0e10e56540ca2a6579859ee147f65850f6d124 - languageName: node - linkType: hard - -"@smithy/smithy-client@npm:^3.4.0": +"@smithy/smithy-client@npm:^3.1.12, @smithy/smithy-client@npm:^3.3.0, @smithy/smithy-client@npm:^3.3.5, @smithy/smithy-client@npm:^3.4.0": version: 3.4.0 resolution: "@smithy/smithy-client@npm:3.4.0" dependencies: @@ -13202,20 +12709,7 @@ __metadata: languageName: node linkType: hard -"@smithy/util-defaults-mode-browser@npm:^3.0.14, @smithy/util-defaults-mode-browser@npm:^3.0.16, @smithy/util-defaults-mode-browser@npm:^3.0.21, @smithy/util-defaults-mode-browser@npm:^3.0.22": - version: 3.0.22 - resolution: "@smithy/util-defaults-mode-browser@npm:3.0.22" - dependencies: - "@smithy/property-provider": ^3.1.7 - "@smithy/smithy-client": ^3.3.6 - "@smithy/types": ^3.5.0 - bowser: ^2.11.0 - tslib: ^2.6.2 - checksum: 8184572e333c34cfe3a4b86fa38e9b232ff8a8877dd18f650c9bfacdb45c2f65b7752bcb074a460c2e2b95f1ea95a33366c5cda8d267feb11fcdfa673d260835 - languageName: node - linkType: hard - -"@smithy/util-defaults-mode-browser@npm:^3.0.23": +"@smithy/util-defaults-mode-browser@npm:^3.0.14, @smithy/util-defaults-mode-browser@npm:^3.0.16, @smithy/util-defaults-mode-browser@npm:^3.0.21, @smithy/util-defaults-mode-browser@npm:^3.0.23": version: 3.0.23 resolution: "@smithy/util-defaults-mode-browser@npm:3.0.23" dependencies: @@ -13242,22 +12736,7 @@ __metadata: languageName: node linkType: hard -"@smithy/util-defaults-mode-node@npm:^3.0.14, @smithy/util-defaults-mode-node@npm:^3.0.16, @smithy/util-defaults-mode-node@npm:^3.0.21, @smithy/util-defaults-mode-node@npm:^3.0.22": - version: 3.0.22 - resolution: "@smithy/util-defaults-mode-node@npm:3.0.22" - dependencies: - "@smithy/config-resolver": ^3.0.9 - "@smithy/credential-provider-imds": ^3.2.4 - "@smithy/node-config-provider": ^3.1.8 - "@smithy/property-provider": ^3.1.7 - "@smithy/smithy-client": ^3.3.6 - "@smithy/types": ^3.5.0 - tslib: ^2.6.2 - checksum: fd233529c5fe10c76905b2fa41523df6dc359de35c2c093a83f7281cfd287b4016ad7435399e366b5328414f39efb0d90ac931c96cffc23c2303021b7696362e - languageName: node - linkType: hard - -"@smithy/util-defaults-mode-node@npm:^3.0.23": +"@smithy/util-defaults-mode-node@npm:^3.0.14, @smithy/util-defaults-mode-node@npm:^3.0.16, @smithy/util-defaults-mode-node@npm:^3.0.21, @smithy/util-defaults-mode-node@npm:^3.0.23": version: 3.0.23 resolution: "@smithy/util-defaults-mode-node@npm:3.0.23" dependencies: From d310c32e939e79bfc8ab2ae81be8d17123a4072f Mon Sep 17 00:00:00 2001 From: Sanay Yogesh Shah Date: Thu, 10 Oct 2024 02:50:58 -0700 Subject: [PATCH 4/5] refactor: organise file structure and modify logic to get gen2StackName --- .eslint-dictionary.json | 1 + .../__tests__/migration_codegen_e2e.test.ts | 74 +-- .../src/__tests__/render_backend.test.ts | 19 - .../src/api-utils.ts | 29 + .../src/assertions.ts | 147 +++++ .../src/function-utils.ts | 23 + .../src/helpers.ts | 377 ------------- .../src/index.ts | 99 ++++ .../src/projectOutputs.ts | 10 + .../src/sdk-calls.ts | 22 + .../src/updatePackageJson.ts | 14 + yarn.lock | 505 ++++++++++++++++-- 12 files changed, 845 insertions(+), 475 deletions(-) delete mode 100644 packages/amplify-migration-codegen-e2e/src/__tests__/render_backend.test.ts create mode 100644 packages/amplify-migration-codegen-e2e/src/api-utils.ts create mode 100644 packages/amplify-migration-codegen-e2e/src/assertions.ts create mode 100644 packages/amplify-migration-codegen-e2e/src/function-utils.ts delete mode 100644 packages/amplify-migration-codegen-e2e/src/helpers.ts create mode 100644 packages/amplify-migration-codegen-e2e/src/index.ts create mode 100644 packages/amplify-migration-codegen-e2e/src/projectOutputs.ts create mode 100644 packages/amplify-migration-codegen-e2e/src/sdk-calls.ts create mode 100644 packages/amplify-migration-codegen-e2e/src/updatePackageJson.ts diff --git a/.eslint-dictionary.json b/.eslint-dictionary.json index e662b50e81..0281e5f4f0 100644 --- a/.eslint-dictionary.json +++ b/.eslint-dictionary.json @@ -265,6 +265,7 @@ "multifactor", "multipart", "mutex", + "mygen2app", "namespace", "netcoreapp", "netmask", diff --git a/packages/amplify-migration-codegen-e2e/src/__tests__/migration_codegen_e2e.test.ts b/packages/amplify-migration-codegen-e2e/src/__tests__/migration_codegen_e2e.test.ts index 900069fcae..c82068a865 100644 --- a/packages/amplify-migration-codegen-e2e/src/__tests__/migration_codegen_e2e.test.ts +++ b/packages/amplify-migration-codegen-e2e/src/__tests__/migration_codegen_e2e.test.ts @@ -1,41 +1,51 @@ import path from 'node:path'; import assert from 'node:assert'; import { createNewProjectDir } from '@aws-amplify/amplify-e2e-core'; -import { - cleanupProjects, - setupAndPushGen1Project, - assertGen1Setup, - runCodegenCommand, - runGen2SandboxCommand, - assertUserPoolResource, - assertStorageResource, - assertFunctionResource, - assertDataResource, - copyFunctionFile, - copyGen1Schema, -} from '../helpers'; +import { createGen2Renderer } from '@aws-amplify/amplify-gen2-codegen'; +import { copyFunctionFile } from '../function-utils'; +import { copyGen1Schema } from '../api-utils'; +import { cleanupProjects, setupAndPushGen1Project, runCodegenCommand, runGen2SandboxCommand } from '..'; +import { assertGen1Setup, assertUserPoolResource, assertStorageResource, assertFunctionResource, assertDataResource } from '../assertions'; -void describe('Migration Codegen E2E tests', () => { - let projRoot: string; - beforeEach(async () => { - const baseDir = process.env.INIT_CWD ?? process.cwd(); - projRoot = await createNewProjectDir('codegen_e2e_flow_test', path.join(baseDir, '..', '..')); +void describe('Codegen E2E tests', () => { + void describe('render pipeline', () => { + void it('renders a project with no parameters', async () => { + const pipeline = createGen2Renderer({ + outputDir: path.join(process.env.INIT_CWD ?? './', 'output'), + auth: { + loginOptions: { + email: true, + }, + }, + }); + await assert.doesNotReject(pipeline.render); + }); }); + void describe('Full Migration Codegen Flow', () => { + let projRoot: string; + let projName: string; - afterEach(async () => { - await cleanupProjects(projRoot); - }); + beforeEach(async () => { + const baseDir = process.env.INIT_CWD ?? process.cwd(); + projRoot = await createNewProjectDir('codegen_e2e_flow_test', path.join(baseDir, '..', '..')); + projName = `test${Math.floor(Math.random() * 1000000)}`; + }); + + afterEach(async () => { + await cleanupProjects(projRoot); + }); - void it('performs full migration codegen flow with backend', async () => { - await setupAndPushGen1Project(projRoot, 'CodegenTest'); - const { gen1UserPoolId, gen1FunctionName, gen1BucketName, gen1GraphQLAPIId, gen1Region } = await assertGen1Setup(projRoot); - await assert.doesNotReject(runCodegenCommand(projRoot), 'Codegen failed'); - await copyFunctionFile(projRoot, gen1FunctionName); - await copyGen1Schema(projRoot); - await assert.doesNotReject(runGen2SandboxCommand(projRoot), 'Gen2 CDK deployment failed'); - await assertUserPoolResource(projRoot, gen1UserPoolId, gen1Region); - await assertStorageResource(projRoot, gen1BucketName, gen1Region); - await assertFunctionResource(projRoot, gen1FunctionName, gen1Region); - await assertDataResource(projRoot, gen1GraphQLAPIId, gen1Region); + void it('should init a project & add auth, function, storage, api with defaults & perform full migration codegen flow', async () => { + await setupAndPushGen1Project(projRoot, projName); + const { gen1UserPoolId, gen1FunctionName, gen1BucketName, gen1GraphqlApiId, gen1Region } = await assertGen1Setup(projRoot); + await assert.doesNotReject(runCodegenCommand(projRoot), 'Codegen failed'); + await copyFunctionFile(projRoot, gen1FunctionName); + await copyGen1Schema(projRoot, projName); + const gen2StackName = await runGen2SandboxCommand(projRoot); + await assertUserPoolResource(projRoot, gen1UserPoolId, gen1Region); + await assertStorageResource(projRoot, gen1BucketName, gen1Region); + await assertFunctionResource(projRoot, gen2StackName, gen1FunctionName, gen1Region); + await assertDataResource(projRoot, gen2StackName, gen1GraphqlApiId, gen1Region); + }); }); }); diff --git a/packages/amplify-migration-codegen-e2e/src/__tests__/render_backend.test.ts b/packages/amplify-migration-codegen-e2e/src/__tests__/render_backend.test.ts deleted file mode 100644 index 491bf7df84..0000000000 --- a/packages/amplify-migration-codegen-e2e/src/__tests__/render_backend.test.ts +++ /dev/null @@ -1,19 +0,0 @@ -import path from 'node:path'; -import assert from 'node:assert'; -import { createGen2Renderer } from '@aws-amplify/amplify-gen2-codegen'; - -void describe('Codegen e2e tests', () => { - void describe('render pipeline', () => { - void it('renders a project with no parameters', async () => { - const pipeline = createGen2Renderer({ - outputDir: path.join(process.env.INIT_CWD ?? './', 'output'), - auth: { - loginOptions: { - email: true, - }, - }, - }); - await assert.doesNotReject(pipeline.render); - }); - }); -}); diff --git a/packages/amplify-migration-codegen-e2e/src/api-utils.ts b/packages/amplify-migration-codegen-e2e/src/api-utils.ts new file mode 100644 index 0000000000..80fa69dd8e --- /dev/null +++ b/packages/amplify-migration-codegen-e2e/src/api-utils.ts @@ -0,0 +1,29 @@ +import { getProjectSchema } from '@aws-amplify/amplify-e2e-core'; +import * as fs from 'fs-extra'; +import path from 'node:path'; + +export function copyGen1Schema(projRoot: string, projName: string) { + const gen1Schema = getProjectSchema(path.join(projRoot, '.amplify', 'migration'), projName); + + const dataResourcePath = path.join(projRoot, 'amplify', 'data', 'resource.ts'); + const dataResourceContent = fs.readFileSync(dataResourcePath, 'utf-8'); + + const backendPath = path.join(projRoot, 'amplify', 'backend.ts'); + let backendContent = fs.readFileSync(backendPath, 'utf-8'); + + const schemaRegex = /"TODO: Add your existing graphql schema here"/; + const updatedContent = dataResourceContent.replace(schemaRegex, `\`${gen1Schema.trim()}\``); + + const errorRegex = /throw new Error\("TODO: Add Gen 1 GraphQL schema"\);?\s*/; + const finalContent = updatedContent.replace(errorRegex, ''); + + fs.writeFileSync(dataResourcePath, finalContent, 'utf-8'); + + const linesToAdd = ` + const todoTable = backend.data.resources.cfnResources.additionalCfnResources['Todo']; + todoTable.addOverride('Properties.sseSpecification', { sseEnabled: false }); + `; + + backendContent += linesToAdd; + fs.writeFileSync(backendPath, backendContent, 'utf-8'); +} diff --git a/packages/amplify-migration-codegen-e2e/src/assertions.ts b/packages/amplify-migration-codegen-e2e/src/assertions.ts new file mode 100644 index 0000000000..82d0d6a969 --- /dev/null +++ b/packages/amplify-migration-codegen-e2e/src/assertions.ts @@ -0,0 +1,147 @@ +import { + getProjectMeta, + getUserPool, + checkIfBucketExists, + getFunction, + getAppSyncApi, + describeCloudFormationStack, +} from '@aws-amplify/amplify-e2e-core'; +import { getProjectOutputs } from './projectOutputs'; +import { getAppSyncDataSource, getResourceDetails } from './sdk-calls'; +import { removeProperties } from '.'; + +export async function assertGen1Setup(projRoot: string) { + const gen1Meta = getProjectMeta(projRoot); + const gen1Region = gen1Meta.providers.awscloudformation.Region; + const { UserPoolId: gen1UserPoolId } = Object.keys(gen1Meta.auth).map((key) => gen1Meta.auth[key])[0].output; + const { Arn: gen1FunctionArn, Name: gen1FunctionName } = Object.keys(gen1Meta.function).map((key) => gen1Meta.function[key])[0].output; + const { BucketName: gen1BucketName } = Object.keys(gen1Meta.storage).map((key) => gen1Meta.storage[key])[0].output; + const { + GraphQLAPIIdOutput: gen1GraphqlApiId, + GraphQLAPIEndpointOutput, + GraphQLAPIKeyOutput, + } = Object.keys(gen1Meta.api).map((key) => gen1Meta.api[key])[0].output; + const { graphqlApi } = await getAppSyncApi(gen1GraphqlApiId, gen1Region); + + expect(gen1Region).toBeDefined(); + + const cloudUserPool = await getUserPool(gen1UserPoolId, gen1Region); + expect(cloudUserPool.UserPool).toBeDefined(); + + expect(gen1FunctionArn).toBeDefined(); + expect(gen1FunctionName).toBeDefined(); + const cloudFunction = await getFunction(gen1FunctionName, gen1Region); + expect(cloudFunction.Configuration?.FunctionArn).toEqual(gen1FunctionArn); + + expect(gen1BucketName).toBeDefined(); + const bucketExists = await checkIfBucketExists(gen1BucketName, gen1Region); + expect(bucketExists).toMatchObject({}); + + expect(gen1GraphqlApiId).toBeDefined(); + expect(GraphQLAPIEndpointOutput).toBeDefined(); + expect(GraphQLAPIKeyOutput).toBeDefined(); + + expect(graphqlApi).toBeDefined(); + expect(graphqlApi?.apiId).toEqual(gen1GraphqlApiId); + return { gen1UserPoolId, gen1FunctionName, gen1BucketName, gen1GraphqlApiId, gen1Region }; +} + +export async function assertUserPoolResource(projRoot: string, gen1UserPoolId: string, gen1Region: string) { + const gen1Resource = await getResourceDetails('AWS::Cognito::UserPool', gen1UserPoolId, gen1Region); + removeProperties(gen1Resource, ['ProviderURL', 'ProviderName', 'UserPoolId', 'Arn']); + // TODO: remove below line after EmailMessage, EmailSubject, SmsMessage, SmsVerificationMessage, EmailVerificationMessage, EmailVerificationSubject, AccountRecoverySetting inconsistency is fixed + removeProperties(gen1Resource, [ + 'UserPoolTags', + 'VerificationMessageTemplate.EmailMessage', + 'VerificationMessageTemplate.EmailSubject', + 'EmailVerificationSubject', + 'AccountRecoverySetting', + 'EmailVerificationMessage', + ]); + const gen2Meta = getProjectOutputs(projRoot); + const gen2UserPoolId = gen2Meta.auth.user_pool_id; + const gen2Region = gen2Meta.auth.aws_region; + const gen2Resource = await getResourceDetails('AWS::Cognito::UserPool', gen2UserPoolId, gen2Region); + removeProperties(gen2Resource, ['ProviderURL', 'ProviderName', 'UserPoolId', 'Arn']); + // TODO: remove below line after EmailMessage, EmailSubject, SmsMessage, SmsVerificationMessage, EmailVerificationMessage, EmailVerificationSubject, AccountRecoverySetting inconsistency is fixed + removeProperties(gen2Resource, [ + 'UserPoolTags', + 'VerificationMessageTemplate.EmailMessage', + 'VerificationMessageTemplate.SmsMessage', + 'VerificationMessageTemplate.EmailSubject', + 'SmsVerificationMessage', + 'EmailVerificationSubject', + 'AccountRecoverySetting', + 'EmailVerificationMessage', + ]); + expect(gen2Resource).toEqual(gen1Resource); +} + +export async function assertStorageResource(projRoot: string, gen1BucketName: string, gen1Region: string) { + const gen1Resource = await getResourceDetails('AWS::S3::Bucket', gen1BucketName, gen1Region); + removeProperties(gen1Resource, ['DualStackDomainName', 'DomainName', 'BucketName', 'Arn', 'RegionalDomainName', 'Tags', 'WebsiteURL']); + // TODO: remove below line after CorsConfiguration.CorsRules[0].Id inconsistency is fixed + removeProperties(gen1Resource, ['CorsConfiguration.CorsRules[0].Id']); + + const gen2Meta = getProjectOutputs(projRoot); + const gen2BucketName = gen2Meta.storage.bucket_name; + const gen2Region = gen2Meta.storage.aws_region; + const gen2Resource = await getResourceDetails('AWS::S3::Bucket', gen2BucketName, gen2Region); + removeProperties(gen2Resource, ['DualStackDomainName', 'DomainName', 'BucketName', 'Arn', 'RegionalDomainName', 'Tags', 'WebsiteURL']); + + expect(gen2Resource).toEqual(gen1Resource); +} + +export async function assertFunctionResource( + projRoot: string, + gen2StackName: string | unknown, + gen1FunctionName: string, + gen1Region: string, +) { + const gen1Resource = await getResourceDetails('AWS::Lambda::Function', gen1FunctionName, gen1Region); + removeProperties(gen1Resource, ['Arn', 'FunctionName', 'LoggingConfig.LogGroup', 'Role']); + // TODO: remove below line after Tags inconsistency is fixed + removeProperties(gen1Resource, ['Tags']); + + const gen2Meta = getProjectOutputs(projRoot); + const gen2Region = gen2Meta.auth.aws_region; + const outputs = (await describeCloudFormationStack(gen2StackName as string, gen2Region)).Outputs; + const gen2FunctionName = JSON.parse(outputs?.find((output) => output.OutputKey === 'definedFunctions')?.OutputValue ?? '[]')[0]; + const gen2Resource = await getResourceDetails('AWS::Lambda::Function', gen2FunctionName, gen2Region); + removeProperties(gen2Resource, ['Arn', 'FunctionName', 'LoggingConfig.LogGroup', 'Role']); + // TODO: remove below line after Environment.Variables.AMPLIFY_SSM_ENV_CONFIG, Tags inconsistency is fixed + removeProperties(gen2Resource, ['Environment.Variables.AMPLIFY_SSM_ENV_CONFIG', 'Tags']); + + expect(gen2Resource).toEqual(gen1Resource); +} + +export async function assertDataResource(projRoot: string, gen2StackName: string | unknown, gen1GraphqlApiId: string, gen1Region: string) { + const gen1Resource = await getAppSyncApi(gen1GraphqlApiId, gen1Region); + const gen1DataSource = (await getAppSyncDataSource(gen1GraphqlApiId, 'TodoTable', gen1Region)) as Record; + removeProperties(gen1DataSource, ['dataSourceArn', 'serviceRoleArn']); + removeProperties(gen1Resource.graphqlApi as Record, ['name', 'apiId', 'arn', 'uris', 'tags', 'dns']); + // TODO: remove below line after authenticationType inconsistency is fixed + removeProperties(gen1Resource.graphqlApi as Record, ['authenticationType']); + + const gen2Meta = getProjectOutputs(projRoot); + const gen2Region = gen2Meta.data.aws_region; + const outputs = (await describeCloudFormationStack(gen2StackName as string, gen2Region)).Outputs; + const gen2GraphqlApiId = outputs?.find((output) => output.OutputKey === 'awsAppsyncApiId')?.OutputValue ?? ''; + const gen2Resource = await getAppSyncApi(gen2GraphqlApiId, gen2Region); + const gen2DataSource = (await getAppSyncDataSource(gen2GraphqlApiId, 'TodoTable', gen1Region)) as Record; + removeProperties(gen2DataSource, ['dataSourceArn', 'serviceRoleArn']); + removeProperties(gen2Resource.graphqlApi as Record, [ + 'name', + 'apiId', + 'arn', + 'uris', + 'tags', + 'additionalAuthenticationProviders', + 'dns', + ]); + // TODO: remove below line after authenticationType, userPoolConfig inconsistency is fixed + removeProperties(gen2Resource.graphqlApi as Record, ['authenticationType', 'userPoolConfig']); + + expect(gen2DataSource).toEqual(gen1DataSource); + expect(gen2Resource).toEqual(gen2Resource); +} diff --git a/packages/amplify-migration-codegen-e2e/src/function-utils.ts b/packages/amplify-migration-codegen-e2e/src/function-utils.ts new file mode 100644 index 0000000000..7dffb9637f --- /dev/null +++ b/packages/amplify-migration-codegen-e2e/src/function-utils.ts @@ -0,0 +1,23 @@ +import path from 'node:path'; +import * as fs from 'fs-extra'; + +export function copyFunctionFile(projRoot: string, gen1FunctionName: string) { + const sourcePath = path.join( + projRoot, + '.amplify', + 'migration', + 'amplify', + 'backend', + 'function', + gen1FunctionName.split('-')[0], + 'src', + 'index.js', + ); + const destinationPath = path.join(projRoot, 'amplify', 'function', gen1FunctionName.split('-')[0], 'handler.ts'); + const content = fs.readFileSync(sourcePath, 'utf8'); + + // Replace the first occurrence of 'event' with 'event: any' + const modifiedContent = content.replace(/(exports\.handler\s*=\s*async\s*\(\s*)event(\s*\))/, '$1event: any$2'); + + fs.writeFileSync(destinationPath, modifiedContent, 'utf8'); +} diff --git a/packages/amplify-migration-codegen-e2e/src/helpers.ts b/packages/amplify-migration-codegen-e2e/src/helpers.ts deleted file mode 100644 index 536e84ca27..0000000000 --- a/packages/amplify-migration-codegen-e2e/src/helpers.ts +++ /dev/null @@ -1,377 +0,0 @@ -import { - deleteProject as deleteGen1Project, - deleteProjectDir, - initJSProjectWithProfile, - addAuthWithDefault, - amplifyPush, - getProjectMeta, - getUserPool, - npmInstall, - getNpxPath, - nspawn as spawn, - addS3WithGuestAccess, - checkIfBucketExists, - addFunction, - functionBuild, - getFunction, - addApiWithoutSchema, - updateApiSchema, - getAppSyncApi, - amplifyPushForce, - describeCloudFormationStack, -} from '@aws-amplify/amplify-e2e-core'; -import * as fs from 'fs-extra'; -import { $TSAny } from '@aws-amplify/amplify-cli-core'; -import path from 'node:path'; -import { CloudControlClient, GetResourceCommand } from '@aws-sdk/client-cloudcontrol'; -import { AppSyncClient, GetDataSourceCommand } from '@aws-sdk/client-appsync'; -import { unset } from 'lodash'; -import { createHash } from 'crypto'; -import { userInfo } from 'os'; - -type AppId = string; -type ProjectName = string; -type BranchName = string; -type SandboxName = string; - -type BackendIdentifier = - | { - namespace: Readonly; - name: Readonly; - type: Readonly<'branch'>; - hash?: Readonly; - } - | { - namespace: Readonly; - name: Readonly; - type: Readonly<'sandbox'>; - hash?: Readonly; - }; - -const STACK_NAME_LENGTH_LIMIT = 128; -const AMPLIFY_PREFIX = 'amplify'; -const HASH_LENGTH = 10; -const NUM_DASHES = 4; -const pushTimeoutMS = 1000 * 60 * 20; // 20 minutes; - -function toStackName(backendId: BackendIdentifier): string { - const hash = getHash(backendId); - - // only take the first 50 chars here to make sure there is room in the stack name for the namespace as well - const name = sanitizeChars(backendId.name).slice(0, 50); - - const namespaceMaxLength = - STACK_NAME_LENGTH_LIMIT - AMPLIFY_PREFIX.length - backendId.type.length - name.length - NUM_DASHES - HASH_LENGTH; - - const namespace = sanitizeChars(backendId.namespace).slice(0, namespaceMaxLength - 1); - - return ['amplify', namespace, name, backendId.type, hash].join('-'); -} - -const getHash = (backendId: BackendIdentifier): string => - backendId.hash ?? - // md5 would be sufficient here because this hash does not need to be cryptographically secure, but this ensures that we don't get unnecessarily flagged by some security scanner - createHash('sha512').update(backendId.namespace).update(backendId.name).digest('hex').slice(0, HASH_LENGTH); - -/** - * Remove all non-alphanumeric characters from the input string - */ -const sanitizeChars = (str: string): string => { - return str.replace(/[^A-Za-z0-9]/g, ''); -}; - -export async function copyFunctionFile(projRoot: string, gen1FunctionName: string): Promise { - const sourcePath = path.join( - projRoot, - '.amplify', - 'migration', - 'amplify', - 'backend', - 'function', - gen1FunctionName.split('-')[0], - 'src', - 'index.js', - ); - const destinationPath = path.join(projRoot, 'amplify', 'function', gen1FunctionName.split('-')[0], 'handler.ts'); - const content = await fs.readFile(sourcePath, 'utf8'); - - // Replace the first occurrence of 'event' with 'event: any' - const modifiedContent = content.replace(/(exports\.handler\s*=\s*async\s*\(\s*)event(\s*\))/, '$1event: any$2'); - - await fs.writeFile(destinationPath, modifiedContent, 'utf8'); -} - -export async function copyGen1Schema(projRoot: string): Promise { - const gen1SchemaPath = path.join(projRoot, '.amplify', 'migration', 'amplify', 'backend', 'api', 'codegentest', 'schema.graphql'); - const gen1Schema = await fs.readFile(gen1SchemaPath, 'utf-8'); - const dataResourcePath = path.join(projRoot, 'amplify', 'data', 'resource.ts'); - const dataResourceContent = await fs.readFile(dataResourcePath, 'utf-8'); - const backendPath = path.join(projRoot, 'amplify', 'backend.ts'); - let backendContent = await fs.readFile(backendPath, 'utf-8'); - - const schemaRegex = /"TODO: Add your existing graphql schema here"/; - const updatedContent = dataResourceContent.replace(schemaRegex, `\`${gen1Schema.trim()}\``); - - const errorRegex = /throw new Error\("TODO: Add Gen 1 GraphQL schema"\);?\s*/; - const finalContent = updatedContent.replace(errorRegex, ''); - - await fs.writeFile(dataResourcePath, finalContent, 'utf-8'); - - const linesToAdd = ` - const todoTable = backend.data.resources.cfnResources.additionalCfnResources['Todo']; - todoTable.addOverride('Properties.sseSpecification', { sseEnabled: false }); - `; - - backendContent += linesToAdd; - await fs.writeFile(backendPath, backendContent, 'utf-8'); -} - -async function setEnableGen2MigrationFeatureFlag(projectRoot: string): Promise { - const cliJsonPath = path.join(projectRoot, 'amplify', 'cli.json'); - const cliJson = await fs.readJSON(cliJsonPath); - if (!cliJson.features) { - cliJson.features = {}; - } - if (!cliJson.features.graphqltransformer) { - cliJson.features.graphqltransformer = {}; - } - cliJson.features.graphqltransformer.enablegen2migration = true; - await fs.writeJSON(cliJsonPath, cliJson, { spaces: 2 }); -} - -async function updatePackageJsonDependency(cwd: string, dependencyName: string, version: string): Promise { - const packageJsonPath = path.join(cwd, 'package.json'); - const packageJsonContent = await fs.readFile(packageJsonPath, 'utf-8'); - const packageJson = JSON.parse(packageJsonContent); - - packageJson.devDependencies = packageJson.devDependencies || {}; - packageJson.devDependencies[dependencyName] = version; - - const updatedContent = JSON.stringify(packageJson, null, 2); - await fs.writeFile(packageJsonPath, updatedContent, 'utf-8'); -} - -async function getAppSyncDataSource(apiId: string, dataSourceName: string, region: string) { - const client = new AppSyncClient({ region }); - const command = new GetDataSourceCommand({ - apiId: apiId, - name: dataSourceName, - }); - const response = await client.send(command); - return response.dataSource; -} - -async function getResourceDetails(typeName: string, identifier: string, region: string) { - const client = new CloudControlClient({ region }); - const command = new GetResourceCommand({ - TypeName: typeName, - Identifier: identifier, - }); - const response = await client.send(command); - return JSON.parse(response.ResourceDescription.Properties); -} - -export async function runGen2SandboxCommand(cwd: string) { - await updatePackageJsonDependency(cwd, '@aws-amplify/backend', '0.0.0-test-20241003180022'); - npmInstall(cwd); - return spawn(getNpxPath(), ['ampx', 'sandbox', '--once'], { - cwd, - stripColors: true, - noOutputTimeout: pushTimeoutMS, - env: { ...process.env, npm_config_user_agent: 'npm' }, - }).runAsync(); -} - -export function runCodegenCommand(cwd: string) { - return spawn(getNpxPath(), ['@aws-amplify/migrate', 'to-gen-2', 'generate-code'], { - cwd, - stripColors: true, - noOutputTimeout: pushTimeoutMS, - env: { ...process.env, npm_config_user_agent: 'npm' }, - }).runAsync(); -} - -function deleteGen2Sandbox(cwd: string) { - return spawn(getNpxPath(), ['ampx', 'sandbox', 'delete'], { - cwd, - stripColors: true, - noOutputTimeout: pushTimeoutMS, - env: { ...process.env, npm_config_user_agent: 'npm' }, - }) - .wait("Are you sure you want to delete all the resources in your sandbox environment (This can't be undone)?") - .sendConfirmYes() - .wait('Finished deleting.') - .runAsync(); -} - -export async function setupAndPushGen1Project(projRoot: string, projectName: string) { - await initJSProjectWithProfile(projRoot, { name: projectName, disableAmplifyAppCreation: false }); - await addAuthWithDefault(projRoot); - await addFunction(projRoot, { functionTemplate: 'Hello World' }, 'nodejs'); - await functionBuild(projRoot); - await addS3WithGuestAccess(projRoot); - await addApiWithoutSchema(projRoot, { transformerVersion: 2 }); - await updateApiSchema(projRoot, projectName, 'simple_model.graphql'); - await amplifyPush(projRoot); - await setEnableGen2MigrationFeatureFlag(projRoot); - await amplifyPushForce(projRoot); -} - -export async function assertGen1Setup(projRoot: string) { - const gen1Meta = getProjectMeta(projRoot); - const gen1Region = gen1Meta.providers.awscloudformation.Region; - const { UserPoolId: gen1UserPoolId } = Object.keys(gen1Meta.auth).map((key) => gen1Meta.auth[key])[0].output; - const { Arn: gen1FunctionArn, Name: gen1FunctionName } = Object.keys(gen1Meta.function).map((key) => gen1Meta.function[key])[0].output; - const { BucketName: gen1BucketName } = Object.keys(gen1Meta.storage).map((key) => gen1Meta.storage[key])[0].output; - const { - GraphQLAPIIdOutput: gen1GraphQLAPIId, - GraphQLAPIEndpointOutput, - GraphQLAPIKeyOutput, - } = Object.keys(gen1Meta.api).map((key) => gen1Meta.api[key])[0].output; - const { graphqlApi } = await getAppSyncApi(gen1GraphQLAPIId, gen1Region); - - expect(gen1Region).toBeDefined(); - - const cloudUserPool = await getUserPool(gen1UserPoolId, gen1Region); - expect(cloudUserPool.UserPool).toBeDefined(); - - expect(gen1FunctionArn).toBeDefined(); - expect(gen1FunctionName).toBeDefined(); - const cloudFunction = await getFunction(gen1FunctionName, gen1Region); - expect(cloudFunction.Configuration?.FunctionArn).toEqual(gen1FunctionArn); - - expect(gen1BucketName).toBeDefined(); - const bucketExists = await checkIfBucketExists(gen1BucketName, gen1Region); - expect(bucketExists).toMatchObject({}); - - expect(gen1GraphQLAPIId).toBeDefined(); - expect(GraphQLAPIEndpointOutput).toBeDefined(); - expect(GraphQLAPIKeyOutput).toBeDefined(); - - expect(graphqlApi).toBeDefined(); - expect(graphqlApi?.apiId).toEqual(gen1GraphQLAPIId); - return { gen1UserPoolId, gen1FunctionName, gen1BucketName, gen1GraphQLAPIId, gen1Region }; -} - -export async function assertUserPoolResource(projRoot: string, gen1UserPoolId: string, gen1Region: string) { - const gen1Resource = await getResourceDetails('AWS::Cognito::UserPool', gen1UserPoolId, gen1Region); - removeProperties(gen1Resource, ['ProviderURL', 'ProviderName', 'UserPoolId', 'Arn']); - // TODO: remove below line after EmailMessage, EmailSubject, SmsMessage, SmsVerificationMessage, EmailVerificationMessage, EmailVerificationSubject, AccountRecoverySetting inconsistency is fixed - removeProperties(gen1Resource, [ - 'UserPoolTags', - 'VerificationMessageTemplate.EmailMessage', - 'VerificationMessageTemplate.EmailSubject', - 'EmailVerificationSubject', - 'AccountRecoverySetting', - 'EmailVerificationMessage', - ]); - const gen2Meta = getProjectOutputs(projRoot); - const gen2UserPoolId = gen2Meta.auth.user_pool_id; - const gen2Region = gen2Meta.auth.aws_region; - const gen2Resource = await getResourceDetails('AWS::Cognito::UserPool', gen2UserPoolId, gen2Region); - removeProperties(gen2Resource, ['ProviderURL', 'ProviderName', 'UserPoolId', 'Arn']); - // TODO: remove below line after EmailMessage, EmailSubject, SmsMessage, SmsVerificationMessage, EmailVerificationMessage, EmailVerificationSubject, AccountRecoverySetting inconsistency is fixed - removeProperties(gen2Resource, [ - 'UserPoolTags', - 'VerificationMessageTemplate.EmailMessage', - 'VerificationMessageTemplate.SmsMessage', - 'VerificationMessageTemplate.EmailSubject', - 'SmsVerificationMessage', - 'EmailVerificationSubject', - 'AccountRecoverySetting', - 'EmailVerificationMessage', - ]); - expect(gen2Resource).toEqual(gen1Resource); -} - -export async function assertStorageResource(projRoot: string, gen1BucketName: string, gen1Region: string) { - const gen1Resource = await getResourceDetails('AWS::S3::Bucket', gen1BucketName, gen1Region); - removeProperties(gen1Resource, ['DualStackDomainName', 'DomainName', 'BucketName', 'Arn', 'RegionalDomainName', 'Tags', 'WebsiteURL']); - // TODO: remove below line after CorsConfiguration.CorsRules[0].Id inconsistency is fixed - removeProperties(gen1Resource, ['CorsConfiguration.CorsRules[0].Id']); - - const gen2Meta = getProjectOutputs(projRoot); - const gen2BucketName = gen2Meta.storage.bucket_name; - const gen2Region = gen2Meta.storage.aws_region; - const gen2Resource = await getResourceDetails('AWS::S3::Bucket', gen2BucketName, gen2Region); - removeProperties(gen2Resource, ['DualStackDomainName', 'DomainName', 'BucketName', 'Arn', 'RegionalDomainName', 'Tags', 'WebsiteURL']); - - expect(gen2Resource).toEqual(gen1Resource); -} - -export async function assertFunctionResource(projRoot: string, gen1FunctionName: string, gen1Region: string) { - const gen1Resource = await getResourceDetails('AWS::Lambda::Function', gen1FunctionName, gen1Region); - removeProperties(gen1Resource, ['Arn', 'FunctionName', 'LoggingConfig.LogGroup', 'Role']); - // TODO: remove below line after Tags inconsistency is fixed - removeProperties(gen1Resource, ['Tags']); - - const gen2Meta = getProjectOutputs(projRoot); - const gen2Region = gen2Meta.auth.aws_region; - const gen2StackName = toStackName({ name: userInfo().username, namespace: 'my-gen2-app', type: 'sandbox' }); - const outputs = (await describeCloudFormationStack(gen2StackName, gen2Region)).Outputs; - const gen2FunctionName = JSON.parse( - outputs?.find((output: { OutputKey: string }) => output.OutputKey === 'definedFunctions')?.OutputValue ?? '[]', - )[0]; - const gen2Resource = await getResourceDetails('AWS::Lambda::Function', gen2FunctionName, gen2Region); - removeProperties(gen2Resource, ['Arn', 'FunctionName', 'LoggingConfig.LogGroup', 'Role']); - // TODO: remove below line after Environment.Variables.AMPLIFY_SSM_ENV_CONFIG, Tags inconsistency is fixed - removeProperties(gen2Resource, ['Environment.Variables.AMPLIFY_SSM_ENV_CONFIG', 'Tags']); - - expect(gen2Resource).toEqual(gen1Resource); -} - -export async function assertDataResource(projRoot: string, gen1GraphQLAPIId: string, gen1Region: string) { - const gen1Resource = await getAppSyncApi(gen1GraphQLAPIId, gen1Region); - const gen1DataSource = (await getAppSyncDataSource(gen1GraphQLAPIId, 'TodoTable', gen1Region)) as Record; - removeProperties(gen1DataSource, ['dataSourceArn', 'serviceRoleArn']); - removeProperties(gen1Resource, [ - 'graphqlApi.name', - 'graphqlApi.apiId', - 'graphqlApi.arn', - 'graphqlApi.uris', - 'graphqlApi.tags', - 'graphqlApi.dns', - ]); - // TODO: remove below line after authenticationType inconsistency is fixed - removeProperties(gen1Resource, ['graphqlApi.authenticationType']); - - const gen2Meta = getProjectOutputs(projRoot); - const gen2Region = gen2Meta.data.aws_region; - const gen2StackName = toStackName({ name: userInfo().username, namespace: 'my-gen2-app', type: 'sandbox' }); - const outputs = (await describeCloudFormationStack(gen2StackName, gen2Region)).Outputs; - const gen2GraphQLAPIId = outputs?.find((output: { OutputKey: string }) => output.OutputKey === 'awsAppsyncApiId')?.OutputValue ?? ''; - const gen2Resource = await getAppSyncApi(gen2GraphQLAPIId, gen2Region); - const gen2DataSource = (await getAppSyncDataSource(gen2GraphQLAPIId, 'TodoTable', gen1Region)) as Record; - removeProperties(gen2DataSource, ['dataSourceArn', 'serviceRoleArn']); - removeProperties(gen2Resource, [ - 'graphqlApi.name', - 'graphqlApi.apiId', - 'graphqlApi.arn', - 'graphqlApi.uris', - 'graphqlApi.tags', - 'graphqlApi.additionalAuthenticationProviders', - 'graphqlApi.dns', - ]); - // TODO: remove below line after authenticationType, userPoolConfig inconsistency is fixed - removeProperties(gen2Resource, ['graphqlApi.authenticationType', 'graphqlApi.userPoolConfig']); - - expect(gen2DataSource).toEqual(gen1DataSource); - expect(gen2Resource).toEqual(gen2Resource); -} - -function removeProperties(obj: Record, propertiesToRemove: string[]) { - propertiesToRemove.forEach((prop) => unset(obj, prop)); -} - -const getProjectOutputsPath = (projectRoot: string) => path.join(projectRoot, 'amplify_outputs.json'); - -const getProjectOutputs = (projectRoot: string): $TSAny => { - const metaFilePath: string = getProjectOutputsPath(projectRoot); - return JSON.parse(fs.readFileSync(metaFilePath, 'utf8')); -}; - -export async function cleanupProjects(cwd: string) { - await deleteGen1Project(path.join(cwd, '.amplify', 'migration')); - await deleteGen2Sandbox(cwd); - deleteProjectDir(cwd); -} diff --git a/packages/amplify-migration-codegen-e2e/src/index.ts b/packages/amplify-migration-codegen-e2e/src/index.ts new file mode 100644 index 0000000000..6e40f2db1e --- /dev/null +++ b/packages/amplify-migration-codegen-e2e/src/index.ts @@ -0,0 +1,99 @@ +import { + deleteProject as deleteGen1Project, + deleteProjectDir, + initJSProjectWithProfile, + addAuthWithDefault, + amplifyPush, + npmInstall, + getNpxPath, + nspawn as spawn, + addS3WithGuestAccess, + addFunction, + functionBuild, + addApiWithoutSchema, + updateApiSchema, + amplifyPushForce, + addFeatureFlag, +} from '@aws-amplify/amplify-e2e-core'; +import { updatePackageDependency } from './updatePackageJson'; +import path from 'node:path'; +import { unset } from 'lodash'; + +export * from './sdk-calls'; +export * from './assertions'; +export * from './projectOutputs'; +export * from './updatePackageJson'; + +const pushTimeoutMS = 1000 * 60 * 20; // 20 minutes; + +export async function setupAndPushGen1Project(projRoot: string, projName: string) { + await initJSProjectWithProfile(projRoot, { name: projName, disableAmplifyAppCreation: false }); + await addAuthWithDefault(projRoot); + await addFunction(projRoot, { functionTemplate: 'Hello World' }, 'nodejs'); + await functionBuild(projRoot); + await addS3WithGuestAccess(projRoot); + await addApiWithoutSchema(projRoot, { transformerVersion: 2 }); + await updateApiSchema(projRoot, projName, 'simple_model.graphql'); + await amplifyPush(projRoot); + await addFeatureFlag(projRoot, 'graphqltransformer', 'enablegen2migration', true); + await amplifyPushForce(projRoot); +} + +export function runCodegenCommand(cwd: string) { + return spawn(getNpxPath(), ['@aws-amplify/migrate', 'to-gen-2', 'generate-code'], { + cwd, + stripColors: true, + noOutputTimeout: pushTimeoutMS, + env: { ...process.env, npm_config_user_agent: 'npm' }, + }).runAsync(); +} + +export async function runGen2SandboxCommand(cwd: string) { + updatePackageDependency(cwd, '@aws-amplify/backend', '0.0.0-test-20241003180022'); + npmInstall(cwd); + return new Promise((resolve, reject) => { + let stackName: string; + spawn(getNpxPath(), ['ampx', 'sandbox', '--once'], { + cwd, + stripColors: true, + noOutputTimeout: pushTimeoutMS, + env: { ...process.env, npm_config_user_agent: 'npm' }, + }) + .wait(/arn:aws:cloudformation:.*:stack\/([^/]+)\//, (data) => { + const match = data.match(/arn:aws:cloudformation:.*:stack\/([^/]+)\//); + if (match) { + stackName = match[1]; + } + }) + .run((err: Error) => { + if (!err && stackName) { + resolve(stackName); + } else { + reject(err); + } + }); + }); +} + +function deleteGen2Sandbox(cwd: string) { + return spawn(getNpxPath(), ['ampx', 'sandbox', 'delete'], { + cwd, + stripColors: true, + noOutputTimeout: pushTimeoutMS, + env: { ...process.env, npm_config_user_agent: 'npm' }, + }) + .wait("Are you sure you want to delete all the resources in your sandbox environment (This can't be undone)?") + .sendConfirmYes() + .wait('Finished deleting.') + .runAsync(); +} + +export async function cleanupProjects(cwd: string) { + await deleteGen1Project(path.join(cwd, '.amplify', 'migration')); + await deleteGen2Sandbox(cwd); + deleteProjectDir(cwd); +} + +export function removeProperties(obj: Record, propertiesToRemove: string[]) { + propertiesToRemove.forEach((prop) => unset(obj, prop)); +} diff --git a/packages/amplify-migration-codegen-e2e/src/projectOutputs.ts b/packages/amplify-migration-codegen-e2e/src/projectOutputs.ts new file mode 100644 index 0000000000..b7e1e4065e --- /dev/null +++ b/packages/amplify-migration-codegen-e2e/src/projectOutputs.ts @@ -0,0 +1,10 @@ +import path from 'node:path'; +import { $TSAny } from '@aws-amplify/amplify-cli-core'; +import { readJsonFile } from '@aws-amplify/amplify-e2e-core'; + +const getProjectOutputsPath = (projectRoot: string) => path.join(projectRoot, 'amplify_outputs.json'); + +export const getProjectOutputs = (projectRoot: string): $TSAny => { + const metaFilePath: string = getProjectOutputsPath(projectRoot); + return readJsonFile(metaFilePath); +}; diff --git a/packages/amplify-migration-codegen-e2e/src/sdk-calls.ts b/packages/amplify-migration-codegen-e2e/src/sdk-calls.ts new file mode 100644 index 0000000000..524e9260ea --- /dev/null +++ b/packages/amplify-migration-codegen-e2e/src/sdk-calls.ts @@ -0,0 +1,22 @@ +import { CloudControlClient, GetResourceCommand } from '@aws-sdk/client-cloudcontrol'; +import { AppSyncClient, GetDataSourceCommand } from '@aws-sdk/client-appsync'; + +export async function getAppSyncDataSource(apiId: string, dataSourceName: string, region: string) { + const client = new AppSyncClient({ region }); + const command = new GetDataSourceCommand({ + apiId: apiId, + name: dataSourceName, + }); + const response = await client.send(command); + return response.dataSource; +} + +export async function getResourceDetails(typeName: string, identifier: string, region: string) { + const client = new CloudControlClient({ region }); + const command = new GetResourceCommand({ + TypeName: typeName, + Identifier: identifier, + }); + const response = await client.send(command); + return JSON.parse(response.ResourceDescription.Properties); +} diff --git a/packages/amplify-migration-codegen-e2e/src/updatePackageJson.ts b/packages/amplify-migration-codegen-e2e/src/updatePackageJson.ts new file mode 100644 index 0000000000..930a9cac6c --- /dev/null +++ b/packages/amplify-migration-codegen-e2e/src/updatePackageJson.ts @@ -0,0 +1,14 @@ +import { readJsonFile } from '@aws-amplify/amplify-e2e-core'; +import * as fs from 'fs-extra'; +import path from 'node:path'; + +export function updatePackageDependency(cwd: string, dependencyName: string, version: string) { + const packageJsonPath = path.join(cwd, 'package.json'); + const packageJson = readJsonFile(packageJsonPath); + + packageJson.devDependencies = packageJson.devDependencies || {}; + packageJson.devDependencies[dependencyName] = version; + + const updatedContent = JSON.stringify(packageJson, null, 2); + fs.writeFileSync(packageJsonPath, updatedContent, 'utf-8'); +} diff --git a/yarn.lock b/yarn.lock index b2878efe2f..5091af7c79 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2531,53 +2531,53 @@ __metadata: linkType: hard "@aws-sdk/client-cloudformation@npm:^3.592.0": - version: 3.624.0 - resolution: "@aws-sdk/client-cloudformation@npm:3.624.0" + version: 3.667.0 + resolution: "@aws-sdk/client-cloudformation@npm:3.667.0" dependencies: "@aws-crypto/sha256-browser": 5.2.0 "@aws-crypto/sha256-js": 5.2.0 - "@aws-sdk/client-sso-oidc": 3.624.0 - "@aws-sdk/client-sts": 3.624.0 - "@aws-sdk/core": 3.624.0 - "@aws-sdk/credential-provider-node": 3.624.0 - "@aws-sdk/middleware-host-header": 3.620.0 - "@aws-sdk/middleware-logger": 3.609.0 - "@aws-sdk/middleware-recursion-detection": 3.620.0 - "@aws-sdk/middleware-user-agent": 3.620.0 - "@aws-sdk/region-config-resolver": 3.614.0 - "@aws-sdk/types": 3.609.0 - "@aws-sdk/util-endpoints": 3.614.0 - "@aws-sdk/util-user-agent-browser": 3.609.0 - "@aws-sdk/util-user-agent-node": 3.614.0 - "@smithy/config-resolver": ^3.0.5 - "@smithy/core": ^2.3.2 - "@smithy/fetch-http-handler": ^3.2.4 - "@smithy/hash-node": ^3.0.3 - "@smithy/invalid-dependency": ^3.0.3 - "@smithy/middleware-content-length": ^3.0.5 - "@smithy/middleware-endpoint": ^3.1.0 - "@smithy/middleware-retry": ^3.0.14 - "@smithy/middleware-serde": ^3.0.3 - "@smithy/middleware-stack": ^3.0.3 - "@smithy/node-config-provider": ^3.1.4 - "@smithy/node-http-handler": ^3.1.4 - "@smithy/protocol-http": ^4.1.0 - "@smithy/smithy-client": ^3.1.12 - "@smithy/types": ^3.3.0 - "@smithy/url-parser": ^3.0.3 + "@aws-sdk/client-sso-oidc": 3.667.0 + "@aws-sdk/client-sts": 3.667.0 + "@aws-sdk/core": 3.667.0 + "@aws-sdk/credential-provider-node": 3.667.0 + "@aws-sdk/middleware-host-header": 3.667.0 + "@aws-sdk/middleware-logger": 3.667.0 + "@aws-sdk/middleware-recursion-detection": 3.667.0 + "@aws-sdk/middleware-user-agent": 3.667.0 + "@aws-sdk/region-config-resolver": 3.667.0 + "@aws-sdk/types": 3.667.0 + "@aws-sdk/util-endpoints": 3.667.0 + "@aws-sdk/util-user-agent-browser": 3.667.0 + "@aws-sdk/util-user-agent-node": 3.667.0 + "@smithy/config-resolver": ^3.0.9 + "@smithy/core": ^2.4.8 + "@smithy/fetch-http-handler": ^3.2.9 + "@smithy/hash-node": ^3.0.7 + "@smithy/invalid-dependency": ^3.0.7 + "@smithy/middleware-content-length": ^3.0.9 + "@smithy/middleware-endpoint": ^3.1.4 + "@smithy/middleware-retry": ^3.0.23 + "@smithy/middleware-serde": ^3.0.7 + "@smithy/middleware-stack": ^3.0.7 + "@smithy/node-config-provider": ^3.1.8 + "@smithy/node-http-handler": ^3.2.4 + "@smithy/protocol-http": ^4.1.4 + "@smithy/smithy-client": ^3.4.0 + "@smithy/types": ^3.5.0 + "@smithy/url-parser": ^3.0.7 "@smithy/util-base64": ^3.0.0 "@smithy/util-body-length-browser": ^3.0.0 "@smithy/util-body-length-node": ^3.0.0 - "@smithy/util-defaults-mode-browser": ^3.0.14 - "@smithy/util-defaults-mode-node": ^3.0.14 - "@smithy/util-endpoints": ^2.0.5 - "@smithy/util-middleware": ^3.0.3 - "@smithy/util-retry": ^3.0.3 + "@smithy/util-defaults-mode-browser": ^3.0.23 + "@smithy/util-defaults-mode-node": ^3.0.23 + "@smithy/util-endpoints": ^2.1.3 + "@smithy/util-middleware": ^3.0.7 + "@smithy/util-retry": ^3.0.7 "@smithy/util-utf8": ^3.0.0 - "@smithy/util-waiter": ^3.1.2 + "@smithy/util-waiter": ^3.1.6 tslib: ^2.6.2 uuid: ^9.0.1 - checksum: 6e53724db011a863fbc3cad7390640bdeb017bc350a4775f6fe5aa4f186ded57a0609e1419e6f86efe8a9d9aebb58f7e647dc2042be5e2d68b740db63289ab37 + checksum: 6d27baeeba5a2c7a33c393b662205848c13b9083b75a03d8a56a635cd943b78af1bed26286ae96dde083674da37b5659e2387f24f0adc69857838511ca6e27b7 languageName: node linkType: hard @@ -3915,6 +3915,55 @@ __metadata: languageName: node linkType: hard +"@aws-sdk/client-sso-oidc@npm:3.667.0": + version: 3.667.0 + resolution: "@aws-sdk/client-sso-oidc@npm:3.667.0" + dependencies: + "@aws-crypto/sha256-browser": 5.2.0 + "@aws-crypto/sha256-js": 5.2.0 + "@aws-sdk/core": 3.667.0 + "@aws-sdk/credential-provider-node": 3.667.0 + "@aws-sdk/middleware-host-header": 3.667.0 + "@aws-sdk/middleware-logger": 3.667.0 + "@aws-sdk/middleware-recursion-detection": 3.667.0 + "@aws-sdk/middleware-user-agent": 3.667.0 + "@aws-sdk/region-config-resolver": 3.667.0 + "@aws-sdk/types": 3.667.0 + "@aws-sdk/util-endpoints": 3.667.0 + "@aws-sdk/util-user-agent-browser": 3.667.0 + "@aws-sdk/util-user-agent-node": 3.667.0 + "@smithy/config-resolver": ^3.0.9 + "@smithy/core": ^2.4.8 + "@smithy/fetch-http-handler": ^3.2.9 + "@smithy/hash-node": ^3.0.7 + "@smithy/invalid-dependency": ^3.0.7 + "@smithy/middleware-content-length": ^3.0.9 + "@smithy/middleware-endpoint": ^3.1.4 + "@smithy/middleware-retry": ^3.0.23 + "@smithy/middleware-serde": ^3.0.7 + "@smithy/middleware-stack": ^3.0.7 + "@smithy/node-config-provider": ^3.1.8 + "@smithy/node-http-handler": ^3.2.4 + "@smithy/protocol-http": ^4.1.4 + "@smithy/smithy-client": ^3.4.0 + "@smithy/types": ^3.5.0 + "@smithy/url-parser": ^3.0.7 + "@smithy/util-base64": ^3.0.0 + "@smithy/util-body-length-browser": ^3.0.0 + "@smithy/util-body-length-node": ^3.0.0 + "@smithy/util-defaults-mode-browser": ^3.0.23 + "@smithy/util-defaults-mode-node": ^3.0.23 + "@smithy/util-endpoints": ^2.1.3 + "@smithy/util-middleware": ^3.0.7 + "@smithy/util-retry": ^3.0.7 + "@smithy/util-utf8": ^3.0.0 + tslib: ^2.6.2 + peerDependencies: + "@aws-sdk/client-sts": ^3.667.0 + checksum: 90e543370e0a09ead84b1aa2cdd3b955484dfd8d42c466609800d4c3f9118b468ad876fe0ef7545cdd4f502904c8985da791ce581d3e41f6df10062d911c538c + languageName: node + linkType: hard + "@aws-sdk/client-sso@npm:3.186.0": version: 3.186.0 resolution: "@aws-sdk/client-sso@npm:3.186.0" @@ -4219,6 +4268,52 @@ __metadata: languageName: node linkType: hard +"@aws-sdk/client-sso@npm:3.667.0": + version: 3.667.0 + resolution: "@aws-sdk/client-sso@npm:3.667.0" + dependencies: + "@aws-crypto/sha256-browser": 5.2.0 + "@aws-crypto/sha256-js": 5.2.0 + "@aws-sdk/core": 3.667.0 + "@aws-sdk/middleware-host-header": 3.667.0 + "@aws-sdk/middleware-logger": 3.667.0 + "@aws-sdk/middleware-recursion-detection": 3.667.0 + "@aws-sdk/middleware-user-agent": 3.667.0 + "@aws-sdk/region-config-resolver": 3.667.0 + "@aws-sdk/types": 3.667.0 + "@aws-sdk/util-endpoints": 3.667.0 + "@aws-sdk/util-user-agent-browser": 3.667.0 + "@aws-sdk/util-user-agent-node": 3.667.0 + "@smithy/config-resolver": ^3.0.9 + "@smithy/core": ^2.4.8 + "@smithy/fetch-http-handler": ^3.2.9 + "@smithy/hash-node": ^3.0.7 + "@smithy/invalid-dependency": ^3.0.7 + "@smithy/middleware-content-length": ^3.0.9 + "@smithy/middleware-endpoint": ^3.1.4 + "@smithy/middleware-retry": ^3.0.23 + "@smithy/middleware-serde": ^3.0.7 + "@smithy/middleware-stack": ^3.0.7 + "@smithy/node-config-provider": ^3.1.8 + "@smithy/node-http-handler": ^3.2.4 + "@smithy/protocol-http": ^4.1.4 + "@smithy/smithy-client": ^3.4.0 + "@smithy/types": ^3.5.0 + "@smithy/url-parser": ^3.0.7 + "@smithy/util-base64": ^3.0.0 + "@smithy/util-body-length-browser": ^3.0.0 + "@smithy/util-body-length-node": ^3.0.0 + "@smithy/util-defaults-mode-browser": ^3.0.23 + "@smithy/util-defaults-mode-node": ^3.0.23 + "@smithy/util-endpoints": ^2.1.3 + "@smithy/util-middleware": ^3.0.7 + "@smithy/util-retry": ^3.0.7 + "@smithy/util-utf8": ^3.0.0 + tslib: ^2.6.2 + checksum: 762045824773e51faadbde682be309e3cc646ae8ff1aa10b6d5677c1376fe432fd55140b9810e7fd8f03a68a289d40ec32f9239ba144b825748e69b13f6ecf77 + languageName: node + linkType: hard + "@aws-sdk/client-sts@npm:3.186.3": version: 3.186.3 resolution: "@aws-sdk/client-sts@npm:3.186.3" @@ -4496,7 +4591,7 @@ __metadata: languageName: node linkType: hard -"@aws-sdk/client-sts@npm:3.666.0, @aws-sdk/client-sts@npm:^3.303.0, @aws-sdk/client-sts@npm:^3.465.0, @aws-sdk/client-sts@npm:^3.658.1": +"@aws-sdk/client-sts@npm:3.666.0": version: 3.666.0 resolution: "@aws-sdk/client-sts@npm:3.666.0" dependencies: @@ -4544,6 +4639,54 @@ __metadata: languageName: node linkType: hard +"@aws-sdk/client-sts@npm:3.667.0, @aws-sdk/client-sts@npm:^3.303.0, @aws-sdk/client-sts@npm:^3.465.0, @aws-sdk/client-sts@npm:^3.658.1": + version: 3.667.0 + resolution: "@aws-sdk/client-sts@npm:3.667.0" + dependencies: + "@aws-crypto/sha256-browser": 5.2.0 + "@aws-crypto/sha256-js": 5.2.0 + "@aws-sdk/client-sso-oidc": 3.667.0 + "@aws-sdk/core": 3.667.0 + "@aws-sdk/credential-provider-node": 3.667.0 + "@aws-sdk/middleware-host-header": 3.667.0 + "@aws-sdk/middleware-logger": 3.667.0 + "@aws-sdk/middleware-recursion-detection": 3.667.0 + "@aws-sdk/middleware-user-agent": 3.667.0 + "@aws-sdk/region-config-resolver": 3.667.0 + "@aws-sdk/types": 3.667.0 + "@aws-sdk/util-endpoints": 3.667.0 + "@aws-sdk/util-user-agent-browser": 3.667.0 + "@aws-sdk/util-user-agent-node": 3.667.0 + "@smithy/config-resolver": ^3.0.9 + "@smithy/core": ^2.4.8 + "@smithy/fetch-http-handler": ^3.2.9 + "@smithy/hash-node": ^3.0.7 + "@smithy/invalid-dependency": ^3.0.7 + "@smithy/middleware-content-length": ^3.0.9 + "@smithy/middleware-endpoint": ^3.1.4 + "@smithy/middleware-retry": ^3.0.23 + "@smithy/middleware-serde": ^3.0.7 + "@smithy/middleware-stack": ^3.0.7 + "@smithy/node-config-provider": ^3.1.8 + "@smithy/node-http-handler": ^3.2.4 + "@smithy/protocol-http": ^4.1.4 + "@smithy/smithy-client": ^3.4.0 + "@smithy/types": ^3.5.0 + "@smithy/url-parser": ^3.0.7 + "@smithy/util-base64": ^3.0.0 + "@smithy/util-body-length-browser": ^3.0.0 + "@smithy/util-body-length-node": ^3.0.0 + "@smithy/util-defaults-mode-browser": ^3.0.23 + "@smithy/util-defaults-mode-node": ^3.0.23 + "@smithy/util-endpoints": ^2.1.3 + "@smithy/util-middleware": ^3.0.7 + "@smithy/util-retry": ^3.0.7 + "@smithy/util-utf8": ^3.0.0 + tslib: ^2.6.2 + checksum: ba66862b31e69820a0aa0174a3a111985eef109f6e39b3e29e64413eabe80318ec82c7f9eb4df561aecc27aaa254d225140a59d8cea7123fcd2ff0d5c6bdd3f2 + languageName: node + linkType: hard + "@aws-sdk/client-textract@npm:3.6.1": version: 3.6.1 resolution: "@aws-sdk/client-textract@npm:3.6.1" @@ -4731,6 +4874,25 @@ __metadata: languageName: node linkType: hard +"@aws-sdk/core@npm:3.667.0": + version: 3.667.0 + resolution: "@aws-sdk/core@npm:3.667.0" + dependencies: + "@aws-sdk/types": 3.667.0 + "@smithy/core": ^2.4.8 + "@smithy/node-config-provider": ^3.1.8 + "@smithy/property-provider": ^3.1.7 + "@smithy/protocol-http": ^4.1.4 + "@smithy/signature-v4": ^4.2.0 + "@smithy/smithy-client": ^3.4.0 + "@smithy/types": ^3.5.0 + "@smithy/util-middleware": ^3.0.7 + fast-xml-parser: 4.4.1 + tslib: ^2.6.2 + checksum: 1f329f972c2ae8b39d6b727a2e70d32acc056ab287e666f192ba1ee61a2995509480c479de2b9151c49af7268d93a95999414023f8542fb2c3578262518751f7 + languageName: node + linkType: hard + "@aws-sdk/credential-provider-cognito-identity@npm:3.382.0": version: 3.382.0 resolution: "@aws-sdk/credential-provider-cognito-identity@npm:3.382.0" @@ -4837,6 +4999,19 @@ __metadata: languageName: node linkType: hard +"@aws-sdk/credential-provider-env@npm:3.667.0": + version: 3.667.0 + resolution: "@aws-sdk/credential-provider-env@npm:3.667.0" + dependencies: + "@aws-sdk/core": 3.667.0 + "@aws-sdk/types": 3.667.0 + "@smithy/property-provider": ^3.1.7 + "@smithy/types": ^3.5.0 + tslib: ^2.6.2 + checksum: 211ec650608320f55a2a5eeb8411949c037729a96e2e8ae9d40ec9d84cf63271b684051eb5e35c130ac15861fc42ab30fc79b8a4eae3bc64d1411f7fc7cfc321 + languageName: node + linkType: hard + "@aws-sdk/credential-provider-http@npm:3.622.0": version: 3.622.0 resolution: "@aws-sdk/credential-provider-http@npm:3.622.0" @@ -4905,6 +5080,24 @@ __metadata: languageName: node linkType: hard +"@aws-sdk/credential-provider-http@npm:3.667.0": + version: 3.667.0 + resolution: "@aws-sdk/credential-provider-http@npm:3.667.0" + dependencies: + "@aws-sdk/core": 3.667.0 + "@aws-sdk/types": 3.667.0 + "@smithy/fetch-http-handler": ^3.2.9 + "@smithy/node-http-handler": ^3.2.4 + "@smithy/property-provider": ^3.1.7 + "@smithy/protocol-http": ^4.1.4 + "@smithy/smithy-client": ^3.4.0 + "@smithy/types": ^3.5.0 + "@smithy/util-stream": ^3.1.9 + tslib: ^2.6.2 + checksum: 1296aacc3e82480b2c296b928810d53e24722162c7065ef3b8c70074c36dd89c5cd56bc8475b0739302bfc53966b1fce58c1b67e7bd4abed21758ce9c3ab302b + languageName: node + linkType: hard + "@aws-sdk/credential-provider-imds@npm:3.186.0": version: 3.186.0 resolution: "@aws-sdk/credential-provider-imds@npm:3.186.0" @@ -5089,6 +5282,28 @@ __metadata: languageName: node linkType: hard +"@aws-sdk/credential-provider-ini@npm:3.667.0": + version: 3.667.0 + resolution: "@aws-sdk/credential-provider-ini@npm:3.667.0" + dependencies: + "@aws-sdk/core": 3.667.0 + "@aws-sdk/credential-provider-env": 3.667.0 + "@aws-sdk/credential-provider-http": 3.667.0 + "@aws-sdk/credential-provider-process": 3.667.0 + "@aws-sdk/credential-provider-sso": 3.667.0 + "@aws-sdk/credential-provider-web-identity": 3.667.0 + "@aws-sdk/types": 3.667.0 + "@smithy/credential-provider-imds": ^3.2.4 + "@smithy/property-provider": ^3.1.7 + "@smithy/shared-ini-file-loader": ^3.1.8 + "@smithy/types": ^3.5.0 + tslib: ^2.6.2 + peerDependencies: + "@aws-sdk/client-sts": ^3.667.0 + checksum: b017277d33c0f4b85180ed4d9d39ca837da2a349a15125aca4304b8e74496862b8d35c65e8e138e931f556a7bd698ddcab33562f7adbfc072a485984d4be8927 + languageName: node + linkType: hard + "@aws-sdk/credential-provider-node@npm:3.186.0": version: 3.186.0 resolution: "@aws-sdk/credential-provider-node@npm:3.186.0" @@ -5240,6 +5455,26 @@ __metadata: languageName: node linkType: hard +"@aws-sdk/credential-provider-node@npm:3.667.0": + version: 3.667.0 + resolution: "@aws-sdk/credential-provider-node@npm:3.667.0" + dependencies: + "@aws-sdk/credential-provider-env": 3.667.0 + "@aws-sdk/credential-provider-http": 3.667.0 + "@aws-sdk/credential-provider-ini": 3.667.0 + "@aws-sdk/credential-provider-process": 3.667.0 + "@aws-sdk/credential-provider-sso": 3.667.0 + "@aws-sdk/credential-provider-web-identity": 3.667.0 + "@aws-sdk/types": 3.667.0 + "@smithy/credential-provider-imds": ^3.2.4 + "@smithy/property-provider": ^3.1.7 + "@smithy/shared-ini-file-loader": ^3.1.8 + "@smithy/types": ^3.5.0 + tslib: ^2.6.2 + checksum: c320451b29fcf6366a5ab3d39aa0ae2a5fcb4cf20afa4d83c55b8103090f639cd6f762e5f73ca2dfc67ff54307a0e6bab2aeda97e49fc8fa113a4006ed32f16b + languageName: node + linkType: hard + "@aws-sdk/credential-provider-process@npm:3.186.0": version: 3.186.0 resolution: "@aws-sdk/credential-provider-process@npm:3.186.0" @@ -5342,6 +5577,20 @@ __metadata: languageName: node linkType: hard +"@aws-sdk/credential-provider-process@npm:3.667.0": + version: 3.667.0 + resolution: "@aws-sdk/credential-provider-process@npm:3.667.0" + dependencies: + "@aws-sdk/core": 3.667.0 + "@aws-sdk/types": 3.667.0 + "@smithy/property-provider": ^3.1.7 + "@smithy/shared-ini-file-loader": ^3.1.8 + "@smithy/types": ^3.5.0 + tslib: ^2.6.2 + checksum: f6bc550ba17ebfc9922be7dffafe900357530eece1bf93d6b710f4c4b04d63aebeba734384225945387a97a134acaf5dde48005daa85e5b9ea4b0bdf59c39698 + languageName: node + linkType: hard + "@aws-sdk/credential-provider-sso@npm:3.186.0": version: 3.186.0 resolution: "@aws-sdk/credential-provider-sso@npm:3.186.0" @@ -5444,6 +5693,22 @@ __metadata: languageName: node linkType: hard +"@aws-sdk/credential-provider-sso@npm:3.667.0": + version: 3.667.0 + resolution: "@aws-sdk/credential-provider-sso@npm:3.667.0" + dependencies: + "@aws-sdk/client-sso": 3.667.0 + "@aws-sdk/core": 3.667.0 + "@aws-sdk/token-providers": 3.667.0 + "@aws-sdk/types": 3.667.0 + "@smithy/property-provider": ^3.1.7 + "@smithy/shared-ini-file-loader": ^3.1.8 + "@smithy/types": ^3.5.0 + tslib: ^2.6.2 + checksum: 44a70cae693b22a351e8677b4f4f57714f3d5fdfdd4684a01896da505ae7cffda039fa0b2a5a1496d3ffcb755389b2863de0f2d6055e789133dd185859beb974 + languageName: node + linkType: hard + "@aws-sdk/credential-provider-web-identity@npm:3.186.0": version: 3.186.0 resolution: "@aws-sdk/credential-provider-web-identity@npm:3.186.0" @@ -5534,6 +5799,21 @@ __metadata: languageName: node linkType: hard +"@aws-sdk/credential-provider-web-identity@npm:3.667.0": + version: 3.667.0 + resolution: "@aws-sdk/credential-provider-web-identity@npm:3.667.0" + dependencies: + "@aws-sdk/core": 3.667.0 + "@aws-sdk/types": 3.667.0 + "@smithy/property-provider": ^3.1.7 + "@smithy/types": ^3.5.0 + tslib: ^2.6.2 + peerDependencies: + "@aws-sdk/client-sts": ^3.667.0 + checksum: d3a2021559e7a087fc1b524d21afaa5088d005bfbb9426005320b2ad16aff99d0a40b358f5629e412b041eef247b8afc0e2b486f5dc1e1d4f62209555b3cfdc4 + languageName: node + linkType: hard + "@aws-sdk/credential-providers@npm:^3.303.0": version: 3.382.0 resolution: "@aws-sdk/credential-providers@npm:3.382.0" @@ -6065,6 +6345,18 @@ __metadata: languageName: node linkType: hard +"@aws-sdk/middleware-host-header@npm:3.667.0": + version: 3.667.0 + resolution: "@aws-sdk/middleware-host-header@npm:3.667.0" + dependencies: + "@aws-sdk/types": 3.667.0 + "@smithy/protocol-http": ^4.1.4 + "@smithy/types": ^3.5.0 + tslib: ^2.6.2 + checksum: 7db9ae0d59695b251a05f48835b2cd2cbcadb0c0f11a8c530c37f596e807479891dae9a0ace723113979d04b8f5d556541cf42131a6ac4bac8371bcd22b86910 + languageName: node + linkType: hard + "@aws-sdk/middleware-location-constraint@npm:3.649.0": version: 3.649.0 resolution: "@aws-sdk/middleware-location-constraint@npm:3.649.0" @@ -6161,6 +6453,17 @@ __metadata: languageName: node linkType: hard +"@aws-sdk/middleware-logger@npm:3.667.0": + version: 3.667.0 + resolution: "@aws-sdk/middleware-logger@npm:3.667.0" + dependencies: + "@aws-sdk/types": 3.667.0 + "@smithy/types": ^3.5.0 + tslib: ^2.6.2 + checksum: 8091b797b226d97b93aa1635fc475168dcc881f4d5fc24efe3153605108be26607d5ca8a008085e2d4c6e8ba6aabd2f97cdf4ca12cf7d295362b36d7064312fe + languageName: node + linkType: hard + "@aws-sdk/middleware-recursion-detection@npm:3.186.0": version: 3.186.0 resolution: "@aws-sdk/middleware-recursion-detection@npm:3.186.0" @@ -6243,6 +6546,18 @@ __metadata: languageName: node linkType: hard +"@aws-sdk/middleware-recursion-detection@npm:3.667.0": + version: 3.667.0 + resolution: "@aws-sdk/middleware-recursion-detection@npm:3.667.0" + dependencies: + "@aws-sdk/types": 3.667.0 + "@smithy/protocol-http": ^4.1.4 + "@smithy/types": ^3.5.0 + tslib: ^2.6.2 + checksum: 87c305abb5df60883b468f000a17b4335188ba4be8845245f1de2d382dfa5f2d4f5ced2380d7b021a89029b8d488fa5139bd3f5c4b98e5c9712ee180b9a25a4d + languageName: node + linkType: hard + "@aws-sdk/middleware-retry@npm:3.186.0": version: 3.186.0 resolution: "@aws-sdk/middleware-retry@npm:3.186.0" @@ -6600,6 +6915,21 @@ __metadata: languageName: node linkType: hard +"@aws-sdk/middleware-user-agent@npm:3.667.0": + version: 3.667.0 + resolution: "@aws-sdk/middleware-user-agent@npm:3.667.0" + dependencies: + "@aws-sdk/core": 3.667.0 + "@aws-sdk/types": 3.667.0 + "@aws-sdk/util-endpoints": 3.667.0 + "@smithy/core": ^2.4.8 + "@smithy/protocol-http": ^4.1.4 + "@smithy/types": ^3.5.0 + tslib: ^2.6.2 + checksum: b85626df127415f4252a779b729cc440d3012dae52284557690147480991db240e7c802ccf3f6e3913f2dbad404ee786c868b9d67d8cafce3d1ed76ed55518d9 + languageName: node + linkType: hard + "@aws-sdk/node-config-provider@npm:3.186.0": version: 3.186.0 resolution: "@aws-sdk/node-config-provider@npm:3.186.0" @@ -6854,6 +7184,20 @@ __metadata: languageName: node linkType: hard +"@aws-sdk/region-config-resolver@npm:3.667.0": + version: 3.667.0 + resolution: "@aws-sdk/region-config-resolver@npm:3.667.0" + dependencies: + "@aws-sdk/types": 3.667.0 + "@smithy/node-config-provider": ^3.1.8 + "@smithy/types": ^3.5.0 + "@smithy/util-config-provider": ^3.0.0 + "@smithy/util-middleware": ^3.0.7 + tslib: ^2.6.2 + checksum: ae3fb07a3e17515c902490c25d5885615f1e2c381b7681731a396319349ffdc80187116cf061763582e2925185b310dcd78fc96c49f1915abab21184f5c9554f + languageName: node + linkType: hard + "@aws-sdk/service-error-classification@npm:3.186.0": version: 3.186.0 resolution: "@aws-sdk/service-error-classification@npm:3.186.0" @@ -7080,6 +7424,21 @@ __metadata: languageName: node linkType: hard +"@aws-sdk/token-providers@npm:3.667.0": + version: 3.667.0 + resolution: "@aws-sdk/token-providers@npm:3.667.0" + dependencies: + "@aws-sdk/types": 3.667.0 + "@smithy/property-provider": ^3.1.7 + "@smithy/shared-ini-file-loader": ^3.1.8 + "@smithy/types": ^3.5.0 + tslib: ^2.6.2 + peerDependencies: + "@aws-sdk/client-sso-oidc": ^3.667.0 + checksum: 5ab543445bda169f0e250bd075044004618fc5915c2f0c11858687b823a7a5106c67c440bea391df2aca67f92ceb8a6ea3e066eaf1cd608d6409f262991772a5 + languageName: node + linkType: hard + "@aws-sdk/types@npm:3.186.0": version: 3.186.0 resolution: "@aws-sdk/types@npm:3.186.0" @@ -7152,7 +7511,7 @@ __metadata: languageName: node linkType: hard -"@aws-sdk/types@npm:3.664.0, @aws-sdk/types@npm:^3.1.0, @aws-sdk/types@npm:^3.222.0, @aws-sdk/types@npm:^3.25.0": +"@aws-sdk/types@npm:3.664.0": version: 3.664.0 resolution: "@aws-sdk/types@npm:3.664.0" dependencies: @@ -7162,6 +7521,16 @@ __metadata: languageName: node linkType: hard +"@aws-sdk/types@npm:3.667.0, @aws-sdk/types@npm:^3.1.0, @aws-sdk/types@npm:^3.222.0, @aws-sdk/types@npm:^3.25.0": + version: 3.667.0 + resolution: "@aws-sdk/types@npm:3.667.0" + dependencies: + "@smithy/types": ^3.5.0 + tslib: ^2.6.2 + checksum: c1173d4799e95f113eeb80505737d86a37b443e45fac52d1045683712078ea338678bf9b55403254615f68e1ee8176084b9647c60e286c6a3569198611ffb9f5 + languageName: node + linkType: hard + "@aws-sdk/url-parser-native@npm:3.6.1": version: 3.6.1 resolution: "@aws-sdk/url-parser-native@npm:3.6.1" @@ -7486,6 +7855,18 @@ __metadata: languageName: node linkType: hard +"@aws-sdk/util-endpoints@npm:3.667.0": + version: 3.667.0 + resolution: "@aws-sdk/util-endpoints@npm:3.667.0" + dependencies: + "@aws-sdk/types": 3.667.0 + "@smithy/types": ^3.5.0 + "@smithy/util-endpoints": ^2.1.3 + tslib: ^2.6.2 + checksum: 53a378a1946024a3a3ce1854d6bf7e92b6155a2814aa0ad7d01109b083bb4fe3cb8ec4d04eb6e23e448fedb0cded7e7430d821d6bdd6f53f256de337ea3fa278 + languageName: node + linkType: hard + "@aws-sdk/util-format-url@npm:3.609.0": version: 3.609.0 resolution: "@aws-sdk/util-format-url@npm:3.609.0" @@ -7682,6 +8063,18 @@ __metadata: languageName: node linkType: hard +"@aws-sdk/util-user-agent-browser@npm:3.667.0": + version: 3.667.0 + resolution: "@aws-sdk/util-user-agent-browser@npm:3.667.0" + dependencies: + "@aws-sdk/types": 3.667.0 + "@smithy/types": ^3.5.0 + bowser: ^2.11.0 + tslib: ^2.6.2 + checksum: 56c2bb125e1814d3903bf11c4ff4c620dade040bb857d829da487e631934551c76ada4e6b2ad729baef1fe1db66895a8e146fe78d6e676f1d2591fc8f136f4ad + languageName: node + linkType: hard + "@aws-sdk/util-user-agent-node@npm:3.186.0": version: 3.186.0 resolution: "@aws-sdk/util-user-agent-node@npm:3.186.0" @@ -7811,6 +8204,24 @@ __metadata: languageName: node linkType: hard +"@aws-sdk/util-user-agent-node@npm:3.667.0": + version: 3.667.0 + resolution: "@aws-sdk/util-user-agent-node@npm:3.667.0" + dependencies: + "@aws-sdk/middleware-user-agent": 3.667.0 + "@aws-sdk/types": 3.667.0 + "@smithy/node-config-provider": ^3.1.8 + "@smithy/types": ^3.5.0 + tslib: ^2.6.2 + peerDependencies: + aws-crt: ">=1.0.0" + peerDependenciesMeta: + aws-crt: + optional: true + checksum: e6e2bbb8f220d12741820b6e67bd666812dafdedf09590f1debe461c1ff995aa6f070ddf9281e333fc5606f7f5b88122bcfb4fe401370e3d03b0d6082580eaa0 + languageName: node + linkType: hard + "@aws-sdk/util-utf8-browser@npm:3.186.0, @aws-sdk/util-utf8-browser@npm:^3.0.0": version: 3.186.0 resolution: "@aws-sdk/util-utf8-browser@npm:3.186.0" @@ -11928,7 +12339,7 @@ __metadata: languageName: node linkType: hard -"@smithy/abort-controller@npm:^3.1.4, @smithy/abort-controller@npm:^3.1.5": +"@smithy/abort-controller@npm:^3.1.5": version: 3.1.5 resolution: "@smithy/abort-controller@npm:3.1.5" dependencies: @@ -12890,14 +13301,14 @@ __metadata: languageName: node linkType: hard -"@smithy/util-waiter@npm:^3.1.2, @smithy/util-waiter@npm:^3.1.3, @smithy/util-waiter@npm:^3.1.5": - version: 3.1.5 - resolution: "@smithy/util-waiter@npm:3.1.5" +"@smithy/util-waiter@npm:^3.1.2, @smithy/util-waiter@npm:^3.1.3, @smithy/util-waiter@npm:^3.1.5, @smithy/util-waiter@npm:^3.1.6": + version: 3.1.6 + resolution: "@smithy/util-waiter@npm:3.1.6" dependencies: - "@smithy/abort-controller": ^3.1.4 - "@smithy/types": ^3.4.2 + "@smithy/abort-controller": ^3.1.5 + "@smithy/types": ^3.5.0 tslib: ^2.6.2 - checksum: d72733480f08a570a08eb1c4e57ac5779d2f41598d9608d62419e9adfccb86295b8c60103c51b3338167bb2f9179483db24c3dc9585da867419c5abf9efcad98 + checksum: dfa7cf04afa7be4736e78f54f96c6583c2f582fef6bd179cf925f5dd737f3fed0b37446d5198d9dedfb343a0b71c481f560b5954686f8e2b51155a37752bc586 languageName: node linkType: hard From 2df45b90b90ed184c155c69ed355285948d9defb Mon Sep 17 00:00:00 2001 From: Sanay Yogesh Shah Date: Thu, 10 Oct 2024 11:08:51 -0700 Subject: [PATCH 5/5] refactor: use execa instead of spawn for executing commands --- .../package.json | 1 + .../__tests__/migration_codegen_e2e.test.ts | 4 +- .../src/assertions.ts | 15 ++---- .../{function-utils.ts => function_utils.ts} | 0 .../src/index.ts | 50 +++++++++---------- .../src/{sdk-calls.ts => sdk_calls.ts} | 0 yarn.lock | 1 + 7 files changed, 32 insertions(+), 39 deletions(-) rename packages/amplify-migration-codegen-e2e/src/{function-utils.ts => function_utils.ts} (100%) rename packages/amplify-migration-codegen-e2e/src/{sdk-calls.ts => sdk_calls.ts} (100%) diff --git a/packages/amplify-migration-codegen-e2e/package.json b/packages/amplify-migration-codegen-e2e/package.json index 4f7fc3f512..0830cdf572 100644 --- a/packages/amplify-migration-codegen-e2e/package.json +++ b/packages/amplify-migration-codegen-e2e/package.json @@ -9,6 +9,7 @@ "@aws-amplify/amplify-gen2-codegen": "0.1.0-gen2-migration-test-alpha.0", "@aws-sdk/client-appsync": "^3.666.0", "@aws-sdk/client-cloudcontrol": "^3.658.1", + "execa": "^5.1.1", "fs-extra": "^8.1.0", "lodash": "^4.17.21" }, diff --git a/packages/amplify-migration-codegen-e2e/src/__tests__/migration_codegen_e2e.test.ts b/packages/amplify-migration-codegen-e2e/src/__tests__/migration_codegen_e2e.test.ts index c82068a865..45e2f8a543 100644 --- a/packages/amplify-migration-codegen-e2e/src/__tests__/migration_codegen_e2e.test.ts +++ b/packages/amplify-migration-codegen-e2e/src/__tests__/migration_codegen_e2e.test.ts @@ -2,7 +2,7 @@ import path from 'node:path'; import assert from 'node:assert'; import { createNewProjectDir } from '@aws-amplify/amplify-e2e-core'; import { createGen2Renderer } from '@aws-amplify/amplify-gen2-codegen'; -import { copyFunctionFile } from '../function-utils'; +import { copyFunctionFile } from '../function_utils'; import { copyGen1Schema } from '../api-utils'; import { cleanupProjects, setupAndPushGen1Project, runCodegenCommand, runGen2SandboxCommand } from '..'; import { assertGen1Setup, assertUserPoolResource, assertStorageResource, assertFunctionResource, assertDataResource } from '../assertions'; @@ -38,7 +38,7 @@ void describe('Codegen E2E tests', () => { void it('should init a project & add auth, function, storage, api with defaults & perform full migration codegen flow', async () => { await setupAndPushGen1Project(projRoot, projName); const { gen1UserPoolId, gen1FunctionName, gen1BucketName, gen1GraphqlApiId, gen1Region } = await assertGen1Setup(projRoot); - await assert.doesNotReject(runCodegenCommand(projRoot), 'Codegen failed'); + await runCodegenCommand(projRoot); await copyFunctionFile(projRoot, gen1FunctionName); await copyGen1Schema(projRoot, projName); const gen2StackName = await runGen2SandboxCommand(projRoot); diff --git a/packages/amplify-migration-codegen-e2e/src/assertions.ts b/packages/amplify-migration-codegen-e2e/src/assertions.ts index 82d0d6a969..6c8a5e21a1 100644 --- a/packages/amplify-migration-codegen-e2e/src/assertions.ts +++ b/packages/amplify-migration-codegen-e2e/src/assertions.ts @@ -7,7 +7,7 @@ import { describeCloudFormationStack, } from '@aws-amplify/amplify-e2e-core'; import { getProjectOutputs } from './projectOutputs'; -import { getAppSyncDataSource, getResourceDetails } from './sdk-calls'; +import { getAppSyncDataSource, getResourceDetails } from './sdk_calls'; import { removeProperties } from '.'; export async function assertGen1Setup(projRoot: string) { @@ -92,12 +92,7 @@ export async function assertStorageResource(projRoot: string, gen1BucketName: st expect(gen2Resource).toEqual(gen1Resource); } -export async function assertFunctionResource( - projRoot: string, - gen2StackName: string | unknown, - gen1FunctionName: string, - gen1Region: string, -) { +export async function assertFunctionResource(projRoot: string, gen2StackName: string, gen1FunctionName: string, gen1Region: string) { const gen1Resource = await getResourceDetails('AWS::Lambda::Function', gen1FunctionName, gen1Region); removeProperties(gen1Resource, ['Arn', 'FunctionName', 'LoggingConfig.LogGroup', 'Role']); // TODO: remove below line after Tags inconsistency is fixed @@ -105,7 +100,7 @@ export async function assertFunctionResource( const gen2Meta = getProjectOutputs(projRoot); const gen2Region = gen2Meta.auth.aws_region; - const outputs = (await describeCloudFormationStack(gen2StackName as string, gen2Region)).Outputs; + const outputs = (await describeCloudFormationStack(gen2StackName, gen2Region)).Outputs; const gen2FunctionName = JSON.parse(outputs?.find((output) => output.OutputKey === 'definedFunctions')?.OutputValue ?? '[]')[0]; const gen2Resource = await getResourceDetails('AWS::Lambda::Function', gen2FunctionName, gen2Region); removeProperties(gen2Resource, ['Arn', 'FunctionName', 'LoggingConfig.LogGroup', 'Role']); @@ -115,7 +110,7 @@ export async function assertFunctionResource( expect(gen2Resource).toEqual(gen1Resource); } -export async function assertDataResource(projRoot: string, gen2StackName: string | unknown, gen1GraphqlApiId: string, gen1Region: string) { +export async function assertDataResource(projRoot: string, gen2StackName: string, gen1GraphqlApiId: string, gen1Region: string) { const gen1Resource = await getAppSyncApi(gen1GraphqlApiId, gen1Region); const gen1DataSource = (await getAppSyncDataSource(gen1GraphqlApiId, 'TodoTable', gen1Region)) as Record; removeProperties(gen1DataSource, ['dataSourceArn', 'serviceRoleArn']); @@ -125,7 +120,7 @@ export async function assertDataResource(projRoot: string, gen2StackName: string const gen2Meta = getProjectOutputs(projRoot); const gen2Region = gen2Meta.data.aws_region; - const outputs = (await describeCloudFormationStack(gen2StackName as string, gen2Region)).Outputs; + const outputs = (await describeCloudFormationStack(gen2StackName, gen2Region)).Outputs; const gen2GraphqlApiId = outputs?.find((output) => output.OutputKey === 'awsAppsyncApiId')?.OutputValue ?? ''; const gen2Resource = await getAppSyncApi(gen2GraphqlApiId, gen2Region); const gen2DataSource = (await getAppSyncDataSource(gen2GraphqlApiId, 'TodoTable', gen1Region)) as Record; diff --git a/packages/amplify-migration-codegen-e2e/src/function-utils.ts b/packages/amplify-migration-codegen-e2e/src/function_utils.ts similarity index 100% rename from packages/amplify-migration-codegen-e2e/src/function-utils.ts rename to packages/amplify-migration-codegen-e2e/src/function_utils.ts diff --git a/packages/amplify-migration-codegen-e2e/src/index.ts b/packages/amplify-migration-codegen-e2e/src/index.ts index 6e40f2db1e..8a8e92e4c6 100644 --- a/packages/amplify-migration-codegen-e2e/src/index.ts +++ b/packages/amplify-migration-codegen-e2e/src/index.ts @@ -18,8 +18,9 @@ import { import { updatePackageDependency } from './updatePackageJson'; import path from 'node:path'; import { unset } from 'lodash'; +import execa from 'execa'; -export * from './sdk-calls'; +export * from './sdk_calls'; export * from './assertions'; export * from './projectOutputs'; export * from './updatePackageJson'; @@ -40,39 +41,34 @@ export async function setupAndPushGen1Project(projRoot: string, projName: string } export function runCodegenCommand(cwd: string) { - return spawn(getNpxPath(), ['@aws-amplify/migrate', 'to-gen-2', 'generate-code'], { + const processResult = execa.sync(getNpxPath(), ['@aws-amplify/migrate', 'to-gen-2', 'generate-code'], { cwd, - stripColors: true, - noOutputTimeout: pushTimeoutMS, env: { ...process.env, npm_config_user_agent: 'npm' }, - }).runAsync(); + encoding: 'utf-8', + }); + if (processResult.exitCode !== 0) { + throw new Error(`Codegen command exit code: ${processResult.exitCode}, message: ${processResult.stderr}`); + } } -export async function runGen2SandboxCommand(cwd: string) { +export function runGen2SandboxCommand(cwd: string) { updatePackageDependency(cwd, '@aws-amplify/backend', '0.0.0-test-20241003180022'); npmInstall(cwd); - return new Promise((resolve, reject) => { - let stackName: string; - spawn(getNpxPath(), ['ampx', 'sandbox', '--once'], { - cwd, - stripColors: true, - noOutputTimeout: pushTimeoutMS, - env: { ...process.env, npm_config_user_agent: 'npm' }, - }) - .wait(/arn:aws:cloudformation:.*:stack\/([^/]+)\//, (data) => { - const match = data.match(/arn:aws:cloudformation:.*:stack\/([^/]+)\//); - if (match) { - stackName = match[1]; - } - }) - .run((err: Error) => { - if (!err && stackName) { - resolve(stackName); - } else { - reject(err); - } - }); + const processResult = execa.sync(getNpxPath(), ['ampx', 'sandbox', '--once'], { + cwd, + env: { ...process.env, npm_config_user_agent: 'npm' }, + encoding: 'utf-8', }); + if (processResult.exitCode === 0) { + const match = processResult.stdout.match(/arn:aws:cloudformation:.*:stack\/([^/]+)\//); + if (match) { + return match[1]; + } else { + throw new Error('Stack name not found in the command output'); + } + } else { + throw new Error(`Sandbox command exit code: ${processResult.exitCode}, message: ${processResult.stderr}`); + } } function deleteGen2Sandbox(cwd: string) { diff --git a/packages/amplify-migration-codegen-e2e/src/sdk-calls.ts b/packages/amplify-migration-codegen-e2e/src/sdk_calls.ts similarity index 100% rename from packages/amplify-migration-codegen-e2e/src/sdk-calls.ts rename to packages/amplify-migration-codegen-e2e/src/sdk_calls.ts diff --git a/yarn.lock b/yarn.lock index 5091af7c79..bb1077e00b 100644 --- a/yarn.lock +++ b/yarn.lock @@ -840,6 +840,7 @@ __metadata: "@aws-amplify/amplify-gen2-codegen": 0.1.0-gen2-migration-test-alpha.0 "@aws-sdk/client-appsync": ^3.666.0 "@aws-sdk/client-cloudcontrol": ^3.658.1 + execa: ^5.1.1 fs-extra: ^8.1.0 jest: ^29.5.0 lodash: ^4.17.21