@microsoft/teamsfx-core 2.0.4-alpha.e83c26af7.0 → 2.0.4-alpha.ea55e6d34.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 (603) hide show
  1. package/build/common/constants.d.ts +1 -0
  2. package/build/common/constants.d.ts.map +1 -1
  3. package/build/common/constants.js +1 -0
  4. package/build/common/constants.js.map +1 -1
  5. package/build/common/deps-checker/checkerFactory.d.ts +1 -2
  6. package/build/common/deps-checker/checkerFactory.d.ts.map +1 -1
  7. package/build/common/deps-checker/checkerFactory.js +2 -2
  8. package/build/common/deps-checker/checkerFactory.js.map +1 -1
  9. package/build/common/deps-checker/depsLogger.d.ts +14 -14
  10. package/build/common/deps-checker/depsLogger.d.ts.map +1 -1
  11. package/build/common/deps-checker/depsLogger.js +7 -21
  12. package/build/common/deps-checker/depsLogger.js.map +1 -1
  13. package/build/common/deps-checker/internal/dotnetChecker.d.ts.map +1 -1
  14. package/build/common/deps-checker/internal/dotnetChecker.js +42 -37
  15. package/build/common/deps-checker/internal/dotnetChecker.js.map +1 -1
  16. package/build/common/deps-checker/internal/funcToolChecker.d.ts.map +1 -1
  17. package/build/common/deps-checker/internal/funcToolChecker.js +2 -2
  18. package/build/common/deps-checker/internal/funcToolChecker.js.map +1 -1
  19. package/build/common/deps-checker/internal/nodeChecker.d.ts.map +1 -1
  20. package/build/common/deps-checker/internal/nodeChecker.js +8 -8
  21. package/build/common/deps-checker/internal/nodeChecker.js.map +1 -1
  22. package/build/common/deps-checker/internal/vxTestAppChecker.js +1 -1
  23. package/build/common/deps-checker/internal/vxTestAppChecker.js.map +1 -1
  24. package/build/common/deps-checker/util/cpUtils.d.ts +1 -1
  25. package/build/common/deps-checker/util/cpUtils.d.ts.map +1 -1
  26. package/build/common/deps-checker/util/cpUtils.js +4 -4
  27. package/build/common/deps-checker/util/cpUtils.js.map +1 -1
  28. package/build/common/deps-checker/util/progressIndicator.js +2 -2
  29. package/build/common/deps-checker/util/progressIndicator.js.map +1 -1
  30. package/build/common/featureFlags.d.ts +1 -0
  31. package/build/common/featureFlags.d.ts.map +1 -1
  32. package/build/common/featureFlags.js +5 -1
  33. package/build/common/featureFlags.js.map +1 -1
  34. package/build/common/local/localCertificateManager.d.ts.map +1 -1
  35. package/build/common/local/localCertificateManager.js +4 -1
  36. package/build/common/local/localCertificateManager.js.map +1 -1
  37. package/build/common/local/packageJsonHelper.d.ts.map +1 -1
  38. package/build/common/local/packageJsonHelper.js +1 -0
  39. package/build/common/local/packageJsonHelper.js.map +1 -1
  40. package/build/common/local/portChecker.js.map +1 -1
  41. package/build/common/m365/launchHelper.d.ts +2 -2
  42. package/build/common/m365/launchHelper.d.ts.map +1 -1
  43. package/build/common/m365/launchHelper.js +24 -6
  44. package/build/common/m365/launchHelper.js.map +1 -1
  45. package/build/common/m365/packageService.d.ts.map +1 -1
  46. package/build/common/m365/packageService.js +66 -19
  47. package/build/common/m365/packageService.js.map +1 -1
  48. package/build/common/projectSettingsHelper.d.ts.map +1 -1
  49. package/build/common/projectSettingsHelper.js +1 -0
  50. package/build/common/projectSettingsHelper.js.map +1 -1
  51. package/build/common/samples.d.ts +13 -5
  52. package/build/common/samples.d.ts.map +1 -1
  53. package/build/common/samples.js +58 -38
  54. package/build/common/samples.js.map +1 -1
  55. package/build/common/spec-parser/adaptiveCardGenerator.d.ts +5 -0
  56. package/build/common/spec-parser/adaptiveCardGenerator.d.ts.map +1 -0
  57. package/build/common/spec-parser/adaptiveCardGenerator.js +120 -0
  58. package/build/common/spec-parser/adaptiveCardGenerator.js.map +1 -0
  59. package/build/common/spec-parser/constants.d.ts +21 -7
  60. package/build/common/spec-parser/constants.d.ts.map +1 -1
  61. package/build/common/spec-parser/constants.js +45 -7
  62. package/build/common/spec-parser/constants.js.map +1 -1
  63. package/build/common/spec-parser/interfaces.d.ts +83 -13
  64. package/build/common/spec-parser/interfaces.d.ts.map +1 -1
  65. package/build/common/spec-parser/interfaces.js +23 -13
  66. package/build/common/spec-parser/interfaces.js.map +1 -1
  67. package/build/common/spec-parser/manifestUpdater.d.ts +6 -0
  68. package/build/common/spec-parser/manifestUpdater.d.ts.map +1 -0
  69. package/build/common/spec-parser/manifestUpdater.js +133 -0
  70. package/build/common/spec-parser/manifestUpdater.js.map +1 -0
  71. package/build/common/spec-parser/specFilter.d.ts +3 -0
  72. package/build/common/spec-parser/specFilter.d.ts.map +1 -0
  73. package/build/common/spec-parser/specFilter.js +40 -0
  74. package/build/common/spec-parser/specFilter.js.map +1 -0
  75. package/build/common/spec-parser/specParser.d.ts +14 -5
  76. package/build/common/spec-parser/specParser.d.ts.map +1 -1
  77. package/build/common/spec-parser/specParser.js +181 -94
  78. package/build/common/spec-parser/specParser.js.map +1 -1
  79. package/build/common/spec-parser/utils.d.ts +29 -0
  80. package/build/common/spec-parser/utils.d.ts.map +1 -0
  81. package/build/common/spec-parser/utils.js +309 -0
  82. package/build/common/spec-parser/utils.js.map +1 -0
  83. package/build/common/telemetry.d.ts +7 -5
  84. package/build/common/telemetry.d.ts.map +1 -1
  85. package/build/common/telemetry.js +41 -15
  86. package/build/common/telemetry.js.map +1 -1
  87. package/build/common/tools.d.ts.map +1 -1
  88. package/build/common/tools.js +7 -2
  89. package/build/common/tools.js.map +1 -1
  90. package/build/common/utils.d.ts +1 -0
  91. package/build/common/utils.d.ts.map +1 -1
  92. package/build/common/utils.js +5 -1
  93. package/build/common/utils.js.map +1 -1
  94. package/build/component/configManager/interface.d.ts +5 -1
  95. package/build/component/configManager/interface.d.ts.map +1 -1
  96. package/build/component/configManager/interface.js.map +1 -1
  97. package/build/component/configManager/lifecycle.d.ts +1 -3
  98. package/build/component/configManager/lifecycle.d.ts.map +1 -1
  99. package/build/component/configManager/lifecycle.js +25 -52
  100. package/build/component/configManager/lifecycle.js.map +1 -1
  101. package/build/component/configManager/parser.d.ts.map +1 -1
  102. package/build/component/configManager/parser.js +12 -6
  103. package/build/component/configManager/parser.js.map +1 -1
  104. package/build/component/configManager/validator.d.ts +0 -3
  105. package/build/component/configManager/validator.d.ts.map +1 -1
  106. package/build/component/configManager/validator.js +2 -12
  107. package/build/component/configManager/validator.js.map +1 -1
  108. package/build/component/constants.d.ts +11 -0
  109. package/build/component/constants.d.ts.map +1 -1
  110. package/build/component/constants.js +11 -0
  111. package/build/component/constants.js.map +1 -1
  112. package/build/component/coordinator/index.d.ts +12 -8
  113. package/build/component/coordinator/index.d.ts.map +1 -1
  114. package/build/component/coordinator/index.js +80 -67
  115. package/build/component/coordinator/index.js.map +1 -1
  116. package/build/component/coordinator/summary.d.ts.map +1 -1
  117. package/build/component/coordinator/summary.js +2 -1
  118. package/build/component/coordinator/summary.js.map +1 -1
  119. package/build/component/developerPortalScaffoldUtils.d.ts +1 -1
  120. package/build/component/developerPortalScaffoldUtils.d.ts.map +1 -1
  121. package/build/component/developerPortalScaffoldUtils.js +7 -7
  122. package/build/component/developerPortalScaffoldUtils.js.map +1 -1
  123. package/build/component/driver/aad/create.d.ts +1 -2
  124. package/build/component/driver/aad/create.d.ts.map +1 -1
  125. package/build/component/driver/aad/create.js +4 -11
  126. package/build/component/driver/aad/create.js.map +1 -1
  127. package/build/component/driver/aad/error/aadManifestError.d.ts +3 -0
  128. package/build/component/driver/aad/error/aadManifestError.d.ts.map +1 -1
  129. package/build/component/driver/aad/error/aadManifestError.js +13 -1
  130. package/build/component/driver/aad/error/aadManifestError.js.map +1 -1
  131. package/build/component/driver/aad/update.d.ts +1 -2
  132. package/build/component/driver/aad/update.d.ts.map +1 -1
  133. package/build/component/driver/aad/update.js +4 -11
  134. package/build/component/driver/aad/update.js.map +1 -1
  135. package/build/component/driver/aad/utility/aadAppClient.d.ts +1 -1
  136. package/build/component/driver/aad/utility/aadAppClient.d.ts.map +1 -1
  137. package/build/component/driver/aad/utility/aadAppClient.js +58 -13
  138. package/build/component/driver/aad/utility/aadAppClient.js.map +1 -1
  139. package/build/component/driver/aad/utility/constants.d.ts +3 -0
  140. package/build/component/driver/aad/utility/constants.d.ts.map +1 -1
  141. package/build/component/driver/aad/utility/constants.js +4 -1
  142. package/build/component/driver/aad/utility/constants.js.map +1 -1
  143. package/build/component/driver/add/addWebPart.d.ts.map +1 -1
  144. package/build/component/driver/add/addWebPart.js +10 -1
  145. package/build/component/driver/add/addWebPart.js.map +1 -1
  146. package/build/component/driver/arm/deploy.d.ts +1 -3
  147. package/build/component/driver/arm/deploy.d.ts.map +1 -1
  148. package/build/component/driver/arm/deploy.js +1 -14
  149. package/build/component/driver/arm/deploy.js.map +1 -1
  150. package/build/component/driver/arm/deployImpl.d.ts +2 -1
  151. package/build/component/driver/arm/deployImpl.d.ts.map +1 -1
  152. package/build/component/driver/arm/deployImpl.js +15 -0
  153. package/build/component/driver/arm/deployImpl.js.map +1 -1
  154. package/build/component/driver/arm/util/bicepChecker.js +7 -6
  155. package/build/component/driver/arm/util/bicepChecker.js.map +1 -1
  156. package/build/component/driver/arm/util/handleError.js.map +1 -1
  157. package/build/component/driver/arm/validator.d.ts.map +1 -1
  158. package/build/component/driver/arm/validator.js +3 -3
  159. package/build/component/driver/arm/validator.js.map +1 -1
  160. package/build/component/driver/botAadApp/create.d.ts +2 -1
  161. package/build/component/driver/botAadApp/create.d.ts.map +1 -1
  162. package/build/component/driver/botAadApp/create.js +7 -10
  163. package/build/component/driver/botAadApp/create.js.map +1 -1
  164. package/build/component/driver/botFramework/createOrUpdateBot.d.ts +1 -0
  165. package/build/component/driver/botFramework/createOrUpdateBot.d.ts.map +1 -1
  166. package/build/component/driver/botFramework/createOrUpdateBot.js +8 -12
  167. package/build/component/driver/botFramework/createOrUpdateBot.js.map +1 -1
  168. package/build/component/driver/deploy/azure/azureAppServiceDeployDriver.d.ts +0 -2
  169. package/build/component/driver/deploy/azure/azureAppServiceDeployDriver.d.ts.map +1 -1
  170. package/build/component/driver/deploy/azure/azureAppServiceDeployDriver.js +0 -10
  171. package/build/component/driver/deploy/azure/azureAppServiceDeployDriver.js.map +1 -1
  172. package/build/component/driver/deploy/azure/azureFunctionDeployDriver.d.ts +0 -2
  173. package/build/component/driver/deploy/azure/azureFunctionDeployDriver.d.ts.map +1 -1
  174. package/build/component/driver/deploy/azure/azureFunctionDeployDriver.js +0 -10
  175. package/build/component/driver/deploy/azure/azureFunctionDeployDriver.js.map +1 -1
  176. package/build/component/driver/deploy/azure/azureStorageDeployDriver.d.ts +0 -2
  177. package/build/component/driver/deploy/azure/azureStorageDeployDriver.d.ts.map +1 -1
  178. package/build/component/driver/deploy/azure/azureStorageDeployDriver.js +17 -19
  179. package/build/component/driver/deploy/azure/azureStorageDeployDriver.js.map +1 -1
  180. package/build/component/driver/deploy/azure/azureStorageStaticWebsiteConfigDriver.d.ts.map +1 -1
  181. package/build/component/driver/deploy/azure/azureStorageStaticWebsiteConfigDriver.js +11 -4
  182. package/build/component/driver/deploy/azure/azureStorageStaticWebsiteConfigDriver.js.map +1 -1
  183. package/build/component/driver/deploy/azure/impl/AzureZipDeployImpl.d.ts.map +1 -1
  184. package/build/component/driver/deploy/azure/impl/AzureZipDeployImpl.js +29 -16
  185. package/build/component/driver/deploy/azure/impl/AzureZipDeployImpl.js.map +1 -1
  186. package/build/component/driver/deploy/azure/impl/azureDeployImpl.d.ts.map +1 -1
  187. package/build/component/driver/deploy/azure/impl/azureDeployImpl.js +18 -15
  188. package/build/component/driver/deploy/azure/impl/azureDeployImpl.js.map +1 -1
  189. package/build/component/driver/deploy/azure/impl/baseDeployImpl.d.ts.map +1 -1
  190. package/build/component/driver/deploy/azure/impl/baseDeployImpl.js +4 -4
  191. package/build/component/driver/deploy/azure/impl/baseDeployImpl.js.map +1 -1
  192. package/build/component/driver/deploy/spfx/deployDriver.d.ts +1 -0
  193. package/build/component/driver/deploy/spfx/deployDriver.d.ts.map +1 -1
  194. package/build/component/driver/deploy/spfx/deployDriver.js +27 -5
  195. package/build/component/driver/deploy/spfx/deployDriver.js.map +1 -1
  196. package/build/component/driver/devTool/installDriver.d.ts +1 -0
  197. package/build/component/driver/devTool/installDriver.d.ts.map +1 -1
  198. package/build/component/driver/devTool/installDriver.js +33 -11
  199. package/build/component/driver/devTool/installDriver.js.map +1 -1
  200. package/build/component/driver/file/createOrUpdateEnvironmentFile.d.ts +1 -0
  201. package/build/component/driver/file/createOrUpdateEnvironmentFile.d.ts.map +1 -1
  202. package/build/component/driver/file/createOrUpdateEnvironmentFile.js +12 -18
  203. package/build/component/driver/file/createOrUpdateEnvironmentFile.js.map +1 -1
  204. package/build/component/driver/file/createOrUpdateJsonFile.d.ts +1 -0
  205. package/build/component/driver/file/createOrUpdateJsonFile.d.ts.map +1 -1
  206. package/build/component/driver/file/createOrUpdateJsonFile.js +5 -11
  207. package/build/component/driver/file/createOrUpdateJsonFile.js.map +1 -1
  208. package/build/component/driver/interface/stepDriver.d.ts +2 -7
  209. package/build/component/driver/interface/stepDriver.d.ts.map +1 -1
  210. package/build/component/driver/m365/acquire.d.ts +1 -0
  211. package/build/component/driver/m365/acquire.d.ts.map +1 -1
  212. package/build/component/driver/m365/acquire.js +6 -12
  213. package/build/component/driver/m365/acquire.js.map +1 -1
  214. package/build/component/driver/script/baseBuildDriver.d.ts.map +1 -1
  215. package/build/component/driver/script/baseBuildDriver.js +1 -0
  216. package/build/component/driver/script/baseBuildDriver.js.map +1 -1
  217. package/build/component/driver/script/baseBuildStepDriver.d.ts +0 -2
  218. package/build/component/driver/script/baseBuildStepDriver.d.ts.map +1 -1
  219. package/build/component/driver/script/baseBuildStepDriver.js +0 -4
  220. package/build/component/driver/script/baseBuildStepDriver.js.map +1 -1
  221. package/build/component/driver/script/dotnetBuildDriver.d.ts +0 -2
  222. package/build/component/driver/script/dotnetBuildDriver.d.ts.map +1 -1
  223. package/build/component/driver/script/dotnetBuildDriver.js +0 -9
  224. package/build/component/driver/script/dotnetBuildDriver.js.map +1 -1
  225. package/build/component/driver/script/npmBuildDriver.d.ts +0 -2
  226. package/build/component/driver/script/npmBuildDriver.d.ts.map +1 -1
  227. package/build/component/driver/script/npmBuildDriver.js +0 -9
  228. package/build/component/driver/script/npmBuildDriver.js.map +1 -1
  229. package/build/component/driver/script/npxBuildDriver.d.ts +0 -2
  230. package/build/component/driver/script/npxBuildDriver.d.ts.map +1 -1
  231. package/build/component/driver/script/npxBuildDriver.js +0 -9
  232. package/build/component/driver/script/npxBuildDriver.js.map +1 -1
  233. package/build/component/driver/script/scriptDriver.d.ts +10 -1
  234. package/build/component/driver/script/scriptDriver.d.ts.map +1 -1
  235. package/build/component/driver/script/scriptDriver.js +31 -30
  236. package/build/component/driver/script/scriptDriver.js.map +1 -1
  237. package/build/component/driver/teamsApp/appStudio.d.ts.map +1 -1
  238. package/build/component/driver/teamsApp/appStudio.js +11 -11
  239. package/build/component/driver/teamsApp/appStudio.js.map +1 -1
  240. package/build/component/driver/teamsApp/clients/appStudioClient.d.ts +5 -5
  241. package/build/component/driver/teamsApp/clients/appStudioClient.d.ts.map +1 -1
  242. package/build/component/driver/teamsApp/clients/appStudioClient.js +31 -11
  243. package/build/component/driver/teamsApp/clients/appStudioClient.js.map +1 -1
  244. package/build/component/driver/teamsApp/clients/authSvcClient.d.ts.map +1 -1
  245. package/build/component/driver/teamsApp/clients/authSvcClient.js +2 -0
  246. package/build/component/driver/teamsApp/clients/authSvcClient.js.map +1 -1
  247. package/build/component/driver/teamsApp/configure.d.ts +1 -1
  248. package/build/component/driver/teamsApp/configure.d.ts.map +1 -1
  249. package/build/component/driver/teamsApp/configure.js +5 -23
  250. package/build/component/driver/teamsApp/configure.js.map +1 -1
  251. package/build/component/driver/teamsApp/constants.d.ts +0 -1
  252. package/build/component/driver/teamsApp/constants.d.ts.map +1 -1
  253. package/build/component/driver/teamsApp/constants.js +1 -2
  254. package/build/component/driver/teamsApp/constants.js.map +1 -1
  255. package/build/component/driver/teamsApp/copyAppPackageToSPFx.d.ts +1 -2
  256. package/build/component/driver/teamsApp/copyAppPackageToSPFx.d.ts.map +1 -1
  257. package/build/component/driver/teamsApp/copyAppPackageToSPFx.js +4 -11
  258. package/build/component/driver/teamsApp/copyAppPackageToSPFx.js.map +1 -1
  259. package/build/component/driver/teamsApp/create.d.ts +1 -1
  260. package/build/component/driver/teamsApp/create.d.ts.map +1 -1
  261. package/build/component/driver/teamsApp/create.js +6 -11
  262. package/build/component/driver/teamsApp/create.js.map +1 -1
  263. package/build/component/driver/teamsApp/createAppPackage.d.ts +4 -3
  264. package/build/component/driver/teamsApp/createAppPackage.d.ts.map +1 -1
  265. package/build/component/driver/teamsApp/createAppPackage.js +68 -32
  266. package/build/component/driver/teamsApp/createAppPackage.js.map +1 -1
  267. package/build/component/driver/teamsApp/errors.d.ts.map +1 -1
  268. package/build/component/driver/teamsApp/errors.js +2 -0
  269. package/build/component/driver/teamsApp/errors.js.map +1 -1
  270. package/build/component/driver/teamsApp/interfaces/appdefinitions/messagingExtension.d.ts +2 -0
  271. package/build/component/driver/teamsApp/interfaces/appdefinitions/messagingExtension.d.ts.map +1 -1
  272. package/build/component/driver/teamsApp/interfaces/appdefinitions/messagingExtensionCommand.d.ts +1 -0
  273. package/build/component/driver/teamsApp/interfaces/appdefinitions/messagingExtensionCommand.d.ts.map +1 -1
  274. package/build/component/driver/teamsApp/publishAppPackage.d.ts +1 -1
  275. package/build/component/driver/teamsApp/publishAppPackage.d.ts.map +1 -1
  276. package/build/component/driver/teamsApp/publishAppPackage.js +4 -12
  277. package/build/component/driver/teamsApp/publishAppPackage.js.map +1 -1
  278. package/build/component/driver/teamsApp/utils/ManifestUtils.d.ts +8 -2
  279. package/build/component/driver/teamsApp/utils/ManifestUtils.d.ts.map +1 -1
  280. package/build/component/driver/teamsApp/utils/ManifestUtils.js +24 -4
  281. package/build/component/driver/teamsApp/utils/ManifestUtils.js.map +1 -1
  282. package/build/component/driver/teamsApp/utils/telemetry.d.ts +1 -0
  283. package/build/component/driver/teamsApp/utils/telemetry.d.ts.map +1 -1
  284. package/build/component/driver/teamsApp/utils/telemetry.js +1 -0
  285. package/build/component/driver/teamsApp/utils/telemetry.js.map +1 -1
  286. package/build/component/driver/teamsApp/utils/utils.d.ts +2 -3
  287. package/build/component/driver/teamsApp/utils/utils.d.ts.map +1 -1
  288. package/build/component/driver/teamsApp/utils/utils.js +21 -19
  289. package/build/component/driver/teamsApp/utils/utils.js.map +1 -1
  290. package/build/component/driver/teamsApp/validate.d.ts +1 -1
  291. package/build/component/driver/teamsApp/validate.d.ts.map +1 -1
  292. package/build/component/driver/teamsApp/validate.js +17 -12
  293. package/build/component/driver/teamsApp/validate.js.map +1 -1
  294. package/build/component/driver/teamsApp/validateAppPackage.d.ts +1 -1
  295. package/build/component/driver/teamsApp/validateAppPackage.d.ts.map +1 -1
  296. package/build/component/driver/teamsApp/validateAppPackage.js +22 -18
  297. package/build/component/driver/teamsApp/validateAppPackage.js.map +1 -1
  298. package/build/component/error/componentError.d.ts +2 -1
  299. package/build/component/error/componentError.d.ts.map +1 -1
  300. package/build/component/error/componentError.js +8 -4
  301. package/build/component/error/componentError.js.map +1 -1
  302. package/build/component/feature/collaboration.d.ts.map +1 -1
  303. package/build/component/feature/collaboration.js +55 -26
  304. package/build/component/feature/collaboration.js.map +1 -1
  305. package/build/component/feature/createAuthFiles.js.map +1 -1
  306. package/build/component/generator/copilotPlugin/generator.d.ts +7 -2
  307. package/build/component/generator/copilotPlugin/generator.d.ts.map +1 -1
  308. package/build/component/generator/copilotPlugin/generator.js +133 -25
  309. package/build/component/generator/copilotPlugin/generator.js.map +1 -1
  310. package/build/component/generator/copilotPlugin/helper.d.ts +12 -12
  311. package/build/component/generator/copilotPlugin/helper.d.ts.map +1 -1
  312. package/build/component/generator/copilotPlugin/helper.js +214 -28
  313. package/build/component/generator/copilotPlugin/helper.js.map +1 -1
  314. package/build/component/generator/error.d.ts +7 -1
  315. package/build/component/generator/error.d.ts.map +1 -1
  316. package/build/component/generator/error.js +15 -3
  317. package/build/component/generator/error.js.map +1 -1
  318. package/build/component/generator/generator.d.ts.map +1 -1
  319. package/build/component/generator/generator.js +31 -22
  320. package/build/component/generator/generator.js.map +1 -1
  321. package/build/component/generator/generatorAction.d.ts +2 -1
  322. package/build/component/generator/generatorAction.d.ts.map +1 -1
  323. package/build/component/generator/generatorAction.js +12 -5
  324. package/build/component/generator/generatorAction.js.map +1 -1
  325. package/build/component/generator/officeAddin/generator.d.ts.map +1 -1
  326. package/build/component/generator/officeAddin/generator.js +9 -1
  327. package/build/component/generator/officeAddin/generator.js.map +1 -1
  328. package/build/component/generator/officeAddin/helperMethods.d.ts.map +1 -1
  329. package/build/component/generator/officeAddin/helperMethods.js +9 -5
  330. package/build/component/generator/officeAddin/helperMethods.js.map +1 -1
  331. package/build/component/generator/spfx/depsChecker/generatorChecker.d.ts +1 -1
  332. package/build/component/generator/spfx/depsChecker/generatorChecker.d.ts.map +1 -1
  333. package/build/component/generator/spfx/depsChecker/generatorChecker.js +12 -12
  334. package/build/component/generator/spfx/depsChecker/generatorChecker.js.map +1 -1
  335. package/build/component/generator/spfx/depsChecker/yoChecker.d.ts +1 -1
  336. package/build/component/generator/spfx/depsChecker/yoChecker.d.ts.map +1 -1
  337. package/build/component/generator/spfx/depsChecker/yoChecker.js +10 -10
  338. package/build/component/generator/spfx/depsChecker/yoChecker.js.map +1 -1
  339. package/build/component/generator/spfx/spfxGenerator.d.ts.map +1 -1
  340. package/build/component/generator/spfx/spfxGenerator.js +16 -14
  341. package/build/component/generator/spfx/spfxGenerator.js.map +1 -1
  342. package/build/component/generator/spfx/utils/constants.d.ts +1 -0
  343. package/build/component/generator/spfx/utils/constants.d.ts.map +1 -1
  344. package/build/component/generator/spfx/utils/constants.js +1 -0
  345. package/build/component/generator/spfx/utils/constants.js.map +1 -1
  346. package/build/component/generator/spfx/utils/utils.js +3 -3
  347. package/build/component/generator/spfx/utils/utils.js.map +1 -1
  348. package/build/component/generator/utils.d.ts +12 -4
  349. package/build/component/generator/utils.d.ts.map +1 -1
  350. package/build/component/generator/utils.js +17 -16
  351. package/build/component/generator/utils.js.map +1 -1
  352. package/build/component/messages.d.ts +2 -3
  353. package/build/component/messages.d.ts.map +1 -1
  354. package/build/component/messages.js +3 -4
  355. package/build/component/messages.js.map +1 -1
  356. package/build/component/middleware/actionExecutionMW.d.ts +2 -2
  357. package/build/component/middleware/actionExecutionMW.d.ts.map +1 -1
  358. package/build/component/middleware/envMW.js +1 -1
  359. package/build/component/middleware/envMW.js.map +1 -1
  360. package/build/component/middleware/questionMW.d.ts +2 -2
  361. package/build/component/middleware/questionMW.d.ts.map +1 -1
  362. package/build/component/middleware/questionMW.js +7 -11
  363. package/build/component/middleware/questionMW.js.map +1 -1
  364. package/build/component/migrate.js.map +1 -1
  365. package/build/component/provisionUtils.d.ts +3 -3
  366. package/build/component/provisionUtils.d.ts.map +1 -1
  367. package/build/component/provisionUtils.js +3 -3
  368. package/build/component/provisionUtils.js.map +1 -1
  369. package/build/component/resource/botService/appStudio/appStudioClient.d.ts.map +1 -1
  370. package/build/component/resource/botService/appStudio/appStudioClient.js +24 -2
  371. package/build/component/resource/botService/appStudio/appStudioClient.js.map +1 -1
  372. package/build/component/resource/botService/botRegistration/botFrameworkRegistration.d.ts +2 -2
  373. package/build/component/resource/botService/botRegistration/botFrameworkRegistration.d.ts.map +1 -1
  374. package/build/component/resource/botService/botRegistration/botFrameworkRegistration.js +6 -1
  375. package/build/component/resource/botService/botRegistration/botFrameworkRegistration.js.map +1 -1
  376. package/build/component/telemetry.d.ts.map +1 -1
  377. package/build/component/telemetry.js +3 -6
  378. package/build/component/telemetry.js.map +1 -1
  379. package/build/component/utils/ResourceGroupHelper.d.ts +2 -2
  380. package/build/component/utils/ResourceGroupHelper.d.ts.map +1 -1
  381. package/build/component/utils/ResourceGroupHelper.js +1 -4
  382. package/build/component/utils/ResourceGroupHelper.js.map +1 -1
  383. package/build/component/utils/azureResourceOperation.js +2 -2
  384. package/build/component/utils/azureResourceOperation.js.map +1 -1
  385. package/build/component/utils/charsetUtils.js +3 -3
  386. package/build/component/utils/charsetUtils.js.map +1 -1
  387. package/build/component/utils/common.d.ts +1 -1
  388. package/build/component/utils/common.d.ts.map +1 -1
  389. package/build/component/utils/common.js +4 -5
  390. package/build/component/utils/common.js.map +1 -1
  391. package/build/component/utils/depsChecker/cpUtils.d.ts.map +1 -1
  392. package/build/component/utils/depsChecker/cpUtils.js +8 -4
  393. package/build/component/utils/depsChecker/cpUtils.js.map +1 -1
  394. package/build/component/utils/envUtil.js +2 -2
  395. package/build/component/utils/envUtil.js.map +1 -1
  396. package/build/component/utils/metadataUtil.d.ts +3 -0
  397. package/build/component/utils/metadataUtil.d.ts.map +1 -1
  398. package/build/component/utils/metadataUtil.js +16 -4
  399. package/build/component/utils/metadataUtil.js.map +1 -1
  400. package/build/component/utils/teamsFxTelemetryReporter.d.ts.map +1 -1
  401. package/build/component/utils/teamsFxTelemetryReporter.js +3 -6
  402. package/build/component/utils/teamsFxTelemetryReporter.js.map +1 -1
  403. package/build/component/utils.js.map +1 -1
  404. package/build/core/FxCore.d.ts +44 -33
  405. package/build/core/FxCore.d.ts.map +1 -1
  406. package/build/core/FxCore.js +821 -64
  407. package/build/core/FxCore.js.map +1 -1
  408. package/build/core/collaborator.d.ts +1 -1
  409. package/build/core/collaborator.d.ts.map +1 -1
  410. package/build/core/collaborator.js +16 -10
  411. package/build/core/collaborator.js.map +1 -1
  412. package/build/core/error.d.ts +6 -0
  413. package/build/core/error.d.ts.map +1 -1
  414. package/build/core/error.js +23 -1
  415. package/build/core/error.js.map +1 -1
  416. package/build/core/globalVars.d.ts +16 -0
  417. package/build/core/globalVars.d.ts.map +1 -1
  418. package/build/core/globalVars.js +34 -1
  419. package/build/core/globalVars.js.map +1 -1
  420. package/build/core/middleware/concurrentLocker.d.ts.map +1 -1
  421. package/build/core/middleware/concurrentLocker.js +7 -3
  422. package/build/core/middleware/concurrentLocker.js.map +1 -1
  423. package/build/core/middleware/errorHandler.d.ts +2 -0
  424. package/build/core/middleware/errorHandler.d.ts.map +1 -1
  425. package/build/core/middleware/errorHandler.js +16 -25
  426. package/build/core/middleware/errorHandler.js.map +1 -1
  427. package/build/core/middleware/projectMigratorV3.d.ts +7 -1
  428. package/build/core/middleware/projectMigratorV3.d.ts.map +1 -1
  429. package/build/core/middleware/projectMigratorV3.js +35 -34
  430. package/build/core/middleware/projectMigratorV3.js.map +1 -1
  431. package/build/core/middleware/projectVersionChecker.js +8 -8
  432. package/build/core/middleware/projectVersionChecker.js.map +1 -1
  433. package/build/core/middleware/utils/appYmlGenerator.d.ts.map +1 -1
  434. package/build/core/middleware/utils/appYmlGenerator.js +2 -1
  435. package/build/core/middleware/utils/appYmlGenerator.js.map +1 -1
  436. package/build/core/middleware/utils/debug/appLocalYmlGenerator.d.ts.map +1 -1
  437. package/build/core/middleware/utils/debug/appLocalYmlGenerator.js +3 -2
  438. package/build/core/middleware/utils/debug/appLocalYmlGenerator.js.map +1 -1
  439. package/build/core/middleware/utils/debug/debugV3MigrationUtils.js.map +1 -1
  440. package/build/core/middleware/utils/debug/taskMigrator.d.ts.map +1 -1
  441. package/build/core/middleware/utils/debug/taskMigrator.js +33 -15
  442. package/build/core/middleware/utils/debug/taskMigrator.js.map +1 -1
  443. package/build/core/middleware/utils/migrationContext.d.ts +1 -0
  444. package/build/core/middleware/utils/migrationContext.d.ts.map +1 -1
  445. package/build/core/middleware/utils/migrationContext.js.map +1 -1
  446. package/build/core/middleware/utils/v3MigrationUtils.d.ts.map +1 -1
  447. package/build/core/middleware/utils/v3MigrationUtils.js +6 -2
  448. package/build/core/middleware/utils/v3MigrationUtils.js.map +1 -1
  449. package/build/error/common.d.ts +10 -4
  450. package/build/error/common.d.ts.map +1 -1
  451. package/build/error/common.js +132 -24
  452. package/build/error/common.js.map +1 -1
  453. package/build/index.d.ts +4 -1
  454. package/build/index.d.ts.map +1 -1
  455. package/build/index.js +5 -1
  456. package/build/index.js.map +1 -1
  457. package/build/question/constants.d.ts +6 -0
  458. package/build/question/constants.d.ts.map +1 -0
  459. package/build/question/constants.js +18 -0
  460. package/build/question/constants.js.map +1 -0
  461. package/build/question/create.d.ts +19 -21
  462. package/build/question/create.d.ts.map +1 -1
  463. package/build/question/create.js +454 -344
  464. package/build/question/create.js.map +1 -1
  465. package/build/question/generator.d.ts +4 -0
  466. package/build/question/generator.d.ts.map +1 -0
  467. package/build/question/generator.js +365 -0
  468. package/build/question/generator.js.map +1 -0
  469. package/build/question/index.d.ts +19 -30
  470. package/build/question/index.d.ts.map +1 -1
  471. package/build/question/index.js +14 -47
  472. package/build/question/index.js.map +1 -1
  473. package/build/question/inputs/CreateEnvInputs.d.ts +14 -0
  474. package/build/question/inputs/CreateEnvInputs.d.ts.map +1 -0
  475. package/build/question/inputs/CreateEnvInputs.js +5 -0
  476. package/build/question/inputs/CreateEnvInputs.js.map +1 -0
  477. package/build/question/inputs/CreateProjectInputs.d.ts +38 -0
  478. package/build/question/inputs/CreateProjectInputs.d.ts.map +1 -0
  479. package/build/question/inputs/CreateProjectInputs.js +5 -0
  480. package/build/question/inputs/CreateProjectInputs.js.map +1 -0
  481. package/build/question/inputs/CreateSampleProjectInputs.d.ts +12 -0
  482. package/build/question/inputs/CreateSampleProjectInputs.d.ts.map +1 -0
  483. package/build/question/inputs/CreateSampleProjectInputs.js +5 -0
  484. package/build/question/inputs/CreateSampleProjectInputs.js.map +1 -0
  485. package/build/question/inputs/DeployAadManifestInputs.d.ts +14 -0
  486. package/build/question/inputs/DeployAadManifestInputs.d.ts.map +1 -0
  487. package/build/question/inputs/DeployAadManifestInputs.js +5 -0
  488. package/build/question/inputs/DeployAadManifestInputs.js.map +1 -0
  489. package/build/question/inputs/PermissionGrantInputs.d.ts +18 -0
  490. package/build/question/inputs/PermissionGrantInputs.d.ts.map +1 -0
  491. package/build/question/inputs/PermissionGrantInputs.js +5 -0
  492. package/build/question/inputs/PermissionGrantInputs.js.map +1 -0
  493. package/build/question/inputs/PermissionListInputs.d.ts +16 -0
  494. package/build/question/inputs/PermissionListInputs.d.ts.map +1 -0
  495. package/build/question/inputs/PermissionListInputs.js +5 -0
  496. package/build/question/inputs/PermissionListInputs.js.map +1 -0
  497. package/build/question/inputs/PreviewTeamsAppInputs.d.ts +14 -0
  498. package/build/question/inputs/PreviewTeamsAppInputs.d.ts.map +1 -0
  499. package/build/question/inputs/PreviewTeamsAppInputs.js +5 -0
  500. package/build/question/inputs/PreviewTeamsAppInputs.js.map +1 -0
  501. package/build/question/inputs/SPFxAddWebpartInputs.d.ts +18 -0
  502. package/build/question/inputs/SPFxAddWebpartInputs.d.ts.map +1 -0
  503. package/build/question/inputs/SPFxAddWebpartInputs.js +5 -0
  504. package/build/question/inputs/SPFxAddWebpartInputs.js.map +1 -0
  505. package/build/question/inputs/SelectTeamsManifestInputs.d.ts +12 -0
  506. package/build/question/inputs/SelectTeamsManifestInputs.d.ts.map +1 -0
  507. package/build/question/inputs/SelectTeamsManifestInputs.js +5 -0
  508. package/build/question/inputs/SelectTeamsManifestInputs.js.map +1 -0
  509. package/build/question/inputs/ValidateTeamsAppInputs.d.ts +14 -0
  510. package/build/question/inputs/ValidateTeamsAppInputs.d.ts.map +1 -0
  511. package/build/question/inputs/ValidateTeamsAppInputs.js +5 -0
  512. package/build/question/inputs/ValidateTeamsAppInputs.js.map +1 -0
  513. package/build/question/inputs/index.d.ts +11 -0
  514. package/build/question/inputs/index.d.ts.map +1 -0
  515. package/build/question/inputs/index.js +16 -0
  516. package/build/question/inputs/index.js.map +1 -0
  517. package/build/question/options/CreateEnvOptions.d.ts +10 -0
  518. package/build/question/options/CreateEnvOptions.d.ts.map +1 -0
  519. package/build/question/options/CreateEnvOptions.js +24 -0
  520. package/build/question/options/CreateEnvOptions.js.map +1 -0
  521. package/build/question/options/CreateProjectOptions.d.ts +10 -0
  522. package/build/question/options/CreateProjectOptions.d.ts.map +1 -0
  523. package/build/question/options/CreateProjectOptions.js +132 -0
  524. package/build/question/options/CreateProjectOptions.js.map +1 -0
  525. package/build/question/options/CreateSampleProjectOptions.d.ts +10 -0
  526. package/build/question/options/CreateSampleProjectOptions.d.ts.map +1 -0
  527. package/build/question/options/CreateSampleProjectOptions.js +52 -0
  528. package/build/question/options/CreateSampleProjectOptions.js.map +1 -0
  529. package/build/question/options/DeployAadManifestOptions.d.ts +10 -0
  530. package/build/question/options/DeployAadManifestOptions.d.ts.map +1 -0
  531. package/build/question/options/DeployAadManifestOptions.js +21 -0
  532. package/build/question/options/DeployAadManifestOptions.js.map +1 -0
  533. package/build/question/options/PermissionGrantOptions.d.ts +10 -0
  534. package/build/question/options/PermissionGrantOptions.d.ts.map +1 -0
  535. package/build/question/options/PermissionGrantOptions.js +33 -0
  536. package/build/question/options/PermissionGrantOptions.js.map +1 -0
  537. package/build/question/options/PermissionListOptions.d.ts +10 -0
  538. package/build/question/options/PermissionListOptions.d.ts.map +1 -0
  539. package/build/question/options/PermissionListOptions.js +28 -0
  540. package/build/question/options/PermissionListOptions.js.map +1 -0
  541. package/build/question/options/PreviewTeamsAppOptions.d.ts +10 -0
  542. package/build/question/options/PreviewTeamsAppOptions.d.ts.map +1 -0
  543. package/build/question/options/PreviewTeamsAppOptions.js +26 -0
  544. package/build/question/options/PreviewTeamsAppOptions.js.map +1 -0
  545. package/build/question/options/SPFxAddWebpartOptions.d.ts +10 -0
  546. package/build/question/options/SPFxAddWebpartOptions.d.ts.map +1 -0
  547. package/build/question/options/SPFxAddWebpartOptions.js +39 -0
  548. package/build/question/options/SPFxAddWebpartOptions.js.map +1 -0
  549. package/build/question/options/SelectTeamsManifestOptions.d.ts +10 -0
  550. package/build/question/options/SelectTeamsManifestOptions.d.ts.map +1 -0
  551. package/build/question/options/SelectTeamsManifestOptions.js +17 -0
  552. package/build/question/options/SelectTeamsManifestOptions.js.map +1 -0
  553. package/build/question/options/ValidateTeamsAppOptions.d.ts +10 -0
  554. package/build/question/options/ValidateTeamsAppOptions.d.ts.map +1 -0
  555. package/build/question/options/ValidateTeamsAppOptions.js +23 -0
  556. package/build/question/options/ValidateTeamsAppOptions.js.map +1 -0
  557. package/build/question/options/index.d.ts +11 -0
  558. package/build/question/options/index.d.ts.map +1 -0
  559. package/build/question/options/index.js +16 -0
  560. package/build/question/options/index.js.map +1 -0
  561. package/build/question/other.d.ts +12 -1
  562. package/build/question/other.d.ts.map +1 -1
  563. package/build/question/other.js +129 -31
  564. package/build/question/other.js.map +1 -1
  565. package/build/question/questionNames.d.ts +6 -2
  566. package/build/question/questionNames.d.ts.map +1 -1
  567. package/build/question/questionNames.js +8 -3
  568. package/build/question/questionNames.js.map +1 -1
  569. package/build/ui/validationUtils.d.ts +31 -0
  570. package/build/ui/validationUtils.d.ts.map +1 -0
  571. package/build/ui/validationUtils.js +297 -0
  572. package/build/ui/validationUtils.js.map +1 -0
  573. package/build/ui/visitor.d.ts +13 -1
  574. package/build/ui/visitor.d.ts.map +1 -1
  575. package/build/ui/visitor.js +264 -215
  576. package/build/ui/visitor.js.map +1 -1
  577. package/package.json +21 -14
  578. package/resource/package.nls.json +59 -18
  579. package/resource/yaml-schema/v1.2/yaml.schema.json +1474 -0
  580. package/templates/fallback/common.zip +0 -0
  581. package/templates/fallback/csharp.zip +0 -0
  582. package/templates/fallback/js.zip +0 -0
  583. package/templates/fallback/ts.zip +0 -0
  584. package/templates/plugins/resource/aad/auth/V3/Tab/GetUserProfile.razor +1 -2
  585. package/templates/plugins/resource/aad/auth/bot/README.md +281 -263
  586. package/templates/plugins/resource/aad/auth/bot/js/sso/handleMessageExtensionQueryWithToken.js +13 -3
  587. package/templates/plugins/resource/aad/auth/bot/js/sso/profileSsoCommandHandler.js +14 -5
  588. package/templates/plugins/resource/aad/auth/bot/ts/sso/handleMessageExtensionQueryWithToken.ts +11 -3
  589. package/templates/plugins/resource/aad/auth/bot/ts/sso/profileSsoCommandHandler.ts +12 -3
  590. package/templates/plugins/resource/aad/auth/tab/csharp/GetUserProfile.razor +1 -2
  591. package/build/common/samples-config-v3.json +0 -233
  592. package/build/component/configManager/diagnostic.d.ts +0 -9
  593. package/build/component/configManager/diagnostic.d.ts.map +0 -1
  594. package/build/component/configManager/diagnostic.js +0 -49
  595. package/build/component/configManager/diagnostic.js.map +0 -1
  596. package/build/component/driver/middleware/updateProgress.d.ts +0 -6
  597. package/build/component/driver/middleware/updateProgress.d.ts.map +0 -1
  598. package/build/component/driver/middleware/updateProgress.js +0 -15
  599. package/build/component/driver/middleware/updateProgress.js.map +0 -1
  600. package/build/core/FxCoreImplementV3.d.ts +0 -44
  601. package/build/core/FxCoreImplementV3.d.ts.map +0 -1
  602. package/build/core/FxCoreImplementV3.js +0 -663
  603. package/build/core/FxCoreImplementV3.js.map +0 -1
@@ -1,22 +1,22 @@
1
1
  # Enable single sign-on for bot applications
2
+
2
3
  > Note: This document includes single sign-on instructions applicable for both bot and message extension. Make sure to add the corresponding Teams capability first and then follow the documentation.
3
4
 
4
5
  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.
5
6
 
6
- For a bot application, user can invoke the AAD consent flow to obtain sso token to call Graph and other APIs.
7
-
7
+ For a bot application, user can invoke the AAD consent flow to obtain sso token to call Graph and other APIs.
8
8
 
9
9
  <h2>Contents </h2>
10
10
 
11
- * [Changes to your project](#1)
12
- * [Update code to Use SSO for Bot](#2)
13
- * [Set up the AAD redirects](#2.1)
14
- * [Update your business logic](#2.2)
15
- * [(Optional) Add a new sso command to the bot](#2.3)
16
- * [Update code to Use SSO for Message Extension](#3)
17
- * [Debug your application](#4)
18
- * [Customize AAD applications](#5)
19
- * [Trouble Shooting](#6)
11
+ - [Changes to your project](#1)
12
+ - [Update code to Use SSO for Bot](#2)
13
+ - [Set up the AAD redirects](#2.1)
14
+ - [Update your business logic](#2.2)
15
+ - [(Optional) Add a new sso command to the bot](#2.3)
16
+ - [Update code to Use SSO for Message Extension](#3)
17
+ - [Debug your application](#4)
18
+ - [Customize AAD applications](#5)
19
+ - [Trouble Shooting](#6)
20
20
 
21
21
  <h2 id='1'>Changes to your project</h2>
22
22
 
@@ -24,13 +24,13 @@ When you added the SSO feature to your application, Teams Toolkit updated your p
24
24
 
25
25
  After you successfully added SSO into your project, Teams Toolkit will create and modify some files that helps you implement SSO feature.
26
26
 
27
- | Action | File | Description |
28
- | - | - | - |
29
- | Modify | `azureWebAppBotConfig.bicep` under `templates/azure/teamsFx` and `azure.parameters.dev.json` under `.fx/configs`| Insert environment variables used for bot web app to enable SSO feature |
30
- | 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. |
31
- | Modify | `projectSettings.json` under `.fx/configs` | Add bot sso capability, which will be used internally by Teams Toolkit. |
32
- | Create| `aad.template.json` under `templates/appPackage` | The Azure Active Directory application manifest that is used to register the application with AAD. |
33
- | Create | `auth/bot` | Reference code, redirect pages and a `README.md` file. These files are provided for reference. See below for more information. |
27
+ | Action | File | Description |
28
+ | ------ | ---------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------- |
29
+ | Modify | `azureWebAppBotConfig.bicep` under `templates/azure/teamsFx` and `azure.parameters.dev.json` under `.fx/configs` | Insert environment variables used for bot web app to enable SSO feature |
30
+ | 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. |
31
+ | Modify | `projectSettings.json` under `.fx/configs` | Add bot sso capability, which will be used internally by Teams Toolkit. |
32
+ | Create | `aad.template.json` under `templates/appPackage` | The Azure Active Directory application manifest that is used to register the application with AAD. |
33
+ | Create | `auth/bot` | Reference code, redirect pages and a `README.md` file. These files are provided for reference. See below for more information. |
34
34
 
35
35
  <h2 id='2'>Update your code to Use SSO for Bot</h2>
36
36
 
@@ -43,16 +43,16 @@ As described above, the Teams Toolkit generated some configuration to set up you
43
43
  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.
44
44
  1. Modify your `bot/src/index` to add the appropriate `restify` routes to these pages.
45
45
 
46
- ```ts
47
- const path = require("path");
48
-
49
- server.get(
50
- "/auth-:name(start|end).html",
51
- restify.plugins.serveStatic({
52
- directory: path.join(__dirname, "public"),
53
- })
54
- );
55
- ```
46
+ ```ts
47
+ const path = require("path");
48
+
49
+ server.get(
50
+ "/auth-:name(start|end).html",
51
+ restify.plugins.serveStatic({
52
+ directory: path.join(__dirname, "public"),
53
+ })
54
+ );
55
+ ```
56
56
 
57
57
  <h3 id='2.2'>Update your business logic</h3>
58
58
 
@@ -60,12 +60,11 @@ The sample business logic provides a sso command handler `ProfileSsoCommandHandl
60
60
 
61
61
  To make this work in your application:
62
62
 
63
+ 1. Move `profileSsoCommandHandler` file under `auth/bot/sso` folder to `bot/src`. ProfileSsoCommandHandler class is a sso command handler to get user info with SSO token. You can follow this method and create your own sso command handler.
63
64
 
64
- 1. Move `profileSsoCommandHandler` file under `auth/bot/sso` folder to `bot/src`. ProfileSsoCommandHandler class is a sso command handler to get user info with SSO token. You can follow this method and create your own sso command handler.
65
-
66
- 1. Open `package.json` file, make sure that teamsfx SDK version >= 2.2.0
67
- 1. Execute the following commands under `bot` folder: `npm install isomorphic-fetch --save`
68
- 1. (For ts only) Execute the following commands under `bot` folder: `npm install copyfiles --save-dev` and replace following line in package.json:
65
+ 1. Open `package.json` file, make sure that teamsfx SDK version >= 2.2.0
66
+ 1. Execute the following commands under `bot` folder: `npm install isomorphic-fetch --save`
67
+ 1. (For ts only) Execute the following commands under `bot` folder: `npm install copyfiles --save-dev` and replace following line in package.json:
69
68
 
70
69
  ```json
71
70
  "build": "tsc --build && shx cp -r ./src/adaptiveCards ./lib/src",
@@ -76,31 +75,32 @@ To make this work in your application:
76
75
  ```json
77
76
  "build": "tsc --build && shx cp -r ./src/adaptiveCards ./lib/src && copyfiles src/public/*.html lib/",
78
77
  ```
78
+
79
79
  By doing this, the HTML pages used for auth redirect will be copied when building this bot project.
80
80
 
81
- 1. After adding the following files, you need to update `bot/src/index` file.
82
- Please replace the following code to make sso consent flow works:
81
+ 1. After adding the following files, you need to update `bot/src/index` file.
82
+ Please replace the following code to make sso consent flow works:
83
83
 
84
- ```ts
85
- server.post("/api/messages", async (req, res) => {
86
- await commandBot.requestHandler(req, res);
87
- });
88
- ```
84
+ ```ts
85
+ server.post("/api/messages", async (req, res) => {
86
+ await commandBot.requestHandler(req, res);
87
+ });
88
+ ```
89
89
 
90
- with:
90
+ with:
91
91
 
92
- ```ts
93
- server.post("/api/messages", async (req, res) => {
94
- await commandBot.requestHandler(req, res).catch((err) => {
95
- // Error message including "412" means it is waiting for user's consent, which is a normal process of SSO, sholdn't throw this error.
96
- if (!err.message.includes("412")) {
97
- throw err;
98
- }
92
+ ```ts
93
+ server.post("/api/messages", async (req, res) => {
94
+ await commandBot.requestHandler(req, res).catch((err) => {
95
+ // Error message including "412" means it is waiting for user's consent, which is a normal process of SSO, sholdn't throw this error.
96
+ if (!err.message.includes("412")) {
97
+ throw err;
98
+ }
99
+ });
99
100
  });
100
- });
101
- ```
101
+ ```
102
102
 
103
- 1. Replace the options for `ConversationBot` instance in `bot/src/internal/initialize` to add the sso config and sso command handler:
103
+ 1. Replace the options for `ConversationBot` instance in `bot/src/internal/initialize` to add the sso config and sso command handler:
104
104
 
105
105
  ```ts
106
106
  export const commandBot = new ConversationBot({
@@ -133,12 +133,12 @@ Please replace the following code to make sso consent flow works:
133
133
  });
134
134
  ```
135
135
 
136
- 1. Register your command in the Teams app manifest. Open `templates/appPackage/manifest.template.json`, and add following lines under `commands` in `commandLists` of your bot:
136
+ 1. Register your command in the Teams app manifest. Open `templates/appPackage/manifest.template.json`, and add following lines under `commands` in `commandLists` of your bot:
137
137
 
138
138
  ```json
139
139
  {
140
- "title": "profile",
141
- "description": "Show user profile using Single Sign On feature"
140
+ "title": "profile",
141
+ "description": "Show user profile using Single Sign On feature"
142
142
  }
143
143
  ```
144
144
 
@@ -148,229 +148,247 @@ After successfully add SSO in your project, you can also add a new sso command.
148
148
 
149
149
  1. Create a new file (e.g. `photoSsoCommandHandler.ts` or `photoSsoCommandHandler.js`) under `bot/src/` and add your own business logic to call Graph API:
150
150
 
151
- ```TypeScript
152
- // for TypeScript:
153
- import { Activity, TurnContext, ActivityTypes } from "botbuilder";
154
- import "isomorphic-fetch";
155
- import {
156
- CommandMessage,
157
- TriggerPatterns,
158
- TeamsFxBotSsoCommandHandler,
159
- TeamsBotSsoPromptTokenResponse,
160
- OnBehalfOfUserCredential,
161
- createMicrosoftGraphClientWithCredential,
162
- OnBehalfOfCredentialAuthConfig,
163
- } from "@microsoft/teamsfx";
164
-
165
- const oboAuthConfig: OnBehalfOfCredentialAuthConfig = {
166
- authorityHost: process.env.M365_AUTHORITY_HOST,
167
- clientId: process.env.M365_CLIENT_ID,
168
- tenantId: process.env.M365_TENANT_ID,
169
- clientSecret: process.env.M365_CLIENT_SECRET,
170
- };
171
-
172
- export class PhotoSsoCommandHandler implements TeamsFxBotSsoCommandHandler {
173
- triggerPatterns: TriggerPatterns = "photo";
174
-
175
- async handleCommandReceived(
176
- context: TurnContext,
177
- message: CommandMessage,
178
- tokenResponse: TeamsBotSsoPromptTokenResponse,
179
- ): Promise<string | Partial<Activity> | void> {
180
- await context.sendActivity("Retrieving user information from Microsoft Graph ...");
181
-
182
- // Init OnBehalfOfUserCredential instance with SSO token
183
- const oboCredential = new OnBehalfOfUserCredential(tokenResponse.ssoToken, oboAuthConfig);
184
- // Add scope for your Azure AD app. For example: Mail.Read, etc.
185
- const graphClient = createMicrosoftGraphClientWithCredential(oboCredential, ["User.Read"]);
186
-
187
- let photoUrl = "";
188
- try {
189
- const photo = await graphClient.api("/me/photo/$value").get();
190
- const arrayBuffer = await photo.arrayBuffer();
191
- const buffer=Buffer.from(arrayBuffer, 'binary');
192
- photoUrl = "data:image/png;base64," + buffer.toString("base64");
193
- } catch {
194
- // Could not fetch photo from user's profile, return empty string as placeholder.
195
- }
196
- if (photoUrl) {
197
- const photoMessage: Partial<Activity> = {
198
- type: ActivityTypes.Message,
199
- text: 'This is your photo:',
200
- attachments: [
201
- {
202
- name: 'photo.png',
203
- contentType: 'image/png',
204
- contentUrl: photoUrl
205
- }
206
- ]
207
- };
208
- return photoMessage;
209
- } else {
210
- return "Could not retrieve your photo from Microsoft Graph. Please make sure you have uploaded your photo.";
211
- }
212
- }
213
- }
214
- ```
215
-
216
- ```javascript
217
- // for JavaScript:
218
- const { ActivityTypes } = require("botbuilder");
219
- require("isomorphic-fetch");
220
- const {
221
- OnBehalfOfUserCredential,
222
- createMicrosoftGraphClientWithCredential,
223
- } = require("@microsoft/teamsfx");
224
-
225
- const oboAuthConfig = {
226
- authorityHost: process.env.M365_AUTHORITY_HOST,
227
- clientId: process.env.M365_CLIENT_ID,
228
- tenantId: process.env.M365_TENANT_ID,
229
- clientSecret: process.env.M365_CLIENT_SECRET,
230
- };
231
-
232
- class PhotoSsoCommandHandler {
233
- triggerPatterns = "photo";
234
-
235
- async handleCommandReceived(context, message, tokenResponse) {
236
- await context.sendActivity("Retrieving user information from Microsoft Graph ...");
237
-
238
- // Init OnBehalfOfUserCredential instance with SSO token
239
- const oboCredential = new OnBehalfOfUserCredential(tokenResponse.ssoToken, oboAuthConfig);
240
- // Add scope for your Azure AD app. For example: Mail.Read, etc.
241
- const graphClient = createMicrosoftGraphClientWithCredential(oboCredential, ["User.Read"]);
242
-
243
-
244
- let photoUrl = "";
245
- try {
246
- const photo = await graphClient.api("/me/photo/$value").get();
247
- const arrayBuffer = await photo.arrayBuffer();
248
- const buffer=Buffer.from(arrayBuffer, 'binary');
249
- photoUrl = "data:image/png;base64," + buffer.toString("base64");
250
- } catch {
251
- // Could not fetch photo from user's profile, return empty string as placeholder.
252
- }
253
- if (photoUrl) {
254
- const photoMessage = {
255
- type: ActivityTypes.Message,
256
- text: 'This is your photo:',
257
- attachments: [
258
- {
259
- name: 'photo.png',
260
- contentType: 'image/png',
261
- contentUrl: photoUrl
262
- }
263
- ]
264
- };
265
- return photoMessage;
266
- } else {
267
- return "Could not retrieve your photo from Microsoft Graph. Please make sure you have uploaded your photo.";
268
- }
269
- }
270
- }
271
-
272
- module.exports = {
273
- PhotoSsoCommandHandler,
274
- };
275
-
276
- ```
151
+ ```TypeScript
152
+ // for TypeScript:
153
+ import { Activity, TurnContext, ActivityTypes } from "botbuilder";
154
+ import "isomorphic-fetch";
155
+ import {
156
+ CommandMessage,
157
+ TriggerPatterns,
158
+ TeamsFxBotSsoCommandHandler,
159
+ TeamsBotSsoPromptTokenResponse,
160
+ OnBehalfOfUserCredential,
161
+ OnBehalfOfCredentialAuthConfig,
162
+ } from "@microsoft/teamsfx";
163
+ import { Client } from "@microsoft/microsoft-graph-client";
164
+ import { TokenCredentialAuthenticationProvider } from "@microsoft/microsoft-graph-client/authProviders/azureTokenCredentials";
165
+
166
+ const oboAuthConfig: OnBehalfOfCredentialAuthConfig = {
167
+ authorityHost: process.env.M365_AUTHORITY_HOST,
168
+ clientId: process.env.M365_CLIENT_ID,
169
+ tenantId: process.env.M365_TENANT_ID,
170
+ clientSecret: process.env.M365_CLIENT_SECRET,
171
+ };
172
+
173
+ export class PhotoSsoCommandHandler implements TeamsFxBotSsoCommandHandler {
174
+ triggerPatterns: TriggerPatterns = "photo";
175
+
176
+ async handleCommandReceived(
177
+ context: TurnContext,
178
+ message: CommandMessage,
179
+ tokenResponse: TeamsBotSsoPromptTokenResponse,
180
+ ): Promise<string | Partial<Activity> | void> {
181
+ await context.sendActivity("Retrieving user information from Microsoft Graph ...");
182
+
183
+ // Init OnBehalfOfUserCredential instance with SSO token
184
+ const oboCredential = new OnBehalfOfUserCredential(tokenResponse.ssoToken, oboAuthConfig);
185
+ // Create an instance of the TokenCredentialAuthenticationProvider by passing the tokenCredential instance and options to the constructor
186
+ const authProvider = new TokenCredentialAuthenticationProvider(oboCredential, {
187
+ scopes: ["User.Read"],
188
+ });
189
+
190
+ // Initialize Graph client instance with authProvider
191
+ const graphClient = Client.initWithMiddleware({
192
+ authProvider: authProvider,
193
+ });
194
+
195
+ let photoUrl = "";
196
+ try {
197
+ const photo = await graphClient.api("/me/photo/$value").get();
198
+ const arrayBuffer = await photo.arrayBuffer();
199
+ const buffer=Buffer.from(arrayBuffer, 'binary');
200
+ photoUrl = "data:image/png;base64," + buffer.toString("base64");
201
+ } catch {
202
+ // Could not fetch photo from user's profile, return empty string as placeholder.
203
+ }
204
+ if (photoUrl) {
205
+ const photoMessage: Partial<Activity> = {
206
+ type: ActivityTypes.Message,
207
+ text: 'This is your photo:',
208
+ attachments: [
209
+ {
210
+ name: 'photo.png',
211
+ contentType: 'image/png',
212
+ contentUrl: photoUrl
213
+ }
214
+ ]
215
+ };
216
+ return photoMessage;
217
+ } else {
218
+ return "Could not retrieve your photo from Microsoft Graph. Please make sure you have uploaded your photo.";
219
+ }
220
+ }
221
+ }
222
+ ```
223
+
224
+ ```javascript
225
+ // for JavaScript:
226
+ const { ActivityTypes } = require("botbuilder");
227
+ require("isomorphic-fetch");
228
+ const { OnBehalfOfUserCredential } = require("@microsoft/teamsfx");
229
+ const { Client } = require("@microsoft/microsoft-graph-client");
230
+ const {
231
+ TokenCredentialAuthenticationProvider,
232
+ } = require("@microsoft/microsoft-graph-client/authProviders/azureTokenCredentials");
233
+
234
+ const oboAuthConfig = {
235
+ authorityHost: process.env.M365_AUTHORITY_HOST,
236
+ clientId: process.env.M365_CLIENT_ID,
237
+ tenantId: process.env.M365_TENANT_ID,
238
+ clientSecret: process.env.M365_CLIENT_SECRET,
239
+ };
240
+
241
+ class PhotoSsoCommandHandler {
242
+ triggerPatterns = "photo";
243
+
244
+ async handleCommandReceived(context, message, tokenResponse) {
245
+ await context.sendActivity("Retrieving user information from Microsoft Graph ...");
246
+
247
+ // Init OnBehalfOfUserCredential instance with SSO token
248
+ const oboCredential = new OnBehalfOfUserCredential(tokenResponse.ssoToken, oboAuthConfig);
249
+ // Create an instance of the TokenCredentialAuthenticationProvider by passing the tokenCredential instance and options to the constructor
250
+ const authProvider = new TokenCredentialAuthenticationProvider(credential, {
251
+ scopes: ["User.Read"],
252
+ });
253
+
254
+ // Initialize Graph client instance with authProvider
255
+ const graphClient = Client.initWithMiddleware({
256
+ authProvider: authProvider,
257
+ });
258
+
259
+ let photoUrl = "";
260
+ try {
261
+ const photo = await graphClient.api("/me/photo/$value").get();
262
+ const arrayBuffer = await photo.arrayBuffer();
263
+ const buffer = Buffer.from(arrayBuffer, "binary");
264
+ photoUrl = "data:image/png;base64," + buffer.toString("base64");
265
+ } catch {
266
+ // Could not fetch photo from user's profile, return empty string as placeholder.
267
+ }
268
+ if (photoUrl) {
269
+ const photoMessage = {
270
+ type: ActivityTypes.Message,
271
+ text: "This is your photo:",
272
+ attachments: [
273
+ {
274
+ name: "photo.png",
275
+ contentType: "image/png",
276
+ contentUrl: photoUrl,
277
+ },
278
+ ],
279
+ };
280
+ return photoMessage;
281
+ } else {
282
+ return "Could not retrieve your photo from Microsoft Graph. Please make sure you have uploaded your photo.";
283
+ }
284
+ }
285
+ }
286
+
287
+ module.exports = {
288
+ PhotoSsoCommandHandler,
289
+ };
290
+ ```
277
291
 
278
292
  1. Put `PhotoSsoCommandHandler` instance to `ssoCommands` array in `bot/src/internal/initialize.ts` as below:
279
-
280
- ```ts
281
- // for TypeScript:
282
- import { PhotoSsoCommandHandler } from "../photoSsoCommandHandler";
283
293
 
284
- export const commandBot = new ConversationBot({
285
- ...
286
- command: {
287
- ...
288
- ssoCommands: [new ProfileSsoCommandHandler(), new PhotoSsoCommandHandler()],
289
- },
290
- });
291
- ```
292
-
293
- ```javascript
294
- // for JavaScript:
295
- ...
296
- const { PhotoSsoCommandHandler } = require("../photoSsoCommandHandler");
297
-
298
- const commandBot = new ConversationBot({
299
- ...
300
- command: {
301
- ...
302
- ssoCommands: [new ProfileSsoCommandHandler(), new PhotoSsoCommandHandler()]
303
- },
304
- });
305
- ...
306
-
307
- ```
294
+ ```ts
295
+ // for TypeScript:
296
+ import { PhotoSsoCommandHandler } from "../photoSsoCommandHandler";
297
+
298
+ export const commandBot = new ConversationBot({
299
+ ...
300
+ command: {
301
+ ...
302
+ ssoCommands: [new ProfileSsoCommandHandler(), new PhotoSsoCommandHandler()],
303
+ },
304
+ });
305
+ ```
306
+
307
+ ```javascript
308
+ // for JavaScript:
309
+ ...
310
+ const { PhotoSsoCommandHandler } = require("../photoSsoCommandHandler");
311
+
312
+ const commandBot = new ConversationBot({
313
+ ...
314
+ command: {
315
+ ...
316
+ ssoCommands: [new ProfileSsoCommandHandler(), new PhotoSsoCommandHandler()]
317
+ },
318
+ });
319
+ ...
320
+
321
+ ```
308
322
 
309
323
  1. Register your command in the Teams app manifest. Open 'templates/appPackage/manifest.template.json', and add following lines under `commands` in `commandLists` of your bot:
310
324
 
311
- ```json
312
- {
313
- "title": "photo",
314
- "description": "Show user photo using Single Sign On feature"
315
- }
316
- ```
325
+ ```json
326
+ {
327
+ "title": "photo",
328
+ "description": "Show user photo using Single Sign On feature"
329
+ }
330
+ ```
317
331
 
318
332
  <h2 id='3'>Update your business logic for Message Extension</h2>
319
333
 
320
- The sample business logic provides a handler `TeamsBot` extends TeamsActivityHandler and override `handleTeamsMessagingExtensionQuery`.
334
+ The sample business logic provides a handler `TeamsBot` extends TeamsActivityHandler and override `handleTeamsMessagingExtensionQuery`.
321
335
  You can update the query logic in the `handleMessageExtensionQueryWithSSO` with token which is obtained by using the logged-in Teams user token.
322
336
 
323
337
  To make this work in your application:
338
+
324
339
  1. Move the `auth/bot/public` folder to `bot`. 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.
325
340
  1. Modify your `bot/index` to add the appropriate `restify` routes to these pages.
326
341
 
327
- ```ts
328
- const path = require("path");
329
-
330
- // Listen for incoming requests.
331
- server.post("/api/messages", async (req, res) => {
332
- await adapter.process(req, res, async (context) => {
333
- await bot.run(context);
334
- }).catch((err) => {
335
- // Error message including "412" means it is waiting for user's consent, which is a normal process of SSO, sholdn't throw this error.
336
- if(!err.message.includes("412")) {
337
- throw err;
338
- }
339
- })
340
- });
342
+ ```ts
343
+ const path = require("path");
344
+
345
+ // Listen for incoming requests.
346
+ server.post("/api/messages", async (req, res) => {
347
+ await adapter
348
+ .process(req, res, async (context) => {
349
+ await bot.run(context);
350
+ })
351
+ .catch((err) => {
352
+ // Error message including "412" means it is waiting for user's consent, which is a normal process of SSO, sholdn't throw this error.
353
+ if (!err.message.includes("412")) {
354
+ throw err;
355
+ }
356
+ });
357
+ });
358
+
359
+ server.get(
360
+ "/auth-:name(start|end).html",
361
+ restify.plugins.serveStatic({
362
+ directory: path.join(__dirname, "public"),
363
+ })
364
+ );
365
+ ```
341
366
 
342
- server.get(
343
- "/auth-:name(start|end).html",
344
- restify.plugins.serveStatic({
345
- directory: path.join(__dirname, "public"),
346
- })
347
- );
348
- ```
349
367
  1. Override `handleTeamsMessagingExtensionQuery` interface under `bot/teamsBot`. You can follow the sample code in the `handleMessageExtensionQueryWithSSO` to do your own query logic.
350
368
  1. Open `bot/package.json`, ensure that `@microsoft/teamsfx` version >= 2.2.0
351
369
  1. Install `isomorphic-fetch` npm packages in your bot project.
352
370
  1. (For ts only) Install `copyfiles` npm packages in your bot project, add or update the `build` script in `bot/package.json` as following
353
371
 
354
- ```json
355
- "build": "tsc --build && copyfiles ./public/*.html lib/",
356
- ```
357
- By doing this, the HTML pages used for auth redirect will be copied when building this bot project.
372
+ ```json
373
+ "build": "tsc --build && copyfiles ./public/*.html lib/",
374
+ ```
358
375
 
359
- 1. Update `templates/appPackage/aad.template.json` your scopes which used in `handleMessageExtensionQueryWithSSO`.
360
- ```json
361
- "requiredResourceAccess": [
362
- {
363
- "resourceAppId": "Microsoft Graph",
364
- "resourceAccess": [
365
- {
366
- "id": "User.Read",
367
- "type": "Scope"
368
- }
369
- ]
370
- }
371
- ]
372
- ```
376
+ By doing this, the HTML pages used for auth redirect will be copied when building this bot project.
373
377
 
378
+ 1. Update `templates/appPackage/aad.template.json` your scopes which used in `handleMessageExtensionQueryWithSSO`.
379
+ ```json
380
+ "requiredResourceAccess": [
381
+ {
382
+ "resourceAppId": "Microsoft Graph",
383
+ "resourceAccess": [
384
+ {
385
+ "id": "User.Read",
386
+ "type": "Scope"
387
+ }
388
+ ]
389
+ }
390
+ ]
391
+ ```
374
392
 
375
393
  <h2 id='4'>Debug your application </h2>
376
394
 
@@ -394,13 +412,13 @@ Follow this [document](https://aka.ms/teamsfx-aad-manifest#How-to-view-the-AAD-a
394
412
 
395
413
  First check whether your auth-start page is available by directly go to "{your-bot-endpoint}/auth-start.html" in your browser. You can find your-bot-endpoint in `.fx/states/state.{env}.json`.
396
414
 
397
- - If the auth-start page can be opened in your browser, please try sign out current account in Teams app page and sign in again and run the command again.
398
- - If encounter with ngrok page below when local debug, please follow the steps to solve this issue.
399
-
400
- 1. Stop debugging in Visual Studio Code.
401
- 1. Sign up an ngrok account in https://dashboard.ngrok.com/signup.
402
- 1. Copy your personal ngrok authtoken from https://dashboard.ngrok.com/get-started/your-authtoken.
403
- 1. Run `npx ngrok authtoken <your-personal-ngrok-authtoken>` in Visual Studio Code terminal.
404
- 1. Start debugging the project again by hitting the F5 key in Visual Studio Code.
415
+ - If the auth-start page can be opened in your browser, please try sign out current account in Teams app page and sign in again and run the command again.
416
+ - If encounter with ngrok page below when local debug, please follow the steps to solve this issue.
417
+
418
+ 1. Stop debugging in Visual Studio Code.
419
+ 1. Sign up an ngrok account in https://dashboard.ngrok.com/signup.
420
+ 1. Copy your personal ngrok authtoken from https://dashboard.ngrok.com/get-started/your-authtoken.
421
+ 1. Run `npx ngrok authtoken <your-personal-ngrok-authtoken>` in Visual Studio Code terminal.
422
+ 1. Start debugging the project again by hitting the F5 key in Visual Studio Code.
405
423
 
406
- ![ngrok auth page](https://user-images.githubusercontent.com/63089166/190566043-6957edc9-c5b8-409d-b532-979ee0ef6ce5.png)
424
+ ![ngrok auth page](https://user-images.githubusercontent.com/63089166/190566043-6957edc9-c5b8-409d-b532-979ee0ef6ce5.png)