@microsoft/teamsfx-core 2.0.0 → 2.0.1-alpha.6f92bb6f7.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 (412) hide show
  1. package/build/common/armInterface.d.ts +0 -5
  2. package/build/common/armInterface.d.ts.map +1 -1
  3. package/build/common/deps-checker/checkerFactory.d.ts.map +1 -1
  4. package/build/common/deps-checker/checkerFactory.js +0 -7
  5. package/build/common/deps-checker/checkerFactory.js.map +1 -1
  6. package/build/common/deps-checker/constant/helpLink.d.ts +0 -4
  7. package/build/common/deps-checker/constant/helpLink.d.ts.map +1 -1
  8. package/build/common/deps-checker/constant/helpLink.js +1 -9
  9. package/build/common/deps-checker/constant/helpLink.js.map +1 -1
  10. package/build/common/deps-checker/constant/message.d.ts +0 -5
  11. package/build/common/deps-checker/constant/message.d.ts.map +1 -1
  12. package/build/common/deps-checker/constant/message.js +0 -6
  13. package/build/common/deps-checker/constant/message.js.map +1 -1
  14. package/build/common/deps-checker/constant/telemetry.d.ts +2 -33
  15. package/build/common/deps-checker/constant/telemetry.d.ts.map +1 -1
  16. package/build/common/deps-checker/constant/telemetry.js +0 -31
  17. package/build/common/deps-checker/constant/telemetry.js.map +1 -1
  18. package/build/common/deps-checker/depsChecker.d.ts +0 -3
  19. package/build/common/deps-checker/depsChecker.d.ts.map +1 -1
  20. package/build/common/deps-checker/depsChecker.js +0 -3
  21. package/build/common/deps-checker/depsChecker.js.map +1 -1
  22. package/build/common/deps-checker/depsError.d.ts +0 -9
  23. package/build/common/deps-checker/depsError.d.ts.map +1 -1
  24. package/build/common/deps-checker/depsError.js +1 -22
  25. package/build/common/deps-checker/depsError.js.map +1 -1
  26. package/build/common/deps-checker/depsManager.d.ts.map +1 -1
  27. package/build/common/deps-checker/depsManager.js +0 -3
  28. package/build/common/deps-checker/depsManager.js.map +1 -1
  29. package/build/common/deps-checker/internal/funcToolChecker.d.ts +2 -2
  30. package/build/common/deps-checker/internal/funcToolChecker.d.ts.map +1 -1
  31. package/build/common/deps-checker/internal/funcToolChecker.js +4 -2
  32. package/build/common/deps-checker/internal/funcToolChecker.js.map +1 -1
  33. package/build/common/deps-checker/internal/nodeChecker.d.ts +0 -20
  34. package/build/common/deps-checker/internal/nodeChecker.d.ts.map +1 -1
  35. package/build/common/deps-checker/internal/nodeChecker.js +1 -51
  36. package/build/common/deps-checker/internal/nodeChecker.js.map +1 -1
  37. package/build/common/local/localEnvManager.d.ts +0 -9
  38. package/build/common/local/localEnvManager.d.ts.map +1 -1
  39. package/build/common/local/localEnvManager.js +0 -59
  40. package/build/common/local/localEnvManager.js.map +1 -1
  41. package/build/common/projectSettingsHelper.d.ts +1 -7
  42. package/build/common/projectSettingsHelper.d.ts.map +1 -1
  43. package/build/common/projectSettingsHelper.js +5 -81
  44. package/build/common/projectSettingsHelper.js.map +1 -1
  45. package/build/common/projectSettingsHelperV3.d.ts +0 -1
  46. package/build/common/projectSettingsHelperV3.d.ts.map +1 -1
  47. package/build/common/projectSettingsHelperV3.js +1 -10
  48. package/build/common/projectSettingsHelperV3.js.map +1 -1
  49. package/build/common/samples.d.ts.map +1 -1
  50. package/build/common/samples.js +18 -40
  51. package/build/common/samples.js.map +1 -1
  52. package/build/common/templates-config.json +2 -2
  53. package/build/common/tools.d.ts +1 -2
  54. package/build/common/tools.d.ts.map +1 -1
  55. package/build/common/tools.js +5 -70
  56. package/build/common/tools.js.map +1 -1
  57. package/build/component/code/utils.d.ts +1 -8
  58. package/build/component/code/utils.d.ts.map +1 -1
  59. package/build/component/code/utils.js +5 -144
  60. package/build/component/code/utils.js.map +1 -1
  61. package/build/component/constants.d.ts +3 -0
  62. package/build/component/constants.d.ts.map +1 -1
  63. package/build/component/constants.js +13 -2
  64. package/build/component/constants.js.map +1 -1
  65. package/build/component/coordinator/index.d.ts +7 -7
  66. package/build/component/coordinator/index.d.ts.map +1 -1
  67. package/build/component/coordinator/index.js +15 -179
  68. package/build/component/coordinator/index.js.map +1 -1
  69. package/build/component/debug/error.d.ts +0 -1
  70. package/build/component/debug/error.d.ts.map +1 -1
  71. package/build/component/debug/error.js +1 -11
  72. package/build/component/debug/error.js.map +1 -1
  73. package/build/component/debug/index.d.ts.map +1 -1
  74. package/build/component/debug/index.js +1 -25
  75. package/build/component/debug/index.js.map +1 -1
  76. package/build/component/driver/aad/create.d.ts.map +1 -1
  77. package/build/component/driver/aad/create.js +2 -2
  78. package/build/component/driver/aad/create.js.map +1 -1
  79. package/build/component/driver/aad/update.d.ts.map +1 -1
  80. package/build/component/driver/aad/update.js +6 -20
  81. package/build/component/driver/aad/update.js.map +1 -1
  82. package/build/component/driver/botAadApp/create.d.ts.map +1 -1
  83. package/build/component/driver/botAadApp/create.js +2 -2
  84. package/build/component/driver/botAadApp/create.js.map +1 -1
  85. package/build/component/driver/devTool/error/dotnetInstallationUserError.d.ts +1 -1
  86. package/build/component/driver/devTool/error/dotnetInstallationUserError.d.ts.map +1 -1
  87. package/build/component/driver/devTool/error/dotnetInstallationUserError.js +4 -2
  88. package/build/component/driver/devTool/error/dotnetInstallationUserError.js.map +1 -1
  89. package/build/component/driver/devTool/error/funcInstallationUserError.d.ts +1 -1
  90. package/build/component/driver/devTool/error/funcInstallationUserError.d.ts.map +1 -1
  91. package/build/component/driver/devTool/error/funcInstallationUserError.js +4 -2
  92. package/build/component/driver/devTool/error/funcInstallationUserError.js.map +1 -1
  93. package/build/component/driver/devTool/installDriver.d.ts +1 -0
  94. package/build/component/driver/devTool/installDriver.d.ts.map +1 -1
  95. package/build/component/driver/devTool/installDriver.js +17 -24
  96. package/build/component/driver/devTool/installDriver.js.map +1 -1
  97. package/build/component/driver/script/baseBuildDriver.d.ts.map +1 -1
  98. package/build/component/driver/script/baseBuildDriver.js +2 -2
  99. package/build/component/driver/script/baseBuildDriver.js.map +1 -1
  100. package/build/component/driver/script/scriptDriver.d.ts +11 -1
  101. package/build/component/driver/script/scriptDriver.d.ts.map +1 -1
  102. package/build/component/driver/script/scriptDriver.js +121 -4
  103. package/build/component/driver/script/scriptDriver.js.map +1 -1
  104. package/build/component/driver/teamsApp/createAppPackage.d.ts +0 -1
  105. package/build/component/driver/teamsApp/createAppPackage.d.ts.map +1 -1
  106. package/build/component/driver/teamsApp/createAppPackage.js +1 -11
  107. package/build/component/driver/teamsApp/createAppPackage.js.map +1 -1
  108. package/build/component/driver/teamsApp/validate.d.ts +0 -1
  109. package/build/component/driver/teamsApp/validate.d.ts.map +1 -1
  110. package/build/component/driver/teamsApp/validate.js +34 -18
  111. package/build/component/driver/teamsApp/validate.js.map +1 -1
  112. package/build/component/feature/bot/question.d.ts.map +1 -1
  113. package/build/component/feature/bot/question.js +7 -16
  114. package/build/component/feature/bot/question.js.map +1 -1
  115. package/build/component/feature/sso.d.ts +0 -4
  116. package/build/component/feature/sso.d.ts.map +1 -1
  117. package/build/component/feature/sso.js +10 -144
  118. package/build/component/feature/sso.js.map +1 -1
  119. package/build/component/question.d.ts +3 -64
  120. package/build/component/question.d.ts.map +1 -1
  121. package/build/component/question.js +61 -663
  122. package/build/component/question.js.map +1 -1
  123. package/build/component/registerService.d.ts +0 -14
  124. package/build/component/registerService.d.ts.map +1 -1
  125. package/build/component/registerService.js +0 -14
  126. package/build/component/registerService.js.map +1 -1
  127. package/build/component/resource/aadApp/aadApp.d.ts.map +1 -1
  128. package/build/component/resource/aadApp/aadApp.js +6 -24
  129. package/build/component/resource/aadApp/aadApp.js.map +1 -1
  130. package/build/component/resource/appManifest/appStudio.js +1 -1
  131. package/build/component/resource/appManifest/appStudio.js.map +1 -1
  132. package/build/component/resource/appManifest/utils/ManifestUtils.d.ts +1 -1
  133. package/build/component/resource/appManifest/utils/ManifestUtils.d.ts.map +1 -1
  134. package/build/component/resource/appManifest/utils/ManifestUtils.js +1 -9
  135. package/build/component/resource/appManifest/utils/ManifestUtils.js.map +1 -1
  136. package/build/component/resource/spfx/utils/questions.d.ts.map +1 -1
  137. package/build/component/resource/spfx/utils/questions.js +1 -4
  138. package/build/component/resource/spfx/utils/questions.js.map +1 -1
  139. package/build/component/utils/backupFiles.d.ts +2 -1
  140. package/build/component/utils/backupFiles.d.ts.map +1 -1
  141. package/build/component/utils/backupFiles.js +23 -3
  142. package/build/component/utils/backupFiles.js.map +1 -1
  143. package/build/component/utils/charsetUtils.d.ts +3 -0
  144. package/build/component/utils/charsetUtils.d.ts.map +1 -0
  145. package/build/component/utils/charsetUtils.js +241 -0
  146. package/build/component/utils/charsetUtils.js.map +1 -0
  147. package/build/component/utils/envUtil.d.ts.map +1 -1
  148. package/build/component/utils/envUtil.js +4 -1
  149. package/build/component/utils/envUtil.js.map +1 -1
  150. package/build/component/utils/metadataUtil.d.ts.map +1 -1
  151. package/build/component/utils/metadataUtil.js +9 -7
  152. package/build/component/utils/metadataUtil.js.map +1 -1
  153. package/build/component/utils/pathUtils.d.ts.map +1 -1
  154. package/build/component/utils/pathUtils.js +8 -7
  155. package/build/component/utils/pathUtils.js.map +1 -1
  156. package/build/component/utils/settingsUtil.js +3 -3
  157. package/build/component/utils/settingsUtil.js.map +1 -1
  158. package/build/component/utils.d.ts +1 -12
  159. package/build/component/utils.d.ts.map +1 -1
  160. package/build/component/utils.js +2 -225
  161. package/build/component/utils.js.map +1 -1
  162. package/build/component/workflow.d.ts +0 -1
  163. package/build/component/workflow.d.ts.map +1 -1
  164. package/build/component/workflow.js +1 -687
  165. package/build/component/workflow.js.map +1 -1
  166. package/build/core/FxCore.d.ts +26 -34
  167. package/build/core/FxCore.d.ts.map +1 -1
  168. package/build/core/FxCore.js +86 -654
  169. package/build/core/FxCore.js.map +1 -1
  170. package/build/core/FxCoreImplementV3.d.ts +15 -9
  171. package/build/core/FxCoreImplementV3.d.ts.map +1 -1
  172. package/build/core/FxCoreImplementV3.js +105 -105
  173. package/build/core/FxCoreImplementV3.js.map +1 -1
  174. package/build/core/middleware/envInfoLoaderV3.d.ts +1 -10
  175. package/build/core/middleware/envInfoLoaderV3.d.ts.map +1 -1
  176. package/build/core/middleware/envInfoLoaderV3.js +1 -207
  177. package/build/core/middleware/envInfoLoaderV3.js.map +1 -1
  178. package/build/core/middleware/projectMigratorV3.d.ts +1 -0
  179. package/build/core/middleware/projectMigratorV3.d.ts.map +1 -1
  180. package/build/core/middleware/projectMigratorV3.js +7 -7
  181. package/build/core/middleware/projectMigratorV3.js.map +1 -1
  182. package/build/core/middleware/projectSettingsLoader.d.ts +1 -4
  183. package/build/core/middleware/projectSettingsLoader.d.ts.map +1 -1
  184. package/build/core/middleware/projectSettingsLoader.js +4 -58
  185. package/build/core/middleware/projectSettingsLoader.js.map +1 -1
  186. package/build/core/middleware/projectVersionChecker.d.ts.map +1 -1
  187. package/build/core/middleware/projectVersionChecker.js +4 -5
  188. package/build/core/middleware/projectVersionChecker.js.map +1 -1
  189. package/build/core/middleware/questionModel.d.ts +0 -1
  190. package/build/core/middleware/questionModel.d.ts.map +1 -1
  191. package/build/core/middleware/questionModel.js +8 -54
  192. package/build/core/middleware/questionModel.js.map +1 -1
  193. package/build/core/middleware/utils/MigrationUtils.d.ts +0 -5
  194. package/build/core/middleware/utils/MigrationUtils.d.ts.map +1 -1
  195. package/build/core/middleware/utils/MigrationUtils.js +1 -77
  196. package/build/core/middleware/utils/MigrationUtils.js.map +1 -1
  197. package/build/core/question.d.ts +2 -12
  198. package/build/core/question.d.ts.map +1 -1
  199. package/build/core/question.js +14 -236
  200. package/build/core/question.js.map +1 -1
  201. package/build/core/types.d.ts +3 -3
  202. package/build/core/types.d.ts.map +1 -1
  203. package/build/error/common.d.ts +9 -0
  204. package/build/error/common.d.ts.map +1 -1
  205. package/build/error/common.js +39 -1
  206. package/build/error/common.js.map +1 -1
  207. package/build/error/script.d.ts +1 -1
  208. package/build/error/script.d.ts.map +1 -1
  209. package/build/error/script.js +3 -3
  210. package/build/error/script.js.map +1 -1
  211. package/build/index.d.ts +0 -2
  212. package/build/index.d.ts.map +1 -1
  213. package/build/index.js +1 -4
  214. package/build/index.js.map +1 -1
  215. package/package.json +12 -28
  216. package/resource/package.nls.json +10 -97
  217. package/templates/fallback/common.zip +0 -0
  218. package/templates/fallback/csharp.zip +0 -0
  219. package/templates/fallback/js.zip +0 -0
  220. package/templates/fallback/ts.zip +0 -0
  221. package/build/common/deps-checker/internal/ngrokChecker.d.ts +0 -27
  222. package/build/common/deps-checker/internal/ngrokChecker.d.ts.map +0 -1
  223. package/build/common/deps-checker/internal/ngrokChecker.js +0 -222
  224. package/build/common/deps-checker/internal/ngrokChecker.js.map +0 -1
  225. package/build/component/connection/apimConfig.d.ts +0 -11
  226. package/build/component/connection/apimConfig.d.ts.map +0 -1
  227. package/build/component/connection/apimConfig.js +0 -44
  228. package/build/component/connection/apimConfig.js.map +0 -1
  229. package/build/component/connection/azureFunctionConfig.d.ts +0 -9
  230. package/build/component/connection/azureFunctionConfig.d.ts.map +0 -1
  231. package/build/component/connection/azureFunctionConfig.js +0 -25
  232. package/build/component/connection/azureFunctionConfig.js.map +0 -1
  233. package/build/component/connection/azureResourceConfig.d.ts +0 -11
  234. package/build/component/connection/azureResourceConfig.d.ts.map +0 -1
  235. package/build/component/connection/azureResourceConfig.js +0 -72
  236. package/build/component/connection/azureResourceConfig.js.map +0 -1
  237. package/build/component/connection/azureWebAppConfig.d.ts +0 -9
  238. package/build/component/connection/azureWebAppConfig.d.ts.map +0 -1
  239. package/build/component/connection/azureWebAppConfig.js +0 -25
  240. package/build/component/connection/azureWebAppConfig.js.map +0 -1
  241. package/build/component/coordinator/lifecycleStage.d.ts +0 -2
  242. package/build/component/coordinator/lifecycleStage.d.ts.map +0 -1
  243. package/build/component/coordinator/lifecycleStage.js +0 -23
  244. package/build/component/coordinator/lifecycleStage.js.map +0 -1
  245. package/build/component/core.d.ts +0 -65
  246. package/build/component/core.d.ts.map +0 -1
  247. package/build/component/core.js +0 -653
  248. package/build/component/core.js.map +0 -1
  249. package/build/component/debug/util/ngrok.d.ts +0 -6
  250. package/build/component/debug/util/ngrok.d.ts.map +0 -1
  251. package/build/component/debug/util/ngrok.js +0 -65
  252. package/build/component/debug/util/ngrok.js.map +0 -1
  253. package/build/component/feature/api/api.d.ts +0 -8
  254. package/build/component/feature/api/api.d.ts.map +0 -1
  255. package/build/component/feature/api/api.js +0 -188
  256. package/build/component/feature/api/api.js.map +0 -1
  257. package/build/component/feature/apiconnector/apiConnector.d.ts +0 -11
  258. package/build/component/feature/apiconnector/apiConnector.d.ts.map +0 -1
  259. package/build/component/feature/apiconnector/apiConnector.js +0 -43
  260. package/build/component/feature/apiconnector/apiConnector.js.map +0 -1
  261. package/build/component/feature/apim.d.ts +0 -8
  262. package/build/component/feature/apim.d.ts.map +0 -1
  263. package/build/component/feature/apim.js +0 -123
  264. package/build/component/feature/apim.js.map +0 -1
  265. package/build/component/feature/bot/bot.d.ts +0 -12
  266. package/build/component/feature/bot/bot.d.ts.map +0 -1
  267. package/build/component/feature/bot/bot.js +0 -309
  268. package/build/component/feature/bot/bot.js.map +0 -1
  269. package/build/component/feature/keyVault.d.ts +0 -16
  270. package/build/component/feature/keyVault.d.ts.map +0 -1
  271. package/build/component/feature/keyVault.js +0 -90
  272. package/build/component/feature/keyVault.js.map +0 -1
  273. package/build/component/feature/spfx.d.ts +0 -9
  274. package/build/component/feature/spfx.d.ts.map +0 -1
  275. package/build/component/feature/spfx.js +0 -121
  276. package/build/component/feature/spfx.js.map +0 -1
  277. package/build/component/feature/sql.d.ts +0 -10
  278. package/build/component/feature/sql.d.ts.map +0 -1
  279. package/build/component/feature/sql.js +0 -80
  280. package/build/component/feature/sql.js.map +0 -1
  281. package/build/component/feature/tab.d.ts +0 -10
  282. package/build/component/feature/tab.d.ts.map +0 -1
  283. package/build/component/feature/tab.js +0 -238
  284. package/build/component/feature/tab.js.map +0 -1
  285. package/build/component/resource/azureSql/actions/configure.d.ts +0 -15
  286. package/build/component/resource/azureSql/actions/configure.d.ts.map +0 -1
  287. package/build/component/resource/azureSql/actions/configure.js +0 -92
  288. package/build/component/resource/azureSql/actions/configure.js.map +0 -1
  289. package/build/component/resource/azureSql/actions/provision.d.ts +0 -10
  290. package/build/component/resource/azureSql/actions/provision.d.ts.map +0 -1
  291. package/build/component/resource/azureSql/actions/provision.js +0 -63
  292. package/build/component/resource/azureSql/actions/provision.js.map +0 -1
  293. package/build/component/resource/azureSql/actions/utils.d.ts +0 -12
  294. package/build/component/resource/azureSql/actions/utils.d.ts.map +0 -1
  295. package/build/component/resource/azureSql/actions/utils.js +0 -82
  296. package/build/component/resource/azureSql/actions/utils.js.map +0 -1
  297. package/build/component/resource/azureSql/azureSql.d.ts +0 -24
  298. package/build/component/resource/azureSql/azureSql.d.ts.map +0 -1
  299. package/build/component/resource/azureSql/azureSql.js +0 -75
  300. package/build/component/resource/azureSql/azureSql.js.map +0 -1
  301. package/build/component/resource/azureSql/clients/management.d.ts +0 -18
  302. package/build/component/resource/azureSql/clients/management.d.ts.map +0 -1
  303. package/build/component/resource/azureSql/clients/management.js +0 -124
  304. package/build/component/resource/azureSql/clients/management.js.map +0 -1
  305. package/build/component/resource/azureSql/clients/sql.d.ts +0 -13
  306. package/build/component/resource/azureSql/clients/sql.d.ts.map +0 -1
  307. package/build/component/resource/azureSql/clients/sql.js +0 -153
  308. package/build/component/resource/azureSql/clients/sql.js.map +0 -1
  309. package/build/component/resource/azureSql/config.d.ts +0 -7
  310. package/build/component/resource/azureSql/config.d.ts.map +0 -1
  311. package/build/component/resource/azureSql/config.js +0 -77
  312. package/build/component/resource/azureSql/config.js.map +0 -1
  313. package/build/component/resource/azureSql/constants.d.ts +0 -85
  314. package/build/component/resource/azureSql/constants.d.ts.map +0 -1
  315. package/build/component/resource/azureSql/constants.js +0 -95
  316. package/build/component/resource/azureSql/constants.js.map +0 -1
  317. package/build/component/resource/azureSql/errors.d.ts +0 -63
  318. package/build/component/resource/azureSql/errors.d.ts.map +0 -1
  319. package/build/component/resource/azureSql/errors.js +0 -107
  320. package/build/component/resource/azureSql/errors.js.map +0 -1
  321. package/build/component/resource/azureSql/index.d.ts +0 -2
  322. package/build/component/resource/azureSql/index.d.ts.map +0 -1
  323. package/build/component/resource/azureSql/index.js +0 -7
  324. package/build/component/resource/azureSql/index.js.map +0 -1
  325. package/build/component/resource/azureSql/questions.d.ts +0 -6
  326. package/build/component/resource/azureSql/questions.d.ts.map +0 -1
  327. package/build/component/resource/azureSql/questions.js +0 -59
  328. package/build/component/resource/azureSql/questions.js.map +0 -1
  329. package/build/component/resource/azureSql/results.d.ts +0 -10
  330. package/build/component/resource/azureSql/results.d.ts.map +0 -1
  331. package/build/component/resource/azureSql/results.js +0 -34
  332. package/build/component/resource/azureSql/results.js.map +0 -1
  333. package/build/component/resource/azureSql/types.d.ts +0 -12
  334. package/build/component/resource/azureSql/types.d.ts.map +0 -1
  335. package/build/component/resource/azureSql/types.js +0 -5
  336. package/build/component/resource/azureSql/types.js.map +0 -1
  337. package/build/component/resource/azureSql/utils/checkInput.d.ts +0 -10
  338. package/build/component/resource/azureSql/utils/checkInput.d.ts.map +0 -1
  339. package/build/component/resource/azureSql/utils/checkInput.js +0 -89
  340. package/build/component/resource/azureSql/utils/checkInput.js.map +0 -1
  341. package/build/component/resource/azureSql/utils/common.d.ts +0 -12
  342. package/build/component/resource/azureSql/utils/common.d.ts.map +0 -1
  343. package/build/component/resource/azureSql/utils/common.js +0 -51
  344. package/build/component/resource/azureSql/utils/common.js.map +0 -1
  345. package/build/component/resource/identity.d.ts +0 -28
  346. package/build/component/resource/identity.d.ts.map +0 -1
  347. package/build/component/resource/identity.js +0 -42
  348. package/build/component/resource/identity.js.map +0 -1
  349. package/build/component/resource/keyVault.d.ts +0 -29
  350. package/build/component/resource/keyVault.d.ts.map +0 -1
  351. package/build/component/resource/keyVault.js +0 -47
  352. package/build/component/resource/keyVault.js.map +0 -1
  353. package/build/component/resource/simpleAuth/constants.d.ts +0 -122
  354. package/build/component/resource/simpleAuth/constants.d.ts.map +0 -1
  355. package/build/component/resource/simpleAuth/constants.js +0 -163
  356. package/build/component/resource/simpleAuth/constants.js.map +0 -1
  357. package/build/component/resource/simpleAuth/errors.d.ts +0 -17
  358. package/build/component/resource/simpleAuth/errors.d.ts.map +0 -1
  359. package/build/component/resource/simpleAuth/errors.js +0 -91
  360. package/build/component/resource/simpleAuth/errors.js.map +0 -1
  361. package/build/component/resource/simpleAuth/index.d.ts +0 -12
  362. package/build/component/resource/simpleAuth/index.d.ts.map +0 -1
  363. package/build/component/resource/simpleAuth/index.js +0 -115
  364. package/build/component/resource/simpleAuth/index.js.map +0 -1
  365. package/build/component/resource/simpleAuth/result.d.ts +0 -9
  366. package/build/component/resource/simpleAuth/result.d.ts.map +0 -1
  367. package/build/component/resource/simpleAuth/result.js +0 -35
  368. package/build/component/resource/simpleAuth/result.js.map +0 -1
  369. package/build/component/resource/simpleAuth/utils/common.d.ts +0 -23
  370. package/build/component/resource/simpleAuth/utils/common.d.ts.map +0 -1
  371. package/build/component/resource/simpleAuth/utils/common.js +0 -150
  372. package/build/component/resource/simpleAuth/utils/common.js.map +0 -1
  373. package/build/component/resource/simpleAuth/utils/dialog.d.ts +0 -5
  374. package/build/component/resource/simpleAuth/utils/dialog.d.ts.map +0 -1
  375. package/build/component/resource/simpleAuth/utils/dialog.js +0 -7
  376. package/build/component/resource/simpleAuth/utils/dialog.js.map +0 -1
  377. package/build/component/resource/simpleAuth/utils/telemetry.d.ts +0 -17
  378. package/build/component/resource/simpleAuth/utils/telemetry.d.ts.map +0 -1
  379. package/build/component/resource/simpleAuth/utils/telemetry.js +0 -45
  380. package/build/component/resource/simpleAuth/utils/telemetry.js.map +0 -1
  381. package/build/core/dependencyChecker.d.ts +0 -1
  382. package/build/core/dependencyChecker.d.ts.map +0 -1
  383. package/build/core/dependencyChecker.js +0 -2
  384. package/build/core/dependencyChecker.js.map +0 -1
  385. package/build/core/middleware/CommonErrorHandlerMW.d.ts +0 -14
  386. package/build/core/middleware/CommonErrorHandlerMW.d.ts.map +0 -1
  387. package/build/core/middleware/CommonErrorHandlerMW.js +0 -63
  388. package/build/core/middleware/CommonErrorHandlerMW.js.map +0 -1
  389. package/build/core/middleware/aadManifestMigration.d.ts +0 -3
  390. package/build/core/middleware/aadManifestMigration.d.ts.map +0 -1
  391. package/build/core/middleware/aadManifestMigration.js +0 -119
  392. package/build/core/middleware/aadManifestMigration.js.map +0 -1
  393. package/build/core/middleware/consolidateLocalRemote.d.ts +0 -5
  394. package/build/core/middleware/consolidateLocalRemote.d.ts.map +0 -1
  395. package/build/core/middleware/consolidateLocalRemote.js +0 -378
  396. package/build/core/middleware/consolidateLocalRemote.js.map +0 -1
  397. package/build/core/middleware/envInfoWriter.d.ts +0 -8
  398. package/build/core/middleware/envInfoWriter.d.ts.map +0 -1
  399. package/build/core/middleware/envInfoWriter.js +0 -76
  400. package/build/core/middleware/envInfoWriter.js.map +0 -1
  401. package/build/core/middleware/envInfoWriterV3.d.ts +0 -6
  402. package/build/core/middleware/envInfoWriterV3.d.ts.map +0 -1
  403. package/build/core/middleware/envInfoWriterV3.js +0 -67
  404. package/build/core/middleware/envInfoWriterV3.js.map +0 -1
  405. package/build/core/middleware/projectMigrator.d.ts +0 -40
  406. package/build/core/middleware/projectMigrator.d.ts.map +0 -1
  407. package/build/core/middleware/projectMigrator.js +0 -1014
  408. package/build/core/middleware/projectMigrator.js.map +0 -1
  409. package/build/core/middleware/projectSettingsWriter.d.ts +0 -6
  410. package/build/core/middleware/projectSettingsWriter.d.ts.map +0 -1
  411. package/build/core/middleware/projectSettingsWriter.js +0 -52
  412. package/build/core/middleware/projectSettingsWriter.js.map +0 -1
@@ -1,653 +0,0 @@
1
- "use strict";
2
- // Copyright (c) Microsoft Corporation.
3
- // Licensed under the MIT license.
4
- Object.defineProperty(exports, "__esModule", { value: true });
5
- exports.getBotTroubleShootMessage = exports.preCheck = exports.TeamsfxCore = void 0;
6
- const tslib_1 = require("tslib");
7
- const teamsfx_api_1 = require("@microsoft/teamsfx-api");
8
- const fs_extra_1 = tslib_1.__importDefault(require("fs-extra"));
9
- const path_1 = tslib_1.__importDefault(require("path"));
10
- require("reflect-metadata");
11
- const typedi_1 = require("typedi");
12
- const question_1 = require("../core/question");
13
- const projectSettingsHelper_1 = require("./../common/projectSettingsHelper");
14
- require("./bicep");
15
- require("./code/api/apiCode");
16
- require("./code/botCode");
17
- require("./code/spfxTabCode");
18
- require("./code/tab/tabCode");
19
- require("./connection/apimConfig");
20
- require("./connection/azureFunctionConfig");
21
- require("./connection/azureWebAppConfig");
22
- const debug_1 = require("./debug");
23
- const envManager_1 = require("./envManager");
24
- require("./feature/api/api");
25
- require("./feature/apiconnector/apiConnector");
26
- require("./feature/apim");
27
- require("./feature/bot/bot");
28
- require("./feature/cicd/cicd");
29
- require("./feature/keyVault");
30
- require("./feature/spfx");
31
- require("./feature/sql");
32
- require("./feature/sso");
33
- require("./feature/tab");
34
- require("./resource/apim/apim");
35
- require("./resource/azureAppService/azureFunction");
36
- require("./resource/azureAppService/azureWebApp");
37
- require("./resource/azureSql");
38
- require("./resource/azureStorage/azureStorage");
39
- require("./resource/botService/botService");
40
- require("./resource/keyVault");
41
- require("./resource/spfx");
42
- require("./resource/aadApp/aadApp");
43
- require("./resource/simpleAuth");
44
- const jsonschema = tslib_1.__importStar(require("jsonschema"));
45
- const lodash_1 = require("lodash");
46
- const constants_1 = require("../common/constants");
47
- const globalState_1 = require("../common/globalState");
48
- const localizeUtils_1 = require("../common/localizeUtils");
49
- const projectSettingsHelperV3_1 = require("../common/projectSettingsHelperV3");
50
- const tools_1 = require("../common/tools");
51
- const downloadSample_1 = require("../core/downloadSample");
52
- const error_1 = require("../core/error");
53
- const globalVars_1 = require("../core/globalVars");
54
- const arm_1 = tslib_1.__importDefault(require("./arm"));
55
- const constants_2 = require("./constants");
56
- const constants_3 = require("./constants");
57
- const migrate_1 = require("./migrate");
58
- const question_2 = require("./question");
59
- const lib_1 = require("@feathersjs/hooks/lib");
60
- const actionExecutionMW_1 = require("./middleware/actionExecutionMW");
61
- const telemetry_1 = require("../common/telemetry");
62
- const workflow_1 = require("./workflow");
63
- const environment_1 = require("../core/environment");
64
- const deployUtils_1 = require("./deployUtils");
65
- const provisionUtils_1 = require("./provisionUtils");
66
- const folder_1 = require("../folder");
67
- const FxCore_1 = require("../core/FxCore");
68
- const constants_4 = require("./constants");
69
- const questionModel_1 = require("../core/middleware/questionModel");
70
- const constants_5 = require("./resource/aadApp/constants");
71
- const executor_1 = require("./utils/executor");
72
- const projectSettingsLoader_1 = require("../core/middleware/projectSettingsLoader");
73
- let TeamsfxCore = class TeamsfxCore {
74
- constructor() {
75
- this.name = "fx";
76
- }
77
- /**
78
- * create project
79
- */
80
- async create(context, inputs, actionContext) {
81
- const folder = inputs["folder"];
82
- if (!folder) {
83
- return teamsfx_api_1.err(error_1.InvalidInputError("folder is undefined"));
84
- }
85
- inputs.folder = folder;
86
- const scratch = inputs[question_1.CoreQuestionNames.CreateFromScratch];
87
- let projectPath;
88
- const automaticNpmInstall = "automaticNpmInstall";
89
- if (scratch === question_1.ScratchOptionNo().id) {
90
- // create from sample
91
- const downloadRes = await downloadSample_1.downloadSample(inputs, undefined, context);
92
- if (downloadRes.isErr()) {
93
- return teamsfx_api_1.err(downloadRes.error);
94
- }
95
- projectPath = downloadRes.value;
96
- }
97
- else {
98
- // create from new
99
- const appName = inputs[question_1.CoreQuestionNames.AppName];
100
- if (undefined === appName)
101
- return teamsfx_api_1.err(error_1.InvalidInputError(`App Name is empty`, inputs));
102
- const validateResult = jsonschema.validate(appName, {
103
- pattern: question_1.ProjectNamePattern,
104
- });
105
- if (validateResult.errors && validateResult.errors.length > 0) {
106
- return teamsfx_api_1.err(error_1.InvalidInputError(`${validateResult.errors[0].message}`, inputs));
107
- }
108
- projectPath = path_1.default.join(folder, appName);
109
- inputs.projectPath = projectPath;
110
- // set isVS global var when creating project
111
- globalVars_1.globalVars.isVS = inputs[question_1.CoreQuestionNames.ProgrammingLanguage] === "csharp";
112
- const features = inputs.capabilities;
113
- const isInitExistingApp = features === constants_2.ExistingTabOptionItem().id;
114
- if (isInitExistingApp) {
115
- const folderExist = await fs_extra_1.default.pathExists(projectPath);
116
- if (folderExist) {
117
- return teamsfx_api_1.err(new error_1.ProjectFolderExistError(projectPath));
118
- }
119
- }
120
- else {
121
- const isValid = projectSettingsHelper_1.isValidProject(projectPath);
122
- if (isValid) {
123
- return teamsfx_api_1.err(new error_1.OperationNotPermittedError("initialize a project in existing teamsfx project"));
124
- }
125
- }
126
- const initRes = await this.init(context, inputs, isInitExistingApp);
127
- if (initRes.isErr())
128
- return teamsfx_api_1.err(initRes.error);
129
- delete inputs.folder;
130
- if (isInitExistingApp) {
131
- lodash_1.merge(actionContext === null || actionContext === void 0 ? void 0 : actionContext.telemetryProps, {
132
- [telemetry_1.TelemetryProperty.Capabilities]: features,
133
- });
134
- const appManifest = typedi_1.Container.get(constants_3.ComponentNames.AppManifest);
135
- const addCapRes = await appManifest.addCapability(inputs, [
136
- { name: "staticTab", existingApp: true },
137
- ]);
138
- if (addCapRes.isErr())
139
- return teamsfx_api_1.err(addCapRes.error);
140
- const sourceReadmePath = path_1.default.join(folder_1.getTemplatesFolder(), "core", teamsfx_api_1.DefaultReadme);
141
- if (await fs_extra_1.default.pathExists(sourceReadmePath)) {
142
- const targetReadmePath = path_1.default.join(inputs.projectPath, teamsfx_api_1.DefaultReadme);
143
- await fs_extra_1.default.copy(sourceReadmePath, targetReadmePath);
144
- }
145
- }
146
- else {
147
- if (features === constants_2.M365SsoLaunchPageOptionItem().id ||
148
- features === constants_2.M365SearchAppOptionItem().id) {
149
- context.projectSetting.isM365 = true;
150
- inputs.isM365 = true;
151
- }
152
- if (constants_2.BotFeatureIds().includes(features)) {
153
- inputs[constants_2.AzureSolutionQuestionNames.Features] = features;
154
- const component = typedi_1.Container.get(constants_3.ComponentNames.TeamsBot);
155
- const res = await component.add(context, inputs);
156
- if (res.isErr())
157
- return teamsfx_api_1.err(res.error);
158
- }
159
- if (constants_2.TabFeatureIds().includes(features)) {
160
- inputs[constants_2.AzureSolutionQuestionNames.Features] = features;
161
- const component = typedi_1.Container.get(constants_3.ComponentNames.TeamsTab);
162
- const res = await component.add(context, inputs);
163
- if (res.isErr())
164
- return teamsfx_api_1.err(res.error);
165
- }
166
- if (features === constants_2.TabSPFxItem().id) {
167
- inputs[constants_2.AzureSolutionQuestionNames.Features] = features;
168
- const component = typedi_1.Container.get("spfx-tab");
169
- const res = await component.add(context, inputs);
170
- if (res.isErr())
171
- return teamsfx_api_1.err(res.error);
172
- }
173
- }
174
- lodash_1.merge(actionContext === null || actionContext === void 0 ? void 0 : actionContext.telemetryProps, {
175
- [telemetry_1.TelemetryProperty.Feature]: features,
176
- });
177
- }
178
- if (inputs.platform === teamsfx_api_1.Platform.VSCode) {
179
- await globalState_1.globalStateUpdate(automaticNpmInstall, true);
180
- }
181
- context.projectPath = projectPath;
182
- return teamsfx_api_1.ok(projectPath);
183
- }
184
- /**
185
- * add feature
186
- */
187
- async addFeature(context, inputs, actionContext) {
188
- var _a, _b, _c, _d, _e, _f;
189
- const features = inputs[constants_2.AzureSolutionQuestionNames.Features];
190
- let component;
191
- if (constants_2.BotFeatureIds().includes(features)) {
192
- component = typedi_1.Container.get(constants_3.ComponentNames.TeamsBot);
193
- }
194
- else if (constants_2.TabFeatureIds().includes(features)) {
195
- component = typedi_1.Container.get(constants_3.ComponentNames.TeamsTab);
196
- }
197
- else if (features === constants_2.AzureResourceSQLNewUI.id) {
198
- component = typedi_1.Container.get("sql");
199
- }
200
- else if (features === constants_2.AzureResourceFunctionNewUI.id) {
201
- component = typedi_1.Container.get(constants_3.ComponentNames.TeamsApi);
202
- }
203
- else if (features === constants_2.AzureResourceApim.id) {
204
- component = typedi_1.Container.get(constants_3.ComponentNames.APIMFeature);
205
- }
206
- else if (features === constants_2.AzureResourceKeyVaultNewUI.id) {
207
- component = typedi_1.Container.get("key-vault-feature");
208
- }
209
- else if (features === constants_2.CicdOptionItem.id) {
210
- component = typedi_1.Container.get("cicd");
211
- }
212
- else if (features === constants_2.ApiConnectionOptionItem.id) {
213
- component = typedi_1.Container.get("api-connector");
214
- }
215
- else if (features === constants_2.SingleSignOnOptionItem.id) {
216
- component = typedi_1.Container.get("sso");
217
- }
218
- else if (features === constants_2.TabSPFxNewUIItem().id) {
219
- component = typedi_1.Container.get(constants_3.ComponentNames.SPFxTab);
220
- }
221
- if (component) {
222
- const res = await component.add(context, inputs);
223
- lodash_1.merge(actionContext === null || actionContext === void 0 ? void 0 : actionContext.telemetryProps, {
224
- [telemetry_1.TelemetryProperty.Feature]: features,
225
- });
226
- if (res.isErr())
227
- return teamsfx_api_1.err(res.error);
228
- if (features !== constants_2.ApiConnectionOptionItem.id && features !== constants_2.CicdOptionItem.id) {
229
- if (((_c = (_b = (_a = context.envInfo) === null || _a === void 0 ? void 0 : _a.state) === null || _b === void 0 ? void 0 : _b.solution) === null || _c === void 0 ? void 0 : _c.provisionSucceeded) === true ||
230
- ((_f = (_e = (_d = context.envInfo) === null || _d === void 0 ? void 0 : _d.state) === null || _e === void 0 ? void 0 : _e.solution) === null || _f === void 0 ? void 0 : _f.provisionSucceeded) === "true") {
231
- context.envInfo.state.solution.provisionSucceeded = false;
232
- }
233
- await environment_1.environmentManager.resetProvisionState(inputs, context);
234
- }
235
- return teamsfx_api_1.ok(res.value);
236
- }
237
- return teamsfx_api_1.ok(undefined);
238
- }
239
- async init(context, inputs, isInitExistingApp = false) {
240
- const projectSettings = projectSettingsHelper_1.newProjectSettings();
241
- projectSettings.appName = inputs["app-name"];
242
- projectSettings.components = [];
243
- if (inputs.projectId) {
244
- projectSettings.projectId = inputs.projectId;
245
- }
246
- context.projectSetting = projectSettings;
247
- await fs_extra_1.default.ensureDir(inputs.projectPath);
248
- await fs_extra_1.default.ensureDir(path_1.default.join(inputs.projectPath, `.${teamsfx_api_1.ConfigFolderName}`));
249
- await fs_extra_1.default.ensureDir(path_1.default.join(inputs.projectPath, `.${teamsfx_api_1.ConfigFolderName}`, "configs"));
250
- const basicFolderRes = await FxCore_1.ensureBasicFolderStructure(inputs);
251
- if (basicFolderRes.isErr()) {
252
- return teamsfx_api_1.err(basicFolderRes.error);
253
- }
254
- if (isInitExistingApp) {
255
- // const folderExist = await fs.pathExists(inputs.projectPath);
256
- // if (folderExist) {
257
- // return err(new ProjectFolderExistError(inputs.projectPath));
258
- // }
259
- // const isValid = isValidProject(inputs.projectPath);
260
- // if (isValid) {
261
- // return err(
262
- // new OperationNotPermittedError("initialize a project in existing teamsfx project")
263
- // );
264
- // }
265
- // pre-check before initialize
266
- const preCheckResult = await preCheck(inputs.projectPath);
267
- if (preCheckResult.isErr()) {
268
- return teamsfx_api_1.err(preCheckResult.error);
269
- }
270
- }
271
- {
272
- const appManifest = typedi_1.Container.get(constants_3.ComponentNames.AppManifest);
273
- const res = await appManifest.init(context, inputs, isInitExistingApp);
274
- if (res.isErr())
275
- return res;
276
- }
277
- {
278
- const endpoint = inputs[question_1.CoreQuestionNames.ExistingTabEndpoint];
279
- const createEnvResult = await envManager_1.createEnvWithName(environment_1.environmentManager.getDefaultEnvName(), projectSettings.appName, inputs, isInitExistingApp ? endpoint : undefined);
280
- if (createEnvResult.isErr()) {
281
- return teamsfx_api_1.err(createEnvResult.error);
282
- }
283
- const createLocalEnvResult = await envManager_1.createEnvWithName(environment_1.environmentManager.getLocalEnvName(), projectSettings.appName, inputs, isInitExistingApp ? endpoint : undefined);
284
- if (createLocalEnvResult.isErr()) {
285
- return teamsfx_api_1.err(createLocalEnvResult.error);
286
- }
287
- }
288
- return teamsfx_api_1.ok(undefined);
289
- }
290
- async provision(ctx, inputs, actionContext) {
291
- ctx.envInfo.state.solution = ctx.envInfo.state.solution || {};
292
- ctx.envInfo.state.solution.provisionSucceeded = false;
293
- // 1. pre provision
294
- {
295
- const res = await provisionUtils_1.provisionUtils.preProvision(ctx, inputs);
296
- if (res.isErr())
297
- return teamsfx_api_1.err(res.error);
298
- }
299
- // 2. create a teams app
300
- const appManifest = typedi_1.Container.get(constants_3.ComponentNames.AppManifest);
301
- {
302
- const res = await appManifest.provision(ctx, inputs);
303
- if (res.isErr())
304
- return teamsfx_api_1.err(res.error);
305
- }
306
- // 3. call resources provision api
307
- const componentsToProvision = ctx.projectSetting.components.filter((r) => r.provision);
308
- {
309
- const thunks = [];
310
- for (const componentConfig of componentsToProvision) {
311
- const componentInstance = typedi_1.Container.get(componentConfig.name);
312
- if (componentInstance.provision) {
313
- thunks.push({
314
- pluginName: `${componentConfig.name}`,
315
- taskName: "provision",
316
- thunk: () => {
317
- ctx.envInfo.state[componentConfig.name] =
318
- ctx.envInfo.state[componentConfig.name] || {};
319
- return componentInstance.provision(ctx, inputs);
320
- },
321
- });
322
- }
323
- }
324
- const provisionResult = await executor_1.executeConcurrently(thunks, ctx.logProvider);
325
- if (provisionResult.kind !== "success") {
326
- return teamsfx_api_1.err(provisionResult.error);
327
- }
328
- ctx.logProvider.info(localizeUtils_1.getLocalizedString("core.provision.ProvisionFinishNotice", constants_1.PluginDisplayName.Solution));
329
- }
330
- // 4
331
- if (ctx.envInfo.envName === "local") {
332
- //4.1 setup local env
333
- const localEnvSetupResult = await debug_1.setupLocalEnvironment(ctx, inputs);
334
- if (localEnvSetupResult.isErr()) {
335
- return teamsfx_api_1.err(localEnvSetupResult.error);
336
- }
337
- }
338
- else if (projectSettingsHelperV3_1.hasAzureResourceV3(ctx.projectSetting, true)) {
339
- //4.2 deploy arm templates for remote
340
- ctx.logProvider.info(localizeUtils_1.getLocalizedString("core.deployArmTemplates.StartNotice", constants_1.PluginDisplayName.Solution));
341
- const armRes = await arm_1.default.deployArmTemplates(ctx, inputs, ctx.envInfo, ctx.tokenProvider.azureAccountProvider);
342
- if (armRes.isErr()) {
343
- return teamsfx_api_1.err(armRes.error);
344
- }
345
- }
346
- // 5.0 "aad-app.setApplicationInContext"
347
- const aadApp = typedi_1.Container.get(constants_3.ComponentNames.AadApp);
348
- if (projectSettingsHelperV3_1.hasAAD(ctx.projectSetting)) {
349
- const res = await aadApp.setApplicationInContext(ctx, inputs);
350
- if (res.isErr())
351
- return teamsfx_api_1.err(res.error);
352
- }
353
- // 5. call resources configure api
354
- {
355
- const thunks = [];
356
- for (const componentConfig of componentsToProvision) {
357
- const componentInstance = typedi_1.Container.get(componentConfig.name);
358
- if (componentInstance.configure) {
359
- thunks.push({
360
- pluginName: `${componentConfig.name}`,
361
- taskName: "configure",
362
- thunk: () => {
363
- ctx.envInfo.state[componentConfig.name] =
364
- ctx.envInfo.state[componentConfig.name] || {};
365
- return componentInstance.configure(ctx, inputs);
366
- },
367
- });
368
- }
369
- }
370
- const configResult = await executor_1.executeConcurrently(thunks, ctx.logProvider);
371
- if (configResult.kind !== "success") {
372
- return teamsfx_api_1.err(configResult.error);
373
- }
374
- ctx.logProvider.info(localizeUtils_1.getLocalizedString("core.provision.configurationFinishNotice", constants_1.PluginDisplayName.Solution));
375
- }
376
- // 6.
377
- if (ctx.envInfo.envName === "local") {
378
- const localConfigResult = await debug_1.configLocalEnvironment(ctx, inputs);
379
- if (localConfigResult.isErr()) {
380
- return teamsfx_api_1.err(localConfigResult.error);
381
- }
382
- }
383
- // 7. update teams app
384
- {
385
- const res = await appManifest.configure(ctx, inputs);
386
- if (res.isErr())
387
- return teamsfx_api_1.err(res.error);
388
- }
389
- // 8. show message and set state
390
- if (ctx.envInfo.envName !== "local") {
391
- const url = tools_1.getResourceGroupInPortal(ctx.envInfo.state.solution.subscriptionId, ctx.envInfo.state.solution.tenantId, ctx.envInfo.state.solution.resourceGroupName);
392
- const msg = localizeUtils_1.getLocalizedString("core.provision.successNotice", ctx.projectSetting.appName);
393
- if (url) {
394
- const title = localizeUtils_1.getLocalizedString("core.provision.viewResources");
395
- ctx.userInteraction.showMessage("info", msg, false, title).then((result) => {
396
- const userSelected = result.isOk() ? result.value : undefined;
397
- if (userSelected === title) {
398
- ctx.userInteraction.openUrl(url);
399
- }
400
- });
401
- }
402
- else {
403
- ctx.userInteraction.showMessage("info", msg, false);
404
- }
405
- ctx.logProvider.info(msg);
406
- }
407
- lodash_1.merge(actionContext === null || actionContext === void 0 ? void 0 : actionContext.telemetryProps, {
408
- [telemetry_1.TelemetryProperty.Components]: JSON.stringify(componentsToProvision.map((component) => component.name)),
409
- });
410
- ctx.envInfo.state.solution.provisionSucceeded = true;
411
- return teamsfx_api_1.ok(undefined);
412
- }
413
- /**
414
- * About AAD deploy:
415
- * 1. For VS platform, there is no "AAD" option in the deploy plugins selection question.
416
- * "Deploy" command does not include "AAD" resource.
417
- * 2. For VS Code platform, there is no "AAD" option in the deploy plugins selection question.
418
- * "Deploy" command does not include "AAD" resource. But there is another command "Deploy aad manifest" in aad manifest's context menu that will trigger the "deploy" lifecycle command in fxcore (with inputs["include-aad-manifest"] === "yes") will trigger "AAD" only deployment.
419
- * 3. For CLI platform, there is "AAD" option in the deploy plugins selection question.
420
- * "Deploy" command includes "AAD" resource if the following conditions meet:
421
- * 1). inputs["include-aad-manifest"] === "yes" AND
422
- * 2). deploy options includes "AAD".
423
- * In such a case "AAD" will be included in the deployment resources and will be deployed together with other resources.
424
- */
425
- async deploy(context, inputs, actionContext) {
426
- var _a;
427
- lodash_1.merge(actionContext === null || actionContext === void 0 ? void 0 : actionContext.telemetryProps, {
428
- [constants_4.SolutionTelemetryProperty.IncludeAadManifest]: (_a = inputs[constants_5.Constants.INCLUDE_AAD_MANIFEST]) !== null && _a !== void 0 ? _a : "no",
429
- });
430
- // deploy AAD only from VS Code
431
- const isDeployAADManifestFromVSCode = inputs[constants_5.Constants.INCLUDE_AAD_MANIFEST] === "yes" && inputs.platform === teamsfx_api_1.Platform.VSCode;
432
- if (isDeployAADManifestFromVSCode) {
433
- return deployUtils_1.deployUtils.deployAadFromVscode(context, inputs);
434
- }
435
- context.logProvider.info(`inputs(${constants_2.AzureSolutionQuestionNames.PluginSelectionDeploy}) = ${inputs[constants_2.AzureSolutionQuestionNames.PluginSelectionDeploy]}`);
436
- const projectSettings = context.projectSetting;
437
- const inputPlugins = inputs[constants_2.AzureSolutionQuestionNames.PluginSelectionDeploy] || [];
438
- let inputComponentNames = inputPlugins.map(migrate_1.pluginName2ComponentName);
439
- if (inputComponentNames.includes(constants_3.ComponentNames.AadApp)) {
440
- if (inputs[constants_5.Constants.INCLUDE_AAD_MANIFEST] != "yes" || inputs.platform !== teamsfx_api_1.Platform.CLI) {
441
- inputComponentNames = inputComponentNames.filter((c) => c !== constants_3.ComponentNames.AadApp);
442
- }
443
- }
444
- const thunks = [];
445
- let hasAzureResource = false;
446
- // 1. collect resources to deploy
447
- const isVS = projectSettingsHelper_1.isVSProject(projectSettings);
448
- for (const component of projectSettings.components) {
449
- if (component.deploy && (isVS || inputComponentNames.includes(component.name))) {
450
- const deployComponentName = component.hosting || component.name;
451
- const featureComponent = typedi_1.Container.get(component.name);
452
- const deployComponent = typedi_1.Container.get(deployComponentName);
453
- thunks.push({
454
- pluginName: `${component.name}`,
455
- taskName: `${featureComponent.build ? "build & " : ""}deploy`,
456
- thunk: async () => {
457
- const clonedInputs = lodash_1.cloneDeep(inputs);
458
- clonedInputs.folder = component.folder;
459
- clonedInputs.artifactFolder = component.artifactFolder || clonedInputs.folder;
460
- clonedInputs.componentId = component.name;
461
- if (featureComponent.build) {
462
- const buildRes = await featureComponent.build(context, clonedInputs);
463
- if (buildRes.isErr())
464
- return teamsfx_api_1.err(buildRes.error);
465
- }
466
- // build process may change the artifact folder, so we need reassign the value
467
- clonedInputs.artifactFolder = component.artifactFolder;
468
- return await deployComponent.deploy(context, clonedInputs);
469
- },
470
- });
471
- if (constants_3.AzureResources.includes(deployComponentName)) {
472
- hasAzureResource = true;
473
- }
474
- }
475
- }
476
- if (!(inputs["include-app-manifest"] && inputs["include-app-manifest"] === "no") &&
477
- inputComponentNames.includes(constants_3.ComponentNames.AppManifest)) {
478
- const appManifest = typedi_1.Container.get(constants_3.ComponentNames.AppManifest);
479
- thunks.push({
480
- pluginName: constants_3.ComponentNames.AppManifest,
481
- taskName: "deploy",
482
- thunk: async () => {
483
- return await appManifest.configure(context, inputs);
484
- },
485
- });
486
- }
487
- if (thunks.length === 0) {
488
- return teamsfx_api_1.err(new teamsfx_api_1.UserError("fx", "NoResourcePluginSelected", localizeUtils_1.getDefaultString("core.NoPluginSelected"), localizeUtils_1.getLocalizedString("core.NoPluginSelected")));
489
- }
490
- context.logProvider.info(localizeUtils_1.getLocalizedString("core.deploy.selectedPluginsToDeployNotice", constants_1.PluginDisplayName.Solution, JSON.stringify(thunks.map((p) => p.pluginName))));
491
- // 2. check azure account
492
- if (hasAzureResource) {
493
- const subscriptionResult = await deployUtils_1.deployUtils.checkDeployAzureSubscription(context, context.envInfo, context.tokenProvider.azureAccountProvider);
494
- if (subscriptionResult.isErr()) {
495
- return teamsfx_api_1.err(subscriptionResult.error);
496
- }
497
- const consent = await deployUtils_1.deployUtils.askForDeployConsent(context, context.tokenProvider.azureAccountProvider, context.envInfo);
498
- if (consent.isErr()) {
499
- return teamsfx_api_1.err(consent.error);
500
- }
501
- }
502
- // // 3. build
503
- // {
504
- // const res = await this.build(context, inputs);
505
- // if (res.isErr()) return err(res.error);
506
- // }
507
- // 4. start deploy
508
- context.logProvider.info(localizeUtils_1.getLocalizedString("core.deploy.startNotice", constants_1.PluginDisplayName.Solution));
509
- const result = await executor_1.executeConcurrently(thunks, context.logProvider);
510
- if (result.kind === "success") {
511
- if (hasAzureResource) {
512
- const botTroubleShootMsg = getBotTroubleShootMessage(projectSettingsHelperV3_1.hasBot(context.projectSetting));
513
- const msg = localizeUtils_1.getLocalizedString("core.deploy.successNotice", context.projectSetting.appName) +
514
- botTroubleShootMsg.textForLogging;
515
- context.logProvider.info(msg);
516
- if (botTroubleShootMsg.textForLogging) {
517
- // Show a `Learn more` action button for bot trouble shooting.
518
- context.userInteraction
519
- .showMessage("info", `${localizeUtils_1.getLocalizedString("core.deploy.successNotice", context.projectSetting.appName)} ${botTroubleShootMsg.textForMsgBox}`, false, botTroubleShootMsg.textForActionButton)
520
- .then((result) => {
521
- const userSelected = result.isOk() ? result.value : undefined;
522
- if (userSelected === botTroubleShootMsg.textForActionButton) {
523
- context.userInteraction.openUrl(botTroubleShootMsg.troubleShootLink);
524
- }
525
- });
526
- }
527
- else {
528
- context.userInteraction.showMessage("info", msg, false);
529
- }
530
- }
531
- lodash_1.merge(actionContext === null || actionContext === void 0 ? void 0 : actionContext.telemetryProps, {
532
- [telemetry_1.TelemetryProperty.Components]: JSON.stringify(thunks.map((p) => p.pluginName)),
533
- [telemetry_1.TelemetryProperty.Hosting]: JSON.stringify(thunks.map((p) => { var _a; return (_a = workflow_1.getComponent(projectSettings, p.pluginName)) === null || _a === void 0 ? void 0 : _a.hosting; })),
534
- });
535
- return teamsfx_api_1.ok(undefined);
536
- }
537
- else {
538
- const msg = localizeUtils_1.getLocalizedString("core.deploy.failNotice", context.projectSetting.appName);
539
- context.logProvider.info(msg);
540
- return teamsfx_api_1.err(result.error);
541
- }
542
- }
543
- };
544
- tslib_1.__decorate([
545
- lib_1.hooks([
546
- actionExecutionMW_1.ActionExecutionMW({
547
- question: (context, inputs) => {
548
- return questionModel_1.getQuestionsForCreateProjectV2(inputs);
549
- },
550
- enableTelemetry: true,
551
- telemetryEventName: telemetry_1.TelemetryEvent.CreateProject,
552
- telemetryComponentName: "core",
553
- }),
554
- ]),
555
- tslib_1.__metadata("design:type", Function),
556
- tslib_1.__metadata("design:paramtypes", [Object, Object, Object]),
557
- tslib_1.__metadata("design:returntype", Promise)
558
- ], TeamsfxCore.prototype, "create", null);
559
- tslib_1.__decorate([
560
- lib_1.hooks([
561
- actionExecutionMW_1.ActionExecutionMW({
562
- question: (context, inputs) => {
563
- return question_2.getQuestionsForAddFeatureV3(context, inputs);
564
- },
565
- enableTelemetry: true,
566
- telemetryEventName: telemetry_1.TelemetryEvent.AddFeature,
567
- telemetryComponentName: "core",
568
- }),
569
- ]),
570
- tslib_1.__metadata("design:type", Function),
571
- tslib_1.__metadata("design:paramtypes", [Object, Object, Object]),
572
- tslib_1.__metadata("design:returntype", Promise)
573
- ], TeamsfxCore.prototype, "addFeature", null);
574
- tslib_1.__decorate([
575
- lib_1.hooks([
576
- actionExecutionMW_1.ActionExecutionMW({
577
- question: async (context, inputs) => {
578
- return await question_2.getQuestionsForProvisionV3(inputs);
579
- },
580
- enableTelemetry: true,
581
- telemetryEventName: telemetry_1.TelemetryEvent.Provision,
582
- telemetryComponentName: "core",
583
- }),
584
- ]),
585
- tslib_1.__metadata("design:type", Function),
586
- tslib_1.__metadata("design:paramtypes", [Object, Object, Object]),
587
- tslib_1.__metadata("design:returntype", Promise)
588
- ], TeamsfxCore.prototype, "provision", null);
589
- tslib_1.__decorate([
590
- lib_1.hooks([
591
- actionExecutionMW_1.ActionExecutionMW({
592
- question: async (context, inputs) => {
593
- return await question_2.getQuestionsForDeployV3(context, inputs, context.envInfo);
594
- },
595
- enableTelemetry: true,
596
- telemetryEventName: telemetry_1.TelemetryEvent.Deploy,
597
- telemetryComponentName: "core",
598
- }),
599
- ]),
600
- tslib_1.__metadata("design:type", Function),
601
- tslib_1.__metadata("design:paramtypes", [Object, Object, Object]),
602
- tslib_1.__metadata("design:returntype", Promise)
603
- ], TeamsfxCore.prototype, "deploy", null);
604
- TeamsfxCore = tslib_1.__decorate([
605
- typedi_1.Service("fx")
606
- ], TeamsfxCore);
607
- exports.TeamsfxCore = TeamsfxCore;
608
- // pre-check before initialize
609
- async function preCheck(projectPath) {
610
- const existFiles = new Array();
611
- // 0. check if projectSettings.json exists
612
- const settingsFile = projectSettingsLoader_1.getProjectSettingsPath(projectPath);
613
- if (await fs_extra_1.default.pathExists(settingsFile)) {
614
- existFiles.push(settingsFile);
615
- }
616
- const appManifest = typedi_1.Container.get(constants_3.ComponentNames.AppManifest);
617
- // 1. check if manifest templates exist
618
- const manifestPreCheckResult = await appManifest.preCheck(projectPath);
619
- existFiles.push(...manifestPreCheckResult);
620
- // 2. check if env config file exists
621
- const defaultEnvPath = environment_1.environmentManager.getEnvConfigPath(environment_1.environmentManager.getDefaultEnvName(), projectPath);
622
- if (await fs_extra_1.default.pathExists(defaultEnvPath)) {
623
- existFiles.push(defaultEnvPath);
624
- }
625
- const localEnvPath = environment_1.environmentManager.getEnvConfigPath(environment_1.environmentManager.getLocalEnvName(), projectPath);
626
- if (await fs_extra_1.default.pathExists(localEnvPath)) {
627
- existFiles.push(localEnvPath);
628
- }
629
- // 3. check if README.md exists
630
- const readmePath = path_1.default.join(projectPath, teamsfx_api_1.AutoGeneratedReadme);
631
- if (await fs_extra_1.default.pathExists(readmePath)) {
632
- existFiles.push(readmePath);
633
- }
634
- if (existFiles.length > 0) {
635
- return teamsfx_api_1.err(new error_1.InitializedFileAlreadyExistError(existFiles.join(", ")));
636
- }
637
- return teamsfx_api_1.ok(undefined);
638
- }
639
- exports.preCheck = preCheck;
640
- function getBotTroubleShootMessage(isBot) {
641
- const botTroubleShootLink = "https://aka.ms/teamsfx-bot-help#how-can-i-troubleshoot-issues-when-teams-bot-isnt-responding-on-azure";
642
- const botTroubleShootDesc = localizeUtils_1.getLocalizedString("core.deploy.botTroubleShoot");
643
- const botTroubleShootLearnMore = localizeUtils_1.getLocalizedString("core.deploy.botTroubleShoot.learnMore");
644
- const botTroubleShootMsg = `${botTroubleShootDesc} ${botTroubleShootLearnMore}: ${botTroubleShootLink}.`;
645
- return {
646
- troubleShootLink: botTroubleShootLink,
647
- textForLogging: isBot ? botTroubleShootMsg : "",
648
- textForMsgBox: botTroubleShootDesc,
649
- textForActionButton: botTroubleShootLearnMore,
650
- };
651
- }
652
- exports.getBotTroubleShootMessage = getBotTroubleShootMessage;
653
- //# sourceMappingURL=core.js.map