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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (704) hide show
  1. package/CHANGELOG.md +16 -0
  2. package/adr/001-refactor-gen2-migration-generate.md +413 -0
  3. package/adr/002-refactor-gen2-migration-refactor.md +593 -0
  4. package/adr/003-gen2-migration-assess.md +414 -0
  5. package/adr/004-gen2-migration-validation-modeling.md +336 -0
  6. package/aws-amplify-cli-internal-gen2-migration-experimental-alpha-0.7.0.tgz +0 -0
  7. package/bin/amplify +1 -1
  8. package/lib/commands/drift-detection/detect-local-drift.d.ts +1 -2
  9. package/lib/commands/drift-detection/detect-local-drift.d.ts.map +1 -1
  10. package/lib/commands/drift-detection/detect-local-drift.js +19 -6
  11. package/lib/commands/drift-detection/detect-local-drift.js.map +1 -1
  12. package/lib/commands/drift-detection/detect-stack-drift.d.ts +20 -9
  13. package/lib/commands/drift-detection/detect-stack-drift.d.ts.map +1 -1
  14. package/lib/commands/drift-detection/detect-stack-drift.js +121 -151
  15. package/lib/commands/drift-detection/detect-stack-drift.js.map +1 -1
  16. package/lib/commands/drift-detection/detect-template-drift.d.ts +8 -21
  17. package/lib/commands/drift-detection/detect-template-drift.d.ts.map +1 -1
  18. package/lib/commands/drift-detection/detect-template-drift.js +81 -89
  19. package/lib/commands/drift-detection/detect-template-drift.js.map +1 -1
  20. package/lib/commands/drift-detection/index.d.ts +2 -3
  21. package/lib/commands/drift-detection/index.d.ts.map +1 -1
  22. package/lib/commands/drift-detection/index.js +1 -3
  23. package/lib/commands/drift-detection/index.js.map +1 -1
  24. package/lib/commands/drift-detection/services/amplify-config-service.d.ts +0 -1
  25. package/lib/commands/drift-detection/services/amplify-config-service.d.ts.map +1 -1
  26. package/lib/commands/drift-detection/services/amplify-config-service.js +0 -16
  27. package/lib/commands/drift-detection/services/amplify-config-service.js.map +1 -1
  28. package/lib/commands/drift-detection/services/cloudformation-service.d.ts +2 -4
  29. package/lib/commands/drift-detection/services/cloudformation-service.d.ts.map +1 -1
  30. package/lib/commands/drift-detection/services/cloudformation-service.js +7 -11
  31. package/lib/commands/drift-detection/services/cloudformation-service.js.map +1 -1
  32. package/lib/commands/drift-detection/services/drift-formatter.d.ts +3 -70
  33. package/lib/commands/drift-detection/services/drift-formatter.d.ts.map +1 -1
  34. package/lib/commands/drift-detection/services/drift-formatter.js +148 -603
  35. package/lib/commands/drift-detection/services/drift-formatter.js.map +1 -1
  36. package/lib/commands/drift-detection/services/index.d.ts +1 -2
  37. package/lib/commands/drift-detection/services/index.d.ts.map +1 -1
  38. package/lib/commands/drift-detection/services/index.js +2 -4
  39. package/lib/commands/drift-detection/services/index.js.map +1 -1
  40. package/lib/commands/drift.d.ts +7 -18
  41. package/lib/commands/drift.d.ts.map +1 -1
  42. package/lib/commands/drift.js +71 -172
  43. package/lib/commands/drift.js.map +1 -1
  44. package/lib/commands/gen2-migration/_infra/aws-clients.d.ts +31 -0
  45. package/lib/commands/gen2-migration/_infra/aws-clients.d.ts.map +1 -0
  46. package/lib/commands/gen2-migration/_infra/aws-clients.js +64 -0
  47. package/lib/commands/gen2-migration/_infra/aws-clients.js.map +1 -0
  48. package/lib/commands/gen2-migration/_infra/categories.d.ts +2 -0
  49. package/lib/commands/gen2-migration/_infra/categories.d.ts.map +1 -0
  50. package/lib/commands/gen2-migration/_infra/categories.js +32 -0
  51. package/lib/commands/gen2-migration/_infra/categories.js.map +1 -0
  52. package/lib/commands/gen2-migration/_infra/cfn-template.d.ts +52 -0
  53. package/lib/commands/gen2-migration/_infra/cfn-template.d.ts.map +1 -0
  54. package/lib/commands/gen2-migration/_infra/cfn-template.js +21 -0
  55. package/lib/commands/gen2-migration/_infra/cfn-template.js.map +1 -0
  56. package/lib/commands/gen2-migration/_infra/operation.d.ts +16 -0
  57. package/lib/commands/gen2-migration/_infra/operation.d.ts.map +1 -0
  58. package/lib/commands/gen2-migration/_infra/operation.js +3 -0
  59. package/lib/commands/gen2-migration/_infra/operation.js.map +1 -0
  60. package/lib/commands/gen2-migration/_infra/plan.d.ts +21 -0
  61. package/lib/commands/gen2-migration/_infra/plan.d.ts.map +1 -0
  62. package/lib/commands/gen2-migration/_infra/plan.js +111 -0
  63. package/lib/commands/gen2-migration/_infra/plan.js.map +1 -0
  64. package/lib/commands/gen2-migration/_infra/planner.d.ts +5 -0
  65. package/lib/commands/gen2-migration/_infra/planner.d.ts.map +1 -0
  66. package/lib/commands/gen2-migration/{generate/custom-resources/types.js → _infra/planner.js} +1 -1
  67. package/lib/commands/gen2-migration/_infra/planner.js.map +1 -0
  68. package/lib/commands/gen2-migration/_infra/spinning-logger.d.ts +25 -0
  69. package/lib/commands/gen2-migration/_infra/spinning-logger.d.ts.map +1 -0
  70. package/lib/commands/gen2-migration/_infra/spinning-logger.js +115 -0
  71. package/lib/commands/gen2-migration/_infra/spinning-logger.js.map +1 -0
  72. package/lib/commands/gen2-migration/_infra/stateful-resources.d.ts.map +1 -0
  73. package/lib/commands/gen2-migration/_infra/stateful-resources.js.map +1 -0
  74. package/lib/commands/gen2-migration/_infra/step.d.ts +15 -0
  75. package/lib/commands/gen2-migration/_infra/step.d.ts.map +1 -0
  76. package/lib/commands/gen2-migration/_infra/step.js +13 -0
  77. package/lib/commands/gen2-migration/_infra/step.js.map +1 -0
  78. package/lib/commands/gen2-migration/{_validations.d.ts → _infra/validations.d.ts} +6 -7
  79. package/lib/commands/gen2-migration/_infra/validations.d.ts.map +1 -0
  80. package/lib/commands/gen2-migration/{_validations.js → _infra/validations.js} +24 -60
  81. package/lib/commands/gen2-migration/_infra/validations.js.map +1 -0
  82. package/lib/commands/gen2-migration/assess/analytics/kinesis.assessor.d.ts +10 -0
  83. package/lib/commands/gen2-migration/assess/analytics/kinesis.assessor.d.ts.map +1 -0
  84. package/lib/commands/gen2-migration/assess/analytics/kinesis.assessor.js +15 -0
  85. package/lib/commands/gen2-migration/assess/analytics/kinesis.assessor.js.map +1 -0
  86. package/lib/commands/gen2-migration/assess/api/data.assessor.d.ts +10 -0
  87. package/lib/commands/gen2-migration/assess/api/data.assessor.d.ts.map +1 -0
  88. package/lib/commands/gen2-migration/assess/api/data.assessor.js +25 -0
  89. package/lib/commands/gen2-migration/assess/api/data.assessor.js.map +1 -0
  90. package/lib/commands/gen2-migration/assess/api/rest-api.assessor.d.ts +10 -0
  91. package/lib/commands/gen2-migration/assess/api/rest-api.assessor.d.ts.map +1 -0
  92. package/lib/commands/gen2-migration/assess/api/rest-api.assessor.js +25 -0
  93. package/lib/commands/gen2-migration/assess/api/rest-api.assessor.js.map +1 -0
  94. package/lib/commands/gen2-migration/assess/assessment.d.ts +42 -0
  95. package/lib/commands/gen2-migration/assess/assessment.d.ts.map +1 -0
  96. package/lib/commands/gen2-migration/assess/assessment.js +118 -0
  97. package/lib/commands/gen2-migration/assess/assessment.js.map +1 -0
  98. package/lib/commands/gen2-migration/assess/assessor.d.ts +5 -0
  99. package/lib/commands/gen2-migration/assess/assessor.d.ts.map +1 -0
  100. package/lib/commands/gen2-migration/{generate/types.js → assess/assessor.js} +1 -1
  101. package/lib/commands/gen2-migration/assess/assessor.js.map +1 -0
  102. package/lib/commands/gen2-migration/assess/auth/auth-cognito.assessor.d.ts +10 -0
  103. package/lib/commands/gen2-migration/assess/auth/auth-cognito.assessor.d.ts.map +1 -0
  104. package/lib/commands/gen2-migration/assess/auth/auth-cognito.assessor.js +30 -0
  105. package/lib/commands/gen2-migration/assess/auth/auth-cognito.assessor.js.map +1 -0
  106. package/lib/commands/gen2-migration/assess/auth/auth-user-pool-groups.assessor.d.ts +10 -0
  107. package/lib/commands/gen2-migration/assess/auth/auth-user-pool-groups.assessor.d.ts.map +1 -0
  108. package/lib/commands/gen2-migration/assess/auth/auth-user-pool-groups.assessor.js +24 -0
  109. package/lib/commands/gen2-migration/assess/auth/auth-user-pool-groups.assessor.js.map +1 -0
  110. package/lib/commands/gen2-migration/assess/function/function.assessor.d.ts +12 -0
  111. package/lib/commands/gen2-migration/assess/function/function.assessor.d.ts.map +1 -0
  112. package/lib/commands/gen2-migration/assess/function/function.assessor.js +40 -0
  113. package/lib/commands/gen2-migration/assess/function/function.assessor.js.map +1 -0
  114. package/lib/commands/gen2-migration/assess/geo/geo-geofence-collection.assessor.d.ts +10 -0
  115. package/lib/commands/gen2-migration/assess/geo/geo-geofence-collection.assessor.d.ts.map +1 -0
  116. package/lib/commands/gen2-migration/assess/geo/geo-geofence-collection.assessor.js +19 -0
  117. package/lib/commands/gen2-migration/assess/geo/geo-geofence-collection.assessor.js.map +1 -0
  118. package/lib/commands/gen2-migration/assess/geo/geo-map.assessor.d.ts +10 -0
  119. package/lib/commands/gen2-migration/assess/geo/geo-map.assessor.d.ts.map +1 -0
  120. package/lib/commands/gen2-migration/assess/geo/geo-map.assessor.js +15 -0
  121. package/lib/commands/gen2-migration/assess/geo/geo-map.assessor.js.map +1 -0
  122. package/lib/commands/gen2-migration/assess/geo/geo-place-index.assessor.d.ts +10 -0
  123. package/lib/commands/gen2-migration/assess/geo/geo-place-index.assessor.d.ts.map +1 -0
  124. package/lib/commands/gen2-migration/assess/geo/geo-place-index.assessor.js +15 -0
  125. package/lib/commands/gen2-migration/assess/geo/geo-place-index.assessor.js.map +1 -0
  126. package/lib/commands/gen2-migration/assess/storage/dynamodb.assessor.d.ts +10 -0
  127. package/lib/commands/gen2-migration/assess/storage/dynamodb.assessor.d.ts.map +1 -0
  128. package/lib/commands/gen2-migration/assess/storage/dynamodb.assessor.js +25 -0
  129. package/lib/commands/gen2-migration/assess/storage/dynamodb.assessor.js.map +1 -0
  130. package/lib/commands/gen2-migration/assess/storage/s3.assessor.d.ts +10 -0
  131. package/lib/commands/gen2-migration/assess/storage/s3.assessor.d.ts.map +1 -0
  132. package/lib/commands/gen2-migration/assess/storage/s3.assessor.js +25 -0
  133. package/lib/commands/gen2-migration/assess/storage/s3.assessor.js.map +1 -0
  134. package/lib/commands/gen2-migration/assess.d.ts +9 -0
  135. package/lib/commands/gen2-migration/assess.d.ts.map +1 -0
  136. package/lib/commands/gen2-migration/assess.js +80 -0
  137. package/lib/commands/gen2-migration/assess.js.map +1 -0
  138. package/lib/commands/gen2-migration/decommission.d.ts +6 -5
  139. package/lib/commands/gen2-migration/decommission.d.ts.map +1 -1
  140. package/lib/commands/gen2-migration/decommission.js +82 -25
  141. package/lib/commands/gen2-migration/decommission.js.map +1 -1
  142. package/lib/commands/gen2-migration/generate/_infra/aws-fetcher.d.ts +32 -0
  143. package/lib/commands/gen2-migration/generate/_infra/aws-fetcher.d.ts.map +1 -0
  144. package/lib/commands/gen2-migration/generate/_infra/aws-fetcher.js +136 -0
  145. package/lib/commands/gen2-migration/generate/_infra/aws-fetcher.js.map +1 -0
  146. package/lib/commands/gen2-migration/generate/_infra/files.d.ts +2 -0
  147. package/lib/commands/gen2-migration/generate/_infra/files.d.ts.map +1 -0
  148. package/lib/commands/gen2-migration/generate/{codegen-head/directory_exists.js → _infra/files.js} +4 -5
  149. package/lib/commands/gen2-migration/generate/_infra/files.js.map +1 -0
  150. package/lib/commands/gen2-migration/generate/_infra/gen1-app.d.ts +40 -0
  151. package/lib/commands/gen2-migration/generate/_infra/gen1-app.d.ts.map +1 -0
  152. package/lib/commands/gen2-migration/generate/_infra/gen1-app.js +198 -0
  153. package/lib/commands/gen2-migration/generate/_infra/gen1-app.js.map +1 -0
  154. package/lib/commands/gen2-migration/generate/_infra/ts.d.ts +24 -0
  155. package/lib/commands/gen2-migration/generate/_infra/ts.d.ts.map +1 -0
  156. package/lib/commands/gen2-migration/generate/_infra/ts.js +128 -0
  157. package/lib/commands/gen2-migration/generate/_infra/ts.js.map +1 -0
  158. package/lib/commands/gen2-migration/generate/amplify/analytics/cfn-condition-resolver.d.ts +18 -0
  159. package/lib/commands/gen2-migration/generate/amplify/analytics/cfn-condition-resolver.d.ts.map +1 -0
  160. package/lib/commands/gen2-migration/generate/amplify/analytics/cfn-condition-resolver.js +126 -0
  161. package/lib/commands/gen2-migration/generate/amplify/analytics/cfn-condition-resolver.js.map +1 -0
  162. package/lib/commands/gen2-migration/generate/amplify/analytics/kinesis-cfn-converter.d.ts +33 -0
  163. package/lib/commands/gen2-migration/generate/amplify/analytics/kinesis-cfn-converter.d.ts.map +1 -0
  164. package/lib/commands/gen2-migration/generate/{unsupported/cdk-from-cfn.js → amplify/analytics/kinesis-cfn-converter.js} +94 -52
  165. package/lib/commands/gen2-migration/generate/amplify/analytics/kinesis-cfn-converter.js.map +1 -0
  166. package/lib/commands/gen2-migration/generate/amplify/analytics/kinesis.generator.d.ts +14 -0
  167. package/lib/commands/gen2-migration/generate/amplify/analytics/kinesis.generator.d.ts.map +1 -0
  168. package/lib/commands/gen2-migration/generate/amplify/analytics/kinesis.generator.js +69 -0
  169. package/lib/commands/gen2-migration/generate/amplify/analytics/kinesis.generator.js.map +1 -0
  170. package/lib/commands/gen2-migration/generate/amplify/analytics/kinesis.renderer.d.ts +18 -0
  171. package/lib/commands/gen2-migration/generate/amplify/analytics/kinesis.renderer.d.ts.map +1 -0
  172. package/lib/commands/gen2-migration/generate/amplify/analytics/kinesis.renderer.js +68 -0
  173. package/lib/commands/gen2-migration/generate/amplify/analytics/kinesis.renderer.js.map +1 -0
  174. package/lib/commands/gen2-migration/generate/amplify/auth/auth.generator.d.ts +24 -0
  175. package/lib/commands/gen2-migration/generate/amplify/auth/auth.generator.d.ts.map +1 -0
  176. package/lib/commands/gen2-migration/generate/amplify/auth/auth.generator.js +233 -0
  177. package/lib/commands/gen2-migration/generate/amplify/auth/auth.generator.js.map +1 -0
  178. package/lib/commands/gen2-migration/generate/amplify/auth/auth.renderer.d.ts +78 -0
  179. package/lib/commands/gen2-migration/generate/amplify/auth/auth.renderer.d.ts.map +1 -0
  180. package/lib/commands/gen2-migration/generate/amplify/auth/auth.renderer.js +491 -0
  181. package/lib/commands/gen2-migration/generate/amplify/auth/auth.renderer.js.map +1 -0
  182. package/lib/commands/gen2-migration/generate/amplify/auth/reference-auth.generator.d.ts +15 -0
  183. package/lib/commands/gen2-migration/generate/amplify/auth/reference-auth.generator.d.ts.map +1 -0
  184. package/lib/commands/gen2-migration/generate/amplify/auth/reference-auth.generator.js +75 -0
  185. package/lib/commands/gen2-migration/generate/amplify/auth/reference-auth.generator.js.map +1 -0
  186. package/lib/commands/gen2-migration/generate/amplify/auth/reference-auth.renderer.d.ts +13 -0
  187. package/lib/commands/gen2-migration/generate/amplify/auth/reference-auth.renderer.d.ts.map +1 -0
  188. package/lib/commands/gen2-migration/generate/amplify/auth/reference-auth.renderer.js +33 -0
  189. package/lib/commands/gen2-migration/generate/amplify/auth/reference-auth.renderer.js.map +1 -0
  190. package/lib/commands/gen2-migration/generate/amplify/backend.generator.d.ts +22 -0
  191. package/lib/commands/gen2-migration/generate/amplify/backend.generator.d.ts.map +1 -0
  192. package/lib/commands/gen2-migration/generate/amplify/backend.generator.js +150 -0
  193. package/lib/commands/gen2-migration/generate/amplify/backend.generator.js.map +1 -0
  194. package/lib/commands/gen2-migration/generate/{custom-resources/transformer → amplify/custom-resources}/amplify-helper-transformer.d.ts +4 -0
  195. package/lib/commands/gen2-migration/generate/amplify/custom-resources/amplify-helper-transformer.d.ts.map +1 -0
  196. package/lib/commands/gen2-migration/generate/amplify/custom-resources/amplify-helper-transformer.js +333 -0
  197. package/lib/commands/gen2-migration/generate/amplify/custom-resources/amplify-helper-transformer.js.map +1 -0
  198. package/lib/commands/gen2-migration/generate/amplify/custom-resources/custom.generator.d.ts +17 -0
  199. package/lib/commands/gen2-migration/generate/amplify/custom-resources/custom.generator.d.ts.map +1 -0
  200. package/lib/commands/gen2-migration/generate/amplify/custom-resources/custom.generator.js +190 -0
  201. package/lib/commands/gen2-migration/generate/amplify/custom-resources/custom.generator.js.map +1 -0
  202. package/lib/commands/gen2-migration/generate/amplify/data/data.generator.d.ts +15 -0
  203. package/lib/commands/gen2-migration/generate/amplify/data/data.generator.d.ts.map +1 -0
  204. package/lib/commands/gen2-migration/generate/amplify/data/data.generator.js +112 -0
  205. package/lib/commands/gen2-migration/generate/amplify/data/data.generator.js.map +1 -0
  206. package/lib/commands/gen2-migration/generate/amplify/data/data.renderer.d.ts +22 -0
  207. package/lib/commands/gen2-migration/generate/amplify/data/data.renderer.d.ts.map +1 -0
  208. package/lib/commands/gen2-migration/generate/amplify/data/data.renderer.js +167 -0
  209. package/lib/commands/gen2-migration/generate/amplify/data/data.renderer.js.map +1 -0
  210. package/lib/commands/gen2-migration/generate/amplify/function/function.generator.d.ts +49 -0
  211. package/lib/commands/gen2-migration/generate/amplify/function/function.generator.d.ts.map +1 -0
  212. package/lib/commands/gen2-migration/generate/amplify/function/function.generator.js +626 -0
  213. package/lib/commands/gen2-migration/generate/amplify/function/function.generator.js.map +1 -0
  214. package/lib/commands/gen2-migration/generate/amplify/function/function.renderer.d.ts +21 -0
  215. package/lib/commands/gen2-migration/generate/amplify/function/function.renderer.d.ts.map +1 -0
  216. package/lib/commands/gen2-migration/generate/amplify/function/function.renderer.js +105 -0
  217. package/lib/commands/gen2-migration/generate/amplify/function/function.renderer.js.map +1 -0
  218. package/lib/commands/gen2-migration/generate/amplify/geo/geo-cfn-converter.d.ts +49 -0
  219. package/lib/commands/gen2-migration/generate/amplify/geo/geo-cfn-converter.d.ts.map +1 -0
  220. package/lib/commands/gen2-migration/generate/amplify/geo/geo-cfn-converter.js +239 -0
  221. package/lib/commands/gen2-migration/generate/amplify/geo/geo-cfn-converter.js.map +1 -0
  222. package/lib/commands/gen2-migration/generate/amplify/geo/geo.generator.d.ts +14 -0
  223. package/lib/commands/gen2-migration/generate/amplify/geo/geo.generator.d.ts.map +1 -0
  224. package/lib/commands/gen2-migration/generate/amplify/geo/geo.generator.js +70 -0
  225. package/lib/commands/gen2-migration/generate/amplify/geo/geo.generator.js.map +1 -0
  226. package/lib/commands/gen2-migration/generate/amplify/geo/geo.renderer.d.ts +13 -0
  227. package/lib/commands/gen2-migration/generate/amplify/geo/geo.renderer.d.ts.map +1 -0
  228. package/lib/commands/gen2-migration/generate/amplify/geo/geo.renderer.js +161 -0
  229. package/lib/commands/gen2-migration/generate/amplify/geo/geo.renderer.js.map +1 -0
  230. package/lib/commands/gen2-migration/generate/amplify/package.json.generator.d.ts +8 -0
  231. package/lib/commands/gen2-migration/generate/amplify/package.json.generator.d.ts.map +1 -0
  232. package/lib/commands/gen2-migration/generate/amplify/package.json.generator.js +28 -0
  233. package/lib/commands/gen2-migration/generate/amplify/package.json.generator.js.map +1 -0
  234. package/lib/commands/gen2-migration/generate/amplify/rest-api/rest-api.generator.d.ts +15 -0
  235. package/lib/commands/gen2-migration/generate/amplify/rest-api/rest-api.generator.d.ts.map +1 -0
  236. package/lib/commands/gen2-migration/generate/amplify/rest-api/rest-api.generator.js +162 -0
  237. package/lib/commands/gen2-migration/generate/amplify/rest-api/rest-api.generator.js.map +1 -0
  238. package/lib/commands/gen2-migration/generate/amplify/rest-api/rest-api.renderer.d.ts +51 -0
  239. package/lib/commands/gen2-migration/generate/amplify/rest-api/rest-api.renderer.d.ts.map +1 -0
  240. package/lib/commands/gen2-migration/generate/amplify/rest-api/rest-api.renderer.js +269 -0
  241. package/lib/commands/gen2-migration/generate/amplify/rest-api/rest-api.renderer.js.map +1 -0
  242. package/lib/commands/gen2-migration/generate/amplify/storage/dynamodb.generator.d.ts +14 -0
  243. package/lib/commands/gen2-migration/generate/amplify/storage/dynamodb.generator.d.ts.map +1 -0
  244. package/lib/commands/gen2-migration/generate/amplify/storage/dynamodb.generator.js +96 -0
  245. package/lib/commands/gen2-migration/generate/amplify/storage/dynamodb.generator.js.map +1 -0
  246. package/lib/commands/gen2-migration/generate/amplify/storage/dynamodb.renderer.d.ts +30 -0
  247. package/lib/commands/gen2-migration/generate/amplify/storage/dynamodb.renderer.d.ts.map +1 -0
  248. package/lib/commands/gen2-migration/generate/amplify/storage/dynamodb.renderer.js +90 -0
  249. package/lib/commands/gen2-migration/generate/amplify/storage/dynamodb.renderer.js.map +1 -0
  250. package/lib/commands/gen2-migration/generate/amplify/storage/s3.generator.d.ts +22 -0
  251. package/lib/commands/gen2-migration/generate/amplify/storage/s3.generator.d.ts.map +1 -0
  252. package/lib/commands/gen2-migration/generate/amplify/storage/s3.generator.js +132 -0
  253. package/lib/commands/gen2-migration/generate/amplify/storage/s3.generator.js.map +1 -0
  254. package/lib/commands/gen2-migration/generate/amplify/storage/s3.renderer.d.ts +31 -0
  255. package/lib/commands/gen2-migration/generate/amplify/storage/s3.renderer.d.ts.map +1 -0
  256. package/lib/commands/gen2-migration/generate/amplify/storage/s3.renderer.js +137 -0
  257. package/lib/commands/gen2-migration/generate/amplify/storage/s3.renderer.js.map +1 -0
  258. package/lib/commands/gen2-migration/generate/amplify/tsconfig.generator.d.ts +8 -0
  259. package/lib/commands/gen2-migration/generate/amplify/tsconfig.generator.d.ts.map +1 -0
  260. package/lib/commands/gen2-migration/generate/amplify/tsconfig.generator.js +45 -0
  261. package/lib/commands/gen2-migration/generate/amplify/tsconfig.generator.js.map +1 -0
  262. package/lib/commands/gen2-migration/generate/amplify.yml.generator.d.ts +9 -0
  263. package/lib/commands/gen2-migration/generate/amplify.yml.generator.d.ts.map +1 -0
  264. package/lib/commands/gen2-migration/generate/amplify.yml.generator.js +112 -0
  265. package/lib/commands/gen2-migration/generate/amplify.yml.generator.js.map +1 -0
  266. package/lib/commands/gen2-migration/generate/gitignore.generator.d.ts +6 -0
  267. package/lib/commands/gen2-migration/generate/gitignore.generator.d.ts.map +1 -0
  268. package/lib/commands/gen2-migration/generate/gitignore.generator.js +45 -0
  269. package/lib/commands/gen2-migration/generate/gitignore.generator.js.map +1 -0
  270. package/lib/commands/gen2-migration/generate/package.json.generator.d.ts +12 -0
  271. package/lib/commands/gen2-migration/generate/package.json.generator.d.ts.map +1 -0
  272. package/lib/commands/gen2-migration/generate/package.json.generator.js +83 -0
  273. package/lib/commands/gen2-migration/generate/package.json.generator.js.map +1 -0
  274. package/lib/commands/gen2-migration/generate.d.ts +6 -5
  275. package/lib/commands/gen2-migration/generate.d.ts.map +1 -1
  276. package/lib/commands/gen2-migration/generate.js +232 -17
  277. package/lib/commands/gen2-migration/generate.js.map +1 -1
  278. package/lib/commands/gen2-migration/lock.d.ts +10 -6
  279. package/lib/commands/gen2-migration/lock.d.ts.map +1 -1
  280. package/lib/commands/gen2-migration/lock.js +182 -64
  281. package/lib/commands/gen2-migration/lock.js.map +1 -1
  282. package/lib/commands/gen2-migration/refactor/analytics/analytics-forward.d.ts +9 -0
  283. package/lib/commands/gen2-migration/refactor/analytics/analytics-forward.d.ts.map +1 -0
  284. package/lib/commands/gen2-migration/refactor/analytics/analytics-forward.js +19 -0
  285. package/lib/commands/gen2-migration/refactor/analytics/analytics-forward.js.map +1 -0
  286. package/lib/commands/gen2-migration/refactor/analytics/analytics-rollback.d.ts +9 -0
  287. package/lib/commands/gen2-migration/refactor/analytics/analytics-rollback.d.ts.map +1 -0
  288. package/lib/commands/gen2-migration/refactor/analytics/analytics-rollback.js +26 -0
  289. package/lib/commands/gen2-migration/refactor/analytics/analytics-rollback.js.map +1 -0
  290. package/lib/commands/gen2-migration/refactor/auth/auth-cognito-forward.d.ts +21 -0
  291. package/lib/commands/gen2-migration/refactor/auth/auth-cognito-forward.d.ts.map +1 -0
  292. package/lib/commands/gen2-migration/refactor/auth/auth-cognito-forward.js +87 -0
  293. package/lib/commands/gen2-migration/refactor/auth/auth-cognito-forward.js.map +1 -0
  294. package/lib/commands/gen2-migration/refactor/auth/auth-cognito-rollback.d.ts +9 -0
  295. package/lib/commands/gen2-migration/refactor/auth/auth-cognito-rollback.d.ts.map +1 -0
  296. package/lib/commands/gen2-migration/refactor/auth/auth-cognito-rollback.js +44 -0
  297. package/lib/commands/gen2-migration/refactor/auth/auth-cognito-rollback.js.map +1 -0
  298. package/lib/commands/gen2-migration/refactor/auth/auth-user-pool-groups-forward.d.ts +11 -0
  299. package/lib/commands/gen2-migration/refactor/auth/auth-user-pool-groups-forward.d.ts.map +1 -0
  300. package/lib/commands/gen2-migration/refactor/auth/auth-user-pool-groups-forward.js +33 -0
  301. package/lib/commands/gen2-migration/refactor/auth/auth-user-pool-groups-forward.js.map +1 -0
  302. package/lib/commands/gen2-migration/refactor/auth/auth-user-pool-groups-rollback.d.ts +9 -0
  303. package/lib/commands/gen2-migration/refactor/auth/auth-user-pool-groups-rollback.d.ts.map +1 -0
  304. package/lib/commands/gen2-migration/refactor/auth/auth-user-pool-groups-rollback.js +26 -0
  305. package/lib/commands/gen2-migration/refactor/auth/auth-user-pool-groups-rollback.js.map +1 -0
  306. package/lib/commands/gen2-migration/refactor/cfn.d.ts +41 -0
  307. package/lib/commands/gen2-migration/refactor/cfn.d.ts.map +1 -0
  308. package/lib/commands/gen2-migration/refactor/cfn.js +337 -0
  309. package/lib/commands/gen2-migration/refactor/cfn.js.map +1 -0
  310. package/lib/commands/gen2-migration/refactor/index.d.ts +1 -1
  311. package/lib/commands/gen2-migration/refactor/index.d.ts.map +1 -1
  312. package/lib/commands/gen2-migration/refactor/index.js +1 -1
  313. package/lib/commands/gen2-migration/refactor/index.js.map +1 -1
  314. package/lib/commands/gen2-migration/refactor/oauth-values-retriever.d.ts +23 -11
  315. package/lib/commands/gen2-migration/refactor/oauth-values-retriever.d.ts.map +1 -1
  316. package/lib/commands/gen2-migration/refactor/oauth-values-retriever.js +53 -45
  317. package/lib/commands/gen2-migration/refactor/oauth-values-retriever.js.map +1 -1
  318. package/lib/commands/gen2-migration/refactor/resolvers/cfn-condition-resolver.d.ts +2 -11
  319. package/lib/commands/gen2-migration/refactor/resolvers/cfn-condition-resolver.d.ts.map +1 -1
  320. package/lib/commands/gen2-migration/refactor/resolvers/cfn-condition-resolver.js +89 -123
  321. package/lib/commands/gen2-migration/refactor/resolvers/cfn-condition-resolver.js.map +1 -1
  322. package/lib/commands/gen2-migration/refactor/resolvers/cfn-dependency-resolver.d.ts +2 -7
  323. package/lib/commands/gen2-migration/refactor/resolvers/cfn-dependency-resolver.d.ts.map +1 -1
  324. package/lib/commands/gen2-migration/refactor/resolvers/cfn-dependency-resolver.js +6 -22
  325. package/lib/commands/gen2-migration/refactor/resolvers/cfn-dependency-resolver.js.map +1 -1
  326. package/lib/commands/gen2-migration/refactor/resolvers/cfn-output-resolver.d.ts +8 -12
  327. package/lib/commands/gen2-migration/refactor/resolvers/cfn-output-resolver.d.ts.map +1 -1
  328. package/lib/commands/gen2-migration/refactor/resolvers/cfn-output-resolver.js +105 -127
  329. package/lib/commands/gen2-migration/refactor/resolvers/cfn-output-resolver.js.map +1 -1
  330. package/lib/commands/gen2-migration/refactor/resolvers/cfn-parameter-resolver.d.ts +2 -8
  331. package/lib/commands/gen2-migration/refactor/resolvers/cfn-parameter-resolver.d.ts.map +1 -1
  332. package/lib/commands/gen2-migration/refactor/resolvers/cfn-parameter-resolver.js +36 -41
  333. package/lib/commands/gen2-migration/refactor/resolvers/cfn-parameter-resolver.js.map +1 -1
  334. package/lib/commands/gen2-migration/refactor/resolvers/cfn-tree-walker.d.ts +3 -0
  335. package/lib/commands/gen2-migration/refactor/resolvers/cfn-tree-walker.d.ts.map +1 -0
  336. package/lib/commands/gen2-migration/refactor/resolvers/cfn-tree-walker.js +18 -0
  337. package/lib/commands/gen2-migration/refactor/resolvers/cfn-tree-walker.js.map +1 -0
  338. package/lib/commands/gen2-migration/refactor/stack-facade.d.ts +13 -0
  339. package/lib/commands/gen2-migration/refactor/stack-facade.d.ts.map +1 -0
  340. package/lib/commands/gen2-migration/refactor/stack-facade.js +39 -0
  341. package/lib/commands/gen2-migration/refactor/stack-facade.js.map +1 -0
  342. package/lib/commands/gen2-migration/refactor/storage/storage-dynamo-forward.d.ts +8 -0
  343. package/lib/commands/gen2-migration/refactor/storage/storage-dynamo-forward.d.ts.map +1 -0
  344. package/lib/commands/gen2-migration/refactor/storage/storage-dynamo-forward.js +18 -0
  345. package/lib/commands/gen2-migration/refactor/storage/storage-dynamo-forward.js.map +1 -0
  346. package/lib/commands/gen2-migration/refactor/storage/storage-dynamo-rollback.d.ts +9 -0
  347. package/lib/commands/gen2-migration/refactor/storage/storage-dynamo-rollback.d.ts.map +1 -0
  348. package/lib/commands/gen2-migration/refactor/storage/storage-dynamo-rollback.js +26 -0
  349. package/lib/commands/gen2-migration/refactor/storage/storage-dynamo-rollback.js.map +1 -0
  350. package/lib/commands/gen2-migration/refactor/storage/storage-forward.d.ts +10 -0
  351. package/lib/commands/gen2-migration/refactor/storage/storage-forward.d.ts.map +1 -0
  352. package/lib/commands/gen2-migration/refactor/storage/storage-forward.js +36 -0
  353. package/lib/commands/gen2-migration/refactor/storage/storage-forward.js.map +1 -0
  354. package/lib/commands/gen2-migration/refactor/storage/storage-rollback.d.ts +9 -0
  355. package/lib/commands/gen2-migration/refactor/storage/storage-rollback.d.ts.map +1 -0
  356. package/lib/commands/gen2-migration/refactor/storage/storage-rollback.js +26 -0
  357. package/lib/commands/gen2-migration/refactor/storage/storage-rollback.js.map +1 -0
  358. package/lib/commands/gen2-migration/refactor/utils.d.ts +1 -1
  359. package/lib/commands/gen2-migration/refactor/utils.d.ts.map +1 -1
  360. package/lib/commands/gen2-migration/refactor/utils.js +2 -2
  361. package/lib/commands/gen2-migration/refactor/utils.js.map +1 -1
  362. package/lib/commands/gen2-migration/refactor/workflow/category-refactorer.d.ts +52 -0
  363. package/lib/commands/gen2-migration/refactor/workflow/category-refactorer.d.ts.map +1 -0
  364. package/lib/commands/gen2-migration/refactor/workflow/category-refactorer.js +212 -0
  365. package/lib/commands/gen2-migration/refactor/workflow/category-refactorer.js.map +1 -0
  366. package/lib/commands/gen2-migration/refactor/workflow/forward-category-refactorer.d.ts +15 -0
  367. package/lib/commands/gen2-migration/refactor/workflow/forward-category-refactorer.d.ts.map +1 -0
  368. package/lib/commands/gen2-migration/refactor/workflow/forward-category-refactorer.js +148 -0
  369. package/lib/commands/gen2-migration/refactor/workflow/forward-category-refactorer.js.map +1 -0
  370. package/lib/commands/gen2-migration/refactor/workflow/rollback-category-refactorer.d.ts +13 -0
  371. package/lib/commands/gen2-migration/refactor/workflow/rollback-category-refactorer.d.ts.map +1 -0
  372. package/lib/commands/gen2-migration/refactor/workflow/rollback-category-refactorer.js +123 -0
  373. package/lib/commands/gen2-migration/refactor/workflow/rollback-category-refactorer.js.map +1 -0
  374. package/lib/commands/gen2-migration/refactor.d.ts +11 -0
  375. package/lib/commands/gen2-migration/refactor.d.ts.map +1 -0
  376. package/lib/commands/gen2-migration/refactor.js +189 -0
  377. package/lib/commands/gen2-migration/refactor.js.map +1 -0
  378. package/lib/commands/gen2-migration.d.ts +0 -12
  379. package/lib/commands/gen2-migration.d.ts.map +1 -1
  380. package/lib/commands/gen2-migration.js +82 -111
  381. package/lib/commands/gen2-migration.js.map +1 -1
  382. package/package.json +22 -12
  383. package/aws-amplify-cli-internal-gen2-migration-experimental-alpha-0.5.0.tgz +0 -0
  384. package/lib/commands/drift-detection/services/file-service.d.ts +0 -7
  385. package/lib/commands/drift-detection/services/file-service.d.ts.map +0 -1
  386. package/lib/commands/drift-detection/services/file-service.js +0 -53
  387. package/lib/commands/drift-detection/services/file-service.js.map +0 -1
  388. package/lib/commands/gen2-migration/_step.d.ts +0 -17
  389. package/lib/commands/gen2-migration/_step.d.ts.map +0 -1
  390. package/lib/commands/gen2-migration/_step.js +0 -16
  391. package/lib/commands/gen2-migration/_step.js.map +0 -1
  392. package/lib/commands/gen2-migration/_validations.d.ts.map +0 -1
  393. package/lib/commands/gen2-migration/_validations.js.map +0 -1
  394. package/lib/commands/gen2-migration/cleanup.d.ts +0 -8
  395. package/lib/commands/gen2-migration/cleanup.d.ts.map +0 -1
  396. package/lib/commands/gen2-migration/cleanup.js +0 -21
  397. package/lib/commands/gen2-migration/cleanup.js.map +0 -1
  398. package/lib/commands/gen2-migration/clone.d.ts +0 -8
  399. package/lib/commands/gen2-migration/clone.d.ts.map +0 -1
  400. package/lib/commands/gen2-migration/clone.js +0 -21
  401. package/lib/commands/gen2-migration/clone.js.map +0 -1
  402. package/lib/commands/gen2-migration/generate/adapters/auth/index.d.ts +0 -24
  403. package/lib/commands/gen2-migration/generate/adapters/auth/index.d.ts.map +0 -1
  404. package/lib/commands/gen2-migration/generate/adapters/auth/index.js +0 -297
  405. package/lib/commands/gen2-migration/generate/adapters/auth/index.js.map +0 -1
  406. package/lib/commands/gen2-migration/generate/adapters/auth/index.test.d.ts +0 -2
  407. package/lib/commands/gen2-migration/generate/adapters/auth/index.test.d.ts.map +0 -1
  408. package/lib/commands/gen2-migration/generate/adapters/auth/index.test.js +0 -140
  409. package/lib/commands/gen2-migration/generate/adapters/auth/index.test.js.map +0 -1
  410. package/lib/commands/gen2-migration/generate/adapters/data/index.d.ts +0 -5
  411. package/lib/commands/gen2-migration/generate/adapters/data/index.d.ts.map +0 -1
  412. package/lib/commands/gen2-migration/generate/adapters/data/index.js +0 -17
  413. package/lib/commands/gen2-migration/generate/adapters/data/index.js.map +0 -1
  414. package/lib/commands/gen2-migration/generate/adapters/functions/api-trigger-detector.d.ts +0 -10
  415. package/lib/commands/gen2-migration/generate/adapters/functions/api-trigger-detector.d.ts.map +0 -1
  416. package/lib/commands/gen2-migration/generate/adapters/functions/api-trigger-detector.js +0 -43
  417. package/lib/commands/gen2-migration/generate/adapters/functions/api-trigger-detector.js.map +0 -1
  418. package/lib/commands/gen2-migration/generate/adapters/functions/api-trigger-detector.test.d.ts +0 -2
  419. package/lib/commands/gen2-migration/generate/adapters/functions/api-trigger-detector.test.d.ts.map +0 -1
  420. package/lib/commands/gen2-migration/generate/adapters/functions/api-trigger-detector.test.js +0 -34
  421. package/lib/commands/gen2-migration/generate/adapters/functions/api-trigger-detector.test.js.map +0 -1
  422. package/lib/commands/gen2-migration/generate/adapters/functions/index.d.ts +0 -18
  423. package/lib/commands/gen2-migration/generate/adapters/functions/index.d.ts.map +0 -1
  424. package/lib/commands/gen2-migration/generate/adapters/functions/index.js +0 -85
  425. package/lib/commands/gen2-migration/generate/adapters/functions/index.js.map +0 -1
  426. package/lib/commands/gen2-migration/generate/adapters/project/index.d.ts +0 -2
  427. package/lib/commands/gen2-migration/generate/adapters/project/index.d.ts.map +0 -1
  428. package/lib/commands/gen2-migration/generate/adapters/project/index.js +0 -7
  429. package/lib/commands/gen2-migration/generate/adapters/project/index.js.map +0 -1
  430. package/lib/commands/gen2-migration/generate/adapters/storage/gen1_storage_codegen_adapter.d.ts +0 -31
  431. package/lib/commands/gen2-migration/generate/adapters/storage/gen1_storage_codegen_adapter.d.ts.map +0 -1
  432. package/lib/commands/gen2-migration/generate/adapters/storage/gen1_storage_codegen_adapter.js +0 -34
  433. package/lib/commands/gen2-migration/generate/adapters/storage/gen1_storage_codegen_adapter.js.map +0 -1
  434. package/lib/commands/gen2-migration/generate/adapters/storage/gen1_storage_codegen_adapter.test.d.ts +0 -2
  435. package/lib/commands/gen2-migration/generate/adapters/storage/gen1_storage_codegen_adapter.test.d.ts.map +0 -1
  436. package/lib/commands/gen2-migration/generate/adapters/storage/gen1_storage_codegen_adapter.test.js +0 -181
  437. package/lib/commands/gen2-migration/generate/adapters/storage/gen1_storage_codegen_adapter.test.js.map +0 -1
  438. package/lib/commands/gen2-migration/generate/adapters/storage/index.d.ts +0 -3
  439. package/lib/commands/gen2-migration/generate/adapters/storage/index.d.ts.map +0 -1
  440. package/lib/commands/gen2-migration/generate/adapters/storage/index.js +0 -10
  441. package/lib/commands/gen2-migration/generate/adapters/storage/index.js.map +0 -1
  442. package/lib/commands/gen2-migration/generate/adapters/storage/storage_access.d.ts +0 -25
  443. package/lib/commands/gen2-migration/generate/adapters/storage/storage_access.d.ts.map +0 -1
  444. package/lib/commands/gen2-migration/generate/adapters/storage/storage_access.js +0 -76
  445. package/lib/commands/gen2-migration/generate/adapters/storage/storage_access.js.map +0 -1
  446. package/lib/commands/gen2-migration/generate/adapters/storage/storage_access.test.d.ts +0 -2
  447. package/lib/commands/gen2-migration/generate/adapters/storage/storage_access.test.d.ts.map +0 -1
  448. package/lib/commands/gen2-migration/generate/adapters/storage/storage_access.test.js +0 -125
  449. package/lib/commands/gen2-migration/generate/adapters/storage/storage_access.test.js.map +0 -1
  450. package/lib/commands/gen2-migration/generate/backend/synthesizer.d.ts +0 -91
  451. package/lib/commands/gen2-migration/generate/backend/synthesizer.d.ts.map +0 -1
  452. package/lib/commands/gen2-migration/generate/backend/synthesizer.js +0 -1014
  453. package/lib/commands/gen2-migration/generate/backend/synthesizer.js.map +0 -1
  454. package/lib/commands/gen2-migration/generate/backend/synthesizer.test.d.ts +0 -2
  455. package/lib/commands/gen2-migration/generate/backend/synthesizer.test.d.ts.map +0 -1
  456. package/lib/commands/gen2-migration/generate/backend/synthesizer.test.js +0 -777
  457. package/lib/commands/gen2-migration/generate/backend/synthesizer.test.js.map +0 -1
  458. package/lib/commands/gen2-migration/generate/codegen-head/amplify_stack_parser.d.ts +0 -14
  459. package/lib/commands/gen2-migration/generate/codegen-head/amplify_stack_parser.d.ts.map +0 -1
  460. package/lib/commands/gen2-migration/generate/codegen-head/amplify_stack_parser.js +0 -82
  461. package/lib/commands/gen2-migration/generate/codegen-head/amplify_stack_parser.js.map +0 -1
  462. package/lib/commands/gen2-migration/generate/codegen-head/analytics.d.ts +0 -10
  463. package/lib/commands/gen2-migration/generate/codegen-head/analytics.d.ts.map +0 -1
  464. package/lib/commands/gen2-migration/generate/codegen-head/analytics.js +0 -11
  465. package/lib/commands/gen2-migration/generate/codegen-head/analytics.js.map +0 -1
  466. package/lib/commands/gen2-migration/generate/codegen-head/api-cfn-access.d.ts +0 -7
  467. package/lib/commands/gen2-migration/generate/codegen-head/api-cfn-access.d.ts.map +0 -1
  468. package/lib/commands/gen2-migration/generate/codegen-head/api-cfn-access.js +0 -80
  469. package/lib/commands/gen2-migration/generate/codegen-head/api-cfn-access.js.map +0 -1
  470. package/lib/commands/gen2-migration/generate/codegen-head/app_analytics_definition_fetcher.d.ts +0 -13
  471. package/lib/commands/gen2-migration/generate/codegen-head/app_analytics_definition_fetcher.d.ts.map +0 -1
  472. package/lib/commands/gen2-migration/generate/codegen-head/app_analytics_definition_fetcher.js +0 -59
  473. package/lib/commands/gen2-migration/generate/codegen-head/app_analytics_definition_fetcher.js.map +0 -1
  474. package/lib/commands/gen2-migration/generate/codegen-head/app_auth_definition_fetcher.d.ts +0 -24
  475. package/lib/commands/gen2-migration/generate/codegen-head/app_auth_definition_fetcher.d.ts.map +0 -1
  476. package/lib/commands/gen2-migration/generate/codegen-head/app_auth_definition_fetcher.js +0 -167
  477. package/lib/commands/gen2-migration/generate/codegen-head/app_auth_definition_fetcher.js.map +0 -1
  478. package/lib/commands/gen2-migration/generate/codegen-head/app_functions_definition_fetcher.d.ts +0 -21
  479. package/lib/commands/gen2-migration/generate/codegen-head/app_functions_definition_fetcher.d.ts.map +0 -1
  480. package/lib/commands/gen2-migration/generate/codegen-head/app_functions_definition_fetcher.js +0 -135
  481. package/lib/commands/gen2-migration/generate/codegen-head/app_functions_definition_fetcher.js.map +0 -1
  482. package/lib/commands/gen2-migration/generate/codegen-head/app_storage_definition_fetcher.d.ts +0 -23
  483. package/lib/commands/gen2-migration/generate/codegen-head/app_storage_definition_fetcher.d.ts.map +0 -1
  484. package/lib/commands/gen2-migration/generate/codegen-head/app_storage_definition_fetcher.js +0 -181
  485. package/lib/commands/gen2-migration/generate/codegen-head/app_storage_definition_fetcher.js.map +0 -1
  486. package/lib/commands/gen2-migration/generate/codegen-head/auth_access_analyzer.d.ts +0 -12
  487. package/lib/commands/gen2-migration/generate/codegen-head/auth_access_analyzer.d.ts.map +0 -1
  488. package/lib/commands/gen2-migration/generate/codegen-head/auth_access_analyzer.js +0 -157
  489. package/lib/commands/gen2-migration/generate/codegen-head/auth_access_analyzer.js.map +0 -1
  490. package/lib/commands/gen2-migration/generate/codegen-head/backend_downloader.d.ts +0 -10
  491. package/lib/commands/gen2-migration/generate/codegen-head/backend_downloader.d.ts.map +0 -1
  492. package/lib/commands/gen2-migration/generate/codegen-head/backend_downloader.js +0 -48
  493. package/lib/commands/gen2-migration/generate/codegen-head/backend_downloader.js.map +0 -1
  494. package/lib/commands/gen2-migration/generate/codegen-head/backend_environment_selector.d.ts +0 -11
  495. package/lib/commands/gen2-migration/generate/codegen-head/backend_environment_selector.d.ts.map +0 -1
  496. package/lib/commands/gen2-migration/generate/codegen-head/backend_environment_selector.js +0 -38
  497. package/lib/commands/gen2-migration/generate/codegen-head/backend_environment_selector.js.map +0 -1
  498. package/lib/commands/gen2-migration/generate/codegen-head/command-handlers.d.ts +0 -13
  499. package/lib/commands/gen2-migration/generate/codegen-head/command-handlers.d.ts.map +0 -1
  500. package/lib/commands/gen2-migration/generate/codegen-head/command-handlers.js +0 -498
  501. package/lib/commands/gen2-migration/generate/codegen-head/command-handlers.js.map +0 -1
  502. package/lib/commands/gen2-migration/generate/codegen-head/data_definition_fetcher.d.ts +0 -47
  503. package/lib/commands/gen2-migration/generate/codegen-head/data_definition_fetcher.d.ts.map +0 -1
  504. package/lib/commands/gen2-migration/generate/codegen-head/data_definition_fetcher.js +0 -222
  505. package/lib/commands/gen2-migration/generate/codegen-head/data_definition_fetcher.js.map +0 -1
  506. package/lib/commands/gen2-migration/generate/codegen-head/data_model_access_parser.d.ts +0 -10
  507. package/lib/commands/gen2-migration/generate/codegen-head/data_model_access_parser.d.ts.map +0 -1
  508. package/lib/commands/gen2-migration/generate/codegen-head/data_model_access_parser.js +0 -59
  509. package/lib/commands/gen2-migration/generate/codegen-head/data_model_access_parser.js.map +0 -1
  510. package/lib/commands/gen2-migration/generate/codegen-head/data_model_access_parser.test.d.ts +0 -2
  511. package/lib/commands/gen2-migration/generate/codegen-head/data_model_access_parser.test.d.ts.map +0 -1
  512. package/lib/commands/gen2-migration/generate/codegen-head/data_model_access_parser.test.js +0 -90
  513. package/lib/commands/gen2-migration/generate/codegen-head/data_model_access_parser.test.js.map +0 -1
  514. package/lib/commands/gen2-migration/generate/codegen-head/directory_exists.d.ts +0 -2
  515. package/lib/commands/gen2-migration/generate/codegen-head/directory_exists.d.ts.map +0 -1
  516. package/lib/commands/gen2-migration/generate/codegen-head/directory_exists.js.map +0 -1
  517. package/lib/commands/gen2-migration/generate/codegen-head/dynamodb_cfn_access_parser.d.ts +0 -14
  518. package/lib/commands/gen2-migration/generate/codegen-head/dynamodb_cfn_access_parser.d.ts.map +0 -1
  519. package/lib/commands/gen2-migration/generate/codegen-head/dynamodb_cfn_access_parser.js +0 -100
  520. package/lib/commands/gen2-migration/generate/codegen-head/dynamodb_cfn_access_parser.js.map +0 -1
  521. package/lib/commands/gen2-migration/generate/codegen-head/dynamodb_cfn_access_parser.test.d.ts +0 -2
  522. package/lib/commands/gen2-migration/generate/codegen-head/dynamodb_cfn_access_parser.test.d.ts.map +0 -1
  523. package/lib/commands/gen2-migration/generate/codegen-head/dynamodb_cfn_access_parser.test.js +0 -69
  524. package/lib/commands/gen2-migration/generate/codegen-head/dynamodb_cfn_access_parser.test.js.map +0 -1
  525. package/lib/commands/gen2-migration/generate/codegen-head/format.d.ts +0 -8
  526. package/lib/commands/gen2-migration/generate/codegen-head/format.d.ts.map +0 -1
  527. package/lib/commands/gen2-migration/generate/codegen-head/format.js +0 -66
  528. package/lib/commands/gen2-migration/generate/codegen-head/format.js.map +0 -1
  529. package/lib/commands/gen2-migration/generate/codegen-head/logger.d.ts +0 -15
  530. package/lib/commands/gen2-migration/generate/codegen-head/logger.d.ts.map +0 -1
  531. package/lib/commands/gen2-migration/generate/codegen-head/logger.js +0 -14
  532. package/lib/commands/gen2-migration/generate/codegen-head/logger.js.map +0 -1
  533. package/lib/commands/gen2-migration/generate/codegen-head/printer.d.ts +0 -26
  534. package/lib/commands/gen2-migration/generate/codegen-head/printer.d.ts.map +0 -1
  535. package/lib/commands/gen2-migration/generate/codegen-head/printer.js +0 -103
  536. package/lib/commands/gen2-migration/generate/codegen-head/printer.js.map +0 -1
  537. package/lib/commands/gen2-migration/generate/codegen-head/s3_cfn_access_parser.d.ts +0 -13
  538. package/lib/commands/gen2-migration/generate/codegen-head/s3_cfn_access_parser.d.ts.map +0 -1
  539. package/lib/commands/gen2-migration/generate/codegen-head/s3_cfn_access_parser.js +0 -66
  540. package/lib/commands/gen2-migration/generate/codegen-head/s3_cfn_access_parser.js.map +0 -1
  541. package/lib/commands/gen2-migration/generate/codegen-head/s3_cfn_access_parser.test.d.ts +0 -2
  542. package/lib/commands/gen2-migration/generate/codegen-head/s3_cfn_access_parser.test.d.ts.map +0 -1
  543. package/lib/commands/gen2-migration/generate/codegen-head/s3_cfn_access_parser.test.js +0 -97
  544. package/lib/commands/gen2-migration/generate/codegen-head/s3_cfn_access_parser.test.js.map +0 -1
  545. package/lib/commands/gen2-migration/generate/core/migration-pipeline.d.ts +0 -26
  546. package/lib/commands/gen2-migration/generate/core/migration-pipeline.d.ts.map +0 -1
  547. package/lib/commands/gen2-migration/generate/core/migration-pipeline.js +0 -269
  548. package/lib/commands/gen2-migration/generate/core/migration-pipeline.js.map +0 -1
  549. package/lib/commands/gen2-migration/generate/custom-resources/generator/backend-updater.d.ts +0 -7
  550. package/lib/commands/gen2-migration/generate/custom-resources/generator/backend-updater.d.ts.map +0 -1
  551. package/lib/commands/gen2-migration/generate/custom-resources/generator/backend-updater.js +0 -84
  552. package/lib/commands/gen2-migration/generate/custom-resources/generator/backend-updater.js.map +0 -1
  553. package/lib/commands/gen2-migration/generate/custom-resources/generator/dependency-merger.d.ts +0 -8
  554. package/lib/commands/gen2-migration/generate/custom-resources/generator/dependency-merger.d.ts.map +0 -1
  555. package/lib/commands/gen2-migration/generate/custom-resources/generator/dependency-merger.js +0 -105
  556. package/lib/commands/gen2-migration/generate/custom-resources/generator/dependency-merger.js.map +0 -1
  557. package/lib/commands/gen2-migration/generate/custom-resources/generator/file-converter.d.ts +0 -5
  558. package/lib/commands/gen2-migration/generate/custom-resources/generator/file-converter.d.ts.map +0 -1
  559. package/lib/commands/gen2-migration/generate/custom-resources/generator/file-converter.js +0 -88
  560. package/lib/commands/gen2-migration/generate/custom-resources/generator/file-converter.js.map +0 -1
  561. package/lib/commands/gen2-migration/generate/custom-resources/generator/gen2-file-generator.d.ts +0 -8
  562. package/lib/commands/gen2-migration/generate/custom-resources/generator/gen2-file-generator.d.ts.map +0 -1
  563. package/lib/commands/gen2-migration/generate/custom-resources/generator/gen2-file-generator.js +0 -36
  564. package/lib/commands/gen2-migration/generate/custom-resources/generator/gen2-file-generator.js.map +0 -1
  565. package/lib/commands/gen2-migration/generate/custom-resources/parser/cdk-stack-parser.d.ts +0 -5
  566. package/lib/commands/gen2-migration/generate/custom-resources/parser/cdk-stack-parser.d.ts.map +0 -1
  567. package/lib/commands/gen2-migration/generate/custom-resources/parser/cdk-stack-parser.js +0 -81
  568. package/lib/commands/gen2-migration/generate/custom-resources/parser/cdk-stack-parser.js.map +0 -1
  569. package/lib/commands/gen2-migration/generate/custom-resources/parser/pattern-detector.d.ts +0 -15
  570. package/lib/commands/gen2-migration/generate/custom-resources/parser/pattern-detector.d.ts.map +0 -1
  571. package/lib/commands/gen2-migration/generate/custom-resources/parser/pattern-detector.js +0 -35
  572. package/lib/commands/gen2-migration/generate/custom-resources/parser/pattern-detector.js.map +0 -1
  573. package/lib/commands/gen2-migration/generate/custom-resources/scanner/custom-resource-scanner.d.ts +0 -5
  574. package/lib/commands/gen2-migration/generate/custom-resources/scanner/custom-resource-scanner.d.ts.map +0 -1
  575. package/lib/commands/gen2-migration/generate/custom-resources/scanner/custom-resource-scanner.js +0 -66
  576. package/lib/commands/gen2-migration/generate/custom-resources/scanner/custom-resource-scanner.js.map +0 -1
  577. package/lib/commands/gen2-migration/generate/custom-resources/transformer/amplify-helper-transformer.d.ts.map +0 -1
  578. package/lib/commands/gen2-migration/generate/custom-resources/transformer/amplify-helper-transformer.js +0 -178
  579. package/lib/commands/gen2-migration/generate/custom-resources/transformer/amplify-helper-transformer.js.map +0 -1
  580. package/lib/commands/gen2-migration/generate/custom-resources/types.d.ts +0 -38
  581. package/lib/commands/gen2-migration/generate/custom-resources/types.d.ts.map +0 -1
  582. package/lib/commands/gen2-migration/generate/custom-resources/types.js.map +0 -1
  583. package/lib/commands/gen2-migration/generate/generators/analytics/index.d.ts +0 -9
  584. package/lib/commands/gen2-migration/generate/generators/analytics/index.d.ts.map +0 -1
  585. package/lib/commands/gen2-migration/generate/generators/analytics/index.js +0 -40
  586. package/lib/commands/gen2-migration/generate/generators/analytics/index.js.map +0 -1
  587. package/lib/commands/gen2-migration/generate/generators/auth/index.d.ts +0 -107
  588. package/lib/commands/gen2-migration/generate/generators/auth/index.d.ts.map +0 -1
  589. package/lib/commands/gen2-migration/generate/generators/auth/index.js +0 -313
  590. package/lib/commands/gen2-migration/generate/generators/auth/index.js.map +0 -1
  591. package/lib/commands/gen2-migration/generate/generators/auth/index.test.d.ts +0 -2
  592. package/lib/commands/gen2-migration/generate/generators/auth/index.test.d.ts.map +0 -1
  593. package/lib/commands/gen2-migration/generate/generators/auth/index.test.js +0 -566
  594. package/lib/commands/gen2-migration/generate/generators/auth/index.test.js.map +0 -1
  595. package/lib/commands/gen2-migration/generate/generators/data/index.d.ts +0 -35
  596. package/lib/commands/gen2-migration/generate/generators/data/index.d.ts.map +0 -1
  597. package/lib/commands/gen2-migration/generate/generators/data/index.js +0 -185
  598. package/lib/commands/gen2-migration/generate/generators/data/index.js.map +0 -1
  599. package/lib/commands/gen2-migration/generate/generators/data/index.test.d.ts +0 -2
  600. package/lib/commands/gen2-migration/generate/generators/data/index.test.d.ts.map +0 -1
  601. package/lib/commands/gen2-migration/generate/generators/data/index.test.js +0 -47
  602. package/lib/commands/gen2-migration/generate/generators/data/index.test.js.map +0 -1
  603. package/lib/commands/gen2-migration/generate/generators/functions/index.d.ts +0 -53
  604. package/lib/commands/gen2-migration/generate/generators/functions/index.d.ts.map +0 -1
  605. package/lib/commands/gen2-migration/generate/generators/functions/index.js +0 -125
  606. package/lib/commands/gen2-migration/generate/generators/functions/index.js.map +0 -1
  607. package/lib/commands/gen2-migration/generate/generators/functions/lambda.d.ts +0 -6
  608. package/lib/commands/gen2-migration/generate/generators/functions/lambda.d.ts.map +0 -1
  609. package/lib/commands/gen2-migration/generate/generators/functions/lambda.js +0 -16
  610. package/lib/commands/gen2-migration/generate/generators/functions/lambda.js.map +0 -1
  611. package/lib/commands/gen2-migration/generate/generators/functions/lambda_env_generator.d.ts +0 -3
  612. package/lib/commands/gen2-migration/generate/generators/functions/lambda_env_generator.d.ts.map +0 -1
  613. package/lib/commands/gen2-migration/generate/generators/functions/lambda_env_generator.js +0 -106
  614. package/lib/commands/gen2-migration/generate/generators/functions/lambda_env_generator.js.map +0 -1
  615. package/lib/commands/gen2-migration/generate/generators/functions/lambda_env_generator.test.d.ts +0 -2
  616. package/lib/commands/gen2-migration/generate/generators/functions/lambda_env_generator.test.d.ts.map +0 -1
  617. package/lib/commands/gen2-migration/generate/generators/functions/lambda_env_generator.test.js +0 -120
  618. package/lib/commands/gen2-migration/generate/generators/functions/lambda_env_generator.test.js.map +0 -1
  619. package/lib/commands/gen2-migration/generate/generators/storage/access.d.ts +0 -4
  620. package/lib/commands/gen2-migration/generate/generators/storage/access.d.ts.map +0 -1
  621. package/lib/commands/gen2-migration/generate/generators/storage/access.js +0 -73
  622. package/lib/commands/gen2-migration/generate/generators/storage/access.js.map +0 -1
  623. package/lib/commands/gen2-migration/generate/generators/storage/index.d.ts +0 -37
  624. package/lib/commands/gen2-migration/generate/generators/storage/index.d.ts.map +0 -1
  625. package/lib/commands/gen2-migration/generate/generators/storage/index.js +0 -78
  626. package/lib/commands/gen2-migration/generate/generators/storage/index.js.map +0 -1
  627. package/lib/commands/gen2-migration/generate/npm_package/renderer.d.ts +0 -27
  628. package/lib/commands/gen2-migration/generate/npm_package/renderer.d.ts.map +0 -1
  629. package/lib/commands/gen2-migration/generate/npm_package/renderer.js +0 -28
  630. package/lib/commands/gen2-migration/generate/npm_package/renderer.js.map +0 -1
  631. package/lib/commands/gen2-migration/generate/render_pipeline.d.ts +0 -9
  632. package/lib/commands/gen2-migration/generate/render_pipeline.d.ts.map +0 -1
  633. package/lib/commands/gen2-migration/generate/render_pipeline.js +0 -15
  634. package/lib/commands/gen2-migration/generate/render_pipeline.js.map +0 -1
  635. package/lib/commands/gen2-migration/generate/renderers/ensure_directory.d.ts +0 -7
  636. package/lib/commands/gen2-migration/generate/renderers/ensure_directory.d.ts.map +0 -1
  637. package/lib/commands/gen2-migration/generate/renderers/ensure_directory.js +0 -17
  638. package/lib/commands/gen2-migration/generate/renderers/ensure_directory.js.map +0 -1
  639. package/lib/commands/gen2-migration/generate/renderers/package_json.d.ts +0 -8
  640. package/lib/commands/gen2-migration/generate/renderers/package_json.d.ts.map +0 -1
  641. package/lib/commands/gen2-migration/generate/renderers/package_json.js +0 -15
  642. package/lib/commands/gen2-migration/generate/renderers/package_json.js.map +0 -1
  643. package/lib/commands/gen2-migration/generate/renderers/typescript_block_node.d.ts +0 -11
  644. package/lib/commands/gen2-migration/generate/renderers/typescript_block_node.d.ts.map +0 -1
  645. package/lib/commands/gen2-migration/generate/renderers/typescript_block_node.js +0 -22
  646. package/lib/commands/gen2-migration/generate/renderers/typescript_block_node.js.map +0 -1
  647. package/lib/commands/gen2-migration/generate/resource/resource.d.ts +0 -20
  648. package/lib/commands/gen2-migration/generate/resource/resource.d.ts.map +0 -1
  649. package/lib/commands/gen2-migration/generate/resource/resource.js +0 -60
  650. package/lib/commands/gen2-migration/generate/resource/resource.js.map +0 -1
  651. package/lib/commands/gen2-migration/generate/test_utils/import_regex.d.ts +0 -2
  652. package/lib/commands/gen2-migration/generate/test_utils/import_regex.d.ts.map +0 -1
  653. package/lib/commands/gen2-migration/generate/test_utils/import_regex.js +0 -6
  654. package/lib/commands/gen2-migration/generate/test_utils/import_regex.js.map +0 -1
  655. package/lib/commands/gen2-migration/generate/test_utils/ts_node_printer.d.ts +0 -4
  656. package/lib/commands/gen2-migration/generate/test_utils/ts_node_printer.d.ts.map +0 -1
  657. package/lib/commands/gen2-migration/generate/test_utils/ts_node_printer.js +0 -22
  658. package/lib/commands/gen2-migration/generate/test_utils/ts_node_printer.js.map +0 -1
  659. package/lib/commands/gen2-migration/generate/todo_error.d.ts +0 -3
  660. package/lib/commands/gen2-migration/generate/todo_error.d.ts.map +0 -1
  661. package/lib/commands/gen2-migration/generate/todo_error.js +0 -11
  662. package/lib/commands/gen2-migration/generate/todo_error.js.map +0 -1
  663. package/lib/commands/gen2-migration/generate/ts_factory_utils.d.ts +0 -3
  664. package/lib/commands/gen2-migration/generate/ts_factory_utils.d.ts.map +0 -1
  665. package/lib/commands/gen2-migration/generate/ts_factory_utils.js +0 -10
  666. package/lib/commands/gen2-migration/generate/ts_factory_utils.js.map +0 -1
  667. package/lib/commands/gen2-migration/generate/types.d.ts +0 -4
  668. package/lib/commands/gen2-migration/generate/types.d.ts.map +0 -1
  669. package/lib/commands/gen2-migration/generate/types.js.map +0 -1
  670. package/lib/commands/gen2-migration/generate/unsupported/cdk-from-cfn.d.ts +0 -26
  671. package/lib/commands/gen2-migration/generate/unsupported/cdk-from-cfn.d.ts.map +0 -1
  672. package/lib/commands/gen2-migration/generate/unsupported/cdk-from-cfn.js.map +0 -1
  673. package/lib/commands/gen2-migration/refactor/cfn-stack-refactor-updater.d.ts +0 -5
  674. package/lib/commands/gen2-migration/refactor/cfn-stack-refactor-updater.d.ts.map +0 -1
  675. package/lib/commands/gen2-migration/refactor/cfn-stack-refactor-updater.js +0 -76
  676. package/lib/commands/gen2-migration/refactor/cfn-stack-refactor-updater.js.map +0 -1
  677. package/lib/commands/gen2-migration/refactor/cfn-stack-updater.d.ts +0 -6
  678. package/lib/commands/gen2-migration/refactor/cfn-stack-updater.d.ts.map +0 -1
  679. package/lib/commands/gen2-migration/refactor/cfn-stack-updater.js +0 -52
  680. package/lib/commands/gen2-migration/refactor/cfn-stack-updater.js.map +0 -1
  681. package/lib/commands/gen2-migration/refactor/generators/category-template-generator.d.ts +0 -40
  682. package/lib/commands/gen2-migration/refactor/generators/category-template-generator.d.ts.map +0 -1
  683. package/lib/commands/gen2-migration/refactor/generators/category-template-generator.js +0 -321
  684. package/lib/commands/gen2-migration/refactor/generators/category-template-generator.js.map +0 -1
  685. package/lib/commands/gen2-migration/refactor/generators/template-generator.d.ts +0 -48
  686. package/lib/commands/gen2-migration/refactor/generators/template-generator.d.ts.map +0 -1
  687. package/lib/commands/gen2-migration/refactor/generators/template-generator.js +0 -513
  688. package/lib/commands/gen2-migration/refactor/generators/template-generator.js.map +0 -1
  689. package/lib/commands/gen2-migration/refactor/refactor.d.ts +0 -19
  690. package/lib/commands/gen2-migration/refactor/refactor.d.ts.map +0 -1
  691. package/lib/commands/gen2-migration/refactor/refactor.js +0 -241
  692. package/lib/commands/gen2-migration/refactor/refactor.js.map +0 -1
  693. package/lib/commands/gen2-migration/refactor/types.d.ts +0 -128
  694. package/lib/commands/gen2-migration/refactor/types.d.ts.map +0 -1
  695. package/lib/commands/gen2-migration/refactor/types.js +0 -59
  696. package/lib/commands/gen2-migration/refactor/types.js.map +0 -1
  697. package/lib/commands/gen2-migration/shift.d.ts +0 -8
  698. package/lib/commands/gen2-migration/shift.d.ts.map +0 -1
  699. package/lib/commands/gen2-migration/shift.js +0 -21
  700. package/lib/commands/gen2-migration/shift.js.map +0 -1
  701. package/lib/commands/gen2-migration/stateful-resources.d.ts.map +0 -1
  702. package/lib/commands/gen2-migration/stateful-resources.js.map +0 -1
  703. /package/lib/commands/gen2-migration/{stateful-resources.d.ts → _infra/stateful-resources.d.ts} +0 -0
  704. /package/lib/commands/gen2-migration/{stateful-resources.js → _infra/stateful-resources.js} +0 -0
@@ -0,0 +1,491 @@
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.AuthRenderer = void 0;
7
+ const typescript_1 = __importDefault(require("typescript"));
8
+ const client_cognito_identity_provider_1 = require("@aws-sdk/client-cognito-identity-provider");
9
+ const ts_1 = require("../../_infra/ts");
10
+ const factory = typescript_1.default.factory;
11
+ const secretIdentifier = factory.createIdentifier('secret');
12
+ const googleClientID = 'GOOGLE_CLIENT_ID';
13
+ const googleClientSecret = 'GOOGLE_CLIENT_SECRET';
14
+ const amazonClientID = 'LOGINWITHAMAZON_CLIENT_ID';
15
+ const amazonClientSecret = 'LOGINWITHAMAZON_CLIENT_SECRET';
16
+ const facebookClientID = 'FACEBOOK_CLIENT_ID';
17
+ const facebookClientSecret = 'FACEBOOK_CLIENT_SECRET';
18
+ const appleClientID = 'SIWA_CLIENT_ID';
19
+ const appleKeyId = 'SIWA_KEY_ID';
20
+ const applePrivateKey = 'SIWA_PRIVATE_KEY';
21
+ const appleTeamID = 'SIWA_TEAM_ID';
22
+ const oidcClientID = 'OIDC_CLIENT_ID';
23
+ const oidcClientSecret = 'OIDC_CLIENT_SECRET';
24
+ const VALID_SCOPES = ['phone', 'email', 'openid', 'profile', 'aws.cognito.signin.user.admin'];
25
+ const MAPPED_USER_ATTRIBUTE_NAME = {
26
+ address: 'address',
27
+ birthdate: 'birthdate',
28
+ email: 'email',
29
+ family_name: 'familyName',
30
+ gender: 'gender',
31
+ given_name: 'givenName',
32
+ locale: 'locale',
33
+ middle_name: 'middleName',
34
+ name: 'fullname',
35
+ nickname: 'nickname',
36
+ phone_number: 'phoneNumber',
37
+ picture: 'profilePicture',
38
+ preferred_username: 'preferredUsername',
39
+ profile: 'profilePage',
40
+ zoneinfo: 'timezone',
41
+ updated_at: 'lastUpdateTime',
42
+ website: 'website',
43
+ };
44
+ const MAP_IDENTITY_PROVIDER = {
45
+ [client_cognito_identity_provider_1.IdentityProviderTypeType.Google]: ['googleLogin', 'googleAttributes'],
46
+ [client_cognito_identity_provider_1.IdentityProviderTypeType.SignInWithApple]: ['appleLogin', 'appleAttributes'],
47
+ [client_cognito_identity_provider_1.IdentityProviderTypeType.LoginWithAmazon]: ['amazonLogin', 'amazonAttributes'],
48
+ [client_cognito_identity_provider_1.IdentityProviderTypeType.Facebook]: ['facebookLogin', 'facebookAttributes'],
49
+ };
50
+ function createTriggersProperty(triggers) {
51
+ return factory.createPropertyAssignment(factory.createIdentifier('triggers'), factory.createObjectLiteralExpression(triggers.map((t) => factory.createPropertyAssignment(factory.createIdentifier(t.event), factory.createIdentifier(t.resourceName))), true));
52
+ }
53
+ class AuthRenderer {
54
+ render(options) {
55
+ const namedImports = { '@aws-amplify/backend': new Set() };
56
+ return this.renderStandardAuth(options, namedImports);
57
+ }
58
+ renderStandardAuth(options, namedImports) {
59
+ var _a, _b, _c;
60
+ namedImports['@aws-amplify/backend'].add('defineAuth');
61
+ const defineAuthProperties = [];
62
+ const loginFlags = AuthRenderer.deriveLoginFlags(options.identityProviders);
63
+ const hasExternalProviders = loginFlags.googleLogin ||
64
+ loginFlags.amazonLogin ||
65
+ loginFlags.appleLogin ||
66
+ loginFlags.facebookLogin ||
67
+ ((_a = options.identityProviders) !== null && _a !== void 0 ? _a : []).some((p) => p.ProviderType === client_cognito_identity_provider_1.IdentityProviderTypeType.OIDC) ||
68
+ ((_b = options.identityProviders) !== null && _b !== void 0 ? _b : []).some((p) => p.ProviderType === client_cognito_identity_provider_1.IdentityProviderTypeType.SAML);
69
+ if (hasExternalProviders) {
70
+ namedImports['@aws-amplify/backend'].add('secret');
71
+ }
72
+ defineAuthProperties.push(this.createLogInWithPropertyAssignment(options, loginFlags));
73
+ const standardAttributes = AuthRenderer.deriveStandardUserAttributes(options.userPool.SchemaAttributes);
74
+ const customAttributes = AuthRenderer.deriveCustomUserAttributes(options.userPool.SchemaAttributes);
75
+ const hasStandard = Object.keys(standardAttributes).length > 0;
76
+ const hasCustom = Object.keys(customAttributes).length > 0;
77
+ if (hasStandard || hasCustom) {
78
+ defineAuthProperties.push(this.createUserAttributeAssignments(hasStandard ? standardAttributes : undefined, hasCustom ? customAttributes : undefined));
79
+ }
80
+ const groups = AuthRenderer.deriveGroups(options.identityGroups);
81
+ if (groups.length > 0) {
82
+ defineAuthProperties.push(factory.createPropertyAssignment(factory.createIdentifier('groups'), factory.createArrayLiteralExpression(groups.map((g) => factory.createStringLiteral(g)))));
83
+ }
84
+ this.addLambdaTriggers((_c = options.triggers) !== null && _c !== void 0 ? _c : [], defineAuthProperties, namedImports);
85
+ const mfa = AuthRenderer.deriveMfaConfig(options.mfaConfig);
86
+ this.addMfaConfig(mfa, defineAuthProperties);
87
+ this.addFunctionAccess(options.access, defineAuthProperties, namedImports);
88
+ return ts_1.TS.renderResourceTsFile({
89
+ exportedVariableName: factory.createIdentifier('auth'),
90
+ functionCallParameter: factory.createObjectLiteralExpression(defineAuthProperties, true),
91
+ additionalImportedBackendIdentifiers: namedImports,
92
+ backendFunctionConstruct: 'defineAuth',
93
+ });
94
+ }
95
+ static deriveLoginFlags(providers) {
96
+ const flags = {
97
+ googleLogin: false,
98
+ amazonLogin: false,
99
+ appleLogin: false,
100
+ facebookLogin: false,
101
+ };
102
+ if (!providers)
103
+ return flags;
104
+ for (const provider of providers) {
105
+ const mapping = MAP_IDENTITY_PROVIDER[provider === null || provider === void 0 ? void 0 : provider.ProviderType];
106
+ if (mapping) {
107
+ flags[mapping[0]] = true;
108
+ }
109
+ }
110
+ return flags;
111
+ }
112
+ static deriveExternalProviders(details) {
113
+ var _a;
114
+ const oidcProviders = [];
115
+ let samlProvider;
116
+ const attributeMappings = {};
117
+ const providerScopes = {};
118
+ if (!details) {
119
+ return { oidcProviders, samlProvider, attributeMappings, providerScopes };
120
+ }
121
+ for (const provider of details) {
122
+ const { ProviderType, ProviderName, ProviderDetails, AttributeMapping } = provider;
123
+ if (ProviderType === client_cognito_identity_provider_1.IdentityProviderTypeType.OIDC && ProviderDetails) {
124
+ const { oidc_issuer, authorize_url, token_url, attributes_url, jwks_uri } = ProviderDetails;
125
+ const endpoints = authorize_url && token_url && attributes_url && jwks_uri
126
+ ? { authorization: authorize_url, token: token_url, userInfo: attributes_url, jwksUri: jwks_uri }
127
+ : undefined;
128
+ oidcProviders.push({
129
+ issuerUrl: oidc_issuer,
130
+ name: ProviderName,
131
+ endpoints,
132
+ attributeMapping: AttributeMapping ? AuthRenderer.filterAttributeMapping(AttributeMapping) : undefined,
133
+ });
134
+ }
135
+ else if (ProviderType === client_cognito_identity_provider_1.IdentityProviderTypeType.SAML && ProviderDetails) {
136
+ const { metadataURL, metadataContent } = ProviderDetails;
137
+ samlProvider = {
138
+ metadata: {
139
+ metadataContent: metadataURL || metadataContent,
140
+ metadataType: metadataURL ? 'URL' : 'FILE',
141
+ },
142
+ name: ProviderName,
143
+ attributeMapping: AttributeMapping ? AuthRenderer.filterAttributeMapping(AttributeMapping) : undefined,
144
+ };
145
+ }
146
+ else {
147
+ if (AttributeMapping) {
148
+ const filteredMapping = AuthRenderer.filterAttributeMapping(AttributeMapping);
149
+ const attributeProperty = (_a = MAP_IDENTITY_PROVIDER[provider === null || provider === void 0 ? void 0 : provider.ProviderType]) === null || _a === void 0 ? void 0 : _a[1];
150
+ if (attributeProperty) {
151
+ attributeMappings[attributeProperty] = filteredMapping;
152
+ }
153
+ }
154
+ if (ProviderDetails) {
155
+ const scopes = AuthRenderer.deriveProviderSpecificScopes(ProviderDetails);
156
+ if (scopes.length > 0) {
157
+ const mapped = scopes
158
+ .map((scope) => (scope === 'public_profile' ? 'profile' : scope))
159
+ .filter((scope) => VALID_SCOPES.includes(scope));
160
+ if (mapped.length > 0 && ProviderType) {
161
+ providerScopes[ProviderType] = mapped;
162
+ }
163
+ }
164
+ }
165
+ }
166
+ }
167
+ return { oidcProviders, samlProvider, attributeMappings, providerScopes };
168
+ }
169
+ static deriveMfaConfig(mfa) {
170
+ var _a, _b, _c, _d;
171
+ if ((mfa === null || mfa === void 0 ? void 0 : mfa.MfaConfiguration) === 'ON') {
172
+ return { mode: 'REQUIRED', sms: true, totp: (_b = (_a = mfa.SoftwareTokenMfaConfiguration) === null || _a === void 0 ? void 0 : _a.Enabled) !== null && _b !== void 0 ? _b : false };
173
+ }
174
+ if ((mfa === null || mfa === void 0 ? void 0 : mfa.MfaConfiguration) === 'OPTIONAL') {
175
+ return { mode: 'OPTIONAL', sms: true, totp: (_d = (_c = mfa.SoftwareTokenMfaConfiguration) === null || _c === void 0 ? void 0 : _c.Enabled) !== null && _d !== void 0 ? _d : false };
176
+ }
177
+ return { mode: 'OFF' };
178
+ }
179
+ static deriveStandardUserAttributes(schema) {
180
+ if (!schema)
181
+ return {};
182
+ const result = {};
183
+ for (const attribute of schema) {
184
+ if (attribute.Name && attribute.Name in MAPPED_USER_ATTRIBUTE_NAME && attribute.Required) {
185
+ result[MAPPED_USER_ATTRIBUTE_NAME[attribute.Name]] = {
186
+ required: attribute.Required,
187
+ mutable: attribute.Mutable,
188
+ };
189
+ }
190
+ }
191
+ return result;
192
+ }
193
+ static deriveCustomUserAttributes(schema) {
194
+ if (!schema)
195
+ return {};
196
+ const result = {};
197
+ for (const attribute of schema) {
198
+ if (attribute.Name && attribute.Name.startsWith('custom:')) {
199
+ const constraints = attribute.NumberAttributeConstraints && Object.keys(attribute.NumberAttributeConstraints).length > 0
200
+ ? { min: Number(attribute.NumberAttributeConstraints.MinValue), max: Number(attribute.NumberAttributeConstraints.MaxValue) }
201
+ : attribute.StringAttributeConstraints && Object.keys(attribute.StringAttributeConstraints).length > 0
202
+ ? {
203
+ minLen: Number(attribute.StringAttributeConstraints.MinLength),
204
+ maxLen: Number(attribute.StringAttributeConstraints.MaxLength),
205
+ }
206
+ : {};
207
+ result[attribute.Name] = {
208
+ mutable: attribute.Mutable,
209
+ dataType: attribute.AttributeDataType,
210
+ ...constraints,
211
+ };
212
+ }
213
+ }
214
+ return result;
215
+ }
216
+ static deriveGroups(groups) {
217
+ if (!groups || groups.length === 0)
218
+ return [];
219
+ return groups
220
+ .filter((group) => group.Precedence !== undefined)
221
+ .sort((a, b) => (a.Precedence || 0) - (b.Precedence || 0))
222
+ .map((group) => group.GroupName)
223
+ .filter((name) => name !== undefined);
224
+ }
225
+ static deriveUserPoolOverrides(userPool) {
226
+ var _a, _b;
227
+ const overrides = {};
228
+ const passwordPolicy = (_b = (_a = userPool.Policies) === null || _a === void 0 ? void 0 : _a.PasswordPolicy) !== null && _b !== void 0 ? _b : {};
229
+ for (const key of Object.keys(passwordPolicy)) {
230
+ const typedKey = key;
231
+ if (passwordPolicy[typedKey] !== undefined) {
232
+ overrides[`Policies.PasswordPolicy.${typedKey}`] = passwordPolicy[typedKey];
233
+ }
234
+ }
235
+ if (userPool.UsernameAttributes === undefined || userPool.UsernameAttributes.length === 0) {
236
+ overrides.usernameAttributes = undefined;
237
+ }
238
+ else {
239
+ overrides.usernameAttributes = userPool.UsernameAttributes;
240
+ }
241
+ if (userPool.AliasAttributes !== undefined && userPool.AliasAttributes.length > 0) {
242
+ overrides.aliasAttributes = userPool.AliasAttributes;
243
+ }
244
+ return overrides;
245
+ }
246
+ static deriveProviderSpecificScopes(providerDetails) {
247
+ const scopeFields = ['authorized_scopes', 'scope', 'scopes'];
248
+ for (const field of scopeFields) {
249
+ if (providerDetails[field]) {
250
+ return providerDetails[field].split(/[\s,]+/).filter((scope) => scope.length > 0);
251
+ }
252
+ }
253
+ return [];
254
+ }
255
+ static filterAttributeMapping(attributeMapping) {
256
+ return Object.fromEntries(Object.entries(attributeMapping)
257
+ .filter(([key]) => Object.keys(MAPPED_USER_ATTRIBUTE_NAME).includes(key))
258
+ .map(([key, value]) => [MAPPED_USER_ATTRIBUTE_NAME[key], value]));
259
+ }
260
+ addLambdaTriggers(triggers, properties, namedImports) {
261
+ if (triggers.length === 0)
262
+ return;
263
+ properties.push(createTriggersProperty(triggers));
264
+ for (const trigger of triggers) {
265
+ const importPath = `./${trigger.resourceName}/resource`;
266
+ if (!namedImports[importPath]) {
267
+ namedImports[importPath] = new Set();
268
+ }
269
+ namedImports[importPath].add(trigger.resourceName);
270
+ }
271
+ }
272
+ addMfaConfig(mfa, properties) {
273
+ const multifactorProperties = [
274
+ factory.createPropertyAssignment(factory.createIdentifier('mode'), factory.createStringLiteral(mfa.mode)),
275
+ ];
276
+ if (mfa.totp !== undefined) {
277
+ multifactorProperties.push(factory.createPropertyAssignment(factory.createIdentifier('totp'), mfa.totp ? factory.createTrue() : factory.createFalse()));
278
+ }
279
+ if (mfa.sms !== undefined) {
280
+ multifactorProperties.push(factory.createPropertyAssignment(factory.createIdentifier('sms'), mfa.sms ? factory.createTrue() : factory.createFalse()));
281
+ }
282
+ properties.push(factory.createPropertyAssignment(factory.createIdentifier('multifactor'), factory.createObjectLiteralExpression(multifactorProperties, true)));
283
+ }
284
+ addFunctionAccess(functions, properties, namedImports) {
285
+ if (!functions || functions.length === 0) {
286
+ return;
287
+ }
288
+ const functionsWithAuthAccess = functions.filter((func) => Object.keys(func.permissions).length > 0);
289
+ if (functionsWithAuthAccess.length === 0) {
290
+ return;
291
+ }
292
+ for (const func of functionsWithAuthAccess) {
293
+ namedImports[`../function/${func.resourceName}/resource`] = new Set([func.resourceName]);
294
+ }
295
+ const accessRules = [];
296
+ for (const func of functionsWithAuthAccess) {
297
+ for (const [permission, enabled] of Object.entries(func.permissions)) {
298
+ if (enabled) {
299
+ accessRules.push(factory.createCallExpression(factory.createPropertyAccessExpression(factory.createCallExpression(factory.createPropertyAccessExpression(factory.createIdentifier('allow'), factory.createIdentifier('resource')), undefined, [factory.createIdentifier(func.resourceName)]), factory.createIdentifier('to')), undefined, [factory.createArrayLiteralExpression([factory.createStringLiteral(permission)])]));
300
+ }
301
+ }
302
+ }
303
+ if (accessRules.length > 0) {
304
+ properties.push(factory.createPropertyAssignment(factory.createIdentifier('access'), factory.createArrowFunction(undefined, undefined, [
305
+ factory.createParameterDeclaration(undefined, undefined, factory.createIdentifier('allow')),
306
+ factory.createParameterDeclaration(undefined, undefined, factory.createIdentifier('_unused')),
307
+ ], undefined, undefined, factory.createArrayLiteralExpression(accessRules, true))));
308
+ }
309
+ }
310
+ createLogInWithPropertyAssignment(options, loginFlags) {
311
+ var _a, _b, _c, _d;
312
+ const logInWith = factory.createIdentifier('loginWith');
313
+ const assignments = [];
314
+ const emailOptions = options.userPool.EmailVerificationMessage || options.userPool.EmailVerificationSubject
315
+ ? {
316
+ emailVerificationBody: (_a = options.userPool.EmailVerificationMessage) !== null && _a !== void 0 ? _a : '',
317
+ emailVerificationSubject: (_b = options.userPool.EmailVerificationSubject) !== null && _b !== void 0 ? _b : '',
318
+ }
319
+ : undefined;
320
+ if (emailOptions) {
321
+ assignments.push(factory.createPropertyAssignment(factory.createIdentifier('email'), this.createEmailDefinitionObject(emailOptions)));
322
+ }
323
+ else {
324
+ assignments.push(factory.createPropertyAssignment(factory.createIdentifier('email'), factory.createTrue()));
325
+ }
326
+ const externalProviders = AuthRenderer.deriveExternalProviders(options.identityProviders);
327
+ const hasExternalProviders = loginFlags.googleLogin ||
328
+ loginFlags.amazonLogin ||
329
+ loginFlags.appleLogin ||
330
+ loginFlags.facebookLogin ||
331
+ externalProviders.oidcProviders.length > 0 ||
332
+ externalProviders.samlProvider !== undefined;
333
+ if (hasExternalProviders) {
334
+ assignments.push(factory.createPropertyAssignment(factory.createIdentifier('externalProviders'), this.createExternalProvidersExpression(loginFlags, externalProviders, (_c = options.webClient) === null || _c === void 0 ? void 0 : _c.CallbackURLs, (_d = options.webClient) === null || _d === void 0 ? void 0 : _d.LogoutURLs)));
335
+ }
336
+ return factory.createPropertyAssignment(logInWith, factory.createObjectLiteralExpression(assignments, true));
337
+ }
338
+ createEmailDefinitionObject(emailOptions) {
339
+ const emailDefinitionAssignments = [];
340
+ if (emailOptions.emailVerificationSubject) {
341
+ emailDefinitionAssignments.push(factory.createPropertyAssignment('verificationEmailSubject', factory.createStringLiteral(emailOptions.emailVerificationSubject)));
342
+ }
343
+ if (emailOptions.emailVerificationBody) {
344
+ emailDefinitionAssignments.push(factory.createPropertyAssignment('verificationEmailBody', factory.createArrowFunction(undefined, undefined, [], undefined, undefined, factory.createStringLiteral(emailOptions.emailVerificationBody))));
345
+ }
346
+ return factory.createObjectLiteralExpression(emailDefinitionAssignments, true);
347
+ }
348
+ createExternalProvidersExpression(loginFlags, externalProviders, callbackUrls, logoutUrls) {
349
+ const providerAssignments = [];
350
+ if (loginFlags.googleLogin) {
351
+ const googleConfig = {
352
+ clientId: googleClientID,
353
+ clientSecret: googleClientSecret,
354
+ };
355
+ const googleScopes = externalProviders.providerScopes[client_cognito_identity_provider_1.IdentityProviderTypeType.Google];
356
+ if (googleScopes && googleScopes.length > 0) {
357
+ googleConfig.scopes = googleScopes.join(' ');
358
+ }
359
+ providerAssignments.push(AuthRenderer.createProviderPropertyAssignment('google', googleConfig, externalProviders.attributeMappings.googleAttributes));
360
+ }
361
+ if (loginFlags.appleLogin) {
362
+ const appleConfig = {
363
+ clientId: appleClientID,
364
+ keyId: appleKeyId,
365
+ privateKey: applePrivateKey,
366
+ teamId: appleTeamID,
367
+ };
368
+ const appleScopes = externalProviders.providerScopes[client_cognito_identity_provider_1.IdentityProviderTypeType.SignInWithApple];
369
+ if (appleScopes && appleScopes.length > 0) {
370
+ appleConfig.scopes = appleScopes.join(' ');
371
+ }
372
+ providerAssignments.push(AuthRenderer.createProviderPropertyAssignment('signInWithApple', appleConfig, externalProviders.attributeMappings.appleAttributes));
373
+ }
374
+ if (loginFlags.amazonLogin) {
375
+ const amazonConfig = {
376
+ clientId: amazonClientID,
377
+ clientSecret: amazonClientSecret,
378
+ };
379
+ const amazonScopes = externalProviders.providerScopes[client_cognito_identity_provider_1.IdentityProviderTypeType.LoginWithAmazon];
380
+ if (amazonScopes && amazonScopes.length > 0) {
381
+ amazonConfig.scopes = amazonScopes.join(' ');
382
+ }
383
+ providerAssignments.push(AuthRenderer.createProviderPropertyAssignment('loginWithAmazon', amazonConfig, externalProviders.attributeMappings.amazonAttributes));
384
+ }
385
+ if (loginFlags.facebookLogin) {
386
+ const facebookConfig = {
387
+ clientId: facebookClientID,
388
+ clientSecret: facebookClientSecret,
389
+ };
390
+ const facebookScopes = externalProviders.providerScopes[client_cognito_identity_provider_1.IdentityProviderTypeType.Facebook];
391
+ if (facebookScopes && facebookScopes.length > 0) {
392
+ facebookConfig.scopes = facebookScopes.join(' ');
393
+ }
394
+ providerAssignments.push(AuthRenderer.createProviderPropertyAssignment('facebook', facebookConfig, externalProviders.attributeMappings.facebookAttributes));
395
+ }
396
+ if (externalProviders.samlProvider) {
397
+ providerAssignments.push(factory.createPropertyAssignment(factory.createIdentifier('saml'), factory.createObjectLiteralExpression(AuthRenderer.createOidcSamlPropertyAssignments(externalProviders.samlProvider), true)));
398
+ }
399
+ if (externalProviders.oidcProviders.length > 0) {
400
+ providerAssignments.push(factory.createPropertyAssignment(factory.createIdentifier('oidc'), factory.createArrayLiteralExpression(externalProviders.oidcProviders.map((oidc, index) => factory.createObjectLiteralExpression([
401
+ factory.createPropertyAssignment(factory.createIdentifier('clientId'), factory.createCallExpression(secretIdentifier, undefined, [
402
+ factory.createStringLiteral(`${oidcClientID}_${index + 1}`),
403
+ ])),
404
+ factory.createPropertyAssignment(factory.createIdentifier('clientSecret'), factory.createCallExpression(secretIdentifier, undefined, [
405
+ factory.createStringLiteral(`${oidcClientSecret}_${index + 1}`),
406
+ ])),
407
+ ...AuthRenderer.createOidcSamlPropertyAssignments(oidc),
408
+ ], true)), true)));
409
+ }
410
+ const properties = [
411
+ ...providerAssignments,
412
+ factory.createPropertyAssignment(factory.createIdentifier('callbackUrls'), factory.createArrayLiteralExpression(callbackUrls === null || callbackUrls === void 0 ? void 0 : callbackUrls.map((url) => factory.createStringLiteral(url)))),
413
+ factory.createPropertyAssignment(factory.createIdentifier('logoutUrls'), factory.createArrayLiteralExpression(logoutUrls === null || logoutUrls === void 0 ? void 0 : logoutUrls.map((url) => factory.createStringLiteral(url)))),
414
+ ];
415
+ return factory.createObjectLiteralExpression(properties, true);
416
+ }
417
+ createUserAttributeAssignments(standardAttributes, customAttributes) {
418
+ const userAttributeIdentifier = factory.createIdentifier('userAttributes');
419
+ const userAttributeProperties = [];
420
+ if (standardAttributes !== undefined) {
421
+ const standardAttributeProperties = Object.entries(standardAttributes).map(([key, value]) => {
422
+ return factory.createPropertyAssignment(factory.createIdentifier(key), AuthRenderer.createAttributeDefinition(value));
423
+ });
424
+ userAttributeProperties.push(...standardAttributeProperties);
425
+ }
426
+ if (customAttributes !== undefined) {
427
+ const customAttributeProperties = Object.entries(customAttributes)
428
+ .map(([key, value]) => {
429
+ if (value !== undefined) {
430
+ return factory.createPropertyAssignment(factory.createStringLiteral(key), AuthRenderer.createAttributeDefinition(value));
431
+ }
432
+ return undefined;
433
+ })
434
+ .filter((property) => property !== undefined);
435
+ userAttributeProperties.push(...customAttributeProperties);
436
+ }
437
+ return factory.createPropertyAssignment(userAttributeIdentifier, factory.createObjectLiteralExpression(userAttributeProperties, true));
438
+ }
439
+ static createAttributeDefinition(attribute) {
440
+ const properties = [];
441
+ for (const key of Object.keys(attribute)) {
442
+ const value = attribute[key];
443
+ if (typeof value === 'boolean') {
444
+ properties.push(factory.createPropertyAssignment(factory.createIdentifier(key), value ? factory.createTrue() : factory.createFalse()));
445
+ }
446
+ else if (typeof value === 'string') {
447
+ properties.push(factory.createPropertyAssignment(factory.createIdentifier(key), factory.createStringLiteral(value)));
448
+ }
449
+ else if (typeof value === 'number') {
450
+ properties.push(factory.createPropertyAssignment(factory.createIdentifier(key), factory.createNumericLiteral(value)));
451
+ }
452
+ }
453
+ return factory.createObjectLiteralExpression(properties, true);
454
+ }
455
+ static createProviderConfig(config, attributeMapping) {
456
+ const properties = [];
457
+ Object.entries(config).forEach(([key, value]) => {
458
+ if (key === 'scopes') {
459
+ const scopeArray = value.split(' ').filter((scope) => scope.length > 0);
460
+ properties.push(factory.createPropertyAssignment(factory.createIdentifier('scopes'), factory.createArrayLiteralExpression(scopeArray.map((scope) => factory.createStringLiteral(scope)))));
461
+ }
462
+ else {
463
+ properties.push(factory.createPropertyAssignment(factory.createIdentifier(key), factory.createCallExpression(secretIdentifier, undefined, [factory.createStringLiteral(value)])));
464
+ }
465
+ });
466
+ if (attributeMapping) {
467
+ const mappingProperties = [];
468
+ Object.entries(attributeMapping).forEach(([key, value]) => mappingProperties.push(factory.createPropertyAssignment(factory.createIdentifier(key), factory.createStringLiteral(value))));
469
+ properties.push(factory.createPropertyAssignment(factory.createIdentifier('attributeMapping'), factory.createObjectLiteralExpression(mappingProperties, true)));
470
+ }
471
+ return properties;
472
+ }
473
+ static createProviderPropertyAssignment(name, config, attributeMapping) {
474
+ return factory.createPropertyAssignment(factory.createIdentifier(name), factory.createObjectLiteralExpression(AuthRenderer.createProviderConfig(config, attributeMapping), true));
475
+ }
476
+ static createOidcSamlPropertyAssignments(config) {
477
+ return Object.entries(config).flatMap(([key, value]) => {
478
+ if (typeof value === 'string') {
479
+ return [factory.createPropertyAssignment(factory.createIdentifier(key), factory.createStringLiteral(value))];
480
+ }
481
+ else if (typeof value === 'object' && value !== null) {
482
+ return [
483
+ factory.createPropertyAssignment(factory.createIdentifier(key), factory.createObjectLiteralExpression(AuthRenderer.createOidcSamlPropertyAssignments(value), true)),
484
+ ];
485
+ }
486
+ return [];
487
+ });
488
+ }
489
+ }
490
+ exports.AuthRenderer = AuthRenderer;
491
+ //# sourceMappingURL=auth.renderer.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"auth.renderer.js","sourceRoot":"","sources":["../../../../../../src/commands/gen2-migration/generate/amplify/auth/auth.renderer.ts"],"names":[],"mappings":";;;;;;AAAA,4DAAoD;AACpD,gGAQmD;AAGnD,wCAAqC;AA6FrC,MAAM,OAAO,GAAG,oBAAE,CAAC,OAAO,CAAC;AAG3B,MAAM,gBAAgB,GAAG,OAAO,CAAC,gBAAgB,CAAC,QAAQ,CAAC,CAAC;AAG5D,MAAM,cAAc,GAAG,kBAAkB,CAAC;AAC1C,MAAM,kBAAkB,GAAG,sBAAsB,CAAC;AAClD,MAAM,cAAc,GAAG,2BAA2B,CAAC;AACnD,MAAM,kBAAkB,GAAG,+BAA+B,CAAC;AAC3D,MAAM,gBAAgB,GAAG,oBAAoB,CAAC;AAC9C,MAAM,oBAAoB,GAAG,wBAAwB,CAAC;AACtD,MAAM,aAAa,GAAG,gBAAgB,CAAC;AACvC,MAAM,UAAU,GAAG,aAAa,CAAC;AACjC,MAAM,eAAe,GAAG,kBAAkB,CAAC;AAC3C,MAAM,WAAW,GAAG,cAAc,CAAC;AACnC,MAAM,YAAY,GAAG,gBA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AAC,YAAY,CAAC,iCAAiC,CAAC,KAAgC,CAAC,EAAE,IAAI,CAAC,CAC9H;iBACF,CAAC;YACJ,CAAC;YACD,OAAO,EAAE,CAAC;QACZ,CAAC,CAAC,CAAC;IACL,CAAC;CACF;AAvuBD,oCAuuBC"}
@@ -0,0 +1,15 @@
1
+ import { Planner } from '../../../_infra/planner';
2
+ import { AmplifyMigrationOperation } from '../../../_infra/operation';
3
+ import { BackendGenerator } from '../backend.generator';
4
+ import { Gen1App, DiscoveredResource } from '../../_infra/gen1-app';
5
+ export declare class ReferenceAuthGenerator implements Planner {
6
+ private readonly gen1App;
7
+ private readonly backendGenerator;
8
+ private readonly outputDir;
9
+ private readonly resource;
10
+ private readonly renderer;
11
+ constructor(gen1App: Gen1App, backendGenerator: BackendGenerator, outputDir: string, resource: DiscoveredResource);
12
+ plan(): Promise<AmplifyMigrationOperation[]>;
13
+ private buildReferenceAuth;
14
+ }
15
+ //# sourceMappingURL=reference-auth.generator.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"reference-auth.generator.d.ts","sourceRoot":"","sources":["../../../../../../src/commands/gen2-migration/generate/amplify/auth/reference-auth.generator.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,OAAO,EAAE,MAAM,yBAAyB,CAAC;AAClD,OAAO,EAAE,yBAAyB,EAAE,MAAM,2BAA2B,CAAC;AACtE,OAAO,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AACxD,OAAO,EAAE,OAAO,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAWpE,qBAAa,sBAAuB,YAAW,OAAO;IACpD,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAU;IAClC,OAAO,CAAC,QAAQ,CAAC,gBAAgB,CAAmB;IACpD,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAS;IACnC,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAqB;IAC9C,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAA+B;gBAErC,OAAO,EAAE,OAAO,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,kBAAkB;IAO3G,IAAI,IAAI,OAAO,CAAC,yBAAyB,EAAE,CAAC;YAkC3C,kBAAkB;CAgCjC"}
@@ -0,0 +1,75 @@
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.ReferenceAuthGenerator = void 0;
7
+ const node_path_1 = __importDefault(require("node:path"));
8
+ const promises_1 = __importDefault(require("node:fs/promises"));
9
+ const typescript_1 = __importDefault(require("typescript"));
10
+ const ts_1 = require("../../_infra/ts");
11
+ const reference_auth_renderer_1 = require("./reference-auth.renderer");
12
+ const factory = typescript_1.default.factory;
13
+ class ReferenceAuthGenerator {
14
+ constructor(gen1App, backendGenerator, outputDir, resource) {
15
+ this.renderer = new reference_auth_renderer_1.ReferenceAuthRenderer();
16
+ this.gen1App = gen1App;
17
+ this.backendGenerator = backendGenerator;
18
+ this.outputDir = outputDir;
19
+ this.resource = resource;
20
+ }
21
+ async plan() {
22
+ const authCategory = this.gen1App.meta('auth');
23
+ if (!authCategory) {
24
+ throw new Error('Auth category not found in amplify-meta.json — ReferenceAuthGenerator should only be created when auth exists');
25
+ }
26
+ const referenceAuth = await this.buildReferenceAuth(authCategory);
27
+ if (!referenceAuth) {
28
+ throw new Error('Auth category exists but no imported auth resource found — ReferenceAuthGenerator should only be created for imported auth');
29
+ }
30
+ const authDir = node_path_1.default.join(this.outputDir, 'amplify', 'auth');
31
+ return [
32
+ {
33
+ resource: this.resource,
34
+ validate: () => undefined,
35
+ describe: async () => ['Generate amplify/auth/resource.ts (reference auth)'],
36
+ execute: async () => {
37
+ const nodes = this.renderer.render(referenceAuth);
38
+ const content = ts_1.TS.printNodes(nodes);
39
+ await promises_1.default.mkdir(authDir, { recursive: true });
40
+ await promises_1.default.writeFile(node_path_1.default.join(authDir, 'resource.ts'), content, 'utf-8');
41
+ this.backendGenerator.addImport('./auth/resource', ['auth']);
42
+ this.backendGenerator.addDefineBackendProperty(factory.createShorthandPropertyAssignment(factory.createIdentifier('auth')));
43
+ },
44
+ },
45
+ ];
46
+ }
47
+ async buildReferenceAuth(authCategory) {
48
+ const isImported = Object.values(authCategory).some((value) => typeof value === 'object' &&
49
+ value !== null &&
50
+ 'serviceType' in value &&
51
+ value.serviceType === 'imported');
52
+ if (!isImported)
53
+ return undefined;
54
+ const firstAuth = Object.values(authCategory)[0];
55
+ const output = firstAuth === null || firstAuth === void 0 ? void 0 : firstAuth.output;
56
+ const userPoolId = output === null || output === void 0 ? void 0 : output.UserPoolId;
57
+ const userPoolClientId = output === null || output === void 0 ? void 0 : output.AppClientIDWeb;
58
+ const identityPoolId = output === null || output === void 0 ? void 0 : output.IdentityPoolId;
59
+ if (!userPoolId && !userPoolClientId && !identityPoolId) {
60
+ throw new Error('No user pool or identity pool found for import.');
61
+ }
62
+ const roles = identityPoolId ? await this.gen1App.aws.fetchIdentityPoolRoles(identityPoolId) : undefined;
63
+ const groups = userPoolId ? await this.gen1App.aws.fetchGroupsByUserPoolId(userPoolId) : undefined;
64
+ return {
65
+ userPoolId,
66
+ userPoolClientId,
67
+ identityPoolId,
68
+ unauthRoleArn: roles === null || roles === void 0 ? void 0 : roles.unauthenticated,
69
+ authRoleArn: roles === null || roles === void 0 ? void 0 : roles.authenticated,
70
+ groups,
71
+ };
72
+ }
73
+ }
74
+ exports.ReferenceAuthGenerator = ReferenceAuthGenerator;
75
+ //# sourceMappingURL=reference-auth.generator.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"reference-auth.generator.js","sourceRoot":"","sources":["../../../../../../src/commands/gen2-migration/generate/amplify/auth/reference-auth.generator.ts"],"names":[],"mappings":";;;;;;AAAA,0DAA6B;AAC7B,gEAAkC;AAClC,4DAA4B;AAK5B,wCAAqC;AACrC,uEAAiF;A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