@aws-amplify/cli-internal-gen2-migration-experimental-alpha 0.1.0 → 0.2.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 (281) hide show
  1. package/aws-amplify-cli-internal-gen2-migration-experimental-alpha-0.2.0.tgz +0 -0
  2. package/lib/commands/drift-detection/detect-local-drift.d.ts +3 -6
  3. package/lib/commands/drift-detection/detect-local-drift.d.ts.map +1 -1
  4. package/lib/commands/drift-detection/detect-local-drift.js +4 -8
  5. package/lib/commands/drift-detection/detect-local-drift.js.map +1 -1
  6. package/lib/commands/drift-detection/detect-stack-drift.d.ts +3 -2
  7. package/lib/commands/drift-detection/detect-stack-drift.d.ts.map +1 -1
  8. package/lib/commands/drift-detection/detect-stack-drift.js +12 -0
  9. package/lib/commands/drift-detection/detect-stack-drift.js.map +1 -1
  10. package/lib/commands/drift-detection/detect-template-drift.d.ts +4 -5
  11. package/lib/commands/drift-detection/detect-template-drift.d.ts.map +1 -1
  12. package/lib/commands/drift-detection/detect-template-drift.js +122 -94
  13. package/lib/commands/drift-detection/detect-template-drift.js.map +1 -1
  14. package/lib/commands/drift-detection/index.d.ts +3 -2
  15. package/lib/commands/drift-detection/index.d.ts.map +1 -1
  16. package/lib/commands/drift-detection/index.js +3 -1
  17. package/lib/commands/drift-detection/index.js.map +1 -1
  18. package/lib/commands/drift-detection/services/cloudformation-service.d.ts.map +1 -1
  19. package/lib/commands/drift-detection/services/cloudformation-service.js +3 -5
  20. package/lib/commands/drift-detection/services/cloudformation-service.js.map +1 -1
  21. package/lib/commands/drift-detection/services/drift-formatter.d.ts +4 -5
  22. package/lib/commands/drift-detection/services/drift-formatter.d.ts.map +1 -1
  23. package/lib/commands/drift-detection/services/drift-formatter.js +15 -38
  24. package/lib/commands/drift-detection/services/drift-formatter.js.map +1 -1
  25. package/lib/commands/drift.d.ts +0 -2
  26. package/lib/commands/drift.d.ts.map +1 -1
  27. package/lib/commands/drift.js +47 -57
  28. package/lib/commands/drift.js.map +1 -1
  29. package/lib/commands/gen2-migration/_step.d.ts +2 -1
  30. package/lib/commands/gen2-migration/_step.d.ts.map +1 -1
  31. package/lib/commands/gen2-migration/_step.js +2 -1
  32. package/lib/commands/gen2-migration/_step.js.map +1 -1
  33. package/lib/commands/gen2-migration/generate/adapters/auth/index.d.ts +24 -0
  34. package/lib/commands/gen2-migration/generate/adapters/auth/index.d.ts.map +1 -0
  35. package/lib/commands/gen2-migration/generate/adapters/auth/index.js +297 -0
  36. package/lib/commands/gen2-migration/generate/adapters/auth/index.js.map +1 -0
  37. package/lib/commands/gen2-migration/generate/adapters/auth/index.test.d.ts +2 -0
  38. package/lib/commands/gen2-migration/generate/adapters/auth/index.test.d.ts.map +1 -0
  39. package/lib/commands/gen2-migration/generate/adapters/auth/index.test.js +140 -0
  40. package/lib/commands/gen2-migration/generate/adapters/auth/index.test.js.map +1 -0
  41. package/lib/commands/gen2-migration/generate/adapters/data/index.d.ts +5 -0
  42. package/lib/commands/gen2-migration/generate/adapters/data/index.d.ts.map +1 -0
  43. package/lib/commands/gen2-migration/generate/adapters/data/index.js +17 -0
  44. package/lib/commands/gen2-migration/generate/adapters/data/index.js.map +1 -0
  45. package/lib/commands/gen2-migration/generate/adapters/functions/index.d.ts +17 -0
  46. package/lib/commands/gen2-migration/generate/adapters/functions/index.d.ts.map +1 -0
  47. package/lib/commands/gen2-migration/generate/adapters/functions/index.js +46 -0
  48. package/lib/commands/gen2-migration/generate/adapters/functions/index.js.map +1 -0
  49. package/lib/commands/gen2-migration/generate/adapters/project/index.d.ts +2 -0
  50. package/lib/commands/gen2-migration/generate/adapters/project/index.d.ts.map +1 -0
  51. package/lib/commands/gen2-migration/generate/adapters/project/index.js +7 -0
  52. package/lib/commands/gen2-migration/generate/adapters/project/index.js.map +1 -0
  53. package/lib/commands/gen2-migration/generate/adapters/storage/gen1_storage_codegen_adapter.d.ts +30 -0
  54. package/lib/commands/gen2-migration/generate/adapters/storage/gen1_storage_codegen_adapter.d.ts.map +1 -0
  55. package/lib/commands/gen2-migration/generate/adapters/storage/gen1_storage_codegen_adapter.js +18 -0
  56. package/lib/commands/gen2-migration/generate/adapters/storage/gen1_storage_codegen_adapter.js.map +1 -0
  57. package/lib/commands/gen2-migration/generate/adapters/storage/gen1_storage_codegen_adapter.test.d.ts +2 -0
  58. package/lib/commands/gen2-migration/generate/adapters/storage/gen1_storage_codegen_adapter.test.d.ts.map +1 -0
  59. package/lib/commands/gen2-migration/generate/adapters/storage/gen1_storage_codegen_adapter.test.js +181 -0
  60. package/lib/commands/gen2-migration/generate/adapters/storage/gen1_storage_codegen_adapter.test.js.map +1 -0
  61. package/lib/commands/gen2-migration/generate/adapters/storage/index.d.ts +3 -0
  62. package/lib/commands/gen2-migration/generate/adapters/storage/index.d.ts.map +1 -0
  63. package/lib/commands/gen2-migration/generate/adapters/storage/index.js +6 -0
  64. package/lib/commands/gen2-migration/generate/adapters/storage/index.js.map +1 -0
  65. package/lib/commands/gen2-migration/generate/adapters/storage/storage_access.d.ts +14 -0
  66. package/lib/commands/gen2-migration/generate/adapters/storage/storage_access.d.ts.map +1 -0
  67. package/lib/commands/gen2-migration/generate/adapters/storage/storage_access.js +27 -0
  68. package/lib/commands/gen2-migration/generate/adapters/storage/storage_access.js.map +1 -0
  69. package/lib/commands/gen2-migration/generate/backend/synthesizer.d.ts +80 -0
  70. package/lib/commands/gen2-migration/generate/backend/synthesizer.d.ts.map +1 -0
  71. package/lib/commands/gen2-migration/generate/backend/synthesizer.js +901 -0
  72. package/lib/commands/gen2-migration/generate/backend/synthesizer.js.map +1 -0
  73. package/lib/commands/gen2-migration/generate/backend/synthesizer.test.d.ts +2 -0
  74. package/lib/commands/gen2-migration/generate/backend/synthesizer.test.d.ts.map +1 -0
  75. package/lib/commands/gen2-migration/generate/backend/synthesizer.test.js +700 -0
  76. package/lib/commands/gen2-migration/generate/backend/synthesizer.test.js.map +1 -0
  77. package/lib/commands/gen2-migration/generate/codegen-head/amplify_stack_parser.d.ts +14 -0
  78. package/lib/commands/gen2-migration/generate/codegen-head/amplify_stack_parser.d.ts.map +1 -0
  79. package/lib/commands/gen2-migration/generate/codegen-head/amplify_stack_parser.js +82 -0
  80. package/lib/commands/gen2-migration/generate/codegen-head/amplify_stack_parser.js.map +1 -0
  81. package/lib/commands/gen2-migration/generate/codegen-head/analytics.d.ts +10 -0
  82. package/lib/commands/gen2-migration/generate/codegen-head/analytics.d.ts.map +1 -0
  83. package/lib/commands/gen2-migration/generate/codegen-head/analytics.js +11 -0
  84. package/lib/commands/gen2-migration/generate/codegen-head/analytics.js.map +1 -0
  85. package/lib/commands/gen2-migration/generate/codegen-head/app_analytics_definition_fetcher.d.ts +13 -0
  86. package/lib/commands/gen2-migration/generate/codegen-head/app_analytics_definition_fetcher.d.ts.map +1 -0
  87. package/lib/commands/gen2-migration/generate/codegen-head/app_analytics_definition_fetcher.js +22 -0
  88. package/lib/commands/gen2-migration/generate/codegen-head/app_analytics_definition_fetcher.js.map +1 -0
  89. package/lib/commands/gen2-migration/generate/codegen-head/app_auth_definition_fetcher.d.ts +24 -0
  90. package/lib/commands/gen2-migration/generate/codegen-head/app_auth_definition_fetcher.d.ts.map +1 -0
  91. package/lib/commands/gen2-migration/generate/codegen-head/app_auth_definition_fetcher.js +167 -0
  92. package/lib/commands/gen2-migration/generate/codegen-head/app_auth_definition_fetcher.js.map +1 -0
  93. package/lib/commands/gen2-migration/generate/codegen-head/app_functions_definition_fetcher.d.ts +19 -0
  94. package/lib/commands/gen2-migration/generate/codegen-head/app_functions_definition_fetcher.d.ts.map +1 -0
  95. package/lib/commands/gen2-migration/generate/codegen-head/app_functions_definition_fetcher.js +133 -0
  96. package/lib/commands/gen2-migration/generate/codegen-head/app_functions_definition_fetcher.js.map +1 -0
  97. package/lib/commands/gen2-migration/generate/codegen-head/app_storage_definition_fetcher.d.ts +23 -0
  98. package/lib/commands/gen2-migration/generate/codegen-head/app_storage_definition_fetcher.d.ts.map +1 -0
  99. package/lib/commands/gen2-migration/generate/codegen-head/app_storage_definition_fetcher.js +172 -0
  100. package/lib/commands/gen2-migration/generate/codegen-head/app_storage_definition_fetcher.js.map +1 -0
  101. package/lib/commands/gen2-migration/generate/codegen-head/backend_downloader.d.ts +10 -0
  102. package/lib/commands/gen2-migration/generate/codegen-head/backend_downloader.d.ts.map +1 -0
  103. package/lib/commands/gen2-migration/generate/codegen-head/backend_downloader.js +48 -0
  104. package/lib/commands/gen2-migration/generate/codegen-head/backend_downloader.js.map +1 -0
  105. package/lib/commands/gen2-migration/generate/codegen-head/backend_environment_selector.d.ts +11 -0
  106. package/lib/commands/gen2-migration/generate/codegen-head/backend_environment_selector.d.ts.map +1 -0
  107. package/lib/commands/gen2-migration/generate/codegen-head/backend_environment_selector.js +38 -0
  108. package/lib/commands/gen2-migration/generate/codegen-head/backend_environment_selector.js.map +1 -0
  109. package/lib/commands/gen2-migration/generate/codegen-head/command-handlers.d.ts +13 -0
  110. package/lib/commands/gen2-migration/generate/codegen-head/command-handlers.d.ts.map +1 -0
  111. package/lib/commands/gen2-migration/generate/codegen-head/command-handlers.js +462 -0
  112. package/lib/commands/gen2-migration/generate/codegen-head/command-handlers.js.map +1 -0
  113. package/lib/commands/gen2-migration/generate/codegen-head/data_definition_fetcher.d.ts +47 -0
  114. package/lib/commands/gen2-migration/generate/codegen-head/data_definition_fetcher.d.ts.map +1 -0
  115. package/lib/commands/gen2-migration/generate/codegen-head/data_definition_fetcher.js +222 -0
  116. package/lib/commands/gen2-migration/generate/codegen-head/data_definition_fetcher.js.map +1 -0
  117. package/lib/commands/gen2-migration/generate/codegen-head/directory_exists.d.ts +2 -0
  118. package/lib/commands/gen2-migration/generate/codegen-head/directory_exists.d.ts.map +1 -0
  119. package/lib/commands/gen2-migration/generate/codegen-head/directory_exists.js +15 -0
  120. package/lib/commands/gen2-migration/generate/codegen-head/directory_exists.js.map +1 -0
  121. package/lib/commands/gen2-migration/generate/codegen-head/format.d.ts +8 -0
  122. package/lib/commands/gen2-migration/generate/codegen-head/format.d.ts.map +1 -0
  123. package/lib/commands/gen2-migration/generate/codegen-head/format.js +66 -0
  124. package/lib/commands/gen2-migration/generate/codegen-head/format.js.map +1 -0
  125. package/lib/commands/gen2-migration/generate/codegen-head/logger.d.ts +15 -0
  126. package/lib/commands/gen2-migration/generate/codegen-head/logger.d.ts.map +1 -0
  127. package/lib/commands/gen2-migration/generate/codegen-head/logger.js +14 -0
  128. package/lib/commands/gen2-migration/generate/codegen-head/logger.js.map +1 -0
  129. package/lib/commands/gen2-migration/generate/codegen-head/printer.d.ts +26 -0
  130. package/lib/commands/gen2-migration/generate/codegen-head/printer.d.ts.map +1 -0
  131. package/lib/commands/gen2-migration/generate/codegen-head/printer.js +103 -0
  132. package/lib/commands/gen2-migration/generate/codegen-head/printer.js.map +1 -0
  133. package/lib/commands/gen2-migration/generate/core/migration-pipeline.d.ts +26 -0
  134. package/lib/commands/gen2-migration/generate/core/migration-pipeline.d.ts.map +1 -0
  135. package/lib/commands/gen2-migration/generate/core/migration-pipeline.js +233 -0
  136. package/lib/commands/gen2-migration/generate/core/migration-pipeline.js.map +1 -0
  137. package/lib/commands/gen2-migration/generate/custom-resources/generator/backend-updater.d.ts.map +1 -0
  138. package/lib/commands/gen2-migration/generate/custom-resources/generator/backend-updater.js.map +1 -0
  139. package/lib/commands/gen2-migration/generate/custom-resources/generator/dependency-merger.d.ts.map +1 -0
  140. package/lib/commands/gen2-migration/generate/custom-resources/generator/dependency-merger.js.map +1 -0
  141. package/lib/commands/gen2-migration/generate/custom-resources/generator/file-converter.d.ts.map +1 -0
  142. package/lib/commands/gen2-migration/generate/custom-resources/generator/file-converter.js.map +1 -0
  143. package/lib/commands/gen2-migration/generate/custom-resources/generator/gen2-file-generator.d.ts.map +1 -0
  144. package/lib/commands/gen2-migration/generate/custom-resources/generator/gen2-file-generator.js.map +1 -0
  145. package/lib/commands/gen2-migration/generate/custom-resources/parser/cdk-stack-parser.d.ts.map +1 -0
  146. package/lib/commands/gen2-migration/generate/custom-resources/parser/cdk-stack-parser.js.map +1 -0
  147. package/lib/commands/gen2-migration/generate/custom-resources/parser/pattern-detector.d.ts.map +1 -0
  148. package/lib/commands/gen2-migration/generate/custom-resources/parser/pattern-detector.js.map +1 -0
  149. package/lib/commands/gen2-migration/generate/custom-resources/scanner/custom-resource-scanner.d.ts.map +1 -0
  150. package/lib/commands/gen2-migration/generate/custom-resources/scanner/custom-resource-scanner.js.map +1 -0
  151. package/lib/commands/gen2-migration/generate/custom-resources/transformer/amplify-helper-transformer.d.ts.map +1 -0
  152. package/lib/commands/gen2-migration/{codegen-custom-resources → generate/custom-resources}/transformer/amplify-helper-transformer.js +25 -3
  153. package/lib/commands/gen2-migration/generate/custom-resources/transformer/amplify-helper-transformer.js.map +1 -0
  154. package/lib/commands/gen2-migration/generate/custom-resources/types.d.ts.map +1 -0
  155. package/lib/commands/gen2-migration/generate/custom-resources/types.js.map +1 -0
  156. package/lib/commands/gen2-migration/generate/generators/analytics/index.d.ts +9 -0
  157. package/lib/commands/gen2-migration/generate/generators/analytics/index.d.ts.map +1 -0
  158. package/lib/commands/gen2-migration/generate/generators/analytics/index.js +40 -0
  159. package/lib/commands/gen2-migration/generate/generators/analytics/index.js.map +1 -0
  160. package/lib/commands/gen2-migration/generate/generators/auth/index.d.ts +106 -0
  161. package/lib/commands/gen2-migration/generate/generators/auth/index.d.ts.map +1 -0
  162. package/lib/commands/gen2-migration/generate/generators/auth/index.js +286 -0
  163. package/lib/commands/gen2-migration/generate/generators/auth/index.js.map +1 -0
  164. package/lib/commands/gen2-migration/generate/generators/auth/index.test.d.ts +2 -0
  165. package/lib/commands/gen2-migration/generate/generators/auth/index.test.d.ts.map +1 -0
  166. package/lib/commands/gen2-migration/generate/generators/auth/index.test.js +437 -0
  167. package/lib/commands/gen2-migration/generate/generators/auth/index.test.js.map +1 -0
  168. package/lib/commands/gen2-migration/generate/generators/data/index.d.ts +35 -0
  169. package/lib/commands/gen2-migration/generate/generators/data/index.d.ts.map +1 -0
  170. package/lib/commands/gen2-migration/generate/generators/data/index.js +199 -0
  171. package/lib/commands/gen2-migration/generate/generators/data/index.js.map +1 -0
  172. package/lib/commands/gen2-migration/generate/generators/data/index.test.d.ts +2 -0
  173. package/lib/commands/gen2-migration/generate/generators/data/index.test.d.ts.map +1 -0
  174. package/lib/commands/gen2-migration/generate/generators/data/index.test.js +50 -0
  175. package/lib/commands/gen2-migration/generate/generators/data/index.test.js.map +1 -0
  176. package/lib/commands/gen2-migration/generate/generators/functions/index.d.ts +17 -0
  177. package/lib/commands/gen2-migration/generate/generators/functions/index.d.ts.map +1 -0
  178. package/lib/commands/gen2-migration/generate/generators/functions/index.js +125 -0
  179. package/lib/commands/gen2-migration/generate/generators/functions/index.js.map +1 -0
  180. package/lib/commands/gen2-migration/generate/generators/functions/lambda.d.ts +6 -0
  181. package/lib/commands/gen2-migration/generate/generators/functions/lambda.d.ts.map +1 -0
  182. package/lib/commands/gen2-migration/generate/generators/functions/lambda.js +16 -0
  183. package/lib/commands/gen2-migration/generate/generators/functions/lambda.js.map +1 -0
  184. package/lib/commands/gen2-migration/generate/generators/storage/access.d.ts +4 -0
  185. package/lib/commands/gen2-migration/generate/generators/storage/access.d.ts.map +1 -0
  186. package/lib/commands/gen2-migration/generate/generators/storage/access.js +53 -0
  187. package/lib/commands/gen2-migration/generate/generators/storage/access.js.map +1 -0
  188. package/lib/commands/gen2-migration/generate/generators/storage/index.d.ts +31 -0
  189. package/lib/commands/gen2-migration/generate/generators/storage/index.d.ts.map +1 -0
  190. package/lib/commands/gen2-migration/generate/generators/storage/index.js +66 -0
  191. package/lib/commands/gen2-migration/generate/generators/storage/index.js.map +1 -0
  192. package/lib/commands/gen2-migration/generate/npm_package/renderer.d.ts +27 -0
  193. package/lib/commands/gen2-migration/generate/npm_package/renderer.d.ts.map +1 -0
  194. package/lib/commands/gen2-migration/generate/npm_package/renderer.js +28 -0
  195. package/lib/commands/gen2-migration/generate/npm_package/renderer.js.map +1 -0
  196. package/lib/commands/gen2-migration/generate/render_pipeline.d.ts +9 -0
  197. package/lib/commands/gen2-migration/generate/render_pipeline.d.ts.map +1 -0
  198. package/lib/commands/gen2-migration/generate/render_pipeline.js +15 -0
  199. package/lib/commands/gen2-migration/generate/render_pipeline.js.map +1 -0
  200. package/lib/commands/gen2-migration/generate/renderers/ensure_directory.d.ts +7 -0
  201. package/lib/commands/gen2-migration/generate/renderers/ensure_directory.d.ts.map +1 -0
  202. package/lib/commands/gen2-migration/generate/renderers/ensure_directory.js +17 -0
  203. package/lib/commands/gen2-migration/generate/renderers/ensure_directory.js.map +1 -0
  204. package/lib/commands/gen2-migration/generate/renderers/package_json.d.ts +8 -0
  205. package/lib/commands/gen2-migration/generate/renderers/package_json.d.ts.map +1 -0
  206. package/lib/commands/gen2-migration/generate/renderers/package_json.js +15 -0
  207. package/lib/commands/gen2-migration/generate/renderers/package_json.js.map +1 -0
  208. package/lib/commands/gen2-migration/generate/renderers/typescript_block_node.d.ts +11 -0
  209. package/lib/commands/gen2-migration/generate/renderers/typescript_block_node.d.ts.map +1 -0
  210. package/lib/commands/gen2-migration/generate/renderers/typescript_block_node.js +22 -0
  211. package/lib/commands/gen2-migration/generate/renderers/typescript_block_node.js.map +1 -0
  212. package/lib/commands/gen2-migration/generate/resource/resource.d.ts +20 -0
  213. package/lib/commands/gen2-migration/generate/resource/resource.d.ts.map +1 -0
  214. package/lib/commands/gen2-migration/generate/resource/resource.js +60 -0
  215. package/lib/commands/gen2-migration/generate/resource/resource.js.map +1 -0
  216. package/lib/commands/gen2-migration/generate/test_utils/import_regex.d.ts +2 -0
  217. package/lib/commands/gen2-migration/generate/test_utils/import_regex.d.ts.map +1 -0
  218. package/lib/commands/gen2-migration/generate/test_utils/import_regex.js +6 -0
  219. package/lib/commands/gen2-migration/generate/test_utils/import_regex.js.map +1 -0
  220. package/lib/commands/gen2-migration/generate/test_utils/ts_node_printer.d.ts +4 -0
  221. package/lib/commands/gen2-migration/generate/test_utils/ts_node_printer.d.ts.map +1 -0
  222. package/lib/commands/gen2-migration/generate/test_utils/ts_node_printer.js +22 -0
  223. package/lib/commands/gen2-migration/generate/test_utils/ts_node_printer.js.map +1 -0
  224. package/lib/commands/gen2-migration/generate/todo_error.d.ts +3 -0
  225. package/lib/commands/gen2-migration/generate/todo_error.d.ts.map +1 -0
  226. package/lib/commands/gen2-migration/generate/todo_error.js +11 -0
  227. package/lib/commands/gen2-migration/generate/todo_error.js.map +1 -0
  228. package/lib/commands/gen2-migration/generate/ts_factory_utils.d.ts +3 -0
  229. package/lib/commands/gen2-migration/generate/ts_factory_utils.d.ts.map +1 -0
  230. package/lib/commands/gen2-migration/generate/ts_factory_utils.js +10 -0
  231. package/lib/commands/gen2-migration/generate/ts_factory_utils.js.map +1 -0
  232. package/lib/commands/gen2-migration/generate/types.d.ts +4 -0
  233. package/lib/commands/gen2-migration/generate/types.d.ts.map +1 -0
  234. package/lib/commands/gen2-migration/generate/types.js +3 -0
  235. package/lib/commands/gen2-migration/generate/types.js.map +1 -0
  236. package/lib/commands/gen2-migration/generate/unsupported/cdk-from-cfn.d.ts +26 -0
  237. package/lib/commands/gen2-migration/generate/unsupported/cdk-from-cfn.d.ts.map +1 -0
  238. package/lib/commands/gen2-migration/generate/unsupported/cdk-from-cfn.js +152 -0
  239. package/lib/commands/gen2-migration/generate/unsupported/cdk-from-cfn.js.map +1 -0
  240. package/lib/commands/gen2-migration/generate.js +2 -2
  241. package/lib/commands/gen2-migration/generate.js.map +1 -1
  242. package/lib/commands/gen2-migration.d.ts.map +1 -1
  243. package/lib/commands/gen2-migration.js +2 -1
  244. package/lib/commands/gen2-migration.js.map +1 -1
  245. package/package.json +2 -1
  246. package/aws-amplify-cli-internal-gen2-migration-experimental-alpha-0.1.0.tgz +0 -0
  247. package/lib/commands/gen2-migration/codegen-custom-resources/generator/backend-updater.d.ts.map +0 -1
  248. package/lib/commands/gen2-migration/codegen-custom-resources/generator/backend-updater.js.map +0 -1
  249. package/lib/commands/gen2-migration/codegen-custom-resources/generator/dependency-merger.d.ts.map +0 -1
  250. package/lib/commands/gen2-migration/codegen-custom-resources/generator/dependency-merger.js.map +0 -1
  251. package/lib/commands/gen2-migration/codegen-custom-resources/generator/file-converter.d.ts.map +0 -1
  252. package/lib/commands/gen2-migration/codegen-custom-resources/generator/file-converter.js.map +0 -1
  253. package/lib/commands/gen2-migration/codegen-custom-resources/generator/gen2-file-generator.d.ts.map +0 -1
  254. package/lib/commands/gen2-migration/codegen-custom-resources/generator/gen2-file-generator.js.map +0 -1
  255. package/lib/commands/gen2-migration/codegen-custom-resources/parser/cdk-stack-parser.d.ts.map +0 -1
  256. package/lib/commands/gen2-migration/codegen-custom-resources/parser/cdk-stack-parser.js.map +0 -1
  257. package/lib/commands/gen2-migration/codegen-custom-resources/parser/pattern-detector.d.ts.map +0 -1
  258. package/lib/commands/gen2-migration/codegen-custom-resources/parser/pattern-detector.js.map +0 -1
  259. package/lib/commands/gen2-migration/codegen-custom-resources/scanner/custom-resource-scanner.d.ts.map +0 -1
  260. package/lib/commands/gen2-migration/codegen-custom-resources/scanner/custom-resource-scanner.js.map +0 -1
  261. package/lib/commands/gen2-migration/codegen-custom-resources/transformer/amplify-helper-transformer.d.ts.map +0 -1
  262. package/lib/commands/gen2-migration/codegen-custom-resources/transformer/amplify-helper-transformer.js.map +0 -1
  263. package/lib/commands/gen2-migration/codegen-custom-resources/types.d.ts.map +0 -1
  264. package/lib/commands/gen2-migration/codegen-custom-resources/types.js.map +0 -1
  265. /package/lib/commands/gen2-migration/{codegen-custom-resources → generate/custom-resources}/generator/backend-updater.d.ts +0 -0
  266. /package/lib/commands/gen2-migration/{codegen-custom-resources → generate/custom-resources}/generator/backend-updater.js +0 -0
  267. /package/lib/commands/gen2-migration/{codegen-custom-resources → generate/custom-resources}/generator/dependency-merger.d.ts +0 -0
  268. /package/lib/commands/gen2-migration/{codegen-custom-resources → generate/custom-resources}/generator/dependency-merger.js +0 -0
  269. /package/lib/commands/gen2-migration/{codegen-custom-resources → generate/custom-resources}/generator/file-converter.d.ts +0 -0
  270. /package/lib/commands/gen2-migration/{codegen-custom-resources → generate/custom-resources}/generator/file-converter.js +0 -0
  271. /package/lib/commands/gen2-migration/{codegen-custom-resources → generate/custom-resources}/generator/gen2-file-generator.d.ts +0 -0
  272. /package/lib/commands/gen2-migration/{codegen-custom-resources → generate/custom-resources}/generator/gen2-file-generator.js +0 -0
  273. /package/lib/commands/gen2-migration/{codegen-custom-resources → generate/custom-resources}/parser/cdk-stack-parser.d.ts +0 -0
  274. /package/lib/commands/gen2-migration/{codegen-custom-resources → generate/custom-resources}/parser/cdk-stack-parser.js +0 -0
  275. /package/lib/commands/gen2-migration/{codegen-custom-resources → generate/custom-resources}/parser/pattern-detector.d.ts +0 -0
  276. /package/lib/commands/gen2-migration/{codegen-custom-resources → generate/custom-resources}/parser/pattern-detector.js +0 -0
  277. /package/lib/commands/gen2-migration/{codegen-custom-resources → generate/custom-resources}/scanner/custom-resource-scanner.d.ts +0 -0
  278. /package/lib/commands/gen2-migration/{codegen-custom-resources → generate/custom-resources}/scanner/custom-resource-scanner.js +0 -0
  279. /package/lib/commands/gen2-migration/{codegen-custom-resources → generate/custom-resources}/transformer/amplify-helper-transformer.d.ts +0 -0
  280. /package/lib/commands/gen2-migration/{codegen-custom-resources → generate/custom-resources}/types.d.ts +0 -0
  281. /package/lib/commands/gen2-migration/{codegen-custom-resources → generate/custom-resources}/types.js +0 -0
@@ -6,8 +6,9 @@ export declare abstract class AmplifyMigrationStep {
6
6
  protected readonly appName: string;
7
7
  protected readonly appId: string;
8
8
  protected readonly rootStackName: string;
9
+ protected readonly region: string;
9
10
  protected readonly context: $TSContext;
10
- constructor(logger: Logger, currentEnvName: string, appName: string, appId: string, rootStackName: string, context: $TSContext);
11
+ constructor(logger: Logger, currentEnvName: string, appName: string, appId: string, rootStackName: string, region: string, context: $TSContext);
11
12
  abstract validate(): Promise<void>;
12
13
  abstract execute(): Promise<void>;
13
14
  abstract rollback(): Promise<void>;
@@ -1 +1 @@
1
- {"version":3,"file":"_step.d.ts","sourceRoot":"","sources":["../../../src/commands/gen2-migration/_step.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,+BAA+B,CAAC;AAC3D,OAAO,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAE3C,8BAAsB,oBAAoB;IAEtC,SAAS,CAAC,QAAQ,CAAC,MAAM,EAAE,MAAM;IACjC,SAAS,CAAC,QAAQ,CAAC,cAAc,EAAE,MAAM;IACzC,SAAS,CAAC,QAAQ,CAAC,OAAO,EAAE,MAAM;IAClC,SAAS,CAAC,QAAQ,CAAC,KAAK,EAAE,MAAM;IAChC,SAAS,CAAC,QAAQ,CAAC,aAAa,EAAE,MAAM;IACxC,SAAS,CAAC,QAAQ,CAAC,OAAO,EAAE,UAAU;gBALnB,MAAM,EAAE,MAAM,EACd,cAAc,EAAE,MAAM,EACtB,OAAO,EAAE,MAAM,EACf,KAAK,EAAE,MAAM,EACb,aAAa,EAAE,MAAM,EACrB,OAAO,EAAE,UAAU;aAGxB,QAAQ,IAAI,OAAO,CAAC,IAAI,CAAC;aAEzB,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC;aAExB,QAAQ,IAAI,OAAO,CAAC,IAAI,CAAC;aAEzB,YAAY,IAAI,MAAM,EAAE;CACzC"}
1
+ {"version":3,"file":"_step.d.ts","sourceRoot":"","sources":["../../../src/commands/gen2-migration/_step.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,+BAA+B,CAAC;AAC3D,OAAO,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAE3C,8BAAsB,oBAAoB;IAEtC,SAAS,CAAC,QAAQ,CAAC,MAAM,EAAE,MAAM;IACjC,SAAS,CAAC,QAAQ,CAAC,cAAc,EAAE,MAAM;IACzC,SAAS,CAAC,QAAQ,CAAC,OAAO,EAAE,MAAM;IAClC,SAAS,CAAC,QAAQ,CAAC,KAAK,EAAE,MAAM;IAChC,SAAS,CAAC,QAAQ,CAAC,aAAa,EAAE,MAAM;IACxC,SAAS,CAAC,QAAQ,CAAC,MAAM,EAAE,MAAM;IACjC,SAAS,CAAC,QAAQ,CAAC,OAAO,EAAE,UAAU;gBANnB,MAAM,EAAE,MAAM,EACd,cAAc,EAAE,MAAM,EACtB,OAAO,EAAE,MAAM,EACf,KAAK,EAAE,MAAM,EACb,aAAa,EAAE,MAAM,EACrB,MAAM,EAAE,MAAM,EACd,OAAO,EAAE,UAAU;aAGxB,QAAQ,IAAI,OAAO,CAAC,IAAI,CAAC;aAEzB,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC;aAExB,QAAQ,IAAI,OAAO,CAAC,IAAI,CAAC;aAEzB,YAAY,IAAI,MAAM,EAAE;CACzC"}
@@ -2,12 +2,13 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.AmplifyMigrationStep = void 0;
4
4
  class AmplifyMigrationStep {
5
- constructor(logger, currentEnvName, appName, appId, rootStackName, context) {
5
+ constructor(logger, currentEnvName, appName, appId, rootStackName, region, context) {
6
6
  this.logger = logger;
7
7
  this.currentEnvName = currentEnvName;
8
8
  this.appName = appName;
9
9
  this.appId = appId;
10
10
  this.rootStackName = rootStackName;
11
+ this.region = region;
11
12
  this.context = context;
12
13
  }
13
14
  }
@@ -1 +1 @@
1
- {"version":3,"file":"_step.js","sourceRoot":"","sources":["../../../src/commands/gen2-migration/_step.ts"],"names":[],"mappings":";;;AAGA,MAAsB,oBAAoB;IACxC,YACqB,MAAc,EACd,cAAsB,EACtB,OAAe,EACf,KAAa,EACb,aAAqB,EACrB,OAAmB;QALnB,WAAM,GAAN,MAAM,CAAQ;QACd,mBAAc,GAAd,cAAc,CAAQ;QACtB,YAAO,GAAP,OAAO,CAAQ;QACf,UAAK,GAAL,KAAK,CAAQ;QACb,kBAAa,GAAb,aAAa,CAAQ;QACrB,YAAO,GAAP,OAAO,CAAY;IACrC,CAAC;CASL;AAjBD,oDAiBC"}
1
+ {"version":3,"file":"_step.js","sourceRoot":"","sources":["../../../src/commands/gen2-migration/_step.ts"],"names":[],"mappings":";;;AAGA,MAAsB,oBAAoB;IACxC,YACqB,MAAc,EACd,cAAsB,EACtB,OAAe,EACf,KAAa,EACb,aAAqB,EACrB,MAAc,EACd,OAAmB;QANnB,WAAM,GAAN,MAAM,CAAQ;QACd,mBAAc,GAAd,cAAc,CAAQ;QACtB,YAAO,GAAP,OAAO,CAAQ;QACf,UAAK,GAAL,KAAK,CAAQ;QACb,kBAAa,GAAb,aAAa,CAAQ;QACrB,WAAM,GAAN,MAAM,CAAQ;QACd,YAAO,GAAP,OAAO,CAAY;IACrC,CAAC;CASL;AAlBD,oDAkBC"}
@@ -0,0 +1,24 @@
1
+ import { AuthDefinition, ReferenceAuth } from '../../core/migration-pipeline';
2
+ import { LambdaConfigType, PasswordPolicyType, ProviderDescription, UserPoolMfaType, UserPoolType, UserPoolClientType, GroupType, IdentityProviderType, SoftwareTokenMfaConfigType } from '@aws-sdk/client-cognito-identity-provider';
3
+ export interface AuthTriggerConnection {
4
+ triggerType: keyof LambdaConfigType;
5
+ lambdaFunctionName: string;
6
+ }
7
+ export type AuthTriggerConnectionSourceMap = Partial<Record<keyof LambdaConfigType, string>>;
8
+ export interface AuthSynthesizerOptions {
9
+ userPool: UserPoolType;
10
+ identityPoolName?: string;
11
+ identityProviders?: ProviderDescription[];
12
+ identityProvidersDetails?: IdentityProviderType[];
13
+ identityGroups?: GroupType[];
14
+ webClient?: UserPoolClientType;
15
+ authTriggerConnections?: AuthTriggerConnectionSourceMap;
16
+ referenceAuth?: ReferenceAuth;
17
+ guestLogin?: boolean;
18
+ mfaConfig?: UserPoolMfaType;
19
+ totpConfig?: SoftwareTokenMfaConfigType;
20
+ userPoolClient?: UserPoolClientType;
21
+ }
22
+ export declare const DEFAULT_PASSWORD_SETTINGS: PasswordPolicyType;
23
+ export declare const getAuthDefinition: ({ userPool, identityPoolName, identityProviders, identityProvidersDetails, identityGroups, webClient, authTriggerConnections, guestLogin, referenceAuth, mfaConfig, totpConfig, userPoolClient, }: AuthSynthesizerOptions) => AuthDefinition;
24
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/commands/gen2-migration/generate/adapters/auth/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,cAAc,EAgBd,aAAa,EACd,MAAM,+BAA+B,CAAC;AACvC,OAAO,EACL,gBAAgB,EAEhB,kBAAkB,EAClB,mBAAmB,EACnB,eAAe,EACf,YAAY,EACZ,kBAAkB,EAElB,SAAS,EACT,oBAAoB,EACpB,0BAA0B,EAC3B,MAAM,2CAA2C,CAAC;AAEnD,MAAM,WAAW,qBAAqB;IACpC,WAAW,EAAE,MAAM,gBAAgB,CAAC;IACpC,kBAAkB,EAAE,MAAM,CAAC;CAC5B;AAED,MAAM,MAAM,8BAA8B,GAAG,OAAO,CAAC,MAAM,CAAC,MAAM,gBAAgB,EAAE,MAAM,CAAC,CAAC,CAAC;AAE7F,MAAM,WAAW,sBAAsB;IACrC,QAAQ,EAAE,YAAY,CAAC;IACvB,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,iBAAiB,CAAC,EAAE,mBAAmB,EAAE,CAAC;IAC1C,wBAAwB,CAAC,EAAE,oBAAoB,EAAE,CAAC;IAClD,cAAc,CAAC,EAAE,SAAS,EAAE,CAAC;IAC7B,SAAS,CAAC,EAAE,kBAAkB,CAAC;IAC/B,sBAAsB,CAAC,EAAE,8BAA8B,CAAC;IACxD,aAAa,CAAC,EAAE,aAAa,CAAC;IAC9B,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,SAAS,CAAC,EAAE,eAAe,CAAC;IAC5B,UAAU,CAAC,EAAE,0BAA0B,CAAC;IACxC,cAAc,CAAC,EAAE,kBAAkB,CAAC;CACrC;AAED,eAAO,MAAM,yBAAyB,EAAE,kBAMvC,CAAC;AAiVF,eAAO,MAAM,iBAAiB,GAAI,mMAa/B,sBAAsB,KAAG,cA0J3B,CAAC"}
@@ -0,0 +1,297 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.getAuthDefinition = exports.DEFAULT_PASSWORD_SETTINGS = void 0;
4
+ const client_cognito_identity_provider_1 = require("@aws-sdk/client-cognito-identity-provider");
5
+ exports.DEFAULT_PASSWORD_SETTINGS = {
6
+ MinimumLength: 8,
7
+ RequireLowercase: true,
8
+ RequireUppercase: true,
9
+ RequireNumbers: true,
10
+ TemporaryPasswordValidityDays: 3,
11
+ };
12
+ const COGNITO_TRIGGERS_TO_SKIP = ['PreTokenGenerationConfig'];
13
+ const getPasswordPolicyOverrides = (passwordPolicy) => {
14
+ const policyOverrides = {};
15
+ const passwordOverridePath = (policyKey) => `Policies.PasswordPolicy.${policyKey}`;
16
+ for (const key of Object.keys(passwordPolicy)) {
17
+ const typedKey = key;
18
+ if (passwordPolicy[typedKey] !== undefined) {
19
+ policyOverrides[passwordOverridePath(typedKey)] = passwordPolicy[typedKey];
20
+ }
21
+ }
22
+ return policyOverrides;
23
+ };
24
+ const getUserPoolOverrides = (userPool) => {
25
+ var _a, _b;
26
+ const userPoolOverrides = {};
27
+ Object.assign(userPoolOverrides, getPasswordPolicyOverrides((_b = (_a = userPool.Policies) === null || _a === void 0 ? void 0 : _a.PasswordPolicy) !== null && _b !== void 0 ? _b : {}));
28
+ if (userPool.UsernameAttributes === undefined || userPool.UsernameAttributes.length === 0) {
29
+ userPoolOverrides.usernameAttributes = undefined;
30
+ }
31
+ else {
32
+ userPoolOverrides.usernameAttributes = userPool.UsernameAttributes;
33
+ }
34
+ return userPoolOverrides;
35
+ };
36
+ const getMfaConfiguration = (mfaConfig, totpConfig) => {
37
+ const multifactor = {
38
+ mode: 'OFF',
39
+ };
40
+ if (mfaConfig === 'ON') {
41
+ multifactor.mode = 'REQUIRED';
42
+ multifactor.sms = true;
43
+ (totpConfig === null || totpConfig === void 0 ? void 0 : totpConfig.Enabled) ? (multifactor.totp = true) : (multifactor.totp = false);
44
+ }
45
+ else if (mfaConfig === 'OPTIONAL') {
46
+ multifactor.mode = 'OPTIONAL';
47
+ multifactor.sms = true;
48
+ (totpConfig === null || totpConfig === void 0 ? void 0 : totpConfig.Enabled) ? (multifactor.totp = true) : (multifactor.totp = false);
49
+ }
50
+ return multifactor;
51
+ };
52
+ const getEmailConfig = (userPool) => {
53
+ var _a, _b;
54
+ return {
55
+ emailVerificationBody: (_a = userPool.EmailVerificationMessage) !== null && _a !== void 0 ? _a : '',
56
+ emailVerificationSubject: (_b = userPool.EmailVerificationSubject) !== null && _b !== void 0 ? _b : '',
57
+ };
58
+ };
59
+ const getStandardUserAttributes = (signupAttributes, mappedUserAttributeName) => {
60
+ return ((signupAttributes === null || signupAttributes === void 0 ? void 0 : signupAttributes.reduce((standardAttributes, attribute) => {
61
+ const standardAttribute = {
62
+ required: attribute.Required,
63
+ mutable: attribute.Mutable,
64
+ };
65
+ if (attribute.Name !== undefined && attribute.Name in mappedUserAttributeName && attribute.Required) {
66
+ return {
67
+ ...standardAttributes,
68
+ [mappedUserAttributeName[attribute.Name]]: standardAttribute,
69
+ };
70
+ }
71
+ return standardAttributes;
72
+ }, {})) || {});
73
+ };
74
+ const getCustomUserAttributes = (signupAttributes) => {
75
+ return ((signupAttributes === null || signupAttributes === void 0 ? void 0 : signupAttributes.reduce((customAttributes, attribute) => {
76
+ if (attribute.Name !== undefined && attribute.Name.startsWith('custom:')) {
77
+ const customAttribute = {
78
+ mutable: attribute.Mutable,
79
+ dataType: attribute.AttributeDataType,
80
+ };
81
+ if (attribute.NumberAttributeConstraints && Object.keys(attribute.NumberAttributeConstraints).length > 0) {
82
+ customAttribute.min = Number(attribute.NumberAttributeConstraints.MinValue);
83
+ customAttribute.max = Number(attribute.NumberAttributeConstraints.MaxValue);
84
+ }
85
+ else if (attribute.StringAttributeConstraints && Object.keys(attribute.StringAttributeConstraints).length > 0) {
86
+ customAttribute.minLen = Number(attribute.StringAttributeConstraints.MinLength);
87
+ customAttribute.maxLen = Number(attribute.StringAttributeConstraints.MaxLength);
88
+ }
89
+ return {
90
+ ...customAttributes,
91
+ [attribute.Name]: customAttribute,
92
+ };
93
+ }
94
+ return customAttributes;
95
+ }, {})) || {});
96
+ };
97
+ const getGroups = (identityGroups) => {
98
+ if (!identityGroups || identityGroups.length === 0) {
99
+ return [];
100
+ }
101
+ const groupsWithPrecedence = identityGroups.filter((group) => group.Precedence !== undefined);
102
+ return groupsWithPrecedence
103
+ .sort((a, b) => (a.Precedence || 0) - (b.Precedence || 0))
104
+ .map((group) => group.GroupName)
105
+ .filter((groupName) => groupName !== undefined);
106
+ };
107
+ const getScopes = (scopes) => {
108
+ return scopes.filter((scope) => ['phone', 'email', 'openid', 'profile', 'aws.cognito.signin.user.admin'].includes(scope));
109
+ };
110
+ const getProviderSpecificScopes = (providerDetails) => {
111
+ const scopeFields = ['authorized_scopes', 'scope', 'scopes'];
112
+ for (const field of scopeFields) {
113
+ if (providerDetails[field]) {
114
+ return providerDetails[field].split(/[\s,]+/).filter((scope) => scope.length > 0);
115
+ }
116
+ }
117
+ return [];
118
+ };
119
+ const mappedLambdaConfigKey = (key) => {
120
+ switch (key) {
121
+ case 'PreSignUp':
122
+ return 'preSignUp';
123
+ case 'CustomMessage':
124
+ return 'customMessage';
125
+ case 'UserMigration':
126
+ return 'userMigration';
127
+ case 'PostConfirmation':
128
+ return 'postConfirmation';
129
+ case 'PreAuthentication':
130
+ return 'preAuthentication';
131
+ case 'PostAuthentication':
132
+ return 'postAuthentication';
133
+ case 'PreTokenGeneration':
134
+ return 'preTokenGeneration';
135
+ case 'DefineAuthChallenge':
136
+ return 'defineAuthChallenge';
137
+ case 'CreateAuthChallenge':
138
+ return 'createAuthChallenge';
139
+ case 'VerifyAuthChallengeResponse':
140
+ return 'verifyAuthChallengeResponse';
141
+ default:
142
+ throw new Error(`Could not map the provided key: ${key}`);
143
+ }
144
+ };
145
+ const getAuthTriggers = (lambdaConfig, triggerSourceFiles) => {
146
+ return (Object.keys(lambdaConfig)
147
+ .filter((triggerName) => !COGNITO_TRIGGERS_TO_SKIP.includes(triggerName))
148
+ .reduce((prev, key) => {
149
+ var _a;
150
+ const typedKey = key;
151
+ prev[mappedLambdaConfigKey(typedKey)] = { source: (_a = triggerSourceFiles[typedKey]) !== null && _a !== void 0 ? _a : '' };
152
+ return prev;
153
+ }, {}));
154
+ };
155
+ function filterAttributeMapping(attributeMapping, mappedUserAttributeName) {
156
+ return Object.fromEntries(Object.entries(attributeMapping)
157
+ .filter(([key]) => Object.keys(mappedUserAttributeName).includes(key))
158
+ .map(([key, value]) => [mappedUserAttributeName[key], value]));
159
+ }
160
+ const getAuthDefinition = ({ userPool, identityPoolName, identityProviders, identityProvidersDetails, identityGroups, webClient, authTriggerConnections, guestLogin, referenceAuth, mfaConfig, totpConfig, userPoolClient, }) => {
161
+ var _a;
162
+ const mappedUserAttributeName = {
163
+ address: 'address',
164
+ birthdate: 'birthdate',
165
+ email: 'email',
166
+ family_name: 'familyName',
167
+ gender: 'gender',
168
+ given_name: 'givenName',
169
+ locale: 'locale',
170
+ middle_name: 'middleName',
171
+ name: 'fullname',
172
+ nickname: 'nickname',
173
+ phone_number: 'phoneNumber',
174
+ picture: 'profilePicture',
175
+ preferred_username: 'preferredUsername',
176
+ profile: 'profilePage',
177
+ zoneinfo: 'timezone',
178
+ updated_at: 'lastUpdateTime',
179
+ website: 'website',
180
+ };
181
+ const loginWith = { email: true };
182
+ const mapIdentityProvider = {
183
+ [client_cognito_identity_provider_1.IdentityProviderTypeType.Google]: ['googleLogin', 'googleAttributes'],
184
+ [client_cognito_identity_provider_1.IdentityProviderTypeType.SignInWithApple]: ['appleLogin', 'appleAttributes'],
185
+ [client_cognito_identity_provider_1.IdentityProviderTypeType.LoginWithAmazon]: ['amazonLogin', 'amazonAttributes'],
186
+ [client_cognito_identity_provider_1.IdentityProviderTypeType.Facebook]: ['facebookLogin', 'facebookAttributes'],
187
+ };
188
+ if (identityProviders !== undefined) {
189
+ identityProviders.forEach((provider) => {
190
+ const loginWithProperty = mapIdentityProvider[provider === null || provider === void 0 ? void 0 : provider.ProviderType];
191
+ if (loginWithProperty !== undefined) {
192
+ const loginProperty = loginWithProperty[0];
193
+ loginWith[loginProperty] = true;
194
+ }
195
+ });
196
+ }
197
+ if (identityProvidersDetails) {
198
+ const oidcOptions = [];
199
+ let samlOptions;
200
+ for (const provider of identityProvidersDetails) {
201
+ const { ProviderType, ProviderName, ProviderDetails, AttributeMapping } = provider;
202
+ if (ProviderType === client_cognito_identity_provider_1.IdentityProviderTypeType.OIDC && ProviderDetails) {
203
+ const { oidc_issuer, authorize_url, token_url, attributes_url, jwks_uri } = ProviderDetails;
204
+ const oidcOption = {
205
+ issuerUrl: oidc_issuer,
206
+ };
207
+ if (ProviderName)
208
+ oidcOption.name = ProviderName;
209
+ if (authorize_url && token_url && attributes_url && jwks_uri) {
210
+ oidcOption.endpoints = {
211
+ authorization: authorize_url,
212
+ token: token_url,
213
+ userInfo: attributes_url,
214
+ jwksUri: jwks_uri,
215
+ };
216
+ }
217
+ if (AttributeMapping)
218
+ oidcOption.attributeMapping = filterAttributeMapping(AttributeMapping, mappedUserAttributeName);
219
+ oidcOptions.push(oidcOption);
220
+ }
221
+ else if (ProviderType === client_cognito_identity_provider_1.IdentityProviderTypeType.SAML && ProviderDetails) {
222
+ const { metadataURL, metadataContent } = ProviderDetails;
223
+ samlOptions = {
224
+ metadata: {
225
+ metadataContent: metadataURL || metadataContent,
226
+ metadataType: metadataURL ? 'URL' : 'FILE',
227
+ },
228
+ };
229
+ if (ProviderName)
230
+ samlOptions.name = ProviderName;
231
+ if (AttributeMapping)
232
+ samlOptions.attributeMapping = filterAttributeMapping(AttributeMapping, mappedUserAttributeName);
233
+ }
234
+ else {
235
+ if (AttributeMapping) {
236
+ const attributeOption = mapIdentityProvider[provider === null || provider === void 0 ? void 0 : provider.ProviderType][1];
237
+ loginWith[attributeOption] = filterAttributeMapping(AttributeMapping, mappedUserAttributeName);
238
+ }
239
+ if (ProviderDetails) {
240
+ const providerScopes = getProviderSpecificScopes(ProviderDetails);
241
+ if (providerScopes.length > 0) {
242
+ const scopePropertyMap = {
243
+ [client_cognito_identity_provider_1.IdentityProviderTypeType.Google]: 'googleScopes',
244
+ [client_cognito_identity_provider_1.IdentityProviderTypeType.Facebook]: 'facebookScopes',
245
+ [client_cognito_identity_provider_1.IdentityProviderTypeType.LoginWithAmazon]: 'amazonScopes',
246
+ [client_cognito_identity_provider_1.IdentityProviderTypeType.SignInWithApple]: 'appleScopes',
247
+ };
248
+ const scopeProperty = scopePropertyMap[ProviderType];
249
+ if (scopeProperty) {
250
+ const mappedScopes = providerScopes
251
+ .map((scope) => {
252
+ if (scope === 'public_profile')
253
+ return 'profile';
254
+ return scope;
255
+ })
256
+ .filter((scope) => ['phone', 'email', 'openid', 'profile', 'aws.cognito.signin.user.admin'].includes(scope));
257
+ loginWith[scopeProperty] = mappedScopes;
258
+ }
259
+ }
260
+ }
261
+ }
262
+ }
263
+ loginWith.oidcLogin = oidcOptions;
264
+ loginWith.samlLogin = samlOptions;
265
+ }
266
+ if (userPool.EmailVerificationMessage || userPool.EmailVerificationSubject) {
267
+ loginWith.emailOptions = getEmailConfig(userPool);
268
+ }
269
+ if (webClient === null || webClient === void 0 ? void 0 : webClient.CallbackURLs) {
270
+ loginWith.callbackURLs = webClient === null || webClient === void 0 ? void 0 : webClient.CallbackURLs;
271
+ }
272
+ if (webClient === null || webClient === void 0 ? void 0 : webClient.LogoutURLs) {
273
+ loginWith.logoutURLs = webClient === null || webClient === void 0 ? void 0 : webClient.LogoutURLs;
274
+ }
275
+ if (webClient === null || webClient === void 0 ? void 0 : webClient.AllowedOAuthScopes) {
276
+ loginWith.scopes = getScopes(webClient === null || webClient === void 0 ? void 0 : webClient.AllowedOAuthScopes);
277
+ }
278
+ const userPoolOverrides = getUserPoolOverrides(userPool);
279
+ return {
280
+ loginOptions: loginWith,
281
+ mfa: getMfaConfiguration(mfaConfig, totpConfig),
282
+ standardUserAttributes: getStandardUserAttributes(userPool.SchemaAttributes, mappedUserAttributeName),
283
+ customUserAttributes: getCustomUserAttributes(userPool.SchemaAttributes),
284
+ groups: getGroups(identityGroups),
285
+ userPoolOverrides,
286
+ lambdaTriggers: getAuthTriggers((_a = userPool.LambdaConfig) !== null && _a !== void 0 ? _a : {}, authTriggerConnections !== null && authTriggerConnections !== void 0 ? authTriggerConnections : {}),
287
+ guestLogin,
288
+ identityPoolName,
289
+ oAuthFlows: webClient === null || webClient === void 0 ? void 0 : webClient.AllowedOAuthFlows,
290
+ readAttributes: webClient === null || webClient === void 0 ? void 0 : webClient.ReadAttributes,
291
+ writeAttributes: webClient === null || webClient === void 0 ? void 0 : webClient.WriteAttributes,
292
+ referenceAuth,
293
+ userPoolClient,
294
+ };
295
+ };
296
+ exports.getAuthDefinition = getAuthDefinition;
297
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../src/commands/gen2-migration/generate/adapters/auth/index.ts"],"names":[],"mappings":";;;AAoBA,gGAYmD;AAwBtC,QAAA,yBAAyB,GAAuB;IAC3D,aAAa,EAAE,CAAC;IAChB,gBAAgB,EAAE,IAAI;IACtB,gBAAgB,EAAE,IAAI;IACtB,cAAc,EAAE,IAAI;IACpB,6BAA6B,EAAE,CAAC;CACjC,CAAC;AAEF,MAAM,wBAAwB,GAAG,CAAC,0BAA0B,CAAC,CAAC;AAe9D,MAAM,0BAA0B,GAAG,CAAC,cAA2C,EAA4B,EAAE;IAC3G,MAAM,eAAe,GAA6B,EAAE,CAAC;IACrD,MAAM,oBAAoB,GAAG,CAAC,SAAmC,EAAsB,EAAE,CAAC,2BAA2B,SAAS,EAAE,CAAC;IACjI,KAAK,MAAM,GAAG,IAAI,MAAM,CAAC,IAAI,CAAC,cAAc,CAAC,EAAE,CAAC;QAC9C,MAAM,QAAQ,GAA6B,GAA+B,CAAC;QAC3E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","sourceRoot":"","sources":["../../../../../../src/commands/gen2-migration/generate/adapters/auth/index.test.ts"],"names":[],"mappings":""}
@@ -0,0 +1,140 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const index_1 = require("./index");
4
+ const client_cognito_identity_provider_1 = require("@aws-sdk/client-cognito-identity-provider");
5
+ describe('Auth Generator - Provider-Specific Scopes', () => {
6
+ it('should extract provider-specific scopes from ProviderDetails', () => {
7
+ var _a, _b, _c, _d, _e;
8
+ const mockIdentityProvidersDetails = [
9
+ {
10
+ ProviderType: client_cognito_identity_provider_1.IdentityProviderTypeType.Google,
11
+ ProviderName: 'Google',
12
+ ProviderDetails: {
13
+ client_id: '911159018992-rnun5p7a6imtf206ci261m3s0jbap5ng.apps.googleusercontent.com',
14
+ client_secret: 'GOCSPX-...',
15
+ authorized_scopes: 'openid email profile',
16
+ },
17
+ AttributeMapping: {
18
+ email: 'email',
19
+ name: 'name',
20
+ },
21
+ },
22
+ {
23
+ ProviderType: client_cognito_identity_provider_1.IdentityProviderTypeType.Facebook,
24
+ ProviderName: 'Facebook',
25
+ ProviderDetails: {
26
+ client_id: '1412236500618572',
27
+ client_secret: '...',
28
+ authorized_scopes: 'public_profile',
29
+ },
30
+ AttributeMapping: {
31
+ email: 'email',
32
+ name: 'name',
33
+ },
34
+ },
35
+ ];
36
+ const mockWebClient = {
37
+ AllowedOAuthScopes: ['aws.cognito.signin.user.admin', 'email', 'openid', 'phone', 'profile'],
38
+ CallbackURLs: ['http://localhost:3000/'],
39
+ LogoutURLs: ['http://localhost:3000/'],
40
+ };
41
+ const mockUserPool = {
42
+ EmailVerificationMessage: null,
43
+ EmailVerificationSubject: null,
44
+ SchemaAttributes: [],
45
+ };
46
+ const result = (0, index_1.getAuthDefinition)({
47
+ userPool: mockUserPool,
48
+ identityProviders: [{ ProviderType: client_cognito_identity_provider_1.IdentityProviderTypeType.Google }, { ProviderType: client_cognito_identity_provider_1.IdentityProviderTypeType.Facebook }],
49
+ identityProvidersDetails: mockIdentityProvidersDetails,
50
+ webClient: mockWebClient,
51
+ });
52
+ expect((_a = result.loginOptions) === null || _a === void 0 ? void 0 : _a.googleScopes).toEqual(['openid', 'email', 'profile']);
53
+ expect((_b = result.loginOptions) === null || _b === void 0 ? void 0 : _b.facebookScopes).toEqual(['profile']);
54
+ expect((_c = result.loginOptions) === null || _c === void 0 ? void 0 : _c.googleLogin).toBe(true);
55
+ expect((_d = result.loginOptions) === null || _d === void 0 ? void 0 : _d.facebookLogin).toBe(true);
56
+ expect((_e = result.loginOptions) === null || _e === void 0 ? void 0 : _e.scopes).toEqual(['aws.cognito.signin.user.admin', 'email', 'openid', 'phone', 'profile']);
57
+ });
58
+ it('should handle providers without scopes gracefully', () => {
59
+ var _a, _b;
60
+ const mockIdentityProvidersDetails = [
61
+ {
62
+ ProviderType: client_cognito_identity_provider_1.IdentityProviderTypeType.Google,
63
+ ProviderName: 'Google',
64
+ ProviderDetails: {
65
+ client_id: '911159018992-rnun5p7a6imtf206ci261m3s0jbap5ng.apps.googleusercontent.com',
66
+ client_secret: 'GOCSPX-...',
67
+ },
68
+ AttributeMapping: {
69
+ email: 'email',
70
+ },
71
+ },
72
+ ];
73
+ const mockUserPool = {
74
+ EmailVerificationMessage: null,
75
+ EmailVerificationSubject: null,
76
+ SchemaAttributes: [],
77
+ };
78
+ const result = (0, index_1.getAuthDefinition)({
79
+ userPool: mockUserPool,
80
+ identityProviders: [{ ProviderType: client_cognito_identity_provider_1.IdentityProviderTypeType.Google }],
81
+ identityProvidersDetails: mockIdentityProvidersDetails,
82
+ webClient: {},
83
+ });
84
+ expect((_a = result.loginOptions) === null || _a === void 0 ? void 0 : _a.googleScopes).toBeUndefined();
85
+ expect((_b = result.loginOptions) === null || _b === void 0 ? void 0 : _b.googleLogin).toBe(true);
86
+ });
87
+ it('should map Facebook public_profile to Cognito profile scope', () => {
88
+ var _a;
89
+ const mockIdentityProvidersDetails = [
90
+ {
91
+ ProviderType: client_cognito_identity_provider_1.IdentityProviderTypeType.Facebook,
92
+ ProviderName: 'Facebook',
93
+ ProviderDetails: {
94
+ client_id: '1412236500618572',
95
+ client_secret: '...',
96
+ authorized_scopes: 'public_profile email',
97
+ },
98
+ },
99
+ ];
100
+ const mockUserPool = {
101
+ EmailVerificationMessage: null,
102
+ EmailVerificationSubject: null,
103
+ SchemaAttributes: [],
104
+ };
105
+ const result = (0, index_1.getAuthDefinition)({
106
+ userPool: mockUserPool,
107
+ identityProviders: [{ ProviderType: client_cognito_identity_provider_1.IdentityProviderTypeType.Facebook }],
108
+ identityProvidersDetails: mockIdentityProvidersDetails,
109
+ webClient: {},
110
+ });
111
+ expect((_a = result.loginOptions) === null || _a === void 0 ? void 0 : _a.facebookScopes).toEqual(['profile', 'email']);
112
+ });
113
+ it('should filter out invalid scopes', () => {
114
+ var _a;
115
+ const mockIdentityProvidersDetails = [
116
+ {
117
+ ProviderType: client_cognito_identity_provider_1.IdentityProviderTypeType.Google,
118
+ ProviderName: 'Google',
119
+ ProviderDetails: {
120
+ client_id: '911159018992-rnun5p7a6imtf206ci261m3s0jbap5ng.apps.googleusercontent.com',
121
+ client_secret: 'GOCSPX-...',
122
+ authorized_scopes: 'openid email profile invalid_scope another_invalid',
123
+ },
124
+ },
125
+ ];
126
+ const mockUserPool = {
127
+ EmailVerificationMessage: null,
128
+ EmailVerificationSubject: null,
129
+ SchemaAttributes: [],
130
+ };
131
+ const result = (0, index_1.getAuthDefinition)({
132
+ userPool: mockUserPool,
133
+ identityProviders: [{ ProviderType: client_cognito_identity_provider_1.IdentityProviderTypeType.Google }],
134
+ identityProvidersDetails: mockIdentityProvidersDetails,
135
+ webClient: {},
136
+ });
137
+ expect((_a = result.loginOptions) === null || _a === void 0 ? void 0 : _a.googleScopes).toEqual(['openid', 'email', 'profile']);
138
+ });
139
+ });
140
+ //# sourceMappingURL=index.test.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.test.js","sourceRoot":"","sources":["../../../../../../src/commands/gen2-mig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E;oBACf,SAAS,EAAE,0EAA0E;oBACrF,aAAa,EAAE,YAAY;oBAC3B,iBAAiB,EAAE,oDAAoD;iBACxE;aACF;SACF,CAAC;QAEF,MAAM,YAAY,GAAG;YACnB,wBAAwB,EAAE,IAAI;YAC9B,wBAAwB,EAAE,IAAI;YAC9B,gBAAgB,EAAE,EAAE;SACrB,CAAC;QAEF,MAAM,MAAM,GAAG,IAAA,yBAAiB,EAAC;YAC/B,QAAQ,EAAE,YAAY;YACtB,iBAAiB,EAAE,CAAC,EAAE,YAAY,EAAE,2DAAwB,CAAC,MAAM,EAAE,CAAC;YACtE,wBAAwB,EAAE,4BAA4B;YACtD,SAAS,EAAE,EAAE;SACd,CAAC,CAAC;QAGH,MAAM,CAAC,MAAA,MAAM,CAAC,YAAY,0CAAE,YAAY,CAAC,CAAC,OAAO,CAAC,CAAC,QAAQ,EAAE,OAAO,EAAE,SAAS,CAAC,CAAC,CAAC;IACpF,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
@@ -0,0 +1,5 @@
1
+ import { DataTableMapping } from '../../core/migration-pipeline';
2
+ import { Stack } from '@aws-sdk/client-cloudformation';
3
+ export declare const tableMappingKey = "DataSourceMappingOutput";
4
+ export declare const getDataDefinition: (dataStack: Stack) => DataTableMapping;
5
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/commands/gen2-migration/generate/adapters/data/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AACjE,OAAO,EAAE,KAAK,EAAE,MAAM,gCAAgC,CAAC;AAEvD,eAAO,MAAM,eAAe,4BAA4B,CAAC;AAEzD,eAAO,MAAM,iBAAiB,GAAI,WAAW,KAAK,KAAG,gBAKpD,CAAC"}
@@ -0,0 +1,17 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.getDataDefinition = exports.tableMappingKey = void 0;
7
+ const node_assert_1 = __importDefault(require("node:assert"));
8
+ exports.tableMappingKey = 'DataSourceMappingOutput';
9
+ const getDataDefinition = (dataStack) => {
10
+ var _a, _b;
11
+ const rawTableMapping = (_b = (_a = dataStack.Outputs) === null || _a === void 0 ? void 0 : _a.find((o) => o.OutputKey === exports.tableMappingKey)) === null || _b === void 0 ? void 0 : _b.OutputValue;
12
+ (0, node_assert_1.default)(rawTableMapping);
13
+ const tableMapping = JSON.parse(rawTableMapping);
14
+ return tableMapping;
15
+ };
16
+ exports.getDataDefinition = getDataDefinition;
17
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../src/commands/gen2-migration/generate/adapters/data/index.ts"],"names":[],"mappings":";;;;;;AAAA,8DAAiC;AAIpB,QAAA,eAAe,GAAG,yBAAyB,CAAC;AAElD,MAAM,iBAAiB,GAAG,CAAC,SAAgB,EAAoB,EAAE;;IACtE,MAAM,eAAe,GAAG,MAAA,MAAA,SAAS,CAAC,OAAO,0CAAE,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,SAAS,KAAK,uBAAe,CAAC,0CAAE,WAAW,CAAC;IACrG,IAAA,qBAAM,EAAC,eAAe,CAAC,CAAC;IACxB,MAAM,YAAY,GAAG,IAAI,CAAC,KAAK,CAAC,eAAe,CAAC,CAAC;IACjD,OAAO,YAAY,CAAC;AACtB,CAAC,CAAC;AALW,QAAA,iBAAiB,qBAK5B"}
@@ -0,0 +1,17 @@
1
+ import { FunctionDefinition } from '../../core/migration-pipeline';
2
+ import { FunctionConfiguration } from '@aws-sdk/client-lambda';
3
+ export type AmplifyMetaFunction = {
4
+ service: string;
5
+ providerPlugin: 'awscloudformation';
6
+ output: Record<string, string>;
7
+ };
8
+ type FunctionSchedule = {
9
+ functionName: string;
10
+ scheduleExpression: string | undefined;
11
+ };
12
+ export type AmplifyMetaWithFunction = {
13
+ function: Record<string, AmplifyMetaFunction>;
14
+ };
15
+ export declare const getFunctionDefinition: (functionConfigurations: FunctionConfiguration[], functionSchedules: FunctionSchedule[], functionCategoryMap: Map<string, string>, meta: AmplifyMetaWithFunction) => FunctionDefinition[];
16
+ export {};
17
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/commands/gen2-migration/generate/adapters/functions/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,+BAA+B,CAAC;AACnE,OAAO,EAAE,qBAAqB,EAAE,MAAM,wBAAwB,CAAC;AAG/D,MAAM,MAAM,mBAAmB,GAAG;IAChC,OAAO,EAAE,MAAM,CAAC;IAChB,cAAc,EAAE,mBAAmB,CAAC;IACpC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CAChC,CAAC;AAEF,KAAK,gBAAgB,GAAG;IACtB,YAAY,EAAE,MAAM,CAAC;IACrB,kBAAkB,EAAE,MAAM,GAAG,SAAS,CAAC;CACxC,CAAC;AAEF,MAAM,MAAM,uBAAuB,GAAG;IACpC,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,mBAAmB,CAAC,CAAC;CAC/C,CAAC;AAuBF,eAAO,MAAM,qBAAqB,GAChC,wBAAwB,qBAAqB,EAAE,EAC/C,mBAAmB,gBAAgB,EAAE,EACrC,qBAAqB,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,EACxC,MAAM,uBAAuB,KAC5B,kBAAkB,EAoCpB,CAAC"}