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