@microsoft/teamsfx-core 1.6.1 → 1.6.2-alpha.eb3c5cc12.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 (450) hide show
  1. package/build/common/constants.d.ts +3 -0
  2. package/build/common/constants.d.ts.map +1 -1
  3. package/build/common/constants.js +3 -0
  4. package/build/common/constants.js.map +1 -1
  5. package/build/common/local/localEnvManager.d.ts +5 -2
  6. package/build/common/local/localEnvManager.d.ts.map +1 -1
  7. package/build/common/local/localEnvManager.js +16 -2
  8. package/build/common/local/localEnvManager.js.map +1 -1
  9. package/build/common/local/localStateHelper.d.ts +3 -0
  10. package/build/common/local/localStateHelper.d.ts.map +1 -0
  11. package/build/common/local/localStateHelper.js +133 -0
  12. package/build/common/local/localStateHelper.js.map +1 -0
  13. package/build/common/local/taskDefinition.d.ts +3 -0
  14. package/build/common/local/taskDefinition.d.ts.map +1 -1
  15. package/build/common/local/taskDefinition.js +36 -0
  16. package/build/common/local/taskDefinition.js.map +1 -1
  17. package/build/common/localStateConstants.d.ts +39 -0
  18. package/build/common/localStateConstants.d.ts.map +1 -0
  19. package/build/common/localStateConstants.js +44 -0
  20. package/build/common/localStateConstants.js.map +1 -0
  21. package/build/common/localStateProvider.d.ts +7 -0
  22. package/build/common/localStateProvider.d.ts.map +1 -0
  23. package/build/common/localStateProvider.js +28 -0
  24. package/build/common/localStateProvider.js.map +1 -0
  25. package/build/common/projectSettingsHelper.d.ts.map +1 -1
  26. package/build/common/projectSettingsHelper.js +2 -0
  27. package/build/common/projectSettingsHelper.js.map +1 -1
  28. package/build/common/samples-config.json +2 -2
  29. package/build/common/telemetry.d.ts +17 -0
  30. package/build/common/telemetry.d.ts.map +1 -1
  31. package/build/common/telemetry.js +17 -0
  32. package/build/common/telemetry.js.map +1 -1
  33. package/build/common/template-utils/templatesActions.d.ts +2 -2
  34. package/build/common/template-utils/templatesActions.d.ts.map +1 -1
  35. package/build/common/template-utils/templatesActions.js +6 -6
  36. package/build/common/template-utils/templatesActions.js.map +1 -1
  37. package/build/common/templates-config.json +4 -3
  38. package/build/common/tools.d.ts +4 -0
  39. package/build/common/tools.d.ts.map +1 -1
  40. package/build/common/tools.js +27 -1
  41. package/build/common/tools.js.map +1 -1
  42. package/build/core/FxCore.d.ts +2 -0
  43. package/build/core/FxCore.d.ts.map +1 -1
  44. package/build/core/FxCore.js +104 -6
  45. package/build/core/FxCore.js.map +1 -1
  46. package/build/core/environment.d.ts +1 -0
  47. package/build/core/environment.d.ts.map +1 -1
  48. package/build/core/environment.js +9 -2
  49. package/build/core/environment.js.map +1 -1
  50. package/build/core/error.d.ts +4 -0
  51. package/build/core/error.d.ts.map +1 -1
  52. package/build/core/error.js +17 -1
  53. package/build/core/error.js.map +1 -1
  54. package/build/core/globalVars.d.ts +4 -0
  55. package/build/core/globalVars.d.ts.map +1 -1
  56. package/build/core/globalVars.js +5 -1
  57. package/build/core/globalVars.js.map +1 -1
  58. package/build/core/middleware/consolidateLocalRemote.d.ts +3 -0
  59. package/build/core/middleware/consolidateLocalRemote.d.ts.map +1 -0
  60. package/build/core/middleware/consolidateLocalRemote.js +203 -0
  61. package/build/core/middleware/consolidateLocalRemote.js.map +1 -0
  62. package/build/core/middleware/envInfoLoader.d.ts.map +1 -1
  63. package/build/core/middleware/envInfoLoader.js +6 -14
  64. package/build/core/middleware/envInfoLoader.js.map +1 -1
  65. package/build/core/middleware/envInfoWriter.d.ts.map +1 -1
  66. package/build/core/middleware/envInfoWriter.js +6 -0
  67. package/build/core/middleware/envInfoWriter.js.map +1 -1
  68. package/build/core/middleware/projectMigrator.d.ts +3 -0
  69. package/build/core/middleware/projectMigrator.d.ts.map +1 -1
  70. package/build/core/middleware/projectMigrator.js +3 -1
  71. package/build/core/middleware/projectMigrator.js.map +1 -1
  72. package/build/core/middleware/questionModel.d.ts.map +1 -1
  73. package/build/core/middleware/questionModel.js +55 -1
  74. package/build/core/middleware/questionModel.js.map +1 -1
  75. package/build/core/question.d.ts +13 -2
  76. package/build/core/question.d.ts.map +1 -1
  77. package/build/core/question.js +153 -61
  78. package/build/core/question.js.map +1 -1
  79. package/build/plugins/resource/aad/aadAppClient.d.ts +4 -0
  80. package/build/plugins/resource/aad/aadAppClient.d.ts.map +1 -1
  81. package/build/plugins/resource/aad/aadAppClient.js +52 -0
  82. package/build/plugins/resource/aad/aadAppClient.js.map +1 -1
  83. package/build/plugins/resource/aad/aadAppManifestManager.d.ts +11 -0
  84. package/build/plugins/resource/aad/aadAppManifestManager.d.ts.map +1 -0
  85. package/build/plugins/resource/aad/aadAppManifestManager.js +117 -0
  86. package/build/plugins/resource/aad/aadAppManifestManager.js.map +1 -0
  87. package/build/plugins/resource/aad/constants.d.ts +13 -0
  88. package/build/plugins/resource/aad/constants.d.ts.map +1 -1
  89. package/build/plugins/resource/aad/constants.js +25 -0
  90. package/build/plugins/resource/aad/constants.js.map +1 -1
  91. package/build/plugins/resource/aad/errors.d.ts +21 -0
  92. package/build/plugins/resource/aad/errors.d.ts.map +1 -1
  93. package/build/plugins/resource/aad/errors.js +65 -1
  94. package/build/plugins/resource/aad/errors.js.map +1 -1
  95. package/build/plugins/resource/aad/index.d.ts +3 -0
  96. package/build/plugins/resource/aad/index.d.ts.map +1 -1
  97. package/build/plugins/resource/aad/index.js +9 -1
  98. package/build/plugins/resource/aad/index.js.map +1 -1
  99. package/build/plugins/resource/aad/interfaces/AADApplication.d.ts +2 -3
  100. package/build/plugins/resource/aad/interfaces/AADApplication.d.ts.map +1 -1
  101. package/build/plugins/resource/aad/interfaces/AADManifest.d.ts +2 -3
  102. package/build/plugins/resource/aad/interfaces/AADManifest.d.ts.map +1 -1
  103. package/build/plugins/resource/aad/permissions/index.d.ts +1 -0
  104. package/build/plugins/resource/aad/permissions/index.d.ts.map +1 -1
  105. package/build/plugins/resource/aad/permissions/index.js +27 -1
  106. package/build/plugins/resource/aad/permissions/index.js.map +1 -1
  107. package/build/plugins/resource/aad/permissions/permissions.json +1084 -204
  108. package/build/plugins/resource/aad/plugin.d.ts +6 -1
  109. package/build/plugins/resource/aad/plugin.d.ts.map +1 -1
  110. package/build/plugins/resource/aad/plugin.js +117 -20
  111. package/build/plugins/resource/aad/plugin.js.map +1 -1
  112. package/build/plugins/resource/aad/utils/aadManifestHelper.d.ts +2 -0
  113. package/build/plugins/resource/aad/utils/aadManifestHelper.d.ts.map +1 -1
  114. package/build/plugins/resource/aad/utils/aadManifestHelper.js +84 -8
  115. package/build/plugins/resource/aad/utils/aadManifestHelper.js.map +1 -1
  116. package/build/plugins/resource/aad/utils/configs.d.ts +3 -1
  117. package/build/plugins/resource/aad/utils/configs.d.ts.map +1 -1
  118. package/build/plugins/resource/aad/utils/configs.js +2 -2
  119. package/build/plugins/resource/aad/utils/configs.js.map +1 -1
  120. package/build/plugins/resource/aad/v2/index.d.ts +3 -1
  121. package/build/plugins/resource/aad/v2/index.d.ts.map +1 -1
  122. package/build/plugins/resource/aad/v2/index.js +6 -0
  123. package/build/plugins/resource/aad/v2/index.js.map +1 -1
  124. package/build/plugins/resource/apiconnector/constants.d.ts +25 -0
  125. package/build/plugins/resource/apiconnector/constants.d.ts.map +1 -0
  126. package/build/plugins/resource/apiconnector/constants.js +34 -0
  127. package/build/plugins/resource/apiconnector/constants.js.map +1 -0
  128. package/build/plugins/resource/apiconnector/envHandler.d.ts +19 -0
  129. package/build/plugins/resource/apiconnector/envHandler.d.ts.map +1 -0
  130. package/build/plugins/resource/apiconnector/envHandler.js +97 -0
  131. package/build/plugins/resource/apiconnector/envHandler.js.map +1 -0
  132. package/build/plugins/resource/apiconnector/errors.d.ts +35 -0
  133. package/build/plugins/resource/apiconnector/errors.d.ts.map +1 -0
  134. package/build/plugins/resource/apiconnector/errors.js +42 -0
  135. package/build/plugins/resource/apiconnector/errors.js.map +1 -0
  136. package/build/plugins/resource/apiconnector/index.d.ts +14 -0
  137. package/build/plugins/resource/apiconnector/index.d.ts.map +1 -0
  138. package/build/plugins/resource/apiconnector/index.js +43 -0
  139. package/build/plugins/resource/apiconnector/index.js.map +1 -0
  140. package/build/plugins/resource/apiconnector/plugin.d.ts +11 -0
  141. package/build/plugins/resource/apiconnector/plugin.d.ts.map +1 -0
  142. package/build/plugins/resource/apiconnector/plugin.js +101 -0
  143. package/build/plugins/resource/apiconnector/plugin.js.map +1 -0
  144. package/build/plugins/resource/apiconnector/questions.d.ts +13 -0
  145. package/build/plugins/resource/apiconnector/questions.d.ts.map +1 -0
  146. package/build/plugins/resource/apiconnector/questions.js +63 -0
  147. package/build/plugins/resource/apiconnector/questions.js.map +1 -0
  148. package/build/plugins/resource/apiconnector/result.d.ts +9 -0
  149. package/build/plugins/resource/apiconnector/result.d.ts.map +1 -0
  150. package/build/plugins/resource/apiconnector/result.js +21 -0
  151. package/build/plugins/resource/apiconnector/result.js.map +1 -0
  152. package/build/plugins/resource/apiconnector/sampleHandler.d.ts +10 -0
  153. package/build/plugins/resource/apiconnector/sampleHandler.d.ts.map +1 -0
  154. package/build/plugins/resource/apiconnector/sampleHandler.js +47 -0
  155. package/build/plugins/resource/apiconnector/sampleHandler.js.map +1 -0
  156. package/build/plugins/resource/apiconnector/utils.d.ts +22 -0
  157. package/build/plugins/resource/apiconnector/utils.d.ts.map +1 -0
  158. package/build/plugins/resource/apiconnector/utils.js +21 -0
  159. package/build/plugins/resource/apiconnector/utils.js.map +1 -0
  160. package/build/plugins/resource/appstudio/constants.d.ts +4 -0
  161. package/build/plugins/resource/appstudio/constants.d.ts.map +1 -1
  162. package/build/plugins/resource/appstudio/constants.js +30 -1
  163. package/build/plugins/resource/appstudio/constants.js.map +1 -1
  164. package/build/plugins/resource/appstudio/manifestTemplate.d.ts.map +1 -1
  165. package/build/plugins/resource/appstudio/manifestTemplate.js +6 -0
  166. package/build/plugins/resource/appstudio/manifestTemplate.js.map +1 -1
  167. package/build/plugins/resource/appstudio/plugin.d.ts +2 -2
  168. package/build/plugins/resource/appstudio/plugin.d.ts.map +1 -1
  169. package/build/plugins/resource/appstudio/plugin.js +70 -16
  170. package/build/plugins/resource/appstudio/plugin.js.map +1 -1
  171. package/build/plugins/resource/appstudio/v3/index.d.ts +5 -1
  172. package/build/plugins/resource/appstudio/v3/index.d.ts.map +1 -1
  173. package/build/plugins/resource/appstudio/v3/index.js +24 -2
  174. package/build/plugins/resource/appstudio/v3/index.js.map +1 -1
  175. package/build/plugins/resource/bot/azureOps.d.ts +1 -1
  176. package/build/plugins/resource/bot/azureOps.d.ts.map +1 -1
  177. package/build/plugins/resource/bot/azureOps.js +12 -28
  178. package/build/plugins/resource/bot/azureOps.js.map +1 -1
  179. package/build/plugins/resource/bot/clientFactory.d.ts +0 -5
  180. package/build/plugins/resource/bot/clientFactory.d.ts.map +1 -1
  181. package/build/plugins/resource/bot/clientFactory.js +1 -29
  182. package/build/plugins/resource/bot/clientFactory.js.map +1 -1
  183. package/build/plugins/resource/bot/configs/scaffoldConfig.d.ts +8 -4
  184. package/build/plugins/resource/bot/configs/scaffoldConfig.d.ts.map +1 -1
  185. package/build/plugins/resource/bot/configs/scaffoldConfig.js +40 -8
  186. package/build/plugins/resource/bot/configs/scaffoldConfig.js.map +1 -1
  187. package/build/plugins/resource/bot/configs/teamsBotConfig.d.ts +1 -1
  188. package/build/plugins/resource/bot/configs/teamsBotConfig.d.ts.map +1 -1
  189. package/build/plugins/resource/bot/configs/teamsBotConfig.js +15 -9
  190. package/build/plugins/resource/bot/configs/teamsBotConfig.js.map +1 -1
  191. package/build/plugins/resource/bot/constants.d.ts +6 -12
  192. package/build/plugins/resource/bot/constants.d.ts.map +1 -1
  193. package/build/plugins/resource/bot/constants.js +5 -11
  194. package/build/plugins/resource/bot/constants.js.map +1 -1
  195. package/build/plugins/resource/bot/enums/pluginActRoles.d.ts +2 -1
  196. package/build/plugins/resource/bot/enums/pluginActRoles.d.ts.map +1 -1
  197. package/build/plugins/resource/bot/enums/pluginActRoles.js +1 -0
  198. package/build/plugins/resource/bot/enums/pluginActRoles.js.map +1 -1
  199. package/build/plugins/resource/bot/errors.d.ts +3 -18
  200. package/build/plugins/resource/bot/errors.d.ts.map +1 -1
  201. package/build/plugins/resource/bot/errors.js +8 -38
  202. package/build/plugins/resource/bot/errors.js.map +1 -1
  203. package/build/plugins/resource/bot/functionsHostedBot/constants.d.ts +13 -0
  204. package/build/plugins/resource/bot/functionsHostedBot/constants.d.ts.map +1 -0
  205. package/build/plugins/resource/bot/functionsHostedBot/constants.js +20 -0
  206. package/build/plugins/resource/bot/functionsHostedBot/constants.js.map +1 -0
  207. package/build/plugins/resource/bot/functionsHostedBot/deployMgr.d.ts +18 -0
  208. package/build/plugins/resource/bot/functionsHostedBot/deployMgr.d.ts.map +1 -0
  209. package/build/plugins/resource/bot/functionsHostedBot/deployMgr.js +160 -0
  210. package/build/plugins/resource/bot/functionsHostedBot/deployMgr.js.map +1 -0
  211. package/build/plugins/resource/bot/functionsHostedBot/plugin.d.ts +2 -0
  212. package/build/plugins/resource/bot/functionsHostedBot/plugin.d.ts.map +1 -1
  213. package/build/plugins/resource/bot/functionsHostedBot/plugin.js +104 -2
  214. package/build/plugins/resource/bot/functionsHostedBot/plugin.js.map +1 -1
  215. package/build/plugins/resource/bot/index.d.ts +5 -2
  216. package/build/plugins/resource/bot/index.d.ts.map +1 -1
  217. package/build/plugins/resource/bot/index.js +10 -5
  218. package/build/plugins/resource/bot/index.js.map +1 -1
  219. package/build/plugins/resource/bot/languageStrategy.d.ts.map +1 -1
  220. package/build/plugins/resource/bot/languageStrategy.js +4 -2
  221. package/build/plugins/resource/bot/languageStrategy.js.map +1 -1
  222. package/build/plugins/resource/bot/plugin.d.ts +2 -1
  223. package/build/plugins/resource/bot/plugin.d.ts.map +1 -1
  224. package/build/plugins/resource/bot/plugin.js +1 -1
  225. package/build/plugins/resource/bot/plugin.js.map +1 -1
  226. package/build/plugins/resource/bot/question.d.ts +4 -1
  227. package/build/plugins/resource/bot/question.d.ts.map +1 -1
  228. package/build/plugins/resource/bot/question.js +24 -7
  229. package/build/plugins/resource/bot/question.js.map +1 -1
  230. package/build/plugins/resource/bot/resources/messages.d.ts +1 -0
  231. package/build/plugins/resource/bot/resources/messages.d.ts.map +1 -1
  232. package/build/plugins/resource/bot/resources/messages.js +5 -1
  233. package/build/plugins/resource/bot/resources/messages.js.map +1 -1
  234. package/build/plugins/resource/bot/resources/strings.d.ts +10 -0
  235. package/build/plugins/resource/bot/resources/strings.d.ts.map +1 -1
  236. package/build/plugins/resource/bot/resources/strings.js +18 -1
  237. package/build/plugins/resource/bot/resources/strings.js.map +1 -1
  238. package/build/plugins/resource/bot/utils/telemetry-helper.d.ts.map +1 -1
  239. package/build/plugins/resource/bot/utils/telemetry-helper.js +4 -1
  240. package/build/plugins/resource/bot/utils/telemetry-helper.js.map +1 -1
  241. package/build/plugins/resource/bot/v3/index.d.ts.map +1 -1
  242. package/build/plugins/resource/bot/v3/index.js +0 -1
  243. package/build/plugins/resource/bot/v3/index.js.map +1 -1
  244. package/build/plugins/resource/cicd/constants.d.ts +3 -3
  245. package/build/plugins/resource/cicd/constants.d.ts.map +1 -1
  246. package/build/plugins/resource/cicd/constants.js +4 -3
  247. package/build/plugins/resource/cicd/constants.js.map +1 -1
  248. package/build/plugins/resource/cicd/errors.d.ts.map +1 -1
  249. package/build/plugins/resource/cicd/errors.js.map +1 -1
  250. package/build/plugins/resource/cicd/index.d.ts.map +1 -1
  251. package/build/plugins/resource/cicd/index.js +10 -3
  252. package/build/plugins/resource/cicd/index.js.map +1 -1
  253. package/build/plugins/resource/cicd/plugin.d.ts.map +1 -1
  254. package/build/plugins/resource/cicd/plugin.js +14 -12
  255. package/build/plugins/resource/cicd/plugin.js.map +1 -1
  256. package/build/plugins/resource/cicd/questions.d.ts +2 -0
  257. package/build/plugins/resource/cicd/questions.d.ts.map +1 -1
  258. package/build/plugins/resource/cicd/questions.js +28 -6
  259. package/build/plugins/resource/cicd/questions.js.map +1 -1
  260. package/build/plugins/resource/frontend/constants.d.ts +0 -1
  261. package/build/plugins/resource/frontend/constants.d.ts.map +1 -1
  262. package/build/plugins/resource/frontend/constants.js +0 -1
  263. package/build/plugins/resource/frontend/constants.js.map +1 -1
  264. package/build/plugins/resource/frontend/dotnet/constants.d.ts +0 -1
  265. package/build/plugins/resource/frontend/dotnet/constants.d.ts.map +1 -1
  266. package/build/plugins/resource/frontend/dotnet/constants.js +0 -1
  267. package/build/plugins/resource/frontend/dotnet/constants.js.map +1 -1
  268. package/build/plugins/resource/frontend/dotnet/ops/scaffold.d.ts.map +1 -1
  269. package/build/plugins/resource/frontend/dotnet/ops/scaffold.js +0 -1
  270. package/build/plugins/resource/frontend/dotnet/ops/scaffold.js.map +1 -1
  271. package/build/plugins/resource/frontend/ops/scaffold.d.ts.map +1 -1
  272. package/build/plugins/resource/frontend/ops/scaffold.js +0 -1
  273. package/build/plugins/resource/frontend/ops/scaffold.js.map +1 -1
  274. package/build/plugins/resource/frontend/resources/templateInfo.d.ts +1 -0
  275. package/build/plugins/resource/frontend/resources/templateInfo.d.ts.map +1 -1
  276. package/build/plugins/resource/frontend/resources/templateInfo.js +9 -2
  277. package/build/plugins/resource/frontend/resources/templateInfo.js.map +1 -1
  278. package/build/plugins/resource/frontend/v3/index.d.ts.map +1 -1
  279. package/build/plugins/resource/frontend/v3/index.js +0 -1
  280. package/build/plugins/resource/frontend/v3/index.js.map +1 -1
  281. package/build/plugins/resource/function/constants.d.ts +0 -1
  282. package/build/plugins/resource/function/constants.d.ts.map +1 -1
  283. package/build/plugins/resource/function/constants.js +0 -1
  284. package/build/plugins/resource/function/constants.js.map +1 -1
  285. package/build/plugins/resource/function/ops/scaffold.d.ts.map +1 -1
  286. package/build/plugins/resource/function/ops/scaffold.js +0 -1
  287. package/build/plugins/resource/function/ops/scaffold.js.map +1 -1
  288. package/build/plugins/resource/index.d.ts +1 -0
  289. package/build/plugins/resource/index.d.ts.map +1 -1
  290. package/build/plugins/resource/index.js +1 -0
  291. package/build/plugins/resource/index.js.map +1 -1
  292. package/build/plugins/resource/localdebug/v2/index.d.ts.map +1 -1
  293. package/build/plugins/resource/localdebug/v2/index.js +1 -1
  294. package/build/plugins/resource/localdebug/v2/index.js.map +1 -1
  295. package/build/plugins/resource/simpleauth/plugin.d.ts.map +1 -1
  296. package/build/plugins/resource/simpleauth/plugin.js +24 -5
  297. package/build/plugins/resource/simpleauth/plugin.js.map +1 -1
  298. package/build/plugins/resource/simpleauth/v2/index.d.ts +2 -2
  299. package/build/plugins/resource/simpleauth/v2/index.d.ts.map +1 -1
  300. package/build/plugins/resource/simpleauth/v2/index.js +4 -4
  301. package/build/plugins/resource/simpleauth/v2/index.js.map +1 -1
  302. package/build/plugins/resource/spfx/depsChecker/dependencyChecker.d.ts +11 -0
  303. package/build/plugins/resource/spfx/depsChecker/dependencyChecker.d.ts.map +1 -0
  304. package/build/plugins/resource/spfx/depsChecker/dependencyChecker.js +5 -0
  305. package/build/plugins/resource/spfx/depsChecker/dependencyChecker.js.map +1 -0
  306. package/build/plugins/resource/spfx/depsChecker/generatorChecker.d.ts +21 -0
  307. package/build/plugins/resource/spfx/depsChecker/generatorChecker.d.ts.map +1 -0
  308. package/build/plugins/resource/spfx/depsChecker/generatorChecker.js +131 -0
  309. package/build/plugins/resource/spfx/depsChecker/generatorChecker.js.map +1 -0
  310. package/build/plugins/resource/spfx/depsChecker/yoChecker.d.ts +21 -0
  311. package/build/plugins/resource/spfx/depsChecker/yoChecker.d.ts.map +1 -0
  312. package/build/plugins/resource/spfx/depsChecker/yoChecker.js +128 -0
  313. package/build/plugins/resource/spfx/depsChecker/yoChecker.js.map +1 -0
  314. package/build/plugins/resource/spfx/error.d.ts +4 -0
  315. package/build/plugins/resource/spfx/error.d.ts.map +1 -1
  316. package/build/plugins/resource/spfx/error.js +17 -1
  317. package/build/plugins/resource/spfx/error.js.map +1 -1
  318. package/build/plugins/resource/spfx/index.d.ts.map +1 -1
  319. package/build/plugins/resource/spfx/index.js +5 -2
  320. package/build/plugins/resource/spfx/index.js.map +1 -1
  321. package/build/plugins/resource/spfx/plugin.d.ts.map +1 -1
  322. package/build/plugins/resource/spfx/plugin.js +62 -13
  323. package/build/plugins/resource/spfx/plugin.js.map +1 -1
  324. package/build/plugins/resource/spfx/utils/constants.d.ts +5 -2
  325. package/build/plugins/resource/spfx/utils/constants.d.ts.map +1 -1
  326. package/build/plugins/resource/spfx/utils/constants.js +5 -2
  327. package/build/plugins/resource/spfx/utils/constants.js.map +1 -1
  328. package/build/plugins/resource/spfx/utils/questions.js +1 -1
  329. package/build/plugins/resource/spfx/utils/questions.js.map +1 -1
  330. package/build/plugins/resource/spfx/utils/telemetry-helper.d.ts.map +1 -1
  331. package/build/plugins/resource/spfx/utils/telemetry-helper.js +1 -0
  332. package/build/plugins/resource/spfx/utils/telemetry-helper.js.map +1 -1
  333. package/build/plugins/resource/spfx/utils/telemetryEvents.d.ts +11 -0
  334. package/build/plugins/resource/spfx/utils/telemetryEvents.d.ts.map +1 -0
  335. package/build/plugins/resource/spfx/utils/telemetryEvents.js +18 -0
  336. package/build/plugins/resource/spfx/utils/telemetryEvents.js.map +1 -0
  337. package/build/plugins/resource/spfx/utils/utils.d.ts +1 -0
  338. package/build/plugins/resource/spfx/utils/utils.d.ts.map +1 -1
  339. package/build/plugins/resource/spfx/utils/utils.js +16 -0
  340. package/build/plugins/resource/spfx/utils/utils.js.map +1 -1
  341. package/build/plugins/solution/fx-solution/ResourcePluginContainer.d.ts +1 -0
  342. package/build/plugins/solution/fx-solution/ResourcePluginContainer.d.ts.map +1 -1
  343. package/build/plugins/solution/fx-solution/ResourcePluginContainer.js +1 -0
  344. package/build/plugins/solution/fx-solution/ResourcePluginContainer.js.map +1 -1
  345. package/build/plugins/solution/fx-solution/constants.d.ts +24 -3
  346. package/build/plugins/solution/fx-solution/constants.d.ts.map +1 -1
  347. package/build/plugins/solution/fx-solution/constants.js +26 -1
  348. package/build/plugins/solution/fx-solution/constants.js.map +1 -1
  349. package/build/plugins/solution/fx-solution/debug/constants.d.ts +15 -0
  350. package/build/plugins/solution/fx-solution/debug/constants.d.ts.map +1 -1
  351. package/build/plugins/solution/fx-solution/debug/constants.js +18 -1
  352. package/build/plugins/solution/fx-solution/debug/constants.js.map +1 -1
  353. package/build/plugins/solution/fx-solution/debug/provisionLocal.d.ts +2 -3
  354. package/build/plugins/solution/fx-solution/debug/provisionLocal.d.ts.map +1 -1
  355. package/build/plugins/solution/fx-solution/debug/provisionLocal.js +40 -12
  356. package/build/plugins/solution/fx-solution/debug/provisionLocal.js.map +1 -1
  357. package/build/plugins/solution/fx-solution/debug/scaffolding.d.ts.map +1 -1
  358. package/build/plugins/solution/fx-solution/debug/scaffolding.js +17 -10
  359. package/build/plugins/solution/fx-solution/debug/scaffolding.js.map +1 -1
  360. package/build/plugins/solution/fx-solution/debug/util/launch.d.ts.map +1 -1
  361. package/build/plugins/solution/fx-solution/debug/util/launch.js +19 -6
  362. package/build/plugins/solution/fx-solution/debug/util/launch.js.map +1 -1
  363. package/build/plugins/solution/fx-solution/debug/util/launchNext.d.ts +2 -0
  364. package/build/plugins/solution/fx-solution/debug/util/launchNext.d.ts.map +1 -1
  365. package/build/plugins/solution/fx-solution/debug/util/launchNext.js +179 -10
  366. package/build/plugins/solution/fx-solution/debug/util/launchNext.js.map +1 -1
  367. package/build/plugins/solution/fx-solution/debug/util/settings.d.ts +1 -1
  368. package/build/plugins/solution/fx-solution/debug/util/settings.d.ts.map +1 -1
  369. package/build/plugins/solution/fx-solution/debug/util/settings.js +2 -2
  370. package/build/plugins/solution/fx-solution/debug/util/settings.js.map +1 -1
  371. package/build/plugins/solution/fx-solution/debug/util/tasksNext.d.ts +1 -0
  372. package/build/plugins/solution/fx-solution/debug/util/tasksNext.d.ts.map +1 -1
  373. package/build/plugins/solution/fx-solution/debug/util/tasksNext.js +74 -1
  374. package/build/plugins/solution/fx-solution/debug/util/tasksNext.js.map +1 -1
  375. package/build/plugins/solution/fx-solution/question.d.ts +6 -2
  376. package/build/plugins/solution/fx-solution/question.d.ts.map +1 -1
  377. package/build/plugins/solution/fx-solution/question.js +33 -4
  378. package/build/plugins/solution/fx-solution/question.js.map +1 -1
  379. package/build/plugins/solution/fx-solution/v2/executeUserTask.d.ts +5 -1
  380. package/build/plugins/solution/fx-solution/v2/executeUserTask.d.ts.map +1 -1
  381. package/build/plugins/solution/fx-solution/v2/executeUserTask.js +409 -135
  382. package/build/plugins/solution/fx-solution/v2/executeUserTask.js.map +1 -1
  383. package/build/plugins/solution/fx-solution/v2/executor.d.ts +1 -1
  384. package/build/plugins/solution/fx-solution/v2/executor.d.ts.map +1 -1
  385. package/build/plugins/solution/fx-solution/v2/executor.js +33 -13
  386. package/build/plugins/solution/fx-solution/v2/executor.js.map +1 -1
  387. package/build/plugins/solution/fx-solution/v2/getQuestions.d.ts +1 -1
  388. package/build/plugins/solution/fx-solution/v2/getQuestions.d.ts.map +1 -1
  389. package/build/plugins/solution/fx-solution/v2/getQuestions.js +102 -37
  390. package/build/plugins/solution/fx-solution/v2/getQuestions.js.map +1 -1
  391. package/build/plugins/solution/fx-solution/v2/provisionLocal.d.ts +1 -2
  392. package/build/plugins/solution/fx-solution/v2/provisionLocal.d.ts.map +1 -1
  393. package/build/plugins/solution/fx-solution/v2/provisionLocal.js.map +1 -1
  394. package/build/plugins/solution/fx-solution/v2/scaffolding.d.ts +1 -1
  395. package/build/plugins/solution/fx-solution/v2/scaffolding.d.ts.map +1 -1
  396. package/build/plugins/solution/fx-solution/v2/scaffolding.js +25 -13
  397. package/build/plugins/solution/fx-solution/v2/scaffolding.js.map +1 -1
  398. package/build/plugins/solution/fx-solution/v2/utils.d.ts +1 -2
  399. package/build/plugins/solution/fx-solution/v2/utils.d.ts.map +1 -1
  400. package/build/plugins/solution/fx-solution/v2/utils.js +28 -8
  401. package/build/plugins/solution/fx-solution/v2/utils.js.map +1 -1
  402. package/build/plugins/solution/fx-solution/v3/provision.js +1 -1
  403. package/build/plugins/solution/fx-solution/v3/provision.js.map +1 -1
  404. package/build/plugins/solution/fx-solution/v3/userTask.js +1 -1
  405. package/build/plugins/solution/fx-solution/v3/userTask.js.map +1 -1
  406. package/package.json +4 -3
  407. package/resource/package.nls.json +133 -18
  408. package/templates/core/README-auto-generated.md +31 -0
  409. package/templates/{plugins/resource/dotnet → fallback}/blazor-base.csharp.default.zip +0 -0
  410. package/templates/{plugins/resource/bot → fallback}/bot.csharp.default.zip +0 -0
  411. package/templates/{plugins/resource/bot → fallback}/bot.js.default.zip +0 -0
  412. package/templates/fallback/bot.ts.command-and-response.zip +0 -0
  413. package/templates/{plugins/resource/bot → fallback}/bot.ts.default.zip +0 -0
  414. package/templates/fallback/bot.ts.notification-function-base.zip +0 -0
  415. package/templates/fallback/bot.ts.notification-restify.zip +0 -0
  416. package/templates/fallback/bot.ts.notification-trigger-http.zip +0 -0
  417. package/templates/fallback/bot.ts.notification-trigger-timer.zip +0 -0
  418. package/templates/fallback/bot.ts.notification.zip +0 -0
  419. package/templates/{plugins/resource/function → fallback}/function-base.js.default.zip +0 -0
  420. package/templates/{plugins/resource/function → fallback}/function-base.ts.default.zip +0 -0
  421. package/templates/{plugins/resource/function → fallback}/function-triggers.js.HTTPTrigger.zip +0 -0
  422. package/templates/{plugins/resource/function → fallback}/function-triggers.ts.HTTPTrigger.zip +0 -0
  423. package/templates/{plugins/resource/frontend → fallback}/tab.csharp.default.zip +0 -0
  424. package/templates/fallback/tab.js.default.zip +0 -0
  425. package/templates/{plugins/resource/frontend/tab.js.default.zip → fallback/tab.js.m365.zip} +0 -0
  426. package/templates/fallback/tab.js.non-sso.zip +0 -0
  427. package/templates/fallback/tab.ts.default.zip +0 -0
  428. package/templates/{plugins/resource/frontend/tab.ts.default.zip → fallback/tab.ts.m365.zip} +0 -0
  429. package/templates/fallback/tab.ts.non-sso.zip +0 -0
  430. package/templates/plugins/resource/aad/auth/bot/README.md +63 -0
  431. package/templates/plugins/resource/aad/auth/bot/js/public/auth-end.html +65 -0
  432. package/templates/plugins/resource/aad/auth/bot/js/public/auth-start.html +177 -0
  433. package/templates/plugins/resource/aad/auth/bot/js/sso/showUserInfo.js +19 -0
  434. package/templates/plugins/resource/aad/auth/bot/js/sso/ssoDialog.js +173 -0
  435. package/templates/plugins/resource/aad/auth/bot/js/sso/teamsSsoBot.js +55 -0
  436. package/templates/plugins/resource/aad/auth/bot/ts/public/auth-end.html +65 -0
  437. package/templates/plugins/resource/aad/auth/bot/ts/public/auth-start.html +177 -0
  438. package/templates/plugins/resource/aad/auth/bot/ts/sso/showUserInfo.ts +24 -0
  439. package/templates/plugins/resource/aad/auth/bot/ts/sso/ssoDialog.ts +182 -0
  440. package/templates/plugins/resource/aad/auth/bot/ts/sso/teamsSsoBot.ts +69 -0
  441. package/templates/plugins/resource/aad/manifest/aad.template.json +7 -14
  442. package/templates/plugins/resource/apiconnector/sample/js/api-connector.template +30 -0
  443. package/templates/plugins/resource/apiconnector/sample/ts/api-connector.template +30 -0
  444. package/templates/plugins/resource/bot/bicep/botProvision.template.bicep +6 -0
  445. package/templates/plugins/resource/bot/bicep/funcHostedBotProvision.template.bicep +127 -0
  446. package/templates/plugins/resource/function/bicep/functionProvision.template.bicep +2 -0
  447. package/templates/plugins/resource/simpleauth/bicep/simpleAuthProvision.template.bicep +4 -0
  448. package/templates/plugins/resource/spfx/solution/README.md +2 -2
  449. package/templates/plugins/resource/sql/bicep/sqlProvision.template.bicep +1 -0
  450. package/templates/plugins/resource/webapp/bicep/webappProvision.template.bicep +2 -0
@@ -0,0 +1,24 @@
1
+ import { createMicrosoftGraphClient, TeamsFx } from "@microsoft/teamsfx";
2
+ import { TurnContext } from "botbuilder";
3
+ import { DialogTurnResult } from "botbuilder-dialogs";
4
+
5
+ export async function showUserInfo(
6
+ context: TurnContext,
7
+ ssoToken: string
8
+ ): Promise<DialogTurnResult> {
9
+ await context.sendActivity("Retrieving user information from Microsoft Graph ...");
10
+ const teamsfx = new TeamsFx().setSsoToken(ssoToken);
11
+ const graphClient = createMicrosoftGraphClient(teamsfx, ["User.Read"]);
12
+ const me = await graphClient.api("/me").get();
13
+ if (me) {
14
+ await context.sendActivity(
15
+ `You're logged in as ${me.displayName} (${me.userPrincipalName})${
16
+ me.jobTitle ? `; your job title is: ${me.jobTitle}` : ""
17
+ }.`
18
+ );
19
+ } else {
20
+ await context.sendActivity("Could not retrieve profile information from Microsoft Graph.");
21
+ }
22
+
23
+ return;
24
+ }
@@ -0,0 +1,182 @@
1
+ import {
2
+ ComponentDialog,
3
+ WaterfallDialog,
4
+ Dialog,
5
+ DialogTurnResult,
6
+ DialogSet,
7
+ DialogTurnStatus,
8
+ } from "botbuilder-dialogs";
9
+ import { ActivityTypes, Storage, tokenExchangeOperationName, TurnContext } from "botbuilder";
10
+ import { TeamsBotSsoPrompt, TeamsBotSsoPromptTokenResponse, TeamsFx } from "@microsoft/teamsfx";
11
+ import "isomorphic-fetch";
12
+
13
+ const DIALOG_NAME = "SSODialog";
14
+ const TEAMS_SSO_PROMPT_ID = "TeamsFxSsoPrompt";
15
+ const COMMAND_ROUTE_DIALOG = "CommandRouteDialog";
16
+
17
+ export class SsoDialog extends ComponentDialog {
18
+ private requiredScopes: string[];
19
+ private dedupStorage: Storage;
20
+ private dedupStorageKeys: string[] = [];
21
+ private commandMapping: Map<string, string | RegExp> = new Map<string, string | RegExp>();
22
+
23
+ constructor(dedupStorage: Storage, requiredScopes: string[]) {
24
+ super(DIALOG_NAME);
25
+
26
+ this.initialDialogId = COMMAND_ROUTE_DIALOG;
27
+
28
+ this.dedupStorage = dedupStorage;
29
+ this.dedupStorageKeys = [];
30
+ this.requiredScopes = requiredScopes;
31
+
32
+ const teamsFx = new TeamsFx();
33
+ const ssoDialog = new TeamsBotSsoPrompt(teamsFx, TEAMS_SSO_PROMPT_ID, {
34
+ scopes: this.requiredScopes,
35
+ endOnInvalidMessage: true,
36
+ });
37
+ this.addDialog(ssoDialog);
38
+
39
+ const commandRouteDialog = new WaterfallDialog(COMMAND_ROUTE_DIALOG, [
40
+ this.commandRouteStep.bind(this),
41
+ ]);
42
+ this.addDialog(commandRouteDialog);
43
+ }
44
+
45
+ public addCommand(
46
+ commandId: string,
47
+ commandText: string | RegExp,
48
+ operation: (context: TurnContext, ssoToken: string) => Promise<DialogTurnResult>
49
+ ): void {
50
+ const dialog = new WaterfallDialog(commandId, [
51
+ this.ssoStep.bind(this),
52
+ this.dedupStep.bind(this),
53
+ async (stepContext: any) => {
54
+ const tokenResponse: TeamsBotSsoPromptTokenResponse = stepContext.result;
55
+ const context: TurnContext = stepContext.context;
56
+ if (tokenResponse) {
57
+ await operation(context, tokenResponse.ssoToken);
58
+ } else {
59
+ await context.sendActivity("Failed to retrieve user token from conversation context.");
60
+ }
61
+ return await stepContext.endDialog();
62
+ },
63
+ ]);
64
+
65
+ if (this.commandMapping.has(commandId)) {
66
+ throw new Error(`Cannot add command. There is already a command with same id ${commandId}`);
67
+ }
68
+ this.commandMapping.set(commandId, commandText);
69
+ this.addDialog(dialog);
70
+ }
71
+
72
+ /**
73
+ * The run method handles the incoming activity (in the form of a DialogContext) and passes it through the dialog system.
74
+ * If no dialog is active, it will start the default dialog.
75
+ * @param {*} dialogContext
76
+ */
77
+ public async run(context: TurnContext, accessor: any) {
78
+ const dialogSet = new DialogSet(accessor);
79
+ dialogSet.add(this);
80
+
81
+ const dialogContext = await dialogSet.createContext(context);
82
+ const results = await dialogContext.continueDialog();
83
+ if (results && results.status === DialogTurnStatus.empty) {
84
+ await dialogContext.beginDialog(this.id);
85
+ }
86
+ }
87
+
88
+ private async commandRouteStep(stepContext: any) {
89
+ const turnContext = stepContext.context as TurnContext;
90
+
91
+ // remove the mention of this bot
92
+ let text = TurnContext.removeRecipientMention(turnContext.activity);
93
+ if (text) {
94
+ // remove the line break
95
+ text = text.toLowerCase().replace(/\n|\r/g, "").trim();
96
+ }
97
+
98
+ const commandId = this.matchCommands(text);
99
+ if (commandId) {
100
+ return await stepContext.beginDialog(commandId);
101
+ }
102
+ return await stepContext.endDialog();
103
+ }
104
+
105
+ private async ssoStep(stepContext: any) {
106
+ return await stepContext.beginDialog(TEAMS_SSO_PROMPT_ID);
107
+ }
108
+
109
+ private async dedupStep(stepContext: any) {
110
+ const tokenResponse = stepContext.result;
111
+ // Only dedup after ssoStep to make sure that all Teams client would receive the login request
112
+ if (tokenResponse && (await this.shouldDedup(stepContext.context))) {
113
+ return Dialog.EndOfTurn;
114
+ }
115
+ return await stepContext.next(tokenResponse);
116
+ }
117
+
118
+ public async onEndDialog(context: TurnContext) {
119
+ const conversationId = context.activity.conversation.id;
120
+ const currentDedupKeys = this.dedupStorageKeys.filter((key) => key.indexOf(conversationId) > 0);
121
+ await this.dedupStorage.delete(currentDedupKeys);
122
+ this.dedupStorageKeys = this.dedupStorageKeys.filter((key) => key.indexOf(conversationId) < 0);
123
+ }
124
+
125
+ // If a user is signed into multiple Teams clients, the Bot might receive a "signin/tokenExchange" from each client.
126
+ // Each token exchange request for a specific user login will have an identical activity.value.Id.
127
+ // Only one of these token exchange requests should be processed by the bot. For a distributed bot in production,
128
+ // this requires a distributed storage to ensure only one token exchange is processed.
129
+ private async shouldDedup(context: TurnContext): Promise<boolean> {
130
+ const storeItem = {
131
+ eTag: context.activity.value.id,
132
+ };
133
+
134
+ const key = this.getStorageKey(context);
135
+ const storeItems = { [key]: storeItem };
136
+
137
+ try {
138
+ await this.dedupStorage.write(storeItems);
139
+ this.dedupStorageKeys.push(key);
140
+ } catch (err) {
141
+ if (err instanceof Error && err.message.indexOf("eTag conflict")) {
142
+ return true;
143
+ }
144
+ throw err;
145
+ }
146
+ return false;
147
+ }
148
+
149
+ private getStorageKey(context: TurnContext): string {
150
+ if (!context || !context.activity || !context.activity.conversation) {
151
+ throw new Error("Invalid context, can not get storage key!");
152
+ }
153
+ const activity = context.activity;
154
+ const channelId = activity.channelId;
155
+ const conversationId = activity.conversation.id;
156
+ if (activity.type !== ActivityTypes.Invoke || activity.name !== tokenExchangeOperationName) {
157
+ throw new Error("TokenExchangeState can only be used with Invokes of signin/tokenExchange.");
158
+ }
159
+ const value = activity.value;
160
+ if (!value || !value.id) {
161
+ throw new Error("Invalid signin/tokenExchange. Missing activity.value.id.");
162
+ }
163
+ return `${channelId}/${conversationId}/${value.id}`;
164
+ }
165
+
166
+ private matchCommands(text: string): string {
167
+ for (const command of this.commandMapping) {
168
+ const pattern: string | RegExp = command[1];
169
+ let matchResult: RegExpExecArray | boolean;
170
+ if (typeof pattern == "string") {
171
+ matchResult = text === pattern;
172
+ } else {
173
+ matchResult = pattern.exec(text);
174
+ }
175
+ if (matchResult) {
176
+ return command[0]; // Return the command id
177
+ }
178
+ }
179
+
180
+ return undefined;
181
+ }
182
+ }
@@ -0,0 +1,69 @@
1
+ import {
2
+ BotState,
3
+ ConversationState,
4
+ MemoryStorage,
5
+ SigninStateVerificationQuery,
6
+ StatePropertyAccessor,
7
+ TeamsActivityHandler,
8
+ TurnContext,
9
+ UserState,
10
+ } from "botbuilder";
11
+ import { showUserInfo } from "./showUserInfo";
12
+ import { SsoDialog } from "./ssoDialog";
13
+
14
+ export class TeamsSsoBot extends TeamsActivityHandler {
15
+ private dialog: SsoDialog;
16
+ private userState: BotState;
17
+ private conversationState: BotState;
18
+ private dialogState: StatePropertyAccessor;
19
+
20
+ constructor() {
21
+ super();
22
+
23
+ // Define the state store for your bot.
24
+ // See https://aka.ms/about-bot-state to learn more about using MemoryStorage.
25
+ // A bot requires a state storage system to persist the dialog and user state between messages.
26
+ const memoryStorage = new MemoryStorage();
27
+
28
+ // Create conversation and user state with in-memory storage provider.
29
+ this.conversationState = new ConversationState(memoryStorage);
30
+ this.userState = new UserState(memoryStorage);
31
+ this.dialog = new SsoDialog(new MemoryStorage(), ["User.Read"]);
32
+ this.dialogState = this.conversationState.createProperty("DialogState");
33
+
34
+ // Add commands that requires user authentication
35
+ this.dialog.addCommand("ShowUserProfile", "show", showUserInfo);
36
+ // call the `addCommand` function to add more customized commands
37
+
38
+ this.onMessage(async (context, next) => {
39
+ console.log("Running with Message Activity.");
40
+
41
+ // Run the Dialog with the new message Activity.
42
+ await this.dialog.run(context, this.dialogState);
43
+
44
+ // By calling next() you ensure that the next BotHandler is run.
45
+ await next();
46
+ });
47
+ }
48
+
49
+ async run(context: TurnContext) {
50
+ await super.run(context);
51
+
52
+ // Save any state changes. The load happened during the execution of the Dialog.
53
+ await this.conversationState.saveChanges(context, false);
54
+ await this.userState.saveChanges(context, false);
55
+ }
56
+
57
+ async handleTeamsSigninVerifyState(context: TurnContext, query: SigninStateVerificationQuery) {
58
+ console.log("Running dialog with signin/verifystate from an Invoke Activity.");
59
+ await this.dialog.run(context, this.dialogState);
60
+ }
61
+
62
+ async handleTeamsSigninTokenExchange(context: TurnContext, query: SigninStateVerificationQuery) {
63
+ await this.dialog.run(context, this.dialogState);
64
+ }
65
+
66
+ async onSignInInvoke(context: TurnContext) {
67
+ await this.dialog.run(context, this.dialogState);
68
+ }
69
+ }
@@ -18,7 +18,7 @@
18
18
  },
19
19
  "requiredResourceAccess": [
20
20
  {
21
- "resourceAppId": "00000003-0000-0000-c000-000000000000",
21
+ "resourceAppId": "Microsoft Graph",
22
22
  "resourceAccess": [
23
23
  {
24
24
  "id": "User.Read",
@@ -33,8 +33,6 @@
33
33
  "adminConsentDisplayName": "Teams can access app's web APIs",
34
34
  "id": "{{state.fx-resource-aad-app-for-teams.oauth2PermissionScopeId}}",
35
35
  "isEnabled": true,
36
- "lang": null,
37
- "origin": "Application",
38
36
  "type": "User",
39
37
  "userConsentDescription": "Enable Teams to call this app's web APIs with the same rights that you have",
40
38
  "userConsentDisplayName": "Teams can access app's web APIs and make requests on your behalf",
@@ -43,13 +41,13 @@
43
41
  ],
44
42
  "preAuthorizedApplications": [
45
43
  {
46
- "appId": "bc59ab01-8403-45c6-8796-ac3ef710b3e3",
44
+ "appId": "1fec8e78-bce4-4aaf-ab1b-5451cc387264",
47
45
  "permissionIds": [
48
46
  "{{state.fx-resource-aad-app-for-teams.oauth2PermissionScopeId}}"
49
47
  ]
50
48
  },
51
49
  {
52
- "appId": "00000002-0000-0ff1-ce00-000000000000",
50
+ "appId": "5e3ce6c0-2b1f-4285-8d4b-75ee78787346",
53
51
  "permissionIds": [
54
52
  "{{state.fx-resource-aad-app-for-teams.oauth2PermissionScopeId}}"
55
53
  ]
@@ -61,13 +59,13 @@
61
59
  ]
62
60
  },
63
61
  {
64
- "appId": "4765445b-32c6-49b0-83e6-1d93765276ca",
62
+ "appId": "00000002-0000-0ff1-ce00-000000000000",
65
63
  "permissionIds": [
66
64
  "{{state.fx-resource-aad-app-for-teams.oauth2PermissionScopeId}}"
67
65
  ]
68
66
  },
69
67
  {
70
- "appId": "4345a7b9-9a63-4910-a426-35363201d503",
68
+ "appId": "bc59ab01-8403-45c6-8796-ac3ef710b3e3",
71
69
  "permissionIds": [
72
70
  "{{state.fx-resource-aad-app-for-teams.oauth2PermissionScopeId}}"
73
71
  ]
@@ -79,23 +77,18 @@
79
77
  ]
80
78
  },
81
79
  {
82
- "appId": "5e3ce6c0-2b1f-4285-8d4b-75ee78787346",
80
+ "appId": "4765445b-32c6-49b0-83e6-1d93765276ca",
83
81
  "permissionIds": [
84
82
  "{{state.fx-resource-aad-app-for-teams.oauth2PermissionScopeId}}"
85
83
  ]
86
84
  },
87
85
  {
88
- "appId": "1fec8e78-bce4-4aaf-ab1b-5451cc387264",
86
+ "appId": "4345a7b9-9a63-4910-a426-35363201d503",
89
87
  "permissionIds": [
90
88
  "{{state.fx-resource-aad-app-for-teams.oauth2PermissionScopeId}}"
91
89
  ]
92
90
  }
93
91
  ],
94
- "passwordCredentials": [
95
- {
96
- "displayName": "default"
97
- }
98
- ],
99
92
  "identifierUris": [
100
93
  "{{state.fx-resource-aad-app-for-teams.applicationIdUris}}"
101
94
  ],
@@ -0,0 +1,30 @@
1
+ const teamsfxSdk = require("@microsoft/teamsfx");
2
+
3
+ // Loads current app's configuration
4
+ const teamsFx = new teamsfxSdk.TeamsFx();
5
+ // Initializes a new axios instance to call {{config.APIName}} API
6
+ const authProvider = new teamsfxSdk.BasicAuthProvider(
7
+ teamsFx.getConfig("API_{{capitalName}}_USERNAME"),
8
+ teamsFx.getConfig("API_{{capitalName}}_PASSWORD")
9
+ );
10
+ const {{config.APIName}}Client = teamsfxSdk.createApiClient(teamsFx.getConfig("API_{{capitalName}}_ENDPOINT"), authProvider);
11
+ export { {{config.APIName}}Client };
12
+
13
+ /*
14
+ You can now call {{config.APIName}} APIs without worrying about authentication.
15
+ Here is an example for a GET request to "relative_path_of_target_api":
16
+ const result = await {{config.APIName}}Client.get("relative_path_of_target_api");
17
+
18
+ You can refer https://aka.ms/teamsfx-connect-api to learn more.
19
+ */
20
+
21
+ /*
22
+ Setting API configuration for cloud environment:
23
+ We have already set the configuration to .env.teamsfx.local based on your answers.
24
+ Before you deploy your code to cloud using TeamsFx, please follow https://aka.ms/teamsfx-add-appsettings to add following app settings with appropriate value to your Azure environment:
25
+ API_{{capitalName}}_ENDPOINT
26
+ API_{{capitalName}}_USERNAME
27
+ API_{{capitalName}}_PASSWORD
28
+
29
+ You can refer https://aka.ms/teamsfx-connet-api to learn more.
30
+ */
@@ -0,0 +1,30 @@
1
+ import { TeamsFx, createApiClient, BasicAuthProvider } from "@microsoft/teamsfx";
2
+
3
+ // Loads current app's configuration
4
+ const teamsFx = new TeamsFx();
5
+ // Initializes a new axios instance to call {{config.APIName}} API
6
+ const authProvider = new BasicAuthProvider(
7
+ teamsFx.getConfig("API_{{capitalName}}_USERNAME"),
8
+ teamsFx.getConfig("API_{{capitalName}}_PASSWORD")
9
+ );
10
+ const {{config.APIName}}Client = createApiClient(teamsFx.getConfig("API_{{capitalName}}_ENDPOINT"), authProvider);
11
+ export { {{config.APIName}}Client };
12
+
13
+ /*
14
+ You can now call {{config.APIName}} APIs without worrying about authentication.
15
+ Here is an example for a GET request to "relative_path_of_target_api":
16
+ const result = await {{config.APIName}}Client.get("relative_path_of_target_api");
17
+
18
+ You can refer https://aka.ms/teamsfx-connect-api to learn more.
19
+ */
20
+
21
+ /*
22
+ Setting API configuration for cloud environment:
23
+ We have already set the configuration to .env.teamsfx.local based on your answers.
24
+ Before you deploy your code to cloud using TeamsFx, please follow https://aka.ms/teamsfx-add-appsettings to add following app settings with appropriate value to your Azure environment:
25
+ API_{{capitalName}}_ENDPOINT
26
+ API_{{capitalName}}_USERNAME
27
+ API_{{capitalName}}_PASSWORD
28
+
29
+ You can refer https://aka.ms/teamsfx-connet-api to learn more.
30
+ */
@@ -54,6 +54,7 @@ resource webApp 'Microsoft.Web/sites@2021-02-01' = {
54
54
  properties: {
55
55
  serverFarmId: serverfarm.id
56
56
  keyVaultReferenceIdentity: userAssignedIdentityId // Use given user assigned identity to access Key Vault
57
+ httpsOnly: true
57
58
  siteConfig: {
58
59
  appSettings: [
59
60
  {
@@ -64,7 +65,12 @@ resource webApp 'Microsoft.Web/sites@2021-02-01' = {
64
65
  name: 'WEBSITE_NODE_DEFAULT_VERSION'
65
66
  value: '~14' // Set NodeJS version to 14.x for your site
66
67
  }
68
+ {
69
+ name: 'RUNNING_ON_AZURE'
70
+ value: '1'
71
+ }
67
72
  ]
73
+ ftpsState: 'FtpsOnly'
68
74
  }
69
75
  }
70
76
  identity: {
@@ -0,0 +1,127 @@
1
+ @secure()
2
+ param provisionParameters object
3
+ param userAssignedIdentityId string
4
+
5
+ var resourceBaseName = provisionParameters.resourceBaseName
6
+ var botAadAppClientId = provisionParameters['botAadAppClientId'] // Read AAD app client id for Azure Bot Service from parameters
7
+ var botServiceName = contains(provisionParameters, 'botServiceName') ? provisionParameters['botServiceName'] : '${resourceBaseName}' // Try to read name for Azure Bot Service from parameters
8
+ var botServiceSku = contains(provisionParameters, 'botServiceSku') ? provisionParameters['botServiceSku'] : 'F0' // Try to read SKU for Azure Bot Service from parameters
9
+ var botDisplayName = contains(provisionParameters, 'botDisplayName') ? provisionParameters['botDisplayName'] : '${resourceBaseName}' // Try to read display name for Azure Bot Service from parameters
10
+ var serverfarmsName = contains(provisionParameters, 'botServerfarmsName') ? provisionParameters['botServerfarmsName'] : '${resourceBaseName}bot' // Try to read name for App Service Plan from parameters
11
+ var webAppSKU = contains(provisionParameters, 'botWebAppSKU') ? provisionParameters['botWebAppSKU'] : 'B1' // Try to read SKU for Azure Web App from parameters
12
+ var webAppName = contains(provisionParameters, 'botSitesName') ? provisionParameters['botSitesName'] : '${resourceBaseName}bot' // Try to read name for Azure Web App from parameters
13
+ var storageName = contains(provisionParameters, 'botStorageName') ? provisionParameters['botStorageName'] : '${resourceBaseName}bot' // Try to read name for Azure Storage from parameters
14
+ var storageSku = contains(provisionParameters, 'botStorageSku') ? provisionParameters['botStorageSku'] : 'Standard_LRS' // Try to read SKU for Azure Storage from parameters
15
+
16
+ // Register your web service as a bot with the Bot Framework
17
+ resource botService 'Microsoft.BotService/botServices@2021-03-01' = {
18
+ kind: 'azurebot'
19
+ location: 'global'
20
+ name: botServiceName
21
+ properties: {
22
+ displayName: botDisplayName
23
+ endpoint: uri('https://${functionApp.properties.defaultHostName}', '/api/messages')
24
+ msaAppId: botAadAppClientId
25
+ }
26
+ sku: {
27
+ 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".
28
+ }
29
+ }
30
+
31
+ // Connect the bot service to Microsoft Teams
32
+ resource botServiceMsTeamsChannel 'Microsoft.BotService/botServices/channels@2021-03-01' = {
33
+ parent: botService
34
+ location: 'global'
35
+ name: 'MsTeamsChannel'
36
+ properties: {
37
+ channelName: 'MsTeamsChannel'
38
+ }
39
+ }
40
+
41
+ // Compute resources for your Web App
42
+ resource serverfarm 'Microsoft.Web/serverfarms@2021-02-01' = {
43
+ kind: 'functionapp'
44
+ location: resourceGroup().location
45
+ name: serverfarmsName
46
+ sku: {
47
+ name: webAppSKU
48
+ }
49
+ }
50
+
51
+ // Web App that hosts your bot
52
+ resource functionApp 'Microsoft.Web/sites@2021-02-01' = {
53
+ kind: 'functionapp'
54
+ location: resourceGroup().location
55
+ name: webAppName
56
+ properties: {
57
+ serverFarmId: serverfarm.id
58
+ keyVaultReferenceIdentity: userAssignedIdentityId // Use given user assigned identity to access Key Vault
59
+ httpsOnly: true
60
+ siteConfig: {
61
+ alwaysOn: true
62
+ appSettings: [
63
+ {
64
+ name: 'AzureWebJobsDashboard'
65
+ value: 'DefaultEndpointsProtocol=https;AccountName=${storage.name};AccountKey=${listKeys(storage.id, storage.apiVersion).keys[0].value};EndpointSuffix=${environment().suffixes.storage}' // Azure Functions internal setting
66
+ }
67
+ {
68
+ name: 'AzureWebJobsStorage'
69
+ value: 'DefaultEndpointsProtocol=https;AccountName=${storage.name};AccountKey=${listKeys(storage.id, storage.apiVersion).keys[0].value};EndpointSuffix=${environment().suffixes.storage}' // Azure Functions internal setting
70
+ }
71
+ {
72
+ name: 'FUNCTIONS_EXTENSION_VERSION'
73
+ value: '~3' // Use Azure Functions runtime v3
74
+ }
75
+ {
76
+ name: 'FUNCTIONS_WORKER_RUNTIME'
77
+ value: 'node' // Set runtime to NodeJS
78
+ }
79
+ {
80
+ name: 'WEBSITE_CONTENTAZUREFILECONNECTIONSTRING'
81
+ value: 'DefaultEndpointsProtocol=https;AccountName=${storage.name};AccountKey=${listKeys(storage.id, storage.apiVersion).keys[0].value};EndpointSuffix=${environment().suffixes.storage}' // Azure Functions internal setting
82
+ }
83
+ {
84
+ name: 'WEBSITE_RUN_FROM_PACKAGE'
85
+ value: '1' // Run Azure Functions from a package file
86
+ }
87
+ {
88
+ name: 'WEBSITE_NODE_DEFAULT_VERSION'
89
+ value: '~14' // Set NodeJS version to 14.x
90
+ }
91
+ {
92
+ name: 'RUNNING_ON_AZURE'
93
+ value: '1'
94
+ }
95
+ {
96
+ name: 'SCM_ZIPDEPLOY_DONOT_PRESERVE_FILETIME'
97
+ value: '1' // Zipdeploy files will always be updated. Detail: https://aka.ms/teamsfx-zipdeploy-donot-preserve-filetime
98
+ }
99
+ ]
100
+ ftpsState: 'FtpsOnly'
101
+ }
102
+ }
103
+ identity: {
104
+ type: 'UserAssigned'
105
+ userAssignedIdentities: {
106
+ '${userAssignedIdentityId}': {} // The identity is used to access other Azure resources
107
+ }
108
+ }
109
+ }
110
+
111
+ // Azure Storage is required when creating Azure Functions instance
112
+ resource storage 'Microsoft.Storage/storageAccounts@2021-06-01' = {
113
+ name: storageName
114
+ kind: 'StorageV2'
115
+ location: resourceGroup().location
116
+ sku: {
117
+ name: storageSku // You can follow https://aka.ms/teamsfx-bicep-add-param-tutorial to add functionStorageSku property to provisionParameters to override the default value "Standard_LRS".
118
+ }
119
+ }
120
+
121
+ output botWebAppSKU string = webAppSKU
122
+ output botWebAppName string = webAppName
123
+ output botDomain string = functionApp.properties.defaultHostName
124
+ output appServicePlanName string = serverfarmsName
125
+ output botServiceName string = botServiceName
126
+ output botWebAppResourceId string = functionApp.id
127
+ output botWebAppEndpoint string = 'https://${functionApp.properties.defaultHostName}'
@@ -27,6 +27,7 @@ resource functionApp 'Microsoft.Web/sites@2021-02-01' = {
27
27
  properties: {
28
28
  serverFarmId: serverfarms.id
29
29
  keyVaultReferenceIdentity: userAssignedIdentityId // Use given user assigned identity to access Key Vault
30
+ httpsOnly: true
30
31
  siteConfig: {
31
32
  appSettings: [
32
33
  {
@@ -58,6 +59,7 @@ resource functionApp 'Microsoft.Web/sites@2021-02-01' = {
58
59
  value: '~14' // Set NodeJS version to 14.x
59
60
  }
60
61
  ]
62
+ ftpsState: 'FtpsOnly'
61
63
  }
62
64
  }
63
65
  identity: {
@@ -25,6 +25,10 @@ resource webApp 'Microsoft.Web/sites@2021-02-01' = {
25
25
  properties: {
26
26
  serverFarmId: serverFarms.id
27
27
  keyVaultReferenceIdentity: userAssignedIdentityId // Use given user assigned identity to access Key Vault
28
+ httpsOnly: true
29
+ siteConfig:{
30
+ ftpsState: 'FtpsOnly'
31
+ }
28
32
  }
29
33
  identity: {
30
34
  type: 'UserAssigned'
@@ -6,7 +6,7 @@ The SharePoint Framework (SPFx) is a page and web part model that provides full
6
6
 
7
7
  ## Used SharePoint Framework Version
8
8
 
9
- ![version](https://img.shields.io/badge/version-1.12.1-green.svg)
9
+ ![version](https://img.shields.io/badge/version-1.14.0-green.svg)
10
10
 
11
11
  ## Applies to
12
12
 
@@ -15,7 +15,7 @@ The SharePoint Framework (SPFx) is a page and web part model that provides full
15
15
 
16
16
  ## Prerequisites
17
17
 
18
- > - Node.js v10/12/14
18
+ > - Node.js v12/14
19
19
  > - An M365 account. Get your own free Microsoft 365 tenant from [M365 developer program](https://developer.microsoft.com/en-us/microsoft-365/dev-program)
20
20
 
21
21
  ## Solution
@@ -13,6 +13,7 @@ resource sqlServer 'Microsoft.Sql/servers@2021-05-01-preview' = {
13
13
  location: resourceGroup().location
14
14
  name: sqlServerName
15
15
  properties: {
16
+ minimalTlsVersion:'1.2'
16
17
  administratorLogin: empty(administratorLogin) ? null : administratorLogin
17
18
  administratorLoginPassword: administratorLoginPassword
18
19
  }
@@ -23,6 +23,7 @@ resource webApp 'Microsoft.Web/sites@2021-02-01' = {
23
23
  properties: {
24
24
  serverFarmId: serverFarms.id
25
25
  keyVaultReferenceIdentity: userAssignedIdentityId
26
+ httpsOnly: true
26
27
  siteConfig: {
27
28
  appSettings: [
28
29
  {
@@ -30,6 +31,7 @@ resource webApp 'Microsoft.Web/sites@2021-02-01' = {
30
31
  value: '1'
31
32
  }
32
33
  ]
34
+ ftpsState: 'FtpsOnly'
33
35
  }
34
36
  }
35
37
  identity: {