@aws-amplify/cli-internal-gen2-migration-experimental-alpha 0.5.0 → 0.7.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/CHANGELOG.md +16 -0
- package/adr/001-refactor-gen2-migration-generate.md +413 -0
- package/adr/002-refactor-gen2-migration-refactor.md +593 -0
- package/adr/003-gen2-migration-assess.md +414 -0
- package/adr/004-gen2-migration-validation-modeling.md +336 -0
- package/aws-amplify-cli-internal-gen2-migration-experimental-alpha-0.7.0.tgz +0 -0
- package/bin/amplify +1 -1
- package/lib/commands/drift-detection/detect-local-drift.d.ts +1 -2
- package/lib/commands/drift-detection/detect-local-drift.d.ts.map +1 -1
- package/lib/commands/drift-detection/detect-local-drift.js +19 -6
- package/lib/commands/drift-detection/detect-local-drift.js.map +1 -1
- package/lib/commands/drift-detection/detect-stack-drift.d.ts +20 -9
- package/lib/commands/drift-detection/detect-stack-drift.d.ts.map +1 -1
- package/lib/commands/drift-detection/detect-stack-drift.js +121 -151
- package/lib/commands/drift-detection/detect-stack-drift.js.map +1 -1
- package/lib/commands/drift-detection/detect-template-drift.d.ts +8 -21
- package/lib/commands/drift-detection/detect-template-drift.d.ts.map +1 -1
- package/lib/commands/drift-detection/detect-template-drift.js +81 -89
- package/lib/commands/drift-detection/detect-template-drift.js.map +1 -1
- package/lib/commands/drift-detection/index.d.ts +2 -3
- package/lib/commands/drift-detection/index.d.ts.map +1 -1
- package/lib/commands/drift-detection/index.js +1 -3
- package/lib/commands/drift-detection/index.js.map +1 -1
- package/lib/commands/drift-detection/services/amplify-config-service.d.ts +0 -1
- package/lib/commands/drift-detection/services/amplify-config-service.d.ts.map +1 -1
- package/lib/commands/drift-detection/services/amplify-config-service.js +0 -16
- package/lib/commands/drift-detection/services/amplify-config-service.js.map +1 -1
- package/lib/commands/drift-detection/services/cloudformation-service.d.ts +2 -4
- package/lib/commands/drift-detection/services/cloudformation-service.d.ts.map +1 -1
- package/lib/commands/drift-detection/services/cloudformation-service.js +7 -11
- package/lib/commands/drift-detection/services/cloudformation-service.js.map +1 -1
- package/lib/commands/drift-detection/services/drift-formatter.d.ts +3 -70
- package/lib/commands/drift-detection/services/drift-formatter.d.ts.map +1 -1
- package/lib/commands/drift-detection/services/drift-formatter.js +148 -603
- package/lib/commands/drift-detection/services/drift-formatter.js.map +1 -1
- package/lib/commands/drift-detection/services/index.d.ts +1 -2
- package/lib/commands/drift-detection/services/index.d.ts.map +1 -1
- package/lib/commands/drift-detection/services/index.js +2 -4
- package/lib/commands/drift-detection/services/index.js.map +1 -1
- package/lib/commands/drift.d.ts +7 -18
- package/lib/commands/drift.d.ts.map +1 -1
- package/lib/commands/drift.js +71 -172
- package/lib/commands/drift.js.map +1 -1
- package/lib/commands/gen2-migration/_infra/aws-clients.d.ts +31 -0
- package/lib/commands/gen2-migration/_infra/aws-clients.d.ts.map +1 -0
- package/lib/commands/gen2-migration/_infra/aws-clients.js +64 -0
- package/lib/commands/gen2-migration/_infra/aws-clients.js.map +1 -0
- package/lib/commands/gen2-migration/_infra/categories.d.ts +2 -0
- package/lib/commands/gen2-migration/_infra/categories.d.ts.map +1 -0
- package/lib/commands/gen2-migration/_infra/categories.js +32 -0
- package/lib/commands/gen2-migration/_infra/categories.js.map +1 -0
- package/lib/commands/gen2-migration/_infra/cfn-template.d.ts +52 -0
- package/lib/commands/gen2-migration/_infra/cfn-template.d.ts.map +1 -0
- package/lib/commands/gen2-migration/_infra/cfn-template.js +21 -0
- package/lib/commands/gen2-migration/_infra/cfn-template.js.map +1 -0
- package/lib/commands/gen2-migration/_infra/operation.d.ts +16 -0
- package/lib/commands/gen2-migration/_infra/operation.d.ts.map +1 -0
- package/lib/commands/gen2-migration/_infra/operation.js +3 -0
- package/lib/commands/gen2-migration/_infra/operation.js.map +1 -0
- package/lib/commands/gen2-migration/_infra/plan.d.ts +21 -0
- package/lib/commands/gen2-migration/_infra/plan.d.ts.map +1 -0
- package/lib/commands/gen2-migration/_infra/plan.js +111 -0
- package/lib/commands/gen2-migration/_infra/plan.js.map +1 -0
- package/lib/commands/gen2-migration/_infra/planner.d.ts +5 -0
- package/lib/commands/gen2-migration/_infra/planner.d.ts.map +1 -0
- package/lib/commands/gen2-migration/{generate/custom-resources/types.js → _infra/planner.js} +1 -1
- package/lib/commands/gen2-migration/_infra/planner.js.map +1 -0
- package/lib/commands/gen2-migration/_infra/spinning-logger.d.ts +25 -0
- package/lib/commands/gen2-migration/_infra/spinning-logger.d.ts.map +1 -0
- package/lib/commands/gen2-migration/_infra/spinning-logger.js +115 -0
- package/lib/commands/gen2-migration/_infra/spinning-logger.js.map +1 -0
- package/lib/commands/gen2-migration/_infra/stateful-resources.d.ts.map +1 -0
- package/lib/commands/gen2-migration/_infra/stateful-resources.js.map +1 -0
- package/lib/commands/gen2-migration/_infra/step.d.ts +15 -0
- package/lib/commands/gen2-migration/_infra/step.d.ts.map +1 -0
- package/lib/commands/gen2-migration/_infra/step.js +13 -0
- package/lib/commands/gen2-migration/_infra/step.js.map +1 -0
- package/lib/commands/gen2-migration/{_validations.d.ts → _infra/validations.d.ts} +6 -7
- package/lib/commands/gen2-migration/_infra/validations.d.ts.map +1 -0
- package/lib/commands/gen2-migration/{_validations.js → _infra/validations.js} +24 -60
- package/lib/commands/gen2-migration/_infra/validations.js.map +1 -0
- package/lib/commands/gen2-migration/assess/analytics/kinesis.assessor.d.ts +10 -0
- package/lib/commands/gen2-migration/assess/analytics/kinesis.assessor.d.ts.map +1 -0
- package/lib/commands/gen2-migration/assess/analytics/kinesis.assessor.js +15 -0
- package/lib/commands/gen2-migration/assess/analytics/kinesis.assessor.js.map +1 -0
- package/lib/commands/gen2-migration/assess/api/data.assessor.d.ts +10 -0
- package/lib/commands/gen2-migration/assess/api/data.assessor.d.ts.map +1 -0
- package/lib/commands/gen2-migration/assess/api/data.assessor.js +25 -0
- package/lib/commands/gen2-migration/assess/api/data.assessor.js.map +1 -0
- package/lib/commands/gen2-migration/assess/api/rest-api.assessor.d.ts +10 -0
- package/lib/commands/gen2-migration/assess/api/rest-api.assessor.d.ts.map +1 -0
- package/lib/commands/gen2-migration/assess/api/rest-api.assessor.js +25 -0
- package/lib/commands/gen2-migration/assess/api/rest-api.assessor.js.map +1 -0
- package/lib/commands/gen2-migration/assess/assessment.d.ts +42 -0
- package/lib/commands/gen2-migration/assess/assessment.d.ts.map +1 -0
- package/lib/commands/gen2-migration/assess/assessment.js +118 -0
- package/lib/commands/gen2-migration/assess/assessment.js.map +1 -0
- package/lib/commands/gen2-migration/assess/assessor.d.ts +5 -0
- package/lib/commands/gen2-migration/assess/assessor.d.ts.map +1 -0
- package/lib/commands/gen2-migration/{generate/types.js → assess/assessor.js} +1 -1
- package/lib/commands/gen2-migration/assess/assessor.js.map +1 -0
- package/lib/commands/gen2-migration/assess/auth/auth-cognito.assessor.d.ts +10 -0
- package/lib/commands/gen2-migration/assess/auth/auth-cognito.assessor.d.ts.map +1 -0
- package/lib/commands/gen2-migration/assess/auth/auth-cognito.assessor.js +30 -0
- package/lib/commands/gen2-migration/assess/auth/auth-cognito.assessor.js.map +1 -0
- package/lib/commands/gen2-migration/assess/auth/auth-user-pool-groups.assessor.d.ts +10 -0
- package/lib/commands/gen2-migration/assess/auth/auth-user-pool-groups.assessor.d.ts.map +1 -0
- package/lib/commands/gen2-migration/assess/auth/auth-user-pool-groups.assessor.js +24 -0
- package/lib/commands/gen2-migration/assess/auth/auth-user-pool-groups.assessor.js.map +1 -0
- package/lib/commands/gen2-migration/assess/function/function.assessor.d.ts +12 -0
- package/lib/commands/gen2-migration/assess/function/function.assessor.d.ts.map +1 -0
- package/lib/commands/gen2-migration/assess/function/function.assessor.js +40 -0
- package/lib/commands/gen2-migration/assess/function/function.assessor.js.map +1 -0
- package/lib/commands/gen2-migration/assess/geo/geo-geofence-collection.assessor.d.ts +10 -0
- package/lib/commands/gen2-migration/assess/geo/geo-geofence-collection.assessor.d.ts.map +1 -0
- package/lib/commands/gen2-migration/assess/geo/geo-geofence-collection.assessor.js +19 -0
- package/lib/commands/gen2-migration/assess/geo/geo-geofence-collection.assessor.js.map +1 -0
- package/lib/commands/gen2-migration/assess/geo/geo-map.assessor.d.ts +10 -0
- package/lib/commands/gen2-migration/assess/geo/geo-map.assessor.d.ts.map +1 -0
- package/lib/commands/gen2-migration/assess/geo/geo-map.assessor.js +15 -0
- package/lib/commands/gen2-migration/assess/geo/geo-map.assessor.js.map +1 -0
- package/lib/commands/gen2-migration/assess/geo/geo-place-index.assessor.d.ts +10 -0
- package/lib/commands/gen2-migration/assess/geo/geo-place-index.assessor.d.ts.map +1 -0
- package/lib/commands/gen2-migration/assess/geo/geo-place-index.assessor.js +15 -0
- package/lib/commands/gen2-migration/assess/geo/geo-place-index.assessor.js.map +1 -0
- package/lib/commands/gen2-migration/assess/storage/dynamodb.assessor.d.ts +10 -0
- package/lib/commands/gen2-migration/assess/storage/dynamodb.assessor.d.ts.map +1 -0
- package/lib/commands/gen2-migration/assess/storage/dynamodb.assessor.js +25 -0
- package/lib/commands/gen2-migration/assess/storage/dynamodb.assessor.js.map +1 -0
- package/lib/commands/gen2-migration/assess/storage/s3.assessor.d.ts +10 -0
- package/lib/commands/gen2-migration/assess/storage/s3.assessor.d.ts.map +1 -0
- package/lib/commands/gen2-migration/assess/storage/s3.assessor.js +25 -0
- package/lib/commands/gen2-migration/assess/storage/s3.assessor.js.map +1 -0
- package/lib/commands/gen2-migration/assess.d.ts +9 -0
- package/lib/commands/gen2-migration/assess.d.ts.map +1 -0
- package/lib/commands/gen2-migration/assess.js +80 -0
- package/lib/commands/gen2-migration/assess.js.map +1 -0
- package/lib/commands/gen2-migration/decommission.d.ts +6 -5
- package/lib/commands/gen2-migration/decommission.d.ts.map +1 -1
- package/lib/commands/gen2-migration/decommission.js +82 -25
- package/lib/commands/gen2-migration/decommission.js.map +1 -1
- package/lib/commands/gen2-migration/generate/_infra/aws-fetcher.d.ts +32 -0
- package/lib/commands/gen2-migration/generate/_infra/aws-fetcher.d.ts.map +1 -0
- package/lib/commands/gen2-migration/generate/_infra/aws-fetcher.js +136 -0
- package/lib/commands/gen2-migration/generate/_infra/aws-fetcher.js.map +1 -0
- package/lib/commands/gen2-migration/generate/_infra/files.d.ts +2 -0
- package/lib/commands/gen2-migration/generate/_infra/files.d.ts.map +1 -0
- package/lib/commands/gen2-migration/generate/{codegen-head/directory_exists.js → _infra/files.js} +4 -5
- package/lib/commands/gen2-migration/generate/_infra/files.js.map +1 -0
- package/lib/commands/gen2-migration/generate/_infra/gen1-app.d.ts +40 -0
- package/lib/commands/gen2-migration/generate/_infra/gen1-app.d.ts.map +1 -0
- package/lib/commands/gen2-migration/generate/_infra/gen1-app.js +198 -0
- package/lib/commands/gen2-migration/generate/_infra/gen1-app.js.map +1 -0
- package/lib/commands/gen2-migration/generate/_infra/ts.d.ts +24 -0
- package/lib/commands/gen2-migration/generate/_infra/ts.d.ts.map +1 -0
- package/lib/commands/gen2-migration/generate/_infra/ts.js +128 -0
- package/lib/commands/gen2-migration/generate/_infra/ts.js.map +1 -0
- package/lib/commands/gen2-migration/generate/amplify/analytics/cfn-condition-resolver.d.ts +18 -0
- package/lib/commands/gen2-migration/generate/amplify/analytics/cfn-condition-resolver.d.ts.map +1 -0
- package/lib/commands/gen2-migration/generate/amplify/analytics/cfn-condition-resolver.js +126 -0
- package/lib/commands/gen2-migration/generate/amplify/analytics/cfn-condition-resolver.js.map +1 -0
- package/lib/commands/gen2-migration/generate/amplify/analytics/kinesis-cfn-converter.d.ts +33 -0
- package/lib/commands/gen2-migration/generate/amplify/analytics/kinesis-cfn-converter.d.ts.map +1 -0
- package/lib/commands/gen2-migration/generate/{unsupported/cdk-from-cfn.js → amplify/analytics/kinesis-cfn-converter.js} +94 -52
- package/lib/commands/gen2-migration/generate/amplify/analytics/kinesis-cfn-converter.js.map +1 -0
- package/lib/commands/gen2-migration/generate/amplify/analytics/kinesis.generator.d.ts +14 -0
- package/lib/commands/gen2-migration/generate/amplify/analytics/kinesis.generator.d.ts.map +1 -0
- package/lib/commands/gen2-migration/generate/amplify/analytics/kinesis.generator.js +69 -0
- package/lib/commands/gen2-migration/generate/amplify/analytics/kinesis.generator.js.map +1 -0
- package/lib/commands/gen2-migration/generate/amplify/analytics/kinesis.renderer.d.ts +18 -0
- package/lib/commands/gen2-migration/generate/amplify/analytics/kinesis.renderer.d.ts.map +1 -0
- package/lib/commands/gen2-migration/generate/amplify/analytics/kinesis.renderer.js +68 -0
- package/lib/commands/gen2-migration/generate/amplify/analytics/kinesis.renderer.js.map +1 -0
- package/lib/commands/gen2-migration/generate/amplify/auth/auth.generator.d.ts +24 -0
- package/lib/commands/gen2-migration/generate/amplify/auth/auth.generator.d.ts.map +1 -0
- package/lib/commands/gen2-migration/generate/amplify/auth/auth.generator.js +233 -0
- package/lib/commands/gen2-migration/generate/amplify/auth/auth.generator.js.map +1 -0
- package/lib/commands/gen2-migration/generate/amplify/auth/auth.renderer.d.ts +78 -0
- package/lib/commands/gen2-migration/generate/amplify/auth/auth.renderer.d.ts.map +1 -0
- package/lib/commands/gen2-migration/generate/amplify/auth/auth.renderer.js +491 -0
- package/lib/commands/gen2-migration/generate/amplify/auth/auth.renderer.js.map +1 -0
- package/lib/commands/gen2-migration/generate/amplify/auth/reference-auth.generator.d.ts +15 -0
- package/lib/commands/gen2-migration/generate/amplify/auth/reference-auth.generator.d.ts.map +1 -0
- package/lib/commands/gen2-migration/generate/amplify/auth/reference-auth.generator.js +75 -0
- package/lib/commands/gen2-migration/generate/amplify/auth/reference-auth.generator.js.map +1 -0
- package/lib/commands/gen2-migration/generate/amplify/auth/reference-auth.renderer.d.ts +13 -0
- package/lib/commands/gen2-migration/generate/amplify/auth/reference-auth.renderer.d.ts.map +1 -0
- package/lib/commands/gen2-migration/generate/amplify/auth/reference-auth.renderer.js +33 -0
- package/lib/commands/gen2-migration/generate/amplify/auth/reference-auth.renderer.js.map +1 -0
- package/lib/commands/gen2-migration/generate/amplify/backend.generator.d.ts +22 -0
- package/lib/commands/gen2-migration/generate/amplify/backend.generator.d.ts.map +1 -0
- package/lib/commands/gen2-migration/generate/amplify/backend.generator.js +150 -0
- package/lib/commands/gen2-migration/generate/amplify/backend.generator.js.map +1 -0
- package/lib/commands/gen2-migration/generate/{custom-resources/transformer → amplify/custom-resources}/amplify-helper-transformer.d.ts +4 -0
- package/lib/commands/gen2-migration/generate/amplify/custom-resources/amplify-helper-transformer.d.ts.map +1 -0
- package/lib/commands/gen2-migration/generate/amplify/custom-resources/amplify-helper-transformer.js +333 -0
- package/lib/commands/gen2-migration/generate/amplify/custom-resources/amplify-helper-transformer.js.map +1 -0
- package/lib/commands/gen2-migration/generate/amplify/custom-resources/custom.generator.d.ts +17 -0
- package/lib/commands/gen2-migration/generate/amplify/custom-resources/custom.generator.d.ts.map +1 -0
- package/lib/commands/gen2-migration/generate/amplify/custom-resources/custom.generator.js +190 -0
- package/lib/commands/gen2-migration/generate/amplify/custom-resources/custom.generator.js.map +1 -0
- package/lib/commands/gen2-migration/generate/amplify/data/data.generator.d.ts +15 -0
- package/lib/commands/gen2-migration/generate/amplify/data/data.generator.d.ts.map +1 -0
- package/lib/commands/gen2-migration/generate/amplify/data/data.generator.js +112 -0
- package/lib/commands/gen2-migration/generate/amplify/data/data.generator.js.map +1 -0
- package/lib/commands/gen2-migration/generate/amplify/data/data.renderer.d.ts +22 -0
- package/lib/commands/gen2-migration/generate/amplify/data/data.renderer.d.ts.map +1 -0
- package/lib/commands/gen2-migration/generate/amplify/data/data.renderer.js +167 -0
- package/lib/commands/gen2-migration/generate/amplify/data/data.renderer.js.map +1 -0
- package/lib/commands/gen2-migration/generate/amplify/function/function.generator.d.ts +49 -0
- package/lib/commands/gen2-migration/generate/amplify/function/function.generator.d.ts.map +1 -0
- package/lib/commands/gen2-migration/generate/amplify/function/function.generator.js +626 -0
- package/lib/commands/gen2-migration/generate/amplify/function/function.generator.js.map +1 -0
- package/lib/commands/gen2-migration/generate/amplify/function/function.renderer.d.ts +21 -0
- package/lib/commands/gen2-migration/generate/amplify/function/function.renderer.d.ts.map +1 -0
- package/lib/commands/gen2-migration/generate/amplify/function/function.renderer.js +105 -0
- package/lib/commands/gen2-migration/generate/amplify/function/function.renderer.js.map +1 -0
- package/lib/commands/gen2-migration/generate/amplify/geo/geo-cfn-converter.d.ts +49 -0
- package/lib/commands/gen2-migration/generate/amplify/geo/geo-cfn-converter.d.ts.map +1 -0
- package/lib/commands/gen2-migration/generate/amplify/geo/geo-cfn-converter.js +239 -0
- package/lib/commands/gen2-migration/generate/amplify/geo/geo-cfn-converter.js.map +1 -0
- package/lib/commands/gen2-migration/generate/amplify/geo/geo.generator.d.ts +14 -0
- package/lib/commands/gen2-migration/generate/amplify/geo/geo.generator.d.ts.map +1 -0
- package/lib/commands/gen2-migration/generate/amplify/geo/geo.generator.js +70 -0
- package/lib/commands/gen2-migration/generate/amplify/geo/geo.generator.js.map +1 -0
- package/lib/commands/gen2-migration/generate/amplify/geo/geo.renderer.d.ts +13 -0
- package/lib/commands/gen2-migration/generate/amplify/geo/geo.renderer.d.ts.map +1 -0
- package/lib/commands/gen2-migration/generate/amplify/geo/geo.renderer.js +161 -0
- package/lib/commands/gen2-migration/generate/amplify/geo/geo.renderer.js.map +1 -0
- package/lib/commands/gen2-migration/generate/amplify/package.json.generator.d.ts +8 -0
- package/lib/commands/gen2-migration/generate/amplify/package.json.generator.d.ts.map +1 -0
- package/lib/commands/gen2-migration/generate/amplify/package.json.generator.js +28 -0
- package/lib/commands/gen2-migration/generate/amplify/package.json.generator.js.map +1 -0
- package/lib/commands/gen2-migration/generate/amplify/rest-api/rest-api.generator.d.ts +15 -0
- package/lib/commands/gen2-migration/generate/amplify/rest-api/rest-api.generator.d.ts.map +1 -0
- package/lib/commands/gen2-migration/generate/amplify/rest-api/rest-api.generator.js +162 -0
- package/lib/commands/gen2-migration/generate/amplify/rest-api/rest-api.generator.js.map +1 -0
- package/lib/commands/gen2-migration/generate/amplify/rest-api/rest-api.renderer.d.ts +51 -0
- package/lib/commands/gen2-migration/generate/amplify/rest-api/rest-api.renderer.d.ts.map +1 -0
- package/lib/commands/gen2-migration/generate/amplify/rest-api/rest-api.renderer.js +269 -0
- package/lib/commands/gen2-migration/generate/amplify/rest-api/rest-api.renderer.js.map +1 -0
- package/lib/commands/gen2-migration/generate/amplify/storage/dynamodb.generator.d.ts +14 -0
- package/lib/commands/gen2-migration/generate/amplify/storage/dynamodb.generator.d.ts.map +1 -0
- package/lib/commands/gen2-migration/generate/amplify/storage/dynamodb.generator.js +96 -0
- package/lib/commands/gen2-migration/generate/amplify/storage/dynamodb.generator.js.map +1 -0
- package/lib/commands/gen2-migration/generate/amplify/storage/dynamodb.renderer.d.ts +30 -0
- package/lib/commands/gen2-migration/generate/amplify/storage/dynamodb.renderer.d.ts.map +1 -0
- package/lib/commands/gen2-migration/generate/amplify/storage/dynamodb.renderer.js +90 -0
- package/lib/commands/gen2-migration/generate/amplify/storage/dynamodb.renderer.js.map +1 -0
- package/lib/commands/gen2-migration/generate/amplify/storage/s3.generator.d.ts +22 -0
- package/lib/commands/gen2-migration/generate/amplify/storage/s3.generator.d.ts.map +1 -0
- package/lib/commands/gen2-migration/generate/amplify/storage/s3.generator.js +132 -0
- package/lib/commands/gen2-migration/generate/amplify/storage/s3.generator.js.map +1 -0
- package/lib/commands/gen2-migration/generate/amplify/storage/s3.renderer.d.ts +31 -0
- package/lib/commands/gen2-migration/generate/amplify/storage/s3.renderer.d.ts.map +1 -0
- package/lib/commands/gen2-migration/generate/amplify/storage/s3.renderer.js +137 -0
- package/lib/commands/gen2-migration/generate/amplify/storage/s3.renderer.js.map +1 -0
- package/lib/commands/gen2-migration/generate/amplify/tsconfig.generator.d.ts +8 -0
- package/lib/commands/gen2-migration/generate/amplify/tsconfig.generator.d.ts.map +1 -0
- package/lib/commands/gen2-migration/generate/amplify/tsconfig.generator.js +45 -0
- package/lib/commands/gen2-migration/generate/amplify/tsconfig.generator.js.map +1 -0
- package/lib/commands/gen2-migration/generate/amplify.yml.generator.d.ts +9 -0
- package/lib/commands/gen2-migration/generate/amplify.yml.generator.d.ts.map +1 -0
- package/lib/commands/gen2-migration/generate/amplify.yml.generator.js +112 -0
- package/lib/commands/gen2-migration/generate/amplify.yml.generator.js.map +1 -0
- package/lib/commands/gen2-migration/generate/gitignore.generator.d.ts +6 -0
- package/lib/commands/gen2-migration/generate/gitignore.generator.d.ts.map +1 -0
- package/lib/commands/gen2-migration/generate/gitignore.generator.js +45 -0
- package/lib/commands/gen2-migration/generate/gitignore.generator.js.map +1 -0
- package/lib/commands/gen2-migration/generate/package.json.generator.d.ts +12 -0
- package/lib/commands/gen2-migration/generate/package.json.generator.d.ts.map +1 -0
- package/lib/commands/gen2-migration/generate/package.json.generator.js +83 -0
- package/lib/commands/gen2-migration/generate/package.json.generator.js.map +1 -0
- package/lib/commands/gen2-migration/generate.d.ts +6 -5
- package/lib/commands/gen2-migration/generate.d.ts.map +1 -1
- package/lib/commands/gen2-migration/generate.js +232 -17
- package/lib/commands/gen2-migration/generate.js.map +1 -1
- package/lib/commands/gen2-migration/lock.d.ts +10 -6
- package/lib/commands/gen2-migration/lock.d.ts.map +1 -1
- package/lib/commands/gen2-migration/lock.js +182 -64
- package/lib/commands/gen2-migration/lock.js.map +1 -1
- package/lib/commands/gen2-migration/refactor/analytics/analytics-forward.d.ts +9 -0
- package/lib/commands/gen2-migration/refactor/analytics/analytics-forward.d.ts.map +1 -0
- package/lib/commands/gen2-migration/refactor/analytics/analytics-forward.js +19 -0
- package/lib/commands/gen2-migration/refactor/analytics/analytics-forward.js.map +1 -0
- package/lib/commands/gen2-migration/refactor/analytics/analytics-rollback.d.ts +9 -0
- package/lib/commands/gen2-migration/refactor/analytics/analytics-rollback.d.ts.map +1 -0
- package/lib/commands/gen2-migration/refactor/analytics/analytics-rollback.js +26 -0
- package/lib/commands/gen2-migration/refactor/analytics/analytics-rollback.js.map +1 -0
- package/lib/commands/gen2-migration/refactor/auth/auth-cognito-forward.d.ts +21 -0
- package/lib/commands/gen2-migration/refactor/auth/auth-cognito-forward.d.ts.map +1 -0
- package/lib/commands/gen2-migration/refactor/auth/auth-cognito-forward.js +87 -0
- package/lib/commands/gen2-migration/refactor/auth/auth-cognito-forward.js.map +1 -0
- package/lib/commands/gen2-migration/refactor/auth/auth-cognito-rollback.d.ts +9 -0
- package/lib/commands/gen2-migration/refactor/auth/auth-cognito-rollback.d.ts.map +1 -0
- package/lib/commands/gen2-migration/refactor/auth/auth-cognito-rollback.js +44 -0
- package/lib/commands/gen2-migration/refactor/auth/auth-cognito-rollback.js.map +1 -0
- package/lib/commands/gen2-migration/refactor/auth/auth-user-pool-groups-forward.d.ts +11 -0
- package/lib/commands/gen2-migration/refactor/auth/auth-user-pool-groups-forward.d.ts.map +1 -0
- package/lib/commands/gen2-migration/refactor/auth/auth-user-pool-groups-forward.js +33 -0
- package/lib/commands/gen2-migration/refactor/auth/auth-user-pool-groups-forward.js.map +1 -0
- package/lib/commands/gen2-migration/refactor/auth/auth-user-pool-groups-rollback.d.ts +9 -0
- package/lib/commands/gen2-migration/refactor/auth/auth-user-pool-groups-rollback.d.ts.map +1 -0
- package/lib/commands/gen2-migration/refactor/auth/auth-user-pool-groups-rollback.js +26 -0
- package/lib/commands/gen2-migration/refactor/auth/auth-user-pool-groups-rollback.js.map +1 -0
- package/lib/commands/gen2-migration/refactor/cfn.d.ts +41 -0
- package/lib/commands/gen2-migration/refactor/cfn.d.ts.map +1 -0
- package/lib/commands/gen2-migration/refactor/cfn.js +337 -0
- package/lib/commands/gen2-migration/refactor/cfn.js.map +1 -0
- package/lib/commands/gen2-migration/refactor/index.d.ts +1 -1
- package/lib/commands/gen2-migration/refactor/index.d.ts.map +1 -1
- package/lib/commands/gen2-migration/refactor/index.js +1 -1
- package/lib/commands/gen2-migration/refactor/index.js.map +1 -1
- package/lib/commands/gen2-migration/refactor/oauth-values-retriever.d.ts +23 -11
- package/lib/commands/gen2-migration/refactor/oauth-values-retriever.d.ts.map +1 -1
- package/lib/commands/gen2-migration/refactor/oauth-values-retriever.js +53 -45
- package/lib/commands/gen2-migration/refactor/oauth-values-retriever.js.map +1 -1
- package/lib/commands/gen2-migration/refactor/resolvers/cfn-condition-resolver.d.ts +2 -11
- package/lib/commands/gen2-migration/refactor/resolvers/cfn-condition-resolver.d.ts.map +1 -1
- package/lib/commands/gen2-migration/refactor/resolvers/cfn-condition-resolver.js +89 -123
- package/lib/commands/gen2-migration/refactor/resolvers/cfn-condition-resolver.js.map +1 -1
- package/lib/commands/gen2-migration/refactor/resolvers/cfn-dependency-resolver.d.ts +2 -7
- package/lib/commands/gen2-migration/refactor/resolvers/cfn-dependency-resolver.d.ts.map +1 -1
- package/lib/commands/gen2-migration/refactor/resolvers/cfn-dependency-resolver.js +6 -22
- package/lib/commands/gen2-migration/refactor/resolvers/cfn-dependency-resolver.js.map +1 -1
- package/lib/commands/gen2-migration/refactor/resolvers/cfn-output-resolver.d.ts +8 -12
- package/lib/commands/gen2-migration/refactor/resolvers/cfn-output-resolver.d.ts.map +1 -1
- package/lib/commands/gen2-migration/refactor/resolvers/cfn-output-resolver.js +105 -127
- package/lib/commands/gen2-migration/refactor/resolvers/cfn-output-resolver.js.map +1 -1
- package/lib/commands/gen2-migration/refactor/resolvers/cfn-parameter-resolver.d.ts +2 -8
- package/lib/commands/gen2-migration/refactor/resolvers/cfn-parameter-resolver.d.ts.map +1 -1
- package/lib/commands/gen2-migration/refactor/resolvers/cfn-parameter-resolver.js +36 -41
- package/lib/commands/gen2-migration/refactor/resolvers/cfn-parameter-resolver.js.map +1 -1
- package/lib/commands/gen2-migration/refactor/resolvers/cfn-tree-walker.d.ts +3 -0
- package/lib/commands/gen2-migration/refactor/resolvers/cfn-tree-walker.d.ts.map +1 -0
- package/lib/commands/gen2-migration/refactor/resolvers/cfn-tree-walker.js +18 -0
- package/lib/commands/gen2-migration/refactor/resolvers/cfn-tree-walker.js.map +1 -0
- package/lib/commands/gen2-migration/refactor/stack-facade.d.ts +13 -0
- package/lib/commands/gen2-migration/refactor/stack-facade.d.ts.map +1 -0
- package/lib/commands/gen2-migration/refactor/stack-facade.js +39 -0
- package/lib/commands/gen2-migration/refactor/stack-facade.js.map +1 -0
- package/lib/commands/gen2-migration/refactor/storage/storage-dynamo-forward.d.ts +8 -0
- package/lib/commands/gen2-migration/refactor/storage/storage-dynamo-forward.d.ts.map +1 -0
- package/lib/commands/gen2-migration/refactor/storage/storage-dynamo-forward.js +18 -0
- package/lib/commands/gen2-migration/refactor/storage/storage-dynamo-forward.js.map +1 -0
- package/lib/commands/gen2-migration/refactor/storage/storage-dynamo-rollback.d.ts +9 -0
- package/lib/commands/gen2-migration/refactor/storage/storage-dynamo-rollback.d.ts.map +1 -0
- package/lib/commands/gen2-migration/refactor/storage/storage-dynamo-rollback.js +26 -0
- package/lib/commands/gen2-migration/refactor/storage/storage-dynamo-rollback.js.map +1 -0
- package/lib/commands/gen2-migration/refactor/storage/storage-forward.d.ts +10 -0
- package/lib/commands/gen2-migration/refactor/storage/storage-forward.d.ts.map +1 -0
- package/lib/commands/gen2-migration/refactor/storage/storage-forward.js +36 -0
- package/lib/commands/gen2-migration/refactor/storage/storage-forward.js.map +1 -0
- package/lib/commands/gen2-migration/refactor/storage/storage-rollback.d.ts +9 -0
- package/lib/commands/gen2-migration/refactor/storage/storage-rollback.d.ts.map +1 -0
- package/lib/commands/gen2-migration/refactor/storage/storage-rollback.js +26 -0
- package/lib/commands/gen2-migration/refactor/storage/storage-rollback.js.map +1 -0
- package/lib/commands/gen2-migration/refactor/utils.d.ts +1 -1
- package/lib/commands/gen2-migration/refactor/utils.d.ts.map +1 -1
- package/lib/commands/gen2-migration/refactor/utils.js +2 -2
- package/lib/commands/gen2-migration/refactor/utils.js.map +1 -1
- package/lib/commands/gen2-migration/refactor/workflow/category-refactorer.d.ts +52 -0
- package/lib/commands/gen2-migration/refactor/workflow/category-refactorer.d.ts.map +1 -0
- package/lib/commands/gen2-migration/refactor/workflow/category-refactorer.js +212 -0
- package/lib/commands/gen2-migration/refactor/workflow/category-refactorer.js.map +1 -0
- package/lib/commands/gen2-migration/refactor/workflow/forward-category-refactorer.d.ts +15 -0
- package/lib/commands/gen2-migration/refactor/workflow/forward-category-refactorer.d.ts.map +1 -0
- package/lib/commands/gen2-migration/refactor/workflow/forward-category-refactorer.js +148 -0
- package/lib/commands/gen2-migration/refactor/workflow/forward-category-refactorer.js.map +1 -0
- package/lib/commands/gen2-migration/refactor/workflow/rollback-category-refactorer.d.ts +13 -0
- package/lib/commands/gen2-migration/refactor/workflow/rollback-category-refactorer.d.ts.map +1 -0
- package/lib/commands/gen2-migration/refactor/workflow/rollback-category-refactorer.js +123 -0
- package/lib/commands/gen2-migration/refactor/workflow/rollback-category-refactorer.js.map +1 -0
- package/lib/commands/gen2-migration/refactor.d.ts +11 -0
- package/lib/commands/gen2-migration/refactor.d.ts.map +1 -0
- package/lib/commands/gen2-migration/refactor.js +189 -0
- package/lib/commands/gen2-migration/refactor.js.map +1 -0
- package/lib/commands/gen2-migration.d.ts +0 -12
- package/lib/commands/gen2-migration.d.ts.map +1 -1
- package/lib/commands/gen2-migration.js +82 -111
- package/lib/commands/gen2-migration.js.map +1 -1
- package/package.json +22 -12
- package/aws-amplify-cli-internal-gen2-migration-experimental-alpha-0.5.0.tgz +0 -0
- package/lib/commands/drift-detection/services/file-service.d.ts +0 -7
- package/lib/commands/drift-detection/services/file-service.d.ts.map +0 -1
- package/lib/commands/drift-detection/services/file-service.js +0 -53
- package/lib/commands/drift-detection/services/file-service.js.map +0 -1
- package/lib/commands/gen2-migration/_step.d.ts +0 -17
- package/lib/commands/gen2-migration/_step.d.ts.map +0 -1
- package/lib/commands/gen2-migration/_step.js +0 -16
- package/lib/commands/gen2-migration/_step.js.map +0 -1
- package/lib/commands/gen2-migration/_validations.d.ts.map +0 -1
- package/lib/commands/gen2-migration/_validations.js.map +0 -1
- package/lib/commands/gen2-migration/cleanup.d.ts +0 -8
- package/lib/commands/gen2-migration/cleanup.d.ts.map +0 -1
- package/lib/commands/gen2-migration/cleanup.js +0 -21
- package/lib/commands/gen2-migration/cleanup.js.map +0 -1
- package/lib/commands/gen2-migration/clone.d.ts +0 -8
- package/lib/commands/gen2-migration/clone.d.ts.map +0 -1
- package/lib/commands/gen2-migration/clone.js +0 -21
- package/lib/commands/gen2-migration/clone.js.map +0 -1
- package/lib/commands/gen2-migration/generate/adapters/auth/index.d.ts +0 -24
- package/lib/commands/gen2-migration/generate/adapters/auth/index.d.ts.map +0 -1
- package/lib/commands/gen2-migration/generate/adapters/auth/index.js +0 -297
- package/lib/commands/gen2-migration/generate/adapters/auth/index.js.map +0 -1
- package/lib/commands/gen2-migration/generate/adapters/auth/index.test.d.ts +0 -2
- package/lib/commands/gen2-migration/generate/adapters/auth/index.test.d.ts.map +0 -1
- package/lib/commands/gen2-migration/generate/adapters/auth/index.test.js +0 -140
- package/lib/commands/gen2-migration/generate/adapters/auth/index.test.js.map +0 -1
- package/lib/commands/gen2-migration/generate/adapters/data/index.d.ts +0 -5
- package/lib/commands/gen2-migration/generate/adapters/data/index.d.ts.map +0 -1
- package/lib/commands/gen2-migration/generate/adapters/data/index.js +0 -17
- package/lib/commands/gen2-migration/generate/adapters/data/index.js.map +0 -1
- package/lib/commands/gen2-migration/generate/adapters/functions/api-trigger-detector.d.ts +0 -10
- package/lib/commands/gen2-migration/generate/adapters/functions/api-trigger-detector.d.ts.map +0 -1
- package/lib/commands/gen2-migration/generate/adapters/functions/api-trigger-detector.js +0 -43
- package/lib/commands/gen2-migration/generate/adapters/functions/api-trigger-detector.js.map +0 -1
- package/lib/commands/gen2-migration/generate/adapters/functions/api-trigger-detector.test.d.ts +0 -2
- package/lib/commands/gen2-migration/generate/adapters/functions/api-trigger-detector.test.d.ts.map +0 -1
- package/lib/commands/gen2-migration/generate/adapters/functions/api-trigger-detector.test.js +0 -34
- package/lib/commands/gen2-migration/generate/adapters/functions/api-trigger-detector.test.js.map +0 -1
- package/lib/commands/gen2-migration/generate/adapters/functions/index.d.ts +0 -18
- package/lib/commands/gen2-migration/generate/adapters/functions/index.d.ts.map +0 -1
- package/lib/commands/gen2-migration/generate/adapters/functions/index.js +0 -85
- package/lib/commands/gen2-migration/generate/adapters/functions/index.js.map +0 -1
- package/lib/commands/gen2-migration/generate/adapters/project/index.d.ts +0 -2
- package/lib/commands/gen2-migration/generate/adapters/project/index.d.ts.map +0 -1
- package/lib/commands/gen2-migration/generate/adapters/project/index.js +0 -7
- package/lib/commands/gen2-migration/generate/adapters/project/index.js.map +0 -1
- package/lib/commands/gen2-migration/generate/adapters/storage/gen1_storage_codegen_adapter.d.ts +0 -31
- package/lib/commands/gen2-migration/generate/adapters/storage/gen1_storage_codegen_adapter.d.ts.map +0 -1
- package/lib/commands/gen2-migration/generate/adapters/storage/gen1_storage_codegen_adapter.js +0 -34
- package/lib/commands/gen2-migration/generate/adapters/storage/gen1_storage_codegen_adapter.js.map +0 -1
- package/lib/commands/gen2-migration/generate/adapters/storage/gen1_storage_codegen_adapter.test.d.ts +0 -2
- package/lib/commands/gen2-migration/generate/adapters/storage/gen1_storage_codegen_adapter.test.d.ts.map +0 -1
- package/lib/commands/gen2-migration/generate/adapters/storage/gen1_storage_codegen_adapter.test.js +0 -181
- package/lib/commands/gen2-migration/generate/adapters/storage/gen1_storage_codegen_adapter.test.js.map +0 -1
- package/lib/commands/gen2-migration/generate/adapters/storage/index.d.ts +0 -3
- package/lib/commands/gen2-migration/generate/adapters/storage/index.d.ts.map +0 -1
- package/lib/commands/gen2-migration/generate/adapters/storage/index.js +0 -10
- package/lib/commands/gen2-migration/generate/adapters/storage/index.js.map +0 -1
- package/lib/commands/gen2-migration/generate/adapters/storage/storage_access.d.ts +0 -25
- package/lib/commands/gen2-migration/generate/adapters/storage/storage_access.d.ts.map +0 -1
- package/lib/commands/gen2-migration/generate/adapters/storage/storage_access.js +0 -76
- package/lib/commands/gen2-migration/generate/adapters/storage/storage_access.js.map +0 -1
- package/lib/commands/gen2-migration/generate/adapters/storage/storage_access.test.d.ts +0 -2
- package/lib/commands/gen2-migration/generate/adapters/storage/storage_access.test.d.ts.map +0 -1
- package/lib/commands/gen2-migration/generate/adapters/storage/storage_access.test.js +0 -125
- package/lib/commands/gen2-migration/generate/adapters/storage/storage_access.test.js.map +0 -1
- package/lib/commands/gen2-migration/generate/backend/synthesizer.d.ts +0 -91
- package/lib/commands/gen2-migration/generate/backend/synthesizer.d.ts.map +0 -1
- package/lib/commands/gen2-migration/generate/backend/synthesizer.js +0 -1014
- package/lib/commands/gen2-migration/generate/backend/synthesizer.js.map +0 -1
- package/lib/commands/gen2-migration/generate/backend/synthesizer.test.d.ts +0 -2
- package/lib/commands/gen2-migration/generate/backend/synthesizer.test.d.ts.map +0 -1
- package/lib/commands/gen2-migration/generate/backend/synthesizer.test.js +0 -777
- package/lib/commands/gen2-migration/generate/backend/synthesizer.test.js.map +0 -1
- package/lib/commands/gen2-migration/generate/codegen-head/amplify_stack_parser.d.ts +0 -14
- package/lib/commands/gen2-migration/generate/codegen-head/amplify_stack_parser.d.ts.map +0 -1
- package/lib/commands/gen2-migration/generate/codegen-head/amplify_stack_parser.js +0 -82
- package/lib/commands/gen2-migration/generate/codegen-head/amplify_stack_parser.js.map +0 -1
- package/lib/commands/gen2-migration/generate/codegen-head/analytics.d.ts +0 -10
- package/lib/commands/gen2-migration/generate/codegen-head/analytics.d.ts.map +0 -1
- package/lib/commands/gen2-migration/generate/codegen-head/analytics.js +0 -11
- package/lib/commands/gen2-migration/generate/codegen-head/analytics.js.map +0 -1
- package/lib/commands/gen2-migration/generate/codegen-head/api-cfn-access.d.ts +0 -7
- package/lib/commands/gen2-migration/generate/codegen-head/api-cfn-access.d.ts.map +0 -1
- package/lib/commands/gen2-migration/generate/codegen-head/api-cfn-access.js +0 -80
- package/lib/commands/gen2-migration/generate/codegen-head/api-cfn-access.js.map +0 -1
- package/lib/commands/gen2-migration/generate/codegen-head/app_analytics_definition_fetcher.d.ts +0 -13
- package/lib/commands/gen2-migration/generate/codegen-head/app_analytics_definition_fetcher.d.ts.map +0 -1
- package/lib/commands/gen2-migration/generate/codegen-head/app_analytics_definition_fetcher.js +0 -59
- package/lib/commands/gen2-migration/generate/codegen-head/app_analytics_definition_fetcher.js.map +0 -1
- package/lib/commands/gen2-migration/generate/codegen-head/app_auth_definition_fetcher.d.ts +0 -24
- package/lib/commands/gen2-migration/generate/codegen-head/app_auth_definition_fetcher.d.ts.map +0 -1
- package/lib/commands/gen2-migration/generate/codegen-head/app_auth_definition_fetcher.js +0 -167
- package/lib/commands/gen2-migration/generate/codegen-head/app_auth_definition_fetcher.js.map +0 -1
- package/lib/commands/gen2-migration/generate/codegen-head/app_functions_definition_fetcher.d.ts +0 -21
- package/lib/commands/gen2-migration/generate/codegen-head/app_functions_definition_fetcher.d.ts.map +0 -1
- package/lib/commands/gen2-migration/generate/codegen-head/app_functions_definition_fetcher.js +0 -135
- package/lib/commands/gen2-migration/generate/codegen-head/app_functions_definition_fetcher.js.map +0 -1
- package/lib/commands/gen2-migration/generate/codegen-head/app_storage_definition_fetcher.d.ts +0 -23
- package/lib/commands/gen2-migration/generate/codegen-head/app_storage_definition_fetcher.d.ts.map +0 -1
- package/lib/commands/gen2-migration/generate/codegen-head/app_storage_definition_fetcher.js +0 -181
- package/lib/commands/gen2-migration/generate/codegen-head/app_storage_definition_fetcher.js.map +0 -1
- package/lib/commands/gen2-migration/generate/codegen-head/auth_access_analyzer.d.ts +0 -12
- package/lib/commands/gen2-migration/generate/codegen-head/auth_access_analyzer.d.ts.map +0 -1
- package/lib/commands/gen2-migration/generate/codegen-head/auth_access_analyzer.js +0 -157
- package/lib/commands/gen2-migration/generate/codegen-head/auth_access_analyzer.js.map +0 -1
- package/lib/commands/gen2-migration/generate/codegen-head/backend_downloader.d.ts +0 -10
- package/lib/commands/gen2-migration/generate/codegen-head/backend_downloader.d.ts.map +0 -1
- package/lib/commands/gen2-migration/generate/codegen-head/backend_downloader.js +0 -48
- package/lib/commands/gen2-migration/generate/codegen-head/backend_downloader.js.map +0 -1
- package/lib/commands/gen2-migration/generate/codegen-head/backend_environment_selector.d.ts +0 -11
- package/lib/commands/gen2-migration/generate/codegen-head/backend_environment_selector.d.ts.map +0 -1
- package/lib/commands/gen2-migration/generate/codegen-head/backend_environment_selector.js +0 -38
- package/lib/commands/gen2-migration/generate/codegen-head/backend_environment_selector.js.map +0 -1
- package/lib/commands/gen2-migration/generate/codegen-head/command-handlers.d.ts +0 -13
- package/lib/commands/gen2-migration/generate/codegen-head/command-handlers.d.ts.map +0 -1
- package/lib/commands/gen2-migration/generate/codegen-head/command-handlers.js +0 -498
- package/lib/commands/gen2-migration/generate/codegen-head/command-handlers.js.map +0 -1
- package/lib/commands/gen2-migration/generate/codegen-head/data_definition_fetcher.d.ts +0 -47
- package/lib/commands/gen2-migration/generate/codegen-head/data_definition_fetcher.d.ts.map +0 -1
- package/lib/commands/gen2-migration/generate/codegen-head/data_definition_fetcher.js +0 -222
- package/lib/commands/gen2-migration/generate/codegen-head/data_definition_fetcher.js.map +0 -1
- package/lib/commands/gen2-migration/generate/codegen-head/data_model_access_parser.d.ts +0 -10
- package/lib/commands/gen2-migration/generate/codegen-head/data_model_access_parser.d.ts.map +0 -1
- package/lib/commands/gen2-migration/generate/codegen-head/data_model_access_parser.js +0 -59
- package/lib/commands/gen2-migration/generate/codegen-head/data_model_access_parser.js.map +0 -1
- package/lib/commands/gen2-migration/generate/codegen-head/data_model_access_parser.test.d.ts +0 -2
- package/lib/commands/gen2-migration/generate/codegen-head/data_model_access_parser.test.d.ts.map +0 -1
- package/lib/commands/gen2-migration/generate/codegen-head/data_model_access_parser.test.js +0 -90
- package/lib/commands/gen2-migration/generate/codegen-head/data_model_access_parser.test.js.map +0 -1
- package/lib/commands/gen2-migration/generate/codegen-head/directory_exists.d.ts +0 -2
- package/lib/commands/gen2-migration/generate/codegen-head/directory_exists.d.ts.map +0 -1
- package/lib/commands/gen2-migration/generate/codegen-head/directory_exists.js.map +0 -1
- package/lib/commands/gen2-migration/generate/codegen-head/dynamodb_cfn_access_parser.d.ts +0 -14
- package/lib/commands/gen2-migration/generate/codegen-head/dynamodb_cfn_access_parser.d.ts.map +0 -1
- package/lib/commands/gen2-migration/generate/codegen-head/dynamodb_cfn_access_parser.js +0 -100
- package/lib/commands/gen2-migration/generate/codegen-head/dynamodb_cfn_access_parser.js.map +0 -1
- package/lib/commands/gen2-migration/generate/codegen-head/dynamodb_cfn_access_parser.test.d.ts +0 -2
- package/lib/commands/gen2-migration/generate/codegen-head/dynamodb_cfn_access_parser.test.d.ts.map +0 -1
- package/lib/commands/gen2-migration/generate/codegen-head/dynamodb_cfn_access_parser.test.js +0 -69
- package/lib/commands/gen2-migration/generate/codegen-head/dynamodb_cfn_access_parser.test.js.map +0 -1
- package/lib/commands/gen2-migration/generate/codegen-head/format.d.ts +0 -8
- package/lib/commands/gen2-migration/generate/codegen-head/format.d.ts.map +0 -1
- package/lib/commands/gen2-migration/generate/codegen-head/format.js +0 -66
- package/lib/commands/gen2-migration/generate/codegen-head/format.js.map +0 -1
- package/lib/commands/gen2-migration/generate/codegen-head/logger.d.ts +0 -15
- package/lib/commands/gen2-migration/generate/codegen-head/logger.d.ts.map +0 -1
- package/lib/commands/gen2-migration/generate/codegen-head/logger.js +0 -14
- package/lib/commands/gen2-migration/generate/codegen-head/logger.js.map +0 -1
- package/lib/commands/gen2-migration/generate/codegen-head/printer.d.ts +0 -26
- package/lib/commands/gen2-migration/generate/codegen-head/printer.d.ts.map +0 -1
- package/lib/commands/gen2-migration/generate/codegen-head/printer.js +0 -103
- package/lib/commands/gen2-migration/generate/codegen-head/printer.js.map +0 -1
- package/lib/commands/gen2-migration/generate/codegen-head/s3_cfn_access_parser.d.ts +0 -13
- package/lib/commands/gen2-migration/generate/codegen-head/s3_cfn_access_parser.d.ts.map +0 -1
- package/lib/commands/gen2-migration/generate/codegen-head/s3_cfn_access_parser.js +0 -66
- package/lib/commands/gen2-migration/generate/codegen-head/s3_cfn_access_parser.js.map +0 -1
- package/lib/commands/gen2-migration/generate/codegen-head/s3_cfn_access_parser.test.d.ts +0 -2
- package/lib/commands/gen2-migration/generate/codegen-head/s3_cfn_access_parser.test.d.ts.map +0 -1
- package/lib/commands/gen2-migration/generate/codegen-head/s3_cfn_access_parser.test.js +0 -97
- package/lib/commands/gen2-migration/generate/codegen-head/s3_cfn_access_parser.test.js.map +0 -1
- package/lib/commands/gen2-migration/generate/core/migration-pipeline.d.ts +0 -26
- package/lib/commands/gen2-migration/generate/core/migration-pipeline.d.ts.map +0 -1
- package/lib/commands/gen2-migration/generate/core/migration-pipeline.js +0 -269
- package/lib/commands/gen2-migration/generate/core/migration-pipeline.js.map +0 -1
- package/lib/commands/gen2-migration/generate/custom-resources/generator/backend-updater.d.ts +0 -7
- package/lib/commands/gen2-migration/generate/custom-resources/generator/backend-updater.d.ts.map +0 -1
- package/lib/commands/gen2-migration/generate/custom-resources/generator/backend-updater.js +0 -84
- package/lib/commands/gen2-migration/generate/custom-resources/generator/backend-updater.js.map +0 -1
- package/lib/commands/gen2-migration/generate/custom-resources/generator/dependency-merger.d.ts +0 -8
- package/lib/commands/gen2-migration/generate/custom-resources/generator/dependency-merger.d.ts.map +0 -1
- package/lib/commands/gen2-migration/generate/custom-resources/generator/dependency-merger.js +0 -105
- package/lib/commands/gen2-migration/generate/custom-resources/generator/dependency-merger.js.map +0 -1
- package/lib/commands/gen2-migration/generate/custom-resources/generator/file-converter.d.ts +0 -5
- package/lib/commands/gen2-migration/generate/custom-resources/generator/file-converter.d.ts.map +0 -1
- package/lib/commands/gen2-migration/generate/custom-resources/generator/file-converter.js +0 -88
- package/lib/commands/gen2-migration/generate/custom-resources/generator/file-converter.js.map +0 -1
- package/lib/commands/gen2-migration/generate/custom-resources/generator/gen2-file-generator.d.ts +0 -8
- package/lib/commands/gen2-migration/generate/custom-resources/generator/gen2-file-generator.d.ts.map +0 -1
- package/lib/commands/gen2-migration/generate/custom-resources/generator/gen2-file-generator.js +0 -36
- package/lib/commands/gen2-migration/generate/custom-resources/generator/gen2-file-generator.js.map +0 -1
- package/lib/commands/gen2-migration/generate/custom-resources/parser/cdk-stack-parser.d.ts +0 -5
- package/lib/commands/gen2-migration/generate/custom-resources/parser/cdk-stack-parser.d.ts.map +0 -1
- package/lib/commands/gen2-migration/generate/custom-resources/parser/cdk-stack-parser.js +0 -81
- package/lib/commands/gen2-migration/generate/custom-resources/parser/cdk-stack-parser.js.map +0 -1
- package/lib/commands/gen2-migration/generate/custom-resources/parser/pattern-detector.d.ts +0 -15
- package/lib/commands/gen2-migration/generate/custom-resources/parser/pattern-detector.d.ts.map +0 -1
- package/lib/commands/gen2-migration/generate/custom-resources/parser/pattern-detector.js +0 -35
- package/lib/commands/gen2-migration/generate/custom-resources/parser/pattern-detector.js.map +0 -1
- package/lib/commands/gen2-migration/generate/custom-resources/scanner/custom-resource-scanner.d.ts +0 -5
- package/lib/commands/gen2-migration/generate/custom-resources/scanner/custom-resource-scanner.d.ts.map +0 -1
- package/lib/commands/gen2-migration/generate/custom-resources/scanner/custom-resource-scanner.js +0 -66
- package/lib/commands/gen2-migration/generate/custom-resources/scanner/custom-resource-scanner.js.map +0 -1
- package/lib/commands/gen2-migration/generate/custom-resources/transformer/amplify-helper-transformer.d.ts.map +0 -1
- package/lib/commands/gen2-migration/generate/custom-resources/transformer/amplify-helper-transformer.js +0 -178
- package/lib/commands/gen2-migration/generate/custom-resources/transformer/amplify-helper-transformer.js.map +0 -1
- package/lib/commands/gen2-migration/generate/custom-resources/types.d.ts +0 -38
- package/lib/commands/gen2-migration/generate/custom-resources/types.d.ts.map +0 -1
- package/lib/commands/gen2-migration/generate/custom-resources/types.js.map +0 -1
- package/lib/commands/gen2-migration/generate/generators/analytics/index.d.ts +0 -9
- package/lib/commands/gen2-migration/generate/generators/analytics/index.d.ts.map +0 -1
- package/lib/commands/gen2-migration/generate/generators/analytics/index.js +0 -40
- package/lib/commands/gen2-migration/generate/generators/analytics/index.js.map +0 -1
- package/lib/commands/gen2-migration/generate/generators/auth/index.d.ts +0 -107
- package/lib/commands/gen2-migration/generate/generators/auth/index.d.ts.map +0 -1
- package/lib/commands/gen2-migration/generate/generators/auth/index.js +0 -313
- package/lib/commands/gen2-migration/generate/generators/auth/index.js.map +0 -1
- package/lib/commands/gen2-migration/generate/generators/auth/index.test.d.ts +0 -2
- package/lib/commands/gen2-migration/generate/generators/auth/index.test.d.ts.map +0 -1
- package/lib/commands/gen2-migration/generate/generators/auth/index.test.js +0 -566
- package/lib/commands/gen2-migration/generate/generators/auth/index.test.js.map +0 -1
- package/lib/commands/gen2-migration/generate/generators/data/index.d.ts +0 -35
- package/lib/commands/gen2-migration/generate/generators/data/index.d.ts.map +0 -1
- package/lib/commands/gen2-migration/generate/generators/data/index.js +0 -185
- package/lib/commands/gen2-migration/generate/generators/data/index.js.map +0 -1
- package/lib/commands/gen2-migration/generate/generators/data/index.test.d.ts +0 -2
- package/lib/commands/gen2-migration/generate/generators/data/index.test.d.ts.map +0 -1
- package/lib/commands/gen2-migration/generate/generators/data/index.test.js +0 -47
- package/lib/commands/gen2-migration/generate/generators/data/index.test.js.map +0 -1
- package/lib/commands/gen2-migration/generate/generators/functions/index.d.ts +0 -53
- package/lib/commands/gen2-migration/generate/generators/functions/index.d.ts.map +0 -1
- package/lib/commands/gen2-migration/generate/generators/functions/index.js +0 -125
- package/lib/commands/gen2-migration/generate/generators/functions/index.js.map +0 -1
- package/lib/commands/gen2-migration/generate/generators/functions/lambda.d.ts +0 -6
- package/lib/commands/gen2-migration/generate/generators/functions/lambda.d.ts.map +0 -1
- package/lib/commands/gen2-migration/generate/generators/functions/lambda.js +0 -16
- package/lib/commands/gen2-migration/generate/generators/functions/lambda.js.map +0 -1
- package/lib/commands/gen2-migration/generate/generators/functions/lambda_env_generator.d.ts +0 -3
- package/lib/commands/gen2-migration/generate/generators/functions/lambda_env_generator.d.ts.map +0 -1
- package/lib/commands/gen2-migration/generate/generators/functions/lambda_env_generator.js +0 -106
- package/lib/commands/gen2-migration/generate/generators/functions/lambda_env_generator.js.map +0 -1
- package/lib/commands/gen2-migration/generate/generators/functions/lambda_env_generator.test.d.ts +0 -2
- package/lib/commands/gen2-migration/generate/generators/functions/lambda_env_generator.test.d.ts.map +0 -1
- package/lib/commands/gen2-migration/generate/generators/functions/lambda_env_generator.test.js +0 -120
- package/lib/commands/gen2-migration/generate/generators/functions/lambda_env_generator.test.js.map +0 -1
- package/lib/commands/gen2-migration/generate/generators/storage/access.d.ts +0 -4
- package/lib/commands/gen2-migration/generate/generators/storage/access.d.ts.map +0 -1
- package/lib/commands/gen2-migration/generate/generators/storage/access.js +0 -73
- package/lib/commands/gen2-migration/generate/generators/storage/access.js.map +0 -1
- package/lib/commands/gen2-migration/generate/generators/storage/index.d.ts +0 -37
- package/lib/commands/gen2-migration/generate/generators/storage/index.d.ts.map +0 -1
- package/lib/commands/gen2-migration/generate/generators/storage/index.js +0 -78
- package/lib/commands/gen2-migration/generate/generators/storage/index.js.map +0 -1
- package/lib/commands/gen2-migration/generate/npm_package/renderer.d.ts +0 -27
- package/lib/commands/gen2-migration/generate/npm_package/renderer.d.ts.map +0 -1
- package/lib/commands/gen2-migration/generate/npm_package/renderer.js +0 -28
- package/lib/commands/gen2-migration/generate/npm_package/renderer.js.map +0 -1
- package/lib/commands/gen2-migration/generate/render_pipeline.d.ts +0 -9
- package/lib/commands/gen2-migration/generate/render_pipeline.d.ts.map +0 -1
- package/lib/commands/gen2-migration/generate/render_pipeline.js +0 -15
- package/lib/commands/gen2-migration/generate/render_pipeline.js.map +0 -1
- package/lib/commands/gen2-migration/generate/renderers/ensure_directory.d.ts +0 -7
- package/lib/commands/gen2-migration/generate/renderers/ensure_directory.d.ts.map +0 -1
- package/lib/commands/gen2-migration/generate/renderers/ensure_directory.js +0 -17
- package/lib/commands/gen2-migration/generate/renderers/ensure_directory.js.map +0 -1
- package/lib/commands/gen2-migration/generate/renderers/package_json.d.ts +0 -8
- package/lib/commands/gen2-migration/generate/renderers/package_json.d.ts.map +0 -1
- package/lib/commands/gen2-migration/generate/renderers/package_json.js +0 -15
- package/lib/commands/gen2-migration/generate/renderers/package_json.js.map +0 -1
- package/lib/commands/gen2-migration/generate/renderers/typescript_block_node.d.ts +0 -11
- package/lib/commands/gen2-migration/generate/renderers/typescript_block_node.d.ts.map +0 -1
- package/lib/commands/gen2-migration/generate/renderers/typescript_block_node.js +0 -22
- package/lib/commands/gen2-migration/generate/renderers/typescript_block_node.js.map +0 -1
- package/lib/commands/gen2-migration/generate/resource/resource.d.ts +0 -20
- package/lib/commands/gen2-migration/generate/resource/resource.d.ts.map +0 -1
- package/lib/commands/gen2-migration/generate/resource/resource.js +0 -60
- package/lib/commands/gen2-migration/generate/resource/resource.js.map +0 -1
- package/lib/commands/gen2-migration/generate/test_utils/import_regex.d.ts +0 -2
- package/lib/commands/gen2-migration/generate/test_utils/import_regex.d.ts.map +0 -1
- package/lib/commands/gen2-migration/generate/test_utils/import_regex.js +0 -6
- package/lib/commands/gen2-migration/generate/test_utils/import_regex.js.map +0 -1
- package/lib/commands/gen2-migration/generate/test_utils/ts_node_printer.d.ts +0 -4
- package/lib/commands/gen2-migration/generate/test_utils/ts_node_printer.d.ts.map +0 -1
- package/lib/commands/gen2-migration/generate/test_utils/ts_node_printer.js +0 -22
- package/lib/commands/gen2-migration/generate/test_utils/ts_node_printer.js.map +0 -1
- package/lib/commands/gen2-migration/generate/todo_error.d.ts +0 -3
- package/lib/commands/gen2-migration/generate/todo_error.d.ts.map +0 -1
- package/lib/commands/gen2-migration/generate/todo_error.js +0 -11
- package/lib/commands/gen2-migration/generate/todo_error.js.map +0 -1
- package/lib/commands/gen2-migration/generate/ts_factory_utils.d.ts +0 -3
- package/lib/commands/gen2-migration/generate/ts_factory_utils.d.ts.map +0 -1
- package/lib/commands/gen2-migration/generate/ts_factory_utils.js +0 -10
- package/lib/commands/gen2-migration/generate/ts_factory_utils.js.map +0 -1
- package/lib/commands/gen2-migration/generate/types.d.ts +0 -4
- package/lib/commands/gen2-migration/generate/types.d.ts.map +0 -1
- package/lib/commands/gen2-migration/generate/types.js.map +0 -1
- package/lib/commands/gen2-migration/generate/unsupported/cdk-from-cfn.d.ts +0 -26
- package/lib/commands/gen2-migration/generate/unsupported/cdk-from-cfn.d.ts.map +0 -1
- package/lib/commands/gen2-migration/generate/unsupported/cdk-from-cfn.js.map +0 -1
- package/lib/commands/gen2-migration/refactor/cfn-stack-refactor-updater.d.ts +0 -5
- package/lib/commands/gen2-migration/refactor/cfn-stack-refactor-updater.d.ts.map +0 -1
- package/lib/commands/gen2-migration/refactor/cfn-stack-refactor-updater.js +0 -76
- package/lib/commands/gen2-migration/refactor/cfn-stack-refactor-updater.js.map +0 -1
- package/lib/commands/gen2-migration/refactor/cfn-stack-updater.d.ts +0 -6
- package/lib/commands/gen2-migration/refactor/cfn-stack-updater.d.ts.map +0 -1
- package/lib/commands/gen2-migration/refactor/cfn-stack-updater.js +0 -52
- package/lib/commands/gen2-migration/refactor/cfn-stack-updater.js.map +0 -1
- package/lib/commands/gen2-migration/refactor/generators/category-template-generator.d.ts +0 -40
- package/lib/commands/gen2-migration/refactor/generators/category-template-generator.d.ts.map +0 -1
- package/lib/commands/gen2-migration/refactor/generators/category-template-generator.js +0 -321
- package/lib/commands/gen2-migration/refactor/generators/category-template-generator.js.map +0 -1
- package/lib/commands/gen2-migration/refactor/generators/template-generator.d.ts +0 -48
- package/lib/commands/gen2-migration/refactor/generators/template-generator.d.ts.map +0 -1
- package/lib/commands/gen2-migration/refactor/generators/template-generator.js +0 -513
- package/lib/commands/gen2-migration/refactor/generators/template-generator.js.map +0 -1
- package/lib/commands/gen2-migration/refactor/refactor.d.ts +0 -19
- package/lib/commands/gen2-migration/refactor/refactor.d.ts.map +0 -1
- package/lib/commands/gen2-migration/refactor/refactor.js +0 -241
- package/lib/commands/gen2-migration/refactor/refactor.js.map +0 -1
- package/lib/commands/gen2-migration/refactor/types.d.ts +0 -128
- package/lib/commands/gen2-migration/refactor/types.d.ts.map +0 -1
- package/lib/commands/gen2-migration/refactor/types.js +0 -59
- package/lib/commands/gen2-migration/refactor/types.js.map +0 -1
- package/lib/commands/gen2-migration/shift.d.ts +0 -8
- package/lib/commands/gen2-migration/shift.d.ts.map +0 -1
- package/lib/commands/gen2-migration/shift.js +0 -21
- package/lib/commands/gen2-migration/shift.js.map +0 -1
- package/lib/commands/gen2-migration/stateful-resources.d.ts.map +0 -1
- package/lib/commands/gen2-migration/stateful-resources.js.map +0 -1
- /package/lib/commands/gen2-migration/{stateful-resources.d.ts → _infra/stateful-resources.d.ts} +0 -0
- /package/lib/commands/gen2-migration/{stateful-resources.js → _infra/stateful-resources.js} +0 -0
package/lib/commands/gen2-migration/generate/codegen-head/app_functions_definition_fetcher.js
DELETED
|
@@ -1,135 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
-
}) : function(o, v) {
|
|
16
|
-
o["default"] = v;
|
|
17
|
-
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
-
var ownKeys = function(o) {
|
|
20
|
-
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
-
var ar = [];
|
|
22
|
-
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
-
return ar;
|
|
24
|
-
};
|
|
25
|
-
return ownKeys(o);
|
|
26
|
-
};
|
|
27
|
-
return function (mod) {
|
|
28
|
-
if (mod && mod.__esModule) return mod;
|
|
29
|
-
var result = {};
|
|
30
|
-
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
-
__setModuleDefault(result, mod);
|
|
32
|
-
return result;
|
|
33
|
-
};
|
|
34
|
-
})();
|
|
35
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
36
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
37
|
-
};
|
|
38
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
|
-
exports.AppFunctionsDefinitionFetcher = void 0;
|
|
40
|
-
const node_assert_1 = __importDefault(require("node:assert"));
|
|
41
|
-
const index_1 = require("../adapters/functions/index");
|
|
42
|
-
const client_lambda_1 = require("@aws-sdk/client-lambda");
|
|
43
|
-
const client_cloudwatch_events_1 = require("@aws-sdk/client-cloudwatch-events");
|
|
44
|
-
const path = __importStar(require("path"));
|
|
45
|
-
const amplify_cli_core_1 = require("@aws-amplify/amplify-cli-core");
|
|
46
|
-
class AppFunctionsDefinitionFetcher {
|
|
47
|
-
constructor(lambdaClient, cloudWatchEventsClient, backendEnvironmentResolver, stateManager, ccbFetcher, authAnalyzer) {
|
|
48
|
-
this.lambdaClient = lambdaClient;
|
|
49
|
-
this.cloudWatchEventsClient = cloudWatchEventsClient;
|
|
50
|
-
this.backendEnvironmentResolver = backendEnvironmentResolver;
|
|
51
|
-
this.stateManager = stateManager;
|
|
52
|
-
this.ccbFetcher = ccbFetcher;
|
|
53
|
-
this.authAnalyzer = authAnalyzer;
|
|
54
|
-
this.getDefinition = async () => {
|
|
55
|
-
var _a, _b, _c;
|
|
56
|
-
const backendEnvironment = await this.backendEnvironmentResolver.selectBackendEnvironment();
|
|
57
|
-
(0, node_assert_1.default)(backendEnvironment === null || backendEnvironment === void 0 ? void 0 : backendEnvironment.stackName);
|
|
58
|
-
const currentCloudBackendDirectory = await this.ccbFetcher.getCurrentCloudBackend(backendEnvironment.deploymentArtifacts);
|
|
59
|
-
const amplifyMetaPath = path.join(currentCloudBackendDirectory, 'amplify-meta.json');
|
|
60
|
-
const meta = amplify_cli_core_1.JSONUtilities.readJson(amplifyMetaPath, { throwIfNotExist: true });
|
|
61
|
-
const functions = (_a = meta === null || meta === void 0 ? void 0 : meta.function) !== null && _a !== void 0 ? _a : {};
|
|
62
|
-
const auth = (_b = meta === null || meta === void 0 ? void 0 : meta.auth) !== null && _b !== void 0 ? _b : {};
|
|
63
|
-
const storageList = (_c = meta === null || meta === void 0 ? void 0 : meta.storage) !== null && _c !== void 0 ? _c : {};
|
|
64
|
-
const functionCategoryMap = new Map();
|
|
65
|
-
const authValues = Object.values(auth).find((resourceConfig) => resourceConfig && typeof resourceConfig === 'object' && 'service' in resourceConfig && (resourceConfig === null || resourceConfig === void 0 ? void 0 : resourceConfig.service) === 'Cognito');
|
|
66
|
-
if (auth && authValues && authValues.dependsOn) {
|
|
67
|
-
for (const env of authValues.dependsOn) {
|
|
68
|
-
if (env.category == 'function') {
|
|
69
|
-
functionCategoryMap.set(env.resourceName, 'auth');
|
|
70
|
-
}
|
|
71
|
-
}
|
|
72
|
-
}
|
|
73
|
-
Object.keys(storageList).forEach((storage) => {
|
|
74
|
-
const storageObj = storageList[storage];
|
|
75
|
-
if (storageObj.dependsOn) {
|
|
76
|
-
for (const env of storageObj.dependsOn) {
|
|
77
|
-
if (env.category == 'function') {
|
|
78
|
-
functionCategoryMap.set(env.resourceName, 'storage');
|
|
79
|
-
}
|
|
80
|
-
}
|
|
81
|
-
}
|
|
82
|
-
});
|
|
83
|
-
Object.keys(functions).forEach((func) => {
|
|
84
|
-
const funcObj = functions[func];
|
|
85
|
-
if (funcObj.dependsOn) {
|
|
86
|
-
for (const env of funcObj.dependsOn) {
|
|
87
|
-
if (env.category == 'storage') {
|
|
88
|
-
functionCategoryMap.set(func, 'storage');
|
|
89
|
-
}
|
|
90
|
-
}
|
|
91
|
-
}
|
|
92
|
-
});
|
|
93
|
-
const getFunctionPromises = Object.keys(functions).map((key) => {
|
|
94
|
-
return this.lambdaClient.send(new client_lambda_1.GetFunctionCommand({
|
|
95
|
-
FunctionName: meta.function[key].output.Name,
|
|
96
|
-
}));
|
|
97
|
-
});
|
|
98
|
-
const functionConfigurations = (await Promise.all(getFunctionPromises))
|
|
99
|
-
.map((functionResponse) => { var _a; return (_a = functionResponse.Configuration) !== null && _a !== void 0 ? _a : null; })
|
|
100
|
-
.filter((config) => config !== null);
|
|
101
|
-
const getFunctionSchedulePromises = Object.keys(functions).map(async (key) => {
|
|
102
|
-
var _a, _b, _c;
|
|
103
|
-
const functionName = meta.function[key].output.Name;
|
|
104
|
-
let ruleName;
|
|
105
|
-
try {
|
|
106
|
-
const policyResponse = await this.lambdaClient.send(new client_lambda_1.GetPolicyCommand({ FunctionName: functionName }));
|
|
107
|
-
const policy = JSON.parse((_a = policyResponse.Policy) !== null && _a !== void 0 ? _a : '{}');
|
|
108
|
-
ruleName = (_c = (_b = policy.Statement) === null || _b === void 0 ? void 0 : _b.find((statement) => { var _a, _b, _c; return (_c = (_b = (_a = statement.Condition) === null || _a === void 0 ? void 0 : _a.ArnLike) === null || _b === void 0 ? void 0 : _b['AWS:SourceArn']) === null || _c === void 0 ? void 0 : _c.includes('rule/'); })) === null || _c === void 0 ? void 0 : _c.Condition.ArnLike['AWS:SourceArn'].split('/').pop();
|
|
109
|
-
}
|
|
110
|
-
catch (error) {
|
|
111
|
-
return { functionName, scheduleExpression: undefined };
|
|
112
|
-
}
|
|
113
|
-
let scheduleExpression;
|
|
114
|
-
if (ruleName) {
|
|
115
|
-
try {
|
|
116
|
-
const ruleResponse = await this.cloudWatchEventsClient.send(new client_cloudwatch_events_1.DescribeRuleCommand({ Name: ruleName }));
|
|
117
|
-
scheduleExpression = ruleResponse.ScheduleExpression;
|
|
118
|
-
}
|
|
119
|
-
catch (error) {
|
|
120
|
-
scheduleExpression = undefined;
|
|
121
|
-
}
|
|
122
|
-
}
|
|
123
|
-
return {
|
|
124
|
-
functionName,
|
|
125
|
-
scheduleExpression,
|
|
126
|
-
};
|
|
127
|
-
});
|
|
128
|
-
const functionSchedules = await Promise.all(getFunctionSchedulePromises);
|
|
129
|
-
const functionAuthAccess = await this.authAnalyzer.getFunctionAuthAccess();
|
|
130
|
-
return (0, index_1.getFunctionDefinition)(functionConfigurations, functionSchedules, functionCategoryMap, meta, functionAuthAccess);
|
|
131
|
-
};
|
|
132
|
-
}
|
|
133
|
-
}
|
|
134
|
-
exports.AppFunctionsDefinitionFetcher = AppFunctionsDefinitionFetcher;
|
|
135
|
-
//# sourceMappingURL=app_functions_definition_fetcher.js.map
|
package/lib/commands/gen2-migration/generate/codegen-head/app_functions_definition_fetcher.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"app_functions_definition_fetcher.js","sourceRoot":"","sources":["../../../../../src/commands/gen2-migration/generate/codegen-head/app_functions_definition_fetcher.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,8DAAiC;AAEjC,uDAAoE;AAEpE,0DAA4F;AAC5F,gFAAgG;AAChG,2CAA6B;AAC7B,oEAAqF;AA+CrF,MAAa,6BAA6B;IASxC,YACU,YAA0B,EAC1B,sBAA8C,EAC9C,0BAAsD,EACtD,YAA0B,EAC1B,UAA6B,EAC7B,YAAgC;QALhC,iBAAY,GAAZ,YAAY,CAAc;QAC1B,2BAAsB,GAAtB,sBAAsB,CAAwB;QAC9C,+BAA0B,GAA1B,0BAA0B,CAA4B;QACtD,iBAAY,GAAZ,YAAY,CAAc;QAC1B,eAAU,GAAV,UAAU,CAAmB;QAC7B,iBAAY,GAAZ,YAAY,CAAoB;QAiB1C,kBAAa,GAAG,KAAK,IAA+C,EAAE;;YAEpE,MAAM,kBAAkB,GAAG,MAAM,IAAI,CAAC,0BAA0B,CAAC,wBAAw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;gBAG3C,IAAI,QAAQ,EAAE,CAAC;oBACb,IAAI,CAAC;wBACH,MAAM,YAAY,GAAG,MAAM,IAAI,CAAC,sBAAsB,CAAC,IAAI,CAAC,IAAI,8CAAmB,CAAC,EAAE,IAAI,EAAE,QAAQ,EAAE,CAAC,CAAC,CAAC;wBACzG,kBAAkB,GAAG,YAAY,CAAC,kBAAkB,CAAC;oBACvD,CAAC;oBAAC,OAAO,KAAK,EAAE,CAAC;wBAEf,kBAAkB,GAAG,SAAS,CAAC;oBACjC,CAAC;gBACH,CAAC;gBAED,OAAO;oBACL,YAAY;oBACZ,kBAAkB;iBACnB,CAAC;YACJ,CAAC,CAAC,CAAC;YAGH,MAAM,iBAAiB,GAAG,MAAM,OAAO,CAAC,GAAG,CAAC,2BAA2B,CAAC,CAAC;YAGzE,MAAM,kBAAkB,GAAG,MAAM,IAAI,CAAC,YAAY,CAAC,qBAAqB,EAAE,CAAC;YAQ3E,OAAO,IAAA,6BAAqB,EAAC,sBAAsB,EAAE,iBAAiB,EAAE,mBAAmB,EAAE,IAAI,EAAE,kBAAkB,CAAC,CAAC;QACzH,CAAC,CAAC;IAlJC,CAAC;CAmJL;AAnKD,sEAmKC"}
|
package/lib/commands/gen2-migration/generate/codegen-head/app_storage_definition_fetcher.d.ts
DELETED
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import { getStorageDefinition } from '../adapters/storage/index';
|
|
2
|
-
import { BackendDownloader } from './backend_downloader';
|
|
3
|
-
import { StorageRenderParameters } from '../core/migration-pipeline';
|
|
4
|
-
import { S3Client } from '@aws-sdk/client-s3';
|
|
5
|
-
import { BackendEnvironmentResolver } from './backend_environment_selector';
|
|
6
|
-
import { DynamoDBClient } from '@aws-sdk/client-dynamodb';
|
|
7
|
-
export interface AppStorageDefinitionFetcher {
|
|
8
|
-
getDefinition(): Promise<ReturnType<typeof getStorageDefinition> | undefined>;
|
|
9
|
-
}
|
|
10
|
-
export declare class AppStorageDefinitionFetcher {
|
|
11
|
-
private backendEnvironmentResolver;
|
|
12
|
-
private ccbFetcher;
|
|
13
|
-
private s3Client;
|
|
14
|
-
private dynamoClient;
|
|
15
|
-
constructor(backendEnvironmentResolver: BackendEnvironmentResolver, ccbFetcher: BackendDownloader, s3Client: S3Client, dynamoClient?: DynamoDBClient);
|
|
16
|
-
private readJsonFile;
|
|
17
|
-
private getFunctionPath;
|
|
18
|
-
private getStorageTriggers;
|
|
19
|
-
private fetchDynamoDBTable;
|
|
20
|
-
private mapAttributeType;
|
|
21
|
-
getDefinition: () => Promise<StorageRenderParameters | undefined>;
|
|
22
|
-
}
|
|
23
|
-
//# sourceMappingURL=app_storage_definition_fetcher.d.ts.map
|
package/lib/commands/gen2-migration/generate/codegen-head/app_storage_definition_fetcher.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"app_storage_definition_fetcher.d.ts","sourceRoot":"","sources":["../../../../../src/commands/gen2-migration/generate/codegen-head/app_storage_definition_fetcher.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,oBAAoB,EAA2D,MAAM,2BAA2B,CAAC;AAC1H,OAAO,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AACzD,OAAO,EAAE,uBAAuB,EAAkE,MAAM,4BAA4B,CAAC;AACrI,OAAO,EAEL,QAAQ,EAKT,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,0BAA0B,EAAE,MAAM,gCAAgC,CAAC;AAE5E,OAAO,EAAE,cAAc,EAAwB,MAAM,0BAA0B,CAAC;AAEhF,MAAM,WAAW,2BAA2B;IAC1C,aAAa,IAAI,OAAO,CAAC,UAAU,CAAC,OAAO,oBAAoB,CAAC,GAAG,SAAS,CAAC,CAAC;CAC/E;AAUD,qBAAa,2BAA2B;IAEpC,OAAO,CAAC,0BAA0B;IAClC,OAAO,CAAC,UAAU;IAClB,OAAO,CAAC,QAAQ;IAChB,OAAO,CAAC,YAAY;gBAHZ,0BAA0B,EAAE,0BAA0B,EACtD,UAAU,EAAE,iBAAiB,EAC7B,QAAQ,EAAE,QAAQ,EAClB,YAAY,GAAE,cAAuC;IAE/D,OAAO,CAAC,YAAY,CAGlB;IACF,OAAO,CAAC,eAAe,CAErB;IACF,OAAO,CAAC,kBAAkB,CAiBxB;IAGF,OAAO,CAAC,kBAAkB,CAuExB;IAEF,OAAO,CAAC,gBAAgB,CAWtB;IAEF,aAAa,QAAa,OAAO,CAAC,uBAAuB,GAAG,SAAS,CAAC,CAiGpE;CACH"}
|
|
@@ -1,181 +0,0 @@
|
|
|
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.AppStorageDefinitionFetcher = void 0;
|
|
7
|
-
const promises_1 = __importDefault(require("node:fs/promises"));
|
|
8
|
-
const node_path_1 = __importDefault(require("node:path"));
|
|
9
|
-
const index_1 = require("../adapters/storage/index");
|
|
10
|
-
const client_s3_1 = require("@aws-sdk/client-s3");
|
|
11
|
-
const directory_exists_1 = require("./directory_exists");
|
|
12
|
-
const client_dynamodb_1 = require("@aws-sdk/client-dynamodb");
|
|
13
|
-
class AppStorageDefinitionFetcher {
|
|
14
|
-
constructor(backendEnvironmentResolver, ccbFetcher, s3Client, dynamoClient = new client_dynamodb_1.DynamoDBClient({})) {
|
|
15
|
-
this.backendEnvironmentResolver = backendEnvironmentResolver;
|
|
16
|
-
this.ccbFetcher = ccbFetcher;
|
|
17
|
-
this.s3Client = s3Client;
|
|
18
|
-
this.dynamoClient = dynamoClient;
|
|
19
|
-
this.readJsonFile = async (filePath) => {
|
|
20
|
-
const contents = await promises_1.default.readFile(filePath, { encoding: 'utf8' });
|
|
21
|
-
return JSON.parse(contents);
|
|
22
|
-
};
|
|
23
|
-
this.getFunctionPath = (functionName) => {
|
|
24
|
-
return node_path_1.default.join('amplify', 'backend', 'function', functionName, 'src');
|
|
25
|
-
};
|
|
26
|
-
this.getStorageTriggers = (connections) => {
|
|
27
|
-
var _a;
|
|
28
|
-
const triggers = {};
|
|
29
|
-
const lambdaFunctionConfigurations = connections.LambdaFunctionConfigurations || [];
|
|
30
|
-
for (const connection of lambdaFunctionConfigurations) {
|
|
31
|
-
const functionName = connection.LambdaFunctionArn ? (_a = connection.LambdaFunctionArn.split(':').pop()) === null || _a === void 0 ? void 0 : _a.split('-')[0] : '';
|
|
32
|
-
const event = connection.Events ? connection.Events[0] : '';
|
|
33
|
-
if (event.includes('ObjectCreated') && functionName) {
|
|
34
|
-
triggers['onUpload'] = { source: this.getFunctionPath(functionName) };
|
|
35
|
-
}
|
|
36
|
-
else if (event.includes('ObjectRemoved') && functionName) {
|
|
37
|
-
triggers['onDelete'] = { source: this.getFunctionPath(functionName) };
|
|
38
|
-
}
|
|
39
|
-
}
|
|
40
|
-
return triggers;
|
|
41
|
-
};
|
|
42
|
-
this.fetchDynamoDBTable = async (storageName, currentCloudBackendDirectory, storageOutput) => {
|
|
43
|
-
var _a, _b, _c, _d, _e, _f;
|
|
44
|
-
const actualTableName = ((_a = storageOutput.output) === null || _a === void 0 ? void 0 : _a.Name) || storageName;
|
|
45
|
-
const describeResult = await this.dynamoClient.send(new client_dynamodb_1.DescribeTableCommand({ TableName: actualTableName }));
|
|
46
|
-
const table = describeResult.Table;
|
|
47
|
-
const partitionKey = {
|
|
48
|
-
name: table.KeySchema.find((k) => k.KeyType === 'HASH').AttributeName,
|
|
49
|
-
type: this.mapAttributeType(table.AttributeDefinitions.find((a) => a.AttributeName === table.KeySchema.find((k) => k.KeyType === 'HASH').AttributeName)
|
|
50
|
-
.AttributeType),
|
|
51
|
-
};
|
|
52
|
-
let sortKey;
|
|
53
|
-
const sortKeySchema = table.KeySchema.find((k) => k.KeyType === 'RANGE');
|
|
54
|
-
if (sortKeySchema) {
|
|
55
|
-
sortKey = {
|
|
56
|
-
name: sortKeySchema.AttributeName,
|
|
57
|
-
type: this.mapAttributeType(table.AttributeDefinitions.find((a) => a.AttributeName === sortKeySchema.AttributeName).AttributeType),
|
|
58
|
-
};
|
|
59
|
-
}
|
|
60
|
-
const gsis = [];
|
|
61
|
-
if (table.GlobalSecondaryIndexes) {
|
|
62
|
-
table.GlobalSecondaryIndexes.forEach((gsi) => {
|
|
63
|
-
const gsiDef = {
|
|
64
|
-
indexName: gsi.IndexName,
|
|
65
|
-
partitionKey: {
|
|
66
|
-
name: gsi.KeySchema.find((k) => k.KeyType === 'HASH').AttributeName,
|
|
67
|
-
type: this.mapAttributeType(table.AttributeDefinitions.find((a) => a.AttributeName === gsi.KeySchema.find((k) => k.KeyType === 'HASH').AttributeName)
|
|
68
|
-
.AttributeType),
|
|
69
|
-
},
|
|
70
|
-
};
|
|
71
|
-
const gsiSortKey = gsi.KeySchema.find((k) => k.KeyType === 'RANGE');
|
|
72
|
-
if (gsiSortKey) {
|
|
73
|
-
gsiDef.sortKey = {
|
|
74
|
-
name: gsiSortKey.AttributeName,
|
|
75
|
-
type: this.mapAttributeType(table.AttributeDefinitions.find((a) => a.AttributeName === gsiSortKey.AttributeName).AttributeType),
|
|
76
|
-
};
|
|
77
|
-
}
|
|
78
|
-
gsis.push(gsiDef);
|
|
79
|
-
});
|
|
80
|
-
}
|
|
81
|
-
return {
|
|
82
|
-
tableName: actualTableName,
|
|
83
|
-
partitionKey,
|
|
84
|
-
sortKey,
|
|
85
|
-
gsis: gsis.length > 0 ? gsis : undefined,
|
|
86
|
-
billingMode: ((_b = table.BillingModeSummary) === null || _b === void 0 ? void 0 : _b.BillingMode) === 'PAY_PER_REQUEST' ? 'PAY_PER_REQUEST' : 'PROVISIONED',
|
|
87
|
-
readCapacity: ((_c = table.ProvisionedThroughput) === null || _c === void 0 ? void 0 : _c.ReadCapacityUnits) || 5,
|
|
88
|
-
writeCapacity: ((_d = table.ProvisionedThroughput) === null || _d === void 0 ? void 0 : _d.WriteCapacityUnits) || 5,
|
|
89
|
-
streamEnabled: !!((_e = table.StreamSpecification) === null || _e === void 0 ? void 0 : _e.StreamEnabled),
|
|
90
|
-
streamViewType: (_f = table.StreamSpecification) === null || _f === void 0 ? void 0 : _f.StreamViewType,
|
|
91
|
-
};
|
|
92
|
-
};
|
|
93
|
-
this.mapAttributeType = (dynamoType) => {
|
|
94
|
-
switch (dynamoType) {
|
|
95
|
-
case 'S':
|
|
96
|
-
return 'STRING';
|
|
97
|
-
case 'N':
|
|
98
|
-
return 'NUMBER';
|
|
99
|
-
case 'B':
|
|
100
|
-
return 'BINARY';
|
|
101
|
-
default:
|
|
102
|
-
return 'STRING';
|
|
103
|
-
}
|
|
104
|
-
};
|
|
105
|
-
this.getDefinition = async () => {
|
|
106
|
-
var _a;
|
|
107
|
-
const backendEnvironment = await this.backendEnvironmentResolver.selectBackendEnvironment();
|
|
108
|
-
if (!(backendEnvironment === null || backendEnvironment === void 0 ? void 0 : backendEnvironment.deploymentArtifacts))
|
|
109
|
-
return undefined;
|
|
110
|
-
const currentCloudBackendDirectory = await this.ccbFetcher.getCurrentCloudBackend(backendEnvironment.deploymentArtifacts);
|
|
111
|
-
const amplifyMetaPath = node_path_1.default.join(currentCloudBackendDirectory, 'amplify-meta.json');
|
|
112
|
-
if (!(await (0, directory_exists_1.fileOrDirectoryExists)(amplifyMetaPath))) {
|
|
113
|
-
throw new Error('Could not find amplify-meta.json');
|
|
114
|
-
}
|
|
115
|
-
const amplifyMeta = (_a = (await this.readJsonFile(amplifyMetaPath))) !== null && _a !== void 0 ? _a : {};
|
|
116
|
-
let storageOptions = undefined;
|
|
117
|
-
const dynamoTables = [];
|
|
118
|
-
const functionNames = amplifyMeta.function ? Object.keys(amplifyMeta.function) : [];
|
|
119
|
-
if ('storage' in amplifyMeta && Object.keys(amplifyMeta.storage).length) {
|
|
120
|
-
for (const [storageName, storage] of Object.entries(amplifyMeta.storage)) {
|
|
121
|
-
const cliInputsPath = node_path_1.default.join(currentCloudBackendDirectory, 'storage', storageName, 'cli-inputs.json');
|
|
122
|
-
if (!(await (0, directory_exists_1.fileOrDirectoryExists)(cliInputsPath))) {
|
|
123
|
-
throw new Error(`Could not find cli-inputs.json for ${storageName}`);
|
|
124
|
-
}
|
|
125
|
-
const storageOutput = storage;
|
|
126
|
-
if (storageOutput.service === 'S3') {
|
|
127
|
-
const cliInputs = await this.readJsonFile(cliInputsPath);
|
|
128
|
-
const bucketName = storageOutput.output.BucketName;
|
|
129
|
-
if (!bucketName)
|
|
130
|
-
throw new Error('Could not find bucket name');
|
|
131
|
-
const connections = await this.s3Client.send(new client_s3_1.GetBucketNotificationConfigurationCommand({ Bucket: bucketName }));
|
|
132
|
-
const { Status: accelerateConfiguration } = await this.s3Client.send(new client_s3_1.GetBucketAccelerateConfigurationCommand({ Bucket: bucketName }));
|
|
133
|
-
const { Status: versioningConfiguration } = await this.s3Client.send(new client_s3_1.GetBucketVersioningCommand({ Bucket: bucketName }));
|
|
134
|
-
const { ServerSideEncryptionConfiguration: serverSideEncryptionByDefault } = await this.s3Client.send(new client_s3_1.GetBucketEncryptionCommand({ Bucket: bucketName }));
|
|
135
|
-
const triggers = this.getStorageTriggers(connections);
|
|
136
|
-
const storageDefinition = (0, index_1.getStorageDefinition)({
|
|
137
|
-
cliInputs,
|
|
138
|
-
bucketName,
|
|
139
|
-
triggers,
|
|
140
|
-
functionNames,
|
|
141
|
-
});
|
|
142
|
-
if (!storageOptions)
|
|
143
|
-
storageOptions = {};
|
|
144
|
-
storageOptions.accessPatterns = storageDefinition.accessPatterns;
|
|
145
|
-
storageOptions.storageIdentifier = storageDefinition.storageIdentifier;
|
|
146
|
-
storageOptions.triggers = storageDefinition.triggers;
|
|
147
|
-
storageOptions.accelerateConfiguration = accelerateConfiguration;
|
|
148
|
-
storageOptions.versioningConfiguration = versioningConfiguration;
|
|
149
|
-
storageOptions.bucketName = bucketName;
|
|
150
|
-
if (serverSideEncryptionByDefault && serverSideEncryptionByDefault.Rules && serverSideEncryptionByDefault.Rules[0]) {
|
|
151
|
-
const serverSideEncryptionConf = {
|
|
152
|
-
serverSideEncryptionByDefault: serverSideEncryptionByDefault.Rules[0].ApplyServerSideEncryptionByDefault,
|
|
153
|
-
bucketKeyEnabled: serverSideEncryptionByDefault.Rules[0].BucketKeyEnabled,
|
|
154
|
-
};
|
|
155
|
-
storageOptions.bucketEncryptionAlgorithm = serverSideEncryptionConf;
|
|
156
|
-
}
|
|
157
|
-
}
|
|
158
|
-
else if (storageOutput.service === 'DynamoDB') {
|
|
159
|
-
const tableDefinition = await this.fetchDynamoDBTable(storageName, currentCloudBackendDirectory, storageOutput);
|
|
160
|
-
dynamoTables.push(tableDefinition);
|
|
161
|
-
}
|
|
162
|
-
}
|
|
163
|
-
}
|
|
164
|
-
if (dynamoTables.length > 0) {
|
|
165
|
-
if (!storageOptions)
|
|
166
|
-
storageOptions = {};
|
|
167
|
-
storageOptions.dynamoTables = dynamoTables;
|
|
168
|
-
const dynamoStorageDefinition = (0, index_1.getStorageDefinition)({
|
|
169
|
-
dynamoTables,
|
|
170
|
-
functionNames,
|
|
171
|
-
});
|
|
172
|
-
if (dynamoStorageDefinition.dynamoFunctionAccess) {
|
|
173
|
-
storageOptions.dynamoFunctionAccess = dynamoStorageDefinition.dynamoFunctionAccess;
|
|
174
|
-
}
|
|
175
|
-
}
|
|
176
|
-
return storageOptions;
|
|
177
|
-
};
|
|
178
|
-
}
|
|
179
|
-
}
|
|
180
|
-
exports.AppStorageDefinitionFetcher = AppStorageDefinitionFetcher;
|
|
181
|
-
//# sourceMappingURL=app_storage_definition_fetcher.js.map
|
package/lib/commands/gen2-migration/generate/codegen-head/app_storage_definition_fetcher.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"app_storage_definition_fetcher.js","sourceRoot":"","sources":["../../../../../src/commands/gen2-migration/generate/codegen-head/app_storage_definition_fetcher.ts"],"names":[],"mappings":";;;;;;AAAA,gEAAkC;AAClC,0DAA6B;AAC7B,qDAA0H;AAG1H,kDAO4B;AAE5B,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AAY,GAAG,YAAY,CAAC;gBAG3C,MAAM,uBAAuB,GAAG,IAAA,4BAAoB,EAAC;oBACnD,YAAY;oBACZ,aAAa;iBACd,CAAC,CAAC;gBAIH,IAAI,uBAAuB,CAAC,oBAAoB,EAAE,CAAC;oBACjD,cAAc,CAAC,oBAAoB,GAAG,uBAAuB,CAAC,oBAAoB,CAAC;gBACrF,CAAC;YACH,CAAC;YAED,OAAO,cAAc,CAAC;QACxB,CAAC,CAAC;IAnNC,CAAC;CAoNL;AA1ND,kEA0NC"}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { BackendEnvironmentResolver } from './backend_environment_selector';
|
|
2
|
-
import { BackendDownloader } from './backend_downloader';
|
|
3
|
-
import { AuthAccess } from '../generators/functions/index';
|
|
4
|
-
export declare function parseAuthAccessFromTemplate(templateContent: string): AuthAccess;
|
|
5
|
-
export declare class AuthAccessAnalyzer {
|
|
6
|
-
private backendEnvironmentResolver;
|
|
7
|
-
private ccbFetcher;
|
|
8
|
-
constructor(backendEnvironmentResolver: BackendEnvironmentResolver, ccbFetcher: BackendDownloader);
|
|
9
|
-
getFunctionTemplates(): Promise<Map<string, string>>;
|
|
10
|
-
getFunctionAuthAccess(): Promise<Map<string, AuthAccess>>;
|
|
11
|
-
}
|
|
12
|
-
//# sourceMappingURL=auth_access_analyzer.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"auth_access_analyzer.d.ts","sourceRoot":"","sources":["../../../../../src/commands/gen2-migration/generate/codegen-head/auth_access_analyzer.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,0BAA0B,EAAE,MAAM,gCAAgC,CAAC;AAC5E,OAAO,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AAGzD,OAAO,EAAE,UAAU,EAAE,MAAM,+BAA+B,CAAC;AAkG3D,wBAAgB,2BAA2B,CAAC,eAAe,EAAE,MAAM,GAAG,UAAU,CAoC/E;AAMD,qBAAa,kBAAkB;IACjB,OAAO,CAAC,0BAA0B;IAA8B,OAAO,CAAC,UAAU;gBAA1E,0BAA0B,EAAE,0BAA0B,EAAU,UAAU,EAAE,iBAAiB;IAM3G,oBAAoB,IAAI,OAAO,CAAC,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IA+BpD,qBAAqB,IAAI,OAAO,CAAC,GAAG,CAAC,MAAM,EAAE,UAAU,CAAC,CAAC;CAahE"}
|
|
@@ -1,157 +0,0 @@
|
|
|
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.AuthAccessAnalyzer = void 0;
|
|
7
|
-
exports.parseAuthAccessFromTemplate = parseAuthAccessFromTemplate;
|
|
8
|
-
const amplify_cli_core_1 = require("@aws-amplify/amplify-cli-core");
|
|
9
|
-
const directory_exists_1 = require("./directory_exists");
|
|
10
|
-
const node_path_1 = __importDefault(require("node:path"));
|
|
11
|
-
const promises_1 = __importDefault(require("node:fs/promises"));
|
|
12
|
-
const node_assert_1 = __importDefault(require("node:assert"));
|
|
13
|
-
const GROUPED_PERMISSIONS = {
|
|
14
|
-
manageUsers: [
|
|
15
|
-
'cognito-idp:AdminConfirmSignUp',
|
|
16
|
-
'cognito-idp:AdminCreateUser',
|
|
17
|
-
'cognito-idp:AdminDeleteUser',
|
|
18
|
-
'cognito-idp:AdminDeleteUserAttributes',
|
|
19
|
-
'cognito-idp:AdminDisableUser',
|
|
20
|
-
'cognito-idp:AdminEnableUser',
|
|
21
|
-
'cognito-idp:AdminGetUser',
|
|
22
|
-
'cognito-idp:AdminListGroupsForUser',
|
|
23
|
-
'cognito-idp:AdminRespondToAuthChallenge',
|
|
24
|
-
'cognito-idp:AdminSetUserMFAPreference',
|
|
25
|
-
'cognito-idp:AdminSetUserSettings',
|
|
26
|
-
'cognito-idp:AdminUpdateUserAttributes',
|
|
27
|
-
'cognito-idp:AdminUserGlobalSignOut',
|
|
28
|
-
],
|
|
29
|
-
manageGroupMembership: ['cognito-idp:AdminAddUserToGroup', 'cognito-idp:AdminRemoveUserFromGroup'],
|
|
30
|
-
manageGroups: [
|
|
31
|
-
'cognito-idp:GetGroup',
|
|
32
|
-
'cognito-idp:ListGroups',
|
|
33
|
-
'cognito-idp:CreateGroup',
|
|
34
|
-
'cognito-idp:DeleteGroup',
|
|
35
|
-
'cognito-idp:UpdateGroup',
|
|
36
|
-
],
|
|
37
|
-
manageUserDevices: [
|
|
38
|
-
'cognito-idp:AdminForgetDevice',
|
|
39
|
-
'cognito-idp:AdminGetDevice',
|
|
40
|
-
'cognito-idp:AdminListDevices',
|
|
41
|
-
'cognito-idp:AdminUpdateDeviceStatus',
|
|
42
|
-
],
|
|
43
|
-
managePasswordRecovery: ['cognito-idp:AdminResetUserPassword', 'cognito-idp:AdminSetUserPassword'],
|
|
44
|
-
};
|
|
45
|
-
const AUTH_ACTION_MAPPING = {
|
|
46
|
-
'cognito-idp:AdminAddUserToGroup': 'addUserToGroup',
|
|
47
|
-
'cognito-idp:AdminCreateUser': 'createUser',
|
|
48
|
-
'cognito-idp:AdminDeleteUser': 'deleteUser',
|
|
49
|
-
'cognito-idp:AdminDeleteUserAttributes': 'deleteUserAttributes',
|
|
50
|
-
'cognito-idp:AdminDisableUser': 'disableUser',
|
|
51
|
-
'cognito-idp:AdminEnableUser': 'enableUser',
|
|
52
|
-
'cognito-idp:AdminForgetDevice': 'forgetDevice',
|
|
53
|
-
'cognito-idp:AdminGetDevice': 'getDevice',
|
|
54
|
-
'cognito-idp:AdminGetUser': 'getUser',
|
|
55
|
-
'cognito-idp:AdminListDevices': 'listDevices',
|
|
56
|
-
'cognito-idp:AdminListGroupsForUser': 'listGroupsForUser',
|
|
57
|
-
'cognito-idp:AdminRemoveUserFromGroup': 'removeUserFromGroup',
|
|
58
|
-
'cognito-idp:AdminResetUserPassword': 'resetUserPassword',
|
|
59
|
-
'cognito-idp:AdminSetUserMFAPreference': 'setUserMfaPreference',
|
|
60
|
-
'cognito-idp:AdminSetUserPassword': 'setUserPassword',
|
|
61
|
-
'cognito-idp:AdminSetUserSettings': 'setUserSettings',
|
|
62
|
-
'cognito-idp:AdminUpdateDeviceStatus': 'updateDeviceStatus',
|
|
63
|
-
'cognito-idp:AdminUpdateUserAttributes': 'updateUserAttributes',
|
|
64
|
-
'cognito-idp:ListUsers': 'listUsers',
|
|
65
|
-
'cognito-idp:ListUsersInGroup': 'listUsersInGroup',
|
|
66
|
-
'cognito-idp:AdminConfirmSignUp': 'manageUsers',
|
|
67
|
-
'cognito-idp:AdminRespondToAuthChallenge': 'manageUsers',
|
|
68
|
-
'cognito-idp:AdminUserGlobalSignOut': 'manageUsers',
|
|
69
|
-
'cognito-idp:AdminInitiateAuth': 'manageUsers',
|
|
70
|
-
'cognito-idp:AdminUpdateAuthEventFeedback': 'manageUsers',
|
|
71
|
-
'cognito-idp:ForgetDevice': 'forgetDevice',
|
|
72
|
-
'cognito-idp:VerifyUserAttribute': 'updateUserAttributes',
|
|
73
|
-
'cognito-idp:UpdateUserAttributes': 'updateUserAttributes',
|
|
74
|
-
'cognito-idp:SetUserMFAPreference': 'setUserMfaPreference',
|
|
75
|
-
'cognito-idp:SetUserSettings': 'setUserSettings',
|
|
76
|
-
};
|
|
77
|
-
function extractCognitoActionsFromPolicy(amplifyResourcesPolicy) {
|
|
78
|
-
var _a;
|
|
79
|
-
const actions = [];
|
|
80
|
-
const policyDocument = (_a = amplifyResourcesPolicy.Properties) === null || _a === void 0 ? void 0 : _a.PolicyDocument;
|
|
81
|
-
const statements = Array.isArray(policyDocument === null || policyDocument === void 0 ? void 0 : policyDocument.Statement) ? policyDocument.Statement : [policyDocument === null || policyDocument === void 0 ? void 0 : policyDocument.Statement].filter(Boolean);
|
|
82
|
-
for (const statement of statements) {
|
|
83
|
-
const statementActions = Array.isArray(statement.Action) ? statement.Action : [statement.Action];
|
|
84
|
-
for (const action of statementActions) {
|
|
85
|
-
if (typeof action === 'string' && action.startsWith('cognito-idp:')) {
|
|
86
|
-
if (!actions.includes(action)) {
|
|
87
|
-
actions.push(action);
|
|
88
|
-
}
|
|
89
|
-
}
|
|
90
|
-
}
|
|
91
|
-
}
|
|
92
|
-
return actions;
|
|
93
|
-
}
|
|
94
|
-
function parseAuthAccessFromTemplate(templateContent) {
|
|
95
|
-
var _a;
|
|
96
|
-
const authAccess = {};
|
|
97
|
-
const cfnTemplate = JSON.parse(templateContent);
|
|
98
|
-
const amplifyResourcesPolicy = (_a = cfnTemplate.Resources) === null || _a === void 0 ? void 0 : _a.AmplifyResourcesPolicy;
|
|
99
|
-
if (!amplifyResourcesPolicy || amplifyResourcesPolicy.Type !== 'AWS::IAM::Policy') {
|
|
100
|
-
return {};
|
|
101
|
-
}
|
|
102
|
-
const cognitoActions = extractCognitoActionsFromPolicy(amplifyResourcesPolicy);
|
|
103
|
-
const coveredActions = new Set();
|
|
104
|
-
Object.entries(GROUPED_PERMISSIONS).forEach(([groupedPermission, requiredActions]) => {
|
|
105
|
-
const hasAllActions = requiredActions.every((action) => cognitoActions.includes(action));
|
|
106
|
-
if (hasAllActions) {
|
|
107
|
-
authAccess[groupedPermission] = true;
|
|
108
|
-
requiredActions.forEach((action) => coveredActions.add(action));
|
|
109
|
-
}
|
|
110
|
-
});
|
|
111
|
-
cognitoActions.forEach((action) => {
|
|
112
|
-
if (!coveredActions.has(action)) {
|
|
113
|
-
const permission = AUTH_ACTION_MAPPING[action];
|
|
114
|
-
if (permission) {
|
|
115
|
-
authAccess[permission] = true;
|
|
116
|
-
}
|
|
117
|
-
}
|
|
118
|
-
});
|
|
119
|
-
return authAccess;
|
|
120
|
-
}
|
|
121
|
-
class AuthAccessAnalyzer {
|
|
122
|
-
constructor(backendEnvironmentResolver, ccbFetcher) {
|
|
123
|
-
this.backendEnvironmentResolver = backendEnvironmentResolver;
|
|
124
|
-
this.ccbFetcher = ccbFetcher;
|
|
125
|
-
}
|
|
126
|
-
async getFunctionTemplates() {
|
|
127
|
-
var _a;
|
|
128
|
-
const backendEnvironment = await this.backendEnvironmentResolver.selectBackendEnvironment();
|
|
129
|
-
(0, node_assert_1.default)(backendEnvironment === null || backendEnvironment === void 0 ? void 0 : backendEnvironment.deploymentArtifacts);
|
|
130
|
-
const currentCloudBackendDirectory = await this.ccbFetcher.getCurrentCloudBackend(backendEnvironment.deploymentArtifacts);
|
|
131
|
-
const amplifyMetaPath = node_path_1.default.join(currentCloudBackendDirectory, 'amplify-meta.json');
|
|
132
|
-
const meta = amplify_cli_core_1.JSONUtilities.readJson(amplifyMetaPath, { throwIfNotExist: true });
|
|
133
|
-
const functions = (_a = meta === null || meta === void 0 ? void 0 : meta.function) !== null && _a !== void 0 ? _a : {};
|
|
134
|
-
const functionTemplates = new Map();
|
|
135
|
-
for (const functionName of Object.keys(functions)) {
|
|
136
|
-
const templatePath = node_path_1.default.join(currentCloudBackendDirectory, 'function', functionName, `${functionName}-cloudformation-template.json`);
|
|
137
|
-
if (await (0, directory_exists_1.fileOrDirectoryExists)(templatePath)) {
|
|
138
|
-
const templateContent = await promises_1.default.readFile(templatePath, 'utf8');
|
|
139
|
-
functionTemplates.set(functionName, templateContent);
|
|
140
|
-
}
|
|
141
|
-
}
|
|
142
|
-
return functionTemplates;
|
|
143
|
-
}
|
|
144
|
-
async getFunctionAuthAccess() {
|
|
145
|
-
const templates = await this.getFunctionTemplates();
|
|
146
|
-
const authAccessMap = new Map();
|
|
147
|
-
for (const [functionName, templateContent] of templates) {
|
|
148
|
-
const authAccess = parseAuthAccessFromTemplate(templateContent);
|
|
149
|
-
if (Object.keys(authAccess).length > 0) {
|
|
150
|
-
authAccessMap.set(functionName, authAccess);
|
|
151
|
-
}
|
|
152
|
-
}
|
|
153
|
-
return authAccessMap;
|
|
154
|
-
}
|
|
155
|
-
}
|
|
156
|
-
exports.AuthAccessAnalyzer = AuthAccessAnalyzer;
|
|
157
|
-
//# sourceMappingURL=auth_access_analyzer.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"auth_access_analyzer.js","sourceRoot":"","sources":["../../../../../src/commands/gen2-migration/generate/codegen-head/auth_access_analyzer.ts"],"names":[],"mappings":";;;;;;AAsGA,kEAoCC;AAxID,oEAAuE;AACvE,yDAA2D;AAE3D,0DAA6B;AAC7B,gEAAkC;AAClC,8DAAiC;AAGjC,MAAM,mBAAmB,GAAG;IAC1B,WAAW,EAAE;QACX,gCAAgC;QAChC,6BAA6B;QAC7B,6BAA6B;QAC7B,uCAAuC;QACvC,8BAA8B;QAC9B,6BAA6B;QAC7B,0BAA0B;QAC1B,oCAAoC;QACpC,yCAAyC;QACzC,uCAAuC;QACvC,kCAAkC;QAClC,uCAAuC;QACvC,oCAAoC;KACrC;IACD,qBAAqB,EAAE,CAAC,iCAAiC,EAAE,sCAAsC,CAAC;IAClG,YAAY,EAAE;QACZ,sBAAsB;QACtB,wBAAwB;QACxB,yBAAyB;QACzB,yBAAyB;QACzB,yBAAyB;KAC1B;IACD,iBAAiB,EAAE;QACjB,+BAA+B;QAC/B,4BAA4B;QAC5B,8BAA8B;QAC9B,qCAAqC;KACtC;IACD,sBAAsB,EAAE,CAAC,oCAAoC,EAAE,kCAAkC,CAAC;CACnG,CAAC;AAEF,MAAM,mBAAmB,GAAqC;IAE5D,iCAAiC,EAAE,gBAAgB;IACnD,6BAA6B,EAAE,YAAY;IAC3C,6BAA6B,EAAE,YAAY;IAC3C,uCAAuC,EAAE,sBAAsB;IAC/D,8BAA8B,EAAE,aAAa;IAC7C,6BAA6B,EAAE,YAAY;IAC3C,+BAA+B,EAAE,cAAc;IAC/C,4BAA4B,EAAE,WAAW;IACzC,0BAA0B,EAAE,SAAS;IACrC,8BAA8B,EAAE,aAAa;IAC7C,oCAAoC,EAAE,mBAAmB;IACzD,sCAAsC,EAAE,qBAAqB;IAC7D,oCAAoC,EAAE,mBAAmB;IACzD,uCAAuC,EAAE,sBAAsB;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AC;gBAC9C,MAAM,eAAe,GAAG,MAAM,kBAAE,CAAC,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAC,CAAC;gBAChE,iBAAiB,CAAC,GAAG,CAAC,YAAY,EAAE,eAAe,CAAC,CAAC;YACvD,CAAC;QACH,CAAC;QAED,OAAO,iBAAiB,CAAC;IAC3B,CAAC;IAMD,KAAK,CAAC,qBAAqB;QACzB,MAAM,SAAS,GAAG,MAAM,IAAI,CAAC,oBAAoB,EAAE,CAAC;QACpD,MAAM,aAAa,GAAG,IAAI,GAAG,EAAsB,CAAC;QAEpD,KAAK,MAAM,CAAC,YAAY,EAAE,eAAe,CAAC,IAAI,SAAS,EAAE,CAAC;YACxD,MAAM,UAAU,GAAG,2BAA2B,CAAC,eAAe,CAAC,CAAC;YAChE,IAAI,MAAM,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;gBACvC,aAAa,CAAC,GAAG,CAAC,YAAY,EAAE,UAAU,CAAC,CAAC;YAC9C,CAAC;QACH,CAAC;QAED,OAAO,aAAa,CAAC;IACvB,CAAC;CACF;AAnDD,gDAmDC"}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { S3Client } from '@aws-sdk/client-s3';
|
|
2
|
-
export declare class BackendDownloader {
|
|
3
|
-
private s3Client;
|
|
4
|
-
constructor(s3Client: S3Client);
|
|
5
|
-
private static ccbDir;
|
|
6
|
-
private static CURRENT_CLOUD_BACKEND;
|
|
7
|
-
private makeTempDirectory;
|
|
8
|
-
getCurrentCloudBackend: (bucket: string) => Promise<string>;
|
|
9
|
-
}
|
|
10
|
-
//# sourceMappingURL=backend_downloader.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"backend_downloader.d.ts","sourceRoot":"","sources":["../../../../../src/commands/gen2-migration/generate/codegen-head/backend_downloader.ts"],"names":[],"mappings":"AAOA,OAAO,EAAoB,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAIhE,qBAAa,iBAAiB;IAChB,OAAO,CAAC,QAAQ;gBAAR,QAAQ,EAAE,QAAQ;IACtC,OAAO,CAAC,MAAM,CAAC,MAAM,CAAqB;IAE1C,OAAO,CAAC,MAAM,CAAC,qBAAqB,CAA2B;IAC/D,OAAO,CAAC,iBAAiB,CAIvB;IACF,sBAAsB,GAAU,QAAQ,MAAM,KAAG,OAAO,CAAC,MAAM,CAAC,CAuB9D;CACH"}
|
|
@@ -1,48 +0,0 @@
|
|
|
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.BackendDownloader = void 0;
|
|
7
|
-
const node_os_1 = __importDefault(require("node:os"));
|
|
8
|
-
const promises_1 = __importDefault(require("node:fs/promises"));
|
|
9
|
-
const node_path_1 = __importDefault(require("node:path"));
|
|
10
|
-
const node_assert_1 = __importDefault(require("node:assert"));
|
|
11
|
-
const unzipper_1 = __importDefault(require("unzipper"));
|
|
12
|
-
const client_s3_1 = require("@aws-sdk/client-s3");
|
|
13
|
-
const directory_exists_1 = require("./directory_exists");
|
|
14
|
-
class BackendDownloader {
|
|
15
|
-
constructor(s3Client) {
|
|
16
|
-
this.s3Client = s3Client;
|
|
17
|
-
this.makeTempDirectory = async () => {
|
|
18
|
-
const tmpDir = node_os_1.default.tmpdir();
|
|
19
|
-
const { sep } = node_path_1.default;
|
|
20
|
-
return await promises_1.default.mkdtemp(`${tmpDir}${sep}`);
|
|
21
|
-
};
|
|
22
|
-
this.getCurrentCloudBackend = async (bucket) => {
|
|
23
|
-
if (BackendDownloader.ccbDir && (await (0, directory_exists_1.fileOrDirectoryExists)(BackendDownloader.ccbDir))) {
|
|
24
|
-
return BackendDownloader.ccbDir;
|
|
25
|
-
}
|
|
26
|
-
const tmpDir = await this.makeTempDirectory();
|
|
27
|
-
const ccbZippedFilename = `#${BackendDownloader.CURRENT_CLOUD_BACKEND}.zip`;
|
|
28
|
-
const ccbZipPath = node_path_1.default.join(tmpDir, ccbZippedFilename);
|
|
29
|
-
const response = await this.s3Client.send(new client_s3_1.GetObjectCommand({
|
|
30
|
-
Key: ccbZippedFilename,
|
|
31
|
-
Bucket: bucket,
|
|
32
|
-
}));
|
|
33
|
-
(0, node_assert_1.default)(response.Body, 'Body is empty');
|
|
34
|
-
await promises_1.default.writeFile(ccbZipPath, response.Body);
|
|
35
|
-
(0, node_assert_1.default)(await (0, directory_exists_1.fileOrDirectoryExists)(ccbZipPath), `${ccbZipPath} does not exist.`);
|
|
36
|
-
const directory = await unzipper_1.default.Open.file(ccbZipPath);
|
|
37
|
-
await directory.extract({
|
|
38
|
-
path: node_path_1.default.join(tmpDir, BackendDownloader.CURRENT_CLOUD_BACKEND),
|
|
39
|
-
});
|
|
40
|
-
const ccbDir = node_path_1.default.join(tmpDir, BackendDownloader.CURRENT_CLOUD_BACKEND);
|
|
41
|
-
BackendDownloader.ccbDir = ccbDir;
|
|
42
|
-
return ccbDir;
|
|
43
|
-
};
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
exports.BackendDownloader = BackendDownloader;
|
|
47
|
-
BackendDownloader.CURRENT_CLOUD_BACKEND = 'current-cloud-backend';
|
|
48
|
-
//# sourceMappingURL=backend_downloader.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"backend_downloader.js","sourceRoot":"","sources":["../../../../../src/commands/gen2-migration/generate/codegen-head/backend_downloader.ts"],"names":[],"mappings":";;;;;;AAAA,sDAAyB;AACzB,gEAAkC;AAClC,0DAA6B;AAC7B,8DAAiC;AAGjC,wDAAgC;AAChC,kDAAgE;AAEhE,yDAA2D;AAE3D,MAAa,iBAAiB;IAC5B,YAAoB,QAAkB;QAAlB,aAAQ,GAAR,QAAQ,CAAU;QAI9B,sBAAiB,GAAG,KAAK,IAAqB,EAAE;YACtD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