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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
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 +21 -12
  383. package/aws-amplify-cli-internal-gen2-migration-experimental-alpha-0.6.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
@@ -1,69 +1,77 @@
1
1
  "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
2
  Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.constructSignInWithApplePrivateKeyParamName = void 0;
7
- const node_assert_1 = __importDefault(require("node:assert"));
3
+ exports.constructSignInWithApplePrivateKeyParamName = constructSignInWithApplePrivateKeyParamName;
4
+ exports.retrieveOAuthValues = retrieveOAuthValues;
8
5
  const client_ssm_1 = require("@aws-sdk/client-ssm");
9
6
  const client_cognito_identity_provider_1 = require("@aws-sdk/client-cognito-identity-provider");
10
- const INVALID_OAUTH_GEN1_PROVIDER_METADATA_ERROR = 'Invalid Gen1 OAuth provider metadata';
11
- const isHostedProviderMetadata = (parsedValue) => {
12
- return typeof parsedValue === 'object' && parsedValue !== null && 'ProviderName' in parsedValue;
7
+ const amplify_cli_core_1 = require("@aws-amplify/amplify-cli-core");
8
+ const isHostedProviderMetadata = (value) => {
9
+ return typeof value === 'object' && value !== null && 'ProviderName' in value;
13
10
  };
14
- const constructSignInWithApplePrivateKeyParamName = (appId, environment) => {
11
+ function constructSignInWithApplePrivateKeyParamName(appId, environment) {
15
12
  return `/amplify/${appId}/${environment}/AMPLIFY_SIWA_PRIVATE_KEY`;
16
- };
17
- exports.constructSignInWithApplePrivateKeyParamName = constructSignInWithApplePrivateKeyParamName;
18
- const retrieveOAuthValues = async ({ ssmClient, cognitoIdpClient, oAuthParameter, userPoolId, appId, environmentName, }) => {
13
+ }
14
+ async function retrieveOAuthValues({ ssmClient, cognitoIdpClient, oAuthParameter, userPoolId, appId, environmentName, }) {
19
15
  const value = oAuthParameter.ParameterValue;
20
- (0, node_assert_1.default)(value);
16
+ if (!value) {
17
+ throw new amplify_cli_core_1.AmplifyError('MissingExpectedParameterError', {
18
+ message: "OAuth parameter 'hostedUIProviderMeta' has no value",
19
+ });
20
+ }
21
21
  const parsedValue = JSON.parse(value);
22
22
  if (!Array.isArray(parsedValue) || parsedValue.length === 0) {
23
- throw new Error(INVALID_OAUTH_GEN1_PROVIDER_METADATA_ERROR);
23
+ throw new amplify_cli_core_1.AmplifyError('InputValidationError', {
24
+ message: "OAuth parameter 'hostedUIProviderMeta' must be a non-empty array of provider metadata",
25
+ });
24
26
  }
25
- const oAuthClientValues = [];
27
+ const oAuthClients = [];
26
28
  for (const provider of parsedValue) {
27
29
  if (!isHostedProviderMetadata(provider)) {
28
- throw new Error(INVALID_OAUTH_GEN1_PROVIDER_METADATA_ERROR);
30
+ throw new amplify_cli_core_1.AmplifyError('InputValidationError', {
31
+ message: `Invalid OAuth provider metadata: ${JSON.stringify(provider)}`,
32
+ });
29
33
  }
30
34
  const { ProviderName } = provider;
31
- const { IdentityProvider } = await cognitoIdpClient.send(new client_cognito_identity_provider_1.DescribeIdentityProviderCommand({
32
- UserPoolId: userPoolId,
33
- ProviderName,
34
- }));
35
+ const { IdentityProvider } = await cognitoIdpClient.send(new client_cognito_identity_provider_1.DescribeIdentityProviderCommand({ UserPoolId: userPoolId, ProviderName }));
35
36
  const providerDetails = IdentityProvider === null || IdentityProvider === void 0 ? void 0 : IdentityProvider.ProviderDetails;
36
- (0, node_assert_1.default)(providerDetails);
37
+ if (!providerDetails) {
38
+ throw new amplify_cli_core_1.AmplifyError('ResourceNotReadyError', {
39
+ message: `OAuth provider '${ProviderName}' returned no provider details from Cognito`,
40
+ });
41
+ }
37
42
  const { client_id, client_secret, team_id, key_id } = providerDetails;
38
- (0, node_assert_1.default)(client_id);
43
+ if (!client_id) {
44
+ throw new amplify_cli_core_1.AmplifyError('MissingExpectedParameterError', {
45
+ message: `OAuth provider '${ProviderName}' has no client_id in Cognito provider details`,
46
+ });
47
+ }
39
48
  if (ProviderName === 'SignInWithApple') {
40
- (0, node_assert_1.default)(team_id);
41
- (0, node_assert_1.default)(key_id);
42
- const { Parameter: PrivateKeyParameter } = await ssmClient.send(new client_ssm_1.GetParameterCommand({
43
- Name: (0, exports.constructSignInWithApplePrivateKeyParamName)(appId, environmentName),
49
+ if (!team_id || !key_id) {
50
+ throw new amplify_cli_core_1.AmplifyError('MissingExpectedParameterError', {
51
+ message: `SignInWithApple provider is missing team_id or key_id in Cognito provider details`,
52
+ });
53
+ }
54
+ const { Parameter: privateKeyParam } = await ssmClient.send(new client_ssm_1.GetParameterCommand({
55
+ Name: constructSignInWithApplePrivateKeyParamName(appId, environmentName),
44
56
  WithDecryption: true,
45
57
  }));
46
- (0, node_assert_1.default)(PrivateKeyParameter);
47
- const privateKey = PrivateKeyParameter.Value;
48
- (0, node_assert_1.default)(privateKey);
49
- oAuthClientValues.push({
50
- ProviderName,
51
- client_id,
52
- team_id,
53
- key_id,
54
- private_key: privateKey,
55
- });
58
+ const privateKey = privateKeyParam === null || privateKeyParam === void 0 ? void 0 : privateKeyParam.Value;
59
+ if (!privateKey) {
60
+ throw new amplify_cli_core_1.AmplifyError('ParameterNotFoundError', {
61
+ message: `SignInWithApple private key not found in SSM at '${constructSignInWithApplePrivateKeyParamName(appId, environmentName)}'`,
62
+ });
63
+ }
64
+ oAuthClients.push({ ProviderName, client_id, team_id, key_id, private_key: privateKey });
56
65
  }
57
66
  else {
58
- (0, node_assert_1.default)(client_secret);
59
- oAuthClientValues.push({
60
- ProviderName,
61
- client_id,
62
- client_secret,
63
- });
67
+ if (!client_secret) {
68
+ throw new amplify_cli_core_1.AmplifyError('MissingExpectedParameterError', {
69
+ message: `OAuth provider '${ProviderName}' has no client_secret in Cognito provider details`,
70
+ });
71
+ }
72
+ oAuthClients.push({ ProviderName, client_id, client_secret });
64
73
  }
65
74
  }
66
- return oAuthClientValues;
67
- };
68
- exports.default = retrieveOAuthValues;
75
+ return oAuthClients;
76
+ }
69
77
  //# sourceMappingURL=oauth-values-retriever.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"oauth-values-retriever.js","sourceRoot":"","sources":["../../../../src/commands/gen2-migration/refactor/oauth-values-retriever.ts"],"names":[],"mappings":";;;;;;AAAA,8DAAiC;AACjC,oDAAqE;AACrE,gGAA2H;AAI3H,MAAM,0CAA0C,GAAG,sCAAsC,CAAC;AAE1F,MAAM,wBAAwB,GAAG,CAAC,WAAoB,EAAuC,EAAE;IAC7F,OAAO,OAAO,WAAW,KAAK,QAAQ,IAAI,WAAW,KAAK,IAAI,IAAI,cAAc,IAAI,WAAW,CAAC;AAClG,CAAC,CAAC;AAEK,MAAM,2CAA2C,GAAG,CAAC,KAAa,EAAE,WAAmB,EAAU,EAAE;IACxG,OAAO,YAAY,KAAK,IAAI,WAAW,2BAA2B,CAAC;AACrE,CAAC,CAAC;AAFW,QAAA,2CAA2C,+CAEtD;AAoBF,MAAM,mBA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,MAAM,EAAE,SAAS,EAAE,mBAAmB,EAAE,GAAG,MAAM,SAAS,CAAC,IAAI,CAC7D,IAAI,gCAAmB,CAAC;gBACtB,IAAI,EAAE,IAAA,mDAA2C,EAAC,KAAK,EAAE,eAAe,CAAC;gBACzE,cAAc,EAAE,IAAI;aACrB,CAAC,CACH,CAAC;YACF,IAAA,qBAAM,EAAC,mBAAmB,CAAC,CAAC;YAC5B,MAAM,UAAU,GAAG,mBAAmB,CAAC,KAAK,CAAC;YAC7C,IAAA,qBAAM,EAAC,UAAU,CAAC,CAAC;YACnB,iBAAiB,CAAC,IAAI,CAAC;gBACrB,YAAY;gBACZ,SAAS;gBACT,OAAO;gBACP,MAAM;gBACN,WAAW,EAAE,UAAU;aACxB,CAAC,CAAC;QACL,CAAC;aAAM,CAAC;YACN,IAAA,qBAAM,EAAC,aAAa,CAAC,CAAC;YACtB,iBAAiB,CAAC,IAAI,CAAC;gBACrB,YAAY;gBACZ,SAAS;gBACT,aAAa;aACd,CAAC,CAAC;QACL,CAAC;IACH,CAAC;IACD,OAAO,iBAAiB,CAAC;AAC3B,CAAC,CAAC;AAEF,kBAAe,mBAAmB,CAAC"}
1
+ {"version":3,"file":"oauth-values-retriever.js","sourceRoot":"","sources":["../../../../src/commands/gen2-migration/refactor/oauth-values-retriever.ts"],"names":[],"mappings":";;AAqBA,kGAEC;AAcD,kDA+EC;AApHD,oDAAqE;AACrE,gGAA2H;AAE3H,oEAA6D;AAW7D,MAAM,wBAAwB,GAAG,CAAC,KAAc,EAAiC,EAAE;IACjF,OAAO,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,KAAK,IAAI,IAAI,cAAc,IAAI,KAAK,CAAC;AAChF,CAAC,CAAC;AAKF,SAAgB,2CAA2C,CAAC,KAAa,EAAE,WAAmB;IAC5F,OAAO,YAAY,KAAK,IAAI,WAAW,2BAA2B,CAAC;AACrE,CAAC;AAcM,KAAK,UAAU,mBAAmB,CAAC,EACxC,SAAS,EACT,gBAAgB,E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AE,YAAY,EAAE,SAAS,EAAE,aAAa,EAAE,CAAC,CAAC;QAChE,CAAC;IACH,CAAC;IAED,OAAO,YAAY,CAAC;AACtB,CAAC"}
@@ -1,13 +1,4 @@
1
- import { CFNTemplate } from '../types';
2
1
  import { Parameter } from '@aws-sdk/client-cloudformation';
3
- declare class CFNConditionResolver {
4
- private readonly template;
5
- private readonly conditions;
6
- constructor(template: CFNTemplate);
7
- resolve(parameters: Parameter[]): CFNTemplate;
8
- private resolveCondition;
9
- private resolveConditionInResources;
10
- private resolveIfCondition;
11
- }
12
- export default CFNConditionResolver;
2
+ import { CFNTemplate } from '../../_infra/cfn-template';
3
+ export declare function resolveConditions(template: CFNTemplate, parameters: Parameter[]): CFNTemplate;
13
4
  //# sourceMappingURL=cfn-condition-resolver.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"cfn-condition-resolver.d.ts","sourceRoot":"","sources":["../../../../../src/commands/gen2-migration/refactor/resolvers/cfn-condition-resolver.ts"],"names":[],"mappings":"AAAA,OAAO,EAAiF,WAAW,EAAE,MAAM,UAAU,CAAC;AAEtH,OAAO,EAAE,SAAS,EAAE,MAAM,gCAAgC,CAAC;AAO3D,cAAM,oBAAoB;IAEZ,OAAO,CAAC,QAAQ,CAAC,QAAQ;IADrC,OAAO,CAAC,QAAQ,CAAC,UAAU,CAAmD;gBACjD,QAAQ,EAAE,WAAW;IAI3C,OAAO,CAAC,UAAU,EAAE,SAAS,EAAE;IAoBtC,OAAO,CAAC,gBAAgB;IA4FxB,OAAO,CAAC,2BAA2B;IA0BnC,OAAO,CAAC,kBAAkB;CAY3B;AAED,eAAe,oBAAoB,CAAC"}
1
+ {"version":3,"file":"cfn-condition-resolver.d.ts","sourceRoot":"","sources":["../../../../../src/commands/gen2-migration/refactor/resolvers/cfn-condition-resolver.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,gCAAgC,CAAC;AAE3D,OAAO,EAAoE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AAe1H,wBAAgB,iBAAiB,CAAC,QAAQ,EAAE,WAAW,EAAE,UAAU,EAAE,SAAS,EAAE,GAAG,WAAW,CA4C7F"}
@@ -1,137 +1,103 @@
1
1
  "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
2
  Object.defineProperty(exports, "__esModule", { value: true });
6
- const types_1 = require("../types");
7
- const node_assert_1 = __importDefault(require("node:assert"));
8
- class CFNConditionResolver {
9
- constructor(template) {
10
- this.template = template;
11
- this.conditions = template.Conditions;
3
+ exports.resolveConditions = resolveConditions;
4
+ const amplify_cli_core_1 = require("@aws-amplify/amplify-cli-core");
5
+ const cfn_template_1 = require("../../_infra/cfn-template");
6
+ function resolveConditions(template, parameters) {
7
+ const conditions = template.Conditions;
8
+ if (!conditions || Object.keys(conditions).length === 0)
9
+ return template;
10
+ const conditionValues = new Map();
11
+ for (const [conditionKey, conditionDef] of Object.entries(conditions)) {
12
+ const fnType = Object.keys(conditionDef)[0];
13
+ if (!Object.values(cfn_template_1.CFNFunction).includes(fnType))
14
+ continue;
15
+ const statements = conditionDef[fnType];
16
+ if ((fnType === cfn_template_1.CFNFunction.Or || fnType === cfn_template_1.CFNFunction.And) && statements.length > 2) {
17
+ throw new amplify_cli_core_1.AmplifyError('CloudFormationTemplateError', {
18
+ message: `${fnType} with ${statements.length} operands is not supported (condition '${conditionKey}'). Only 2 operands are handled.`,
19
+ });
20
+ }
21
+ const [left, right] = statements;
22
+ conditionValues.set(conditionKey, evaluateCondition(conditions, left, right, parameters, fnType));
12
23
  }
13
- resolve(parameters) {
14
- if (!this.conditions || Object.keys(this.conditions).length === 0)
15
- return this.template;
16
- const clonedTemplate = JSON.parse(JSON.stringify(this.template));
17
- const conditionValueMap = new Map();
18
- Object.entries(this.conditions).forEach(([conditionKey, conditionValue]) => {
19
- const fnType = Object.keys(conditionValue)[0];
20
- if (Object.values(types_1.CFNFunction).includes(fnType)) {
21
- const conditionStatements = conditionValue[fnType];
22
- const [leftStatement, rightStatement] = conditionStatements;
23
- const result = this.resolveCondition(leftStatement, rightStatement, parameters, fnType);
24
- conditionValueMap.set(conditionKey, result);
24
+ const resolved = JSON.parse(JSON.stringify(template));
25
+ for (const [, resource] of Object.entries(resolved.Resources)) {
26
+ for (const [propName, propValue] of Object.entries(resource.Properties)) {
27
+ if (typeof propValue === 'object' && propValue !== null && !Array.isArray(propValue)) {
28
+ resource.Properties[propName] = resolveIfCondition(propValue, conditionValues);
29
+ }
30
+ else if (Array.isArray(propValue)) {
31
+ resource.Properties[propName] = propValue.map((item) => typeof item === 'object' && item !== null ? resolveIfCondition(item, conditionValues) : item);
25
32
  }
26
- });
27
- this.resolveConditionInResources(clonedTemplate.Resources, conditionValueMap);
28
- return clonedTemplate;
29
- }
30
- resolveCondition(leftStatement, rightStatement, params, fnType) {
31
- var _a, _b;
32
- (0, node_assert_1.default)(this.conditions);
33
- let resolvedLeftStatement;
34
- let resolvedRightStatement;
35
- if (typeof leftStatement !== 'object') {
36
- resolvedLeftStatement = leftStatement;
37
- }
38
- if (typeof rightStatement !== 'object') {
39
- resolvedRightStatement = rightStatement;
40
- }
41
- if (typeof leftStatement === 'object' && 'Condition' in leftStatement) {
42
- const nestedConditionName = leftStatement.Condition;
43
- const nestedCondition = this.conditions[nestedConditionName];
44
- const nestedFnType = Object.keys(nestedCondition)[0];
45
- const [nestedLeftStatement, nestedRightStatement] = nestedCondition[nestedFnType];
46
- resolvedLeftStatement = this.resolveCondition(nestedLeftStatement, nestedRightStatement, params, nestedFnType);
47
- }
48
- if (typeof rightStatement === 'object' && 'Condition' in rightStatement) {
49
- const nestedConditionName = rightStatement.Condition;
50
- const nestedCondition = this.conditions[nestedConditionName];
51
- const nestedFnType = Object.keys(nestedCondition)[0];
52
- const [nestedLeftStatement, nestedRightStatement] = nestedCondition[nestedFnType];
53
- resolvedRightStatement = this.resolveCondition(nestedLeftStatement, nestedRightStatement, params, nestedFnType);
54
- }
55
- if (typeof leftStatement === 'object' && Object.values(types_1.CFNFunction).includes(Object.keys(leftStatement)[0])) {
56
- const nestedCondition = leftStatement;
57
- const nestedFnType = Object.keys(nestedCondition)[0];
58
- const [nestedLeftStatement, nestedRightStatement] = nestedCondition[nestedFnType];
59
- resolvedLeftStatement = this.resolveCondition(nestedLeftStatement, nestedRightStatement, params, nestedFnType);
60
- }
61
- if (typeof rightStatement === 'object' && Object.values(types_1.CFNFunction).includes(Object.keys(rightStatement)[0])) {
62
- const nestedCondition = rightStatement;
63
- const nestedFnType = Object.keys(nestedCondition)[0];
64
- const [nestedLeftStatement, nestedRightStatement] = nestedCondition[nestedFnType];
65
- resolvedRightStatement = this.resolveCondition(nestedLeftStatement, nestedRightStatement, params, nestedFnType);
66
- }
67
- if (typeof leftStatement === 'object' && 'Ref' in leftStatement) {
68
- const parameterKey = leftStatement.Ref;
69
- const value = (_a = params.find((p) => p.ParameterKey === parameterKey)) === null || _a === void 0 ? void 0 : _a.ParameterValue;
70
- (0, node_assert_1.default)(value);
71
- resolvedLeftStatement = value;
72
33
  }
73
- if (rightStatement && typeof rightStatement === 'object' && 'Ref' in rightStatement) {
74
- const parameterKey = rightStatement.Ref;
75
- const value = (_b = params.find((p) => p.ParameterKey === parameterKey)) === null || _b === void 0 ? void 0 : _b.ParameterValue;
76
- (0, node_assert_1.default)(value);
77
- resolvedRightStatement = value;
34
+ }
35
+ for (const [logicalId, resource] of Object.entries(resolved.Resources)) {
36
+ const condition = resource.Condition;
37
+ if (condition && conditionValues.has(condition) && !conditionValues.get(condition)) {
38
+ delete resolved.Resources[logicalId];
78
39
  }
79
- let result;
80
- switch (fnType) {
81
- case types_1.CFNFunction.Equals:
82
- result = resolvedLeftStatement === resolvedRightStatement;
83
- break;
84
- case types_1.CFNFunction.Not:
85
- result = !resolvedLeftStatement;
86
- break;
87
- case types_1.CFNFunction.Or:
88
- result = !!(resolvedLeftStatement || resolvedRightStatement);
89
- break;
90
- case types_1.CFNFunction.And:
91
- result = !!(resolvedLeftStatement && resolvedRightStatement);
92
- break;
93
- default:
94
- throw new Error(`Invalid ${fnType} condition`);
40
+ }
41
+ return resolved;
42
+ }
43
+ function resolveStatement(conditions, statement, parameters) {
44
+ var _a;
45
+ if (typeof statement !== 'object')
46
+ return statement;
47
+ const record = statement;
48
+ if ('Condition' in record) {
49
+ const nestedName = record.Condition;
50
+ const nestedDef = conditions[nestedName];
51
+ const nestedFnType = Object.keys(nestedDef)[0];
52
+ const nestedStatements = nestedDef[nestedFnType];
53
+ return evaluateCondition(conditions, nestedStatements[0], nestedStatements[1], parameters, nestedFnType);
54
+ }
55
+ const fnKey = Object.keys(record).find((k) => Object.values(cfn_template_1.CFNFunction).includes(k));
56
+ if (fnKey) {
57
+ const nestedStatements = record[fnKey];
58
+ return evaluateCondition(conditions, nestedStatements[0], nestedStatements[1], parameters, fnKey);
59
+ }
60
+ if ('Ref' in record) {
61
+ const paramKey = record.Ref;
62
+ const value = (_a = parameters.find((p) => p.ParameterKey === paramKey)) === null || _a === void 0 ? void 0 : _a.ParameterValue;
63
+ if (value === undefined) {
64
+ throw new amplify_cli_core_1.AmplifyError('MissingExpectedParameterError', {
65
+ message: `Condition references parameter '${paramKey}' but no value was provided`,
66
+ });
95
67
  }
96
- return result;
68
+ return value;
97
69
  }
98
- resolveConditionInResources(resources, conditionValueMap) {
99
- Object.entries(resources).forEach(([logicalId, value]) => {
100
- const condition = value.Condition;
101
- if (condition && conditionValueMap.has(condition)) {
102
- const result = conditionValueMap.get(condition);
103
- if (!result) {
104
- delete resources[logicalId];
105
- }
106
- }
107
- const props = value.Properties;
108
- Object.entries(props).forEach(([propName, propValue]) => {
109
- if (typeof propValue === 'object') {
110
- props[propName] = this.resolveIfCondition(propValue, conditionValueMap);
111
- }
112
- else if (Array.isArray(propValue)) {
113
- propValue.forEach((item, index) => {
114
- if (typeof item === 'object') {
115
- propValue[index] = this.resolveIfCondition(item, conditionValueMap);
116
- }
117
- });
118
- }
70
+ throw new amplify_cli_core_1.AmplifyError('CloudFormationTemplateError', {
71
+ message: `Unsupported condition statement: ${JSON.stringify(statement)}`,
72
+ });
73
+ }
74
+ function evaluateCondition(conditions, left, right, parameters, fnType) {
75
+ const resolvedLeft = resolveStatement(conditions, left, parameters);
76
+ const resolvedRight = right !== undefined ? resolveStatement(conditions, right, parameters) : undefined;
77
+ switch (fnType) {
78
+ case cfn_template_1.CFNFunction.Equals:
79
+ return resolvedLeft === resolvedRight;
80
+ case cfn_template_1.CFNFunction.Not:
81
+ return !resolvedLeft;
82
+ case cfn_template_1.CFNFunction.Or:
83
+ return !!(resolvedLeft || resolvedRight);
84
+ case cfn_template_1.CFNFunction.And:
85
+ return !!(resolvedLeft && resolvedRight);
86
+ default:
87
+ throw new amplify_cli_core_1.AmplifyError('CloudFormationTemplateError', {
88
+ message: `Unsupported condition function: ${fnType}`,
119
89
  });
120
- });
121
- return resources;
122
90
  }
123
- resolveIfCondition(propValue, conditionValueMap) {
124
- let result = propValue;
125
- if (types_1.CFNFunction.If in propValue) {
126
- const ifCondition = propValue[types_1.CFNFunction.If];
127
- const conditionName = ifCondition[0];
128
- if (conditionValueMap.has(conditionName)) {
129
- const conditionValue = conditionValueMap.get(conditionName);
130
- result = conditionValue ? ifCondition[1] : ifCondition[2];
131
- }
91
+ }
92
+ function resolveIfCondition(propValue, conditionValues) {
93
+ const record = propValue;
94
+ if (cfn_template_1.CFNFunction.If in record) {
95
+ const ifCondition = record[cfn_template_1.CFNFunction.If];
96
+ const conditionName = ifCondition[0];
97
+ if (conditionValues.has(conditionName)) {
98
+ return (conditionValues.get(conditionName) ? ifCondition[1] : ifCondition[2]);
132
99
  }
133
- return result;
134
100
  }
101
+ return propValue;
135
102
  }
136
- exports.default = CFNConditionResolver;
137
103
  //# sourceMappingURL=cfn-condition-resolver.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"cfn-condition-resolver.js","sourceRoot":"","sources":["../../../../../src/commands/gen2-migration/refactor/resolvers/cfn-condition-resolver.ts"],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,EAAE,IAAI,SAAS,EAAE,CAAC;YAChC,MAAM,WAAW,GAAG,SAAS,CAAC,mBAAW,CAAC,EAAE,CAA6B,CAAC;YAC1E,MAAM,aAAa,GAAG,WAAW,CAAC,CAAC,CAAC,CAAC;YACrC,IAAI,iBAAiB,CAAC,GAAG,CAAC,aAAa,CAAC,EAAE,CAAC;gBACzC,MAAM,cAAc,GAAG,iBAAiB,CAAC,GAAG,CAAC,aAAa,CAAC,CAAC;gBAC5D,MAAM,GAAG,cAAc,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC;YAC5D,CAAC;QACH,CAAC;QACD,OAAO,MAAM,CAAC;IAChB,CAAC;CACF;AAED,kBAAe,oBAAoB,CAAC"}
1
+ {"version":3,"file":"cfn-condition-resolver.js","sourceRoot":"","sources":["../../../../../src/commands/gen2-migration/refactor/resolvers/cfn-condition-resolver.ts"],"names":[],"mappings":";;AAiBA,8CA4CC;AA5DD,oEAA6D;AAC7D,4DAA0H;AAe1H,SAAgB,iBAAiB,CAAC,QAAqB,EAAE,UAAuB;IAC9E,MAAM,UAAU,GAAG,QAAQ,CAAC,UAAU,CAAC;IACvC,IAAI,CAAC,UAAU,IAAI,MAAM,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO,QAAQ,CAAC;IAGzE,MAAM,eAAe,GAAG,IAAI,GAAG,EAAmB,CAAC;IACnD,KAAK,MAAM,CAAC,YAAY,EAAE,YAAY,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,UAAU,CAAC,EAAE,CAAC;QACtE,MAAM,MAAM,GAAG,MAAM,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC,CAAC,CAAgB,CAAC;QAC3D,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,0BAAW,CAAC,CAAC,QAAQ,CAAC,MAAM,CAAC;YAAE,SAAS;QAE3D,MAAM,UAAU,GAA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AU,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;IAExG,QAAQ,MAAM,EAAE,CAAC;QACf,KAAK,0BAAW,CAAC,MAAM;YACrB,OAAO,YAAY,KAAK,aAAa,CAAC;QACxC,KAAK,0BAAW,CAAC,GAAG;YAClB,OAAO,CAAC,YAAY,CAAC;QACvB,KAAK,0BAAW,CAAC,EAAE;YACjB,OAAO,CAAC,CAAC,CAAC,YAAY,IAAI,aAAa,CAAC,CAAC;QAC3C,KAAK,0BAAW,CAAC,GAAG;YAClB,OAAO,CAAC,CAAC,CAAC,YAAY,IAAI,aAAa,CAAC,CAAC;QAC3C;YACE,MAAM,IAAI,+BAAY,CAAC,6BAA6B,EAAE;gBACpD,OAAO,EAAE,mCAAmC,MAAM,EAAE;aACrD,CAAC,CAAC;IACP,CAAC;AACH,CAAC;AAMD,SAAS,kBAAkB,CAAC,SAAiB,EAAE,eAAqC;IAClF,MAAM,MAAM,GAAG,SAAoC,CAAC;IACpD,IAAI,0BAAW,CAAC,EAAE,IAAI,MAAM,EAAE,CAAC;QAC7B,MAAM,WAAW,GAAG,MAAM,CAAC,0BAAW,CAAC,EAAE,CAA+B,CAAC;QACzE,MAAM,aAAa,GAAG,WAAW,CAAC,CAAC,CAAC,CAAC;QACrC,IAAI,eAAe,CAAC,GAAG,CAAC,aAAa,CAAC,EAAE,CAAC;YACvC,OAAO,CAAC,eAAe,CAAC,GAAG,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,CAAW,CAAC;QAC1F,CAAC;IACH,CAAC;IACD,OAAO,SAAS,CAAC;AACnB,CAAC"}
@@ -1,8 +1,3 @@
1
- import { CFNTemplate } from '../types';
2
- declare class CfnDependencyResolver {
3
- private readonly template;
4
- constructor(template: CFNTemplate);
5
- resolve(resourcesToRefactor: string[]): CFNTemplate;
6
- }
7
- export default CfnDependencyResolver;
1
+ import { CFNTemplate } from '../../_infra/cfn-template';
2
+ export declare function resolveDependencies(template: CFNTemplate): CFNTemplate;
8
3
  //# sourceMappingURL=cfn-dependency-resolver.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"cfn-dependency-resolver.d.ts","sourceRoot":"","sources":["../../../../../src/commands/gen2-migration/refactor/resolvers/cfn-dependency-resolver.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AAEvC,cAAM,qBAAqB;IACb,OAAO,CAAC,QAAQ,CAAC,QAAQ;gBAAR,QAAQ,EAAE,WAAW;IAE3C,OAAO,CAAC,mBAAmB,EAAE,MAAM,EAAE;CAqB7C;AAED,eAAe,qBAAqB,CAAC"}
1
+ {"version":3,"file":"cfn-dependency-resolver.d.ts","sourceRoot":"","sources":["../../../../../src/commands/gen2-migration/refactor/resolvers/cfn-dependency-resolver.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AAQxD,wBAAgB,mBAAmB,CAAC,QAAQ,EAAE,WAAW,GAAG,WAAW,CAQtE"}
@@ -1,27 +1,11 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- class CfnDependencyResolver {
4
- constructor(template) {
5
- this.template = template;
6
- }
7
- resolve(resourcesToRefactor) {
8
- const clonedGen1Template = JSON.parse(JSON.stringify(this.template));
9
- const resources = clonedGen1Template.Resources;
10
- Object.entries(resources).forEach(([logicalResourceId, resource]) => {
11
- if (resource === null || resource === void 0 ? void 0 : resource.DependsOn) {
12
- const deps = Array.isArray(resource.DependsOn) ? resource.DependsOn : [resource.DependsOn];
13
- const depsInRefactor = deps.filter((dep) => resourcesToRefactor.includes(dep));
14
- if (depsInRefactor.length > 0 && !resourcesToRefactor.includes(logicalResourceId)) {
15
- const filteredDeps = deps.filter((dep) => !resourcesToRefactor.includes(dep));
16
- resource.DependsOn = filteredDeps;
17
- }
18
- else if (resourcesToRefactor.includes(logicalResourceId) && deps.length > depsInRefactor.length) {
19
- resource.DependsOn = depsInRefactor;
20
- }
21
- }
22
- });
23
- return clonedGen1Template;
3
+ exports.resolveDependencies = resolveDependencies;
4
+ function resolveDependencies(template) {
5
+ const cloned = JSON.parse(JSON.stringify(template));
6
+ for (const resource of Object.values(cloned.Resources)) {
7
+ delete resource.DependsOn;
24
8
  }
9
+ return cloned;
25
10
  }
26
- exports.default = CfnDependencyResolver;
27
11
  //# sourceMappingURL=cfn-dependency-resolver.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"cfn-dependency-resolver.js","sourceRoot":"","sources":["../../../../../src/commands/gen2-migration/refactor/resolvers/cfn-dependency-resolver.ts"],"names":[],"mappings":";;AAEA,MAAM,qBAAqB;IACzB,YAA6B,QAAqB;QAArB,aAAQ,GAAR,QAAQ,CAAa;IAAG,CAAC;IAE/C,OAAO,CAAC,mBAA6B;QAC1C,MAAM,kBAAkB,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAgB,CAAC;QACpF,MAAM,SAAS,GAAG,kBAAkB,CAAC,SAAS,CAAC;QAC/C,MAAM,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,iBAAiB,EAAE,QAAQ,CAAC,EAAE,EAAE;YAClE,IAAI,QAAQ,aAAR,QAAQ,uBAAR,QAAQ,CAAE,SAAS,EAAE,CAAC;gBAExB,MAAM,IAAI,GAAG,KAAK,CAAC,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,SAAS,CAAC,CAAC;gBAC3F,MAAM,cAAc,GAAG,IAAI,CAAC,MAAM,CAAC,CAAC,GAAW,EAAE,EAAE,CAAC,mBAAmB,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC;gBAEvF,IAAI,cAAc,CAAC,MAAM,GAAG,CAAC,IAAI,CAAC,mBAAmB,CAAC,QAAQ,CAAC,iBAAiB,CAAC,EAAE,CAAC;oBAClF,MAAM,YAAY,GAAG,IAAI,CAAC,MAAM,CAAC,CAAC,GAAW,EAAE,EAAE,CAAC,CAAC,mBAAmB,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC;oBACtF,QAAQ,CAAC,SAAS,GAAG,YAAY,CAAC;gBACpC,CAAC;qBAEI,IAAI,mBAAmB,CAAC,QAAQ,CAAC,iBAAiB,CAAC,IAAI,IAAI,CAAC,MAAM,GAAG,cAAc,CAAC,MAAM,EAAE,CAAC;oBAChG,QAAQ,CAAC,SAAS,GAAG,cAAc,CAAC;gBACtC,CAAC;YACH,CAAC;QACH,CAAC,CAAC,CAAC;QACH,OAAO,kBAAkB,CAAC;IAC5B,CAAC;CACF;AAED,kBAAe,qBAAqB,CAAC"}
1
+ {"version":3,"file":"cfn-dependency-resolver.js","sourceRoot":"","sources":["../../../../../src/commands/gen2-migration/refactor/resolvers/cfn-dependency-resolver.ts"],"names":[],"mappings":";;AAQA,kDAQC;AARD,SAAgB,mBAAmB,CAAC,QAAqB;IACvD,MAAM,MAAM,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC,QAAQ,CAAC,CAAgB,CAAC;IAEnE,KAAK,MAAM,QAAQ,IAAI,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,SAAS,CAAC,EAAE,CAAC;QACvD,OAAO,QAAQ,CAAC,SAAS,CAAC;IAC5B,CAAC;IAED,OAAO,MAAM,CAAC;AAChB,CAAC"}
@@ -1,14 +1,10 @@
1
- import { CFNTemplate } from '../types';
2
1
  import { Output, StackResource } from '@aws-sdk/client-cloudformation';
3
- declare class CfnOutputResolver {
4
- private readonly template;
5
- private readonly region;
6
- private readonly accountId;
7
- constructor(template: CFNTemplate, region: string, accountId: string);
8
- resolve(logicalResourceIds: string[], stackOutputs: Output[], stackResources: StackResource[]): CFNTemplate;
9
- private tryReplaceLogicalResourceRefWithPhysicalId;
10
- private getResourceAttribute;
11
- private buildFnGetAttReplace;
12
- }
13
- export default CfnOutputResolver;
2
+ import { CFNTemplate } from '../../_infra/cfn-template';
3
+ export declare function resolveOutputs(params: {
4
+ readonly template: CFNTemplate;
5
+ readonly stackOutputs: Output[];
6
+ readonly stackResources: StackResource[];
7
+ readonly region: string;
8
+ readonly accountId: string;
9
+ }): CFNTemplate;
14
10
  //# sourceMappingURL=cfn-output-resolver.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"cfn-output-resolver.d.ts","sourceRoot":"","sources":["../../../../../src/commands/gen2-migration/refactor/resolvers/cfn-output-resolver.ts"],"names":[],"mappings":"AAAA,OAAO,EAA+C,WAAW,EAAE,MAAM,UAAU,CAAC;AAEpF,OAAO,EAAE,MAAM,EAAE,aAAa,EAAE,MAAM,gCAAgC,CAAC;AASvE,cAAM,iBAAiB;IACT,OAAO,CAAC,QAAQ,CAAC,QAAQ;IAAe,OAAO,CAAC,QAAQ,CAAC,MAAM;IAAU,OAAO,CAAC,QAAQ,CAAC,SAAS;gBAAlF,QAAQ,EAAE,WAAW,EAAmB,MAAM,EAAE,MAAM,EAAmB,SAAS,EAAE,MAAM;IAEhH,OAAO,CAAC,kBAAkB,EAAE,MAAM,EAAE,EAAE,YAAY,EAAE,MAAM,EAAE,EAAE,cAAc,EAAE,aAAa,EAAE,GAAG,WAAW;IAoElH,OAAO,CAAC,0CAA0C;IAkDlD,OAAO,CAAC,oBAAoB;IAiD5B,OAAO,CAAC,oBAAoB;CAI7B;AAED,eAAe,iBAAiB,CAAC"}
1
+ {"version":3,"file":"cfn-output-resolver.d.ts","sourceRoot":"","sources":["../../../../../src/commands/gen2-migration/refactor/resolvers/cfn-output-resolver.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,aAAa,EAAE,MAAM,gCAAgC,CAAC;AAEvE,OAAO,EAAe,WAAW,EAAE,MAAM,2BAA2B,CAAC;AAgBrE,wBAAgB,cAAc,CAAC,MAAM,EAAE;IACrC,QAAQ,CAAC,QAAQ,EAAE,WAAW,CAAC;IAC/B,QAAQ,CAAC,YAAY,EAAE,MAAM,EAAE,CAAC;IAChC,QAAQ,CAAC,cAAc,EAAE,aAAa,EAAE,CAAC;IACzC,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;CAC5B,GAAG,WAAW,CA2Fd"}