@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,18 @@
1
+ // Resources web app
2
+ module azureWebAppProvision './provision/azureWebApp.bicep' = {
3
+ name: 'azureWebAppProvision'
4
+ params: {
5
+ provisionParameters: provisionParameters
6
+ }
7
+ }
8
+
9
+
10
+ output azureWebAppOutput object = {
11
+ teamsFxPluginId: 'azure-web-app'
12
+ sku: azureWebAppProvision.outputs.sku
13
+ appName: azureWebAppProvision.outputs.appName
14
+ domain: azureWebAppProvision.outputs.domain
15
+ appServicePlanName: azureWebAppProvision.outputs.appServicePlanName
16
+ resourceId: azureWebAppProvision.outputs.resourceId
17
+ endpoint: azureWebAppProvision.outputs.endpoint
18
+ }
@@ -0,0 +1,33 @@
1
+ @secure()
2
+ param provisionParameters object
3
+ param provisionOutputs object
4
+ var resourceBaseName = provisionParameters.resourceBaseName
5
+ var botAadAppClientId = provisionParameters['botAadAppClientId'] // Read AAD app client id for Azure Bot Service from parameters
6
+ var botServiceName = contains(provisionParameters, 'botServiceName') ? provisionParameters['botServiceName'] : '${resourceBaseName}' // Try to read name for Azure Bot Service from parameters
7
+ var botServiceSku = contains(provisionParameters, 'botServiceSku') ? provisionParameters['botServiceSku'] : 'F0' // Try to read SKU for Azure Bot Service from parameters
8
+ var botDisplayName = contains(provisionParameters, 'botDisplayName') ? provisionParameters['botDisplayName'] : '${resourceBaseName}' // Try to read display name for Azure Bot Service from parameters
9
+
10
+ // Register your web service as a bot with the Bot Framework
11
+ resource azureBot 'Microsoft.BotService/botServices@2021-03-01' = {
12
+ kind: 'azurebot'
13
+ location: 'global'
14
+ name: botServiceName
15
+ properties: {
16
+ displayName: botDisplayName
17
+ endpoint: uri({{endpointVarName}} , '/api/messages')
18
+ msaAppId: botAadAppClientId
19
+ }
20
+ sku: {
21
+ name: botServiceSku // You can follow https://aka.ms/teamsfx-bicep-add-param-tutorial to add botServiceSku property to provisionParameters to override the default value "F0".
22
+ }
23
+ }
24
+
25
+ // Connect the bot service to Microsoft Teams
26
+ resource botServiceMsTeamsChannel 'Microsoft.BotService/botServices/channels@2021-03-01' = {
27
+ parent: azureBot
28
+ location: 'global'
29
+ name: 'MsTeamsChannel'
30
+ properties: {
31
+ channelName: 'MsTeamsChannel'
32
+ }
33
+ }
@@ -0,0 +1,8 @@
1
+ // Merge TeamsFx configurations to Bot service
2
+ module teamsFxBotServiceConfig './teamsFx/botService.bicep' = {
3
+ name: 'teamsFxBotServiceConfig'
4
+ params: {
5
+ provisionParameters: provisionParameters
6
+ provisionOutputs: provisionOutputs
7
+ }
8
+ }
@@ -0,0 +1,3 @@
1
+ @secure()
2
+ param provisionParameters object
3
+ param provisionOutputs object
@@ -0,0 +1,18 @@
1
+ @secure()
2
+ param provisionParameters object
3
+
4
+ module provision './provision.bicep' = {
5
+ name: 'provisionResources'
6
+ params: {
7
+ provisionParameters: provisionParameters
8
+ }
9
+ }
10
+ output provisionOutput object = provision
11
+ module config './config.bicep' = {
12
+ name: 'config'
13
+ params: {
14
+ provisionParameters: provisionParameters
15
+ provisionOutputs: provision
16
+ }
17
+ }
18
+ output configOutput object = contains(reference(resourceId('Microsoft.Resources/deployments', config.name), '2020-06-01'), 'outputs') ? config : {}
@@ -0,0 +1,2 @@
1
+ @secure()
2
+ param provisionParameters object
@@ -7,9 +7,9 @@ Embed existing web app is to bring your own static webpages and embed in Microso
7
7
  Before run this app locally, make sure you have prepared the following prerequisites:
8
8
  * An [M365 account for development](https://docs.microsoft.com/microsoftteams/platform/toolkit/accounts).
9
9
 
10
- Also, make sure your own static webpages meets the [prerequisites](https://aka.ms/teamsfx-existing-tab#prerequisites) and launches locally.
10
+ Also, make sure your own static webpages meets the [prerequisites](https://aka.ms/teamsfx-embed-existing-web#prerequisites) and launches locally.
11
11
 
12
- Then, you can quickly start local preview via the environment tree view in Teams Toolkit, refer [Preview your Teams app](https://aka.ms/teamsfx-existing-tab#preview-your-teams-app) for more information.
12
+ Then, you can quickly start local preview via the environment tree view in Teams Toolkit, refer [Preview your Teams app](https://aka.ms/teamsfx-embed-existing-web#preview-your-teams-app) for more information.
13
13
 
14
14
  ## Develop
15
15
 
@@ -34,13 +34,13 @@ The file contains template arguments with `{...}` statements which will be repla
34
34
 
35
35
  Teams Toolkit can help provision new Teams app per different environments.
36
36
 
37
- After provisioned, you can preview your app via the environment tree view in Teams Toolkit, refer [Preview your Teams app](https://aka.ms/teamsfx-existing-tab#preview-your-teams-app) for more information.
37
+ After provisioned, you can preview your app via the environment tree view in Teams Toolkit, refer [Preview your Teams app](https://aka.ms/teamsfx-embed-existing-web#preview-your-teams-app) for more information.
38
38
 
39
39
  After finish development and to distribute your app to others, you can [Publish Teams apps using Teams Toolkit](https://docs.microsoft.com/microsoftteams/platform/toolkit/publish).
40
40
 
41
41
  ## Reference
42
42
 
43
- * [Embed Existing Web App with Teams Toolkit](https://aka.ms/teamsfx-existing-tab)
43
+ * [Embed Existing Web App with Teams Toolkit](https://aka.ms/teamsfx-embed-existing-web)
44
44
  * [Teams Toolkit and Step-by-step Documentations](https://docs.microsoft.com/microsoftteams/platform/toolkit/teams-toolkit-fundamentals)
45
45
  * [Teams Toolkit CLI](https://docs.microsoft.com/microsoftteams/platform/toolkit/teamsfx-cli)
46
46
  * [Teams Toolkit Samples](https://github.com/OfficeDev/TeamsFx-Samples)
Binary file
Binary file
Binary file
Binary file
@@ -1,17 +1,220 @@
1
- ## How to enable SSO in TeamsFx Bot projects
1
+ # Enable single sign-on for bot applications
2
2
 
3
- This doc will show you how to add Single sign-on (SSO) feature to TeamsFx Bot projects. Note that this article is only for Teams Toolkit Visual Studio Code Extension version after x.x.x or TeamsFx CLI version after x.x.x.
3
+ Microsoft Teams provides a mechanism by which an application can obtain the signed-in Teams user token to access Microsoft Graph (and other APIs). Teams Toolkit facilitates this interaction by abstracting some of the Azure Active Directory (AAD) flows and integrations behind some simple, high level APIs. This enables you to add single sign-on (SSO) features easily to your Teams application.
4
4
 
5
- *Note: This article is only for bot hosted on Azure App Service. Bot that hosted on Azure Function is not supported now.*
5
+ For a bot application, SSO manifests as an Adaptive Card which the user can interact with to invoke the AAD consent flow.
6
6
 
7
- *Note: This article is only for TeamsFx projects by Javascript and Typescript. For Dotnet, please refer to ${help link}.*
7
+ # Changes to your project
8
8
 
9
- For more detail about SSO, please refer to the [wiki](https://aka.ms/teamsfx-add-sso-readme).
9
+ When you added the SSO feature to your application, Teams Toolkit updated your project to support SSO:
10
10
 
11
- ### What we have done in 'Add SSO' command
11
+ After you successfully added SSO into your project, Teams Toolkit will create and modify some files that helps you implement SSO feature.
12
12
 
13
- By triggering `Add SSO` command, we will help you to setup your project to enable SSO and create `auth/bot` folder with some code snippet. For detail, please refer to the [wiki](https://aka.ms/teamsfx-add-sso-readme).
13
+ | Action | File | Description |
14
+ | - | - | - |
15
+ | Create| `aad.template.json` under `templates/appPackage` | The Azure Active Directory application manifest that is used to register the application with AAD. |
16
+ | Modify | `manifest.template.json` under `templates/appPackage` | An `webApplicationInfo` object will be added into your Teams app manifest template. This field is required by Teams when enabling SSO. |
17
+ | Create | `auth/bot` | Reference code, redirect pages and a `README.md` file. These files are provided for reference. See below for more information. |
14
18
 
15
- ### What you need to do after triggering 'Add SSO' command
19
+ # Update your code to add SSO
16
20
 
17
- Please follow the [wiki](https://aka.ms/teamsfx-add-sso-readme) to update your source code, provision Azure AD app and deploy latest code.
21
+ As described above, the Teams Toolkit generated some configuration to set up your application for SSO, but you need to update your application business logic to take advantage of the SSO feature as appropriate.
22
+
23
+ ## Set up the AAD redirects
24
+
25
+ 1. Move the `auth/bot/public` folder to `bot/src`. This folder contains HTML pages that the bot application hosts. When single sign-on flows are initiated with AAD, AAD will redirect the user to these pages.
26
+ 2. Modify your `bot/src/index.ts` to add the appropriate `restify` routes to these pages.
27
+
28
+ ## Update your business logic
29
+
30
+ The sample business logic provides a function `showUserInfo` that requires an AAD token to call Microsoft Graph. This token is obtained by using the logged-in Teams user token. The flow is brought together in a dialog that will display a consent dialog if required; otherwise it will go straight to `showUserInfo`.
31
+
32
+ To make this work in your application:
33
+
34
+ 1. Move `auth/bot/public` folder to `bot/src`.
35
+ These folder contains HTML pages used for auth redirect, please note that you need to modify `bot/src/index` file to add routing to these pages.
36
+
37
+ 1. Move `auth/bot/sso` folder to `bot/src`.
38
+ These folder contains three files as reference for sso implementation:
39
+ * `showUserInfo`: This implements a function to get user info with SSO token. You can follow this method and create your own method that requires SSO token.
40
+ * `ssoDialog`: This creates a [ComponentDialog](https://docs.microsoft.com/en-us/javascript/api/botbuilder-dialogs/componentdialog?view=botbuilder-ts-latest) that used for SSO.
41
+ * `teamsSsoBot`: This create a [TeamsActivityHandler](https://docs.microsoft.com/en-us/javascript/api/botbuilder/teamsactivityhandler?view=botbuilder-ts-latest) with `ssoDialog` and add `showUserInfo` as a command that can be triggered.
42
+
43
+ 1. (Optional) Follow the code sample and register your own command with `addCommand` in this file.
44
+ 1. Execute the following commands under `bot/`: `npm install isomorphic-fetch`
45
+ 1. Execute the following commands under `bot/`: `npm install copyfiles` and replace following line in package.json:
46
+ ```
47
+ "tsc --build && shx cp -r ./src/adaptiveCards ./lib/src",
48
+ ```
49
+ with:
50
+ ```
51
+ "tsc --build && shx cp -r ./src/adaptiveCards ./lib/src && copyfiles src/public/*.html lib/",
52
+ ```
53
+ By doing this, the HTML pages used for auth redirect will be copied when building this bot project.
54
+
55
+ 1. After adding the following files, you need to create a new `teamsSsoBot` instance in `bot/src/index` file.
56
+ Please replace the following code:
57
+ ```
58
+ // Process Teams activity with Bot Framework.
59
+ server.post("/api/messages", async (req, res) => {
60
+ await commandBot.requestHandler(req, res);
61
+ });
62
+ ```
63
+
64
+ with:
65
+
66
+ ```
67
+ const handler = new TeamsSsoBot();
68
+ // Process Teams activity with Bot Framework.
69
+ server.post("/api/messages", async (req, res) => {
70
+ await commandBot.requestHandler(req, res, async (context)=> {
71
+ await handler.run(context);
72
+ });
73
+ });
74
+ ```
75
+
76
+ 1. Add routing in `bot/src/index` file as below:
77
+
78
+ ```
79
+ server.get(
80
+ "/auth-*.html",
81
+ restify.plugins.serveStatic({
82
+ directory: path.join(__dirname, "public"),
83
+ })
84
+ );
85
+ ```
86
+
87
+ 1. Add the following lines to `bot/src/index` to import `teamsSsoBot` and `path`:
88
+
89
+ ```
90
+ // For ts:
91
+ import { TeamsSsoBot } from "./sso/teamsSsoBot";
92
+ const path = require("path");
93
+
94
+ // For js:
95
+ const { TeamsSsoBot } = require("./sso/teamsSsoBot");
96
+ const path = require("path");
97
+ ```
98
+
99
+ 1. Register your command in the Teams app manifest. Open `templates/appPackage/manifest.template.json`, and add following lines under `command` in `commandLists` of your bot:
100
+
101
+ ```
102
+ {
103
+ "title": "show",
104
+ "description": "Show user profile using Single Sign On feature"
105
+ }
106
+ ```
107
+
108
+ ## (Optional) Add a new command to the bot
109
+
110
+ After successfully add SSO in your project, you can also add a new command.
111
+
112
+ 1. Create a new file (e.g. `todo.ts` or `todo.js`) under `bot/src/` and add your own business logic to call Graph API:
113
+
114
+ ```TypeScript
115
+ // for TypeScript:
116
+ export async function showUserImage(
117
+ context: TurnContext,
118
+ ssoToken: string,
119
+ param: any[]
120
+ ): Promise<DialogTurnResult> {
121
+ await context.sendActivity("Retrieving user photo from Microsoft Graph ...");
122
+
123
+ // Init TeamsFx instance with SSO token
124
+ const teamsfx = new TeamsFx().setSsoToken(ssoToken);
125
+
126
+ // Update scope here. For example: Mail.Read, etc.
127
+ const graphClient = createMicrosoftGraphClient(teamsfx, param[0]);
128
+
129
+ // You can add following code to get your photo:
130
+ // let photoUrl = "";
131
+ // try {
132
+ // const photo = await graphClient.api("/me/photo/$value").get();
133
+ // photoUrl = URL.createObjectURL(photo);
134
+ // } catch {
135
+ // // Could not fetch photo from user's profile, return empty string as placeholder.
136
+ // }
137
+ // if (photoUrl) {
138
+ // await context.sendActivity(
139
+ // `You can find your photo here: ${photoUrl}`
140
+ // );
141
+ // } else {
142
+ // await context.sendActivity("Could not retrieve your photo from Microsoft Graph. Please make sure you have uploaded your photo.");
143
+ // }
144
+
145
+ return;
146
+ }
147
+ ```
148
+
149
+ ```javascript
150
+ // for JavaScript:
151
+ export async function showUserImage(context, ssoToken, param) {
152
+ await context.sendActivity("Retrieving user photo from Microsoft Graph ...");
153
+
154
+ // Init TeamsFx instance with SSO token
155
+ const teamsfx = new TeamsFx().setSsoToken(ssoToken);
156
+
157
+ // Update scope here. For example: Mail.Read, etc.
158
+ const graphClient = createMicrosoftGraphClient(teamsfx, param[0]);
159
+
160
+ // You can add following code to get your photo:
161
+ // let photoUrl = "";
162
+ // try {
163
+ // const photo = await graphClient.api("/me/photo/$value").get();
164
+ // photoUrl = URL.createObjectURL(photo);
165
+ // } catch {
166
+ // // Could not fetch photo from user's profile, return empty string as placeholder.
167
+ // }
168
+ // if (photoUrl) {
169
+ // await context.sendActivity(
170
+ // `You can find your photo here: ${photoUrl}`
171
+ // );
172
+ // } else {
173
+ // await context.sendActivity("Could not retrieve your photo from Microsoft Graph. Please make sure you have uploaded your photo.");
174
+ // }
175
+
176
+ return;
177
+ }
178
+ ```
179
+
180
+ 1. Register a new command using `addCommand` in `teamsSsoBot`:
181
+
182
+ Find the following line:
183
+
184
+ ```
185
+ this.dialog.addCommand("ShowUserProfile", "show", showUserInfo);
186
+ ```
187
+
188
+ and add following lines after the above line to register a new command `photo` and hook up with method `showUserImage` added above:
189
+
190
+ ```
191
+ // As shown here, you can add your own parameter into the `showUserImage` method
192
+ // You can also use regular expression for the command here
193
+ const scope = ["User.Read"];
194
+ this.dialog.addCommand("ShowUserPhoto", new RegExp("photo\s*.*"), showUserImage, scope);
195
+ ```
196
+
197
+ 1. Register your command in the Teams app manifest. Open 'templates/appPackage/manifest.template.json', and add following lines under `command` in `commandLists` of your bot:
198
+
199
+ ```
200
+ {
201
+ "title": "photo",
202
+ "description": "Show user photo using Single Sign On feature"
203
+ }
204
+ ```
205
+
206
+ # Debug your application
207
+
208
+ You can debug your application by pressing F5.
209
+
210
+ Teams Toolkit will use the AAD manifest file to register a AAD application registered for SSO.
211
+
212
+ To learn more about Teams Toolkit local debug functionalities, refer to this [document](https://docs.microsoft.com/microsoftteams/platform/toolkit/debug-local).
213
+
214
+ # Customize AAD applications
215
+
216
+ The AAD [manifest](https://docs.microsoft.com/azure/active-directory/develop/reference-app-manifest) allows you to customize various aspects of your application registration. You can update the manifest as needed.
217
+
218
+ Follow this [document](https://aka.ms/teamsfx-aad-manifest#customize-aad-manifest-template) if you need to include additional API permissions to access your desired APIs.
219
+
220
+ Follow this [document](https://aka.ms/teamsfx-aad-manifest#How-to-view-the-AAD-app-on-the-Azure-portal) to view your AAD application in Azure Portal.
@@ -1,3 +1,6 @@
1
+ <!--This file is auto generated by Teams Toolkit to provide you instructions and reference code to implement single sign on. -->
2
+ <!--This file is used during the Teams Bot authentication flow to assist with retrieval of the access token.-->
3
+ <!--If you're not familiar with this, do not alter or remove this file from your project.-->
1
4
  <html>
2
5
  <head>
3
6
  <title>Login End Page</title>
@@ -34,7 +37,7 @@
34
37
 
35
38
  // Parse hash parameters into key-value pairs
36
39
  function getHashParameters() {
37
- let hashParams = {};
40
+ let hashParams = new Map();
38
41
  location.hash
39
42
  .substr(1)
40
43
  .split("&")
@@ -1,3 +1,4 @@
1
+ <!--This file is auto generated by Teams Toolkit to provide you instructions and reference code to implement single sign on. -->
1
2
  <!--This file is used during the Teams Bot authentication flow to assist with retrieval of the access token.-->
2
3
  <!--If you're not familiar with this, do not alter or remove this file from your project.-->
3
4
  <html>
@@ -1,11 +1,24 @@
1
- import { createMicrosoftGraphClient, TeamsFx } from "@microsoft/teamsfx";
1
+ // This file is auto generated by Teams Toolkit to provide you instructions and reference code to implement single sign on.
2
+ // This file implements a function to call Graph API with TeamsFx SDK to get user profile with SSO token.
3
+ // You can modify this file to add your business with SSO token.
4
+ // See https://aka.ms/teamsfx-add-sso to learn more about adding new command to your bot.
2
5
 
3
- export async function showUserInfo(context, ssoToken) {
6
+ const { createMicrosoftGraphClient, TeamsFx } = require("@microsoft/teamsfx");
7
+
8
+ // If you need extra parameters, you can add param in `addCommand`
9
+ async function showUserInfo(context, ssoToken, param) {
4
10
  await context.sendActivity("Retrieving user information from Microsoft Graph ...");
11
+
12
+ // Init TeamsFx instance with SSO token
5
13
  const teamsfx = new TeamsFx().setSsoToken(ssoToken);
14
+
15
+ // Add scope for your Azure AD app. For example: Mail.Read, etc.
6
16
  const graphClient = createMicrosoftGraphClient(teamsfx, ["User.Read"]);
17
+
18
+ // Call graph api use `graph` instance to get user profile information
7
19
  const me = await graphClient.api("/me").get();
8
20
  if (me) {
21
+ // Bot will send the user profile info to user
9
22
  await context.sendActivity(
10
23
  `You're logged in as ${me.displayName} (${me.userPrincipalName})${
11
24
  me.jobTitle ? `; your job title is: ${me.jobTitle}` : ""
@@ -17,3 +30,7 @@ export async function showUserInfo(context, ssoToken) {
17
30
 
18
31
  return;
19
32
  }
33
+
34
+ module.exports = {
35
+ showUserInfo,
36
+ };
@@ -1,20 +1,25 @@
1
- import {
1
+ // This file is auto generated by Teams Toolkit to provide you instructions and reference code to implement single sign on.
2
+ // This file implements a `ComponentDialog` class for Single Sign On.
3
+ // See https://docs.microsoft.com/javascript/api/botbuilder-dialogs/componentdialog?view=botbuilder-ts-latest for more about `ComponentDialog`.
4
+ // If you are not familiar with this, do not remove or update this file.
5
+
6
+ const {
2
7
  ComponentDialog,
3
8
  WaterfallDialog,
4
9
  Dialog,
5
10
  DialogTurnResult,
6
11
  DialogSet,
7
12
  DialogTurnStatus,
8
- } from "botbuilder-dialogs";
9
- import { ActivityTypes, tokenExchangeOperationName, TurnContext } from "botbuilder";
10
- import { TeamsBotSsoPrompt, TeamsFx } from "@microsoft/teamsfx";
11
- import "isomorphic-fetch";
13
+ } = require("botbuilder-dialogs");
14
+ const { ActivityTypes, tokenExchangeOperationName, TurnContext } = require("botbuilder");
15
+ const { TeamsBotSsoPrompt, TeamsFx } = require("@microsoft/teamsfx");
16
+ require("isomorphic-fetch");
12
17
 
13
18
  const DIALOG_NAME = "SSODialog";
14
19
  const TEAMS_SSO_PROMPT_ID = "TeamsFxSsoPrompt";
15
20
  const COMMAND_ROUTE_DIALOG = "CommandRouteDialog";
16
21
 
17
- export class SsoDialog extends ComponentDialog {
22
+ class SsoDialog extends ComponentDialog {
18
23
  constructor(dedupStorage, requiredScopes) {
19
24
  super(DIALOG_NAME);
20
25
 
@@ -23,6 +28,7 @@ export class SsoDialog extends ComponentDialog {
23
28
  this.dedupStorage = dedupStorage;
24
29
  this.dedupStorageKeys = [];
25
30
  this.requiredScopes = requiredScopes;
31
+ this.commandMapping = new Map();
26
32
 
27
33
  const teamsFx = new TeamsFx();
28
34
  const ssoDialog = new TeamsBotSsoPrompt(teamsFx, TEAMS_SSO_PROMPT_ID, {
@@ -37,19 +43,25 @@ export class SsoDialog extends ComponentDialog {
37
43
  this.addDialog(commandRouteDialog);
38
44
  }
39
45
 
40
- addCommand(commandId, commandText, operation) {
46
+ addCommand(commandId, commandText, operation, ...param) {
41
47
  const dialog = new WaterfallDialog(commandId, [
42
48
  this.ssoStep.bind(this),
43
49
  this.dedupStep.bind(this),
44
50
  async (stepContext) => {
45
51
  const tokenResponse = stepContext.result;
46
52
  const context = stepContext.context;
47
- if (tokenResponse) {
48
- await operation(context, tokenResponse.ssoToken);
49
- } else {
53
+ try {
54
+ if (tokenResponse) {
55
+ await operation(context, tokenResponse.ssoToken, param);
56
+ } else {
57
+ await context.sendActivity("Failed to retrieve user token from conversation context.");
58
+ }
59
+ return await stepContext.endDialog();
60
+ } catch (error) {
50
61
  await context.sendActivity("Failed to retrieve user token from conversation context.");
62
+ await context.sendActivity(error.message);
63
+ return await stepContext.endDialog();
51
64
  }
52
- return await stepContext.endDialog();
53
65
  },
54
66
  ]);
55
67
 
@@ -94,16 +106,30 @@ export class SsoDialog extends ComponentDialog {
94
106
  }
95
107
 
96
108
  async ssoStep(stepContext) {
97
- return await stepContext.beginDialog(TEAMS_SSO_PROMPT_ID);
109
+ try {
110
+ return await stepContext.beginDialog(TEAMS_SSO_PROMPT_ID);
111
+ } catch (error) {
112
+ const context = stepContext.context;
113
+ await context.sendActivity("Failed to run SSO step");
114
+ await context.sendActivity(error.message);
115
+ return await stepContext.endDialog();
116
+ }
98
117
  }
99
118
 
100
119
  async dedupStep(stepContext) {
101
- const tokenResponse = stepContext.result;
102
- // Only dedup after ssoStep to make sure that all Teams client would receive the login request
103
- if (tokenResponse && (await this.shouldDedup(stepContext.context))) {
104
- return Dialog.EndOfTurn;
120
+ try {
121
+ const tokenResponse = stepContext.result;
122
+ // Only dedup after ssoStep to make sure that all Teams client would receive the login request
123
+ if (tokenResponse && (await this.shouldDedup(stepContext.context))) {
124
+ return Dialog.EndOfTurn;
125
+ }
126
+ return await stepContext.next(tokenResponse);
127
+ } catch (error) {
128
+ const context = stepContext.context;
129
+ await context.sendActivity("Failed to run dedup step");
130
+ await context.sendActivity(error.message);
131
+ return await stepContext.endDialog();
105
132
  }
106
- return await stepContext.next(tokenResponse);
107
133
  }
108
134
 
109
135
  async onEndDialog(context) {
@@ -156,7 +182,7 @@ export class SsoDialog extends ComponentDialog {
156
182
 
157
183
  matchCommands(text) {
158
184
  for (const command of this.commandMapping) {
159
- let pattern = command[1];
185
+ const pattern = command[1];
160
186
  let matchResult;
161
187
  if (typeof pattern == "string") {
162
188
  matchResult = text === pattern;
@@ -171,3 +197,5 @@ export class SsoDialog extends ComponentDialog {
171
197
  return undefined;
172
198
  }
173
199
  }
200
+
201
+ exports.SsoDialog = SsoDialog;
@@ -1,8 +1,13 @@
1
- import { ConversationState, MemoryStorage, TeamsActivityHandler, UserState } from "botbuilder";
2
- import { showUserInfo } from "./showUserInfo";
3
- import { SsoDialog } from "./ssoDialog";
1
+ // This file is auto generated by Teams Toolkit to provide you instructions and reference code to implement single sign on.
2
+ // This file implements a `TeamsActivityHandler` class using `ssoDialog` and add `showUserInfo` as a command.
3
+ // See https://docs.microsoft.com/javascript/api/botbuilder/teamsactivityhandler?view=botbuilder-ts-latest for more about `TeamsActivityHandler`.
4
+ // You can add your own command that requires SSO in this file.
4
5
 
5
- export class TeamsSsoBot extends TeamsActivityHandler {
6
+ const { ConversationState, MemoryStorage, TeamsActivityHandler, UserState } = require("botbuilder");
7
+ const { showUserInfo } = require("./showUserInfo");
8
+ const { SsoDialog } = require("./ssoDialog");
9
+
10
+ class TeamsSsoBot extends TeamsActivityHandler {
6
11
  constructor() {
7
12
  super();
8
13
 
@@ -19,7 +24,8 @@ export class TeamsSsoBot extends TeamsActivityHandler {
19
24
 
20
25
  // Add commands that requires user authentication
21
26
  this.dialog.addCommand("ShowUserProfile", "show", showUserInfo);
22
- // call the `addCommand` function to add more customized commands
27
+ // Call the `addCommand` function to add more customized commands with your own parameters, e.g.
28
+ // this.dialog.addCommand("ManageToDo", new RegExp("todo\s*.*"), todoCmdHandler, param);
23
29
 
24
30
  this.onMessage(async (context, next) => {
25
31
  console.log("Running with Message Activity.");
@@ -53,3 +59,5 @@ export class TeamsSsoBot extends TeamsActivityHandler {
53
59
  await this.dialog.run(context, this.dialogState);
54
60
  }
55
61
  }
62
+
63
+ exports.TeamsSsoBot = TeamsSsoBot;