@microsoft/teamsfx-core 1.1.2 → 1.1.3-alpha.e5227bb6.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 (631) hide show
  1. package/build/common/armInterface.d.ts +1 -1
  2. package/build/common/armInterface.d.ts.map +1 -1
  3. package/build/common/constants.d.ts +3 -2
  4. package/build/common/constants.d.ts.map +1 -1
  5. package/build/common/constants.js +3 -2
  6. package/build/common/constants.js.map +1 -1
  7. package/build/common/deps-checker/checkerFactory.d.ts +8 -0
  8. package/build/common/deps-checker/checkerFactory.d.ts.map +1 -0
  9. package/build/common/deps-checker/checkerFactory.js +32 -0
  10. package/build/common/deps-checker/checkerFactory.js.map +1 -0
  11. package/build/common/deps-checker/constant/helpLink.d.ts +11 -0
  12. package/build/common/deps-checker/constant/helpLink.d.ts.map +1 -0
  13. package/build/common/deps-checker/constant/helpLink.js +16 -0
  14. package/build/common/deps-checker/constant/helpLink.js.map +1 -0
  15. package/build/common/deps-checker/constant/index.d.ts +4 -0
  16. package/build/common/deps-checker/constant/index.d.ts.map +1 -0
  17. package/build/common/deps-checker/constant/index.js +9 -0
  18. package/build/common/deps-checker/constant/index.js.map +1 -0
  19. package/build/common/deps-checker/constant/message.d.ts +29 -0
  20. package/build/common/deps-checker/constant/message.d.ts.map +1 -0
  21. package/build/common/deps-checker/constant/message.js +57 -0
  22. package/build/common/deps-checker/constant/message.js.map +1 -0
  23. package/build/common/deps-checker/constant/telemetry.d.ts +43 -0
  24. package/build/common/deps-checker/constant/telemetry.d.ts.map +1 -0
  25. package/build/common/deps-checker/constant/telemetry.js +51 -0
  26. package/build/common/deps-checker/constant/telemetry.js.map +1 -0
  27. package/build/common/deps-checker/depsChecker.d.ts +24 -0
  28. package/build/common/deps-checker/depsChecker.d.ts.map +1 -0
  29. package/build/common/deps-checker/depsChecker.js +13 -0
  30. package/build/common/deps-checker/depsChecker.js.map +1 -0
  31. package/build/common/deps-checker/depsError.d.ts +17 -0
  32. package/build/common/deps-checker/depsError.d.ts.map +1 -0
  33. package/build/common/deps-checker/depsError.js +42 -0
  34. package/build/common/deps-checker/depsError.js.map +1 -0
  35. package/build/common/deps-checker/depsLogger.d.ts +11 -0
  36. package/build/common/deps-checker/depsLogger.d.ts.map +1 -0
  37. package/build/common/deps-checker/depsLogger.js +5 -0
  38. package/build/common/deps-checker/depsLogger.js.map +1 -0
  39. package/build/common/deps-checker/depsManager.d.ts +36 -0
  40. package/build/common/deps-checker/depsManager.d.ts.map +1 -0
  41. package/build/common/deps-checker/depsManager.js +83 -0
  42. package/build/common/deps-checker/depsManager.js.map +1 -0
  43. package/build/common/deps-checker/depsTelemetry.d.ts +10 -0
  44. package/build/common/deps-checker/depsTelemetry.d.ts.map +1 -0
  45. package/build/common/deps-checker/depsTelemetry.js +5 -0
  46. package/build/common/deps-checker/depsTelemetry.js.map +1 -0
  47. package/build/common/deps-checker/index.d.ts +8 -0
  48. package/build/common/deps-checker/index.d.ts.map +1 -0
  49. package/build/common/deps-checker/index.js +13 -0
  50. package/build/common/deps-checker/index.js.map +1 -0
  51. package/build/common/deps-checker/internal/dotnetChecker.d.ts +50 -0
  52. package/build/common/deps-checker/internal/dotnetChecker.d.ts.map +1 -0
  53. package/build/common/deps-checker/internal/dotnetChecker.js +406 -0
  54. package/build/common/deps-checker/internal/dotnetChecker.js.map +1 -0
  55. package/build/common/deps-checker/internal/funcToolChecker.d.ts +40 -0
  56. package/build/common/deps-checker/internal/funcToolChecker.d.ts.map +1 -0
  57. package/build/common/deps-checker/internal/funcToolChecker.js +279 -0
  58. package/build/common/deps-checker/internal/funcToolChecker.js.map +1 -0
  59. package/build/common/deps-checker/internal/ngrokChecker.d.ts +28 -0
  60. package/build/common/deps-checker/internal/ngrokChecker.d.ts.map +1 -0
  61. package/build/common/deps-checker/internal/ngrokChecker.js +183 -0
  62. package/build/common/deps-checker/internal/ngrokChecker.js.map +1 -0
  63. package/build/common/deps-checker/internal/nodeChecker.d.ts +40 -0
  64. package/build/common/deps-checker/internal/nodeChecker.d.ts.map +1 -0
  65. package/build/common/deps-checker/internal/nodeChecker.js +144 -0
  66. package/build/common/deps-checker/internal/nodeChecker.js.map +1 -0
  67. package/build/common/deps-checker/util/cpUtils.d.ts +24 -0
  68. package/build/common/deps-checker/util/cpUtils.d.ts.map +1 -0
  69. package/build/common/deps-checker/util/cpUtils.js +99 -0
  70. package/build/common/deps-checker/util/cpUtils.js.map +1 -0
  71. package/build/common/deps-checker/util/progressIndicator.d.ts +3 -0
  72. package/build/common/deps-checker/util/progressIndicator.d.ts.map +1 -0
  73. package/build/common/deps-checker/util/progressIndicator.js +18 -0
  74. package/build/common/deps-checker/util/progressIndicator.js.map +1 -0
  75. package/build/common/deps-checker/util/system.d.ts +5 -0
  76. package/build/common/deps-checker/util/system.d.ts.map +1 -0
  77. package/build/common/deps-checker/util/system.js +24 -0
  78. package/build/common/deps-checker/util/system.js.map +1 -0
  79. package/build/common/index.d.ts +4 -0
  80. package/build/common/index.d.ts.map +1 -1
  81. package/build/common/index.js +4 -0
  82. package/build/common/index.js.map +1 -1
  83. package/build/common/local/constants.d.ts +115 -0
  84. package/build/common/local/constants.d.ts.map +1 -0
  85. package/build/common/local/constants.js +122 -0
  86. package/build/common/local/constants.js.map +1 -0
  87. package/build/common/local/localEnvManager.d.ts +16 -0
  88. package/build/common/local/localEnvManager.d.ts.map +1 -0
  89. package/build/common/local/localEnvManager.js +72 -0
  90. package/build/common/local/localEnvManager.js.map +1 -0
  91. package/build/{plugins/resource/localdebug/localEnvMulti.d.ts → common/local/localEnvProvider.d.ts} +5 -4
  92. package/build/common/local/localEnvProvider.d.ts.map +1 -0
  93. package/build/{plugins/resource/localdebug/localEnvMulti.js → common/local/localEnvProvider.js} +19 -15
  94. package/build/common/local/localEnvProvider.js.map +1 -0
  95. package/build/common/local/localSettingsHelper.d.ts +3 -0
  96. package/build/common/local/localSettingsHelper.d.ts.map +1 -0
  97. package/build/common/local/localSettingsHelper.js +129 -0
  98. package/build/common/local/localSettingsHelper.js.map +1 -0
  99. package/build/common/local/npmLogHelper.d.ts +11 -0
  100. package/build/common/local/npmLogHelper.d.ts.map +1 -0
  101. package/build/common/local/npmLogHelper.js +82 -0
  102. package/build/common/local/npmLogHelper.js.map +1 -0
  103. package/build/common/local/packageJsonHelper.d.ts +4 -0
  104. package/build/common/local/packageJsonHelper.d.ts.map +1 -0
  105. package/build/common/local/packageJsonHelper.js +36 -0
  106. package/build/common/local/packageJsonHelper.js.map +1 -0
  107. package/build/common/local/portChecker.d.ts +3 -0
  108. package/build/common/local/portChecker.d.ts.map +1 -0
  109. package/build/common/local/portChecker.js +104 -0
  110. package/build/common/local/portChecker.js.map +1 -0
  111. package/build/common/local/projectSettingsHelper.d.ts +10 -0
  112. package/build/common/local/projectSettingsHelper.d.ts.map +1 -0
  113. package/build/common/local/projectSettingsHelper.js +34 -0
  114. package/build/common/local/projectSettingsHelper.js.map +1 -0
  115. package/build/common/local/taskDefinition.d.ts +37 -0
  116. package/build/common/local/taskDefinition.d.ts.map +1 -0
  117. package/build/common/local/taskDefinition.js +229 -0
  118. package/build/common/local/taskDefinition.js.map +1 -0
  119. package/build/common/localSettingsProvider.d.ts +3 -3
  120. package/build/common/localSettingsProvider.d.ts.map +1 -1
  121. package/build/common/localSettingsProvider.js +12 -10
  122. package/build/common/localSettingsProvider.js.map +1 -1
  123. package/build/common/samples-config.json +14 -0
  124. package/build/common/templatesActions.d.ts +2 -0
  125. package/build/common/templatesActions.d.ts.map +1 -1
  126. package/build/common/templatesActions.js +33 -1
  127. package/build/common/templatesActions.js.map +1 -1
  128. package/build/common/tools.d.ts +12 -6
  129. package/build/common/tools.d.ts.map +1 -1
  130. package/build/common/tools.js +35 -85
  131. package/build/common/tools.js.map +1 -1
  132. package/build/core/SolutionPluginContainer.d.ts +2 -1
  133. package/build/core/SolutionPluginContainer.d.ts.map +1 -1
  134. package/build/core/SolutionPluginContainer.js +9 -1
  135. package/build/core/SolutionPluginContainer.js.map +1 -1
  136. package/build/core/dependencyChecker.d.ts +1 -0
  137. package/build/core/dependencyChecker.d.ts.map +1 -0
  138. package/build/core/dependencyChecker.js +2 -0
  139. package/build/core/dependencyChecker.js.map +1 -0
  140. package/build/core/downloadSample.d.ts +9 -0
  141. package/build/core/downloadSample.d.ts.map +1 -0
  142. package/build/core/downloadSample.js +150 -0
  143. package/build/core/downloadSample.js.map +1 -0
  144. package/build/core/environment.d.ts +5 -5
  145. package/build/core/environment.d.ts.map +1 -1
  146. package/build/core/environment.js +40 -25
  147. package/build/core/environment.js.map +1 -1
  148. package/build/core/error.d.ts +2 -1
  149. package/build/core/error.d.ts.map +1 -1
  150. package/build/core/error.js +7 -3
  151. package/build/core/error.js.map +1 -1
  152. package/build/core/index.d.ts +53 -15
  153. package/build/core/index.d.ts.map +1 -1
  154. package/build/core/index.js +689 -575
  155. package/build/core/index.js.map +1 -1
  156. package/build/core/middleware/concurrentLocker.d.ts.map +1 -1
  157. package/build/core/middleware/concurrentLocker.js +23 -12
  158. package/build/core/middleware/concurrentLocker.js.map +1 -1
  159. package/build/core/middleware/envInfoLoader.d.ts +5 -1
  160. package/build/core/middleware/envInfoLoader.d.ts.map +1 -1
  161. package/build/core/middleware/envInfoLoader.js +52 -46
  162. package/build/core/middleware/envInfoLoader.js.map +1 -1
  163. package/build/core/middleware/envInfoLoaderV3.d.ts +3 -0
  164. package/build/core/middleware/envInfoLoaderV3.d.ts.map +1 -0
  165. package/build/core/middleware/envInfoLoaderV3.js +64 -0
  166. package/build/core/middleware/envInfoLoaderV3.js.map +1 -0
  167. package/build/core/middleware/envInfoWriter.js +14 -31
  168. package/build/core/middleware/envInfoWriter.js.map +1 -1
  169. package/build/core/middleware/envInfoWriterV3.d.ts +6 -0
  170. package/build/core/middleware/envInfoWriterV3.d.ts.map +1 -0
  171. package/build/core/middleware/envInfoWriterV3.js +63 -0
  172. package/build/core/middleware/envInfoWriterV3.js.map +1 -0
  173. package/build/core/middleware/errorHandler.d.ts.map +1 -1
  174. package/build/core/middleware/errorHandler.js +3 -5
  175. package/build/core/middleware/errorHandler.js.map +1 -1
  176. package/build/core/middleware/localSettingsLoader.d.ts.map +1 -1
  177. package/build/core/middleware/localSettingsLoader.js +1 -2
  178. package/build/core/middleware/localSettingsLoader.js.map +1 -1
  179. package/build/core/middleware/localSettingsWriter.d.ts.map +1 -1
  180. package/build/core/middleware/localSettingsWriter.js +7 -18
  181. package/build/core/middleware/localSettingsWriter.js.map +1 -1
  182. package/build/core/middleware/projectMigrator.d.ts.map +1 -1
  183. package/build/core/middleware/projectMigrator.js +25 -57
  184. package/build/core/middleware/projectMigrator.js.map +1 -1
  185. package/build/core/middleware/projectSettingsLoader.d.ts.map +1 -1
  186. package/build/core/middleware/projectSettingsLoader.js +3 -6
  187. package/build/core/middleware/projectSettingsLoader.js.map +1 -1
  188. package/build/core/middleware/projectSettingsLoaderV3.d.ts +4 -0
  189. package/build/core/middleware/projectSettingsLoaderV3.d.ts.map +1 -0
  190. package/build/core/middleware/projectSettingsLoaderV3.js +49 -0
  191. package/build/core/middleware/projectSettingsLoaderV3.js.map +1 -0
  192. package/build/core/middleware/projectSettingsWriter.d.ts.map +1 -1
  193. package/build/core/middleware/projectSettingsWriter.js +5 -12
  194. package/build/core/middleware/projectSettingsWriter.js.map +1 -1
  195. package/build/core/middleware/projectUpgrader.d.ts.map +1 -1
  196. package/build/core/middleware/projectUpgrader.js +7 -15
  197. package/build/core/middleware/projectUpgrader.js.map +1 -1
  198. package/build/core/middleware/questionModel.d.ts +14 -1
  199. package/build/core/middleware/questionModel.d.ts.map +1 -1
  200. package/build/core/middleware/questionModel.js +319 -23
  201. package/build/core/middleware/questionModel.js.map +1 -1
  202. package/build/core/middleware/solutionLoader.d.ts +3 -2
  203. package/build/core/middleware/solutionLoader.d.ts.map +1 -1
  204. package/build/core/middleware/solutionLoader.js +21 -23
  205. package/build/core/middleware/solutionLoader.js.map +1 -1
  206. package/build/core/middleware/solutionLoaderV3.d.ts +4 -0
  207. package/build/core/middleware/solutionLoaderV3.d.ts.map +1 -0
  208. package/build/core/middleware/solutionLoaderV3.js +19 -0
  209. package/build/core/middleware/solutionLoaderV3.js.map +1 -0
  210. package/build/core/question.d.ts +9 -1
  211. package/build/core/question.d.ts.map +1 -1
  212. package/build/core/question.js +113 -3
  213. package/build/core/question.js.map +1 -1
  214. package/build/core/tools.d.ts +2 -1
  215. package/build/core/tools.d.ts.map +1 -1
  216. package/build/core/tools.js +19 -10
  217. package/build/core/tools.js.map +1 -1
  218. package/build/plugins/resource/aad/plugin.d.ts.map +1 -1
  219. package/build/plugins/resource/aad/plugin.js +3 -12
  220. package/build/plugins/resource/aad/plugin.js.map +1 -1
  221. package/build/plugins/resource/apim/index.js +2 -2
  222. package/build/plugins/resource/apim/index.js.map +1 -1
  223. package/build/plugins/resource/apim/managers/apimManager.d.ts +2 -2
  224. package/build/plugins/resource/apim/managers/apimManager.d.ts.map +1 -1
  225. package/build/plugins/resource/apim/managers/apimManager.js +26 -20
  226. package/build/plugins/resource/apim/managers/apimManager.js.map +1 -1
  227. package/build/plugins/resource/appstudio/appStudio.d.ts +1 -1
  228. package/build/plugins/resource/appstudio/appStudio.d.ts.map +1 -1
  229. package/build/plugins/resource/appstudio/appStudio.js +106 -85
  230. package/build/plugins/resource/appstudio/appStudio.js.map +1 -1
  231. package/build/plugins/resource/appstudio/constants.d.ts +7 -1
  232. package/build/plugins/resource/appstudio/constants.d.ts.map +1 -1
  233. package/build/plugins/resource/appstudio/constants.js +8 -2
  234. package/build/plugins/resource/appstudio/constants.js.map +1 -1
  235. package/build/plugins/resource/appstudio/errors.d.ts +9 -5
  236. package/build/plugins/resource/appstudio/errors.d.ts.map +1 -1
  237. package/build/plugins/resource/appstudio/errors.js +10 -5
  238. package/build/plugins/resource/appstudio/errors.js.map +1 -1
  239. package/build/plugins/resource/appstudio/index.d.ts +36 -1
  240. package/build/plugins/resource/appstudio/index.d.ts.map +1 -1
  241. package/build/plugins/resource/appstudio/index.js +57 -21
  242. package/build/plugins/resource/appstudio/index.js.map +1 -1
  243. package/build/plugins/resource/appstudio/manifestTemplate.d.ts +32 -0
  244. package/build/plugins/resource/appstudio/manifestTemplate.d.ts.map +1 -0
  245. package/build/plugins/resource/appstudio/manifestTemplate.js +185 -0
  246. package/build/plugins/resource/appstudio/manifestTemplate.js.map +1 -0
  247. package/build/plugins/resource/appstudio/plugin.d.ts +2 -4
  248. package/build/plugins/resource/appstudio/plugin.d.ts.map +1 -1
  249. package/build/plugins/resource/appstudio/plugin.js +256 -465
  250. package/build/plugins/resource/appstudio/plugin.js.map +1 -1
  251. package/build/plugins/resource/appstudio/utils/telemetry.d.ts.map +1 -1
  252. package/build/plugins/resource/appstudio/utils/telemetry.js +12 -16
  253. package/build/plugins/resource/appstudio/utils/telemetry.js.map +1 -1
  254. package/build/plugins/resource/appstudio/v3/index.d.ts +73 -0
  255. package/build/plugins/resource/appstudio/v3/index.d.ts.map +1 -0
  256. package/build/plugins/resource/appstudio/v3/index.js +87 -0
  257. package/build/plugins/resource/appstudio/v3/index.js.map +1 -0
  258. package/build/plugins/resource/bot/index.d.ts.map +1 -1
  259. package/build/plugins/resource/bot/index.js +5 -1
  260. package/build/plugins/resource/bot/index.js.map +1 -1
  261. package/build/plugins/resource/bot/plugin.d.ts +2 -2
  262. package/build/plugins/resource/bot/plugin.d.ts.map +1 -1
  263. package/build/plugins/resource/bot/plugin.js +30 -24
  264. package/build/plugins/resource/bot/plugin.js.map +1 -1
  265. package/build/plugins/resource/frontend/constants.d.ts +1 -7
  266. package/build/plugins/resource/frontend/constants.d.ts.map +1 -1
  267. package/build/plugins/resource/frontend/constants.js +2 -9
  268. package/build/plugins/resource/frontend/constants.js.map +1 -1
  269. package/build/plugins/resource/frontend/env.d.ts +21 -0
  270. package/build/plugins/resource/frontend/env.d.ts.map +1 -0
  271. package/build/plugins/resource/frontend/env.js +82 -0
  272. package/build/plugins/resource/frontend/env.js.map +1 -0
  273. package/build/plugins/resource/frontend/ops/deploy.d.ts +2 -1
  274. package/build/plugins/resource/frontend/ops/deploy.d.ts.map +1 -1
  275. package/build/plugins/resource/frontend/ops/deploy.js +2 -2
  276. package/build/plugins/resource/frontend/ops/deploy.js.map +1 -1
  277. package/build/plugins/resource/frontend/plugin.d.ts +2 -0
  278. package/build/plugins/resource/frontend/plugin.d.ts.map +1 -1
  279. package/build/plugins/resource/frontend/plugin.js +43 -26
  280. package/build/plugins/resource/frontend/plugin.js.map +1 -1
  281. package/build/plugins/resource/frontend/utils/environment-utils.d.ts.map +1 -1
  282. package/build/plugins/resource/frontend/utils/environment-utils.js +4 -2
  283. package/build/plugins/resource/frontend/utils/environment-utils.js.map +1 -1
  284. package/build/plugins/resource/frontend/utils.d.ts +6 -1
  285. package/build/plugins/resource/frontend/utils.d.ts.map +1 -1
  286. package/build/plugins/resource/frontend/utils.js +17 -6
  287. package/build/plugins/resource/frontend/utils.js.map +1 -1
  288. package/build/plugins/resource/function/plugin.d.ts.map +1 -1
  289. package/build/plugins/resource/function/plugin.js +26 -21
  290. package/build/plugins/resource/function/plugin.js.map +1 -1
  291. package/build/plugins/resource/function/utils/depsChecker/checker.d.ts +0 -1
  292. package/build/plugins/resource/function/utils/depsChecker/checker.d.ts.map +1 -1
  293. package/build/plugins/resource/function/utils/depsChecker/checker.js +2 -2
  294. package/build/plugins/resource/function/utils/depsChecker/checker.js.map +1 -1
  295. package/build/plugins/resource/function/utils/depsChecker/common.d.ts +2 -2
  296. package/build/plugins/resource/function/utils/depsChecker/common.d.ts.map +1 -1
  297. package/build/plugins/resource/function/utils/depsChecker/common.js +6 -6
  298. package/build/plugins/resource/function/utils/depsChecker/common.js.map +1 -1
  299. package/build/plugins/resource/function/utils/depsChecker/dotnetChecker.d.ts +3 -2
  300. package/build/plugins/resource/function/utils/depsChecker/dotnetChecker.d.ts.map +1 -1
  301. package/build/plugins/resource/function/utils/depsChecker/dotnetChecker.js +3 -2
  302. package/build/plugins/resource/function/utils/depsChecker/dotnetChecker.js.map +1 -1
  303. package/build/plugins/resource/function/utils/depsChecker/funcPluginAdapter.d.ts +0 -1
  304. package/build/plugins/resource/function/utils/depsChecker/funcPluginAdapter.d.ts.map +1 -1
  305. package/build/plugins/resource/function/utils/depsChecker/funcPluginAdapter.js +1 -23
  306. package/build/plugins/resource/function/utils/depsChecker/funcPluginAdapter.js.map +1 -1
  307. package/build/plugins/resource/identity/index.d.ts.map +1 -1
  308. package/build/plugins/resource/identity/index.js +21 -17
  309. package/build/plugins/resource/identity/index.js.map +1 -1
  310. package/build/plugins/resource/keyvault/plugin.d.ts.map +1 -1
  311. package/build/plugins/resource/keyvault/plugin.js +17 -14
  312. package/build/plugins/resource/keyvault/plugin.js.map +1 -1
  313. package/build/plugins/resource/localdebug/index.d.ts +0 -7
  314. package/build/plugins/resource/localdebug/index.d.ts.map +1 -1
  315. package/build/plugins/resource/localdebug/index.js +3 -501
  316. package/build/plugins/resource/localdebug/index.js.map +1 -1
  317. package/build/plugins/resource/localdebug/util/error.d.ts.map +1 -1
  318. package/build/plugins/resource/localdebug/util/error.js +1 -1
  319. package/build/plugins/resource/localdebug/util/error.js.map +1 -1
  320. package/build/plugins/resource/localdebug/util/localService.d.ts +0 -1
  321. package/build/plugins/resource/localdebug/util/localService.d.ts.map +1 -1
  322. package/build/plugins/resource/localdebug/util/localService.js +1 -40
  323. package/build/plugins/resource/localdebug/util/localService.js.map +1 -1
  324. package/build/plugins/resource/localdebug/v2/index.d.ts.map +1 -1
  325. package/build/plugins/resource/localdebug/v2/index.js +41 -1
  326. package/build/plugins/resource/localdebug/v2/index.js.map +1 -1
  327. package/build/plugins/resource/simpleauth/plugin.d.ts.map +1 -1
  328. package/build/plugins/resource/simpleauth/plugin.js +26 -21
  329. package/build/plugins/resource/simpleauth/plugin.js.map +1 -1
  330. package/build/plugins/resource/simpleauth/utils/common.d.ts.map +1 -1
  331. package/build/plugins/resource/simpleauth/utils/common.js +3 -1
  332. package/build/plugins/resource/simpleauth/utils/common.js.map +1 -1
  333. package/build/plugins/resource/sql/config.d.ts +0 -1
  334. package/build/plugins/resource/sql/config.d.ts.map +1 -1
  335. package/build/plugins/resource/sql/config.js +0 -1
  336. package/build/plugins/resource/sql/config.js.map +1 -1
  337. package/build/plugins/resource/sql/constants.d.ts +1 -0
  338. package/build/plugins/resource/sql/constants.d.ts.map +1 -1
  339. package/build/plugins/resource/sql/constants.js +2 -1
  340. package/build/plugins/resource/sql/constants.js.map +1 -1
  341. package/build/plugins/resource/sql/errors.d.ts +3 -1
  342. package/build/plugins/resource/sql/errors.d.ts.map +1 -1
  343. package/build/plugins/resource/sql/errors.js +3 -1
  344. package/build/plugins/resource/sql/errors.js.map +1 -1
  345. package/build/plugins/resource/sql/managementClient.d.ts +3 -1
  346. package/build/plugins/resource/sql/managementClient.d.ts.map +1 -1
  347. package/build/plugins/resource/sql/managementClient.js +11 -20
  348. package/build/plugins/resource/sql/managementClient.js.map +1 -1
  349. package/build/plugins/resource/sql/plugin.d.ts +3 -0
  350. package/build/plugins/resource/sql/plugin.d.ts.map +1 -1
  351. package/build/plugins/resource/sql/plugin.js +51 -40
  352. package/build/plugins/resource/sql/plugin.js.map +1 -1
  353. package/build/plugins/resource/sql/results.d.ts +2 -2
  354. package/build/plugins/resource/sql/results.d.ts.map +1 -1
  355. package/build/plugins/resource/sql/results.js +4 -4
  356. package/build/plugins/resource/sql/results.js.map +1 -1
  357. package/build/plugins/resource/sql/sqlClient.d.ts +1 -1
  358. package/build/plugins/resource/sql/sqlClient.d.ts.map +1 -1
  359. package/build/plugins/resource/sql/sqlClient.js +33 -46
  360. package/build/plugins/resource/sql/sqlClient.js.map +1 -1
  361. package/build/plugins/resource/sql/utils/checkInput.js +2 -2
  362. package/build/plugins/resource/sql/utils/checkInput.js.map +1 -1
  363. package/build/plugins/resource/sql/utils/message.d.ts +0 -1
  364. package/build/plugins/resource/sql/utils/message.d.ts.map +1 -1
  365. package/build/plugins/resource/sql/utils/message.js +0 -1
  366. package/build/plugins/resource/sql/utils/message.js.map +1 -1
  367. package/build/plugins/resource/utils4v2.d.ts.map +1 -1
  368. package/build/plugins/resource/utils4v2.js +0 -4
  369. package/build/plugins/resource/utils4v2.js.map +1 -1
  370. package/build/plugins/solution/fx-solution/arm.d.ts +18 -11
  371. package/build/plugins/solution/fx-solution/arm.d.ts.map +1 -1
  372. package/build/plugins/solution/fx-solution/arm.js +390 -131
  373. package/build/plugins/solution/fx-solution/arm.js.map +1 -1
  374. package/build/plugins/solution/fx-solution/commonQuestions.d.ts +13 -2
  375. package/build/plugins/solution/fx-solution/commonQuestions.d.ts.map +1 -1
  376. package/build/plugins/solution/fx-solution/commonQuestions.js +24 -26
  377. package/build/plugins/solution/fx-solution/commonQuestions.js.map +1 -1
  378. package/build/plugins/solution/fx-solution/debug/constants.d.ts +10 -0
  379. package/build/plugins/solution/fx-solution/debug/constants.d.ts.map +1 -0
  380. package/build/plugins/solution/fx-solution/debug/constants.js +17 -0
  381. package/build/plugins/solution/fx-solution/debug/constants.js.map +1 -0
  382. package/build/plugins/solution/fx-solution/debug/error.d.ts +9 -0
  383. package/build/plugins/solution/fx-solution/debug/error.d.ts.map +1 -0
  384. package/build/plugins/solution/fx-solution/debug/error.js +36 -0
  385. package/build/plugins/solution/fx-solution/debug/error.js.map +1 -0
  386. package/build/plugins/solution/fx-solution/debug/provisionLocal.d.ts +4 -0
  387. package/build/plugins/solution/fx-solution/debug/provisionLocal.d.ts.map +1 -0
  388. package/build/plugins/solution/fx-solution/debug/provisionLocal.js +233 -0
  389. package/build/plugins/solution/fx-solution/debug/provisionLocal.js.map +1 -0
  390. package/build/plugins/solution/fx-solution/debug/scaffolding.d.ts +5 -0
  391. package/build/plugins/solution/fx-solution/debug/scaffolding.d.ts.map +1 -0
  392. package/build/plugins/solution/fx-solution/debug/scaffolding.js +164 -0
  393. package/build/plugins/solution/fx-solution/debug/scaffolding.js.map +1 -0
  394. package/build/plugins/{resource/localdebug → solution/fx-solution/debug/util}/certificate.d.ts +2 -2
  395. package/build/plugins/solution/fx-solution/debug/util/certificate.d.ts.map +1 -0
  396. package/build/plugins/{resource/localdebug → solution/fx-solution/debug/util}/certificate.js +8 -9
  397. package/build/plugins/solution/fx-solution/debug/util/certificate.js.map +1 -0
  398. package/build/plugins/{resource/localdebug → solution/fx-solution/debug}/util/codespace.d.ts +0 -0
  399. package/build/plugins/solution/fx-solution/debug/util/codespace.d.ts.map +1 -0
  400. package/build/plugins/{resource/localdebug → solution/fx-solution/debug}/util/codespace.js +0 -0
  401. package/build/plugins/solution/fx-solution/debug/util/codespace.js.map +1 -0
  402. package/build/plugins/{resource/localdebug → solution/fx-solution/debug/util}/launch.d.ts +0 -0
  403. package/build/plugins/solution/fx-solution/debug/util/launch.d.ts.map +1 -0
  404. package/build/plugins/{resource/localdebug → solution/fx-solution/debug/util}/launch.js +1 -1
  405. package/build/plugins/solution/fx-solution/debug/util/launch.js.map +1 -0
  406. package/build/plugins/solution/fx-solution/debug/util/localService.d.ts +3 -0
  407. package/build/plugins/solution/fx-solution/debug/util/localService.d.ts.map +1 -0
  408. package/build/plugins/solution/fx-solution/debug/util/localService.js +52 -0
  409. package/build/plugins/solution/fx-solution/debug/util/localService.js.map +1 -0
  410. package/build/plugins/{resource/localdebug → solution/fx-solution/debug}/util/ngrok.d.ts +0 -0
  411. package/build/plugins/solution/fx-solution/debug/util/ngrok.d.ts.map +1 -0
  412. package/build/plugins/{resource/localdebug → solution/fx-solution/debug}/util/ngrok.js +2 -2
  413. package/build/plugins/solution/fx-solution/debug/util/ngrok.js.map +1 -0
  414. package/build/plugins/{resource/localdebug → solution/fx-solution/debug}/util/process.d.ts +0 -0
  415. package/build/plugins/solution/fx-solution/debug/util/process.d.ts.map +1 -0
  416. package/build/plugins/{resource/localdebug → solution/fx-solution/debug}/util/process.js +0 -0
  417. package/build/plugins/solution/fx-solution/debug/util/process.js.map +1 -0
  418. package/build/plugins/solution/fx-solution/debug/util/settings.d.ts +2 -0
  419. package/build/plugins/solution/fx-solution/debug/util/settings.d.ts.map +1 -0
  420. package/build/plugins/solution/fx-solution/debug/util/settings.js +22 -0
  421. package/build/plugins/solution/fx-solution/debug/util/settings.js.map +1 -0
  422. package/build/plugins/{resource/localdebug → solution/fx-solution/debug/util}/tasks.d.ts +0 -0
  423. package/build/plugins/solution/fx-solution/debug/util/tasks.d.ts.map +1 -0
  424. package/build/plugins/{resource/localdebug → solution/fx-solution/debug/util}/tasks.js +11 -11
  425. package/build/plugins/solution/fx-solution/debug/util/tasks.js.map +1 -0
  426. package/build/plugins/{resource/localdebug → solution/fx-solution/debug}/util/telemetry.d.ts +7 -6
  427. package/build/plugins/solution/fx-solution/debug/util/telemetry.d.ts.map +1 -0
  428. package/build/plugins/{resource/localdebug → solution/fx-solution/debug}/util/telemetry.js +16 -19
  429. package/build/plugins/solution/fx-solution/debug/util/telemetry.js.map +1 -0
  430. package/build/plugins/solution/fx-solution/index.d.ts +1 -0
  431. package/build/plugins/solution/fx-solution/index.d.ts.map +1 -1
  432. package/build/plugins/solution/fx-solution/index.js +1 -0
  433. package/build/plugins/solution/fx-solution/index.js.map +1 -1
  434. package/build/plugins/solution/fx-solution/question.d.ts +2 -2
  435. package/build/plugins/solution/fx-solution/question.d.ts.map +1 -1
  436. package/build/plugins/solution/fx-solution/question.js +2 -32
  437. package/build/plugins/solution/fx-solution/question.js.map +1 -1
  438. package/build/plugins/solution/fx-solution/solution.d.ts.map +1 -1
  439. package/build/plugins/solution/fx-solution/solution.js +14 -5
  440. package/build/plugins/solution/fx-solution/solution.js.map +1 -1
  441. package/build/plugins/solution/fx-solution/utils/depsChecker/bicepChecker.d.ts +2 -2
  442. package/build/plugins/solution/fx-solution/utils/depsChecker/bicepChecker.d.ts.map +1 -1
  443. package/build/plugins/solution/fx-solution/utils/depsChecker/bicepChecker.js +13 -14
  444. package/build/plugins/solution/fx-solution/utils/depsChecker/bicepChecker.js.map +1 -1
  445. package/build/plugins/solution/fx-solution/utils/progressHelper.d.ts +2 -2
  446. package/build/plugins/solution/fx-solution/utils/progressHelper.d.ts.map +1 -1
  447. package/build/plugins/solution/fx-solution/utils/progressHelper.js +4 -4
  448. package/build/plugins/solution/fx-solution/utils/progressHelper.js.map +1 -1
  449. package/build/plugins/solution/fx-solution/v2/constants.d.ts +2 -0
  450. package/build/plugins/solution/fx-solution/v2/constants.d.ts.map +1 -0
  451. package/build/plugins/solution/fx-solution/v2/constants.js +7 -0
  452. package/build/plugins/solution/fx-solution/v2/constants.js.map +1 -0
  453. package/build/plugins/solution/fx-solution/v2/createEnv.d.ts.map +1 -1
  454. package/build/plugins/solution/fx-solution/v2/createEnv.js +1 -1
  455. package/build/plugins/solution/fx-solution/v2/createEnv.js.map +1 -1
  456. package/build/plugins/solution/fx-solution/v2/deploy.d.ts.map +1 -1
  457. package/build/plugins/solution/fx-solution/v2/deploy.js +3 -0
  458. package/build/plugins/solution/fx-solution/v2/deploy.js.map +1 -1
  459. package/build/plugins/solution/fx-solution/v2/executeUserTask.d.ts.map +1 -1
  460. package/build/plugins/solution/fx-solution/v2/executeUserTask.js +7 -4
  461. package/build/plugins/solution/fx-solution/v2/executeUserTask.js.map +1 -1
  462. package/build/plugins/solution/fx-solution/v2/getQuestions.d.ts.map +1 -1
  463. package/build/plugins/solution/fx-solution/v2/getQuestions.js +67 -25
  464. package/build/plugins/solution/fx-solution/v2/getQuestions.js.map +1 -1
  465. package/build/plugins/solution/fx-solution/v2/listAllCollaborators.js.map +1 -1
  466. package/build/plugins/solution/fx-solution/v2/provision.d.ts.map +1 -1
  467. package/build/plugins/solution/fx-solution/v2/provision.js +9 -1
  468. package/build/plugins/solution/fx-solution/v2/provision.js.map +1 -1
  469. package/build/plugins/solution/fx-solution/v2/provisionLocal.d.ts.map +1 -1
  470. package/build/plugins/solution/fx-solution/v2/provisionLocal.js +12 -1
  471. package/build/plugins/solution/fx-solution/v2/provisionLocal.js.map +1 -1
  472. package/build/plugins/solution/fx-solution/v2/scaffolding.d.ts.map +1 -1
  473. package/build/plugins/solution/fx-solution/v2/scaffolding.js +5 -0
  474. package/build/plugins/solution/fx-solution/v2/scaffolding.js.map +1 -1
  475. package/build/plugins/solution/fx-solution/v2/solution.d.ts.map +1 -1
  476. package/build/plugins/solution/fx-solution/v2/solution.js +2 -1
  477. package/build/plugins/solution/fx-solution/v2/solution.js.map +1 -1
  478. package/build/plugins/solution/fx-solution/v3/addModule.d.ts +6 -0
  479. package/build/plugins/solution/fx-solution/v3/addModule.d.ts.map +1 -0
  480. package/build/plugins/solution/fx-solution/v3/addModule.js +35 -0
  481. package/build/plugins/solution/fx-solution/v3/addModule.js.map +1 -0
  482. package/build/plugins/solution/fx-solution/v3/addResource.d.ts +37 -0
  483. package/build/plugins/solution/fx-solution/v3/addResource.d.ts.map +1 -0
  484. package/build/plugins/solution/fx-solution/v3/addResource.js +261 -0
  485. package/build/plugins/solution/fx-solution/v3/addResource.js.map +1 -0
  486. package/build/plugins/solution/fx-solution/v3/constants.d.ts +20 -0
  487. package/build/plugins/solution/fx-solution/v3/constants.d.ts.map +1 -0
  488. package/build/plugins/solution/fx-solution/v3/constants.js +25 -0
  489. package/build/plugins/solution/fx-solution/v3/constants.js.map +1 -0
  490. package/build/plugins/solution/fx-solution/v3/deploy.d.ts +6 -0
  491. package/build/plugins/solution/fx-solution/v3/deploy.d.ts.map +1 -0
  492. package/build/plugins/solution/fx-solution/v3/deploy.js +78 -0
  493. package/build/plugins/solution/fx-solution/v3/deploy.js.map +1 -0
  494. package/build/plugins/solution/fx-solution/v3/error.d.ts +8 -0
  495. package/build/plugins/solution/fx-solution/v3/error.d.ts.map +1 -0
  496. package/build/plugins/solution/fx-solution/v3/error.js +17 -0
  497. package/build/plugins/solution/fx-solution/v3/error.js.map +1 -0
  498. package/build/plugins/solution/fx-solution/v3/init.d.ts +4 -0
  499. package/build/plugins/solution/fx-solution/v3/init.d.ts.map +1 -0
  500. package/build/plugins/solution/fx-solution/v3/init.js +35 -0
  501. package/build/plugins/solution/fx-solution/v3/init.js.map +1 -0
  502. package/build/plugins/solution/fx-solution/v3/provision.d.ts +4 -0
  503. package/build/plugins/solution/fx-solution/v3/provision.d.ts.map +1 -0
  504. package/build/plugins/solution/fx-solution/v3/provision.js +124 -0
  505. package/build/plugins/solution/fx-solution/v3/provision.js.map +1 -0
  506. package/build/plugins/solution/fx-solution/v3/provisionLocal.d.ts +4 -0
  507. package/build/plugins/solution/fx-solution/v3/provisionLocal.d.ts.map +1 -0
  508. package/build/plugins/solution/fx-solution/v3/provisionLocal.js +13 -0
  509. package/build/plugins/solution/fx-solution/v3/provisionLocal.js.map +1 -0
  510. package/build/plugins/solution/fx-solution/v3/publish.d.ts +4 -0
  511. package/build/plugins/solution/fx-solution/v3/publish.d.ts.map +1 -0
  512. package/build/plugins/solution/fx-solution/v3/publish.js +15 -0
  513. package/build/plugins/solution/fx-solution/v3/publish.js.map +1 -0
  514. package/build/plugins/solution/fx-solution/v3/scaffold.d.ts +27 -0
  515. package/build/plugins/solution/fx-solution/v3/scaffold.d.ts.map +1 -0
  516. package/build/plugins/solution/fx-solution/v3/scaffold.js +241 -0
  517. package/build/plugins/solution/fx-solution/v3/scaffold.js.map +1 -0
  518. package/build/plugins/solution/fx-solution/v3/solution.d.ts +32 -0
  519. package/build/plugins/solution/fx-solution/v3/solution.d.ts.map +1 -0
  520. package/build/plugins/solution/fx-solution/v3/solution.js +45 -0
  521. package/build/plugins/solution/fx-solution/v3/solution.js.map +1 -0
  522. package/build/plugins/solution/fx-solution/v3/userTask.d.ts +4 -0
  523. package/build/plugins/solution/fx-solution/v3/userTask.d.ts.map +1 -0
  524. package/build/plugins/solution/fx-solution/v3/userTask.js +15 -0
  525. package/build/plugins/solution/fx-solution/v3/userTask.js.map +1 -0
  526. package/build/plugins/solution/fx-solution/v3/utils.d.ts +3 -0
  527. package/build/plugins/solution/fx-solution/v3/utils.d.ts.map +1 -0
  528. package/build/plugins/solution/fx-solution/v3/utils.js +16 -0
  529. package/build/plugins/solution/fx-solution/v3/utils.js.map +1 -0
  530. package/build/plugins/solution/index.d.ts +1 -0
  531. package/build/plugins/solution/index.d.ts.map +1 -1
  532. package/build/plugins/solution/index.js +1 -0
  533. package/build/plugins/solution/index.js.map +1 -1
  534. package/build/plugins/solution/spfx-solution/addModule.d.ts +5 -0
  535. package/build/plugins/solution/spfx-solution/addModule.d.ts.map +1 -0
  536. package/build/plugins/solution/spfx-solution/addModule.js +29 -0
  537. package/build/plugins/solution/spfx-solution/addModule.js.map +1 -0
  538. package/build/plugins/solution/spfx-solution/constants.d.ts +2 -0
  539. package/build/plugins/solution/spfx-solution/constants.d.ts.map +1 -0
  540. package/build/plugins/solution/spfx-solution/constants.js +7 -0
  541. package/build/plugins/solution/spfx-solution/constants.js.map +1 -0
  542. package/build/plugins/solution/spfx-solution/error.d.ts +5 -0
  543. package/build/plugins/solution/spfx-solution/error.d.ts.map +1 -0
  544. package/build/plugins/solution/spfx-solution/error.js +13 -0
  545. package/build/plugins/solution/spfx-solution/error.js.map +1 -0
  546. package/build/plugins/solution/spfx-solution/index.d.ts +2 -0
  547. package/build/plugins/solution/spfx-solution/index.d.ts.map +1 -0
  548. package/build/plugins/solution/spfx-solution/index.js +7 -0
  549. package/build/plugins/solution/spfx-solution/index.js.map +1 -0
  550. package/build/plugins/solution/spfx-solution/init.d.ts +4 -0
  551. package/build/plugins/solution/spfx-solution/init.d.ts.map +1 -0
  552. package/build/plugins/solution/spfx-solution/init.js +52 -0
  553. package/build/plugins/solution/spfx-solution/init.js.map +1 -0
  554. package/build/plugins/solution/spfx-solution/questions.d.ts +4 -0
  555. package/build/plugins/solution/spfx-solution/questions.d.ts.map +1 -0
  556. package/build/plugins/solution/spfx-solution/questions.js +10 -0
  557. package/build/plugins/solution/spfx-solution/questions.js.map +1 -0
  558. package/build/plugins/solution/spfx-solution/scaffold.d.ts +13 -0
  559. package/build/plugins/solution/spfx-solution/scaffold.d.ts.map +1 -0
  560. package/build/plugins/solution/spfx-solution/scaffold.js +105 -0
  561. package/build/plugins/solution/spfx-solution/scaffold.js.map +1 -0
  562. package/build/plugins/solution/spfx-solution/solution.d.ts +22 -0
  563. package/build/plugins/solution/spfx-solution/solution.d.ts.map +1 -0
  564. package/build/plugins/solution/spfx-solution/solution.js +31 -0
  565. package/build/plugins/solution/spfx-solution/solution.js.map +1 -0
  566. package/build/plugins/solution/utils/error.d.ts +5 -0
  567. package/build/plugins/solution/utils/error.d.ts.map +1 -0
  568. package/build/plugins/solution/utils/error.js +13 -0
  569. package/build/plugins/solution/utils/error.js.map +1 -0
  570. package/build/plugins/solution/utils/questions.d.ts +16 -0
  571. package/build/plugins/solution/utils/questions.d.ts.map +1 -0
  572. package/build/plugins/solution/utils/questions.js +86 -0
  573. package/build/plugins/solution/utils/questions.js.map +1 -0
  574. package/package.json +20 -5
  575. package/resource/deps-checker/dotnet-install.ps1 +1095 -0
  576. package/resource/deps-checker/dotnet-install.sh +1222 -0
  577. package/resource/strings.json +1 -2
  578. package/templates/plugins/resource/apim/bicep/apimConfiguration.bicep +16 -16
  579. package/templates/plugins/resource/apim/bicep/config.template.bicep +1 -1
  580. package/templates/plugins/resource/apim/bicep/provision.template.bicep +1 -1
  581. package/templates/plugins/resource/bot/bicep/botConfiguration.template.bicep +24 -29
  582. package/templates/plugins/resource/bot/bicep/config.template.bicep +1 -1
  583. package/templates/plugins/resource/bot/bicep/provision.template.bicep +2 -2
  584. package/templates/plugins/resource/frontend/bicep/provision.template.bicep +1 -1
  585. package/templates/plugins/resource/function/bicep/config.template.bicep +1 -1
  586. package/templates/plugins/resource/function/bicep/functionConfiguration.template.bicep +33 -31
  587. package/templates/plugins/resource/function/bicep/provision.template.bicep +2 -2
  588. package/templates/plugins/resource/identity/bicep/provision.template.bicep +1 -1
  589. package/templates/plugins/resource/keyvault/bicep/keyVaultProvision.template.bicep +1 -0
  590. package/templates/plugins/resource/keyvault/bicep/provision.template.bicep +4 -2
  591. package/templates/plugins/resource/simpleauth/bicep/config.template.bicep +1 -1
  592. package/templates/plugins/resource/simpleauth/bicep/provision.template.bicep +2 -2
  593. package/templates/plugins/resource/simpleauth/bicep/simpleAuthConfiguration.template.bicep +20 -24
  594. package/templates/plugins/resource/simpleauth/version.txt +2 -1
  595. package/templates/plugins/resource/sql/bicep/provision.template.bicep +1 -1
  596. package/build/plugins/resource/localdebug/certificate.d.ts.map +0 -1
  597. package/build/plugins/resource/localdebug/certificate.js.map +0 -1
  598. package/build/plugins/resource/localdebug/launch.d.ts.map +0 -1
  599. package/build/plugins/resource/localdebug/launch.js.map +0 -1
  600. package/build/plugins/resource/localdebug/legacyPlugin.d.ts +0 -6
  601. package/build/plugins/resource/localdebug/legacyPlugin.d.ts.map +0 -1
  602. package/build/plugins/resource/localdebug/legacyPlugin.js +0 -208
  603. package/build/plugins/resource/localdebug/legacyPlugin.js.map +0 -1
  604. package/build/plugins/resource/localdebug/localEnvMulti.d.ts.map +0 -1
  605. package/build/plugins/resource/localdebug/localEnvMulti.js.map +0 -1
  606. package/build/plugins/resource/localdebug/settings.d.ts +0 -2
  607. package/build/plugins/resource/localdebug/settings.d.ts.map +0 -1
  608. package/build/plugins/resource/localdebug/settings.js +0 -18
  609. package/build/plugins/resource/localdebug/settings.js.map +0 -1
  610. package/build/plugins/resource/localdebug/tasks.d.ts.map +0 -1
  611. package/build/plugins/resource/localdebug/tasks.js.map +0 -1
  612. package/build/plugins/resource/localdebug/util/codespace.d.ts.map +0 -1
  613. package/build/plugins/resource/localdebug/util/codespace.js.map +0 -1
  614. package/build/plugins/resource/localdebug/util/ngrok.d.ts.map +0 -1
  615. package/build/plugins/resource/localdebug/util/ngrok.js.map +0 -1
  616. package/build/plugins/resource/localdebug/util/process.d.ts.map +0 -1
  617. package/build/plugins/resource/localdebug/util/process.js.map +0 -1
  618. package/build/plugins/resource/localdebug/util/telemetry.d.ts.map +0 -1
  619. package/build/plugins/resource/localdebug/util/telemetry.js.map +0 -1
  620. package/templates/azure/config.bicep +0 -25
  621. package/templates/azure/main.bicep +0 -20
  622. package/templates/azure/provision/azureSql.bicep +0 -39
  623. package/templates/azure/provision/frontendHosting.bicep +0 -23
  624. package/templates/azure/provision/function.bicep +0 -79
  625. package/templates/azure/provision/simpleAuth.bicep +0 -44
  626. package/templates/azure/provision.bicep +0 -58
  627. package/templates/azure/teamsFx/bot.bicep +0 -34
  628. package/templates/azure/teamsFx/function.bicep +0 -71
  629. package/templates/azure/teamsFx/simpleAuth.bicep +0 -40
  630. package/templates/plugins/resource/aad/bicep/param.template.bicep +0 -6
  631. package/templates/plugins/resource/aad/bicep/variables.template.bicep +0 -13
@@ -2,45 +2,49 @@
2
2
  // Copyright (c) Microsoft Corporation.
3
3
  // Licensed under the MIT license.
4
4
  Object.defineProperty(exports, "__esModule", { value: true });
5
- exports.getProjectSettingsVersion = exports.undefinedName = exports.createV2Context = exports.newProjectSettings = exports.downloadSample = exports.createBasicFolderStructure = exports.FxCore = exports.TOOLS = exports.currentStage = exports.telemetryReporter = exports.Logger = exports.isVsCallingCli = exports.isV2 = void 0;
5
+ exports.getProjectSettingsVersion = exports.undefinedName = exports.createV2Context = exports.newProjectSettings = exports.createBasicFolderStructure = exports.FxCore = exports.setTools = exports.TOOLS = exports.currentStage = exports.telemetryReporter = exports.Logger = exports.isVsCallingCli = exports.isV3 = void 0;
6
6
  const tslib_1 = require("tslib");
7
7
  const hooks_1 = require("@feathersjs/hooks");
8
8
  const teamsfx_api_1 = require("@microsoft/teamsfx-api");
9
- const adm_zip_1 = tslib_1.__importDefault(require("adm-zip"));
10
9
  const fs = tslib_1.__importStar(require("fs-extra"));
11
10
  const jsonschema = tslib_1.__importStar(require("jsonschema"));
11
+ const lodash_1 = require("lodash");
12
12
  const path = tslib_1.__importStar(require("path"));
13
+ const typedi_1 = require("typedi");
13
14
  const uuid = tslib_1.__importStar(require("uuid"));
14
15
  const __1 = require("..");
15
16
  const constants_1 = require("../common/constants");
16
17
  const globalState_1 = require("../common/globalState");
17
18
  const localSettingsProvider_1 = require("../common/localSettingsProvider");
18
- const telemetry_1 = require("../common/telemetry");
19
19
  const tools_1 = require("../common/tools");
20
- const plugins_1 = require("../plugins");
21
- const ResourcePluginContainer_1 = require("../plugins/solution/fx-solution/ResourcePluginContainer");
20
+ const question_1 = require("../plugins/solution/fx-solution/question");
21
+ const constants_2 = require("../plugins/solution/fx-solution/v3/constants");
22
22
  const callback_1 = require("./callback");
23
+ const crypto_1 = require("./crypto");
24
+ const downloadSample_1 = require("./downloadSample");
23
25
  const error_1 = require("./error");
24
26
  const concurrentLocker_1 = require("./middleware/concurrentLocker");
25
27
  const contextInjector_1 = require("./middleware/contextInjector");
26
28
  const envInfoLoader_1 = require("./middleware/envInfoLoader");
29
+ const envInfoLoaderV3_1 = require("./middleware/envInfoLoaderV3");
27
30
  const envInfoWriter_1 = require("./middleware/envInfoWriter");
31
+ const envInfoWriterV3_1 = require("./middleware/envInfoWriterV3");
28
32
  const errorHandler_1 = require("./middleware/errorHandler");
29
33
  const localSettingsLoader_1 = require("./middleware/localSettingsLoader");
30
34
  const localSettingsWriter_1 = require("./middleware/localSettingsWriter");
31
35
  const migrateConditionHandler_1 = require("./middleware/migrateConditionHandler");
32
36
  const projectMigrator_1 = require("./middleware/projectMigrator");
33
37
  const projectSettingsLoader_1 = require("./middleware/projectSettingsLoader");
38
+ const projectSettingsLoaderV3_1 = require("./middleware/projectSettingsLoaderV3");
34
39
  const projectSettingsWriter_1 = require("./middleware/projectSettingsWriter");
35
40
  const projectUpgrader_1 = require("./middleware/projectUpgrader");
36
41
  const questionModel_1 = require("./middleware/questionModel");
37
42
  const solutionLoader_1 = require("./middleware/solutionLoader");
38
- const question_1 = require("./question");
43
+ const solutionLoaderV3_1 = require("./middleware/solutionLoaderV3");
44
+ const supportV1ConditionHandler_1 = require("./middleware/supportV1ConditionHandler");
45
+ const question_2 = require("./question");
39
46
  const SolutionPluginContainer_1 = require("./SolutionPluginContainer");
40
47
  const tools_2 = require("./tools");
41
- const crypto_1 = require("./crypto");
42
- const supportV1ConditionHandler_1 = require("./middleware/supportV1ConditionHandler");
43
- const lodash_1 = require("lodash");
44
48
  // TODO: For package.json,
45
49
  // use require instead of import because of core building/packaging method.
46
50
  // Using import will cause the build folder structure to change.
@@ -54,18 +58,36 @@ function featureFlagEnabled(flagName) {
54
58
  return false;
55
59
  }
56
60
  }
57
- // API V2 feature flag
58
- function isV2() {
59
- return tools_1.isMultiEnvEnabled();
61
+ function isV3() {
62
+ return featureFlagEnabled(constants_1.FeatureFlagName.APIV3);
60
63
  }
61
- exports.isV2 = isV2;
64
+ exports.isV3 = isV3;
62
65
  // On VS calling CLI, interactive questions need to be skipped.
63
66
  function isVsCallingCli() {
64
67
  return featureFlagEnabled(constants_1.FeatureFlagName.VSCallingCLI);
65
68
  }
66
69
  exports.isVsCallingCli = isVsCallingCli;
70
+ function setTools(tools) {
71
+ exports.TOOLS = tools;
72
+ }
73
+ exports.setTools = setTools;
67
74
  class FxCore {
68
75
  constructor(tools) {
76
+ //V1,V2 questions
77
+ this._getQuestionsForCreateProjectV2 = questionModel_1.getQuestionsForCreateProjectV2;
78
+ this._getQuestionsForCreateProjectV3 = questionModel_1.getQuestionsForCreateProjectV3;
79
+ this._getQuestionsForUserTask = questionModel_1.getQuestionsForUserTaskV2;
80
+ this._getQuestions = questionModel_1.getQuestionsV2;
81
+ this._getQuestionsForMigrateV1Project = questionModel_1.getQuestionsForMigrateV1Project;
82
+ //v3 questions
83
+ this._getQuestionsForScaffold = questionModel_1.getQuestionsForScaffold;
84
+ this._getQuestionsForAddModule = questionModel_1.getQuestionsForAddModule;
85
+ this._getQuestionsForAddResource = questionModel_1.getQuestionsForAddResource;
86
+ this._getQuestionsForProvision = questionModel_1.getQuestionsForProvision;
87
+ this._getQuestionsForDeploy = questionModel_1.getQuestionsForDeploy;
88
+ this._getQuestionsForLocalProvision = questionModel_1.getQuestionsForLocalProvision;
89
+ this._getQuestionsForPublish = questionModel_1.getQuestionsForPublish;
90
+ this._getQuestionsForInit = questionModel_1.getQuestionsForInit;
69
91
  this.tools = tools;
70
92
  exports.TOOLS = tools;
71
93
  exports.Logger = tools.logProvider;
@@ -78,24 +100,36 @@ class FxCore {
78
100
  on(event, callback) {
79
101
  return callback_1.CallbackRegistry.set(event, callback);
80
102
  }
81
- async createProject(inputs, ctx) {
103
+ async createProject(inputs) {
104
+ if (isV3()) {
105
+ return this.createProjectV3(inputs);
106
+ }
107
+ else {
108
+ return this.createProjectV2(inputs);
109
+ }
110
+ }
111
+ async createProjectV2(inputs, ctx) {
82
112
  if (!ctx) {
83
113
  return teamsfx_api_1.err(new error_1.ObjectIsUndefinedError("ctx for createProject"));
84
114
  }
85
115
  exports.currentStage = teamsfx_api_1.Stage.create;
86
116
  inputs.stage = teamsfx_api_1.Stage.create;
87
- let folder = inputs[question_1.QuestionRootFolder.name];
117
+ let folder = inputs[question_2.QuestionRootFolder.name];
88
118
  if (inputs.platform === teamsfx_api_1.Platform.VSCode) {
89
119
  folder = tools_1.getRootDirectory();
90
- await fs.ensureDir(folder);
120
+ try {
121
+ await fs.ensureDir(folder);
122
+ }
123
+ catch (e) {
124
+ throw error_1.ProjectFolderInvalidError(folder);
125
+ }
91
126
  }
92
- const scratch = inputs[question_1.CoreQuestionNames.CreateFromScratch];
127
+ const scratch = inputs[question_2.CoreQuestionNames.CreateFromScratch];
93
128
  let projectPath;
94
129
  let globalStateDescription = "openReadme";
95
- const multiEnv = tools_1.isMultiEnvEnabled();
96
- if (scratch === question_1.ScratchOptionNo.id) {
130
+ if (scratch === question_2.ScratchOptionNo.id) {
97
131
  // create from sample
98
- const downloadRes = await downloadSample(this, inputs, ctx);
132
+ const downloadRes = await downloadSample_1.downloadSample(inputs, ctx);
99
133
  if (downloadRes.isErr()) {
100
134
  return teamsfx_api_1.err(downloadRes.error);
101
135
  }
@@ -104,11 +138,11 @@ class FxCore {
104
138
  }
105
139
  else {
106
140
  // create from new
107
- const appName = inputs[question_1.QuestionAppName.name];
141
+ const appName = inputs[question_2.QuestionAppName.name];
108
142
  if (undefined === appName)
109
143
  return teamsfx_api_1.err(error_1.InvalidInputError(`App Name is empty`, inputs));
110
144
  const validateResult = jsonschema.validate(appName, {
111
- pattern: question_1.ProjectNamePattern,
145
+ pattern: question_2.ProjectNamePattern,
112
146
  });
113
147
  if (validateResult.errors && validateResult.errors.length > 0) {
114
148
  return teamsfx_api_1.err(error_1.InvalidInputError(`${validateResult.errors[0].message}`, inputs));
@@ -121,7 +155,7 @@ class FxCore {
121
155
  }
122
156
  await fs.ensureDir(projectPath);
123
157
  await fs.ensureDir(path.join(projectPath, `.${teamsfx_api_1.ConfigFolderName}`));
124
- await fs.ensureDir(path.join(projectPath, multiEnv ? path.join("templates", `${teamsfx_api_1.AppPackageFolderName}`) : `${teamsfx_api_1.AppPackageFolderName}`));
158
+ await fs.ensureDir(path.join(projectPath, path.join("templates", `${teamsfx_api_1.AppPackageFolderName}`)));
125
159
  const basicFolderRes = await createBasicFolderStructure(inputs);
126
160
  if (basicFolderRes.isErr()) {
127
161
  return teamsfx_api_1.err(basicFolderRes.error);
@@ -137,77 +171,211 @@ class FxCore {
137
171
  isFromSample: false,
138
172
  };
139
173
  ctx.projectSettings = projectSettings;
140
- if (multiEnv) {
141
- const createEnvResult = await this.createEnvWithName(__1.environmentManager.getDefaultEnvName(), projectSettings, inputs);
142
- if (createEnvResult.isErr()) {
143
- return teamsfx_api_1.err(createEnvResult.error);
144
- }
174
+ const createEnvResult = await this.createEnvWithName(__1.environmentManager.getDefaultEnvName(), projectSettings, inputs);
175
+ if (createEnvResult.isErr()) {
176
+ return teamsfx_api_1.err(createEnvResult.error);
145
177
  }
146
- if (isV2()) {
147
- const solution = await SolutionPluginContainer_1.getSolutionPluginV2ByName(inputs[question_1.CoreQuestionNames.Solution]);
148
- if (!solution) {
149
- return teamsfx_api_1.err(new error_1.LoadSolutionError());
150
- }
151
- ctx.solutionV2 = solution;
152
- projectSettings.solutionSettings.name = solution.name;
153
- const contextV2 = createV2Context(this, projectSettings);
154
- ctx.contextV2 = contextV2;
155
- const scaffoldSourceCodeRes = await solution.scaffoldSourceCode(contextV2, inputs);
156
- if (scaffoldSourceCodeRes.isErr()) {
157
- return teamsfx_api_1.err(scaffoldSourceCodeRes.error);
178
+ const solution = await SolutionPluginContainer_1.getSolutionPluginV2ByName(inputs[question_2.CoreQuestionNames.Solution]);
179
+ if (!solution) {
180
+ return teamsfx_api_1.err(new error_1.LoadSolutionError());
181
+ }
182
+ ctx.solutionV2 = solution;
183
+ projectSettings.solutionSettings.name = solution.name;
184
+ const contextV2 = createV2Context(projectSettings);
185
+ ctx.contextV2 = contextV2;
186
+ const scaffoldSourceCodeRes = await solution.scaffoldSourceCode(contextV2, inputs);
187
+ if (scaffoldSourceCodeRes.isErr()) {
188
+ return teamsfx_api_1.err(scaffoldSourceCodeRes.error);
189
+ }
190
+ const generateResourceTemplateRes = await solution.generateResourceTemplate(contextV2, inputs);
191
+ if (generateResourceTemplateRes.isErr()) {
192
+ return teamsfx_api_1.err(generateResourceTemplateRes.error);
193
+ }
194
+ // ctx.provisionInputConfig = generateResourceTemplateRes.value;
195
+ if (solution.createEnv) {
196
+ inputs.copy = false;
197
+ const createEnvRes = await solution.createEnv(contextV2, inputs);
198
+ if (createEnvRes.isErr()) {
199
+ return teamsfx_api_1.err(createEnvRes.error);
158
200
  }
159
- const generateResourceTemplateRes = await solution.generateResourceTemplate(contextV2, inputs);
160
- if (generateResourceTemplateRes.isErr()) {
161
- return teamsfx_api_1.err(generateResourceTemplateRes.error);
201
+ }
202
+ }
203
+ if (inputs.platform === teamsfx_api_1.Platform.VSCode) {
204
+ await globalState_1.globalStateUpdate(globalStateDescription, true);
205
+ }
206
+ return teamsfx_api_1.ok(projectPath);
207
+ }
208
+ async createProjectV3(inputs, ctx) {
209
+ if (!ctx) {
210
+ return teamsfx_api_1.err(new error_1.ObjectIsUndefinedError("ctx for createProject"));
211
+ }
212
+ exports.currentStage = teamsfx_api_1.Stage.create;
213
+ inputs.stage = teamsfx_api_1.Stage.create;
214
+ let folder = inputs[question_2.QuestionRootFolder.name];
215
+ if (inputs.platform === teamsfx_api_1.Platform.VSCode || inputs.platform === teamsfx_api_1.Platform.VS) {
216
+ folder = tools_1.getRootDirectory();
217
+ try {
218
+ await fs.ensureDir(folder);
219
+ }
220
+ catch (e) {
221
+ throw error_1.ProjectFolderInvalidError(folder);
222
+ }
223
+ }
224
+ const scratch = inputs[question_2.CoreQuestionNames.CreateFromScratch];
225
+ let projectPath;
226
+ let globalStateDescription = "openReadme";
227
+ if (scratch === question_2.ScratchOptionNo.id) {
228
+ // create from sample
229
+ const downloadRes = await downloadSample_1.downloadSample(inputs, ctx);
230
+ if (downloadRes.isErr()) {
231
+ return teamsfx_api_1.err(downloadRes.error);
232
+ }
233
+ projectPath = downloadRes.value;
234
+ globalStateDescription = "openSampleReadme";
235
+ }
236
+ else {
237
+ // create from new
238
+ const appName = inputs[question_2.QuestionAppName.name];
239
+ if (undefined === appName)
240
+ return teamsfx_api_1.err(error_1.InvalidInputError(`App Name is empty`, inputs));
241
+ const validateResult = jsonschema.validate(appName, {
242
+ pattern: question_2.ProjectNamePattern,
243
+ });
244
+ if (validateResult.errors && validateResult.errors.length > 0) {
245
+ return teamsfx_api_1.err(error_1.InvalidInputError(`${validateResult.errors[0].message}`, inputs));
246
+ }
247
+ projectPath = path.join(folder, appName);
248
+ inputs.projectPath = projectPath;
249
+ const folderExist = await fs.pathExists(projectPath);
250
+ if (folderExist) {
251
+ return teamsfx_api_1.err(error_1.ProjectFolderExistError(projectPath));
252
+ }
253
+ await fs.ensureDir(projectPath);
254
+ await fs.ensureDir(path.join(projectPath, `.${teamsfx_api_1.ConfigFolderName}`));
255
+ let capabilities = inputs[question_2.CoreQuestionNames.Capabilities];
256
+ let projectType = "";
257
+ if (capabilities.includes(question_2.TabSPFxItem.id))
258
+ projectType = "spfx";
259
+ else if (capabilities.includes(question_2.TabOptionItem.id) && capabilities.length === 1)
260
+ projectType = "tab";
261
+ else if ((capabilities.includes(question_2.BotOptionItem.id) ||
262
+ capabilities.includes(question_1.MessageExtensionItem.id)) &&
263
+ !capabilities.includes(question_2.TabOptionItem.id))
264
+ projectType = "bot";
265
+ else if ((capabilities.includes(question_2.BotOptionItem.id) ||
266
+ capabilities.includes(question_1.MessageExtensionItem.id)) &&
267
+ capabilities.includes(question_2.TabOptionItem.id))
268
+ projectType = "tab+bot";
269
+ const programmingLanguage = inputs[question_2.CoreQuestionNames.ProgrammingLanguage];
270
+ // const solution = capabilities.includes(TabSPFxItem.id)
271
+ // ? BuiltInSolutionNames.spfx
272
+ // : BuiltInSolutionNames.azure;
273
+ // init
274
+ const initInputs = Object.assign(Object.assign({}, inputs), { projectPath: projectPath });
275
+ const initRes = await this._init(initInputs, ctx);
276
+ if (initRes.isErr()) {
277
+ return teamsfx_api_1.err(initRes.error);
278
+ }
279
+ // addModule, scaffold and addResource
280
+ if (inputs.platform === teamsfx_api_1.Platform.VS) {
281
+ // addModule
282
+ const addModuleInputs = Object.assign(Object.assign({}, inputs), { projectPath: projectPath, capabilities: capabilities });
283
+ const addModuleRes = await this._addModule(addModuleInputs, ctx);
284
+ if (addModuleRes.isErr()) {
285
+ return teamsfx_api_1.err(addModuleRes.error);
162
286
  }
163
- // ctx.provisionInputConfig = generateResourceTemplateRes.value;
164
- if (multiEnv) {
165
- if (solution.createEnv) {
166
- inputs.copy = false;
167
- const createEnvRes = await solution.createEnv(contextV2, inputs);
168
- if (createEnvRes.isErr()) {
169
- return teamsfx_api_1.err(createEnvRes.error);
170
- }
171
- }
287
+ // addResource
288
+ const addResourceInputs = Object.assign(Object.assign({}, inputs), { projectPath: projectPath, module: "0", resource: constants_2.BuiltInResourcePluginNames.webApp });
289
+ const addResourceRes = await this._addResource(addResourceInputs, ctx);
290
+ if (addResourceRes.isErr()) {
291
+ return teamsfx_api_1.err(addResourceRes.error);
172
292
  }
173
- else {
174
- //TODO lagacy env.default.json
175
- const state = { solution: {} };
176
- for (const plugin of ResourcePluginContainer_1.getAllV2ResourcePlugins()) {
177
- state[plugin.name] = {};
178
- }
179
- state[plugins_1.PluginNames.LDEBUG]["trustDevCert"] = "true";
180
- ctx.envInfoV2 = {
181
- envName: __1.environmentManager.getDefaultEnvName(),
182
- config: {},
183
- state: state,
184
- };
293
+ // scaffold
294
+ let templateName = "";
295
+ if (projectType === "tab")
296
+ templateName = "BlazorTab";
297
+ else if (projectType === "bot")
298
+ templateName = "BlazorBot";
299
+ else if (projectType === "tabbot")
300
+ templateName = "BlazorTabBot";
301
+ const scaffoldInputs = Object.assign(Object.assign({}, inputs), { projectPath: projectPath, module: "0", template: {
302
+ id: `${constants_2.BuiltInScaffoldPluginNames.blazor}/${templateName}`,
303
+ label: `${constants_2.BuiltInScaffoldPluginNames.blazor}/${templateName}`,
304
+ data: {
305
+ pluginName: constants_2.BuiltInScaffoldPluginNames.blazor,
306
+ templateName: templateName,
307
+ },
308
+ } });
309
+ const scaffoldRes = await this._scaffold(scaffoldInputs, ctx);
310
+ if (scaffoldRes.isErr()) {
311
+ return teamsfx_api_1.err(scaffoldRes.error);
185
312
  }
186
313
  }
187
314
  else {
188
- const solution = await SolutionPluginContainer_1.getSolutionPluginByName(inputs[question_1.CoreQuestionNames.Solution]);
189
- if (!solution) {
190
- return teamsfx_api_1.err(new error_1.LoadSolutionError());
191
- }
192
- ctx.solution = solution;
193
- projectSettings.solutionSettings.name = solution.name;
194
- const solutionContext = Object.assign(Object.assign(Object.assign({ projectSettings: projectSettings, envInfo: tools_2.newEnvInfo(), root: projectPath }, this.tools), this.tools.tokenProvider), { answers: inputs, cryptoProvider: new crypto_1.LocalCrypto(projectSettings.projectId) });
195
- ctx.solutionContext = solutionContext;
196
- const createRes = await solution.create(solutionContext);
197
- if (createRes.isErr()) {
198
- return createRes;
199
- }
200
- const scaffoldRes = await solution.scaffold(solutionContext);
201
- if (scaffoldRes.isErr()) {
202
- return scaffoldRes;
315
+ if (capabilities.includes(question_2.TabOptionItem.id) || capabilities.includes(question_2.TabSPFxItem.id)) {
316
+ const addModuleInputs = Object.assign(Object.assign({}, inputs), { projectPath: projectPath, capabilities: capabilities.includes(question_2.TabOptionItem.id)
317
+ ? [question_2.TabOptionItem.id]
318
+ : [question_2.TabSPFxItem.id] });
319
+ const addModuleRes = await this._addModule(addModuleInputs, ctx);
320
+ if (addModuleRes.isErr()) {
321
+ return teamsfx_api_1.err(addModuleRes.error);
322
+ }
323
+ // addResource
324
+ const addResourceInputs = Object.assign(Object.assign({}, inputs), { projectPath: projectPath, module: "0", resource: capabilities.includes(question_2.TabOptionItem.id)
325
+ ? constants_2.BuiltInResourcePluginNames.storage
326
+ : constants_2.BuiltInResourcePluginNames.spfx });
327
+ const addResourceRes = await this._addResource(addResourceInputs, ctx);
328
+ if (addResourceRes.isErr()) {
329
+ return teamsfx_api_1.err(addResourceRes.error);
330
+ }
331
+ // scaffold
332
+ const pluginName = capabilities.includes(question_2.TabOptionItem.id)
333
+ ? constants_2.BuiltInScaffoldPluginNames.tab
334
+ : constants_2.BuiltInScaffoldPluginNames.spfx;
335
+ const templateName = capabilities.includes(question_2.TabOptionItem.id)
336
+ ? programmingLanguage === "javascript"
337
+ ? "ReactTab_JS"
338
+ : "ReactTab_TS"
339
+ : "SPFxTab";
340
+ const scaffoldInputs = Object.assign(Object.assign({}, inputs), { projectPath: projectPath, module: "0", template: {
341
+ id: `${pluginName}/${templateName}`,
342
+ label: `${pluginName}/${templateName}`,
343
+ data: {
344
+ pluginName: pluginName,
345
+ templateName: templateName, //TODO
346
+ },
347
+ } });
348
+ const scaffoldRes = await this._scaffold(scaffoldInputs, ctx);
349
+ if (scaffoldRes.isErr()) {
350
+ return teamsfx_api_1.err(scaffoldRes.error);
351
+ }
203
352
  }
204
- if (multiEnv) {
205
- if (solution.createEnv) {
206
- solutionContext.answers.copy = false;
207
- const createEnvRes = await solution.createEnv(solutionContext);
208
- if (createEnvRes.isErr()) {
209
- return teamsfx_api_1.err(createEnvRes.error);
210
- }
353
+ capabilities = capabilities.filter((c) => c !== question_2.TabOptionItem.id && c !== question_2.TabSPFxItem.id);
354
+ if (capabilities.length > 0) {
355
+ const addModuleInputs = Object.assign(Object.assign({}, inputs), { projectPath: projectPath, capabilities: capabilities });
356
+ const addModuleRes = await this._addModule(addModuleInputs, ctx);
357
+ if (addModuleRes.isErr()) {
358
+ return teamsfx_api_1.err(addModuleRes.error);
359
+ }
360
+ // addResource
361
+ const addResourceInputs = Object.assign(Object.assign({}, inputs), { projectPath: projectPath, module: "1", resource: constants_2.BuiltInResourcePluginNames.bot });
362
+ const addResourceRes = await this._addResource(addResourceInputs, ctx);
363
+ if (addResourceRes.isErr()) {
364
+ return teamsfx_api_1.err(addResourceRes.error);
365
+ }
366
+ // scaffold
367
+ const templateName = programmingLanguage === "javascript" ? "NodejsBot_JS" : "NodejsBot_TS";
368
+ const scaffoldInputs = Object.assign(Object.assign({}, inputs), { projectPath: projectPath, module: "1", resource: constants_2.BuiltInScaffoldPluginNames.bot, template: {
369
+ id: `${constants_2.BuiltInScaffoldPluginNames.bot}/${templateName}`,
370
+ label: `${constants_2.BuiltInScaffoldPluginNames.bot}/${templateName}`,
371
+ data: {
372
+ pluginName: constants_2.BuiltInScaffoldPluginNames.bot,
373
+ templateName: templateName, //TODO
374
+ },
375
+ } });
376
+ const scaffoldRes = await this._scaffold(scaffoldInputs, ctx);
377
+ if (scaffoldRes.isErr()) {
378
+ return teamsfx_api_1.err(scaffoldRes.error);
211
379
  }
212
380
  }
213
381
  }
@@ -222,11 +390,11 @@ class FxCore {
222
390
  exports.currentStage = teamsfx_api_1.Stage.migrateV1;
223
391
  inputs.stage = teamsfx_api_1.Stage.migrateV1;
224
392
  const globalStateDescription = "openReadme";
225
- const appName = ((_a = inputs[question_1.DefaultAppNameFunc.name]) !== null && _a !== void 0 ? _a : inputs[question_1.QuestionV1AppName.name]);
393
+ const appName = ((_a = inputs[question_2.DefaultAppNameFunc.name]) !== null && _a !== void 0 ? _a : inputs[question_2.QuestionV1AppName.name]);
226
394
  if (undefined === appName)
227
395
  return teamsfx_api_1.err(error_1.InvalidInputError(`App Name is empty`, inputs));
228
396
  const validateResult = jsonschema.validate(appName, {
229
- pattern: question_1.ProjectNamePattern,
397
+ pattern: question_2.ProjectNamePattern,
230
398
  });
231
399
  if (validateResult.errors && validateResult.errors.length > 0) {
232
400
  return teamsfx_api_1.err(error_1.InvalidInputError(`${validateResult.errors[0].message}`, inputs));
@@ -302,104 +470,131 @@ class FxCore {
302
470
  return teamsfx_api_1.err(error_1.ArchiveProjectError(e.message));
303
471
  }
304
472
  }
305
- async provisionResources(inputs, ctx) {
473
+ /**
474
+ * switch to different versions of provisionResources
475
+ */
476
+ async provisionResources(inputs) {
477
+ if (isV3()) {
478
+ return this.provisionResourcesV3(inputs);
479
+ }
480
+ else {
481
+ return this.provisionResourcesV2(inputs);
482
+ }
483
+ }
484
+ async provisionResourcesV2(inputs, ctx) {
306
485
  exports.currentStage = teamsfx_api_1.Stage.provision;
307
486
  inputs.stage = teamsfx_api_1.Stage.provision;
308
- // provision is not ready yet, so use API v1
309
- if (isV2()) {
310
- if (!ctx || !ctx.solutionV2 || !ctx.contextV2 || !ctx.envInfoV2) {
311
- return teamsfx_api_1.err(new error_1.ObjectIsUndefinedError("Provision input stuff"));
312
- }
313
- const envInfo = ctx.envInfoV2;
314
- const result = await ctx.solutionV2.provisionResources(ctx.contextV2, inputs, envInfo, this.tools.tokenProvider);
315
- if (result.kind === "success") {
316
- ctx.envInfoV2.state = lodash_1.assign(ctx.envInfoV2.state, result.output);
317
- return teamsfx_api_1.ok(teamsfx_api_1.Void);
318
- }
319
- else if (result.kind === "partialSuccess") {
320
- ctx.envInfoV2.state = lodash_1.assign(ctx.envInfoV2.state, result.output);
321
- return teamsfx_api_1.err(result.error);
322
- }
323
- else {
324
- return teamsfx_api_1.err(result.error);
325
- }
487
+ if (!ctx || !ctx.solutionV2 || !ctx.contextV2 || !ctx.envInfoV2) {
488
+ return teamsfx_api_1.err(new error_1.ObjectIsUndefinedError("Provision input stuff"));
489
+ }
490
+ const envInfo = ctx.envInfoV2;
491
+ const result = await ctx.solutionV2.provisionResources(ctx.contextV2, inputs, envInfo, this.tools.tokenProvider);
492
+ if (result.kind === "success") {
493
+ ctx.envInfoV2.state = lodash_1.assign(ctx.envInfoV2.state, result.output);
494
+ return teamsfx_api_1.ok(teamsfx_api_1.Void);
495
+ }
496
+ else if (result.kind === "partialSuccess") {
497
+ ctx.envInfoV2.state = lodash_1.assign(ctx.envInfoV2.state, result.output);
498
+ return teamsfx_api_1.err(result.error);
326
499
  }
327
500
  else {
328
- if (!ctx || !ctx.solution || !ctx.solutionContext) {
329
- const name = undefinedName([ctx, ctx === null || ctx === void 0 ? void 0 : ctx.solution, ctx === null || ctx === void 0 ? void 0 : ctx.solutionContext], ["ctx", "ctx.solution", "ctx.solutionContext"]);
330
- return teamsfx_api_1.err(new error_1.ObjectIsUndefinedError(`Provision input stuff: ${name}`));
331
- }
332
- const provisionRes = await ctx.solution.provision(ctx.solutionContext);
333
- if (provisionRes.isErr()) {
334
- return provisionRes;
501
+ return teamsfx_api_1.err(result.error);
502
+ }
503
+ }
504
+ async provisionResourcesV3(inputs, ctx) {
505
+ exports.currentStage = teamsfx_api_1.Stage.provision;
506
+ inputs.stage = teamsfx_api_1.Stage.provision;
507
+ if (ctx &&
508
+ ctx.solutionV3 &&
509
+ ctx.contextV2 &&
510
+ ctx.envInfoV3 &&
511
+ ctx.solutionV3.provisionResources) {
512
+ const res = await ctx.solutionV3.provisionResources(ctx.contextV2, inputs, ctx.envInfoV3, exports.TOOLS.tokenProvider);
513
+ if (res.isOk()) {
514
+ ctx.envInfoV3 = res.value;
335
515
  }
336
- this._setEnvInfoV2(ctx);
337
- return provisionRes;
516
+ return res;
338
517
  }
518
+ return teamsfx_api_1.ok(teamsfx_api_1.Void);
519
+ }
520
+ async deployArtifacts(inputs) {
521
+ if (isV3())
522
+ return this.deployArtifactsV3(inputs);
523
+ else
524
+ return this.deployArtifactsV2(inputs);
339
525
  }
340
- async deployArtifacts(inputs, ctx) {
526
+ async deployArtifactsV2(inputs, ctx) {
341
527
  exports.currentStage = teamsfx_api_1.Stage.deploy;
342
528
  inputs.stage = teamsfx_api_1.Stage.deploy;
343
- if (isV2()) {
344
- if (!ctx || !ctx.solutionV2 || !ctx.contextV2 || !ctx.envInfoV2) {
345
- const name = undefinedName([ctx, ctx === null || ctx === void 0 ? void 0 : ctx.solutionV2, ctx === null || ctx === void 0 ? void 0 : ctx.contextV2, ctx === null || ctx === void 0 ? void 0 : ctx.envInfoV2], ["ctx", "ctx.solutionV2", "ctx.contextV2", "ctx.envInfoV2"]);
346
- return teamsfx_api_1.err(new error_1.ObjectIsUndefinedError(`Deploy input stuff: ${name}`));
347
- }
348
- if (ctx.solutionV2.deploy)
349
- return await ctx.solutionV2.deploy(ctx.contextV2, inputs, ctx.envInfoV2, this.tools.tokenProvider);
350
- else
529
+ if (!ctx || !ctx.solutionV2 || !ctx.contextV2 || !ctx.envInfoV2) {
530
+ const name = undefinedName([ctx, ctx === null || ctx === void 0 ? void 0 : ctx.solutionV2, ctx === null || ctx === void 0 ? void 0 : ctx.contextV2, ctx === null || ctx === void 0 ? void 0 : ctx.envInfoV2], ["ctx", "ctx.solutionV2", "ctx.contextV2", "ctx.envInfoV2"]);
531
+ return teamsfx_api_1.err(new error_1.ObjectIsUndefinedError(`Deploy input stuff: ${name}`));
532
+ }
533
+ if (ctx.solutionV2.deploy)
534
+ return await ctx.solutionV2.deploy(ctx.contextV2, inputs, ctx.envInfoV2, this.tools.tokenProvider);
535
+ else
536
+ return teamsfx_api_1.ok(teamsfx_api_1.Void);
537
+ }
538
+ async deployArtifactsV3(inputs, ctx) {
539
+ exports.currentStage = teamsfx_api_1.Stage.deploy;
540
+ inputs.stage = teamsfx_api_1.Stage.deploy;
541
+ if (ctx && ctx.solutionV3 && ctx.contextV2 && ctx.envInfoV3 && ctx.solutionV3.deploy) {
542
+ const res = await ctx.solutionV3.deploy(ctx.contextV2, inputs, ctx.envInfoV3, exports.TOOLS.tokenProvider);
543
+ return res;
544
+ }
545
+ return teamsfx_api_1.ok(teamsfx_api_1.Void);
546
+ }
547
+ async localDebug(inputs) {
548
+ if (isV3())
549
+ return this.localDebugV3(inputs);
550
+ else
551
+ return this.localDebugV2(inputs);
552
+ }
553
+ async localDebugV2(inputs, ctx) {
554
+ exports.currentStage = teamsfx_api_1.Stage.debug;
555
+ inputs.stage = teamsfx_api_1.Stage.debug;
556
+ if (!ctx || !ctx.solutionV2 || !ctx.contextV2) {
557
+ const name = undefinedName([ctx, ctx === null || ctx === void 0 ? void 0 : ctx.solutionV2, ctx === null || ctx === void 0 ? void 0 : ctx.contextV2], ["ctx", "ctx.solutionV2", "ctx.contextV2"]);
558
+ return teamsfx_api_1.err(new error_1.ObjectIsUndefinedError(`localDebug input stuff (${name})`));
559
+ }
560
+ if (!ctx.localSettings)
561
+ ctx.localSettings = {};
562
+ if (ctx.solutionV2.provisionLocalResource) {
563
+ const res = await ctx.solutionV2.provisionLocalResource(ctx.contextV2, inputs, ctx.localSettings, this.tools.tokenProvider);
564
+ if (res.kind === "success") {
565
+ ctx.localSettings = res.output;
351
566
  return teamsfx_api_1.ok(teamsfx_api_1.Void);
567
+ }
568
+ else if (res.kind === "partialSuccess") {
569
+ ctx.localSettings = res.output;
570
+ return teamsfx_api_1.err(res.error);
571
+ }
572
+ else {
573
+ return teamsfx_api_1.err(res.error);
574
+ }
352
575
  }
353
576
  else {
354
- if (!ctx || !ctx.solution || !ctx.solutionContext) {
355
- const name = undefinedName([ctx, ctx === null || ctx === void 0 ? void 0 : ctx.solution, ctx === null || ctx === void 0 ? void 0 : ctx.solutionContext], ["ctx", "ctx.solution", "ctx.solutionContext"]);
356
- return teamsfx_api_1.err(new error_1.ObjectIsUndefinedError(`Deploy input stuff: ${name}`));
357
- }
358
- return await ctx.solution.deploy(ctx.solutionContext);
577
+ return teamsfx_api_1.ok(teamsfx_api_1.Void);
359
578
  }
360
579
  }
361
- async localDebug(inputs, ctx) {
580
+ async localDebugV3(inputs, ctx) {
362
581
  exports.currentStage = teamsfx_api_1.Stage.debug;
363
582
  inputs.stage = teamsfx_api_1.Stage.debug;
364
- if (isV2()) {
365
- if (tools_1.isMultiEnvEnabled()) {
366
- if (!ctx || !ctx.solutionV2 || !ctx.contextV2) {
367
- const name = undefinedName([ctx, ctx === null || ctx === void 0 ? void 0 : ctx.solutionV2, ctx === null || ctx === void 0 ? void 0 : ctx.contextV2], ["ctx", "ctx.solutionV2", "ctx.contextV2"]);
368
- return teamsfx_api_1.err(new error_1.ObjectIsUndefinedError(`localDebug input stuff (${name})`));
369
- }
370
- if (!ctx.localSettings)
371
- ctx.localSettings = {};
372
- if (ctx.solutionV2.provisionLocalResource) {
373
- const res = await ctx.solutionV2.provisionLocalResource(ctx.contextV2, inputs, ctx.localSettings, this.tools.tokenProvider);
374
- if (res.kind === "success") {
375
- ctx.localSettings = res.output;
376
- return teamsfx_api_1.ok(teamsfx_api_1.Void);
377
- }
378
- else if (res.kind === "partialSuccess") {
379
- ctx.localSettings = res.output;
380
- return teamsfx_api_1.err(res.error);
381
- }
382
- else {
383
- return teamsfx_api_1.err(res.error);
384
- }
385
- }
386
- else {
387
- return teamsfx_api_1.ok(teamsfx_api_1.Void);
388
- }
583
+ if (ctx &&
584
+ ctx.solutionV3 &&
585
+ ctx.contextV2 &&
586
+ ctx.localSettings &&
587
+ ctx.solutionV3.provisionLocalResources) {
588
+ const res = await ctx.solutionV3.provisionLocalResources(ctx.contextV2, inputs, ctx.localSettings, exports.TOOLS.tokenProvider);
589
+ if (res.isOk()) {
590
+ ctx.localSettings = res.value;
389
591
  }
592
+ return res;
390
593
  }
391
- if (!ctx || !ctx.solution || !ctx.solutionContext || !ctx.projectSettings) {
392
- const name = undefinedName([ctx, ctx === null || ctx === void 0 ? void 0 : ctx.solution, ctx === null || ctx === void 0 ? void 0 : ctx.solutionContext, ctx === null || ctx === void 0 ? void 0 : ctx.projectSettings], ["ctx", "ctx.solution", "ctx.solutionContext", "ctx.projectSettings"]);
393
- return teamsfx_api_1.err(new error_1.ObjectIsUndefinedError(`localDebug input stuff (${name})`));
394
- }
395
- envInfoLoader_1.upgradeProgrammingLanguage(ctx.solutionContext.envInfo.state, ctx.projectSettings);
396
- envInfoLoader_1.upgradeDefaultFunctionName(ctx.solutionContext.envInfo.state, ctx.projectSettings);
397
- const res = await ctx.solution.localDebug(ctx.solutionContext);
398
- this._setEnvInfoV2(ctx);
399
- return res;
594
+ return teamsfx_api_1.ok(teamsfx_api_1.Void);
400
595
  }
401
596
  _setEnvInfoV2(ctx) {
402
- if (isV2() && ctx && ctx.solutionContext) {
597
+ if (ctx && ctx.solutionContext) {
403
598
  //workaround, compatible to api v2
404
599
  ctx.envInfoV2 = {
405
600
  envName: ctx.solutionContext.envInfo.envName,
@@ -409,23 +604,33 @@ class FxCore {
409
604
  ctx.envInfoV2.state = tools_1.mapToJson(ctx.solutionContext.envInfo.state);
410
605
  }
411
606
  }
412
- async publishApplication(inputs, ctx) {
607
+ async publishApplication(inputs) {
608
+ if (isV3())
609
+ return this.publishApplicationV3(inputs);
610
+ else
611
+ return this.publishApplicationV2(inputs);
612
+ }
613
+ async publishApplicationV2(inputs, ctx) {
413
614
  exports.currentStage = teamsfx_api_1.Stage.publish;
414
615
  inputs.stage = teamsfx_api_1.Stage.publish;
415
- if (isV2()) {
416
- if (!ctx || !ctx.solutionV2 || !ctx.contextV2 || !ctx.envInfoV2) {
417
- const name = undefinedName([ctx, ctx === null || ctx === void 0 ? void 0 : ctx.solutionV2, ctx === null || ctx === void 0 ? void 0 : ctx.contextV2, ctx === null || ctx === void 0 ? void 0 : ctx.envInfoV2], ["ctx", "ctx.solutionV2", "ctx.contextV2", "ctx.envInfoV2"]);
418
- return teamsfx_api_1.err(new error_1.ObjectIsUndefinedError(`publish input stuff: ${name}`));
419
- }
420
- return await ctx.solutionV2.publishApplication(ctx.contextV2, inputs, ctx.envInfoV2, this.tools.tokenProvider.appStudioToken);
616
+ if (!ctx || !ctx.solutionV2 || !ctx.contextV2 || !ctx.envInfoV2) {
617
+ const name = undefinedName([ctx, ctx === null || ctx === void 0 ? void 0 : ctx.solutionV2, ctx === null || ctx === void 0 ? void 0 : ctx.contextV2, ctx === null || ctx === void 0 ? void 0 : ctx.envInfoV2], ["ctx", "ctx.solutionV2", "ctx.contextV2", "ctx.envInfoV2"]);
618
+ return teamsfx_api_1.err(new error_1.ObjectIsUndefinedError(`publish input stuff: ${name}`));
421
619
  }
422
- else {
423
- if (!ctx || !ctx.solution || !ctx.solutionContext) {
424
- const name = undefinedName([ctx, ctx === null || ctx === void 0 ? void 0 : ctx.solution, ctx === null || ctx === void 0 ? void 0 : ctx.solutionContext], ["ctx", "ctx.solution", "ctx.solutionContext"]);
425
- return teamsfx_api_1.err(new error_1.ObjectIsUndefinedError(`publish input stuff: ${name}`));
426
- }
427
- return await ctx.solution.publish(ctx.solutionContext);
620
+ return await ctx.solutionV2.publishApplication(ctx.contextV2, inputs, ctx.envInfoV2, this.tools.tokenProvider.appStudioToken);
621
+ }
622
+ async publishApplicationV3(inputs, ctx) {
623
+ exports.currentStage = teamsfx_api_1.Stage.publish;
624
+ inputs.stage = teamsfx_api_1.Stage.publish;
625
+ if (ctx &&
626
+ ctx.solutionV3 &&
627
+ ctx.contextV2 &&
628
+ ctx.envInfoV3 &&
629
+ ctx.solutionV3.publishApplication) {
630
+ const res = await ctx.solutionV3.publishApplication(ctx.contextV2, inputs, ctx.envInfoV3, exports.TOOLS.tokenProvider.appStudioToken);
631
+ return res;
428
632
  }
633
+ return teamsfx_api_1.ok(teamsfx_api_1.Void);
429
634
  }
430
635
  async executeUserTask(func, inputs, ctx) {
431
636
  exports.currentStage = teamsfx_api_1.Stage.userTask;
@@ -433,32 +638,20 @@ class FxCore {
433
638
  const namespace = func.namespace;
434
639
  const array = namespace ? namespace.split("/") : [];
435
640
  if ("" !== namespace && array.length > 0) {
436
- if (isV2()) {
437
- if (!ctx || !ctx.solutionV2 || !ctx.envInfoV2) {
438
- const name = undefinedName([ctx, ctx === null || ctx === void 0 ? void 0 : ctx.solutionV2, ctx === null || ctx === void 0 ? void 0 : ctx.envInfoV2], ["ctx", "ctx.solutionV2", "ctx.envInfoV2"]);
439
- return teamsfx_api_1.err(new error_1.ObjectIsUndefinedError(`executeUserTask input stuff: ${name}`));
440
- }
441
- if (!ctx.contextV2)
442
- ctx.contextV2 = createV2Context(this, newProjectSettings());
443
- if (ctx.solutionV2.executeUserTask) {
444
- if (!ctx.localSettings)
445
- ctx.localSettings = {};
446
- const res = await ctx.solutionV2.executeUserTask(ctx.contextV2, inputs, func, ctx.localSettings, ctx.envInfoV2, this.tools.tokenProvider);
447
- return res;
448
- }
449
- else
450
- return teamsfx_api_1.err(error_1.FunctionRouterError(func));
641
+ if (!ctx || !ctx.solutionV2 || !ctx.envInfoV2) {
642
+ const name = undefinedName([ctx, ctx === null || ctx === void 0 ? void 0 : ctx.solutionV2, ctx === null || ctx === void 0 ? void 0 : ctx.envInfoV2], ["ctx", "ctx.solutionV2", "ctx.envInfoV2"]);
643
+ return teamsfx_api_1.err(new error_1.ObjectIsUndefinedError(`executeUserTask input stuff: ${name}`));
451
644
  }
452
- else {
453
- if (!ctx || !ctx.solution)
454
- return teamsfx_api_1.err(new error_1.ObjectIsUndefinedError("executeUserTask input stuff"));
455
- if (!ctx.solutionContext)
456
- ctx.solutionContext = await projectSettingsLoader_1.newSolutionContext(this.tools, inputs);
457
- if (ctx.solution.executeUserTask)
458
- return await ctx.solution.executeUserTask(func, ctx.solutionContext);
459
- else
460
- return teamsfx_api_1.err(error_1.FunctionRouterError(func));
645
+ if (!ctx.contextV2)
646
+ ctx.contextV2 = createV2Context(newProjectSettings());
647
+ if (ctx.solutionV2.executeUserTask) {
648
+ if (!ctx.localSettings)
649
+ ctx.localSettings = {};
650
+ const res = await ctx.solutionV2.executeUserTask(ctx.contextV2, inputs, func, ctx.localSettings, ctx.envInfoV2, this.tools.tokenProvider);
651
+ return res;
461
652
  }
653
+ else
654
+ return teamsfx_api_1.err(error_1.FunctionRouterError(func));
462
655
  }
463
656
  return teamsfx_api_1.err(error_1.FunctionRouterError(func));
464
657
  }
@@ -469,27 +662,16 @@ class FxCore {
469
662
  exports.currentStage = teamsfx_api_1.Stage.getQuestions;
470
663
  if (stage === teamsfx_api_1.Stage.create) {
471
664
  delete inputs.projectPath;
472
- return await this._getQuestionsForCreateProject(inputs);
665
+ return await this._getQuestionsForCreateProjectV2(inputs);
473
666
  }
474
667
  else {
475
- if (isV2()) {
476
- const contextV2 = ctx.contextV2
477
- ? ctx.contextV2
478
- : createV2Context(this, newProjectSettings());
479
- const solutionV2 = ctx.solutionV2 ? ctx.solutionV2 : await SolutionPluginContainer_1.getAllSolutionPluginsV2()[0];
480
- const envInfoV2 = ctx.envInfoV2
481
- ? ctx.envInfoV2
482
- : { envName: __1.environmentManager.getDefaultEnvName(), config: {}, state: {} };
483
- inputs.stage = stage;
484
- return await this._getQuestions(contextV2, solutionV2, stage, inputs, envInfoV2);
485
- }
486
- else {
487
- const solutionContext = ctx.solutionContext
488
- ? ctx.solutionContext
489
- : await projectSettingsLoader_1.newSolutionContext(this.tools, inputs);
490
- const solution = ctx.solution ? ctx.solution : SolutionPluginContainer_1.getAllSolutionPlugins()[0];
491
- return await this._getQuestions(solutionContext, solution, stage, inputs);
492
- }
668
+ const contextV2 = ctx.contextV2 ? ctx.contextV2 : createV2Context(newProjectSettings());
669
+ const solutionV2 = ctx.solutionV2 ? ctx.solutionV2 : await SolutionPluginContainer_1.getAllSolutionPluginsV2()[0];
670
+ const envInfoV2 = ctx.envInfoV2
671
+ ? ctx.envInfoV2
672
+ : { envName: __1.environmentManager.getDefaultEnvName(), config: {}, state: {} };
673
+ inputs.stage = stage;
674
+ return await this._getQuestions(contextV2, solutionV2, stage, inputs, envInfoV2);
493
675
  }
494
676
  }
495
677
  async getQuestionsForUserTask(func, inputs, ctx) {
@@ -497,21 +679,12 @@ class FxCore {
497
679
  return teamsfx_api_1.err(new error_1.ObjectIsUndefinedError("getQuestionsForUserTask input stuff"));
498
680
  inputs.stage = teamsfx_api_1.Stage.getQuestions;
499
681
  exports.currentStage = teamsfx_api_1.Stage.getQuestions;
500
- if (isV2()) {
501
- const contextV2 = ctx.contextV2 ? ctx.contextV2 : createV2Context(this, newProjectSettings());
502
- const solutionV2 = ctx.solutionV2 ? ctx.solutionV2 : await SolutionPluginContainer_1.getAllSolutionPluginsV2()[0];
503
- const envInfoV2 = ctx.envInfoV2
504
- ? ctx.envInfoV2
505
- : { envName: __1.environmentManager.getDefaultEnvName(), config: {}, state: {} };
506
- return await this._getQuestionsForUserTask(contextV2, solutionV2, func, inputs, envInfoV2);
507
- }
508
- else {
509
- const solutionContext = ctx.solutionContext
510
- ? ctx.solutionContext
511
- : await projectSettingsLoader_1.newSolutionContext(this.tools, inputs);
512
- const solution = ctx.solution ? ctx.solution : SolutionPluginContainer_1.getAllSolutionPlugins()[0];
513
- return await this._getQuestionsForUserTask(solutionContext, solution, func, inputs);
514
- }
682
+ const contextV2 = ctx.contextV2 ? ctx.contextV2 : createV2Context(newProjectSettings());
683
+ const solutionV2 = ctx.solutionV2 ? ctx.solutionV2 : await SolutionPluginContainer_1.getAllSolutionPluginsV2()[0];
684
+ const envInfoV2 = ctx.envInfoV2
685
+ ? ctx.envInfoV2
686
+ : { envName: __1.environmentManager.getDefaultEnvName(), config: {}, state: {} };
687
+ return await this._getQuestionsForUserTask(contextV2, solutionV2, func, inputs, envInfoV2);
515
688
  }
516
689
  async getProjectConfig(inputs, ctx) {
517
690
  var _a, _b;
@@ -528,175 +701,56 @@ class FxCore {
528
701
  async grantPermission(inputs, ctx) {
529
702
  exports.currentStage = teamsfx_api_1.Stage.grantPermission;
530
703
  inputs.stage = teamsfx_api_1.Stage.grantPermission;
531
- if (!isV2()) {
532
- return ctx.solution.grantPermission(ctx.solutionContext);
533
- }
534
- else {
535
- const projectPath = inputs.projectPath;
536
- if (!projectPath) {
537
- return teamsfx_api_1.err(new error_1.ObjectIsUndefinedError("projectPath"));
538
- }
539
- return ctx.solutionV2.grantPermission(ctx.contextV2, Object.assign(Object.assign({}, inputs), { projectPath: projectPath }), ctx.envInfoV2, this.tools.tokenProvider);
704
+ const projectPath = inputs.projectPath;
705
+ if (!projectPath) {
706
+ return teamsfx_api_1.err(new error_1.ObjectIsUndefinedError("projectPath"));
540
707
  }
708
+ return ctx.solutionV2.grantPermission(ctx.contextV2, Object.assign(Object.assign({}, inputs), { projectPath: projectPath }), ctx.envInfoV2, this.tools.tokenProvider);
541
709
  }
542
710
  async checkPermission(inputs, ctx) {
543
711
  exports.currentStage = teamsfx_api_1.Stage.checkPermission;
544
712
  inputs.stage = teamsfx_api_1.Stage.checkPermission;
545
- if (!isV2()) {
546
- return ctx.solution.checkPermission(ctx.solutionContext);
547
- }
548
- else {
549
- const projectPath = inputs.projectPath;
550
- if (!projectPath) {
551
- return teamsfx_api_1.err(new error_1.ObjectIsUndefinedError("projectPath"));
552
- }
553
- return ctx.solutionV2.checkPermission(ctx.contextV2, Object.assign(Object.assign({}, inputs), { projectPath: projectPath }), ctx.envInfoV2, this.tools.tokenProvider);
713
+ const projectPath = inputs.projectPath;
714
+ if (!projectPath) {
715
+ return teamsfx_api_1.err(new error_1.ObjectIsUndefinedError("projectPath"));
554
716
  }
717
+ return ctx.solutionV2.checkPermission(ctx.contextV2, Object.assign(Object.assign({}, inputs), { projectPath: projectPath }), ctx.envInfoV2, this.tools.tokenProvider);
555
718
  }
556
719
  async listCollaborator(inputs, ctx) {
557
720
  exports.currentStage = teamsfx_api_1.Stage.listCollaborator;
558
721
  inputs.stage = teamsfx_api_1.Stage.listCollaborator;
559
- if (!isV2()) {
560
- return ctx.solution.listCollaborator(ctx.solutionContext);
561
- }
562
- else {
563
- const projectPath = inputs.projectPath;
564
- if (!projectPath) {
565
- return teamsfx_api_1.err(new error_1.ObjectIsUndefinedError("projectPath"));
566
- }
567
- return ctx.solutionV2.listCollaborator(ctx.contextV2, Object.assign(Object.assign({}, inputs), { projectPath: projectPath }), ctx.envInfoV2, this.tools.tokenProvider);
722
+ const projectPath = inputs.projectPath;
723
+ if (!projectPath) {
724
+ return teamsfx_api_1.err(new error_1.ObjectIsUndefinedError("projectPath"));
568
725
  }
726
+ return ctx.solutionV2.listCollaborator(ctx.contextV2, Object.assign(Object.assign({}, inputs), { projectPath: projectPath }), ctx.envInfoV2, this.tools.tokenProvider);
569
727
  }
570
728
  async listAllCollaborators(inputs, ctx) {
571
729
  exports.currentStage = teamsfx_api_1.Stage.listAllCollaborators;
572
730
  inputs.stage = teamsfx_api_1.Stage.listAllCollaborators;
573
- if (!isV2()) {
574
- return ctx.solution.listAllCollaborators(ctx.solutionContext);
575
- }
576
- else {
577
- const projectPath = inputs.projectPath;
578
- if (!projectPath) {
579
- return teamsfx_api_1.err(new error_1.ObjectIsUndefinedError("projectPath"));
580
- }
581
- return ctx.solutionV2.listAllCollaborators(ctx.contextV2, Object.assign(Object.assign({}, inputs), { projectPath: projectPath }), ctx.envInfoV2, this.tools.tokenProvider);
731
+ const projectPath = inputs.projectPath;
732
+ if (!projectPath) {
733
+ return teamsfx_api_1.err(new error_1.ObjectIsUndefinedError("projectPath"));
582
734
  }
735
+ return ctx.solutionV2.listAllCollaborators(ctx.contextV2, Object.assign(Object.assign({}, inputs), { projectPath: projectPath }), ctx.envInfoV2, this.tools.tokenProvider);
583
736
  }
584
737
  async getSelectedEnv(inputs, ctx) {
585
- var _a, _b;
586
- if (!tools_1.isMultiEnvEnabled()) {
587
- return teamsfx_api_1.err(new error_1.TaskNotSupportError("getSelectedEnv"));
588
- }
589
- if (isV2()) {
590
- return teamsfx_api_1.ok((_a = ctx === null || ctx === void 0 ? void 0 : ctx.envInfoV2) === null || _a === void 0 ? void 0 : _a.envName);
591
- }
592
- else {
593
- return teamsfx_api_1.ok((_b = ctx === null || ctx === void 0 ? void 0 : ctx.solutionContext) === null || _b === void 0 ? void 0 : _b.envInfo.envName);
594
- }
595
- }
596
- async _getQuestionsForUserTask(ctx, solution, func, inputs, envInfo) {
597
- const namespace = func.namespace;
598
- const array = namespace ? namespace.split("/") : [];
599
- if (namespace && "" !== namespace && array.length > 0) {
600
- let res = teamsfx_api_1.ok(undefined);
601
- if (isV2()) {
602
- const solutionV2 = solution;
603
- if (solutionV2.getQuestionsForUserTask) {
604
- res = await solutionV2.getQuestionsForUserTask(ctx, inputs, func, envInfo, this.tools.tokenProvider);
605
- }
606
- }
607
- else {
608
- const solutionv1 = solution;
609
- if (solutionv1.getQuestionsForUserTask) {
610
- res = await solutionv1.getQuestionsForUserTask(func, ctx);
611
- }
612
- }
613
- if (res.isOk()) {
614
- if (res.value) {
615
- const node = res.value.trim();
616
- return teamsfx_api_1.ok(node);
617
- }
618
- }
619
- return res;
620
- }
621
- return teamsfx_api_1.err(error_1.FunctionRouterError(func));
622
- }
623
- async _getQuestionsForMigrateV1Project(inputs) {
624
- const node = new teamsfx_api_1.QTreeNode({ type: "group" });
625
- const globalSolutions = await SolutionPluginContainer_1.getAllSolutionPlugins();
626
- const solutionContext = await projectSettingsLoader_1.newSolutionContext(this.tools, inputs);
627
- for (const v of globalSolutions) {
628
- if (v.getQuestions) {
629
- const res = await v.getQuestions(teamsfx_api_1.Stage.migrateV1, solutionContext);
630
- if (res.isErr())
631
- return res;
632
- if (res.value) {
633
- const solutionNode = res.value;
634
- solutionNode.condition = { equals: v.name };
635
- if (solutionNode.data)
636
- node.addChild(solutionNode);
637
- }
638
- }
639
- }
640
- const defaultAppNameFunc = new teamsfx_api_1.QTreeNode(question_1.DefaultAppNameFunc);
641
- node.addChild(defaultAppNameFunc);
642
- const appNameQuestion = new teamsfx_api_1.QTreeNode(question_1.QuestionV1AppName);
643
- appNameQuestion.condition = {
644
- validFunc: (input) => (!input ? undefined : "App name is auto generated."),
645
- };
646
- defaultAppNameFunc.addChild(appNameQuestion);
647
- return teamsfx_api_1.ok(node.trim());
648
- }
649
- async _getQuestions(ctx, solution, stage, inputs, envInfo) {
650
- if (stage !== teamsfx_api_1.Stage.create) {
651
- let res = teamsfx_api_1.ok(undefined);
652
- if (isV2()) {
653
- const solutionV2 = solution;
654
- if (solutionV2.getQuestions) {
655
- inputs.stage = stage;
656
- res = await solutionV2.getQuestions(ctx, inputs, envInfo, this.tools.tokenProvider);
657
- }
658
- }
659
- else {
660
- res = await solution.getQuestions(stage, ctx);
661
- }
662
- if (res.isErr())
663
- return res;
664
- if (res.value) {
665
- const node = res.value;
666
- if (node.data) {
667
- return teamsfx_api_1.ok(node.trim());
668
- }
669
- }
670
- }
671
- return teamsfx_api_1.ok(undefined);
738
+ var _a;
739
+ return teamsfx_api_1.ok((_a = ctx === null || ctx === void 0 ? void 0 : ctx.envInfoV2) === null || _a === void 0 ? void 0 : _a.envName);
672
740
  }
673
741
  async encrypt(plaintext, inputs, ctx) {
674
742
  if (!ctx)
675
743
  return teamsfx_api_1.err(new error_1.ObjectIsUndefinedError("ctx"));
676
- if (isV2()) {
677
- if (!ctx.contextV2)
678
- return teamsfx_api_1.err(new error_1.ObjectIsUndefinedError("ctx.contextV2"));
679
- return ctx.contextV2.cryptoProvider.encrypt(plaintext);
680
- }
681
- else {
682
- if (!ctx.solutionContext)
683
- return teamsfx_api_1.err(new error_1.ObjectIsUndefinedError("ctx.solutionContext"));
684
- return ctx.solutionContext.cryptoProvider.encrypt(plaintext);
685
- }
744
+ if (!ctx.contextV2)
745
+ return teamsfx_api_1.err(new error_1.ObjectIsUndefinedError("ctx.contextV2"));
746
+ return ctx.contextV2.cryptoProvider.encrypt(plaintext);
686
747
  }
687
748
  async decrypt(ciphertext, inputs, ctx) {
688
749
  if (!ctx)
689
750
  return teamsfx_api_1.err(new error_1.ObjectIsUndefinedError("ctx"));
690
- if (isV2()) {
691
- if (!ctx.contextV2)
692
- return teamsfx_api_1.err(new error_1.ObjectIsUndefinedError("ctx.contextV2"));
693
- return ctx.contextV2.cryptoProvider.decrypt(ciphertext);
694
- }
695
- else {
696
- if (!ctx.solutionContext)
697
- return teamsfx_api_1.err(new error_1.ObjectIsUndefinedError("ctx.solutionContext"));
698
- return ctx.solutionContext.cryptoProvider.decrypt(ciphertext);
699
- }
751
+ if (!ctx.contextV2)
752
+ return teamsfx_api_1.err(new error_1.ObjectIsUndefinedError("ctx.contextV2"));
753
+ return ctx.contextV2.cryptoProvider.decrypt(ciphertext);
700
754
  }
701
755
  async buildArtifacts(inputs) {
702
756
  throw new error_1.TaskNotSupportError(teamsfx_api_1.Stage.build);
@@ -705,7 +759,7 @@ class FxCore {
705
759
  if (!ctx)
706
760
  return teamsfx_api_1.err(new error_1.ObjectIsUndefinedError("createEnv input stuff"));
707
761
  const projectSettings = ctx.projectSettings;
708
- if (!tools_1.isMultiEnvEnabled() || !projectSettings) {
762
+ if (!projectSettings) {
709
763
  return teamsfx_api_1.ok(teamsfx_api_1.Void);
710
764
  }
711
765
  const core = ctx.self;
@@ -721,21 +775,11 @@ class FxCore {
721
775
  }
722
776
  inputs.sourceEnvName = createEnvCopyInput.sourceEnvName;
723
777
  inputs.targetEnvName = createEnvCopyInput.targetEnvName;
724
- if (isV2()) {
725
- if (!ctx.solutionV2 || !ctx.contextV2)
726
- return teamsfx_api_1.err(new error_1.ObjectIsUndefinedError("ctx.solutionV2, ctx.contextV2"));
727
- if (ctx.solutionV2.createEnv) {
728
- inputs.copy = true;
729
- return await ctx.solutionV2.createEnv(ctx.contextV2, inputs);
730
- }
731
- }
732
- else {
733
- if (!ctx.solution || !ctx.solutionContext)
734
- return teamsfx_api_1.err(new error_1.ObjectIsUndefinedError("ctx.solution, ctx.solutionContext"));
735
- if (ctx.solution.createEnv) {
736
- ctx.solutionContext.answers.copy = true;
737
- return await ctx.solution.createEnv(ctx.solutionContext);
738
- }
778
+ if (!ctx.solutionV2 || !ctx.contextV2)
779
+ return teamsfx_api_1.err(new error_1.ObjectIsUndefinedError("ctx.solutionV2, ctx.contextV2"));
780
+ if (ctx.solutionV2.createEnv) {
781
+ inputs.copy = true;
782
+ return await ctx.solutionV2.createEnv(ctx.contextV2, inputs);
739
783
  }
740
784
  return teamsfx_api_1.ok(teamsfx_api_1.Void);
741
785
  }
@@ -759,7 +803,7 @@ class FxCore {
759
803
  catch (e) {
760
804
  return teamsfx_api_1.err(error_1.CopyFileError(e));
761
805
  }
762
- core.tools.logProvider.debug(`[core] copy env config file for ${targetEnvName} environment to path ${targetEnvConfigFilePath}`);
806
+ exports.TOOLS.logProvider.debug(`[core] copy env config file for ${targetEnvName} environment to path ${targetEnvConfigFilePath}`);
763
807
  return teamsfx_api_1.ok(teamsfx_api_1.Void);
764
808
  }
765
809
  // deprecated
@@ -768,7 +812,7 @@ class FxCore {
768
812
  if (!env) {
769
813
  return teamsfx_api_1.err(new error_1.ObjectIsUndefinedError("env"));
770
814
  }
771
- if (!tools_1.isMultiEnvEnabled() || !ctx.projectSettings) {
815
+ if (!ctx.projectSettings) {
772
816
  return teamsfx_api_1.ok(teamsfx_api_1.Void);
773
817
  }
774
818
  const envConfigs = await __1.environmentManager.listEnvConfigs(inputs.projectPath);
@@ -779,73 +823,78 @@ class FxCore {
779
823
  return teamsfx_api_1.err(error_1.NonExistEnvNameError(env));
780
824
  }
781
825
  const core = ctx.self;
782
- const solutionContext = await envInfoLoader_1.loadSolutionContext(core.tools, inputs, ctx.projectSettings, env);
826
+ const solutionContext = await envInfoLoader_1.loadSolutionContext(inputs, ctx.projectSettings, env);
783
827
  if (!solutionContext.isErr()) {
784
- if (isV2()) {
785
- //TODO core should not know the details of envInfo
786
- ctx.provisionInputConfig = solutionContext.value.envInfo.config;
787
- ctx.provisionOutputs = solutionContext.value.envInfo.state;
788
- ctx.envName = solutionContext.value.envInfo.envName;
789
- }
790
- else {
791
- ctx.solutionContext = solutionContext.value;
792
- }
828
+ ctx.provisionInputConfig = solutionContext.value.envInfo.config;
829
+ ctx.provisionOutputs = solutionContext.value.envInfo.state;
830
+ ctx.envName = solutionContext.value.envInfo.envName;
793
831
  }
794
832
  this.tools.ui.showMessage("info", `[${env}] is activated.`, false);
795
833
  return teamsfx_api_1.ok(teamsfx_api_1.Void);
796
834
  }
797
- async _getQuestionsForCreateProject(inputs) {
798
- const node = new teamsfx_api_1.QTreeNode(question_1.getCreateNewOrFromSampleQuestion(inputs.platform));
799
- // create new
800
- const createNew = new teamsfx_api_1.QTreeNode({ type: "group" });
801
- node.addChild(createNew);
802
- createNew.condition = { equals: question_1.ScratchOptionYes.id };
803
- const globalSolutions = isV2()
804
- ? await SolutionPluginContainer_1.getAllSolutionPluginsV2()
805
- : await SolutionPluginContainer_1.getAllSolutionPlugins();
806
- const solutionNames = globalSolutions.map((s) => s.name);
807
- const selectSolution = question_1.QuestionSelectSolution;
808
- selectSolution.staticOptions = solutionNames;
809
- const solutionSelectNode = new teamsfx_api_1.QTreeNode(selectSolution);
810
- createNew.addChild(solutionSelectNode);
811
- const context = isV2()
812
- ? createV2Context(this, newProjectSettings())
813
- : await projectSettingsLoader_1.newSolutionContext(this.tools, inputs);
814
- for (const solutionPlugin of globalSolutions) {
815
- let res = teamsfx_api_1.ok(undefined);
816
- if (isV2()) {
817
- const v2plugin = solutionPlugin;
818
- res = v2plugin.getQuestionsForScaffolding
819
- ? await v2plugin.getQuestionsForScaffolding(context, inputs)
820
- : teamsfx_api_1.ok(undefined);
821
- }
822
- else {
823
- const v1plugin = solutionPlugin;
824
- res = v1plugin.getQuestions
825
- ? await v1plugin.getQuestions(teamsfx_api_1.Stage.create, context)
826
- : teamsfx_api_1.ok(undefined);
827
- }
828
- if (res.isErr())
829
- return res;
830
- if (res.value) {
831
- const solutionNode = res.value;
832
- solutionNode.condition = { equals: solutionPlugin.name };
833
- if (solutionNode.data)
834
- solutionSelectNode.addChild(solutionNode);
835
- }
835
+ async _init(inputs, ctx) {
836
+ if (!ctx) {
837
+ return teamsfx_api_1.err(new error_1.ObjectIsUndefinedError("ctx for createProject"));
838
+ }
839
+ const appName = inputs[question_2.QuestionAppName.name];
840
+ const validateResult = jsonschema.validate(appName, {
841
+ pattern: question_2.ProjectNamePattern,
842
+ });
843
+ if (validateResult.errors && validateResult.errors.length > 0) {
844
+ return teamsfx_api_1.err(error_1.InvalidInputError("invalid app-name", inputs));
836
845
  }
837
- if (inputs.platform !== teamsfx_api_1.Platform.VSCode) {
838
- createNew.addChild(new teamsfx_api_1.QTreeNode(question_1.QuestionRootFolder));
846
+ const projectSettings = newProjectSettings();
847
+ projectSettings.appName = appName;
848
+ ctx.projectSettings = projectSettings;
849
+ if (!inputs.solution) {
850
+ return teamsfx_api_1.err(error_1.InvalidInputError("solution is undefined", inputs));
839
851
  }
840
- createNew.addChild(new teamsfx_api_1.QTreeNode(question_1.QuestionAppName));
841
- // create from sample
842
- const sampleNode = new teamsfx_api_1.QTreeNode(question_1.SampleSelect);
843
- node.addChild(sampleNode);
844
- sampleNode.condition = { equals: question_1.ScratchOptionNo.id };
845
- if (inputs.platform !== teamsfx_api_1.Platform.VSCode) {
846
- sampleNode.addChild(new teamsfx_api_1.QTreeNode(question_1.QuestionRootFolder));
852
+ const createEnvResult = await this.createEnvWithName(__1.environmentManager.getDefaultEnvName(), projectSettings, inputs);
853
+ if (createEnvResult.isErr()) {
854
+ return teamsfx_api_1.err(createEnvResult.error);
855
+ }
856
+ await fs.ensureDir(path.join(inputs.projectPath, `.${teamsfx_api_1.ConfigFolderName}`));
857
+ await fs.ensureDir(path.join(inputs.projectPath, "templates", `${teamsfx_api_1.AppPackageFolderName}`));
858
+ const basicFolderRes = await createBasicFolderStructure(inputs);
859
+ if (basicFolderRes.isErr()) {
860
+ return teamsfx_api_1.err(basicFolderRes.error);
861
+ }
862
+ const solution = typedi_1.Container.get(inputs.solution);
863
+ projectSettings.solutionSettings.name = inputs.solution;
864
+ const context = createV2Context(projectSettings);
865
+ ctx.contextV2 = context;
866
+ ctx.solutionV3 = solution;
867
+ return await solution.init(context, inputs);
868
+ }
869
+ async init(inputs, ctx) {
870
+ return this._init(inputs, ctx);
871
+ }
872
+ async _addModule(inputs, ctx) {
873
+ if (ctx && ctx.solutionV3 && ctx.contextV2) {
874
+ return await ctx.solutionV3.addModule(ctx.contextV2, {}, inputs);
847
875
  }
848
- return teamsfx_api_1.ok(node.trim());
876
+ return teamsfx_api_1.ok(teamsfx_api_1.Void);
877
+ }
878
+ async addModule(inputs, ctx) {
879
+ return this._addModule(inputs, ctx);
880
+ }
881
+ async scaffold(inputs, ctx) {
882
+ return this._scaffold(inputs, ctx);
883
+ }
884
+ async _scaffold(inputs, ctx) {
885
+ if (ctx && ctx.solutionV3 && ctx.contextV2) {
886
+ return await ctx.solutionV3.scaffold(ctx.contextV2, inputs);
887
+ }
888
+ return teamsfx_api_1.ok(teamsfx_api_1.Void);
889
+ }
890
+ async addResource(inputs, ctx) {
891
+ return this._addResource(inputs, ctx);
892
+ }
893
+ async _addResource(inputs, ctx) {
894
+ if (ctx && ctx.solutionV3 && ctx.contextV2) {
895
+ return await ctx.solutionV3.addResource(ctx.contextV2, inputs);
896
+ }
897
+ return teamsfx_api_1.ok(teamsfx_api_1.Void);
849
898
  }
850
899
  }
851
900
  tslib_1.__decorate([
@@ -860,7 +909,20 @@ tslib_1.__decorate([
860
909
  tslib_1.__metadata("design:type", Function),
861
910
  tslib_1.__metadata("design:paramtypes", [Object, Object]),
862
911
  tslib_1.__metadata("design:returntype", Promise)
863
- ], FxCore.prototype, "createProject", null);
912
+ ], FxCore.prototype, "createProjectV2", null);
913
+ tslib_1.__decorate([
914
+ hooks_1.hooks([
915
+ errorHandler_1.ErrorHandlerMW,
916
+ supportV1ConditionHandler_1.SupportV1ConditionMW(true),
917
+ questionModel_1.QuestionModelMW,
918
+ contextInjector_1.ContextInjectorMW,
919
+ projectSettingsWriter_1.ProjectSettingsWriterMW,
920
+ envInfoWriterV3_1.EnvInfoWriterMW_V3(true),
921
+ ]),
922
+ tslib_1.__metadata("design:type", Function),
923
+ tslib_1.__metadata("design:paramtypes", [Object, Object]),
924
+ tslib_1.__metadata("design:returntype", Promise)
925
+ ], FxCore.prototype, "createProjectV3", null);
864
926
  tslib_1.__decorate([
865
927
  hooks_1.hooks([
866
928
  errorHandler_1.ErrorHandlerMW,
@@ -883,7 +945,7 @@ tslib_1.__decorate([
883
945
  projectMigrator_1.ProjectMigratorMW,
884
946
  projectSettingsLoader_1.ProjectSettingsLoaderMW,
885
947
  envInfoLoader_1.EnvInfoLoaderMW(false),
886
- solutionLoader_1.SolutionLoaderMW(),
948
+ solutionLoader_1.SolutionLoaderMW,
887
949
  questionModel_1.QuestionModelMW,
888
950
  contextInjector_1.ContextInjectorMW,
889
951
  projectSettingsWriter_1.ProjectSettingsWriterMW,
@@ -892,7 +954,25 @@ tslib_1.__decorate([
892
954
  tslib_1.__metadata("design:type", Function),
893
955
  tslib_1.__metadata("design:paramtypes", [Object, Object]),
894
956
  tslib_1.__metadata("design:returntype", Promise)
895
- ], FxCore.prototype, "provisionResources", null);
957
+ ], FxCore.prototype, "provisionResourcesV2", null);
958
+ tslib_1.__decorate([
959
+ hooks_1.hooks([
960
+ errorHandler_1.ErrorHandlerMW,
961
+ concurrentLocker_1.ConcurrentLockerMW,
962
+ supportV1ConditionHandler_1.SupportV1ConditionMW(false),
963
+ projectMigrator_1.ProjectMigratorMW,
964
+ projectSettingsLoaderV3_1.ProjectSettingsLoaderMW_V3,
965
+ envInfoLoaderV3_1.EnvInfoLoaderMW_V3(false),
966
+ solutionLoaderV3_1.SolutionLoaderMW_V3,
967
+ questionModel_1.QuestionModelMW,
968
+ contextInjector_1.ContextInjectorMW,
969
+ projectSettingsWriter_1.ProjectSettingsWriterMW,
970
+ envInfoWriterV3_1.EnvInfoWriterMW_V3(),
971
+ ]),
972
+ tslib_1.__metadata("design:type", Function),
973
+ tslib_1.__metadata("design:paramtypes", [Object, Object]),
974
+ tslib_1.__metadata("design:returntype", Promise)
975
+ ], FxCore.prototype, "provisionResourcesV3", null);
896
976
  tslib_1.__decorate([
897
977
  hooks_1.hooks([
898
978
  errorHandler_1.ErrorHandlerMW,
@@ -901,7 +981,7 @@ tslib_1.__decorate([
901
981
  projectMigrator_1.ProjectMigratorMW,
902
982
  projectSettingsLoader_1.ProjectSettingsLoaderMW,
903
983
  envInfoLoader_1.EnvInfoLoaderMW(false),
904
- solutionLoader_1.SolutionLoaderMW(),
984
+ solutionLoader_1.SolutionLoaderMW,
905
985
  questionModel_1.QuestionModelMW,
906
986
  contextInjector_1.ContextInjectorMW,
907
987
  projectSettingsWriter_1.ProjectSettingsWriterMW,
@@ -910,7 +990,25 @@ tslib_1.__decorate([
910
990
  tslib_1.__metadata("design:type", Function),
911
991
  tslib_1.__metadata("design:paramtypes", [Object, Object]),
912
992
  tslib_1.__metadata("design:returntype", Promise)
913
- ], FxCore.prototype, "deployArtifacts", null);
993
+ ], FxCore.prototype, "deployArtifactsV2", null);
994
+ tslib_1.__decorate([
995
+ hooks_1.hooks([
996
+ errorHandler_1.ErrorHandlerMW,
997
+ concurrentLocker_1.ConcurrentLockerMW,
998
+ supportV1ConditionHandler_1.SupportV1ConditionMW(false),
999
+ projectMigrator_1.ProjectMigratorMW,
1000
+ projectSettingsLoaderV3_1.ProjectSettingsLoaderMW_V3,
1001
+ envInfoLoaderV3_1.EnvInfoLoaderMW_V3(false),
1002
+ solutionLoaderV3_1.SolutionLoaderMW_V3,
1003
+ questionModel_1.QuestionModelMW,
1004
+ contextInjector_1.ContextInjectorMW,
1005
+ projectSettingsWriter_1.ProjectSettingsWriterMW,
1006
+ envInfoWriterV3_1.EnvInfoWriterMW_V3(),
1007
+ ]),
1008
+ tslib_1.__metadata("design:type", Function),
1009
+ tslib_1.__metadata("design:paramtypes", [Object, Object]),
1010
+ tslib_1.__metadata("design:returntype", Promise)
1011
+ ], FxCore.prototype, "deployArtifactsV3", null);
914
1012
  tslib_1.__decorate([
915
1013
  hooks_1.hooks([
916
1014
  errorHandler_1.ErrorHandlerMW,
@@ -921,7 +1019,7 @@ tslib_1.__decorate([
921
1019
  projectSettingsLoader_1.ProjectSettingsLoaderMW,
922
1020
  envInfoLoader_1.EnvInfoLoaderMW(true),
923
1021
  localSettingsLoader_1.LocalSettingsLoaderMW,
924
- solutionLoader_1.SolutionLoaderMW(),
1022
+ solutionLoader_1.SolutionLoaderMW,
925
1023
  questionModel_1.QuestionModelMW,
926
1024
  contextInjector_1.ContextInjectorMW,
927
1025
  projectSettingsWriter_1.ProjectSettingsWriterMW,
@@ -931,7 +1029,26 @@ tslib_1.__decorate([
931
1029
  tslib_1.__metadata("design:type", Function),
932
1030
  tslib_1.__metadata("design:paramtypes", [Object, Object]),
933
1031
  tslib_1.__metadata("design:returntype", Promise)
934
- ], FxCore.prototype, "localDebug", null);
1032
+ ], FxCore.prototype, "localDebugV2", null);
1033
+ tslib_1.__decorate([
1034
+ hooks_1.hooks([
1035
+ errorHandler_1.ErrorHandlerMW,
1036
+ concurrentLocker_1.ConcurrentLockerMW,
1037
+ supportV1ConditionHandler_1.SupportV1ConditionMW(true),
1038
+ projectMigrator_1.ProjectMigratorMW,
1039
+ projectUpgrader_1.ProjectUpgraderMW,
1040
+ projectSettingsLoaderV3_1.ProjectSettingsLoaderMW_V3,
1041
+ localSettingsLoader_1.LocalSettingsLoaderMW,
1042
+ solutionLoaderV3_1.SolutionLoaderMW_V3,
1043
+ questionModel_1.QuestionModelMW,
1044
+ contextInjector_1.ContextInjectorMW,
1045
+ projectSettingsWriter_1.ProjectSettingsWriterMW,
1046
+ localSettingsWriter_1.LocalSettingsWriterMW,
1047
+ ]),
1048
+ tslib_1.__metadata("design:type", Function),
1049
+ tslib_1.__metadata("design:paramtypes", [Object, Object]),
1050
+ tslib_1.__metadata("design:returntype", Promise)
1051
+ ], FxCore.prototype, "localDebugV3", null);
935
1052
  tslib_1.__decorate([
936
1053
  hooks_1.hooks([
937
1054
  errorHandler_1.ErrorHandlerMW,
@@ -940,7 +1057,7 @@ tslib_1.__decorate([
940
1057
  projectMigrator_1.ProjectMigratorMW,
941
1058
  projectSettingsLoader_1.ProjectSettingsLoaderMW,
942
1059
  envInfoLoader_1.EnvInfoLoaderMW(false),
943
- solutionLoader_1.SolutionLoaderMW(),
1060
+ solutionLoader_1.SolutionLoaderMW,
944
1061
  questionModel_1.QuestionModelMW,
945
1062
  contextInjector_1.ContextInjectorMW,
946
1063
  projectSettingsWriter_1.ProjectSettingsWriterMW,
@@ -949,7 +1066,25 @@ tslib_1.__decorate([
949
1066
  tslib_1.__metadata("design:type", Function),
950
1067
  tslib_1.__metadata("design:paramtypes", [Object, Object]),
951
1068
  tslib_1.__metadata("design:returntype", Promise)
952
- ], FxCore.prototype, "publishApplication", null);
1069
+ ], FxCore.prototype, "publishApplicationV2", null);
1070
+ tslib_1.__decorate([
1071
+ hooks_1.hooks([
1072
+ errorHandler_1.ErrorHandlerMW,
1073
+ concurrentLocker_1.ConcurrentLockerMW,
1074
+ supportV1ConditionHandler_1.SupportV1ConditionMW(false),
1075
+ projectMigrator_1.ProjectMigratorMW,
1076
+ projectSettingsLoader_1.ProjectSettingsLoaderMW,
1077
+ envInfoLoader_1.EnvInfoLoaderMW(false),
1078
+ solutionLoader_1.SolutionLoaderMW,
1079
+ questionModel_1.QuestionModelMW,
1080
+ contextInjector_1.ContextInjectorMW,
1081
+ projectSettingsWriter_1.ProjectSettingsWriterMW,
1082
+ envInfoWriter_1.EnvInfoWriterMW(),
1083
+ ]),
1084
+ tslib_1.__metadata("design:type", Function),
1085
+ tslib_1.__metadata("design:paramtypes", [Object, Object]),
1086
+ tslib_1.__metadata("design:returntype", Promise)
1087
+ ], FxCore.prototype, "publishApplicationV3", null);
953
1088
  tslib_1.__decorate([
954
1089
  hooks_1.hooks([
955
1090
  errorHandler_1.ErrorHandlerMW,
@@ -959,7 +1094,7 @@ tslib_1.__decorate([
959
1094
  projectSettingsLoader_1.ProjectSettingsLoaderMW,
960
1095
  envInfoLoader_1.EnvInfoLoaderMW(false),
961
1096
  localSettingsLoader_1.LocalSettingsLoaderMW,
962
- solutionLoader_1.SolutionLoaderMW(),
1097
+ solutionLoader_1.SolutionLoaderMW,
963
1098
  questionModel_1.QuestionModelMW,
964
1099
  contextInjector_1.ContextInjectorMW,
965
1100
  projectSettingsWriter_1.ProjectSettingsWriterMW,
@@ -976,7 +1111,7 @@ tslib_1.__decorate([
976
1111
  supportV1ConditionHandler_1.SupportV1ConditionMW(true),
977
1112
  projectSettingsLoader_1.ProjectSettingsLoaderMW,
978
1113
  envInfoLoader_1.EnvInfoLoaderMW(true),
979
- solutionLoader_1.SolutionLoaderMW(),
1114
+ solutionLoader_1.SolutionLoaderMW,
980
1115
  contextInjector_1.ContextInjectorMW,
981
1116
  envInfoWriter_1.EnvInfoWriterMW(),
982
1117
  ]),
@@ -991,7 +1126,7 @@ tslib_1.__decorate([
991
1126
  supportV1ConditionHandler_1.SupportV1ConditionMW(true),
992
1127
  projectSettingsLoader_1.ProjectSettingsLoaderMW,
993
1128
  envInfoLoader_1.EnvInfoLoaderMW(true),
994
- solutionLoader_1.SolutionLoaderMW(),
1129
+ solutionLoader_1.SolutionLoaderMW,
995
1130
  contextInjector_1.ContextInjectorMW,
996
1131
  envInfoWriter_1.EnvInfoWriterMW(),
997
1132
  ]),
@@ -1022,7 +1157,7 @@ tslib_1.__decorate([
1022
1157
  projectMigrator_1.ProjectMigratorMW,
1023
1158
  projectSettingsLoader_1.ProjectSettingsLoaderMW,
1024
1159
  envInfoLoader_1.EnvInfoLoaderMW(false),
1025
- solutionLoader_1.SolutionLoaderMW(),
1160
+ solutionLoader_1.SolutionLoaderMW,
1026
1161
  questionModel_1.QuestionModelMW,
1027
1162
  contextInjector_1.ContextInjectorMW,
1028
1163
  ]),
@@ -1038,7 +1173,7 @@ tslib_1.__decorate([
1038
1173
  projectMigrator_1.ProjectMigratorMW,
1039
1174
  projectSettingsLoader_1.ProjectSettingsLoaderMW,
1040
1175
  envInfoLoader_1.EnvInfoLoaderMW(false),
1041
- solutionLoader_1.SolutionLoaderMW(),
1176
+ solutionLoader_1.SolutionLoaderMW,
1042
1177
  questionModel_1.QuestionModelMW,
1043
1178
  contextInjector_1.ContextInjectorMW,
1044
1179
  ]),
@@ -1054,7 +1189,7 @@ tslib_1.__decorate([
1054
1189
  projectMigrator_1.ProjectMigratorMW,
1055
1190
  projectSettingsLoader_1.ProjectSettingsLoaderMW,
1056
1191
  envInfoLoader_1.EnvInfoLoaderMW(false),
1057
- solutionLoader_1.SolutionLoaderMW(),
1192
+ solutionLoader_1.SolutionLoaderMW,
1058
1193
  questionModel_1.QuestionModelMW,
1059
1194
  contextInjector_1.ContextInjectorMW,
1060
1195
  ]),
@@ -1069,7 +1204,7 @@ tslib_1.__decorate([
1069
1204
  supportV1ConditionHandler_1.SupportV1ConditionMW(true),
1070
1205
  projectSettingsLoader_1.ProjectSettingsLoaderMW,
1071
1206
  envInfoLoader_1.EnvInfoLoaderMW(true),
1072
- solutionLoader_1.SolutionLoaderMW(),
1207
+ solutionLoader_1.SolutionLoaderMW,
1073
1208
  questionModel_1.QuestionModelMW,
1074
1209
  contextInjector_1.ContextInjectorMW,
1075
1210
  ]),
@@ -1121,7 +1256,7 @@ tslib_1.__decorate([
1121
1256
  concurrentLocker_1.ConcurrentLockerMW,
1122
1257
  supportV1ConditionHandler_1.SupportV1ConditionMW(false),
1123
1258
  projectSettingsLoader_1.ProjectSettingsLoaderMW,
1124
- solutionLoader_1.SolutionLoaderMW(),
1259
+ solutionLoader_1.SolutionLoaderMW,
1125
1260
  envInfoLoader_1.EnvInfoLoaderMW(true),
1126
1261
  contextInjector_1.ContextInjectorMW,
1127
1262
  ]),
@@ -1136,7 +1271,7 @@ tslib_1.__decorate([
1136
1271
  supportV1ConditionHandler_1.SupportV1ConditionMW(true),
1137
1272
  projectMigrator_1.ProjectMigratorMW,
1138
1273
  projectSettingsLoader_1.ProjectSettingsLoaderMW,
1139
- solutionLoader_1.SolutionLoaderMW(),
1274
+ solutionLoader_1.SolutionLoaderMW,
1140
1275
  contextInjector_1.ContextInjectorMW,
1141
1276
  projectSettingsWriter_1.ProjectSettingsWriterMW,
1142
1277
  ]),
@@ -1144,39 +1279,84 @@ tslib_1.__decorate([
1144
1279
  tslib_1.__metadata("design:paramtypes", [Object, Object]),
1145
1280
  tslib_1.__metadata("design:returntype", Promise)
1146
1281
  ], FxCore.prototype, "activateEnv", null);
1282
+ tslib_1.__decorate([
1283
+ hooks_1.hooks([errorHandler_1.ErrorHandlerMW, questionModel_1.QuestionModelMW, contextInjector_1.ContextInjectorMW, projectSettingsWriter_1.ProjectSettingsWriterMW]),
1284
+ tslib_1.__metadata("design:type", Function),
1285
+ tslib_1.__metadata("design:paramtypes", [Object, Object]),
1286
+ tslib_1.__metadata("design:returntype", Promise)
1287
+ ], FxCore.prototype, "init", null);
1288
+ tslib_1.__decorate([
1289
+ hooks_1.hooks([
1290
+ errorHandler_1.ErrorHandlerMW,
1291
+ projectSettingsLoaderV3_1.ProjectSettingsLoaderMW_V3,
1292
+ solutionLoaderV3_1.SolutionLoaderMW_V3,
1293
+ questionModel_1.QuestionModelMW,
1294
+ contextInjector_1.ContextInjectorMW,
1295
+ projectSettingsWriter_1.ProjectSettingsWriterMW,
1296
+ ]),
1297
+ tslib_1.__metadata("design:type", Function),
1298
+ tslib_1.__metadata("design:paramtypes", [Object, Object]),
1299
+ tslib_1.__metadata("design:returntype", Promise)
1300
+ ], FxCore.prototype, "addModule", null);
1301
+ tslib_1.__decorate([
1302
+ hooks_1.hooks([
1303
+ errorHandler_1.ErrorHandlerMW,
1304
+ projectSettingsLoaderV3_1.ProjectSettingsLoaderMW_V3,
1305
+ solutionLoaderV3_1.SolutionLoaderMW_V3,
1306
+ questionModel_1.QuestionModelMW,
1307
+ contextInjector_1.ContextInjectorMW,
1308
+ projectSettingsWriter_1.ProjectSettingsWriterMW,
1309
+ ]),
1310
+ tslib_1.__metadata("design:type", Function),
1311
+ tslib_1.__metadata("design:paramtypes", [Object, Object]),
1312
+ tslib_1.__metadata("design:returntype", Promise)
1313
+ ], FxCore.prototype, "scaffold", null);
1314
+ tslib_1.__decorate([
1315
+ hooks_1.hooks([
1316
+ errorHandler_1.ErrorHandlerMW,
1317
+ projectSettingsLoaderV3_1.ProjectSettingsLoaderMW_V3,
1318
+ solutionLoaderV3_1.SolutionLoaderMW_V3,
1319
+ questionModel_1.QuestionModelMW,
1320
+ contextInjector_1.ContextInjectorMW,
1321
+ projectSettingsWriter_1.ProjectSettingsWriterMW,
1322
+ ]),
1323
+ tslib_1.__metadata("design:type", Function),
1324
+ tslib_1.__metadata("design:paramtypes", [Object, Object]),
1325
+ tslib_1.__metadata("design:returntype", Promise)
1326
+ ], FxCore.prototype, "addResource", null);
1147
1327
  exports.FxCore = FxCore;
1148
1328
  async function createBasicFolderStructure(inputs) {
1149
1329
  if (!inputs.projectPath) {
1150
1330
  return teamsfx_api_1.err(new error_1.ObjectIsUndefinedError("projectPath"));
1151
1331
  }
1152
1332
  try {
1153
- const appName = inputs[question_1.QuestionAppName.name];
1154
- await fs.writeFile(path.join(inputs.projectPath, `package.json`), JSON.stringify({
1155
- name: appName,
1156
- version: "0.0.1",
1157
- description: "",
1158
- author: "",
1159
- scripts: {
1160
- test: 'echo "Error: no test specified" && exit 1',
1161
- },
1162
- devDependencies: {
1163
- "@microsoft/teamsfx-cli": "0.*",
1164
- },
1165
- license: "MIT",
1166
- }, null, 4));
1167
- await fs.writeFile(path.join(inputs.projectPath, `.gitignore`), tools_1.isMultiEnvEnabled()
1168
- ? [
1169
- "node_modules",
1170
- `.${teamsfx_api_1.ConfigFolderName}/${teamsfx_api_1.InputConfigsFolderName}/${localSettingsProvider_1.localSettingsFileName}`,
1171
- `.${teamsfx_api_1.ConfigFolderName}/${teamsfx_api_1.StatesFolderName}/*.userdata`,
1172
- ".DS_Store",
1173
- `${teamsfx_api_1.ArchiveFolderName}`,
1174
- `${teamsfx_api_1.ArchiveLogFileName}`,
1175
- ".env.teamsfx.local",
1176
- "subscriptionInfo.json",
1177
- teamsfx_api_1.BuildFolderName,
1178
- ].join("\n")
1179
- : `node_modules\n/.${teamsfx_api_1.ConfigFolderName}/*.env\n/.${teamsfx_api_1.ConfigFolderName}/*.userdata\n.DS_Store\n${teamsfx_api_1.ArchiveFolderName}\n${teamsfx_api_1.ArchiveLogFileName}`);
1333
+ const appName = inputs[question_2.QuestionAppName.name];
1334
+ if (inputs.platform !== teamsfx_api_1.Platform.VS) {
1335
+ await fs.writeFile(path.join(inputs.projectPath, `package.json`), JSON.stringify({
1336
+ name: appName,
1337
+ version: "0.0.1",
1338
+ description: "",
1339
+ author: "",
1340
+ scripts: {
1341
+ test: 'echo "Error: no test specified" && exit 1',
1342
+ },
1343
+ devDependencies: {
1344
+ "@microsoft/teamsfx-cli": "0.*",
1345
+ },
1346
+ license: "MIT",
1347
+ }, null, 4));
1348
+ }
1349
+ await fs.writeFile(path.join(inputs.projectPath, `.gitignore`), [
1350
+ "node_modules",
1351
+ `.${teamsfx_api_1.ConfigFolderName}/${teamsfx_api_1.InputConfigsFolderName}/${localSettingsProvider_1.localSettingsFileName}`,
1352
+ `.${teamsfx_api_1.ConfigFolderName}/${teamsfx_api_1.StatesFolderName}/*.userdata`,
1353
+ ".DS_Store",
1354
+ `${teamsfx_api_1.ArchiveFolderName}`,
1355
+ `${teamsfx_api_1.ArchiveLogFileName}`,
1356
+ ".env.teamsfx.local",
1357
+ "subscriptionInfo.json",
1358
+ teamsfx_api_1.BuildFolderName,
1359
+ ].join("\n"));
1180
1360
  }
1181
1361
  catch (e) {
1182
1362
  return teamsfx_api_1.err(error_1.WriteFileError(e));
@@ -1184,70 +1364,6 @@ async function createBasicFolderStructure(inputs) {
1184
1364
  return teamsfx_api_1.ok(null);
1185
1365
  }
1186
1366
  exports.createBasicFolderStructure = createBasicFolderStructure;
1187
- async function downloadSample(fxCore, inputs, ctx) {
1188
- let fxError;
1189
- const progress = fxCore.tools.ui.createProgressBar("Fetch sample app", 3);
1190
- progress.start();
1191
- const telemetryProperties = {
1192
- [telemetry_1.TelemetryProperty.Success]: telemetry_1.TelemetrySuccess.Yes,
1193
- module: "fx-core",
1194
- };
1195
- try {
1196
- let folder = inputs[question_1.QuestionRootFolder.name];
1197
- if (inputs.platform === teamsfx_api_1.Platform.VSCode) {
1198
- folder = tools_1.getRootDirectory();
1199
- await fs.ensureDir(folder);
1200
- }
1201
- const sampleId = inputs[question_1.CoreQuestionNames.Samples];
1202
- if (!(sampleId && folder)) {
1203
- throw error_1.InvalidInputError(`invalid answer for '${question_1.CoreQuestionNames.Samples}'`, inputs);
1204
- }
1205
- telemetryProperties[telemetry_1.TelemetryProperty.SampleAppName] = sampleId;
1206
- const samples = __1.sampleProvider.SampleCollection.samples.filter((sample) => sample.id.toLowerCase() === sampleId.toLowerCase());
1207
- if (samples.length === 0) {
1208
- throw error_1.InvalidInputError(`invalid sample id: '${sampleId}'`, inputs);
1209
- }
1210
- const sample = samples[0];
1211
- const url = sample.link;
1212
- let sampleAppPath = path.resolve(folder, sampleId);
1213
- if ((await fs.pathExists(sampleAppPath)) && (await fs.readdir(sampleAppPath)).length > 0) {
1214
- let suffix = 1;
1215
- while (await fs.pathExists(sampleAppPath)) {
1216
- sampleAppPath = `${folder}/${sampleId}_${suffix++}`;
1217
- }
1218
- }
1219
- progress.next(`Downloading from ${url}`);
1220
- const fetchRes = await tools_1.fetchCodeZip(url);
1221
- if (fetchRes === undefined) {
1222
- throw new teamsfx_api_1.SystemError("FetchSampleError", "Fetch sample app error: empty zip file", error_1.CoreSource);
1223
- }
1224
- progress.next("Unzipping the sample package");
1225
- await tools_1.saveFilesRecursively(new adm_zip_1.default(fetchRes.data), sampleId, sampleAppPath);
1226
- await tools_1.downloadSampleHook(sampleId, sampleAppPath);
1227
- progress.next("Update project settings");
1228
- const loadInputs = Object.assign(Object.assign({}, inputs), { projectPath: sampleAppPath });
1229
- const projectSettingsRes = await projectSettingsLoader_1.loadProjectSettings(loadInputs, tools_1.isMultiEnvEnabled());
1230
- if (projectSettingsRes.isOk()) {
1231
- const projectSettings = projectSettingsRes.value;
1232
- projectSettings.projectId = inputs.projectId ? inputs.projectId : uuid.v4();
1233
- inputs.projectId = projectSettings.projectId;
1234
- telemetryProperties[telemetry_1.TelemetryProperty.ProjectId] = projectSettings.projectId;
1235
- ctx.projectSettings = projectSettings;
1236
- inputs.projectPath = sampleAppPath;
1237
- }
1238
- progress.end(true);
1239
- telemetry_1.sendTelemetryEvent(telemetry_1.Component.core, telemetry_1.TelemetryEvent.DownloadSample, telemetryProperties);
1240
- return teamsfx_api_1.ok(sampleAppPath);
1241
- }
1242
- catch (e) {
1243
- fxError = teamsfx_api_1.assembleError(e);
1244
- progress.end(false);
1245
- telemetryProperties[telemetry_1.TelemetryProperty.Success] = telemetry_1.TelemetrySuccess.No;
1246
- telemetry_1.sendTelemetryErrorEvent(telemetry_1.Component.core, telemetry_1.TelemetryEvent.DownloadSample, fxError, telemetryProperties);
1247
- return teamsfx_api_1.err(fxError);
1248
- }
1249
- }
1250
- exports.downloadSample = downloadSample;
1251
1367
  function newProjectSettings() {
1252
1368
  const projectSettings = {
1253
1369
  appName: "",
@@ -1260,13 +1376,13 @@ function newProjectSettings() {
1260
1376
  return projectSettings;
1261
1377
  }
1262
1378
  exports.newProjectSettings = newProjectSettings;
1263
- function createV2Context(core, projectSettings) {
1379
+ function createV2Context(projectSettings) {
1264
1380
  const context = {
1265
- userInteraction: core.tools.ui,
1266
- logProvider: core.tools.logProvider,
1267
- telemetryReporter: core.tools.telemetryReporter,
1381
+ userInteraction: exports.TOOLS.ui,
1382
+ logProvider: exports.TOOLS.logProvider,
1383
+ telemetryReporter: exports.TOOLS.telemetryReporter,
1268
1384
  cryptoProvider: new crypto_1.LocalCrypto(projectSettings.projectId),
1269
- permissionRequestProvider: core.tools.permissionRequest,
1385
+ permissionRequestProvider: exports.TOOLS.permissionRequest,
1270
1386
  projectSetting: projectSettings,
1271
1387
  };
1272
1388
  return context;
@@ -1282,12 +1398,10 @@ function undefinedName(objs, names) {
1282
1398
  }
1283
1399
  exports.undefinedName = undefinedName;
1284
1400
  function getProjectSettingsVersion() {
1285
- if (tools_1.isMultiEnvEnabled())
1286
- return "2.0.0";
1287
- else
1288
- return "1.0.0";
1401
+ return "2.0.0";
1289
1402
  }
1290
1403
  exports.getProjectSettingsVersion = getProjectSettingsVersion;
1291
1404
  tslib_1.__exportStar(require("./error"), exports);
1292
1405
  tslib_1.__exportStar(require("./tools"), exports);
1406
+ tslib_1.__exportStar(require("./downloadSample"), exports);
1293
1407
  //# sourceMappingURL=index.js.map