@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,33 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.AuthUserPoolGroupsForwardRefactorer = exports.RESOURCE_TYPES = exports.USER_POOL_GROUP_TYPE = void 0;
4
+ const forward_category_refactorer_1 = require("../workflow/forward-category-refactorer");
5
+ exports.USER_POOL_GROUP_TYPE = 'AWS::Cognito::UserPoolGroup';
6
+ exports.RESOURCE_TYPES = [exports.USER_POOL_GROUP_TYPE];
7
+ class AuthUserPoolGroupsForwardRefactorer extends forward_category_refactorer_1.ForwardCategoryRefactorer {
8
+ resourceTypes() {
9
+ return exports.RESOURCE_TYPES;
10
+ }
11
+ async fetchSourceStackId() {
12
+ return this.findNestedStack(this.gen1Env, `auth${this.resource.resourceName}`);
13
+ }
14
+ async fetchDestStackId() {
15
+ return this.findNestedStack(this.gen2Branch, 'auth');
16
+ }
17
+ match(_sourceId, sourceResource, _targetId, targetResource) {
18
+ if (sourceResource.Type !== targetResource.Type) {
19
+ return false;
20
+ }
21
+ switch (sourceResource.Type) {
22
+ case exports.USER_POOL_GROUP_TYPE: {
23
+ const sourceGroupName = sourceResource.Properties['GroupName'];
24
+ const targetGroupName = targetResource.Properties['GroupName'];
25
+ return sourceGroupName === targetGroupName;
26
+ }
27
+ default:
28
+ return false;
29
+ }
30
+ }
31
+ }
32
+ exports.AuthUserPoolGroupsForwardRefactorer = AuthUserPoolGroupsForwardRefactorer;
33
+ //# sourceMappingURL=auth-user-pool-groups-forward.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"auth-user-pool-groups-forward.js","sourceRoot":"","sources":["../../../../../src/commands/gen2-migration/refactor/auth/auth-user-pool-groups-forward.ts"],"names":[],"mappings":";;;AACA,yFAAoF;AAEvE,QAAA,oBAAoB,GAAG,6BAA6B,CAAC;AAErD,QAAA,cAAc,GAAG,CAAC,4BAAoB,CAAC,CAAC;AAOrD,MAAa,mCAAoC,SAAQ,uDAAyB;IACtE,aAAa;QACrB,OAAO,sBAAc,CAAC;IACxB,CAAC;IAES,KAAK,CAAC,kBAAkB;QAChC,OAAO,IAAI,CAAC,eAAe,CAAC,IAAI,CAAC,OAAO,EAAE,OAAO,IAAI,CAAC,QAAQ,CAAC,YAAY,EAAE,CAAC,CAAC;IACjF,CAAC;IAES,KAAK,CAAC,gBAAgB;QAE9B,OAAO,IAAI,CAAC,eAAe,CAAC,IAAI,CAAC,UAAU,EAAE,MAAM,CAAC,CAAC;IACvD,CAAC;IAEkB,KAAK,CAAC,SAAiB,EAAE,cAA2B,EAAE,SAAiB,EAAE,cAA2B;QACrH,IAAI,cAAc,CAAC,IAAI,KAAK,cAAc,CAAC,IAAI,EAAE,CAAC;YAChD,OAAO,KAAK,CAAC;QACf,CAAC;QACD,QAAQ,cAAc,CAAC,IAAI,EAAE,CAAC;YAC5B,KAAK,4BAAoB,CAAC,CAAC,CAAC;gBAC1B,MAAM,eAAe,GAAG,cAAc,CAAC,UAAU,CAAC,WAAW,CAAC,CAAC;gBAC/D,MAAM,eAAe,GAAG,cAAc,CAAC,UAAU,CAAC,WAAW,CAAC,CAAC;gBAC/D,OAAO,eAAe,KAAK,eAAe,CAAC;YAC7C,CAAC;YACD;gBACE,OAAO,KAAK,CAAC;QACjB,CAAC;IACH,CAAC;CACF;AA5BD,kFA4BC"}
@@ -0,0 +1,9 @@
1
+ import { CFNResource } from '../../_infra/cfn-template';
2
+ import { RollbackCategoryRefactorer } from '../workflow/rollback-category-refactorer';
3
+ export declare class AuthUserPoolGroupsRollbackRefactorer extends RollbackCategoryRefactorer {
4
+ protected resourceTypes(): string[];
5
+ protected fetchSourceStackId(): Promise<string | undefined>;
6
+ protected fetchDestStackId(): Promise<string | undefined>;
7
+ protected targetLogicalId(sourceId: string, sourceResource: CFNResource): string | undefined;
8
+ }
9
+ //# sourceMappingURL=auth-user-pool-groups-rollback.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"auth-user-pool-groups-rollback.d.ts","sourceRoot":"","sources":["../../../../../src/commands/gen2-migration/refactor/auth/auth-user-pool-groups-rollback.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AACxD,OAAO,EAAE,0BAA0B,EAAE,MAAM,0CAA0C,CAAC;AAQtF,qBAAa,oCAAqC,SAAQ,0BAA0B;IAClF,SAAS,CAAC,aAAa,IAAI,MAAM,EAAE;cAInB,kBAAkB,IAAI,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC;cAIjD,gBAAgB,IAAI,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC;IAI/D,SAAS,CAAC,eAAe,CAAC,QAAQ,EAAE,MAAM,EAAE,cAAc,EAAE,WAAW,GAAG,MAAM,GAAG,SAAS;CAQ7F"}
@@ -0,0 +1,26 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.AuthUserPoolGroupsRollbackRefactorer = void 0;
4
+ const rollback_category_refactorer_1 = require("../workflow/rollback-category-refactorer");
5
+ const auth_user_pool_groups_forward_1 = require("./auth-user-pool-groups-forward");
6
+ class AuthUserPoolGroupsRollbackRefactorer extends rollback_category_refactorer_1.RollbackCategoryRefactorer {
7
+ resourceTypes() {
8
+ return auth_user_pool_groups_forward_1.RESOURCE_TYPES;
9
+ }
10
+ async fetchSourceStackId() {
11
+ return this.findNestedStack(this.gen2Branch, 'auth');
12
+ }
13
+ async fetchDestStackId() {
14
+ return this.findNestedStack(this.gen1Env, `auth${this.resource.resourceName}`);
15
+ }
16
+ targetLogicalId(sourceId, sourceResource) {
17
+ switch (sourceResource.Type) {
18
+ case auth_user_pool_groups_forward_1.USER_POOL_GROUP_TYPE:
19
+ return `${sourceResource.Properties['GroupName']}Group`;
20
+ default:
21
+ return undefined;
22
+ }
23
+ }
24
+ }
25
+ exports.AuthUserPoolGroupsRollbackRefactorer = AuthUserPoolGroupsRollbackRefactorer;
26
+ //# sourceMappingURL=auth-user-pool-groups-rollback.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"auth-user-pool-groups-rollback.js","sourceRoot":"","sources":["../../../../../src/commands/gen2-migration/refactor/auth/auth-user-pool-groups-rollback.ts"],"names":[],"mappings":";;;AACA,2FAAsF;AACtF,mFAAuF;AAOvF,MAAa,oCAAqC,SAAQ,yDAA0B;IACxE,aAAa;QACrB,OAAO,8CAAc,CAAC;IACxB,CAAC;IAES,KAAK,CAAC,kBAAkB;QAChC,OAAO,IAAI,CAAC,eAAe,CAAC,IAAI,CAAC,UAAU,EAAE,MAAM,CAAC,CAAC;IACvD,CAAC;IAES,KAAK,CAAC,gBAAgB;QAC9B,OAAO,IAAI,CAAC,eAAe,CAAC,IAAI,CAAC,OAAO,EAAE,OAAO,IAAI,CAAC,QAAQ,CAAC,YAAY,EAAE,CAAC,CAAC;IACjF,CAAC;IAES,eAAe,CAAC,QAAgB,EAAE,cAA2B;QACrE,QAAQ,cAAc,CAAC,IAAI,EAAE,CAAC;YAC5B,KAAK,oDAAoB;gBACvB,OAAO,GAAG,cAAc,CAAC,UAAU,CAAC,WAAW,CAAC,OAAO,CAAC;YAC1D;gBACE,OAAO,SAAS,CAAC;QACrB,CAAC;IACH,CAAC;CACF;AArBD,oFAqBC"}
@@ -0,0 +1,41 @@
1
+ import { CloudFormationClient, DescribeChangeSetOutput, Parameter, ResourceMapping, Stack } from '@aws-sdk/client-cloudformation';
2
+ import { CFNResource, CFNTemplate } from '../_infra/cfn-template';
3
+ import { SpinningLogger } from '../_infra/spinning-logger';
4
+ import { DiscoveredResource } from '../generate/_infra/gen1-app';
5
+ export declare const OUTPUT_DIRECTORY = ".amplify/refactor.operations";
6
+ export declare const HOLDING_STACK_NAME_SUFFIX = "-holding";
7
+ export declare const MIGRATION_PLACEHOLDER_LOGICAL_ID = "MigrationPlaceholder";
8
+ export declare const MIGRATION_PLACEHOLDER_RESOURCE: CFNResource;
9
+ export declare class Cfn {
10
+ private readonly client;
11
+ private readonly logger;
12
+ private readonly updateStackClaims;
13
+ constructor(client: CloudFormationClient, logger: SpinningLogger);
14
+ isUpdateClaimed(stackName: string): boolean;
15
+ claimUpdate(stackName: string): void;
16
+ update(params: {
17
+ readonly stackName: string;
18
+ readonly parameters: Parameter[];
19
+ readonly templateBody: CFNTemplate;
20
+ readonly resource?: DiscoveredResource;
21
+ }): Promise<void>;
22
+ refactor(resourceMappings: ResourceMapping[], resource?: DiscoveredResource): Promise<void>;
23
+ createChangeSet(params: {
24
+ readonly stackName: string;
25
+ readonly parameters: Parameter[];
26
+ readonly templateBody: CFNTemplate;
27
+ }): Promise<DescribeChangeSetOutput | undefined>;
28
+ executeChangeSet(params: {
29
+ readonly changeSet: DescribeChangeSetOutput;
30
+ readonly templateBody: CFNTemplate;
31
+ readonly resource?: DiscoveredResource;
32
+ }): Promise<void>;
33
+ deleteChangeSet(changeSet: DescribeChangeSetOutput): Promise<void>;
34
+ findStack(stackName: string): Promise<Stack | null>;
35
+ describeStack(stackName: string): Promise<Stack>;
36
+ fetchTemplate(stackName: string): Promise<CFNTemplate>;
37
+ deleteStack(stackName: string, resource?: DiscoveredResource): Promise<void>;
38
+ renderChangeSet(changeSet: DescribeChangeSetOutput): string | undefined;
39
+ private info;
40
+ }
41
+ //# sourceMappingURL=cfn.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cfn.d.ts","sourceRoot":"","sources":["../../../../src/commands/gen2-migration/refactor/cfn.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,oBAAoB,EAQpB,uBAAuB,EAKvB,SAAS,EACT,eAAe,EACf,KAAK,EASN,MAAM,gCAAgC,CAAC;AAExC,OAAO,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AAElE,OAAO,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAI3D,OAAO,EAAE,kBAAkB,EAAE,MAAM,6BAA6B,CAAC;AAKjE,eAAO,MAAM,gBAAgB,iCAAiC,CAAC;AAS/D,eAAO,MAAM,yBAAyB,aAAa,CAAC;AACpD,eAAO,MAAM,gCAAgC,yBAAyB,CAAC;AACvE,eAAO,MAAM,8BAA8B,EAAE,WAAkF,CAAC;AAMhI,qBAAa,GAAG;IAOF,OAAO,CAAC,QAAQ,CAAC,MAAM;IAAwB,OAAO,CAAC,QAAQ,CAAC,MAAM;IAFlF,OAAO,CAAC,QAAQ,CAAC,iBAAiB,CAAqB;gBAE1B,MAAM,EAAE,oBAAoB,EAAmB,MAAM,EAAE,cAAc;IAS3F,eAAe,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO;IAQ3C,WAAW,CAAC,SAAS,EAAE,MAAM,GAAG,IAAI;IAQ9B,MAAM,CAAC,MAAM,EAAE;QAC1B,QAAQ,CA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CAIb"}
@@ -0,0 +1,337 @@
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.Cfn = exports.MIGRATION_PLACEHOLDER_RESOURCE = exports.MIGRATION_PLACEHOLDER_LOGICAL_ID = exports.HOLDING_STACK_NAME_SUFFIX = exports.OUTPUT_DIRECTORY = void 0;
40
+ const client_cloudformation_1 = require("@aws-sdk/client-cloudformation");
41
+ const amplify_cli_core_1 = require("@aws-amplify/amplify-cli-core");
42
+ const utils_1 = require("./utils");
43
+ const chalk_1 = __importDefault(require("chalk"));
44
+ const fs = __importStar(require("fs"));
45
+ const path = __importStar(require("path"));
46
+ const MAX_WAIT_TIME_SECONDS = 900;
47
+ const NO_UPDATES_MESSAGE = 'No updates are to be performed';
48
+ const CFN_IAM_CAPABILITY = 'CAPABILITY_NAMED_IAM';
49
+ exports.OUTPUT_DIRECTORY = '.amplify/refactor.operations';
50
+ const EMPTY_HOLDING_TEMPLATE = {
51
+ AWSTemplateFormatVersion: '2010-09-09',
52
+ Description: 'Temporary holding stack for Gen2 migration',
53
+ Resources: {},
54
+ Outputs: {},
55
+ };
56
+ exports.HOLDING_STACK_NAME_SUFFIX = '-holding';
57
+ exports.MIGRATION_PLACEHOLDER_LOGICAL_ID = 'MigrationPlaceholder';
58
+ exports.MIGRATION_PLACEHOLDER_RESOURCE = { Type: 'AWS::CloudFormation::WaitConditionHandle', Properties: {} };
59
+ class Cfn {
60
+ constructor(client, logger) {
61
+ this.client = client;
62
+ this.logger = logger;
63
+ this.updateStackClaims = new Set();
64
+ if (!fs.existsSync(exports.OUTPUT_DIRECTORY)) {
65
+ fs.mkdirSync(exports.OUTPUT_DIRECTORY, { recursive: true });
66
+ }
67
+ }
68
+ isUpdateClaimed(stackName) {
69
+ return this.updateStackClaims.has(stackName);
70
+ }
71
+ claimUpdate(stackName) {
72
+ this.updateStackClaims.add(stackName);
73
+ }
74
+ async update(params) {
75
+ const { stackName, parameters, templateBody, resource } = params;
76
+ try {
77
+ const input = {
78
+ TemplateBody: JSON.stringify(templateBody),
79
+ Parameters: parameters,
80
+ StackName: stackName,
81
+ Capabilities: [CFN_IAM_CAPABILITY],
82
+ };
83
+ writeUpdateSnapshot({ stackName, templateBody: input.TemplateBody, parameters });
84
+ this.info(`Updating stack: ${(0, utils_1.extractStackNameFromId)(stackName)}`, resource);
85
+ await this.client.send(new client_cloudformation_1.UpdateStackCommand(input));
86
+ }
87
+ catch (e) {
88
+ if (e && typeof e === 'object' && 'message' in e && typeof e.message === 'string' && e.message.includes(NO_UPDATES_MESSAGE)) {
89
+ return;
90
+ }
91
+ throw e;
92
+ }
93
+ this.info(`Waiting for stack update to complete: ${(0, utils_1.extractStackNameFromId)(stackName)}`, resource);
94
+ await (0, client_cloudformation_1.waitUntilStackUpdateComplete)({ client: this.client, maxWaitTime: MAX_WAIT_TIME_SECONDS }, { StackName: stackName });
95
+ }
96
+ async refactor(resourceMappings, resource) {
97
+ var _a;
98
+ const sourceStackId = resourceMappings[0].Source.StackName;
99
+ const targetStackId = resourceMappings[0].Destination.StackName;
100
+ const sourceStackName = (0, utils_1.extractStackNameFromId)(sourceStackId);
101
+ const targetStackName = (0, utils_1.extractStackNameFromId)(targetStackId);
102
+ this.info(`Refactoring ${sourceStackName} → ${targetStackName}`, resource);
103
+ const targetStack = await this.findStack(targetStackId);
104
+ const sourceStack = await this.findStack(sourceStackId);
105
+ if (!targetStack && !targetStackName.endsWith(exports.HOLDING_STACK_NAME_SUFFIX)) {
106
+ throw new amplify_cli_core_1.AmplifyError('MigrationError', { message: `Target stack ${targetStackName} does not exist` });
107
+ }
108
+ if (!sourceStack) {
109
+ throw new amplify_cli_core_1.AmplifyError('MigrationError', { message: `Source stack ${sourceStackName} does not exist` });
110
+ }
111
+ const sourceTemplate = await this.fetchTemplate(sourceStackId);
112
+ const sourceTemplateClone = JSON.parse(JSON.stringify(sourceTemplate));
113
+ const targetTemplate = targetStack ? await this.fetchTemplate(targetStackId) : JSON.parse(JSON.stringify(EMPTY_HOLDING_TEMPLATE));
114
+ for (const mapping of resourceMappings) {
115
+ if (mapping.Destination.LogicalResourceId in targetTemplate.Resources) {
116
+ throw new amplify_cli_core_1.AmplifyError('MigrationError', {
117
+ message: `Unable to create stack refactor. Resource ${mapping.Destination.LogicalResourceId} already exists in stack ${targetStackName}`,
118
+ });
119
+ }
120
+ targetTemplate.Resources[mapping.Destination.LogicalResourceId] = sourceTemplate.Resources[mapping.Source.LogicalResourceId];
121
+ delete sourceTemplate.Resources[mapping.Source.LogicalResourceId];
122
+ }
123
+ if (Object.keys(sourceTemplate.Resources).length === 0) {
124
+ sourceTemplateClone.Resources[exports.MIGRATION_PLACEHOLDER_LOGICAL_ID] = exports.MIGRATION_PLACEHOLDER_RESOURCE;
125
+ sourceTemplate.Resources[exports.MIGRATION_PLACEHOLDER_LOGICAL_ID] = exports.MIGRATION_PLACEHOLDER_RESOURCE;
126
+ this.info(`Adding placeholder resource to source stack '${sourceStackName}'`);
127
+ await this.update({
128
+ stackName: sourceStackId,
129
+ templateBody: sourceTemplateClone,
130
+ parameters: (_a = sourceStack.Parameters) !== null && _a !== void 0 ? _a : [],
131
+ resource,
132
+ });
133
+ this.info(`Finished adding placeholder to source stack '${sourceStackName}'`);
134
+ }
135
+ const input = {
136
+ StackDefinitions: [
137
+ { TemplateBody: JSON.stringify(sourceTemplate), StackName: sourceStackId },
138
+ { TemplateBody: JSON.stringify(targetTemplate), StackName: targetStackId },
139
+ ],
140
+ ResourceMappings: resourceMappings,
141
+ EnableStackCreation: true,
142
+ };
143
+ input.Description = buildRefactorDescription(input);
144
+ writeRefactorSnapshot(input);
145
+ this.info(`Creating stack refactor: ${(0, utils_1.extractStackNameFromId)(sourceStackId)} → ${(0, utils_1.extractStackNameFromId)(targetStackId)}`, resource);
146
+ const { StackRefactorId } = await this.client.send(new client_cloudformation_1.CreateStackRefactorCommand(input));
147
+ if (!StackRefactorId) {
148
+ throw new amplify_cli_core_1.AmplifyError('StackStateError', {
149
+ message: 'CreateStackRefactor returned no StackRefactorId',
150
+ });
151
+ }
152
+ this.info(`Waiting for stack refactor creation to complete: ${StackRefactorId}`, resource);
153
+ await (0, client_cloudformation_1.waitUntilStackRefactorCreateComplete)({ client: this.client, maxWaitTime: MAX_WAIT_TIME_SECONDS }, { StackRefactorId });
154
+ await this.client.send(new client_cloudformation_1.ExecuteStackRefactorCommand({ StackRefactorId }));
155
+ this.info(`Waiting for stack refactor execution to complete: ${StackRefactorId}`, resource);
156
+ await (0, client_cloudformation_1.waitUntilStackRefactorExecuteComplete)({ client: this.client, maxWaitTime: MAX_WAIT_TIME_SECONDS }, { StackRefactorId });
157
+ this.info(`Waiting for source stack update: ${(0, utils_1.extractStackNameFromId)(sourceStackId)}`, resource);
158
+ await (0, client_cloudformation_1.waitUntilStackUpdateComplete)({ client: this.client, maxWaitTime: MAX_WAIT_TIME_SECONDS }, { StackName: sourceStackId });
159
+ this.info(`Waiting for destination stack: ${(0, utils_1.extractStackNameFromId)(targetStackId)}`, resource);
160
+ if (targetStack) {
161
+ await (0, client_cloudformation_1.waitUntilStackUpdateComplete)({ client: this.client, maxWaitTime: MAX_WAIT_TIME_SECONDS }, { StackName: targetStackId });
162
+ }
163
+ else {
164
+ await (0, client_cloudformation_1.waitUntilStackCreateComplete)({ client: this.client, maxWaitTime: MAX_WAIT_TIME_SECONDS }, { StackName: targetStackId });
165
+ }
166
+ this.info(`Finished refactoring ${sourceStackName} → ${targetStackName}`, resource);
167
+ }
168
+ async createChangeSet(params) {
169
+ var _a;
170
+ const { stackName, parameters, templateBody } = params;
171
+ const changeSetName = `gen2-migration-${Date.now()}`;
172
+ await this.client.send(new client_cloudformation_1.CreateChangeSetCommand({
173
+ StackName: stackName,
174
+ ChangeSetName: changeSetName,
175
+ TemplateBody: JSON.stringify(templateBody),
176
+ Parameters: parameters,
177
+ Capabilities: [CFN_IAM_CAPABILITY],
178
+ }));
179
+ try {
180
+ await (0, client_cloudformation_1.waitUntilChangeSetCreateComplete)({ client: this.client, maxWaitTime: 120 }, { StackName: stackName, ChangeSetName: changeSetName });
181
+ }
182
+ catch (e) {
183
+ if ((_a = e.message) === null || _a === void 0 ? void 0 : _a.includes(`The submitted information didn't contain changes`)) {
184
+ await this.client.send(new client_cloudformation_1.DeleteChangeSetCommand({ StackName: stackName, ChangeSetName: changeSetName }));
185
+ return undefined;
186
+ }
187
+ throw e;
188
+ }
189
+ return await this.client.send(new client_cloudformation_1.DescribeChangeSetCommand({ StackName: stackName, ChangeSetName: changeSetName, IncludePropertyValues: true }));
190
+ }
191
+ async executeChangeSet(params) {
192
+ var _a;
193
+ const { changeSet, templateBody, resource } = params;
194
+ const displayName = (0, utils_1.extractStackNameFromId)(changeSet.StackName);
195
+ writeUpdateSnapshot({
196
+ stackName: changeSet.StackName,
197
+ templateBody: JSON.stringify(templateBody),
198
+ parameters: (_a = changeSet.Parameters) !== null && _a !== void 0 ? _a : [],
199
+ });
200
+ this.info(`Executing change set for stack: ${displayName}`, resource);
201
+ await this.client.send(new client_cloudformation_1.ExecuteChangeSetCommand({ StackName: changeSet.StackName, ChangeSetName: changeSet.ChangeSetName }));
202
+ this.info(`Waiting for stack update to complete: ${displayName}`, resource);
203
+ await (0, client_cloudformation_1.waitUntilStackUpdateComplete)({ client: this.client, maxWaitTime: MAX_WAIT_TIME_SECONDS }, { StackName: changeSet.StackName });
204
+ }
205
+ async deleteChangeSet(changeSet) {
206
+ await this.client.send(new client_cloudformation_1.DeleteChangeSetCommand({ StackName: changeSet.StackName, ChangeSetName: changeSet.ChangeSetName }));
207
+ }
208
+ async findStack(stackName) {
209
+ var _a, _b;
210
+ try {
211
+ const response = await this.client.send(new client_cloudformation_1.DescribeStacksCommand({ StackName: stackName }));
212
+ const stack = (_a = response.Stacks) === null || _a === void 0 ? void 0 : _a[0];
213
+ if (stack && stack.StackStatus !== 'DELETE_COMPLETE') {
214
+ return stack;
215
+ }
216
+ return null;
217
+ }
218
+ catch (error) {
219
+ if (error instanceof client_cloudformation_1.CloudFormationServiceException &&
220
+ error.name === 'ValidationError' &&
221
+ ((_b = error.message) === null || _b === void 0 ? void 0 : _b.includes('does not exist'))) {
222
+ return null;
223
+ }
224
+ throw error;
225
+ }
226
+ }
227
+ async describeStack(stackName) {
228
+ const stack = await this.findStack(stackName);
229
+ if (!stack) {
230
+ throw new amplify_cli_core_1.AmplifyError('StackNotFoundError', {
231
+ message: `Stack '${(0, utils_1.extractStackNameFromId)(stackName)}' does not exist`,
232
+ });
233
+ }
234
+ return stack;
235
+ }
236
+ async fetchTemplate(stackName) {
237
+ const response = await this.client.send(new client_cloudformation_1.GetTemplateCommand({ StackName: stackName, TemplateStage: 'Original' }));
238
+ if (!response.TemplateBody) {
239
+ throw new amplify_cli_core_1.AmplifyError('InvalidStackError', {
240
+ message: `Stack '${(0, utils_1.extractStackNameFromId)(stackName)}' returned an empty template`,
241
+ });
242
+ }
243
+ return JSON.parse(response.TemplateBody);
244
+ }
245
+ async deleteStack(stackName, resource) {
246
+ var _a;
247
+ try {
248
+ this.info(`Deleting stack: ${(0, utils_1.extractStackNameFromId)(stackName)}`, resource);
249
+ await this.client.send(new client_cloudformation_1.DeleteStackCommand({ StackName: stackName }));
250
+ this.info(`Waiting for stack deletion: ${(0, utils_1.extractStackNameFromId)(stackName)}`, resource);
251
+ await (0, client_cloudformation_1.waitUntilStackDeleteComplete)({ client: this.client, maxWaitTime: 300 }, { StackName: stackName });
252
+ }
253
+ catch (error) {
254
+ if (error instanceof client_cloudformation_1.CloudFormationServiceException &&
255
+ error.name === 'ValidationError' &&
256
+ ((_a = error.message) === null || _a === void 0 ? void 0 : _a.includes('does not exist'))) {
257
+ return;
258
+ }
259
+ throw error;
260
+ }
261
+ }
262
+ renderChangeSet(changeSet) {
263
+ var _a, _b, _c, _d, _e;
264
+ const changes = (_a = changeSet.Changes) !== null && _a !== void 0 ? _a : [];
265
+ if (changes.length === 0)
266
+ return undefined;
267
+ const lines = [];
268
+ for (const change of changes) {
269
+ const rc = change.ResourceChange;
270
+ if (!rc)
271
+ continue;
272
+ const action = (_b = rc.Action) !== null && _b !== void 0 ? _b : 'Unknown';
273
+ const logicalId = (_c = rc.LogicalResourceId) !== null && _c !== void 0 ? _c : 'Unknown';
274
+ const resourceType = (_d = rc.ResourceType) !== null && _d !== void 0 ? _d : 'Unknown';
275
+ lines.push('');
276
+ lines.push(`${chalk_1.default.bold(logicalId)} (${resourceType}) — ${chalk_1.default.yellow(action)}`);
277
+ const details = (_e = rc.Details) !== null && _e !== void 0 ? _e : [];
278
+ const propDetails = details.filter((d) => { var _a, _b; return ((_a = d.Target) === null || _a === void 0 ? void 0 : _a.Attribute) === 'Properties' && ((_b = d.Target) === null || _b === void 0 ? void 0 : _b.Name); });
279
+ for (const detail of propDetails) {
280
+ const target = detail.Target;
281
+ const propertyPath = target.Path;
282
+ const before = target.BeforeValue;
283
+ const after = target.AfterValue;
284
+ lines.push('');
285
+ if (before && after) {
286
+ lines.push(` ${propertyPath}:`);
287
+ lines.push(` ${chalk_1.default.red(`- ${before}`)}`);
288
+ lines.push(` ${chalk_1.default.green(`+ ${after}`)}`);
289
+ }
290
+ else if (after) {
291
+ lines.push(` ${propertyPath}:`);
292
+ lines.push(` ${chalk_1.default.green(`+ ${after}`)}`);
293
+ }
294
+ else if (before) {
295
+ lines.push(` ${propertyPath}:`);
296
+ lines.push(` ${chalk_1.default.red(`- ${before}`)}`);
297
+ }
298
+ else {
299
+ lines.push(` ${propertyPath}: (changed)`);
300
+ }
301
+ }
302
+ }
303
+ return lines.join('\n');
304
+ }
305
+ info(message, resource) {
306
+ const prefix = resource ? `[${resource.category}/${resource.resourceName}] ` : '';
307
+ this.logger.info(`${prefix}${message}`);
308
+ }
309
+ }
310
+ exports.Cfn = Cfn;
311
+ function buildRefactorDescription(input) {
312
+ const logicalIds = input.ResourceMappings.map((m) => { var _a; return (_a = m.Source) === null || _a === void 0 ? void 0 : _a.LogicalResourceId; }).join(', ');
313
+ const source = (0, utils_1.extractStackNameFromId)(input.StackDefinitions[0].StackName);
314
+ const dest = (0, utils_1.extractStackNameFromId)(input.StackDefinitions[1].StackName);
315
+ return `Move [${logicalIds}] from ${source} to ${dest}`;
316
+ }
317
+ function formatTemplateBody(templateBody) {
318
+ return JSON.stringify(JSON.parse(templateBody), null, 2);
319
+ }
320
+ function writeUpdateSnapshot(input) {
321
+ const stackName = (0, utils_1.extractStackNameFromId)(input.stackName);
322
+ fs.writeFileSync(path.join(exports.OUTPUT_DIRECTORY, `update.${stackName}.template.json`), formatTemplateBody(input.templateBody));
323
+ fs.writeFileSync(path.join(exports.OUTPUT_DIRECTORY, `update.${stackName}.parameters.json`), JSON.stringify(input.parameters, null, 2));
324
+ }
325
+ function writeRefactorSnapshot(input) {
326
+ var _a;
327
+ const source = input.StackDefinitions[0];
328
+ const target = input.StackDefinitions[1];
329
+ const sourceStackName = (0, utils_1.extractStackNameFromId)(source.StackName);
330
+ const targetStackName = (0, utils_1.extractStackNameFromId)(target.StackName);
331
+ const description = `refactor.__from__.${sourceStackName}.__to__.${targetStackName}`;
332
+ const basePath = path.join(exports.OUTPUT_DIRECTORY, description);
333
+ fs.writeFileSync(`${basePath}.source.template.json`, formatTemplateBody(source.TemplateBody));
334
+ fs.writeFileSync(`${basePath}.target.template.json`, formatTemplateBody(target.TemplateBody));
335
+ fs.writeFileSync(path.join(exports.OUTPUT_DIRECTORY, `${description}.mappings.json`), JSON.stringify((_a = input.ResourceMappings) !== null && _a !== void 0 ? _a : [], null, 2));
336
+ }
337
+ //# sourceMappingURL=cfn.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cfn.js","sourceRoot":"","sources":["../../../../src/commands/gen2-migration/refactor/cfn.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,0EAyBwC;AACxC,oEAA6D;AAE7D,mCAAiD;AAEjD,kDAA0B;AAC1B,uCAAyB;AACzB,2CAA6B;AAG7B,MAAM,qBAAqB,GAAG,GAAG,CAAC;AAClC,MAAM,kBAAkB,GAAG,gCAAgC,CAAC;AAC5D,MAAM,kBAAkB,GAAG,sBAAsB,CAAC;AACrC,QAAA,gBAAgB,GAAG,8BAA8B,CAAC;AAE/D,MAAM,sBAAsB,GAAgB;IAC1C,wBAAwB,EAAE,YAAY;IACtC,WAAW,EAAE,4CAA4C;IACzD,SAAS,EAAE,EAAE;IACb,OAAO,EAAE,EAAE;CACZ,CAAC;AAEW,QAAA,yBAAyB,GAAG,UAAU,CAAC;AACvC,QAAA,gCAAgC,GAAG,sBAAsB,CAAC;AA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CAAC,SAAS,CAAC,CAAC;IACjE,MAAM,WAAW,GAAG,qBAAqB,eAAe,WAAW,eAAe,EAAE,CAAC;IACrF,MAAM,QAAQ,GAAG,IAAI,CAAC,IAAI,CAAC,wBAAgB,EAAE,WAAW,CAAC,CAAC;IAC1D,EAAE,CAAC,aAAa,CAAC,GAAG,QAAQ,uBAAuB,EAAE,kBAAkB,CAAC,MAAM,CAAC,YAAY,CAAC,CAAC,CAAC;IAC9F,EAAE,CAAC,aAAa,CAAC,GAAG,QAAQ,uBAAuB,EAAE,kBAAkB,CAAC,MAAM,CAAC,YAAY,CAAC,CAAC,CAAC;IAC9F,EAAE,CAAC,aAAa,CAAC,IAAI,CAAC,IAAI,CAAC,wBAAgB,EAAE,GAAG,WAAW,gBAAgB,CAAC,EAAE,IAAI,CAAC,SAAS,CAAC,MAAA,KAAK,CAAC,gBAAgB,mCAAI,EAAE,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC;AACvI,CAAC"}
@@ -1,2 +1,2 @@
1
- export { AmplifyMigrationRefactorStep } from './refactor';
1
+ export { AmplifyMigrationRefactorStep } from '../refactor';
2
2
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/commands/gen2-migration/refactor/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,4BAA4B,EAAE,MAAM,YAAY,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/commands/gen2-migration/refactor/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,4BAA4B,EAAE,MAAM,aAAa,CAAC"}
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.AmplifyMigrationRefactorStep = void 0;
4
- var refactor_1 = require("./refactor");
4
+ var refactor_1 = require("../refactor");
5
5
  Object.defineProperty(exports, "AmplifyMigrationRefactorStep", { enumerable: true, get: function () { return refactor_1.AmplifyMigrationRefactorStep; } });
6
6
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/commands/gen2-migration/refactor/index.ts"],"names":[],"mappings":";;;AAAA,uCAA0D;AAAjD,wHAAA,4BAA4B,OAAA"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/commands/gen2-migration/refactor/index.ts"],"names":[],"mappings":";;;AAAA,wCAA2D;AAAlD,wHAAA,4BAA4B,OAAA"}
@@ -1,16 +1,28 @@
1
1
  import { SSMClient } from '@aws-sdk/client-ssm';
2
2
  import { CognitoIdentityProviderClient } from '@aws-sdk/client-cognito-identity-provider';
3
3
  import { Parameter } from '@aws-sdk/client-cloudformation';
4
- import { OAuthClient } from './types';
5
- export declare const constructSignInWithApplePrivateKeyParamName: (appId: string, environment: string) => string;
6
- type RetrieveOAuthValuesParameters = {
7
- ssmClient: SSMClient;
8
- cognitoIdpClient: CognitoIdentityProviderClient;
9
- oAuthParameter: Parameter;
10
- userPoolId: string;
11
- appId: string;
12
- environmentName: string;
4
+ type BaseOAuthClient = {
5
+ readonly ProviderName: string;
6
+ readonly client_id: string;
13
7
  };
14
- declare const retrieveOAuthValues: ({ ssmClient, cognitoIdpClient, oAuthParameter, userPoolId, appId, environmentName, }: RetrieveOAuthValuesParameters) => Promise<OAuthClient[]>;
15
- export default retrieveOAuthValues;
8
+ type OAuthClientWithSecret = BaseOAuthClient & {
9
+ readonly client_secret: string;
10
+ };
11
+ type SignInWithAppleOAuthClient = BaseOAuthClient & {
12
+ readonly team_id: string;
13
+ readonly key_id: string;
14
+ readonly private_key: string;
15
+ };
16
+ export type OAuthClient = OAuthClientWithSecret | SignInWithAppleOAuthClient;
17
+ export declare function constructSignInWithApplePrivateKeyParamName(appId: string, environment: string): string;
18
+ interface RetrieveOAuthValuesParams {
19
+ readonly ssmClient: SSMClient;
20
+ readonly cognitoIdpClient: CognitoIdentityProviderClient;
21
+ readonly oAuthParameter: Parameter;
22
+ readonly userPoolId: string;
23
+ readonly appId: string;
24
+ readonly environmentName: string;
25
+ }
26
+ export declare function retrieveOAuthValues({ ssmClient, cognitoIdpClient, oAuthParameter, userPoolId, appId, environmentName, }: RetrieveOAuthValuesParams): Promise<OAuthClient[]>;
27
+ export {};
16
28
  //# sourceMappingURL=oauth-values-retriever.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"oauth-values-retriever.d.ts","sourceRoot":"","sources":["../../../../src/commands/gen2-migration/refactor/oauth-values-retriever.ts"],"names":[],"mappings":"AACA,OAAO,EAAuB,SAAS,EAAE,MAAM,qBAAqB,CAAC;AACrE,OAAO,EAAE,6BAA6B,EAAmC,MAAM,2CAA2C,CAAC;AAC3H,OAAO,EAAE,SAAS,EAAE,MAAM,gCAAgC,CAAC;AAC3D,OAAO,EAAwB,WAAW,EAAE,MAAM,SAAS,CAAC;AAQ5D,eAAO,MAAM,2CAA2C,GAAI,OAAO,MAAM,EAAE,aAAa,MAAM,KAAG,MAEhG,CAAC;AAEF,KAAK,6BAA6B,GAAG;IACnC,SAAS,EAAE,SAAS,CAAC;IACrB,gBAAgB,EAAE,6BAA6B,CAAC;IAChD,cAAc,EAAE,SAAS,CAAC;IAC1B,UAAU,EAAE,MAAM,CAAC;IACnB,KAAK,EAAE,MAAM,CAAC;IACd,eAAe,EAAE,MAAM,CAAC;CACzB,CAAC;AAWF,QAAA,MAAM,mBAAmB,GAAU,sFAOhC,6BAA6B,2BAuD/B,CAAC;AAEF,eAAe,mBAAmB,CAAC"}
1
+ {"version":3,"file":"oauth-values-retriever.d.ts","sourceRoot":"","sources":["../../../../src/commands/gen2-migration/refactor/oauth-values-retriever.ts"],"names":[],"mappings":"AAAA,OAAO,EAAuB,SAAS,EAAE,MAAM,qBAAqB,CAAC;AACrE,OAAO,EAAE,6BAA6B,EAAmC,MAAM,2CAA2C,CAAC;AAC3H,OAAO,EAAE,SAAS,EAAE,MAAM,gCAAgC,CAAC;AAG3D,KAAK,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