@microsoft/teamsfx-core 1.6.1 → 1.6.2-alpha.eb3c5cc12.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/common/constants.d.ts +3 -0
- package/build/common/constants.d.ts.map +1 -1
- package/build/common/constants.js +3 -0
- package/build/common/constants.js.map +1 -1
- package/build/common/local/localEnvManager.d.ts +5 -2
- package/build/common/local/localEnvManager.d.ts.map +1 -1
- package/build/common/local/localEnvManager.js +16 -2
- package/build/common/local/localEnvManager.js.map +1 -1
- package/build/common/local/localStateHelper.d.ts +3 -0
- package/build/common/local/localStateHelper.d.ts.map +1 -0
- package/build/common/local/localStateHelper.js +133 -0
- package/build/common/local/localStateHelper.js.map +1 -0
- package/build/common/local/taskDefinition.d.ts +3 -0
- package/build/common/local/taskDefinition.d.ts.map +1 -1
- package/build/common/local/taskDefinition.js +36 -0
- package/build/common/local/taskDefinition.js.map +1 -1
- package/build/common/localStateConstants.d.ts +39 -0
- package/build/common/localStateConstants.d.ts.map +1 -0
- package/build/common/localStateConstants.js +44 -0
- package/build/common/localStateConstants.js.map +1 -0
- package/build/common/localStateProvider.d.ts +7 -0
- package/build/common/localStateProvider.d.ts.map +1 -0
- package/build/common/localStateProvider.js +28 -0
- package/build/common/localStateProvider.js.map +1 -0
- package/build/common/projectSettingsHelper.d.ts.map +1 -1
- package/build/common/projectSettingsHelper.js +2 -0
- package/build/common/projectSettingsHelper.js.map +1 -1
- package/build/common/samples-config.json +2 -2
- package/build/common/telemetry.d.ts +17 -0
- package/build/common/telemetry.d.ts.map +1 -1
- package/build/common/telemetry.js +17 -0
- package/build/common/telemetry.js.map +1 -1
- package/build/common/template-utils/templatesActions.d.ts +2 -2
- package/build/common/template-utils/templatesActions.d.ts.map +1 -1
- package/build/common/template-utils/templatesActions.js +6 -6
- package/build/common/template-utils/templatesActions.js.map +1 -1
- package/build/common/templates-config.json +4 -3
- package/build/common/tools.d.ts +4 -0
- package/build/common/tools.d.ts.map +1 -1
- package/build/common/tools.js +27 -1
- package/build/common/tools.js.map +1 -1
- package/build/core/FxCore.d.ts +2 -0
- package/build/core/FxCore.d.ts.map +1 -1
- package/build/core/FxCore.js +104 -6
- package/build/core/FxCore.js.map +1 -1
- package/build/core/environment.d.ts +1 -0
- package/build/core/environment.d.ts.map +1 -1
- package/build/core/environment.js +9 -2
- package/build/core/environment.js.map +1 -1
- package/build/core/error.d.ts +4 -0
- package/build/core/error.d.ts.map +1 -1
- package/build/core/error.js +17 -1
- package/build/core/error.js.map +1 -1
- package/build/core/globalVars.d.ts +4 -0
- package/build/core/globalVars.d.ts.map +1 -1
- package/build/core/globalVars.js +5 -1
- package/build/core/globalVars.js.map +1 -1
- package/build/core/middleware/consolidateLocalRemote.d.ts +3 -0
- package/build/core/middleware/consolidateLocalRemote.d.ts.map +1 -0
- package/build/core/middleware/consolidateLocalRemote.js +203 -0
- package/build/core/middleware/consolidateLocalRemote.js.map +1 -0
- package/build/core/middleware/envInfoLoader.d.ts.map +1 -1
- package/build/core/middleware/envInfoLoader.js +6 -14
- package/build/core/middleware/envInfoLoader.js.map +1 -1
- package/build/core/middleware/envInfoWriter.d.ts.map +1 -1
- package/build/core/middleware/envInfoWriter.js +6 -0
- package/build/core/middleware/envInfoWriter.js.map +1 -1
- package/build/core/middleware/projectMigrator.d.ts +3 -0
- package/build/core/middleware/projectMigrator.d.ts.map +1 -1
- package/build/core/middleware/projectMigrator.js +3 -1
- package/build/core/middleware/projectMigrator.js.map +1 -1
- package/build/core/middleware/questionModel.d.ts.map +1 -1
- package/build/core/middleware/questionModel.js +55 -1
- package/build/core/middleware/questionModel.js.map +1 -1
- package/build/core/question.d.ts +13 -2
- package/build/core/question.d.ts.map +1 -1
- package/build/core/question.js +153 -61
- package/build/core/question.js.map +1 -1
- package/build/plugins/resource/aad/aadAppClient.d.ts +4 -0
- package/build/plugins/resource/aad/aadAppClient.d.ts.map +1 -1
- package/build/plugins/resource/aad/aadAppClient.js +52 -0
- package/build/plugins/resource/aad/aadAppClient.js.map +1 -1
- package/build/plugins/resource/aad/aadAppManifestManager.d.ts +11 -0
- package/build/plugins/resource/aad/aadAppManifestManager.d.ts.map +1 -0
- package/build/plugins/resource/aad/aadAppManifestManager.js +117 -0
- package/build/plugins/resource/aad/aadAppManifestManager.js.map +1 -0
- package/build/plugins/resource/aad/constants.d.ts +13 -0
- package/build/plugins/resource/aad/constants.d.ts.map +1 -1
- package/build/plugins/resource/aad/constants.js +25 -0
- package/build/plugins/resource/aad/constants.js.map +1 -1
- package/build/plugins/resource/aad/errors.d.ts +21 -0
- package/build/plugins/resource/aad/errors.d.ts.map +1 -1
- package/build/plugins/resource/aad/errors.js +65 -1
- package/build/plugins/resource/aad/errors.js.map +1 -1
- package/build/plugins/resource/aad/index.d.ts +3 -0
- package/build/plugins/resource/aad/index.d.ts.map +1 -1
- package/build/plugins/resource/aad/index.js +9 -1
- package/build/plugins/resource/aad/index.js.map +1 -1
- package/build/plugins/resource/aad/interfaces/AADApplication.d.ts +2 -3
- package/build/plugins/resource/aad/interfaces/AADApplication.d.ts.map +1 -1
- package/build/plugins/resource/aad/interfaces/AADManifest.d.ts +2 -3
- package/build/plugins/resource/aad/interfaces/AADManifest.d.ts.map +1 -1
- package/build/plugins/resource/aad/permissions/index.d.ts +1 -0
- package/build/plugins/resource/aad/permissions/index.d.ts.map +1 -1
- package/build/plugins/resource/aad/permissions/index.js +27 -1
- package/build/plugins/resource/aad/permissions/index.js.map +1 -1
- package/build/plugins/resource/aad/permissions/permissions.json +1084 -204
- package/build/plugins/resource/aad/plugin.d.ts +6 -1
- package/build/plugins/resource/aad/plugin.d.ts.map +1 -1
- package/build/plugins/resource/aad/plugin.js +117 -20
- package/build/plugins/resource/aad/plugin.js.map +1 -1
- package/build/plugins/resource/aad/utils/aadManifestHelper.d.ts +2 -0
- package/build/plugins/resource/aad/utils/aadManifestHelper.d.ts.map +1 -1
- package/build/plugins/resource/aad/utils/aadManifestHelper.js +84 -8
- package/build/plugins/resource/aad/utils/aadManifestHelper.js.map +1 -1
- package/build/plugins/resource/aad/utils/configs.d.ts +3 -1
- package/build/plugins/resource/aad/utils/configs.d.ts.map +1 -1
- package/build/plugins/resource/aad/utils/configs.js +2 -2
- package/build/plugins/resource/aad/utils/configs.js.map +1 -1
- package/build/plugins/resource/aad/v2/index.d.ts +3 -1
- package/build/plugins/resource/aad/v2/index.d.ts.map +1 -1
- package/build/plugins/resource/aad/v2/index.js +6 -0
- package/build/plugins/resource/aad/v2/index.js.map +1 -1
- package/build/plugins/resource/apiconnector/constants.d.ts +25 -0
- package/build/plugins/resource/apiconnector/constants.d.ts.map +1 -0
- package/build/plugins/resource/apiconnector/constants.js +34 -0
- package/build/plugins/resource/apiconnector/constants.js.map +1 -0
- package/build/plugins/resource/apiconnector/envHandler.d.ts +19 -0
- package/build/plugins/resource/apiconnector/envHandler.d.ts.map +1 -0
- package/build/plugins/resource/apiconnector/envHandler.js +97 -0
- package/build/plugins/resource/apiconnector/envHandler.js.map +1 -0
- package/build/plugins/resource/apiconnector/errors.d.ts +35 -0
- package/build/plugins/resource/apiconnector/errors.d.ts.map +1 -0
- package/build/plugins/resource/apiconnector/errors.js +42 -0
- package/build/plugins/resource/apiconnector/errors.js.map +1 -0
- package/build/plugins/resource/apiconnector/index.d.ts +14 -0
- package/build/plugins/resource/apiconnector/index.d.ts.map +1 -0
- package/build/plugins/resource/apiconnector/index.js +43 -0
- package/build/plugins/resource/apiconnector/index.js.map +1 -0
- package/build/plugins/resource/apiconnector/plugin.d.ts +11 -0
- package/build/plugins/resource/apiconnector/plugin.d.ts.map +1 -0
- package/build/plugins/resource/apiconnector/plugin.js +101 -0
- package/build/plugins/resource/apiconnector/plugin.js.map +1 -0
- package/build/plugins/resource/apiconnector/questions.d.ts +13 -0
- package/build/plugins/resource/apiconnector/questions.d.ts.map +1 -0
- package/build/plugins/resource/apiconnector/questions.js +63 -0
- package/build/plugins/resource/apiconnector/questions.js.map +1 -0
- package/build/plugins/resource/apiconnector/result.d.ts +9 -0
- package/build/plugins/resource/apiconnector/result.d.ts.map +1 -0
- package/build/plugins/resource/apiconnector/result.js +21 -0
- package/build/plugins/resource/apiconnector/result.js.map +1 -0
- package/build/plugins/resource/apiconnector/sampleHandler.d.ts +10 -0
- package/build/plugins/resource/apiconnector/sampleHandler.d.ts.map +1 -0
- package/build/plugins/resource/apiconnector/sampleHandler.js +47 -0
- package/build/plugins/resource/apiconnector/sampleHandler.js.map +1 -0
- package/build/plugins/resource/apiconnector/utils.d.ts +22 -0
- package/build/plugins/resource/apiconnector/utils.d.ts.map +1 -0
- package/build/plugins/resource/apiconnector/utils.js +21 -0
- package/build/plugins/resource/apiconnector/utils.js.map +1 -0
- package/build/plugins/resource/appstudio/constants.d.ts +4 -0
- package/build/plugins/resource/appstudio/constants.d.ts.map +1 -1
- package/build/plugins/resource/appstudio/constants.js +30 -1
- package/build/plugins/resource/appstudio/constants.js.map +1 -1
- package/build/plugins/resource/appstudio/manifestTemplate.d.ts.map +1 -1
- package/build/plugins/resource/appstudio/manifestTemplate.js +6 -0
- package/build/plugins/resource/appstudio/manifestTemplate.js.map +1 -1
- package/build/plugins/resource/appstudio/plugin.d.ts +2 -2
- package/build/plugins/resource/appstudio/plugin.d.ts.map +1 -1
- package/build/plugins/resource/appstudio/plugin.js +70 -16
- package/build/plugins/resource/appstudio/plugin.js.map +1 -1
- package/build/plugins/resource/appstudio/v3/index.d.ts +5 -1
- package/build/plugins/resource/appstudio/v3/index.d.ts.map +1 -1
- package/build/plugins/resource/appstudio/v3/index.js +24 -2
- package/build/plugins/resource/appstudio/v3/index.js.map +1 -1
- package/build/plugins/resource/bot/azureOps.d.ts +1 -1
- package/build/plugins/resource/bot/azureOps.d.ts.map +1 -1
- package/build/plugins/resource/bot/azureOps.js +12 -28
- 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/scaffoldConfig.d.ts +8 -4
- package/build/plugins/resource/bot/configs/scaffoldConfig.d.ts.map +1 -1
- package/build/plugins/resource/bot/configs/scaffoldConfig.js +40 -8
- package/build/plugins/resource/bot/configs/scaffoldConfig.js.map +1 -1
- package/build/plugins/resource/bot/configs/teamsBotConfig.d.ts +1 -1
- package/build/plugins/resource/bot/configs/teamsBotConfig.d.ts.map +1 -1
- package/build/plugins/resource/bot/configs/teamsBotConfig.js +15 -9
- package/build/plugins/resource/bot/configs/teamsBotConfig.js.map +1 -1
- package/build/plugins/resource/bot/constants.d.ts +6 -12
- package/build/plugins/resource/bot/constants.d.ts.map +1 -1
- package/build/plugins/resource/bot/constants.js +5 -11
- package/build/plugins/resource/bot/constants.js.map +1 -1
- package/build/plugins/resource/bot/enums/pluginActRoles.d.ts +2 -1
- package/build/plugins/resource/bot/enums/pluginActRoles.d.ts.map +1 -1
- package/build/plugins/resource/bot/enums/pluginActRoles.js +1 -0
- package/build/plugins/resource/bot/enums/pluginActRoles.js.map +1 -1
- package/build/plugins/resource/bot/errors.d.ts +3 -18
- package/build/plugins/resource/bot/errors.d.ts.map +1 -1
- package/build/plugins/resource/bot/errors.js +8 -38
- package/build/plugins/resource/bot/errors.js.map +1 -1
- package/build/plugins/resource/bot/functionsHostedBot/constants.d.ts +13 -0
- package/build/plugins/resource/bot/functionsHostedBot/constants.d.ts.map +1 -0
- package/build/plugins/resource/bot/functionsHostedBot/constants.js +20 -0
- package/build/plugins/resource/bot/functionsHostedBot/constants.js.map +1 -0
- package/build/plugins/resource/bot/functionsHostedBot/deployMgr.d.ts +18 -0
- package/build/plugins/resource/bot/functionsHostedBot/deployMgr.d.ts.map +1 -0
- package/build/plugins/resource/bot/functionsHostedBot/deployMgr.js +160 -0
- package/build/plugins/resource/bot/functionsHostedBot/deployMgr.js.map +1 -0
- package/build/plugins/resource/bot/functionsHostedBot/plugin.d.ts +2 -0
- package/build/plugins/resource/bot/functionsHostedBot/plugin.d.ts.map +1 -1
- package/build/plugins/resource/bot/functionsHostedBot/plugin.js +104 -2
- package/build/plugins/resource/bot/functionsHostedBot/plugin.js.map +1 -1
- package/build/plugins/resource/bot/index.d.ts +5 -2
- package/build/plugins/resource/bot/index.d.ts.map +1 -1
- package/build/plugins/resource/bot/index.js +10 -5
- 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 +4 -2
- package/build/plugins/resource/bot/languageStrategy.js.map +1 -1
- package/build/plugins/resource/bot/plugin.d.ts +2 -1
- package/build/plugins/resource/bot/plugin.d.ts.map +1 -1
- package/build/plugins/resource/bot/plugin.js +1 -1
- package/build/plugins/resource/bot/plugin.js.map +1 -1
- package/build/plugins/resource/bot/question.d.ts +4 -1
- package/build/plugins/resource/bot/question.d.ts.map +1 -1
- package/build/plugins/resource/bot/question.js +24 -7
- package/build/plugins/resource/bot/question.js.map +1 -1
- package/build/plugins/resource/bot/resources/messages.d.ts +1 -0
- package/build/plugins/resource/bot/resources/messages.d.ts.map +1 -1
- package/build/plugins/resource/bot/resources/messages.js +5 -1
- package/build/plugins/resource/bot/resources/messages.js.map +1 -1
- package/build/plugins/resource/bot/resources/strings.d.ts +10 -0
- package/build/plugins/resource/bot/resources/strings.d.ts.map +1 -1
- package/build/plugins/resource/bot/resources/strings.js +18 -1
- package/build/plugins/resource/bot/resources/strings.js.map +1 -1
- package/build/plugins/resource/bot/utils/telemetry-helper.d.ts.map +1 -1
- package/build/plugins/resource/bot/utils/telemetry-helper.js +4 -1
- package/build/plugins/resource/bot/utils/telemetry-helper.js.map +1 -1
- package/build/plugins/resource/bot/v3/index.d.ts.map +1 -1
- package/build/plugins/resource/bot/v3/index.js +0 -1
- package/build/plugins/resource/bot/v3/index.js.map +1 -1
- package/build/plugins/resource/cicd/constants.d.ts +3 -3
- package/build/plugins/resource/cicd/constants.d.ts.map +1 -1
- package/build/plugins/resource/cicd/constants.js +4 -3
- package/build/plugins/resource/cicd/constants.js.map +1 -1
- package/build/plugins/resource/cicd/errors.d.ts.map +1 -1
- package/build/plugins/resource/cicd/errors.js.map +1 -1
- package/build/plugins/resource/cicd/index.d.ts.map +1 -1
- package/build/plugins/resource/cicd/index.js +10 -3
- package/build/plugins/resource/cicd/index.js.map +1 -1
- package/build/plugins/resource/cicd/plugin.d.ts.map +1 -1
- package/build/plugins/resource/cicd/plugin.js +14 -12
- package/build/plugins/resource/cicd/plugin.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 +28 -6
- package/build/plugins/resource/cicd/questions.js.map +1 -1
- package/build/plugins/resource/frontend/constants.d.ts +0 -1
- package/build/plugins/resource/frontend/constants.d.ts.map +1 -1
- package/build/plugins/resource/frontend/constants.js +0 -1
- package/build/plugins/resource/frontend/constants.js.map +1 -1
- package/build/plugins/resource/frontend/dotnet/constants.d.ts +0 -1
- package/build/plugins/resource/frontend/dotnet/constants.d.ts.map +1 -1
- package/build/plugins/resource/frontend/dotnet/constants.js +0 -1
- package/build/plugins/resource/frontend/dotnet/constants.js.map +1 -1
- package/build/plugins/resource/frontend/dotnet/ops/scaffold.d.ts.map +1 -1
- package/build/plugins/resource/frontend/dotnet/ops/scaffold.js +0 -1
- package/build/plugins/resource/frontend/dotnet/ops/scaffold.js.map +1 -1
- package/build/plugins/resource/frontend/ops/scaffold.d.ts.map +1 -1
- package/build/plugins/resource/frontend/ops/scaffold.js +0 -1
- package/build/plugins/resource/frontend/ops/scaffold.js.map +1 -1
- package/build/plugins/resource/frontend/resources/templateInfo.d.ts +1 -0
- package/build/plugins/resource/frontend/resources/templateInfo.d.ts.map +1 -1
- package/build/plugins/resource/frontend/resources/templateInfo.js +9 -2
- package/build/plugins/resource/frontend/resources/templateInfo.js.map +1 -1
- package/build/plugins/resource/frontend/v3/index.d.ts.map +1 -1
- package/build/plugins/resource/frontend/v3/index.js +0 -1
- package/build/plugins/resource/frontend/v3/index.js.map +1 -1
- package/build/plugins/resource/function/constants.d.ts +0 -1
- 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/ops/scaffold.d.ts.map +1 -1
- package/build/plugins/resource/function/ops/scaffold.js +0 -1
- package/build/plugins/resource/function/ops/scaffold.js.map +1 -1
- package/build/plugins/resource/index.d.ts +1 -0
- package/build/plugins/resource/index.d.ts.map +1 -1
- package/build/plugins/resource/index.js +1 -0
- package/build/plugins/resource/index.js.map +1 -1
- package/build/plugins/resource/localdebug/v2/index.d.ts.map +1 -1
- package/build/plugins/resource/localdebug/v2/index.js +1 -1
- package/build/plugins/resource/localdebug/v2/index.js.map +1 -1
- package/build/plugins/resource/simpleauth/plugin.d.ts.map +1 -1
- package/build/plugins/resource/simpleauth/plugin.js +24 -5
- package/build/plugins/resource/simpleauth/plugin.js.map +1 -1
- package/build/plugins/resource/simpleauth/v2/index.d.ts +2 -2
- package/build/plugins/resource/simpleauth/v2/index.d.ts.map +1 -1
- package/build/plugins/resource/simpleauth/v2/index.js +4 -4
- package/build/plugins/resource/simpleauth/v2/index.js.map +1 -1
- package/build/plugins/resource/spfx/depsChecker/dependencyChecker.d.ts +11 -0
- package/build/plugins/resource/spfx/depsChecker/dependencyChecker.d.ts.map +1 -0
- package/build/plugins/resource/spfx/depsChecker/dependencyChecker.js +5 -0
- package/build/plugins/resource/spfx/depsChecker/dependencyChecker.js.map +1 -0
- package/build/plugins/resource/spfx/depsChecker/generatorChecker.d.ts +21 -0
- package/build/plugins/resource/spfx/depsChecker/generatorChecker.d.ts.map +1 -0
- package/build/plugins/resource/spfx/depsChecker/generatorChecker.js +131 -0
- package/build/plugins/resource/spfx/depsChecker/generatorChecker.js.map +1 -0
- package/build/plugins/resource/spfx/depsChecker/yoChecker.d.ts +21 -0
- package/build/plugins/resource/spfx/depsChecker/yoChecker.d.ts.map +1 -0
- package/build/plugins/resource/spfx/depsChecker/yoChecker.js +128 -0
- package/build/plugins/resource/spfx/depsChecker/yoChecker.js.map +1 -0
- package/build/plugins/resource/spfx/error.d.ts +4 -0
- package/build/plugins/resource/spfx/error.d.ts.map +1 -1
- package/build/plugins/resource/spfx/error.js +17 -1
- package/build/plugins/resource/spfx/error.js.map +1 -1
- package/build/plugins/resource/spfx/index.d.ts.map +1 -1
- package/build/plugins/resource/spfx/index.js +5 -2
- 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 +62 -13
- package/build/plugins/resource/spfx/plugin.js.map +1 -1
- package/build/plugins/resource/spfx/utils/constants.d.ts +5 -2
- package/build/plugins/resource/spfx/utils/constants.d.ts.map +1 -1
- package/build/plugins/resource/spfx/utils/constants.js +5 -2
- package/build/plugins/resource/spfx/utils/constants.js.map +1 -1
- package/build/plugins/resource/spfx/utils/questions.js +1 -1
- package/build/plugins/resource/spfx/utils/questions.js.map +1 -1
- package/build/plugins/resource/spfx/utils/telemetry-helper.d.ts.map +1 -1
- package/build/plugins/resource/spfx/utils/telemetry-helper.js +1 -0
- package/build/plugins/resource/spfx/utils/telemetry-helper.js.map +1 -1
- package/build/plugins/resource/spfx/utils/telemetryEvents.d.ts +11 -0
- package/build/plugins/resource/spfx/utils/telemetryEvents.d.ts.map +1 -0
- package/build/plugins/resource/spfx/utils/telemetryEvents.js +18 -0
- package/build/plugins/resource/spfx/utils/telemetryEvents.js.map +1 -0
- package/build/plugins/resource/spfx/utils/utils.d.ts +1 -0
- package/build/plugins/resource/spfx/utils/utils.d.ts.map +1 -1
- package/build/plugins/resource/spfx/utils/utils.js +16 -0
- package/build/plugins/resource/spfx/utils/utils.js.map +1 -1
- package/build/plugins/solution/fx-solution/ResourcePluginContainer.d.ts +1 -0
- package/build/plugins/solution/fx-solution/ResourcePluginContainer.d.ts.map +1 -1
- package/build/plugins/solution/fx-solution/ResourcePluginContainer.js +1 -0
- package/build/plugins/solution/fx-solution/ResourcePluginContainer.js.map +1 -1
- package/build/plugins/solution/fx-solution/constants.d.ts +24 -3
- package/build/plugins/solution/fx-solution/constants.d.ts.map +1 -1
- package/build/plugins/solution/fx-solution/constants.js +26 -1
- package/build/plugins/solution/fx-solution/constants.js.map +1 -1
- package/build/plugins/solution/fx-solution/debug/constants.d.ts +15 -0
- package/build/plugins/solution/fx-solution/debug/constants.d.ts.map +1 -1
- package/build/plugins/solution/fx-solution/debug/constants.js +18 -1
- package/build/plugins/solution/fx-solution/debug/constants.js.map +1 -1
- package/build/plugins/solution/fx-solution/debug/provisionLocal.d.ts +2 -3
- package/build/plugins/solution/fx-solution/debug/provisionLocal.d.ts.map +1 -1
- package/build/plugins/solution/fx-solution/debug/provisionLocal.js +40 -12
- 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 +17 -10
- package/build/plugins/solution/fx-solution/debug/scaffolding.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 +19 -6
- package/build/plugins/solution/fx-solution/debug/util/launch.js.map +1 -1
- package/build/plugins/solution/fx-solution/debug/util/launchNext.d.ts +2 -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 +179 -10
- package/build/plugins/solution/fx-solution/debug/util/launchNext.js.map +1 -1
- package/build/plugins/solution/fx-solution/debug/util/settings.d.ts +1 -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 +2 -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 +74 -1
- package/build/plugins/solution/fx-solution/debug/util/tasksNext.js.map +1 -1
- package/build/plugins/solution/fx-solution/question.d.ts +6 -2
- package/build/plugins/solution/fx-solution/question.d.ts.map +1 -1
- package/build/plugins/solution/fx-solution/question.js +33 -4
- package/build/plugins/solution/fx-solution/question.js.map +1 -1
- package/build/plugins/solution/fx-solution/v2/executeUserTask.d.ts +5 -1
- package/build/plugins/solution/fx-solution/v2/executeUserTask.d.ts.map +1 -1
- package/build/plugins/solution/fx-solution/v2/executeUserTask.js +409 -135
- package/build/plugins/solution/fx-solution/v2/executeUserTask.js.map +1 -1
- package/build/plugins/solution/fx-solution/v2/executor.d.ts +1 -1
- package/build/plugins/solution/fx-solution/v2/executor.d.ts.map +1 -1
- package/build/plugins/solution/fx-solution/v2/executor.js +33 -13
- package/build/plugins/solution/fx-solution/v2/executor.js.map +1 -1
- package/build/plugins/solution/fx-solution/v2/getQuestions.d.ts +1 -1
- package/build/plugins/solution/fx-solution/v2/getQuestions.d.ts.map +1 -1
- package/build/plugins/solution/fx-solution/v2/getQuestions.js +102 -37
- package/build/plugins/solution/fx-solution/v2/getQuestions.js.map +1 -1
- package/build/plugins/solution/fx-solution/v2/provisionLocal.d.ts +1 -2
- package/build/plugins/solution/fx-solution/v2/provisionLocal.d.ts.map +1 -1
- package/build/plugins/solution/fx-solution/v2/provisionLocal.js.map +1 -1
- package/build/plugins/solution/fx-solution/v2/scaffolding.d.ts +1 -1
- package/build/plugins/solution/fx-solution/v2/scaffolding.d.ts.map +1 -1
- package/build/plugins/solution/fx-solution/v2/scaffolding.js +25 -13
- package/build/plugins/solution/fx-solution/v2/scaffolding.js.map +1 -1
- package/build/plugins/solution/fx-solution/v2/utils.d.ts +1 -2
- package/build/plugins/solution/fx-solution/v2/utils.d.ts.map +1 -1
- package/build/plugins/solution/fx-solution/v2/utils.js +28 -8
- package/build/plugins/solution/fx-solution/v2/utils.js.map +1 -1
- package/build/plugins/solution/fx-solution/v3/provision.js +1 -1
- package/build/plugins/solution/fx-solution/v3/provision.js.map +1 -1
- package/build/plugins/solution/fx-solution/v3/userTask.js +1 -1
- package/build/plugins/solution/fx-solution/v3/userTask.js.map +1 -1
- package/package.json +4 -3
- package/resource/package.nls.json +133 -18
- package/templates/core/README-auto-generated.md +31 -0
- package/templates/{plugins/resource/dotnet → fallback}/blazor-base.csharp.default.zip +0 -0
- package/templates/{plugins/resource/bot → fallback}/bot.csharp.default.zip +0 -0
- package/templates/{plugins/resource/bot → fallback}/bot.js.default.zip +0 -0
- package/templates/fallback/bot.ts.command-and-response.zip +0 -0
- package/templates/{plugins/resource/bot → fallback}/bot.ts.default.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/{plugins/resource/function → fallback}/function-base.js.default.zip +0 -0
- package/templates/{plugins/resource/function → fallback}/function-base.ts.default.zip +0 -0
- package/templates/{plugins/resource/function → fallback}/function-triggers.js.HTTPTrigger.zip +0 -0
- package/templates/{plugins/resource/function → fallback}/function-triggers.ts.HTTPTrigger.zip +0 -0
- package/templates/{plugins/resource/frontend → fallback}/tab.csharp.default.zip +0 -0
- package/templates/fallback/tab.js.default.zip +0 -0
- package/templates/{plugins/resource/frontend/tab.js.default.zip → 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/{plugins/resource/frontend/tab.ts.default.zip → 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 +63 -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 +19 -0
- package/templates/plugins/resource/aad/auth/bot/js/sso/ssoDialog.js +173 -0
- package/templates/plugins/resource/aad/auth/bot/js/sso/teamsSsoBot.js +55 -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/manifest/aad.template.json +7 -14
- package/templates/plugins/resource/apiconnector/sample/js/api-connector.template +30 -0
- package/templates/plugins/resource/apiconnector/sample/ts/api-connector.template +30 -0
- package/templates/plugins/resource/bot/bicep/botProvision.template.bicep +6 -0
- package/templates/plugins/resource/bot/bicep/funcHostedBotProvision.template.bicep +127 -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 +2 -2
- package/templates/plugins/resource/sql/bicep/sqlProvision.template.bicep +1 -0
- package/templates/plugins/resource/webapp/bicep/webappProvision.template.bicep +2 -0
|
@@ -1,27 +1,32 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.extractParamForRegisterTeamsAppAndAad = exports.addResource = exports.showUpdateArmTemplateNotice = exports.addCapability = exports.canAddResource = exports.canAddCapability = exports.executeUserTask = void 0;
|
|
3
|
+
exports.validateAndParseLanguage = exports.createAuthFiles = exports.addSso = exports.canAddSso = exports.extractParamForRegisterTeamsAppAndAad = exports.addResource = exports.showUpdateArmTemplateNotice = exports.addCapability = exports.canAddResource = exports.canAddCapability = exports.executeUserTask = void 0;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
5
|
const teamsfx_api_1 = require("@microsoft/teamsfx-api");
|
|
6
|
-
const
|
|
7
|
-
const constants_1 = require("../constants");
|
|
8
|
-
const util = tslib_1.__importStar(require("util"));
|
|
9
|
-
const question_1 = require("../question");
|
|
6
|
+
const fs_extra_1 = tslib_1.__importDefault(require("fs-extra"));
|
|
10
7
|
const lodash_1 = require("lodash");
|
|
11
|
-
const
|
|
12
|
-
const ResourcePluginContainer_1 = require("../ResourcePluginContainer");
|
|
8
|
+
const path_1 = tslib_1.__importDefault(require("path"));
|
|
13
9
|
const typedi_1 = require("typedi");
|
|
14
|
-
const
|
|
15
|
-
const
|
|
16
|
-
const
|
|
17
|
-
const constants_2 = require("../v3/constants");
|
|
18
|
-
const error_1 = require("../../../../core/error");
|
|
19
|
-
const constants_3 = require("./constants");
|
|
10
|
+
const util = tslib_1.__importStar(require("util"));
|
|
11
|
+
const common_1 = require("../../../../common");
|
|
12
|
+
const constants_1 = require("../../../../common/constants");
|
|
20
13
|
const projectSettingsHelper_1 = require("../../../../common/projectSettingsHelper");
|
|
21
|
-
const
|
|
22
|
-
const
|
|
14
|
+
const error_1 = require("../../../../core/error");
|
|
15
|
+
const question_1 = require("../../../../core/question");
|
|
16
|
+
const constants_2 = require("../constants");
|
|
17
|
+
const scaffolding_1 = require("../debug/scaffolding");
|
|
18
|
+
const question_2 = require("../question");
|
|
19
|
+
const ResourcePluginContainer_1 = require("../ResourcePluginContainer");
|
|
20
|
+
const util_1 = require("../utils/util");
|
|
21
|
+
const constants_3 = require("../v3/constants");
|
|
22
|
+
const constants_4 = require("./constants");
|
|
23
|
+
const generateResourceTemplate_1 = require("./generateResourceTemplate");
|
|
24
|
+
const scaffolding_2 = require("./scaffolding");
|
|
25
|
+
const utils_1 = require("./utils");
|
|
23
26
|
const localizeUtils_1 = require("../../../../common/localizeUtils");
|
|
24
|
-
const
|
|
27
|
+
const folder_1 = require("../../../../folder");
|
|
28
|
+
const adm_zip_1 = tslib_1.__importDefault(require("adm-zip"));
|
|
29
|
+
const templatesUtils_1 = require("../../../../common/template-utils/templatesUtils");
|
|
25
30
|
async function executeUserTask(ctx, inputs, func, localSettings, envInfo, tokenProvider) {
|
|
26
31
|
const namespace = func.namespace;
|
|
27
32
|
const method = func.method;
|
|
@@ -32,17 +37,20 @@ async function executeUserTask(ctx, inputs, func, localSettings, envInfo, tokenP
|
|
|
32
37
|
if (method === "addResource") {
|
|
33
38
|
return addResource(ctx, inputs, localSettings, func, envInfo, tokenProvider);
|
|
34
39
|
}
|
|
40
|
+
if (method === "addSso") {
|
|
41
|
+
return addSso(ctx, inputs, localSettings);
|
|
42
|
+
}
|
|
35
43
|
if (namespace.includes("solution")) {
|
|
36
44
|
if (method === "registerTeamsAppAndAad") {
|
|
37
45
|
// not implemented for now
|
|
38
|
-
return teamsfx_api_1.err(new teamsfx_api_1.SystemError(
|
|
46
|
+
return teamsfx_api_1.err(new teamsfx_api_1.SystemError(constants_2.SolutionSource, constants_2.SolutionError.FeatureNotSupported, "Not implemented"));
|
|
39
47
|
}
|
|
40
48
|
else if (method === "VSpublish") {
|
|
41
49
|
// VSpublish means VS calling cli to do publish. It is different than normal cli work flow
|
|
42
50
|
// It's teamsfx init followed by teamsfx publish without running provision.
|
|
43
51
|
// Using executeUserTask here could bypass the fx project check.
|
|
44
52
|
if (inputs.platform !== "vs") {
|
|
45
|
-
return teamsfx_api_1.err(new teamsfx_api_1.SystemError(
|
|
53
|
+
return teamsfx_api_1.err(new teamsfx_api_1.SystemError(constants_2.SolutionSource, constants_2.SolutionError.UnsupportedPlatform, localizeUtils_1.getDefaultString("error.UnsupportedPlatformVS"), localizeUtils_1.getLocalizedString("error.UnsupportedPlatformVS")));
|
|
46
54
|
}
|
|
47
55
|
const appStudioPlugin = typedi_1.Container.get(ResourcePluginContainer_1.ResourcePluginsV2.AppStudioPlugin);
|
|
48
56
|
if (appStudioPlugin.publishApplication) {
|
|
@@ -76,13 +84,13 @@ async function executeUserTask(ctx, inputs, func, localSettings, envInfo, tokenP
|
|
|
76
84
|
}
|
|
77
85
|
}
|
|
78
86
|
}
|
|
79
|
-
return teamsfx_api_1.err(new teamsfx_api_1.UserError(
|
|
87
|
+
return teamsfx_api_1.err(new teamsfx_api_1.UserError(constants_2.SolutionSource, "executeUserTaskRouteFailed", localizeUtils_1.getDefaultString("error.appstudio.executeUserTaskRouteFailed", JSON.stringify(func)), localizeUtils_1.getLocalizedString("error.appstudio.executeUserTaskRouteFailed", JSON.stringify(func))));
|
|
80
88
|
}
|
|
81
89
|
exports.executeUserTask = executeUserTask;
|
|
82
90
|
function canAddCapability(settings, telemetryReporter) {
|
|
83
|
-
if (settings && !(settings.hostType ===
|
|
84
|
-
const e = new teamsfx_api_1.UserError(
|
|
85
|
-
return teamsfx_api_1.err(util_1.sendErrorTelemetryThenReturnError(
|
|
91
|
+
if (settings && !(settings.hostType === question_2.HostTypeOptionAzure.id)) {
|
|
92
|
+
const e = new teamsfx_api_1.UserError(constants_2.SolutionSource, constants_2.SolutionError.AddCapabilityNotSupport, localizeUtils_1.getDefaultString("core.addCapability.onlySupportAzure"), localizeUtils_1.getLocalizedString("core.addCapability.onlySupportAzure"));
|
|
93
|
+
return teamsfx_api_1.err(util_1.sendErrorTelemetryThenReturnError(constants_2.SolutionTelemetryEvent.AddCapability, e, telemetryReporter));
|
|
86
94
|
}
|
|
87
95
|
return teamsfx_api_1.ok(teamsfx_api_1.Void);
|
|
88
96
|
}
|
|
@@ -90,33 +98,34 @@ exports.canAddCapability = canAddCapability;
|
|
|
90
98
|
function canAddResource(projectSetting, telemetryReporter) {
|
|
91
99
|
const isVS = projectSettingsHelper_1.isVSProject(projectSetting);
|
|
92
100
|
if (isVS) {
|
|
93
|
-
const e = new teamsfx_api_1.UserError(
|
|
94
|
-
return teamsfx_api_1.err(util_1.sendErrorTelemetryThenReturnError(
|
|
101
|
+
const e = new teamsfx_api_1.UserError(constants_2.SolutionSource, constants_2.SolutionError.AddResourceNotSupport, localizeUtils_1.getDefaultString("core.addResource.notSupportForVSProject"), localizeUtils_1.getLocalizedString("core.addResource.notSupportForVSProject"));
|
|
102
|
+
return teamsfx_api_1.err(util_1.sendErrorTelemetryThenReturnError(constants_2.SolutionTelemetryEvent.AddResource, e, telemetryReporter));
|
|
95
103
|
}
|
|
96
104
|
const solutionSettings = projectSetting.solutionSettings;
|
|
97
|
-
if (!(solutionSettings.hostType ===
|
|
98
|
-
const e = new teamsfx_api_1.UserError(
|
|
99
|
-
return teamsfx_api_1.err(util_1.sendErrorTelemetryThenReturnError(
|
|
105
|
+
if (!(solutionSettings.hostType === question_2.HostTypeOptionAzure.id)) {
|
|
106
|
+
const e = new teamsfx_api_1.UserError(constants_2.SolutionSource, constants_2.SolutionError.AddResourceNotSupport, localizeUtils_1.getDefaultString("core.addResource.onlySupportAzure"), localizeUtils_1.getLocalizedString("core.addResource.onlySupportAzure"));
|
|
107
|
+
return teamsfx_api_1.err(util_1.sendErrorTelemetryThenReturnError(constants_2.SolutionTelemetryEvent.AddResource, e, telemetryReporter));
|
|
100
108
|
}
|
|
101
109
|
return teamsfx_api_1.ok(teamsfx_api_1.Void);
|
|
102
110
|
}
|
|
103
111
|
exports.canAddResource = canAddResource;
|
|
104
112
|
async function addCapability(ctx, inputs, localSettings) {
|
|
105
113
|
var _a, _b;
|
|
106
|
-
ctx.telemetryReporter.sendTelemetryEvent(
|
|
107
|
-
[
|
|
114
|
+
ctx.telemetryReporter.sendTelemetryEvent(constants_2.SolutionTelemetryEvent.AddCapabilityStart, {
|
|
115
|
+
[constants_2.SolutionTelemetryProperty.Component]: constants_2.SolutionTelemetryComponentName,
|
|
108
116
|
});
|
|
109
117
|
// 0. set programming language if it is empty
|
|
110
|
-
const programmingLanguageInputs = inputs[
|
|
118
|
+
const programmingLanguageInputs = inputs[question_1.CoreQuestionNames.ProgrammingLanguage];
|
|
111
119
|
if (!ctx.projectSetting.programmingLanguage && programmingLanguageInputs) {
|
|
112
120
|
ctx.projectSetting.programmingLanguage = programmingLanguageInputs;
|
|
113
121
|
}
|
|
114
122
|
// 1. checking addable
|
|
115
123
|
let solutionSettings = utils_1.getAzureSolutionSettings(ctx);
|
|
124
|
+
let isMiniApp = false;
|
|
116
125
|
if (!solutionSettings) {
|
|
117
126
|
// pure existing app
|
|
118
127
|
solutionSettings = {
|
|
119
|
-
name:
|
|
128
|
+
name: constants_4.TeamsAppSolutionNameV2,
|
|
120
129
|
version: "1.0.0",
|
|
121
130
|
hostType: "Azure",
|
|
122
131
|
capabilities: [],
|
|
@@ -124,10 +133,13 @@ async function addCapability(ctx, inputs, localSettings) {
|
|
|
124
133
|
activeResourcePlugins: [],
|
|
125
134
|
};
|
|
126
135
|
ctx.projectSetting.solutionSettings = solutionSettings;
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
136
|
+
if (!common_1.isAadManifestEnabled()) {
|
|
137
|
+
//aad need this file
|
|
138
|
+
await fs_extra_1.default.writeJSON(`${inputs.projectPath}/permissions.json`, constants_2.DEFAULT_PERMISSION_REQUEST, {
|
|
139
|
+
spaces: 4,
|
|
140
|
+
});
|
|
141
|
+
}
|
|
142
|
+
isMiniApp = true;
|
|
131
143
|
}
|
|
132
144
|
const originalSettings = lodash_1.cloneDeep(solutionSettings);
|
|
133
145
|
const inputsNew = Object.assign(Object.assign({}, inputs), { projectPath: inputs.projectPath, existingResources: originalSettings.activeResourcePlugins, existingCapabilities: originalSettings.capabilities });
|
|
@@ -136,23 +148,63 @@ async function addCapability(ctx, inputs, localSettings) {
|
|
|
136
148
|
return teamsfx_api_1.err(canProceed.error);
|
|
137
149
|
}
|
|
138
150
|
// 2. check answer
|
|
139
|
-
|
|
151
|
+
let capabilitiesAnswer = inputs[question_2.AzureSolutionQuestionNames.Capabilities];
|
|
140
152
|
if (!capabilitiesAnswer || capabilitiesAnswer.length === 0) {
|
|
141
|
-
(_a = ctx.telemetryReporter) === null || _a === void 0 ? void 0 : _a.sendTelemetryEvent(
|
|
142
|
-
[
|
|
143
|
-
[
|
|
144
|
-
[
|
|
153
|
+
(_a = ctx.telemetryReporter) === null || _a === void 0 ? void 0 : _a.sendTelemetryEvent(constants_2.SolutionTelemetryEvent.AddCapability, {
|
|
154
|
+
[constants_2.SolutionTelemetryProperty.Component]: constants_2.SolutionTelemetryComponentName,
|
|
155
|
+
[constants_2.SolutionTelemetryProperty.Success]: constants_2.SolutionTelemetrySuccess.Yes,
|
|
156
|
+
[constants_2.SolutionTelemetryProperty.Capabilities]: [].join(";"),
|
|
145
157
|
});
|
|
146
158
|
return teamsfx_api_1.ok({});
|
|
147
159
|
}
|
|
160
|
+
const validateRes = question_1.validateCapabilities(capabilitiesAnswer);
|
|
161
|
+
if (validateRes) {
|
|
162
|
+
return teamsfx_api_1.err(error_1.InvalidInputError(validateRes));
|
|
163
|
+
}
|
|
164
|
+
// add spfx tab is not permitted for non-mini app
|
|
165
|
+
if (!isMiniApp && capabilitiesAnswer.includes(question_2.TabSPFxItem.id)) {
|
|
166
|
+
return teamsfx_api_1.err(error_1.InvalidInputError(localizeUtils_1.getLocalizedString("core.capability.validation.spfx")));
|
|
167
|
+
}
|
|
168
|
+
// normalize capability answer
|
|
169
|
+
const scenarios = [];
|
|
170
|
+
const notificationIndex = capabilitiesAnswer.indexOf(question_2.NotificationOptionItem.id);
|
|
171
|
+
if (notificationIndex !== -1) {
|
|
172
|
+
capabilitiesAnswer[notificationIndex] = question_2.BotOptionItem.id;
|
|
173
|
+
scenarios.push(question_2.BotScenario.NotificationBot);
|
|
174
|
+
}
|
|
175
|
+
const commandAndResponseIndex = capabilitiesAnswer.indexOf(question_2.CommandAndResponseOptionItem.id);
|
|
176
|
+
if (commandAndResponseIndex !== -1) {
|
|
177
|
+
capabilitiesAnswer[commandAndResponseIndex] = question_2.BotOptionItem.id;
|
|
178
|
+
scenarios.push(question_2.BotScenario.CommandAndResponseBot);
|
|
179
|
+
}
|
|
180
|
+
inputsNew[question_2.AzureSolutionQuestionNames.Scenarios] = scenarios;
|
|
181
|
+
capabilitiesAnswer = [...new Set(capabilitiesAnswer)];
|
|
148
182
|
// 3. check capability limit
|
|
149
|
-
const alreadyHasTab = solutionSettings.capabilities.includes(
|
|
150
|
-
const alreadyHasBot = solutionSettings.capabilities.includes(
|
|
151
|
-
const alreadyHasME = solutionSettings.capabilities.includes(
|
|
152
|
-
const
|
|
153
|
-
const
|
|
154
|
-
const
|
|
155
|
-
const
|
|
183
|
+
const alreadyHasTab = solutionSettings.capabilities.includes(question_2.TabOptionItem.id);
|
|
184
|
+
const alreadyHasBot = solutionSettings.capabilities.includes(question_2.BotOptionItem.id);
|
|
185
|
+
const alreadyHasME = solutionSettings.capabilities.includes(question_2.MessageExtensionItem.id);
|
|
186
|
+
const alreadyHasSso = common_1.isAadManifestEnabled() && solutionSettings.capabilities.includes(question_2.SsoItem.id);
|
|
187
|
+
const toAddTab = capabilitiesAnswer.includes(question_2.TabOptionItem.id);
|
|
188
|
+
const toAddBot = capabilitiesAnswer.includes(question_2.BotOptionItem.id);
|
|
189
|
+
const toAddME = capabilitiesAnswer.includes(question_2.MessageExtensionItem.id);
|
|
190
|
+
const toAddTabNonSso = common_1.isAadManifestEnabled() && capabilitiesAnswer.includes(question_2.TabNonSsoItem.id);
|
|
191
|
+
const toAddSpfx = capabilitiesAnswer.includes(question_2.TabSPFxItem.id);
|
|
192
|
+
if (common_1.isAadManifestEnabled()) {
|
|
193
|
+
if (alreadyHasSso && toAddTabNonSso) {
|
|
194
|
+
const e = new teamsfx_api_1.SystemError(constants_2.SolutionError.InvalidInput, localizeUtils_1.getLocalizedString("core.addSsoFiles.canNotAddNonSsoTabWhenSsoEnabled"), constants_2.SolutionSource);
|
|
195
|
+
return teamsfx_api_1.err(e);
|
|
196
|
+
}
|
|
197
|
+
if (!alreadyHasSso && toAddTab) {
|
|
198
|
+
const e = new teamsfx_api_1.SystemError(constants_2.SolutionError.InvalidInput, localizeUtils_1.getLocalizedString("core.addSsoFiles.canNotAddTabWhenSsoNotEnabled"), constants_2.SolutionSource);
|
|
199
|
+
return teamsfx_api_1.err(e);
|
|
200
|
+
}
|
|
201
|
+
if (toAddTabNonSso) {
|
|
202
|
+
const index = capabilitiesAnswer.indexOf(question_2.TabNonSsoItem.id);
|
|
203
|
+
capabilitiesAnswer.splice(index, 1);
|
|
204
|
+
capabilitiesAnswer.push(question_2.TabOptionItem.id);
|
|
205
|
+
}
|
|
206
|
+
}
|
|
207
|
+
const appStudioPlugin = typedi_1.Container.get(constants_3.BuiltInFeaturePluginNames.appStudio);
|
|
156
208
|
const inputsWithProjectPath = inputs;
|
|
157
209
|
const tabExceedRes = await appStudioPlugin.capabilityExceedLimit(ctx, inputs, "staticTab");
|
|
158
210
|
if (tabExceedRes.isErr()) {
|
|
@@ -170,8 +222,8 @@ async function addCapability(ctx, inputs, localSettings) {
|
|
|
170
222
|
}
|
|
171
223
|
const isMEAddable = !meExceedRes.value;
|
|
172
224
|
if ((toAddTab && !isTabAddable) || (toAddBot && !isBotAddable) || (toAddME && !isMEAddable)) {
|
|
173
|
-
const error = new teamsfx_api_1.UserError(
|
|
174
|
-
return teamsfx_api_1.err(util_1.sendErrorTelemetryThenReturnError(
|
|
225
|
+
const error = new teamsfx_api_1.UserError(constants_2.SolutionSource, constants_2.SolutionError.FailedToAddCapability, localizeUtils_1.getDefaultString("core.addCapability.exceedMaxLimit"), localizeUtils_1.getLocalizedString("core.addCapability.exceedMaxLimit"));
|
|
226
|
+
return teamsfx_api_1.err(util_1.sendErrorTelemetryThenReturnError(constants_2.SolutionTelemetryEvent.AddCapability, error, ctx.telemetryReporter));
|
|
175
227
|
}
|
|
176
228
|
const capabilitiesToAddManifest = [];
|
|
177
229
|
const pluginNamesToScaffold = new Set();
|
|
@@ -179,68 +231,117 @@ async function addCapability(ctx, inputs, localSettings) {
|
|
|
179
231
|
const newCapabilitySet = new Set();
|
|
180
232
|
solutionSettings.capabilities.forEach((c) => newCapabilitySet.add(c));
|
|
181
233
|
const vsProject = projectSettingsHelper_1.isVSProject(ctx.projectSetting);
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
234
|
+
// check SPFx
|
|
235
|
+
if (toAddSpfx) {
|
|
236
|
+
pluginNamesToScaffold.add(ResourcePluginContainer_1.ResourcePluginsV2.SpfxPlugin);
|
|
237
|
+
capabilitiesToAddManifest.push({ name: "staticTab" });
|
|
238
|
+
capabilitiesToAddManifest.push({ name: "configurableTab" });
|
|
239
|
+
newCapabilitySet.add(question_2.TabSPFxItem.id);
|
|
240
|
+
solutionSettings.hostType = question_2.HostTypeOptionSPFx.id;
|
|
241
|
+
}
|
|
242
|
+
else {
|
|
243
|
+
if (!originalSettings.activeResourcePlugins.includes(constants_3.BuiltInFeaturePluginNames.identity)) {
|
|
244
|
+
pluginNamesToArm.add(ResourcePluginContainer_1.ResourcePluginsV2.IdentityPlugin);
|
|
245
|
+
}
|
|
246
|
+
if (!common_1.isAadManifestEnabled() &&
|
|
247
|
+
!originalSettings.activeResourcePlugins.includes(constants_3.BuiltInFeaturePluginNames.aad)) {
|
|
248
|
+
pluginNamesToArm.add(ResourcePluginContainer_1.ResourcePluginsV2.AadPlugin);
|
|
195
249
|
}
|
|
196
|
-
|
|
197
|
-
|
|
250
|
+
// 4. check Tab
|
|
251
|
+
if (toAddTab) {
|
|
252
|
+
if (vsProject) {
|
|
198
253
|
pluginNamesToScaffold.add(ResourcePluginContainer_1.ResourcePluginsV2.FrontendPlugin);
|
|
199
|
-
|
|
254
|
+
if (!alreadyHasTab) {
|
|
255
|
+
pluginNamesToArm.add(ResourcePluginContainer_1.ResourcePluginsV2.FrontendPlugin);
|
|
256
|
+
if (common_1.isAadManifestEnabled() && alreadyHasSso) {
|
|
257
|
+
const createAuthFilesRes = await createAuthFiles(inputsNew, ctx, true, false, true);
|
|
258
|
+
if (createAuthFilesRes.isErr()) {
|
|
259
|
+
return addAuthFileError(createAuthFilesRes, ctx.telemetryReporter);
|
|
260
|
+
}
|
|
261
|
+
}
|
|
262
|
+
}
|
|
200
263
|
}
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
264
|
+
else {
|
|
265
|
+
if (!alreadyHasTab) {
|
|
266
|
+
pluginNamesToScaffold.add(ResourcePluginContainer_1.ResourcePluginsV2.FrontendPlugin);
|
|
267
|
+
pluginNamesToArm.add(ResourcePluginContainer_1.ResourcePluginsV2.FrontendPlugin);
|
|
268
|
+
if (common_1.isAadManifestEnabled() && alreadyHasSso) {
|
|
269
|
+
const createAuthFilesRes = await createAuthFiles(inputsNew, ctx, true, false);
|
|
270
|
+
if (createAuthFilesRes.isErr()) {
|
|
271
|
+
return addAuthFileError(createAuthFilesRes, ctx.telemetryReporter);
|
|
272
|
+
}
|
|
273
|
+
}
|
|
274
|
+
}
|
|
211
275
|
}
|
|
276
|
+
capabilitiesToAddManifest.push({ name: "staticTab" });
|
|
277
|
+
newCapabilitySet.add(question_2.TabOptionItem.id);
|
|
212
278
|
}
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
279
|
+
// 5. check Bot
|
|
280
|
+
if (toAddBot) {
|
|
281
|
+
if (vsProject) {
|
|
282
|
+
pluginNamesToScaffold.add(ResourcePluginContainer_1.ResourcePluginsV2.FrontendPlugin);
|
|
283
|
+
if (!alreadyHasBot && !alreadyHasME) {
|
|
284
|
+
pluginNamesToArm.add(ResourcePluginContainer_1.ResourcePluginsV2.BotPlugin);
|
|
285
|
+
if (common_1.isAadManifestEnabled() && alreadyHasSso) {
|
|
286
|
+
const createAuthFilesRes = await createAuthFiles(inputsNew, ctx, false, true, true);
|
|
287
|
+
if (createAuthFilesRes.isErr()) {
|
|
288
|
+
return addAuthFileError(createAuthFilesRes, ctx.telemetryReporter);
|
|
289
|
+
}
|
|
290
|
+
}
|
|
291
|
+
}
|
|
217
292
|
}
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
293
|
+
else {
|
|
294
|
+
if (!alreadyHasBot && !alreadyHasME) {
|
|
295
|
+
pluginNamesToScaffold.add(ResourcePluginContainer_1.ResourcePluginsV2.BotPlugin);
|
|
296
|
+
pluginNamesToArm.add(ResourcePluginContainer_1.ResourcePluginsV2.BotPlugin);
|
|
297
|
+
if (common_1.isAadManifestEnabled() && alreadyHasSso) {
|
|
298
|
+
const createAuthFilesRes = await createAuthFiles(inputsNew, ctx, false, true);
|
|
299
|
+
if (createAuthFilesRes.isErr()) {
|
|
300
|
+
return addAuthFileError(createAuthFilesRes, ctx.telemetryReporter);
|
|
301
|
+
}
|
|
302
|
+
}
|
|
303
|
+
}
|
|
228
304
|
}
|
|
305
|
+
capabilitiesToAddManifest.push({ name: "Bot" });
|
|
306
|
+
newCapabilitySet.add(question_2.BotOptionItem.id);
|
|
229
307
|
}
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
308
|
+
// 6. check MessageExtension
|
|
309
|
+
if (toAddME) {
|
|
310
|
+
if (vsProject) {
|
|
311
|
+
pluginNamesToScaffold.add(ResourcePluginContainer_1.ResourcePluginsV2.FrontendPlugin);
|
|
312
|
+
if (!alreadyHasBot && !alreadyHasME) {
|
|
313
|
+
pluginNamesToArm.add(ResourcePluginContainer_1.ResourcePluginsV2.BotPlugin);
|
|
314
|
+
if (common_1.isAadManifestEnabled() && alreadyHasSso) {
|
|
315
|
+
const createAuthFilesRes = await createAuthFiles(inputsNew, ctx, false, true, true);
|
|
316
|
+
if (createAuthFilesRes.isErr()) {
|
|
317
|
+
return addAuthFileError(createAuthFilesRes, ctx.telemetryReporter);
|
|
318
|
+
}
|
|
319
|
+
}
|
|
320
|
+
}
|
|
234
321
|
}
|
|
322
|
+
else {
|
|
323
|
+
if (!alreadyHasBot && !alreadyHasME) {
|
|
324
|
+
pluginNamesToScaffold.add(ResourcePluginContainer_1.ResourcePluginsV2.BotPlugin);
|
|
325
|
+
pluginNamesToArm.add(ResourcePluginContainer_1.ResourcePluginsV2.BotPlugin);
|
|
326
|
+
if (common_1.isAadManifestEnabled() && alreadyHasSso) {
|
|
327
|
+
const createAuthFilesRes = await createAuthFiles(inputsNew, ctx, false, true);
|
|
328
|
+
if (createAuthFilesRes.isErr()) {
|
|
329
|
+
return addAuthFileError(createAuthFilesRes, ctx.telemetryReporter);
|
|
330
|
+
}
|
|
331
|
+
}
|
|
332
|
+
}
|
|
333
|
+
}
|
|
334
|
+
capabilitiesToAddManifest.push({ name: "MessageExtension" });
|
|
335
|
+
newCapabilitySet.add(question_2.MessageExtensionItem.id);
|
|
235
336
|
}
|
|
236
|
-
capabilitiesToAddManifest.push({ name: "MessageExtension" });
|
|
237
|
-
newCapabilitySet.add(question_1.MessageExtensionItem.id);
|
|
238
337
|
}
|
|
239
338
|
// 7. update solution settings
|
|
240
339
|
solutionSettings.capabilities = Array.from(newCapabilitySet);
|
|
241
340
|
utils_1.setActivatedResourcePluginsV2(ctx.projectSetting);
|
|
242
|
-
if (!
|
|
243
|
-
|
|
341
|
+
if (!toAddSpfx &&
|
|
342
|
+
!common_1.isAadManifestEnabled() &&
|
|
343
|
+
!solutionSettings.activeResourcePlugins.includes(constants_3.BuiltInFeaturePluginNames.aad)) {
|
|
344
|
+
solutionSettings.activeResourcePlugins.push(constants_3.BuiltInFeaturePluginNames.aad);
|
|
244
345
|
}
|
|
245
346
|
// 8. scaffold and update arm
|
|
246
347
|
const pluginsToScaffold = Array.from(pluginNamesToScaffold).map((name) => typedi_1.Container.get(name));
|
|
@@ -249,11 +350,11 @@ async function addCapability(ctx, inputs, localSettings) {
|
|
|
249
350
|
const scaffoldRes = await scaffoldCodeAndResourceTemplate(ctx, inputsNew, localSettings, pluginsToScaffold, pluginsToArm);
|
|
250
351
|
if (scaffoldRes.isErr()) {
|
|
251
352
|
ctx.projectSetting.solutionSettings = originalSettings;
|
|
252
|
-
return teamsfx_api_1.err(util_1.sendErrorTelemetryThenReturnError(
|
|
353
|
+
return teamsfx_api_1.err(util_1.sendErrorTelemetryThenReturnError(constants_2.SolutionTelemetryEvent.AddCapability, scaffoldRes.error, ctx.telemetryReporter));
|
|
253
354
|
}
|
|
254
355
|
}
|
|
255
356
|
// 4. update manifest
|
|
256
|
-
if (capabilitiesToAddManifest.length > 0
|
|
357
|
+
if (capabilitiesToAddManifest.length > 0) {
|
|
257
358
|
await appStudioPlugin.addCapabilities(ctx, inputsWithProjectPath, capabilitiesToAddManifest);
|
|
258
359
|
}
|
|
259
360
|
if (capabilitiesAnswer.length > 0) {
|
|
@@ -268,10 +369,10 @@ async function addCapability(ctx, inputs, localSettings) {
|
|
|
268
369
|
: localizeUtils_1.getLocalizedString("core.addCapability.addCapabilitiesNotice");
|
|
269
370
|
const msg = util.format(template, addNames);
|
|
270
371
|
ctx.userInteraction.showMessage("info", msg, false);
|
|
271
|
-
(_b = ctx.telemetryReporter) === null || _b === void 0 ? void 0 : _b.sendTelemetryEvent(
|
|
272
|
-
[
|
|
273
|
-
[
|
|
274
|
-
[
|
|
372
|
+
(_b = ctx.telemetryReporter) === null || _b === void 0 ? void 0 : _b.sendTelemetryEvent(constants_2.SolutionTelemetryEvent.AddCapability, {
|
|
373
|
+
[constants_2.SolutionTelemetryProperty.Component]: constants_2.SolutionTelemetryComponentName,
|
|
374
|
+
[constants_2.SolutionTelemetryProperty.Success]: constants_2.SolutionTelemetrySuccess.Yes,
|
|
375
|
+
[constants_2.SolutionTelemetryProperty.Capabilities]: capabilitiesAnswer.join(";"),
|
|
275
376
|
});
|
|
276
377
|
}
|
|
277
378
|
return teamsfx_api_1.ok({
|
|
@@ -285,12 +386,12 @@ function showUpdateArmTemplateNotice(ui) {
|
|
|
285
386
|
ui === null || ui === void 0 ? void 0 : ui.showMessage("info", msg, false);
|
|
286
387
|
}
|
|
287
388
|
exports.showUpdateArmTemplateNotice = showUpdateArmTemplateNotice;
|
|
288
|
-
async function scaffoldCodeAndResourceTemplate(ctx, inputs, localSettings, pluginsToScaffold, pluginsToDoArm) {
|
|
289
|
-
const result = await
|
|
389
|
+
async function scaffoldCodeAndResourceTemplate(ctx, inputs, localSettings, pluginsToScaffold, pluginsToDoArm, concurrent = true) {
|
|
390
|
+
const result = await scaffolding_2.scaffoldByPlugins(ctx, inputs, localSettings, pluginsToScaffold, concurrent);
|
|
290
391
|
if (result.isErr()) {
|
|
291
392
|
return result;
|
|
292
393
|
}
|
|
293
|
-
const scaffoldLocalDebugSettingsResult = await
|
|
394
|
+
const scaffoldLocalDebugSettingsResult = await scaffolding_1.scaffoldLocalDebugSettings(ctx, inputs, localSettings);
|
|
294
395
|
if (scaffoldLocalDebugSettingsResult.isErr()) {
|
|
295
396
|
return scaffoldLocalDebugSettingsResult;
|
|
296
397
|
}
|
|
@@ -302,8 +403,8 @@ async function scaffoldCodeAndResourceTemplate(ctx, inputs, localSettings, plugi
|
|
|
302
403
|
}
|
|
303
404
|
async function addResource(ctx, inputs, localSettings, func, envInfo, tokenProvider) {
|
|
304
405
|
var _a, _b, _c, _d;
|
|
305
|
-
(_a = ctx.telemetryReporter) === null || _a === void 0 ? void 0 : _a.sendTelemetryEvent(
|
|
306
|
-
[
|
|
406
|
+
(_a = ctx.telemetryReporter) === null || _a === void 0 ? void 0 : _a.sendTelemetryEvent(constants_2.SolutionTelemetryEvent.AddResourceStart, {
|
|
407
|
+
[constants_2.SolutionTelemetryProperty.Component]: constants_2.SolutionTelemetryComponentName,
|
|
307
408
|
});
|
|
308
409
|
// 1. checking addable
|
|
309
410
|
const solutionSettings = utils_1.getAzureSolutionSettings(ctx);
|
|
@@ -317,26 +418,26 @@ async function addResource(ctx, inputs, localSettings, func, envInfo, tokenProvi
|
|
|
317
418
|
return teamsfx_api_1.err(canProceed.error);
|
|
318
419
|
}
|
|
319
420
|
// 2. check answer
|
|
320
|
-
const addResourcesAnswer = inputs[
|
|
421
|
+
const addResourcesAnswer = inputs[question_2.AzureSolutionQuestionNames.AddResources];
|
|
321
422
|
if (!addResourcesAnswer || addResourcesAnswer.length === 0) {
|
|
322
|
-
(_b = ctx.telemetryReporter) === null || _b === void 0 ? void 0 : _b.sendTelemetryEvent(
|
|
323
|
-
[
|
|
324
|
-
[
|
|
325
|
-
[
|
|
423
|
+
(_b = ctx.telemetryReporter) === null || _b === void 0 ? void 0 : _b.sendTelemetryEvent(constants_2.SolutionTelemetryEvent.AddResource, {
|
|
424
|
+
[constants_2.SolutionTelemetryProperty.Component]: constants_2.SolutionTelemetryComponentName,
|
|
425
|
+
[constants_2.SolutionTelemetryProperty.Success]: constants_2.SolutionTelemetrySuccess.Yes,
|
|
426
|
+
[constants_2.SolutionTelemetryProperty.Resources]: [].join(";"),
|
|
326
427
|
});
|
|
327
428
|
return teamsfx_api_1.ok({});
|
|
328
429
|
}
|
|
329
|
-
const alreadyHaveFunction = solutionSettings.azureResources.includes(
|
|
330
|
-
const alreadyHaveApim = solutionSettings.azureResources.includes(
|
|
331
|
-
const alreadyHaveKeyVault = solutionSettings.azureResources.includes(
|
|
332
|
-
const addSQL = addResourcesAnswer.includes(
|
|
333
|
-
const addApim = addResourcesAnswer.includes(
|
|
334
|
-
const addKeyVault = addResourcesAnswer.includes(
|
|
335
|
-
const addFunc = addResourcesAnswer.includes(
|
|
430
|
+
const alreadyHaveFunction = solutionSettings.azureResources.includes(question_2.AzureResourceFunction.id);
|
|
431
|
+
const alreadyHaveApim = solutionSettings.azureResources.includes(question_2.AzureResourceApim.id);
|
|
432
|
+
const alreadyHaveKeyVault = solutionSettings.azureResources.includes(question_2.AzureResourceKeyVault.id);
|
|
433
|
+
const addSQL = addResourcesAnswer.includes(question_2.AzureResourceSQL.id);
|
|
434
|
+
const addApim = addResourcesAnswer.includes(question_2.AzureResourceApim.id);
|
|
435
|
+
const addKeyVault = addResourcesAnswer.includes(question_2.AzureResourceKeyVault.id);
|
|
436
|
+
const addFunc = addResourcesAnswer.includes(question_2.AzureResourceFunction.id) || (addApim && !alreadyHaveFunction);
|
|
336
437
|
// 3. check APIM and KeyVault addable
|
|
337
438
|
if ((alreadyHaveApim && addApim) || (alreadyHaveKeyVault && addKeyVault)) {
|
|
338
|
-
const e = new teamsfx_api_1.UserError(
|
|
339
|
-
return teamsfx_api_1.err(util_1.sendErrorTelemetryThenReturnError(
|
|
439
|
+
const e = new teamsfx_api_1.UserError(constants_2.SolutionSource, constants_2.SolutionError.AddResourceNotSupport, "APIM/KeyVault is already added.");
|
|
440
|
+
return teamsfx_api_1.err(util_1.sendErrorTelemetryThenReturnError(constants_2.SolutionTelemetryEvent.AddResource, e, ctx.telemetryReporter));
|
|
340
441
|
}
|
|
341
442
|
const newResourceSet = new Set();
|
|
342
443
|
solutionSettings.azureResources.forEach((r) => newResourceSet.add(r));
|
|
@@ -353,10 +454,10 @@ async function addResource(ctx, inputs, localSettings, func, envInfo, tokenProvi
|
|
|
353
454
|
const aadPlugin = typedi_1.Container.get(ResourcePluginContainer_1.ResourcePluginsV2.AadPlugin);
|
|
354
455
|
pluginsToScaffold.push(aadPlugin);
|
|
355
456
|
pluginsToDoArm.push(aadPlugin);
|
|
356
|
-
solutionSettings.capabilities.push(
|
|
457
|
+
solutionSettings.capabilities.push(question_2.SsoItem.id);
|
|
357
458
|
}
|
|
358
459
|
else {
|
|
359
|
-
(_c = solutionSettings.activeResourcePlugins) === null || _c === void 0 ? void 0 : _c.push(
|
|
460
|
+
(_c = solutionSettings.activeResourcePlugins) === null || _c === void 0 ? void 0 : _c.push(constants_2.PluginNames.AAD);
|
|
360
461
|
}
|
|
361
462
|
}
|
|
362
463
|
const functionPlugin = typedi_1.Container.get(ResourcePluginContainer_1.ResourcePluginsV2.FunctionPlugin);
|
|
@@ -364,7 +465,7 @@ async function addResource(ctx, inputs, localSettings, func, envInfo, tokenProvi
|
|
|
364
465
|
if (!alreadyHaveFunction) {
|
|
365
466
|
pluginsToDoArm.push(functionPlugin);
|
|
366
467
|
}
|
|
367
|
-
addedResources.push(
|
|
468
|
+
addedResources.push(question_2.AzureResourceFunction.id);
|
|
368
469
|
}
|
|
369
470
|
// 5. check SQL
|
|
370
471
|
if (addSQL) {
|
|
@@ -375,7 +476,7 @@ async function addResource(ctx, inputs, localSettings, func, envInfo, tokenProvi
|
|
|
375
476
|
// add identity for first time
|
|
376
477
|
pluginsToDoArm.push(identityPlugin);
|
|
377
478
|
}
|
|
378
|
-
addedResources.push(
|
|
479
|
+
addedResources.push(question_2.AzureResourceSQL.id);
|
|
379
480
|
}
|
|
380
481
|
// 6. check APIM
|
|
381
482
|
const apimPlugin = typedi_1.Container.get(ResourcePluginContainer_1.ResourcePluginsV2.ApimPlugin);
|
|
@@ -384,14 +485,14 @@ async function addResource(ctx, inputs, localSettings, func, envInfo, tokenProvi
|
|
|
384
485
|
// apim plugin needs to modify config output during scaffolding,
|
|
385
486
|
// which is not supported by the scaffoldSourceCode API.
|
|
386
487
|
// The scaffolding will run later as a userTask as a work around.
|
|
387
|
-
addedResources.push(
|
|
488
|
+
addedResources.push(question_2.AzureResourceApim.id);
|
|
388
489
|
pluginsToDoArm.push(apimPlugin);
|
|
389
490
|
scaffoldApim = true;
|
|
390
491
|
}
|
|
391
492
|
if (addKeyVault) {
|
|
392
493
|
const keyVaultPlugin = typedi_1.Container.get(ResourcePluginContainer_1.ResourcePluginsV2.KeyVaultPlugin);
|
|
393
494
|
pluginsToDoArm.push(keyVaultPlugin);
|
|
394
|
-
addedResources.push(
|
|
495
|
+
addedResources.push(question_2.AzureResourceKeyVault.id);
|
|
395
496
|
}
|
|
396
497
|
// 7. update solution settings
|
|
397
498
|
addedResources.forEach((r) => newResourceSet.add(r));
|
|
@@ -410,7 +511,7 @@ async function addResource(ctx, inputs, localSettings, func, envInfo, tokenProvi
|
|
|
410
511
|
}
|
|
411
512
|
if (scaffoldRes.isErr()) {
|
|
412
513
|
ctx.projectSetting.solutionSettings = originalSettings;
|
|
413
|
-
return teamsfx_api_1.err(util_1.sendErrorTelemetryThenReturnError(
|
|
514
|
+
return teamsfx_api_1.err(util_1.sendErrorTelemetryThenReturnError(constants_2.SolutionTelemetryEvent.AddResource, scaffoldRes.error, ctx.telemetryReporter));
|
|
414
515
|
}
|
|
415
516
|
const addNames = addedResources.map((c) => `'${c}'`).join(" and ");
|
|
416
517
|
const single = addedResources.length === 1;
|
|
@@ -423,10 +524,10 @@ async function addResource(ctx, inputs, localSettings, func, envInfo, tokenProvi
|
|
|
423
524
|
: localizeUtils_1.getLocalizedString("core.addResource.addResourcesNotice");
|
|
424
525
|
ctx.userInteraction.showMessage("info", util.format(template, addNames), false);
|
|
425
526
|
}
|
|
426
|
-
(_d = ctx.telemetryReporter) === null || _d === void 0 ? void 0 : _d.sendTelemetryEvent(
|
|
427
|
-
[
|
|
428
|
-
[
|
|
429
|
-
[
|
|
527
|
+
(_d = ctx.telemetryReporter) === null || _d === void 0 ? void 0 : _d.sendTelemetryEvent(constants_2.SolutionTelemetryEvent.AddResource, {
|
|
528
|
+
[constants_2.SolutionTelemetryProperty.Component]: constants_2.SolutionTelemetryComponentName,
|
|
529
|
+
[constants_2.SolutionTelemetryProperty.Success]: constants_2.SolutionTelemetrySuccess.Yes,
|
|
530
|
+
[constants_2.SolutionTelemetryProperty.Resources]: addResourcesAnswer.join(";"),
|
|
430
531
|
});
|
|
431
532
|
return teamsfx_api_1.ok(pluginsToDoArm.length > 0
|
|
432
533
|
? { solutionSettings: solutionSettings, solutionConfig: { provisionSucceeded: false } }
|
|
@@ -435,7 +536,7 @@ async function addResource(ctx, inputs, localSettings, func, envInfo, tokenProvi
|
|
|
435
536
|
exports.addResource = addResource;
|
|
436
537
|
function extractParamForRegisterTeamsAppAndAad(answers) {
|
|
437
538
|
if (answers == undefined) {
|
|
438
|
-
return teamsfx_api_1.err(new teamsfx_api_1.SystemError(
|
|
539
|
+
return teamsfx_api_1.err(new teamsfx_api_1.SystemError(constants_2.SolutionSource, constants_2.SolutionError.FailedToGetParamForRegisterTeamsAppAndAad, "Input is undefined"));
|
|
439
540
|
}
|
|
440
541
|
const param = {
|
|
441
542
|
"app-name": "",
|
|
@@ -446,11 +547,184 @@ function extractParamForRegisterTeamsAppAndAad(answers) {
|
|
|
446
547
|
for (const key of Object.keys(param)) {
|
|
447
548
|
const value = answers[key];
|
|
448
549
|
if (value == undefined) {
|
|
449
|
-
return teamsfx_api_1.err(new teamsfx_api_1.SystemError(
|
|
550
|
+
return teamsfx_api_1.err(new teamsfx_api_1.SystemError(constants_2.SolutionSource, constants_2.SolutionError.FailedToGetParamForRegisterTeamsAppAndAad, `${key} not found`));
|
|
450
551
|
}
|
|
451
552
|
param[key] = value;
|
|
452
553
|
}
|
|
453
554
|
return teamsfx_api_1.ok(param);
|
|
454
555
|
}
|
|
455
556
|
exports.extractParamForRegisterTeamsAppAndAad = extractParamForRegisterTeamsAppAndAad;
|
|
557
|
+
// TODO: handle VS scenario
|
|
558
|
+
function canAddSso(projectSettings, telemetryReporter) {
|
|
559
|
+
var _a, _b;
|
|
560
|
+
// Can not add sso if feature flag is not enabled
|
|
561
|
+
if (!common_1.isAadManifestEnabled()) {
|
|
562
|
+
const e = new teamsfx_api_1.SystemError(constants_2.SolutionError.NeedEnableFeatureFlag, localizeUtils_1.getLocalizedString("core.addSso.needEnableFeatureFlag"), constants_2.SolutionSource);
|
|
563
|
+
return teamsfx_api_1.err(util_1.sendErrorTelemetryThenReturnError(constants_2.SolutionTelemetryEvent.AddSso, e, telemetryReporter));
|
|
564
|
+
}
|
|
565
|
+
const solutionSettings = projectSettings.solutionSettings;
|
|
566
|
+
if (!(solutionSettings.hostType === question_2.HostTypeOptionAzure.id)) {
|
|
567
|
+
const e = new teamsfx_api_1.UserError(constants_2.SolutionError.AddSsoNotSupported, localizeUtils_1.getLocalizedString("core.addSso.onlySupportAzure"), constants_2.SolutionSource);
|
|
568
|
+
return teamsfx_api_1.err(util_1.sendErrorTelemetryThenReturnError(constants_2.SolutionTelemetryEvent.AddSso, e, telemetryReporter));
|
|
569
|
+
}
|
|
570
|
+
// Can only add sso when capability includes Tab, Bot, Messaging Extension, etc.
|
|
571
|
+
if (!solutionSettings.capabilities.includes(question_2.TabOptionItem.id) &&
|
|
572
|
+
!solutionSettings.capabilities.includes(question_2.BotOptionItem.id) &&
|
|
573
|
+
!solutionSettings.capabilities.includes(question_2.MessageExtensionItem.id)) {
|
|
574
|
+
const e = new teamsfx_api_1.UserError(constants_2.SolutionError.AddSsoNotSupported, localizeUtils_1.getLocalizedString("core.addSso.needCapability"), constants_2.SolutionSource);
|
|
575
|
+
return teamsfx_api_1.err(util_1.sendErrorTelemetryThenReturnError(constants_2.SolutionTelemetryEvent.AddSso, e, telemetryReporter));
|
|
576
|
+
}
|
|
577
|
+
// Will throw error if bot host type is Azure Function
|
|
578
|
+
if (solutionSettings.capabilities.includes(question_2.BotOptionItem.id)) {
|
|
579
|
+
const botHostType = (_b = (_a = projectSettings.pluginSettings) === null || _a === void 0 ? void 0 : _a[constants_1.ResourcePlugins.Bot]) === null || _b === void 0 ? void 0 : _b[common_1.BotHostTypeName];
|
|
580
|
+
if (botHostType === common_1.BotHostTypes.AzureFunctions) {
|
|
581
|
+
const e = new teamsfx_api_1.UserError(constants_2.SolutionError.AddSsoNotSupported, localizeUtils_1.getLocalizedString("core.addSso.functionNotSupport"), constants_2.SolutionSource);
|
|
582
|
+
return teamsfx_api_1.err(util_1.sendErrorTelemetryThenReturnError(constants_2.SolutionTelemetryEvent.AddSso, e, telemetryReporter));
|
|
583
|
+
}
|
|
584
|
+
}
|
|
585
|
+
// Check whether SSO is enabled
|
|
586
|
+
const activeResourcePlugins = solutionSettings.activeResourcePlugins;
|
|
587
|
+
const containSsoItem = solutionSettings.capabilities.includes(question_2.SsoItem.id);
|
|
588
|
+
const containAadPlugin = activeResourcePlugins.includes(constants_2.PluginNames.AAD);
|
|
589
|
+
if (containSsoItem && containAadPlugin) {
|
|
590
|
+
// Throw error if sso is already enabled
|
|
591
|
+
const e = new teamsfx_api_1.UserError(constants_2.SolutionError.SsoEnabled, localizeUtils_1.getLocalizedString("core.addSso.ssoEnabled"), constants_2.SolutionSource);
|
|
592
|
+
return teamsfx_api_1.err(util_1.sendErrorTelemetryThenReturnError(constants_2.SolutionTelemetryEvent.AddSso, e, telemetryReporter));
|
|
593
|
+
}
|
|
594
|
+
else if (containSsoItem || containAadPlugin) {
|
|
595
|
+
// Throw error if the project is invalid
|
|
596
|
+
const e = new teamsfx_api_1.UserError(constants_2.SolutionError.InvalidSsoProject, localizeUtils_1.getLocalizedString("core.addSso.invalidSsoProject"), constants_2.SolutionSource);
|
|
597
|
+
return teamsfx_api_1.err(util_1.sendErrorTelemetryThenReturnError(constants_2.SolutionTelemetryEvent.AddSso, e, telemetryReporter));
|
|
598
|
+
}
|
|
599
|
+
return teamsfx_api_1.ok(teamsfx_api_1.Void);
|
|
600
|
+
}
|
|
601
|
+
exports.canAddSso = canAddSso;
|
|
602
|
+
async function addSso(ctx, inputs, localSettings) {
|
|
603
|
+
ctx.telemetryReporter.sendTelemetryEvent(constants_2.SolutionTelemetryEvent.AddSsoStart, {
|
|
604
|
+
[constants_2.SolutionTelemetryProperty.Component]: constants_2.SolutionTelemetryComponentName,
|
|
605
|
+
});
|
|
606
|
+
let solutionSettings = utils_1.getAzureSolutionSettings(ctx);
|
|
607
|
+
if (!solutionSettings) {
|
|
608
|
+
// pure existing app
|
|
609
|
+
solutionSettings = {
|
|
610
|
+
name: constants_4.TeamsAppSolutionNameV2,
|
|
611
|
+
version: "1.0.0",
|
|
612
|
+
hostType: "Azure",
|
|
613
|
+
capabilities: [],
|
|
614
|
+
azureResources: [],
|
|
615
|
+
activeResourcePlugins: [],
|
|
616
|
+
};
|
|
617
|
+
ctx.projectSetting.solutionSettings = solutionSettings;
|
|
618
|
+
}
|
|
619
|
+
// Check whether can add sso
|
|
620
|
+
const canProceed = canAddSso(ctx.projectSetting, ctx.telemetryReporter);
|
|
621
|
+
if (canProceed.isErr()) {
|
|
622
|
+
return teamsfx_api_1.err(canProceed.error);
|
|
623
|
+
}
|
|
624
|
+
// Update project settings
|
|
625
|
+
solutionSettings.activeResourcePlugins.push(constants_2.PluginNames.AAD);
|
|
626
|
+
solutionSettings.capabilities.push(question_2.SsoItem.id);
|
|
627
|
+
const originalSettings = lodash_1.cloneDeep(solutionSettings);
|
|
628
|
+
const inputsNew = Object.assign(Object.assign({}, inputs), { projectPath: inputs.projectPath, existingResources: originalSettings.activeResourcePlugins, existingCapabilities: originalSettings.capabilities });
|
|
629
|
+
const needsTab = solutionSettings.capabilities.includes(question_2.TabOptionItem.id);
|
|
630
|
+
const needsBot = solutionSettings.capabilities.includes(question_2.BotOptionItem.id) ||
|
|
631
|
+
solutionSettings.capabilities.includes(question_2.MessageExtensionItem.id);
|
|
632
|
+
const createAuthFilesRes = await createAuthFiles(inputsNew, ctx, needsTab, needsBot, projectSettingsHelper_1.isVSProject(ctx.projectSetting));
|
|
633
|
+
if (createAuthFilesRes.isErr()) {
|
|
634
|
+
return teamsfx_api_1.err(util_1.sendErrorTelemetryThenReturnError(constants_2.SolutionTelemetryEvent.AddSso, createAuthFilesRes.error, ctx.telemetryReporter));
|
|
635
|
+
}
|
|
636
|
+
// Scaffold aad plugin and arm template
|
|
637
|
+
const scaffoldRes = await scaffoldCodeAndResourceTemplate(ctx, inputsNew, localSettings, [typedi_1.Container.get(constants_2.PluginNames.AAD)], [typedi_1.Container.get(constants_2.PluginNames.AAD)]);
|
|
638
|
+
if (scaffoldRes.isErr()) {
|
|
639
|
+
ctx.projectSetting.solutionSettings = originalSettings;
|
|
640
|
+
return teamsfx_api_1.err(util_1.sendErrorTelemetryThenReturnError(constants_2.SolutionTelemetryEvent.AddSso, scaffoldRes.error, ctx.telemetryReporter));
|
|
641
|
+
}
|
|
642
|
+
// Update manifest
|
|
643
|
+
const appStudioPlugin = typedi_1.Container.get(constants_3.BuiltInFeaturePluginNames.appStudio);
|
|
644
|
+
await appStudioPlugin.addCapabilities(ctx, inputs, [
|
|
645
|
+
{ name: "WebApplicationInfo" },
|
|
646
|
+
]);
|
|
647
|
+
return teamsfx_api_1.ok(undefined);
|
|
648
|
+
}
|
|
649
|
+
exports.addSso = addSso;
|
|
650
|
+
// TODO: use 'isVsProject' for changes in VS
|
|
651
|
+
async function createAuthFiles(input, ctx, needTab, needBot, isVsProject = false) {
|
|
652
|
+
var _a;
|
|
653
|
+
const projectPath = input.projectPath;
|
|
654
|
+
if (!projectPath) {
|
|
655
|
+
const e = new teamsfx_api_1.SystemError(constants_2.SolutionError.InvalidProjectPath, localizeUtils_1.getLocalizedString("core.addSsoFiles.emptyProjectPath"), constants_2.SolutionSource);
|
|
656
|
+
return teamsfx_api_1.err(e);
|
|
657
|
+
}
|
|
658
|
+
const language = (_a = ctx.projectSetting.programmingLanguage) !== null && _a !== void 0 ? _a : constants_2.Language.JavaScript;
|
|
659
|
+
const languageFolderResult = validateAndParseLanguage(language);
|
|
660
|
+
if (languageFolderResult.isErr()) {
|
|
661
|
+
return teamsfx_api_1.err(languageFolderResult.error);
|
|
662
|
+
}
|
|
663
|
+
const languageFolderName = languageFolderResult.value;
|
|
664
|
+
const projectFolderExists = await fs_extra_1.default.pathExists(projectPath);
|
|
665
|
+
if (!projectFolderExists) {
|
|
666
|
+
const e = new teamsfx_api_1.SystemError(constants_2.SolutionError.InvalidProjectPath, localizeUtils_1.getLocalizedString("core.addSsoFiles.projectPathNotExists"), constants_2.SolutionSource);
|
|
667
|
+
return teamsfx_api_1.err(e);
|
|
668
|
+
}
|
|
669
|
+
const authFolder = path_1.default.join(projectPath, "auth");
|
|
670
|
+
const authFolderExists = await fs_extra_1.default.pathExists(authFolder);
|
|
671
|
+
if (!authFolderExists) {
|
|
672
|
+
await fs_extra_1.default.ensureDir(authFolder);
|
|
673
|
+
}
|
|
674
|
+
if (needTab) {
|
|
675
|
+
const tabFolder = path_1.default.join(authFolder, constants_2.AddSsoParameters.Tab);
|
|
676
|
+
const tabFolderExists = await fs_extra_1.default.pathExists(tabFolder);
|
|
677
|
+
if (!tabFolderExists) {
|
|
678
|
+
await fs_extra_1.default.ensureDir(tabFolder);
|
|
679
|
+
}
|
|
680
|
+
// TODO: Add necessary files here for tab
|
|
681
|
+
}
|
|
682
|
+
if (needBot) {
|
|
683
|
+
const botFolder = path_1.default.join(authFolder, constants_2.AddSsoParameters.Bot);
|
|
684
|
+
const botFolderExists = await fs_extra_1.default.pathExists(botFolder);
|
|
685
|
+
if (!botFolderExists) {
|
|
686
|
+
await fs_extra_1.default.ensureDir(botFolder);
|
|
687
|
+
}
|
|
688
|
+
try {
|
|
689
|
+
const templateFolder = folder_1.getTemplatesFolder();
|
|
690
|
+
const botTemplateFolder = path_1.default.join(templateFolder, constants_2.AddSsoParameters.filePath, constants_2.AddSsoParameters.Bot);
|
|
691
|
+
if (isVsProject) {
|
|
692
|
+
// TODO: add steps for VS
|
|
693
|
+
}
|
|
694
|
+
else {
|
|
695
|
+
// README.md
|
|
696
|
+
const readmeSourcePath = path_1.default.join(botTemplateFolder, constants_2.AddSsoParameters.Readme);
|
|
697
|
+
const readmeTargetPath = path_1.default.join(botFolder, constants_2.AddSsoParameters.Readme);
|
|
698
|
+
const readme = await fs_extra_1.default.readFile(readmeSourcePath);
|
|
699
|
+
fs_extra_1.default.writeFile(readmeTargetPath, readme);
|
|
700
|
+
// Sample Code
|
|
701
|
+
const sampleSourceFolder = path_1.default.join(botTemplateFolder, languageFolderName);
|
|
702
|
+
const sampleZip = new adm_zip_1.default();
|
|
703
|
+
sampleZip.addLocalFolder(sampleSourceFolder);
|
|
704
|
+
await templatesUtils_1.unzip(sampleZip, botFolder);
|
|
705
|
+
}
|
|
706
|
+
}
|
|
707
|
+
catch (error) {
|
|
708
|
+
// TODO: remove added code
|
|
709
|
+
const e = new teamsfx_api_1.SystemError(constants_2.SolutionError.FailedToCreateAuthFiles, localizeUtils_1.getLocalizedString("core.addSsoFiles.FailedToCreateAuthFiles", error.message), constants_2.SolutionSource);
|
|
710
|
+
return teamsfx_api_1.err(e);
|
|
711
|
+
}
|
|
712
|
+
}
|
|
713
|
+
return teamsfx_api_1.ok(undefined);
|
|
714
|
+
}
|
|
715
|
+
exports.createAuthFiles = createAuthFiles;
|
|
716
|
+
function validateAndParseLanguage(language) {
|
|
717
|
+
if (language.toLowerCase() == constants_2.Language.TypeScript) {
|
|
718
|
+
return teamsfx_api_1.ok("ts");
|
|
719
|
+
}
|
|
720
|
+
if (language.toLowerCase() == constants_2.Language.JavaScript) {
|
|
721
|
+
return teamsfx_api_1.ok("js");
|
|
722
|
+
}
|
|
723
|
+
const e = new teamsfx_api_1.SystemError(constants_2.SolutionError.InvalidInput, localizeUtils_1.getLocalizedString("core.addSsoFiles.invalidLanguage"), constants_2.SolutionSource);
|
|
724
|
+
return teamsfx_api_1.err(e);
|
|
725
|
+
}
|
|
726
|
+
exports.validateAndParseLanguage = validateAndParseLanguage;
|
|
727
|
+
const addAuthFileError = (createAuthFilesRes, telemetryReporter) => {
|
|
728
|
+
return teamsfx_api_1.err(util_1.sendErrorTelemetryThenReturnError(constants_2.SolutionTelemetryEvent.AddCapability, createAuthFilesRes.error, telemetryReporter));
|
|
729
|
+
};
|
|
456
730
|
//# sourceMappingURL=executeUserTask.js.map
|