@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,46 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.getFunctionDefinition = void 0;
|
|
7
|
+
const node_assert_1 = __importDefault(require("node:assert"));
|
|
8
|
+
const extractFilePathFromHandler = (handler) => {
|
|
9
|
+
const lastDotIndex = handler.lastIndexOf('.');
|
|
10
|
+
if (lastDotIndex === -1) {
|
|
11
|
+
return `./${handler}.js`;
|
|
12
|
+
}
|
|
13
|
+
const filePath = handler.substring(0, lastDotIndex);
|
|
14
|
+
return `./${filePath}.js`;
|
|
15
|
+
};
|
|
16
|
+
const getFunctionDefinition = (functionConfigurations, functionSchedules, functionCategoryMap, meta) => {
|
|
17
|
+
var _a, _b, _c, _d, _e, _f;
|
|
18
|
+
const funcDefList = [];
|
|
19
|
+
for (const configuration of functionConfigurations) {
|
|
20
|
+
const funcDef = {};
|
|
21
|
+
funcDef.entry = extractFilePathFromHandler((_a = configuration === null || configuration === void 0 ? void 0 : configuration.Handler) !== null && _a !== void 0 ? _a : 'index.js');
|
|
22
|
+
funcDef.name = configuration === null || configuration === void 0 ? void 0 : configuration.FunctionName;
|
|
23
|
+
funcDef.timeoutSeconds = configuration === null || configuration === void 0 ? void 0 : configuration.Timeout;
|
|
24
|
+
funcDef.memoryMB = configuration === null || configuration === void 0 ? void 0 : configuration.MemorySize;
|
|
25
|
+
for (const envSuffix of ['GRAPHQLAPIKEYOUTPUT', 'GRAPHQLAPIENDPOINTOUTPUT', 'GRAPHQLAPIIDOUTPUT']) {
|
|
26
|
+
for (const variable of Object.keys((_c = (_b = configuration.Environment) === null || _b === void 0 ? void 0 : _b.Variables) !== null && _c !== void 0 ? _c : {})) {
|
|
27
|
+
if (variable.startsWith('API_') && variable.endsWith(envSuffix)) {
|
|
28
|
+
(_d = configuration.Environment) === null || _d === void 0 ? true : delete _d.Variables[variable];
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
funcDef.environment = configuration === null || configuration === void 0 ? void 0 : configuration.Environment;
|
|
33
|
+
funcDef.runtime = configuration === null || configuration === void 0 ? void 0 : configuration.Runtime;
|
|
34
|
+
const functionName = configuration === null || configuration === void 0 ? void 0 : configuration.FunctionName;
|
|
35
|
+
(0, node_assert_1.default)(functionName);
|
|
36
|
+
const functionRecordInMeta = Object.entries(meta.function).find(([, value]) => value.output.Name === functionName);
|
|
37
|
+
(0, node_assert_1.default)(functionRecordInMeta);
|
|
38
|
+
funcDef.category = (_e = functionCategoryMap.get(functionRecordInMeta[0])) !== null && _e !== void 0 ? _e : 'function';
|
|
39
|
+
funcDef.resourceName = functionRecordInMeta[0];
|
|
40
|
+
funcDef.schedule = (_f = functionSchedules.find((schedule) => schedule.functionName === functionName)) === null || _f === void 0 ? void 0 : _f.scheduleExpression;
|
|
41
|
+
funcDefList.push(funcDef);
|
|
42
|
+
}
|
|
43
|
+
return funcDefList;
|
|
44
|
+
};
|
|
45
|
+
exports.getFunctionDefinition = getFunctionDefinition;
|
|
46
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../src/commands/gen2-migration/generate/adapters/functions/index.ts"],"names":[],"mappings":";;;;;;AAEA,8DAAiC;AAyBjC,MAAM,0BAA0B,GAAG,CAAC,OAAe,EAAU,EAAE;IAE7D,MAAM,YAAY,GAAG,OAAO,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC;IAC9C,IAAI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H,CAAC;QAED,OAAO,CAAC,WAAW,GAAG,aAAa,aAAb,aAAa,uBAAb,aAAa,CAAE,WAAW,CAAC;QACjD,OAAO,CAAC,OAAO,GAAG,aAAa,aAAb,aAAa,uBAAb,aAAa,CAAE,OAAO,CAAC;QACzC,MAAM,YAAY,GAAG,aAAa,aAAb,aAAa,uBAAb,aAAa,CAAE,YAAY,CAAC;QACjD,IAAA,qBAAM,EAAC,YAAY,CAAC,CAAC;QACrB,MAAM,oBAAoB,GAAG,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,KAAK,CAAC,EAAE,EAAE,CAAC,KAAK,CAAC,MAAM,CAAC,IAAI,KAAK,YAAY,CAAC,CAAC;QACnH,IAAA,qBAAM,EAAC,oBAAoB,CAAC,CAAC;QAC7B,OAAO,CAAC,QAAQ,GAAG,MAAA,mBAAmB,CAAC,GAAG,CAAC,oBAAoB,CAAC,CAAC,CAAC,CAAC,mCAAI,UAAU,CAAC;QAClF,OAAO,CAAC,YAAY,GAAG,oBAAoB,CAAC,CAAC,CAAC,CAAC;QAC/C,OAAO,CAAC,QAAQ,GAAG,MAAA,iBAAiB,CAAC,IAAI,CAAC,CAAC,QAAQ,EAAE,EAAE,CAAC,QAAQ,CAAC,YAAY,KAAK,YAAY,CAAC,0CAAE,kBAAkB,CAAC;QAEpH,WAAW,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IAC5B,CAAC;IAED,OAAO,WAAW,CAAC;AACrB,CAAC,CAAC;AAzCW,QAAA,qBAAqB,yBAyChC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/commands/gen2-migration/generate/adapters/project/index.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,iBAAiB,GAAU,aAAa,MAAM,kBAI1D,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../src/commands/gen2-migration/generate/adapters/project/index.ts"],"names":[],"mappings":";;;AAEO,MAAM,iBAAiB,GAAG,KAAK,EAAE,WAAmB,EAAE,EAAE;AAI/D,CAAC,CAAC;AAJW,QAAA,iBAAiB,qBAI5B"}
|
package/lib/commands/gen2-migration/generate/adapters/storage/gen1_storage_codegen_adapter.d.ts
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { StorageTriggerEvent, Lambda, StorageRenderParameters } from '../../core/migration-pipeline';
|
|
2
|
+
import { StorageCLIInputsJSON } from './storage_access';
|
|
3
|
+
export type DynamoDBAttribute = {
|
|
4
|
+
name: string;
|
|
5
|
+
type: 'STRING' | 'NUMBER' | 'BINARY';
|
|
6
|
+
};
|
|
7
|
+
export type DynamoDBGSI = {
|
|
8
|
+
indexName: string;
|
|
9
|
+
partitionKey: DynamoDBAttribute;
|
|
10
|
+
sortKey?: DynamoDBAttribute;
|
|
11
|
+
};
|
|
12
|
+
export type DynamoDBTableDefinition = {
|
|
13
|
+
tableName: string;
|
|
14
|
+
partitionKey: DynamoDBAttribute;
|
|
15
|
+
sortKey?: DynamoDBAttribute;
|
|
16
|
+
gsis?: DynamoDBGSI[];
|
|
17
|
+
billingMode?: 'PROVISIONED' | 'PAY_PER_REQUEST';
|
|
18
|
+
readCapacity?: number;
|
|
19
|
+
writeCapacity?: number;
|
|
20
|
+
streamEnabled?: boolean;
|
|
21
|
+
streamViewType?: 'KEYS_ONLY' | 'NEW_IMAGE' | 'OLD_IMAGE' | 'NEW_AND_OLD_IMAGES';
|
|
22
|
+
};
|
|
23
|
+
export type StorageInputs = {
|
|
24
|
+
bucketName?: string;
|
|
25
|
+
cliInputs?: StorageCLIInputsJSON;
|
|
26
|
+
triggers?: Partial<Record<StorageTriggerEvent, Lambda>>;
|
|
27
|
+
dynamoTables?: DynamoDBTableDefinition[];
|
|
28
|
+
};
|
|
29
|
+
export declare const getStorageDefinition: ({ bucketName, cliInputs, triggers, dynamoTables }: StorageInputs) => StorageRenderParameters;
|
|
30
|
+
//# sourceMappingURL=gen1_storage_codegen_adapter.d.ts.map
|
package/lib/commands/gen2-migration/generate/adapters/storage/gen1_storage_codegen_adapter.d.ts.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"gen1_storage_codegen_adapter.d.ts","sourceRoot":"","sources":["../../../../../../src/commands/gen2-migration/generate/adapters/storage/gen1_storage_codegen_adapter.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,EAAE,uBAAuB,EAAE,MAAM,+BAA+B,CAAC;AACrG,OAAO,EAAE,oBAAoB,EAAoB,MAAM,kBAAkB,CAAC;AAE1E,MAAM,MAAM,iBAAiB,GAAG;IAC9B,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,QAAQ,GAAG,QAAQ,GAAG,QAAQ,CAAC;CACtC,CAAC;AAEF,MAAM,MAAM,WAAW,GAAG;IACxB,SAAS,EAAE,MAAM,CAAC;IAClB,YAAY,EAAE,iBAAiB,CAAC;IAChC,OAAO,CAAC,EAAE,iBAAiB,CAAC;CAC7B,CAAC;AAEF,MAAM,MAAM,uBAAuB,GAAG;IACpC,SAAS,EAAE,MAAM,CAAC;IAClB,YAAY,EAAE,iBAAiB,CAAC;IAChC,OAAO,CAAC,EAAE,iBAAiB,CAAC;IAC5B,IAAI,CAAC,EAAE,WAAW,EAAE,CAAC;IACrB,WAAW,CAAC,EAAE,aAAa,GAAG,iBAAiB,CAAC;IAChD,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,cAAc,CAAC,EAAE,WAAW,GAAG,WAAW,GAAG,WAAW,GAAG,oBAAoB,CAAC;CACjF,CAAC;AAEF,MAAM,MAAM,aAAa,GAAG;IAC1B,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,SAAS,CAAC,EAAE,oBAAoB,CAAC;IACjC,QAAQ,CAAC,EAAE,OAAO,CAAC,MAAM,CAAC,mBAAmB,EAAE,MAAM,CAAC,CAAC,CAAC;IACxD,YAAY,CAAC,EAAE,uBAAuB,EAAE,CAAC;CAC1C,CAAC;AAEF,eAAO,MAAM,oBAAoB,GAAI,mDAAmD,aAAa,KAAG,uBAcvG,CAAC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getStorageDefinition = void 0;
|
|
4
|
+
const storage_access_1 = require("./storage_access");
|
|
5
|
+
const getStorageDefinition = ({ bucketName, cliInputs, triggers, dynamoTables }) => {
|
|
6
|
+
const result = {};
|
|
7
|
+
if (bucketName && cliInputs) {
|
|
8
|
+
result.accessPatterns = (0, storage_access_1.getStorageAccess)(cliInputs);
|
|
9
|
+
result.storageIdentifier = bucketName;
|
|
10
|
+
result.triggers = triggers !== null && triggers !== void 0 ? triggers : {};
|
|
11
|
+
}
|
|
12
|
+
if (dynamoTables) {
|
|
13
|
+
result.dynamoTables = dynamoTables;
|
|
14
|
+
}
|
|
15
|
+
return result;
|
|
16
|
+
};
|
|
17
|
+
exports.getStorageDefinition = getStorageDefinition;
|
|
18
|
+
//# sourceMappingURL=gen1_storage_codegen_adapter.js.map
|
package/lib/commands/gen2-migration/generate/adapters/storage/gen1_storage_codegen_adapter.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"gen1_storage_codegen_adapter.js","sourceRoot":"","sources":["../../../../../../src/commands/gen2-migration/generate/adapters/storage/gen1_storage_codegen_adapter.ts"],"names":[],"mappings":";;;AACA,qDAA0E;AAgCnE,MAAM,oBAAoB,GAAG,CAAC,EAAE,UAAU,EAAE,SAAS,EAAE,QAAQ,EAAE,YAAY,EAAiB,EAA2B,EAAE;IAChI,MAAM,MAAM,GAA4B,EAAE,CAAC;IAE3C,IAAI,UAAU,IAAI,SAAS,EAAE,CAAC;QAC5B,MAAM,CAAC,cAAc,GAAG,IAAA,iCAAgB,EAAC,SAAS,CAAC,CAAC;QACpD,MAAM,CAAC,iBAAiB,GAAG,UAAU,CAAC;QACtC,MAAM,CAAC,QAAQ,GAAG,QAAQ,aAAR,QAAQ,cAAR,QAAQ,GAAI,EAAE,CAAC;IACnC,CAAC;IAED,IAAI,YAAY,EAAE,CAAC;QACjB,MAAM,CAAC,YAAY,GAAG,YAAY,CAAC;IACrC,CAAC;IAED,OAAO,MAAM,CAAC;AAChB,CAAC,CAAC;AAdW,QAAA,oBAAoB,wBAc/B"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"gen1_storage_codegen_adapter.test.d.ts","sourceRoot":"","sources":["../../../../../../src/commands/gen2-migration/generate/adapters/storage/gen1_storage_codegen_adapter.test.ts"],"names":[],"mappings":""}
|
package/lib/commands/gen2-migration/generate/adapters/storage/gen1_storage_codegen_adapter.test.js
ADDED
|
@@ -0,0 +1,181 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const globals_1 = require("@jest/globals");
|
|
4
|
+
const gen1_storage_codegen_adapter_1 = require("./gen1_storage_codegen_adapter");
|
|
5
|
+
(0, globals_1.describe)('Storage Adapter DynamoDB Support', () => {
|
|
6
|
+
(0, globals_1.describe)('getStorageDefinition', () => {
|
|
7
|
+
(0, globals_1.it)('should handle DynamoDB tables without S3 bucket', () => {
|
|
8
|
+
const dynamoTables = [
|
|
9
|
+
{
|
|
10
|
+
tableName: 'testTable',
|
|
11
|
+
partitionKey: { name: 'id', type: 'STRING' },
|
|
12
|
+
billingMode: 'PAY_PER_REQUEST',
|
|
13
|
+
},
|
|
14
|
+
];
|
|
15
|
+
const inputs = {
|
|
16
|
+
dynamoTables,
|
|
17
|
+
};
|
|
18
|
+
const result = (0, gen1_storage_codegen_adapter_1.getStorageDefinition)(inputs);
|
|
19
|
+
(0, globals_1.expect)(result.dynamoTables).toEqual(dynamoTables);
|
|
20
|
+
(0, globals_1.expect)(result.accessPatterns).toBeUndefined();
|
|
21
|
+
(0, globals_1.expect)(result.storageIdentifier).toBeUndefined();
|
|
22
|
+
});
|
|
23
|
+
(0, globals_1.it)('should handle both S3 bucket and DynamoDB tables', () => {
|
|
24
|
+
const dynamoTables = [
|
|
25
|
+
{
|
|
26
|
+
tableName: 'mixedTable',
|
|
27
|
+
partitionKey: { name: 'pk', type: 'STRING' },
|
|
28
|
+
sortKey: { name: 'sk', type: 'NUMBER' },
|
|
29
|
+
billingMode: 'PROVISIONED',
|
|
30
|
+
readCapacity: 5,
|
|
31
|
+
writeCapacity: 5,
|
|
32
|
+
},
|
|
33
|
+
];
|
|
34
|
+
const inputs = {
|
|
35
|
+
bucketName: 'test-bucket-dev',
|
|
36
|
+
cliInputs: {
|
|
37
|
+
resourceName: 'testStorage',
|
|
38
|
+
policyUUID: 'test-uuid',
|
|
39
|
+
bucketName: 'test-bucket-dev',
|
|
40
|
+
storageAccess: 'auth',
|
|
41
|
+
guestAccess: [],
|
|
42
|
+
authAccess: ['CREATE_AND_UPDATE', 'READ', 'DELETE'],
|
|
43
|
+
triggerFunction: 'NONE',
|
|
44
|
+
groupAccess: {},
|
|
45
|
+
},
|
|
46
|
+
dynamoTables,
|
|
47
|
+
};
|
|
48
|
+
const result = (0, gen1_storage_codegen_adapter_1.getStorageDefinition)(inputs);
|
|
49
|
+
(0, globals_1.expect)(result.dynamoTables).toEqual(dynamoTables);
|
|
50
|
+
(0, globals_1.expect)(result.storageIdentifier).toBe('test-bucket-dev');
|
|
51
|
+
(0, globals_1.expect)(result.accessPatterns).toBeDefined();
|
|
52
|
+
});
|
|
53
|
+
(0, globals_1.it)('should handle complex DynamoDB table with GSIs and triggers', () => {
|
|
54
|
+
const dynamoTables = [
|
|
55
|
+
{
|
|
56
|
+
tableName: 'complexTable-dev',
|
|
57
|
+
partitionKey: { name: 'userId', type: 'STRING' },
|
|
58
|
+
sortKey: { name: 'timestamp', type: 'NUMBER' },
|
|
59
|
+
billingMode: 'PROVISIONED',
|
|
60
|
+
readCapacity: 10,
|
|
61
|
+
writeCapacity: 10,
|
|
62
|
+
streamEnabled: true,
|
|
63
|
+
streamViewType: 'NEW_AND_OLD_IMAGES',
|
|
64
|
+
gsis: [
|
|
65
|
+
{
|
|
66
|
+
indexName: 'statusIndex',
|
|
67
|
+
partitionKey: { name: 'status', type: 'STRING' },
|
|
68
|
+
sortKey: { name: 'createdAt', type: 'NUMBER' },
|
|
69
|
+
},
|
|
70
|
+
],
|
|
71
|
+
},
|
|
72
|
+
];
|
|
73
|
+
const inputs = {
|
|
74
|
+
dynamoTables,
|
|
75
|
+
};
|
|
76
|
+
const result = (0, gen1_storage_codegen_adapter_1.getStorageDefinition)(inputs);
|
|
77
|
+
(0, globals_1.expect)(result.dynamoTables).toHaveLength(1);
|
|
78
|
+
(0, globals_1.expect)(result.dynamoTables[0].tableName).toBe('complexTable-dev');
|
|
79
|
+
(0, globals_1.expect)(result.dynamoTables[0].gsis).toHaveLength(1);
|
|
80
|
+
(0, globals_1.expect)(result.dynamoTables[0].streamEnabled).toBe(true);
|
|
81
|
+
});
|
|
82
|
+
(0, globals_1.it)('should handle empty inputs', () => {
|
|
83
|
+
const inputs = {};
|
|
84
|
+
const result = (0, gen1_storage_codegen_adapter_1.getStorageDefinition)(inputs);
|
|
85
|
+
(0, globals_1.expect)(result.dynamoTables).toBeUndefined();
|
|
86
|
+
(0, globals_1.expect)(result.accessPatterns).toBeUndefined();
|
|
87
|
+
(0, globals_1.expect)(result.storageIdentifier).toBeUndefined();
|
|
88
|
+
});
|
|
89
|
+
(0, globals_1.it)('should handle undefined dynamoTables', () => {
|
|
90
|
+
const inputs = {
|
|
91
|
+
bucketName: 'test-bucket',
|
|
92
|
+
cliInputs: {
|
|
93
|
+
resourceName: 'testStorage',
|
|
94
|
+
policyUUID: 'test-uuid',
|
|
95
|
+
bucketName: 'test-bucket',
|
|
96
|
+
storageAccess: 'auth',
|
|
97
|
+
guestAccess: [],
|
|
98
|
+
authAccess: ['READ'],
|
|
99
|
+
triggerFunction: 'NONE',
|
|
100
|
+
groupAccess: {},
|
|
101
|
+
},
|
|
102
|
+
dynamoTables: undefined,
|
|
103
|
+
};
|
|
104
|
+
const result = (0, gen1_storage_codegen_adapter_1.getStorageDefinition)(inputs);
|
|
105
|
+
(0, globals_1.expect)(result.dynamoTables).toBeUndefined();
|
|
106
|
+
(0, globals_1.expect)(result.storageIdentifier).toBe('test-bucket');
|
|
107
|
+
});
|
|
108
|
+
(0, globals_1.it)('should handle empty dynamoTables array', () => {
|
|
109
|
+
const inputs = {
|
|
110
|
+
dynamoTables: [],
|
|
111
|
+
};
|
|
112
|
+
const result = (0, gen1_storage_codegen_adapter_1.getStorageDefinition)(inputs);
|
|
113
|
+
(0, globals_1.expect)(result.dynamoTables).toEqual([]);
|
|
114
|
+
});
|
|
115
|
+
});
|
|
116
|
+
(0, globals_1.describe)('DynamoDB table validation', () => {
|
|
117
|
+
(0, globals_1.it)('should handle table with all supported attribute types', () => {
|
|
118
|
+
const dynamoTables = [
|
|
119
|
+
{
|
|
120
|
+
tableName: 'typeTestTable',
|
|
121
|
+
partitionKey: { name: 'stringKey', type: 'STRING' },
|
|
122
|
+
sortKey: { name: 'numberKey', type: 'NUMBER' },
|
|
123
|
+
billingMode: 'PAY_PER_REQUEST',
|
|
124
|
+
gsis: [
|
|
125
|
+
{
|
|
126
|
+
indexName: 'binaryIndex',
|
|
127
|
+
partitionKey: { name: 'binaryKey', type: 'BINARY' },
|
|
128
|
+
},
|
|
129
|
+
],
|
|
130
|
+
},
|
|
131
|
+
];
|
|
132
|
+
const inputs = { dynamoTables };
|
|
133
|
+
const result = (0, gen1_storage_codegen_adapter_1.getStorageDefinition)(inputs);
|
|
134
|
+
(0, globals_1.expect)(result.dynamoTables[0].partitionKey.type).toBe('STRING');
|
|
135
|
+
(0, globals_1.expect)(result.dynamoTables[0].sortKey.type).toBe('NUMBER');
|
|
136
|
+
(0, globals_1.expect)(result.dynamoTables[0].gsis[0].partitionKey.type).toBe('BINARY');
|
|
137
|
+
});
|
|
138
|
+
(0, globals_1.it)('should handle table with all billing modes', () => {
|
|
139
|
+
const provisionedTable = {
|
|
140
|
+
tableName: 'provisionedTable',
|
|
141
|
+
partitionKey: { name: 'id', type: 'STRING' },
|
|
142
|
+
billingMode: 'PROVISIONED',
|
|
143
|
+
readCapacity: 5,
|
|
144
|
+
writeCapacity: 5,
|
|
145
|
+
};
|
|
146
|
+
const payPerRequestTable = {
|
|
147
|
+
tableName: 'payPerRequestTable',
|
|
148
|
+
partitionKey: { name: 'id', type: 'STRING' },
|
|
149
|
+
billingMode: 'PAY_PER_REQUEST',
|
|
150
|
+
};
|
|
151
|
+
const inputs = {
|
|
152
|
+
dynamoTables: [provisionedTable, payPerRequestTable],
|
|
153
|
+
};
|
|
154
|
+
const result = (0, gen1_storage_codegen_adapter_1.getStorageDefinition)(inputs);
|
|
155
|
+
(0, globals_1.expect)(result.dynamoTables).toHaveLength(2);
|
|
156
|
+
(0, globals_1.expect)(result.dynamoTables[0].billingMode).toBe('PROVISIONED');
|
|
157
|
+
(0, globals_1.expect)(result.dynamoTables[1].billingMode).toBe('PAY_PER_REQUEST');
|
|
158
|
+
});
|
|
159
|
+
(0, globals_1.it)('should handle table with all stream view types', () => {
|
|
160
|
+
const streamViewTypes = [
|
|
161
|
+
'KEYS_ONLY',
|
|
162
|
+
'NEW_IMAGE',
|
|
163
|
+
'OLD_IMAGE',
|
|
164
|
+
'NEW_AND_OLD_IMAGES',
|
|
165
|
+
];
|
|
166
|
+
streamViewTypes.forEach((viewType, index) => {
|
|
167
|
+
const dynamoTable = {
|
|
168
|
+
tableName: `streamTable${index}`,
|
|
169
|
+
partitionKey: { name: 'id', type: 'STRING' },
|
|
170
|
+
billingMode: 'PAY_PER_REQUEST',
|
|
171
|
+
streamEnabled: true,
|
|
172
|
+
streamViewType: viewType,
|
|
173
|
+
};
|
|
174
|
+
const inputs = { dynamoTables: [dynamoTable] };
|
|
175
|
+
const result = (0, gen1_storage_codegen_adapter_1.getStorageDefinition)(inputs);
|
|
176
|
+
(0, globals_1.expect)(result.dynamoTables[0].streamViewType).toBe(viewType);
|
|
177
|
+
});
|
|
178
|
+
});
|
|
179
|
+
});
|
|
180
|
+
});
|
|
181
|
+
//# sourceMappingURL=gen1_storage_codegen_adapter.test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"gen1_storage_codegen_adapter.test.js","sourceRoot":"","sources":["../../../../../../src/commands/gen2-migration/generate/adapters/storage/gen1_storage_codegen_adapter.test.ts"],"names":[],"mappings":";;AAAA,2CAAqD;AACrD,iFAA8G;AAE9G,IAAA,kBAAQ,EAAC,kCAAkC,EAAE,GAAG,EAAE;IAChD,IAAA,kBAAQ,EAAC,sBAAsB,EAAE,GAAG,EAAE;QACpC,IAAA,YAAE,EAAC,iDAAiD,EAAE,GAAG,EAAE;YACzD,MAAM,YAAY,GAA8B;gBAC9C;oBACE,SAAS,EAAE,WAAW;oBACtB,YAAY,EAAE,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,QAAQ,EAAE;oBAC5C,WAAW,EAAE,iBAAiB;iBAC/B;aACF,CAAC;YAEF,MAAM,MAAM,GAAkB;gBAC5B,YAAY;aACb,CAAC;YAEF,MAAM,MAAM,GAAG,IAAA,mDAAoB,EAAC,MAAM,CAAC,CAAC;YAE5C,IAAA,gBAAM,EAAC,MAAM,CAAC,YAAY,CAAC,CAAC,OAAO,CAAC,YAAY,CAAC,CAAC;YAClD,IAAA,gBAAM,EAAC,MAAM,CAAC,cAAc,CAAC,CAAC,aAAa,EAAE,CAAC;YAC9C,IAAA,gBAAM,EAAC,MAAM,CAAC,iBAAiB,CAAC,CAAC,aAAa,EAAE,CAAC;QACnD,CAAC,CAAC,CAAC;QAEH,IAAA,YAAE,EAAC,kDAAkD,EAAE,GAAG,EAAE;YAC1D,MAAM,YAAY,GAA8B;gB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Ac,CAAC,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;YAChE,CAAC,CAAC,CAAC;QACL,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/commands/gen2-migration/generate/adapters/storage/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,oBAAoB,EACpB,aAAa,EACb,uBAAuB,EACvB,iBAAiB,EACjB,WAAW,GACZ,MAAM,gCAAgC,CAAC;AACxC,OAAO,EAAE,oBAAoB,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getStorageDefinition = void 0;
|
|
4
|
+
var gen1_storage_codegen_adapter_1 = require("./gen1_storage_codegen_adapter");
|
|
5
|
+
Object.defineProperty(exports, "getStorageDefinition", { enumerable: true, get: function () { return gen1_storage_codegen_adapter_1.getStorageDefinition; } });
|
|
6
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../src/commands/gen2-migration/generate/adapters/storage/index.ts"],"names":[],"mappings":";;;AAAA,+EAMwC;AALtC,oIAAA,oBAAoB,OAAA"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { AccessPatterns } from '../../core/migration-pipeline';
|
|
2
|
+
export type CLIV1Permission = 'READ' | 'CREATE_AND_UPDATE' | 'DELETE';
|
|
3
|
+
export type StorageCLIInputsJSON = {
|
|
4
|
+
resourceName?: string;
|
|
5
|
+
policyUUID?: string;
|
|
6
|
+
bucketName?: string;
|
|
7
|
+
storageAccess?: string;
|
|
8
|
+
guestAccess: CLIV1Permission[];
|
|
9
|
+
authAccess: CLIV1Permission[];
|
|
10
|
+
triggerFunction?: string;
|
|
11
|
+
groupAccess?: Record<string, CLIV1Permission[]>;
|
|
12
|
+
};
|
|
13
|
+
export declare const getStorageAccess: (input: StorageCLIInputsJSON) => AccessPatterns;
|
|
14
|
+
//# sourceMappingURL=storage_access.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"storage_access.d.ts","sourceRoot":"","sources":["../../../../../../src/commands/gen2-migration/generate/adapters/storage/storage_access.ts"],"names":[],"mappings":"AAAA,OAAO,EAAc,cAAc,EAAE,MAAM,+BAA+B,CAAC;AAE3E,MAAM,MAAM,eAAe,GAAG,MAAM,GAAG,mBAAmB,GAAG,QAAQ,CAAC;AACtE,MAAM,MAAM,oBAAoB,GAAG;IACjC,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,WAAW,EAAE,eAAe,EAAE,CAAC;IAC/B,UAAU,EAAE,eAAe,EAAE,CAAC;IAC9B,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,WAAW,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,eAAe,EAAE,CAAC,CAAC;CACjD,CAAC;AAUF,eAAO,MAAM,gBAAgB,GAAI,OAAO,oBAAoB,KAAG,cAa9D,CAAC"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getStorageAccess = void 0;
|
|
4
|
+
const PERMISSION_MAP = {
|
|
5
|
+
READ: ['read'],
|
|
6
|
+
DELETE: ['delete'],
|
|
7
|
+
CREATE_AND_UPDATE: ['write'],
|
|
8
|
+
};
|
|
9
|
+
const getGen2Permissions = (permissions) => {
|
|
10
|
+
return permissions.flatMap((p) => PERMISSION_MAP[p]);
|
|
11
|
+
};
|
|
12
|
+
const getStorageAccess = (input) => {
|
|
13
|
+
let groups;
|
|
14
|
+
if (input.groupAccess && Object.keys(input.groupAccess).length > 0) {
|
|
15
|
+
groups = Object.entries(input.groupAccess).reduce((acc, [key, value]) => {
|
|
16
|
+
acc[key] = getGen2Permissions(value);
|
|
17
|
+
return acc;
|
|
18
|
+
}, {});
|
|
19
|
+
}
|
|
20
|
+
return {
|
|
21
|
+
guest: getGen2Permissions(input.guestAccess),
|
|
22
|
+
auth: getGen2Permissions(input.authAccess),
|
|
23
|
+
groups,
|
|
24
|
+
};
|
|
25
|
+
};
|
|
26
|
+
exports.getStorageAccess = getStorageAccess;
|
|
27
|
+
//# sourceMappingURL=storage_access.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"storage_access.js","sourceRoot":"","sources":["../../../../../../src/commands/gen2-migration/generate/adapters/storage/storage_access.ts"],"names":[],"mappings":";;;AAcA,MAAM,cAAc,GAA0C;IAC5D,IAAI,EAAE,CAAC,MAAM,CAAC;IACd,MAAM,EAAE,CAAC,QAAQ,CAAC;IAClB,iBAAiB,EAAE,CAAC,OAAO,CAAC;CAC7B,CAAC;AACF,MAAM,kBAAkB,GAAG,CAAC,WAA8B,EAAgB,EAAE;IAC1E,OAAO,WAAW,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,cAAc,CAAC,CAAC,CAAC,CAAC,CAAC;AACvD,CAAC,CAAC;AACK,MAAM,gBAAgB,GAAG,CAAC,KAA2B,EAAkB,EAAE;IAC9E,IAAI,MAA4C,CAAC;IACjD,IAAI,KAAK,CAAC,WAAW,IAAI,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,WAAW,CAAC,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QACnE,MAAM,GAAG,MAAM,CAAC,OAAO,CAAC,KAAK,CAAC,WAAW,CAAC,CAAC,MAAM,CAAC,CAAC,GAAG,EAAE,CAAC,GAAG,EAAE,KAAK,CAAC,EAAE,EAAE;YACtE,GAAG,CAAC,GAAG,CAAC,GAAG,kBAAkB,CAAC,KAAK,CAAC,CAAC;YACrC,OAAO,GAAG,CAAC;QACb,CAAC,EAAE,EAA2C,CAAC,CAAC;IAClD,CAAC;IACD,OAAO;QACL,KAAK,EAAE,kBAAkB,CAAC,KAAK,CAAC,WAAW,CAAC;QAC5C,IAAI,EAAE,kBAAkB,CAAC,KAAK,CAAC,UAAU,CAAC;QAC1C,MAAM;KACP,CAAC;AACJ,CAAC,CAAC;AAbW,QAAA,gBAAgB,oBAa3B"}
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
import { Node, NodeArray } from 'typescript';
|
|
2
|
+
import { PolicyOverrides, ReferenceAuth } from '../generators/auth';
|
|
3
|
+
import type { BucketAccelerateStatus, BucketVersioningStatus } from '@aws-sdk/client-s3';
|
|
4
|
+
import { AccessPatterns, ServerSideEncryptionConfiguration } from '../generators/storage';
|
|
5
|
+
import { DynamoDBTableDefinition } from '../adapters/storage';
|
|
6
|
+
import { UserPoolClientType } from '@aws-sdk/client-cognito-identity-provider';
|
|
7
|
+
import type { AdditionalAuthProvider } from '../generators/data';
|
|
8
|
+
import { RestApiDefinition } from '../codegen-head/data_definition_fetcher';
|
|
9
|
+
export interface BackendRenderParameters {
|
|
10
|
+
data?: {
|
|
11
|
+
importFrom: string;
|
|
12
|
+
additionalAuthProviders?: AdditionalAuthProvider[];
|
|
13
|
+
restApis?: RestApiDefinition[];
|
|
14
|
+
};
|
|
15
|
+
auth?: {
|
|
16
|
+
importFrom: string;
|
|
17
|
+
userPoolOverrides?: PolicyOverrides;
|
|
18
|
+
guestLogin?: boolean;
|
|
19
|
+
identityPoolName?: string;
|
|
20
|
+
oAuthFlows?: string[];
|
|
21
|
+
readAttributes?: string[];
|
|
22
|
+
writeAttributes?: string[];
|
|
23
|
+
referenceAuth?: ReferenceAuth;
|
|
24
|
+
userPoolClient?: UserPoolClientType;
|
|
25
|
+
};
|
|
26
|
+
storage?: {
|
|
27
|
+
importFrom: string;
|
|
28
|
+
dynamoTables?: DynamoDBTableDefinition[];
|
|
29
|
+
accelerateConfiguration?: BucketAccelerateStatus;
|
|
30
|
+
versionConfiguration?: BucketVersioningStatus;
|
|
31
|
+
hasS3Bucket?: string | AccessPatterns | undefined;
|
|
32
|
+
bucketEncryptionAlgorithm?: ServerSideEncryptionConfiguration;
|
|
33
|
+
bucketName?: string;
|
|
34
|
+
};
|
|
35
|
+
function?: {
|
|
36
|
+
importFrom: string;
|
|
37
|
+
functionNamesAndCategories: Map<string, string>;
|
|
38
|
+
};
|
|
39
|
+
analytics?: {
|
|
40
|
+
importFrom: string;
|
|
41
|
+
};
|
|
42
|
+
customResources?: Map<string, string>;
|
|
43
|
+
unsupportedCategories?: Map<string, string>;
|
|
44
|
+
}
|
|
45
|
+
export declare class BackendSynthesizer {
|
|
46
|
+
private importDurationFlag;
|
|
47
|
+
private oAuthFlag;
|
|
48
|
+
private readWriteAttributeFlag;
|
|
49
|
+
private supportedIdentityProviderFlag;
|
|
50
|
+
private createPropertyAccessExpression;
|
|
51
|
+
private createVariableDeclaration;
|
|
52
|
+
private createVariableStatement;
|
|
53
|
+
private createImportStatement;
|
|
54
|
+
private defineBackendCall;
|
|
55
|
+
private setPropertyValue;
|
|
56
|
+
private getOverrideValue;
|
|
57
|
+
private createBooleanPropertyAssignment;
|
|
58
|
+
private createListPropertyAssignment;
|
|
59
|
+
private createEnumListPropertyAssignment;
|
|
60
|
+
private createNumericPropertyAssignment;
|
|
61
|
+
private createDurationPropertyAssignment;
|
|
62
|
+
private createStringPropertyAssignment;
|
|
63
|
+
private createUserPoolClientAssignment;
|
|
64
|
+
private createPropertyAccessChain;
|
|
65
|
+
private getProviderSetupDeclaration;
|
|
66
|
+
private getProviderSetupForeachStatement;
|
|
67
|
+
private createProviderSetupCode;
|
|
68
|
+
private createNestedObjectExpression;
|
|
69
|
+
private createReadWriteAttributes;
|
|
70
|
+
private mapOAuthScopes;
|
|
71
|
+
private createOAuthObjectExpression;
|
|
72
|
+
private createOAuthFlowsObjectExpression;
|
|
73
|
+
private createAuthFlowsObjectExpression;
|
|
74
|
+
private createAdditionalAuthProvidersArray;
|
|
75
|
+
private createTemplateLiteralExpression;
|
|
76
|
+
private createAmplifyEnvNameLogic;
|
|
77
|
+
private sanitizeVariableName;
|
|
78
|
+
render(renderArgs: BackendRenderParameters): NodeArray<Node>;
|
|
79
|
+
}
|
|
80
|
+
//# sourceMappingURL=synthesizer.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"synthesizer.d.ts","sourceRoot":"","sources":["../../../../../src/commands/gen2-migration/generate/backend/synthesizer.ts"],"names":[],"mappings":"AAAA,OAAW,EAMT,IAAI,EACJ,SAAS,EAGV,MAAM,YAAY,CAAC;AACpB,OAAO,EAAE,eAAe,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACpE,OAAO,KAAK,EAAE,sBAAsB,EAAE,sBAAsB,EAAE,MAAM,oBAAoB,CAAC;AACzF,OAAO,EAAE,cAAc,EAAE,iCAAiC,EAAE,MAAM,uBAAuB,CAAC;AAC1F,OAAO,EAAE,uBAAuB,EAAE,MAAM,qBAAqB,CAAC;AAC9D,OAAO,EAAwC,kBAAkB,EAAE,MAAM,2CAA2C,CAAC;AAGrH,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,oBAAoB,CAAC;AACjE,OAAO,EAAE,iBAAiB,EAAE,MAAM,yCAAyC,CAAC;AAG5E,MAAM,WAAW,uBAAuB;IACtC,IAAI,CAAC,EAAE;QACL,UAAU,EAAE,MAAM,CAAC;QACnB,uBAAuB,CAAC,EAAE,sBAAsB,EAAE,CAAC;QACnD,QAAQ,CAAC,EAAE,iBAAiB,EAAE,CAAC;KAChC,CAAC;IACF,IAAI,CAAC,EAAE;QACL,UAAU,EAAE,MAAM,CAAC;QACnB,iBAAiB,CAAC,EAAE,eAAe,CAAC;QACpC,UAAU,CAAC,EAAE,OAAO,CAAC;QACrB,gBAAgB,CAAC,EAAE,MAA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