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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (704) hide show
  1. package/CHANGELOG.md +16 -0
  2. package/adr/001-refactor-gen2-migration-generate.md +413 -0
  3. package/adr/002-refactor-gen2-migration-refactor.md +593 -0
  4. package/adr/003-gen2-migration-assess.md +414 -0
  5. package/adr/004-gen2-migration-validation-modeling.md +336 -0
  6. package/aws-amplify-cli-internal-gen2-migration-experimental-alpha-0.7.0.tgz +0 -0
  7. package/bin/amplify +1 -1
  8. package/lib/commands/drift-detection/detect-local-drift.d.ts +1 -2
  9. package/lib/commands/drift-detection/detect-local-drift.d.ts.map +1 -1
  10. package/lib/commands/drift-detection/detect-local-drift.js +19 -6
  11. package/lib/commands/drift-detection/detect-local-drift.js.map +1 -1
  12. package/lib/commands/drift-detection/detect-stack-drift.d.ts +20 -9
  13. package/lib/commands/drift-detection/detect-stack-drift.d.ts.map +1 -1
  14. package/lib/commands/drift-detection/detect-stack-drift.js +121 -151
  15. package/lib/commands/drift-detection/detect-stack-drift.js.map +1 -1
  16. package/lib/commands/drift-detection/detect-template-drift.d.ts +8 -21
  17. package/lib/commands/drift-detection/detect-template-drift.d.ts.map +1 -1
  18. package/lib/commands/drift-detection/detect-template-drift.js +81 -89
  19. package/lib/commands/drift-detection/detect-template-drift.js.map +1 -1
  20. package/lib/commands/drift-detection/index.d.ts +2 -3
  21. package/lib/commands/drift-detection/index.d.ts.map +1 -1
  22. package/lib/commands/drift-detection/index.js +1 -3
  23. package/lib/commands/drift-detection/index.js.map +1 -1
  24. package/lib/commands/drift-detection/services/amplify-config-service.d.ts +0 -1
  25. package/lib/commands/drift-detection/services/amplify-config-service.d.ts.map +1 -1
  26. package/lib/commands/drift-detection/services/amplify-config-service.js +0 -16
  27. package/lib/commands/drift-detection/services/amplify-config-service.js.map +1 -1
  28. package/lib/commands/drift-detection/services/cloudformation-service.d.ts +2 -4
  29. package/lib/commands/drift-detection/services/cloudformation-service.d.ts.map +1 -1
  30. package/lib/commands/drift-detection/services/cloudformation-service.js +7 -11
  31. package/lib/commands/drift-detection/services/cloudformation-service.js.map +1 -1
  32. package/lib/commands/drift-detection/services/drift-formatter.d.ts +3 -70
  33. package/lib/commands/drift-detection/services/drift-formatter.d.ts.map +1 -1
  34. package/lib/commands/drift-detection/services/drift-formatter.js +148 -603
  35. package/lib/commands/drift-detection/services/drift-formatter.js.map +1 -1
  36. package/lib/commands/drift-detection/services/index.d.ts +1 -2
  37. package/lib/commands/drift-detection/services/index.d.ts.map +1 -1
  38. package/lib/commands/drift-detection/services/index.js +2 -4
  39. package/lib/commands/drift-detection/services/index.js.map +1 -1
  40. package/lib/commands/drift.d.ts +7 -18
  41. package/lib/commands/drift.d.ts.map +1 -1
  42. package/lib/commands/drift.js +71 -172
  43. package/lib/commands/drift.js.map +1 -1
  44. package/lib/commands/gen2-migration/_infra/aws-clients.d.ts +31 -0
  45. package/lib/commands/gen2-migration/_infra/aws-clients.d.ts.map +1 -0
  46. package/lib/commands/gen2-migration/_infra/aws-clients.js +64 -0
  47. package/lib/commands/gen2-migration/_infra/aws-clients.js.map +1 -0
  48. package/lib/commands/gen2-migration/_infra/categories.d.ts +2 -0
  49. package/lib/commands/gen2-migration/_infra/categories.d.ts.map +1 -0
  50. package/lib/commands/gen2-migration/_infra/categories.js +32 -0
  51. package/lib/commands/gen2-migration/_infra/categories.js.map +1 -0
  52. package/lib/commands/gen2-migration/_infra/cfn-template.d.ts +52 -0
  53. package/lib/commands/gen2-migration/_infra/cfn-template.d.ts.map +1 -0
  54. package/lib/commands/gen2-migration/_infra/cfn-template.js +21 -0
  55. package/lib/commands/gen2-migration/_infra/cfn-template.js.map +1 -0
  56. package/lib/commands/gen2-migration/_infra/operation.d.ts +16 -0
  57. package/lib/commands/gen2-migration/_infra/operation.d.ts.map +1 -0
  58. package/lib/commands/gen2-migration/_infra/operation.js +3 -0
  59. package/lib/commands/gen2-migration/_infra/operation.js.map +1 -0
  60. package/lib/commands/gen2-migration/_infra/plan.d.ts +21 -0
  61. package/lib/commands/gen2-migration/_infra/plan.d.ts.map +1 -0
  62. package/lib/commands/gen2-migration/_infra/plan.js +111 -0
  63. package/lib/commands/gen2-migration/_infra/plan.js.map +1 -0
  64. package/lib/commands/gen2-migration/_infra/planner.d.ts +5 -0
  65. package/lib/commands/gen2-migration/_infra/planner.d.ts.map +1 -0
  66. package/lib/commands/gen2-migration/{generate/custom-resources/types.js → _infra/planner.js} +1 -1
  67. package/lib/commands/gen2-migration/_infra/planner.js.map +1 -0
  68. package/lib/commands/gen2-migration/_infra/spinning-logger.d.ts +25 -0
  69. package/lib/commands/gen2-migration/_infra/spinning-logger.d.ts.map +1 -0
  70. package/lib/commands/gen2-migration/_infra/spinning-logger.js +115 -0
  71. package/lib/commands/gen2-migration/_infra/spinning-logger.js.map +1 -0
  72. package/lib/commands/gen2-migration/_infra/stateful-resources.d.ts.map +1 -0
  73. package/lib/commands/gen2-migration/_infra/stateful-resources.js.map +1 -0
  74. package/lib/commands/gen2-migration/_infra/step.d.ts +15 -0
  75. package/lib/commands/gen2-migration/_infra/step.d.ts.map +1 -0
  76. package/lib/commands/gen2-migration/_infra/step.js +13 -0
  77. package/lib/commands/gen2-migration/_infra/step.js.map +1 -0
  78. package/lib/commands/gen2-migration/{_validations.d.ts → _infra/validations.d.ts} +6 -7
  79. package/lib/commands/gen2-migration/_infra/validations.d.ts.map +1 -0
  80. package/lib/commands/gen2-migration/{_validations.js → _infra/validations.js} +24 -60
  81. package/lib/commands/gen2-migration/_infra/validations.js.map +1 -0
  82. package/lib/commands/gen2-migration/assess/analytics/kinesis.assessor.d.ts +10 -0
  83. package/lib/commands/gen2-migration/assess/analytics/kinesis.assessor.d.ts.map +1 -0
  84. package/lib/commands/gen2-migration/assess/analytics/kinesis.assessor.js +15 -0
  85. package/lib/commands/gen2-migration/assess/analytics/kinesis.assessor.js.map +1 -0
  86. package/lib/commands/gen2-migration/assess/api/data.assessor.d.ts +10 -0
  87. package/lib/commands/gen2-migration/assess/api/data.assessor.d.ts.map +1 -0
  88. package/lib/commands/gen2-migration/assess/api/data.assessor.js +25 -0
  89. package/lib/commands/gen2-migration/assess/api/data.assessor.js.map +1 -0
  90. package/lib/commands/gen2-migration/assess/api/rest-api.assessor.d.ts +10 -0
  91. package/lib/commands/gen2-migration/assess/api/rest-api.assessor.d.ts.map +1 -0
  92. package/lib/commands/gen2-migration/assess/api/rest-api.assessor.js +25 -0
  93. package/lib/commands/gen2-migration/assess/api/rest-api.assessor.js.map +1 -0
  94. package/lib/commands/gen2-migration/assess/assessment.d.ts +42 -0
  95. package/lib/commands/gen2-migration/assess/assessment.d.ts.map +1 -0
  96. package/lib/commands/gen2-migration/assess/assessment.js +118 -0
  97. package/lib/commands/gen2-migration/assess/assessment.js.map +1 -0
  98. package/lib/commands/gen2-migration/assess/assessor.d.ts +5 -0
  99. package/lib/commands/gen2-migration/assess/assessor.d.ts.map +1 -0
  100. package/lib/commands/gen2-migration/{generate/types.js → assess/assessor.js} +1 -1
  101. package/lib/commands/gen2-migration/assess/assessor.js.map +1 -0
  102. package/lib/commands/gen2-migration/assess/auth/auth-cognito.assessor.d.ts +10 -0
  103. package/lib/commands/gen2-migration/assess/auth/auth-cognito.assessor.d.ts.map +1 -0
  104. package/lib/commands/gen2-migration/assess/auth/auth-cognito.assessor.js +30 -0
  105. package/lib/commands/gen2-migration/assess/auth/auth-cognito.assessor.js.map +1 -0
  106. package/lib/commands/gen2-migration/assess/auth/auth-user-pool-groups.assessor.d.ts +10 -0
  107. package/lib/commands/gen2-migration/assess/auth/auth-user-pool-groups.assessor.d.ts.map +1 -0
  108. package/lib/commands/gen2-migration/assess/auth/auth-user-pool-groups.assessor.js +24 -0
  109. package/lib/commands/gen2-migration/assess/auth/auth-user-pool-groups.assessor.js.map +1 -0
  110. package/lib/commands/gen2-migration/assess/function/function.assessor.d.ts +12 -0
  111. package/lib/commands/gen2-migration/assess/function/function.assessor.d.ts.map +1 -0
  112. package/lib/commands/gen2-migration/assess/function/function.assessor.js +40 -0
  113. package/lib/commands/gen2-migration/assess/function/function.assessor.js.map +1 -0
  114. package/lib/commands/gen2-migration/assess/geo/geo-geofence-collection.assessor.d.ts +10 -0
  115. package/lib/commands/gen2-migration/assess/geo/geo-geofence-collection.assessor.d.ts.map +1 -0
  116. package/lib/commands/gen2-migration/assess/geo/geo-geofence-collection.assessor.js +19 -0
  117. package/lib/commands/gen2-migration/assess/geo/geo-geofence-collection.assessor.js.map +1 -0
  118. package/lib/commands/gen2-migration/assess/geo/geo-map.assessor.d.ts +10 -0
  119. package/lib/commands/gen2-migration/assess/geo/geo-map.assessor.d.ts.map +1 -0
  120. package/lib/commands/gen2-migration/assess/geo/geo-map.assessor.js +15 -0
  121. package/lib/commands/gen2-migration/assess/geo/geo-map.assessor.js.map +1 -0
  122. package/lib/commands/gen2-migration/assess/geo/geo-place-index.assessor.d.ts +10 -0
  123. package/lib/commands/gen2-migration/assess/geo/geo-place-index.assessor.d.ts.map +1 -0
  124. package/lib/commands/gen2-migration/assess/geo/geo-place-index.assessor.js +15 -0
  125. package/lib/commands/gen2-migration/assess/geo/geo-place-index.assessor.js.map +1 -0
  126. package/lib/commands/gen2-migration/assess/storage/dynamodb.assessor.d.ts +10 -0
  127. package/lib/commands/gen2-migration/assess/storage/dynamodb.assessor.d.ts.map +1 -0
  128. package/lib/commands/gen2-migration/assess/storage/dynamodb.assessor.js +25 -0
  129. package/lib/commands/gen2-migration/assess/storage/dynamodb.assessor.js.map +1 -0
  130. package/lib/commands/gen2-migration/assess/storage/s3.assessor.d.ts +10 -0
  131. package/lib/commands/gen2-migration/assess/storage/s3.assessor.d.ts.map +1 -0
  132. package/lib/commands/gen2-migration/assess/storage/s3.assessor.js +25 -0
  133. package/lib/commands/gen2-migration/assess/storage/s3.assessor.js.map +1 -0
  134. package/lib/commands/gen2-migration/assess.d.ts +9 -0
  135. package/lib/commands/gen2-migration/assess.d.ts.map +1 -0
  136. package/lib/commands/gen2-migration/assess.js +80 -0
  137. package/lib/commands/gen2-migration/assess.js.map +1 -0
  138. package/lib/commands/gen2-migration/decommission.d.ts +6 -5
  139. package/lib/commands/gen2-migration/decommission.d.ts.map +1 -1
  140. package/lib/commands/gen2-migration/decommission.js +82 -25
  141. package/lib/commands/gen2-migration/decommission.js.map +1 -1
  142. package/lib/commands/gen2-migration/generate/_infra/aws-fetcher.d.ts +32 -0
  143. package/lib/commands/gen2-migration/generate/_infra/aws-fetcher.d.ts.map +1 -0
  144. package/lib/commands/gen2-migration/generate/_infra/aws-fetcher.js +136 -0
  145. package/lib/commands/gen2-migration/generate/_infra/aws-fetcher.js.map +1 -0
  146. package/lib/commands/gen2-migration/generate/_infra/files.d.ts +2 -0
  147. package/lib/commands/gen2-migration/generate/_infra/files.d.ts.map +1 -0
  148. package/lib/commands/gen2-migration/generate/{codegen-head/directory_exists.js → _infra/files.js} +4 -5
  149. package/lib/commands/gen2-migration/generate/_infra/files.js.map +1 -0
  150. package/lib/commands/gen2-migration/generate/_infra/gen1-app.d.ts +40 -0
  151. package/lib/commands/gen2-migration/generate/_infra/gen1-app.d.ts.map +1 -0
  152. package/lib/commands/gen2-migration/generate/_infra/gen1-app.js +198 -0
  153. package/lib/commands/gen2-migration/generate/_infra/gen1-app.js.map +1 -0
  154. package/lib/commands/gen2-migration/generate/_infra/ts.d.ts +24 -0
  155. package/lib/commands/gen2-migration/generate/_infra/ts.d.ts.map +1 -0
  156. package/lib/commands/gen2-migration/generate/_infra/ts.js +128 -0
  157. package/lib/commands/gen2-migration/generate/_infra/ts.js.map +1 -0
  158. package/lib/commands/gen2-migration/generate/amplify/analytics/cfn-condition-resolver.d.ts +18 -0
  159. package/lib/commands/gen2-migration/generate/amplify/analytics/cfn-condition-resolver.d.ts.map +1 -0
  160. package/lib/commands/gen2-migration/generate/amplify/analytics/cfn-condition-resolver.js +126 -0
  161. package/lib/commands/gen2-migration/generate/amplify/analytics/cfn-condition-resolver.js.map +1 -0
  162. package/lib/commands/gen2-migration/generate/amplify/analytics/kinesis-cfn-converter.d.ts +33 -0
  163. package/lib/commands/gen2-migration/generate/amplify/analytics/kinesis-cfn-converter.d.ts.map +1 -0
  164. package/lib/commands/gen2-migration/generate/{unsupported/cdk-from-cfn.js → amplify/analytics/kinesis-cfn-converter.js} +94 -52
  165. package/lib/commands/gen2-migration/generate/amplify/analytics/kinesis-cfn-converter.js.map +1 -0
  166. package/lib/commands/gen2-migration/generate/amplify/analytics/kinesis.generator.d.ts +14 -0
  167. package/lib/commands/gen2-migration/generate/amplify/analytics/kinesis.generator.d.ts.map +1 -0
  168. package/lib/commands/gen2-migration/generate/amplify/analytics/kinesis.generator.js +69 -0
  169. package/lib/commands/gen2-migration/generate/amplify/analytics/kinesis.generator.js.map +1 -0
  170. package/lib/commands/gen2-migration/generate/amplify/analytics/kinesis.renderer.d.ts +18 -0
  171. package/lib/commands/gen2-migration/generate/amplify/analytics/kinesis.renderer.d.ts.map +1 -0
  172. package/lib/commands/gen2-migration/generate/amplify/analytics/kinesis.renderer.js +68 -0
  173. package/lib/commands/gen2-migration/generate/amplify/analytics/kinesis.renderer.js.map +1 -0
  174. package/lib/commands/gen2-migration/generate/amplify/auth/auth.generator.d.ts +24 -0
  175. package/lib/commands/gen2-migration/generate/amplify/auth/auth.generator.d.ts.map +1 -0
  176. package/lib/commands/gen2-migration/generate/amplify/auth/auth.generator.js +233 -0
  177. package/lib/commands/gen2-migration/generate/amplify/auth/auth.generator.js.map +1 -0
  178. package/lib/commands/gen2-migration/generate/amplify/auth/auth.renderer.d.ts +78 -0
  179. package/lib/commands/gen2-migration/generate/amplify/auth/auth.renderer.d.ts.map +1 -0
  180. package/lib/commands/gen2-migration/generate/amplify/auth/auth.renderer.js +491 -0
  181. package/lib/commands/gen2-migration/generate/amplify/auth/auth.renderer.js.map +1 -0
  182. package/lib/commands/gen2-migration/generate/amplify/auth/reference-auth.generator.d.ts +15 -0
  183. package/lib/commands/gen2-migration/generate/amplify/auth/reference-auth.generator.d.ts.map +1 -0
  184. package/lib/commands/gen2-migration/generate/amplify/auth/reference-auth.generator.js +75 -0
  185. package/lib/commands/gen2-migration/generate/amplify/auth/reference-auth.generator.js.map +1 -0
  186. package/lib/commands/gen2-migration/generate/amplify/auth/reference-auth.renderer.d.ts +13 -0
  187. package/lib/commands/gen2-migration/generate/amplify/auth/reference-auth.renderer.d.ts.map +1 -0
  188. package/lib/commands/gen2-migration/generate/amplify/auth/reference-auth.renderer.js +33 -0
  189. package/lib/commands/gen2-migration/generate/amplify/auth/reference-auth.renderer.js.map +1 -0
  190. package/lib/commands/gen2-migration/generate/amplify/backend.generator.d.ts +22 -0
  191. package/lib/commands/gen2-migration/generate/amplify/backend.generator.d.ts.map +1 -0
  192. package/lib/commands/gen2-migration/generate/amplify/backend.generator.js +150 -0
  193. package/lib/commands/gen2-migration/generate/amplify/backend.generator.js.map +1 -0
  194. package/lib/commands/gen2-migration/generate/{custom-resources/transformer → amplify/custom-resources}/amplify-helper-transformer.d.ts +4 -0
  195. package/lib/commands/gen2-migration/generate/amplify/custom-resources/amplify-helper-transformer.d.ts.map +1 -0
  196. package/lib/commands/gen2-migration/generate/amplify/custom-resources/amplify-helper-transformer.js +333 -0
  197. package/lib/commands/gen2-migration/generate/amplify/custom-resources/amplify-helper-transformer.js.map +1 -0
  198. package/lib/commands/gen2-migration/generate/amplify/custom-resources/custom.generator.d.ts +17 -0
  199. package/lib/commands/gen2-migration/generate/amplify/custom-resources/custom.generator.d.ts.map +1 -0
  200. package/lib/commands/gen2-migration/generate/amplify/custom-resources/custom.generator.js +190 -0
  201. package/lib/commands/gen2-migration/generate/amplify/custom-resources/custom.generator.js.map +1 -0
  202. package/lib/commands/gen2-migration/generate/amplify/data/data.generator.d.ts +15 -0
  203. package/lib/commands/gen2-migration/generate/amplify/data/data.generator.d.ts.map +1 -0
  204. package/lib/commands/gen2-migration/generate/amplify/data/data.generator.js +112 -0
  205. package/lib/commands/gen2-migration/generate/amplify/data/data.generator.js.map +1 -0
  206. package/lib/commands/gen2-migration/generate/amplify/data/data.renderer.d.ts +22 -0
  207. package/lib/commands/gen2-migration/generate/amplify/data/data.renderer.d.ts.map +1 -0
  208. package/lib/commands/gen2-migration/generate/amplify/data/data.renderer.js +167 -0
  209. package/lib/commands/gen2-migration/generate/amplify/data/data.renderer.js.map +1 -0
  210. package/lib/commands/gen2-migration/generate/amplify/function/function.generator.d.ts +49 -0
  211. package/lib/commands/gen2-migration/generate/amplify/function/function.generator.d.ts.map +1 -0
  212. package/lib/commands/gen2-migration/generate/amplify/function/function.generator.js +626 -0
  213. package/lib/commands/gen2-migration/generate/amplify/function/function.generator.js.map +1 -0
  214. package/lib/commands/gen2-migration/generate/amplify/function/function.renderer.d.ts +21 -0
  215. package/lib/commands/gen2-migration/generate/amplify/function/function.renderer.d.ts.map +1 -0
  216. package/lib/commands/gen2-migration/generate/amplify/function/function.renderer.js +105 -0
  217. package/lib/commands/gen2-migration/generate/amplify/function/function.renderer.js.map +1 -0
  218. package/lib/commands/gen2-migration/generate/amplify/geo/geo-cfn-converter.d.ts +49 -0
  219. package/lib/commands/gen2-migration/generate/amplify/geo/geo-cfn-converter.d.ts.map +1 -0
  220. package/lib/commands/gen2-migration/generate/amplify/geo/geo-cfn-converter.js +239 -0
  221. package/lib/commands/gen2-migration/generate/amplify/geo/geo-cfn-converter.js.map +1 -0
  222. package/lib/commands/gen2-migration/generate/amplify/geo/geo.generator.d.ts +14 -0
  223. package/lib/commands/gen2-migration/generate/amplify/geo/geo.generator.d.ts.map +1 -0
  224. package/lib/commands/gen2-migration/generate/amplify/geo/geo.generator.js +70 -0
  225. package/lib/commands/gen2-migration/generate/amplify/geo/geo.generator.js.map +1 -0
  226. package/lib/commands/gen2-migration/generate/amplify/geo/geo.renderer.d.ts +13 -0
  227. package/lib/commands/gen2-migration/generate/amplify/geo/geo.renderer.d.ts.map +1 -0
  228. package/lib/commands/gen2-migration/generate/amplify/geo/geo.renderer.js +161 -0
  229. package/lib/commands/gen2-migration/generate/amplify/geo/geo.renderer.js.map +1 -0
  230. package/lib/commands/gen2-migration/generate/amplify/package.json.generator.d.ts +8 -0
  231. package/lib/commands/gen2-migration/generate/amplify/package.json.generator.d.ts.map +1 -0
  232. package/lib/commands/gen2-migration/generate/amplify/package.json.generator.js +28 -0
  233. package/lib/commands/gen2-migration/generate/amplify/package.json.generator.js.map +1 -0
  234. package/lib/commands/gen2-migration/generate/amplify/rest-api/rest-api.generator.d.ts +15 -0
  235. package/lib/commands/gen2-migration/generate/amplify/rest-api/rest-api.generator.d.ts.map +1 -0
  236. package/lib/commands/gen2-migration/generate/amplify/rest-api/rest-api.generator.js +162 -0
  237. package/lib/commands/gen2-migration/generate/amplify/rest-api/rest-api.generator.js.map +1 -0
  238. package/lib/commands/gen2-migration/generate/amplify/rest-api/rest-api.renderer.d.ts +51 -0
  239. package/lib/commands/gen2-migration/generate/amplify/rest-api/rest-api.renderer.d.ts.map +1 -0
  240. package/lib/commands/gen2-migration/generate/amplify/rest-api/rest-api.renderer.js +269 -0
  241. package/lib/commands/gen2-migration/generate/amplify/rest-api/rest-api.renderer.js.map +1 -0
  242. package/lib/commands/gen2-migration/generate/amplify/storage/dynamodb.generator.d.ts +14 -0
  243. package/lib/commands/gen2-migration/generate/amplify/storage/dynamodb.generator.d.ts.map +1 -0
  244. package/lib/commands/gen2-migration/generate/amplify/storage/dynamodb.generator.js +96 -0
  245. package/lib/commands/gen2-migration/generate/amplify/storage/dynamodb.generator.js.map +1 -0
  246. package/lib/commands/gen2-migration/generate/amplify/storage/dynamodb.renderer.d.ts +30 -0
  247. package/lib/commands/gen2-migration/generate/amplify/storage/dynamodb.renderer.d.ts.map +1 -0
  248. package/lib/commands/gen2-migration/generate/amplify/storage/dynamodb.renderer.js +90 -0
  249. package/lib/commands/gen2-migration/generate/amplify/storage/dynamodb.renderer.js.map +1 -0
  250. package/lib/commands/gen2-migration/generate/amplify/storage/s3.generator.d.ts +22 -0
  251. package/lib/commands/gen2-migration/generate/amplify/storage/s3.generator.d.ts.map +1 -0
  252. package/lib/commands/gen2-migration/generate/amplify/storage/s3.generator.js +132 -0
  253. package/lib/commands/gen2-migration/generate/amplify/storage/s3.generator.js.map +1 -0
  254. package/lib/commands/gen2-migration/generate/amplify/storage/s3.renderer.d.ts +31 -0
  255. package/lib/commands/gen2-migration/generate/amplify/storage/s3.renderer.d.ts.map +1 -0
  256. package/lib/commands/gen2-migration/generate/amplify/storage/s3.renderer.js +137 -0
  257. package/lib/commands/gen2-migration/generate/amplify/storage/s3.renderer.js.map +1 -0
  258. package/lib/commands/gen2-migration/generate/amplify/tsconfig.generator.d.ts +8 -0
  259. package/lib/commands/gen2-migration/generate/amplify/tsconfig.generator.d.ts.map +1 -0
  260. package/lib/commands/gen2-migration/generate/amplify/tsconfig.generator.js +45 -0
  261. package/lib/commands/gen2-migration/generate/amplify/tsconfig.generator.js.map +1 -0
  262. package/lib/commands/gen2-migration/generate/amplify.yml.generator.d.ts +9 -0
  263. package/lib/commands/gen2-migration/generate/amplify.yml.generator.d.ts.map +1 -0
  264. package/lib/commands/gen2-migration/generate/amplify.yml.generator.js +112 -0
  265. package/lib/commands/gen2-migration/generate/amplify.yml.generator.js.map +1 -0
  266. package/lib/commands/gen2-migration/generate/gitignore.generator.d.ts +6 -0
  267. package/lib/commands/gen2-migration/generate/gitignore.generator.d.ts.map +1 -0
  268. package/lib/commands/gen2-migration/generate/gitignore.generator.js +45 -0
  269. package/lib/commands/gen2-migration/generate/gitignore.generator.js.map +1 -0
  270. package/lib/commands/gen2-migration/generate/package.json.generator.d.ts +12 -0
  271. package/lib/commands/gen2-migration/generate/package.json.generator.d.ts.map +1 -0
  272. package/lib/commands/gen2-migration/generate/package.json.generator.js +83 -0
  273. package/lib/commands/gen2-migration/generate/package.json.generator.js.map +1 -0
  274. package/lib/commands/gen2-migration/generate.d.ts +6 -5
  275. package/lib/commands/gen2-migration/generate.d.ts.map +1 -1
  276. package/lib/commands/gen2-migration/generate.js +232 -17
  277. package/lib/commands/gen2-migration/generate.js.map +1 -1
  278. package/lib/commands/gen2-migration/lock.d.ts +10 -6
  279. package/lib/commands/gen2-migration/lock.d.ts.map +1 -1
  280. package/lib/commands/gen2-migration/lock.js +182 -64
  281. package/lib/commands/gen2-migration/lock.js.map +1 -1
  282. package/lib/commands/gen2-migration/refactor/analytics/analytics-forward.d.ts +9 -0
  283. package/lib/commands/gen2-migration/refactor/analytics/analytics-forward.d.ts.map +1 -0
  284. package/lib/commands/gen2-migration/refactor/analytics/analytics-forward.js +19 -0
  285. package/lib/commands/gen2-migration/refactor/analytics/analytics-forward.js.map +1 -0
  286. package/lib/commands/gen2-migration/refactor/analytics/analytics-rollback.d.ts +9 -0
  287. package/lib/commands/gen2-migration/refactor/analytics/analytics-rollback.d.ts.map +1 -0
  288. package/lib/commands/gen2-migration/refactor/analytics/analytics-rollback.js +26 -0
  289. package/lib/commands/gen2-migration/refactor/analytics/analytics-rollback.js.map +1 -0
  290. package/lib/commands/gen2-migration/refactor/auth/auth-cognito-forward.d.ts +21 -0
  291. package/lib/commands/gen2-migration/refactor/auth/auth-cognito-forward.d.ts.map +1 -0
  292. package/lib/commands/gen2-migration/refactor/auth/auth-cognito-forward.js +87 -0
  293. package/lib/commands/gen2-migration/refactor/auth/auth-cognito-forward.js.map +1 -0
  294. package/lib/commands/gen2-migration/refactor/auth/auth-cognito-rollback.d.ts +9 -0
  295. package/lib/commands/gen2-migration/refactor/auth/auth-cognito-rollback.d.ts.map +1 -0
  296. package/lib/commands/gen2-migration/refactor/auth/auth-cognito-rollback.js +44 -0
  297. package/lib/commands/gen2-migration/refactor/auth/auth-cognito-rollback.js.map +1 -0
  298. package/lib/commands/gen2-migration/refactor/auth/auth-user-pool-groups-forward.d.ts +11 -0
  299. package/lib/commands/gen2-migration/refactor/auth/auth-user-pool-groups-forward.d.ts.map +1 -0
  300. package/lib/commands/gen2-migration/refactor/auth/auth-user-pool-groups-forward.js +33 -0
  301. package/lib/commands/gen2-migration/refactor/auth/auth-user-pool-groups-forward.js.map +1 -0
  302. package/lib/commands/gen2-migration/refactor/auth/auth-user-pool-groups-rollback.d.ts +9 -0
  303. package/lib/commands/gen2-migration/refactor/auth/auth-user-pool-groups-rollback.d.ts.map +1 -0
  304. package/lib/commands/gen2-migration/refactor/auth/auth-user-pool-groups-rollback.js +26 -0
  305. package/lib/commands/gen2-migration/refactor/auth/auth-user-pool-groups-rollback.js.map +1 -0
  306. package/lib/commands/gen2-migration/refactor/cfn.d.ts +41 -0
  307. package/lib/commands/gen2-migration/refactor/cfn.d.ts.map +1 -0
  308. package/lib/commands/gen2-migration/refactor/cfn.js +337 -0
  309. package/lib/commands/gen2-migration/refactor/cfn.js.map +1 -0
  310. package/lib/commands/gen2-migration/refactor/index.d.ts +1 -1
  311. package/lib/commands/gen2-migration/refactor/index.d.ts.map +1 -1
  312. package/lib/commands/gen2-migration/refactor/index.js +1 -1
  313. package/lib/commands/gen2-migration/refactor/index.js.map +1 -1
  314. package/lib/commands/gen2-migration/refactor/oauth-values-retriever.d.ts +23 -11
  315. package/lib/commands/gen2-migration/refactor/oauth-values-retriever.d.ts.map +1 -1
  316. package/lib/commands/gen2-migration/refactor/oauth-values-retriever.js +53 -45
  317. package/lib/commands/gen2-migration/refactor/oauth-values-retriever.js.map +1 -1
  318. package/lib/commands/gen2-migration/refactor/resolvers/cfn-condition-resolver.d.ts +2 -11
  319. package/lib/commands/gen2-migration/refactor/resolvers/cfn-condition-resolver.d.ts.map +1 -1
  320. package/lib/commands/gen2-migration/refactor/resolvers/cfn-condition-resolver.js +89 -123
  321. package/lib/commands/gen2-migration/refactor/resolvers/cfn-condition-resolver.js.map +1 -1
  322. package/lib/commands/gen2-migration/refactor/resolvers/cfn-dependency-resolver.d.ts +2 -7
  323. package/lib/commands/gen2-migration/refactor/resolvers/cfn-dependency-resolver.d.ts.map +1 -1
  324. package/lib/commands/gen2-migration/refactor/resolvers/cfn-dependency-resolver.js +6 -22
  325. package/lib/commands/gen2-migration/refactor/resolvers/cfn-dependency-resolver.js.map +1 -1
  326. package/lib/commands/gen2-migration/refactor/resolvers/cfn-output-resolver.d.ts +8 -12
  327. package/lib/commands/gen2-migration/refactor/resolvers/cfn-output-resolver.d.ts.map +1 -1
  328. package/lib/commands/gen2-migration/refactor/resolvers/cfn-output-resolver.js +105 -127
  329. package/lib/commands/gen2-migration/refactor/resolvers/cfn-output-resolver.js.map +1 -1
  330. package/lib/commands/gen2-migration/refactor/resolvers/cfn-parameter-resolver.d.ts +2 -8
  331. package/lib/commands/gen2-migration/refactor/resolvers/cfn-parameter-resolver.d.ts.map +1 -1
  332. package/lib/commands/gen2-migration/refactor/resolvers/cfn-parameter-resolver.js +36 -41
  333. package/lib/commands/gen2-migration/refactor/resolvers/cfn-parameter-resolver.js.map +1 -1
  334. package/lib/commands/gen2-migration/refactor/resolvers/cfn-tree-walker.d.ts +3 -0
  335. package/lib/commands/gen2-migration/refactor/resolvers/cfn-tree-walker.d.ts.map +1 -0
  336. package/lib/commands/gen2-migration/refactor/resolvers/cfn-tree-walker.js +18 -0
  337. package/lib/commands/gen2-migration/refactor/resolvers/cfn-tree-walker.js.map +1 -0
  338. package/lib/commands/gen2-migration/refactor/stack-facade.d.ts +13 -0
  339. package/lib/commands/gen2-migration/refactor/stack-facade.d.ts.map +1 -0
  340. package/lib/commands/gen2-migration/refactor/stack-facade.js +39 -0
  341. package/lib/commands/gen2-migration/refactor/stack-facade.js.map +1 -0
  342. package/lib/commands/gen2-migration/refactor/storage/storage-dynamo-forward.d.ts +8 -0
  343. package/lib/commands/gen2-migration/refactor/storage/storage-dynamo-forward.d.ts.map +1 -0
  344. package/lib/commands/gen2-migration/refactor/storage/storage-dynamo-forward.js +18 -0
  345. package/lib/commands/gen2-migration/refactor/storage/storage-dynamo-forward.js.map +1 -0
  346. package/lib/commands/gen2-migration/refactor/storage/storage-dynamo-rollback.d.ts +9 -0
  347. package/lib/commands/gen2-migration/refactor/storage/storage-dynamo-rollback.d.ts.map +1 -0
  348. package/lib/commands/gen2-migration/refactor/storage/storage-dynamo-rollback.js +26 -0
  349. package/lib/commands/gen2-migration/refactor/storage/storage-dynamo-rollback.js.map +1 -0
  350. package/lib/commands/gen2-migration/refactor/storage/storage-forward.d.ts +10 -0
  351. package/lib/commands/gen2-migration/refactor/storage/storage-forward.d.ts.map +1 -0
  352. package/lib/commands/gen2-migration/refactor/storage/storage-forward.js +36 -0
  353. package/lib/commands/gen2-migration/refactor/storage/storage-forward.js.map +1 -0
  354. package/lib/commands/gen2-migration/refactor/storage/storage-rollback.d.ts +9 -0
  355. package/lib/commands/gen2-migration/refactor/storage/storage-rollback.d.ts.map +1 -0
  356. package/lib/commands/gen2-migration/refactor/storage/storage-rollback.js +26 -0
  357. package/lib/commands/gen2-migration/refactor/storage/storage-rollback.js.map +1 -0
  358. package/lib/commands/gen2-migration/refactor/utils.d.ts +1 -1
  359. package/lib/commands/gen2-migration/refactor/utils.d.ts.map +1 -1
  360. package/lib/commands/gen2-migration/refactor/utils.js +2 -2
  361. package/lib/commands/gen2-migration/refactor/utils.js.map +1 -1
  362. package/lib/commands/gen2-migration/refactor/workflow/category-refactorer.d.ts +52 -0
  363. package/lib/commands/gen2-migration/refactor/workflow/category-refactorer.d.ts.map +1 -0
  364. package/lib/commands/gen2-migration/refactor/workflow/category-refactorer.js +212 -0
  365. package/lib/commands/gen2-migration/refactor/workflow/category-refactorer.js.map +1 -0
  366. package/lib/commands/gen2-migration/refactor/workflow/forward-category-refactorer.d.ts +15 -0
  367. package/lib/commands/gen2-migration/refactor/workflow/forward-category-refactorer.d.ts.map +1 -0
  368. package/lib/commands/gen2-migration/refactor/workflow/forward-category-refactorer.js +148 -0
  369. package/lib/commands/gen2-migration/refactor/workflow/forward-category-refactorer.js.map +1 -0
  370. package/lib/commands/gen2-migration/refactor/workflow/rollback-category-refactorer.d.ts +13 -0
  371. package/lib/commands/gen2-migration/refactor/workflow/rollback-category-refactorer.d.ts.map +1 -0
  372. package/lib/commands/gen2-migration/refactor/workflow/rollback-category-refactorer.js +123 -0
  373. package/lib/commands/gen2-migration/refactor/workflow/rollback-category-refactorer.js.map +1 -0
  374. package/lib/commands/gen2-migration/refactor.d.ts +11 -0
  375. package/lib/commands/gen2-migration/refactor.d.ts.map +1 -0
  376. package/lib/commands/gen2-migration/refactor.js +189 -0
  377. package/lib/commands/gen2-migration/refactor.js.map +1 -0
  378. package/lib/commands/gen2-migration.d.ts +0 -12
  379. package/lib/commands/gen2-migration.d.ts.map +1 -1
  380. package/lib/commands/gen2-migration.js +82 -111
  381. package/lib/commands/gen2-migration.js.map +1 -1
  382. package/package.json +22 -12
  383. package/aws-amplify-cli-internal-gen2-migration-experimental-alpha-0.5.0.tgz +0 -0
  384. package/lib/commands/drift-detection/services/file-service.d.ts +0 -7
  385. package/lib/commands/drift-detection/services/file-service.d.ts.map +0 -1
  386. package/lib/commands/drift-detection/services/file-service.js +0 -53
  387. package/lib/commands/drift-detection/services/file-service.js.map +0 -1
  388. package/lib/commands/gen2-migration/_step.d.ts +0 -17
  389. package/lib/commands/gen2-migration/_step.d.ts.map +0 -1
  390. package/lib/commands/gen2-migration/_step.js +0 -16
  391. package/lib/commands/gen2-migration/_step.js.map +0 -1
  392. package/lib/commands/gen2-migration/_validations.d.ts.map +0 -1
  393. package/lib/commands/gen2-migration/_validations.js.map +0 -1
  394. package/lib/commands/gen2-migration/cleanup.d.ts +0 -8
  395. package/lib/commands/gen2-migration/cleanup.d.ts.map +0 -1
  396. package/lib/commands/gen2-migration/cleanup.js +0 -21
  397. package/lib/commands/gen2-migration/cleanup.js.map +0 -1
  398. package/lib/commands/gen2-migration/clone.d.ts +0 -8
  399. package/lib/commands/gen2-migration/clone.d.ts.map +0 -1
  400. package/lib/commands/gen2-migration/clone.js +0 -21
  401. package/lib/commands/gen2-migration/clone.js.map +0 -1
  402. package/lib/commands/gen2-migration/generate/adapters/auth/index.d.ts +0 -24
  403. package/lib/commands/gen2-migration/generate/adapters/auth/index.d.ts.map +0 -1
  404. package/lib/commands/gen2-migration/generate/adapters/auth/index.js +0 -297
  405. package/lib/commands/gen2-migration/generate/adapters/auth/index.js.map +0 -1
  406. package/lib/commands/gen2-migration/generate/adapters/auth/index.test.d.ts +0 -2
  407. package/lib/commands/gen2-migration/generate/adapters/auth/index.test.d.ts.map +0 -1
  408. package/lib/commands/gen2-migration/generate/adapters/auth/index.test.js +0 -140
  409. package/lib/commands/gen2-migration/generate/adapters/auth/index.test.js.map +0 -1
  410. package/lib/commands/gen2-migration/generate/adapters/data/index.d.ts +0 -5
  411. package/lib/commands/gen2-migration/generate/adapters/data/index.d.ts.map +0 -1
  412. package/lib/commands/gen2-migration/generate/adapters/data/index.js +0 -17
  413. package/lib/commands/gen2-migration/generate/adapters/data/index.js.map +0 -1
  414. package/lib/commands/gen2-migration/generate/adapters/functions/api-trigger-detector.d.ts +0 -10
  415. package/lib/commands/gen2-migration/generate/adapters/functions/api-trigger-detector.d.ts.map +0 -1
  416. package/lib/commands/gen2-migration/generate/adapters/functions/api-trigger-detector.js +0 -43
  417. package/lib/commands/gen2-migration/generate/adapters/functions/api-trigger-detector.js.map +0 -1
  418. package/lib/commands/gen2-migration/generate/adapters/functions/api-trigger-detector.test.d.ts +0 -2
  419. package/lib/commands/gen2-migration/generate/adapters/functions/api-trigger-detector.test.d.ts.map +0 -1
  420. package/lib/commands/gen2-migration/generate/adapters/functions/api-trigger-detector.test.js +0 -34
  421. package/lib/commands/gen2-migration/generate/adapters/functions/api-trigger-detector.test.js.map +0 -1
  422. package/lib/commands/gen2-migration/generate/adapters/functions/index.d.ts +0 -18
  423. package/lib/commands/gen2-migration/generate/adapters/functions/index.d.ts.map +0 -1
  424. package/lib/commands/gen2-migration/generate/adapters/functions/index.js +0 -85
  425. package/lib/commands/gen2-migration/generate/adapters/functions/index.js.map +0 -1
  426. package/lib/commands/gen2-migration/generate/adapters/project/index.d.ts +0 -2
  427. package/lib/commands/gen2-migration/generate/adapters/project/index.d.ts.map +0 -1
  428. package/lib/commands/gen2-migration/generate/adapters/project/index.js +0 -7
  429. package/lib/commands/gen2-migration/generate/adapters/project/index.js.map +0 -1
  430. package/lib/commands/gen2-migration/generate/adapters/storage/gen1_storage_codegen_adapter.d.ts +0 -31
  431. package/lib/commands/gen2-migration/generate/adapters/storage/gen1_storage_codegen_adapter.d.ts.map +0 -1
  432. package/lib/commands/gen2-migration/generate/adapters/storage/gen1_storage_codegen_adapter.js +0 -34
  433. package/lib/commands/gen2-migration/generate/adapters/storage/gen1_storage_codegen_adapter.js.map +0 -1
  434. package/lib/commands/gen2-migration/generate/adapters/storage/gen1_storage_codegen_adapter.test.d.ts +0 -2
  435. package/lib/commands/gen2-migration/generate/adapters/storage/gen1_storage_codegen_adapter.test.d.ts.map +0 -1
  436. package/lib/commands/gen2-migration/generate/adapters/storage/gen1_storage_codegen_adapter.test.js +0 -181
  437. package/lib/commands/gen2-migration/generate/adapters/storage/gen1_storage_codegen_adapter.test.js.map +0 -1
  438. package/lib/commands/gen2-migration/generate/adapters/storage/index.d.ts +0 -3
  439. package/lib/commands/gen2-migration/generate/adapters/storage/index.d.ts.map +0 -1
  440. package/lib/commands/gen2-migration/generate/adapters/storage/index.js +0 -10
  441. package/lib/commands/gen2-migration/generate/adapters/storage/index.js.map +0 -1
  442. package/lib/commands/gen2-migration/generate/adapters/storage/storage_access.d.ts +0 -25
  443. package/lib/commands/gen2-migration/generate/adapters/storage/storage_access.d.ts.map +0 -1
  444. package/lib/commands/gen2-migration/generate/adapters/storage/storage_access.js +0 -76
  445. package/lib/commands/gen2-migration/generate/adapters/storage/storage_access.js.map +0 -1
  446. package/lib/commands/gen2-migration/generate/adapters/storage/storage_access.test.d.ts +0 -2
  447. package/lib/commands/gen2-migration/generate/adapters/storage/storage_access.test.d.ts.map +0 -1
  448. package/lib/commands/gen2-migration/generate/adapters/storage/storage_access.test.js +0 -125
  449. package/lib/commands/gen2-migration/generate/adapters/storage/storage_access.test.js.map +0 -1
  450. package/lib/commands/gen2-migration/generate/backend/synthesizer.d.ts +0 -91
  451. package/lib/commands/gen2-migration/generate/backend/synthesizer.d.ts.map +0 -1
  452. package/lib/commands/gen2-migration/generate/backend/synthesizer.js +0 -1014
  453. package/lib/commands/gen2-migration/generate/backend/synthesizer.js.map +0 -1
  454. package/lib/commands/gen2-migration/generate/backend/synthesizer.test.d.ts +0 -2
  455. package/lib/commands/gen2-migration/generate/backend/synthesizer.test.d.ts.map +0 -1
  456. package/lib/commands/gen2-migration/generate/backend/synthesizer.test.js +0 -777
  457. package/lib/commands/gen2-migration/generate/backend/synthesizer.test.js.map +0 -1
  458. package/lib/commands/gen2-migration/generate/codegen-head/amplify_stack_parser.d.ts +0 -14
  459. package/lib/commands/gen2-migration/generate/codegen-head/amplify_stack_parser.d.ts.map +0 -1
  460. package/lib/commands/gen2-migration/generate/codegen-head/amplify_stack_parser.js +0 -82
  461. package/lib/commands/gen2-migration/generate/codegen-head/amplify_stack_parser.js.map +0 -1
  462. package/lib/commands/gen2-migration/generate/codegen-head/analytics.d.ts +0 -10
  463. package/lib/commands/gen2-migration/generate/codegen-head/analytics.d.ts.map +0 -1
  464. package/lib/commands/gen2-migration/generate/codegen-head/analytics.js +0 -11
  465. package/lib/commands/gen2-migration/generate/codegen-head/analytics.js.map +0 -1
  466. package/lib/commands/gen2-migration/generate/codegen-head/api-cfn-access.d.ts +0 -7
  467. package/lib/commands/gen2-migration/generate/codegen-head/api-cfn-access.d.ts.map +0 -1
  468. package/lib/commands/gen2-migration/generate/codegen-head/api-cfn-access.js +0 -80
  469. package/lib/commands/gen2-migration/generate/codegen-head/api-cfn-access.js.map +0 -1
  470. package/lib/commands/gen2-migration/generate/codegen-head/app_analytics_definition_fetcher.d.ts +0 -13
  471. package/lib/commands/gen2-migration/generate/codegen-head/app_analytics_definition_fetcher.d.ts.map +0 -1
  472. package/lib/commands/gen2-migration/generate/codegen-head/app_analytics_definition_fetcher.js +0 -59
  473. package/lib/commands/gen2-migration/generate/codegen-head/app_analytics_definition_fetcher.js.map +0 -1
  474. package/lib/commands/gen2-migration/generate/codegen-head/app_auth_definition_fetcher.d.ts +0 -24
  475. package/lib/commands/gen2-migration/generate/codegen-head/app_auth_definition_fetcher.d.ts.map +0 -1
  476. package/lib/commands/gen2-migration/generate/codegen-head/app_auth_definition_fetcher.js +0 -167
  477. package/lib/commands/gen2-migration/generate/codegen-head/app_auth_definition_fetcher.js.map +0 -1
  478. package/lib/commands/gen2-migration/generate/codegen-head/app_functions_definition_fetcher.d.ts +0 -21
  479. package/lib/commands/gen2-migration/generate/codegen-head/app_functions_definition_fetcher.d.ts.map +0 -1
  480. package/lib/commands/gen2-migration/generate/codegen-head/app_functions_definition_fetcher.js +0 -135
  481. package/lib/commands/gen2-migration/generate/codegen-head/app_functions_definition_fetcher.js.map +0 -1
  482. package/lib/commands/gen2-migration/generate/codegen-head/app_storage_definition_fetcher.d.ts +0 -23
  483. package/lib/commands/gen2-migration/generate/codegen-head/app_storage_definition_fetcher.d.ts.map +0 -1
  484. package/lib/commands/gen2-migration/generate/codegen-head/app_storage_definition_fetcher.js +0 -181
  485. package/lib/commands/gen2-migration/generate/codegen-head/app_storage_definition_fetcher.js.map +0 -1
  486. package/lib/commands/gen2-migration/generate/codegen-head/auth_access_analyzer.d.ts +0 -12
  487. package/lib/commands/gen2-migration/generate/codegen-head/auth_access_analyzer.d.ts.map +0 -1
  488. package/lib/commands/gen2-migration/generate/codegen-head/auth_access_analyzer.js +0 -157
  489. package/lib/commands/gen2-migration/generate/codegen-head/auth_access_analyzer.js.map +0 -1
  490. package/lib/commands/gen2-migration/generate/codegen-head/backend_downloader.d.ts +0 -10
  491. package/lib/commands/gen2-migration/generate/codegen-head/backend_downloader.d.ts.map +0 -1
  492. package/lib/commands/gen2-migration/generate/codegen-head/backend_downloader.js +0 -48
  493. package/lib/commands/gen2-migration/generate/codegen-head/backend_downloader.js.map +0 -1
  494. package/lib/commands/gen2-migration/generate/codegen-head/backend_environment_selector.d.ts +0 -11
  495. package/lib/commands/gen2-migration/generate/codegen-head/backend_environment_selector.d.ts.map +0 -1
  496. package/lib/commands/gen2-migration/generate/codegen-head/backend_environment_selector.js +0 -38
  497. package/lib/commands/gen2-migration/generate/codegen-head/backend_environment_selector.js.map +0 -1
  498. package/lib/commands/gen2-migration/generate/codegen-head/command-handlers.d.ts +0 -13
  499. package/lib/commands/gen2-migration/generate/codegen-head/command-handlers.d.ts.map +0 -1
  500. package/lib/commands/gen2-migration/generate/codegen-head/command-handlers.js +0 -498
  501. package/lib/commands/gen2-migration/generate/codegen-head/command-handlers.js.map +0 -1
  502. package/lib/commands/gen2-migration/generate/codegen-head/data_definition_fetcher.d.ts +0 -47
  503. package/lib/commands/gen2-migration/generate/codegen-head/data_definition_fetcher.d.ts.map +0 -1
  504. package/lib/commands/gen2-migration/generate/codegen-head/data_definition_fetcher.js +0 -222
  505. package/lib/commands/gen2-migration/generate/codegen-head/data_definition_fetcher.js.map +0 -1
  506. package/lib/commands/gen2-migration/generate/codegen-head/data_model_access_parser.d.ts +0 -10
  507. package/lib/commands/gen2-migration/generate/codegen-head/data_model_access_parser.d.ts.map +0 -1
  508. package/lib/commands/gen2-migration/generate/codegen-head/data_model_access_parser.js +0 -59
  509. package/lib/commands/gen2-migration/generate/codegen-head/data_model_access_parser.js.map +0 -1
  510. package/lib/commands/gen2-migration/generate/codegen-head/data_model_access_parser.test.d.ts +0 -2
  511. package/lib/commands/gen2-migration/generate/codegen-head/data_model_access_parser.test.d.ts.map +0 -1
  512. package/lib/commands/gen2-migration/generate/codegen-head/data_model_access_parser.test.js +0 -90
  513. package/lib/commands/gen2-migration/generate/codegen-head/data_model_access_parser.test.js.map +0 -1
  514. package/lib/commands/gen2-migration/generate/codegen-head/directory_exists.d.ts +0 -2
  515. package/lib/commands/gen2-migration/generate/codegen-head/directory_exists.d.ts.map +0 -1
  516. package/lib/commands/gen2-migration/generate/codegen-head/directory_exists.js.map +0 -1
  517. package/lib/commands/gen2-migration/generate/codegen-head/dynamodb_cfn_access_parser.d.ts +0 -14
  518. package/lib/commands/gen2-migration/generate/codegen-head/dynamodb_cfn_access_parser.d.ts.map +0 -1
  519. package/lib/commands/gen2-migration/generate/codegen-head/dynamodb_cfn_access_parser.js +0 -100
  520. package/lib/commands/gen2-migration/generate/codegen-head/dynamodb_cfn_access_parser.js.map +0 -1
  521. package/lib/commands/gen2-migration/generate/codegen-head/dynamodb_cfn_access_parser.test.d.ts +0 -2
  522. package/lib/commands/gen2-migration/generate/codegen-head/dynamodb_cfn_access_parser.test.d.ts.map +0 -1
  523. package/lib/commands/gen2-migration/generate/codegen-head/dynamodb_cfn_access_parser.test.js +0 -69
  524. package/lib/commands/gen2-migration/generate/codegen-head/dynamodb_cfn_access_parser.test.js.map +0 -1
  525. package/lib/commands/gen2-migration/generate/codegen-head/format.d.ts +0 -8
  526. package/lib/commands/gen2-migration/generate/codegen-head/format.d.ts.map +0 -1
  527. package/lib/commands/gen2-migration/generate/codegen-head/format.js +0 -66
  528. package/lib/commands/gen2-migration/generate/codegen-head/format.js.map +0 -1
  529. package/lib/commands/gen2-migration/generate/codegen-head/logger.d.ts +0 -15
  530. package/lib/commands/gen2-migration/generate/codegen-head/logger.d.ts.map +0 -1
  531. package/lib/commands/gen2-migration/generate/codegen-head/logger.js +0 -14
  532. package/lib/commands/gen2-migration/generate/codegen-head/logger.js.map +0 -1
  533. package/lib/commands/gen2-migration/generate/codegen-head/printer.d.ts +0 -26
  534. package/lib/commands/gen2-migration/generate/codegen-head/printer.d.ts.map +0 -1
  535. package/lib/commands/gen2-migration/generate/codegen-head/printer.js +0 -103
  536. package/lib/commands/gen2-migration/generate/codegen-head/printer.js.map +0 -1
  537. package/lib/commands/gen2-migration/generate/codegen-head/s3_cfn_access_parser.d.ts +0 -13
  538. package/lib/commands/gen2-migration/generate/codegen-head/s3_cfn_access_parser.d.ts.map +0 -1
  539. package/lib/commands/gen2-migration/generate/codegen-head/s3_cfn_access_parser.js +0 -66
  540. package/lib/commands/gen2-migration/generate/codegen-head/s3_cfn_access_parser.js.map +0 -1
  541. package/lib/commands/gen2-migration/generate/codegen-head/s3_cfn_access_parser.test.d.ts +0 -2
  542. package/lib/commands/gen2-migration/generate/codegen-head/s3_cfn_access_parser.test.d.ts.map +0 -1
  543. package/lib/commands/gen2-migration/generate/codegen-head/s3_cfn_access_parser.test.js +0 -97
  544. package/lib/commands/gen2-migration/generate/codegen-head/s3_cfn_access_parser.test.js.map +0 -1
  545. package/lib/commands/gen2-migration/generate/core/migration-pipeline.d.ts +0 -26
  546. package/lib/commands/gen2-migration/generate/core/migration-pipeline.d.ts.map +0 -1
  547. package/lib/commands/gen2-migration/generate/core/migration-pipeline.js +0 -269
  548. package/lib/commands/gen2-migration/generate/core/migration-pipeline.js.map +0 -1
  549. package/lib/commands/gen2-migration/generate/custom-resources/generator/backend-updater.d.ts +0 -7
  550. package/lib/commands/gen2-migration/generate/custom-resources/generator/backend-updater.d.ts.map +0 -1
  551. package/lib/commands/gen2-migration/generate/custom-resources/generator/backend-updater.js +0 -84
  552. package/lib/commands/gen2-migration/generate/custom-resources/generator/backend-updater.js.map +0 -1
  553. package/lib/commands/gen2-migration/generate/custom-resources/generator/dependency-merger.d.ts +0 -8
  554. package/lib/commands/gen2-migration/generate/custom-resources/generator/dependency-merger.d.ts.map +0 -1
  555. package/lib/commands/gen2-migration/generate/custom-resources/generator/dependency-merger.js +0 -105
  556. package/lib/commands/gen2-migration/generate/custom-resources/generator/dependency-merger.js.map +0 -1
  557. package/lib/commands/gen2-migration/generate/custom-resources/generator/file-converter.d.ts +0 -5
  558. package/lib/commands/gen2-migration/generate/custom-resources/generator/file-converter.d.ts.map +0 -1
  559. package/lib/commands/gen2-migration/generate/custom-resources/generator/file-converter.js +0 -88
  560. package/lib/commands/gen2-migration/generate/custom-resources/generator/file-converter.js.map +0 -1
  561. package/lib/commands/gen2-migration/generate/custom-resources/generator/gen2-file-generator.d.ts +0 -8
  562. package/lib/commands/gen2-migration/generate/custom-resources/generator/gen2-file-generator.d.ts.map +0 -1
  563. package/lib/commands/gen2-migration/generate/custom-resources/generator/gen2-file-generator.js +0 -36
  564. package/lib/commands/gen2-migration/generate/custom-resources/generator/gen2-file-generator.js.map +0 -1
  565. package/lib/commands/gen2-migration/generate/custom-resources/parser/cdk-stack-parser.d.ts +0 -5
  566. package/lib/commands/gen2-migration/generate/custom-resources/parser/cdk-stack-parser.d.ts.map +0 -1
  567. package/lib/commands/gen2-migration/generate/custom-resources/parser/cdk-stack-parser.js +0 -81
  568. package/lib/commands/gen2-migration/generate/custom-resources/parser/cdk-stack-parser.js.map +0 -1
  569. package/lib/commands/gen2-migration/generate/custom-resources/parser/pattern-detector.d.ts +0 -15
  570. package/lib/commands/gen2-migration/generate/custom-resources/parser/pattern-detector.d.ts.map +0 -1
  571. package/lib/commands/gen2-migration/generate/custom-resources/parser/pattern-detector.js +0 -35
  572. package/lib/commands/gen2-migration/generate/custom-resources/parser/pattern-detector.js.map +0 -1
  573. package/lib/commands/gen2-migration/generate/custom-resources/scanner/custom-resource-scanner.d.ts +0 -5
  574. package/lib/commands/gen2-migration/generate/custom-resources/scanner/custom-resource-scanner.d.ts.map +0 -1
  575. package/lib/commands/gen2-migration/generate/custom-resources/scanner/custom-resource-scanner.js +0 -66
  576. package/lib/commands/gen2-migration/generate/custom-resources/scanner/custom-resource-scanner.js.map +0 -1
  577. package/lib/commands/gen2-migration/generate/custom-resources/transformer/amplify-helper-transformer.d.ts.map +0 -1
  578. package/lib/commands/gen2-migration/generate/custom-resources/transformer/amplify-helper-transformer.js +0 -178
  579. package/lib/commands/gen2-migration/generate/custom-resources/transformer/amplify-helper-transformer.js.map +0 -1
  580. package/lib/commands/gen2-migration/generate/custom-resources/types.d.ts +0 -38
  581. package/lib/commands/gen2-migration/generate/custom-resources/types.d.ts.map +0 -1
  582. package/lib/commands/gen2-migration/generate/custom-resources/types.js.map +0 -1
  583. package/lib/commands/gen2-migration/generate/generators/analytics/index.d.ts +0 -9
  584. package/lib/commands/gen2-migration/generate/generators/analytics/index.d.ts.map +0 -1
  585. package/lib/commands/gen2-migration/generate/generators/analytics/index.js +0 -40
  586. package/lib/commands/gen2-migration/generate/generators/analytics/index.js.map +0 -1
  587. package/lib/commands/gen2-migration/generate/generators/auth/index.d.ts +0 -107
  588. package/lib/commands/gen2-migration/generate/generators/auth/index.d.ts.map +0 -1
  589. package/lib/commands/gen2-migration/generate/generators/auth/index.js +0 -313
  590. package/lib/commands/gen2-migration/generate/generators/auth/index.js.map +0 -1
  591. package/lib/commands/gen2-migration/generate/generators/auth/index.test.d.ts +0 -2
  592. package/lib/commands/gen2-migration/generate/generators/auth/index.test.d.ts.map +0 -1
  593. package/lib/commands/gen2-migration/generate/generators/auth/index.test.js +0 -566
  594. package/lib/commands/gen2-migration/generate/generators/auth/index.test.js.map +0 -1
  595. package/lib/commands/gen2-migration/generate/generators/data/index.d.ts +0 -35
  596. package/lib/commands/gen2-migration/generate/generators/data/index.d.ts.map +0 -1
  597. package/lib/commands/gen2-migration/generate/generators/data/index.js +0 -185
  598. package/lib/commands/gen2-migration/generate/generators/data/index.js.map +0 -1
  599. package/lib/commands/gen2-migration/generate/generators/data/index.test.d.ts +0 -2
  600. package/lib/commands/gen2-migration/generate/generators/data/index.test.d.ts.map +0 -1
  601. package/lib/commands/gen2-migration/generate/generators/data/index.test.js +0 -47
  602. package/lib/commands/gen2-migration/generate/generators/data/index.test.js.map +0 -1
  603. package/lib/commands/gen2-migration/generate/generators/functions/index.d.ts +0 -53
  604. package/lib/commands/gen2-migration/generate/generators/functions/index.d.ts.map +0 -1
  605. package/lib/commands/gen2-migration/generate/generators/functions/index.js +0 -125
  606. package/lib/commands/gen2-migration/generate/generators/functions/index.js.map +0 -1
  607. package/lib/commands/gen2-migration/generate/generators/functions/lambda.d.ts +0 -6
  608. package/lib/commands/gen2-migration/generate/generators/functions/lambda.d.ts.map +0 -1
  609. package/lib/commands/gen2-migration/generate/generators/functions/lambda.js +0 -16
  610. package/lib/commands/gen2-migration/generate/generators/functions/lambda.js.map +0 -1
  611. package/lib/commands/gen2-migration/generate/generators/functions/lambda_env_generator.d.ts +0 -3
  612. package/lib/commands/gen2-migration/generate/generators/functions/lambda_env_generator.d.ts.map +0 -1
  613. package/lib/commands/gen2-migration/generate/generators/functions/lambda_env_generator.js +0 -106
  614. package/lib/commands/gen2-migration/generate/generators/functions/lambda_env_generator.js.map +0 -1
  615. package/lib/commands/gen2-migration/generate/generators/functions/lambda_env_generator.test.d.ts +0 -2
  616. package/lib/commands/gen2-migration/generate/generators/functions/lambda_env_generator.test.d.ts.map +0 -1
  617. package/lib/commands/gen2-migration/generate/generators/functions/lambda_env_generator.test.js +0 -120
  618. package/lib/commands/gen2-migration/generate/generators/functions/lambda_env_generator.test.js.map +0 -1
  619. package/lib/commands/gen2-migration/generate/generators/storage/access.d.ts +0 -4
  620. package/lib/commands/gen2-migration/generate/generators/storage/access.d.ts.map +0 -1
  621. package/lib/commands/gen2-migration/generate/generators/storage/access.js +0 -73
  622. package/lib/commands/gen2-migration/generate/generators/storage/access.js.map +0 -1
  623. package/lib/commands/gen2-migration/generate/generators/storage/index.d.ts +0 -37
  624. package/lib/commands/gen2-migration/generate/generators/storage/index.d.ts.map +0 -1
  625. package/lib/commands/gen2-migration/generate/generators/storage/index.js +0 -78
  626. package/lib/commands/gen2-migration/generate/generators/storage/index.js.map +0 -1
  627. package/lib/commands/gen2-migration/generate/npm_package/renderer.d.ts +0 -27
  628. package/lib/commands/gen2-migration/generate/npm_package/renderer.d.ts.map +0 -1
  629. package/lib/commands/gen2-migration/generate/npm_package/renderer.js +0 -28
  630. package/lib/commands/gen2-migration/generate/npm_package/renderer.js.map +0 -1
  631. package/lib/commands/gen2-migration/generate/render_pipeline.d.ts +0 -9
  632. package/lib/commands/gen2-migration/generate/render_pipeline.d.ts.map +0 -1
  633. package/lib/commands/gen2-migration/generate/render_pipeline.js +0 -15
  634. package/lib/commands/gen2-migration/generate/render_pipeline.js.map +0 -1
  635. package/lib/commands/gen2-migration/generate/renderers/ensure_directory.d.ts +0 -7
  636. package/lib/commands/gen2-migration/generate/renderers/ensure_directory.d.ts.map +0 -1
  637. package/lib/commands/gen2-migration/generate/renderers/ensure_directory.js +0 -17
  638. package/lib/commands/gen2-migration/generate/renderers/ensure_directory.js.map +0 -1
  639. package/lib/commands/gen2-migration/generate/renderers/package_json.d.ts +0 -8
  640. package/lib/commands/gen2-migration/generate/renderers/package_json.d.ts.map +0 -1
  641. package/lib/commands/gen2-migration/generate/renderers/package_json.js +0 -15
  642. package/lib/commands/gen2-migration/generate/renderers/package_json.js.map +0 -1
  643. package/lib/commands/gen2-migration/generate/renderers/typescript_block_node.d.ts +0 -11
  644. package/lib/commands/gen2-migration/generate/renderers/typescript_block_node.d.ts.map +0 -1
  645. package/lib/commands/gen2-migration/generate/renderers/typescript_block_node.js +0 -22
  646. package/lib/commands/gen2-migration/generate/renderers/typescript_block_node.js.map +0 -1
  647. package/lib/commands/gen2-migration/generate/resource/resource.d.ts +0 -20
  648. package/lib/commands/gen2-migration/generate/resource/resource.d.ts.map +0 -1
  649. package/lib/commands/gen2-migration/generate/resource/resource.js +0 -60
  650. package/lib/commands/gen2-migration/generate/resource/resource.js.map +0 -1
  651. package/lib/commands/gen2-migration/generate/test_utils/import_regex.d.ts +0 -2
  652. package/lib/commands/gen2-migration/generate/test_utils/import_regex.d.ts.map +0 -1
  653. package/lib/commands/gen2-migration/generate/test_utils/import_regex.js +0 -6
  654. package/lib/commands/gen2-migration/generate/test_utils/import_regex.js.map +0 -1
  655. package/lib/commands/gen2-migration/generate/test_utils/ts_node_printer.d.ts +0 -4
  656. package/lib/commands/gen2-migration/generate/test_utils/ts_node_printer.d.ts.map +0 -1
  657. package/lib/commands/gen2-migration/generate/test_utils/ts_node_printer.js +0 -22
  658. package/lib/commands/gen2-migration/generate/test_utils/ts_node_printer.js.map +0 -1
  659. package/lib/commands/gen2-migration/generate/todo_error.d.ts +0 -3
  660. package/lib/commands/gen2-migration/generate/todo_error.d.ts.map +0 -1
  661. package/lib/commands/gen2-migration/generate/todo_error.js +0 -11
  662. package/lib/commands/gen2-migration/generate/todo_error.js.map +0 -1
  663. package/lib/commands/gen2-migration/generate/ts_factory_utils.d.ts +0 -3
  664. package/lib/commands/gen2-migration/generate/ts_factory_utils.d.ts.map +0 -1
  665. package/lib/commands/gen2-migration/generate/ts_factory_utils.js +0 -10
  666. package/lib/commands/gen2-migration/generate/ts_factory_utils.js.map +0 -1
  667. package/lib/commands/gen2-migration/generate/types.d.ts +0 -4
  668. package/lib/commands/gen2-migration/generate/types.d.ts.map +0 -1
  669. package/lib/commands/gen2-migration/generate/types.js.map +0 -1
  670. package/lib/commands/gen2-migration/generate/unsupported/cdk-from-cfn.d.ts +0 -26
  671. package/lib/commands/gen2-migration/generate/unsupported/cdk-from-cfn.d.ts.map +0 -1
  672. package/lib/commands/gen2-migration/generate/unsupported/cdk-from-cfn.js.map +0 -1
  673. package/lib/commands/gen2-migration/refactor/cfn-stack-refactor-updater.d.ts +0 -5
  674. package/lib/commands/gen2-migration/refactor/cfn-stack-refactor-updater.d.ts.map +0 -1
  675. package/lib/commands/gen2-migration/refactor/cfn-stack-refactor-updater.js +0 -76
  676. package/lib/commands/gen2-migration/refactor/cfn-stack-refactor-updater.js.map +0 -1
  677. package/lib/commands/gen2-migration/refactor/cfn-stack-updater.d.ts +0 -6
  678. package/lib/commands/gen2-migration/refactor/cfn-stack-updater.d.ts.map +0 -1
  679. package/lib/commands/gen2-migration/refactor/cfn-stack-updater.js +0 -52
  680. package/lib/commands/gen2-migration/refactor/cfn-stack-updater.js.map +0 -1
  681. package/lib/commands/gen2-migration/refactor/generators/category-template-generator.d.ts +0 -40
  682. package/lib/commands/gen2-migration/refactor/generators/category-template-generator.d.ts.map +0 -1
  683. package/lib/commands/gen2-migration/refactor/generators/category-template-generator.js +0 -321
  684. package/lib/commands/gen2-migration/refactor/generators/category-template-generator.js.map +0 -1
  685. package/lib/commands/gen2-migration/refactor/generators/template-generator.d.ts +0 -48
  686. package/lib/commands/gen2-migration/refactor/generators/template-generator.d.ts.map +0 -1
  687. package/lib/commands/gen2-migration/refactor/generators/template-generator.js +0 -513
  688. package/lib/commands/gen2-migration/refactor/generators/template-generator.js.map +0 -1
  689. package/lib/commands/gen2-migration/refactor/refactor.d.ts +0 -19
  690. package/lib/commands/gen2-migration/refactor/refactor.d.ts.map +0 -1
  691. package/lib/commands/gen2-migration/refactor/refactor.js +0 -241
  692. package/lib/commands/gen2-migration/refactor/refactor.js.map +0 -1
  693. package/lib/commands/gen2-migration/refactor/types.d.ts +0 -128
  694. package/lib/commands/gen2-migration/refactor/types.d.ts.map +0 -1
  695. package/lib/commands/gen2-migration/refactor/types.js +0 -59
  696. package/lib/commands/gen2-migration/refactor/types.js.map +0 -1
  697. package/lib/commands/gen2-migration/shift.d.ts +0 -8
  698. package/lib/commands/gen2-migration/shift.d.ts.map +0 -1
  699. package/lib/commands/gen2-migration/shift.js +0 -21
  700. package/lib/commands/gen2-migration/shift.js.map +0 -1
  701. package/lib/commands/gen2-migration/stateful-resources.d.ts.map +0 -1
  702. package/lib/commands/gen2-migration/stateful-resources.js.map +0 -1
  703. /package/lib/commands/gen2-migration/{stateful-resources.d.ts → _infra/stateful-resources.d.ts} +0 -0
  704. /package/lib/commands/gen2-migration/{stateful-resources.js → _infra/stateful-resources.js} +0 -0
@@ -1,297 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.getAuthDefinition = exports.DEFAULT_PASSWORD_SETTINGS = void 0;
4
- const client_cognito_identity_provider_1 = require("@aws-sdk/client-cognito-identity-provider");
5
- exports.DEFAULT_PASSWORD_SETTINGS = {
6
- MinimumLength: 8,
7
- RequireLowercase: true,
8
- RequireUppercase: true,
9
- RequireNumbers: true,
10
- TemporaryPasswordValidityDays: 3,
11
- };
12
- const COGNITO_TRIGGERS_TO_SKIP = ['PreTokenGenerationConfig'];
13
- const getPasswordPolicyOverrides = (passwordPolicy) => {
14
- const policyOverrides = {};
15
- const passwordOverridePath = (policyKey) => `Policies.PasswordPolicy.${policyKey}`;
16
- for (const key of Object.keys(passwordPolicy)) {
17
- const typedKey = key;
18
- if (passwordPolicy[typedKey] !== undefined) {
19
- policyOverrides[passwordOverridePath(typedKey)] = passwordPolicy[typedKey];
20
- }
21
- }
22
- return policyOverrides;
23
- };
24
- const getUserPoolOverrides = (userPool) => {
25
- var _a, _b;
26
- const userPoolOverrides = {};
27
- Object.assign(userPoolOverrides, getPasswordPolicyOverrides((_b = (_a = userPool.Policies) === null || _a === void 0 ? void 0 : _a.PasswordPolicy) !== null && _b !== void 0 ? _b : {}));
28
- if (userPool.UsernameAttributes === undefined || userPool.UsernameAttributes.length === 0) {
29
- userPoolOverrides.usernameAttributes = undefined;
30
- }
31
- else {
32
- userPoolOverrides.usernameAttributes = userPool.UsernameAttributes;
33
- }
34
- return userPoolOverrides;
35
- };
36
- const getMfaConfiguration = (mfaConfig, totpConfig) => {
37
- const multifactor = {
38
- mode: 'OFF',
39
- };
40
- if (mfaConfig === 'ON') {
41
- multifactor.mode = 'REQUIRED';
42
- multifactor.sms = true;
43
- (totpConfig === null || totpConfig === void 0 ? void 0 : totpConfig.Enabled) ? (multifactor.totp = true) : (multifactor.totp = false);
44
- }
45
- else if (mfaConfig === 'OPTIONAL') {
46
- multifactor.mode = 'OPTIONAL';
47
- multifactor.sms = true;
48
- (totpConfig === null || totpConfig === void 0 ? void 0 : totpConfig.Enabled) ? (multifactor.totp = true) : (multifactor.totp = false);
49
- }
50
- return multifactor;
51
- };
52
- const getEmailConfig = (userPool) => {
53
- var _a, _b;
54
- return {
55
- emailVerificationBody: (_a = userPool.EmailVerificationMessage) !== null && _a !== void 0 ? _a : '',
56
- emailVerificationSubject: (_b = userPool.EmailVerificationSubject) !== null && _b !== void 0 ? _b : '',
57
- };
58
- };
59
- const getStandardUserAttributes = (signupAttributes, mappedUserAttributeName) => {
60
- return ((signupAttributes === null || signupAttributes === void 0 ? void 0 : signupAttributes.reduce((standardAttributes, attribute) => {
61
- const standardAttribute = {
62
- required: attribute.Required,
63
- mutable: attribute.Mutable,
64
- };
65
- if (attribute.Name !== undefined && attribute.Name in mappedUserAttributeName && attribute.Required) {
66
- return {
67
- ...standardAttributes,
68
- [mappedUserAttributeName[attribute.Name]]: standardAttribute,
69
- };
70
- }
71
- return standardAttributes;
72
- }, {})) || {});
73
- };
74
- const getCustomUserAttributes = (signupAttributes) => {
75
- return ((signupAttributes === null || signupAttributes === void 0 ? void 0 : signupAttributes.reduce((customAttributes, attribute) => {
76
- if (attribute.Name !== undefined && attribute.Name.startsWith('custom:')) {
77
- const customAttribute = {
78
- mutable: attribute.Mutable,
79
- dataType: attribute.AttributeDataType,
80
- };
81
- if (attribute.NumberAttributeConstraints && Object.keys(attribute.NumberAttributeConstraints).length > 0) {
82
- customAttribute.min = Number(attribute.NumberAttributeConstraints.MinValue);
83
- customAttribute.max = Number(attribute.NumberAttributeConstraints.MaxValue);
84
- }
85
- else if (attribute.StringAttributeConstraints && Object.keys(attribute.StringAttributeConstraints).length > 0) {
86
- customAttribute.minLen = Number(attribute.StringAttributeConstraints.MinLength);
87
- customAttribute.maxLen = Number(attribute.StringAttributeConstraints.MaxLength);
88
- }
89
- return {
90
- ...customAttributes,
91
- [attribute.Name]: customAttribute,
92
- };
93
- }
94
- return customAttributes;
95
- }, {})) || {});
96
- };
97
- const getGroups = (identityGroups) => {
98
- if (!identityGroups || identityGroups.length === 0) {
99
- return [];
100
- }
101
- const groupsWithPrecedence = identityGroups.filter((group) => group.Precedence !== undefined);
102
- return groupsWithPrecedence
103
- .sort((a, b) => (a.Precedence || 0) - (b.Precedence || 0))
104
- .map((group) => group.GroupName)
105
- .filter((groupName) => groupName !== undefined);
106
- };
107
- const getScopes = (scopes) => {
108
- return scopes.filter((scope) => ['phone', 'email', 'openid', 'profile', 'aws.cognito.signin.user.admin'].includes(scope));
109
- };
110
- const getProviderSpecificScopes = (providerDetails) => {
111
- const scopeFields = ['authorized_scopes', 'scope', 'scopes'];
112
- for (const field of scopeFields) {
113
- if (providerDetails[field]) {
114
- return providerDetails[field].split(/[\s,]+/).filter((scope) => scope.length > 0);
115
- }
116
- }
117
- return [];
118
- };
119
- const mappedLambdaConfigKey = (key) => {
120
- switch (key) {
121
- case 'PreSignUp':
122
- return 'preSignUp';
123
- case 'CustomMessage':
124
- return 'customMessage';
125
- case 'UserMigration':
126
- return 'userMigration';
127
- case 'PostConfirmation':
128
- return 'postConfirmation';
129
- case 'PreAuthentication':
130
- return 'preAuthentication';
131
- case 'PostAuthentication':
132
- return 'postAuthentication';
133
- case 'PreTokenGeneration':
134
- return 'preTokenGeneration';
135
- case 'DefineAuthChallenge':
136
- return 'defineAuthChallenge';
137
- case 'CreateAuthChallenge':
138
- return 'createAuthChallenge';
139
- case 'VerifyAuthChallengeResponse':
140
- return 'verifyAuthChallengeResponse';
141
- default:
142
- throw new Error(`Could not map the provided key: ${key}`);
143
- }
144
- };
145
- const getAuthTriggers = (lambdaConfig, triggerSourceFiles) => {
146
- return (Object.keys(lambdaConfig)
147
- .filter((triggerName) => !COGNITO_TRIGGERS_TO_SKIP.includes(triggerName))
148
- .reduce((prev, key) => {
149
- var _a;
150
- const typedKey = key;
151
- prev[mappedLambdaConfigKey(typedKey)] = { source: (_a = triggerSourceFiles[typedKey]) !== null && _a !== void 0 ? _a : '' };
152
- return prev;
153
- }, {}));
154
- };
155
- function filterAttributeMapping(attributeMapping, mappedUserAttributeName) {
156
- return Object.fromEntries(Object.entries(attributeMapping)
157
- .filter(([key]) => Object.keys(mappedUserAttributeName).includes(key))
158
- .map(([key, value]) => [mappedUserAttributeName[key], value]));
159
- }
160
- const getAuthDefinition = ({ userPool, identityPoolName, identityProviders, identityProvidersDetails, identityGroups, webClient, authTriggerConnections, guestLogin, referenceAuth, mfaConfig, totpConfig, userPoolClient, }) => {
161
- var _a;
162
- const mappedUserAttributeName = {
163
- address: 'address',
164
- birthdate: 'birthdate',
165
- email: 'email',
166
- family_name: 'familyName',
167
- gender: 'gender',
168
- given_name: 'givenName',
169
- locale: 'locale',
170
- middle_name: 'middleName',
171
- name: 'fullname',
172
- nickname: 'nickname',
173
- phone_number: 'phoneNumber',
174
- picture: 'profilePicture',
175
- preferred_username: 'preferredUsername',
176
- profile: 'profilePage',
177
- zoneinfo: 'timezone',
178
- updated_at: 'lastUpdateTime',
179
- website: 'website',
180
- };
181
- const loginWith = { email: true };
182
- const mapIdentityProvider = {
183
- [client_cognito_identity_provider_1.IdentityProviderTypeType.Google]: ['googleLogin', 'googleAttributes'],
184
- [client_cognito_identity_provider_1.IdentityProviderTypeType.SignInWithApple]: ['appleLogin', 'appleAttributes'],
185
- [client_cognito_identity_provider_1.IdentityProviderTypeType.LoginWithAmazon]: ['amazonLogin', 'amazonAttributes'],
186
- [client_cognito_identity_provider_1.IdentityProviderTypeType.Facebook]: ['facebookLogin', 'facebookAttributes'],
187
- };
188
- if (identityProviders !== undefined) {
189
- identityProviders.forEach((provider) => {
190
- const loginWithProperty = mapIdentityProvider[provider === null || provider === void 0 ? void 0 : provider.ProviderType];
191
- if (loginWithProperty !== undefined) {
192
- const loginProperty = loginWithProperty[0];
193
- loginWith[loginProperty] = true;
194
- }
195
- });
196
- }
197
- if (identityProvidersDetails) {
198
- const oidcOptions = [];
199
- let samlOptions;
200
- for (const provider of identityProvidersDetails) {
201
- const { ProviderType, ProviderName, ProviderDetails, AttributeMapping } = provider;
202
- if (ProviderType === client_cognito_identity_provider_1.IdentityProviderTypeType.OIDC && ProviderDetails) {
203
- const { oidc_issuer, authorize_url, token_url, attributes_url, jwks_uri } = ProviderDetails;
204
- const oidcOption = {
205
- issuerUrl: oidc_issuer,
206
- };
207
- if (ProviderName)
208
- oidcOption.name = ProviderName;
209
- if (authorize_url && token_url && attributes_url && jwks_uri) {
210
- oidcOption.endpoints = {
211
- authorization: authorize_url,
212
- token: token_url,
213
- userInfo: attributes_url,
214
- jwksUri: jwks_uri,
215
- };
216
- }
217
- if (AttributeMapping)
218
- oidcOption.attributeMapping = filterAttributeMapping(AttributeMapping, mappedUserAttributeName);
219
- oidcOptions.push(oidcOption);
220
- }
221
- else if (ProviderType === client_cognito_identity_provider_1.IdentityProviderTypeType.SAML && ProviderDetails) {
222
- const { metadataURL, metadataContent } = ProviderDetails;
223
- samlOptions = {
224
- metadata: {
225
- metadataContent: metadataURL || metadataContent,
226
- metadataType: metadataURL ? 'URL' : 'FILE',
227
- },
228
- };
229
- if (ProviderName)
230
- samlOptions.name = ProviderName;
231
- if (AttributeMapping)
232
- samlOptions.attributeMapping = filterAttributeMapping(AttributeMapping, mappedUserAttributeName);
233
- }
234
- else {
235
- if (AttributeMapping) {
236
- const attributeOption = mapIdentityProvider[provider === null || provider === void 0 ? void 0 : provider.ProviderType][1];
237
- loginWith[attributeOption] = filterAttributeMapping(AttributeMapping, mappedUserAttributeName);
238
- }
239
- if (ProviderDetails) {
240
- const providerScopes = getProviderSpecificScopes(ProviderDetails);
241
- if (providerScopes.length > 0) {
242
- const scopePropertyMap = {
243
- [client_cognito_identity_provider_1.IdentityProviderTypeType.Google]: 'googleScopes',
244
- [client_cognito_identity_provider_1.IdentityProviderTypeType.Facebook]: 'facebookScopes',
245
- [client_cognito_identity_provider_1.IdentityProviderTypeType.LoginWithAmazon]: 'amazonScopes',
246
- [client_cognito_identity_provider_1.IdentityProviderTypeType.SignInWithApple]: 'appleScopes',
247
- };
248
- const scopeProperty = scopePropertyMap[ProviderType];
249
- if (scopeProperty) {
250
- const mappedScopes = providerScopes
251
- .map((scope) => {
252
- if (scope === 'public_profile')
253
- return 'profile';
254
- return scope;
255
- })
256
- .filter((scope) => ['phone', 'email', 'openid', 'profile', 'aws.cognito.signin.user.admin'].includes(scope));
257
- loginWith[scopeProperty] = mappedScopes;
258
- }
259
- }
260
- }
261
- }
262
- }
263
- loginWith.oidcLogin = oidcOptions;
264
- loginWith.samlLogin = samlOptions;
265
- }
266
- if (userPool.EmailVerificationMessage || userPool.EmailVerificationSubject) {
267
- loginWith.emailOptions = getEmailConfig(userPool);
268
- }
269
- if (webClient === null || webClient === void 0 ? void 0 : webClient.CallbackURLs) {
270
- loginWith.callbackURLs = webClient === null || webClient === void 0 ? void 0 : webClient.CallbackURLs;
271
- }
272
- if (webClient === null || webClient === void 0 ? void 0 : webClient.LogoutURLs) {
273
- loginWith.logoutURLs = webClient === null || webClient === void 0 ? void 0 : webClient.LogoutURLs;
274
- }
275
- if (webClient === null || webClient === void 0 ? void 0 : webClient.AllowedOAuthScopes) {
276
- loginWith.scopes = getScopes(webClient === null || webClient === void 0 ? void 0 : webClient.AllowedOAuthScopes);
277
- }
278
- const userPoolOverrides = getUserPoolOverrides(userPool);
279
- return {
280
- loginOptions: loginWith,
281
- mfa: getMfaConfiguration(mfaConfig, totpConfig),
282
- standardUserAttributes: getStandardUserAttributes(userPool.SchemaAttributes, mappedUserAttributeName),
283
- customUserAttributes: getCustomUserAttributes(userPool.SchemaAttributes),
284
- groups: getGroups(identityGroups),
285
- userPoolOverrides,
286
- lambdaTriggers: getAuthTriggers((_a = userPool.LambdaConfig) !== null && _a !== void 0 ? _a : {}, authTriggerConnections !== null && authTriggerConnections !== void 0 ? authTriggerConnections : {}),
287
- guestLogin,
288
- identityPoolName,
289
- oAuthFlows: webClient === null || webClient === void 0 ? void 0 : webClient.AllowedOAuthFlows,
290
- readAttributes: webClient === null || webClient === void 0 ? void 0 : webClient.ReadAttributes,
291
- writeAttributes: webClient === null || webClient === void 0 ? void 0 : webClient.WriteAttributes,
292
- referenceAuth,
293
- userPoolClient,
294
- };
295
- };
296
- exports.getAuthDefinition = getAuthDefinition;
297
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../src/commands/gen2-migration/generate/adapters/auth/index.ts"],"names":[],"mappings":";;;AAoBA,gGAYmD;AAwBtC,QAAA,yBAAyB,GAAuB;IAC3D,aAAa,EAAE,CAAC;IAChB,gBAAgB,EAAE,IAAI;IACtB,gBAAgB,EAAE,IAAI;IACtB,cAA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CAAC;QAC1F,UAAU;QACV,gBAAgB;QAChB,UAAU,EAAE,SAAS,aAAT,SAAS,uBAAT,SAAS,CAAE,iBAAiB;QACxC,cAAc,EAAE,SAAS,aAAT,SAAS,uBAAT,SAAS,CAAE,cAAc;QACzC,eAAe,EAAE,SAAS,aAAT,SAAS,uBAAT,SAAS,CAAE,eAAe;QAC3C,aAAa;QACb,cAAc;KACf,CAAC;AACJ,CAAC,CAAC;AAvKW,QAAA,iBAAiB,qBAuK5B"}
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=index.test.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.test.d.ts","sourceRoot":"","sources":["../../../../../../src/commands/gen2-migration/generate/adapters/auth/index.test.ts"],"names":[],"mappings":""}
@@ -1,140 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const index_1 = require("./index");
4
- const client_cognito_identity_provider_1 = require("@aws-sdk/client-cognito-identity-provider");
5
- describe('Auth Generator - Provider-Specific Scopes', () => {
6
- it('should extract provider-specific scopes from ProviderDetails', () => {
7
- var _a, _b, _c, _d, _e;
8
- const mockIdentityProvidersDetails = [
9
- {
10
- ProviderType: client_cognito_identity_provider_1.IdentityProviderTypeType.Google,
11
- ProviderName: 'Google',
12
- ProviderDetails: {
13
- client_id: '911159018992-rnun5p7a6imtf206ci261m3s0jbap5ng.apps.googleusercontent.com',
14
- client_secret: 'GOCSPX-...',
15
- authorized_scopes: 'openid email profile',
16
- },
17
- AttributeMapping: {
18
- email: 'email',
19
- name: 'name',
20
- },
21
- },
22
- {
23
- ProviderType: client_cognito_identity_provider_1.IdentityProviderTypeType.Facebook,
24
- ProviderName: 'Facebook',
25
- ProviderDetails: {
26
- client_id: '1412236500618572',
27
- client_secret: '...',
28
- authorized_scopes: 'public_profile',
29
- },
30
- AttributeMapping: {
31
- email: 'email',
32
- name: 'name',
33
- },
34
- },
35
- ];
36
- const mockWebClient = {
37
- AllowedOAuthScopes: ['aws.cognito.signin.user.admin', 'email', 'openid', 'phone', 'profile'],
38
- CallbackURLs: ['http://localhost:3000/'],
39
- LogoutURLs: ['http://localhost:3000/'],
40
- };
41
- const mockUserPool = {
42
- EmailVerificationMessage: null,
43
- EmailVerificationSubject: null,
44
- SchemaAttributes: [],
45
- };
46
- const result = (0, index_1.getAuthDefinition)({
47
- userPool: mockUserPool,
48
- identityProviders: [{ ProviderType: client_cognito_identity_provider_1.IdentityProviderTypeType.Google }, { ProviderType: client_cognito_identity_provider_1.IdentityProviderTypeType.Facebook }],
49
- identityProvidersDetails: mockIdentityProvidersDetails,
50
- webClient: mockWebClient,
51
- });
52
- expect((_a = result.loginOptions) === null || _a === void 0 ? void 0 : _a.googleScopes).toEqual(['openid', 'email', 'profile']);
53
- expect((_b = result.loginOptions) === null || _b === void 0 ? void 0 : _b.facebookScopes).toEqual(['profile']);
54
- expect((_c = result.loginOptions) === null || _c === void 0 ? void 0 : _c.googleLogin).toBe(true);
55
- expect((_d = result.loginOptions) === null || _d === void 0 ? void 0 : _d.facebookLogin).toBe(true);
56
- expect((_e = result.loginOptions) === null || _e === void 0 ? void 0 : _e.scopes).toEqual(['aws.cognito.signin.user.admin', 'email', 'openid', 'phone', 'profile']);
57
- });
58
- it('should handle providers without scopes gracefully', () => {
59
- var _a, _b;
60
- const mockIdentityProvidersDetails = [
61
- {
62
- ProviderType: client_cognito_identity_provider_1.IdentityProviderTypeType.Google,
63
- ProviderName: 'Google',
64
- ProviderDetails: {
65
- client_id: '911159018992-rnun5p7a6imtf206ci261m3s0jbap5ng.apps.googleusercontent.com',
66
- client_secret: 'GOCSPX-...',
67
- },
68
- AttributeMapping: {
69
- email: 'email',
70
- },
71
- },
72
- ];
73
- const mockUserPool = {
74
- EmailVerificationMessage: null,
75
- EmailVerificationSubject: null,
76
- SchemaAttributes: [],
77
- };
78
- const result = (0, index_1.getAuthDefinition)({
79
- userPool: mockUserPool,
80
- identityProviders: [{ ProviderType: client_cognito_identity_provider_1.IdentityProviderTypeType.Google }],
81
- identityProvidersDetails: mockIdentityProvidersDetails,
82
- webClient: {},
83
- });
84
- expect((_a = result.loginOptions) === null || _a === void 0 ? void 0 : _a.googleScopes).toBeUndefined();
85
- expect((_b = result.loginOptions) === null || _b === void 0 ? void 0 : _b.googleLogin).toBe(true);
86
- });
87
- it('should map Facebook public_profile to Cognito profile scope', () => {
88
- var _a;
89
- const mockIdentityProvidersDetails = [
90
- {
91
- ProviderType: client_cognito_identity_provider_1.IdentityProviderTypeType.Facebook,
92
- ProviderName: 'Facebook',
93
- ProviderDetails: {
94
- client_id: '1412236500618572',
95
- client_secret: '...',
96
- authorized_scopes: 'public_profile email',
97
- },
98
- },
99
- ];
100
- const mockUserPool = {
101
- EmailVerificationMessage: null,
102
- EmailVerificationSubject: null,
103
- SchemaAttributes: [],
104
- };
105
- const result = (0, index_1.getAuthDefinition)({
106
- userPool: mockUserPool,
107
- identityProviders: [{ ProviderType: client_cognito_identity_provider_1.IdentityProviderTypeType.Facebook }],
108
- identityProvidersDetails: mockIdentityProvidersDetails,
109
- webClient: {},
110
- });
111
- expect((_a = result.loginOptions) === null || _a === void 0 ? void 0 : _a.facebookScopes).toEqual(['profile', 'email']);
112
- });
113
- it('should filter out invalid scopes', () => {
114
- var _a;
115
- const mockIdentityProvidersDetails = [
116
- {
117
- ProviderType: client_cognito_identity_provider_1.IdentityProviderTypeType.Google,
118
- ProviderName: 'Google',
119
- ProviderDetails: {
120
- client_id: '911159018992-rnun5p7a6imtf206ci261m3s0jbap5ng.apps.googleusercontent.com',
121
- client_secret: 'GOCSPX-...',
122
- authorized_scopes: 'openid email profile invalid_scope another_invalid',
123
- },
124
- },
125
- ];
126
- const mockUserPool = {
127
- EmailVerificationMessage: null,
128
- EmailVerificationSubject: null,
129
- SchemaAttributes: [],
130
- };
131
- const result = (0, index_1.getAuthDefinition)({
132
- userPool: mockUserPool,
133
- identityProviders: [{ ProviderType: client_cognito_identity_provider_1.IdentityProviderTypeType.Google }],
134
- identityProvidersDetails: mockIdentityProvidersDetails,
135
- webClient: {},
136
- });
137
- expect((_a = result.loginOptions) === null || _a === void 0 ? void 0 : _a.googleScopes).toEqual(['openid', 'email', 'profile']);
138
- });
139
- });
140
- //# sourceMappingURL=index.test.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.test.js","sourceRoot":"","sources":["../../../../../../src/commands/gen2-migration/generate/adapters/auth/index.test.ts"],"names":[],"mappings":";;AAAA,mCAA4C;AAC5C,gGAAqF;AAErF,QAAQ,CAAC,2CAA2C,EAAE,GAAG,EAAE;IACzD,EAAE,CAAC,8DAA8D,EAAE,GAAG,EAAE;;QACtE,MAAM,4BAA4B,GAAG;YACnC;gBACE,YAAY,EAAE,2DAAwB,CAAC,MAAM;gBAC7C,YAAY,EAAE,QAAQ;gBACtB,eAAe,EAAE;oBACf,SAAS,EAAE,0EAA0E;oBACrF,aAAa,EAAE,YAAY;oBAC3B,iBAAiB,EAAE,sBAAsB;iBAC1C;gBACD,gBAAgB,EAAE;oBAChB,KAAK,EAAE,OAAO;oBACd,IAAI,EAAE,MAAM;iBACb;aACF;YACD;gBACE,YAAY,EAAE,2DAAwB,CAAC,QAAQ;gBAC/C,YAAY,EAAE,UAAU;gBACxB,eAAe,EAAE;oBACf,SAAS,EAAE,kBAAkB;oBAC7B,aAAa,EAAE,KAAK;oBACpB,iBAAiB,EAAE,gBAAgB;iBACpC;gBACD,gBAAgB,EAAE;oBAChB,KAAK,EAAE,OAAO;oBACd,IAAI,EAAE,MAAM;iBACb;aACF;SACF,CAAC;QAEF,MAAM,aAAa,GAAG;YACpB,kBAAkB,EAAE,CAAC,+BAA+B,EAAE,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,SAAS,CAAC;YAC5F,YAAY,EAAE,CAAC,wBAAwB,CAAC;YACxC,UAAU,EAAE,CAAC,wBAAwB,CAAC;SACvC,CAAC;QAEF,MAAM,YAAY,GAAG;YACnB,wBAAwB,EAAE,IAAI;YAC9B,wBAAwB,EAA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CAAC,CAAC,SAAS,EAAE,OAAO,CAAC,CAAC,CAAC;IAC5E,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,kCAAkC,EAAE,GAAG,EAAE;;QAC1C,MAAM,4BAA4B,GAAG;YACnC;gBACE,YAAY,EAAE,2DAAwB,CAAC,MAAM;gBAC7C,YAAY,EAAE,QAAQ;gBACtB,eAAe,EAAE;oBACf,SAAS,EAAE,0EAA0E;oBACrF,aAAa,EAAE,YAAY;oBAC3B,iBAAiB,EAAE,oDAAoD;iBACxE;aACF;SACF,CAAC;QAEF,MAAM,YAAY,GAAG;YACnB,wBAAwB,EAAE,IAAI;YAC9B,wBAAwB,EAAE,IAAI;YAC9B,gBAAgB,EAAE,EAAE;SACrB,CAAC;QAEF,MAAM,MAAM,GAAG,IAAA,yBAAiB,EAAC;YAC/B,QAAQ,EAAE,YAAY;YACtB,iBAAiB,EAAE,CAAC,EAAE,YAAY,EAAE,2DAAwB,CAAC,MAAM,EAAE,CAAC;YACtE,wBAAwB,EAAE,4BAA4B;YACtD,SAAS,EAAE,EAAE;SACd,CAAC,CAAC;QAGH,MAAM,CAAC,MAAA,MAAM,CAAC,YAAY,0CAAE,YAAY,CAAC,CAAC,OAAO,CAAC,CAAC,QAAQ,EAAE,OAAO,EAAE,SAAS,CAAC,CAAC,CAAC;IACpF,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
@@ -1,5 +0,0 @@
1
- import { DataTableMapping } from '../../core/migration-pipeline';
2
- import { Stack } from '@aws-sdk/client-cloudformation';
3
- export declare const tableMappingKey = "DataSourceMappingOutput";
4
- export declare const getDataDefinition: (dataStack: Stack) => DataTableMapping;
5
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/commands/gen2-migration/generate/adapters/data/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AACjE,OAAO,EAAE,KAAK,EAAE,MAAM,gCAAgC,CAAC;AAEvD,eAAO,MAAM,eAAe,4BAA4B,CAAC;AAEzD,eAAO,MAAM,iBAAiB,GAAI,WAAW,KAAK,KAAG,gBAKpD,CAAC"}
@@ -1,17 +0,0 @@
1
- "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.getDataDefinition = exports.tableMappingKey = void 0;
7
- const node_assert_1 = __importDefault(require("node:assert"));
8
- exports.tableMappingKey = 'DataSourceMappingOutput';
9
- const getDataDefinition = (dataStack) => {
10
- var _a, _b;
11
- const rawTableMapping = (_b = (_a = dataStack.Outputs) === null || _a === void 0 ? void 0 : _a.find((o) => o.OutputKey === exports.tableMappingKey)) === null || _b === void 0 ? void 0 : _b.OutputValue;
12
- (0, node_assert_1.default)(rawTableMapping);
13
- const tableMapping = JSON.parse(rawTableMapping);
14
- return tableMapping;
15
- };
16
- exports.getDataDefinition = getDataDefinition;
17
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../src/commands/gen2-migration/generate/adapters/data/index.ts"],"names":[],"mappings":";;;;;;AAAA,8DAAiC;AAIpB,QAAA,eAAe,GAAG,yBAAyB,CAAC;AAElD,MAAM,iBAAiB,GAAG,CAAC,SAAgB,EAAoB,EAAE;;IACtE,MAAM,eAAe,GAAG,MAAA,MAAA,SAAS,CAAC,OAAO,0CAAE,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,SAAS,KAAK,uBAAe,CAAC,0CAAE,WAAW,CAAC;IACrG,IAAA,qBAAM,EAAC,eAAe,CAAC,CAAC;IACxB,MAAM,YAAY,GAAG,IAAI,CAAC,KAAK,CAAC,eAAe,CAAC,CAAC;IACjD,OAAO,YAAY,CAAC;AACtB,CAAC,CAAC;AALW,QAAA,iBAAiB,qBAK5B"}
@@ -1,10 +0,0 @@
1
- import { FunctionDefinition } from '../../core/migration-pipeline';
2
- export interface DynamoTriggerInfo {
3
- functionName: string;
4
- models: string[];
5
- }
6
- export declare class ApiTriggerDetector {
7
- static detectDynamoTriggers(functions: FunctionDefinition[]): DynamoTriggerInfo[];
8
- private static extractTriggeredModels;
9
- }
10
- //# sourceMappingURL=api-trigger-detector.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"api-trigger-detector.d.ts","sourceRoot":"","sources":["../../../../../../src/commands/gen2-migration/generate/adapters/functions/api-trigger-detector.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,kBAAkB,EAAE,MAAM,+BAA+B,CAAC;AAEnE,MAAM,WAAW,iBAAiB;IAChC,YAAY,EAAE,MAAM,CAAC;IACrB,MAAM,EAAE,MAAM,EAAE,CAAC;CAClB;AAED,qBAAa,kBAAkB;IAI7B,MAAM,CAAC,oBAAoB,CAAC,SAAS,EAAE,kBAAkB,EAAE,GAAG,iBAAiB,EAAE;IAwBjF,OAAO,CAAC,MAAM,CAAC,sBAAsB;CAwBtC"}
@@ -1,43 +0,0 @@
1
- "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.ApiTriggerDetector = void 0;
7
- const amplify_cli_core_1 = require("@aws-amplify/amplify-cli-core");
8
- const path_1 = __importDefault(require("path"));
9
- class ApiTriggerDetector {
10
- static detectDynamoTriggers(functions) {
11
- const triggers = [];
12
- for (const func of functions) {
13
- if (func.resourceName) {
14
- const models = this.extractTriggeredModels(func.resourceName);
15
- if (models.length > 0) {
16
- triggers.push({ functionName: func.resourceName, models });
17
- }
18
- }
19
- }
20
- return triggers;
21
- }
22
- static extractTriggeredModels(functionName) {
23
- var _a, _b;
24
- const templatePath = path_1.default.join('amplify', 'backend', 'function', functionName, `${functionName}-cloudformation-template.json`);
25
- const { cfnTemplate } = (0, amplify_cli_core_1.readCFNTemplate)(templatePath);
26
- const models = [];
27
- for (const [, resource] of Object.entries(cfnTemplate.Resources || {})) {
28
- if (resource.Type === 'AWS::Lambda::EventSourceMapping' && ((_a = resource.Properties) === null || _a === void 0 ? void 0 : _a.EventSourceArn)) {
29
- const eventSourceArn = resource.Properties.EventSourceArn;
30
- if ((_b = eventSourceArn['Fn::ImportValue']) === null || _b === void 0 ? void 0 : _b['Fn::Sub']) {
31
- const importValue = eventSourceArn['Fn::ImportValue']['Fn::Sub'];
32
- const match = importValue.match(/:GetAtt:(\w+)Table:StreamArn/);
33
- if (match) {
34
- models.push(match[1]);
35
- }
36
- }
37
- }
38
- }
39
- return models;
40
- }
41
- }
42
- exports.ApiTriggerDetector = ApiTriggerDetector;
43
- //# sourceMappingURL=api-trigger-detector.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"api-trigger-detector.js","sourceRoot":"","sources":["../../../../../../src/commands/gen2-migration/generate/adapters/functions/api-trigger-detector.ts"],"names":[],"mappings":";;;;;;AAAA,oEAAgE;AAChE,gDAAwB;AAQxB,MAAa,kBAAkB;IAI7B,MAAM,CAAC,oBAAoB,CAAC,SAA+B;QACzD,MAAM,QAAQ,GAAwB,EAAE,CAAC;QAEzC,KAAK,MAAM,IAAI,IAAI,SAAS,EAAE,CAAC;YAC7B,IAAI,IAAI,CAAC,YAAY,EAAE,CAAC;gBACtB,MAAM,MAAM,GAAG,IAAI,CAAC,sBAAsB,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC;gBAC9D,IAAI,MAAM,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;oBACtB,QAAQ,CAAC,IAAI,CAAC,EAAE,YAAY,EAAE,IAAI,CAAC,YAAY,EAAE,MAAM,EAAE,CAAC,CAAC;gBAC7D,CAAC;YACH,CAAC;QACH,CAAC;QAED,OAAO,QAAQ,CAAC;IAClB,CAAC;IAWO,MAAM,CAAC,sBAAsB,CAAC,YAAoB;;QACxD,MAAM,YAAY,GAAG,cAAI,CAAC,IAAI,CAAC,SAAS,EAAE,SAAS,EAAE,UAAU,EAAE,YAAY,EAAE,GAAG,YAAY,+BAA+B,CAAC,CAAC;QAC/H,MAAM,EAAE,WAAW,EAAE,GAAG,IAAA,kCAAe,EAAC,YAAY,CAAC,CAAC;QACtD,MAAM,MAAM,GAAa,EAAE,CAAC;QAG5B,KAAK,MAAM,CAAC,EAAE,QAAQ,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,WAAW,CAAC,SAAS,IAAI,EAAE,CAAC,EAAE,CAAC;YACvE,IAAI,QAAQ,CAAC,IAAI,KAAK,iCAAiC,KAAI,MAAA,QAAQ,CAAC,UAAU,0CAAE,cAAc,CAAA,EAAE,CAAC;gBAC/F,MAAM,cAAc,GAAG,QAAQ,CAAC,UAAU,CAAC,cAAc,CAAC;gBAG1D,IAAI,MAAA,cAAc,CAAC,iBAAiB,CAAC,0CAAG,SAAS,CAAC,EAAE,CAAC;oBACnD,MAAM,WAAW,GAAG,cAAc,CAAC,iBAAiB,CAAC,CAAC,SAAS,CAAC,CAAC;oBAEjE,MAAM,KAAK,GAAG,WAAW,CAAC,KAAK,CAAC,8BAA8B,CAAC,CAAC;oBAChE,IAAI,KAAK,EAAE,CAAC;wBACV,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC;oBACxB,CAAC;gBACH,CAAC;YACH,CAAC;QACH,CAAC;QAED,OAAO,MAAM,CAAC;IAChB,CAAC;CACF;AApDD,gDAoDC"}
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=api-trigger-detector.test.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"api-trigger-detector.test.d.ts","sourceRoot":"","sources":["../../../../../../src/commands/gen2-migration/generate/adapters/functions/api-trigger-detector.test.ts"],"names":[],"mappings":""}
@@ -1,34 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const api_trigger_detector_1 = require("./api-trigger-detector");
4
- const amplify_cli_core_1 = require("@aws-amplify/amplify-cli-core");
5
- jest.mock('@aws-amplify/amplify-cli-core');
6
- const mockReadCFNTemplate = amplify_cli_core_1.readCFNTemplate;
7
- describe('ApiTriggerDetector', () => {
8
- it('should return empty array when no functions', () => {
9
- expect(api_trigger_detector_1.ApiTriggerDetector.detectDynamoTriggers([])).toEqual([]);
10
- });
11
- it('should detect DynamoDB trigger', () => {
12
- const functions = [{ resourceName: 'testFunc' }];
13
- mockReadCFNTemplate.mockReturnValue({
14
- templateFormat: amplify_cli_core_1.CFNTemplateFormat.JSON,
15
- cfnTemplate: {
16
- Resources: {
17
- LambdaEventSourceMappingPost: {
18
- Type: 'AWS::Lambda::EventSourceMapping',
19
- Properties: {
20
- EventSourceArn: {
21
- 'Fn::ImportValue': {
22
- 'Fn::Sub': '${apidiscussionsfinalGraphQLAPIIdOutput}:GetAtt:PostTable:StreamArn',
23
- },
24
- },
25
- },
26
- },
27
- },
28
- },
29
- });
30
- const result = api_trigger_detector_1.ApiTriggerDetector.detectDynamoTriggers(functions);
31
- expect(result).toEqual([{ functionName: 'testFunc', models: ['Post'] }]);
32
- });
33
- });
34
- //# sourceMappingURL=api-trigger-detector.test.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"api-trigger-detector.test.js","sourceRoot":"","sources":["../../../../../../src/commands/gen2-migration/generate/adapters/functions/api-trigger-detector.test.ts"],"names":[],"mappings":";;AAAA,iEAA4D;AAE5D,oEAAmF;AAEnF,IAAI,CAAC,IAAI,CAAC,+BAA+B,CAAC,CAAC;AAC3C,MAAM,mBAAmB,GAAG,kCAA8D,CAAC;AAE3F,QAAQ,CAAC,oBAAoB,EAAE,GAAG,EAAE;IAClC,EAAE,CAAC,6CAA6C,EAAE,GAAG,EAAE;QACrD,MAAM,CAAC,yCAAkB,CAAC,oBAAoB,CAAC,EAAE,CAAC,CAAC,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC;IAClE,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,gCAAgC,EAAE,GAAG,EAAE;QACxC,MAAM,SAAS,GAAyB,CAAC,EAAE,YAAY,EAAE,UAAU,EAAE,CAAC,CAAC;QAEvE,mBAAmB,CAAC,eAAe,CAAC;YAClC,cAAc,EAAE,oCAAiB,CAAC,IAAI;YACtC,WAAW,EAAE;gBACX,SAAS,EAAE;oBACT,4BAA4B,EAAE;wBAC5B,IAAI,EAAE,iCAAiC;wBACvC,UAAU,EAAE;4BACV,cAAc,EAAE;gCACd,iBAAiB,EAAE;oCACjB,SAAS,EAAE,qEAAqE;iCACjF;6BACF;yBACF;qBACF;iBACF;aACF;SACF,CAAC,CAAC;QAEH,MAAM,MAAM,GAAG,yCAAkB,CAAC,oBAAoB,CAAC,SAAS,CAAC,CAAC;QAClE,MAAM,CAAC,MAAM,CAAC,CAAC,OAAO,CAAC,CAAC,EAAE,YAAY,EAAE,UAAU,EAAE,MAAM,EAAE,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC,CAAC;IAC3E,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
@@ -1,18 +0,0 @@
1
- import { FunctionDefinition } from '../../core/migration-pipeline';
2
- import { FunctionConfiguration } from '@aws-sdk/client-lambda';
3
- import { AuthAccess } from '../../generators/functions/index';
4
- export type AmplifyMetaFunction = {
5
- service: string;
6
- providerPlugin: 'awscloudformation';
7
- output: Record<string, string>;
8
- };
9
- type FunctionSchedule = {
10
- functionName: string;
11
- scheduleExpression: string | undefined;
12
- };
13
- export type AmplifyMetaWithFunction = {
14
- function: Record<string, AmplifyMetaFunction>;
15
- };
16
- export declare const getFunctionDefinition: (functionConfigurations: FunctionConfiguration[], functionSchedules: FunctionSchedule[], functionCategoryMap: Map<string, string>, meta: AmplifyMetaWithFunction, functionAuthAccess?: Map<string, AuthAccess>) => FunctionDefinition[];
17
- export {};
18
- //# sourceMappingURL=index.d.ts.map