@aws-amplify/cli-internal-gen2-migration-experimental-alpha 0.5.0 → 0.7.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (704) hide show
  1. package/CHANGELOG.md +16 -0
  2. package/adr/001-refactor-gen2-migration-generate.md +413 -0
  3. package/adr/002-refactor-gen2-migration-refactor.md +593 -0
  4. package/adr/003-gen2-migration-assess.md +414 -0
  5. package/adr/004-gen2-migration-validation-modeling.md +336 -0
  6. package/aws-amplify-cli-internal-gen2-migration-experimental-alpha-0.7.0.tgz +0 -0
  7. package/bin/amplify +1 -1
  8. package/lib/commands/drift-detection/detect-local-drift.d.ts +1 -2
  9. package/lib/commands/drift-detection/detect-local-drift.d.ts.map +1 -1
  10. package/lib/commands/drift-detection/detect-local-drift.js +19 -6
  11. package/lib/commands/drift-detection/detect-local-drift.js.map +1 -1
  12. package/lib/commands/drift-detection/detect-stack-drift.d.ts +20 -9
  13. package/lib/commands/drift-detection/detect-stack-drift.d.ts.map +1 -1
  14. package/lib/commands/drift-detection/detect-stack-drift.js +121 -151
  15. package/lib/commands/drift-detection/detect-stack-drift.js.map +1 -1
  16. package/lib/commands/drift-detection/detect-template-drift.d.ts +8 -21
  17. package/lib/commands/drift-detection/detect-template-drift.d.ts.map +1 -1
  18. package/lib/commands/drift-detection/detect-template-drift.js +81 -89
  19. package/lib/commands/drift-detection/detect-template-drift.js.map +1 -1
  20. package/lib/commands/drift-detection/index.d.ts +2 -3
  21. package/lib/commands/drift-detection/index.d.ts.map +1 -1
  22. package/lib/commands/drift-detection/index.js +1 -3
  23. package/lib/commands/drift-detection/index.js.map +1 -1
  24. package/lib/commands/drift-detection/services/amplify-config-service.d.ts +0 -1
  25. package/lib/commands/drift-detection/services/amplify-config-service.d.ts.map +1 -1
  26. package/lib/commands/drift-detection/services/amplify-config-service.js +0 -16
  27. package/lib/commands/drift-detection/services/amplify-config-service.js.map +1 -1
  28. package/lib/commands/drift-detection/services/cloudformation-service.d.ts +2 -4
  29. package/lib/commands/drift-detection/services/cloudformation-service.d.ts.map +1 -1
  30. package/lib/commands/drift-detection/services/cloudformation-service.js +7 -11
  31. package/lib/commands/drift-detection/services/cloudformation-service.js.map +1 -1
  32. package/lib/commands/drift-detection/services/drift-formatter.d.ts +3 -70
  33. package/lib/commands/drift-detection/services/drift-formatter.d.ts.map +1 -1
  34. package/lib/commands/drift-detection/services/drift-formatter.js +148 -603
  35. package/lib/commands/drift-detection/services/drift-formatter.js.map +1 -1
  36. package/lib/commands/drift-detection/services/index.d.ts +1 -2
  37. package/lib/commands/drift-detection/services/index.d.ts.map +1 -1
  38. package/lib/commands/drift-detection/services/index.js +2 -4
  39. package/lib/commands/drift-detection/services/index.js.map +1 -1
  40. package/lib/commands/drift.d.ts +7 -18
  41. package/lib/commands/drift.d.ts.map +1 -1
  42. package/lib/commands/drift.js +71 -172
  43. package/lib/commands/drift.js.map +1 -1
  44. package/lib/commands/gen2-migration/_infra/aws-clients.d.ts +31 -0
  45. package/lib/commands/gen2-migration/_infra/aws-clients.d.ts.map +1 -0
  46. package/lib/commands/gen2-migration/_infra/aws-clients.js +64 -0
  47. package/lib/commands/gen2-migration/_infra/aws-clients.js.map +1 -0
  48. package/lib/commands/gen2-migration/_infra/categories.d.ts +2 -0
  49. package/lib/commands/gen2-migration/_infra/categories.d.ts.map +1 -0
  50. package/lib/commands/gen2-migration/_infra/categories.js +32 -0
  51. package/lib/commands/gen2-migration/_infra/categories.js.map +1 -0
  52. package/lib/commands/gen2-migration/_infra/cfn-template.d.ts +52 -0
  53. package/lib/commands/gen2-migration/_infra/cfn-template.d.ts.map +1 -0
  54. package/lib/commands/gen2-migration/_infra/cfn-template.js +21 -0
  55. package/lib/commands/gen2-migration/_infra/cfn-template.js.map +1 -0
  56. package/lib/commands/gen2-migration/_infra/operation.d.ts +16 -0
  57. package/lib/commands/gen2-migration/_infra/operation.d.ts.map +1 -0
  58. package/lib/commands/gen2-migration/_infra/operation.js +3 -0
  59. package/lib/commands/gen2-migration/_infra/operation.js.map +1 -0
  60. package/lib/commands/gen2-migration/_infra/plan.d.ts +21 -0
  61. package/lib/commands/gen2-migration/_infra/plan.d.ts.map +1 -0
  62. package/lib/commands/gen2-migration/_infra/plan.js +111 -0
  63. package/lib/commands/gen2-migration/_infra/plan.js.map +1 -0
  64. package/lib/commands/gen2-migration/_infra/planner.d.ts +5 -0
  65. package/lib/commands/gen2-migration/_infra/planner.d.ts.map +1 -0
  66. package/lib/commands/gen2-migration/{generate/custom-resources/types.js → _infra/planner.js} +1 -1
  67. package/lib/commands/gen2-migration/_infra/planner.js.map +1 -0
  68. package/lib/commands/gen2-migration/_infra/spinning-logger.d.ts +25 -0
  69. package/lib/commands/gen2-migration/_infra/spinning-logger.d.ts.map +1 -0
  70. package/lib/commands/gen2-migration/_infra/spinning-logger.js +115 -0
  71. package/lib/commands/gen2-migration/_infra/spinning-logger.js.map +1 -0
  72. package/lib/commands/gen2-migration/_infra/stateful-resources.d.ts.map +1 -0
  73. package/lib/commands/gen2-migration/_infra/stateful-resources.js.map +1 -0
  74. package/lib/commands/gen2-migration/_infra/step.d.ts +15 -0
  75. package/lib/commands/gen2-migration/_infra/step.d.ts.map +1 -0
  76. package/lib/commands/gen2-migration/_infra/step.js +13 -0
  77. package/lib/commands/gen2-migration/_infra/step.js.map +1 -0
  78. package/lib/commands/gen2-migration/{_validations.d.ts → _infra/validations.d.ts} +6 -7
  79. package/lib/commands/gen2-migration/_infra/validations.d.ts.map +1 -0
  80. package/lib/commands/gen2-migration/{_validations.js → _infra/validations.js} +24 -60
  81. package/lib/commands/gen2-migration/_infra/validations.js.map +1 -0
  82. package/lib/commands/gen2-migration/assess/analytics/kinesis.assessor.d.ts +10 -0
  83. package/lib/commands/gen2-migration/assess/analytics/kinesis.assessor.d.ts.map +1 -0
  84. package/lib/commands/gen2-migration/assess/analytics/kinesis.assessor.js +15 -0
  85. package/lib/commands/gen2-migration/assess/analytics/kinesis.assessor.js.map +1 -0
  86. package/lib/commands/gen2-migration/assess/api/data.assessor.d.ts +10 -0
  87. package/lib/commands/gen2-migration/assess/api/data.assessor.d.ts.map +1 -0
  88. package/lib/commands/gen2-migration/assess/api/data.assessor.js +25 -0
  89. package/lib/commands/gen2-migration/assess/api/data.assessor.js.map +1 -0
  90. package/lib/commands/gen2-migration/assess/api/rest-api.assessor.d.ts +10 -0
  91. package/lib/commands/gen2-migration/assess/api/rest-api.assessor.d.ts.map +1 -0
  92. package/lib/commands/gen2-migration/assess/api/rest-api.assessor.js +25 -0
  93. package/lib/commands/gen2-migration/assess/api/rest-api.assessor.js.map +1 -0
  94. package/lib/commands/gen2-migration/assess/assessment.d.ts +42 -0
  95. package/lib/commands/gen2-migration/assess/assessment.d.ts.map +1 -0
  96. package/lib/commands/gen2-migration/assess/assessment.js +118 -0
  97. package/lib/commands/gen2-migration/assess/assessment.js.map +1 -0
  98. package/lib/commands/gen2-migration/assess/assessor.d.ts +5 -0
  99. package/lib/commands/gen2-migration/assess/assessor.d.ts.map +1 -0
  100. package/lib/commands/gen2-migration/{generate/types.js → assess/assessor.js} +1 -1
  101. package/lib/commands/gen2-migration/assess/assessor.js.map +1 -0
  102. package/lib/commands/gen2-migration/assess/auth/auth-cognito.assessor.d.ts +10 -0
  103. package/lib/commands/gen2-migration/assess/auth/auth-cognito.assessor.d.ts.map +1 -0
  104. package/lib/commands/gen2-migration/assess/auth/auth-cognito.assessor.js +30 -0
  105. package/lib/commands/gen2-migration/assess/auth/auth-cognito.assessor.js.map +1 -0
  106. package/lib/commands/gen2-migration/assess/auth/auth-user-pool-groups.assessor.d.ts +10 -0
  107. package/lib/commands/gen2-migration/assess/auth/auth-user-pool-groups.assessor.d.ts.map +1 -0
  108. package/lib/commands/gen2-migration/assess/auth/auth-user-pool-groups.assessor.js +24 -0
  109. package/lib/commands/gen2-migration/assess/auth/auth-user-pool-groups.assessor.js.map +1 -0
  110. package/lib/commands/gen2-migration/assess/function/function.assessor.d.ts +12 -0
  111. package/lib/commands/gen2-migration/assess/function/function.assessor.d.ts.map +1 -0
  112. package/lib/commands/gen2-migration/assess/function/function.assessor.js +40 -0
  113. package/lib/commands/gen2-migration/assess/function/function.assessor.js.map +1 -0
  114. package/lib/commands/gen2-migration/assess/geo/geo-geofence-collection.assessor.d.ts +10 -0
  115. package/lib/commands/gen2-migration/assess/geo/geo-geofence-collection.assessor.d.ts.map +1 -0
  116. package/lib/commands/gen2-migration/assess/geo/geo-geofence-collection.assessor.js +19 -0
  117. package/lib/commands/gen2-migration/assess/geo/geo-geofence-collection.assessor.js.map +1 -0
  118. package/lib/commands/gen2-migration/assess/geo/geo-map.assessor.d.ts +10 -0
  119. package/lib/commands/gen2-migration/assess/geo/geo-map.assessor.d.ts.map +1 -0
  120. package/lib/commands/gen2-migration/assess/geo/geo-map.assessor.js +15 -0
  121. package/lib/commands/gen2-migration/assess/geo/geo-map.assessor.js.map +1 -0
  122. package/lib/commands/gen2-migration/assess/geo/geo-place-index.assessor.d.ts +10 -0
  123. package/lib/commands/gen2-migration/assess/geo/geo-place-index.assessor.d.ts.map +1 -0
  124. package/lib/commands/gen2-migration/assess/geo/geo-place-index.assessor.js +15 -0
  125. package/lib/commands/gen2-migration/assess/geo/geo-place-index.assessor.js.map +1 -0
  126. package/lib/commands/gen2-migration/assess/storage/dynamodb.assessor.d.ts +10 -0
  127. package/lib/commands/gen2-migration/assess/storage/dynamodb.assessor.d.ts.map +1 -0
  128. package/lib/commands/gen2-migration/assess/storage/dynamodb.assessor.js +25 -0
  129. package/lib/commands/gen2-migration/assess/storage/dynamodb.assessor.js.map +1 -0
  130. package/lib/commands/gen2-migration/assess/storage/s3.assessor.d.ts +10 -0
  131. package/lib/commands/gen2-migration/assess/storage/s3.assessor.d.ts.map +1 -0
  132. package/lib/commands/gen2-migration/assess/storage/s3.assessor.js +25 -0
  133. package/lib/commands/gen2-migration/assess/storage/s3.assessor.js.map +1 -0
  134. package/lib/commands/gen2-migration/assess.d.ts +9 -0
  135. package/lib/commands/gen2-migration/assess.d.ts.map +1 -0
  136. package/lib/commands/gen2-migration/assess.js +80 -0
  137. package/lib/commands/gen2-migration/assess.js.map +1 -0
  138. package/lib/commands/gen2-migration/decommission.d.ts +6 -5
  139. package/lib/commands/gen2-migration/decommission.d.ts.map +1 -1
  140. package/lib/commands/gen2-migration/decommission.js +82 -25
  141. package/lib/commands/gen2-migration/decommission.js.map +1 -1
  142. package/lib/commands/gen2-migration/generate/_infra/aws-fetcher.d.ts +32 -0
  143. package/lib/commands/gen2-migration/generate/_infra/aws-fetcher.d.ts.map +1 -0
  144. package/lib/commands/gen2-migration/generate/_infra/aws-fetcher.js +136 -0
  145. package/lib/commands/gen2-migration/generate/_infra/aws-fetcher.js.map +1 -0
  146. package/lib/commands/gen2-migration/generate/_infra/files.d.ts +2 -0
  147. package/lib/commands/gen2-migration/generate/_infra/files.d.ts.map +1 -0
  148. package/lib/commands/gen2-migration/generate/{codegen-head/directory_exists.js → _infra/files.js} +4 -5
  149. package/lib/commands/gen2-migration/generate/_infra/files.js.map +1 -0
  150. package/lib/commands/gen2-migration/generate/_infra/gen1-app.d.ts +40 -0
  151. package/lib/commands/gen2-migration/generate/_infra/gen1-app.d.ts.map +1 -0
  152. package/lib/commands/gen2-migration/generate/_infra/gen1-app.js +198 -0
  153. package/lib/commands/gen2-migration/generate/_infra/gen1-app.js.map +1 -0
  154. package/lib/commands/gen2-migration/generate/_infra/ts.d.ts +24 -0
  155. package/lib/commands/gen2-migration/generate/_infra/ts.d.ts.map +1 -0
  156. package/lib/commands/gen2-migration/generate/_infra/ts.js +128 -0
  157. package/lib/commands/gen2-migration/generate/_infra/ts.js.map +1 -0
  158. package/lib/commands/gen2-migration/generate/amplify/analytics/cfn-condition-resolver.d.ts +18 -0
  159. package/lib/commands/gen2-migration/generate/amplify/analytics/cfn-condition-resolver.d.ts.map +1 -0
  160. package/lib/commands/gen2-migration/generate/amplify/analytics/cfn-condition-resolver.js +126 -0
  161. package/lib/commands/gen2-migration/generate/amplify/analytics/cfn-condition-resolver.js.map +1 -0
  162. package/lib/commands/gen2-migration/generate/amplify/analytics/kinesis-cfn-converter.d.ts +33 -0
  163. package/lib/commands/gen2-migration/generate/amplify/analytics/kinesis-cfn-converter.d.ts.map +1 -0
  164. package/lib/commands/gen2-migration/generate/{unsupported/cdk-from-cfn.js → amplify/analytics/kinesis-cfn-converter.js} +94 -52
  165. package/lib/commands/gen2-migration/generate/amplify/analytics/kinesis-cfn-converter.js.map +1 -0
  166. package/lib/commands/gen2-migration/generate/amplify/analytics/kinesis.generator.d.ts +14 -0
  167. package/lib/commands/gen2-migration/generate/amplify/analytics/kinesis.generator.d.ts.map +1 -0
  168. package/lib/commands/gen2-migration/generate/amplify/analytics/kinesis.generator.js +69 -0
  169. package/lib/commands/gen2-migration/generate/amplify/analytics/kinesis.generator.js.map +1 -0
  170. package/lib/commands/gen2-migration/generate/amplify/analytics/kinesis.renderer.d.ts +18 -0
  171. package/lib/commands/gen2-migration/generate/amplify/analytics/kinesis.renderer.d.ts.map +1 -0
  172. package/lib/commands/gen2-migration/generate/amplify/analytics/kinesis.renderer.js +68 -0
  173. package/lib/commands/gen2-migration/generate/amplify/analytics/kinesis.renderer.js.map +1 -0
  174. package/lib/commands/gen2-migration/generate/amplify/auth/auth.generator.d.ts +24 -0
  175. package/lib/commands/gen2-migration/generate/amplify/auth/auth.generator.d.ts.map +1 -0
  176. package/lib/commands/gen2-migration/generate/amplify/auth/auth.generator.js +233 -0
  177. package/lib/commands/gen2-migration/generate/amplify/auth/auth.generator.js.map +1 -0
  178. package/lib/commands/gen2-migration/generate/amplify/auth/auth.renderer.d.ts +78 -0
  179. package/lib/commands/gen2-migration/generate/amplify/auth/auth.renderer.d.ts.map +1 -0
  180. package/lib/commands/gen2-migration/generate/amplify/auth/auth.renderer.js +491 -0
  181. package/lib/commands/gen2-migration/generate/amplify/auth/auth.renderer.js.map +1 -0
  182. package/lib/commands/gen2-migration/generate/amplify/auth/reference-auth.generator.d.ts +15 -0
  183. package/lib/commands/gen2-migration/generate/amplify/auth/reference-auth.generator.d.ts.map +1 -0
  184. package/lib/commands/gen2-migration/generate/amplify/auth/reference-auth.generator.js +75 -0
  185. package/lib/commands/gen2-migration/generate/amplify/auth/reference-auth.generator.js.map +1 -0
  186. package/lib/commands/gen2-migration/generate/amplify/auth/reference-auth.renderer.d.ts +13 -0
  187. package/lib/commands/gen2-migration/generate/amplify/auth/reference-auth.renderer.d.ts.map +1 -0
  188. package/lib/commands/gen2-migration/generate/amplify/auth/reference-auth.renderer.js +33 -0
  189. package/lib/commands/gen2-migration/generate/amplify/auth/reference-auth.renderer.js.map +1 -0
  190. package/lib/commands/gen2-migration/generate/amplify/backend.generator.d.ts +22 -0
  191. package/lib/commands/gen2-migration/generate/amplify/backend.generator.d.ts.map +1 -0
  192. package/lib/commands/gen2-migration/generate/amplify/backend.generator.js +150 -0
  193. package/lib/commands/gen2-migration/generate/amplify/backend.generator.js.map +1 -0
  194. package/lib/commands/gen2-migration/generate/{custom-resources/transformer → amplify/custom-resources}/amplify-helper-transformer.d.ts +4 -0
  195. package/lib/commands/gen2-migration/generate/amplify/custom-resources/amplify-helper-transformer.d.ts.map +1 -0
  196. package/lib/commands/gen2-migration/generate/amplify/custom-resources/amplify-helper-transformer.js +333 -0
  197. package/lib/commands/gen2-migration/generate/amplify/custom-resources/amplify-helper-transformer.js.map +1 -0
  198. package/lib/commands/gen2-migration/generate/amplify/custom-resources/custom.generator.d.ts +17 -0
  199. package/lib/commands/gen2-migration/generate/amplify/custom-resources/custom.generator.d.ts.map +1 -0
  200. package/lib/commands/gen2-migration/generate/amplify/custom-resources/custom.generator.js +190 -0
  201. package/lib/commands/gen2-migration/generate/amplify/custom-resources/custom.generator.js.map +1 -0
  202. package/lib/commands/gen2-migration/generate/amplify/data/data.generator.d.ts +15 -0
  203. package/lib/commands/gen2-migration/generate/amplify/data/data.generator.d.ts.map +1 -0
  204. package/lib/commands/gen2-migration/generate/amplify/data/data.generator.js +112 -0
  205. package/lib/commands/gen2-migration/generate/amplify/data/data.generator.js.map +1 -0
  206. package/lib/commands/gen2-migration/generate/amplify/data/data.renderer.d.ts +22 -0
  207. package/lib/commands/gen2-migration/generate/amplify/data/data.renderer.d.ts.map +1 -0
  208. package/lib/commands/gen2-migration/generate/amplify/data/data.renderer.js +167 -0
  209. package/lib/commands/gen2-migration/generate/amplify/data/data.renderer.js.map +1 -0
  210. package/lib/commands/gen2-migration/generate/amplify/function/function.generator.d.ts +49 -0
  211. package/lib/commands/gen2-migration/generate/amplify/function/function.generator.d.ts.map +1 -0
  212. package/lib/commands/gen2-migration/generate/amplify/function/function.generator.js +626 -0
  213. package/lib/commands/gen2-migration/generate/amplify/function/function.generator.js.map +1 -0
  214. package/lib/commands/gen2-migration/generate/amplify/function/function.renderer.d.ts +21 -0
  215. package/lib/commands/gen2-migration/generate/amplify/function/function.renderer.d.ts.map +1 -0
  216. package/lib/commands/gen2-migration/generate/amplify/function/function.renderer.js +105 -0
  217. package/lib/commands/gen2-migration/generate/amplify/function/function.renderer.js.map +1 -0
  218. package/lib/commands/gen2-migration/generate/amplify/geo/geo-cfn-converter.d.ts +49 -0
  219. package/lib/commands/gen2-migration/generate/amplify/geo/geo-cfn-converter.d.ts.map +1 -0
  220. package/lib/commands/gen2-migration/generate/amplify/geo/geo-cfn-converter.js +239 -0
  221. package/lib/commands/gen2-migration/generate/amplify/geo/geo-cfn-converter.js.map +1 -0
  222. package/lib/commands/gen2-migration/generate/amplify/geo/geo.generator.d.ts +14 -0
  223. package/lib/commands/gen2-migration/generate/amplify/geo/geo.generator.d.ts.map +1 -0
  224. package/lib/commands/gen2-migration/generate/amplify/geo/geo.generator.js +70 -0
  225. package/lib/commands/gen2-migration/generate/amplify/geo/geo.generator.js.map +1 -0
  226. package/lib/commands/gen2-migration/generate/amplify/geo/geo.renderer.d.ts +13 -0
  227. package/lib/commands/gen2-migration/generate/amplify/geo/geo.renderer.d.ts.map +1 -0
  228. package/lib/commands/gen2-migration/generate/amplify/geo/geo.renderer.js +161 -0
  229. package/lib/commands/gen2-migration/generate/amplify/geo/geo.renderer.js.map +1 -0
  230. package/lib/commands/gen2-migration/generate/amplify/package.json.generator.d.ts +8 -0
  231. package/lib/commands/gen2-migration/generate/amplify/package.json.generator.d.ts.map +1 -0
  232. package/lib/commands/gen2-migration/generate/amplify/package.json.generator.js +28 -0
  233. package/lib/commands/gen2-migration/generate/amplify/package.json.generator.js.map +1 -0
  234. package/lib/commands/gen2-migration/generate/amplify/rest-api/rest-api.generator.d.ts +15 -0
  235. package/lib/commands/gen2-migration/generate/amplify/rest-api/rest-api.generator.d.ts.map +1 -0
  236. package/lib/commands/gen2-migration/generate/amplify/rest-api/rest-api.generator.js +162 -0
  237. package/lib/commands/gen2-migration/generate/amplify/rest-api/rest-api.generator.js.map +1 -0
  238. package/lib/commands/gen2-migration/generate/amplify/rest-api/rest-api.renderer.d.ts +51 -0
  239. package/lib/commands/gen2-migration/generate/amplify/rest-api/rest-api.renderer.d.ts.map +1 -0
  240. package/lib/commands/gen2-migration/generate/amplify/rest-api/rest-api.renderer.js +269 -0
  241. package/lib/commands/gen2-migration/generate/amplify/rest-api/rest-api.renderer.js.map +1 -0
  242. package/lib/commands/gen2-migration/generate/amplify/storage/dynamodb.generator.d.ts +14 -0
  243. package/lib/commands/gen2-migration/generate/amplify/storage/dynamodb.generator.d.ts.map +1 -0
  244. package/lib/commands/gen2-migration/generate/amplify/storage/dynamodb.generator.js +96 -0
  245. package/lib/commands/gen2-migration/generate/amplify/storage/dynamodb.generator.js.map +1 -0
  246. package/lib/commands/gen2-migration/generate/amplify/storage/dynamodb.renderer.d.ts +30 -0
  247. package/lib/commands/gen2-migration/generate/amplify/storage/dynamodb.renderer.d.ts.map +1 -0
  248. package/lib/commands/gen2-migration/generate/amplify/storage/dynamodb.renderer.js +90 -0
  249. package/lib/commands/gen2-migration/generate/amplify/storage/dynamodb.renderer.js.map +1 -0
  250. package/lib/commands/gen2-migration/generate/amplify/storage/s3.generator.d.ts +22 -0
  251. package/lib/commands/gen2-migration/generate/amplify/storage/s3.generator.d.ts.map +1 -0
  252. package/lib/commands/gen2-migration/generate/amplify/storage/s3.generator.js +132 -0
  253. package/lib/commands/gen2-migration/generate/amplify/storage/s3.generator.js.map +1 -0
  254. package/lib/commands/gen2-migration/generate/amplify/storage/s3.renderer.d.ts +31 -0
  255. package/lib/commands/gen2-migration/generate/amplify/storage/s3.renderer.d.ts.map +1 -0
  256. package/lib/commands/gen2-migration/generate/amplify/storage/s3.renderer.js +137 -0
  257. package/lib/commands/gen2-migration/generate/amplify/storage/s3.renderer.js.map +1 -0
  258. package/lib/commands/gen2-migration/generate/amplify/tsconfig.generator.d.ts +8 -0
  259. package/lib/commands/gen2-migration/generate/amplify/tsconfig.generator.d.ts.map +1 -0
  260. package/lib/commands/gen2-migration/generate/amplify/tsconfig.generator.js +45 -0
  261. package/lib/commands/gen2-migration/generate/amplify/tsconfig.generator.js.map +1 -0
  262. package/lib/commands/gen2-migration/generate/amplify.yml.generator.d.ts +9 -0
  263. package/lib/commands/gen2-migration/generate/amplify.yml.generator.d.ts.map +1 -0
  264. package/lib/commands/gen2-migration/generate/amplify.yml.generator.js +112 -0
  265. package/lib/commands/gen2-migration/generate/amplify.yml.generator.js.map +1 -0
  266. package/lib/commands/gen2-migration/generate/gitignore.generator.d.ts +6 -0
  267. package/lib/commands/gen2-migration/generate/gitignore.generator.d.ts.map +1 -0
  268. package/lib/commands/gen2-migration/generate/gitignore.generator.js +45 -0
  269. package/lib/commands/gen2-migration/generate/gitignore.generator.js.map +1 -0
  270. package/lib/commands/gen2-migration/generate/package.json.generator.d.ts +12 -0
  271. package/lib/commands/gen2-migration/generate/package.json.generator.d.ts.map +1 -0
  272. package/lib/commands/gen2-migration/generate/package.json.generator.js +83 -0
  273. package/lib/commands/gen2-migration/generate/package.json.generator.js.map +1 -0
  274. package/lib/commands/gen2-migration/generate.d.ts +6 -5
  275. package/lib/commands/gen2-migration/generate.d.ts.map +1 -1
  276. package/lib/commands/gen2-migration/generate.js +232 -17
  277. package/lib/commands/gen2-migration/generate.js.map +1 -1
  278. package/lib/commands/gen2-migration/lock.d.ts +10 -6
  279. package/lib/commands/gen2-migration/lock.d.ts.map +1 -1
  280. package/lib/commands/gen2-migration/lock.js +182 -64
  281. package/lib/commands/gen2-migration/lock.js.map +1 -1
  282. package/lib/commands/gen2-migration/refactor/analytics/analytics-forward.d.ts +9 -0
  283. package/lib/commands/gen2-migration/refactor/analytics/analytics-forward.d.ts.map +1 -0
  284. package/lib/commands/gen2-migration/refactor/analytics/analytics-forward.js +19 -0
  285. package/lib/commands/gen2-migration/refactor/analytics/analytics-forward.js.map +1 -0
  286. package/lib/commands/gen2-migration/refactor/analytics/analytics-rollback.d.ts +9 -0
  287. package/lib/commands/gen2-migration/refactor/analytics/analytics-rollback.d.ts.map +1 -0
  288. package/lib/commands/gen2-migration/refactor/analytics/analytics-rollback.js +26 -0
  289. package/lib/commands/gen2-migration/refactor/analytics/analytics-rollback.js.map +1 -0
  290. package/lib/commands/gen2-migration/refactor/auth/auth-cognito-forward.d.ts +21 -0
  291. package/lib/commands/gen2-migration/refactor/auth/auth-cognito-forward.d.ts.map +1 -0
  292. package/lib/commands/gen2-migration/refactor/auth/auth-cognito-forward.js +87 -0
  293. package/lib/commands/gen2-migration/refactor/auth/auth-cognito-forward.js.map +1 -0
  294. package/lib/commands/gen2-migration/refactor/auth/auth-cognito-rollback.d.ts +9 -0
  295. package/lib/commands/gen2-migration/refactor/auth/auth-cognito-rollback.d.ts.map +1 -0
  296. package/lib/commands/gen2-migration/refactor/auth/auth-cognito-rollback.js +44 -0
  297. package/lib/commands/gen2-migration/refactor/auth/auth-cognito-rollback.js.map +1 -0
  298. package/lib/commands/gen2-migration/refactor/auth/auth-user-pool-groups-forward.d.ts +11 -0
  299. package/lib/commands/gen2-migration/refactor/auth/auth-user-pool-groups-forward.d.ts.map +1 -0
  300. package/lib/commands/gen2-migration/refactor/auth/auth-user-pool-groups-forward.js +33 -0
  301. package/lib/commands/gen2-migration/refactor/auth/auth-user-pool-groups-forward.js.map +1 -0
  302. package/lib/commands/gen2-migration/refactor/auth/auth-user-pool-groups-rollback.d.ts +9 -0
  303. package/lib/commands/gen2-migration/refactor/auth/auth-user-pool-groups-rollback.d.ts.map +1 -0
  304. package/lib/commands/gen2-migration/refactor/auth/auth-user-pool-groups-rollback.js +26 -0
  305. package/lib/commands/gen2-migration/refactor/auth/auth-user-pool-groups-rollback.js.map +1 -0
  306. package/lib/commands/gen2-migration/refactor/cfn.d.ts +41 -0
  307. package/lib/commands/gen2-migration/refactor/cfn.d.ts.map +1 -0
  308. package/lib/commands/gen2-migration/refactor/cfn.js +337 -0
  309. package/lib/commands/gen2-migration/refactor/cfn.js.map +1 -0
  310. package/lib/commands/gen2-migration/refactor/index.d.ts +1 -1
  311. package/lib/commands/gen2-migration/refactor/index.d.ts.map +1 -1
  312. package/lib/commands/gen2-migration/refactor/index.js +1 -1
  313. package/lib/commands/gen2-migration/refactor/index.js.map +1 -1
  314. package/lib/commands/gen2-migration/refactor/oauth-values-retriever.d.ts +23 -11
  315. package/lib/commands/gen2-migration/refactor/oauth-values-retriever.d.ts.map +1 -1
  316. package/lib/commands/gen2-migration/refactor/oauth-values-retriever.js +53 -45
  317. package/lib/commands/gen2-migration/refactor/oauth-values-retriever.js.map +1 -1
  318. package/lib/commands/gen2-migration/refactor/resolvers/cfn-condition-resolver.d.ts +2 -11
  319. package/lib/commands/gen2-migration/refactor/resolvers/cfn-condition-resolver.d.ts.map +1 -1
  320. package/lib/commands/gen2-migration/refactor/resolvers/cfn-condition-resolver.js +89 -123
  321. package/lib/commands/gen2-migration/refactor/resolvers/cfn-condition-resolver.js.map +1 -1
  322. package/lib/commands/gen2-migration/refactor/resolvers/cfn-dependency-resolver.d.ts +2 -7
  323. package/lib/commands/gen2-migration/refactor/resolvers/cfn-dependency-resolver.d.ts.map +1 -1
  324. package/lib/commands/gen2-migration/refactor/resolvers/cfn-dependency-resolver.js +6 -22
  325. package/lib/commands/gen2-migration/refactor/resolvers/cfn-dependency-resolver.js.map +1 -1
  326. package/lib/commands/gen2-migration/refactor/resolvers/cfn-output-resolver.d.ts +8 -12
  327. package/lib/commands/gen2-migration/refactor/resolvers/cfn-output-resolver.d.ts.map +1 -1
  328. package/lib/commands/gen2-migration/refactor/resolvers/cfn-output-resolver.js +105 -127
  329. package/lib/commands/gen2-migration/refactor/resolvers/cfn-output-resolver.js.map +1 -1
  330. package/lib/commands/gen2-migration/refactor/resolvers/cfn-parameter-resolver.d.ts +2 -8
  331. package/lib/commands/gen2-migration/refactor/resolvers/cfn-parameter-resolver.d.ts.map +1 -1
  332. package/lib/commands/gen2-migration/refactor/resolvers/cfn-parameter-resolver.js +36 -41
  333. package/lib/commands/gen2-migration/refactor/resolvers/cfn-parameter-resolver.js.map +1 -1
  334. package/lib/commands/gen2-migration/refactor/resolvers/cfn-tree-walker.d.ts +3 -0
  335. package/lib/commands/gen2-migration/refactor/resolvers/cfn-tree-walker.d.ts.map +1 -0
  336. package/lib/commands/gen2-migration/refactor/resolvers/cfn-tree-walker.js +18 -0
  337. package/lib/commands/gen2-migration/refactor/resolvers/cfn-tree-walker.js.map +1 -0
  338. package/lib/commands/gen2-migration/refactor/stack-facade.d.ts +13 -0
  339. package/lib/commands/gen2-migration/refactor/stack-facade.d.ts.map +1 -0
  340. package/lib/commands/gen2-migration/refactor/stack-facade.js +39 -0
  341. package/lib/commands/gen2-migration/refactor/stack-facade.js.map +1 -0
  342. package/lib/commands/gen2-migration/refactor/storage/storage-dynamo-forward.d.ts +8 -0
  343. package/lib/commands/gen2-migration/refactor/storage/storage-dynamo-forward.d.ts.map +1 -0
  344. package/lib/commands/gen2-migration/refactor/storage/storage-dynamo-forward.js +18 -0
  345. package/lib/commands/gen2-migration/refactor/storage/storage-dynamo-forward.js.map +1 -0
  346. package/lib/commands/gen2-migration/refactor/storage/storage-dynamo-rollback.d.ts +9 -0
  347. package/lib/commands/gen2-migration/refactor/storage/storage-dynamo-rollback.d.ts.map +1 -0
  348. package/lib/commands/gen2-migration/refactor/storage/storage-dynamo-rollback.js +26 -0
  349. package/lib/commands/gen2-migration/refactor/storage/storage-dynamo-rollback.js.map +1 -0
  350. package/lib/commands/gen2-migration/refactor/storage/storage-forward.d.ts +10 -0
  351. package/lib/commands/gen2-migration/refactor/storage/storage-forward.d.ts.map +1 -0
  352. package/lib/commands/gen2-migration/refactor/storage/storage-forward.js +36 -0
  353. package/lib/commands/gen2-migration/refactor/storage/storage-forward.js.map +1 -0
  354. package/lib/commands/gen2-migration/refactor/storage/storage-rollback.d.ts +9 -0
  355. package/lib/commands/gen2-migration/refactor/storage/storage-rollback.d.ts.map +1 -0
  356. package/lib/commands/gen2-migration/refactor/storage/storage-rollback.js +26 -0
  357. package/lib/commands/gen2-migration/refactor/storage/storage-rollback.js.map +1 -0
  358. package/lib/commands/gen2-migration/refactor/utils.d.ts +1 -1
  359. package/lib/commands/gen2-migration/refactor/utils.d.ts.map +1 -1
  360. package/lib/commands/gen2-migration/refactor/utils.js +2 -2
  361. package/lib/commands/gen2-migration/refactor/utils.js.map +1 -1
  362. package/lib/commands/gen2-migration/refactor/workflow/category-refactorer.d.ts +52 -0
  363. package/lib/commands/gen2-migration/refactor/workflow/category-refactorer.d.ts.map +1 -0
  364. package/lib/commands/gen2-migration/refactor/workflow/category-refactorer.js +212 -0
  365. package/lib/commands/gen2-migration/refactor/workflow/category-refactorer.js.map +1 -0
  366. package/lib/commands/gen2-migration/refactor/workflow/forward-category-refactorer.d.ts +15 -0
  367. package/lib/commands/gen2-migration/refactor/workflow/forward-category-refactorer.d.ts.map +1 -0
  368. package/lib/commands/gen2-migration/refactor/workflow/forward-category-refactorer.js +148 -0
  369. package/lib/commands/gen2-migration/refactor/workflow/forward-category-refactorer.js.map +1 -0
  370. package/lib/commands/gen2-migration/refactor/workflow/rollback-category-refactorer.d.ts +13 -0
  371. package/lib/commands/gen2-migration/refactor/workflow/rollback-category-refactorer.d.ts.map +1 -0
  372. package/lib/commands/gen2-migration/refactor/workflow/rollback-category-refactorer.js +123 -0
  373. package/lib/commands/gen2-migration/refactor/workflow/rollback-category-refactorer.js.map +1 -0
  374. package/lib/commands/gen2-migration/refactor.d.ts +11 -0
  375. package/lib/commands/gen2-migration/refactor.d.ts.map +1 -0
  376. package/lib/commands/gen2-migration/refactor.js +189 -0
  377. package/lib/commands/gen2-migration/refactor.js.map +1 -0
  378. package/lib/commands/gen2-migration.d.ts +0 -12
  379. package/lib/commands/gen2-migration.d.ts.map +1 -1
  380. package/lib/commands/gen2-migration.js +82 -111
  381. package/lib/commands/gen2-migration.js.map +1 -1
  382. package/package.json +22 -12
  383. package/aws-amplify-cli-internal-gen2-migration-experimental-alpha-0.5.0.tgz +0 -0
  384. package/lib/commands/drift-detection/services/file-service.d.ts +0 -7
  385. package/lib/commands/drift-detection/services/file-service.d.ts.map +0 -1
  386. package/lib/commands/drift-detection/services/file-service.js +0 -53
  387. package/lib/commands/drift-detection/services/file-service.js.map +0 -1
  388. package/lib/commands/gen2-migration/_step.d.ts +0 -17
  389. package/lib/commands/gen2-migration/_step.d.ts.map +0 -1
  390. package/lib/commands/gen2-migration/_step.js +0 -16
  391. package/lib/commands/gen2-migration/_step.js.map +0 -1
  392. package/lib/commands/gen2-migration/_validations.d.ts.map +0 -1
  393. package/lib/commands/gen2-migration/_validations.js.map +0 -1
  394. package/lib/commands/gen2-migration/cleanup.d.ts +0 -8
  395. package/lib/commands/gen2-migration/cleanup.d.ts.map +0 -1
  396. package/lib/commands/gen2-migration/cleanup.js +0 -21
  397. package/lib/commands/gen2-migration/cleanup.js.map +0 -1
  398. package/lib/commands/gen2-migration/clone.d.ts +0 -8
  399. package/lib/commands/gen2-migration/clone.d.ts.map +0 -1
  400. package/lib/commands/gen2-migration/clone.js +0 -21
  401. package/lib/commands/gen2-migration/clone.js.map +0 -1
  402. package/lib/commands/gen2-migration/generate/adapters/auth/index.d.ts +0 -24
  403. package/lib/commands/gen2-migration/generate/adapters/auth/index.d.ts.map +0 -1
  404. package/lib/commands/gen2-migration/generate/adapters/auth/index.js +0 -297
  405. package/lib/commands/gen2-migration/generate/adapters/auth/index.js.map +0 -1
  406. package/lib/commands/gen2-migration/generate/adapters/auth/index.test.d.ts +0 -2
  407. package/lib/commands/gen2-migration/generate/adapters/auth/index.test.d.ts.map +0 -1
  408. package/lib/commands/gen2-migration/generate/adapters/auth/index.test.js +0 -140
  409. package/lib/commands/gen2-migration/generate/adapters/auth/index.test.js.map +0 -1
  410. package/lib/commands/gen2-migration/generate/adapters/data/index.d.ts +0 -5
  411. package/lib/commands/gen2-migration/generate/adapters/data/index.d.ts.map +0 -1
  412. package/lib/commands/gen2-migration/generate/adapters/data/index.js +0 -17
  413. package/lib/commands/gen2-migration/generate/adapters/data/index.js.map +0 -1
  414. package/lib/commands/gen2-migration/generate/adapters/functions/api-trigger-detector.d.ts +0 -10
  415. package/lib/commands/gen2-migration/generate/adapters/functions/api-trigger-detector.d.ts.map +0 -1
  416. package/lib/commands/gen2-migration/generate/adapters/functions/api-trigger-detector.js +0 -43
  417. package/lib/commands/gen2-migration/generate/adapters/functions/api-trigger-detector.js.map +0 -1
  418. package/lib/commands/gen2-migration/generate/adapters/functions/api-trigger-detector.test.d.ts +0 -2
  419. package/lib/commands/gen2-migration/generate/adapters/functions/api-trigger-detector.test.d.ts.map +0 -1
  420. package/lib/commands/gen2-migration/generate/adapters/functions/api-trigger-detector.test.js +0 -34
  421. package/lib/commands/gen2-migration/generate/adapters/functions/api-trigger-detector.test.js.map +0 -1
  422. package/lib/commands/gen2-migration/generate/adapters/functions/index.d.ts +0 -18
  423. package/lib/commands/gen2-migration/generate/adapters/functions/index.d.ts.map +0 -1
  424. package/lib/commands/gen2-migration/generate/adapters/functions/index.js +0 -85
  425. package/lib/commands/gen2-migration/generate/adapters/functions/index.js.map +0 -1
  426. package/lib/commands/gen2-migration/generate/adapters/project/index.d.ts +0 -2
  427. package/lib/commands/gen2-migration/generate/adapters/project/index.d.ts.map +0 -1
  428. package/lib/commands/gen2-migration/generate/adapters/project/index.js +0 -7
  429. package/lib/commands/gen2-migration/generate/adapters/project/index.js.map +0 -1
  430. package/lib/commands/gen2-migration/generate/adapters/storage/gen1_storage_codegen_adapter.d.ts +0 -31
  431. package/lib/commands/gen2-migration/generate/adapters/storage/gen1_storage_codegen_adapter.d.ts.map +0 -1
  432. package/lib/commands/gen2-migration/generate/adapters/storage/gen1_storage_codegen_adapter.js +0 -34
  433. package/lib/commands/gen2-migration/generate/adapters/storage/gen1_storage_codegen_adapter.js.map +0 -1
  434. package/lib/commands/gen2-migration/generate/adapters/storage/gen1_storage_codegen_adapter.test.d.ts +0 -2
  435. package/lib/commands/gen2-migration/generate/adapters/storage/gen1_storage_codegen_adapter.test.d.ts.map +0 -1
  436. package/lib/commands/gen2-migration/generate/adapters/storage/gen1_storage_codegen_adapter.test.js +0 -181
  437. package/lib/commands/gen2-migration/generate/adapters/storage/gen1_storage_codegen_adapter.test.js.map +0 -1
  438. package/lib/commands/gen2-migration/generate/adapters/storage/index.d.ts +0 -3
  439. package/lib/commands/gen2-migration/generate/adapters/storage/index.d.ts.map +0 -1
  440. package/lib/commands/gen2-migration/generate/adapters/storage/index.js +0 -10
  441. package/lib/commands/gen2-migration/generate/adapters/storage/index.js.map +0 -1
  442. package/lib/commands/gen2-migration/generate/adapters/storage/storage_access.d.ts +0 -25
  443. package/lib/commands/gen2-migration/generate/adapters/storage/storage_access.d.ts.map +0 -1
  444. package/lib/commands/gen2-migration/generate/adapters/storage/storage_access.js +0 -76
  445. package/lib/commands/gen2-migration/generate/adapters/storage/storage_access.js.map +0 -1
  446. package/lib/commands/gen2-migration/generate/adapters/storage/storage_access.test.d.ts +0 -2
  447. package/lib/commands/gen2-migration/generate/adapters/storage/storage_access.test.d.ts.map +0 -1
  448. package/lib/commands/gen2-migration/generate/adapters/storage/storage_access.test.js +0 -125
  449. package/lib/commands/gen2-migration/generate/adapters/storage/storage_access.test.js.map +0 -1
  450. package/lib/commands/gen2-migration/generate/backend/synthesizer.d.ts +0 -91
  451. package/lib/commands/gen2-migration/generate/backend/synthesizer.d.ts.map +0 -1
  452. package/lib/commands/gen2-migration/generate/backend/synthesizer.js +0 -1014
  453. package/lib/commands/gen2-migration/generate/backend/synthesizer.js.map +0 -1
  454. package/lib/commands/gen2-migration/generate/backend/synthesizer.test.d.ts +0 -2
  455. package/lib/commands/gen2-migration/generate/backend/synthesizer.test.d.ts.map +0 -1
  456. package/lib/commands/gen2-migration/generate/backend/synthesizer.test.js +0 -777
  457. package/lib/commands/gen2-migration/generate/backend/synthesizer.test.js.map +0 -1
  458. package/lib/commands/gen2-migration/generate/codegen-head/amplify_stack_parser.d.ts +0 -14
  459. package/lib/commands/gen2-migration/generate/codegen-head/amplify_stack_parser.d.ts.map +0 -1
  460. package/lib/commands/gen2-migration/generate/codegen-head/amplify_stack_parser.js +0 -82
  461. package/lib/commands/gen2-migration/generate/codegen-head/amplify_stack_parser.js.map +0 -1
  462. package/lib/commands/gen2-migration/generate/codegen-head/analytics.d.ts +0 -10
  463. package/lib/commands/gen2-migration/generate/codegen-head/analytics.d.ts.map +0 -1
  464. package/lib/commands/gen2-migration/generate/codegen-head/analytics.js +0 -11
  465. package/lib/commands/gen2-migration/generate/codegen-head/analytics.js.map +0 -1
  466. package/lib/commands/gen2-migration/generate/codegen-head/api-cfn-access.d.ts +0 -7
  467. package/lib/commands/gen2-migration/generate/codegen-head/api-cfn-access.d.ts.map +0 -1
  468. package/lib/commands/gen2-migration/generate/codegen-head/api-cfn-access.js +0 -80
  469. package/lib/commands/gen2-migration/generate/codegen-head/api-cfn-access.js.map +0 -1
  470. package/lib/commands/gen2-migration/generate/codegen-head/app_analytics_definition_fetcher.d.ts +0 -13
  471. package/lib/commands/gen2-migration/generate/codegen-head/app_analytics_definition_fetcher.d.ts.map +0 -1
  472. package/lib/commands/gen2-migration/generate/codegen-head/app_analytics_definition_fetcher.js +0 -59
  473. package/lib/commands/gen2-migration/generate/codegen-head/app_analytics_definition_fetcher.js.map +0 -1
  474. package/lib/commands/gen2-migration/generate/codegen-head/app_auth_definition_fetcher.d.ts +0 -24
  475. package/lib/commands/gen2-migration/generate/codegen-head/app_auth_definition_fetcher.d.ts.map +0 -1
  476. package/lib/commands/gen2-migration/generate/codegen-head/app_auth_definition_fetcher.js +0 -167
  477. package/lib/commands/gen2-migration/generate/codegen-head/app_auth_definition_fetcher.js.map +0 -1
  478. package/lib/commands/gen2-migration/generate/codegen-head/app_functions_definition_fetcher.d.ts +0 -21
  479. package/lib/commands/gen2-migration/generate/codegen-head/app_functions_definition_fetcher.d.ts.map +0 -1
  480. package/lib/commands/gen2-migration/generate/codegen-head/app_functions_definition_fetcher.js +0 -135
  481. package/lib/commands/gen2-migration/generate/codegen-head/app_functions_definition_fetcher.js.map +0 -1
  482. package/lib/commands/gen2-migration/generate/codegen-head/app_storage_definition_fetcher.d.ts +0 -23
  483. package/lib/commands/gen2-migration/generate/codegen-head/app_storage_definition_fetcher.d.ts.map +0 -1
  484. package/lib/commands/gen2-migration/generate/codegen-head/app_storage_definition_fetcher.js +0 -181
  485. package/lib/commands/gen2-migration/generate/codegen-head/app_storage_definition_fetcher.js.map +0 -1
  486. package/lib/commands/gen2-migration/generate/codegen-head/auth_access_analyzer.d.ts +0 -12
  487. package/lib/commands/gen2-migration/generate/codegen-head/auth_access_analyzer.d.ts.map +0 -1
  488. package/lib/commands/gen2-migration/generate/codegen-head/auth_access_analyzer.js +0 -157
  489. package/lib/commands/gen2-migration/generate/codegen-head/auth_access_analyzer.js.map +0 -1
  490. package/lib/commands/gen2-migration/generate/codegen-head/backend_downloader.d.ts +0 -10
  491. package/lib/commands/gen2-migration/generate/codegen-head/backend_downloader.d.ts.map +0 -1
  492. package/lib/commands/gen2-migration/generate/codegen-head/backend_downloader.js +0 -48
  493. package/lib/commands/gen2-migration/generate/codegen-head/backend_downloader.js.map +0 -1
  494. package/lib/commands/gen2-migration/generate/codegen-head/backend_environment_selector.d.ts +0 -11
  495. package/lib/commands/gen2-migration/generate/codegen-head/backend_environment_selector.d.ts.map +0 -1
  496. package/lib/commands/gen2-migration/generate/codegen-head/backend_environment_selector.js +0 -38
  497. package/lib/commands/gen2-migration/generate/codegen-head/backend_environment_selector.js.map +0 -1
  498. package/lib/commands/gen2-migration/generate/codegen-head/command-handlers.d.ts +0 -13
  499. package/lib/commands/gen2-migration/generate/codegen-head/command-handlers.d.ts.map +0 -1
  500. package/lib/commands/gen2-migration/generate/codegen-head/command-handlers.js +0 -498
  501. package/lib/commands/gen2-migration/generate/codegen-head/command-handlers.js.map +0 -1
  502. package/lib/commands/gen2-migration/generate/codegen-head/data_definition_fetcher.d.ts +0 -47
  503. package/lib/commands/gen2-migration/generate/codegen-head/data_definition_fetcher.d.ts.map +0 -1
  504. package/lib/commands/gen2-migration/generate/codegen-head/data_definition_fetcher.js +0 -222
  505. package/lib/commands/gen2-migration/generate/codegen-head/data_definition_fetcher.js.map +0 -1
  506. package/lib/commands/gen2-migration/generate/codegen-head/data_model_access_parser.d.ts +0 -10
  507. package/lib/commands/gen2-migration/generate/codegen-head/data_model_access_parser.d.ts.map +0 -1
  508. package/lib/commands/gen2-migration/generate/codegen-head/data_model_access_parser.js +0 -59
  509. package/lib/commands/gen2-migration/generate/codegen-head/data_model_access_parser.js.map +0 -1
  510. package/lib/commands/gen2-migration/generate/codegen-head/data_model_access_parser.test.d.ts +0 -2
  511. package/lib/commands/gen2-migration/generate/codegen-head/data_model_access_parser.test.d.ts.map +0 -1
  512. package/lib/commands/gen2-migration/generate/codegen-head/data_model_access_parser.test.js +0 -90
  513. package/lib/commands/gen2-migration/generate/codegen-head/data_model_access_parser.test.js.map +0 -1
  514. package/lib/commands/gen2-migration/generate/codegen-head/directory_exists.d.ts +0 -2
  515. package/lib/commands/gen2-migration/generate/codegen-head/directory_exists.d.ts.map +0 -1
  516. package/lib/commands/gen2-migration/generate/codegen-head/directory_exists.js.map +0 -1
  517. package/lib/commands/gen2-migration/generate/codegen-head/dynamodb_cfn_access_parser.d.ts +0 -14
  518. package/lib/commands/gen2-migration/generate/codegen-head/dynamodb_cfn_access_parser.d.ts.map +0 -1
  519. package/lib/commands/gen2-migration/generate/codegen-head/dynamodb_cfn_access_parser.js +0 -100
  520. package/lib/commands/gen2-migration/generate/codegen-head/dynamodb_cfn_access_parser.js.map +0 -1
  521. package/lib/commands/gen2-migration/generate/codegen-head/dynamodb_cfn_access_parser.test.d.ts +0 -2
  522. package/lib/commands/gen2-migration/generate/codegen-head/dynamodb_cfn_access_parser.test.d.ts.map +0 -1
  523. package/lib/commands/gen2-migration/generate/codegen-head/dynamodb_cfn_access_parser.test.js +0 -69
  524. package/lib/commands/gen2-migration/generate/codegen-head/dynamodb_cfn_access_parser.test.js.map +0 -1
  525. package/lib/commands/gen2-migration/generate/codegen-head/format.d.ts +0 -8
  526. package/lib/commands/gen2-migration/generate/codegen-head/format.d.ts.map +0 -1
  527. package/lib/commands/gen2-migration/generate/codegen-head/format.js +0 -66
  528. package/lib/commands/gen2-migration/generate/codegen-head/format.js.map +0 -1
  529. package/lib/commands/gen2-migration/generate/codegen-head/logger.d.ts +0 -15
  530. package/lib/commands/gen2-migration/generate/codegen-head/logger.d.ts.map +0 -1
  531. package/lib/commands/gen2-migration/generate/codegen-head/logger.js +0 -14
  532. package/lib/commands/gen2-migration/generate/codegen-head/logger.js.map +0 -1
  533. package/lib/commands/gen2-migration/generate/codegen-head/printer.d.ts +0 -26
  534. package/lib/commands/gen2-migration/generate/codegen-head/printer.d.ts.map +0 -1
  535. package/lib/commands/gen2-migration/generate/codegen-head/printer.js +0 -103
  536. package/lib/commands/gen2-migration/generate/codegen-head/printer.js.map +0 -1
  537. package/lib/commands/gen2-migration/generate/codegen-head/s3_cfn_access_parser.d.ts +0 -13
  538. package/lib/commands/gen2-migration/generate/codegen-head/s3_cfn_access_parser.d.ts.map +0 -1
  539. package/lib/commands/gen2-migration/generate/codegen-head/s3_cfn_access_parser.js +0 -66
  540. package/lib/commands/gen2-migration/generate/codegen-head/s3_cfn_access_parser.js.map +0 -1
  541. package/lib/commands/gen2-migration/generate/codegen-head/s3_cfn_access_parser.test.d.ts +0 -2
  542. package/lib/commands/gen2-migration/generate/codegen-head/s3_cfn_access_parser.test.d.ts.map +0 -1
  543. package/lib/commands/gen2-migration/generate/codegen-head/s3_cfn_access_parser.test.js +0 -97
  544. package/lib/commands/gen2-migration/generate/codegen-head/s3_cfn_access_parser.test.js.map +0 -1
  545. package/lib/commands/gen2-migration/generate/core/migration-pipeline.d.ts +0 -26
  546. package/lib/commands/gen2-migration/generate/core/migration-pipeline.d.ts.map +0 -1
  547. package/lib/commands/gen2-migration/generate/core/migration-pipeline.js +0 -269
  548. package/lib/commands/gen2-migration/generate/core/migration-pipeline.js.map +0 -1
  549. package/lib/commands/gen2-migration/generate/custom-resources/generator/backend-updater.d.ts +0 -7
  550. package/lib/commands/gen2-migration/generate/custom-resources/generator/backend-updater.d.ts.map +0 -1
  551. package/lib/commands/gen2-migration/generate/custom-resources/generator/backend-updater.js +0 -84
  552. package/lib/commands/gen2-migration/generate/custom-resources/generator/backend-updater.js.map +0 -1
  553. package/lib/commands/gen2-migration/generate/custom-resources/generator/dependency-merger.d.ts +0 -8
  554. package/lib/commands/gen2-migration/generate/custom-resources/generator/dependency-merger.d.ts.map +0 -1
  555. package/lib/commands/gen2-migration/generate/custom-resources/generator/dependency-merger.js +0 -105
  556. package/lib/commands/gen2-migration/generate/custom-resources/generator/dependency-merger.js.map +0 -1
  557. package/lib/commands/gen2-migration/generate/custom-resources/generator/file-converter.d.ts +0 -5
  558. package/lib/commands/gen2-migration/generate/custom-resources/generator/file-converter.d.ts.map +0 -1
  559. package/lib/commands/gen2-migration/generate/custom-resources/generator/file-converter.js +0 -88
  560. package/lib/commands/gen2-migration/generate/custom-resources/generator/file-converter.js.map +0 -1
  561. package/lib/commands/gen2-migration/generate/custom-resources/generator/gen2-file-generator.d.ts +0 -8
  562. package/lib/commands/gen2-migration/generate/custom-resources/generator/gen2-file-generator.d.ts.map +0 -1
  563. package/lib/commands/gen2-migration/generate/custom-resources/generator/gen2-file-generator.js +0 -36
  564. package/lib/commands/gen2-migration/generate/custom-resources/generator/gen2-file-generator.js.map +0 -1
  565. package/lib/commands/gen2-migration/generate/custom-resources/parser/cdk-stack-parser.d.ts +0 -5
  566. package/lib/commands/gen2-migration/generate/custom-resources/parser/cdk-stack-parser.d.ts.map +0 -1
  567. package/lib/commands/gen2-migration/generate/custom-resources/parser/cdk-stack-parser.js +0 -81
  568. package/lib/commands/gen2-migration/generate/custom-resources/parser/cdk-stack-parser.js.map +0 -1
  569. package/lib/commands/gen2-migration/generate/custom-resources/parser/pattern-detector.d.ts +0 -15
  570. package/lib/commands/gen2-migration/generate/custom-resources/parser/pattern-detector.d.ts.map +0 -1
  571. package/lib/commands/gen2-migration/generate/custom-resources/parser/pattern-detector.js +0 -35
  572. package/lib/commands/gen2-migration/generate/custom-resources/parser/pattern-detector.js.map +0 -1
  573. package/lib/commands/gen2-migration/generate/custom-resources/scanner/custom-resource-scanner.d.ts +0 -5
  574. package/lib/commands/gen2-migration/generate/custom-resources/scanner/custom-resource-scanner.d.ts.map +0 -1
  575. package/lib/commands/gen2-migration/generate/custom-resources/scanner/custom-resource-scanner.js +0 -66
  576. package/lib/commands/gen2-migration/generate/custom-resources/scanner/custom-resource-scanner.js.map +0 -1
  577. package/lib/commands/gen2-migration/generate/custom-resources/transformer/amplify-helper-transformer.d.ts.map +0 -1
  578. package/lib/commands/gen2-migration/generate/custom-resources/transformer/amplify-helper-transformer.js +0 -178
  579. package/lib/commands/gen2-migration/generate/custom-resources/transformer/amplify-helper-transformer.js.map +0 -1
  580. package/lib/commands/gen2-migration/generate/custom-resources/types.d.ts +0 -38
  581. package/lib/commands/gen2-migration/generate/custom-resources/types.d.ts.map +0 -1
  582. package/lib/commands/gen2-migration/generate/custom-resources/types.js.map +0 -1
  583. package/lib/commands/gen2-migration/generate/generators/analytics/index.d.ts +0 -9
  584. package/lib/commands/gen2-migration/generate/generators/analytics/index.d.ts.map +0 -1
  585. package/lib/commands/gen2-migration/generate/generators/analytics/index.js +0 -40
  586. package/lib/commands/gen2-migration/generate/generators/analytics/index.js.map +0 -1
  587. package/lib/commands/gen2-migration/generate/generators/auth/index.d.ts +0 -107
  588. package/lib/commands/gen2-migration/generate/generators/auth/index.d.ts.map +0 -1
  589. package/lib/commands/gen2-migration/generate/generators/auth/index.js +0 -313
  590. package/lib/commands/gen2-migration/generate/generators/auth/index.js.map +0 -1
  591. package/lib/commands/gen2-migration/generate/generators/auth/index.test.d.ts +0 -2
  592. package/lib/commands/gen2-migration/generate/generators/auth/index.test.d.ts.map +0 -1
  593. package/lib/commands/gen2-migration/generate/generators/auth/index.test.js +0 -566
  594. package/lib/commands/gen2-migration/generate/generators/auth/index.test.js.map +0 -1
  595. package/lib/commands/gen2-migration/generate/generators/data/index.d.ts +0 -35
  596. package/lib/commands/gen2-migration/generate/generators/data/index.d.ts.map +0 -1
  597. package/lib/commands/gen2-migration/generate/generators/data/index.js +0 -185
  598. package/lib/commands/gen2-migration/generate/generators/data/index.js.map +0 -1
  599. package/lib/commands/gen2-migration/generate/generators/data/index.test.d.ts +0 -2
  600. package/lib/commands/gen2-migration/generate/generators/data/index.test.d.ts.map +0 -1
  601. package/lib/commands/gen2-migration/generate/generators/data/index.test.js +0 -47
  602. package/lib/commands/gen2-migration/generate/generators/data/index.test.js.map +0 -1
  603. package/lib/commands/gen2-migration/generate/generators/functions/index.d.ts +0 -53
  604. package/lib/commands/gen2-migration/generate/generators/functions/index.d.ts.map +0 -1
  605. package/lib/commands/gen2-migration/generate/generators/functions/index.js +0 -125
  606. package/lib/commands/gen2-migration/generate/generators/functions/index.js.map +0 -1
  607. package/lib/commands/gen2-migration/generate/generators/functions/lambda.d.ts +0 -6
  608. package/lib/commands/gen2-migration/generate/generators/functions/lambda.d.ts.map +0 -1
  609. package/lib/commands/gen2-migration/generate/generators/functions/lambda.js +0 -16
  610. package/lib/commands/gen2-migration/generate/generators/functions/lambda.js.map +0 -1
  611. package/lib/commands/gen2-migration/generate/generators/functions/lambda_env_generator.d.ts +0 -3
  612. package/lib/commands/gen2-migration/generate/generators/functions/lambda_env_generator.d.ts.map +0 -1
  613. package/lib/commands/gen2-migration/generate/generators/functions/lambda_env_generator.js +0 -106
  614. package/lib/commands/gen2-migration/generate/generators/functions/lambda_env_generator.js.map +0 -1
  615. package/lib/commands/gen2-migration/generate/generators/functions/lambda_env_generator.test.d.ts +0 -2
  616. package/lib/commands/gen2-migration/generate/generators/functions/lambda_env_generator.test.d.ts.map +0 -1
  617. package/lib/commands/gen2-migration/generate/generators/functions/lambda_env_generator.test.js +0 -120
  618. package/lib/commands/gen2-migration/generate/generators/functions/lambda_env_generator.test.js.map +0 -1
  619. package/lib/commands/gen2-migration/generate/generators/storage/access.d.ts +0 -4
  620. package/lib/commands/gen2-migration/generate/generators/storage/access.d.ts.map +0 -1
  621. package/lib/commands/gen2-migration/generate/generators/storage/access.js +0 -73
  622. package/lib/commands/gen2-migration/generate/generators/storage/access.js.map +0 -1
  623. package/lib/commands/gen2-migration/generate/generators/storage/index.d.ts +0 -37
  624. package/lib/commands/gen2-migration/generate/generators/storage/index.d.ts.map +0 -1
  625. package/lib/commands/gen2-migration/generate/generators/storage/index.js +0 -78
  626. package/lib/commands/gen2-migration/generate/generators/storage/index.js.map +0 -1
  627. package/lib/commands/gen2-migration/generate/npm_package/renderer.d.ts +0 -27
  628. package/lib/commands/gen2-migration/generate/npm_package/renderer.d.ts.map +0 -1
  629. package/lib/commands/gen2-migration/generate/npm_package/renderer.js +0 -28
  630. package/lib/commands/gen2-migration/generate/npm_package/renderer.js.map +0 -1
  631. package/lib/commands/gen2-migration/generate/render_pipeline.d.ts +0 -9
  632. package/lib/commands/gen2-migration/generate/render_pipeline.d.ts.map +0 -1
  633. package/lib/commands/gen2-migration/generate/render_pipeline.js +0 -15
  634. package/lib/commands/gen2-migration/generate/render_pipeline.js.map +0 -1
  635. package/lib/commands/gen2-migration/generate/renderers/ensure_directory.d.ts +0 -7
  636. package/lib/commands/gen2-migration/generate/renderers/ensure_directory.d.ts.map +0 -1
  637. package/lib/commands/gen2-migration/generate/renderers/ensure_directory.js +0 -17
  638. package/lib/commands/gen2-migration/generate/renderers/ensure_directory.js.map +0 -1
  639. package/lib/commands/gen2-migration/generate/renderers/package_json.d.ts +0 -8
  640. package/lib/commands/gen2-migration/generate/renderers/package_json.d.ts.map +0 -1
  641. package/lib/commands/gen2-migration/generate/renderers/package_json.js +0 -15
  642. package/lib/commands/gen2-migration/generate/renderers/package_json.js.map +0 -1
  643. package/lib/commands/gen2-migration/generate/renderers/typescript_block_node.d.ts +0 -11
  644. package/lib/commands/gen2-migration/generate/renderers/typescript_block_node.d.ts.map +0 -1
  645. package/lib/commands/gen2-migration/generate/renderers/typescript_block_node.js +0 -22
  646. package/lib/commands/gen2-migration/generate/renderers/typescript_block_node.js.map +0 -1
  647. package/lib/commands/gen2-migration/generate/resource/resource.d.ts +0 -20
  648. package/lib/commands/gen2-migration/generate/resource/resource.d.ts.map +0 -1
  649. package/lib/commands/gen2-migration/generate/resource/resource.js +0 -60
  650. package/lib/commands/gen2-migration/generate/resource/resource.js.map +0 -1
  651. package/lib/commands/gen2-migration/generate/test_utils/import_regex.d.ts +0 -2
  652. package/lib/commands/gen2-migration/generate/test_utils/import_regex.d.ts.map +0 -1
  653. package/lib/commands/gen2-migration/generate/test_utils/import_regex.js +0 -6
  654. package/lib/commands/gen2-migration/generate/test_utils/import_regex.js.map +0 -1
  655. package/lib/commands/gen2-migration/generate/test_utils/ts_node_printer.d.ts +0 -4
  656. package/lib/commands/gen2-migration/generate/test_utils/ts_node_printer.d.ts.map +0 -1
  657. package/lib/commands/gen2-migration/generate/test_utils/ts_node_printer.js +0 -22
  658. package/lib/commands/gen2-migration/generate/test_utils/ts_node_printer.js.map +0 -1
  659. package/lib/commands/gen2-migration/generate/todo_error.d.ts +0 -3
  660. package/lib/commands/gen2-migration/generate/todo_error.d.ts.map +0 -1
  661. package/lib/commands/gen2-migration/generate/todo_error.js +0 -11
  662. package/lib/commands/gen2-migration/generate/todo_error.js.map +0 -1
  663. package/lib/commands/gen2-migration/generate/ts_factory_utils.d.ts +0 -3
  664. package/lib/commands/gen2-migration/generate/ts_factory_utils.d.ts.map +0 -1
  665. package/lib/commands/gen2-migration/generate/ts_factory_utils.js +0 -10
  666. package/lib/commands/gen2-migration/generate/ts_factory_utils.js.map +0 -1
  667. package/lib/commands/gen2-migration/generate/types.d.ts +0 -4
  668. package/lib/commands/gen2-migration/generate/types.d.ts.map +0 -1
  669. package/lib/commands/gen2-migration/generate/types.js.map +0 -1
  670. package/lib/commands/gen2-migration/generate/unsupported/cdk-from-cfn.d.ts +0 -26
  671. package/lib/commands/gen2-migration/generate/unsupported/cdk-from-cfn.d.ts.map +0 -1
  672. package/lib/commands/gen2-migration/generate/unsupported/cdk-from-cfn.js.map +0 -1
  673. package/lib/commands/gen2-migration/refactor/cfn-stack-refactor-updater.d.ts +0 -5
  674. package/lib/commands/gen2-migration/refactor/cfn-stack-refactor-updater.d.ts.map +0 -1
  675. package/lib/commands/gen2-migration/refactor/cfn-stack-refactor-updater.js +0 -76
  676. package/lib/commands/gen2-migration/refactor/cfn-stack-refactor-updater.js.map +0 -1
  677. package/lib/commands/gen2-migration/refactor/cfn-stack-updater.d.ts +0 -6
  678. package/lib/commands/gen2-migration/refactor/cfn-stack-updater.d.ts.map +0 -1
  679. package/lib/commands/gen2-migration/refactor/cfn-stack-updater.js +0 -52
  680. package/lib/commands/gen2-migration/refactor/cfn-stack-updater.js.map +0 -1
  681. package/lib/commands/gen2-migration/refactor/generators/category-template-generator.d.ts +0 -40
  682. package/lib/commands/gen2-migration/refactor/generators/category-template-generator.d.ts.map +0 -1
  683. package/lib/commands/gen2-migration/refactor/generators/category-template-generator.js +0 -321
  684. package/lib/commands/gen2-migration/refactor/generators/category-template-generator.js.map +0 -1
  685. package/lib/commands/gen2-migration/refactor/generators/template-generator.d.ts +0 -48
  686. package/lib/commands/gen2-migration/refactor/generators/template-generator.d.ts.map +0 -1
  687. package/lib/commands/gen2-migration/refactor/generators/template-generator.js +0 -513
  688. package/lib/commands/gen2-migration/refactor/generators/template-generator.js.map +0 -1
  689. package/lib/commands/gen2-migration/refactor/refactor.d.ts +0 -19
  690. package/lib/commands/gen2-migration/refactor/refactor.d.ts.map +0 -1
  691. package/lib/commands/gen2-migration/refactor/refactor.js +0 -241
  692. package/lib/commands/gen2-migration/refactor/refactor.js.map +0 -1
  693. package/lib/commands/gen2-migration/refactor/types.d.ts +0 -128
  694. package/lib/commands/gen2-migration/refactor/types.d.ts.map +0 -1
  695. package/lib/commands/gen2-migration/refactor/types.js +0 -59
  696. package/lib/commands/gen2-migration/refactor/types.js.map +0 -1
  697. package/lib/commands/gen2-migration/shift.d.ts +0 -8
  698. package/lib/commands/gen2-migration/shift.d.ts.map +0 -1
  699. package/lib/commands/gen2-migration/shift.js +0 -21
  700. package/lib/commands/gen2-migration/shift.js.map +0 -1
  701. package/lib/commands/gen2-migration/stateful-resources.d.ts.map +0 -1
  702. package/lib/commands/gen2-migration/stateful-resources.js.map +0 -1
  703. /package/lib/commands/gen2-migration/{stateful-resources.d.ts → _infra/stateful-resources.d.ts} +0 -0
  704. /package/lib/commands/gen2-migration/{stateful-resources.js → _infra/stateful-resources.js} +0 -0
@@ -0,0 +1,136 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.AwsFetcher = void 0;
4
+ const client_cognito_identity_provider_1 = require("@aws-sdk/client-cognito-identity-provider");
5
+ const client_cognito_identity_1 = require("@aws-sdk/client-cognito-identity");
6
+ const client_lambda_1 = require("@aws-sdk/client-lambda");
7
+ const client_cloudwatch_events_1 = require("@aws-sdk/client-cloudwatch-events");
8
+ const client_s3_1 = require("@aws-sdk/client-s3");
9
+ const client_appsync_1 = require("@aws-sdk/client-appsync");
10
+ const client_dynamodb_1 = require("@aws-sdk/client-dynamodb");
11
+ const client_amplify_1 = require("@aws-sdk/client-amplify");
12
+ const client_api_gateway_1 = require("@aws-sdk/client-api-gateway");
13
+ class AwsFetcher {
14
+ constructor(clients) {
15
+ this.clients = clients;
16
+ }
17
+ async fetchUserPool(userPoolId) {
18
+ const { UserPool } = await this.clients.cognitoIdentityProvider.send(new client_cognito_identity_provider_1.DescribeUserPoolCommand({ UserPoolId: userPoolId }));
19
+ if (!UserPool) {
20
+ throw new Error(`User pool '${userPoolId}' not found`);
21
+ }
22
+ return UserPool;
23
+ }
24
+ async fetchMfaConfig(userPoolId) {
25
+ return this.clients.cognitoIdentityProvider.send(new client_cognito_identity_provider_1.GetUserPoolMfaConfigCommand({ UserPoolId: userPoolId }));
26
+ }
27
+ async fetchUserPoolClient(userPoolId, clientId) {
28
+ const { UserPoolClient } = await this.clients.cognitoIdentityProvider.send(new client_cognito_identity_provider_1.DescribeUserPoolClientCommand({ UserPoolId: userPoolId, ClientId: clientId }));
29
+ return UserPoolClient;
30
+ }
31
+ async fetchIdentityProviders(userPoolId) {
32
+ var _a;
33
+ const paginator = (0, client_cognito_identity_provider_1.paginateListIdentityProviders)({ client: this.clients.cognitoIdentityProvider }, { UserPoolId: userPoolId });
34
+ const details = [];
35
+ for await (const page of paginator) {
36
+ for (const provider of (_a = page.Providers) !== null && _a !== void 0 ? _a : []) {
37
+ const { IdentityProvider } = await this.clients.cognitoIdentityProvider.send(new client_cognito_identity_provider_1.DescribeIdentityProviderCommand({ UserPoolId: userPoolId, ProviderName: provider.ProviderName }));
38
+ if (IdentityProvider)
39
+ details.push(IdentityProvider);
40
+ }
41
+ }
42
+ return details;
43
+ }
44
+ async fetchIdentityGroups(userPoolId) {
45
+ var _a;
46
+ const paginator = (0, client_cognito_identity_provider_1.paginateListGroups)({ client: this.clients.cognitoIdentityProvider }, { UserPoolId: userPoolId });
47
+ const groups = [];
48
+ for await (const page of paginator) {
49
+ groups.push(...((_a = page.Groups) !== null && _a !== void 0 ? _a : []));
50
+ }
51
+ return groups;
52
+ }
53
+ async fetchIdentityPool(identityPoolId) {
54
+ return this.clients.cognitoIdentity.send(new client_cognito_identity_1.DescribeIdentityPoolCommand({ IdentityPoolId: identityPoolId }));
55
+ }
56
+ async fetchIdentityPoolRoles(identityPoolId) {
57
+ const { Roles } = await this.clients.cognitoIdentity.send(new client_cognito_identity_1.GetIdentityPoolRolesCommand({ IdentityPoolId: identityPoolId }));
58
+ if (!Roles)
59
+ return undefined;
60
+ return { authenticated: Roles.authenticated, unauthenticated: Roles.unauthenticated };
61
+ }
62
+ async fetchGroupsByUserPoolId(userPoolId) {
63
+ var _a;
64
+ const paginator = (0, client_cognito_identity_provider_1.paginateListGroups)({ client: this.clients.cognitoIdentityProvider }, { UserPoolId: userPoolId });
65
+ const result = {};
66
+ for await (const page of paginator) {
67
+ for (const { GroupName, RoleArn } of (_a = page.Groups) !== null && _a !== void 0 ? _a : []) {
68
+ if (GroupName && RoleArn)
69
+ result[GroupName] = RoleArn;
70
+ }
71
+ }
72
+ return Object.keys(result).length > 0 ? result : undefined;
73
+ }
74
+ async fetchFunctionConfig(deployedName) {
75
+ const result = await this.clients.lambda.send(new client_lambda_1.GetFunctionCommand({ FunctionName: deployedName }));
76
+ return result.Configuration;
77
+ }
78
+ async fetchFunctionSchedule(deployedName) {
79
+ var _a, _b;
80
+ let ruleName;
81
+ try {
82
+ const policyResponse = await this.clients.lambda.send(new client_lambda_1.GetPolicyCommand({ FunctionName: deployedName }));
83
+ if (!(policyResponse === null || policyResponse === void 0 ? void 0 : policyResponse.Policy))
84
+ return undefined;
85
+ const policy = JSON.parse(policyResponse.Policy);
86
+ ruleName = (_b = (_a = policy.Statement) === null || _a === void 0 ? void 0 : _a.find((s) => { var _a, _b, _c; return (_c = (_b = (_a = s.Condition) === null || _a === void 0 ? void 0 : _a.ArnLike) === null || _b === void 0 ? void 0 : _b['AWS:SourceArn']) === null || _c === void 0 ? void 0 : _c.includes('rule/'); })) === null || _b === void 0 ? void 0 : _b.Condition.ArnLike['AWS:SourceArn'].split('/').pop();
87
+ }
88
+ catch (e) {
89
+ if (e instanceof Error && e.name === 'ResourceNotFoundException') {
90
+ return undefined;
91
+ }
92
+ throw e;
93
+ }
94
+ if (!ruleName)
95
+ return undefined;
96
+ const ruleResponse = await this.clients.cloudWatchEvents.send(new client_cloudwatch_events_1.DescribeRuleCommand({ Name: ruleName }));
97
+ return ruleResponse.ScheduleExpression;
98
+ }
99
+ async fetchBucketNotifications(bucketName) {
100
+ return this.clients.s3.send(new client_s3_1.GetBucketNotificationConfigurationCommand({ Bucket: bucketName }));
101
+ }
102
+ async fetchBucketAccelerate(bucketName) {
103
+ const { Status } = await this.clients.s3.send(new client_s3_1.GetBucketAccelerateConfigurationCommand({ Bucket: bucketName }));
104
+ return Status;
105
+ }
106
+ async fetchBucketVersioning(bucketName) {
107
+ const { Status } = await this.clients.s3.send(new client_s3_1.GetBucketVersioningCommand({ Bucket: bucketName }));
108
+ return Status;
109
+ }
110
+ async fetchBucketEncryption(bucketName) {
111
+ const { ServerSideEncryptionConfiguration } = await this.clients.s3.send(new client_s3_1.GetBucketEncryptionCommand({ Bucket: bucketName }));
112
+ return ServerSideEncryptionConfiguration;
113
+ }
114
+ async fetchGraphqlApi(apiId) {
115
+ const { graphqlApi } = await this.clients.appSync.send(new client_appsync_1.GetGraphqlApiCommand({ apiId }));
116
+ return graphqlApi;
117
+ }
118
+ async fetchTableDescription(tableName) {
119
+ const { Table } = await this.clients.dynamoDB.send(new client_dynamodb_1.DescribeTableCommand({ TableName: tableName }));
120
+ return Table;
121
+ }
122
+ async fetchAppBuildSpec(appId) {
123
+ const { app } = await this.clients.amplify.send(new client_amplify_1.GetAppCommand({ appId }));
124
+ return app === null || app === void 0 ? void 0 : app.buildSpec;
125
+ }
126
+ async fetchRestApiRootResourceId(restApiId) {
127
+ const { items } = await this.clients.apiGateway.send(new client_api_gateway_1.GetResourcesCommand({ restApiId }));
128
+ const root = items === null || items === void 0 ? void 0 : items.find((r) => r.path === '/');
129
+ if (!(root === null || root === void 0 ? void 0 : root.id)) {
130
+ throw new Error(`Root resource not found for REST API '${restApiId}'`);
131
+ }
132
+ return root.id;
133
+ }
134
+ }
135
+ exports.AwsFetcher = AwsFetcher;
136
+ //# sourceMappingURL=aws-fetcher.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"aws-fetcher.js","sourceRoot":"","sources":["../../../../../src/commands/gen2-migration/generate/_infra/aws-fetcher.ts"],"names":[],"mappings":";;;AAAA,gGAYmD;AACnD,8EAA0H;AAC1H,0DAAqG;AACrG,gFAAwE;AACxE,kDAK4B;AAC5B,4DAA2E;AAC3E,8DAAkF;AAClF,4DAAwD;AACxD,oEAAkE;AAUlE,MAAa,UAAU;IAGrB,YAAmB,OAAmB;QACpC,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;IACzB,CAAC;IAIM,KAAK,CAAC,aAAa,CAAC,UAAkB;QAC3C,MAAM,EAAE,QAAQ,EAAE,GAAG,MAAM,IAAI,CAAC,OAAO,CAAC,uBAAuB,CAAC,IAAI,CAAC,IAAI,0DAAuB,CAAC,EAAE,UAAU,EAAE,UAAU,EAAE,CAAC,CAAC,CAAC;QAC9H,IAAI,CAAC,QAAQ,EAAE,CAAC;YACd,MAAM,IAAI,KAAK,CAAC,cAAc,UAAU,aAAa,CAAC,CAAC;QACzD,CAAC;QACD,OAAO,QAAQ,CAAC;IAClB,CAAC;IAEM,KAAK,CAAC,cAAc,CAAC,UAAkB;QAC5C,OAAO,IAAI,CAAC,OAAO,CAAC,uBAAuB,CAAC,IAAI,CAAC,IAAI,8DAA2B,CAAC,EAAE,UAAU,EAAE,UAAU,EAAE,CAAC,CAAC,CAAC;IAChH,CAAC;IAEM,KAAK,CAAC,mBAAmB,CAAC,UAAkB,EAAE,QAAgB;QACnE,MAAM,EAAE,cAAc,EAAE,GAAG,MAAM,IAAI,CAAC,OAAO,CAAC,uBAAuB,CAAC,IAAI,CACxE,IAAI,gEAA6B,CAAC,EAAE,UAAU,EAAE,UAAU,EAAE,QAAQ,EAAE,QAAQ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,MAAM,EAAE,KAAK,EAAE,GAAG,MAAM,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,sCAAoB,CAAC,EAAE,SAAS,EAAE,SAAS,EAAE,CAAC,CAAC,CAAC;QACvG,OAAO,KAAK,CAAC;IACf,CAAC;IAIM,KAAK,CAAC,iBAAiB,CAAC,KAAa;QAC1C,MAAM,EAAE,GAAG,EAAE,GAAG,MAAM,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,8BAAa,CAAC,EAAE,KAAK,EAAE,CAAC,CAAC,CAAC;QAC9E,OAAO,GAAG,aAAH,GAAG,uBAAH,GAAG,CAAE,SAAS,CAAC;IACxB,CAAC;IAIM,KAAK,CAAC,0BAA0B,CAAC,SAAiB;QACvD,MAAM,EAAE,KAAK,EAAE,GAAG,MAAM,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,IAAI,CAAC,IAAI,wCAAmB,CAAC,EAAE,SAAS,EAAE,CAAC,CAAC,CAAC;QAC7F,MAAM,IAAI,GAAG,KAAK,aAAL,KAAK,uBAAL,KAAK,CAAE,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,KAAK,GAAG,CAAC,CAAC;QAChD,IAAI,CAAC,CAAA,IAAI,aAAJ,IAAI,uBAAJ,IAAI,CAAE,EAAE,CAAA,EAAE,CAAC;YACd,MAAM,IAAI,KAAK,CAAC,yCAAyC,SAAS,GAAG,CAAC,CAAC;QACzE,CAAC;QACD,OAAO,IAAI,CAAC,EAAE,CAAC;IACjB,CAAC;CACF;AA1JD,gCA0JC"}
@@ -0,0 +1,2 @@
1
+ export declare function fileOrDirectoryExists(targetPath: string): Promise<boolean>;
2
+ //# sourceMappingURL=files.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"files.d.ts","sourceRoot":"","sources":["../../../../../src/commands/gen2-migration/generate/_infra/files.ts"],"names":[],"mappings":"AAKA,wBAAsB,qBAAqB,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAKhF"}
@@ -3,13 +3,12 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
3
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.fileOrDirectoryExists = void 0;
6
+ exports.fileOrDirectoryExists = fileOrDirectoryExists;
7
7
  const promises_1 = __importDefault(require("node:fs/promises"));
8
- const fileOrDirectoryExists = async (targetPath) => {
8
+ async function fileOrDirectoryExists(targetPath) {
9
9
  return promises_1.default
10
10
  .access(targetPath)
11
11
  .then(() => true)
12
12
  .catch(() => false);
13
- };
14
- exports.fileOrDirectoryExists = fileOrDirectoryExists;
15
- //# sourceMappingURL=directory_exists.js.map
13
+ }
14
+ //# sourceMappingURL=files.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"files.js","sourceRoot":"","sources":["../../../../../src/commands/gen2-migration/generate/_infra/files.ts"],"names":[],"mappings":";;;;;AAKA,sDAKC;AAVD,gEAAkC;AAK3B,KAAK,UAAU,qBAAqB,CAAC,UAAkB;IAC5D,OAAO,kBAAE;SACN,MAAM,CAAC,UAAU,CAAC;SAClB,IAAI,CAAC,GAAG,EAAE,CAAC,IAAI,CAAC;SAChB,KAAK,CAAC,GAAG,EAAE,CAAC,KAAK,CAAC,CAAC;AACxB,CAAC"}
@@ -0,0 +1,40 @@
1
+ import { $TSContext } from '@aws-amplify/amplify-cli-core';
2
+ import { AwsClients } from '../../_infra/aws-clients';
3
+ import { AwsFetcher } from './aws-fetcher';
4
+ export declare const KNOWN_RESOURCE_KEYS: readonly ["auth:Cognito", "auth:Cognito-UserPool-Groups", "storage:S3", "storage:DynamoDB", "api:AppSync", "api:API Gateway", "analytics:Kinesis", "function:Lambda", "geo:Map", "geo:PlaceIndex", "geo:GeofenceCollection"];
5
+ export declare enum KNOWN_FEATURES {
6
+ OVERRIDES = "overrides",
7
+ CUSTOM_FUNCTION_POLICIES = "custom-policies"
8
+ }
9
+ export type ResourceKey = (typeof KNOWN_RESOURCE_KEYS)[number] | 'UNKNOWN';
10
+ export interface DiscoveredResource {
11
+ readonly category: string;
12
+ readonly resourceName: string;
13
+ readonly service: string;
14
+ readonly key: ResourceKey;
15
+ }
16
+ export declare class Gen1App {
17
+ readonly appId: string;
18
+ readonly appName: string;
19
+ readonly region: string;
20
+ readonly envName: string;
21
+ readonly clients: AwsClients;
22
+ readonly aws: AwsFetcher;
23
+ readonly ccbDir: string;
24
+ readonly rootStackName: string;
25
+ private readonly _meta;
26
+ private constructor();
27
+ static create(context: $TSContext): Promise<Gen1App>;
28
+ meta(category: string): Record<string, unknown> | undefined;
29
+ discover(): DiscoveredResource[];
30
+ metaOutput(category: string, resourceName: string, outputKey: string): string;
31
+ singleResourceName(category: string, service: string): string;
32
+ json(relativePath: string): any;
33
+ file(relativePath: string): string;
34
+ fileExists(relativePath: string): boolean;
35
+ ensureCliInputs(category: string, resourceName: string): void;
36
+ cliInputs(category: string, resourceName: string): any;
37
+ private static currentEnvName;
38
+ private static downloadCloudBackend;
39
+ }
40
+ //# sourceMappingURL=gen1-app.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"gen1-app.d.ts","sourceRoot":"","sources":["../../../../../src/commands/gen2-migration/generate/_infra/gen1-app.ts"],"names":[],"mappings":"AAOA,OAAO,EAAU,UAAU,EAAwC,MAAM,+BAA+B,CAAC;AACzG,OAAO,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC;AACtD,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAgB3C,eAAO,MAAM,mBAAmB,8NAYtB,CAAC;AAEX,oBAAY,cAAc;IACxB,SAAS,cAAc;IACvB,wBAAwB,oBAAoB;CAC7C;AAMD,MAAM,MAAM,WAAW,GAAG,CAAC,OAAO,mBAAmB,CAAC,CAAC,MAAM,CAAC,GAAG,SAAS,CAAC;AAK3E,MAAM,WAAW,kBAAkB;IACj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AqBd,oBAAoB;CAgB1C"}
@@ -0,0 +1,198 @@
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.Gen1App = exports.KNOWN_FEATURES = exports.KNOWN_RESOURCE_KEYS = void 0;
7
+ const node_path_1 = __importDefault(require("node:path"));
8
+ const node_os_1 = __importDefault(require("node:os"));
9
+ const promises_1 = __importDefault(require("node:fs/promises"));
10
+ const node_fs_1 = require("node:fs");
11
+ const unzipper_1 = __importDefault(require("unzipper"));
12
+ const client_s3_1 = require("@aws-sdk/client-s3");
13
+ const amplify_cli_core_1 = require("@aws-amplify/amplify-cli-core");
14
+ const aws_clients_1 = require("../../_infra/aws-clients");
15
+ const aws_fetcher_1 = require("./aws-fetcher");
16
+ const amplify_cli_core_2 = require("@aws-amplify/amplify-cli-core");
17
+ const client_amplify_1 = require("@aws-sdk/client-amplify");
18
+ exports.KNOWN_RESOURCE_KEYS = [
19
+ 'auth:Cognito',
20
+ 'auth:Cognito-UserPool-Groups',
21
+ 'storage:S3',
22
+ 'storage:DynamoDB',
23
+ 'api:AppSync',
24
+ 'api:API Gateway',
25
+ 'analytics:Kinesis',
26
+ 'function:Lambda',
27
+ 'geo:Map',
28
+ 'geo:PlaceIndex',
29
+ 'geo:GeofenceCollection',
30
+ ];
31
+ var KNOWN_FEATURES;
32
+ (function (KNOWN_FEATURES) {
33
+ KNOWN_FEATURES["OVERRIDES"] = "overrides";
34
+ KNOWN_FEATURES["CUSTOM_FUNCTION_POLICIES"] = "custom-policies";
35
+ })(KNOWN_FEATURES || (exports.KNOWN_FEATURES = KNOWN_FEATURES = {}));
36
+ class Gen1App {
37
+ constructor(props) {
38
+ this.appId = props.app.appId;
39
+ this.appName = props.app.name;
40
+ this.envName = props.envName;
41
+ this.clients = props.clients;
42
+ this.ccbDir = props.ccbDir;
43
+ this.aws = new aws_fetcher_1.AwsFetcher(this.clients);
44
+ this._meta = amplify_cli_core_1.JSONUtilities.readJson(node_path_1.default.join(this.ccbDir, 'amplify-meta.json'), { throwIfNotExist: true });
45
+ this.rootStackName = this._meta.providers.awscloudformation.StackName;
46
+ this.region = this._meta.providers.awscloudformation.Region;
47
+ }
48
+ static async create(context) {
49
+ const clients = await aws_clients_1.AwsClients.create(context);
50
+ const tpiRelPath = `./${node_path_1.default.relative(process.cwd(), amplify_cli_core_2.pathManager.getTeamProviderInfoFilePath())}`;
51
+ if (!amplify_cli_core_2.stateManager.teamProviderInfoExists()) {
52
+ throw new amplify_cli_core_1.AmplifyError('MigrationError', {
53
+ message: `Unable to find '${tpiRelPath}' - Are you sure you're on the right branch?`,
54
+ resolution: 'Checkout to the Gen1 branch and rerun the command',
55
+ });
56
+ }
57
+ const tpi = amplify_cli_core_2.stateManager.getTeamProviderInfo();
58
+ const appId = Object.values(tpi)[0].awscloudformation.AmplifyAppId;
59
+ const app = await clients.amplify.send(new client_amplify_1.GetAppCommand({ appId }));
60
+ const envName = await Gen1App.currentEnvName(app.app);
61
+ const envInfo = tpi[envName];
62
+ if (!envInfo) {
63
+ throw new amplify_cli_core_1.AmplifyError('MigrationError', {
64
+ message: `Environment ${envName} does not exist in ${tpiRelPath}`,
65
+ resolution: `Checkout to the branch corresponding to environment ${envName} and rerun the command`,
66
+ });
67
+ }
68
+ const cfnProvider = envInfo.awscloudformation;
69
+ if (!(cfnProvider === null || cfnProvider === void 0 ? void 0 : cfnProvider.StackName) || !(cfnProvider === null || cfnProvider === void 0 ? void 0 : cfnProvider.DeploymentBucketName)) {
70
+ throw new amplify_cli_core_1.AmplifyError('MigrationError', {
71
+ message: `Missing StackName or DeploymentBucketName for environment '${envName}' in '${tpiRelPath}'`,
72
+ });
73
+ }
74
+ const ccbDir = await Gen1App.downloadCloudBackend(clients.s3, cfnProvider.DeploymentBucketName);
75
+ return new Gen1App({ ccbDir, clients, envName, app: app.app });
76
+ }
77
+ meta(category) {
78
+ const block = this._meta[category];
79
+ if (block && typeof block === 'object' && Object.keys(block).length > 0) {
80
+ return block;
81
+ }
82
+ return undefined;
83
+ }
84
+ discover() {
85
+ const meta = this._meta;
86
+ const skip = new Set(['providers', 'hosting']);
87
+ const resources = [];
88
+ for (const [category, block] of Object.entries(meta)) {
89
+ if (skip.has(category) || !block || typeof block !== 'object')
90
+ continue;
91
+ for (const [resourceName, resourceMeta] of Object.entries(block)) {
92
+ if (!resourceMeta || typeof resourceMeta !== 'object') {
93
+ throw new amplify_cli_core_1.AmplifyError('MigrationError', { message: `Unable to find meta entry for resource ${resourceName}` });
94
+ }
95
+ const service = resourceMeta.service;
96
+ if (!service) {
97
+ throw new amplify_cli_core_1.AmplifyError('MigrationError', {
98
+ message: `Resource '${resourceName}' in category '${category}' is missing the 'service' field in amplify-meta.json`,
99
+ });
100
+ }
101
+ const rawKey = `${category}:${service}`;
102
+ const key = exports.KNOWN_RESOURCE_KEYS.includes(rawKey) ? rawKey : 'UNKNOWN';
103
+ resources.push({ category, resourceName, service, key });
104
+ }
105
+ }
106
+ return resources;
107
+ }
108
+ metaOutput(category, resourceName, outputKey) {
109
+ var _a, _b, _c;
110
+ const value = (_c = (_b = (_a = this._meta[category]) === null || _a === void 0 ? void 0 : _a[resourceName]) === null || _b === void 0 ? void 0 : _b.output) === null || _c === void 0 ? void 0 : _c[outputKey];
111
+ if (value === undefined) {
112
+ throw new amplify_cli_core_1.AmplifyError('MigrationError', {
113
+ message: `Missing output '${outputKey}' for resource '${resourceName}' in category '${category}'`,
114
+ });
115
+ }
116
+ return value;
117
+ }
118
+ singleResourceName(category, service) {
119
+ const categoryBlock = this.meta(category);
120
+ if (!categoryBlock) {
121
+ throw new amplify_cli_core_1.AmplifyError('MigrationError', { message: `Category '${category}' not found in amplify-meta.json` });
122
+ }
123
+ const names = Object.keys(categoryBlock).filter((name) => categoryBlock[name].service === service);
124
+ if (names.length !== 1) {
125
+ throw new amplify_cli_core_1.AmplifyError('MigrationError', {
126
+ message: `Expected exactly one '${service}' resource in '${category}', found ${names.length}: ${names.join(', ')}`,
127
+ });
128
+ }
129
+ return names[0];
130
+ }
131
+ json(relativePath) {
132
+ return amplify_cli_core_1.JSONUtilities.readJson(node_path_1.default.join(this.ccbDir, relativePath), { throwIfNotExist: true });
133
+ }
134
+ file(relativePath) {
135
+ return (0, node_fs_1.readFileSync)(node_path_1.default.join(this.ccbDir, relativePath), 'utf8');
136
+ }
137
+ fileExists(relativePath) {
138
+ try {
139
+ (0, node_fs_1.readFileSync)(node_path_1.default.join(this.ccbDir, relativePath));
140
+ return true;
141
+ }
142
+ catch (_a) {
143
+ return false;
144
+ }
145
+ }
146
+ ensureCliInputs(category, resourceName) {
147
+ const relativePath = node_path_1.default.join(category, resourceName, 'cli-inputs.json');
148
+ const fullPath = node_path_1.default.join(this.ccbDir, relativePath);
149
+ try {
150
+ amplify_cli_core_1.JSONUtilities.readJson(fullPath, { throwIfNotExist: true });
151
+ }
152
+ catch (_a) {
153
+ throw new amplify_cli_core_1.AmplifyError('MigrationError', {
154
+ message: `Unable to find ${relativePath}. Your app was created with an old Gen1 CLI version (<=v6) that did not produce this file.`,
155
+ resolution: 'You must first migrate to the latest Gen1 CLI version by following https://docs.amplify.aws/gen1/javascript/tools/cli/migration/override/',
156
+ });
157
+ }
158
+ }
159
+ cliInputs(category, resourceName) {
160
+ const relativePath = node_path_1.default.join(category, resourceName, 'cli-inputs.json');
161
+ const fullPath = node_path_1.default.join(this.ccbDir, relativePath);
162
+ return amplify_cli_core_1.JSONUtilities.readJson(fullPath, { throwIfNotExist: true });
163
+ }
164
+ static async currentEnvName(app) {
165
+ var _a;
166
+ const migratingEnvName = ((_a = app.environmentVariables) !== null && _a !== void 0 ? _a : {})['GEN2_MIGRATION_ENVIRONMENT_NAME'];
167
+ const localEnvName = amplify_cli_core_2.stateManager.getCurrentEnvName();
168
+ if (!localEnvName && !migratingEnvName) {
169
+ throw new amplify_cli_core_1.AmplifyError('EnvironmentNotInitializedError', {
170
+ message: `No environment configured for app '${app.name}'`,
171
+ resolution: 'Run "amplify pull" to configure an environment.',
172
+ });
173
+ }
174
+ if (migratingEnvName && localEnvName && migratingEnvName !== localEnvName) {
175
+ throw new amplify_cli_core_1.AmplifyError('MigrationError', {
176
+ message: `Environment mismatch: Your local env (${localEnvName}) does
177
+ not match the environment you marked for migration (${migratingEnvName})`,
178
+ });
179
+ }
180
+ return localEnvName !== null && localEnvName !== void 0 ? localEnvName : migratingEnvName;
181
+ }
182
+ static async downloadCloudBackend(s3Client, bucket) {
183
+ const tmpDir = await promises_1.default.mkdtemp(node_path_1.default.join(node_os_1.default.tmpdir(), 'amplify-ccb-'));
184
+ const zipKey = '#current-cloud-backend.zip';
185
+ const zipPath = node_path_1.default.join(tmpDir, zipKey);
186
+ const response = await s3Client.send(new client_s3_1.GetObjectCommand({ Key: zipKey, Bucket: bucket }));
187
+ if (!response.Body) {
188
+ throw new amplify_cli_core_1.AmplifyError('MigrationError', { message: 'S3 GetObject response body is empty' });
189
+ }
190
+ await promises_1.default.writeFile(zipPath, response.Body);
191
+ const directory = await unzipper_1.default.Open.file(zipPath);
192
+ const ccbDir = node_path_1.default.join(tmpDir, 'current-cloud-backend');
193
+ await directory.extract({ path: ccbDir });
194
+ return ccbDir;
195
+ }
196
+ }
197
+ exports.Gen1App = Gen1App;
198
+ //# sourceMappingURL=gen1-app.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"gen1-app.js","sourceRoot":"","sources":["../../../../../src/commands/gen2-migration/generate/_infra/gen1-app.ts"],"names":[],"mappings":";;;;;;AAAA,0DAA6B;AAC7B,sDAAyB;AACzB,gEAAkC;AAClC,qCAAuC;AAEvC,wDAAgC;AAChC,kDAAgE;AAChE,oEAAyG;AACzG,0DAAsD;AACtD,+CAA2C;AAC3C,oEAA0E;AAC1E,4DAA6D;AAchD,QAAA,mBAAmB,GAAG;IACjC,cAAc;IACd,8BAA8B;IAC9B,YAAY;IACZ,kBAAkB;IAClB,aAAa;IACb,iBAA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xE,CAAC,CAAC;QACL,CAAC;QAED,OAAO,YAAY,aAAZ,YAAY,cAAZ,YAAY,GAAI,gBAAgB,CAAC;IAC1C,CAAC;IAEO,MAAM,CAAC,KAAK,CAAC,oBAAoB,CAAC,QAAkB,EAAE,MAAc;QAC1E,MAAM,MAAM,GAAG,MAAM,kBAAE,CAAC,OAAO,CAAC,mBAAI,CAAC,IAAI,CAAC,iBAAE,CAAC,MAAM,EAAE,EAAE,cAAc,CAAC,CAAC,CAAC;QACxE,MAAM,MAAM,GAAG,4BAA4B,CAAC;QAC5C,MAAM,OAAO,GAAG,mBAAI,CAAC,IAAI,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;QAE1C,MAAM,QAAQ,GAAG,MAAM,QAAQ,CAAC,IAAI,CAAC,IAAI,4BAAgB,CAAC,EAAE,GAAG,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,CAAC,CAAC,CAAC;QAC5F,IAAI,CAAC,QAAQ,CAAC,IAAI,EAAE,CAAC;YACnB,MAAM,IAAI,+BAAY,CAAC,gBAAgB,EAAE,EAAE,OAAO,EAAE,qCAAqC,EAAE,CAAC,CAAC;QAC/F,CAAC;QACD,MAAM,kBAAE,CAAC,SAAS,CAAC,OAAO,EAAE,QAAQ,CAAC,IAAc,CAAC,CAAC;QAErD,MAAM,SAAS,GAAG,MAAM,kBAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QACpD,MAAM,MAAM,GAAG,mBAAI,CAAC,IAAI,CAAC,MAAM,EAAE,uBAAuB,CAAC,CAAC;QAC1D,MAAM,SAAS,CAAC,OAAO,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC,CAAC;QAC1C,OAAO,MAAM,CAAC;IAChB,CAAC;CACF;AArND,0BAqNC"}
@@ -0,0 +1,24 @@
1
+ import ts from 'typescript';
2
+ export declare const newLineIdentifier: ts.Identifier;
3
+ export type ResourceTsParameters = {
4
+ readonly additionalImportedBackendIdentifiers?: Readonly<Record<string, Set<string>>>;
5
+ readonly backendFunctionConstruct: string;
6
+ readonly functionCallParameter: ts.ObjectLiteralExpression;
7
+ readonly exportedVariableName: ts.Identifier;
8
+ readonly postImportStatements?: readonly ts.Node[];
9
+ readonly postExportStatements?: readonly ts.Node[];
10
+ };
11
+ export declare class TS {
12
+ static printNodes(nodes: ts.NodeArray<ts.Node>): string;
13
+ static printNode(node: ts.Node): string;
14
+ static constDecl(name: string, initializer: ts.Expression): ts.VariableStatement;
15
+ static propAccess(root: string | ts.Expression, ...segments: string[]): ts.Expression;
16
+ static constFromBackend(name: string, ...path: string[]): ts.VariableStatement;
17
+ static assignProp(target: string, property: string, value: number | string | boolean | string[] | object | undefined): ts.ExpressionStatement;
18
+ static jsValue(value: number | string | boolean | string[] | object | undefined): ts.Expression;
19
+ static createBranchNameDeclaration(): ts.VariableStatement;
20
+ static extractFilePathFromHandler(handler: string): string;
21
+ static renderResourceTsFile({ additionalImportedBackendIdentifiers, backendFunctionConstruct, functionCallParameter, exportedVariableName, postImportStatements, postExportStatements, }: ResourceTsParameters): ts.NodeArray<ts.Node>;
22
+ private static renderImportStatements;
23
+ }
24
+ //# sourceMappingURL=ts.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ts.d.ts","sourceRoot":"","sources":["../../../../../src/commands/gen2-migration/generate/_infra/ts.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,YAAY,CAAC;AAO5B,eAAO,MAAM,iBAAiB,eAAiC,CAAC;AAKhE,MAAM,MAAM,oBAAoB,GAAG;IACjC,QAAQ,CAAC,oCAAoC,CAAC,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC;IACtF,QAAQ,CAAC,wBAAwB,EAAE,MAAM,CAAC;IAC1C,QAAQ,CAAC,qBAAqB,EAAE,EAAE,CAAC,uBAAuB,CAAC;IAC3D,QAAQ,CAAC,oBAAoB,EAAE,EAAE,C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AC,EAAE,CAAC,IAAI,CAAC;IAmB/C,OAAO,CAAC,MAAM,CAAC,sBAAsB;CAiBtC"}
@@ -0,0 +1,128 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || (function () {
19
+ var ownKeys = function(o) {
20
+ ownKeys = Object.getOwnPropertyNames || function (o) {
21
+ var ar = [];
22
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
+ return ar;
24
+ };
25
+ return ownKeys(o);
26
+ };
27
+ return function (mod) {
28
+ if (mod && mod.__esModule) return mod;
29
+ var result = {};
30
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
+ __setModuleDefault(result, mod);
32
+ return result;
33
+ };
34
+ })();
35
+ var __importDefault = (this && this.__importDefault) || function (mod) {
36
+ return (mod && mod.__esModule) ? mod : { "default": mod };
37
+ };
38
+ Object.defineProperty(exports, "__esModule", { value: true });
39
+ exports.TS = exports.newLineIdentifier = void 0;
40
+ const typescript_1 = __importDefault(require("typescript"));
41
+ const prettier = __importStar(require("prettier"));
42
+ const factory = typescript_1.default.factory;
43
+ const printer = typescript_1.default.createPrinter({ newLine: typescript_1.default.NewLineKind.LineFeed });
44
+ const sourceFile = typescript_1.default.createSourceFile('output.ts', '', typescript_1.default.ScriptTarget.Latest, false, typescript_1.default.ScriptKind.TS);
45
+ exports.newLineIdentifier = factory.createIdentifier('\n');
46
+ class TS {
47
+ static printNodes(nodes) {
48
+ const raw = printer.printList(typescript_1.default.ListFormat.MultiLine, nodes, sourceFile);
49
+ return prettier.format(raw, {
50
+ parser: 'typescript',
51
+ singleQuote: true,
52
+ tabWidth: 2,
53
+ });
54
+ }
55
+ static printNode(node) {
56
+ return printer.printNode(typescript_1.default.EmitHint.Unspecified, node, sourceFile);
57
+ }
58
+ static constDecl(name, initializer) {
59
+ return factory.createVariableStatement([], factory.createVariableDeclarationList([factory.createVariableDeclaration(name, undefined, undefined, initializer)], typescript_1.default.NodeFlags.Const));
60
+ }
61
+ static propAccess(root, ...segments) {
62
+ let expr = typeof root === 'string' ? factory.createIdentifier(root) : root;
63
+ for (const segment of segments) {
64
+ expr = factory.createPropertyAccessExpression(expr, factory.createIdentifier(segment));
65
+ }
66
+ return expr;
67
+ }
68
+ static constFromBackend(name, ...path) {
69
+ return TS.constDecl(name, TS.propAccess('backend', ...path));
70
+ }
71
+ static assignProp(target, property, value) {
72
+ return factory.createExpressionStatement(factory.createAssignment(factory.createPropertyAccessExpression(factory.createIdentifier(target), factory.createIdentifier(property)), TS.jsValue(value)));
73
+ }
74
+ static jsValue(value) {
75
+ if (value === undefined)
76
+ return factory.createIdentifier('undefined');
77
+ if (typeof value === 'boolean')
78
+ return value ? factory.createTrue() : factory.createFalse();
79
+ if (typeof value === 'number')
80
+ return factory.createNumericLiteral(value);
81
+ if (typeof value === 'string')
82
+ return factory.createStringLiteral(value);
83
+ if (Array.isArray(value))
84
+ return factory.createArrayLiteralExpression(value.map((v) => factory.createStringLiteral(v)));
85
+ if (typeof value === 'object') {
86
+ const props = Object.entries(value).map(([key, val]) => factory.createPropertyAssignment(key, TS.jsValue(val)));
87
+ return factory.createObjectLiteralExpression(props, true);
88
+ }
89
+ return factory.createIdentifier('undefined');
90
+ }
91
+ static createBranchNameDeclaration() {
92
+ return TS.constDecl('branchName', factory.createIdentifier('process.env.AWS_BRANCH ?? "sandbox"'));
93
+ }
94
+ static extractFilePathFromHandler(handler) {
95
+ const lastDotIndex = handler.lastIndexOf('.');
96
+ if (lastDotIndex === -1) {
97
+ return `./${handler}.js`;
98
+ }
99
+ return `./${handler.substring(0, lastDotIndex)}.js`;
100
+ }
101
+ static renderResourceTsFile({ additionalImportedBackendIdentifiers = {}, backendFunctionConstruct, functionCallParameter, exportedVariableName, postImportStatements, postExportStatements, }) {
102
+ const backendFunctionIdentifier = factory.createIdentifier(backendFunctionConstruct);
103
+ const importStatements = TS.renderImportStatements(additionalImportedBackendIdentifiers);
104
+ const functionCall = factory.createCallExpression(backendFunctionIdentifier, undefined, [functionCallParameter]);
105
+ const exportedVariable = factory.createVariableDeclaration(exportedVariableName, undefined, undefined, functionCall);
106
+ const exportStatement = factory.createVariableStatement([factory.createModifier(typescript_1.default.SyntaxKind.ExportKeyword)], factory.createVariableDeclarationList([exportedVariable], typescript_1.default.NodeFlags.Const));
107
+ return factory.createNodeArray([
108
+ ...importStatements,
109
+ ...(postImportStatements !== undefined && postImportStatements.length > 0 ? [exports.newLineIdentifier, ...postImportStatements] : []),
110
+ exports.newLineIdentifier,
111
+ exportStatement,
112
+ ...(postExportStatements !== undefined && postExportStatements.length > 0 ? [exports.newLineIdentifier, ...postExportStatements] : []),
113
+ ]);
114
+ }
115
+ static renderImportStatements(additionalImportedBackendIdentifiers) {
116
+ const importStatements = [];
117
+ for (const [packageName, identifiers] of Object.entries(additionalImportedBackendIdentifiers)) {
118
+ const importSpecifiers = [];
119
+ identifiers.forEach((identifier) => {
120
+ importSpecifiers.push(factory.createImportSpecifier(false, undefined, factory.createIdentifier(identifier)));
121
+ });
122
+ importStatements.push(factory.createImportDeclaration(undefined, factory.createImportClause(false, undefined, factory.createNamedImports(importSpecifiers)), factory.createStringLiteral(packageName)));
123
+ }
124
+ return importStatements;
125
+ }
126
+ }
127
+ exports.TS = TS;
128
+ //# sourceMappingURL=ts.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ts.js","sourceRoot":"","sources":["../../../../../src/commands/gen2-migration/generate/_infra/ts.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,4DAA4B;AAC5B,mDAAqC;AAErC,MAAM,OAAO,GAAG,oBAAE,CAAC,OAAO,CAAC;AAC3B,MAAM,OAAO,GAAG,oBAAE,CAAC,aAAa,CAAC,EAAE,OAAO,EAAE,oBAAE,CAAC,WAAW,CAAC,QAAQ,EAAE,CAAC,CAAC;AACvE,MAAM,UAAU,GAAG,oBAAE,CAAC,gBAAgB,CAAC,WAAW,EAAE,EAAE,EAAE,oBAAE,CAAC,YAAY,CAAC,MAAM,EAAE,KAAK,EAAE,oBAAE,CAAC,UAAU,CAAC,EAAE,CAAC,CAAC;AAE5F,QAAA,iBAAiB,GAAG,OAAO,CAAC,gBAAgB,CAAC,IAAI,CAAC,CAAC;AAmBhE,MAAa,EAAE;IAIN,MAAM,CAAC,UAAU,CAAC,KAA4B;QACnD,MAAM,GAAG,GAAG,OAAO,CAAC,SAAS,CAAC,oBAAE,CAAC,UAAU,CAAC,SAAS,EAAE,KAAK,EAAE,UAAU,CAAC,CAAC;QAC1E,OAAO,QAAQ,CAAC,MAAM,CAAC,GAAG,EAAE;YAC1B,MAAM,EAAE,YAAY;YACpB,WAAW,EAAE,IAAI;YACjB,QAAQ,EAAE,CAAC;SACZ,CAAC,CAAC;IACL,CAAC;IAKM,MAAM,CAAC,SAAS,CAAC,IAAa;QACnC,OAAO,OAAO,CAAC,SAAS,CAAC,oBAAE,CAAC,QAAQ,CAAC,WAAW,EAAE,IAAI,EAAE,UAAU,CAAC,CAAC;IACtE,CAAC;IAKM,MAAM,CAAC,SAAS,CAAC,IAAY,EAAE,WAA0B;QAC9D,OAAO,OAAO,CAAC,uBAAuB,CACpC,EAAE,EACF,OAAO,CAAC,6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,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;SAC/H,CAAC,CAAC;IACL,CAAC;IAEO,MAAM,CAAC,sBAAsB,CAAC,oCAAiE;QACrG,MAAM,gBAAgB,GAA2B,EAAE,CAAC;QACpD,KAAK,MAAM,CAAC,WAAW,EAAE,WAAW,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,oCAAoC,CAAC,EAAE,CAAC;YAC9F,MAAM,gBAAgB,GAAyB,EAAE,CAAC;YAClD,WAAW,CAAC,OAAO,CAAC,CAAC,UAAU,EAAE,EAAE;gBACjC,gBAAgB,CAAC,IAAI,CAAC,OAAO,CAAC,qBAAqB,CAAC,KAAK,EAAE,SAAS,EAAE,OAAO,CAAC,gBAAgB,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC;YAC/G,CAAC,CAAC,CAAC;YACH,gBAAgB,CAAC,IAAI,CACnB,OAAO,CAAC,uBAAuB,CAC7B,SAAS,EACT,OAAO,CAAC,kBAAkB,CAAC,KAAK,EAAE,SAAS,EAAE,OAAO,CAAC,kBAAkB,CAAC,gBAAgB,CAAC,CAAC,EAC1F,OAAO,CAAC,mBAAmB,CAAC,WAAW,CAAC,CACzC,CACF,CAAC;QACJ,CAAC;QACD,OAAO,gBAAgB,CAAC;IAC1B,CAAC;CACF;AArJD,gBAqJC"}
@@ -0,0 +1,18 @@
1
+ import { Parameter } from '@aws-sdk/client-cloudformation';
2
+ export declare enum CFNFunction {
3
+ Equals = "Fn::Equals",
4
+ Not = "Fn::Not",
5
+ Or = "Fn::Or",
6
+ And = "Fn::And",
7
+ If = "Fn::If"
8
+ }
9
+ export default class CFNConditionResolver {
10
+ private readonly template;
11
+ private readonly conditions;
12
+ constructor(template: any);
13
+ resolve(parameters: Parameter[]): any;
14
+ private resolveCondition;
15
+ private resolveConditionInResources;
16
+ private resolveIfCondition;
17
+ }
18
+ //# sourceMappingURL=cfn-condition-resolver.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cfn-condition-resolver.d.ts","sourceRoot":"","sources":["../../../../../../src/commands/gen2-migration/generate/amplify/analytics/cfn-condition-resolver.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,gCAAgC,CAAC;AAK3D,oBAAY,WAAW;IACrB,MAAM,eAAe;IACrB,GAAG,YAAY;IACf,EAAE,WAAW;IACb,GAAG,YAAY;IACf,EAAE,WAAW;CACd;AAcD,MAAM,CAAC,OAAO,OAAO,oBAAoB;IAIpB,OAAO,CAAC,QAAQ,CAAC,QAAQ;IAH5C,OAAO,CAAC,QAAQ,CAAC,UAAU,CAAkC;gBAGzB,QAAQ,EAAE,GAAG;IAQ1C,OAAO,CAAC,UAAU,EAAE,SAAS,EAAE,GAAG,GAAG;IAqB5C,OAAO,CAAC,gBAAgB;IAwExB,OAAO,CAAC,2BAA2B;IAkBnC,OAAO,CAAC,kBAAkB;CAW3B"}