@aws-amplify/cli-internal-gen2-migration-experimental-alpha 0.1.0 → 0.3.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.3.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 +899 -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 +744 -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 +3 -2
  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
@@ -0,0 +1,437 @@
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
+ const node_assert_1 = __importDefault(require("node:assert"));
7
+ const index_1 = require("./index");
8
+ const ts_node_printer_1 = require("../../test_utils/ts_node_printer");
9
+ describe('render auth node', () => {
10
+ describe('external providers', () => {
11
+ describe('Google', () => {
12
+ it('renders the google provider', () => {
13
+ const rendered = (0, index_1.renderAuthNode)({
14
+ loginOptions: { googleLogin: true, callbackURLs: ['https://example.com/callback'], logoutURLs: ['https://example.com/logout'] },
15
+ });
16
+ const source = (0, ts_node_printer_1.printNodeArray)(rendered);
17
+ node_assert_1.default.match(source, /google:/);
18
+ node_assert_1.default.match(source, /clientId: secret\("GOOGLE_CLIENT_ID"\)/);
19
+ node_assert_1.default.match(source, /clientSecret: secret\("GOOGLE_CLIENT_SECRET"\)/);
20
+ node_assert_1.default.match(source, /callbackUrls: \[\"https:\/\/example\.com\/callback\"\]/);
21
+ node_assert_1.default.match(source, /logoutUrls: \[\"https:\/\/example\.com\/logout\"\]/);
22
+ });
23
+ });
24
+ describe('Facebook', () => {
25
+ it('renders the facebook provider', () => {
26
+ const rendered = (0, index_1.renderAuthNode)({
27
+ loginOptions: { facebookLogin: true, callbackURLs: ['https://example.com/callback'], logoutURLs: ['https://example.com/logout'] },
28
+ });
29
+ const source = (0, ts_node_printer_1.printNodeArray)(rendered);
30
+ node_assert_1.default.match(source, /facebook:/);
31
+ node_assert_1.default.match(source, /clientId: secret\("FACEBOOK_CLIENT_ID"\)/);
32
+ node_assert_1.default.match(source, /clientSecret: secret\("FACEBOOK_CLIENT_SECRET"\)/);
33
+ node_assert_1.default.match(source, /callbackUrls: \[\"https:\/\/example\.com\/callback\"\]/);
34
+ node_assert_1.default.match(source, /logoutUrls: \[\"https:\/\/example\.com\/logout\"\]/);
35
+ });
36
+ });
37
+ describe('Apple', () => {
38
+ it('renders the apple provider', () => {
39
+ const rendered = (0, index_1.renderAuthNode)({
40
+ loginOptions: { appleLogin: true, callbackURLs: ['https://example.com/callback'], logoutURLs: ['https://example.com/logout'] },
41
+ });
42
+ const source = (0, ts_node_printer_1.printNodeArray)(rendered);
43
+ node_assert_1.default.match(source, /signInWithApple:/);
44
+ node_assert_1.default.match(source, /clientId: secret\("SIWA_CLIENT_ID"\)/);
45
+ node_assert_1.default.match(source, /keyId: secret\("SIWA_KEY_ID"\)/);
46
+ node_assert_1.default.match(source, /privateKey: secret\("SIWA_PRIVATE_KEY"\)/);
47
+ node_assert_1.default.match(source, /teamId: secret\("SIWA_TEAM_ID"\)/);
48
+ node_assert_1.default.match(source, /callbackUrls: \[\"https:\/\/example\.com\/callback\"\]/);
49
+ node_assert_1.default.match(source, /logoutUrls: \[\"https:\/\/example\.com\/logout\"\]/);
50
+ });
51
+ });
52
+ describe('Amazon', () => {
53
+ it('renders the amazon provider', () => {
54
+ const rendered = (0, index_1.renderAuthNode)({
55
+ loginOptions: { amazonLogin: true, callbackURLs: ['https://example.com/callback'], logoutURLs: ['https://example.com/logout'] },
56
+ });
57
+ const source = (0, ts_node_printer_1.printNodeArray)(rendered);
58
+ node_assert_1.default.match(source, /loginWithAmazon:/);
59
+ node_assert_1.default.match(source, /clientId: secret\("LOGINWITHAMAZON_CLIENT_ID"\)/);
60
+ node_assert_1.default.match(source, /clientSecret: secret\("LOGINWITHAMAZON_CLIENT_SECRET"\)/);
61
+ node_assert_1.default.match(source, /callbackUrls: \[\"https:\/\/example\.com\/callback\"\]/);
62
+ node_assert_1.default.match(source, /logoutUrls: \[\"https:\/\/example\.com\/logout\"\]/);
63
+ });
64
+ });
65
+ describe('OIDC', () => {
66
+ it('renders the oidc provider', () => {
67
+ const rendered = (0, index_1.renderAuthNode)({
68
+ loginOptions: {
69
+ oidcLogin: [{ issuerUrl: 'https://e' }, { name: 'Sanay', issuerUrl: 'hey' }],
70
+ callbackURLs: ['https://example.com/callback'],
71
+ logoutURLs: ['https://example.com/logout'],
72
+ },
73
+ });
74
+ const source = (0, ts_node_printer_1.printNodeArray)(rendered);
75
+ node_assert_1.default.match(source, /oidc:/);
76
+ node_assert_1.default.match(source, /clientId: secret\("OIDC_CLIENT_ID_1"\)/);
77
+ node_assert_1.default.match(source, /clientSecret: secret\("OIDC_CLIENT_SECRET_1"\)/);
78
+ node_assert_1.default.match(source, /issuerUrl: \"https:\/\/e\"/);
79
+ node_assert_1.default.match(source, /issuerUrl: \"hey\"/);
80
+ node_assert_1.default.match(source, /name: "Sanay"/);
81
+ });
82
+ it('does not render OIDC if not passed', () => {
83
+ const rendered = (0, index_1.renderAuthNode)({
84
+ loginOptions: {
85
+ oidcLogin: [],
86
+ },
87
+ });
88
+ const source = (0, ts_node_printer_1.printNodeArray)(rendered);
89
+ (0, node_assert_1.default)(!source.includes('oidc:'));
90
+ });
91
+ });
92
+ describe('SAML', () => {
93
+ it('renders the saml provider', () => {
94
+ const rendered = (0, index_1.renderAuthNode)({
95
+ loginOptions: {
96
+ samlLogin: { name: 'Sanay', metadata: { metadataContent: 'content', metadataType: 'URL' } },
97
+ callbackURLs: ['https://example.com/callback'],
98
+ logoutURLs: ['https://example.com/logout'],
99
+ },
100
+ });
101
+ const source = (0, ts_node_printer_1.printNodeArray)(rendered);
102
+ node_assert_1.default.match(source, /saml:/);
103
+ node_assert_1.default.match(source, /metadataContent: \"content\"/);
104
+ node_assert_1.default.match(source, /metadataType: \"URL\"/);
105
+ node_assert_1.default.match(source, /name: "Sanay"/);
106
+ });
107
+ it('does not render SAML if not passed', () => {
108
+ const rendered = (0, index_1.renderAuthNode)({
109
+ loginOptions: {},
110
+ });
111
+ const source = (0, ts_node_printer_1.printNodeArray)(rendered);
112
+ (0, node_assert_1.default)(!source.includes('saml:'));
113
+ });
114
+ });
115
+ });
116
+ describe('lambda', () => {
117
+ it('adds a triggers object when a lambda trigger is defined', () => {
118
+ const rendered = (0, index_1.renderAuthNode)({ lambdaTriggers: { preSignUp: { source: 'amplify/backend/function/testfunction/handler.ts' } } });
119
+ const source = (0, ts_node_printer_1.printNodeArray)(rendered);
120
+ node_assert_1.default.match(source, /triggers: \{/);
121
+ });
122
+ const testCases = {
123
+ createAuthChallenge: true,
124
+ customMessage: true,
125
+ defineAuthChallenge: true,
126
+ postAuthentication: true,
127
+ postConfirmation: true,
128
+ preAuthentication: true,
129
+ preSignUp: true,
130
+ preTokenGeneration: true,
131
+ userMigration: true,
132
+ verifyAuthChallengeResponse: true,
133
+ };
134
+ for (const testCase of Object.keys(testCases)) {
135
+ const rendered = (0, index_1.renderAuthNode)({ lambdaTriggers: { [testCase]: { source: `amplify/backend/function/${testCase}/handler.ts` } } });
136
+ const source = (0, ts_node_printer_1.printNodeArray)(rendered);
137
+ node_assert_1.default.match(source, new RegExp(`triggers:\\s*{\\s*${testCase}:\\s*${testCase}\\s*}`));
138
+ }
139
+ });
140
+ describe('mfa', () => {
141
+ it('does not render the multifactor property if no multifactor options are specified', () => {
142
+ const rendered = (0, index_1.renderAuthNode)({});
143
+ const source = (0, ts_node_printer_1.printNodeArray)(rendered);
144
+ node_assert_1.default.doesNotMatch(source, new RegExp(`multifactor:`));
145
+ });
146
+ describe('totp', () => {
147
+ it('does not render totp if totp is not specified', () => {
148
+ const rendered = (0, index_1.renderAuthNode)({ mfa: { mode: 'OPTIONAL' } });
149
+ const source = (0, ts_node_printer_1.printNodeArray)(rendered);
150
+ node_assert_1.default.doesNotMatch(source, new RegExp(`multifactor:\\s+\\{[\\s\\S]*totp:\\strue`));
151
+ });
152
+ const totpStates = [true, false];
153
+ for (const state of totpStates) {
154
+ it(`correctly renders totp state of ${state}`, async () => {
155
+ const rendered = (0, index_1.renderAuthNode)({ mfa: { mode: 'OPTIONAL', totp: state } });
156
+ const source = (0, ts_node_printer_1.printNodeArray)(rendered);
157
+ node_assert_1.default.match(source, new RegExp(`multifactor:\\s+\\{[\\s\\S]*totp:\\s${state}`));
158
+ });
159
+ }
160
+ });
161
+ describe('sms', () => {
162
+ it('does not render sms if sms is not specified', () => {
163
+ const rendered = (0, index_1.renderAuthNode)({ mfa: { mode: 'OPTIONAL' } });
164
+ const source = (0, ts_node_printer_1.printNodeArray)(rendered);
165
+ node_assert_1.default.doesNotMatch(source, new RegExp(`multifactor:\\s+\\{[\\s\\S]*sms:\\strue`));
166
+ });
167
+ const smsStates = [true, false];
168
+ for (const state of smsStates) {
169
+ it(`correctly renders sms state of ${state}`, async () => {
170
+ const rendered = (0, index_1.renderAuthNode)({ mfa: { mode: 'OPTIONAL', sms: state } });
171
+ const source = (0, ts_node_printer_1.printNodeArray)(rendered);
172
+ node_assert_1.default.match(source, new RegExp(`multifactor:\\s+\\{[\\s\\S]*sms:\\s${state}`));
173
+ });
174
+ }
175
+ });
176
+ const modes = ['REQUIRED', 'OFF', 'OPTIONAL'];
177
+ for (const mode of modes) {
178
+ it(`correctly renders mfa state of ${mode}`, async () => {
179
+ const rendered = (0, index_1.renderAuthNode)({ mfa: { mode } });
180
+ const source = (0, ts_node_printer_1.printNodeArray)(rendered);
181
+ node_assert_1.default.match(source, new RegExp(`multifactor:\\s+\\{\\s+mode:\\s"${mode}"`));
182
+ });
183
+ }
184
+ });
185
+ describe('imports', () => {
186
+ it('imports @aws-amplify/backend', async () => {
187
+ const rendered = (0, index_1.renderAuthNode)({
188
+ loginOptions: { email: true },
189
+ });
190
+ const source = (0, ts_node_printer_1.printNodeArray)(rendered);
191
+ node_assert_1.default.match(source, /import\s?\{\s?defineAuth\s?\}\s?from\s?"\@aws-amplify\/backend"/);
192
+ });
193
+ });
194
+ describe('username attributes', () => {
195
+ describe('Standard Attributes', () => {
196
+ const attributes = [
197
+ 'email',
198
+ 'gender',
199
+ 'locale',
200
+ 'address',
201
+ 'website',
202
+ 'fullname',
203
+ 'nickname',
204
+ 'timezone',
205
+ 'birthdate',
206
+ 'givenName',
207
+ 'familyName',
208
+ 'middleName',
209
+ 'phoneNumber',
210
+ 'profilePage',
211
+ 'profilePicture',
212
+ 'lastUpdateTime',
213
+ 'preferredUsername',
214
+ ];
215
+ for (const attribute of attributes) {
216
+ for (const truthiness of [true, false]) {
217
+ it(`renders ${attribute}: ${truthiness} individually`, () => {
218
+ const authDefinition = {
219
+ loginOptions: {
220
+ email: true,
221
+ },
222
+ standardUserAttributes: {
223
+ [attribute]: {
224
+ mutable: truthiness,
225
+ required: truthiness,
226
+ },
227
+ },
228
+ };
229
+ const node = (0, index_1.renderAuthNode)(authDefinition);
230
+ const source = (0, ts_node_printer_1.printNodeArray)(node);
231
+ (0, node_assert_1.default)(source.includes(attribute));
232
+ (0, node_assert_1.default)(source.includes(`mutable: ${truthiness}`));
233
+ (0, node_assert_1.default)(source.includes(`required: ${truthiness}`));
234
+ });
235
+ }
236
+ }
237
+ });
238
+ describe('Custom Attributes', () => {
239
+ it('renders custom attributes', () => {
240
+ const authDefinition = {
241
+ loginOptions: {
242
+ email: true,
243
+ },
244
+ customUserAttributes: { 'custom:Test1': { dataType: 'Number', mutable: true, min: 10, max: 100 } },
245
+ };
246
+ const node = (0, index_1.renderAuthNode)(authDefinition);
247
+ const source = (0, ts_node_printer_1.printNodeArray)(node);
248
+ (0, node_assert_1.default)(source.includes('custom:Test1'));
249
+ (0, node_assert_1.default)(source.includes('dataType: "Number"'));
250
+ });
251
+ it('does not render anything if CustomAttribute is undefined', () => {
252
+ const authDefinition = {
253
+ loginOptions: {
254
+ email: true,
255
+ },
256
+ customUserAttributes: { 'custom:isAllowed': undefined },
257
+ };
258
+ const node = (0, index_1.renderAuthNode)(authDefinition);
259
+ const source = (0, ts_node_printer_1.printNodeArray)(node);
260
+ (0, node_assert_1.default)(!source.includes('custom:isAllowed'));
261
+ });
262
+ });
263
+ });
264
+ describe('groups', () => {
265
+ it('renders groups', () => {
266
+ const authDefinition = {
267
+ loginOptions: {},
268
+ groups: ['manager'],
269
+ };
270
+ const node = (0, index_1.renderAuthNode)(authDefinition);
271
+ const source = (0, ts_node_printer_1.printNodeArray)(node);
272
+ node_assert_1.default.match(source, /defineAuth\(\{[\s\S]*groups:\s\["manager"\]/);
273
+ });
274
+ });
275
+ describe('loginWith', () => {
276
+ describe('email', () => {
277
+ const emailPropertyTestCases = [
278
+ {
279
+ optionProperty: 'emailVerificationSubject',
280
+ value: 'My Verification Subject',
281
+ gen2DefinitionProperty: 'verificationEmailSubject',
282
+ searchPattern: '"My Verification Subject"',
283
+ },
284
+ {
285
+ optionProperty: 'emailVerificationBody',
286
+ gen2DefinitionProperty: 'verificationEmailBody',
287
+ value: 'My Verification Body',
288
+ searchPattern: '\\(\\) => "My Verification Body"',
289
+ },
290
+ ];
291
+ for (const { optionProperty: property, value, searchPattern, gen2DefinitionProperty } of emailPropertyTestCases) {
292
+ it(`renders email login parameter ${property}`, () => {
293
+ const emailOptions = {
294
+ [property]: value,
295
+ };
296
+ const authDefinition = {
297
+ loginOptions: {
298
+ emailOptions,
299
+ },
300
+ };
301
+ const node = (0, index_1.renderAuthNode)(authDefinition);
302
+ const source = (0, ts_node_printer_1.printNodeArray)(node);
303
+ node_assert_1.default.match(source, new RegExp(`defineAuth\\(\\{\\s+loginWith:\\s+\\{\\s+email:\\s+\\{\\s+${gen2DefinitionProperty}: ${searchPattern}\\s+\\}\\s+\\}\\s+\\}\\)`));
304
+ });
305
+ }
306
+ it('renders `email: true`', () => {
307
+ const authDefinition = {
308
+ loginOptions: {
309
+ email: true,
310
+ },
311
+ };
312
+ const node = (0, index_1.renderAuthNode)(authDefinition);
313
+ const source = (0, ts_node_printer_1.printNodeArray)(node);
314
+ node_assert_1.default.match(source, /defineAuth\(\{\s+loginWith:\s+\{\s+email:\s?true\s+\}\s+\}\)/);
315
+ });
316
+ });
317
+ describe('phone', () => {
318
+ it('renders `phone: true`', () => {
319
+ const authDefinition = {
320
+ loginOptions: {
321
+ phone: true,
322
+ },
323
+ };
324
+ const node = (0, index_1.renderAuthNode)(authDefinition);
325
+ const source = (0, ts_node_printer_1.printNodeArray)(node);
326
+ node_assert_1.default.match(source, /defineAuth\(\{\s+loginWith:\s+\{\s+phone:\s?true\s+\}\s+\}\)/);
327
+ });
328
+ });
329
+ describe('OAuth scopes', () => {
330
+ it('renders oauth scopes', () => {
331
+ const authDefinition = {
332
+ loginOptions: {
333
+ googleLogin: true,
334
+ googleScopes: ['email', 'openid'],
335
+ },
336
+ };
337
+ const node = (0, index_1.renderAuthNode)(authDefinition);
338
+ const source = (0, ts_node_printer_1.printNodeArray)(node);
339
+ node_assert_1.default.match(source, /google:\s*\{[\s\S]*scopes:\s*\["email",\s*"openid"\]/);
340
+ });
341
+ it('renders no oauth scopes if not passed', () => {
342
+ const authDefinition = {
343
+ loginOptions: {},
344
+ };
345
+ const node = (0, index_1.renderAuthNode)(authDefinition);
346
+ const source = (0, ts_node_printer_1.printNodeArray)(node);
347
+ node_assert_1.default.doesNotMatch(source, /scopes:/);
348
+ });
349
+ });
350
+ it('renders attributeMapping if passed along with Google login', () => {
351
+ const authDefinition = {
352
+ loginOptions: {
353
+ googleLogin: true,
354
+ googleAttributes: { fullname: 'name' },
355
+ },
356
+ };
357
+ const node = (0, index_1.renderAuthNode)(authDefinition);
358
+ const source = (0, ts_node_printer_1.printNodeArray)(node);
359
+ node_assert_1.default.match(source, /defineAuth\(\{[\s\S]*attributeMapping:\s\{[\s\S]*fullname:\s"name"/);
360
+ });
361
+ });
362
+ describe('reference auth', () => {
363
+ it(`renders successfully for imported userpool`, () => {
364
+ const referenceAuthProps = {
365
+ userPoolId: 'userPoolId',
366
+ userPoolClientId: 'userPoolClientId',
367
+ groups: {
368
+ Admin: 'AdminRoleARN',
369
+ ReadOnly: 'ReadOnlyRoleARN',
370
+ },
371
+ };
372
+ const authDefinition = {
373
+ referenceAuth: referenceAuthProps,
374
+ };
375
+ const node = (0, index_1.renderAuthNode)(authDefinition);
376
+ const source = (0, ts_node_printer_1.printNodeArray)(node);
377
+ node_assert_1.default.match(source, /referenceAuth/);
378
+ node_assert_1.default.match(source, /userPoolId: "userPoolId"/);
379
+ node_assert_1.default.match(source, /userPoolClientId: "userPoolClientId"/);
380
+ node_assert_1.default.match(source, /groups:/);
381
+ node_assert_1.default.match(source, /"Admin": "AdminRoleARN"/);
382
+ node_assert_1.default.match(source, /"ReadOnly": "ReadOnlyRoleARN"/);
383
+ node_assert_1.default.doesNotMatch(source, /identityPoolId: "identityPoolId"/);
384
+ node_assert_1.default.doesNotMatch(source, /authRoleArn: "authRoleArn"/);
385
+ node_assert_1.default.doesNotMatch(source, /unauthRoleArn: "unauthRoleArn"/);
386
+ });
387
+ it(`renders successfully for imported identity pool`, () => {
388
+ const referenceAuthProps = {
389
+ identityPoolId: 'identityPoolId',
390
+ authRoleArn: 'authRoleArn',
391
+ unauthRoleArn: 'unauthRoleArn',
392
+ };
393
+ const authDefinition = {
394
+ referenceAuth: referenceAuthProps,
395
+ };
396
+ const node = (0, index_1.renderAuthNode)(authDefinition);
397
+ const source = (0, ts_node_printer_1.printNodeArray)(node);
398
+ node_assert_1.default.match(source, /referenceAuth/);
399
+ node_assert_1.default.match(source, /identityPoolId: "identityPoolId"/);
400
+ node_assert_1.default.match(source, /authRoleArn: "authRoleArn"/);
401
+ node_assert_1.default.match(source, /unauthRoleArn: "unauthRoleArn"/);
402
+ node_assert_1.default.doesNotMatch(source, /userPoolId: "userPoolId"/);
403
+ node_assert_1.default.doesNotMatch(source, /userPoolClientId: "userPoolClientId"/);
404
+ node_assert_1.default.doesNotMatch(source, /groups:/);
405
+ node_assert_1.default.doesNotMatch(source, /"Admin": "AdminRoleARN"/);
406
+ node_assert_1.default.doesNotMatch(source, /"ReadOnly": "ReadOnlyRoleARN"/);
407
+ });
408
+ it(`renders successfully for imported userpool and identity pool`, () => {
409
+ const referenceAuthProps = {
410
+ userPoolId: 'userPoolId',
411
+ userPoolClientId: 'userPoolClientId',
412
+ identityPoolId: 'identityPoolId',
413
+ authRoleArn: 'authRoleArn',
414
+ unauthRoleArn: 'unauthRoleArn',
415
+ groups: {
416
+ Admin: 'AdminRoleARN',
417
+ 'Read-Only': 'ReadOnlyRoleARN',
418
+ },
419
+ };
420
+ const authDefinition = {
421
+ referenceAuth: referenceAuthProps,
422
+ };
423
+ const node = (0, index_1.renderAuthNode)(authDefinition);
424
+ const source = (0, ts_node_printer_1.printNodeArray)(node);
425
+ node_assert_1.default.match(source, /referenceAuth/);
426
+ node_assert_1.default.match(source, /userPoolId: "userPoolId"/);
427
+ node_assert_1.default.match(source, /userPoolClientId: "userPoolClientId"/);
428
+ node_assert_1.default.match(source, /identityPoolId: "identityPoolId"/);
429
+ node_assert_1.default.match(source, /authRoleArn: "authRoleArn"/);
430
+ node_assert_1.default.match(source, /unauthRoleArn: "unauthRoleArn"/);
431
+ node_assert_1.default.match(source, /groups:/);
432
+ node_assert_1.default.match(source, /"Admin": "AdminRoleARN"/);
433
+ node_assert_1.default.match(source, /"Read-Only": "ReadOnlyRoleARN"/);
434
+ });
435
+ });
436
+ });
437
+ //# sourceMappingURL=index.test.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.test.js","sourceRoot":"","sources":["../../../../../../src/commands/gen2-migration/generate/generators/auth/index.test.ts"],"names":[],"mappings":";;;;;AACA,8DAAiC;AACjC,mCASiB;AACjB,sEAAkE;AAElE,QAAQ,CAAC,kBAAkB,EAAE,GAAG,EAAE;IAChC,QAAQ,CAAC,oBAAoB,EAAE,GAAG,EAAE;QAClC,QAAQ,CAAC,QAAQ,EAAE,GAAG,EAAE;YACtB,EAAE,CAAC,6BAA6B,EAAE,GAAG,EAAE;gBACrC,MAAM,QAAQ,GAAG,IAAA,sBAAc,EAAC;oBAC9B,YAAY,EAAE,EAAE,WAAW,EAAE,IAAI,EAAE,YAAY,EAAE,CAAC,8BAA8B,CAAC,EAAE,UAAU,EAAE,CAAC,4BAA4B,CAAC,EAAE;iBAChI,CAAC,CAAC;gBACH,MAAM,MAAM,GAAG,IAAA,gCAAc,EAAC,QAAQ,CAAC,CAAC;gBACxC,qBAAM,CAAC,KAAK,CAAC,MAAM,EAAE,SAAS,CAAC,CAAC;gBAChC,qBAAM,CAAC,KAAK,CAAC,MAAM,EAAE,wCAAwC,CAAC,CAAC;gBAC/D,qBAAM,CAAC,KAAK,CAAC,MAAM,EAAE,gDAAgD,CAAC,CAAC;gBACvE,qBAAM,CAAC,KAAK,CAAC,MAAM,EAAE,wDAAwD,CAAC,CAAC;gBAC/E,qBAAM,CAAC,KAAK,CAAC,MAAM,EAAE,oDAAoD,CAAC,CAAC;YAC7E,CAAC,CAAC,CAAC;QACL,CAAC,CAAC,CAAC;QACH,QAAQ,CAAC,UAAU,EAAE,GAAG,EAA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AC,KAAK,CAAC,MAAM,EAAE,SAAS,CAAC,CAAC;YAChC,qBAAM,CAAC,KAAK,CAAC,MAAM,EAAE,yBAAyB,CAAC,CAAC;YAChD,qBAAM,CAAC,KAAK,CAAC,MAAM,EAAE,gCAAgC,CAAC,CAAC;QACzD,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
@@ -0,0 +1,35 @@
1
+ import ts from 'typescript';
2
+ import type { ConstructFactory, AmplifyFunction } from '@aws-amplify/plugin-types';
3
+ import type { AuthorizationModes, DataLoggingOptions } from '@aws-amplify/backend-data';
4
+ import { RestApiDefinition } from '../../codegen-head/data_definition_fetcher';
5
+ export interface AdditionalAuthProvider {
6
+ authenticationType: 'API_KEY' | 'AWS_IAM' | 'OPENID_CONNECT' | 'AMAZON_COGNITO_USER_POOLS' | 'AWS_LAMBDA';
7
+ lambdaAuthorizerConfig?: {
8
+ authorizerResultTtlInSeconds?: number;
9
+ authorizerUri: string;
10
+ identityValidationExpression?: string;
11
+ };
12
+ openIdConnectConfig?: {
13
+ authTtl?: number;
14
+ clientId?: string;
15
+ iatTtl?: number;
16
+ issuer: string;
17
+ };
18
+ userPoolConfig?: {
19
+ appIdClientRegex?: string;
20
+ awsRegion?: string;
21
+ userPoolId?: string;
22
+ };
23
+ }
24
+ export type DataTableMapping = Record<string, string>;
25
+ export type DataDefinition = {
26
+ tableMappings?: DataTableMapping | undefined;
27
+ schema?: string;
28
+ authorizationModes?: AuthorizationModes;
29
+ additionalAuthProviders?: AdditionalAuthProvider[];
30
+ functions?: Record<string, ConstructFactory<AmplifyFunction>>;
31
+ logging?: DataLoggingOptions;
32
+ restApis?: RestApiDefinition[];
33
+ };
34
+ export declare const generateDataSource: (gen1Env: string, dataDefinition?: DataDefinition) => Promise<ts.NodeArray<ts.Node> | undefined>;
35
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../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