@aws-amplify/cli-internal-gen2-migration-experimental-alpha 0.6.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 +21 -12
- package/aws-amplify-cli-internal-gen2-migration-experimental-alpha-0.6.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
|
@@ -0,0 +1,269 @@
|
|
|
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.RestApiRenderer = void 0;
|
|
7
|
+
const typescript_1 = __importDefault(require("typescript"));
|
|
8
|
+
const factory = typescript_1.default.factory;
|
|
9
|
+
class RestApiRenderer {
|
|
10
|
+
constructor(hasAuth, functionNames) {
|
|
11
|
+
this.hasAuth = hasAuth;
|
|
12
|
+
this.functionNames = functionNames;
|
|
13
|
+
}
|
|
14
|
+
renderApi(restApi) {
|
|
15
|
+
const statements = [];
|
|
16
|
+
const sanitizedName = restApi.apiName.replace(/[^a-zA-Z0-9]/g, '');
|
|
17
|
+
const stackVarName = `${sanitizedName}Stack`;
|
|
18
|
+
const apiVarName = `${sanitizedName}Api`;
|
|
19
|
+
const gen1ApiVarName = `gen1${sanitizedName}Api`;
|
|
20
|
+
const gen1PolicyVarName = `gen1${sanitizedName}Policy`;
|
|
21
|
+
statements.push(this.renderStack(restApi, stackVarName));
|
|
22
|
+
statements.push(this.renderRestApiConstruct(restApi, stackVarName, apiVarName));
|
|
23
|
+
statements.push(...this.renderGatewayResponses(apiVarName));
|
|
24
|
+
const integrations = this.renderLambdaIntegrations(restApi);
|
|
25
|
+
statements.push(...integrations.statements);
|
|
26
|
+
statements.push(this.renderGen1ApiReference(restApi, stackVarName, gen1ApiVarName));
|
|
27
|
+
statements.push(this.renderGen1Policy(restApi, stackVarName, gen1ApiVarName, gen1PolicyVarName));
|
|
28
|
+
if (restApi.authType && this.hasAuth) {
|
|
29
|
+
statements.push(this.renderGen1PolicyAttachment(gen1PolicyVarName));
|
|
30
|
+
}
|
|
31
|
+
statements.push(...this.renderPaths(restApi, apiVarName, integrations.map));
|
|
32
|
+
statements.push(...this.renderPathPolicies(restApi, apiVarName, stackVarName));
|
|
33
|
+
statements.push(this.renderOutput(apiVarName));
|
|
34
|
+
return statements;
|
|
35
|
+
}
|
|
36
|
+
renderStack(restApi, stackVarName) {
|
|
37
|
+
return factory.createVariableStatement([], factory.createVariableDeclarationList([
|
|
38
|
+
factory.createVariableDeclaration(stackVarName, undefined, undefined, factory.createCallExpression(factory.createPropertyAccessExpression(factory.createIdentifier('backend'), factory.createIdentifier('createStack')), undefined, [factory.createStringLiteral(`rest-api-stack-${restApi.apiName}`)])),
|
|
39
|
+
], typescript_1.default.NodeFlags.Const));
|
|
40
|
+
}
|
|
41
|
+
renderRestApiConstruct(restApi, stackVarName, apiVarName) {
|
|
42
|
+
return factory.createVariableStatement([], factory.createVariableDeclarationList([
|
|
43
|
+
factory.createVariableDeclaration(apiVarName, undefined, undefined, factory.createNewExpression(factory.createIdentifier('RestApi'), undefined, [
|
|
44
|
+
factory.createIdentifier(stackVarName),
|
|
45
|
+
factory.createStringLiteral('RestApi'),
|
|
46
|
+
factory.createObjectLiteralExpression([
|
|
47
|
+
factory.createPropertyAssignment('restApiName', factory.createTemplateExpression(factory.createTemplateHead(`${restApi.apiName}-`), [
|
|
48
|
+
factory.createTemplateSpan(factory.createIdentifier('branchName'), factory.createTemplateTail('')),
|
|
49
|
+
])),
|
|
50
|
+
], true),
|
|
51
|
+
])),
|
|
52
|
+
], typescript_1.default.NodeFlags.Const));
|
|
53
|
+
}
|
|
54
|
+
renderGatewayResponses(apiVarName) {
|
|
55
|
+
return [
|
|
56
|
+
this.renderGatewayResponse(apiVarName, 'Default4XX', 'DEFAULT_4XX'),
|
|
57
|
+
this.renderGatewayResponse(apiVarName, 'Default5XX', 'DEFAULT_5XX'),
|
|
58
|
+
];
|
|
59
|
+
}
|
|
60
|
+
renderGatewayResponse(apiVarName, name, responseType) {
|
|
61
|
+
return factory.createExpressionStatement(factory.createCallExpression(factory.createPropertyAccessExpression(factory.createIdentifier(apiVarName), factory.createIdentifier('addGatewayResponse')), undefined, [
|
|
62
|
+
factory.createStringLiteral(name),
|
|
63
|
+
factory.createObjectLiteralExpression([
|
|
64
|
+
factory.createPropertyAssignment('type', factory.createPropertyAccessExpression(factory.createIdentifier('ResponseType'), factory.createIdentifier(responseType))),
|
|
65
|
+
factory.createPropertyAssignment('responseHeaders', factory.createObjectLiteralExpression([
|
|
66
|
+
factory.createPropertyAssignment(factory.createStringLiteral('Access-Control-Allow-Origin'), factory.createStringLiteral("'*'")),
|
|
67
|
+
factory.createPropertyAssignment(factory.createStringLiteral('Access-Control-Allow-Headers'), factory.createStringLiteral("'Content-Type,X-Amz-Date,Authorization,X-Api-Key,X-Amz-Security-Token'")),
|
|
68
|
+
factory.createPropertyAssignment(factory.createStringLiteral('Access-Control-Allow-Methods'), factory.createStringLiteral("'DELETE,GET,HEAD,OPTIONS,PATCH,POST,PUT'")),
|
|
69
|
+
factory.createPropertyAssignment(factory.createStringLiteral('Access-Control-Expose-Headers'), factory.createStringLiteral("'Date,X-Amzn-ErrorType'")),
|
|
70
|
+
], true)),
|
|
71
|
+
], true),
|
|
72
|
+
]));
|
|
73
|
+
}
|
|
74
|
+
renderLambdaIntegrations(restApi) {
|
|
75
|
+
const statements = [];
|
|
76
|
+
const map = new Map();
|
|
77
|
+
if (!restApi.uniqueFunctions) {
|
|
78
|
+
return { statements, map };
|
|
79
|
+
}
|
|
80
|
+
for (const funcName of restApi.uniqueFunctions) {
|
|
81
|
+
const integrationVarName = `${funcName}Integration`;
|
|
82
|
+
map.set(funcName, integrationVarName);
|
|
83
|
+
statements.push(factory.createVariableStatement([], factory.createVariableDeclarationList([
|
|
84
|
+
factory.createVariableDeclaration(integrationVarName, undefined, undefined, factory.createNewExpression(factory.createIdentifier('LambdaIntegration'), undefined, [
|
|
85
|
+
factory.createPropertyAccessExpression(factory.createPropertyAccessExpression(factory.createPropertyAccessExpression(factory.createIdentifier('backend'), factory.createIdentifier(funcName)), factory.createIdentifier('resources')), factory.createIdentifier('lambda')),
|
|
86
|
+
])),
|
|
87
|
+
], typescript_1.default.NodeFlags.Const)));
|
|
88
|
+
}
|
|
89
|
+
return { statements, map };
|
|
90
|
+
}
|
|
91
|
+
renderGen1ApiReference(restApi, stackVarName, gen1ApiVarName) {
|
|
92
|
+
return factory.createVariableStatement([], factory.createVariableDeclarationList([
|
|
93
|
+
factory.createVariableDeclaration(gen1ApiVarName, undefined, undefined, factory.createCallExpression(factory.createPropertyAccessExpression(factory.createIdentifier('RestApi'), factory.createIdentifier('fromRestApiAttributes')), undefined, [
|
|
94
|
+
factory.createIdentifier(stackVarName),
|
|
95
|
+
factory.createStringLiteral(`Gen1${restApi.apiName}Api`),
|
|
96
|
+
factory.createObjectLiteralExpression([
|
|
97
|
+
factory.createPropertyAssignment('restApiId', factory.createStringLiteral(restApi.gen1ApiId)),
|
|
98
|
+
factory.createPropertyAssignment('rootResourceId', factory.createStringLiteral(restApi.gen1RootResourceId)),
|
|
99
|
+
], true),
|
|
100
|
+
])),
|
|
101
|
+
], typescript_1.default.NodeFlags.Const));
|
|
102
|
+
}
|
|
103
|
+
renderGen1Policy(restApi, stackVarName, gen1ApiVarName, gen1PolicyVarName) {
|
|
104
|
+
return factory.createVariableStatement([], factory.createVariableDeclarationList([
|
|
105
|
+
factory.createVariableDeclaration(gen1PolicyVarName, undefined, undefined, factory.createNewExpression(factory.createIdentifier('Policy'), undefined, [
|
|
106
|
+
factory.createIdentifier(stackVarName),
|
|
107
|
+
factory.createStringLiteral(`Gen1${restApi.apiName}Policy`),
|
|
108
|
+
factory.createObjectLiteralExpression([
|
|
109
|
+
factory.createPropertyAssignment('statements', factory.createArrayLiteralExpression([
|
|
110
|
+
factory.createNewExpression(factory.createIdentifier('PolicyStatement'), undefined, [
|
|
111
|
+
factory.createObjectLiteralExpression([
|
|
112
|
+
factory.createPropertyAssignment('actions', factory.createArrayLiteralExpression([factory.createStringLiteral('execute-api:Invoke')])),
|
|
113
|
+
factory.createPropertyAssignment('resources', factory.createArrayLiteralExpression([
|
|
114
|
+
...restApi.paths.flatMap((apiPath) => apiPath.methods.map((method) => factory.createTemplateExpression(factory.createTemplateHead(''), [
|
|
115
|
+
factory.createTemplateSpan(factory.createCallExpression(factory.createPropertyAccessExpression(factory.createIdentifier(gen1ApiVarName), factory.createIdentifier('arnForExecuteApi')), undefined, [factory.createStringLiteral(method), factory.createStringLiteral('/*')]), factory.createTemplateTail('')),
|
|
116
|
+
]))),
|
|
117
|
+
])),
|
|
118
|
+
], true),
|
|
119
|
+
]),
|
|
120
|
+
])),
|
|
121
|
+
], true),
|
|
122
|
+
])),
|
|
123
|
+
], typescript_1.default.NodeFlags.Const));
|
|
124
|
+
}
|
|
125
|
+
renderGen1PolicyAttachment(gen1PolicyVarName) {
|
|
126
|
+
return factory.createExpressionStatement(factory.createCallExpression(factory.createPropertyAccessExpression(factory.createPropertyAccessExpression(factory.createIdentifier('backend.auth.resources'), factory.createIdentifier('authenticatedUserIamRole')), factory.createIdentifier('attachInlinePolicy')), undefined, [factory.createIdentifier(gen1PolicyVarName)]));
|
|
127
|
+
}
|
|
128
|
+
renderPaths(restApi, apiVarName, integrations) {
|
|
129
|
+
var _a, _b;
|
|
130
|
+
const statements = [];
|
|
131
|
+
for (const apiPath of restApi.paths) {
|
|
132
|
+
const pathSegments = apiPath.path.split('/').filter((segment) => segment && segment !== '{proxy+}');
|
|
133
|
+
let resourceName = pathSegments.join('').replace(/[^a-zA-Z0-9]/g, '') || 'root';
|
|
134
|
+
if (this.functionNames.has(resourceName)) {
|
|
135
|
+
resourceName = `${resourceName}Resource`;
|
|
136
|
+
}
|
|
137
|
+
let resourceExpression = factory.createPropertyAccessExpression(factory.createIdentifier(apiVarName), factory.createIdentifier('root'));
|
|
138
|
+
for (let i = 0; i < pathSegments.length; i++) {
|
|
139
|
+
const isLastSegment = i === pathSegments.length - 1;
|
|
140
|
+
const resourceArgs = [factory.createStringLiteral(pathSegments[i])];
|
|
141
|
+
if (isLastSegment) {
|
|
142
|
+
const resourceOptions = [];
|
|
143
|
+
if (apiPath.authType === 'private') {
|
|
144
|
+
resourceOptions.push(factory.createPropertyAssignment('defaultMethodOptions', factory.createObjectLiteralExpression([
|
|
145
|
+
factory.createPropertyAssignment('authorizationType', factory.createPropertyAccessExpression(factory.createIdentifier('AuthorizationType'), factory.createIdentifier('IAM'))),
|
|
146
|
+
], true)));
|
|
147
|
+
}
|
|
148
|
+
resourceOptions.push(this.renderCorsPreflightOptions());
|
|
149
|
+
resourceArgs.push(factory.createObjectLiteralExpression(resourceOptions, true));
|
|
150
|
+
}
|
|
151
|
+
resourceExpression = factory.createCallExpression(factory.createPropertyAccessExpression(resourceExpression, factory.createIdentifier('addResource')), undefined, resourceArgs);
|
|
152
|
+
}
|
|
153
|
+
statements.push(factory.createVariableStatement([], factory.createVariableDeclarationList([factory.createVariableDeclaration(resourceName, undefined, undefined, resourceExpression)], typescript_1.default.NodeFlags.Const)));
|
|
154
|
+
const integrationVar = (_b = integrations.get((_a = apiPath.lambdaFunction) !== null && _a !== void 0 ? _a : '')) !== null && _b !== void 0 ? _b : `${apiPath.lambdaFunction}Integration`;
|
|
155
|
+
statements.push(factory.createExpressionStatement(factory.createCallExpression(factory.createPropertyAccessExpression(factory.createIdentifier(resourceName), factory.createIdentifier('addMethod')), undefined, [factory.createStringLiteral('ANY'), factory.createIdentifier(integrationVar)])));
|
|
156
|
+
statements.push(factory.createExpressionStatement(factory.createCallExpression(factory.createPropertyAccessExpression(factory.createIdentifier(resourceName), factory.createIdentifier('addProxy')), undefined, [
|
|
157
|
+
factory.createObjectLiteralExpression([
|
|
158
|
+
factory.createPropertyAssignment('anyMethod', factory.createTrue()),
|
|
159
|
+
factory.createPropertyAssignment('defaultIntegration', factory.createIdentifier(integrationVar)),
|
|
160
|
+
], true),
|
|
161
|
+
])));
|
|
162
|
+
}
|
|
163
|
+
return statements;
|
|
164
|
+
}
|
|
165
|
+
renderCorsPreflightOptions() {
|
|
166
|
+
return factory.createPropertyAssignment('defaultCorsPreflightOptions', factory.createObjectLiteralExpression([
|
|
167
|
+
factory.createPropertyAssignment('allowOrigins', factory.createPropertyAccessExpression(factory.createIdentifier('Cors'), factory.createIdentifier('ALL_ORIGINS'))),
|
|
168
|
+
factory.createPropertyAssignment('allowMethods', factory.createPropertyAccessExpression(factory.createIdentifier('Cors'), factory.createIdentifier('ALL_METHODS'))),
|
|
169
|
+
factory.createPropertyAssignment('allowHeaders', factory.createArrayLiteralExpression([
|
|
170
|
+
factory.createStringLiteral('Content-Type'),
|
|
171
|
+
factory.createStringLiteral('X-Amz-Date'),
|
|
172
|
+
factory.createStringLiteral('Authorization'),
|
|
173
|
+
factory.createStringLiteral('X-Api-Key'),
|
|
174
|
+
factory.createStringLiteral('X-Amz-Security-Token'),
|
|
175
|
+
factory.createStringLiteral('X-Amz-User-Agent'),
|
|
176
|
+
])),
|
|
177
|
+
factory.createPropertyAssignment('statusCode', factory.createNumericLiteral('200')),
|
|
178
|
+
], true));
|
|
179
|
+
}
|
|
180
|
+
renderPathPolicies(restApi, apiVarName, stackVarName) {
|
|
181
|
+
var _a, _b;
|
|
182
|
+
const statements = [];
|
|
183
|
+
for (const apiPath of restApi.paths) {
|
|
184
|
+
if ((_a = apiPath.permissions) === null || _a === void 0 ? void 0 : _a.hasAuth) {
|
|
185
|
+
statements.push(...this.renderAuthPathPolicy(apiPath, apiVarName, stackVarName));
|
|
186
|
+
}
|
|
187
|
+
if ((_b = apiPath.permissions) === null || _b === void 0 ? void 0 : _b.groups) {
|
|
188
|
+
for (const groupName of Object.keys(apiPath.permissions.groups)) {
|
|
189
|
+
statements.push(...this.renderGroupPathPolicy(apiPath, apiVarName, stackVarName, groupName));
|
|
190
|
+
}
|
|
191
|
+
}
|
|
192
|
+
}
|
|
193
|
+
return statements;
|
|
194
|
+
}
|
|
195
|
+
renderAuthPathPolicy(apiPath, apiVarName, stackVarName) {
|
|
196
|
+
const comment = factory.createNotEmittedStatement(factory.createStringLiteral(''));
|
|
197
|
+
typescript_1.default.addSyntheticLeadingComment(comment, typescript_1.default.SyntaxKind.SingleLineCommentTrivia, ` ${apiPath.path} - all authenticated users`, true);
|
|
198
|
+
const policyName = `${apiPath.path.replace(/[^a-zA-Z0-9]/g, '')}AuthPolicy`;
|
|
199
|
+
const attachCall = factory.createExpressionStatement(factory.createCallExpression(factory.createPropertyAccessExpression(factory.createPropertyAccessExpression(factory.createIdentifier('backend.auth.resources'), factory.createIdentifier('authenticatedUserIamRole')), factory.createIdentifier('attachInlinePolicy')), undefined, [
|
|
200
|
+
factory.createNewExpression(factory.createIdentifier('Policy'), undefined, [
|
|
201
|
+
factory.createIdentifier(stackVarName),
|
|
202
|
+
factory.createStringLiteral(policyName),
|
|
203
|
+
factory.createObjectLiteralExpression([
|
|
204
|
+
factory.createPropertyAssignment('statements', factory.createArrayLiteralExpression([
|
|
205
|
+
factory.createNewExpression(factory.createIdentifier('PolicyStatement'), undefined, [
|
|
206
|
+
factory.createObjectLiteralExpression([
|
|
207
|
+
factory.createPropertyAssignment('actions', factory.createArrayLiteralExpression([factory.createStringLiteral('execute-api:Invoke')])),
|
|
208
|
+
factory.createPropertyAssignment('resources', factory.createArrayLiteralExpression([
|
|
209
|
+
...apiPath.methods.flatMap((method) => [
|
|
210
|
+
factory.createCallExpression(factory.createPropertyAccessExpression(factory.createIdentifier(apiVarName), factory.createIdentifier('arnForExecuteApi')), undefined, [factory.createStringLiteral(method), factory.createStringLiteral(apiPath.path)]),
|
|
211
|
+
factory.createCallExpression(factory.createPropertyAccessExpression(factory.createIdentifier(apiVarName), factory.createIdentifier('arnForExecuteApi')), undefined, [factory.createStringLiteral(method), factory.createStringLiteral(`${apiPath.path}/*`)]),
|
|
212
|
+
]),
|
|
213
|
+
])),
|
|
214
|
+
], true),
|
|
215
|
+
]),
|
|
216
|
+
])),
|
|
217
|
+
], true),
|
|
218
|
+
]),
|
|
219
|
+
]));
|
|
220
|
+
return [comment, attachCall];
|
|
221
|
+
}
|
|
222
|
+
renderGroupPathPolicy(apiPath, apiVarName, stackVarName, groupName) {
|
|
223
|
+
const comment = factory.createNotEmittedStatement(factory.createStringLiteral(''));
|
|
224
|
+
typescript_1.default.addSyntheticLeadingComment(comment, typescript_1.default.SyntaxKind.SingleLineCommentTrivia, ` ${apiPath.path} - ${groupName} group only`, true);
|
|
225
|
+
const policyName = `${apiPath.path.replace(/[^a-zA-Z0-9]/g, '')}${groupName}Policy`;
|
|
226
|
+
const attachCall = factory.createExpressionStatement(factory.createCallExpression(factory.createPropertyAccessExpression(factory.createPropertyAccessExpression(factory.createElementAccessExpression(factory.createPropertyAccessExpression(factory.createIdentifier('backend.auth.resources'), factory.createIdentifier('groups')), factory.createStringLiteral(groupName)), factory.createIdentifier('role')), factory.createIdentifier('attachInlinePolicy')), undefined, [
|
|
227
|
+
factory.createNewExpression(factory.createIdentifier('Policy'), undefined, [
|
|
228
|
+
factory.createIdentifier(stackVarName),
|
|
229
|
+
factory.createStringLiteral(policyName),
|
|
230
|
+
factory.createObjectLiteralExpression([
|
|
231
|
+
factory.createPropertyAssignment('statements', factory.createArrayLiteralExpression([
|
|
232
|
+
factory.createNewExpression(factory.createIdentifier('PolicyStatement'), undefined, [
|
|
233
|
+
factory.createObjectLiteralExpression([
|
|
234
|
+
factory.createPropertyAssignment('actions', factory.createArrayLiteralExpression([factory.createStringLiteral('execute-api:Invoke')])),
|
|
235
|
+
factory.createPropertyAssignment('resources', factory.createArrayLiteralExpression([
|
|
236
|
+
...apiPath.methods.flatMap((method) => [
|
|
237
|
+
factory.createCallExpression(factory.createPropertyAccessExpression(factory.createIdentifier(apiVarName), factory.createIdentifier('arnForExecuteApi')), undefined, [factory.createStringLiteral(method), factory.createStringLiteral(apiPath.path)]),
|
|
238
|
+
factory.createCallExpression(factory.createPropertyAccessExpression(factory.createIdentifier(apiVarName), factory.createIdentifier('arnForExecuteApi')), undefined, [factory.createStringLiteral(method), factory.createStringLiteral(`${apiPath.path}/*`)]),
|
|
239
|
+
]),
|
|
240
|
+
])),
|
|
241
|
+
], true),
|
|
242
|
+
]),
|
|
243
|
+
])),
|
|
244
|
+
], true),
|
|
245
|
+
]),
|
|
246
|
+
]));
|
|
247
|
+
return [comment, attachCall];
|
|
248
|
+
}
|
|
249
|
+
renderOutput(apiVarName) {
|
|
250
|
+
return factory.createExpressionStatement(factory.createCallExpression(factory.createPropertyAccessExpression(factory.createIdentifier('backend'), factory.createIdentifier('addOutput')), undefined, [
|
|
251
|
+
factory.createObjectLiteralExpression([
|
|
252
|
+
factory.createPropertyAssignment('custom', factory.createObjectLiteralExpression([
|
|
253
|
+
factory.createPropertyAssignment('API', factory.createObjectLiteralExpression([
|
|
254
|
+
factory.createPropertyAssignment(factory.createComputedPropertyName(factory.createPropertyAccessExpression(factory.createIdentifier(apiVarName), factory.createIdentifier('restApiName'))), factory.createObjectLiteralExpression([
|
|
255
|
+
factory.createPropertyAssignment('endpoint', factory.createCallExpression(factory.createPropertyAccessExpression(factory.createPropertyAccessExpression(factory.createIdentifier(apiVarName), factory.createIdentifier('url')), factory.createIdentifier('slice')), undefined, [
|
|
256
|
+
factory.createNumericLiteral('0'),
|
|
257
|
+
factory.createPrefixUnaryExpression(typescript_1.default.SyntaxKind.MinusToken, factory.createNumericLiteral('1')),
|
|
258
|
+
])),
|
|
259
|
+
factory.createPropertyAssignment('region', factory.createPropertyAccessExpression(factory.createCallExpression(factory.createPropertyAccessExpression(factory.createIdentifier('Stack'), factory.createIdentifier('of')), undefined, [factory.createIdentifier(apiVarName)]), factory.createIdentifier('region'))),
|
|
260
|
+
factory.createPropertyAssignment('apiName', factory.createPropertyAccessExpression(factory.createIdentifier(apiVarName), factory.createIdentifier('restApiName'))),
|
|
261
|
+
], true)),
|
|
262
|
+
], true)),
|
|
263
|
+
], true)),
|
|
264
|
+
], true),
|
|
265
|
+
]));
|
|
266
|
+
}
|
|
267
|
+
}
|
|
268
|
+
exports.RestApiRenderer = RestApiRenderer;
|
|
269
|
+
//# sourceMappingURL=rest-api.renderer.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"rest-api.renderer.js","sourceRoot":"","sources":["../../../../../../src/commands/gen2-migration/generate/amplify/rest-api/rest-api.renderer.ts"],"names":[],"mappings":";;;;;;AAAA,4DAA4B;AAE5B,MAAM,OAAO,GAAG,oBAAE,CAAC,OAAO,CAAC;AAqD3B,MAAa,eAAe;IAI1B,YAAmB,OAAgB,EAAE,aAAkC;QACrE,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;QACvB,IAAI,CAAC,aAAa,GAAG,aAAa,CAAC;IACrC,CAAC;IAKM,SAAS,CAAC,OAA0B;QACzC,MAAM,UAAU,GAAmB,EAAE,CAAC;QACtC,MAAM,aAAa,GAAG,OAAO,CAAC,OAAO,CAAC,OAAO,CAAC,eAAe,EAAE,EAAE,CAAC,CAAC;QACnE,MAAM,YAAY,GAAG,GAAG,aAAa,OAAO,CAAC;QAC7C,MAAM,UAAU,GAAG,GAAG,aAAa,KAAK,CAAC;QACzC,MAAM,cAAc,GAAG,OAAO,aAAa,KAAK,CAAC;QACjD,MAAM,iBAAiB,GAAG,OAAO,aAAa,QAAQ,CAAC;QAEvD,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC,WAAW,CAAC,OAAO,EAAE,YAAY,CAAC,CAAC,CAAC;QACzD,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC,sBAAsB,CAAC,OAAO,EAAE,YAAY,EAAE,UAAU,CAAC,CAAC,CAAC;QAChF,UAAU,CAAC,IAAI,CAAC,GAAG,IAAI,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igrationOperation } from '../../../_infra/operation';
|
|
3
|
+
import { BackendGenerator } from '../backend.generator';
|
|
4
|
+
import { Gen1App, DiscoveredResource } from '../../_infra/gen1-app';
|
|
5
|
+
export declare class DynamoDBGenerator implements Planner {
|
|
6
|
+
private readonly gen1App;
|
|
7
|
+
private readonly backendGenerator;
|
|
8
|
+
private readonly resource;
|
|
9
|
+
private readonly renderer;
|
|
10
|
+
constructor(gen1App: Gen1App, backendGenerator: BackendGenerator, resource: DiscoveredResource);
|
|
11
|
+
plan(): Promise<AmplifyMigrationOperation[]>;
|
|
12
|
+
private fetchTable;
|
|
13
|
+
}
|
|
14
|
+
//# sourceMappingURL=dynamodb.generator.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dynamodb.generator.d.ts","sourceRoot":"","sources":["../../../../../../src/commands/gen2-migration/generate/amplify/storage/dynamodb.generator.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,yBAAyB,CAAC;AAClD,OAAO,EAAE,yBAAyB,EAAE,MAAM,2BAA2B,CAAC;AACtE,OAAO,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AACxD,OAAO,EAAE,OAAO,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAWpE,qBAAa,iBAAkB,YAAW,OAAO;IAC/C,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAU;IAClC,OAAO,CAAC,QAAQ,CAAC,gBAAgB,CAAmB;IACpD,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAqB;IAC9C,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAA0B;gBAEhC,OAAO,EAAE,OAAO,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,QAAQ,EAAE,kBAAkB;IASxF,IAAI,IAAI,OAAO,CAAC,yBAAyB,EAAE,CAAC;YAqB3C,UAAU;CAwCzB"}
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.DynamoDBGenerator = void 0;
|
|
4
|
+
const dynamodb_renderer_1 = require("./dynamodb.renderer");
|
|
5
|
+
class DynamoDBGenerator {
|
|
6
|
+
constructor(gen1App, backendGenerator, resource) {
|
|
7
|
+
this.renderer = new dynamodb_renderer_1.DynamoDBRenderer();
|
|
8
|
+
this.gen1App = gen1App;
|
|
9
|
+
this.backendGenerator = backendGenerator;
|
|
10
|
+
this.resource = resource;
|
|
11
|
+
}
|
|
12
|
+
async plan() {
|
|
13
|
+
const table = await this.fetchTable();
|
|
14
|
+
return [
|
|
15
|
+
{
|
|
16
|
+
resource: this.resource,
|
|
17
|
+
validate: () => undefined,
|
|
18
|
+
describe: async () => [`Generate DynamoDB table ${this.resource.resourceName} in amplify/backend.ts`],
|
|
19
|
+
execute: async () => {
|
|
20
|
+
const imports = this.renderer.requiredImports();
|
|
21
|
+
this.backendGenerator.addImport(imports.source, imports.identifiers);
|
|
22
|
+
const scopeVarName = this.backendGenerator.createDynamoDBStack(this.resource.resourceName);
|
|
23
|
+
for (const statement of this.renderer.renderTable(table, scopeVarName)) {
|
|
24
|
+
this.backendGenerator.addEarlyStatement(statement);
|
|
25
|
+
}
|
|
26
|
+
},
|
|
27
|
+
},
|
|
28
|
+
];
|
|
29
|
+
}
|
|
30
|
+
async fetchTable() {
|
|
31
|
+
var _a, _b, _c, _d, _e, _f, _g;
|
|
32
|
+
const storageMeta = this.gen1App.meta('storage');
|
|
33
|
+
const resourceMeta = storageMeta === null || storageMeta === void 0 ? void 0 : storageMeta[this.resource.resourceName];
|
|
34
|
+
const output = resourceMeta === null || resourceMeta === void 0 ? void 0 : resourceMeta.output;
|
|
35
|
+
const actualTableName = (output === null || output === void 0 ? void 0 : output.Name) || this.resource.resourceName;
|
|
36
|
+
const table = await this.gen1App.aws.fetchTableDescription(actualTableName);
|
|
37
|
+
if (!table) {
|
|
38
|
+
throw new Error(`DynamoDB table '${actualTableName}' not found`);
|
|
39
|
+
}
|
|
40
|
+
const partitionKey = extractKey(table, 'HASH');
|
|
41
|
+
const sortKey = ((_a = table.KeySchema) === null || _a === void 0 ? void 0 : _a.some((k) => k.KeyType === 'RANGE')) ? extractKey(table, 'RANGE') : undefined;
|
|
42
|
+
const gsis = ((_b = table.GlobalSecondaryIndexes) !== null && _b !== void 0 ? _b : []).map((gsi) => {
|
|
43
|
+
var _a, _b, _c, _d, _e;
|
|
44
|
+
const keySchema = (_a = gsi.KeySchema) !== null && _a !== void 0 ? _a : [];
|
|
45
|
+
const gsiPartitionKey = extractKeyFromSchema(keySchema, (_b = table.AttributeDefinitions) !== null && _b !== void 0 ? _b : [], 'HASH', (_c = gsi.IndexName) !== null && _c !== void 0 ? _c : 'unknown');
|
|
46
|
+
const gsiSortKeySchema = keySchema.find((k) => k.KeyType === 'RANGE');
|
|
47
|
+
const gsiSortKey = gsiSortKeySchema
|
|
48
|
+
? extractKeyFromSchema(keySchema, (_d = table.AttributeDefinitions) !== null && _d !== void 0 ? _d : [], 'RANGE', (_e = gsi.IndexName) !== null && _e !== void 0 ? _e : 'unknown')
|
|
49
|
+
: undefined;
|
|
50
|
+
if (!gsi.IndexName) {
|
|
51
|
+
throw new Error(`GSI on table '${actualTableName}' has no IndexName`);
|
|
52
|
+
}
|
|
53
|
+
return { indexName: gsi.IndexName, partitionKey: gsiPartitionKey, sortKey: gsiSortKey };
|
|
54
|
+
});
|
|
55
|
+
return {
|
|
56
|
+
tableName: actualTableName,
|
|
57
|
+
partitionKey,
|
|
58
|
+
sortKey,
|
|
59
|
+
gsis: gsis.length > 0 ? gsis : undefined,
|
|
60
|
+
billingMode: ((_c = table.BillingModeSummary) === null || _c === void 0 ? void 0 : _c.BillingMode) === 'PAY_PER_REQUEST' ? 'PAY_PER_REQUEST' : 'PROVISIONED',
|
|
61
|
+
readCapacity: ((_d = table.ProvisionedThroughput) === null || _d === void 0 ? void 0 : _d.ReadCapacityUnits) || 5,
|
|
62
|
+
writeCapacity: ((_e = table.ProvisionedThroughput) === null || _e === void 0 ? void 0 : _e.WriteCapacityUnits) || 5,
|
|
63
|
+
streamEnabled: !!((_f = table.StreamSpecification) === null || _f === void 0 ? void 0 : _f.StreamEnabled),
|
|
64
|
+
streamViewType: (_g = table.StreamSpecification) === null || _g === void 0 ? void 0 : _g.StreamViewType,
|
|
65
|
+
};
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
exports.DynamoDBGenerator = DynamoDBGenerator;
|
|
69
|
+
function extractKey(table, keyType) {
|
|
70
|
+
var _a, _b, _c;
|
|
71
|
+
return extractKeyFromSchema((_a = table.KeySchema) !== null && _a !== void 0 ? _a : [], (_b = table.AttributeDefinitions) !== null && _b !== void 0 ? _b : [], keyType, (_c = table.TableName) !== null && _c !== void 0 ? _c : 'unknown');
|
|
72
|
+
}
|
|
73
|
+
function extractKeyFromSchema(keySchema, attributeDefinitions, keyType, context) {
|
|
74
|
+
const keyElement = keySchema.find((k) => k.KeyType === keyType);
|
|
75
|
+
if (!(keyElement === null || keyElement === void 0 ? void 0 : keyElement.AttributeName)) {
|
|
76
|
+
throw new Error(`${keyType} key not found in KeySchema for '${context}'`);
|
|
77
|
+
}
|
|
78
|
+
const attrDef = attributeDefinitions.find((a) => a.AttributeName === keyElement.AttributeName);
|
|
79
|
+
if (!(attrDef === null || attrDef === void 0 ? void 0 : attrDef.AttributeType)) {
|
|
80
|
+
throw new Error(`Attribute definition for '${keyElement.AttributeName}' not found in '${context}'`);
|
|
81
|
+
}
|
|
82
|
+
return { name: keyElement.AttributeName, type: mapAttributeType(attrDef.AttributeType) };
|
|
83
|
+
}
|
|
84
|
+
function mapAttributeType(dynamoType) {
|
|
85
|
+
switch (dynamoType) {
|
|
86
|
+
case 'S':
|
|
87
|
+
return 'STRING';
|
|
88
|
+
case 'N':
|
|
89
|
+
return 'NUMBER';
|
|
90
|
+
case 'B':
|
|
91
|
+
return 'BINARY';
|
|
92
|
+
default:
|
|
93
|
+
return 'STRING';
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
//# sourceMappingURL=dynamodb.generator.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dynamodb.generator.js","sourceRoot":"","sources":["../../../../../../src/commands/gen2-migration/generate/amplify/storage/dynamodb.generator.ts"],"names":[],"mappings":";;;AAIA,2DAA6F;AAU7F,MAAa,iBAAiB;IAM5B,YAAmB,OAAgB,EAAE,gBAAkC,EAAE,QAA4B;QAFpF,aAAQ,GAAG,IAAI,oCAAgB,EAAE,CAAC;QAGjD,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;QACvB,IAAI,CAAC,gBAAgB,GAAG,gBAAgB,CAAC;QACzC,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC;IAC3B,CAAC;IAKM,KAAK,CAAC,IAAI;QACf,MAAM,KAAK,GAAG,MAAM,IAAI,CAAC,UAAU,EAAE,CAAC;QAEtC,OAAO;YACL;gBACE,QAAQ,EAAE,IAAI,CAAC,QAAQ;gBACvB,QAAQ,EAAE,GAAG,EAAE,CAAC,SAAS;gBACzB,QAAQ,EAAE,KAAK,IAAI,EAAE,CAAC,CAAC,2BAA2B,IAAI,CAAC,QAAQ,CAAC,YAAY,wBAAwB,CAAC;gBACrG,OAAO,EAAE,KAAK,IAAI,EAAE;oBAClB,MAAM,OAAO,GAAG,IAAI,CAAC,QAAQ,CAAC,eAAe,EAAE,CAAC;oBAChD,IAAI,CAAC,gBAAgB,CAAC,SAAS,CAAC,OAAO,CAAC,MAAM,EAAE,OAAO,CAAC,WAAW,CAAC,CAAC;oBACrE,MAAM,YAAY,GAAG,IAAI,CAAC,gBAAgB,CAAC,mBAAmB,CAAC,IAAI,CAAC,QAAQ,CAAC,YAAY,CAAC,CAAC;oBAE3F,KAAK,MAAM,SAAS,IAAI,IAAI,CAAC,QAAQ,CAAC,WAAW,CAAC,KAAK,EAAE,YAAY,CAAC,EAAE,CAAC;wBACvE,IAAI,CAAC,gBAAgB,CAAC,iBAAiB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N,OAAO,QAAQ,CAAC;QAClB,KAAK,GAAG;YACN,OAAO,QAAQ,CAAC;QAClB,KAAK,GAAG;YACN,OAAO,QAAQ,CAAC;QAClB;YACE,OAAO,QAAQ,CAAC;IACpB,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import ts from 'typescript';
|
|
2
|
+
export interface DynamoDBAttribute {
|
|
3
|
+
readonly name: string;
|
|
4
|
+
readonly type: 'STRING' | 'NUMBER' | 'BINARY';
|
|
5
|
+
}
|
|
6
|
+
export interface DynamoDBGSI {
|
|
7
|
+
readonly indexName: string;
|
|
8
|
+
readonly partitionKey: DynamoDBAttribute;
|
|
9
|
+
readonly sortKey?: DynamoDBAttribute;
|
|
10
|
+
}
|
|
11
|
+
export interface DynamoDBTableDefinition {
|
|
12
|
+
readonly tableName: string;
|
|
13
|
+
readonly partitionKey: DynamoDBAttribute;
|
|
14
|
+
readonly sortKey?: DynamoDBAttribute;
|
|
15
|
+
readonly gsis?: readonly DynamoDBGSI[];
|
|
16
|
+
readonly billingMode?: 'PROVISIONED' | 'PAY_PER_REQUEST';
|
|
17
|
+
readonly readCapacity?: number;
|
|
18
|
+
readonly writeCapacity?: number;
|
|
19
|
+
readonly streamEnabled?: boolean;
|
|
20
|
+
readonly streamViewType?: 'KEYS_ONLY' | 'NEW_IMAGE' | 'OLD_IMAGE' | 'NEW_AND_OLD_IMAGES';
|
|
21
|
+
}
|
|
22
|
+
export declare class DynamoDBRenderer {
|
|
23
|
+
requiredImports(): {
|
|
24
|
+
readonly source: string;
|
|
25
|
+
readonly identifiers: string[];
|
|
26
|
+
};
|
|
27
|
+
renderTable(table: DynamoDBTableDefinition, scopeVarName: string): ts.Statement[];
|
|
28
|
+
private renderGSI;
|
|
29
|
+
}
|
|
30
|
+
//# sourceMappingURL=dynamodb.renderer.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dynamodb.renderer.d.ts","sourceRoot":"","sources":["../../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
@@ -0,0 +1,90 @@
|
|
|
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.DynamoDBRenderer = void 0;
|
|
7
|
+
const typescript_1 = __importDefault(require("typescript"));
|
|
8
|
+
const factory = typescript_1.default.factory;
|
|
9
|
+
class DynamoDBRenderer {
|
|
10
|
+
requiredImports() {
|
|
11
|
+
return {
|
|
12
|
+
source: 'aws-cdk-lib/aws-dynamodb',
|
|
13
|
+
identifiers: ['Table', 'AttributeType', 'BillingMode', 'StreamViewType'],
|
|
14
|
+
};
|
|
15
|
+
}
|
|
16
|
+
renderTable(table, scopeVarName) {
|
|
17
|
+
const statements = [];
|
|
18
|
+
const baseTableName = table.tableName.replace(/-[^-]+$/, '');
|
|
19
|
+
const sanitizedName = sanitizeVariableName(baseTableName);
|
|
20
|
+
const tableProps = [
|
|
21
|
+
factory.createPropertyAssignment('partitionKey', factory.createObjectLiteralExpression([
|
|
22
|
+
factory.createPropertyAssignment('name', factory.createStringLiteral(table.partitionKey.name)),
|
|
23
|
+
factory.createPropertyAssignment('type', factory.createPropertyAccessExpression(factory.createIdentifier('AttributeType'), factory.createIdentifier(table.partitionKey.type))),
|
|
24
|
+
])),
|
|
25
|
+
factory.createPropertyAssignment('billingMode', factory.createPropertyAccessExpression(factory.createIdentifier('BillingMode'), factory.createIdentifier(table.billingMode || 'PROVISIONED'))),
|
|
26
|
+
];
|
|
27
|
+
if (table.billingMode !== 'PAY_PER_REQUEST') {
|
|
28
|
+
tableProps.push(factory.createPropertyAssignment('readCapacity', factory.createNumericLiteral(String(table.readCapacity || 5))));
|
|
29
|
+
tableProps.push(factory.createPropertyAssignment('writeCapacity', factory.createNumericLiteral(String(table.writeCapacity || 5))));
|
|
30
|
+
}
|
|
31
|
+
if (table.streamEnabled && table.streamViewType) {
|
|
32
|
+
tableProps.push(factory.createPropertyAssignment('stream', factory.createPropertyAccessExpression(factory.createIdentifier('StreamViewType'), factory.createIdentifier(table.streamViewType))));
|
|
33
|
+
}
|
|
34
|
+
if (table.sortKey) {
|
|
35
|
+
tableProps.push(factory.createPropertyAssignment('sortKey', factory.createObjectLiteralExpression([
|
|
36
|
+
factory.createPropertyAssignment('name', factory.createStringLiteral(table.sortKey.name)),
|
|
37
|
+
factory.createPropertyAssignment('type', factory.createPropertyAccessExpression(factory.createIdentifier('AttributeType'), factory.createIdentifier(table.sortKey.type))),
|
|
38
|
+
])));
|
|
39
|
+
}
|
|
40
|
+
const hasGSIs = table.gsis && table.gsis.length > 0;
|
|
41
|
+
if (hasGSIs) {
|
|
42
|
+
statements.push(factory.createVariableStatement([], factory.createVariableDeclarationList([
|
|
43
|
+
factory.createVariableDeclaration(sanitizedName, undefined, undefined, factory.createNewExpression(factory.createIdentifier('Table'), undefined, [
|
|
44
|
+
factory.createIdentifier(scopeVarName),
|
|
45
|
+
factory.createStringLiteral(sanitizedName),
|
|
46
|
+
factory.createObjectLiteralExpression(tableProps),
|
|
47
|
+
])),
|
|
48
|
+
], typescript_1.default.NodeFlags.Const)));
|
|
49
|
+
}
|
|
50
|
+
else {
|
|
51
|
+
statements.push(factory.createExpressionStatement(factory.createNewExpression(factory.createIdentifier('Table'), undefined, [
|
|
52
|
+
factory.createIdentifier(scopeVarName),
|
|
53
|
+
factory.createStringLiteral(sanitizedName),
|
|
54
|
+
factory.createObjectLiteralExpression(tableProps),
|
|
55
|
+
])));
|
|
56
|
+
}
|
|
57
|
+
const tableNameComment = factory.createNotEmittedStatement(factory.createStringLiteral(''));
|
|
58
|
+
typescript_1.default.addSyntheticLeadingComment(tableNameComment, typescript_1.default.SyntaxKind.SingleLineCommentTrivia, ` Add this property to the Table above post refactor: tableName: '${table.tableName}'`, true);
|
|
59
|
+
statements.push(tableNameComment);
|
|
60
|
+
if (table.gsis) {
|
|
61
|
+
for (const gsi of table.gsis) {
|
|
62
|
+
statements.push(this.renderGSI(sanitizedName, gsi));
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
return statements;
|
|
66
|
+
}
|
|
67
|
+
renderGSI(tableVarName, gsi) {
|
|
68
|
+
const gsiProps = [
|
|
69
|
+
factory.createPropertyAssignment('indexName', factory.createStringLiteral(gsi.indexName)),
|
|
70
|
+
factory.createPropertyAssignment('partitionKey', factory.createObjectLiteralExpression([
|
|
71
|
+
factory.createPropertyAssignment('name', factory.createStringLiteral(gsi.partitionKey.name)),
|
|
72
|
+
factory.createPropertyAssignment('type', factory.createPropertyAccessExpression(factory.createIdentifier('AttributeType'), factory.createIdentifier(gsi.partitionKey.type))),
|
|
73
|
+
])),
|
|
74
|
+
];
|
|
75
|
+
if (gsi.sortKey) {
|
|
76
|
+
gsiProps.push(factory.createPropertyAssignment('sortKey', factory.createObjectLiteralExpression([
|
|
77
|
+
factory.createPropertyAssignment('name', factory.createStringLiteral(gsi.sortKey.name)),
|
|
78
|
+
factory.createPropertyAssignment('type', factory.createPropertyAccessExpression(factory.createIdentifier('AttributeType'), factory.createIdentifier(gsi.sortKey.type))),
|
|
79
|
+
])));
|
|
80
|
+
}
|
|
81
|
+
gsiProps.push(factory.createPropertyAssignment('readCapacity', factory.createNumericLiteral('5')));
|
|
82
|
+
gsiProps.push(factory.createPropertyAssignment('writeCapacity', factory.createNumericLiteral('5')));
|
|
83
|
+
return factory.createExpressionStatement(factory.createCallExpression(factory.createPropertyAccessExpression(factory.createIdentifier(tableVarName), factory.createIdentifier('addGlobalSecondaryIndex')), undefined, [factory.createObjectLiteralExpression(gsiProps)]));
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
exports.DynamoDBRenderer = DynamoDBRenderer;
|
|
87
|
+
function sanitizeVariableName(name) {
|
|
88
|
+
return name.replace(/[^a-zA-Z0-9_$]/g, '_');
|
|
89
|
+
}
|
|
90
|
+
//# sourceMappingURL=dynamodb.renderer.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dynamodb.renderer.js","sourceRoot":"","sources":["../../../../../../src/commands/gen2-migration/generate/amplify/storage/dynamodb.renderer.ts"],"names":[],"mappings":";;;;;;AAAA,4DAA4B;AAE5B,MAAM,OAAO,GAAG,oBAAE,CAAC,OAAO,CAAC;AAsC3B,MAAa,gBAAgB;IAIpB,eAAe;QACpB,OAAO;YACL,MAAM,EAAE,0BAA0B;YAClC,WAAW,EAAE,CAAC,OAAO,EAAE,eAAe,EAAE,aAAa,EAAE,gBAAgB,CAAC;SACzE,CAAC;IACJ,CAAC;IAKM,WAAW,CAAC,KAA8B,EAAE,YAAoB;QACrE,MAAM,UAAU,GAAmB,EAAE,CAAC;QACtC,MAAM,aAAa,GAAG,KAAK,CAAC,SAAS,CAAC,OAAO,CAAC,SAAS,EAAE,EAAE,CAAC,CAAC;QAC7D,MAAM,aAAa,GAAG,oBAAoB,CAAC,aAAa,CAAC,CAAC;QAE1D,MAAM,UAAU,GAA4B;YAC1C,OAAO,CAAC,wBAAwB,CAC9B,cAAc,EACd,OAAO,CAAC,6BAA6B,CAAC;gBACpC,OAAO,CAAC,wBAAwB,CAAC,MAAM,EAAE,OAAO,CAAC,mBAAmB,CAAC,KAAK,CAAC,YAAY,CAAC,IAAI,CAAC,CAAC;gBAC9F,OAAO,CAAC,wBAAwB,CAC9B,MAAM,EACN,OAAO,CAAC,8BAA8B,CACpC,OAAO,CAAC,gBAAgB,CAAC,eAAe,CAAC,EACzC,OAAO,CAAC,gBAAgB,CAAC,KAAK,CAAC,YAAY,CAAC,IAAI,CAAC,CAClD,CACF;aACF,CAAC,CACH;YACD,OAAO,CAAC,wBAAwB,CAC9B,aAAa,EACb,OAAO,CAAC,8BAA8B,CACpC,OAAO,CAAC,gBAAgB,CAAC,aAAa,CAAC,EACvC,OAAO,CAAC,gBAAgB,CAAC,KAAK,CAAC,WAAW,IAAI,aAAa,CAAC,CAC7D,CACF;SACF,CAAC;QAEF,IAAI,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QAED,QAAQ,CAAC,IAAI,CAAC,OAAO,CAAC,wBAAwB,CAAC,cAAc,EAAE,OAAO,CAAC,oBAAoB,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;QACnG,QAAQ,CAAC,IAAI,CAAC,OAAO,CAAC,wBAAwB,CAAC,eAAe,EAAE,OAAO,CAAC,oBAAoB,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;QAEpG,OAAO,OAAO,CAAC,yBAAyB,CACtC,OAAO,CAAC,oBAAoB,CAC1B,OAAO,CAAC,8BAA8B,CAAC,OAAO,CAAC,gBAAgB,CAAC,YAAY,CAAC,EAAE,OAAO,CAAC,gBAAgB,CAAC,yBAAyB,CAAC,CAAC,EACnI,SAAS,EACT,CAAC,OAAO,CAAC,6BAA6B,CAAC,QAAQ,CAAC,CAAC,CAClD,CACF,CAAC;IACJ,CAAC;CACF;AA/KD,4CA+KC;AAED,SAAS,oBAAoB,CAAC,IAAY;IACxC,OAAO,IAAI,CAAC,OAAO,CAAC,iBAAiB,EAAE,GAAG,CAAC,CAAC;AAC9C,CAAC"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { Planner } from '../../../_infra/planner';
|
|
2
|
+
import { AmplifyMigrationOperation } from '../../../_infra/operation';
|
|
3
|
+
import { BackendGenerator } from '../backend.generator';
|
|
4
|
+
import { Gen1App, DiscoveredResource } from '../../_infra/gen1-app';
|
|
5
|
+
import { StorageTriggerEvent, Permission } from './s3.renderer';
|
|
6
|
+
export declare class S3Generator implements Planner {
|
|
7
|
+
private readonly gen1App;
|
|
8
|
+
private readonly backendGenerator;
|
|
9
|
+
private readonly outputDir;
|
|
10
|
+
private readonly resource;
|
|
11
|
+
private readonly defineStorage;
|
|
12
|
+
private readonly functionStorageAccess;
|
|
13
|
+
private readonly triggers;
|
|
14
|
+
constructor(gen1App: Gen1App, backendGenerator: BackendGenerator, outputDir: string, resource: DiscoveredResource);
|
|
15
|
+
addFunctionStorageAccess(functionName: string, category: string, permissions: readonly Permission[]): void;
|
|
16
|
+
addTrigger(event: StorageTriggerEvent, functionName: string): void;
|
|
17
|
+
plan(): Promise<AmplifyMigrationOperation[]>;
|
|
18
|
+
private planS3;
|
|
19
|
+
private contributeOverrides;
|
|
20
|
+
private buildAccessPatterns;
|
|
21
|
+
}
|
|
22
|
+
//# sourceMappingURL=s3.generator.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"s3.generator.d.ts","sourceRoot":"","sources":["../../../../../../src/commands/gen2-migration/generate/amplify/storage/s3.generator.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,OAAO,EAAE,MAAM,yBAAyB,CAAC;AAClD,OAAO,EAAE,yBAAyB,EAAE,MAAM,2BAA2B,CAAC;AACtE,OAAO,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AACxD,OAAO,EAAE,OAAO,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAEpE,OAAO,EAA8B,mBAAmB,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAsC5F,qBAAa,WAAY,YAAW,OAAO;IACzC,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAU;IAClC,OAAO,CAAC,QAAQ,CAAC,gBAAgB,CAAmB;IACpD,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAS;IACnC,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAqB;IAC9C,OAAO,CAAC,QAAQ,CAAC,aAAa,CAAa;IAC3C,OAAO,CAAC,QAAQ,CAAC,qBAAqB,CAI9B;IACR,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAoD;gBAE1D,OAAO,EAAE,OAAO,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,kBAAkB;IAYjH,wBAAwB,CAAC,YAAY,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,WAAW,EAAE,SAAS,UAAU,EAAE,GAAG,IAAI;IAQ1G,UAAU,CAAC,KAAK,EAAE,mBAAmB,EAAE,YAAY,EAAE,MAAM,GAAG,IAAI;IAO5D,IAAI,IAAI,OAAO,CAAC,yBAAyB,EAAE,CAAC;YAO3C,MAAM;IA4CpB,OAAO,CAAC,mBAAmB;IA8H3B,OAAO,CAAC,mBAAmB;CAgB5B"}
|