@microsoft/teamsfx-core 1.9.0 → 1.9.1-alpha.300caa689.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 (370) hide show
  1. package/build/common/azure-hosting/azureAppServiceHosting.d.ts +16 -0
  2. package/build/common/azure-hosting/azureAppServiceHosting.d.ts.map +1 -0
  3. package/build/common/azure-hosting/azureAppServiceHosting.js +33 -0
  4. package/build/common/azure-hosting/azureAppServiceHosting.js.map +1 -0
  5. package/build/common/azure-hosting/azureFunctionHosting.d.ts +17 -0
  6. package/build/common/azure-hosting/azureFunctionHosting.d.ts.map +1 -0
  7. package/build/common/azure-hosting/azureFunctionHosting.js +36 -0
  8. package/build/common/azure-hosting/azureFunctionHosting.js.map +1 -0
  9. package/build/common/azure-hosting/azureHosting.d.ts +22 -0
  10. package/build/common/azure-hosting/azureHosting.d.ts.map +1 -0
  11. package/build/common/azure-hosting/azureHosting.js +91 -0
  12. package/build/common/azure-hosting/azureHosting.js.map +1 -0
  13. package/build/common/azure-hosting/azureOps.d.ts +16 -0
  14. package/build/common/azure-hosting/azureOps.d.ts.map +1 -0
  15. package/build/common/azure-hosting/azureOps.js +87 -0
  16. package/build/common/azure-hosting/azureOps.js.map +1 -0
  17. package/build/common/azure-hosting/botServiceHosting.d.ts +7 -0
  18. package/build/common/azure-hosting/botServiceHosting.d.ts.map +1 -0
  19. package/build/common/azure-hosting/botServiceHosting.js +16 -0
  20. package/build/common/azure-hosting/botServiceHosting.js.map +1 -0
  21. package/build/common/azure-hosting/hostingConstant.d.ts +45 -0
  22. package/build/common/azure-hosting/hostingConstant.d.ts.map +1 -0
  23. package/build/common/azure-hosting/hostingConstant.js +85 -0
  24. package/build/common/azure-hosting/hostingConstant.js.map +1 -0
  25. package/build/common/azure-hosting/hostingError.d.ts +47 -0
  26. package/build/common/azure-hosting/hostingError.d.ts.map +1 -0
  27. package/build/common/azure-hosting/hostingError.js +83 -0
  28. package/build/common/azure-hosting/hostingError.js.map +1 -0
  29. package/build/common/azure-hosting/hostingFactory.d.ts +6 -0
  30. package/build/common/azure-hosting/hostingFactory.d.ts.map +1 -0
  31. package/build/common/azure-hosting/hostingFactory.js +24 -0
  32. package/build/common/azure-hosting/hostingFactory.js.map +1 -0
  33. package/build/common/azure-hosting/interfaces.d.ts +39 -0
  34. package/build/common/azure-hosting/interfaces.d.ts.map +1 -0
  35. package/build/common/azure-hosting/interfaces.js +12 -0
  36. package/build/common/azure-hosting/interfaces.js.map +1 -0
  37. package/build/common/azure-hosting/utils.d.ts +7 -0
  38. package/build/common/azure-hosting/utils.d.ts.map +1 -0
  39. package/build/common/azure-hosting/utils.js +86 -0
  40. package/build/common/azure-hosting/utils.js.map +1 -0
  41. package/build/common/constants.d.ts +6 -0
  42. package/build/common/constants.d.ts.map +1 -1
  43. package/build/common/constants.js +8 -1
  44. package/build/common/constants.js.map +1 -1
  45. package/build/common/featureFlags.d.ts +1 -0
  46. package/build/common/featureFlags.d.ts.map +1 -1
  47. package/build/common/featureFlags.js +5 -1
  48. package/build/common/featureFlags.js.map +1 -1
  49. package/build/common/projectSettingsHelper.d.ts +2 -1
  50. package/build/common/projectSettingsHelper.d.ts.map +1 -1
  51. package/build/common/projectSettingsHelper.js +19 -2
  52. package/build/common/projectSettingsHelper.js.map +1 -1
  53. package/build/common/template-utils/templatesUtils.d.ts +1 -1
  54. package/build/common/template-utils/templatesUtils.d.ts.map +1 -1
  55. package/build/common/template-utils/templatesUtils.js +9 -2
  56. package/build/common/template-utils/templatesUtils.js.map +1 -1
  57. package/build/common/templates-config.json +2 -2
  58. package/build/common/tools.d.ts +5 -0
  59. package/build/common/tools.d.ts.map +1 -1
  60. package/build/common/tools.js +17 -1
  61. package/build/common/tools.js.map +1 -1
  62. package/build/component/bicep.d.ts +8 -0
  63. package/build/component/bicep.d.ts.map +1 -0
  64. package/build/component/bicep.js +107 -0
  65. package/build/component/bicep.js.map +1 -0
  66. package/build/component/botCode.d.ts +13 -0
  67. package/build/component/botCode.d.ts.map +1 -0
  68. package/build/component/botCode.js +138 -0
  69. package/build/component/botCode.js.map +1 -0
  70. package/build/component/connection.d.ts +8 -0
  71. package/build/component/connection.d.ts.map +1 -0
  72. package/build/component/connection.js +84 -0
  73. package/build/component/connection.js.map +1 -0
  74. package/build/component/core.d.ts +43 -0
  75. package/build/component/core.d.ts.map +1 -0
  76. package/build/component/core.js +714 -0
  77. package/build/component/core.js.map +1 -0
  78. package/build/component/debugManager.d.ts +8 -0
  79. package/build/component/debugManager.d.ts.map +1 -0
  80. package/build/component/debugManager.js +57 -0
  81. package/build/component/debugManager.js.map +1 -0
  82. package/build/component/envManager.d.ts +7 -0
  83. package/build/component/envManager.d.ts.map +1 -0
  84. package/build/component/envManager.js +140 -0
  85. package/build/component/envManager.js.map +1 -0
  86. package/build/component/projectSettingsManager.d.ts +10 -0
  87. package/build/component/projectSettingsManager.d.ts.map +1 -0
  88. package/build/component/projectSettingsManager.js +72 -0
  89. package/build/component/projectSettingsManager.js.map +1 -0
  90. package/build/component/resource/aad.d.ts +11 -0
  91. package/build/component/resource/aad.d.ts.map +1 -0
  92. package/build/component/resource/aad.js +82 -0
  93. package/build/component/resource/aad.js.map +1 -0
  94. package/build/component/resource/azureFunction.d.ts +19 -0
  95. package/build/component/resource/azureFunction.d.ts.map +1 -0
  96. package/build/component/resource/azureFunction.js +81 -0
  97. package/build/component/resource/azureFunction.js.map +1 -0
  98. package/build/component/resource/azureSql.d.ts +24 -0
  99. package/build/component/resource/azureSql.d.ts.map +1 -0
  100. package/build/component/resource/azureSql.js +101 -0
  101. package/build/component/resource/azureSql.js.map +1 -0
  102. package/build/component/resource/azureStorage.d.ts +16 -0
  103. package/build/component/resource/azureStorage.d.ts.map +1 -0
  104. package/build/component/resource/azureStorage.js +102 -0
  105. package/build/component/resource/azureStorage.js.map +1 -0
  106. package/build/component/resource/azureWebApp.d.ts +23 -0
  107. package/build/component/resource/azureWebApp.d.ts.map +1 -0
  108. package/build/component/resource/azureWebApp.js +95 -0
  109. package/build/component/resource/azureWebApp.js.map +1 -0
  110. package/build/component/resource/botService.d.ts +22 -0
  111. package/build/component/resource/botService.d.ts.map +1 -0
  112. package/build/component/resource/botService.js +208 -0
  113. package/build/component/resource/botService.js.map +1 -0
  114. package/build/component/resource/index.d.ts +17 -0
  115. package/build/component/resource/index.d.ts.map +1 -0
  116. package/build/component/resource/index.js +25 -0
  117. package/build/component/resource/index.js.map +1 -0
  118. package/build/component/resource/spfx.d.ts +9 -0
  119. package/build/component/resource/spfx.d.ts.map +1 -0
  120. package/build/component/resource/spfx.js +46 -0
  121. package/build/component/resource/spfx.js.map +1 -0
  122. package/build/component/resource/teamsManifest.d.ts +19 -0
  123. package/build/component/resource/teamsManifest.d.ts.map +1 -0
  124. package/build/component/resource/teamsManifest.js +135 -0
  125. package/build/component/resource/teamsManifest.js.map +1 -0
  126. package/build/component/utils.d.ts +18 -0
  127. package/build/component/utils.d.ts.map +1 -0
  128. package/build/component/utils.js +354 -0
  129. package/build/component/utils.js.map +1 -0
  130. package/build/component/workflow.d.ts +21 -0
  131. package/build/component/workflow.d.ts.map +1 -0
  132. package/build/component/workflow.js +440 -0
  133. package/build/component/workflow.js.map +1 -0
  134. package/build/core/FxCore.d.ts +2 -2
  135. package/build/core/FxCore.d.ts.map +1 -1
  136. package/build/core/FxCore.js +36 -91
  137. package/build/core/FxCore.js.map +1 -1
  138. package/build/core/collaborator.d.ts.map +1 -1
  139. package/build/core/collaborator.js +2 -1
  140. package/build/core/collaborator.js.map +1 -1
  141. package/build/core/middleware/questionModel.d.ts.map +1 -1
  142. package/build/core/middleware/questionModel.js +65 -20
  143. package/build/core/middleware/questionModel.js.map +1 -1
  144. package/build/core/middleware/questionModelV3.d.ts +6 -0
  145. package/build/core/middleware/questionModelV3.d.ts.map +1 -0
  146. package/build/core/middleware/questionModelV3.js +83 -0
  147. package/build/core/middleware/questionModelV3.js.map +1 -0
  148. package/build/core/question.d.ts +6 -0
  149. package/build/core/question.d.ts.map +1 -1
  150. package/build/core/question.js +42 -1
  151. package/build/core/question.js.map +1 -1
  152. package/build/plugins/resource/apiconnector/index.d.ts.map +1 -1
  153. package/build/plugins/resource/apiconnector/index.js +3 -1
  154. package/build/plugins/resource/apiconnector/index.js.map +1 -1
  155. package/build/plugins/resource/appstudio/constants.d.ts +0 -2
  156. package/build/plugins/resource/appstudio/constants.d.ts.map +1 -1
  157. package/build/plugins/resource/appstudio/constants.js +0 -2
  158. package/build/plugins/resource/appstudio/constants.js.map +1 -1
  159. package/build/plugins/resource/appstudio/index.d.ts.map +1 -1
  160. package/build/plugins/resource/appstudio/index.js +27 -18
  161. package/build/plugins/resource/appstudio/index.js.map +1 -1
  162. package/build/plugins/resource/appstudio/plugin.d.ts.map +1 -1
  163. package/build/plugins/resource/appstudio/plugin.js +2 -2
  164. package/build/plugins/resource/appstudio/plugin.js.map +1 -1
  165. package/build/plugins/resource/bot/appStudio/appStudio.d.ts +4 -0
  166. package/build/plugins/resource/bot/appStudio/appStudio.d.ts.map +1 -1
  167. package/build/plugins/resource/bot/appStudio/appStudio.js +14 -3
  168. package/build/plugins/resource/bot/appStudio/appStudio.js.map +1 -1
  169. package/build/plugins/resource/bot/constants.d.ts +2 -70
  170. package/build/plugins/resource/bot/constants.d.ts.map +1 -1
  171. package/build/plugins/resource/bot/constants.js +9 -85
  172. package/build/plugins/resource/bot/constants.js.map +1 -1
  173. package/build/plugins/resource/bot/dotnet/constants.d.ts +5 -0
  174. package/build/plugins/resource/bot/dotnet/constants.d.ts.map +1 -1
  175. package/build/plugins/resource/bot/dotnet/constants.js +7 -1
  176. package/build/plugins/resource/bot/dotnet/constants.js.map +1 -1
  177. package/build/plugins/resource/bot/dotnet/errors.d.ts +5 -0
  178. package/build/plugins/resource/bot/dotnet/errors.d.ts.map +1 -0
  179. package/build/plugins/resource/bot/dotnet/errors.js +21 -0
  180. package/build/plugins/resource/bot/dotnet/errors.js.map +1 -0
  181. package/build/plugins/resource/bot/dotnet/plugin.d.ts +1 -0
  182. package/build/plugins/resource/bot/dotnet/plugin.d.ts.map +1 -1
  183. package/build/plugins/resource/bot/dotnet/plugin.js +28 -0
  184. package/build/plugins/resource/bot/dotnet/plugin.js.map +1 -1
  185. package/build/plugins/resource/bot/errors.d.ts +1 -16
  186. package/build/plugins/resource/bot/errors.d.ts.map +1 -1
  187. package/build/plugins/resource/bot/errors.js +8 -38
  188. package/build/plugins/resource/bot/errors.js.map +1 -1
  189. package/build/plugins/resource/bot/functionsHostedBot/deployMgr.d.ts.map +1 -1
  190. package/build/plugins/resource/bot/functionsHostedBot/deployMgr.js +7 -7
  191. package/build/plugins/resource/bot/functionsHostedBot/deployMgr.js.map +1 -1
  192. package/build/plugins/resource/bot/functionsHostedBot/plugin.d.ts.map +1 -1
  193. package/build/plugins/resource/bot/functionsHostedBot/plugin.js +16 -16
  194. package/build/plugins/resource/bot/functionsHostedBot/plugin.js.map +1 -1
  195. package/build/plugins/resource/bot/index.d.ts +1 -0
  196. package/build/plugins/resource/bot/index.d.ts.map +1 -1
  197. package/build/plugins/resource/bot/index.js +19 -12
  198. package/build/plugins/resource/bot/index.js.map +1 -1
  199. package/build/plugins/resource/bot/languageStrategy.d.ts.map +1 -1
  200. package/build/plugins/resource/bot/languageStrategy.js.map +1 -1
  201. package/build/plugins/resource/bot/plugin.d.ts.map +1 -1
  202. package/build/plugins/resource/bot/plugin.js +19 -24
  203. package/build/plugins/resource/bot/plugin.js.map +1 -1
  204. package/build/plugins/resource/bot/progressBars.d.ts +1 -1
  205. package/build/plugins/resource/bot/progressBars.d.ts.map +1 -1
  206. package/build/plugins/resource/bot/progressBars.js +6 -6
  207. package/build/plugins/resource/bot/progressBars.js.map +1 -1
  208. package/build/plugins/resource/bot/question.d.ts +5 -3
  209. package/build/plugins/resource/bot/question.d.ts.map +1 -1
  210. package/build/plugins/resource/bot/question.js +33 -1
  211. package/build/plugins/resource/bot/question.js.map +1 -1
  212. package/build/plugins/resource/bot/resources/messages.d.ts +0 -14
  213. package/build/plugins/resource/bot/resources/messages.d.ts.map +1 -1
  214. package/build/plugins/resource/bot/resources/messages.js +0 -41
  215. package/build/plugins/resource/bot/resources/messages.js.map +1 -1
  216. package/build/plugins/resource/bot/resources/strings.d.ts +2 -11
  217. package/build/plugins/resource/bot/resources/strings.d.ts.map +1 -1
  218. package/build/plugins/resource/bot/resources/strings.js +2 -15
  219. package/build/plugins/resource/bot/resources/strings.js.map +1 -1
  220. package/build/plugins/resource/bot/utils/common.d.ts +10 -0
  221. package/build/plugins/resource/bot/utils/common.d.ts.map +1 -1
  222. package/build/plugins/resource/bot/utils/common.js +92 -3
  223. package/build/plugins/resource/bot/utils/common.js.map +1 -1
  224. package/build/plugins/resource/bot/v2/common.d.ts +10 -0
  225. package/build/plugins/resource/bot/v2/common.d.ts.map +1 -0
  226. package/build/plugins/resource/bot/v2/common.js +73 -0
  227. package/build/plugins/resource/bot/v2/common.js.map +1 -0
  228. package/build/plugins/resource/bot/v2/enum.d.ts +6 -0
  229. package/build/plugins/resource/bot/v2/enum.d.ts.map +1 -0
  230. package/build/plugins/resource/bot/v2/enum.js +12 -0
  231. package/build/plugins/resource/bot/v2/enum.js.map +1 -0
  232. package/build/plugins/resource/bot/v2/index.d.ts +2 -0
  233. package/build/plugins/resource/bot/v2/index.d.ts.map +1 -1
  234. package/build/plugins/resource/bot/v2/index.js +19 -5
  235. package/build/plugins/resource/bot/v2/index.js.map +1 -1
  236. package/build/plugins/resource/bot/v2/interface/codeTemplateInfo.d.ts +10 -0
  237. package/build/plugins/resource/bot/v2/interface/codeTemplateInfo.d.ts.map +1 -0
  238. package/build/plugins/resource/bot/v2/interface/codeTemplateInfo.js +5 -0
  239. package/build/plugins/resource/bot/v2/interface/codeTemplateInfo.js.map +1 -0
  240. package/build/plugins/resource/bot/v2/mapping.d.ts +7 -0
  241. package/build/plugins/resource/bot/v2/mapping.d.ts.map +1 -0
  242. package/build/plugins/resource/bot/v2/mapping.js +79 -0
  243. package/build/plugins/resource/bot/v2/mapping.js.map +1 -0
  244. package/build/plugins/resource/bot/v2/plugin.d.ts +47 -0
  245. package/build/plugins/resource/bot/v2/plugin.d.ts.map +1 -0
  246. package/build/plugins/resource/bot/v2/plugin.js +308 -0
  247. package/build/plugins/resource/bot/v2/plugin.js.map +1 -0
  248. package/build/plugins/resource/bot/v2/scaffold.d.ts +5 -0
  249. package/build/plugins/resource/bot/v2/scaffold.d.ts.map +1 -0
  250. package/build/plugins/resource/bot/v2/scaffold.js +48 -0
  251. package/build/plugins/resource/bot/v2/scaffold.js.map +1 -0
  252. package/build/plugins/resource/bot/v3/index.d.ts.map +1 -1
  253. package/build/plugins/resource/bot/v3/index.js +7 -11
  254. package/build/plugins/resource/bot/v3/index.js.map +1 -1
  255. package/build/plugins/resource/cicd/plugin.d.ts.map +1 -1
  256. package/build/plugins/resource/cicd/plugin.js +7 -1
  257. package/build/plugins/resource/cicd/plugin.js.map +1 -1
  258. package/build/plugins/resource/frontend/dotnet/constants.d.ts +1 -13
  259. package/build/plugins/resource/frontend/dotnet/constants.d.ts.map +1 -1
  260. package/build/plugins/resource/frontend/dotnet/constants.js +4 -16
  261. package/build/plugins/resource/frontend/dotnet/constants.js.map +1 -1
  262. package/build/plugins/resource/frontend/dotnet/enum.d.ts +0 -10
  263. package/build/plugins/resource/frontend/dotnet/enum.d.ts.map +1 -1
  264. package/build/plugins/resource/frontend/dotnet/enum.js +1 -12
  265. package/build/plugins/resource/frontend/dotnet/enum.js.map +1 -1
  266. package/build/plugins/resource/frontend/dotnet/ops/scaffold.js +2 -2
  267. package/build/plugins/resource/frontend/dotnet/ops/scaffold.js.map +1 -1
  268. package/build/plugins/resource/frontend/dotnet/plugin.d.ts.map +1 -1
  269. package/build/plugins/resource/frontend/dotnet/plugin.js +12 -48
  270. package/build/plugins/resource/frontend/dotnet/plugin.js.map +1 -1
  271. package/build/plugins/resource/frontend/dotnet/resources/templateInfo.d.ts +2 -7
  272. package/build/plugins/resource/frontend/dotnet/resources/templateInfo.d.ts.map +1 -1
  273. package/build/plugins/resource/frontend/dotnet/resources/templateInfo.js +5 -31
  274. package/build/plugins/resource/frontend/dotnet/resources/templateInfo.js.map +1 -1
  275. package/build/plugins/resource/frontend/v2/index.d.ts.map +1 -1
  276. package/build/plugins/resource/frontend/v2/index.js +1 -3
  277. package/build/plugins/resource/frontend/v2/index.js.map +1 -1
  278. package/build/plugins/solution/fx-solution/arm.d.ts.map +1 -1
  279. package/build/plugins/solution/fx-solution/arm.js +5 -7
  280. package/build/plugins/solution/fx-solution/arm.js.map +1 -1
  281. package/build/plugins/solution/fx-solution/constants.d.ts +5 -2
  282. package/build/plugins/solution/fx-solution/constants.d.ts.map +1 -1
  283. package/build/plugins/solution/fx-solution/constants.js +3 -0
  284. package/build/plugins/solution/fx-solution/constants.js.map +1 -1
  285. package/build/plugins/solution/fx-solution/debug/provisionLocal.js +2 -2
  286. package/build/plugins/solution/fx-solution/question.d.ts +1 -0
  287. package/build/plugins/solution/fx-solution/question.d.ts.map +1 -1
  288. package/build/plugins/solution/fx-solution/question.js +7 -1
  289. package/build/plugins/solution/fx-solution/question.js.map +1 -1
  290. package/build/plugins/solution/fx-solution/v2/listCollaborator.d.ts.map +1 -1
  291. package/build/plugins/solution/fx-solution/v2/listCollaborator.js +2 -1
  292. package/build/plugins/solution/fx-solution/v2/listCollaborator.js.map +1 -1
  293. package/build/plugins/solution/fx-solution/v2/provision.d.ts.map +1 -1
  294. package/build/plugins/solution/fx-solution/v2/provision.js +29 -1
  295. package/build/plugins/solution/fx-solution/v2/provision.js.map +1 -1
  296. package/build/plugins/solution/fx-solution/v3/constants.d.ts +0 -1
  297. package/build/plugins/solution/fx-solution/v3/constants.d.ts.map +1 -1
  298. package/build/plugins/solution/fx-solution/v3/constants.js +0 -1
  299. package/build/plugins/solution/fx-solution/v3/constants.js.map +1 -1
  300. package/build/plugins/solution/fx-solution/v3/userTask.d.ts.map +1 -1
  301. package/build/plugins/solution/fx-solution/v3/userTask.js +5 -12
  302. package/build/plugins/solution/fx-solution/v3/userTask.js.map +1 -1
  303. package/package.json +8 -3
  304. package/resource/package.nls.json +27 -18
  305. package/templates/bicep/azureSql.parameters.json +4 -0
  306. package/templates/bicep/azureSql.provisionDatabase.module.bicep +15 -0
  307. package/templates/bicep/azureSql.provisionDatabase.orchestration.bicep +5 -0
  308. package/templates/bicep/azureSql.provisionServer.module.bicep +44 -0
  309. package/templates/bicep/azureSql.provisionServer.orchestration.bicep +14 -0
  310. package/templates/bicep/azureWebApp.config.module.bicep +63 -0
  311. package/templates/bicep/azureWebApp.config.orchestration.bicep +12 -0
  312. package/templates/bicep/azureWebApp.parameters.json +4 -0
  313. package/templates/bicep/azureWebApp.provision.module.bicep +50 -0
  314. package/templates/bicep/azureWebApp.provision.orchestration.bicep +18 -0
  315. package/templates/bicep/botService.config.module.bicep +33 -0
  316. package/templates/bicep/botService.config.orchestration.bicep +8 -0
  317. package/templates/bicep/config.bicep +3 -0
  318. package/templates/bicep/main.bicep +18 -0
  319. package/templates/bicep/provision.bicep +2 -0
  320. package/templates/fallback/blazor-base.csharp.default.zip +0 -0
  321. package/templates/fallback/bot.csharp.command-and-response.zip +0 -0
  322. package/templates/fallback/bot.csharp.default.zip +0 -0
  323. package/templates/fallback/bot.csharp.notification-webapi.zip +0 -0
  324. package/templates/fallback/bot.js.command-and-response.zip +0 -0
  325. package/templates/fallback/bot.js.default.zip +0 -0
  326. package/templates/fallback/bot.js.m365.zip +0 -0
  327. package/templates/fallback/bot.js.notification-function-base.zip +0 -0
  328. package/templates/fallback/bot.js.notification-restify.zip +0 -0
  329. package/templates/fallback/bot.js.notification-trigger-http.zip +0 -0
  330. package/templates/fallback/bot.js.notification-trigger-timer.zip +0 -0
  331. package/templates/fallback/bot.ts.command-and-response.zip +0 -0
  332. package/templates/fallback/bot.ts.default.zip +0 -0
  333. package/templates/fallback/bot.ts.m365.zip +0 -0
  334. package/templates/fallback/bot.ts.notification-function-base.zip +0 -0
  335. package/templates/fallback/bot.ts.notification-restify.zip +0 -0
  336. package/templates/fallback/bot.ts.notification-trigger-http.zip +0 -0
  337. package/templates/fallback/bot.ts.notification-trigger-timer.zip +0 -0
  338. package/templates/fallback/bot.ts.notification.zip +0 -0
  339. package/templates/fallback/function-base.js.default.zip +0 -0
  340. package/templates/fallback/function-base.ts.default.zip +0 -0
  341. package/templates/fallback/function-triggers.js.HTTPTrigger.zip +0 -0
  342. package/templates/fallback/function-triggers.ts.HTTPTrigger.zip +0 -0
  343. package/templates/fallback/tab.csharp.default.zip +0 -0
  344. package/templates/fallback/tab.js.default.zip +0 -0
  345. package/templates/fallback/tab.js.m365.zip +0 -0
  346. package/templates/fallback/tab.js.non-sso.zip +0 -0
  347. package/templates/fallback/tab.ts.default.zip +0 -0
  348. package/templates/fallback/tab.ts.m365.zip +0 -0
  349. package/templates/fallback/tab.ts.non-sso.zip +0 -0
  350. package/templates/plugins/resource/aad/auth/bot/js/public/auth-end.html +8 -8
  351. package/templates/plugins/resource/aad/auth/bot/ts/public/auth-end.html +8 -8
  352. package/templates/plugins/resource/hosting/bicep/botFunction/botFunctionConfiguration.template.bicep +71 -0
  353. package/templates/plugins/resource/hosting/bicep/botFunction/botFunctionProvision.template.bicep +99 -0
  354. package/templates/plugins/resource/hosting/bicep/botFunction/config.template.bicep +12 -0
  355. package/templates/plugins/resource/hosting/bicep/botFunction/provision.template.bicep +20 -0
  356. package/templates/plugins/resource/hosting/bicep/botservice/botserviceProvision.template.bicep +34 -0
  357. package/templates/plugins/resource/hosting/bicep/botservice/parameters.json +4 -0
  358. package/templates/plugins/resource/hosting/bicep/botservice/provision.template.bicep +8 -0
  359. package/templates/plugins/resource/hosting/bicep/webapp/config.template.bicep +12 -0
  360. package/templates/plugins/resource/hosting/bicep/webapp/provision.template.bicep +20 -0
  361. package/templates/plugins/resource/hosting/bicep/webapp/webappConfiguration.template.bicep +66 -0
  362. package/templates/plugins/resource/hosting/bicep/webapp/webappProvision.template.bicep +63 -0
  363. package/build/plugins/resource/bot/azureOps.d.ts +0 -14
  364. package/build/plugins/resource/bot/azureOps.d.ts.map +0 -1
  365. package/build/plugins/resource/bot/azureOps.js +0 -140
  366. package/build/plugins/resource/bot/azureOps.js.map +0 -1
  367. package/build/plugins/resource/bot/functionsHostedBot/constants.d.ts +0 -13
  368. package/build/plugins/resource/bot/functionsHostedBot/constants.d.ts.map +0 -1
  369. package/build/plugins/resource/bot/functionsHostedBot/constants.js +0 -20
  370. package/build/plugins/resource/bot/functionsHostedBot/constants.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
+ // 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(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