@microsoft/teamsfx-core 1.8.0 → 1.8.1-alpha.324752dff.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 (527) hide show
  1. package/build/common/azure-hosting/azureFunctionHosting.d.ts +13 -0
  2. package/build/common/azure-hosting/azureFunctionHosting.d.ts.map +1 -0
  3. package/build/common/azure-hosting/azureFunctionHosting.js +26 -0
  4. package/build/common/azure-hosting/azureFunctionHosting.js.map +1 -0
  5. package/build/common/azure-hosting/azureHosting.d.ts +14 -0
  6. package/build/common/azure-hosting/azureHosting.d.ts.map +1 -0
  7. package/build/common/azure-hosting/azureHosting.js +66 -0
  8. package/build/common/azure-hosting/azureHosting.js.map +1 -0
  9. package/build/common/azure-hosting/botServiceHosting.d.ts +7 -0
  10. package/build/common/azure-hosting/botServiceHosting.d.ts.map +1 -0
  11. package/build/common/azure-hosting/botServiceHosting.js +16 -0
  12. package/build/common/azure-hosting/botServiceHosting.js.map +1 -0
  13. package/build/common/azure-hosting/hostingFactory.d.ts +6 -0
  14. package/build/common/azure-hosting/hostingFactory.d.ts.map +1 -0
  15. package/build/common/azure-hosting/hostingFactory.js +22 -0
  16. package/build/common/azure-hosting/hostingFactory.js.map +1 -0
  17. package/build/common/azure-hosting/interfaces.d.ts +11 -0
  18. package/build/common/azure-hosting/interfaces.d.ts.map +1 -0
  19. package/build/common/azure-hosting/interfaces.js +12 -0
  20. package/build/common/azure-hosting/interfaces.js.map +1 -0
  21. package/build/common/azure-hosting/utils.d.ts +3 -0
  22. package/build/common/azure-hosting/utils.d.ts.map +1 -0
  23. package/build/common/azure-hosting/utils.js +26 -0
  24. package/build/common/azure-hosting/utils.js.map +1 -0
  25. package/build/common/constants.d.ts +1 -2
  26. package/build/common/constants.d.ts.map +1 -1
  27. package/build/common/constants.js +1 -2
  28. package/build/common/constants.js.map +1 -1
  29. package/build/common/deps-checker/constant/helpLink.d.ts +1 -0
  30. package/build/common/deps-checker/constant/helpLink.d.ts.map +1 -1
  31. package/build/common/deps-checker/constant/helpLink.js +6 -5
  32. package/build/common/deps-checker/constant/helpLink.js.map +1 -1
  33. package/build/common/deps-checker/constant/telemetry.d.ts +2 -0
  34. package/build/common/deps-checker/constant/telemetry.d.ts.map +1 -1
  35. package/build/common/deps-checker/constant/telemetry.js +2 -0
  36. package/build/common/deps-checker/constant/telemetry.js.map +1 -1
  37. package/build/common/deps-checker/internal/funcToolChecker.d.ts +2 -1
  38. package/build/common/deps-checker/internal/funcToolChecker.d.ts.map +1 -1
  39. package/build/common/deps-checker/internal/funcToolChecker.js +7 -4
  40. package/build/common/deps-checker/internal/funcToolChecker.js.map +1 -1
  41. package/build/common/deps-checker/internal/nodeChecker.d.ts.map +1 -1
  42. package/build/common/deps-checker/internal/nodeChecker.js +8 -4
  43. package/build/common/deps-checker/internal/nodeChecker.js.map +1 -1
  44. package/build/common/featureFlags.d.ts +1 -0
  45. package/build/common/featureFlags.d.ts.map +1 -1
  46. package/build/common/featureFlags.js +7 -6
  47. package/build/common/featureFlags.js.map +1 -1
  48. package/build/common/local/constants.d.ts +1 -0
  49. package/build/common/local/constants.d.ts.map +1 -1
  50. package/build/common/local/constants.js +2 -1
  51. package/build/common/local/constants.js.map +1 -1
  52. package/build/common/local/projectSettingsHelper.d.ts +1 -0
  53. package/build/common/local/projectSettingsHelper.d.ts.map +1 -1
  54. package/build/common/local/projectSettingsHelper.js +5 -0
  55. package/build/common/local/projectSettingsHelper.js.map +1 -1
  56. package/build/common/projectSettingsHelper.d.ts +3 -2
  57. package/build/common/projectSettingsHelper.d.ts.map +1 -1
  58. package/build/common/projectSettingsHelper.js +32 -4
  59. package/build/common/projectSettingsHelper.js.map +1 -1
  60. package/build/common/samples-config.json +40 -6
  61. package/build/common/telemetry.d.ts +2 -3
  62. package/build/common/telemetry.d.ts.map +1 -1
  63. package/build/common/telemetry.js +1 -2
  64. package/build/common/telemetry.js.map +1 -1
  65. package/build/common/template-utils/templates.d.ts +1 -0
  66. package/build/common/template-utils/templates.d.ts.map +1 -1
  67. package/build/common/template-utils/templates.js +5 -1
  68. package/build/common/template-utils/templates.js.map +1 -1
  69. package/build/common/templates-config.json +2 -2
  70. package/build/common/tools.d.ts +4 -2
  71. package/build/common/tools.d.ts.map +1 -1
  72. package/build/common/tools.js +101 -11
  73. package/build/common/tools.js.map +1 -1
  74. package/build/component/bicep.d.ts +8 -0
  75. package/build/component/bicep.d.ts.map +1 -0
  76. package/build/component/bicep.js +111 -0
  77. package/build/component/bicep.js.map +1 -0
  78. package/build/component/botCode.d.ts +13 -0
  79. package/build/component/botCode.d.ts.map +1 -0
  80. package/build/component/botCode.js +138 -0
  81. package/build/component/botCode.js.map +1 -0
  82. package/build/component/connection.d.ts +8 -0
  83. package/build/component/connection.d.ts.map +1 -0
  84. package/build/component/connection.js +84 -0
  85. package/build/component/connection.js.map +1 -0
  86. package/build/component/core.d.ts +43 -0
  87. package/build/component/core.d.ts.map +1 -0
  88. package/build/component/core.js +714 -0
  89. package/build/component/core.js.map +1 -0
  90. package/build/component/debugManager.d.ts +8 -0
  91. package/build/component/debugManager.d.ts.map +1 -0
  92. package/build/component/debugManager.js +57 -0
  93. package/build/component/debugManager.js.map +1 -0
  94. package/build/component/envManager.d.ts +7 -0
  95. package/build/component/envManager.d.ts.map +1 -0
  96. package/build/component/envManager.js +140 -0
  97. package/build/component/envManager.js.map +1 -0
  98. package/build/component/projectSettingsManager.d.ts +10 -0
  99. package/build/component/projectSettingsManager.d.ts.map +1 -0
  100. package/build/component/projectSettingsManager.js +72 -0
  101. package/build/component/projectSettingsManager.js.map +1 -0
  102. package/build/component/resource/aad.d.ts +11 -0
  103. package/build/component/resource/aad.d.ts.map +1 -0
  104. package/build/component/resource/aad.js +82 -0
  105. package/build/component/resource/aad.js.map +1 -0
  106. package/build/component/resource/azureFunction.d.ts +19 -0
  107. package/build/component/resource/azureFunction.d.ts.map +1 -0
  108. package/build/component/resource/azureFunction.js +81 -0
  109. package/build/component/resource/azureFunction.js.map +1 -0
  110. package/build/component/resource/azureSql.d.ts +24 -0
  111. package/build/component/resource/azureSql.d.ts.map +1 -0
  112. package/build/component/resource/azureSql.js +101 -0
  113. package/build/component/resource/azureSql.js.map +1 -0
  114. package/build/component/resource/azureStorage.d.ts +16 -0
  115. package/build/component/resource/azureStorage.d.ts.map +1 -0
  116. package/build/component/resource/azureStorage.js +102 -0
  117. package/build/component/resource/azureStorage.js.map +1 -0
  118. package/build/component/resource/azureWebApp.d.ts +23 -0
  119. package/build/component/resource/azureWebApp.d.ts.map +1 -0
  120. package/build/component/resource/azureWebApp.js +95 -0
  121. package/build/component/resource/azureWebApp.js.map +1 -0
  122. package/build/component/resource/botService.d.ts +22 -0
  123. package/build/component/resource/botService.d.ts.map +1 -0
  124. package/build/component/resource/botService.js +208 -0
  125. package/build/component/resource/botService.js.map +1 -0
  126. package/build/component/resource/index.d.ts +17 -0
  127. package/build/component/resource/index.d.ts.map +1 -0
  128. package/build/component/resource/index.js +25 -0
  129. package/build/component/resource/index.js.map +1 -0
  130. package/build/component/resource/spfx.d.ts +9 -0
  131. package/build/component/resource/spfx.d.ts.map +1 -0
  132. package/build/component/resource/spfx.js +46 -0
  133. package/build/component/resource/spfx.js.map +1 -0
  134. package/build/component/resource/teamsManifest.d.ts +19 -0
  135. package/build/component/resource/teamsManifest.d.ts.map +1 -0
  136. package/build/component/resource/teamsManifest.js +135 -0
  137. package/build/component/resource/teamsManifest.js.map +1 -0
  138. package/build/component/utils.d.ts +18 -0
  139. package/build/component/utils.d.ts.map +1 -0
  140. package/build/component/utils.js +354 -0
  141. package/build/component/utils.js.map +1 -0
  142. package/build/component/workflow.d.ts +21 -0
  143. package/build/component/workflow.d.ts.map +1 -0
  144. package/build/component/workflow.js +445 -0
  145. package/build/component/workflow.js.map +1 -0
  146. package/build/core/FxCore.d.ts +2 -2
  147. package/build/core/FxCore.d.ts.map +1 -1
  148. package/build/core/FxCore.js +66 -117
  149. package/build/core/FxCore.js.map +1 -1
  150. package/build/core/downloadSample.d.ts.map +1 -1
  151. package/build/core/downloadSample.js +1 -6
  152. package/build/core/downloadSample.js.map +1 -1
  153. package/build/core/environment.d.ts +2 -1
  154. package/build/core/environment.d.ts.map +1 -1
  155. package/build/core/environment.js +20 -10
  156. package/build/core/environment.js.map +1 -1
  157. package/build/core/error.d.ts +0 -1
  158. package/build/core/error.d.ts.map +1 -1
  159. package/build/core/error.js +3 -7
  160. package/build/core/error.js.map +1 -1
  161. package/build/core/generateAadManifestTemplate.d.ts +10 -0
  162. package/build/core/generateAadManifestTemplate.d.ts.map +1 -0
  163. package/build/core/generateAadManifestTemplate.js +100 -0
  164. package/build/core/generateAadManifestTemplate.js.map +1 -0
  165. package/build/core/middleware/MigrationUtils.d.ts +10 -0
  166. package/build/core/middleware/MigrationUtils.d.ts.map +1 -0
  167. package/build/core/middleware/MigrationUtils.js +63 -0
  168. package/build/core/middleware/MigrationUtils.js.map +1 -0
  169. package/build/core/middleware/aadManifestMigration.d.ts.map +1 -1
  170. package/build/core/middleware/aadManifestMigration.js +33 -117
  171. package/build/core/middleware/aadManifestMigration.js.map +1 -1
  172. package/build/core/middleware/consolidateLocalRemote.d.ts.map +1 -1
  173. package/build/core/middleware/consolidateLocalRemote.js +75 -20
  174. package/build/core/middleware/consolidateLocalRemote.js.map +1 -1
  175. package/build/core/middleware/envInfoLoader.d.ts.map +1 -1
  176. package/build/core/middleware/envInfoLoader.js +13 -3
  177. package/build/core/middleware/envInfoLoader.js.map +1 -1
  178. package/build/core/middleware/errorHandler.js +1 -1
  179. package/build/core/middleware/errorHandler.js.map +1 -1
  180. package/build/core/middleware/projectVersionChecker.d.ts +3 -0
  181. package/build/core/middleware/projectVersionChecker.d.ts.map +1 -0
  182. package/build/core/middleware/projectVersionChecker.js +55 -0
  183. package/build/core/middleware/projectVersionChecker.js.map +1 -0
  184. package/build/core/middleware/questionModel.d.ts.map +1 -1
  185. package/build/core/middleware/questionModel.js +85 -28
  186. package/build/core/middleware/questionModel.js.map +1 -1
  187. package/build/core/middleware/questionModelV3.d.ts +6 -0
  188. package/build/core/middleware/questionModelV3.d.ts.map +1 -0
  189. package/build/core/middleware/questionModelV3.js +66 -0
  190. package/build/core/middleware/questionModelV3.js.map +1 -0
  191. package/build/core/question.d.ts +8 -0
  192. package/build/core/question.d.ts.map +1 -1
  193. package/build/core/question.js +105 -11
  194. package/build/core/question.js.map +1 -1
  195. package/build/plugins/resource/aad/aadAppClient.d.ts +1 -1
  196. package/build/plugins/resource/aad/aadAppClient.d.ts.map +1 -1
  197. package/build/plugins/resource/aad/aadAppClient.js +20 -11
  198. package/build/plugins/resource/aad/aadAppClient.js.map +1 -1
  199. package/build/plugins/resource/aad/errors.d.ts +1 -0
  200. package/build/plugins/resource/aad/errors.d.ts.map +1 -1
  201. package/build/plugins/resource/aad/errors.js +8 -1
  202. package/build/plugins/resource/aad/errors.js.map +1 -1
  203. package/build/plugins/resource/aad/plugin.d.ts +1 -1
  204. package/build/plugins/resource/aad/plugin.d.ts.map +1 -1
  205. package/build/plugins/resource/aad/plugin.js +22 -62
  206. package/build/plugins/resource/aad/plugin.js.map +1 -1
  207. package/build/plugins/resource/aad/utils/configs.d.ts +1 -1
  208. package/build/plugins/resource/aad/utils/configs.d.ts.map +1 -1
  209. package/build/plugins/resource/aad/utils/configs.js +13 -7
  210. package/build/plugins/resource/aad/utils/configs.js.map +1 -1
  211. package/build/plugins/resource/apiconnector/checker.d.ts +1 -0
  212. package/build/plugins/resource/apiconnector/checker.d.ts.map +1 -1
  213. package/build/plugins/resource/apiconnector/checker.js +22 -3
  214. package/build/plugins/resource/apiconnector/checker.js.map +1 -1
  215. package/build/plugins/resource/apiconnector/depsHandler.d.ts +1 -0
  216. package/build/plugins/resource/apiconnector/depsHandler.d.ts.map +1 -1
  217. package/build/plugins/resource/apiconnector/depsHandler.js +22 -2
  218. package/build/plugins/resource/apiconnector/depsHandler.js.map +1 -1
  219. package/build/plugins/resource/apiconnector/envHandler.d.ts.map +1 -1
  220. package/build/plugins/resource/apiconnector/envHandler.js +10 -1
  221. package/build/plugins/resource/apiconnector/envHandler.js.map +1 -1
  222. package/build/plugins/resource/apiconnector/errors.d.ts +4 -0
  223. package/build/plugins/resource/apiconnector/errors.d.ts.map +1 -1
  224. package/build/plugins/resource/apiconnector/errors.js +5 -1
  225. package/build/plugins/resource/apiconnector/errors.js.map +1 -1
  226. package/build/plugins/resource/apiconnector/index.d.ts +3 -3
  227. package/build/plugins/resource/apiconnector/index.d.ts.map +1 -1
  228. package/build/plugins/resource/apiconnector/index.js +7 -4
  229. package/build/plugins/resource/apiconnector/index.js.map +1 -1
  230. package/build/plugins/resource/apiconnector/plugin.d.ts +2 -2
  231. package/build/plugins/resource/apiconnector/plugin.d.ts.map +1 -1
  232. package/build/plugins/resource/apiconnector/plugin.js +21 -14
  233. package/build/plugins/resource/apiconnector/plugin.js.map +1 -1
  234. package/build/plugins/resource/apiconnector/questions.d.ts.map +1 -1
  235. package/build/plugins/resource/apiconnector/questions.js +6 -2
  236. package/build/plugins/resource/apiconnector/questions.js.map +1 -1
  237. package/build/plugins/resource/apiconnector/result.d.ts +4 -3
  238. package/build/plugins/resource/apiconnector/result.d.ts.map +1 -1
  239. package/build/plugins/resource/apiconnector/result.js.map +1 -1
  240. package/build/plugins/resource/apiconnector/sampleHandler.d.ts.map +1 -1
  241. package/build/plugins/resource/apiconnector/sampleHandler.js +1 -0
  242. package/build/plugins/resource/apiconnector/sampleHandler.js.map +1 -1
  243. package/build/plugins/resource/apiconnector/telemetry.js +1 -1
  244. package/build/plugins/resource/apim/constants.d.ts +1 -0
  245. package/build/plugins/resource/apim/constants.d.ts.map +1 -1
  246. package/build/plugins/resource/apim/constants.js +1 -0
  247. package/build/plugins/resource/apim/constants.js.map +1 -1
  248. package/build/plugins/resource/apim/index.d.ts.map +1 -1
  249. package/build/plugins/resource/apim/index.js +2 -1
  250. package/build/plugins/resource/apim/index.js.map +1 -1
  251. package/build/plugins/resource/appstudio/appStudio.js +1 -1
  252. package/build/plugins/resource/appstudio/appStudio.js.map +1 -1
  253. package/build/plugins/resource/appstudio/constants.d.ts +2 -0
  254. package/build/plugins/resource/appstudio/constants.d.ts.map +1 -1
  255. package/build/plugins/resource/appstudio/constants.js +2 -0
  256. package/build/plugins/resource/appstudio/constants.js.map +1 -1
  257. package/build/plugins/resource/appstudio/plugin.d.ts.map +1 -1
  258. package/build/plugins/resource/appstudio/plugin.js +9 -3
  259. package/build/plugins/resource/appstudio/plugin.js.map +1 -1
  260. package/build/plugins/resource/appstudio/v3/index.js +1 -1
  261. package/build/plugins/resource/appstudio/v3/index.js.map +1 -1
  262. package/build/plugins/resource/bot/appStudio/appStudio.d.ts +4 -0
  263. package/build/plugins/resource/bot/appStudio/appStudio.d.ts.map +1 -1
  264. package/build/plugins/resource/bot/appStudio/appStudio.js +14 -3
  265. package/build/plugins/resource/bot/appStudio/appStudio.js.map +1 -1
  266. package/build/plugins/resource/bot/azureOps.d.ts +1 -0
  267. package/build/plugins/resource/bot/azureOps.d.ts.map +1 -1
  268. package/build/plugins/resource/bot/azureOps.js +3 -2
  269. package/build/plugins/resource/bot/azureOps.js.map +1 -1
  270. package/build/plugins/resource/bot/configs/teamsBotConfig.js +1 -1
  271. package/build/plugins/resource/bot/configs/teamsBotConfig.js.map +1 -1
  272. package/build/plugins/resource/bot/constants.d.ts +2 -1
  273. package/build/plugins/resource/bot/constants.d.ts.map +1 -1
  274. package/build/plugins/resource/bot/constants.js +2 -1
  275. package/build/plugins/resource/bot/constants.js.map +1 -1
  276. package/build/plugins/resource/bot/index.d.ts.map +1 -1
  277. package/build/plugins/resource/bot/index.js +3 -1
  278. package/build/plugins/resource/bot/index.js.map +1 -1
  279. package/build/plugins/resource/bot/question.d.ts +1 -2
  280. package/build/plugins/resource/bot/question.d.ts.map +1 -1
  281. package/build/plugins/resource/bot/question.js +17 -3
  282. package/build/plugins/resource/bot/question.js.map +1 -1
  283. package/build/plugins/resource/bot/resources/strings.d.ts +1 -0
  284. package/build/plugins/resource/bot/resources/strings.d.ts.map +1 -1
  285. package/build/plugins/resource/bot/utils/common.d.ts +2 -0
  286. package/build/plugins/resource/bot/utils/common.d.ts.map +1 -1
  287. package/build/plugins/resource/bot/utils/common.js +14 -1
  288. package/build/plugins/resource/bot/utils/common.js.map +1 -1
  289. package/build/plugins/resource/bot/v2/common.d.ts +10 -0
  290. package/build/plugins/resource/bot/v2/common.d.ts.map +1 -0
  291. package/build/plugins/resource/bot/v2/common.js +70 -0
  292. package/build/plugins/resource/bot/v2/common.js.map +1 -0
  293. package/build/plugins/resource/bot/v2/enum.d.ts +6 -0
  294. package/build/plugins/resource/bot/v2/enum.d.ts.map +1 -0
  295. package/build/plugins/resource/bot/v2/enum.js +12 -0
  296. package/build/plugins/resource/bot/v2/enum.js.map +1 -0
  297. package/build/plugins/resource/bot/v2/index.d.ts +2 -0
  298. package/build/plugins/resource/bot/v2/index.d.ts.map +1 -1
  299. package/build/plugins/resource/bot/v2/index.js +14 -0
  300. package/build/plugins/resource/bot/v2/index.js.map +1 -1
  301. package/build/plugins/resource/bot/v2/interface/codeTemplateInfo.d.ts +10 -0
  302. package/build/plugins/resource/bot/v2/interface/codeTemplateInfo.d.ts.map +1 -0
  303. package/build/plugins/resource/bot/v2/interface/codeTemplateInfo.js +5 -0
  304. package/build/plugins/resource/bot/v2/interface/codeTemplateInfo.js.map +1 -0
  305. package/build/plugins/resource/bot/v2/mapping.d.ts +7 -0
  306. package/build/plugins/resource/bot/v2/mapping.d.ts.map +1 -0
  307. package/build/plugins/resource/bot/v2/mapping.js +74 -0
  308. package/build/plugins/resource/bot/v2/mapping.js.map +1 -0
  309. package/build/plugins/resource/bot/v2/plugin.d.ts +16 -0
  310. package/build/plugins/resource/bot/v2/plugin.d.ts.map +1 -0
  311. package/build/plugins/resource/bot/v2/plugin.js +129 -0
  312. package/build/plugins/resource/bot/v2/plugin.js.map +1 -0
  313. package/build/plugins/resource/bot/v2/scaffold.d.ts +3 -0
  314. package/build/plugins/resource/bot/v2/scaffold.d.ts.map +1 -0
  315. package/build/plugins/resource/bot/v2/scaffold.js +40 -0
  316. package/build/plugins/resource/bot/v2/scaffold.js.map +1 -0
  317. package/build/plugins/resource/cicd/index.d.ts.map +1 -1
  318. package/build/plugins/resource/cicd/index.js +29 -9
  319. package/build/plugins/resource/cicd/index.js.map +1 -1
  320. package/build/plugins/resource/cicd/questions.d.ts +2 -0
  321. package/build/plugins/resource/cicd/questions.d.ts.map +1 -1
  322. package/build/plugins/resource/cicd/questions.js +3 -1
  323. package/build/plugins/resource/cicd/questions.js.map +1 -1
  324. package/build/plugins/resource/cicd/utils/existingTemplatesStat.d.ts +16 -0
  325. package/build/plugins/resource/cicd/utils/existingTemplatesStat.d.ts.map +1 -0
  326. package/build/plugins/resource/cicd/utils/existingTemplatesStat.js +75 -0
  327. package/build/plugins/resource/cicd/utils/existingTemplatesStat.js.map +1 -0
  328. package/build/plugins/resource/frontend/dotnet/constants.d.ts +0 -10
  329. package/build/plugins/resource/frontend/dotnet/constants.d.ts.map +1 -1
  330. package/build/plugins/resource/frontend/dotnet/constants.js +1 -12
  331. package/build/plugins/resource/frontend/dotnet/constants.js.map +1 -1
  332. package/build/plugins/resource/frontend/dotnet/enum.d.ts +0 -10
  333. package/build/plugins/resource/frontend/dotnet/enum.d.ts.map +1 -1
  334. package/build/plugins/resource/frontend/dotnet/enum.js +1 -12
  335. package/build/plugins/resource/frontend/dotnet/enum.js.map +1 -1
  336. package/build/plugins/resource/frontend/dotnet/ops/scaffold.js +2 -2
  337. package/build/plugins/resource/frontend/dotnet/ops/scaffold.js.map +1 -1
  338. package/build/plugins/resource/frontend/dotnet/plugin.d.ts.map +1 -1
  339. package/build/plugins/resource/frontend/dotnet/plugin.js +9 -24
  340. package/build/plugins/resource/frontend/dotnet/plugin.js.map +1 -1
  341. package/build/plugins/resource/frontend/dotnet/resources/templateInfo.d.ts +2 -7
  342. package/build/plugins/resource/frontend/dotnet/resources/templateInfo.d.ts.map +1 -1
  343. package/build/plugins/resource/frontend/dotnet/resources/templateInfo.js +5 -31
  344. package/build/plugins/resource/frontend/dotnet/resources/templateInfo.js.map +1 -1
  345. package/build/plugins/resource/frontend/resources/errors.js +2 -2
  346. package/build/plugins/resource/frontend/resources/errors.js.map +1 -1
  347. package/build/plugins/resource/function/constants.d.ts +1 -2
  348. package/build/plugins/resource/function/constants.d.ts.map +1 -1
  349. package/build/plugins/resource/function/constants.js +0 -1
  350. package/build/plugins/resource/function/constants.js.map +1 -1
  351. package/build/plugins/resource/function/enums.d.ts +2 -6
  352. package/build/plugins/resource/function/enums.d.ts.map +1 -1
  353. package/build/plugins/resource/function/enums.js +2 -7
  354. package/build/plugins/resource/function/enums.js.map +1 -1
  355. package/build/plugins/resource/function/language-strategy.d.ts +0 -3
  356. package/build/plugins/resource/function/language-strategy.d.ts.map +1 -1
  357. package/build/plugins/resource/function/language-strategy.js +0 -11
  358. package/build/plugins/resource/function/language-strategy.js.map +1 -1
  359. package/build/plugins/resource/function/ops/provision.d.ts +1 -5
  360. package/build/plugins/resource/function/ops/provision.d.ts.map +1 -1
  361. package/build/plugins/resource/function/ops/provision.js +0 -29
  362. package/build/plugins/resource/function/ops/provision.js.map +1 -1
  363. package/build/plugins/resource/function/plugin.d.ts +1 -3
  364. package/build/plugins/resource/function/plugin.d.ts.map +1 -1
  365. package/build/plugins/resource/function/plugin.js +8 -33
  366. package/build/plugins/resource/function/plugin.js.map +1 -1
  367. package/build/plugins/resource/function/resources/errors.js +2 -2
  368. package/build/plugins/resource/function/resources/errors.js.map +1 -1
  369. package/build/plugins/resource/function/v3/index.d.ts +1 -1
  370. package/build/plugins/resource/function/v3/index.d.ts.map +1 -1
  371. package/build/plugins/resource/function/v3/index.js +9 -12
  372. package/build/plugins/resource/function/v3/index.js.map +1 -1
  373. package/build/plugins/solution/fx-solution/arm.d.ts.map +1 -1
  374. package/build/plugins/solution/fx-solution/arm.js +5 -7
  375. package/build/plugins/solution/fx-solution/arm.js.map +1 -1
  376. package/build/plugins/solution/fx-solution/constants.d.ts +13 -2
  377. package/build/plugins/solution/fx-solution/constants.d.ts.map +1 -1
  378. package/build/plugins/solution/fx-solution/constants.js +13 -1
  379. package/build/plugins/solution/fx-solution/constants.js.map +1 -1
  380. package/build/plugins/solution/fx-solution/debug/error.d.ts.map +1 -1
  381. package/build/plugins/solution/fx-solution/debug/error.js +7 -1
  382. package/build/plugins/solution/fx-solution/debug/error.js.map +1 -1
  383. package/build/plugins/solution/fx-solution/debug/provisionLocal.d.ts.map +1 -1
  384. package/build/plugins/solution/fx-solution/debug/provisionLocal.js +17 -0
  385. package/build/plugins/solution/fx-solution/debug/provisionLocal.js.map +1 -1
  386. package/build/plugins/solution/fx-solution/debug/scaffolding.d.ts.map +1 -1
  387. package/build/plugins/solution/fx-solution/debug/scaffolding.js +32 -29
  388. package/build/plugins/solution/fx-solution/debug/scaffolding.js.map +1 -1
  389. package/build/plugins/solution/fx-solution/debug/util/launchNext.d.ts +1 -0
  390. package/build/plugins/solution/fx-solution/debug/util/launchNext.d.ts.map +1 -1
  391. package/build/plugins/solution/fx-solution/debug/util/launchNext.js +49 -9
  392. package/build/plugins/solution/fx-solution/debug/util/launchNext.js.map +1 -1
  393. package/build/plugins/solution/fx-solution/debug/util/settings.d.ts +2 -1
  394. package/build/plugins/solution/fx-solution/debug/util/settings.d.ts.map +1 -1
  395. package/build/plugins/solution/fx-solution/debug/util/settings.js +22 -2
  396. package/build/plugins/solution/fx-solution/debug/util/settings.js.map +1 -1
  397. package/build/plugins/solution/fx-solution/debug/util/tasksNext.d.ts +1 -0
  398. package/build/plugins/solution/fx-solution/debug/util/tasksNext.d.ts.map +1 -1
  399. package/build/plugins/solution/fx-solution/debug/util/tasksNext.js +40 -2
  400. package/build/plugins/solution/fx-solution/debug/util/tasksNext.js.map +1 -1
  401. package/build/plugins/solution/fx-solution/question.d.ts +12 -1
  402. package/build/plugins/solution/fx-solution/question.d.ts.map +1 -1
  403. package/build/plugins/solution/fx-solution/question.js +130 -22
  404. package/build/plugins/solution/fx-solution/question.js.map +1 -1
  405. package/build/plugins/solution/fx-solution/utils/ResourceGroupHelper.js +1 -1
  406. package/build/plugins/solution/fx-solution/utils/ResourceGroupHelper.js.map +1 -1
  407. package/build/plugins/solution/fx-solution/v2/deploy.d.ts.map +1 -1
  408. package/build/plugins/solution/fx-solution/v2/deploy.js +37 -4
  409. package/build/plugins/solution/fx-solution/v2/deploy.js.map +1 -1
  410. package/build/plugins/solution/fx-solution/v2/executeUserTask.d.ts +1 -1
  411. package/build/plugins/solution/fx-solution/v2/executeUserTask.d.ts.map +1 -1
  412. package/build/plugins/solution/fx-solution/v2/executeUserTask.js +113 -65
  413. package/build/plugins/solution/fx-solution/v2/executeUserTask.js.map +1 -1
  414. package/build/plugins/solution/fx-solution/v2/getQuestions.d.ts +6 -0
  415. package/build/plugins/solution/fx-solution/v2/getQuestions.d.ts.map +1 -1
  416. package/build/plugins/solution/fx-solution/v2/getQuestions.js +277 -2
  417. package/build/plugins/solution/fx-solution/v2/getQuestions.js.map +1 -1
  418. package/build/plugins/solution/fx-solution/v2/provision.d.ts.map +1 -1
  419. package/build/plugins/solution/fx-solution/v2/provision.js +48 -20
  420. package/build/plugins/solution/fx-solution/v2/provision.js.map +1 -1
  421. package/build/plugins/solution/fx-solution/v2/provisionLocal.d.ts.map +1 -1
  422. package/build/plugins/solution/fx-solution/v2/provisionLocal.js +8 -5
  423. package/build/plugins/solution/fx-solution/v2/provisionLocal.js.map +1 -1
  424. package/build/plugins/solution/fx-solution/v2/publish.js +1 -1
  425. package/build/plugins/solution/fx-solution/v2/publish.js.map +1 -1
  426. package/build/plugins/solution/fx-solution/v2/solution.d.ts.map +1 -1
  427. package/build/plugins/solution/fx-solution/v2/solution.js +4 -1
  428. package/build/plugins/solution/fx-solution/v2/solution.js.map +1 -1
  429. package/build/plugins/solution/fx-solution/v2/utils.d.ts +7 -0
  430. package/build/plugins/solution/fx-solution/v2/utils.d.ts.map +1 -1
  431. package/build/plugins/solution/fx-solution/v2/utils.js +23 -1
  432. package/build/plugins/solution/fx-solution/v2/utils.js.map +1 -1
  433. package/package.json +8 -3
  434. package/resource/aad-manifest-change-logs.md +27 -0
  435. package/resource/package.nls.json +93 -54
  436. package/resource/{unify-config-change-logs.md → unify-config-and-aad-manifest-change-logs.md} +10 -3
  437. package/templates/bicep/azureSql.parameters.json +4 -0
  438. package/templates/bicep/azureSql.provisionDatabase.module.bicep +15 -0
  439. package/templates/bicep/azureSql.provisionDatabase.orchestration.bicep +5 -0
  440. package/templates/bicep/azureSql.provisionServer.module.bicep +44 -0
  441. package/templates/bicep/azureSql.provisionServer.orchestration.bicep +14 -0
  442. package/templates/bicep/azureWebApp.config.module.bicep +63 -0
  443. package/templates/bicep/azureWebApp.config.orchestration.bicep +12 -0
  444. package/templates/bicep/azureWebApp.parameters.json +4 -0
  445. package/templates/bicep/azureWebApp.provision.module.bicep +50 -0
  446. package/templates/bicep/azureWebApp.provision.orchestration.bicep +18 -0
  447. package/templates/bicep/botService.config.module.bicep +33 -0
  448. package/templates/bicep/botService.config.orchestration.bicep +8 -0
  449. package/templates/bicep/config.bicep +3 -0
  450. package/templates/bicep/main.bicep +18 -0
  451. package/templates/bicep/provision.bicep +2 -0
  452. package/templates/core/README.md +4 -4
  453. package/templates/fallback/blazor-base.csharp.default.zip +0 -0
  454. package/templates/fallback/bot.csharp.default.zip +0 -0
  455. package/templates/fallback/bot.csharp.notification-webapi.zip +0 -0
  456. package/templates/fallback/bot.js.command-and-response.zip +0 -0
  457. package/templates/fallback/bot.js.default.zip +0 -0
  458. package/templates/fallback/bot.js.m365.zip +0 -0
  459. package/templates/fallback/bot.js.notification-function-base.zip +0 -0
  460. package/templates/fallback/bot.js.notification-restify.zip +0 -0
  461. package/templates/fallback/bot.js.notification-trigger-http.zip +0 -0
  462. package/templates/fallback/bot.js.notification-trigger-timer.zip +0 -0
  463. package/templates/fallback/bot.ts.command-and-response.zip +0 -0
  464. package/templates/fallback/bot.ts.default.zip +0 -0
  465. package/templates/fallback/bot.ts.m365.zip +0 -0
  466. package/templates/fallback/bot.ts.notification-function-base.zip +0 -0
  467. package/templates/fallback/bot.ts.notification-restify.zip +0 -0
  468. package/templates/fallback/bot.ts.notification-trigger-http.zip +0 -0
  469. package/templates/fallback/bot.ts.notification-trigger-timer.zip +0 -0
  470. package/templates/fallback/bot.ts.notification.zip +0 -0
  471. package/templates/fallback/function-base.js.default.zip +0 -0
  472. package/templates/fallback/function-base.ts.default.zip +0 -0
  473. package/templates/fallback/function-triggers.js.HTTPTrigger.zip +0 -0
  474. package/templates/fallback/function-triggers.ts.HTTPTrigger.zip +0 -0
  475. package/templates/fallback/tab.csharp.default.zip +0 -0
  476. package/templates/fallback/tab.js.default.zip +0 -0
  477. package/templates/fallback/tab.js.m365.zip +0 -0
  478. package/templates/fallback/tab.js.non-sso.zip +0 -0
  479. package/templates/fallback/tab.ts.default.zip +0 -0
  480. package/templates/fallback/tab.ts.m365.zip +0 -0
  481. package/templates/fallback/tab.ts.non-sso.zip +0 -0
  482. package/templates/plugins/resource/aad/auth/bot/README.md +212 -9
  483. package/templates/plugins/resource/aad/auth/bot/js/public/auth-end.html +4 -1
  484. package/templates/plugins/resource/aad/auth/bot/js/public/auth-start.html +1 -0
  485. package/templates/plugins/resource/aad/auth/bot/js/sso/showUserInfo.js +19 -2
  486. package/templates/plugins/resource/aad/auth/bot/js/sso/ssoDialog.js +46 -18
  487. package/templates/plugins/resource/aad/auth/bot/js/sso/teamsSsoBot.js +13 -5
  488. package/templates/plugins/resource/aad/auth/bot/ts/public/auth-end.html +4 -1
  489. package/templates/plugins/resource/aad/auth/bot/ts/public/auth-start.html +1 -0
  490. package/templates/plugins/resource/aad/auth/bot/ts/sso/showUserInfo.ts +15 -1
  491. package/templates/plugins/resource/aad/auth/bot/ts/sso/ssoDialog.ts +42 -11
  492. package/templates/plugins/resource/aad/auth/bot/ts/sso/teamsSsoBot.ts +7 -1
  493. package/templates/plugins/resource/aad/auth/tab/README.md +44 -8
  494. package/templates/plugins/resource/aad/auth/tab/js/public/auth-end.html +1 -3
  495. package/templates/plugins/resource/aad/auth/tab/js/public/auth-start.html +1 -3
  496. package/templates/plugins/resource/aad/auth/tab/js/sso/GetUserProfile.jsx +23 -11
  497. package/templates/plugins/resource/aad/auth/tab/js/sso/InitTeamsFx.jsx +20 -0
  498. package/templates/plugins/resource/aad/auth/tab/ts/public/auth-end.html +1 -3
  499. package/templates/plugins/resource/aad/auth/tab/ts/public/auth-start.html +1 -3
  500. package/templates/plugins/resource/aad/auth/tab/ts/sso/GetUserProfile.tsx +25 -12
  501. package/templates/plugins/resource/aad/auth/tab/ts/sso/InitTeamsFx.tsx +20 -0
  502. package/templates/plugins/resource/apiconnector/package.json +1 -1
  503. package/templates/plugins/resource/apiconnector/sample/headerComment.template +20 -6
  504. package/templates/plugins/resource/apiconnector/sample/js/aad.template +1 -1
  505. package/templates/plugins/resource/apiconnector/sample/js/apikey.template +2 -2
  506. package/templates/plugins/resource/apiconnector/sample/js/basic.template +1 -1
  507. package/templates/plugins/resource/apiconnector/sample/js/cert.template +1 -1
  508. package/templates/plugins/resource/apiconnector/sample/js/custom.template +1 -1
  509. package/templates/plugins/resource/apiconnector/sample/ts/aad.template +1 -1
  510. package/templates/plugins/resource/apiconnector/sample/ts/apikey.template +1 -1
  511. package/templates/plugins/resource/bot/bicep/funcHostedBotProvision.template.bicep +2 -2
  512. package/templates/plugins/resource/cicd/azdo/cd.yml +2 -1
  513. package/templates/plugins/resource/cicd/jenkins/Jenkinsfile.cd +2 -3
  514. package/templates/plugins/resource/function/bicep/functionProvision.template.bicep +2 -2
  515. package/templates/plugins/resource/hosting/bicep/botservice/botserviceProvision.template.bicep +34 -0
  516. package/templates/plugins/resource/hosting/bicep/botservice/parameters.json +4 -0
  517. package/templates/plugins/resource/hosting/bicep/botservice/provision.template.bicep +8 -0
  518. package/templates/plugins/resource/hosting/bicep/function/config.template.bicep +12 -0
  519. package/templates/plugins/resource/hosting/bicep/function/functionConfiguration.template.bicep +71 -0
  520. package/templates/plugins/resource/hosting/bicep/function/functionProvision.template.bicep +99 -0
  521. package/templates/plugins/resource/hosting/bicep/function/provision.template.bicep +20 -0
  522. package/templates/plugins/resource/keyvault/bicep/keyVaultProvision.template.bicep +1 -1
  523. package/templates/plugins/resource/spfx/solution/README.md +3 -3
  524. package/build/plugins/resource/function/utils/node-version.d.ts +0 -2
  525. package/build/plugins/resource/function/utils/node-version.d.ts.map +0 -1
  526. package/build/plugins/resource/function/utils/node-version.js +0 -21
  527. package/build/plugins/resource/function/utils/node-version.js.map +0 -1
@@ -0,0 +1,714 @@
1
+ "use strict";
2
+ // Copyright (c) Microsoft Corporation.
3
+ // Licensed under the MIT license.
4
+ Object.defineProperty(exports, "__esModule", { value: true });
5
+ 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 projectSettingsHelper_1 = require("./../common/projectSettingsHelper");
13
+ const projectSettingsLoader_1 = require("../core/middleware/projectSettingsLoader");
14
+ const question_1 = require("../core/question");
15
+ const workflow_1 = require("./workflow");
16
+ require("./resource");
17
+ require("./bicep");
18
+ require("./botCode");
19
+ require("./connection");
20
+ require("./envManager");
21
+ require("./debugManager");
22
+ const plugins_1 = require("../plugins");
23
+ const projectSettingsManager_1 = require("./projectSettingsManager");
24
+ const constants_1 = require("../plugins/resource/bot/constants");
25
+ const question_2 = require("../plugins/resource/bot/question");
26
+ let TeamsfxCore = class TeamsfxCore {
27
+ constructor() {
28
+ this.name = "fx";
29
+ // addTab(
30
+ // context: ContextV3,
31
+ // inputs: InputsWithProjectPath
32
+ // ): MaybePromise<Result<Action | undefined, FxError>> {
33
+ // const actions: Action[] = [
34
+ // {
35
+ // name: "fx.configTab",
36
+ // type: "function",
37
+ // plan: (context: ContextV3, inputs: InputsWithProjectPath) => {
38
+ // return ok([`add component 'teams-tab' in projectSettings: ${JSON.stringify(inputs)}`]);
39
+ // },
40
+ // execute: async (
41
+ // context: ContextV3,
42
+ // inputs: InputsWithProjectPath
43
+ // ): Promise<Result<undefined, FxError>> => {
44
+ // const projectSettings = context.projectSetting as ProjectSettingsV3;
45
+ // const teamsTabResource: Component = {
46
+ // name: "teams-tab",
47
+ // ...inputs,
48
+ // };
49
+ // projectSettings.components.push(teamsTabResource);
50
+ // console.log(
51
+ // `add component 'teams-tab' in projectSettings: ${JSON.stringify(teamsTabResource)}`
52
+ // );
53
+ // return ok(undefined);
54
+ // },
55
+ // },
56
+ // {
57
+ // name: "call:tab-code.generate",
58
+ // type: "call",
59
+ // required: true,
60
+ // targetAction: "tab-code.generate",
61
+ // },
62
+ // {
63
+ // name: "call:azure-bicep.generate",
64
+ // type: "call",
65
+ // required: false,
66
+ // targetAction: "azure-bicep.generate",
67
+ // inputs: {
68
+ // "azure-bicep": {
69
+ // resources: [inputs.hosting],
70
+ // },
71
+ // },
72
+ // },
73
+ // {
74
+ // name: "call:teams-manifest.addCapability",
75
+ // type: "call",
76
+ // required: true,
77
+ // targetAction: "teams-manifest.addCapability",
78
+ // inputs: {
79
+ // "teams-manifest": {
80
+ // capabilities: [{ name: "staticTab" }],
81
+ // },
82
+ // },
83
+ // },
84
+ // ];
85
+ // const group: GroupAction = {
86
+ // type: "group",
87
+ // name: "fx.addTab",
88
+ // mode: "parallel",
89
+ // actions: actions,
90
+ // };
91
+ // return ok(group);
92
+ // }
93
+ // preProvision(
94
+ // context: ContextV3,
95
+ // inputs: InputsWithProjectPath
96
+ // ): MaybePromise<Result<Action | undefined, FxError>> {
97
+ // const action: Action = {
98
+ // type: "function",
99
+ // name: "fx.preProvision",
100
+ // plan: (context: ContextV3, inputs: InputsWithProjectPath) => {
101
+ // return ok(["pre step before provision (tenant, subscription, resource group)"]);
102
+ // },
103
+ // execute: async (context: ContextV3, inputs: InputsWithProjectPath) => {
104
+ // const ctx = context as ProvisionContextV3;
105
+ // const envInfo = ctx.envInfo;
106
+ // const solutionSetting = ctx.projectSetting.solutionSettings as
107
+ // | AzureSolutionSettings
108
+ // | undefined;
109
+ // // 1. check M365 tenant
110
+ // if (!envInfo.state["teams-manifest"]) envInfo.state["teams-manifest"] = {};
111
+ // const teamsAppResource = envInfo.state["teams-manifest"] as v3.TeamsAppResource;
112
+ // if (!envInfo.state.solution) envInfo.state.solution = {};
113
+ // const solutionConfig = envInfo.state.solution as v3.AzureSolutionConfig;
114
+ // solutionConfig.provisionSucceeded = false;
115
+ // const tenantIdInConfig = teamsAppResource.tenantId;
116
+ // const tenantIdInTokenRes = await getM365TenantId(ctx.tokenProvider.appStudioToken);
117
+ // if (tenantIdInTokenRes.isErr()) {
118
+ // return err(tenantIdInTokenRes.error);
119
+ // }
120
+ // const tenantIdInToken = tenantIdInTokenRes.value;
121
+ // if (tenantIdInConfig && tenantIdInToken && tenantIdInToken !== tenantIdInConfig) {
122
+ // return err(
123
+ // new UserError(
124
+ // "Solution",
125
+ // SolutionError.TeamsAppTenantIdNotRight,
126
+ // `The signed in M365 account does not match the M365 tenant in config file for '${envInfo.envName}' environment. Please sign out and sign in with the correct M365 account.`
127
+ // )
128
+ // );
129
+ // }
130
+ // if (!tenantIdInConfig) {
131
+ // teamsAppResource.tenantId = tenantIdInToken;
132
+ // solutionConfig.teamsAppTenantId = tenantIdInToken;
133
+ // }
134
+ // // 3. check Azure configs
135
+ // if (hasAzureResourceV3(ctx.projectSetting) && envInfo.envName !== "local") {
136
+ // // ask common question and fill in solution config
137
+ // const solutionConfigRes = await fillInAzureConfigs(
138
+ // ctx,
139
+ // inputs,
140
+ // envInfo as v3.EnvInfoV3,
141
+ // ctx.tokenProvider
142
+ // );
143
+ // if (solutionConfigRes.isErr()) {
144
+ // return err(solutionConfigRes.error);
145
+ // }
146
+ // // ask for provision consent
147
+ // const consentResult = await askForProvisionConsent(
148
+ // ctx,
149
+ // ctx.tokenProvider.azureAccountProvider,
150
+ // envInfo as v3.EnvInfoV3
151
+ // );
152
+ // if (consentResult.isErr()) {
153
+ // return err(consentResult.error);
154
+ // }
155
+ // // create resource group if needed
156
+ // if (solutionConfig.needCreateResourceGroup) {
157
+ // const createRgRes = await resourceGroupHelper.createNewResourceGroup(
158
+ // solutionConfig.resourceGroupName,
159
+ // ctx.tokenProvider.azureAccountProvider,
160
+ // solutionConfig.subscriptionId,
161
+ // solutionConfig.location
162
+ // );
163
+ // if (createRgRes.isErr()) {
164
+ // return err(createRgRes.error);
165
+ // }
166
+ // }
167
+ // }
168
+ // // ctx.envInfo.state.solution = {
169
+ // // tenantId: "MockTenantId",
170
+ // // subscriptionId: "MockSubscriptionId",
171
+ // // resourceGroup: "MockResourceGroup",
172
+ // // };
173
+ // // ctx.envInfo.state["teams-manifest"] = {
174
+ // // tenantId: "MockTenantId",
175
+ // // };
176
+ // return ok(["pre step before provision (tenant, subscription, resource group)"]);
177
+ // },
178
+ // };
179
+ // return ok(action);
180
+ // }
181
+ // provision(
182
+ // context: ContextV3,
183
+ // inputs: InputsWithProjectPath
184
+ // ): MaybePromise<Result<Action | undefined, FxError>> {
185
+ // const ctx = context as ProvisionContextV3;
186
+ // const projectSettings = context.projectSetting as ProjectSettingsV3;
187
+ // const resourcesToProvision = projectSettings.components.filter((r) => r.provision);
188
+ // const provisionActions: Action[] = resourcesToProvision.map((r) => {
189
+ // return {
190
+ // type: "call",
191
+ // name: `call:${r.name}.provision`,
192
+ // required: false,
193
+ // targetAction: `${r.name}.provision`,
194
+ // };
195
+ // });
196
+ // const loadEnvStep: Action = {
197
+ // type: "call",
198
+ // targetAction: "env-manager.read",
199
+ // required: true,
200
+ // };
201
+ // const writeEnvStep: Action = {
202
+ // type: "call",
203
+ // targetAction: "env-manager.write",
204
+ // required: true,
205
+ // };
206
+ // const configureActions: Action[] = resourcesToProvision.map((r) => {
207
+ // return {
208
+ // type: "call",
209
+ // name: `call:${r.name}.configure`,
210
+ // required: false,
211
+ // targetAction: `${r.name}.configure`,
212
+ // };
213
+ // });
214
+ // const setupLocalEnvironmentStep: Action = {
215
+ // type: "call",
216
+ // name: "call debug-manager.setupLocalEnvironment",
217
+ // targetAction: "debug-manager.setupLocalEnvironment",
218
+ // required: false,
219
+ // };
220
+ // const configLocalEnvironmentStep: Action = {
221
+ // type: "call",
222
+ // name: "call debug-manager.configLocalEnvironmentStep",
223
+ // targetAction: "debug-manager.configLocalEnvironmentStep",
224
+ // required: false,
225
+ // };
226
+ // const preProvisionStep: Action = {
227
+ // type: "call",
228
+ // name: "call fx.preProvision",
229
+ // targetAction: "fx.preProvision",
230
+ // required: true,
231
+ // };
232
+ // const createTeamsAppStep: Action = {
233
+ // type: "call",
234
+ // name: "call teams-manifest.provision",
235
+ // targetAction: "teams-manifest.provision",
236
+ // required: true,
237
+ // };
238
+ // const updateTeamsAppStep: Action = {
239
+ // type: "call",
240
+ // name: "call teams-manifest.configure",
241
+ // targetAction: "teams-manifest.configure",
242
+ // required: true,
243
+ // };
244
+ // const provisionResourcesStep: Action = {
245
+ // type: "group",
246
+ // name: "resources.provision",
247
+ // mode: "parallel",
248
+ // actions: provisionActions,
249
+ // };
250
+ // const configureResourcesStep: Action = {
251
+ // type: "group",
252
+ // name: "resources.configure",
253
+ // mode: "parallel",
254
+ // actions: configureActions,
255
+ // };
256
+ // const deployBicepStep: Action = {
257
+ // type: "call",
258
+ // name: "call:bicep.deploy",
259
+ // required: true,
260
+ // targetAction: "bicep.deploy",
261
+ // };
262
+ // const postProvisionStep: Action = {
263
+ // type: "function",
264
+ // name: "fx.postProvision",
265
+ // plan: (context: ContextV3, inputs: InputsWithProjectPath) => {
266
+ // return ok([]);
267
+ // },
268
+ // execute: (context: ContextV3, inputs: InputsWithProjectPath) => {
269
+ // const ctx = context as ProvisionContextV3;
270
+ // const url = getResourceGroupInPortal(
271
+ // ctx.envInfo.state.solution.subscriptionId,
272
+ // ctx.envInfo.state.solution.tenantId,
273
+ // ctx.envInfo.state.solution.resourceGroupName
274
+ // );
275
+ // const msg = getLocalizedString("core.provision.successAzure");
276
+ // if (url) {
277
+ // const title = "View Provisioned Resources";
278
+ // ctx.userInteraction.showMessage("info", msg, false, title).then((result: any) => {
279
+ // const userSelected = result.isOk() ? result.value : undefined;
280
+ // if (userSelected === title) {
281
+ // ctx.userInteraction.openUrl(url);
282
+ // }
283
+ // });
284
+ // } else {
285
+ // ctx.userInteraction.showMessage("info", msg, false);
286
+ // }
287
+ // return ok([]);
288
+ // },
289
+ // };
290
+ // const preConfigureStep: Action = {
291
+ // type: "function",
292
+ // name: "fx.preConfigure",
293
+ // plan: (context: ContextV3, inputs: InputsWithProjectPath) => {
294
+ // return ok([]);
295
+ // },
296
+ // execute: (context: ContextV3, inputs: InputsWithProjectPath) => {
297
+ // const projectSettings = context.projectSetting as ProjectSettingsV3;
298
+ // const teamsTab = getComponent(projectSettings, "teams-tab") as Component;
299
+ // const aad = getComponent(projectSettings, "aad");
300
+ // if (aad) {
301
+ // if (teamsTab) {
302
+ // const tabEndpoint = context.envInfo?.state[teamsTab.hosting!].endpoint;
303
+ // inputs.m365ApplicationIdUri = `api://${tabEndpoint}`;
304
+ // }
305
+ // }
306
+ // return ok([]);
307
+ // },
308
+ // };
309
+ // const provisionSequences: Action[] = [
310
+ // LoadProjectSettingsAction,
311
+ // loadEnvStep,
312
+ // preProvisionStep,
313
+ // createTeamsAppStep,
314
+ // provisionResourcesStep,
315
+ // ctx.envInfo.envName !== "local" ? deployBicepStep : setupLocalEnvironmentStep,
316
+ // preConfigureStep,
317
+ // configureResourcesStep,
318
+ // ctx.envInfo.envName === "local" ? configLocalEnvironmentStep : postProvisionStep,
319
+ // updateTeamsAppStep,
320
+ // writeEnvStep,
321
+ // WriteProjectSettingsAction,
322
+ // ];
323
+ // const result: Action = {
324
+ // name: "fx.provision",
325
+ // type: "group",
326
+ // actions: provisionSequences,
327
+ // };
328
+ // return ok(result);
329
+ // }
330
+ // build(context: ContextV3, inputs: InputsWithProjectPath): Result<Action | undefined, FxError> {
331
+ // const projectSettings = context.projectSetting as ProjectSettingsV3;
332
+ // const actions: Action[] = projectSettings.components
333
+ // .filter((resource) => resource.build)
334
+ // .map((resource) => {
335
+ // return {
336
+ // name: `call:${resource.name}.build`,
337
+ // type: "call",
338
+ // targetAction: `${resource.name}.build`,
339
+ // required: false,
340
+ // };
341
+ // });
342
+ // const group: Action = {
343
+ // type: "group",
344
+ // mode: "parallel",
345
+ // actions: actions,
346
+ // };
347
+ // return ok(group);
348
+ // }
349
+ // deploy(
350
+ // context: ContextV3,
351
+ // inputs: InputsWithProjectPath
352
+ // ): MaybePromise<Result<Action | undefined, FxError>> {
353
+ // const projectSettings = context.projectSetting as ProjectSettingsV3;
354
+ // const actions: Action[] = [
355
+ // {
356
+ // name: "call:fx.build",
357
+ // type: "call",
358
+ // targetAction: "fx.build",
359
+ // required: false,
360
+ // },
361
+ // ];
362
+ // projectSettings.components
363
+ // .filter((resource) => resource.build && resource.hosting)
364
+ // .forEach((resource) => {
365
+ // actions.push({
366
+ // type: "call",
367
+ // targetAction: `${resource.hosting}.deploy`,
368
+ // required: false,
369
+ // inputs: {
370
+ // [resource.hosting!]: {
371
+ // folder: resource.folder,
372
+ // },
373
+ // },
374
+ // });
375
+ // });
376
+ // const action: GroupAction = {
377
+ // type: "group",
378
+ // name: "fx.deploy",
379
+ // actions: actions,
380
+ // };
381
+ // return ok(action);
382
+ // }
383
+ }
384
+ init(context, inputs) {
385
+ const initProjectSettings = {
386
+ type: "function",
387
+ name: "fx.initConfig",
388
+ plan: (context, inputs) => {
389
+ return teamsfx_api_1.ok([
390
+ {
391
+ type: "file",
392
+ operate: "create",
393
+ filePath: projectSettingsLoader_1.getProjectSettingsPath(inputs.projectPath),
394
+ },
395
+ ]);
396
+ },
397
+ question: (context, inputs) => {
398
+ const question = {
399
+ type: "text",
400
+ name: "app-name",
401
+ title: "Application name",
402
+ validation: {
403
+ pattern: question_1.ProjectNamePattern,
404
+ maxLength: 30,
405
+ },
406
+ placeholder: "Application name",
407
+ };
408
+ return teamsfx_api_1.ok(new teamsfx_api_1.QTreeNode(question));
409
+ },
410
+ execute: async (context, inputs) => {
411
+ const projectSettings = projectSettingsHelper_1.newProjectSettings();
412
+ projectSettings.appName = workflow_1.getEmbeddedValueByPath(inputs, "app-name");
413
+ projectSettings.components = [];
414
+ context.projectSetting = projectSettings;
415
+ await fs_extra_1.default.ensureDir(inputs.projectPath);
416
+ await fs_extra_1.default.ensureDir(path_1.default.join(inputs.projectPath, `.${teamsfx_api_1.ConfigFolderName}`));
417
+ await fs_extra_1.default.ensureDir(path_1.default.join(inputs.projectPath, `.${teamsfx_api_1.ConfigFolderName}`, "configs"));
418
+ return teamsfx_api_1.ok([
419
+ {
420
+ type: "file",
421
+ operate: "create",
422
+ filePath: projectSettingsLoader_1.getProjectSettingsPath(inputs.projectPath),
423
+ },
424
+ ]);
425
+ },
426
+ };
427
+ const action = {
428
+ type: "group",
429
+ name: "fx.init",
430
+ actions: [
431
+ initProjectSettings,
432
+ {
433
+ type: "call",
434
+ targetAction: "teams-manifest.init",
435
+ required: true,
436
+ },
437
+ {
438
+ type: "call",
439
+ targetAction: "env-manager.create",
440
+ required: true,
441
+ },
442
+ projectSettingsManager_1.WriteProjectSettingsAction,
443
+ ],
444
+ };
445
+ return teamsfx_api_1.ok(action);
446
+ }
447
+ /**
448
+ *
449
+ * capability = Notification
450
+ * bot-host-type-trigger = http-restify
451
+ * group=bot, scenario=notification-restify, host=app-service
452
+ * bot-host-type-trigger = [http-functions, timer-functions]
453
+ * group=bot, host=function, scenario=notification-function-base + [notification-trigger-http, notification-trigger-timer]
454
+ * capability = command-bot:
455
+ * group=bot, host=app-service, scenario=command-and-response
456
+ * capability = Bot
457
+ * group=bot, host=app-service, scenario=default
458
+ * capability = MessagingExtension
459
+ * group=bot, host=app-service, scenario=default
460
+ */
461
+ /**
462
+ * 1. config bot in project settings
463
+ * 2. generate bot source code
464
+ * 3. generate bot-service and hosting bicep
465
+ * 3. overwrite hosting config bicep
466
+ * 4. persist bicep
467
+ * 5. add capability in teams manifest
468
+ */
469
+ addBot(context, inputs) {
470
+ const feature = inputs.feature;
471
+ const triggers = inputs[constants_1.QuestionNames.BOT_HOST_TYPE_TRIGGER];
472
+ inputs.hosting = "azure-web-app";
473
+ const scenarios = [];
474
+ if (feature === plugins_1.NotificationOptionItem.id) {
475
+ if (triggers.includes(question_2.AppServiceOptionItem.id)) {
476
+ scenarios.push(constants_1.TemplateProjectsScenarios.NOTIFICATION_RESTIFY_SCENARIO_NAME);
477
+ }
478
+ else {
479
+ inputs.hosting = "azure-function";
480
+ if (triggers.includes(question_2.FunctionsHttpTriggerOptionItem.id)) {
481
+ scenarios.push(constants_1.TemplateProjectsScenarios.NOTIFICATION_FUNCTION_TRIGGER_HTTP_SCENARIO_NAME);
482
+ }
483
+ if (triggers.includes(question_2.FunctionsTimerTriggerOptionItem.id)) {
484
+ scenarios.push(constants_1.TemplateProjectsScenarios.NOTIFICATION_FUNCTION_TRIGGER_TIMER_SCENARIO_NAME);
485
+ }
486
+ }
487
+ }
488
+ else if (feature === plugins_1.CommandAndResponseOptionItem.id) {
489
+ scenarios.push(constants_1.TemplateProjectsScenarios.COMMAND_AND_RESPONSE_SCENARIO_NAME);
490
+ }
491
+ else {
492
+ scenarios.push(constants_1.TemplateProjectsScenarios.DEFAULT_SCENARIO_NAME);
493
+ }
494
+ const actions = [
495
+ projectSettingsManager_1.LoadProjectSettingsAction,
496
+ {
497
+ name: "fx.configBot",
498
+ type: "function",
499
+ plan: (context, inputs) => {
500
+ const remarks = [
501
+ `add components 'teams-bot', '${inputs.hosting}', 'bot-service' in projectSettings`,
502
+ ];
503
+ // connect to azure-sql
504
+ if (workflow_1.getComponent(context.projectSetting, "azure-sql")) {
505
+ remarks.push(`connect 'azure-sql' to hosting component '${inputs.hosting}' in projectSettings`);
506
+ }
507
+ return teamsfx_api_1.ok(remarks);
508
+ },
509
+ execute: async (context, inputs) => {
510
+ const projectSettings = context.projectSetting;
511
+ // add teams-bot
512
+ projectSettings.components.push({
513
+ name: "teams-bot",
514
+ hosting: inputs.hosting,
515
+ });
516
+ // add hosting component
517
+ const hostingComponent = {
518
+ name: inputs.hosting,
519
+ connections: ["teams-bot"],
520
+ };
521
+ projectSettings.components.push(hostingComponent);
522
+ //add bot-service
523
+ projectSettings.components.push({
524
+ name: "bot-service",
525
+ provision: true,
526
+ });
527
+ const remarks = [
528
+ `add components 'teams-bot', '${inputs.hosting}', 'bot-service' in projectSettings`,
529
+ ];
530
+ // connect azure-sql to hosting component
531
+ if (workflow_1.getComponent(context.projectSetting, "azure-sql")) {
532
+ hostingComponent.connections.push("azure-sql");
533
+ remarks.push(`connect 'azure-sql' to hosting component '${inputs.hosting}' in projectSettings`);
534
+ }
535
+ return teamsfx_api_1.ok([
536
+ {
537
+ type: "file",
538
+ operate: "replace",
539
+ filePath: projectSettingsLoader_1.getProjectSettingsPath(inputs.projectPath),
540
+ remarks: remarks.join(";"),
541
+ },
542
+ ]);
543
+ },
544
+ },
545
+ {
546
+ name: "call:bot-code.generate",
547
+ type: "call",
548
+ required: true,
549
+ targetAction: "bot-code.generate",
550
+ inputs: {
551
+ scenarios: scenarios,
552
+ },
553
+ },
554
+ {
555
+ type: "call",
556
+ targetAction: "bicep.init",
557
+ required: true,
558
+ },
559
+ {
560
+ name: `call:${inputs.hosting}.generateBicep`,
561
+ type: "call",
562
+ required: true,
563
+ targetAction: `${inputs.hosting}.generateBicep`,
564
+ },
565
+ {
566
+ name: "call:bot-service.generateBicep",
567
+ type: "call",
568
+ required: true,
569
+ targetAction: "bot-service.generateBicep",
570
+ },
571
+ {
572
+ name: `call:${inputs.hosting}-config.generateBicep`,
573
+ type: "call",
574
+ required: true,
575
+ targetAction: `${inputs.hosting}-config.generateBicep`,
576
+ },
577
+ {
578
+ name: "call:teams-manifest.addCapability",
579
+ type: "call",
580
+ required: true,
581
+ targetAction: "teams-manifest.addCapability",
582
+ inputs: {
583
+ capabilities: [{ name: "Bot" }],
584
+ },
585
+ },
586
+ ];
587
+ actions.push(projectSettingsManager_1.WriteProjectSettingsAction);
588
+ const group = {
589
+ type: "group",
590
+ name: "fx.addBot",
591
+ mode: "sequential",
592
+ actions: actions,
593
+ };
594
+ return teamsfx_api_1.ok(group);
595
+ }
596
+ /**
597
+ * 1. config sql
598
+ * 2. add sql provision bicep
599
+ * 3. re-generate resources that connect to sql
600
+ * 4. persist bicep
601
+ */
602
+ addSql(context, inputs) {
603
+ const sqlComponent = workflow_1.getComponent(context.projectSetting, "azure-sql");
604
+ const provisionType = sqlComponent ? "database" : "server";
605
+ const actions = [
606
+ projectSettingsManager_1.LoadProjectSettingsAction,
607
+ {
608
+ name: "fx.configSql",
609
+ type: "function",
610
+ plan: (context, inputs) => {
611
+ const sqlComponent = workflow_1.getComponent(context.projectSetting, "azure-sql");
612
+ if (sqlComponent) {
613
+ return teamsfx_api_1.ok([]);
614
+ }
615
+ const remarks = ["add component 'azure-sql' in projectSettings"];
616
+ const webAppComponent = workflow_1.getComponent(context.projectSetting, "azure-web-app");
617
+ if (webAppComponent) {
618
+ remarks.push("connect 'azure-sql' to component 'azure-web-app' in projectSettings");
619
+ }
620
+ const functionComponent = workflow_1.getComponent(context.projectSetting, "azure-function");
621
+ if (functionComponent) {
622
+ remarks.push("connect 'azure-sql' to component 'azure-function' in projectSettings");
623
+ }
624
+ return teamsfx_api_1.ok([
625
+ {
626
+ type: "file",
627
+ operate: "replace",
628
+ filePath: projectSettingsLoader_1.getProjectSettingsPath(inputs.projectPath),
629
+ remarks: remarks.join(";"),
630
+ },
631
+ ]);
632
+ },
633
+ execute: async (context, inputs) => {
634
+ const sqlComponent = workflow_1.getComponent(context.projectSetting, "azure-sql");
635
+ if (sqlComponent)
636
+ return teamsfx_api_1.ok([]);
637
+ const projectSettings = context.projectSetting;
638
+ const remarks = ["add component 'azure-sql' in projectSettings"];
639
+ projectSettings.components.push({
640
+ name: "azure-sql",
641
+ provision: true,
642
+ });
643
+ const webAppComponent = workflow_1.getComponent(context.projectSetting, "azure-web-app");
644
+ if (webAppComponent) {
645
+ if (!webAppComponent.connections)
646
+ webAppComponent.connections = [];
647
+ webAppComponent.connections.push("azure-sql");
648
+ remarks.push("connect 'azure-sql' to component 'azure-web-app' in projectSettings");
649
+ }
650
+ const functionComponent = workflow_1.getComponent(context.projectSetting, "azure-function");
651
+ if (functionComponent) {
652
+ if (!functionComponent.connections)
653
+ functionComponent.connections = [];
654
+ functionComponent.connections.push("azure-sql");
655
+ remarks.push("connect 'azure-sql' to component 'azure-function' in projectSettings");
656
+ }
657
+ return teamsfx_api_1.ok([
658
+ {
659
+ type: "file",
660
+ operate: "replace",
661
+ filePath: projectSettingsLoader_1.getProjectSettingsPath(inputs.projectPath),
662
+ remarks: remarks.join(";"),
663
+ },
664
+ ]);
665
+ },
666
+ },
667
+ {
668
+ type: "call",
669
+ targetAction: "bicep.init",
670
+ required: true,
671
+ },
672
+ {
673
+ name: "call:azure-sql.generateBicep",
674
+ type: "call",
675
+ required: true,
676
+ targetAction: "azure-sql.generateBicep",
677
+ inputs: {
678
+ provisionType: provisionType,
679
+ },
680
+ },
681
+ ];
682
+ const webAppComponent = workflow_1.getComponent(context.projectSetting, "azure-web-app");
683
+ if (webAppComponent) {
684
+ actions.push({
685
+ name: "call:azure-web-app-config.generateBicep",
686
+ type: "call",
687
+ required: true,
688
+ targetAction: "azure-web-app-config.generateBicep",
689
+ });
690
+ }
691
+ const functionComponent = workflow_1.getComponent(context.projectSetting, "azure-function");
692
+ if (functionComponent) {
693
+ actions.push({
694
+ name: "call:azure-function-config.generateBicep",
695
+ type: "call",
696
+ required: true,
697
+ targetAction: "azure-function-config.generateBicep",
698
+ });
699
+ }
700
+ actions.push(projectSettingsManager_1.WriteProjectSettingsAction);
701
+ const group = {
702
+ type: "group",
703
+ name: "fx.addSql",
704
+ mode: "sequential",
705
+ actions: actions,
706
+ };
707
+ return teamsfx_api_1.ok(group);
708
+ }
709
+ };
710
+ TeamsfxCore = tslib_1.__decorate([
711
+ typedi_1.Service("fx")
712
+ ], TeamsfxCore);
713
+ exports.TeamsfxCore = TeamsfxCore;
714
+ //# sourceMappingURL=core.js.map