@microsoft/teamsfx-core 1.1.1 → 1.1.2-alpha.30d0724a.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 (447) 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/local/localEnvManager.d.ts +17 -0
  8. package/build/common/local/localEnvManager.d.ts.map +1 -0
  9. package/build/common/local/localEnvManager.js +72 -0
  10. package/build/common/local/localEnvManager.js.map +1 -0
  11. package/build/common/localSettingsProvider.d.ts +3 -3
  12. package/build/common/localSettingsProvider.d.ts.map +1 -1
  13. package/build/common/localSettingsProvider.js +11 -6
  14. package/build/common/localSettingsProvider.js.map +1 -1
  15. package/build/common/samples-config.json +14 -0
  16. package/build/common/tools.d.ts +11 -1
  17. package/build/common/tools.d.ts.map +1 -1
  18. package/build/common/tools.js +23 -10
  19. package/build/common/tools.js.map +1 -1
  20. package/build/core/SolutionPluginContainer.d.ts +2 -1
  21. package/build/core/SolutionPluginContainer.d.ts.map +1 -1
  22. package/build/core/SolutionPluginContainer.js +9 -1
  23. package/build/core/SolutionPluginContainer.js.map +1 -1
  24. package/build/core/environment.d.ts +4 -3
  25. package/build/core/environment.d.ts.map +1 -1
  26. package/build/core/environment.js +37 -7
  27. package/build/core/environment.js.map +1 -1
  28. package/build/core/error.d.ts +2 -1
  29. package/build/core/error.d.ts.map +1 -1
  30. package/build/core/error.js +7 -3
  31. package/build/core/error.js.map +1 -1
  32. package/build/core/index.d.ts +52 -14
  33. package/build/core/index.d.ts.map +1 -1
  34. package/build/core/index.js +699 -485
  35. package/build/core/index.js.map +1 -1
  36. package/build/core/middleware/concurrentLocker.d.ts.map +1 -1
  37. package/build/core/middleware/concurrentLocker.js +23 -12
  38. package/build/core/middleware/concurrentLocker.js.map +1 -1
  39. package/build/core/middleware/envInfoLoader.d.ts +5 -1
  40. package/build/core/middleware/envInfoLoader.d.ts.map +1 -1
  41. package/build/core/middleware/envInfoLoader.js +51 -44
  42. package/build/core/middleware/envInfoLoader.js.map +1 -1
  43. package/build/core/middleware/envInfoLoaderV3.d.ts +3 -0
  44. package/build/core/middleware/envInfoLoaderV3.d.ts.map +1 -0
  45. package/build/core/middleware/envInfoLoaderV3.js +64 -0
  46. package/build/core/middleware/envInfoLoaderV3.js.map +1 -0
  47. package/build/core/middleware/envInfoWriter.js +13 -30
  48. package/build/core/middleware/envInfoWriter.js.map +1 -1
  49. package/build/core/middleware/envInfoWriterV3.d.ts +6 -0
  50. package/build/core/middleware/envInfoWriterV3.d.ts.map +1 -0
  51. package/build/core/middleware/envInfoWriterV3.js +63 -0
  52. package/build/core/middleware/envInfoWriterV3.js.map +1 -0
  53. package/build/core/middleware/errorHandler.d.ts.map +1 -1
  54. package/build/core/middleware/errorHandler.js +3 -5
  55. package/build/core/middleware/errorHandler.js.map +1 -1
  56. package/build/core/middleware/localSettingsLoader.js.map +1 -1
  57. package/build/core/middleware/localSettingsWriter.d.ts.map +1 -1
  58. package/build/core/middleware/localSettingsWriter.js +6 -16
  59. package/build/core/middleware/localSettingsWriter.js.map +1 -1
  60. package/build/core/middleware/projectMigrator.d.ts.map +1 -1
  61. package/build/core/middleware/projectMigrator.js +22 -54
  62. package/build/core/middleware/projectMigrator.js.map +1 -1
  63. package/build/core/middleware/projectSettingsLoader.d.ts.map +1 -1
  64. package/build/core/middleware/projectSettingsLoader.js +2 -4
  65. package/build/core/middleware/projectSettingsLoader.js.map +1 -1
  66. package/build/core/middleware/projectSettingsLoaderV3.d.ts +4 -0
  67. package/build/core/middleware/projectSettingsLoaderV3.d.ts.map +1 -0
  68. package/build/core/middleware/projectSettingsLoaderV3.js +49 -0
  69. package/build/core/middleware/projectSettingsLoaderV3.js.map +1 -0
  70. package/build/core/middleware/projectSettingsWriter.d.ts.map +1 -1
  71. package/build/core/middleware/projectSettingsWriter.js +2 -2
  72. package/build/core/middleware/projectSettingsWriter.js.map +1 -1
  73. package/build/core/middleware/questionModel.d.ts +14 -1
  74. package/build/core/middleware/questionModel.d.ts.map +1 -1
  75. package/build/core/middleware/questionModel.js +319 -23
  76. package/build/core/middleware/questionModel.js.map +1 -1
  77. package/build/core/middleware/solutionLoader.d.ts +3 -2
  78. package/build/core/middleware/solutionLoader.d.ts.map +1 -1
  79. package/build/core/middleware/solutionLoader.js +21 -23
  80. package/build/core/middleware/solutionLoader.js.map +1 -1
  81. package/build/core/middleware/solutionLoaderV3.d.ts +4 -0
  82. package/build/core/middleware/solutionLoaderV3.d.ts.map +1 -0
  83. package/build/core/middleware/solutionLoaderV3.js +19 -0
  84. package/build/core/middleware/solutionLoaderV3.js.map +1 -0
  85. package/build/core/question.d.ts +9 -1
  86. package/build/core/question.d.ts.map +1 -1
  87. package/build/core/question.js +113 -3
  88. package/build/core/question.js.map +1 -1
  89. package/build/core/tools.d.ts +2 -1
  90. package/build/core/tools.d.ts.map +1 -1
  91. package/build/core/tools.js +15 -1
  92. package/build/core/tools.js.map +1 -1
  93. package/build/plugins/resource/aad/plugin.d.ts.map +1 -1
  94. package/build/plugins/resource/aad/plugin.js +1 -10
  95. package/build/plugins/resource/aad/plugin.js.map +1 -1
  96. package/build/plugins/resource/apim/managers/apimManager.d.ts.map +1 -1
  97. package/build/plugins/resource/apim/managers/apimManager.js +5 -7
  98. package/build/plugins/resource/apim/managers/apimManager.js.map +1 -1
  99. package/build/plugins/resource/appstudio/appStudio.d.ts +1 -1
  100. package/build/plugins/resource/appstudio/appStudio.d.ts.map +1 -1
  101. package/build/plugins/resource/appstudio/appStudio.js +106 -85
  102. package/build/plugins/resource/appstudio/appStudio.js.map +1 -1
  103. package/build/plugins/resource/appstudio/constants.d.ts +6 -1
  104. package/build/plugins/resource/appstudio/constants.d.ts.map +1 -1
  105. package/build/plugins/resource/appstudio/constants.js +6 -1
  106. package/build/plugins/resource/appstudio/constants.js.map +1 -1
  107. package/build/plugins/resource/appstudio/errors.d.ts +1 -1
  108. package/build/plugins/resource/appstudio/errors.d.ts.map +1 -1
  109. package/build/plugins/resource/appstudio/errors.js +2 -1
  110. package/build/plugins/resource/appstudio/errors.js.map +1 -1
  111. package/build/plugins/resource/appstudio/index.d.ts.map +1 -1
  112. package/build/plugins/resource/appstudio/index.js +10 -2
  113. package/build/plugins/resource/appstudio/index.js.map +1 -1
  114. package/build/plugins/resource/appstudio/plugin.d.ts +2 -3
  115. package/build/plugins/resource/appstudio/plugin.d.ts.map +1 -1
  116. package/build/plugins/resource/appstudio/plugin.js +93 -119
  117. package/build/plugins/resource/appstudio/plugin.js.map +1 -1
  118. package/build/plugins/resource/bot/index.d.ts.map +1 -1
  119. package/build/plugins/resource/bot/index.js +5 -1
  120. package/build/plugins/resource/bot/index.js.map +1 -1
  121. package/build/plugins/resource/bot/plugin.d.ts.map +1 -1
  122. package/build/plugins/resource/bot/plugin.js +9 -11
  123. package/build/plugins/resource/bot/plugin.js.map +1 -1
  124. package/build/plugins/resource/frontend/constants.d.ts +1 -7
  125. package/build/plugins/resource/frontend/constants.d.ts.map +1 -1
  126. package/build/plugins/resource/frontend/constants.js +2 -9
  127. package/build/plugins/resource/frontend/constants.js.map +1 -1
  128. package/build/plugins/resource/frontend/env.d.ts +21 -0
  129. package/build/plugins/resource/frontend/env.d.ts.map +1 -0
  130. package/build/plugins/resource/frontend/env.js +82 -0
  131. package/build/plugins/resource/frontend/env.js.map +1 -0
  132. package/build/plugins/resource/frontend/ops/deploy.d.ts +2 -1
  133. package/build/plugins/resource/frontend/ops/deploy.d.ts.map +1 -1
  134. package/build/plugins/resource/frontend/ops/deploy.js +2 -2
  135. package/build/plugins/resource/frontend/ops/deploy.js.map +1 -1
  136. package/build/plugins/resource/frontend/plugin.d.ts +2 -0
  137. package/build/plugins/resource/frontend/plugin.d.ts.map +1 -1
  138. package/build/plugins/resource/frontend/plugin.js +28 -16
  139. package/build/plugins/resource/frontend/plugin.js.map +1 -1
  140. package/build/plugins/resource/frontend/utils/environment-utils.d.ts.map +1 -1
  141. package/build/plugins/resource/frontend/utils/environment-utils.js +4 -2
  142. package/build/plugins/resource/frontend/utils/environment-utils.js.map +1 -1
  143. package/build/plugins/resource/frontend/utils.d.ts +6 -1
  144. package/build/plugins/resource/frontend/utils.d.ts.map +1 -1
  145. package/build/plugins/resource/frontend/utils.js +17 -6
  146. package/build/plugins/resource/frontend/utils.js.map +1 -1
  147. package/build/plugins/resource/function/plugin.d.ts.map +1 -1
  148. package/build/plugins/resource/function/plugin.js +7 -9
  149. package/build/plugins/resource/function/plugin.js.map +1 -1
  150. package/build/plugins/resource/function/utils/depsChecker/checker.d.ts +0 -1
  151. package/build/plugins/resource/function/utils/depsChecker/checker.d.ts.map +1 -1
  152. package/build/plugins/resource/function/utils/depsChecker/checker.js +2 -2
  153. package/build/plugins/resource/function/utils/depsChecker/checker.js.map +1 -1
  154. package/build/plugins/resource/function/utils/depsChecker/common.d.ts +2 -2
  155. package/build/plugins/resource/function/utils/depsChecker/common.d.ts.map +1 -1
  156. package/build/plugins/resource/function/utils/depsChecker/common.js +6 -6
  157. package/build/plugins/resource/function/utils/depsChecker/common.js.map +1 -1
  158. package/build/plugins/resource/function/utils/depsChecker/dotnetChecker.d.ts +3 -2
  159. package/build/plugins/resource/function/utils/depsChecker/dotnetChecker.d.ts.map +1 -1
  160. package/build/plugins/resource/function/utils/depsChecker/dotnetChecker.js +3 -2
  161. package/build/plugins/resource/function/utils/depsChecker/dotnetChecker.js.map +1 -1
  162. package/build/plugins/resource/function/utils/depsChecker/funcPluginAdapter.d.ts +0 -1
  163. package/build/plugins/resource/function/utils/depsChecker/funcPluginAdapter.d.ts.map +1 -1
  164. package/build/plugins/resource/function/utils/depsChecker/funcPluginAdapter.js +1 -23
  165. package/build/plugins/resource/function/utils/depsChecker/funcPluginAdapter.js.map +1 -1
  166. package/build/plugins/resource/identity/index.d.ts.map +1 -1
  167. package/build/plugins/resource/identity/index.js +11 -13
  168. package/build/plugins/resource/identity/index.js.map +1 -1
  169. package/build/plugins/resource/keyvault/plugin.d.ts.map +1 -1
  170. package/build/plugins/resource/keyvault/plugin.js +7 -9
  171. package/build/plugins/resource/keyvault/plugin.js.map +1 -1
  172. package/build/plugins/resource/localdebug/certificate.js +3 -3
  173. package/build/plugins/resource/localdebug/certificate.js.map +1 -1
  174. package/build/plugins/resource/localdebug/index.d.ts +0 -1
  175. package/build/plugins/resource/localdebug/index.d.ts.map +1 -1
  176. package/build/plugins/resource/localdebug/index.js +3 -280
  177. package/build/plugins/resource/localdebug/index.js.map +1 -1
  178. package/build/plugins/resource/localdebug/util/error.d.ts.map +1 -1
  179. package/build/plugins/resource/localdebug/util/error.js +1 -1
  180. package/build/plugins/resource/localdebug/util/error.js.map +1 -1
  181. package/build/plugins/resource/localdebug/v2/index.d.ts.map +1 -1
  182. package/build/plugins/resource/localdebug/v2/index.js +34 -1
  183. package/build/plugins/resource/localdebug/v2/index.js.map +1 -1
  184. package/build/plugins/resource/simpleauth/plugin.d.ts.map +1 -1
  185. package/build/plugins/resource/simpleauth/plugin.js +7 -9
  186. package/build/plugins/resource/simpleauth/plugin.js.map +1 -1
  187. package/build/plugins/resource/simpleauth/utils/common.d.ts.map +1 -1
  188. package/build/plugins/resource/simpleauth/utils/common.js +3 -1
  189. package/build/plugins/resource/simpleauth/utils/common.js.map +1 -1
  190. package/build/plugins/resource/sql/config.d.ts +0 -1
  191. package/build/plugins/resource/sql/config.d.ts.map +1 -1
  192. package/build/plugins/resource/sql/config.js +0 -1
  193. package/build/plugins/resource/sql/config.js.map +1 -1
  194. package/build/plugins/resource/sql/constants.d.ts +1 -0
  195. package/build/plugins/resource/sql/constants.d.ts.map +1 -1
  196. package/build/plugins/resource/sql/constants.js +1 -0
  197. package/build/plugins/resource/sql/constants.js.map +1 -1
  198. package/build/plugins/resource/sql/errors.d.ts +1 -0
  199. package/build/plugins/resource/sql/errors.d.ts.map +1 -1
  200. package/build/plugins/resource/sql/errors.js +1 -0
  201. package/build/plugins/resource/sql/errors.js.map +1 -1
  202. package/build/plugins/resource/sql/managementClient.d.ts +3 -1
  203. package/build/plugins/resource/sql/managementClient.d.ts.map +1 -1
  204. package/build/plugins/resource/sql/managementClient.js +11 -2
  205. package/build/plugins/resource/sql/managementClient.js.map +1 -1
  206. package/build/plugins/resource/sql/plugin.d.ts +3 -0
  207. package/build/plugins/resource/sql/plugin.d.ts.map +1 -1
  208. package/build/plugins/resource/sql/plugin.js +37 -27
  209. package/build/plugins/resource/sql/plugin.js.map +1 -1
  210. package/build/plugins/resource/sql/sqlClient.d.ts +1 -1
  211. package/build/plugins/resource/sql/sqlClient.d.ts.map +1 -1
  212. package/build/plugins/resource/sql/sqlClient.js +15 -24
  213. package/build/plugins/resource/sql/sqlClient.js.map +1 -1
  214. package/build/plugins/resource/sql/utils/checkInput.js +2 -2
  215. package/build/plugins/resource/sql/utils/checkInput.js.map +1 -1
  216. package/build/plugins/resource/sql/utils/message.d.ts +0 -1
  217. package/build/plugins/resource/sql/utils/message.d.ts.map +1 -1
  218. package/build/plugins/resource/sql/utils/message.js +0 -1
  219. package/build/plugins/resource/sql/utils/message.js.map +1 -1
  220. package/build/plugins/solution/fx-solution/arm.d.ts +18 -11
  221. package/build/plugins/solution/fx-solution/arm.d.ts.map +1 -1
  222. package/build/plugins/solution/fx-solution/arm.js +387 -120
  223. package/build/plugins/solution/fx-solution/arm.js.map +1 -1
  224. package/build/plugins/solution/fx-solution/commonQuestions.d.ts +13 -2
  225. package/build/plugins/solution/fx-solution/commonQuestions.d.ts.map +1 -1
  226. package/build/plugins/solution/fx-solution/commonQuestions.js +24 -26
  227. package/build/plugins/solution/fx-solution/commonQuestions.js.map +1 -1
  228. package/build/plugins/solution/fx-solution/debug/constants.d.ts +9 -0
  229. package/build/plugins/solution/fx-solution/debug/constants.d.ts.map +1 -0
  230. package/build/plugins/solution/fx-solution/debug/constants.js +16 -0
  231. package/build/plugins/solution/fx-solution/debug/constants.js.map +1 -0
  232. package/build/plugins/solution/fx-solution/debug/error.d.ts +7 -0
  233. package/build/plugins/solution/fx-solution/debug/error.d.ts.map +1 -0
  234. package/build/plugins/solution/fx-solution/debug/error.js +28 -0
  235. package/build/plugins/solution/fx-solution/debug/error.js.map +1 -0
  236. package/build/plugins/solution/fx-solution/debug/provisionLocal.d.ts +3 -0
  237. package/build/plugins/solution/fx-solution/debug/provisionLocal.d.ts.map +1 -0
  238. package/build/plugins/solution/fx-solution/debug/provisionLocal.js +107 -0
  239. package/build/plugins/solution/fx-solution/debug/provisionLocal.js.map +1 -0
  240. package/build/plugins/solution/fx-solution/debug/scaffolding.d.ts +3 -0
  241. package/build/plugins/solution/fx-solution/debug/scaffolding.d.ts.map +1 -0
  242. package/build/plugins/solution/fx-solution/debug/scaffolding.js +153 -0
  243. package/build/plugins/solution/fx-solution/debug/scaffolding.js.map +1 -0
  244. package/build/plugins/{resource/localdebug → solution/fx-solution/debug}/util/codespace.d.ts +0 -0
  245. package/build/plugins/solution/fx-solution/debug/util/codespace.d.ts.map +1 -0
  246. package/build/plugins/{resource/localdebug → solution/fx-solution/debug}/util/codespace.js +0 -0
  247. package/build/plugins/solution/fx-solution/debug/util/codespace.js.map +1 -0
  248. package/build/plugins/solution/fx-solution/debug/util/contextHelper.d.ts +10 -0
  249. package/build/plugins/solution/fx-solution/debug/util/contextHelper.d.ts.map +1 -0
  250. package/build/plugins/solution/fx-solution/debug/util/contextHelper.js +34 -0
  251. package/build/plugins/solution/fx-solution/debug/util/contextHelper.js.map +1 -0
  252. package/build/plugins/{resource/localdebug → solution/fx-solution/debug/util}/launch.d.ts +0 -0
  253. package/build/plugins/solution/fx-solution/debug/util/launch.d.ts.map +1 -0
  254. package/build/plugins/{resource/localdebug → solution/fx-solution/debug/util}/launch.js +1 -1
  255. package/build/plugins/solution/fx-solution/debug/util/launch.js.map +1 -0
  256. package/build/plugins/{resource/localdebug → solution/fx-solution/debug}/util/ngrok.d.ts +0 -0
  257. package/build/plugins/solution/fx-solution/debug/util/ngrok.d.ts.map +1 -0
  258. package/build/plugins/{resource/localdebug → solution/fx-solution/debug}/util/ngrok.js +2 -2
  259. package/build/plugins/solution/fx-solution/debug/util/ngrok.js.map +1 -0
  260. package/build/plugins/solution/fx-solution/debug/util/settings.d.ts +2 -0
  261. package/build/plugins/solution/fx-solution/debug/util/settings.d.ts.map +1 -0
  262. package/build/plugins/solution/fx-solution/debug/util/settings.js +22 -0
  263. package/build/plugins/solution/fx-solution/debug/util/settings.js.map +1 -0
  264. package/build/plugins/{resource/localdebug → solution/fx-solution/debug/util}/tasks.d.ts +0 -0
  265. package/build/plugins/solution/fx-solution/debug/util/tasks.d.ts.map +1 -0
  266. package/build/plugins/{resource/localdebug → solution/fx-solution/debug/util}/tasks.js +6 -6
  267. package/build/plugins/solution/fx-solution/debug/util/tasks.js.map +1 -0
  268. package/build/plugins/solution/fx-solution/debug/util/telemetry.d.ts +27 -0
  269. package/build/plugins/solution/fx-solution/debug/util/telemetry.d.ts.map +1 -0
  270. package/build/plugins/solution/fx-solution/debug/util/telemetry.js +81 -0
  271. package/build/plugins/solution/fx-solution/debug/util/telemetry.js.map +1 -0
  272. package/build/plugins/solution/fx-solution/index.d.ts +1 -0
  273. package/build/plugins/solution/fx-solution/index.d.ts.map +1 -1
  274. package/build/plugins/solution/fx-solution/index.js +1 -0
  275. package/build/plugins/solution/fx-solution/index.js.map +1 -1
  276. package/build/plugins/solution/fx-solution/question.d.ts +2 -2
  277. package/build/plugins/solution/fx-solution/question.d.ts.map +1 -1
  278. package/build/plugins/solution/fx-solution/question.js +2 -32
  279. package/build/plugins/solution/fx-solution/question.js.map +1 -1
  280. package/build/plugins/solution/fx-solution/solution.d.ts.map +1 -1
  281. package/build/plugins/solution/fx-solution/solution.js +9 -5
  282. package/build/plugins/solution/fx-solution/solution.js.map +1 -1
  283. package/build/plugins/solution/fx-solution/utils/depsChecker/bicepChecker.d.ts +2 -2
  284. package/build/plugins/solution/fx-solution/utils/depsChecker/bicepChecker.d.ts.map +1 -1
  285. package/build/plugins/solution/fx-solution/utils/depsChecker/bicepChecker.js +13 -14
  286. package/build/plugins/solution/fx-solution/utils/depsChecker/bicepChecker.js.map +1 -1
  287. package/build/plugins/solution/fx-solution/utils/progressHelper.d.ts +2 -2
  288. package/build/plugins/solution/fx-solution/utils/progressHelper.d.ts.map +1 -1
  289. package/build/plugins/solution/fx-solution/utils/progressHelper.js +4 -4
  290. package/build/plugins/solution/fx-solution/utils/progressHelper.js.map +1 -1
  291. package/build/plugins/solution/fx-solution/v2/constants.d.ts +2 -0
  292. package/build/plugins/solution/fx-solution/v2/constants.d.ts.map +1 -0
  293. package/build/plugins/solution/fx-solution/v2/constants.js +7 -0
  294. package/build/plugins/solution/fx-solution/v2/constants.js.map +1 -0
  295. package/build/plugins/solution/fx-solution/v2/createEnv.d.ts.map +1 -1
  296. package/build/plugins/solution/fx-solution/v2/createEnv.js +1 -1
  297. package/build/plugins/solution/fx-solution/v2/createEnv.js.map +1 -1
  298. package/build/plugins/solution/fx-solution/v2/executeUserTask.d.ts.map +1 -1
  299. package/build/plugins/solution/fx-solution/v2/executeUserTask.js +7 -4
  300. package/build/plugins/solution/fx-solution/v2/executeUserTask.js.map +1 -1
  301. package/build/plugins/solution/fx-solution/v2/getQuestions.d.ts.map +1 -1
  302. package/build/plugins/solution/fx-solution/v2/getQuestions.js +67 -25
  303. package/build/plugins/solution/fx-solution/v2/getQuestions.js.map +1 -1
  304. package/build/plugins/solution/fx-solution/v2/listAllCollaborators.js.map +1 -1
  305. package/build/plugins/solution/fx-solution/v2/provision.d.ts.map +1 -1
  306. package/build/plugins/solution/fx-solution/v2/provision.js +9 -1
  307. package/build/plugins/solution/fx-solution/v2/provision.js.map +1 -1
  308. package/build/plugins/solution/fx-solution/v2/provisionLocal.d.ts.map +1 -1
  309. package/build/plugins/solution/fx-solution/v2/provisionLocal.js +5 -0
  310. package/build/plugins/solution/fx-solution/v2/provisionLocal.js.map +1 -1
  311. package/build/plugins/solution/fx-solution/v2/scaffolding.d.ts.map +1 -1
  312. package/build/plugins/solution/fx-solution/v2/scaffolding.js +5 -0
  313. package/build/plugins/solution/fx-solution/v2/scaffolding.js.map +1 -1
  314. package/build/plugins/solution/fx-solution/v2/solution.d.ts.map +1 -1
  315. package/build/plugins/solution/fx-solution/v2/solution.js +2 -1
  316. package/build/plugins/solution/fx-solution/v2/solution.js.map +1 -1
  317. package/build/plugins/solution/fx-solution/v3/addModule.d.ts +6 -0
  318. package/build/plugins/solution/fx-solution/v3/addModule.d.ts.map +1 -0
  319. package/build/plugins/solution/fx-solution/v3/addModule.js +35 -0
  320. package/build/plugins/solution/fx-solution/v3/addModule.js.map +1 -0
  321. package/build/plugins/solution/fx-solution/v3/addResource.d.ts +37 -0
  322. package/build/plugins/solution/fx-solution/v3/addResource.d.ts.map +1 -0
  323. package/build/plugins/solution/fx-solution/v3/addResource.js +260 -0
  324. package/build/plugins/solution/fx-solution/v3/addResource.js.map +1 -0
  325. package/build/plugins/solution/fx-solution/v3/constants.d.ts +20 -0
  326. package/build/plugins/solution/fx-solution/v3/constants.d.ts.map +1 -0
  327. package/build/plugins/solution/fx-solution/v3/constants.js +25 -0
  328. package/build/plugins/solution/fx-solution/v3/constants.js.map +1 -0
  329. package/build/plugins/solution/fx-solution/v3/deploy.d.ts +6 -0
  330. package/build/plugins/solution/fx-solution/v3/deploy.d.ts.map +1 -0
  331. package/build/plugins/solution/fx-solution/v3/deploy.js +78 -0
  332. package/build/plugins/solution/fx-solution/v3/deploy.js.map +1 -0
  333. package/build/plugins/solution/fx-solution/v3/error.d.ts +11 -0
  334. package/build/plugins/solution/fx-solution/v3/error.d.ts.map +1 -0
  335. package/build/plugins/solution/fx-solution/v3/error.js +23 -0
  336. package/build/plugins/solution/fx-solution/v3/error.js.map +1 -0
  337. package/build/plugins/solution/fx-solution/v3/init.d.ts +4 -0
  338. package/build/plugins/solution/fx-solution/v3/init.d.ts.map +1 -0
  339. package/build/plugins/solution/fx-solution/v3/init.js +35 -0
  340. package/build/plugins/solution/fx-solution/v3/init.js.map +1 -0
  341. package/build/plugins/solution/fx-solution/v3/provision.d.ts +4 -0
  342. package/build/plugins/solution/fx-solution/v3/provision.d.ts.map +1 -0
  343. package/build/plugins/solution/fx-solution/v3/provision.js +124 -0
  344. package/build/plugins/solution/fx-solution/v3/provision.js.map +1 -0
  345. package/build/plugins/solution/fx-solution/v3/provisionLocal.d.ts +4 -0
  346. package/build/plugins/solution/fx-solution/v3/provisionLocal.d.ts.map +1 -0
  347. package/build/plugins/solution/fx-solution/v3/provisionLocal.js +13 -0
  348. package/build/plugins/solution/fx-solution/v3/provisionLocal.js.map +1 -0
  349. package/build/plugins/solution/fx-solution/v3/publish.d.ts +4 -0
  350. package/build/plugins/solution/fx-solution/v3/publish.d.ts.map +1 -0
  351. package/build/plugins/solution/fx-solution/v3/publish.js +15 -0
  352. package/build/plugins/solution/fx-solution/v3/publish.js.map +1 -0
  353. package/build/plugins/solution/fx-solution/v3/questions.d.ts +16 -0
  354. package/build/plugins/solution/fx-solution/v3/questions.d.ts.map +1 -0
  355. package/build/plugins/solution/fx-solution/v3/questions.js +86 -0
  356. package/build/plugins/solution/fx-solution/v3/questions.js.map +1 -0
  357. package/build/plugins/solution/fx-solution/v3/scaffold.d.ts +27 -0
  358. package/build/plugins/solution/fx-solution/v3/scaffold.d.ts.map +1 -0
  359. package/build/plugins/solution/fx-solution/v3/scaffold.js +241 -0
  360. package/build/plugins/solution/fx-solution/v3/scaffold.js.map +1 -0
  361. package/build/plugins/solution/fx-solution/v3/solution.d.ts +32 -0
  362. package/build/plugins/solution/fx-solution/v3/solution.d.ts.map +1 -0
  363. package/build/plugins/solution/fx-solution/v3/solution.js +45 -0
  364. package/build/plugins/solution/fx-solution/v3/solution.js.map +1 -0
  365. package/build/plugins/solution/fx-solution/v3/userTask.d.ts +4 -0
  366. package/build/plugins/solution/fx-solution/v3/userTask.d.ts.map +1 -0
  367. package/build/plugins/solution/fx-solution/v3/userTask.js +15 -0
  368. package/build/plugins/solution/fx-solution/v3/userTask.js.map +1 -0
  369. package/build/plugins/solution/fx-solution/v3/utils.d.ts +3 -0
  370. package/build/plugins/solution/fx-solution/v3/utils.d.ts.map +1 -0
  371. package/build/plugins/solution/fx-solution/v3/utils.js +16 -0
  372. package/build/plugins/solution/fx-solution/v3/utils.js.map +1 -0
  373. package/build/plugins/solution/index.d.ts +1 -0
  374. package/build/plugins/solution/index.d.ts.map +1 -1
  375. package/build/plugins/solution/index.js +1 -0
  376. package/build/plugins/solution/index.js.map +1 -1
  377. package/build/plugins/solution/spfx-solution/constants.d.ts +2 -0
  378. package/build/plugins/solution/spfx-solution/constants.d.ts.map +1 -0
  379. package/build/plugins/solution/spfx-solution/constants.js +7 -0
  380. package/build/plugins/solution/spfx-solution/constants.js.map +1 -0
  381. package/build/plugins/solution/spfx-solution/index.d.ts +2 -0
  382. package/build/plugins/solution/spfx-solution/index.d.ts.map +1 -0
  383. package/build/plugins/solution/spfx-solution/index.js +5 -0
  384. package/build/plugins/solution/spfx-solution/index.js.map +1 -0
  385. package/build/plugins/solution/spfx-solution/init.d.ts +3 -0
  386. package/build/plugins/solution/spfx-solution/init.d.ts.map +1 -0
  387. package/build/plugins/solution/spfx-solution/init.js +20 -0
  388. package/build/plugins/solution/spfx-solution/init.js.map +1 -0
  389. package/build/plugins/solution/spfx-solution/questions.d.ts +6 -0
  390. package/build/plugins/solution/spfx-solution/questions.d.ts.map +1 -0
  391. package/build/plugins/solution/spfx-solution/questions.js +36 -0
  392. package/build/plugins/solution/spfx-solution/questions.js.map +1 -0
  393. package/build/plugins/solution/spfx-solution/scaffolding.d.ts +17 -0
  394. package/build/plugins/solution/spfx-solution/scaffolding.d.ts.map +1 -0
  395. package/build/plugins/solution/spfx-solution/scaffolding.js +29 -0
  396. package/build/plugins/solution/spfx-solution/scaffolding.js.map +1 -0
  397. package/build/plugins/solution/spfx-solution/solution.d.ts +23 -0
  398. package/build/plugins/solution/spfx-solution/solution.d.ts.map +1 -0
  399. package/build/plugins/solution/spfx-solution/solution.js +29 -0
  400. package/build/plugins/solution/spfx-solution/solution.js.map +1 -0
  401. package/package.json +9 -4
  402. package/resource/strings.json +0 -1
  403. package/templates/plugins/resource/apim/bicep/apimConfiguration.bicep +16 -16
  404. package/templates/plugins/resource/apim/bicep/config.template.bicep +1 -1
  405. package/templates/plugins/resource/apim/bicep/provision.template.bicep +1 -1
  406. package/templates/plugins/resource/bot/bicep/botConfiguration.template.bicep +28 -29
  407. package/templates/plugins/resource/bot/bicep/config.template.bicep +1 -1
  408. package/templates/plugins/resource/bot/bicep/provision.template.bicep +2 -2
  409. package/templates/plugins/resource/frontend/bicep/provision.template.bicep +1 -1
  410. package/templates/plugins/resource/function/bicep/config.template.bicep +1 -1
  411. package/templates/plugins/resource/function/bicep/functionConfiguration.template.bicep +33 -31
  412. package/templates/plugins/resource/function/bicep/provision.template.bicep +2 -2
  413. package/templates/plugins/resource/identity/bicep/provision.template.bicep +1 -1
  414. package/templates/plugins/resource/keyvault/bicep/provision.template.bicep +3 -2
  415. package/templates/plugins/resource/simpleauth/bicep/config.template.bicep +1 -1
  416. package/templates/plugins/resource/simpleauth/bicep/provision.template.bicep +2 -2
  417. package/templates/plugins/resource/simpleauth/bicep/simpleAuthConfiguration.template.bicep +20 -24
  418. package/templates/plugins/resource/simpleauth/version.txt +2 -1
  419. package/templates/plugins/resource/sql/bicep/provision.template.bicep +1 -1
  420. package/build/plugins/resource/localdebug/launch.d.ts.map +0 -1
  421. package/build/plugins/resource/localdebug/launch.js.map +0 -1
  422. package/build/plugins/resource/localdebug/legacyPlugin.d.ts +0 -6
  423. package/build/plugins/resource/localdebug/legacyPlugin.d.ts.map +0 -1
  424. package/build/plugins/resource/localdebug/legacyPlugin.js +0 -208
  425. package/build/plugins/resource/localdebug/legacyPlugin.js.map +0 -1
  426. package/build/plugins/resource/localdebug/settings.d.ts +0 -2
  427. package/build/plugins/resource/localdebug/settings.d.ts.map +0 -1
  428. package/build/plugins/resource/localdebug/settings.js +0 -18
  429. package/build/plugins/resource/localdebug/settings.js.map +0 -1
  430. package/build/plugins/resource/localdebug/tasks.d.ts.map +0 -1
  431. package/build/plugins/resource/localdebug/tasks.js.map +0 -1
  432. package/build/plugins/resource/localdebug/util/codespace.d.ts.map +0 -1
  433. package/build/plugins/resource/localdebug/util/codespace.js.map +0 -1
  434. package/build/plugins/resource/localdebug/util/ngrok.d.ts.map +0 -1
  435. package/build/plugins/resource/localdebug/util/ngrok.js.map +0 -1
  436. package/templates/azure/config.bicep +0 -25
  437. package/templates/azure/main.bicep +0 -20
  438. package/templates/azure/provision/azureSql.bicep +0 -39
  439. package/templates/azure/provision/frontendHosting.bicep +0 -23
  440. package/templates/azure/provision/function.bicep +0 -79
  441. package/templates/azure/provision/simpleAuth.bicep +0 -44
  442. package/templates/azure/provision.bicep +0 -58
  443. package/templates/azure/teamsFx/bot.bicep +0 -34
  444. package/templates/azure/teamsFx/function.bicep +0 -71
  445. package/templates/azure/teamsFx/simpleAuth.bicep +0 -40
  446. package/templates/plugins/resource/aad/bicep/param.template.bicep +0 -6
  447. package/templates/plugins/resource/aad/bicep/variables.template.bicep +0 -13
@@ -0,0 +1,64 @@
1
+ "use strict";
2
+ // Copyright (c) Microsoft Corporation.
3
+ // Licensed under the MIT license.
4
+ Object.defineProperty(exports, "__esModule", { value: true });
5
+ exports.EnvInfoLoaderMW_V3 = void 0;
6
+ const teamsfx_api_1 = require("@microsoft/teamsfx-api");
7
+ const __1 = require("..");
8
+ const crypto_1 = require("../crypto");
9
+ const environment_1 = require("../environment");
10
+ const error_1 = require("../error");
11
+ const envInfoLoader_1 = require("./envInfoLoader");
12
+ const projectSettingsLoader_1 = require("./projectSettingsLoader");
13
+ function EnvInfoLoaderMW_V3(skip) {
14
+ return async (ctx, next) => {
15
+ if (projectSettingsLoader_1.shouldIgnored(ctx)) {
16
+ await next();
17
+ return;
18
+ }
19
+ const inputs = ctx.arguments[ctx.arguments.length - 1];
20
+ if (!ctx.projectSettings) {
21
+ ctx.result = teamsfx_api_1.err(error_1.ProjectSettingsUndefinedError());
22
+ return;
23
+ }
24
+ if (!inputs.projectPath) {
25
+ ctx.result = teamsfx_api_1.err(error_1.NoProjectOpenedError());
26
+ return;
27
+ }
28
+ // make sure inputs.env always has value so telemetry can use it.
29
+ const envRes = await envInfoLoader_1.getTargetEnvName(skip, inputs, ctx);
30
+ if (envRes.isErr()) {
31
+ ctx.result = teamsfx_api_1.err(envRes.error);
32
+ return;
33
+ }
34
+ inputs.env = envRes.value;
35
+ const result = await loadEnvInfoV3(inputs, ctx.projectSettings, inputs.env, skip || inputs.ignoreEnvInfo);
36
+ if (result.isErr()) {
37
+ ctx.result = teamsfx_api_1.err(result.error);
38
+ return;
39
+ }
40
+ ctx.envInfoV3 = result.value;
41
+ await next();
42
+ };
43
+ }
44
+ exports.EnvInfoLoaderMW_V3 = EnvInfoLoaderMW_V3;
45
+ async function loadEnvInfoV3(inputs, projectSettings, targetEnvName, ignoreEnvInfo = false) {
46
+ const cryptoProvider = new crypto_1.LocalCrypto(projectSettings.projectId);
47
+ let envInfo;
48
+ // in pre-multi-env case, envInfo is always loaded.
49
+ if (ignoreEnvInfo) {
50
+ envInfo = __1.newEnvInfoV3();
51
+ }
52
+ else {
53
+ // ensure backwards compatibility:
54
+ // project id will be generated for previous TeamsFx project.
55
+ // Decrypting the secrets in *.userdata with generated project id works because secrets doesn't have prefix.
56
+ const envDataResult = await environment_1.environmentManager.loadEnvInfo(inputs.projectPath, cryptoProvider, targetEnvName, true);
57
+ if (envDataResult.isErr()) {
58
+ return teamsfx_api_1.err(envDataResult.error);
59
+ }
60
+ envInfo = envDataResult.value;
61
+ }
62
+ return teamsfx_api_1.ok(envInfo);
63
+ }
64
+ //# sourceMappingURL=envInfoLoaderV3.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"envInfoLoaderV3.js","sourceRoot":"","sources":["../../../src/core/middleware/envInfoLoaderV3.ts"],"names":[],"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,OAAO;SACR;QAED,GAAG,CAAC,SAAS,GAAG,MAAM,CAAC,KAAK,CAAC;QAE7B,MAAM,IAAI,EAAE,CAAC;IACf,CAAC,CAAC;AACJ,CAAC;AAzCD,gDAyCC;AAED,KAAK,UAAU,aAAa,CAC1B,MAAgC,EAChC,eAAgC,EAChC,aAAsB,EACtB,aAAa,GAAG,KAAK;IAErB,MAAM,cAAc,GAAG,IAAI,oBAAW,CAAC,eAAe,CAAC,SAAS,CAAC,CAAC;IAElE,IAAI,OAAqB,CAAC;IAC1B,mDAAmD;IACnD,IAAI,aAAa,EAAE;QACjB,OAAO,GAAG,gBAAY,EAAE,CAAC;KAC1B;SAAM;QACL,kCAAkC;QAClC,6DAA6D;QAC7D,4GAA4G;QAC5G,MAAM,aAAa,GAAG,MAAM,gCAAkB,CAAC,WAAW,CACxD,MAAM,CAAC,WAAW,EAClB,cAAc,EACd,aAAa,EACb,IAAI,CACL,CAAC;QAEF,IAAI,aAAa,CAAC,KAAK,EAAE,EAAE;YACzB,OAAO,iBAAG,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC;SACjC;QACD,OAAO,GAAG,aAAa,CAAC,KAAqB,CAAC;KAC/C;IACD,OAAO,gBAAE,CAAC,OAAO,CAAC,CAAC;AACrB,CAAC"}
@@ -48,37 +48,20 @@ async function writeEnvInfo(ctx, skip) {
48
48
  inputs.ignoreEnvInfo === true ||
49
49
  teamsfx_api_1.StaticPlatforms.includes(inputs.platform))
50
50
  return;
51
- if (__1.isV2()) {
52
- const envInfoV2 = ctx.envInfoV2;
53
- if (!envInfoV2)
54
- return;
55
- const provisionOutputs = envInfoV2.state;
56
- if (provisionOutputs === undefined)
57
- return;
58
- // DO NOT persist local debug plugin config.
59
- if (common_1.isMultiEnvEnabled() && provisionOutputs[constants_1.PluginNames.LDEBUG]) {
60
- delete provisionOutputs[constants_1.PluginNames.LDEBUG];
61
- }
62
- const envState = __1.flattenConfigJson(provisionOutputs);
63
- const envStatePath = await environment_1.environmentManager.writeEnvState(envState, inputs.projectPath, ctx.contextV2.cryptoProvider, envInfoV2.envName);
64
- if (envStatePath.isOk()) {
65
- const core = ctx.self;
66
- core.tools.logProvider.debug(`[core] persist env state: ${envStatePath.value}`);
67
- }
51
+ const envInfoV2 = ctx.envInfoV2;
52
+ if (!envInfoV2)
53
+ return;
54
+ const provisionOutputs = envInfoV2.state;
55
+ if (provisionOutputs === undefined)
56
+ return;
57
+ // DO NOT persist local debug plugin config.
58
+ if (common_1.isMultiEnvEnabled() && provisionOutputs[constants_1.PluginNames.LDEBUG]) {
59
+ delete provisionOutputs[constants_1.PluginNames.LDEBUG];
68
60
  }
69
- else {
70
- const solutionContext = ctx.solutionContext;
71
- if (solutionContext === undefined)
72
- return;
73
- // DO NOT persist local debug plugin config.
74
- if (common_1.isMultiEnvEnabled() && solutionContext.envInfo.state.has(constants_1.PluginNames.LDEBUG)) {
75
- solutionContext.envInfo.state.delete(constants_1.PluginNames.LDEBUG);
76
- }
77
- const envStatePath = await environment_1.environmentManager.writeEnvState(solutionContext.envInfo.state, inputs.projectPath, solutionContext.cryptoProvider, solutionContext.envInfo.envName);
78
- if (envStatePath.isOk()) {
79
- const core = ctx.self;
80
- core.tools.logProvider.debug(`[core] persist env state: ${envStatePath.value}`);
81
- }
61
+ const envState = __1.flattenConfigJson(provisionOutputs);
62
+ const envStatePath = await environment_1.environmentManager.writeEnvState(envState, inputs.projectPath, ctx.contextV2.cryptoProvider, envInfoV2.envName);
63
+ if (envStatePath.isOk()) {
64
+ __1.TOOLS.logProvider.debug(`[core] persist env state: ${envStatePath.value}`);
82
65
  }
83
66
  }
84
67
  //# sourceMappingURL=envInfoWriter.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"envInfoWriter.js","sourceRoot":"","sources":["../../../src/core/middleware/envInfoWriter.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAClC,YAAY,CAAC;;;AAGb,wDAAiE;AACjE,0BAAsE;AACtE,yCAA6D;AAC7D,4EA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6BAA6B,YAAY,CAAC,KAAK,EAAE,CAAC,CAAC;KAC5E;AACH,CAAC"}
@@ -0,0 +1,6 @@
1
+ import { Middleware } from "@feathersjs/hooks";
2
+ /**
3
+ * This middleware will help to persist environment state even if lifecycle task throws Error.
4
+ */
5
+ export declare function EnvInfoWriterMW_V3(skip?: boolean): Middleware;
6
+ //# sourceMappingURL=envInfoWriterV3.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"envInfoWriterV3.d.ts","sourceRoot":"","sources":["../../../src/core/middleware/envInfoWriterV3.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,UAAU,EAAgB,MAAM,mBAAmB,CAAC;AAO7D;;GAEG;AACH,wBAAgB,kBAAkB,CAAC,IAAI,UAAQ,GAAG,UAAU,CAkB3D"}
@@ -0,0 +1,63 @@
1
+ // Copyright (c) Microsoft Corporation.
2
+ // Licensed under the MIT license.
3
+ "use strict";
4
+ Object.defineProperty(exports, "__esModule", { value: true });
5
+ exports.EnvInfoWriterMW_V3 = void 0;
6
+ const teamsfx_api_1 = require("@microsoft/teamsfx-api");
7
+ const __1 = require("..");
8
+ const common_1 = require("../../common");
9
+ const environment_1 = require("../environment");
10
+ const projectSettingsLoader_1 = require("./projectSettingsLoader");
11
+ /**
12
+ * This middleware will help to persist environment state even if lifecycle task throws Error.
13
+ */
14
+ function EnvInfoWriterMW_V3(skip = false) {
15
+ return async (ctx, next) => {
16
+ let error1 = undefined;
17
+ try {
18
+ await next();
19
+ }
20
+ catch (e) {
21
+ if (e["name"] === common_1.getStrings().solution.CancelProvision)
22
+ throw e;
23
+ error1 = e;
24
+ }
25
+ let error2 = undefined;
26
+ try {
27
+ await writeEnvInfo(ctx, skip);
28
+ }
29
+ catch (e) {
30
+ error2 = e;
31
+ }
32
+ if (error1)
33
+ throw error1;
34
+ if (error2)
35
+ throw error2;
36
+ };
37
+ }
38
+ exports.EnvInfoWriterMW_V3 = EnvInfoWriterMW_V3;
39
+ async function writeEnvInfo(ctx, skip) {
40
+ if (projectSettingsLoader_1.shouldIgnored(ctx) || skip) {
41
+ return;
42
+ }
43
+ const lastArg = ctx.arguments[ctx.arguments.length - 1];
44
+ const inputs = lastArg === ctx ? ctx.arguments[ctx.arguments.length - 2] : lastArg;
45
+ if (!inputs.projectPath ||
46
+ inputs.ignoreConfigPersist === true ||
47
+ inputs.ignoreEnvInfo === true ||
48
+ teamsfx_api_1.StaticPlatforms.includes(inputs.platform))
49
+ return;
50
+ if (ctx.contextV2 && ctx.envInfoV3) {
51
+ const envInfoV3 = ctx.envInfoV3;
52
+ if (!envInfoV3)
53
+ return;
54
+ const envState = envInfoV3.state;
55
+ if (envState === undefined)
56
+ return;
57
+ const envStatePath = await environment_1.environmentManager.writeEnvState(envState, inputs.projectPath, ctx.contextV2.cryptoProvider, envInfoV3.envName, true);
58
+ if (envStatePath.isOk()) {
59
+ __1.TOOLS === null || __1.TOOLS === void 0 ? void 0 : __1.TOOLS.logProvider.debug(`[core] persist env state: ${envStatePath.value}`);
60
+ }
61
+ }
62
+ }
63
+ //# sourceMappingURL=envInfoWriterV3.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"envInfoWriterV3.js","sourceRoot":"","sources":["../../../src/core/middleware/envInfoWriterV3.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAClC,YAAY,CAAC;;;AAGb,wDAAiE;AACjE,0BAAoD;AACpD,yCAA0C;AAC1C,gDAAoD;AACpD,mEAAwD;AAExD;;GAEG;AACH,SAAgB,kBAAkB,CAAC,IAAI,GAAG,KAAK;IAC7C,OAAO,KAAK,EAAE,GAAoB,EAAE,IAAkB,EAAE,EAAE;QACxD,IAAI,MAAM,GAAQ,SAAS,CAAC;QAC5B,IAAI;YACF,MAAM,IAAI,EAAE,CAAC;SACd;QAAC,OAAO,CAAC,EAAE;YACV,IAAK,CAAS,CAAC,MAAM,CAAC,KAAK,mBAAU,EAAE,CAAC,QAAQ,CAAC,eAAe;gBAAE,MAAM,CAAC,CA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AClB,GAAG,CAAC,SAAS,CAAC,cAAc,EAC5B,SAAS,CAAC,OAAO,EACjB,IAAI,CACL,CAAC;QACF,IAAI,YAAY,CAAC,IAAI,EAAE,EAAE;YACvB,SAAK,aAAL,SAAK,uBAAL,SAAK,CAAE,WAAW,CAAC,KAAK,CAAC,6BAA6B,YAAY,CAAC,KAAK,EAAE,CAAC,CAAC;SAC7E;KACF;AACH,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"errorHandler.d.ts","sourceRoot":"","sources":["../../../src/core/middleware/errorHandler.ts"],"names":[],"mappings":"AAIA,OAAO,EAA6B,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAI1E;;;GAGG;AACH,eAAO,MAAM,cAAc,EAAE,UAwB5B,CAAC"}
1
+ {"version":3,"file":"errorHandler.d.ts","sourceRoot":"","sources":["../../../src/core/middleware/errorHandler.ts"],"names":[],"mappings":"AAIA,OAAO,EAA6B,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAI1E;;;GAGG;AACH,eAAO,MAAM,cAAc,EAAE,UAsB5B,CAAC"}
@@ -10,17 +10,15 @@ const __1 = require("..");
10
10
  * to catch exceptions and return specific error.
11
11
  */
12
12
  const ErrorHandlerMW = async (ctx, next) => {
13
+ var _a, _b;
13
14
  const core = ctx.self;
14
15
  const inputs = ctx.arguments[ctx.arguments.length - 1];
15
- const logger = core !== undefined && core.tools !== undefined && core.tools.logProvider !== undefined
16
- ? core.tools.logProvider
17
- : undefined;
18
16
  const taskName = `${ctx.method} ${ctx.method === "executeUserTask" ? ctx.arguments[0].method : ""}`;
19
17
  try {
20
- logger === null || logger === void 0 ? void 0 : logger.info(`[core] start task:${taskName}, inputs:${JSON.stringify(inputs)}, API v2: ${__1.isV2()}`);
18
+ (_a = __1.TOOLS === null || __1.TOOLS === void 0 ? void 0 : __1.TOOLS.logProvider) === null || _a === void 0 ? void 0 : _a.info(`[core] start task:${taskName}, inputs:${JSON.stringify(inputs)}, API v3: ${__1.isV3()}`);
21
19
  const time = new Date().getTime();
22
20
  await next();
23
- logger === null || logger === void 0 ? void 0 : logger.info(`[core] finish task:${taskName}, time: ${new Date().getTime() - time} ms`);
21
+ (_b = __1.TOOLS === null || __1.TOOLS === void 0 ? void 0 : __1.TOOLS.logProvider) === null || _b === void 0 ? void 0 : _b.info(`[core] finish task:${taskName}, time: ${new Date().getTime() - time} ms`);
24
22
  }
25
23
  catch (e) {
26
24
  let fxError = teamsfx_api_1.assembleError(e);
@@ -1 +1 @@
1
- {"version":3,"file":"errorHandler.js","sourceRoot":"","sources":["../../../src/core/middleware/errorHandler.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAClC,YAAY,CAAC;;;AAGb,wDAAkG;AAClG,0BAAkC;AAElC;;;GAGG;AACI,MAAM,cAAc,GAAe,KAAK,EAAE,GAAgB,EAAE,IAAkB,EAAE,EAAE;IACvF,MAAM,IAAI,GAAG,GAAG,CAAC,IAAc,CAAC;IAChC,MAAM,MAAM,GAAG,GAAG,CAAC,SAAS,CAAC,GAAG,CAAC,SAAS,CAAC,MAAM,GAAG,CAAC,CAAW,CAAC;IACjE,MAAM,MAAM,GACV,IAAI,KAAK,SAAS,IAAI,IAAI,CAAC,KAAK,KAAK,SAAS,IAAI,IAAI,CAAC,KAAK,CAAC,WAAW,KAAK,SAAS;QACpF,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,WAAW;QACxB,CAAC,CAAC,SAAS,CAAC;IAChB,MAAM,QAAQ,GAAG,GAAG,GAAG,CAAC,MAAM,IAC5B,GAAG,CAAC,MAAM,KAAK,iBAAiB,CAAC,CAAC,CAAE,GAAG,CAAC,SAAS,CAAC,CAAC,CAAU,CAAC,MAAM,CAAC,CAAC,CAAC,EACzE,EAAE,CAAC;IACH,IAAI;QACF,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,IAAI,CACV,qBAAqB,QAAQ,YAAY,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,aAAa,QAAI,EAAE,EAAE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AAC,CAAC;AAElF,KAAK,UAAU,qBAAqB,CAAC,GAAgB;IACnD,MAAM,GAAG,GAAG,GAAG,CAAC,OAAO,CAAC;IACxB,IAAI,CAAC,GAAG;QAAE,OAAO,GAAG,CAAC;IACrB,KAAK,MAAM,GAAG,IAAI,IAAI,EAAE;QACtB,IAAI,GAAG,CAAC,IAAI,CAAC,GAAG,CAAC,KAAK,IAAI,EAAE;YAC1B,MAAM,SAAS,GAAG,IAAI,uBAAS,CAC7B,GAAG,CAAC,IAAI,EACR,GAAG,CAAC,OAAO,EACX,GAAG,CAAC,MAAM,EACV,SAAS,EACT,SAAS,EACT,GAAG,CAAC,UAAU,CACf,CAAC;YACF,SAAS,CAAC,KAAK,GAAG,GAAG,CAAC,KAAK,CAAC;YAC5B,OAAO,SAAS,CAAC;SAClB;KACF;IACD,OAAO,GAAG,CAAC;AACb,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"localSettingsLoader.js","sourceRoot":"","sources":["../../../src/core/middleware/localSettingsLoader.ts"],"names":[],"mappings":";AAAA,uCAAuC;AACvC,kCAAkC;;;;AAGlC,wDAAoF;AACpF,qDAA+B;AAC/B,0BAAoF;AACpF,yCAAiD;AACjD,8EAA2E;AAC3E,4EAA2E;AAC3E,wGAAyG;AACzG,oCAAkD;AAClD,mEAAwD;AAEjD,MAAM,qBAAqB,GAAe,KAAK,EACpD,GAAoB,EACpB,IAAkB,EAClB,EAAE;;IACF,IAAI,CAAC,qCAAa,CAAC,GAAG,CAAC,IAAI,0BAAiB,EAAE,EAAE;QAC9C,MAAM,MAAM,GAAG,GAAG,CAAC,SAAS,CAAC,GAAG,CAAC,SAAS,CAAC,MAAM,GAAG,CAAC,CAAW,CAAC;QACjE,IAAI,CAAC,MAAM,CAAC,WAAW,EAAE;YACvB,GAAG,CAAC,MAAM,GAAG,iBAAG,CAAC,wBAAoB,EAAE,CAAC,CAAC;YACzC,OAAO;SACR;QAED,MAAM,gBAAgB,GAAG,MAAM,EAAE,CAAC,U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aAAa,IAAI,MAAM,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC,MAAM,KAAK,CAAC,EAAE;gBAC7D,kEAAkE;gBAClE,MAAM,GAAG,KAAK,CAAC;aAChB;SACF;QACD,2CAA2C;QAC3C,IAAI,MAAM,EAAE;YACV,GAAG,CAAC,aAAa,GAAG,MAAM,qBAAqB,CAAC,MAAM,CAAC,MAAA,GAAG,CAAC,SAAS,0CAAE,cAAc,CAAC,CAAC;SACvF;aAAM;YACL,GAAG,CAAC,aAAa,GAAG,qBAAqB,CAAC,MAAM,CAAC,WAAW,EAAE,UAAU,EAAE,MAAM,CAAC,CAAC;SACnF;QACD,IAAI,GAAG,CAAC,eAAe,EAAE;YACvB,IAAI,MAAM,EAAE;gBACV,GAAG,CAAC,eAAe,CAAC,aAAa,GAAG,MAAM,qBAAqB,CAAC,IAAI,CAClE,GAAG,CAAC,eAAe,CAAC,cAAc,CACnC,CAAC;aACH;iBAAM;gBACL,GAAG,CAAC,eAAe,CAAC,aAAa,GAAG,qBAAqB,CAAC,IAAI,CAC5D,WAAW,EACX,UAAU,EACV,MAAM,CACP,CAAC;aACH;SACF;KACF;IAED,MAAM,IAAI,EAAE,CAAC;AACf,CAAC,CAAC;AA5DW,QAAA,qBAAqB,yBA4DhC"}
1
+ {"version":3,"file":"localSettingsLoader.js","sourceRoot":"","sources":["../../../src/core/middleware/localSettingsLoader.ts"],"names":[],"mappings":";AAAA,uCAAuC;AACvC,kCAAkC;;;;AAGlC,wDAAoF;AACpF,qDAA+B;AAC/B,0BAA8E;AAC9E,yCAAiD;AACjD,8EAA2E;AAC3E,4EAA2E;AAC3E,wGAAyG;AACzG,oCAAkD;AAClD,mEAAwD;AAEjD,MAAM,qBAAqB,GAAe,KAAK,EACpD,GAAoB,EACpB,IAAkB,EAClB,EAAE;;IACF,IAAI,CAAC,qCAAa,CAAC,GAAG,CAAC,IAAI,0BAAiB,EAAE,EAAE;QAC9C,MAAM,MAAM,GAAG,GAAG,CAAC,SAAS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CAAC,CAAC;QAC5E,IAAI,MAAM,GAAG,MAAM,EAAE,CAAC,UAAU,CAAC,qBAAqB,CAAC,qBAAqB,CAAC,CAAC;QAC9E,IAAI,MAAM,EAAE;YACV,MAAM,aAAa,GAAG,MAAM,EAAE,CAAC,QAAQ,CAAC,qBAAqB,CAAC,qBAAqB,CAAC,CAAC;YACrF,IAAI,CAAC,aAAa,IAAI,MAAM,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC,MAAM,KAAK,CAAC,EAAE;gBAC7D,kEAAkE;gBAClE,MAAM,GAAG,KAAK,CAAC;aAChB;SACF;QACD,2CAA2C;QAC3C,IAAI,MAAM,EAAE;YACV,GAAG,CAAC,aAAa,GAAG,MAAM,qBAAqB,CAAC,MAAM,CAAC,MAAA,GAAG,CAAC,SAAS,0CAAE,cAAc,CAAC,CAAC;SACvF;aAAM;YACL,GAAG,CAAC,aAAa,GAAG,qBAAqB,CAAC,MAAM,CAAC,WAAW,EAAE,UAAU,EAAE,MAAM,CAAC,CAAC;SACnF;QACD,IAAI,GAAG,CAAC,eAAe,EAAE;YACvB,IAAI,MAAM,EAAE;gBACV,GAAG,CAAC,eAAe,CAAC,aAAa,GAAG,MAAM,qBAAqB,CAAC,IAAI,CAClE,GAAG,CAAC,eAAe,CAAC,cAAc,CACnC,CAAC;aACH;iBAAM;gBACL,GAAG,CAAC,eAAe,CAAC,aAAa,GAAG,qBAAqB,CAAC,IAAI,CAC5D,WAAW,EACX,UAAU,EACV,MAAM,CACP,CAAC;aACH;SACF;KACF;IAED,MAAM,IAAI,EAAE,CAAC;AACf,CAAC,CAAC;AA5DW,QAAA,qBAAqB,yBA4DhC"}
@@ -1 +1 @@
1
- {"version":3,"file":"localSettingsWriter.d.ts","sourceRoot":"","sources":["../../../src/core/middleware/localSettingsWriter.ts"],"names":[],"mappings":"AAIA,OAAO,EAAgB,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAO7D;;GAEG;AACH,eAAO,MAAM,qBAAqB,EAAE,UAoCnC,CAAC"}
1
+ {"version":3,"file":"localSettingsWriter.d.ts","sourceRoot":"","sources":["../../../src/core/middleware/localSettingsWriter.ts"],"names":[],"mappings":"AAIA,OAAO,EAAgB,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAO7D;;GAEG;AACH,eAAO,MAAM,qBAAqB,EAAE,UAyBnC,CAAC"}
@@ -12,7 +12,7 @@ const projectSettingsLoader_1 = require("./projectSettingsLoader");
12
12
  * This middleware will help to persist local settings if necessary.
13
13
  */
14
14
  const LocalSettingsWriterMW = async (ctx, next) => {
15
- var _a, _b;
15
+ var _a;
16
16
  await next();
17
17
  if (!projectSettingsLoader_1.shouldIgnored(ctx) && common_1.isMultiEnvEnabled()) {
18
18
  const lastArg = ctx.arguments[ctx.arguments.length - 1];
@@ -22,21 +22,11 @@ const LocalSettingsWriterMW = async (ctx, next) => {
22
22
  teamsfx_api_1.StaticPlatforms.includes(inputs.platform))
23
23
  return;
24
24
  const localSettingsProvider = new localSettingsProvider_1.LocalSettingsProvider(inputs.projectPath);
25
- if (__1.isV2()) {
26
- if (ctx.localSettings === undefined)
27
- return;
28
- // persistent localSettings.json.
29
- await localSettingsProvider.saveJson(ctx.localSettings, (_a = ctx.contextV2) === null || _a === void 0 ? void 0 : _a.cryptoProvider);
30
- }
31
- else {
32
- const solutionContext = ctx.solutionContext;
33
- if (solutionContext === undefined || solutionContext.localSettings === undefined)
34
- return;
35
- // persistent localSettings.json.
36
- await localSettingsProvider.save(solutionContext.localSettings, (_b = ctx.solutionContext) === null || _b === void 0 ? void 0 : _b.cryptoProvider);
37
- }
38
- const core = ctx.self;
39
- core.tools.logProvider.debug(`[core] persist local settings config file: ${localSettingsProvider.localSettingsFilePath}`);
25
+ if (ctx.localSettings === undefined)
26
+ return;
27
+ // persistent localSettings.json.
28
+ await localSettingsProvider.saveJson(ctx.localSettings, (_a = ctx.contextV2) === null || _a === void 0 ? void 0 : _a.cryptoProvider);
29
+ __1.TOOLS.logProvider.debug(`[core] persist local settings config file: ${localSettingsProvider.localSettingsFilePath}`);
40
30
  }
41
31
  };
42
32
  exports.LocalSettingsWriterMW = LocalSettingsWriterMW;
@@ -1 +1 @@
1
- {"version":3,"file":"localSettingsWriter.js","sourceRoot":"","sources":["../../../src/core/middleware/localSettingsWriter.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAClC,YAAY,CAAC;;;AAGb,wDAAiE;AACjE,0BAAmD;AACnD,yCAAiD;AACjD,8EAA2E;AAC3E,mEAAwD;AAExD;;GAEG;AACI,MAAM,qBAAqB,GAAe,KAAK,EACpD,GAAoB,EACpB,IAAkB,EAClB,EAAE;;IACF,MAAM,IAAI,EAAE,CAAC;IACb,IAAI,CAAC,qCAAa,CAAC,GAAG,CAAC,IAAI,0BAAiB,EAAE,EAAE;QAC9C,MAAM,OAAO,GAAG,GAAG,CAAC,SAAS,CAAC,GAAG,CAAC,SAAS,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC;QACxD,MAAM,MAAM,GAAW,OAAO,KAAK,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC,SAAS,CAAC,GAAG,CAAC,SAAS,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC;QAC3F,IACE,CAAC,MAAM,CAAC,WAAW;YACnB,MAAM,CAAC,mBAAmB,KAAK,IAAI;YACnC,6BAAe,CAAC,QAAQ,CAAC,MAAM,CAAC,QAAQ,CAAC;YAEzC,OAAO;QAET,MAAM,qBAAqB,GAAG,IAAI,6CAAqB,CAAC,MAAM,CAAC,WAAW,CAAC,CAAC;QAE5E,IAAI,QAAI,EAAE,EAAE;YACV,IAAI,GAAG,CAAC,aAAa,KAAK,SAAS;gBAAE,OAAO;YAC5C,iCAAiC;YACjC,MAAM,qBAAqB,CAAC,QAAQ,CAAC,GAAG,CAAC,aAAa,EAAE,MAAA,GAAG,CAAC,SAAS,0CAAE,cAAc,CAAC,CAAC;SACxF;aAAM;YACL,MAAM,eAAe,GAAG,GAAG,CAAC,eAAe,CAAC;YAC5C,IAAI,eAAe,KAAK,SAAS,IAAI,eAAe,CAAC,aAAa,KAAK,SAAS;gBAAE,OAAO;YACzF,iCAAiC;YACjC,MAAM,qBAAqB,CAAC,IAAI,CAC9B,eAAe,CAAC,aAAa,EAC7B,MAAA,GAAG,CAAC,eAAe,0CAAE,cAAc,CACpC,CAAC;SACH;QAED,MAAM,IAAI,GAAG,GAAG,CAAC,IAAc,CAAC;QAChC,IAAI,CAAC,KAAK,CAAC,WAAW,CAAC,KAAK,CAC1B,8CAA8C,qBAAqB,CAAC,qBAAqB,EAAE,CAC5F,CAAC;KACH;AACH,CAAC,CAAC;AApCW,QAAA,qBAAqB,yBAoChC"}
1
+ {"version":3,"file":"localSettingsWriter.js","sourceRoot":"","sources":["../../../src/core/middleware/localSettingsWriter.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAClC,YAAY,CAAC;;;AAGb,wDAAiE;AACjE,0BAA4C;AAC5C,yCAAiD;AACjD,8EAA2E;AAC3E,mEAAwD;AAExD;;GAEG;AACI,MAAM,qBAAqB,GAAe,KAAK,EACpD,GAAoB,EACpB,IAAkB,EAClB,EAAE;;IACF,MAAM,IAAI,EAAE,CAAC;IACb,IAAI,CAAC,qCAAa,CAAC,GAAG,CAAC,IAAI,0BAAiB,EAAE,EAAE;QAC9C,MAAM,OAAO,GAAG,GAAG,CAAC,SAAS,CAAC,GAAG,CAAC,SAAS,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC;QACxD,MAAM,MAAM,GAAW,OAAO,KAAK,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC,SAAS,CAAC,GAAG,CAAC,SAAS,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC;QAC3F,IACE,CAAC,MAAM,CAAC,WAAW;YACnB,MAAM,CAAC,mBAAmB,KAAK,IAAI;YACnC,6BAAe,CAAC,QAAQ,CAAC,MAAM,CAAC,QAAQ,CA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
  const ChangeLogsFlag = "openUpgradeChangelogs";
48
48
  const AADClientSecretFlag = "NeedToSetAADClientSecretEnv";
49
49
  const gitignoreFileName = ".gitignore";
50
- let updateNotificationFlag = false;
51
50
  let fromReloadFlag = false;
52
51
  class EnvConfigName {
53
52
  }
@@ -104,7 +103,7 @@ const ProjectMigratorMW = async (ctx, next) => {
104
103
  }
105
104
  const core = ctx.self;
106
105
  telemetry_1.sendTelemetryEvent(telemetry_1.Component.core, telemetry_1.TelemetryEvent.ProjectMigratorNotificationStart);
107
- const res = await core.tools.ui.showMessage("warn", tools_1.getStrings().solution.MigrationToArmAndMultiEnvMessage, true, upgradeButton);
106
+ const res = await (__2.TOOLS === null || __2.TOOLS === void 0 ? void 0 : __2.TOOLS.ui.showMessage("warn", tools_1.getStrings().solution.MigrationToArmAndMultiEnvMessage, true, upgradeButton));
108
107
  const answer = (res === null || res === void 0 ? void 0 : res.isOk()) ? res.value : undefined;
109
108
  if (!answer || answer != upgradeButton) {
110
109
  telemetry_1.sendTelemetryEvent(telemetry_1.Component.core, telemetry_1.TelemetryEvent.ProjectMigratorNotification, {
@@ -129,13 +128,6 @@ const ProjectMigratorMW = async (ctx, next) => {
129
128
  throw error;
130
129
  }
131
130
  }
132
- else if ((await needUpdateTeamsToolkitVersion(ctx)) && !updateNotificationFlag) {
133
- // TODO: delete before Arm && Multi-env version released
134
- // only for arm && multi-env project with unreleased teams toolkit version
135
- updateNotificationFlag = true;
136
- const core = ctx.self;
137
- core.tools.ui.showMessage("info", tools_1.getStrings().solution.NeedToUpdateTeamsToolkitVersionMessage, false, "OK");
138
- }
139
131
  else {
140
132
  // continue next step only when:
141
133
  // 1. no need to upgrade the project;
@@ -146,15 +138,15 @@ const ProjectMigratorMW = async (ctx, next) => {
146
138
  exports.ProjectMigratorMW = ProjectMigratorMW;
147
139
  function outputCancelMessage(ctx) {
148
140
  const core = ctx.self;
149
- core.tools.logProvider.warning(`[core] Upgrade cancelled.`);
141
+ __2.TOOLS === null || __2.TOOLS === void 0 ? void 0 : __2.TOOLS.logProvider.warning(`[core] Upgrade cancelled.`);
150
142
  const inputs = ctx.arguments[ctx.arguments.length - 1];
151
143
  if (inputs.platform === teamsfx_api_1.Platform.VSCode) {
152
- core.tools.logProvider.warning(`[core] Notice upgrade to new configuration files is a must-have to continue to use current version Teams Toolkit. If you want to upgrade, please run command (Teams: Upgrade project) or click the “Upgrade project” button on tree view to trigger the upgrade.`);
153
- core.tools.logProvider.warning(`[core]If you are not ready to upgrade and want to continue to use the old version Teams Toolkit, please find Teams Toolkit in Extension and install the version <= 2.10.0`);
144
+ __2.TOOLS === null || __2.TOOLS === void 0 ? void 0 : __2.TOOLS.logProvider.warning(`[core] Notice upgrade to new configuration files is a must-have to continue to use current version Teams Toolkit. If you want to upgrade, please run command (Teams: Upgrade project) or click the “Upgrade project” button on tree view to trigger the upgrade.`);
145
+ __2.TOOLS === null || __2.TOOLS === void 0 ? void 0 : __2.TOOLS.logProvider.warning(`[core]If you are not ready to upgrade and want to continue to use the old version Teams Toolkit, please find Teams Toolkit in Extension and install the version <= 2.10.0`);
154
146
  }
155
147
  else {
156
- core.tools.logProvider.warning(`[core] Notice upgrade to new configuration files is a must-have to continue to use current version Teams Toolkit CLI. If you want to upgrade, please trigger this command again.`);
157
- core.tools.logProvider.warning(`[core]If you are not ready to upgrade and want to continue to use the old version Teams Toolkit CLI, please install the version <= 2.10.0`);
148
+ __2.TOOLS === null || __2.TOOLS === void 0 ? void 0 : __2.TOOLS.logProvider.warning(`[core] Notice upgrade to new configuration files is a must-have to continue to use current version Teams Toolkit CLI. If you want to upgrade, please trigger this command again.`);
149
+ __2.TOOLS === null || __2.TOOLS === void 0 ? void 0 : __2.TOOLS.logProvider.warning(`[core]If you are not ready to upgrade and want to continue to use the old version Teams Toolkit CLI, please install the version <= 2.10.0`);
158
150
  }
159
151
  }
160
152
  function checkMethod(ctx) {
@@ -227,7 +219,7 @@ async function migrateToArmAndMultiEnv(ctx) {
227
219
  await backup(projectPath, backupFolder);
228
220
  await updateConfig(ctx);
229
221
  telemetry_1.sendTelemetryEvent(telemetry_1.Component.core, telemetry_1.TelemetryEvent.ProjectMigratorMigrateMultiEnvStart);
230
- await migrateMultiEnv(projectPath, core.tools.logProvider);
222
+ await migrateMultiEnv(projectPath, __2.TOOLS.logProvider);
231
223
  telemetry_1.sendTelemetryEvent(telemetry_1.Component.core, telemetry_1.TelemetryEvent.ProjectMigratorMigrateMultiEnv);
232
224
  const loadRes = await projectSettingsLoader_1.loadProjectSettings(inputs);
233
225
  if (loadRes.isErr()) {
@@ -241,7 +233,7 @@ async function migrateToArmAndMultiEnv(ctx) {
241
233
  }
242
234
  }
243
235
  catch (err) {
244
- core.tools.logProvider.error(`[core] Failed to upgrade project, error: '${err}'`);
236
+ __2.TOOLS === null || __2.TOOLS === void 0 ? void 0 : __2.TOOLS.logProvider.error(`[core] Failed to upgrade project, error: '${err}'`);
245
237
  await handleError(projectPath, ctx, backupFolder);
246
238
  throw err;
247
239
  }
@@ -271,14 +263,12 @@ async function preReadJsonFile(path, core) {
271
263
  await fs_extra_1.default.readJson(path);
272
264
  }
273
265
  catch (err) {
274
- core.tools.logProvider.error(`'${path}' doesn't exist or is not in json format. Please fix it and try again by running command (Teams: Upgrade project).`);
275
- core.tools.logProvider.warning(`Read this wiki(${learnMoreLink}) for the FAQ.`);
276
- core.tools.ui
277
- .showMessage("info", util_1.default.format(tools_1.getStrings().solution.MigrationToArmAndMultiEnvPreCheckErrorMessage, path), false, learnMoreText)
278
- .then((result) => {
266
+ __2.TOOLS === null || __2.TOOLS === void 0 ? void 0 : __2.TOOLS.logProvider.error(`'${path}' doesn't exist or is not in json format. Please fix it and try again by running command (Teams: Upgrade project).`);
267
+ __2.TOOLS === null || __2.TOOLS === void 0 ? void 0 : __2.TOOLS.logProvider.warning(`Read this wiki(${learnMoreLink}) for the FAQ.`);
268
+ __2.TOOLS === null || __2.TOOLS === void 0 ? void 0 : __2.TOOLS.ui.showMessage("info", util_1.default.format(tools_1.getStrings().solution.MigrationToArmAndMultiEnvPreCheckErrorMessage, path), false, learnMoreText).then((result) => {
279
269
  const userSelected = result.isOk() ? result.value : undefined;
280
270
  if (userSelected === learnMoreText) {
281
- core.tools.ui.openUrl(manualUpgradeLink);
271
+ __2.TOOLS === null || __2.TOOLS === void 0 ? void 0 : __2.TOOLS.ui.openUrl(manualUpgradeLink);
282
272
  }
283
273
  });
284
274
  throw __1.NotJsonError(err);
@@ -291,15 +281,12 @@ async function handleError(projectPath, ctx, backupFolder) {
291
281
  catch (e) {
292
282
  // try my best to cleanup
293
283
  const core = ctx.self;
294
- core.tools.logProvider.error(`[core] Failed to cleanup the backup, error: '${e}'`);
284
+ __2.TOOLS === null || __2.TOOLS === void 0 ? void 0 : __2.TOOLS.logProvider.error(`[core] Failed to cleanup the backup, error: '${e}'`);
295
285
  }
296
- const core = ctx.self;
297
- core.tools.ui
298
- .showMessage("info", tools_1.getStrings().solution.MigrationToArmAndMultiEnvErrorMessage, false, learnMoreText)
299
- .then((result) => {
286
+ __2.TOOLS === null || __2.TOOLS === void 0 ? void 0 : __2.TOOLS.ui.showMessage("info", tools_1.getStrings().solution.MigrationToArmAndMultiEnvErrorMessage, false, learnMoreText).then((result) => {
300
287
  const userSelected = result.isOk() ? result.value : undefined;
301
288
  if (userSelected === learnMoreText) {
302
- core.tools.ui.openUrl(manualUpgradeLink);
289
+ __2.TOOLS === null || __2.TOOLS === void 0 ? void 0 : __2.TOOLS.ui.openUrl(manualUpgradeLink);
303
290
  }
304
291
  });
305
292
  }
@@ -322,18 +309,18 @@ async function postMigration(projectPath, ctx, inputs, backupFolder) {
322
309
  telemetry_1.sendTelemetryEvent(telemetry_1.Component.core, telemetry_1.TelemetryEvent.ProjectMigratorGuideStart);
323
310
  await generateUpgradeReport(backupFolder);
324
311
  const core = ctx.self;
325
- await updateGitIgnore(projectPath, core.tools.logProvider, backupFolder);
326
- core.tools.logProvider.warning(`[core] Upgrade success! All old files in .fx and appPackage folder have been backed up to the .backup folder and you can delete it. Read this wiki(${learnMoreLink}) if you want to restore your configuration files or learn more about this upgrade.`);
327
- core.tools.logProvider.warning(`[core] Read upgrade-change-logs.md to learn about details for this upgrade.`);
312
+ await updateGitIgnore(projectPath, __2.TOOLS.logProvider, backupFolder);
313
+ __2.TOOLS === null || __2.TOOLS === void 0 ? void 0 : __2.TOOLS.logProvider.warning(`[core] Upgrade success! All old files in .fx and appPackage folder have been backed up to the .backup folder and you can delete it. Read this wiki(${learnMoreLink}) if you want to restore your configuration files or learn more about this upgrade.`);
314
+ __2.TOOLS === null || __2.TOOLS === void 0 ? void 0 : __2.TOOLS.logProvider.warning(`[core] Read upgrade-change-logs.md to learn about details for this upgrade.`);
328
315
  if (inputs.platform === teamsfx_api_1.Platform.VSCode) {
329
316
  await globalState_1.globalStateUpdate(ChangeLogsFlag, true);
330
317
  telemetry_1.sendTelemetryEvent(telemetry_1.Component.core, telemetry_1.TelemetryEvent.ProjectMigratorGuide, {
331
318
  [telemetry_1.TelemetryProperty.Status]: telemetry_1.ProjectMigratorGuideStatus.Reload,
332
319
  });
333
- await ((_b = (_a = core.tools.ui).reload) === null || _b === void 0 ? void 0 : _b.call(_a));
320
+ await ((_b = __2.TOOLS === null || __2.TOOLS === void 0 ? void 0 : (_a = __2.TOOLS.ui).reload) === null || _b === void 0 ? void 0 : _b.call(_a));
334
321
  }
335
322
  else {
336
- core.tools.logProvider.info(tools_1.getStrings().solution.MigrationToArmAndMultiEnvSuccessMessage);
323
+ __2.TOOLS === null || __2.TOOLS === void 0 ? void 0 : __2.TOOLS.logProvider.info(tools_1.getStrings().solution.MigrationToArmAndMultiEnvSuccessMessage);
337
324
  }
338
325
  }
339
326
  async function updateGitIgnore(projectPath, log, backupFolder) {
@@ -712,23 +699,6 @@ async function needMigrateToArmAndMultiEnv(ctx) {
712
699
  }
713
700
  return false;
714
701
  }
715
- async function needUpdateTeamsToolkitVersion(ctx) {
716
- if (preCheckEnvEnabled()) {
717
- return false;
718
- }
719
- const inputs = ctx.arguments[ctx.arguments.length - 1];
720
- if (!inputs.projectPath) {
721
- return false;
722
- }
723
- const fx = path_1.default.join(inputs.projectPath, ".fx");
724
- if (!(await fs_extra_1.default.pathExists(fx))) {
725
- return false;
726
- }
727
- // only for arm && multi-env project
728
- const armParameter = path_1.default.join(fx, "configs", parameterFileNameTemplate.replace("@envName", "dev"));
729
- const defaultEnv = path_1.default.join(fx, "env.default.json");
730
- return (await fs_extra_1.default.pathExists(armParameter)) && !(await fs_extra_1.default.pathExists(defaultEnv));
731
- }
732
702
  function preCheckEnvEnabled() {
733
703
  if (tools_1.isMultiEnvEnabled() && tools_1.isArmSupportEnabled()) {
734
704
  return true;
@@ -815,15 +785,13 @@ async function generateArmTemplatesFiles(ctx) {
815
785
  const projectSettings = loadRes.value;
816
786
  minorCtx.projectSettings = projectSettings;
817
787
  const targetEnvName = "dev";
818
- const result = await envInfoLoader_1.loadSolutionContext(core.tools, inputs, minorCtx.projectSettings, targetEnvName, inputs.ignoreEnvInfo);
788
+ const result = await envInfoLoader_1.loadSolutionContext(inputs, minorCtx.projectSettings, targetEnvName, inputs.ignoreEnvInfo);
819
789
  if (result.isErr()) {
820
790
  throw __1.SolutionConfigError();
821
791
  }
822
792
  minorCtx.solutionContext = result.value;
823
793
  const settings = (_a = minorCtx.projectSettings) === null || _a === void 0 ? void 0 : _a.solutionSettings;
824
- const activePlugins = __2.isV2()
825
- ? ResourcePluginContainer_1.getActivatedV2ResourcePlugins(settings).map((p) => new adaptor_1.NamedArmResourcePluginAdaptor(p))
826
- : ResourcePluginContainer_1.getActivatedResourcePlugins(settings);
794
+ const activePlugins = ResourcePluginContainer_1.getActivatedV2ResourcePlugins(settings).map((p) => new adaptor_1.NamedArmResourcePluginAdaptor(p));
827
795
  // generate bicep files.
828
796
  try {
829
797
  await arm_1.generateArmTemplate(minorCtx.solutionContext, activePlugins);