@aws-amplify/cli-internal-gen2-migration-experimental-alpha 0.1.0 → 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/aws-amplify-cli-internal-gen2-migration-experimental-alpha-0.3.0.tgz +0 -0
- package/lib/commands/drift-detection/detect-local-drift.d.ts +3 -6
- package/lib/commands/drift-detection/detect-local-drift.d.ts.map +1 -1
- package/lib/commands/drift-detection/detect-local-drift.js +4 -8
- package/lib/commands/drift-detection/detect-local-drift.js.map +1 -1
- package/lib/commands/drift-detection/detect-stack-drift.d.ts +3 -2
- package/lib/commands/drift-detection/detect-stack-drift.d.ts.map +1 -1
- package/lib/commands/drift-detection/detect-stack-drift.js +12 -0
- package/lib/commands/drift-detection/detect-stack-drift.js.map +1 -1
- package/lib/commands/drift-detection/detect-template-drift.d.ts +4 -5
- package/lib/commands/drift-detection/detect-template-drift.d.ts.map +1 -1
- package/lib/commands/drift-detection/detect-template-drift.js +122 -94
- package/lib/commands/drift-detection/detect-template-drift.js.map +1 -1
- package/lib/commands/drift-detection/index.d.ts +3 -2
- package/lib/commands/drift-detection/index.d.ts.map +1 -1
- package/lib/commands/drift-detection/index.js +3 -1
- package/lib/commands/drift-detection/index.js.map +1 -1
- package/lib/commands/drift-detection/services/cloudformation-service.d.ts.map +1 -1
- package/lib/commands/drift-detection/services/cloudformation-service.js +3 -5
- package/lib/commands/drift-detection/services/cloudformation-service.js.map +1 -1
- package/lib/commands/drift-detection/services/drift-formatter.d.ts +4 -5
- package/lib/commands/drift-detection/services/drift-formatter.d.ts.map +1 -1
- package/lib/commands/drift-detection/services/drift-formatter.js +15 -38
- package/lib/commands/drift-detection/services/drift-formatter.js.map +1 -1
- package/lib/commands/drift.d.ts +0 -2
- package/lib/commands/drift.d.ts.map +1 -1
- package/lib/commands/drift.js +47 -57
- package/lib/commands/drift.js.map +1 -1
- package/lib/commands/gen2-migration/_step.d.ts +2 -1
- package/lib/commands/gen2-migration/_step.d.ts.map +1 -1
- package/lib/commands/gen2-migration/_step.js +2 -1
- package/lib/commands/gen2-migration/_step.js.map +1 -1
- package/lib/commands/gen2-migration/generate/adapters/auth/index.d.ts +24 -0
- package/lib/commands/gen2-migration/generate/adapters/auth/index.d.ts.map +1 -0
- package/lib/commands/gen2-migration/generate/adapters/auth/index.js +297 -0
- package/lib/commands/gen2-migration/generate/adapters/auth/index.js.map +1 -0
- package/lib/commands/gen2-migration/generate/adapters/auth/index.test.d.ts +2 -0
- package/lib/commands/gen2-migration/generate/adapters/auth/index.test.d.ts.map +1 -0
- package/lib/commands/gen2-migration/generate/adapters/auth/index.test.js +140 -0
- package/lib/commands/gen2-migration/generate/adapters/auth/index.test.js.map +1 -0
- package/lib/commands/gen2-migration/generate/adapters/data/index.d.ts +5 -0
- package/lib/commands/gen2-migration/generate/adapters/data/index.d.ts.map +1 -0
- package/lib/commands/gen2-migration/generate/adapters/data/index.js +17 -0
- package/lib/commands/gen2-migration/generate/adapters/data/index.js.map +1 -0
- package/lib/commands/gen2-migration/generate/adapters/functions/index.d.ts +17 -0
- package/lib/commands/gen2-migration/generate/adapters/functions/index.d.ts.map +1 -0
- package/lib/commands/gen2-migration/generate/adapters/functions/index.js +46 -0
- package/lib/commands/gen2-migration/generate/adapters/functions/index.js.map +1 -0
- package/lib/commands/gen2-migration/generate/adapters/project/index.d.ts +2 -0
- package/lib/commands/gen2-migration/generate/adapters/project/index.d.ts.map +1 -0
- package/lib/commands/gen2-migration/generate/adapters/project/index.js +7 -0
- package/lib/commands/gen2-migration/generate/adapters/project/index.js.map +1 -0
- package/lib/commands/gen2-migration/generate/adapters/storage/gen1_storage_codegen_adapter.d.ts +30 -0
- package/lib/commands/gen2-migration/generate/adapters/storage/gen1_storage_codegen_adapter.d.ts.map +1 -0
- package/lib/commands/gen2-migration/generate/adapters/storage/gen1_storage_codegen_adapter.js +18 -0
- package/lib/commands/gen2-migration/generate/adapters/storage/gen1_storage_codegen_adapter.js.map +1 -0
- package/lib/commands/gen2-migration/generate/adapters/storage/gen1_storage_codegen_adapter.test.d.ts +2 -0
- package/lib/commands/gen2-migration/generate/adapters/storage/gen1_storage_codegen_adapter.test.d.ts.map +1 -0
- package/lib/commands/gen2-migration/generate/adapters/storage/gen1_storage_codegen_adapter.test.js +181 -0
- package/lib/commands/gen2-migration/generate/adapters/storage/gen1_storage_codegen_adapter.test.js.map +1 -0
- package/lib/commands/gen2-migration/generate/adapters/storage/index.d.ts +3 -0
- package/lib/commands/gen2-migration/generate/adapters/storage/index.d.ts.map +1 -0
- package/lib/commands/gen2-migration/generate/adapters/storage/index.js +6 -0
- package/lib/commands/gen2-migration/generate/adapters/storage/index.js.map +1 -0
- package/lib/commands/gen2-migration/generate/adapters/storage/storage_access.d.ts +14 -0
- package/lib/commands/gen2-migration/generate/adapters/storage/storage_access.d.ts.map +1 -0
- package/lib/commands/gen2-migration/generate/adapters/storage/storage_access.js +27 -0
- package/lib/commands/gen2-migration/generate/adapters/storage/storage_access.js.map +1 -0
- package/lib/commands/gen2-migration/generate/backend/synthesizer.d.ts +80 -0
- package/lib/commands/gen2-migration/generate/backend/synthesizer.d.ts.map +1 -0
- package/lib/commands/gen2-migration/generate/backend/synthesizer.js +899 -0
- package/lib/commands/gen2-migration/generate/backend/synthesizer.js.map +1 -0
- package/lib/commands/gen2-migration/generate/backend/synthesizer.test.d.ts +2 -0
- package/lib/commands/gen2-migration/generate/backend/synthesizer.test.d.ts.map +1 -0
- package/lib/commands/gen2-migration/generate/backend/synthesizer.test.js +744 -0
- package/lib/commands/gen2-migration/generate/backend/synthesizer.test.js.map +1 -0
- package/lib/commands/gen2-migration/generate/codegen-head/amplify_stack_parser.d.ts +14 -0
- package/lib/commands/gen2-migration/generate/codegen-head/amplify_stack_parser.d.ts.map +1 -0
- package/lib/commands/gen2-migration/generate/codegen-head/amplify_stack_parser.js +82 -0
- package/lib/commands/gen2-migration/generate/codegen-head/amplify_stack_parser.js.map +1 -0
- package/lib/commands/gen2-migration/generate/codegen-head/analytics.d.ts +10 -0
- package/lib/commands/gen2-migration/generate/codegen-head/analytics.d.ts.map +1 -0
- package/lib/commands/gen2-migration/generate/codegen-head/analytics.js +11 -0
- package/lib/commands/gen2-migration/generate/codegen-head/analytics.js.map +1 -0
- package/lib/commands/gen2-migration/generate/codegen-head/app_analytics_definition_fetcher.d.ts +13 -0
- package/lib/commands/gen2-migration/generate/codegen-head/app_analytics_definition_fetcher.d.ts.map +1 -0
- package/lib/commands/gen2-migration/generate/codegen-head/app_analytics_definition_fetcher.js +22 -0
- package/lib/commands/gen2-migration/generate/codegen-head/app_analytics_definition_fetcher.js.map +1 -0
- package/lib/commands/gen2-migration/generate/codegen-head/app_auth_definition_fetcher.d.ts +24 -0
- package/lib/commands/gen2-migration/generate/codegen-head/app_auth_definition_fetcher.d.ts.map +1 -0
- package/lib/commands/gen2-migration/generate/codegen-head/app_auth_definition_fetcher.js +167 -0
- package/lib/commands/gen2-migration/generate/codegen-head/app_auth_definition_fetcher.js.map +1 -0
- package/lib/commands/gen2-migration/generate/codegen-head/app_functions_definition_fetcher.d.ts +19 -0
- package/lib/commands/gen2-migration/generate/codegen-head/app_functions_definition_fetcher.d.ts.map +1 -0
- package/lib/commands/gen2-migration/generate/codegen-head/app_functions_definition_fetcher.js +133 -0
- package/lib/commands/gen2-migration/generate/codegen-head/app_functions_definition_fetcher.js.map +1 -0
- package/lib/commands/gen2-migration/generate/codegen-head/app_storage_definition_fetcher.d.ts +23 -0
- package/lib/commands/gen2-migration/generate/codegen-head/app_storage_definition_fetcher.d.ts.map +1 -0
- package/lib/commands/gen2-migration/generate/codegen-head/app_storage_definition_fetcher.js +172 -0
- package/lib/commands/gen2-migration/generate/codegen-head/app_storage_definition_fetcher.js.map +1 -0
- package/lib/commands/gen2-migration/generate/codegen-head/backend_downloader.d.ts +10 -0
- package/lib/commands/gen2-migration/generate/codegen-head/backend_downloader.d.ts.map +1 -0
- package/lib/commands/gen2-migration/generate/codegen-head/backend_downloader.js +48 -0
- package/lib/commands/gen2-migration/generate/codegen-head/backend_downloader.js.map +1 -0
- package/lib/commands/gen2-migration/generate/codegen-head/backend_environment_selector.d.ts +11 -0
- package/lib/commands/gen2-migration/generate/codegen-head/backend_environment_selector.d.ts.map +1 -0
- package/lib/commands/gen2-migration/generate/codegen-head/backend_environment_selector.js +38 -0
- package/lib/commands/gen2-migration/generate/codegen-head/backend_environment_selector.js.map +1 -0
- package/lib/commands/gen2-migration/generate/codegen-head/command-handlers.d.ts +13 -0
- package/lib/commands/gen2-migration/generate/codegen-head/command-handlers.d.ts.map +1 -0
- package/lib/commands/gen2-migration/generate/codegen-head/command-handlers.js +462 -0
- package/lib/commands/gen2-migration/generate/codegen-head/command-handlers.js.map +1 -0
- package/lib/commands/gen2-migration/generate/codegen-head/data_definition_fetcher.d.ts +47 -0
- package/lib/commands/gen2-migration/generate/codegen-head/data_definition_fetcher.d.ts.map +1 -0
- package/lib/commands/gen2-migration/generate/codegen-head/data_definition_fetcher.js +222 -0
- package/lib/commands/gen2-migration/generate/codegen-head/data_definition_fetcher.js.map +1 -0
- package/lib/commands/gen2-migration/generate/codegen-head/directory_exists.d.ts +2 -0
- package/lib/commands/gen2-migration/generate/codegen-head/directory_exists.d.ts.map +1 -0
- package/lib/commands/gen2-migration/generate/codegen-head/directory_exists.js +15 -0
- package/lib/commands/gen2-migration/generate/codegen-head/directory_exists.js.map +1 -0
- package/lib/commands/gen2-migration/generate/codegen-head/format.d.ts +8 -0
- package/lib/commands/gen2-migration/generate/codegen-head/format.d.ts.map +1 -0
- package/lib/commands/gen2-migration/generate/codegen-head/format.js +66 -0
- package/lib/commands/gen2-migration/generate/codegen-head/format.js.map +1 -0
- package/lib/commands/gen2-migration/generate/codegen-head/logger.d.ts +15 -0
- package/lib/commands/gen2-migration/generate/codegen-head/logger.d.ts.map +1 -0
- package/lib/commands/gen2-migration/generate/codegen-head/logger.js +14 -0
- package/lib/commands/gen2-migration/generate/codegen-head/logger.js.map +1 -0
- package/lib/commands/gen2-migration/generate/codegen-head/printer.d.ts +26 -0
- package/lib/commands/gen2-migration/generate/codegen-head/printer.d.ts.map +1 -0
- package/lib/commands/gen2-migration/generate/codegen-head/printer.js +103 -0
- package/lib/commands/gen2-migration/generate/codegen-head/printer.js.map +1 -0
- package/lib/commands/gen2-migration/generate/core/migration-pipeline.d.ts +26 -0
- package/lib/commands/gen2-migration/generate/core/migration-pipeline.d.ts.map +1 -0
- package/lib/commands/gen2-migration/generate/core/migration-pipeline.js +233 -0
- package/lib/commands/gen2-migration/generate/core/migration-pipeline.js.map +1 -0
- package/lib/commands/gen2-migration/generate/custom-resources/generator/backend-updater.d.ts.map +1 -0
- package/lib/commands/gen2-migration/generate/custom-resources/generator/backend-updater.js.map +1 -0
- package/lib/commands/gen2-migration/generate/custom-resources/generator/dependency-merger.d.ts.map +1 -0
- package/lib/commands/gen2-migration/generate/custom-resources/generator/dependency-merger.js.map +1 -0
- package/lib/commands/gen2-migration/generate/custom-resources/generator/file-converter.d.ts.map +1 -0
- package/lib/commands/gen2-migration/generate/custom-resources/generator/file-converter.js.map +1 -0
- package/lib/commands/gen2-migration/generate/custom-resources/generator/gen2-file-generator.d.ts.map +1 -0
- package/lib/commands/gen2-migration/generate/custom-resources/generator/gen2-file-generator.js.map +1 -0
- package/lib/commands/gen2-migration/generate/custom-resources/parser/cdk-stack-parser.d.ts.map +1 -0
- package/lib/commands/gen2-migration/generate/custom-resources/parser/cdk-stack-parser.js.map +1 -0
- package/lib/commands/gen2-migration/generate/custom-resources/parser/pattern-detector.d.ts.map +1 -0
- package/lib/commands/gen2-migration/generate/custom-resources/parser/pattern-detector.js.map +1 -0
- package/lib/commands/gen2-migration/generate/custom-resources/scanner/custom-resource-scanner.d.ts.map +1 -0
- package/lib/commands/gen2-migration/generate/custom-resources/scanner/custom-resource-scanner.js.map +1 -0
- package/lib/commands/gen2-migration/generate/custom-resources/transformer/amplify-helper-transformer.d.ts.map +1 -0
- package/lib/commands/gen2-migration/{codegen-custom-resources → generate/custom-resources}/transformer/amplify-helper-transformer.js +25 -3
- package/lib/commands/gen2-migration/generate/custom-resources/transformer/amplify-helper-transformer.js.map +1 -0
- package/lib/commands/gen2-migration/generate/custom-resources/types.d.ts.map +1 -0
- package/lib/commands/gen2-migration/generate/custom-resources/types.js.map +1 -0
- package/lib/commands/gen2-migration/generate/generators/analytics/index.d.ts +9 -0
- package/lib/commands/gen2-migration/generate/generators/analytics/index.d.ts.map +1 -0
- package/lib/commands/gen2-migration/generate/generators/analytics/index.js +40 -0
- package/lib/commands/gen2-migration/generate/generators/analytics/index.js.map +1 -0
- package/lib/commands/gen2-migration/generate/generators/auth/index.d.ts +106 -0
- package/lib/commands/gen2-migration/generate/generators/auth/index.d.ts.map +1 -0
- package/lib/commands/gen2-migration/generate/generators/auth/index.js +286 -0
- package/lib/commands/gen2-migration/generate/generators/auth/index.js.map +1 -0
- package/lib/commands/gen2-migration/generate/generators/auth/index.test.d.ts +2 -0
- package/lib/commands/gen2-migration/generate/generators/auth/index.test.d.ts.map +1 -0
- package/lib/commands/gen2-migration/generate/generators/auth/index.test.js +437 -0
- package/lib/commands/gen2-migration/generate/generators/auth/index.test.js.map +1 -0
- package/lib/commands/gen2-migration/generate/generators/data/index.d.ts +35 -0
- package/lib/commands/gen2-migration/generate/generators/data/index.d.ts.map +1 -0
- package/lib/commands/gen2-migration/generate/generators/data/index.js +199 -0
- package/lib/commands/gen2-migration/generate/generators/data/index.js.map +1 -0
- package/lib/commands/gen2-migration/generate/generators/data/index.test.d.ts +2 -0
- package/lib/commands/gen2-migration/generate/generators/data/index.test.d.ts.map +1 -0
- package/lib/commands/gen2-migration/generate/generators/data/index.test.js +50 -0
- package/lib/commands/gen2-migration/generate/generators/data/index.test.js.map +1 -0
- package/lib/commands/gen2-migration/generate/generators/functions/index.d.ts +17 -0
- package/lib/commands/gen2-migration/generate/generators/functions/index.d.ts.map +1 -0
- package/lib/commands/gen2-migration/generate/generators/functions/index.js +125 -0
- package/lib/commands/gen2-migration/generate/generators/functions/index.js.map +1 -0
- package/lib/commands/gen2-migration/generate/generators/functions/lambda.d.ts +6 -0
- package/lib/commands/gen2-migration/generate/generators/functions/lambda.d.ts.map +1 -0
- package/lib/commands/gen2-migration/generate/generators/functions/lambda.js +16 -0
- package/lib/commands/gen2-migration/generate/generators/functions/lambda.js.map +1 -0
- package/lib/commands/gen2-migration/generate/generators/storage/access.d.ts +4 -0
- package/lib/commands/gen2-migration/generate/generators/storage/access.d.ts.map +1 -0
- package/lib/commands/gen2-migration/generate/generators/storage/access.js +53 -0
- package/lib/commands/gen2-migration/generate/generators/storage/access.js.map +1 -0
- package/lib/commands/gen2-migration/generate/generators/storage/index.d.ts +31 -0
- package/lib/commands/gen2-migration/generate/generators/storage/index.d.ts.map +1 -0
- package/lib/commands/gen2-migration/generate/generators/storage/index.js +66 -0
- package/lib/commands/gen2-migration/generate/generators/storage/index.js.map +1 -0
- package/lib/commands/gen2-migration/generate/npm_package/renderer.d.ts +27 -0
- package/lib/commands/gen2-migration/generate/npm_package/renderer.d.ts.map +1 -0
- package/lib/commands/gen2-migration/generate/npm_package/renderer.js +28 -0
- package/lib/commands/gen2-migration/generate/npm_package/renderer.js.map +1 -0
- package/lib/commands/gen2-migration/generate/render_pipeline.d.ts +9 -0
- package/lib/commands/gen2-migration/generate/render_pipeline.d.ts.map +1 -0
- package/lib/commands/gen2-migration/generate/render_pipeline.js +15 -0
- package/lib/commands/gen2-migration/generate/render_pipeline.js.map +1 -0
- package/lib/commands/gen2-migration/generate/renderers/ensure_directory.d.ts +7 -0
- package/lib/commands/gen2-migration/generate/renderers/ensure_directory.d.ts.map +1 -0
- package/lib/commands/gen2-migration/generate/renderers/ensure_directory.js +17 -0
- package/lib/commands/gen2-migration/generate/renderers/ensure_directory.js.map +1 -0
- package/lib/commands/gen2-migration/generate/renderers/package_json.d.ts +8 -0
- package/lib/commands/gen2-migration/generate/renderers/package_json.d.ts.map +1 -0
- package/lib/commands/gen2-migration/generate/renderers/package_json.js +15 -0
- package/lib/commands/gen2-migration/generate/renderers/package_json.js.map +1 -0
- package/lib/commands/gen2-migration/generate/renderers/typescript_block_node.d.ts +11 -0
- package/lib/commands/gen2-migration/generate/renderers/typescript_block_node.d.ts.map +1 -0
- package/lib/commands/gen2-migration/generate/renderers/typescript_block_node.js +22 -0
- package/lib/commands/gen2-migration/generate/renderers/typescript_block_node.js.map +1 -0
- package/lib/commands/gen2-migration/generate/resource/resource.d.ts +20 -0
- package/lib/commands/gen2-migration/generate/resource/resource.d.ts.map +1 -0
- package/lib/commands/gen2-migration/generate/resource/resource.js +60 -0
- package/lib/commands/gen2-migration/generate/resource/resource.js.map +1 -0
- package/lib/commands/gen2-migration/generate/test_utils/import_regex.d.ts +2 -0
- package/lib/commands/gen2-migration/generate/test_utils/import_regex.d.ts.map +1 -0
- package/lib/commands/gen2-migration/generate/test_utils/import_regex.js +6 -0
- package/lib/commands/gen2-migration/generate/test_utils/import_regex.js.map +1 -0
- package/lib/commands/gen2-migration/generate/test_utils/ts_node_printer.d.ts +4 -0
- package/lib/commands/gen2-migration/generate/test_utils/ts_node_printer.d.ts.map +1 -0
- package/lib/commands/gen2-migration/generate/test_utils/ts_node_printer.js +22 -0
- package/lib/commands/gen2-migration/generate/test_utils/ts_node_printer.js.map +1 -0
- package/lib/commands/gen2-migration/generate/todo_error.d.ts +3 -0
- package/lib/commands/gen2-migration/generate/todo_error.d.ts.map +1 -0
- package/lib/commands/gen2-migration/generate/todo_error.js +11 -0
- package/lib/commands/gen2-migration/generate/todo_error.js.map +1 -0
- package/lib/commands/gen2-migration/generate/ts_factory_utils.d.ts +3 -0
- package/lib/commands/gen2-migration/generate/ts_factory_utils.d.ts.map +1 -0
- package/lib/commands/gen2-migration/generate/ts_factory_utils.js +10 -0
- package/lib/commands/gen2-migration/generate/ts_factory_utils.js.map +1 -0
- package/lib/commands/gen2-migration/generate/types.d.ts +4 -0
- package/lib/commands/gen2-migration/generate/types.d.ts.map +1 -0
- package/lib/commands/gen2-migration/generate/types.js +3 -0
- package/lib/commands/gen2-migration/generate/types.js.map +1 -0
- package/lib/commands/gen2-migration/generate/unsupported/cdk-from-cfn.d.ts +26 -0
- package/lib/commands/gen2-migration/generate/unsupported/cdk-from-cfn.d.ts.map +1 -0
- package/lib/commands/gen2-migration/generate/unsupported/cdk-from-cfn.js +152 -0
- package/lib/commands/gen2-migration/generate/unsupported/cdk-from-cfn.js.map +1 -0
- package/lib/commands/gen2-migration/generate.js +2 -2
- package/lib/commands/gen2-migration/generate.js.map +1 -1
- package/lib/commands/gen2-migration.d.ts.map +1 -1
- package/lib/commands/gen2-migration.js +2 -1
- package/lib/commands/gen2-migration.js.map +1 -1
- package/package.json +3 -2
- package/aws-amplify-cli-internal-gen2-migration-experimental-alpha-0.1.0.tgz +0 -0
- package/lib/commands/gen2-migration/codegen-custom-resources/generator/backend-updater.d.ts.map +0 -1
- package/lib/commands/gen2-migration/codegen-custom-resources/generator/backend-updater.js.map +0 -1
- package/lib/commands/gen2-migration/codegen-custom-resources/generator/dependency-merger.d.ts.map +0 -1
- package/lib/commands/gen2-migration/codegen-custom-resources/generator/dependency-merger.js.map +0 -1
- package/lib/commands/gen2-migration/codegen-custom-resources/generator/file-converter.d.ts.map +0 -1
- package/lib/commands/gen2-migration/codegen-custom-resources/generator/file-converter.js.map +0 -1
- package/lib/commands/gen2-migration/codegen-custom-resources/generator/gen2-file-generator.d.ts.map +0 -1
- package/lib/commands/gen2-migration/codegen-custom-resources/generator/gen2-file-generator.js.map +0 -1
- package/lib/commands/gen2-migration/codegen-custom-resources/parser/cdk-stack-parser.d.ts.map +0 -1
- package/lib/commands/gen2-migration/codegen-custom-resources/parser/cdk-stack-parser.js.map +0 -1
- package/lib/commands/gen2-migration/codegen-custom-resources/parser/pattern-detector.d.ts.map +0 -1
- package/lib/commands/gen2-migration/codegen-custom-resources/parser/pattern-detector.js.map +0 -1
- package/lib/commands/gen2-migration/codegen-custom-resources/scanner/custom-resource-scanner.d.ts.map +0 -1
- package/lib/commands/gen2-migration/codegen-custom-resources/scanner/custom-resource-scanner.js.map +0 -1
- package/lib/commands/gen2-migration/codegen-custom-resources/transformer/amplify-helper-transformer.d.ts.map +0 -1
- package/lib/commands/gen2-migration/codegen-custom-resources/transformer/amplify-helper-transformer.js.map +0 -1
- package/lib/commands/gen2-migration/codegen-custom-resources/types.d.ts.map +0 -1
- package/lib/commands/gen2-migration/codegen-custom-resources/types.js.map +0 -1
- /package/lib/commands/gen2-migration/{codegen-custom-resources → generate/custom-resources}/generator/backend-updater.d.ts +0 -0
- /package/lib/commands/gen2-migration/{codegen-custom-resources → generate/custom-resources}/generator/backend-updater.js +0 -0
- /package/lib/commands/gen2-migration/{codegen-custom-resources → generate/custom-resources}/generator/dependency-merger.d.ts +0 -0
- /package/lib/commands/gen2-migration/{codegen-custom-resources → generate/custom-resources}/generator/dependency-merger.js +0 -0
- /package/lib/commands/gen2-migration/{codegen-custom-resources → generate/custom-resources}/generator/file-converter.d.ts +0 -0
- /package/lib/commands/gen2-migration/{codegen-custom-resources → generate/custom-resources}/generator/file-converter.js +0 -0
- /package/lib/commands/gen2-migration/{codegen-custom-resources → generate/custom-resources}/generator/gen2-file-generator.d.ts +0 -0
- /package/lib/commands/gen2-migration/{codegen-custom-resources → generate/custom-resources}/generator/gen2-file-generator.js +0 -0
- /package/lib/commands/gen2-migration/{codegen-custom-resources → generate/custom-resources}/parser/cdk-stack-parser.d.ts +0 -0
- /package/lib/commands/gen2-migration/{codegen-custom-resources → generate/custom-resources}/parser/cdk-stack-parser.js +0 -0
- /package/lib/commands/gen2-migration/{codegen-custom-resources → generate/custom-resources}/parser/pattern-detector.d.ts +0 -0
- /package/lib/commands/gen2-migration/{codegen-custom-resources → generate/custom-resources}/parser/pattern-detector.js +0 -0
- /package/lib/commands/gen2-migration/{codegen-custom-resources → generate/custom-resources}/scanner/custom-resource-scanner.d.ts +0 -0
- /package/lib/commands/gen2-migration/{codegen-custom-resources → generate/custom-resources}/scanner/custom-resource-scanner.js +0 -0
- /package/lib/commands/gen2-migration/{codegen-custom-resources → generate/custom-resources}/transformer/amplify-helper-transformer.d.ts +0 -0
- /package/lib/commands/gen2-migration/{codegen-custom-resources → generate/custom-resources}/types.d.ts +0 -0
- /package/lib/commands/gen2-migration/{codegen-custom-resources → generate/custom-resources}/types.js +0 -0
|
@@ -0,0 +1,462 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
"use strict";
|
|
3
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
4
|
+
if (k2 === undefined) k2 = k;
|
|
5
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
6
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
7
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
8
|
+
}
|
|
9
|
+
Object.defineProperty(o, k2, desc);
|
|
10
|
+
}) : (function(o, m, k, k2) {
|
|
11
|
+
if (k2 === undefined) k2 = k;
|
|
12
|
+
o[k2] = m[k];
|
|
13
|
+
}));
|
|
14
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
15
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
16
|
+
}) : function(o, v) {
|
|
17
|
+
o["default"] = v;
|
|
18
|
+
});
|
|
19
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
20
|
+
var ownKeys = function(o) {
|
|
21
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
22
|
+
var ar = [];
|
|
23
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
24
|
+
return ar;
|
|
25
|
+
};
|
|
26
|
+
return ownKeys(o);
|
|
27
|
+
};
|
|
28
|
+
return function (mod) {
|
|
29
|
+
if (mod && mod.__esModule) return mod;
|
|
30
|
+
var result = {};
|
|
31
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
32
|
+
__setModuleDefault(result, mod);
|
|
33
|
+
return result;
|
|
34
|
+
};
|
|
35
|
+
})();
|
|
36
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
37
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
38
|
+
};
|
|
39
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
40
|
+
exports.getAuthTriggersConnections = exports.GEN1_CONFIGURATION_FILES = void 0;
|
|
41
|
+
exports.updateAmplifyYmlFile = updateAmplifyYmlFile;
|
|
42
|
+
exports.updateGitIgnoreForGen2 = updateGitIgnoreForGen2;
|
|
43
|
+
exports.updateCustomResources = updateCustomResources;
|
|
44
|
+
exports.updateCdkStackFile = updateCdkStackFile;
|
|
45
|
+
exports.prepare = prepare;
|
|
46
|
+
const node_path_1 = __importDefault(require("node:path"));
|
|
47
|
+
const promises_1 = __importDefault(require("node:fs/promises"));
|
|
48
|
+
const node_assert_1 = __importDefault(require("node:assert"));
|
|
49
|
+
const uuid_1 = require("uuid");
|
|
50
|
+
const migration_pipeline_1 = require("../core/migration-pipeline");
|
|
51
|
+
const amplify_usageData_1 = require("../../../../domain/amplify-usageData");
|
|
52
|
+
const client_amplify_1 = require("@aws-sdk/client-amplify");
|
|
53
|
+
const client_cloudformation_1 = require("@aws-sdk/client-cloudformation");
|
|
54
|
+
const client_cognito_identity_provider_1 = require("@aws-sdk/client-cognito-identity-provider");
|
|
55
|
+
const client_cognito_identity_1 = require("@aws-sdk/client-cognito-identity");
|
|
56
|
+
const client_s3_1 = require("@aws-sdk/client-s3");
|
|
57
|
+
const client_lambda_1 = require("@aws-sdk/client-lambda");
|
|
58
|
+
const client_cloudwatch_events_1 = require("@aws-sdk/client-cloudwatch-events");
|
|
59
|
+
const client_sts_1 = require("@aws-sdk/client-sts");
|
|
60
|
+
const backend_downloader_1 = require("./backend_downloader");
|
|
61
|
+
const backend_environment_selector_1 = require("./backend_environment_selector");
|
|
62
|
+
const analytics_1 = require("./analytics");
|
|
63
|
+
const app_auth_definition_fetcher_1 = require("./app_auth_definition_fetcher");
|
|
64
|
+
const app_storage_definition_fetcher_1 = require("./app_storage_definition_fetcher");
|
|
65
|
+
const amplify_cli_core_1 = require("@aws-amplify/amplify-cli-core");
|
|
66
|
+
const data_definition_fetcher_1 = require("./data_definition_fetcher");
|
|
67
|
+
const amplify_stack_parser_1 = require("./amplify_stack_parser");
|
|
68
|
+
const app_functions_definition_fetcher_1 = require("./app_functions_definition_fetcher");
|
|
69
|
+
const ora_1 = __importDefault(require("ora"));
|
|
70
|
+
const app_analytics_definition_fetcher_1 = require("./app_analytics_definition_fetcher");
|
|
71
|
+
const ts = __importStar(require("typescript"));
|
|
72
|
+
const amplify_helper_transformer_1 = require("../custom-resources/transformer/amplify-helper-transformer");
|
|
73
|
+
const dependency_merger_1 = require("../custom-resources/generator/dependency-merger");
|
|
74
|
+
const file_converter_1 = require("../custom-resources/generator/file-converter");
|
|
75
|
+
const backend_updater_1 = require("../custom-resources/generator/backend-updater");
|
|
76
|
+
const execa_1 = __importDefault(require("execa"));
|
|
77
|
+
const TEMP_GEN_2_OUTPUT_DIR = 'amplify-gen2';
|
|
78
|
+
const AMPLIFY_DIR = 'amplify';
|
|
79
|
+
const GEN1_COMMAND = '- amplifyPush --simple';
|
|
80
|
+
const GEN2_INSTALL_COMMAND = '- npm ci --cache .npm --prefer-offline';
|
|
81
|
+
const GEN2_COMMAND = '- npx ampx pipeline-deploy --branch $AWS_BRANCH --app-id $AWS_APP_ID';
|
|
82
|
+
const GEN2_COMMAND_GENERATION_MESSAGE_SUFFIX = 'your Gen 2 backend code';
|
|
83
|
+
const GEN1_CUSTOM_RESOURCES_SUFFIX = 'your Gen 1 custom resources';
|
|
84
|
+
exports.GEN1_CONFIGURATION_FILES = ['aws-exports.js', 'amplifyconfiguration.json', 'awsconfiguration.json'];
|
|
85
|
+
const CUSTOM_DIR = 'custom';
|
|
86
|
+
const TYPES_DIR = 'types';
|
|
87
|
+
const BACKEND_DIR = 'backend';
|
|
88
|
+
const GEN2_COMMAND_REPLACE_STRING = `${GEN2_INSTALL_COMMAND}\n${' '.repeat(8)}${GEN2_COMMAND}`;
|
|
89
|
+
var GEN2_AMPLIFY_GITIGNORE_FILES_OR_DIRS;
|
|
90
|
+
(function (GEN2_AMPLIFY_GITIGNORE_FILES_OR_DIRS) {
|
|
91
|
+
GEN2_AMPLIFY_GITIGNORE_FILES_OR_DIRS["DOT_AMPLIFY"] = ".amplify";
|
|
92
|
+
GEN2_AMPLIFY_GITIGNORE_FILES_OR_DIRS["AMPLIFY_OUTPUTS"] = "amplify_outputs*";
|
|
93
|
+
GEN2_AMPLIFY_GITIGNORE_FILES_OR_DIRS["AMPLIFY_CONFIGURATION"] = "amplifyconfiguration*";
|
|
94
|
+
GEN2_AMPLIFY_GITIGNORE_FILES_OR_DIRS["NODE_MODULES"] = "node_modules";
|
|
95
|
+
GEN2_AMPLIFY_GITIGNORE_FILES_OR_DIRS["BUILD"] = "build";
|
|
96
|
+
GEN2_AMPLIFY_GITIGNORE_FILES_OR_DIRS["DIST"] = "dist";
|
|
97
|
+
})(GEN2_AMPLIFY_GITIGNORE_FILES_OR_DIRS || (GEN2_AMPLIFY_GITIGNORE_FILES_OR_DIRS = {}));
|
|
98
|
+
const generateGen2Code = async ({ outputDirectory, backendEnvironmentName, rootStackName, cloudFormationClient, authDefinitionFetcher, dataDefinitionFetcher, storageDefinitionFetcher, functionsDefinitionFetcher, analyticsDefinitionFetcher, ccbFetcher, backendEnvironment, logger, }) => {
|
|
99
|
+
logger.info('Fetching definitions from AWS for category: Auth');
|
|
100
|
+
const auth = await authDefinitionFetcher.getDefinition();
|
|
101
|
+
logger.info('Fetching definitions from AWS for category: Storage');
|
|
102
|
+
const storage = await storageDefinitionFetcher.getDefinition();
|
|
103
|
+
logger.info('Fetching definitions from AWS for category: Api');
|
|
104
|
+
const data = await dataDefinitionFetcher.getDefinition();
|
|
105
|
+
logger.info('Fetching definitions from AWS for category: Functions');
|
|
106
|
+
const functions = await functionsDefinitionFetcher.getDefinition();
|
|
107
|
+
logger.info('Fetching definitions from AWS for category: Analytics');
|
|
108
|
+
const analytics = await analyticsDefinitionFetcher.getDefinition();
|
|
109
|
+
logger.debug(`Auth: ${auth ? 'EXISTS' : 'UNDEFINED'}`);
|
|
110
|
+
logger.debug(`Storage: ${storage ? 'EXISTS' : 'UNDEFINED'}`);
|
|
111
|
+
logger.debug(`Data: ${data ? JSON.stringify(data, null, 2) : 'UNDEFINED'}`);
|
|
112
|
+
logger.debug(`Functions: ${functions ? `${functions.length} functions` : 'UNDEFINED'}`);
|
|
113
|
+
logger.debug(`Backend env: ${backendEnvironmentName}`);
|
|
114
|
+
logger.debug(`Analytics: ${analytics ? JSON.stringify(analytics, null, 2) : 'UNDEFINED'}`);
|
|
115
|
+
const gen2RenderOptions = {
|
|
116
|
+
outputDir: outputDirectory,
|
|
117
|
+
backendEnvironmentName: backendEnvironmentName,
|
|
118
|
+
rootStackName: rootStackName,
|
|
119
|
+
cfnClient: cloudFormationClient,
|
|
120
|
+
auth,
|
|
121
|
+
storage,
|
|
122
|
+
data,
|
|
123
|
+
functions,
|
|
124
|
+
analytics,
|
|
125
|
+
customResources: await getCustomResourceMap(ccbFetcher, backendEnvironment),
|
|
126
|
+
unsupportedCategories: await unsupportedCategories(ccbFetcher, backendEnvironment),
|
|
127
|
+
};
|
|
128
|
+
(0, node_assert_1.default)(gen2RenderOptions);
|
|
129
|
+
const pipeline = (0, migration_pipeline_1.createGen2Renderer)(gen2RenderOptions);
|
|
130
|
+
(0, node_assert_1.default)(backendEnvironmentName);
|
|
131
|
+
logger.info(`Generating ${GEN2_COMMAND_GENERATION_MESSAGE_SUFFIX}`);
|
|
132
|
+
await pipeline.render();
|
|
133
|
+
};
|
|
134
|
+
const getFunctionPath = (functionName) => {
|
|
135
|
+
return node_path_1.default.join(AMPLIFY_DIR, BACKEND_DIR, 'function', functionName, 'src');
|
|
136
|
+
};
|
|
137
|
+
const getUsageDataMetric = async (envName) => {
|
|
138
|
+
const usageData = amplify_usageData_1.UsageData.Instance;
|
|
139
|
+
const accountId = await getAccountId();
|
|
140
|
+
(0, node_assert_1.default)(accountId);
|
|
141
|
+
usageData.init((0, uuid_1.v4)(), '', {
|
|
142
|
+
command: 'to-gen-2',
|
|
143
|
+
argv: process.argv,
|
|
144
|
+
}, accountId, {
|
|
145
|
+
envName,
|
|
146
|
+
}, Date.now());
|
|
147
|
+
return usageData;
|
|
148
|
+
};
|
|
149
|
+
const getAccountId = async () => {
|
|
150
|
+
const stsClient = new client_sts_1.STSClient();
|
|
151
|
+
const callerIdentityResult = await stsClient.send(new client_sts_1.GetCallerIdentityCommand());
|
|
152
|
+
return callerIdentityResult.Account;
|
|
153
|
+
};
|
|
154
|
+
const getAuthTriggersConnections = async (ccbFetcher, backendEnvironment) => {
|
|
155
|
+
var _a;
|
|
156
|
+
const currentCloudBackendDirectory = await ccbFetcher.getCurrentCloudBackend(backendEnvironment.deploymentArtifacts);
|
|
157
|
+
const amplifyMetaPath = node_path_1.default.join(currentCloudBackendDirectory, 'amplify-meta.json');
|
|
158
|
+
const amplifyMeta = amplify_cli_core_1.JSONUtilities.readJson(amplifyMetaPath, { throwIfNotExist: true });
|
|
159
|
+
if (!amplifyMeta.auth) {
|
|
160
|
+
return {};
|
|
161
|
+
}
|
|
162
|
+
const resourceName = (_a = Object.entries(amplifyMeta.auth).find(([, resource]) => resource.service === 'Cognito')) === null || _a === void 0 ? void 0 : _a[0];
|
|
163
|
+
(0, node_assert_1.default)(resourceName);
|
|
164
|
+
const authInputs = amplify_cli_core_1.stateManager.getResourceInputsJson(undefined, amplify_cli_core_1.AmplifyCategories.AUTH, resourceName);
|
|
165
|
+
if (authInputs && typeof authInputs === 'object' && 'cognitoConfig' in authInputs && typeof authInputs.cognitoConfig === 'object') {
|
|
166
|
+
let triggerConnections = [];
|
|
167
|
+
if ('authTriggerConnections' in authInputs.cognitoConfig) {
|
|
168
|
+
try {
|
|
169
|
+
if (typeof authInputs.cognitoConfig.authTriggerConnections === 'string') {
|
|
170
|
+
triggerConnections = JSON.parse(authInputs.cognitoConfig.authTriggerConnections);
|
|
171
|
+
}
|
|
172
|
+
else {
|
|
173
|
+
triggerConnections = authInputs.cognitoConfig.authTriggerConnections.map((connection) => JSON.parse(connection));
|
|
174
|
+
}
|
|
175
|
+
return triggerConnections.reduce((prev, curr) => {
|
|
176
|
+
prev[curr.triggerType] = getFunctionPath(curr.lambdaFunctionName);
|
|
177
|
+
return prev;
|
|
178
|
+
}, {});
|
|
179
|
+
}
|
|
180
|
+
catch (e) {
|
|
181
|
+
throw new Error('Error parsing auth trigger connections');
|
|
182
|
+
}
|
|
183
|
+
}
|
|
184
|
+
else if ('triggers' in authInputs.cognitoConfig && typeof authInputs.cognitoConfig.triggers === 'object') {
|
|
185
|
+
const authTriggers = authInputs.cognitoConfig.triggers;
|
|
186
|
+
return Object.keys(authTriggers).reduce((prev, authTrigger) => {
|
|
187
|
+
const triggerResourceName = `${resourceName}${authTrigger}`;
|
|
188
|
+
prev[authTrigger] = getFunctionPath(triggerResourceName);
|
|
189
|
+
return prev;
|
|
190
|
+
}, {});
|
|
191
|
+
}
|
|
192
|
+
}
|
|
193
|
+
return {};
|
|
194
|
+
};
|
|
195
|
+
exports.getAuthTriggersConnections = getAuthTriggersConnections;
|
|
196
|
+
const unsupportedCategories = async (ccbFetcher, backendEnvironment) => {
|
|
197
|
+
const unsupportedCategories = new Map();
|
|
198
|
+
const urlPrefix = 'https://docs.amplify.aws/react/build-a-backend/add-aws-services';
|
|
199
|
+
const restAPIKey = 'rest api';
|
|
200
|
+
const analyticsKey = 'analytics';
|
|
201
|
+
unsupportedCategories.set('geo', `${urlPrefix}/geo/`);
|
|
202
|
+
unsupportedCategories.set('analytics', `${urlPrefix}/analytics/`);
|
|
203
|
+
unsupportedCategories.set('predictions', `${urlPrefix}/predictions/`);
|
|
204
|
+
unsupportedCategories.set('notifications', `${urlPrefix}/in-app-messaging/`);
|
|
205
|
+
unsupportedCategories.set('interactions', `${urlPrefix}/interactions/`);
|
|
206
|
+
unsupportedCategories.set(restAPIKey, `${urlPrefix}/rest-api/`);
|
|
207
|
+
const currentCloudBackendDirectory = await ccbFetcher.getCurrentCloudBackend(backendEnvironment.deploymentArtifacts);
|
|
208
|
+
const amplifyMetaPath = node_path_1.default.join(currentCloudBackendDirectory, 'amplify-meta.json');
|
|
209
|
+
const meta = amplify_cli_core_1.JSONUtilities.readJson(amplifyMetaPath, { throwIfNotExist: true });
|
|
210
|
+
const categories = Object.keys(meta);
|
|
211
|
+
const unsupportedCategoriesList = new Map();
|
|
212
|
+
categories.forEach((category) => {
|
|
213
|
+
var _a;
|
|
214
|
+
if (category === 'analytics') {
|
|
215
|
+
const analytics = (_a = meta === null || meta === void 0 ? void 0 : meta.analytics) !== null && _a !== void 0 ? _a : {};
|
|
216
|
+
Object.keys(analytics).forEach((analytic) => {
|
|
217
|
+
const analyticObj = analytics[analytic];
|
|
218
|
+
if (analyticObj.service === 'Pinpoint') {
|
|
219
|
+
const analyticsDocLink = unsupportedCategories.get(analyticsKey);
|
|
220
|
+
(0, node_assert_1.default)(analyticsDocLink);
|
|
221
|
+
unsupportedCategoriesList.set(`Pinpoint ${analyticsKey}`, analyticsDocLink);
|
|
222
|
+
}
|
|
223
|
+
});
|
|
224
|
+
}
|
|
225
|
+
else {
|
|
226
|
+
if (unsupportedCategories.has(category) && Object.entries(meta[category]).length > 0) {
|
|
227
|
+
const unsupportedCategoryDocLink = unsupportedCategories.get(category);
|
|
228
|
+
(0, node_assert_1.default)(unsupportedCategoryDocLink);
|
|
229
|
+
unsupportedCategoriesList.set(category, unsupportedCategoryDocLink);
|
|
230
|
+
}
|
|
231
|
+
}
|
|
232
|
+
});
|
|
233
|
+
return unsupportedCategoriesList;
|
|
234
|
+
};
|
|
235
|
+
async function updateAmplifyYmlFile(amplifyClient, appId) {
|
|
236
|
+
const rootDir = amplify_cli_core_1.pathManager.findProjectRoot();
|
|
237
|
+
(0, node_assert_1.default)(rootDir);
|
|
238
|
+
const amplifyYmlPath = node_path_1.default.join(rootDir, 'amplify.yml');
|
|
239
|
+
try {
|
|
240
|
+
const amplifyYmlContent = await promises_1.default.readFile(amplifyYmlPath, 'utf-8');
|
|
241
|
+
await writeToAmplifyYmlFile(amplifyYmlPath, amplifyYmlContent);
|
|
242
|
+
}
|
|
243
|
+
catch (error) {
|
|
244
|
+
if (error.code === 'ENOENT') {
|
|
245
|
+
const getAppResponse = await amplifyClient.send(new client_amplify_1.GetAppCommand({ appId }));
|
|
246
|
+
(0, node_assert_1.default)(getAppResponse.app, 'App not found');
|
|
247
|
+
const buildSpec = getAppResponse.app.buildSpec;
|
|
248
|
+
if (buildSpec) {
|
|
249
|
+
await writeToAmplifyYmlFile(amplifyYmlPath, buildSpec);
|
|
250
|
+
}
|
|
251
|
+
}
|
|
252
|
+
else {
|
|
253
|
+
throw error;
|
|
254
|
+
}
|
|
255
|
+
}
|
|
256
|
+
}
|
|
257
|
+
async function writeToAmplifyYmlFile(amplifyYmlPath, content) {
|
|
258
|
+
content = content.replace(new RegExp(GEN1_COMMAND, 'g'), GEN2_COMMAND_REPLACE_STRING);
|
|
259
|
+
await promises_1.default.writeFile(amplifyYmlPath, content, { encoding: 'utf-8' });
|
|
260
|
+
}
|
|
261
|
+
async function updateGitIgnoreForGen2() {
|
|
262
|
+
const cwd = process.cwd();
|
|
263
|
+
let gitIgnore = '';
|
|
264
|
+
try {
|
|
265
|
+
gitIgnore = await promises_1.default.readFile(`${cwd}/.gitignore`, { encoding: 'utf-8' });
|
|
266
|
+
}
|
|
267
|
+
catch (e) {
|
|
268
|
+
}
|
|
269
|
+
const regex = /#amplify-do-not-edit-begin[\s\S]*#amplify-do-not-edit-end/g;
|
|
270
|
+
let newGitIgnore = gitIgnore.replace(regex, '');
|
|
271
|
+
if (!newGitIgnore.includes(GEN2_AMPLIFY_GITIGNORE_FILES_OR_DIRS.DOT_AMPLIFY)) {
|
|
272
|
+
newGitIgnore = `${newGitIgnore}\n# amplify\n${GEN2_AMPLIFY_GITIGNORE_FILES_OR_DIRS.DOT_AMPLIFY}`;
|
|
273
|
+
}
|
|
274
|
+
if (!newGitIgnore.includes(GEN2_AMPLIFY_GITIGNORE_FILES_OR_DIRS.AMPLIFY_OUTPUTS)) {
|
|
275
|
+
newGitIgnore = `${newGitIgnore}\n${GEN2_AMPLIFY_GITIGNORE_FILES_OR_DIRS.AMPLIFY_OUTPUTS}`;
|
|
276
|
+
}
|
|
277
|
+
if (!newGitIgnore.includes(GEN2_AMPLIFY_GITIGNORE_FILES_OR_DIRS.AMPLIFY_CONFIGURATION)) {
|
|
278
|
+
newGitIgnore = `${newGitIgnore}\n${GEN2_AMPLIFY_GITIGNORE_FILES_OR_DIRS.AMPLIFY_CONFIGURATION}`;
|
|
279
|
+
}
|
|
280
|
+
if (!newGitIgnore.includes(GEN2_AMPLIFY_GITIGNORE_FILES_OR_DIRS.NODE_MODULES)) {
|
|
281
|
+
newGitIgnore = `${newGitIgnore}\n# node_modules\n${GEN2_AMPLIFY_GITIGNORE_FILES_OR_DIRS.NODE_MODULES}`;
|
|
282
|
+
}
|
|
283
|
+
if (!newGitIgnore.includes(GEN2_AMPLIFY_GITIGNORE_FILES_OR_DIRS.BUILD)) {
|
|
284
|
+
newGitIgnore = `${newGitIgnore}\n${GEN2_AMPLIFY_GITIGNORE_FILES_OR_DIRS.BUILD}`;
|
|
285
|
+
}
|
|
286
|
+
if (!newGitIgnore.includes(GEN2_AMPLIFY_GITIGNORE_FILES_OR_DIRS.DIST)) {
|
|
287
|
+
newGitIgnore = `${newGitIgnore}\n${GEN2_AMPLIFY_GITIGNORE_FILES_OR_DIRS.DIST}`;
|
|
288
|
+
}
|
|
289
|
+
newGitIgnore = newGitIgnore.replace(/^\s*[\r\n]/gm, '');
|
|
290
|
+
await promises_1.default.writeFile(`${cwd}/.gitignore`, newGitIgnore, { encoding: 'utf-8' });
|
|
291
|
+
}
|
|
292
|
+
const getCustomResources = async (ccbFetcher, backendEnvironment) => {
|
|
293
|
+
const currentCloudBackendDirectory = await ccbFetcher.getCurrentCloudBackend(backendEnvironment.deploymentArtifacts);
|
|
294
|
+
const amplifyMetaPath = node_path_1.default.join(currentCloudBackendDirectory, 'amplify-meta.json');
|
|
295
|
+
const meta = amplify_cli_core_1.JSONUtilities.readJson(amplifyMetaPath, { throwIfNotExist: true });
|
|
296
|
+
const customCategory = meta === null || meta === void 0 ? void 0 : meta.custom;
|
|
297
|
+
return customCategory ? Object.keys(customCategory) : [];
|
|
298
|
+
};
|
|
299
|
+
const getCustomResourceMap = async (ccbFetcher, backendEnvironment) => {
|
|
300
|
+
var _a;
|
|
301
|
+
const customResources = await getCustomResources(ccbFetcher, backendEnvironment);
|
|
302
|
+
const customResourceMap = new Map();
|
|
303
|
+
const rootDir = amplify_cli_core_1.pathManager.findProjectRoot();
|
|
304
|
+
(0, node_assert_1.default)(rootDir);
|
|
305
|
+
const amplifyGen1BackendDir = node_path_1.default.join(rootDir, AMPLIFY_DIR, BACKEND_DIR);
|
|
306
|
+
const sourceCustomResourcePath = node_path_1.default.join(amplifyGen1BackendDir, CUSTOM_DIR);
|
|
307
|
+
for (const resource of customResources) {
|
|
308
|
+
const cdkStackFilePath = node_path_1.default.join(sourceCustomResourcePath, resource, 'cdk-stack.ts');
|
|
309
|
+
const cdkStackContent = await promises_1.default.readFile(cdkStackFilePath, { encoding: 'utf-8' });
|
|
310
|
+
const className = (_a = cdkStackContent.match(/export class (\w+)/)) === null || _a === void 0 ? void 0 : _a[1];
|
|
311
|
+
if (className) {
|
|
312
|
+
customResourceMap.set(resource, className);
|
|
313
|
+
}
|
|
314
|
+
}
|
|
315
|
+
return customResourceMap;
|
|
316
|
+
};
|
|
317
|
+
async function updateCustomResources(ccbFetcher, backendEnvironment) {
|
|
318
|
+
const customResources = await getCustomResources(ccbFetcher, backendEnvironment);
|
|
319
|
+
if (customResources.length > 0) {
|
|
320
|
+
const movingGen1CustomResources = (0, ora_1.default)(`Moving ${GEN1_CUSTOM_RESOURCES_SUFFIX}`).start();
|
|
321
|
+
const rootDir = amplify_cli_core_1.pathManager.findProjectRoot();
|
|
322
|
+
(0, node_assert_1.default)(rootDir);
|
|
323
|
+
const amplifyGen1BackendDir = node_path_1.default.join(rootDir, AMPLIFY_DIR, BACKEND_DIR);
|
|
324
|
+
const amplifyGen2Dir = node_path_1.default.join(TEMP_GEN_2_OUTPUT_DIR, AMPLIFY_DIR);
|
|
325
|
+
const sourceCustomResourcePath = node_path_1.default.join(amplifyGen1BackendDir, CUSTOM_DIR);
|
|
326
|
+
const destinationCustomResourcePath = node_path_1.default.join(amplifyGen2Dir, CUSTOM_DIR);
|
|
327
|
+
const filterFiles = ['package.json', 'yarn.lock'];
|
|
328
|
+
await promises_1.default.mkdir(destinationCustomResourcePath, { recursive: true });
|
|
329
|
+
await promises_1.default.cp(sourceCustomResourcePath, destinationCustomResourcePath, {
|
|
330
|
+
recursive: true,
|
|
331
|
+
filter: (src) => {
|
|
332
|
+
const fileName = node_path_1.default.basename(src);
|
|
333
|
+
return !filterFiles.includes(fileName);
|
|
334
|
+
},
|
|
335
|
+
});
|
|
336
|
+
const sourceTypesPath = node_path_1.default.join(amplifyGen1BackendDir, TYPES_DIR);
|
|
337
|
+
const destinationTypesPath = node_path_1.default.join(amplifyGen2Dir, TYPES_DIR);
|
|
338
|
+
await promises_1.default.mkdir(destinationTypesPath, { recursive: true });
|
|
339
|
+
await promises_1.default.cp(sourceTypesPath, destinationTypesPath, { recursive: true });
|
|
340
|
+
await updateCdkStackFile(customResources, destinationCustomResourcePath, rootDir);
|
|
341
|
+
const gen2PackageJsonPath = node_path_1.default.join(amplifyGen2Dir, '..', 'package.json');
|
|
342
|
+
const dependencyMerger = new dependency_merger_1.DependencyMerger();
|
|
343
|
+
await dependencyMerger.mergeDependencies(sourceCustomResourcePath, gen2PackageJsonPath);
|
|
344
|
+
const fileConverter = new file_converter_1.FileConverter();
|
|
345
|
+
await fileConverter.convertCdkStackToResource(destinationCustomResourcePath);
|
|
346
|
+
await fileConverter.removeBuildArtifacts(destinationCustomResourcePath);
|
|
347
|
+
const backendFilePath = node_path_1.default.join(amplifyGen2Dir, 'backend.ts');
|
|
348
|
+
const customResourceMap = await getCustomResourceMap(ccbFetcher, backendEnvironment);
|
|
349
|
+
const backendUpdater = new backend_updater_1.BackendUpdater();
|
|
350
|
+
await backendUpdater.updateBackendFile(backendFilePath, customResourceMap);
|
|
351
|
+
movingGen1CustomResources.succeed(`Moved ${GEN1_CUSTOM_RESOURCES_SUFFIX}`);
|
|
352
|
+
}
|
|
353
|
+
}
|
|
354
|
+
async function updateCdkStackFile(customResources, destinationCustomResourcePath, rootDir) {
|
|
355
|
+
let projectName;
|
|
356
|
+
try {
|
|
357
|
+
const projectConfigPath = node_path_1.default.join(rootDir, AMPLIFY_DIR, '.config', 'project-config.json');
|
|
358
|
+
const projectConfig = JSON.parse(await promises_1.default.readFile(projectConfigPath, { encoding: 'utf-8' }));
|
|
359
|
+
projectName = projectConfig.projectName;
|
|
360
|
+
}
|
|
361
|
+
catch (e) {
|
|
362
|
+
}
|
|
363
|
+
for (const resource of customResources) {
|
|
364
|
+
const cdkStackFilePath = node_path_1.default.join(destinationCustomResourcePath, resource, 'cdk-stack.ts');
|
|
365
|
+
try {
|
|
366
|
+
let cdkStackContent = await promises_1.default.readFile(cdkStackFilePath, { encoding: 'utf-8' });
|
|
367
|
+
if (hasUncommentedDependency(cdkStackContent, 'AmplifyHelpers.addResourceDependency')) {
|
|
368
|
+
cdkStackContent = cdkStackContent.replace(/export class/, `throw new Error('Follow https://docs.amplify.aws/react/start/migrate-to-gen2/ to update the resource dependency');\n\nexport class`);
|
|
369
|
+
}
|
|
370
|
+
if (!cdkStackContent.includes("from 'constructs'")) {
|
|
371
|
+
const importRegex = /(import.*from.*['"]; ?\s*\n)/g;
|
|
372
|
+
let lastImportMatch;
|
|
373
|
+
let match;
|
|
374
|
+
while ((match = importRegex.exec(cdkStackContent)) !== null) {
|
|
375
|
+
lastImportMatch = match;
|
|
376
|
+
}
|
|
377
|
+
if (lastImportMatch) {
|
|
378
|
+
const insertIndex = lastImportMatch.index + lastImportMatch[0].length;
|
|
379
|
+
cdkStackContent =
|
|
380
|
+
cdkStackContent.slice(0, insertIndex) + "import { Construct } from 'constructs';\n" + cdkStackContent.slice(insertIndex);
|
|
381
|
+
}
|
|
382
|
+
else {
|
|
383
|
+
cdkStackContent = "import { Construct } from 'constructs';\n" + cdkStackContent;
|
|
384
|
+
}
|
|
385
|
+
}
|
|
386
|
+
cdkStackContent = cdkStackContent.replace(/new cdk\.CfnParameter\(this, ['"]env['"], {[\s\S]*?}\);/, `new cdk.CfnParameter(this, "env", {
|
|
387
|
+
type: "String",
|
|
388
|
+
description: "Current Amplify CLI env name",
|
|
389
|
+
default: \`\${branchName}\`
|
|
390
|
+
});`);
|
|
391
|
+
const sourceFile = ts.createSourceFile(cdkStackFilePath, cdkStackContent, ts.ScriptTarget.Latest, true);
|
|
392
|
+
const transformedFile = amplify_helper_transformer_1.AmplifyHelperTransformer.transform(sourceFile, projectName);
|
|
393
|
+
const transformedWithBranchName = amplify_helper_transformer_1.AmplifyHelperTransformer.addBranchNameVariable(transformedFile, projectName);
|
|
394
|
+
const printer = ts.createPrinter({ newLine: ts.NewLineKind.LineFeed });
|
|
395
|
+
cdkStackContent = printer.printFile(transformedWithBranchName);
|
|
396
|
+
await promises_1.default.writeFile(cdkStackFilePath, cdkStackContent, { encoding: 'utf-8' });
|
|
397
|
+
}
|
|
398
|
+
catch (error) {
|
|
399
|
+
throw new Error(`Error updating the custom resource ${resource}`, { cause: error });
|
|
400
|
+
}
|
|
401
|
+
}
|
|
402
|
+
}
|
|
403
|
+
const hasUncommentedDependency = (fileContent, matchString) => {
|
|
404
|
+
const lines = fileContent.split('\n');
|
|
405
|
+
for (const line of lines) {
|
|
406
|
+
const trimmedLine = line.trim();
|
|
407
|
+
if (trimmedLine.includes(matchString) &&
|
|
408
|
+
!trimmedLine.startsWith('//') &&
|
|
409
|
+
!trimmedLine.startsWith('/*') &&
|
|
410
|
+
!trimmedLine.includes('*/') &&
|
|
411
|
+
!trimmedLine.match(/^\s*\*/)) {
|
|
412
|
+
return true;
|
|
413
|
+
}
|
|
414
|
+
}
|
|
415
|
+
return false;
|
|
416
|
+
};
|
|
417
|
+
async function prepare(logger, appId, envName, region) {
|
|
418
|
+
const amplifyClient = new client_amplify_1.AmplifyClient();
|
|
419
|
+
const backendEnvironmentResolver = new backend_environment_selector_1.BackendEnvironmentResolver(appId, envName, amplifyClient);
|
|
420
|
+
const backendEnvironment = await backendEnvironmentResolver.selectBackendEnvironment();
|
|
421
|
+
(0, node_assert_1.default)(backendEnvironment);
|
|
422
|
+
(0, node_assert_1.default)(backendEnvironmentResolver);
|
|
423
|
+
(0, node_assert_1.default)(backendEnvironment.environmentName);
|
|
424
|
+
const s3Client = new client_s3_1.S3Client();
|
|
425
|
+
const cloudFormationClient = new client_cloudformation_1.CloudFormationClient();
|
|
426
|
+
const cognitoIdentityProviderClient = new client_cognito_identity_provider_1.CognitoIdentityProviderClient();
|
|
427
|
+
const cognitoIdentityPoolClient = new client_cognito_identity_1.CognitoIdentityClient();
|
|
428
|
+
const lambdaClient = new client_lambda_1.LambdaClient({ region });
|
|
429
|
+
const cloudWatchEventsClient = new client_cloudwatch_events_1.CloudWatchEventsClient();
|
|
430
|
+
const amplifyStackParser = new amplify_stack_parser_1.AmplifyStackParser(cloudFormationClient);
|
|
431
|
+
const ccbFetcher = new backend_downloader_1.BackendDownloader(s3Client);
|
|
432
|
+
await generateGen2Code({
|
|
433
|
+
outputDirectory: TEMP_GEN_2_OUTPUT_DIR,
|
|
434
|
+
storageDefinitionFetcher: new app_storage_definition_fetcher_1.AppStorageDefinitionFetcher(backendEnvironmentResolver, new backend_downloader_1.BackendDownloader(s3Client), s3Client),
|
|
435
|
+
authDefinitionFetcher: new app_auth_definition_fetcher_1.AppAuthDefinitionFetcher(cognitoIdentityPoolClient, cognitoIdentityProviderClient, amplifyStackParser, backendEnvironmentResolver, () => (0, exports.getAuthTriggersConnections)(ccbFetcher, backendEnvironment), ccbFetcher),
|
|
436
|
+
dataDefinitionFetcher: new data_definition_fetcher_1.DataDefinitionFetcher(backendEnvironmentResolver, new backend_downloader_1.BackendDownloader(s3Client)),
|
|
437
|
+
functionsDefinitionFetcher: new app_functions_definition_fetcher_1.AppFunctionsDefinitionFetcher(lambdaClient, cloudWatchEventsClient, backendEnvironmentResolver, amplify_cli_core_1.stateManager, ccbFetcher),
|
|
438
|
+
analyticsDefinitionFetcher: new app_analytics_definition_fetcher_1.AppAnalyticsDefinitionFetcher(backendEnvironmentResolver, amplify_cli_core_1.stateManager),
|
|
439
|
+
analytics: new analytics_1.AppAnalytics(appId),
|
|
440
|
+
logger: logger,
|
|
441
|
+
ccbFetcher,
|
|
442
|
+
backendEnvironment,
|
|
443
|
+
backendEnvironmentName: backendEnvironment.environmentName,
|
|
444
|
+
rootStackName: backendEnvironment.stackName,
|
|
445
|
+
cloudFormationClient: cloudFormationClient,
|
|
446
|
+
});
|
|
447
|
+
logger.info(`Creating 'amplify.yml' file for amplify hosting deployments`);
|
|
448
|
+
await updateAmplifyYmlFile(amplifyClient, appId);
|
|
449
|
+
logger.info('Updating .gitignore');
|
|
450
|
+
await updateGitIgnoreForGen2();
|
|
451
|
+
await updateCustomResources(ccbFetcher, backendEnvironment);
|
|
452
|
+
const cwd = process.cwd();
|
|
453
|
+
logger.info(`Overriding local 'amplify' folder`);
|
|
454
|
+
await promises_1.default.rm(AMPLIFY_DIR, { recursive: true });
|
|
455
|
+
await promises_1.default.rename(`${TEMP_GEN_2_OUTPUT_DIR}/amplify`, `${cwd}/amplify`);
|
|
456
|
+
await promises_1.default.rename(`${TEMP_GEN_2_OUTPUT_DIR}/package.json`, `${cwd}/package.json`);
|
|
457
|
+
await promises_1.default.rm(TEMP_GEN_2_OUTPUT_DIR, { recursive: true });
|
|
458
|
+
logger.info('Installing dependencies');
|
|
459
|
+
await (0, execa_1.default)('npm', ['install']);
|
|
460
|
+
await (0, execa_1.default)('npm', ['install']);
|
|
461
|
+
}
|
|
462
|
+
//# sourceMappingURL=command-handlers.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"command-handlers.js","sourceRoot":"","sources":["../../../../../src/commands/gen2-migration/generate/codegen-head/command-handlers.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAuRA,oDA0BC;AASD,wDAkCC;AAsCD,sDAgDC;AAED,gDAmEC;AAwBD,0BAkEC;AAhlBD,0DAA6B;AAC7B,gEAAkC;AAClC,8DAAiC;AACjC,+BAAkC;AAElC,mEAAsF;AAEtF,4EAAiE;AACjE,4DAA6G;AAC7G,0EAAsE;AACtE,gGAA4G;AAC5G,8EAAyE;AACzE,kDAA8C;AAC9C,0DAAsD;AACtD,gFAA2E;AAE3E,oDAA0E;AAC1E,6DAAyD;AAEzD,iFAA4E;AAC5E,2CAAsD;AACtD,+EAAyE;AACzE,qFAA+E;AAC/E,oEAAiI;AAEjI,uEAAkE;AAClE,iEAA4D;AAC5D,yFAAmF;AAInF,8CAAsB;AACtB,yFAAmF;AACnF,+CAAiC;AACjC,2GAAsG;AACtG,uFAAmF;AACnF,iFAA6E;AAC7E,mFAA+E;AAC/E,kDAA0B;AAmB1B,MAAM,qBAAqB,GAAG,cAAc,CAAC;AAC7C,MAAM,WAAW,GAAG,SAAS,CAAC;AAC9B,MAAM,YAAY,GAAG,wBAAwB,CAAC;AAC9C,MAAM,oBAAoB,GAAG,wCAAwC,CAAC;AACtE,MAAM,YAAY,GAAG,sEAAsE,CAAC;AAC5F,MAAM,sCAAsC,GAAG,yBAAyB,CAAC;AACzE,MAAM,4BAA4B,GAAG,6BAA6B,CAAC;AACtD,QAAA,wBAAwB,GAAG,CAAC,gBAAgB,EAAE,2BAA2B,EAAE,uBAAuB,CAAC,CAAC;AACjH,MAAM,UAAU,GAAG,QAAQ,CAAC;AAC5B,M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IACjD,MAAM,kBAAE,CAAC,EAAE,CAAC,WAAW,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;IAC9C,MAAM,kBAAE,CAAC,MAAM,CAAC,GAAG,qBAAqB,UAAU,EAAE,GAAG,GAAG,UAAU,CAAC,CAAC;IACtE,MAAM,kBAAE,CAAC,MAAM,CAAC,GAAG,qBAAqB,eAAe,EAAE,GAAG,GAAG,eAAe,CAAC,CAAC;IAChF,MAAM,kBAAE,CAAC,EAAE,CAAC,qBAAqB,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;IAExD,MAAM,CAAC,IAAI,CAAC,yBAAyB,CAAC,CAAC;IAGvC,MAAM,IAAA,eAAK,EAAC,KAAK,EAAE,CAAC,SAAS,CAAC,CAAC,CAAC;IAChC,MAAM,IAAA,eAAK,EAAC,KAAK,EAAE,CAAC,SAAS,CAAC,CAAC,CAAC;AAClC,CAAC"}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { DataDefinition } from '../core/migration-pipeline';
|
|
2
|
+
interface Gen1ApiObject {
|
|
3
|
+
service: string;
|
|
4
|
+
dependsOn?: Array<{
|
|
5
|
+
category: string;
|
|
6
|
+
resourceName: string;
|
|
7
|
+
}>;
|
|
8
|
+
}
|
|
9
|
+
export interface RestApiDefinition {
|
|
10
|
+
apiName: string;
|
|
11
|
+
functionName: string;
|
|
12
|
+
paths: RestApiPath[];
|
|
13
|
+
authType?: string;
|
|
14
|
+
corsConfiguration?: CorsConfiguration;
|
|
15
|
+
uniqueFunctions?: string[];
|
|
16
|
+
}
|
|
17
|
+
export interface RestApiPath {
|
|
18
|
+
path: string;
|
|
19
|
+
methods: string[];
|
|
20
|
+
authType?: string;
|
|
21
|
+
lambdaFunction?: string;
|
|
22
|
+
userPoolGroups?: string[];
|
|
23
|
+
}
|
|
24
|
+
export interface CorsConfiguration {
|
|
25
|
+
allowCredentials?: boolean;
|
|
26
|
+
allowHeaders?: string[];
|
|
27
|
+
allowMethods?: string[];
|
|
28
|
+
allowOrigins?: string[];
|
|
29
|
+
exposeHeaders?: string[];
|
|
30
|
+
maxAge?: number;
|
|
31
|
+
}
|
|
32
|
+
import { BackendEnvironmentResolver } from './backend_environment_selector';
|
|
33
|
+
import { BackendDownloader } from './backend_downloader';
|
|
34
|
+
export declare class DataDefinitionFetcher {
|
|
35
|
+
private backendEnvironmentResolver;
|
|
36
|
+
private ccbFetcher;
|
|
37
|
+
constructor(backendEnvironmentResolver: BackendEnvironmentResolver, ccbFetcher: BackendDownloader);
|
|
38
|
+
private readJsonFile;
|
|
39
|
+
getRestApis: (apis: Record<string, Gen1ApiObject>) => Promise<RestApiDefinition[]>;
|
|
40
|
+
private extractMethodsFromPath;
|
|
41
|
+
getSchema: (apis: any) => Promise<string>;
|
|
42
|
+
private getAdditionalAuthProvidersFromConsole;
|
|
43
|
+
private getLoggingConfigFromConsole;
|
|
44
|
+
getDefinition: () => Promise<DataDefinition | undefined>;
|
|
45
|
+
}
|
|
46
|
+
export {};
|
|
47
|
+
//# sourceMappingURL=data_definition_fetcher.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"data_definition_fetcher.d.ts","sourceRoot":"","sources":["../../../../../src/commands/gen2-migration/generate/codegen-head/data_definition_fetcher.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AA0B5D,UAAU,aAAa;IACrB,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,CAAC,EAAE,KAAK,CAAC;QAChB,QAAQ,EAAE,MAAM,CAAC;QACjB,YAAY,EAAE,MAAM,CAAC;KACtB,CAAC,CAAC;CACJ;AAGD,MAAM,WAAW,iBAAiB;IAChC,OAAO,EAAE,MAAM,CAAC;IAChB,YAAY,EAAE,MAAM,CAAC;IACrB,KAAK,EAAE,WAAW,EAAE,CAAC;IACrB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,iBAAiB,CAAC,EAAE,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