@microsoft/teamsfx-core 1.7.0 → 1.7.1-alpha.42a29d71b.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/constants.d.ts +3 -1
- package/build/common/constants.d.ts.map +1 -1
- package/build/common/constants.js +3 -1
- package/build/common/constants.js.map +1 -1
- package/build/common/featureFlags.d.ts +8 -0
- package/build/common/featureFlags.d.ts.map +1 -0
- package/build/common/featureFlags.js +43 -0
- package/build/common/featureFlags.js.map +1 -0
- package/build/common/index.d.ts +4 -3
- package/build/common/index.d.ts.map +1 -1
- package/build/common/index.js +4 -3
- package/build/common/index.js.map +1 -1
- package/build/common/local/localEnvManager.d.ts +1 -1
- package/build/common/local/localEnvManager.d.ts.map +1 -1
- package/build/common/local/localEnvManager.js +1 -1
- package/build/common/local/localEnvManager.js.map +1 -1
- package/build/common/local/localStateHelper.d.ts.map +1 -1
- package/build/common/local/localStateHelper.js +12 -0
- package/build/common/local/localStateHelper.js.map +1 -1
- package/build/common/local/portChecker.d.ts.map +1 -1
- package/build/common/local/portChecker.js +6 -1
- package/build/common/local/portChecker.js.map +1 -1
- package/build/common/projectSettingsHelper.d.ts +1 -1
- package/build/common/projectSettingsHelper.d.ts.map +1 -1
- package/build/common/projectSettingsHelper.js +6 -4
- package/build/common/projectSettingsHelper.js.map +1 -1
- package/build/common/samples-config.json +29 -15
- package/build/common/samples.d.ts +1 -1
- package/build/common/samples.d.ts.map +1 -1
- package/build/common/samples.js +3 -2
- package/build/common/samples.js.map +1 -1
- package/build/common/telemetry.d.ts +9 -0
- package/build/common/telemetry.d.ts.map +1 -1
- package/build/common/telemetry.js +9 -0
- package/build/common/telemetry.js.map +1 -1
- package/build/common/templates-config.json +2 -2
- package/build/common/tools.d.ts +3 -3
- package/build/common/tools.d.ts.map +1 -1
- package/build/common/tools.js +28 -28
- package/build/common/tools.js.map +1 -1
- package/build/core/FxCore.d.ts +3 -2
- package/build/core/FxCore.d.ts.map +1 -1
- package/build/core/FxCore.js +76 -19
- package/build/core/FxCore.js.map +1 -1
- package/build/core/environment.d.ts +1 -1
- package/build/core/environment.d.ts.map +1 -1
- package/build/core/environment.js +6 -1
- package/build/core/environment.js.map +1 -1
- package/build/core/error.d.ts +1 -0
- package/build/core/error.d.ts.map +1 -1
- package/build/core/error.js +5 -1
- package/build/core/error.js.map +1 -1
- package/build/core/globalVars.d.ts +0 -5
- package/build/core/globalVars.d.ts.map +1 -1
- package/build/core/globalVars.js +1 -9
- package/build/core/globalVars.js.map +1 -1
- package/build/core/middleware/aadManifestMigration.d.ts +3 -0
- package/build/core/middleware/aadManifestMigration.d.ts.map +1 -0
- package/build/core/middleware/aadManifestMigration.js +240 -0
- package/build/core/middleware/aadManifestMigration.js.map +1 -0
- package/build/core/middleware/consolidateLocalRemote.d.ts +2 -0
- package/build/core/middleware/consolidateLocalRemote.d.ts.map +1 -1
- package/build/core/middleware/consolidateLocalRemote.js +100 -55
- package/build/core/middleware/consolidateLocalRemote.js.map +1 -1
- package/build/core/middleware/errorHandler.d.ts.map +1 -1
- package/build/core/middleware/errorHandler.js +15 -3
- package/build/core/middleware/errorHandler.js.map +1 -1
- package/build/core/middleware/questionModel.d.ts.map +1 -1
- package/build/core/middleware/questionModel.js +11 -55
- package/build/core/middleware/questionModel.js.map +1 -1
- package/build/core/question.d.ts +2 -8
- package/build/core/question.d.ts.map +1 -1
- package/build/core/question.js +68 -52
- package/build/core/question.js.map +1 -1
- package/build/core/telemetry.d.ts +23 -0
- package/build/core/telemetry.d.ts.map +1 -0
- package/build/core/telemetry.js +46 -0
- package/build/core/telemetry.js.map +1 -0
- package/build/plugins/resource/aad/constants.d.ts +5 -0
- package/build/plugins/resource/aad/constants.d.ts.map +1 -1
- package/build/plugins/resource/aad/constants.js +5 -0
- package/build/plugins/resource/aad/constants.js.map +1 -1
- package/build/plugins/resource/aad/errors.d.ts +2 -0
- package/build/plugins/resource/aad/errors.d.ts.map +1 -1
- package/build/plugins/resource/aad/errors.js +15 -1
- package/build/plugins/resource/aad/errors.js.map +1 -1
- package/build/plugins/resource/aad/index.d.ts +2 -1
- package/build/plugins/resource/aad/index.d.ts.map +1 -1
- package/build/plugins/resource/aad/index.js +23 -0
- package/build/plugins/resource/aad/index.js.map +1 -1
- package/build/plugins/resource/aad/plugin.d.ts +3 -0
- package/build/plugins/resource/aad/plugin.d.ts.map +1 -1
- package/build/plugins/resource/aad/plugin.js +109 -19
- package/build/plugins/resource/aad/plugin.js.map +1 -1
- package/build/plugins/resource/aad/utils/configs.d.ts +2 -1
- package/build/plugins/resource/aad/utils/configs.d.ts.map +1 -1
- package/build/plugins/resource/aad/utils/configs.js +20 -3
- package/build/plugins/resource/aad/utils/configs.js.map +1 -1
- package/build/plugins/resource/aad/v2/index.d.ts +2 -1
- package/build/plugins/resource/aad/v2/index.d.ts.map +1 -1
- package/build/plugins/resource/aad/v2/index.js +3 -0
- package/build/plugins/resource/aad/v2/index.js.map +1 -1
- package/build/plugins/resource/apiconnector/checker.d.ts +7 -0
- package/build/plugins/resource/apiconnector/checker.d.ts.map +1 -0
- package/build/plugins/resource/apiconnector/checker.js +73 -0
- package/build/plugins/resource/apiconnector/checker.js.map +1 -0
- package/build/plugins/resource/apiconnector/config.d.ts +23 -0
- package/build/plugins/resource/apiconnector/config.d.ts.map +1 -0
- package/build/plugins/resource/apiconnector/config.js +5 -0
- package/build/plugins/resource/apiconnector/config.js.map +1 -0
- package/build/plugins/resource/apiconnector/constants.d.ts +25 -1
- package/build/plugins/resource/apiconnector/constants.d.ts.map +1 -1
- package/build/plugins/resource/apiconnector/constants.js +33 -7
- package/build/plugins/resource/apiconnector/constants.js.map +1 -1
- package/build/plugins/resource/apiconnector/depsHandler.d.ts +13 -0
- package/build/plugins/resource/apiconnector/depsHandler.d.ts.map +1 -0
- package/build/plugins/resource/apiconnector/depsHandler.js +93 -0
- package/build/plugins/resource/apiconnector/depsHandler.js.map +1 -0
- package/build/plugins/resource/apiconnector/envHandler.d.ts +6 -4
- package/build/plugins/resource/apiconnector/envHandler.d.ts.map +1 -1
- package/build/plugins/resource/apiconnector/envHandler.js +57 -26
- package/build/plugins/resource/apiconnector/envHandler.js.map +1 -1
- package/build/plugins/resource/apiconnector/errors.d.ts +30 -8
- package/build/plugins/resource/apiconnector/errors.d.ts.map +1 -1
- package/build/plugins/resource/apiconnector/errors.js +35 -9
- package/build/plugins/resource/apiconnector/errors.js.map +1 -1
- package/build/plugins/resource/apiconnector/index.d.ts.map +1 -1
- package/build/plugins/resource/apiconnector/index.js +1 -8
- package/build/plugins/resource/apiconnector/index.js.map +1 -1
- package/build/plugins/resource/apiconnector/plugin.d.ts +16 -2
- package/build/plugins/resource/apiconnector/plugin.d.ts.map +1 -1
- package/build/plugins/resource/apiconnector/plugin.js +259 -37
- package/build/plugins/resource/apiconnector/plugin.js.map +1 -1
- package/build/plugins/resource/apiconnector/questions.d.ts +26 -4
- package/build/plugins/resource/apiconnector/questions.d.ts.map +1 -1
- package/build/plugins/resource/apiconnector/questions.js +103 -26
- package/build/plugins/resource/apiconnector/questions.js.map +1 -1
- package/build/plugins/resource/apiconnector/result.d.ts +16 -3
- package/build/plugins/resource/apiconnector/result.d.ts.map +1 -1
- package/build/plugins/resource/apiconnector/result.js +24 -5
- package/build/plugins/resource/apiconnector/result.js.map +1 -1
- package/build/plugins/resource/apiconnector/sampleHandler.d.ts +3 -3
- package/build/plugins/resource/apiconnector/sampleHandler.d.ts.map +1 -1
- package/build/plugins/resource/apiconnector/sampleHandler.js +14 -4
- package/build/plugins/resource/apiconnector/sampleHandler.js.map +1 -1
- package/build/plugins/resource/apiconnector/telemetry.d.ts +41 -0
- package/build/plugins/resource/apiconnector/telemetry.d.ts.map +1 -0
- package/build/plugins/resource/apiconnector/telemetry.js +69 -0
- package/build/plugins/resource/apiconnector/telemetry.js.map +1 -0
- package/build/plugins/resource/apiconnector/utils.d.ts +14 -20
- package/build/plugins/resource/apiconnector/utils.d.ts.map +1 -1
- package/build/plugins/resource/apiconnector/utils.js +63 -16
- package/build/plugins/resource/apiconnector/utils.js.map +1 -1
- package/build/plugins/resource/appstudio/appStudio.d.ts.map +1 -1
- package/build/plugins/resource/appstudio/appStudio.js +6 -5
- 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 +24 -1
- package/build/plugins/resource/appstudio/constants.js.map +1 -1
- package/build/plugins/resource/appstudio/index.d.ts +1 -0
- package/build/plugins/resource/appstudio/index.d.ts.map +1 -1
- package/build/plugins/resource/appstudio/index.js +56 -11
- package/build/plugins/resource/appstudio/index.js.map +1 -1
- package/build/plugins/resource/appstudio/manifestTemplate.d.ts +2 -2
- package/build/plugins/resource/appstudio/manifestTemplate.d.ts.map +1 -1
- package/build/plugins/resource/appstudio/manifestTemplate.js +27 -5
- package/build/plugins/resource/appstudio/manifestTemplate.js.map +1 -1
- package/build/plugins/resource/appstudio/plugin.d.ts +1 -0
- package/build/plugins/resource/appstudio/plugin.d.ts.map +1 -1
- package/build/plugins/resource/appstudio/plugin.js +6 -1
- package/build/plugins/resource/appstudio/plugin.js.map +1 -1
- package/build/plugins/resource/appstudio/utils/telemetry.d.ts +1 -0
- package/build/plugins/resource/appstudio/utils/telemetry.d.ts.map +1 -1
- package/build/plugins/resource/appstudio/utils/telemetry.js +1 -0
- package/build/plugins/resource/appstudio/utils/telemetry.js.map +1 -1
- package/build/plugins/resource/appstudio/v2/index.d.ts +2 -0
- package/build/plugins/resource/appstudio/v2/index.d.ts.map +1 -1
- package/build/plugins/resource/appstudio/v2/index.js +5 -0
- package/build/plugins/resource/appstudio/v2/index.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/appstudio/v3/plugin.d.ts.map +1 -1
- package/build/plugins/resource/appstudio/v3/plugin.js +5 -0
- package/build/plugins/resource/appstudio/v3/plugin.js.map +1 -1
- package/build/plugins/resource/bot/azureOps.d.ts +3 -2
- package/build/plugins/resource/bot/azureOps.d.ts.map +1 -1
- package/build/plugins/resource/bot/azureOps.js +29 -30
- package/build/plugins/resource/bot/azureOps.js.map +1 -1
- package/build/plugins/resource/bot/clientFactory.d.ts +0 -5
- package/build/plugins/resource/bot/clientFactory.d.ts.map +1 -1
- package/build/plugins/resource/bot/clientFactory.js +1 -29
- package/build/plugins/resource/bot/clientFactory.js.map +1 -1
- package/build/plugins/resource/bot/configs/teamsBotConfig.d.ts +1 -0
- package/build/plugins/resource/bot/configs/teamsBotConfig.d.ts.map +1 -1
- package/build/plugins/resource/bot/configs/teamsBotConfig.js +15 -13
- package/build/plugins/resource/bot/configs/teamsBotConfig.js.map +1 -1
- package/build/plugins/resource/bot/constants.d.ts +8 -9
- package/build/plugins/resource/bot/constants.d.ts.map +1 -1
- package/build/plugins/resource/bot/constants.js +9 -9
- package/build/plugins/resource/bot/constants.js.map +1 -1
- package/build/plugins/resource/bot/errors.d.ts +6 -18
- package/build/plugins/resource/bot/errors.d.ts.map +1 -1
- package/build/plugins/resource/bot/errors.js +16 -39
- package/build/plugins/resource/bot/errors.js.map +1 -1
- package/build/plugins/resource/bot/functionsHostedBot/deployMgr.d.ts +1 -1
- package/build/plugins/resource/bot/functionsHostedBot/deployMgr.d.ts.map +1 -1
- package/build/plugins/resource/bot/functionsHostedBot/deployMgr.js +10 -4
- package/build/plugins/resource/bot/functionsHostedBot/deployMgr.js.map +1 -1
- package/build/plugins/resource/bot/functionsHostedBot/plugin.d.ts.map +1 -1
- package/build/plugins/resource/bot/functionsHostedBot/plugin.js +4 -7
- package/build/plugins/resource/bot/functionsHostedBot/plugin.js.map +1 -1
- package/build/plugins/resource/bot/index.d.ts.map +1 -1
- package/build/plugins/resource/bot/index.js +4 -2
- package/build/plugins/resource/bot/index.js.map +1 -1
- package/build/plugins/resource/bot/languageStrategy.d.ts.map +1 -1
- package/build/plugins/resource/bot/languageStrategy.js +3 -1
- package/build/plugins/resource/bot/languageStrategy.js.map +1 -1
- package/build/plugins/resource/bot/plugin.d.ts.map +1 -1
- package/build/plugins/resource/bot/plugin.js +8 -3
- package/build/plugins/resource/bot/plugin.js.map +1 -1
- package/build/plugins/resource/bot/question.d.ts +5 -3
- package/build/plugins/resource/bot/question.d.ts.map +1 -1
- package/build/plugins/resource/bot/question.js +20 -2
- package/build/plugins/resource/bot/question.js.map +1 -1
- package/build/plugins/resource/bot/resources/messages.d.ts +2 -0
- package/build/plugins/resource/bot/resources/messages.d.ts.map +1 -1
- package/build/plugins/resource/bot/resources/messages.js +8 -0
- package/build/plugins/resource/bot/resources/messages.js.map +1 -1
- package/build/plugins/resource/bot/utils/common.d.ts +1 -0
- package/build/plugins/resource/bot/utils/common.d.ts.map +1 -1
- package/build/plugins/resource/bot/utils/common.js +5 -1
- package/build/plugins/resource/bot/utils/common.js.map +1 -1
- package/build/plugins/resource/bot/utils/zipDeploy.js +1 -1
- package/build/plugins/resource/bot/utils/zipDeploy.js.map +1 -1
- package/build/plugins/resource/bot/v3/index.d.ts.map +1 -1
- package/build/plugins/resource/bot/v3/index.js +2 -1
- package/build/plugins/resource/bot/v3/index.js.map +1 -1
- package/build/plugins/resource/frontend/constants.d.ts +4 -0
- package/build/plugins/resource/frontend/constants.d.ts.map +1 -1
- package/build/plugins/resource/frontend/constants.js +6 -2
- package/build/plugins/resource/frontend/constants.js.map +1 -1
- package/build/plugins/resource/frontend/dotnet/plugin.js +1 -1
- package/build/plugins/resource/frontend/dotnet/plugin.js.map +1 -1
- package/build/plugins/resource/frontend/env.js +2 -2
- package/build/plugins/resource/frontend/env.js.map +1 -1
- package/build/plugins/resource/frontend/ops/deploy.d.ts +3 -5
- package/build/plugins/resource/frontend/ops/deploy.d.ts.map +1 -1
- package/build/plugins/resource/frontend/ops/deploy.js +41 -7
- package/build/plugins/resource/frontend/ops/deploy.js.map +1 -1
- package/build/plugins/resource/frontend/plugin.d.ts.map +1 -1
- package/build/plugins/resource/frontend/plugin.js +5 -6
- package/build/plugins/resource/frontend/plugin.js.map +1 -1
- package/build/plugins/resource/frontend/resources/errors.d.ts +1 -1
- package/build/plugins/resource/frontend/resources/errors.d.ts.map +1 -1
- package/build/plugins/resource/frontend/resources/errors.js +4 -4
- package/build/plugins/resource/frontend/resources/errors.js.map +1 -1
- package/build/plugins/resource/frontend/resources/templateInfo.js +1 -1
- package/build/plugins/resource/frontend/resources/templateInfo.js.map +1 -1
- package/build/plugins/resource/frontend/utils/progress-helper.d.ts +2 -2
- package/build/plugins/resource/frontend/utils/progress-helper.d.ts.map +1 -1
- package/build/plugins/resource/frontend/utils/progress-helper.js +4 -4
- package/build/plugins/resource/frontend/utils/progress-helper.js.map +1 -1
- package/build/plugins/resource/frontend/v3/index.d.ts.map +1 -1
- package/build/plugins/resource/frontend/v3/index.js +10 -13
- package/build/plugins/resource/frontend/v3/index.js.map +1 -1
- package/build/plugins/resource/spfx/depsChecker/yoChecker.d.ts.map +1 -1
- package/build/plugins/resource/spfx/depsChecker/yoChecker.js +6 -0
- package/build/plugins/resource/spfx/depsChecker/yoChecker.js.map +1 -1
- package/build/plugins/resource/spfx/index.d.ts.map +1 -1
- package/build/plugins/resource/spfx/index.js +0 -5
- package/build/plugins/resource/spfx/index.js.map +1 -1
- package/build/plugins/resource/spfx/plugin.d.ts.map +1 -1
- package/build/plugins/resource/spfx/plugin.js +59 -133
- package/build/plugins/resource/spfx/plugin.js.map +1 -1
- package/build/plugins/resource/spfx/utils/questions.d.ts.map +1 -1
- package/build/plugins/resource/spfx/utils/questions.js +5 -11
- package/build/plugins/resource/spfx/utils/questions.js.map +1 -1
- package/build/plugins/resource/sql/constants.d.ts +2 -4
- package/build/plugins/resource/sql/constants.d.ts.map +1 -1
- package/build/plugins/resource/sql/constants.js +2 -4
- package/build/plugins/resource/sql/constants.js.map +1 -1
- package/build/plugins/resource/sql/errors.d.ts.map +1 -1
- package/build/plugins/resource/sql/errors.js +29 -29
- package/build/plugins/resource/sql/errors.js.map +1 -1
- package/build/plugins/resource/sql/index.d.ts.map +1 -1
- package/build/plugins/resource/sql/index.js +1 -1
- package/build/plugins/resource/sql/index.js.map +1 -1
- package/build/plugins/resource/sql/plugin.d.ts.map +1 -1
- package/build/plugins/resource/sql/plugin.js +24 -11
- package/build/plugins/resource/sql/plugin.js.map +1 -1
- package/build/plugins/resource/sql/sqlClient.d.ts.map +1 -1
- package/build/plugins/resource/sql/sqlClient.js +7 -10
- package/build/plugins/resource/sql/sqlClient.js.map +1 -1
- package/build/plugins/resource/sql/utils/dialogUtils.d.ts +0 -1
- package/build/plugins/resource/sql/utils/dialogUtils.d.ts.map +1 -1
- package/build/plugins/resource/sql/utils/dialogUtils.js +0 -1
- package/build/plugins/resource/sql/utils/dialogUtils.js.map +1 -1
- package/build/plugins/solution/fx-solution/arm.d.ts.map +1 -1
- package/build/plugins/solution/fx-solution/arm.js +15 -9
- package/build/plugins/solution/fx-solution/arm.js.map +1 -1
- package/build/plugins/solution/fx-solution/commonQuestions.js +1 -1
- package/build/plugins/solution/fx-solution/commonQuestions.js.map +1 -1
- package/build/plugins/solution/fx-solution/constants.d.ts +19 -2
- package/build/plugins/solution/fx-solution/constants.d.ts.map +1 -1
- package/build/plugins/solution/fx-solution/constants.js +22 -1
- package/build/plugins/solution/fx-solution/constants.js.map +1 -1
- package/build/plugins/solution/fx-solution/debug/util/launch.d.ts.map +1 -1
- package/build/plugins/solution/fx-solution/debug/util/launch.js +1 -46
- package/build/plugins/solution/fx-solution/debug/util/launch.js.map +1 -1
- package/build/plugins/solution/fx-solution/debug/util/launchNext.d.ts.map +1 -1
- package/build/plugins/solution/fx-solution/debug/util/launchNext.js +0 -26
- package/build/plugins/solution/fx-solution/debug/util/launchNext.js.map +1 -1
- package/build/plugins/solution/fx-solution/debug/util/tasksNext.js +1 -1
- package/build/plugins/solution/fx-solution/debug/util/tasksNext.js.map +1 -1
- package/build/plugins/solution/fx-solution/index.d.ts +1 -0
- package/build/plugins/solution/fx-solution/index.d.ts.map +1 -1
- package/build/plugins/solution/fx-solution/index.js +1 -0
- package/build/plugins/solution/fx-solution/index.js.map +1 -1
- package/build/plugins/solution/fx-solution/question.d.ts +8 -3
- package/build/plugins/solution/fx-solution/question.d.ts.map +1 -1
- package/build/plugins/solution/fx-solution/question.js +70 -29
- package/build/plugins/solution/fx-solution/question.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 +31 -8
- package/build/plugins/solution/fx-solution/v2/deploy.js.map +1 -1
- package/build/plugins/solution/fx-solution/v2/executeUserTask.d.ts +2 -1
- package/build/plugins/solution/fx-solution/v2/executeUserTask.d.ts.map +1 -1
- package/build/plugins/solution/fx-solution/v2/executeUserTask.js +160 -95
- package/build/plugins/solution/fx-solution/v2/executeUserTask.js.map +1 -1
- package/build/plugins/solution/fx-solution/v2/getQuestions.d.ts.map +1 -1
- package/build/plugins/solution/fx-solution/v2/getQuestions.js +123 -65
- 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 +22 -9
- package/build/plugins/solution/fx-solution/v2/provision.js.map +1 -1
- package/build/plugins/solution/fx-solution/v2/utils.d.ts.map +1 -1
- package/build/plugins/solution/fx-solution/v2/utils.js +9 -1
- package/build/plugins/solution/fx-solution/v2/utils.js.map +1 -1
- package/build/plugins/solution/fx-solution/v3/provision.d.ts +1 -0
- package/build/plugins/solution/fx-solution/v3/provision.d.ts.map +1 -1
- package/build/plugins/solution/fx-solution/v3/provision.js +18 -1
- package/build/plugins/solution/fx-solution/v3/provision.js.map +1 -1
- package/package.json +5 -4
- package/resource/aad-manifest-change-logs.md +27 -0
- package/resource/package.nls.json +150 -72
- package/resource/unify-config-change-logs.md +26 -0
- package/templates/core/README.md +46 -0
- package/templates/fallback/blazor-base.csharp.default.zip +0 -0
- package/templates/fallback/bot.csharp.default.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 +17 -0
- package/templates/plugins/resource/aad/auth/bot/js/public/auth-end.html +65 -0
- package/templates/plugins/resource/aad/auth/bot/js/public/auth-start.html +177 -0
- package/templates/plugins/resource/aad/auth/bot/js/sso/showUserInfo.js +23 -0
- package/templates/plugins/resource/aad/auth/bot/js/sso/ssoDialog.js +176 -0
- package/templates/plugins/resource/aad/auth/bot/js/sso/teamsSsoBot.js +57 -0
- package/templates/plugins/resource/aad/auth/bot/ts/public/auth-end.html +65 -0
- package/templates/plugins/resource/aad/auth/bot/ts/public/auth-start.html +177 -0
- package/templates/plugins/resource/aad/auth/bot/ts/sso/showUserInfo.ts +24 -0
- package/templates/plugins/resource/aad/auth/bot/ts/sso/ssoDialog.ts +182 -0
- package/templates/plugins/resource/aad/auth/bot/ts/sso/teamsSsoBot.ts +69 -0
- package/templates/plugins/resource/aad/auth/tab/README.md +15 -0
- package/templates/plugins/resource/aad/auth/tab/js/public/auth-end.html +58 -0
- package/templates/plugins/resource/aad/auth/tab/js/public/auth-start.html +57 -0
- package/templates/plugins/resource/aad/auth/tab/js/sso/GetUserProfile.jsx +34 -0
- package/templates/plugins/resource/aad/auth/tab/ts/public/auth-end.html +58 -0
- package/templates/plugins/resource/aad/auth/tab/ts/public/auth-start.html +57 -0
- package/templates/plugins/resource/aad/auth/tab/ts/sso/GetUserProfile.tsx +34 -0
- package/templates/plugins/resource/aad/manifest/aad.template.json +1 -14
- package/templates/plugins/resource/apiconnector/package.json +5 -0
- package/templates/plugins/resource/apiconnector/sample/footerComment.template +20 -0
- package/templates/plugins/resource/apiconnector/sample/headerComment.template +28 -0
- package/templates/plugins/resource/apiconnector/sample/js/aad.template +26 -0
- package/templates/plugins/resource/apiconnector/sample/js/apikey.template +19 -0
- package/templates/plugins/resource/apiconnector/sample/js/basic.template +14 -0
- package/templates/plugins/resource/apiconnector/sample/js/cert.template +15 -0
- package/templates/plugins/resource/apiconnector/sample/js/custom.template +39 -0
- package/templates/plugins/resource/apiconnector/sample/ts/aad.template +31 -0
- package/templates/plugins/resource/apiconnector/sample/ts/apikey.template +16 -0
- package/templates/plugins/resource/apiconnector/sample/ts/basic.template +14 -0
- package/templates/plugins/resource/apiconnector/sample/ts/cert.template +17 -0
- package/templates/plugins/resource/apiconnector/sample/ts/custom.template +42 -0
- package/templates/plugins/resource/bot/bicep/botProvision.template.bicep +9 -0
- package/templates/plugins/resource/bot/bicep/funcHostedBotProvision.template.bicep +2 -0
- package/templates/plugins/resource/function/bicep/functionProvision.template.bicep +2 -0
- package/templates/plugins/resource/simpleauth/bicep/simpleAuthProvision.template.bicep +4 -0
- package/templates/plugins/resource/spfx/solution/README.md +3 -3
- package/templates/plugins/resource/webapp/bicep/webappProvision.template.bicep +2 -0
- package/templates/plugins/solution/v1/README.md +1 -1
- package/templates/core/README-auto-generated.md +0 -31
- package/templates/fallback/bot-msgext.csharp.default.zip +0 -0
- package/templates/fallback/bot-msgext.js.default.zip +0 -0
- package/templates/fallback/bot-msgext.ts.default.zip +0 -0
- package/templates/fallback/msgext.js.default.zip +0 -0
- package/templates/fallback/msgext.ts.default.zip +0 -0
- package/templates/plugins/resource/apiconnector/sample/js/api-connector.template +0 -30
- package/templates/plugins/resource/apiconnector/sample/ts/api-connector.template +0 -30
- package/templates/plugins/resource/spfx/solution/_gitignore +0 -33
- package/templates/plugins/resource/spfx/solution/config/config.json +0 -19
- package/templates/plugins/resource/spfx/solution/config/copy-assets.json +0 -4
- package/templates/plugins/resource/spfx/solution/config/deploy-azure-storage.json +0 -7
- package/templates/plugins/resource/spfx/solution/config/package-solution.json +0 -21
- package/templates/plugins/resource/spfx/solution/config/serve.json +0 -10
- package/templates/plugins/resource/spfx/solution/config/write-manifests.json +0 -4
- package/templates/plugins/resource/spfx/solution/gulpfile.js +0 -16
- package/templates/plugins/resource/spfx/solution/manifest.json +0 -62
- package/templates/plugins/resource/spfx/solution/src/index.ts +0 -1
- package/templates/plugins/resource/spfx/solution/tsconfig.json +0 -35
- package/templates/plugins/resource/spfx/solution/tslint.json +0 -30
- package/templates/plugins/resource/spfx/webpart/base/images/color.png +0 -0
- package/templates/plugins/resource/spfx/webpart/base/images/outline.png +0 -0
- package/templates/plugins/resource/spfx/webpart/base/loc/en-us.js +0 -7
- package/templates/plugins/resource/spfx/webpart/base/loc/mystrings.d.ts +0 -10
- package/templates/plugins/resource/spfx/webpart/base/{componentClassName}.manifest.json +0 -27
- package/templates/plugins/resource/spfx/webpart/none/package.json +0 -28
- package/templates/plugins/resource/spfx/webpart/none/{componentClassName}.module.scss +0 -74
- package/templates/plugins/resource/spfx/webpart/none/{componentClassName}.ts +0 -61
- package/templates/plugins/resource/spfx/webpart/react/components/I{componentName}Props.ts +0 -3
- package/templates/plugins/resource/spfx/webpart/react/components/{componentName}.module.scss +0 -74
- package/templates/plugins/resource/spfx/webpart/react/components/{componentName}.tsx +0 -25
- package/templates/plugins/resource/spfx/webpart/react/package.json +0 -33
- package/templates/plugins/resource/spfx/webpart/react/{componentClassName}.ts +0 -60
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
# Embed Existing Web App
|
|
2
|
+
|
|
3
|
+
Embed existing web app is to bring your own static webpages and embed in Microsoft Teams.
|
|
4
|
+
|
|
5
|
+
## Get Started
|
|
6
|
+
|
|
7
|
+
Before run this app locally, make sure you have prepared the following prerequisites:
|
|
8
|
+
* An [M365 account for development](https://docs.microsoft.com/microsoftteams/platform/toolkit/accounts).
|
|
9
|
+
|
|
10
|
+
Also, make sure your own static webpages meets the [prerequisites](https://aka.ms/teamsfx-existing-tab#prerequisites) and launches locally.
|
|
11
|
+
|
|
12
|
+
Then, you can quickly start local preview via the environment tree view in Teams Toolkit, refer [Preview your Teams app](https://aka.ms/teamsfx-existing-tab#preview-your-teams-app) for more information.
|
|
13
|
+
|
|
14
|
+
## Develop
|
|
15
|
+
|
|
16
|
+
The following table lists all the scaffolded folder and files by Teams Toolkit:
|
|
17
|
+
|
|
18
|
+
| File name | Contents |
|
|
19
|
+
|- | -|
|
|
20
|
+
|`.fx/configs/config.local.json`| Configuration file for local environment |
|
|
21
|
+
|`.fx/configs/config.dev.json`| Configuration file for dev environment |
|
|
22
|
+
|`.fx/configs/projectSettings.json`| Global project settings, which apply to all environments |
|
|
23
|
+
|`templates/appPackage/manifest.template.json`|Teams app manifest template|
|
|
24
|
+
|`templates/appPackage/resources`|Teams app's icon referenced by manifest template|
|
|
25
|
+
|`.gitignore` | The git ignore file to exclude local files from TeamsFx project |
|
|
26
|
+
|
|
27
|
+
### Edit Teams App manifest
|
|
28
|
+
|
|
29
|
+
You can find the Teams app manifest in `templates/appPackage/manifest.template.json`.
|
|
30
|
+
|
|
31
|
+
The file contains template arguments with `{...}` statements which will be replaced at build time. You may add any extra properties or permissions you require to this file. See the [schema reference](https://docs.microsoft.com/microsoftteams/platform/resources/schema/manifest-schema) for more information.
|
|
32
|
+
|
|
33
|
+
## Deployment
|
|
34
|
+
|
|
35
|
+
Teams Toolkit can help provision new Teams app per different environments.
|
|
36
|
+
|
|
37
|
+
After provisioned, you can preview your app via the environment tree view in Teams Toolkit, refer [Preview your Teams app](https://aka.ms/teamsfx-existing-tab#preview-your-teams-app) for more information.
|
|
38
|
+
|
|
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
|
+
|
|
41
|
+
## Reference
|
|
42
|
+
|
|
43
|
+
* [Embed Existing Web App with Teams Toolkit](https://aka.ms/teamsfx-existing-tab)
|
|
44
|
+
* [Teams Toolkit and Step-by-step Documentations](https://docs.microsoft.com/microsoftteams/platform/toolkit/teams-toolkit-fundamentals)
|
|
45
|
+
* [Teams Toolkit CLI](https://docs.microsoft.com/microsoftteams/platform/toolkit/teamsfx-cli)
|
|
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
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
## How to enable SSO in TeamsFx Bot projects
|
|
2
|
+
|
|
3
|
+
This doc will show you how to add Single sign-on (SSO) feature to TeamsFx Bot projects. Note that this article is only for Teams Toolkit Visual Studio Code Extension version after x.x.x or TeamsFx CLI version after x.x.x.
|
|
4
|
+
|
|
5
|
+
*Note: This article is only for bot hosted on Azure App Service. Bot that hosted on Azure Function is not supported now.*
|
|
6
|
+
|
|
7
|
+
*Note: This article is only for TeamsFx projects by Javascript and Typescript. For Dotnet, please refer to ${help link}.*
|
|
8
|
+
|
|
9
|
+
For more detail about SSO, please refer to the [wiki](https://aka.ms/teamsfx-add-sso-readme#overview).
|
|
10
|
+
|
|
11
|
+
### What we have done in 'Add SSO' command
|
|
12
|
+
|
|
13
|
+
By triggering `Add SSO` command, we will help you to setup your project to enable SSO and create `auth/bot` folder with some code snippet. For detail, please refer to the [wiki](https://aka.ms/teamsfx-add-sso-readme#what-we-will-do-in-add-sso-command).
|
|
14
|
+
|
|
15
|
+
### What you need to do after triggering 'Add SSO' command
|
|
16
|
+
|
|
17
|
+
Please follow the [wiki](https://aka.ms/teamsfx-add-sso-readme#what-you-need-to-do-after-triggering-add-sso-command) to update your source code, provision Azure AD app and deploy latest code.
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
<html>
|
|
2
|
+
<head>
|
|
3
|
+
<title>Login End Page</title>
|
|
4
|
+
<meta charset="utf-8" />
|
|
5
|
+
</head>
|
|
6
|
+
|
|
7
|
+
<body>
|
|
8
|
+
<script
|
|
9
|
+
src="https://statics.teams.cdn.office.net/sdk/v1.6.0/js/MicrosoftTeams.min.js"
|
|
10
|
+
integrity="sha384-mhp2E+BLMiZLe7rDIzj19WjgXJeI32NkPvrvvZBrMi5IvWup/1NUfS5xuYN5S3VT"
|
|
11
|
+
crossorigin="anonymous"
|
|
12
|
+
></script>
|
|
13
|
+
<div id="divError"></div>
|
|
14
|
+
<script type="text/javascript">
|
|
15
|
+
microsoftTeams.initialize();
|
|
16
|
+
let hashParams = getHashParameters();
|
|
17
|
+
|
|
18
|
+
if (hashParams["error"]) {
|
|
19
|
+
// Authentication failed
|
|
20
|
+
handleAuthError(hashParams["error"], hashParams);
|
|
21
|
+
} else if (hashParams["code"]) {
|
|
22
|
+
// Get the stored state parameter and compare with incoming state
|
|
23
|
+
let expectedState = localStorage.getItem("state");
|
|
24
|
+
if (expectedState !== hashParams["state"]) {
|
|
25
|
+
// State does not match, report error
|
|
26
|
+
handleAuthError("StateDoesNotMatch", hashParams);
|
|
27
|
+
} else {
|
|
28
|
+
microsoftTeams.authentication.notifySuccess();
|
|
29
|
+
}
|
|
30
|
+
} else {
|
|
31
|
+
// Unexpected condition: hash does not contain error or access_token parameter
|
|
32
|
+
handleAuthError("UnexpectedFailure", hashParams);
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
// Parse hash parameters into key-value pairs
|
|
36
|
+
function getHashParameters() {
|
|
37
|
+
let hashParams = {};
|
|
38
|
+
location.hash
|
|
39
|
+
.substr(1)
|
|
40
|
+
.split("&")
|
|
41
|
+
.forEach(function (item) {
|
|
42
|
+
let s = item.split("="),
|
|
43
|
+
k = s[0],
|
|
44
|
+
v = s[1] && decodeURIComponent(s[1]);
|
|
45
|
+
hashParams[k] = v;
|
|
46
|
+
});
|
|
47
|
+
return hashParams;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
// Show error information
|
|
51
|
+
function handleAuthError(errorType, errorMessage) {
|
|
52
|
+
const err = JSON.stringify({
|
|
53
|
+
error: errorType,
|
|
54
|
+
message: JSON.stringify(errorMessage),
|
|
55
|
+
});
|
|
56
|
+
let para = document.createElement("p");
|
|
57
|
+
let node = document.createTextNode(err);
|
|
58
|
+
para.appendChild(node);
|
|
59
|
+
|
|
60
|
+
let element = document.getElementById("divError");
|
|
61
|
+
element.appendChild(para);
|
|
62
|
+
}
|
|
63
|
+
</script>
|
|
64
|
+
</body>
|
|
65
|
+
</html>
|
|
@@ -0,0 +1,177 @@
|
|
|
1
|
+
<!--This file is used during the Teams Bot authentication flow to assist with retrieval of the access token.-->
|
|
2
|
+
<!--If you're not familiar with this, do not alter or remove this file from your project.-->
|
|
3
|
+
<html>
|
|
4
|
+
<head>
|
|
5
|
+
<title>Login Start Page</title>
|
|
6
|
+
<meta charset="utf-8" />
|
|
7
|
+
</head>
|
|
8
|
+
|
|
9
|
+
<body>
|
|
10
|
+
<script type="text/javascript">
|
|
11
|
+
popUpSignInWindow();
|
|
12
|
+
|
|
13
|
+
async function popUpSignInWindow() {
|
|
14
|
+
// Generate random state string and store it, so we can verify it in the callback
|
|
15
|
+
let state = _guid();
|
|
16
|
+
localStorage.setItem("state", state);
|
|
17
|
+
localStorage.removeItem("codeVerifier");
|
|
18
|
+
var currentURL = new URL(window.location);
|
|
19
|
+
var clientId = currentURL.searchParams.get("clientId");
|
|
20
|
+
var tenantId = currentURL.searchParams.get("tenantId");
|
|
21
|
+
var loginHint = currentURL.searchParams.get("loginHint");
|
|
22
|
+
if (!loginHint) {
|
|
23
|
+
loginHint = "";
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
var scope = currentURL.searchParams.get("scope");
|
|
27
|
+
|
|
28
|
+
var originalCode = _guid();
|
|
29
|
+
var codeChallenge = await pkceChallengeFromVerifier(originalCode);
|
|
30
|
+
|
|
31
|
+
localStorage.setItem("codeVerifier", originalCode);
|
|
32
|
+
let queryParams = {
|
|
33
|
+
client_id: clientId,
|
|
34
|
+
response_type: "code",
|
|
35
|
+
response_mode: "fragment",
|
|
36
|
+
scope: scope,
|
|
37
|
+
redirect_uri: window.location.origin + "/auth-end.html",
|
|
38
|
+
nonce: _guid(),
|
|
39
|
+
login_hint: loginHint,
|
|
40
|
+
state: state,
|
|
41
|
+
code_challenge: codeChallenge,
|
|
42
|
+
code_challenge_method: "S256",
|
|
43
|
+
};
|
|
44
|
+
|
|
45
|
+
let authorizeEndpoint = `https://login.microsoftonline.com/${tenantId}/oauth2/v2.0/authorize?${toQueryString(
|
|
46
|
+
queryParams
|
|
47
|
+
)}`;
|
|
48
|
+
window.location.assign(authorizeEndpoint);
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
// Build query string from map of query parameter
|
|
52
|
+
function toQueryString(queryParams) {
|
|
53
|
+
let encodedQueryParams = [];
|
|
54
|
+
for (let key in queryParams) {
|
|
55
|
+
encodedQueryParams.push(key + "=" + encodeURIComponent(queryParams[key]));
|
|
56
|
+
}
|
|
57
|
+
return encodedQueryParams.join("&");
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
// Converts decimal to hex equivalent
|
|
61
|
+
// (From ADAL.js: https://github.com/AzureAD/azure-activedirectory-library-for-js/blob/dev/lib/adal.js)
|
|
62
|
+
function _decimalToHex(number) {
|
|
63
|
+
var hex = number.toString(16);
|
|
64
|
+
while (hex.length < 2) {
|
|
65
|
+
hex = "0" + hex;
|
|
66
|
+
}
|
|
67
|
+
return hex;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
// Generates RFC4122 version 4 guid (128 bits)
|
|
71
|
+
// (From ADAL.js: https://github.com/AzureAD/azure-activedirectory-library-for-js/blob/dev/lib/adal.js)
|
|
72
|
+
function _guid() {
|
|
73
|
+
// RFC4122: The version 4 UUID is meant for generating UUIDs from truly-random or
|
|
74
|
+
// pseudo-random numbers.
|
|
75
|
+
// The algorithm is as follows:
|
|
76
|
+
// Set the two most significant bits (bits 6 and 7) of the
|
|
77
|
+
// clock_seq_hi_and_reserved to zero and one, respectively.
|
|
78
|
+
// Set the four most significant bits (bits 12 through 15) of the
|
|
79
|
+
// time_hi_and_version field to the 4-bit version number from
|
|
80
|
+
// Section 4.1.3. Version4
|
|
81
|
+
// Set all the other bits to randomly (or pseudo-randomly) chosen
|
|
82
|
+
// values.
|
|
83
|
+
// UUID = time-low "-" time-mid "-"time-high-and-version "-"clock-seq-reserved and low(2hexOctet)"-" node
|
|
84
|
+
// time-low = 4hexOctet
|
|
85
|
+
// time-mid = 2hexOctet
|
|
86
|
+
// time-high-and-version = 2hexOctet
|
|
87
|
+
// clock-seq-and-reserved = hexOctet:
|
|
88
|
+
// clock-seq-low = hexOctet
|
|
89
|
+
// node = 6hexOctet
|
|
90
|
+
// Format: xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx
|
|
91
|
+
// y could be 1000, 1001, 1010, 1011 since most significant two bits needs to be 10
|
|
92
|
+
// y values are 8, 9, A, B
|
|
93
|
+
var cryptoObj = window.crypto || window.msCrypto; // for IE 11
|
|
94
|
+
if (cryptoObj && cryptoObj.getRandomValues) {
|
|
95
|
+
var buffer = new Uint8Array(16);
|
|
96
|
+
cryptoObj.getRandomValues(buffer);
|
|
97
|
+
//buffer[6] and buffer[7] represents the time_hi_and_version field. We will set the four most significant bits (4 through 7) of buffer[6] to represent decimal number 4 (UUID version number).
|
|
98
|
+
buffer[6] |= 0x40; //buffer[6] | 01000000 will set the 6 bit to 1.
|
|
99
|
+
buffer[6] &= 0x4f; //buffer[6] & 01001111 will set the 4, 5, and 7 bit to 0 such that bits 4-7 == 0100 = "4".
|
|
100
|
+
//buffer[8] represents the clock_seq_hi_and_reserved field. We will set the two most significant bits (6 and 7) of the clock_seq_hi_and_reserved to zero and one, respectively.
|
|
101
|
+
buffer[8] |= 0x80; //buffer[8] | 10000000 will set the 7 bit to 1.
|
|
102
|
+
buffer[8] &= 0xbf; //buffer[8] & 10111111 will set the 6 bit to 0.
|
|
103
|
+
return (
|
|
104
|
+
_decimalToHex(buffer[0]) +
|
|
105
|
+
_decimalToHex(buffer[1]) +
|
|
106
|
+
_decimalToHex(buffer[2]) +
|
|
107
|
+
_decimalToHex(buffer[3]) +
|
|
108
|
+
"-" +
|
|
109
|
+
_decimalToHex(buffer[4]) +
|
|
110
|
+
_decimalToHex(buffer[5]) +
|
|
111
|
+
"-" +
|
|
112
|
+
_decimalToHex(buffer[6]) +
|
|
113
|
+
_decimalToHex(buffer[7]) +
|
|
114
|
+
"-" +
|
|
115
|
+
_decimalToHex(buffer[8]) +
|
|
116
|
+
_decimalToHex(buffer[9]) +
|
|
117
|
+
"-" +
|
|
118
|
+
_decimalToHex(buffer[10]) +
|
|
119
|
+
_decimalToHex(buffer[11]) +
|
|
120
|
+
_decimalToHex(buffer[12]) +
|
|
121
|
+
_decimalToHex(buffer[13]) +
|
|
122
|
+
_decimalToHex(buffer[14]) +
|
|
123
|
+
_decimalToHex(buffer[15])
|
|
124
|
+
);
|
|
125
|
+
} else {
|
|
126
|
+
var guidHolder = "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx";
|
|
127
|
+
var hex = "0123456789abcdef";
|
|
128
|
+
var r = 0;
|
|
129
|
+
var guidResponse = "";
|
|
130
|
+
for (var i = 0; i < 36; i++) {
|
|
131
|
+
if (guidHolder[i] !== "-" && guidHolder[i] !== "4") {
|
|
132
|
+
// each x and y needs to be random
|
|
133
|
+
r = (Math.random() * 16) | 0;
|
|
134
|
+
}
|
|
135
|
+
if (guidHolder[i] === "x") {
|
|
136
|
+
guidResponse += hex[r];
|
|
137
|
+
} else if (guidHolder[i] === "y") {
|
|
138
|
+
// clock-seq-and-reserved first hex is filtered and remaining hex values are random
|
|
139
|
+
r &= 0x3; // bit and with 0011 to set pos 2 to zero ?0??
|
|
140
|
+
r |= 0x8; // set pos 3 to 1 as 1???
|
|
141
|
+
guidResponse += hex[r];
|
|
142
|
+
} else {
|
|
143
|
+
guidResponse += guidHolder[i];
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
return guidResponse;
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
// Calculate the SHA256 hash of the input text.
|
|
151
|
+
// Returns a promise that resolves to an ArrayBuffer
|
|
152
|
+
function sha256(plain) {
|
|
153
|
+
const encoder = new TextEncoder();
|
|
154
|
+
const data = encoder.encode(plain);
|
|
155
|
+
return window.crypto.subtle.digest("SHA-256", data);
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
// Base64-urlencodes the input string
|
|
159
|
+
function base64urlencode(str) {
|
|
160
|
+
// Convert the ArrayBuffer to string using Uint8 array to convert to what btoa accepts.
|
|
161
|
+
// btoa accepts chars only within ascii 0-255 and base64 encodes them.
|
|
162
|
+
// Then convert the base64 encoded to base64url encoded
|
|
163
|
+
// (replace + with -, replace / with _, trim trailing =)
|
|
164
|
+
return btoa(String.fromCharCode.apply(null, new Uint8Array(str)))
|
|
165
|
+
.replace(/\+/g, "-")
|
|
166
|
+
.replace(/\//g, "_")
|
|
167
|
+
.replace(/=+$/, "");
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
// Return the base64-urlencoded sha256 hash for the PKCE challenge
|
|
171
|
+
async function pkceChallengeFromVerifier(v) {
|
|
172
|
+
hashed = await sha256(v);
|
|
173
|
+
return base64urlencode(hashed);
|
|
174
|
+
}
|
|
175
|
+
</script>
|
|
176
|
+
</body>
|
|
177
|
+
</html>
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
const { createMicrosoftGraphClient, TeamsFx } = require("@microsoft/teamsfx");
|
|
2
|
+
|
|
3
|
+
async function showUserInfo(context, ssoToken) {
|
|
4
|
+
await context.sendActivity("Retrieving user information from Microsoft Graph ...");
|
|
5
|
+
const teamsfx = new TeamsFx().setSsoToken(ssoToken);
|
|
6
|
+
const graphClient = createMicrosoftGraphClient(teamsfx, ["User.Read"]);
|
|
7
|
+
const me = await graphClient.api("/me").get();
|
|
8
|
+
if (me) {
|
|
9
|
+
await context.sendActivity(
|
|
10
|
+
`You're logged in as ${me.displayName} (${me.userPrincipalName})${
|
|
11
|
+
me.jobTitle ? `; your job title is: ${me.jobTitle}` : ""
|
|
12
|
+
}.`
|
|
13
|
+
);
|
|
14
|
+
} else {
|
|
15
|
+
await context.sendActivity("Could not retrieve profile information from Microsoft Graph.");
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
return;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
module.exports = {
|
|
22
|
+
showUserInfo,
|
|
23
|
+
};
|
|
@@ -0,0 +1,176 @@
|
|
|
1
|
+
const {
|
|
2
|
+
ComponentDialog,
|
|
3
|
+
WaterfallDialog,
|
|
4
|
+
Dialog,
|
|
5
|
+
DialogTurnResult,
|
|
6
|
+
DialogSet,
|
|
7
|
+
DialogTurnStatus,
|
|
8
|
+
} = require("botbuilder-dialogs");
|
|
9
|
+
const { ActivityTypes, tokenExchangeOperationName, TurnContext } = require("botbuilder");
|
|
10
|
+
const { TeamsBotSsoPrompt, TeamsFx } = require("@microsoft/teamsfx");
|
|
11
|
+
require("isomorphic-fetch");
|
|
12
|
+
|
|
13
|
+
const DIALOG_NAME = "SSODialog";
|
|
14
|
+
const TEAMS_SSO_PROMPT_ID = "TeamsFxSsoPrompt";
|
|
15
|
+
const COMMAND_ROUTE_DIALOG = "CommandRouteDialog";
|
|
16
|
+
|
|
17
|
+
class SsoDialog extends ComponentDialog {
|
|
18
|
+
constructor(dedupStorage, requiredScopes) {
|
|
19
|
+
super(DIALOG_NAME);
|
|
20
|
+
|
|
21
|
+
this.initialDialogId = COMMAND_ROUTE_DIALOG;
|
|
22
|
+
|
|
23
|
+
this.dedupStorage = dedupStorage;
|
|
24
|
+
this.dedupStorageKeys = [];
|
|
25
|
+
this.requiredScopes = requiredScopes;
|
|
26
|
+
this.commandMapping = new Map();
|
|
27
|
+
|
|
28
|
+
const teamsFx = new TeamsFx();
|
|
29
|
+
const ssoDialog = new TeamsBotSsoPrompt(teamsFx, TEAMS_SSO_PROMPT_ID, {
|
|
30
|
+
scopes: this.requiredScopes,
|
|
31
|
+
endOnInvalidMessage: true,
|
|
32
|
+
});
|
|
33
|
+
this.addDialog(ssoDialog);
|
|
34
|
+
|
|
35
|
+
const commandRouteDialog = new WaterfallDialog(COMMAND_ROUTE_DIALOG, [
|
|
36
|
+
this.commandRouteStep.bind(this),
|
|
37
|
+
]);
|
|
38
|
+
this.addDialog(commandRouteDialog);
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
addCommand(commandId, commandText, operation) {
|
|
42
|
+
const dialog = new WaterfallDialog(commandId, [
|
|
43
|
+
this.ssoStep.bind(this),
|
|
44
|
+
this.dedupStep.bind(this),
|
|
45
|
+
async (stepContext) => {
|
|
46
|
+
const tokenResponse = stepContext.result;
|
|
47
|
+
const context = stepContext.context;
|
|
48
|
+
if (tokenResponse) {
|
|
49
|
+
await operation(context, tokenResponse.ssoToken);
|
|
50
|
+
} else {
|
|
51
|
+
await context.sendActivity("Failed to retrieve user token from conversation context.");
|
|
52
|
+
}
|
|
53
|
+
return await stepContext.endDialog();
|
|
54
|
+
},
|
|
55
|
+
]);
|
|
56
|
+
|
|
57
|
+
if (this.commandMapping.has(commandId)) {
|
|
58
|
+
throw new Error(`Cannot add command. There is already a command with same id ${commandId}`);
|
|
59
|
+
}
|
|
60
|
+
this.commandMapping.set(commandId, commandText);
|
|
61
|
+
this.addDialog(dialog);
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
/**
|
|
65
|
+
* The run method handles the incoming activity (in the form of a DialogContext) and passes it through the dialog system.
|
|
66
|
+
* If no dialog is active, it will start the default dialog.
|
|
67
|
+
* @param {*} dialogContext
|
|
68
|
+
*/
|
|
69
|
+
async run(context, accessor) {
|
|
70
|
+
const dialogSet = new DialogSet(accessor);
|
|
71
|
+
dialogSet.add(this);
|
|
72
|
+
|
|
73
|
+
const dialogContext = await dialogSet.createContext(context);
|
|
74
|
+
const results = await dialogContext.continueDialog();
|
|
75
|
+
if (results && results.status === DialogTurnStatus.empty) {
|
|
76
|
+
await dialogContext.beginDialog(this.id);
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
async commandRouteStep(stepContext) {
|
|
81
|
+
const turnContext = stepContext.context;
|
|
82
|
+
|
|
83
|
+
// remove the mention of this bot
|
|
84
|
+
let text = TurnContext.removeRecipientMention(turnContext.activity);
|
|
85
|
+
if (text) {
|
|
86
|
+
// remove the line break
|
|
87
|
+
text = text.toLowerCase().replace(/\n|\r/g, "").trim();
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
const commandId = this.matchCommands(text);
|
|
91
|
+
if (commandId) {
|
|
92
|
+
return await stepContext.beginDialog(commandId);
|
|
93
|
+
}
|
|
94
|
+
return await stepContext.endDialog();
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
async ssoStep(stepContext) {
|
|
98
|
+
return await stepContext.beginDialog(TEAMS_SSO_PROMPT_ID);
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
async dedupStep(stepContext) {
|
|
102
|
+
const tokenResponse = stepContext.result;
|
|
103
|
+
// Only dedup after ssoStep to make sure that all Teams client would receive the login request
|
|
104
|
+
if (tokenResponse && (await this.shouldDedup(stepContext.context))) {
|
|
105
|
+
return Dialog.EndOfTurn;
|
|
106
|
+
}
|
|
107
|
+
return await stepContext.next(tokenResponse);
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
async onEndDialog(context) {
|
|
111
|
+
const conversationId = context.activity.conversation.id;
|
|
112
|
+
const currentDedupKeys = this.dedupStorageKeys.filter((key) => key.indexOf(conversationId) > 0);
|
|
113
|
+
await this.dedupStorage.delete(currentDedupKeys);
|
|
114
|
+
this.dedupStorageKeys = this.dedupStorageKeys.filter((key) => key.indexOf(conversationId) < 0);
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
// If a user is signed into multiple Teams clients, the Bot might receive a "signin/tokenExchange" from each client.
|
|
118
|
+
// Each token exchange request for a specific user login will have an identical activity.value.Id.
|
|
119
|
+
// Only one of these token exchange requests should be processed by the bot. For a distributed bot in production,
|
|
120
|
+
// this requires a distributed storage to ensure only one token exchange is processed.
|
|
121
|
+
async shouldDedup(context) {
|
|
122
|
+
const storeItem = {
|
|
123
|
+
eTag: context.activity.value.id,
|
|
124
|
+
};
|
|
125
|
+
|
|
126
|
+
const key = this.getStorageKey(context);
|
|
127
|
+
const storeItems = { [key]: storeItem };
|
|
128
|
+
|
|
129
|
+
try {
|
|
130
|
+
await this.dedupStorage.write(storeItems);
|
|
131
|
+
this.dedupStorageKeys.push(key);
|
|
132
|
+
} catch (err) {
|
|
133
|
+
if (err instanceof Error && err.message.indexOf("eTag conflict")) {
|
|
134
|
+
return true;
|
|
135
|
+
}
|
|
136
|
+
throw err;
|
|
137
|
+
}
|
|
138
|
+
return false;
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
getStorageKey(context) {
|
|
142
|
+
if (!context || !context.activity || !context.activity.conversation) {
|
|
143
|
+
throw new Error("Invalid context, can not get storage key!");
|
|
144
|
+
}
|
|
145
|
+
const activity = context.activity;
|
|
146
|
+
const channelId = activity.channelId;
|
|
147
|
+
const conversationId = activity.conversation.id;
|
|
148
|
+
if (activity.type !== ActivityTypes.Invoke || activity.name !== tokenExchangeOperationName) {
|
|
149
|
+
throw new Error("TokenExchangeState can only be used with Invokes of signin/tokenExchange.");
|
|
150
|
+
}
|
|
151
|
+
const value = activity.value;
|
|
152
|
+
if (!value || !value.id) {
|
|
153
|
+
throw new Error("Invalid signin/tokenExchange. Missing activity.value.id.");
|
|
154
|
+
}
|
|
155
|
+
return `${channelId}/${conversationId}/${value.id}`;
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
matchCommands(text) {
|
|
159
|
+
for (const command of this.commandMapping) {
|
|
160
|
+
const pattern = command[1];
|
|
161
|
+
let matchResult;
|
|
162
|
+
if (typeof pattern == "string") {
|
|
163
|
+
matchResult = text === pattern;
|
|
164
|
+
} else {
|
|
165
|
+
matchResult = pattern.exec(text);
|
|
166
|
+
}
|
|
167
|
+
if (matchResult) {
|
|
168
|
+
return command[0]; // Return the command id
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
return undefined;
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
exports.SsoDialog = SsoDialog;
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
const { ConversationState, MemoryStorage, TeamsActivityHandler, UserState } = require("botbuilder");
|
|
2
|
+
const { showUserInfo } = require("./showUserInfo");
|
|
3
|
+
const { SsoDialog } = require("./ssoDialog");
|
|
4
|
+
|
|
5
|
+
class TeamsSsoBot extends TeamsActivityHandler {
|
|
6
|
+
constructor() {
|
|
7
|
+
super();
|
|
8
|
+
|
|
9
|
+
// Define the state store for your bot.
|
|
10
|
+
// See https://aka.ms/about-bot-state to learn more about using MemoryStorage.
|
|
11
|
+
// A bot requires a state storage system to persist the dialog and user state between messages.
|
|
12
|
+
const memoryStorage = new MemoryStorage();
|
|
13
|
+
|
|
14
|
+
// Create conversation and user state with in-memory storage provider.
|
|
15
|
+
this.conversationState = new ConversationState(memoryStorage);
|
|
16
|
+
this.userState = new UserState(memoryStorage);
|
|
17
|
+
this.dialog = new SsoDialog(new MemoryStorage(), ["User.Read"]);
|
|
18
|
+
this.dialogState = this.conversationState.createProperty("DialogState");
|
|
19
|
+
|
|
20
|
+
// Add commands that requires user authentication
|
|
21
|
+
this.dialog.addCommand("ShowUserProfile", "show", showUserInfo);
|
|
22
|
+
// call the `addCommand` function to add more customized commands
|
|
23
|
+
|
|
24
|
+
this.onMessage(async (context, next) => {
|
|
25
|
+
console.log("Running with Message Activity.");
|
|
26
|
+
|
|
27
|
+
// Run the Dialog with the new message Activity.
|
|
28
|
+
await this.dialog.run(context, this.dialogState);
|
|
29
|
+
|
|
30
|
+
// By calling next() you ensure that the next BotHandler is run.
|
|
31
|
+
await next();
|
|
32
|
+
});
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
async run(context) {
|
|
36
|
+
await super.run(context);
|
|
37
|
+
|
|
38
|
+
// Save any state changes. The load happened during the execution of the Dialog.
|
|
39
|
+
await this.conversationState.saveChanges(context, false);
|
|
40
|
+
await this.userState.saveChanges(context, false);
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
async handleTeamsSigninVerifyState(context, query) {
|
|
44
|
+
console.log("Running dialog with signin/verifystate from an Invoke Activity.");
|
|
45
|
+
await this.dialog.run(context, this.dialogState);
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
async handleTeamsSigninTokenExchange(context, query) {
|
|
49
|
+
await this.dialog.run(context, this.dialogState);
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
async onSignInInvoke(context) {
|
|
53
|
+
await this.dialog.run(context, this.dialogState);
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
exports.TeamsSsoBot = TeamsSsoBot;
|