@microsoft/teamsfx-core 1.4.0 → 1.4.1-alpha.0535e2d27.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 +1 -0
- package/build/common/constants.d.ts.map +1 -1
- package/build/common/constants.js +1 -0
- package/build/common/constants.js.map +1 -1
- package/build/common/local/constants.d.ts +0 -4
- package/build/common/local/constants.d.ts.map +1 -1
- package/build/common/local/constants.js +1 -5
- package/build/common/local/constants.js.map +1 -1
- package/build/common/local/localEnvProvider.d.ts +4 -8
- package/build/common/local/localEnvProvider.d.ts.map +1 -1
- package/build/common/local/localEnvProvider.js +21 -33
- package/build/common/local/localEnvProvider.js.map +1 -1
- package/build/common/local/localSettingsHelper.d.ts.map +1 -1
- package/build/common/local/localSettingsHelper.js +12 -21
- package/build/common/local/localSettingsHelper.js.map +1 -1
- package/build/common/local/portChecker.d.ts.map +1 -1
- package/build/common/local/portChecker.js +1 -8
- package/build/common/local/portChecker.js.map +1 -1
- package/build/common/local/projectSettingsHelper.d.ts +0 -1
- package/build/common/local/projectSettingsHelper.d.ts.map +1 -1
- package/build/common/local/projectSettingsHelper.js +2 -5
- package/build/common/local/projectSettingsHelper.js.map +1 -1
- package/build/common/localSettingsProvider.d.ts +2 -2
- package/build/common/localSettingsProvider.d.ts.map +1 -1
- package/build/common/localSettingsProvider.js +4 -4
- package/build/common/localSettingsProvider.js.map +1 -1
- package/build/common/projectSettingsValidator.d.ts.map +1 -1
- package/build/common/projectSettingsValidator.js +5 -0
- package/build/common/projectSettingsValidator.js.map +1 -1
- package/build/common/samples-config.json +12 -2
- package/build/common/template-utils/templates.d.ts +1 -0
- package/build/common/template-utils/templates.d.ts.map +1 -1
- package/build/common/template-utils/templates.js +5 -1
- package/build/common/template-utils/templates.js.map +1 -1
- package/build/common/templates-config.json +2 -2
- package/build/common/tools.d.ts +0 -4
- package/build/common/tools.d.ts.map +1 -1
- package/build/common/tools.js +1 -20
- package/build/common/tools.js.map +1 -1
- package/build/core/SolutionPluginContainer.js +1 -1
- package/build/core/SolutionPluginContainer.js.map +1 -1
- package/build/core/collaborator.d.ts +10 -0
- package/build/core/collaborator.d.ts.map +1 -0
- package/build/core/collaborator.js +381 -0
- package/build/core/collaborator.js.map +1 -0
- package/build/core/environment.d.ts.map +1 -1
- package/build/core/environment.js +7 -2
- package/build/core/environment.js.map +1 -1
- package/build/core/error.d.ts +0 -6
- package/build/core/error.d.ts.map +1 -1
- package/build/core/error.js +1 -25
- package/build/core/error.js.map +1 -1
- package/build/core/index.d.ts +11 -9
- package/build/core/index.d.ts.map +1 -1
- package/build/core/index.js +232 -233
- package/build/core/index.js.map +1 -1
- package/build/core/middleware/concurrentLocker.d.ts.map +1 -1
- package/build/core/middleware/concurrentLocker.js +1 -2
- package/build/core/middleware/concurrentLocker.js.map +1 -1
- package/build/core/middleware/envInfoLoaderV3.d.ts.map +1 -1
- package/build/core/middleware/envInfoLoaderV3.js +3 -0
- package/build/core/middleware/envInfoLoaderV3.js.map +1 -1
- package/build/core/middleware/index.d.ts +0 -2
- package/build/core/middleware/index.d.ts.map +1 -1
- package/build/core/middleware/index.js +0 -2
- package/build/core/middleware/index.js.map +1 -1
- package/build/core/middleware/localSettingsLoader.d.ts.map +1 -1
- package/build/core/middleware/localSettingsLoader.js +2 -2
- package/build/core/middleware/localSettingsLoader.js.map +1 -1
- package/build/core/middleware/projectMigrator.d.ts.map +1 -1
- package/build/core/middleware/projectMigrator.js +28 -35
- package/build/core/middleware/projectMigrator.js.map +1 -1
- package/build/core/middleware/questionModel.d.ts +0 -1
- package/build/core/middleware/questionModel.d.ts.map +1 -1
- package/build/core/middleware/questionModel.js +48 -71
- package/build/core/middleware/questionModel.js.map +1 -1
- package/build/core/middleware/solutionLoaderV3.d.ts +1 -1
- package/build/core/middleware/solutionLoaderV3.d.ts.map +1 -1
- package/build/core/middleware/solutionLoaderV3.js +1 -8
- package/build/core/middleware/solutionLoaderV3.js.map +1 -1
- package/build/core/question.d.ts +0 -1
- package/build/core/question.d.ts.map +1 -1
- package/build/core/question.js +1 -26
- package/build/core/question.js.map +1 -1
- package/build/core/tools.d.ts +0 -2
- package/build/core/tools.d.ts.map +1 -1
- package/build/core/tools.js +3 -63
- package/build/core/tools.js.map +1 -1
- package/build/core/utils.d.ts +1 -2
- package/build/core/utils.d.ts.map +1 -1
- package/build/core/utils.js +1 -5
- package/build/core/utils.js.map +1 -1
- package/build/plugins/resource/aad/aadAppClient.d.ts +4 -4
- package/build/plugins/resource/aad/aadAppClient.d.ts.map +1 -1
- package/build/plugins/resource/aad/aadAppClient.js +3 -3
- package/build/plugins/resource/aad/aadAppClient.js.map +1 -1
- package/build/plugins/resource/aad/index.d.ts.map +1 -1
- package/build/plugins/resource/aad/index.js +0 -3
- package/build/plugins/resource/aad/index.js.map +1 -1
- package/build/plugins/resource/aad/plugin.d.ts.map +1 -1
- package/build/plugins/resource/aad/plugin.js +13 -8
- package/build/plugins/resource/aad/plugin.js.map +1 -1
- package/build/plugins/resource/aad/v2/index.d.ts +3 -2
- package/build/plugins/resource/aad/v2/index.d.ts.map +1 -1
- package/build/plugins/resource/aad/v2/index.js +4 -4
- package/build/plugins/resource/aad/v2/index.js.map +1 -1
- package/build/plugins/resource/aad/v3/index.d.ts +8 -2
- package/build/plugins/resource/aad/v3/index.d.ts.map +1 -1
- package/build/plugins/resource/aad/v3/index.js +148 -49
- package/build/plugins/resource/aad/v3/index.js.map +1 -1
- package/build/plugins/resource/apim/config.js +2 -1
- package/build/plugins/resource/apim/config.js.map +1 -1
- package/build/plugins/resource/apim/managers/questionManager.d.ts.map +1 -1
- package/build/plugins/resource/apim/managers/questionManager.js +8 -4
- package/build/plugins/resource/apim/managers/questionManager.js.map +1 -1
- package/build/plugins/resource/apim/v3/index.d.ts +7 -7
- package/build/plugins/resource/apim/v3/index.d.ts.map +1 -1
- package/build/plugins/resource/apim/v3/index.js +63 -55
- package/build/plugins/resource/apim/v3/index.js.map +1 -1
- package/build/plugins/resource/appstudio/appStudio.js +1 -1
- package/build/plugins/resource/appstudio/appStudio.js.map +1 -1
- package/build/plugins/resource/appstudio/errors.d.ts +8 -16
- package/build/plugins/resource/appstudio/errors.d.ts.map +1 -1
- package/build/plugins/resource/appstudio/errors.js +8 -16
- package/build/plugins/resource/appstudio/errors.js.map +1 -1
- package/build/plugins/resource/appstudio/index.d.ts +0 -4
- package/build/plugins/resource/appstudio/index.d.ts.map +1 -1
- package/build/plugins/resource/appstudio/index.js +0 -21
- package/build/plugins/resource/appstudio/index.js.map +1 -1
- package/build/plugins/resource/appstudio/manifestTemplate.d.ts +3 -1
- package/build/plugins/resource/appstudio/manifestTemplate.d.ts.map +1 -1
- package/build/plugins/resource/appstudio/manifestTemplate.js +111 -1
- package/build/plugins/resource/appstudio/manifestTemplate.js.map +1 -1
- package/build/plugins/resource/appstudio/plugin.d.ts +2 -13
- package/build/plugins/resource/appstudio/plugin.d.ts.map +1 -1
- package/build/plugins/resource/appstudio/plugin.js +46 -127
- package/build/plugins/resource/appstudio/plugin.js.map +1 -1
- package/build/plugins/resource/appstudio/utils/telemetry.d.ts +1 -1
- package/build/plugins/resource/appstudio/utils/telemetry.d.ts.map +1 -1
- package/build/plugins/resource/appstudio/utils/telemetry.js +22 -10
- package/build/plugins/resource/appstudio/utils/telemetry.js.map +1 -1
- package/build/plugins/resource/appstudio/v2/index.d.ts +2 -2
- package/build/plugins/resource/appstudio/v2/index.d.ts.map +1 -1
- package/build/plugins/resource/appstudio/v2/index.js +2 -2
- package/build/plugins/resource/appstudio/v2/index.js.map +1 -1
- package/build/plugins/resource/appstudio/v3/index.d.ts +24 -4
- package/build/plugins/resource/appstudio/v3/index.d.ts.map +1 -1
- package/build/plugins/resource/appstudio/v3/index.js +133 -5
- package/build/plugins/resource/appstudio/v3/index.js.map +1 -1
- package/build/plugins/resource/appstudio/v3/plugin.d.ts +17 -4
- package/build/plugins/resource/appstudio/v3/plugin.d.ts.map +1 -1
- package/build/plugins/resource/appstudio/v3/plugin.js +117 -25
- package/build/plugins/resource/appstudio/v3/plugin.js.map +1 -1
- package/build/plugins/resource/bot/configs/deployConfig.js.map +1 -1
- package/build/plugins/resource/bot/constants.d.ts +0 -4
- package/build/plugins/resource/bot/constants.d.ts.map +1 -1
- package/build/plugins/resource/bot/constants.js +0 -6
- package/build/plugins/resource/bot/constants.js.map +1 -1
- package/build/plugins/resource/bot/dotnet/plugin.d.ts +0 -3
- package/build/plugins/resource/bot/dotnet/plugin.d.ts.map +1 -1
- package/build/plugins/resource/bot/dotnet/plugin.js +0 -9
- package/build/plugins/resource/bot/dotnet/plugin.js.map +1 -1
- package/build/plugins/resource/bot/errors.d.ts +0 -3
- package/build/plugins/resource/bot/errors.d.ts.map +1 -1
- package/build/plugins/resource/bot/errors.js +1 -9
- package/build/plugins/resource/bot/errors.js.map +1 -1
- package/build/plugins/resource/bot/index.d.ts +2 -3
- package/build/plugins/resource/bot/index.d.ts.map +1 -1
- package/build/plugins/resource/bot/index.js +5 -16
- package/build/plugins/resource/bot/index.js.map +1 -1
- package/build/plugins/resource/bot/interface.d.ts +0 -1
- package/build/plugins/resource/bot/interface.d.ts.map +1 -1
- package/build/plugins/resource/bot/plugin.d.ts +0 -1
- package/build/plugins/resource/bot/plugin.d.ts.map +1 -1
- package/build/plugins/resource/bot/plugin.js +0 -26
- package/build/plugins/resource/bot/plugin.js.map +1 -1
- package/build/plugins/resource/bot/progressBars.d.ts +2 -2
- package/build/plugins/resource/bot/progressBars.d.ts.map +1 -1
- package/build/plugins/resource/bot/progressBars.js +4 -3
- package/build/plugins/resource/bot/progressBars.js.map +1 -1
- package/build/plugins/resource/bot/resources/messages.d.ts +0 -3
- package/build/plugins/resource/bot/resources/messages.d.ts.map +1 -1
- package/build/plugins/resource/bot/resources/messages.js +0 -5
- package/build/plugins/resource/bot/resources/messages.js.map +1 -1
- package/build/plugins/resource/bot/resources/strings.d.ts +0 -1
- package/build/plugins/resource/bot/resources/strings.d.ts.map +1 -1
- package/build/plugins/resource/bot/resources/strings.js +0 -2
- package/build/plugins/resource/bot/resources/strings.js.map +1 -1
- package/build/plugins/resource/bot/v3/error.d.ts +15 -0
- package/build/plugins/resource/bot/v3/error.d.ts.map +1 -0
- package/build/plugins/resource/bot/v3/error.js +46 -0
- package/build/plugins/resource/bot/v3/error.js.map +1 -0
- package/build/plugins/resource/bot/v3/index.d.ts +19 -0
- package/build/plugins/resource/bot/v3/index.d.ts.map +1 -0
- package/build/plugins/resource/bot/v3/index.js +376 -0
- package/build/plugins/resource/bot/v3/index.js.map +1 -0
- package/build/plugins/resource/frontend/constants.d.ts +1 -0
- package/build/plugins/resource/frontend/constants.d.ts.map +1 -1
- package/build/plugins/resource/frontend/constants.js +1 -0
- package/build/plugins/resource/frontend/constants.js.map +1 -1
- package/build/plugins/resource/frontend/dotnet/constants.d.ts +21 -0
- package/build/plugins/resource/frontend/dotnet/constants.d.ts.map +1 -1
- package/build/plugins/resource/frontend/dotnet/constants.js +23 -1
- package/build/plugins/resource/frontend/dotnet/constants.js.map +1 -1
- package/build/plugins/resource/frontend/dotnet/plugin.d.ts +1 -0
- package/build/plugins/resource/frontend/dotnet/plugin.d.ts.map +1 -1
- package/build/plugins/resource/frontend/dotnet/plugin.js +59 -0
- package/build/plugins/resource/frontend/dotnet/plugin.js.map +1 -1
- package/build/plugins/resource/frontend/dotnet/resources/errors.d.ts +3 -0
- package/build/plugins/resource/frontend/dotnet/resources/errors.d.ts.map +1 -1
- package/build/plugins/resource/frontend/dotnet/resources/errors.js +10 -1
- package/build/plugins/resource/frontend/dotnet/resources/errors.js.map +1 -1
- package/build/plugins/resource/frontend/index.d.ts +2 -3
- package/build/plugins/resource/frontend/index.d.ts.map +1 -1
- package/build/plugins/resource/frontend/index.js +5 -9
- package/build/plugins/resource/frontend/index.js.map +1 -1
- package/build/plugins/resource/frontend/interface.d.ts +2 -2
- package/build/plugins/resource/frontend/interface.d.ts.map +1 -1
- package/build/plugins/resource/frontend/plugin.d.ts +2 -2
- package/build/plugins/resource/frontend/plugin.d.ts.map +1 -1
- package/build/plugins/resource/frontend/plugin.js +12 -25
- package/build/plugins/resource/frontend/plugin.js.map +1 -1
- package/build/plugins/resource/frontend/resources/errors.d.ts +0 -7
- package/build/plugins/resource/frontend/resources/errors.d.ts.map +1 -1
- package/build/plugins/resource/frontend/resources/errors.js +1 -14
- package/build/plugins/resource/frontend/resources/errors.js.map +1 -1
- package/build/plugins/resource/frontend/resources/messages.d.ts +0 -2
- package/build/plugins/resource/frontend/resources/messages.d.ts.map +1 -1
- package/build/plugins/resource/frontend/resources/messages.js +0 -2
- package/build/plugins/resource/frontend/resources/messages.js.map +1 -1
- package/build/plugins/resource/frontend/resources/steps.d.ts +0 -1
- package/build/plugins/resource/frontend/resources/steps.d.ts.map +1 -1
- package/build/plugins/resource/frontend/resources/steps.js +1 -7
- package/build/plugins/resource/frontend/resources/steps.js.map +1 -1
- package/build/plugins/resource/frontend/v2/index.d.ts +3 -2
- package/build/plugins/resource/frontend/v2/index.d.ts.map +1 -1
- package/build/plugins/resource/frontend/v2/index.js +5 -2
- package/build/plugins/resource/frontend/v2/index.js.map +1 -1
- package/build/plugins/resource/frontend/v3/index.d.ts +7 -7
- package/build/plugins/resource/frontend/v3/index.d.ts.map +1 -1
- package/build/plugins/resource/frontend/v3/index.js +21 -28
- package/build/plugins/resource/frontend/v3/index.js.map +1 -1
- package/build/plugins/resource/function/v3/index.d.ts +8 -9
- package/build/plugins/resource/function/v3/index.d.ts.map +1 -1
- package/build/plugins/resource/function/v3/index.js +20 -26
- package/build/plugins/resource/function/v3/index.js.map +1 -1
- package/build/plugins/resource/identity/index.d.ts.map +1 -1
- package/build/plugins/resource/identity/index.js +0 -3
- package/build/plugins/resource/identity/index.js.map +1 -1
- package/build/plugins/resource/identity/v3/index.d.ts +4 -4
- package/build/plugins/resource/identity/v3/index.d.ts.map +1 -1
- package/build/plugins/resource/identity/v3/index.js +10 -14
- package/build/plugins/resource/identity/v3/index.js.map +1 -1
- package/build/plugins/resource/keyvault/v3/index.d.ts +5 -6
- package/build/plugins/resource/keyvault/v3/index.d.ts.map +1 -1
- package/build/plugins/resource/keyvault/v3/index.js +10 -17
- package/build/plugins/resource/keyvault/v3/index.js.map +1 -1
- package/build/plugins/resource/localdebug/constants.d.ts +0 -4
- package/build/plugins/resource/localdebug/constants.d.ts.map +1 -1
- package/build/plugins/resource/localdebug/constants.js +1 -5
- package/build/plugins/resource/localdebug/constants.js.map +1 -1
- package/build/plugins/resource/localdebug/localEnv.d.ts +2 -2
- package/build/plugins/resource/localdebug/localEnv.d.ts.map +1 -1
- package/build/plugins/resource/localdebug/localEnv.js +4 -6
- package/build/plugins/resource/localdebug/localEnv.js.map +1 -1
- package/build/plugins/resource/localdebug/projectSettingLoader.d.ts +0 -1
- package/build/plugins/resource/localdebug/projectSettingLoader.d.ts.map +1 -1
- package/build/plugins/resource/localdebug/projectSettingLoader.js +0 -1
- package/build/plugins/resource/localdebug/projectSettingLoader.js.map +1 -1
- package/build/plugins/resource/spfx/index.d.ts +1 -5
- package/build/plugins/resource/spfx/index.d.ts.map +1 -1
- package/build/plugins/resource/spfx/index.js +6 -10
- package/build/plugins/resource/spfx/index.js.map +1 -1
- package/build/plugins/resource/spfx/plugin.js +6 -6
- package/build/plugins/resource/spfx/plugin.js.map +1 -1
- package/build/plugins/resource/spfx/utils/constants.d.ts +9 -0
- package/build/plugins/resource/spfx/utils/constants.d.ts.map +1 -1
- package/build/plugins/resource/spfx/utils/constants.js +11 -1
- package/build/plugins/resource/spfx/utils/constants.js.map +1 -1
- package/build/plugins/resource/spfx/utils/progress-helper.d.ts +3 -3
- package/build/plugins/resource/spfx/utils/progress-helper.d.ts.map +1 -1
- package/build/plugins/resource/spfx/utils/progress-helper.js +8 -8
- package/build/plugins/resource/spfx/utils/progress-helper.js.map +1 -1
- package/build/plugins/resource/spfx/utils/questions.d.ts +10 -0
- package/build/plugins/resource/spfx/utils/questions.d.ts.map +1 -0
- package/build/plugins/resource/spfx/utils/questions.js +39 -0
- package/build/plugins/resource/spfx/utils/questions.js.map +1 -0
- package/build/plugins/resource/spfx/v3/error.d.ts +5 -0
- package/build/plugins/resource/spfx/v3/error.d.ts.map +1 -0
- package/build/plugins/resource/spfx/v3/error.js +20 -0
- package/build/plugins/resource/spfx/v3/error.js.map +1 -0
- package/build/plugins/resource/spfx/v3/index.d.ts +13 -0
- package/build/plugins/resource/spfx/v3/index.d.ts.map +1 -0
- package/build/plugins/resource/spfx/v3/index.js +122 -0
- package/build/plugins/resource/spfx/v3/index.js.map +1 -0
- package/build/plugins/resource/spfx/v3/plugin.d.ts +11 -0
- package/build/plugins/resource/spfx/v3/plugin.d.ts.map +1 -0
- package/build/plugins/resource/spfx/v3/plugin.js +290 -0
- package/build/plugins/resource/spfx/v3/plugin.js.map +1 -0
- package/build/plugins/resource/sql/v3/index.d.ts +9 -6
- package/build/plugins/resource/sql/v3/index.d.ts.map +1 -1
- package/build/plugins/resource/sql/v3/index.js +82 -20
- package/build/plugins/resource/sql/v3/index.js.map +1 -1
- package/build/plugins/resource/utils4v2.d.ts +3 -2
- package/build/plugins/resource/utils4v2.d.ts.map +1 -1
- package/build/plugins/resource/utils4v2.js +24 -7
- package/build/plugins/resource/utils4v2.js.map +1 -1
- package/build/plugins/solution/fx-solution/arm.d.ts +2 -2
- package/build/plugins/solution/fx-solution/arm.d.ts.map +1 -1
- package/build/plugins/solution/fx-solution/arm.js +52 -59
- package/build/plugins/solution/fx-solution/arm.js.map +1 -1
- package/build/plugins/solution/fx-solution/commonQuestions.d.ts +15 -3
- package/build/plugins/solution/fx-solution/commonQuestions.d.ts.map +1 -1
- package/build/plugins/solution/fx-solution/commonQuestions.js +14 -8
- package/build/plugins/solution/fx-solution/commonQuestions.js.map +1 -1
- package/build/plugins/solution/fx-solution/constants.d.ts +0 -2
- package/build/plugins/solution/fx-solution/constants.d.ts.map +1 -1
- package/build/plugins/solution/fx-solution/constants.js +0 -2
- package/build/plugins/solution/fx-solution/constants.js.map +1 -1
- package/build/plugins/solution/fx-solution/debug/error.d.ts +0 -1
- package/build/plugins/solution/fx-solution/debug/error.d.ts.map +1 -1
- package/build/plugins/solution/fx-solution/debug/error.js +1 -5
- package/build/plugins/solution/fx-solution/debug/error.js.map +1 -1
- package/build/plugins/solution/fx-solution/debug/provisionLocal.d.ts +3 -0
- package/build/plugins/solution/fx-solution/debug/provisionLocal.d.ts.map +1 -1
- package/build/plugins/solution/fx-solution/debug/provisionLocal.js +254 -28
- package/build/plugins/solution/fx-solution/debug/provisionLocal.js.map +1 -1
- package/build/plugins/solution/fx-solution/debug/scaffolding.d.ts +3 -4
- package/build/plugins/solution/fx-solution/debug/scaffolding.d.ts.map +1 -1
- package/build/plugins/solution/fx-solution/debug/scaffolding.js +18 -19
- package/build/plugins/solution/fx-solution/debug/scaffolding.js.map +1 -1
- package/build/plugins/solution/fx-solution/debug/util/launch.d.ts +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 +109 -290
- 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 +102 -236
- package/build/plugins/solution/fx-solution/debug/util/launchNext.js.map +1 -1
- package/build/plugins/solution/fx-solution/debug/util/tasks.d.ts +1 -1
- package/build/plugins/solution/fx-solution/debug/util/tasks.d.ts.map +1 -1
- package/build/plugins/solution/fx-solution/debug/util/tasks.js +12 -18
- package/build/plugins/solution/fx-solution/debug/util/tasks.js.map +1 -1
- package/build/plugins/solution/fx-solution/debug/util/tasksNext.d.ts.map +1 -1
- package/build/plugins/solution/fx-solution/debug/util/tasksNext.js +5 -5
- package/build/plugins/solution/fx-solution/debug/util/tasksNext.js.map +1 -1
- package/build/plugins/solution/fx-solution/question.d.ts +0 -2
- package/build/plugins/solution/fx-solution/question.d.ts.map +1 -1
- package/build/plugins/solution/fx-solution/question.js +1 -14
- package/build/plugins/solution/fx-solution/question.js.map +1 -1
- package/build/plugins/solution/fx-solution/solution.d.ts +0 -2
- package/build/plugins/solution/fx-solution/solution.d.ts.map +1 -1
- package/build/plugins/solution/fx-solution/solution.js +4 -84
- package/build/plugins/solution/fx-solution/solution.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 +17 -0
- package/build/plugins/solution/fx-solution/v2/deploy.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 +1 -6
- 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 +4 -0
- package/build/plugins/solution/fx-solution/v2/provision.js.map +1 -1
- package/build/plugins/solution/fx-solution/v2/provisionLocal.d.ts +2 -0
- package/build/plugins/solution/fx-solution/v2/provisionLocal.d.ts.map +1 -1
- package/build/plugins/solution/fx-solution/v2/provisionLocal.js +52 -11
- 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 +5 -8
- package/build/plugins/solution/fx-solution/v2/scaffolding.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 +0 -3
- package/build/plugins/solution/fx-solution/v2/utils.js.map +1 -1
- package/build/plugins/solution/fx-solution/v3/addFeature.d.ts +4 -3
- package/build/plugins/solution/fx-solution/v3/addFeature.d.ts.map +1 -1
- package/build/plugins/solution/fx-solution/v3/addFeature.js +124 -45
- package/build/plugins/solution/fx-solution/v3/addFeature.js.map +1 -1
- package/build/plugins/solution/fx-solution/v3/constants.d.ts +0 -1
- package/build/plugins/solution/fx-solution/v3/constants.d.ts.map +1 -1
- package/build/plugins/solution/fx-solution/v3/constants.js +2 -3
- package/build/plugins/solution/fx-solution/v3/constants.js.map +1 -1
- package/build/plugins/solution/fx-solution/v3/deploy.d.ts.map +1 -1
- package/build/plugins/solution/fx-solution/v3/deploy.js +21 -11
- package/build/plugins/solution/fx-solution/v3/deploy.js.map +1 -1
- package/build/plugins/solution/fx-solution/v3/provision.d.ts.map +1 -1
- package/build/plugins/solution/fx-solution/v3/provision.js +37 -24
- package/build/plugins/solution/fx-solution/v3/provision.js.map +1 -1
- package/build/plugins/solution/fx-solution/v3/solution.js +2 -2
- package/build/plugins/solution/fx-solution/v3/solution.js.map +1 -1
- package/build/plugins/solution/fx-solution/v3/userTask.d.ts.map +1 -1
- package/build/plugins/solution/fx-solution/v3/userTask.js +58 -58
- package/build/plugins/solution/fx-solution/v3/userTask.js.map +1 -1
- package/build/plugins/solution/spfx-solution/addFeature.d.ts.map +1 -1
- package/build/plugins/solution/spfx-solution/addFeature.js +0 -8
- package/build/plugins/solution/spfx-solution/addFeature.js.map +1 -1
- package/build/plugins/solution/utils/questions.d.ts +3 -3
- package/build/plugins/solution/utils/questions.d.ts.map +1 -1
- package/build/plugins/solution/utils/questions.js +6 -6
- package/build/plugins/solution/utils/questions.js.map +1 -1
- package/package.json +4 -3
- package/resource/strings.json +1 -0
- package/templates/plugins/resource/bot/bot-msgext.csharp.default.zip +0 -0
- package/templates/plugins/resource/bot/bot-msgext.js.default.zip +0 -0
- package/templates/plugins/resource/bot/bot-msgext.ts.default.zip +0 -0
- package/templates/plugins/resource/bot/bot.csharp.default.zip +0 -0
- package/templates/plugins/resource/bot/bot.js.default.zip +0 -0
- package/templates/plugins/resource/bot/bot.ts.default.zip +0 -0
- package/templates/plugins/resource/bot/msgext.js.default.zip +0 -0
- package/templates/plugins/resource/bot/msgext.ts.default.zip +0 -0
- package/templates/plugins/resource/dotnet/blazor-base.csharp.default.zip +0 -0
- package/templates/plugins/resource/frontend/tab.csharp.default.zip +0 -0
- package/templates/plugins/resource/frontend/tab.js.default.zip +0 -0
- package/templates/plugins/resource/frontend/tab.ts.default.zip +0 -0
- package/templates/plugins/resource/function/function-base.js.default.zip +0 -0
- package/templates/plugins/resource/function/function-base.ts.default.zip +0 -0
- package/templates/plugins/resource/function/function-triggers.js.HTTPTrigger.zip +0 -0
- package/templates/plugins/resource/function/function-triggers.ts.HTTPTrigger.zip +0 -0
- package/build/core/middleware/migrateConditionHandler.d.ts +0 -3
- package/build/core/middleware/migrateConditionHandler.d.ts.map +0 -1
- package/build/core/middleware/migrateConditionHandler.js +0 -23
- package/build/core/middleware/migrateConditionHandler.js.map +0 -1
- package/build/core/middleware/supportV1ConditionHandler.d.ts +0 -3
- package/build/core/middleware/supportV1ConditionHandler.d.ts.map +0 -1
- package/build/core/middleware/supportV1ConditionHandler.js +0 -23
- package/build/core/middleware/supportV1ConditionHandler.js.map +0 -1
- package/build/core/middleware/telemetrySender.d.ts +0 -6
- package/build/core/middleware/telemetrySender.d.ts.map +0 -1
- package/build/core/middleware/telemetrySender.js +0 -43
- package/build/core/middleware/telemetrySender.js.map +0 -1
- package/templates/plugins/resource/storage/bicep/azureStorageProvision.bicep +0 -25
- package/templates/plugins/resource/storage/bicep/provision.template.bicep +0 -15
|
@@ -16,6 +16,7 @@ var TelemetryPropertyKey;
|
|
|
16
16
|
TelemetryPropertyKey["updateExistingApp"] = "update";
|
|
17
17
|
TelemetryPropertyKey["success"] = "success";
|
|
18
18
|
TelemetryPropertyKey["appId"] = "appid";
|
|
19
|
+
TelemetryPropertyKey["tenantId"] = "tenant-id";
|
|
19
20
|
TelemetryPropertyKey["publishedAppId"] = "published-app-id";
|
|
20
21
|
TelemetryPropertyKey["customizedKeys"] = "customized-manifest-keys";
|
|
21
22
|
})(TelemetryPropertyKey = exports.TelemetryPropertyKey || (exports.TelemetryPropertyKey = {}));
|
|
@@ -32,7 +33,6 @@ var TelemetryEventName;
|
|
|
32
33
|
TelemetryEventName["validateManifest"] = "validate-manifest";
|
|
33
34
|
TelemetryEventName["buildTeamsPackage"] = "build";
|
|
34
35
|
TelemetryEventName["publish"] = "publish";
|
|
35
|
-
TelemetryEventName["migrateV1Project"] = "migrate-v1-project";
|
|
36
36
|
TelemetryEventName["updateManifest"] = "update-manifest";
|
|
37
37
|
TelemetryEventName["provision"] = "provision";
|
|
38
38
|
TelemetryEventName["provisionManifest"] = "provision-manifest";
|
|
@@ -51,32 +51,40 @@ class TelemetryUtils {
|
|
|
51
51
|
TelemetryUtils.ctx = ctx;
|
|
52
52
|
}
|
|
53
53
|
static sendStartEvent(eventName, properties, measurements) {
|
|
54
|
-
var _a, _b, _c;
|
|
54
|
+
var _a, _b, _c, _d, _e;
|
|
55
55
|
if (!properties) {
|
|
56
56
|
properties = {};
|
|
57
57
|
}
|
|
58
58
|
properties[TelemetryPropertyKey.component] = constants_1.Constants.PLUGIN_NAME;
|
|
59
|
-
const
|
|
59
|
+
const tenantId = (_b = (_a = this.ctx.envInfo) === null || _a === void 0 ? void 0 : _a.state.get(constants_2.PluginNames.SOLUTION)) === null || _b === void 0 ? void 0 : _b.get(constants_2.REMOTE_TEAMS_APP_TENANT_ID);
|
|
60
|
+
if (tenantId) {
|
|
61
|
+
properties[TelemetryPropertyKey.tenantId] = tenantId;
|
|
62
|
+
}
|
|
63
|
+
const teamsAppId = (_d = (_c = this.ctx.envInfo) === null || _c === void 0 ? void 0 : _c.state.get(constants_2.PluginNames.APPST)) === null || _d === void 0 ? void 0 : _d.get(constants_1.Constants.TEAMS_APP_ID);
|
|
60
64
|
if (teamsAppId) {
|
|
61
65
|
properties[TelemetryPropertyKey.appId] = teamsAppId;
|
|
62
66
|
}
|
|
63
|
-
(
|
|
67
|
+
(_e = TelemetryUtils.ctx.telemetryReporter) === null || _e === void 0 ? void 0 : _e.sendTelemetryErrorEvent(`${eventName}-start`, properties, measurements);
|
|
64
68
|
}
|
|
65
69
|
static sendSuccessEvent(eventName, properties, measurements) {
|
|
66
|
-
var _a, _b, _c;
|
|
70
|
+
var _a, _b, _c, _d, _e;
|
|
67
71
|
if (!properties) {
|
|
68
72
|
properties = {};
|
|
69
73
|
}
|
|
70
74
|
properties[TelemetryPropertyKey.component] = constants_1.Constants.PLUGIN_NAME;
|
|
71
75
|
properties[TelemetryPropertyKey.success] = TelemetryPropertyValue.success;
|
|
72
|
-
const
|
|
76
|
+
const tenantId = (_b = (_a = this.ctx.envInfo) === null || _a === void 0 ? void 0 : _a.state.get(constants_2.PluginNames.SOLUTION)) === null || _b === void 0 ? void 0 : _b.get(constants_2.REMOTE_TEAMS_APP_TENANT_ID);
|
|
77
|
+
if (tenantId) {
|
|
78
|
+
properties[TelemetryPropertyKey.tenantId] = tenantId;
|
|
79
|
+
}
|
|
80
|
+
const teamsAppId = (_d = (_c = this.ctx.envInfo) === null || _c === void 0 ? void 0 : _c.state.get(constants_2.PluginNames.APPST)) === null || _d === void 0 ? void 0 : _d.get(constants_1.Constants.TEAMS_APP_ID);
|
|
73
81
|
if (teamsAppId) {
|
|
74
82
|
properties[TelemetryPropertyKey.appId] = teamsAppId;
|
|
75
83
|
}
|
|
76
|
-
(
|
|
84
|
+
(_e = TelemetryUtils.ctx.telemetryReporter) === null || _e === void 0 ? void 0 : _e.sendTelemetryEvent(eventName, properties, measurements);
|
|
77
85
|
}
|
|
78
86
|
static sendErrorEvent(eventName, error, properties, measurements) {
|
|
79
|
-
var _a, _b, _c;
|
|
87
|
+
var _a, _b, _c, _d, _e;
|
|
80
88
|
if (!properties) {
|
|
81
89
|
properties = {};
|
|
82
90
|
}
|
|
@@ -90,11 +98,15 @@ class TelemetryUtils {
|
|
|
90
98
|
properties[TelemetryPropertyKey.errorCode] = `${error.source}.${error.name}`;
|
|
91
99
|
properties[TelemetryPropertyKey.errorMessage] = error.message;
|
|
92
100
|
properties[TelemetryPropertyKey.success] = TelemetryPropertyValue.failure;
|
|
93
|
-
const
|
|
101
|
+
const tenantId = (_b = (_a = this.ctx.envInfo) === null || _a === void 0 ? void 0 : _a.state.get(constants_2.PluginNames.SOLUTION)) === null || _b === void 0 ? void 0 : _b.get(constants_2.REMOTE_TEAMS_APP_TENANT_ID);
|
|
102
|
+
if (tenantId) {
|
|
103
|
+
properties[TelemetryPropertyKey.tenantId] = tenantId;
|
|
104
|
+
}
|
|
105
|
+
const teamsAppId = (_d = (_c = this.ctx.envInfo) === null || _c === void 0 ? void 0 : _c.state.get(constants_2.PluginNames.APPST)) === null || _d === void 0 ? void 0 : _d.get(constants_1.Constants.TEAMS_APP_ID);
|
|
94
106
|
if (teamsAppId) {
|
|
95
107
|
properties[TelemetryPropertyKey.appId] = teamsAppId;
|
|
96
108
|
}
|
|
97
|
-
(
|
|
109
|
+
(_e = TelemetryUtils.ctx.telemetryReporter) === null || _e === void 0 ? void 0 : _e.sendTelemetryErrorEvent(eventName, properties, measurements);
|
|
98
110
|
}
|
|
99
111
|
}
|
|
100
112
|
exports.TelemetryUtils = TelemetryUtils;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"telemetry.js","sourceRoot":"","sources":["../../../../../src/plugins/resource/appstudio/utils/telemetry.ts"],"names":[],"mappings":";AAAA,uCAAuC;AACvC,kCAAkC;;;AAElC,wDAAmF;AACnF,8CAA2C;AAC3C,
|
|
1
|
+
{"version":3,"file":"telemetry.js","sourceRoot":"","sources":["../../../../../src/plugins/resource/appstudio/utils/telemetry.ts"],"names":[],"mappings":";AAAA,uCAAuC;AACvC,kCAAkC;;;AAElC,wDAAmF;AACnF,8CAA2C;AAC3C,uEAAkG;AAElG,IAAY,oBAYX;AAZD,WAAY,oBAAoB;IAC9B,+CAAuB,CAAA;IACvB,gDAAwB,CAAA;IACxB,gDAAwB,CAAA;IACxB,sDAA8B,CAAA;IAC9B,8DAAsC,CAAA;IACtC,oDAA4B,CAAA;IAC5B,2CAAmB,CAAA;IACnB,uCAAe,CAAA;IACf,8CAAsB,CAAA;IACtB,2DAAmC,CAAA;IACnC,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AK,CAAC,0CACrB,GAAG,CAAC,qBAAS,CAAC,YAAY,CAAW,CAAC;QAC1C,IAAI,UAAU,EAAE;YACd,UAAU,CAAC,oBAAoB,CAAC,KAAK,CAAC,GAAG,UAAU,CAAC;SACrD;QACD,MAAA,cAAc,CAAC,GAAG,CAAC,iBAAiB,0CAAE,uBAAuB,CAC3D,SAAS,EACT,UAAU,EACV,YAAY,CACb,CAAC;IACJ,CAAC;CACF;AAjGD,wCAiGC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { AppStudioTokenProvider, Func, FxError, Inputs, Json, ProjectSettings, QTreeNode, Result, TokenProvider, v2, Void } from "@microsoft/teamsfx-api";
|
|
2
|
-
import { Context, DeepReadonly, ProvisionInputs, ResourcePlugin } from "@microsoft/teamsfx-api/build/v2";
|
|
2
|
+
import { Context, DeepReadonly, EnvInfoV2, ProvisionInputs, ResourcePlugin } from "@microsoft/teamsfx-api/build/v2";
|
|
3
3
|
import { AppStudioPlugin } from "..";
|
|
4
4
|
export declare class AppStudioPluginV2 implements ResourcePlugin {
|
|
5
5
|
name: string;
|
|
@@ -9,7 +9,7 @@ export declare class AppStudioPluginV2 implements ResourcePlugin {
|
|
|
9
9
|
scaffoldSourceCode(ctx: Context, inputs: Inputs): Promise<Result<Void, FxError>>;
|
|
10
10
|
provisionResource(ctx: Context, inputs: ProvisionInputs, envInfo: v2.EnvInfoV2, tokenProvider: TokenProvider): Promise<Result<Void, FxError>>;
|
|
11
11
|
configureResource(ctx: Context, inputs: Readonly<ProvisionInputs>, envInfo: v2.EnvInfoV2, tokenProvider: TokenProvider): Promise<Result<Void, FxError>>;
|
|
12
|
-
configureLocalResource(ctx: Context, inputs: Inputs, localSettings: Json, tokenProvider: TokenProvider): Promise<Result<Void, FxError>>;
|
|
12
|
+
configureLocalResource(ctx: Context, inputs: Inputs, localSettings: Json, tokenProvider: TokenProvider, envInfo?: EnvInfoV2): Promise<Result<Void, FxError>>;
|
|
13
13
|
executeUserTask(ctx: Context, inputs: Inputs, func: Func, localSettings: Json, envInfo: v2.EnvInfoV2, tokenProvider: TokenProvider): Promise<Result<unknown, FxError>>;
|
|
14
14
|
getQuestions(ctx: Context, inputs: Inputs, envInfo: v2.EnvInfoV2, tokenProvider: TokenProvider): Promise<Result<QTreeNode | undefined, FxError>>;
|
|
15
15
|
publishApplication(ctx: Context, inputs: Inputs, envInfo: DeepReadonly<v2.EnvInfoV2>, tokenProvider: AppStudioTokenProvider): Promise<Result<Void, FxError>>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/plugins/resource/appstudio/v2/index.ts"],"names":[],"mappings":"AAGA,OAAO,EACL,sBAAsB,EAItB,IAAI,EACJ,OAAO,EACP,MAAM,EACN,IAAI,EAGJ,eAAe,EACf,SAAS,EACT,MAAM,EACN,aAAa,EACb,EAAE,EACF,IAAI,EACL,MAAM,wBAAwB,CAAC;AAChC,OAAO,EACL,OAAO,EACP,YAAY,EACZ,eAAe,EACf,cAAc,EAGf,MAAM,iCAAiC,CAAC;AAEzC,OAAO,EAAE,eAAe,EAAE,MAAM,IAAI,CAAC;AAkBrC,qBACa,iBAAkB,YAAW,cAAc;IACtD,IAAI,SAA2B;IAC/B,WAAW,SAAgB;IAE3B,MAAM,EAAG,eAAe,CAAC;IAEzB,QAAQ,CAAC,eAAe,EAAE,eAAe,GAAG,OAAO;IAK7C,kBAAkB,CAAC,GAAG,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;IAIhF,iBAAiB,CACrB,GAAG,EAAE,OAAO,EACZ,MAAM,EAAE,eAAe,EACvB,OAAO,EAAE,EAAE,CAAC,SAAS,EACrB,aAAa,EAAE,aAAa,GAC3B,OAAO,CAAC,MAAM,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;IAI3B,iBAAiB,CACrB,GAAG,EAAE,OAAO,EACZ,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AAE,EAAE,CAAC,qBAAqB,EAChC,OAAO,EAAE,YAAY,CAAC,EAAE,CAAC,SAAS,CAAC,EACnC,aAAa,EAAE,aAAa,EAC5B,QAAQ,EAAE,IAAI,GACb,OAAO,CAAC,MAAM,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;IAY3B,gBAAgB,CACpB,GAAG,EAAE,OAAO,EACZ,MAAM,EAAE,EAAE,CAAC,qBAAqB,EAChC,OAAO,EAAE,YAAY,CAAC,EAAE,CAAC,SAAS,CAAC,EACnC,aAAa,EAAE,aAAa,EAC5B,QAAQ,EAAE,IAAI,GACb,OAAO,CAAC,MAAM,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;CAWlC"}
|
|
@@ -27,8 +27,8 @@ let AppStudioPluginV2 = class AppStudioPluginV2 {
|
|
|
27
27
|
async configureResource(ctx, inputs, envInfo, tokenProvider) {
|
|
28
28
|
return await utils4v2_1.configureResourceAdapter(ctx, inputs, envInfo, tokenProvider, this.plugin);
|
|
29
29
|
}
|
|
30
|
-
async configureLocalResource(ctx, inputs, localSettings, tokenProvider) {
|
|
31
|
-
return await utils4v2_1.configureLocalResourceAdapter(ctx, inputs, localSettings, tokenProvider, this.plugin);
|
|
30
|
+
async configureLocalResource(ctx, inputs, localSettings, tokenProvider, envInfo) {
|
|
31
|
+
return await utils4v2_1.configureLocalResourceAdapter(ctx, inputs, localSettings, tokenProvider, this.plugin, envInfo);
|
|
32
32
|
}
|
|
33
33
|
async executeUserTask(ctx, inputs, func, localSettings, envInfo, tokenProvider) {
|
|
34
34
|
return await utils4v2_1.executeUserTaskAdapter(ctx, inputs, func, localSettings, envInfo, tokenProvider, this.plugin);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/plugins/resource/appstudio/v2/index.ts"],"names":[],"mappings":";AAAA,uCAAuC;AACvC,kCAAkC;;;;AAElC,wDAiBgC;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot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B,QAAc;QAEd,OAAO,kCAAuB,CAC5B,GAAG,EACH,MAAM,EACN,OAAO,EACP,aAAa,EACb,QAAQ,EACR,IAAI,CAAC,MAAM,EACX,iBAAiB,CAClB,CAAC;IACJ,CAAC;IAED,KAAK,CAAC,eAAe,CACnB,GAAY,EACZ,MAAgC,EAChC,OAAmC,EACnC,aAA4B,EAC5B,QAAc;QAEd,OAAO,kCAAuB,CAC5B,GAAG,EACH,MAAM,EACN,OAAO,EACP,aAAa,EACb,QAAQ,EACR,IAAI,CAAC,MAAM,EACX,iBAAiB,CAClB,CAAC;IACJ,CAAC;IAED,KAAK,CAAC,gBAAgB,CACpB,GAAY,EACZ,MAAgC,EAChC,OAAmC,EACnC,aAA4B,EAC5B,QAAc;QAEd,OAAO,kCAAuB,CAC5B,GAAG,EACH,MAAM,EACN,OAAO,EACP,aAAa,EACb,QAAQ,EACR,IAAI,CAAC,MAAM,EACX,kBAAkB,CACnB,CAAC;IACJ,CAAC;CACF,CAAA;AA5JC;IADC,eAAM,CAAC,yCAAe,CAAC,eAAe,CAAC;sCAC/B,mBAAe;iDAAC;AAJd,iBAAiB;IAD7B,gBAAO,CAAC,2CAAiB,CAAC,eAAe,CAAC;GAC9B,iBAAiB,CAgK7B;AAhKY,8CAAiB"}
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
import { FxError, Result, v2, TeamsAppManifest, TokenProvider, Void, v3 } from "@microsoft/teamsfx-api";
|
|
1
|
+
import { FxError, Result, v2, TeamsAppManifest, TokenProvider, Void, v3, AppStudioTokenProvider } from "@microsoft/teamsfx-api";
|
|
2
|
+
import { ResourcePermission, TeamsAppAdmin } from "../../../../common/permissionInterface";
|
|
3
|
+
import { IUserList } from "../interfaces/IAppDefinition";
|
|
2
4
|
export declare class AppStudioPluginV3 {
|
|
3
5
|
name: string;
|
|
4
6
|
displayName: string;
|
|
@@ -18,6 +20,20 @@ export declare class AppStudioPluginV3 {
|
|
|
18
20
|
* @returns
|
|
19
21
|
*/
|
|
20
22
|
addCapabilities(ctx: v2.Context, inputs: v2.InputsWithProjectPath, capabilities: v3.ManifestCapability[]): Promise<Result<any, FxError>>;
|
|
23
|
+
/**
|
|
24
|
+
* Update existing manifest template
|
|
25
|
+
* @param ctx
|
|
26
|
+
* @param inputs
|
|
27
|
+
* @param capability
|
|
28
|
+
*/
|
|
29
|
+
updateCapability(ctx: v2.Context, inputs: v2.InputsWithProjectPath, capability: v3.ManifestCapability): Promise<Result<any, FxError>>;
|
|
30
|
+
/**
|
|
31
|
+
* Delete existing manifest template
|
|
32
|
+
* @param ctx
|
|
33
|
+
* @param inputs
|
|
34
|
+
* @param capability
|
|
35
|
+
*/
|
|
36
|
+
deleteCapability(ctx: v2.Context, inputs: v2.InputsWithProjectPath, capability: v3.ManifestCapability): Promise<Result<any, FxError>>;
|
|
21
37
|
/**
|
|
22
38
|
* Should conside both local and remote
|
|
23
39
|
* @returns
|
|
@@ -43,9 +59,13 @@ export declare class AppStudioPluginV3 {
|
|
|
43
59
|
* @param capability
|
|
44
60
|
* @returns
|
|
45
61
|
*/
|
|
46
|
-
capabilityExceedLimit(ctx: v2.Context, inputs: v2.InputsWithProjectPath, capability: "staticTab" | "configurableTab" | "Bot" | "MessageExtension"): Promise<Result<boolean, FxError>>;
|
|
62
|
+
capabilityExceedLimit(ctx: v2.Context, inputs: v2.InputsWithProjectPath, capability: "staticTab" | "configurableTab" | "Bot" | "MessageExtension" | "WebApplicationInfo"): Promise<Result<boolean, FxError>>;
|
|
47
63
|
registerTeamsApp(ctx: v2.Context, inputs: v2.InputsWithProjectPath, envInfo: v3.EnvInfoV3, tokenProvider: TokenProvider): Promise<Result<string, FxError>>;
|
|
48
|
-
updateTeamsApp(ctx: v2.Context, inputs: v2.InputsWithProjectPath, envInfo: v3.EnvInfoV3): Promise<Result<
|
|
49
|
-
publishTeamsApp(ctx: v2.Context, inputs: v2.InputsWithProjectPath, envInfo: v3.EnvInfoV3): Promise<Result<Void, FxError>>;
|
|
64
|
+
updateTeamsApp(ctx: v2.Context, inputs: v2.InputsWithProjectPath, envInfo: v3.EnvInfoV3, tokenProvider: TokenProvider): Promise<Result<string, FxError>>;
|
|
65
|
+
publishTeamsApp(ctx: v2.Context, inputs: v2.InputsWithProjectPath, envInfo: v3.EnvInfoV3, tokenProvider: TokenProvider): Promise<Result<Void, FxError>>;
|
|
66
|
+
private getTeamsAppId;
|
|
67
|
+
listCollaborator(ctx: v2.Context, inputs: v2.InputsWithProjectPath, envInfo: v3.EnvInfoV3, appStudioTokenProvider: AppStudioTokenProvider): Promise<Result<TeamsAppAdmin[], FxError>>;
|
|
68
|
+
checkPermission(ctx: v2.Context, inputs: v2.InputsWithProjectPath, envInfo: v3.EnvInfoV3, appStudioTokenProvider: AppStudioTokenProvider, userInfo: IUserList): Promise<Result<ResourcePermission[], FxError>>;
|
|
69
|
+
grantPermission(ctx: v2.Context, inputs: v2.InputsWithProjectPath, envInfo: v3.EnvInfoV3, appStudioTokenProvider: AppStudioTokenProvider, userInfo: IUserList): Promise<Result<ResourcePermission[], FxError>>;
|
|
50
70
|
}
|
|
51
71
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/plugins/resource/appstudio/v3/index.ts"],"names":[],"mappings":"AAGA,OAAO,EACL,OAAO,EACP,MAAM,EAEN,EAAE,EACF,gBAAgB,EAIhB,aAAa,EACb,IAAI,EACJ,EAAE,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/plugins/resource/appstudio/v3/index.ts"],"names":[],"mappings":"AAGA,OAAO,EACL,OAAO,EACP,MAAM,EAEN,EAAE,EACF,gBAAgB,EAIhB,aAAa,EACb,IAAI,EACJ,EAAE,EACF,sBAAsB,EAEvB,MAAM,wBAAwB,CAAC;AA8BhC,OAAO,EAAE,kBAAkB,EAAE,aAAa,EAAE,MAAM,wCAAwC,CAAC;AAG3F,OAAO,EAAE,S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AC,aAAa,EAAE,EAAE,OAAO,CAAC,CAAC;IA0CtC,eAAe,CACnB,GAAG,EAAE,EAAE,CAAC,OAAO,EACf,MAAM,EAAE,EAAE,CAAC,qBAAqB,EAChC,OAAO,EAAE,EAAE,CAAC,SAAS,EACrB,sBAAsB,EAAE,sBAAsB,EAC9C,QAAQ,EAAE,SAAS,GAClB,OAAO,CAAC,MAAM,CAAC,kBAAkB,EAAE,EAAE,OAAO,CAAC,CAAC;IAgCpC,eAAe,CAC1B,GAAG,EAAE,EAAE,CAAC,OAAO,EACf,MAAM,EAAE,EAAE,CAAC,qBAAqB,EAChC,OAAO,EAAE,EAAE,CAAC,SAAS,EACrB,sBAAsB,EAAE,sBAAsB,EAC9C,QAAQ,EAAE,SAAS,GAClB,OAAO,CAAC,MAAM,CAAC,kBAAkB,EAAE,EAAE,OAAO,CAAC,CAAC;CAqClD"}
|
|
@@ -17,6 +17,8 @@ const fs_extra_1 = tslib_1.__importDefault(require("fs-extra"));
|
|
|
17
17
|
const constants_2 = require("../constants");
|
|
18
18
|
const telemetry_1 = require("../utils/telemetry");
|
|
19
19
|
const plugin_1 = require("./plugin");
|
|
20
|
+
const isUUID_1 = tslib_1.__importDefault(require("validator/lib/isUUID"));
|
|
21
|
+
const appStudio_1 = require("../appStudio");
|
|
20
22
|
let AppStudioPluginV3 = class AppStudioPluginV3 {
|
|
21
23
|
constructor() {
|
|
22
24
|
this.name = "fx-resource-appstudio";
|
|
@@ -75,6 +77,24 @@ let AppStudioPluginV3 = class AppStudioPluginV3 {
|
|
|
75
77
|
}
|
|
76
78
|
return res;
|
|
77
79
|
}
|
|
80
|
+
/**
|
|
81
|
+
* Update existing manifest template
|
|
82
|
+
* @param ctx
|
|
83
|
+
* @param inputs
|
|
84
|
+
* @param capability
|
|
85
|
+
*/
|
|
86
|
+
async updateCapability(ctx, inputs, capability) {
|
|
87
|
+
return await manifestTemplate_1.updateCapability(inputs.projectPath, capability);
|
|
88
|
+
}
|
|
89
|
+
/**
|
|
90
|
+
* Delete existing manifest template
|
|
91
|
+
* @param ctx
|
|
92
|
+
* @param inputs
|
|
93
|
+
* @param capability
|
|
94
|
+
*/
|
|
95
|
+
async deleteCapability(ctx, inputs, capability) {
|
|
96
|
+
return await manifestTemplate_1.deleteCapability(inputs.projectPath, capability);
|
|
97
|
+
}
|
|
78
98
|
/**
|
|
79
99
|
* Should conside both local and remote
|
|
80
100
|
* @returns
|
|
@@ -133,7 +153,7 @@ let AppStudioPluginV3 = class AppStudioPluginV3 {
|
|
|
133
153
|
async registerTeamsApp(ctx, inputs, envInfo, tokenProvider) {
|
|
134
154
|
telemetry_1.TelemetryUtils.init(ctx);
|
|
135
155
|
telemetry_1.TelemetryUtils.sendStartEvent(telemetry_1.TelemetryEventName.provisionManifest);
|
|
136
|
-
const result = await this.appStudioPluginImpl.
|
|
156
|
+
const result = await this.appStudioPluginImpl.createOrUpdateTeamsApp(ctx, inputs, envInfo, tokenProvider);
|
|
137
157
|
if (result.isOk()) {
|
|
138
158
|
const properties = {};
|
|
139
159
|
properties[telemetry_1.TelemetryPropertyKey.appId] = result.value;
|
|
@@ -144,11 +164,119 @@ let AppStudioPluginV3 = class AppStudioPluginV3 {
|
|
|
144
164
|
}
|
|
145
165
|
return result;
|
|
146
166
|
}
|
|
147
|
-
async updateTeamsApp(ctx, inputs, envInfo) {
|
|
148
|
-
|
|
167
|
+
async updateTeamsApp(ctx, inputs, envInfo, tokenProvider) {
|
|
168
|
+
telemetry_1.TelemetryUtils.init(ctx);
|
|
169
|
+
telemetry_1.TelemetryUtils.sendStartEvent(telemetry_1.TelemetryEventName.updateManifest);
|
|
170
|
+
const result = await this.appStudioPluginImpl.createOrUpdateTeamsApp(ctx, inputs, envInfo, tokenProvider);
|
|
171
|
+
if (result.isOk()) {
|
|
172
|
+
const properties = {};
|
|
173
|
+
properties[telemetry_1.TelemetryPropertyKey.appId] = result.value;
|
|
174
|
+
telemetry_1.TelemetryUtils.sendSuccessEvent(telemetry_1.TelemetryEventName.updateManifest);
|
|
175
|
+
}
|
|
176
|
+
else {
|
|
177
|
+
telemetry_1.TelemetryUtils.sendErrorEvent(telemetry_1.TelemetryEventName.updateManifest, result.error);
|
|
178
|
+
}
|
|
179
|
+
return result;
|
|
149
180
|
}
|
|
150
|
-
async publishTeamsApp(ctx, inputs, envInfo) {
|
|
151
|
-
|
|
181
|
+
async publishTeamsApp(ctx, inputs, envInfo, tokenProvider) {
|
|
182
|
+
telemetry_1.TelemetryUtils.init(ctx);
|
|
183
|
+
telemetry_1.TelemetryUtils.sendStartEvent(telemetry_1.TelemetryEventName.publish);
|
|
184
|
+
const result = await this.appStudioPluginImpl.publishTeamsApp(ctx, inputs, envInfo, tokenProvider);
|
|
185
|
+
if (result.isOk()) {
|
|
186
|
+
const properties = {};
|
|
187
|
+
properties[telemetry_1.TelemetryPropertyKey.publishedAppId] = result.value.publishedAppId;
|
|
188
|
+
properties[telemetry_1.TelemetryPropertyKey.updateExistingApp] = String(result.value.update);
|
|
189
|
+
telemetry_1.TelemetryUtils.sendSuccessEvent(telemetry_1.TelemetryEventName.publish);
|
|
190
|
+
}
|
|
191
|
+
else {
|
|
192
|
+
telemetry_1.TelemetryUtils.sendErrorEvent(telemetry_1.TelemetryEventName.publish, result.error);
|
|
193
|
+
}
|
|
194
|
+
return result;
|
|
195
|
+
}
|
|
196
|
+
async getTeamsAppId(ctx, inputs, envInfo) {
|
|
197
|
+
let teamsAppId = "";
|
|
198
|
+
// User may manually update id in manifest template file, rather than configuration file
|
|
199
|
+
// The id in manifest template file should override configurations
|
|
200
|
+
const manifestResult = await this.loadManifest(ctx, inputs);
|
|
201
|
+
if (manifestResult.isOk()) {
|
|
202
|
+
teamsAppId = manifestResult.value.remote.id;
|
|
203
|
+
}
|
|
204
|
+
if (!isUUID_1.default(teamsAppId)) {
|
|
205
|
+
teamsAppId = envInfo.state[this.name].teamsAppId;
|
|
206
|
+
}
|
|
207
|
+
return teamsAppId;
|
|
208
|
+
}
|
|
209
|
+
async listCollaborator(ctx, inputs, envInfo, appStudioTokenProvider) {
|
|
210
|
+
const teamsAppId = await this.getTeamsAppId(ctx, inputs, envInfo);
|
|
211
|
+
if (!teamsAppId) {
|
|
212
|
+
return teamsfx_api_1.err(new teamsfx_api_1.UserError("GetConfigError", constants_2.ErrorMessages.GetConfigError(constants_2.Constants.TEAMS_APP_ID, this.name), constants_2.Constants.PLUGIN_NAME));
|
|
213
|
+
}
|
|
214
|
+
const appStudioToken = await appStudioTokenProvider.getAccessToken();
|
|
215
|
+
let userLists;
|
|
216
|
+
try {
|
|
217
|
+
userLists = await appStudio_1.AppStudioClient.getUserList(teamsAppId, appStudioToken);
|
|
218
|
+
if (!userLists) {
|
|
219
|
+
return teamsfx_api_1.ok([]);
|
|
220
|
+
}
|
|
221
|
+
}
|
|
222
|
+
catch (error) {
|
|
223
|
+
if (error.name === 404) {
|
|
224
|
+
error.message = constants_2.ErrorMessages.TeamsAppNotFound(teamsAppId);
|
|
225
|
+
}
|
|
226
|
+
throw error;
|
|
227
|
+
}
|
|
228
|
+
const teamsAppAdmin = userLists
|
|
229
|
+
.filter((userList) => {
|
|
230
|
+
return userList.isAdministrator;
|
|
231
|
+
})
|
|
232
|
+
.map((userList) => {
|
|
233
|
+
return {
|
|
234
|
+
userObjectId: userList.aadId,
|
|
235
|
+
displayName: userList.displayName,
|
|
236
|
+
userPrincipalName: userList.userPrincipalName,
|
|
237
|
+
resourceId: teamsAppId,
|
|
238
|
+
};
|
|
239
|
+
});
|
|
240
|
+
return teamsfx_api_1.ok(teamsAppAdmin);
|
|
241
|
+
}
|
|
242
|
+
async checkPermission(ctx, inputs, envInfo, appStudioTokenProvider, userInfo) {
|
|
243
|
+
const appStudioToken = await appStudioTokenProvider.getAccessToken();
|
|
244
|
+
const teamsAppId = await this.getTeamsAppId(ctx, inputs, envInfo);
|
|
245
|
+
if (!teamsAppId) {
|
|
246
|
+
return teamsfx_api_1.err(new teamsfx_api_1.UserError("GetConfigError", constants_2.ErrorMessages.GetConfigError(constants_2.Constants.TEAMS_APP_ID, this.name), constants_2.Constants.PLUGIN_NAME));
|
|
247
|
+
}
|
|
248
|
+
const teamsAppRoles = await appStudio_1.AppStudioClient.checkPermission(teamsAppId, appStudioToken, userInfo.aadId);
|
|
249
|
+
const result = [
|
|
250
|
+
{
|
|
251
|
+
name: constants_2.Constants.PERMISSIONS.name,
|
|
252
|
+
roles: [teamsAppRoles],
|
|
253
|
+
type: constants_2.Constants.PERMISSIONS.type,
|
|
254
|
+
resourceId: teamsAppId,
|
|
255
|
+
},
|
|
256
|
+
];
|
|
257
|
+
return teamsfx_api_1.ok(result);
|
|
258
|
+
}
|
|
259
|
+
async grantPermission(ctx, inputs, envInfo, appStudioTokenProvider, userInfo) {
|
|
260
|
+
const appStudioToken = await appStudioTokenProvider.getAccessToken();
|
|
261
|
+
const teamsAppId = await this.getTeamsAppId(ctx, inputs, envInfo);
|
|
262
|
+
if (!teamsAppId) {
|
|
263
|
+
return teamsfx_api_1.err(new teamsfx_api_1.UserError(errors_1.AppStudioError.GrantPermissionFailedError.name, errors_1.AppStudioError.GrantPermissionFailedError.message(constants_2.ErrorMessages.GetConfigError(constants_2.Constants.TEAMS_APP_ID, this.name)), constants_2.Constants.PLUGIN_NAME));
|
|
264
|
+
}
|
|
265
|
+
try {
|
|
266
|
+
await appStudio_1.AppStudioClient.grantPermission(teamsAppId, appStudioToken, userInfo);
|
|
267
|
+
}
|
|
268
|
+
catch (error) {
|
|
269
|
+
return teamsfx_api_1.err(new teamsfx_api_1.UserError(errors_1.AppStudioError.GrantPermissionFailedError.name, errors_1.AppStudioError.GrantPermissionFailedError.message(error === null || error === void 0 ? void 0 : error.message, teamsAppId), constants_2.Constants.PLUGIN_NAME));
|
|
270
|
+
}
|
|
271
|
+
const result = [
|
|
272
|
+
{
|
|
273
|
+
name: constants_2.Constants.PERMISSIONS.name,
|
|
274
|
+
roles: [constants_2.Constants.PERMISSIONS.admin],
|
|
275
|
+
type: constants_2.Constants.PERMISSIONS.type,
|
|
276
|
+
resourceId: teamsAppId,
|
|
277
|
+
},
|
|
278
|
+
];
|
|
279
|
+
return teamsfx_api_1.ok(result);
|
|
152
280
|
}
|
|
153
281
|
};
|
|
154
282
|
AppStudioPluginV3 = tslib_1.__decorate([
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/plugins/resource/appstudio/v3/index.ts"],"names":[],"mappings":";AAAA,uCAAuC;AACvC,kCAAkC;;;;AAElC,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/plugins/resource/appstudio/v3/index.ts"],"names":[],"mappings":";AAAA,uCAAuC;AACvC,kCAAkC;;;;AAElC,wDAcgC;AAChC,mCAAiC;AACjC,0EAAuF;AACvF,6CAAuD;AACvD,wCAAoD;AACpD,sCAA2C;AAC3C,0DAQ6B;AAC7B,+CAAwD;AACxD,mDAA6B;AAC7B,gEAA0B;AAC1B,4CASsB;AACtB,kDAA8F;AAC9F,qCAA+C;AAE/C,0EAA0C;AAC1C,4CAA+C;AAI/C,IAAa,iBAAiB,GAA9B,MAAa,iBAAiB;IAA9B;QACE,SAAI,GAAG,uBAAuB,CAAC;QAC/B,gBAAW,GAAG,YAAY,CAAC;QAEnB,wBAAmB,GAAG,IAAI,4BAAmB,EAAE,CAAC;IA+X1D,CAAC;IA7XC;;;;;OAKG;IACH,KAAK,CAAC,IAAI,CAAC,GAAe,EAAE,MAAgC;QAC1D,0BAAc,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;QACzB,0BAAc,CAAC,cAAc,CAAC,8BAAkB,CAAC,IAAI,CAAC,CAAC;QACvD,MAAM,GAAG,GAAG,MAAM,uBAAI,CAAC,MAAM,CAAC,WAAW,EAAE,GAAG,CAAC,cAAc,CAAC,OAAO,CAAC,CAAC;QACvE,IAAI,GAAG,CAAC,KAAK,EAAE;YAAE,OAAO,iBAAG,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;QACvC,MAAM,eA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F;QAAC,OAAO,KAAU,EAAE;YACnB,OAAO,iBAAG,CACR,IAAI,uBAAS,CACX,uBAAc,CAAC,0BAA0B,CAAC,IAAI,EAC9C,uBAAc,CAAC,0BAA0B,CAAC,OAAO,CAAC,KAAK,aAAL,KAAK,uBAAL,KAAK,CAAE,OAAO,EAAE,UAAU,CAAC,EAC7E,qBAAS,CAAC,WAAW,CACtB,CACF,CAAC;SACH;QACD,MAAM,MAAM,GAAyB;YACnC;gBACE,IAAI,EAAE,qBAAS,CAAC,WAAW,CAAC,IAAI;gBAChC,KAAK,EAAE,CAAC,qBAAS,CAAC,WAAW,CAAC,KAAK,CAAC;gBACpC,IAAI,EAAE,qBAAS,CAAC,WAAW,CAAC,IAAI;gBAChC,UAAU,EAAE,UAAU;aACvB;SACF,CAAC;QACF,OAAO,gBAAE,CAAC,MAAM,CAAC,CAAC;IACpB,CAAC;CACF,CAAA;AAnYY,iBAAiB;IAD7B,gBAAO,CAAC,qCAAyB,CAAC,SAAS,CAAC;GAChC,iBAAiB,CAmY7B;AAnYY,8CAAiB"}
|
|
@@ -1,8 +1,21 @@
|
|
|
1
|
-
import { v2, v3, Result, FxError, TokenProvider } from "@microsoft/teamsfx-api";
|
|
1
|
+
import { v2, v3, Result, FxError, TeamsAppManifest, TokenProvider } from "@microsoft/teamsfx-api";
|
|
2
2
|
export declare class AppStudioPluginImpl {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
3
|
+
createOrUpdateTeamsApp(ctx: v2.Context, inputs: v2.InputsWithProjectPath, envInfo: v3.EnvInfoV3, tokenProvider: TokenProvider): Promise<Result<string, FxError>>;
|
|
4
|
+
publishTeamsApp(ctx: v2.Context, inputs: v2.InputsWithProjectPath, envInfo: v3.EnvInfoV3, tokenProvider: TokenProvider): Promise<Result<{
|
|
5
|
+
appName: string;
|
|
6
|
+
publishedAppId: string;
|
|
7
|
+
update: boolean;
|
|
8
|
+
}, FxError>>;
|
|
9
|
+
/**
|
|
10
|
+
* Build appPackage.{envName}.zip
|
|
11
|
+
* @returns Path for built Teams app package
|
|
12
|
+
*/
|
|
13
|
+
buildTeamsAppPackage(projectPath: string, envInfo: v3.EnvInfoV3): Promise<Result<string, FxError>>;
|
|
14
|
+
/**
|
|
15
|
+
* Validate manifest
|
|
16
|
+
* @returns an array of validation error strings
|
|
17
|
+
*/
|
|
18
|
+
validateManifest(manifest: TeamsAppManifest): Promise<Result<string[], FxError>>;
|
|
6
19
|
private getAppDefinitionAndManifest;
|
|
7
20
|
}
|
|
8
21
|
//# sourceMappingURL=plugin.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plugin.d.ts","sourceRoot":"","sources":["../../../../../src/plugins/resource/appstudio/v3/plugin.ts"],"names":[],"mappings":"AAGA,OAAO,EACL,EAAE,EACF,EAAE,EACF,MAAM,EACN,OAAO,
|
|
1
|
+
{"version":3,"file":"plugin.d.ts","sourceRoot":"","sources":["../../../../../src/plugins/resource/appstudio/v3/plugin.ts"],"names":[],"mappings":"AAGA,OAAO,EACL,EAAE,EACF,EAAE,EACF,MAAM,EACN,OAAO,EACP,gBAAgB,EAGhB,aAAa,EAGd,MAAM,wBAAwB,CAAC;AAYhC,qBAAa,mBAAmB;IACjB,sBAAsB,CACjC,GAAG,EAAE,EAAE,CAAC,OAAO,EACf,MAAM,EAAE,EAAE,CAAC,qBAAqB,EAChC,OAAO,EAAE,EAAE,CAAC,SAAS,EACrB,aAAa,EAAE,aAAa,GAC3B,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IA6FtB,eAAe,CAC1B,GAAG,EAAE,EAAE,CAAC,OAAO,EACf,MAAM,EAAE,EAAE,CAAC,qBAAqB,EAChC,OAAO,EAAE,EAAE,CAAC,SAAS,EACrB,aAAa,EAAE,aAAa,GAC3B,OAAO,CAAC,MAAM,CAAC;QAAE,OAAO,EAAE,MAAM,CAAC;QAAC,cAAc,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,OAAO,CAAA;KAAE,EAAE,OAAO,CAAC,CAAC;IAyEzF;;;OAGG;IACU,oBAAoB,CAC/B,WAAW,EAAE,MAAM,EACnB,OAAO,EAAE,EAAE,CAAC,SAAS,GACpB,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAkDnC;;;OAGG;IACU,gBAAgB,CAAC,QAAQ,EAAE,gBAAgB,GAAG,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,EAAE,OAAO,CAAC,CAAC;YAK/E,2BAA2B;CAuB1C"}
|
|
@@ -13,8 +13,9 @@ const errors_1 = require("../errors");
|
|
|
13
13
|
const common_1 = require("../../../../common");
|
|
14
14
|
const constants_1 = require("../constants");
|
|
15
15
|
const utils_1 = require("../utils/utils");
|
|
16
|
+
const manifestTemplate_1 = require("../manifestTemplate");
|
|
16
17
|
class AppStudioPluginImpl {
|
|
17
|
-
async
|
|
18
|
+
async createOrUpdateTeamsApp(ctx, inputs, envInfo, tokenProvider) {
|
|
18
19
|
var _a, _b, _c, _d;
|
|
19
20
|
let archivedFile;
|
|
20
21
|
// User provided zip file
|
|
@@ -27,28 +28,11 @@ class AppStudioPluginImpl {
|
|
|
27
28
|
}
|
|
28
29
|
}
|
|
29
30
|
else {
|
|
30
|
-
const
|
|
31
|
-
if (
|
|
32
|
-
return teamsfx_api_1.err(
|
|
31
|
+
const buildPackage = await this.buildTeamsAppPackage(inputs.projectPath, envInfo);
|
|
32
|
+
if (buildPackage.isErr()) {
|
|
33
|
+
return teamsfx_api_1.err(buildPackage.error);
|
|
33
34
|
}
|
|
34
|
-
|
|
35
|
-
manifest.bots = undefined;
|
|
36
|
-
manifest.composeExtensions = undefined;
|
|
37
|
-
return teamsfx_api_1.ok("");
|
|
38
|
-
const appDirectory = await common_1.getAppDirectory(inputs.projectPath);
|
|
39
|
-
const colorFile = `${appDirectory}/${manifest.icons.color}`;
|
|
40
|
-
if (!(await fs.pathExists(colorFile))) {
|
|
41
|
-
throw results_1.AppStudioResultFactory.UserError(errors_1.AppStudioError.FileNotFoundError.name, errors_1.AppStudioError.FileNotFoundError.message(colorFile));
|
|
42
|
-
}
|
|
43
|
-
const outlineFile = `${appDirectory}/${manifest.icons.outline}`;
|
|
44
|
-
if (!(await fs.pathExists(outlineFile))) {
|
|
45
|
-
throw results_1.AppStudioResultFactory.UserError(errors_1.AppStudioError.FileNotFoundError.name, errors_1.AppStudioError.FileNotFoundError.message(outlineFile));
|
|
46
|
-
}
|
|
47
|
-
const zip = new adm_zip_1.default();
|
|
48
|
-
zip.addFile(constants_1.Constants.MANIFEST_FILE, Buffer.from(JSON.stringify(manifest)));
|
|
49
|
-
zip.addLocalFile(colorFile);
|
|
50
|
-
zip.addLocalFile(outlineFile);
|
|
51
|
-
archivedFile = zip.toBuffer();
|
|
35
|
+
archivedFile = await fs.readFile(buildPackage.value);
|
|
52
36
|
}
|
|
53
37
|
const appStudioToken = await tokenProvider.appStudioToken.getAccessToken();
|
|
54
38
|
try {
|
|
@@ -85,12 +69,120 @@ class AppStudioPluginImpl {
|
|
|
85
69
|
}
|
|
86
70
|
}
|
|
87
71
|
}
|
|
88
|
-
async
|
|
89
|
-
|
|
72
|
+
async publishTeamsApp(ctx, inputs, envInfo, tokenProvider) {
|
|
73
|
+
var _a, _b;
|
|
74
|
+
let archivedFile;
|
|
75
|
+
// User provided zip file
|
|
76
|
+
if (inputs.appPackagePath) {
|
|
77
|
+
if (await fs.pathExists(inputs.appPackagePath)) {
|
|
78
|
+
archivedFile = await fs.readFile(inputs.appPackagePath);
|
|
79
|
+
}
|
|
80
|
+
else {
|
|
81
|
+
return teamsfx_api_1.err(results_1.AppStudioResultFactory.UserError(errors_1.AppStudioError.FileNotFoundError.name, errors_1.AppStudioError.FileNotFoundError.message(inputs.appPackagePath)));
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
else {
|
|
85
|
+
const buildPackage = await this.buildTeamsAppPackage(inputs.projectPath, envInfo);
|
|
86
|
+
if (buildPackage.isErr()) {
|
|
87
|
+
return teamsfx_api_1.err(buildPackage.error);
|
|
88
|
+
}
|
|
89
|
+
archivedFile = await fs.readFile(buildPackage.value);
|
|
90
|
+
}
|
|
91
|
+
const zipEntries = new adm_zip_1.default(archivedFile).getEntries();
|
|
92
|
+
const manifestFile = zipEntries.find((x) => x.entryName === constants_1.Constants.MANIFEST_FILE);
|
|
93
|
+
if (!manifestFile) {
|
|
94
|
+
return teamsfx_api_1.err(results_1.AppStudioResultFactory.UserError(errors_1.AppStudioError.FileNotFoundError.name, errors_1.AppStudioError.FileNotFoundError.message(constants_1.Constants.MANIFEST_FILE)));
|
|
95
|
+
}
|
|
96
|
+
const manifestString = manifestFile.getData().toString();
|
|
97
|
+
const manifest = JSON.parse(manifestString);
|
|
98
|
+
// manifest.id === externalID
|
|
99
|
+
const appStudioToken = await ((_a = tokenProvider.appStudioToken) === null || _a === void 0 ? void 0 : _a.getAccessToken());
|
|
100
|
+
const existApp = await appStudio_1.AppStudioClient.getAppByTeamsAppId(manifest.id, appStudioToken);
|
|
101
|
+
if (existApp) {
|
|
102
|
+
let executePublishUpdate = false;
|
|
103
|
+
let description = `The app ${existApp.displayName} has already been submitted to tenant App Catalog.\nStatus: ${existApp.publishingState}\n`;
|
|
104
|
+
if (existApp.lastModifiedDateTime) {
|
|
105
|
+
description =
|
|
106
|
+
description + `Last Modified: ${(_b = existApp.lastModifiedDateTime) === null || _b === void 0 ? void 0 : _b.toLocaleString()}\n`;
|
|
107
|
+
}
|
|
108
|
+
description = description + "Do you want to submit a new update?";
|
|
109
|
+
const res = await ctx.userInteraction.showMessage("warn", description, true, "Confirm");
|
|
110
|
+
if ((res === null || res === void 0 ? void 0 : res.isOk()) && res.value === "Confirm")
|
|
111
|
+
executePublishUpdate = true;
|
|
112
|
+
if (executePublishUpdate) {
|
|
113
|
+
const appId = await appStudio_1.AppStudioClient.publishTeamsAppUpdate(manifest.id, archivedFile, appStudioToken);
|
|
114
|
+
return teamsfx_api_1.ok({ publishedAppId: appId, appName: manifest.name.short, update: true });
|
|
115
|
+
}
|
|
116
|
+
else {
|
|
117
|
+
throw results_1.AppStudioResultFactory.SystemError(errors_1.AppStudioError.TeamsAppPublishCancelError.name, errors_1.AppStudioError.TeamsAppPublishCancelError.message(manifest.name.short));
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
else {
|
|
121
|
+
const appId = await appStudio_1.AppStudioClient.publishTeamsApp(manifest.id, archivedFile, appStudioToken);
|
|
122
|
+
return teamsfx_api_1.ok({ publishedAppId: appId, appName: manifest.name.short, update: false });
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
/**
|
|
126
|
+
* Build appPackage.{envName}.zip
|
|
127
|
+
* @returns Path for built Teams app package
|
|
128
|
+
*/
|
|
129
|
+
async buildTeamsAppPackage(projectPath, envInfo) {
|
|
130
|
+
const buildFolderPath = `${projectPath}/${teamsfx_api_1.BuildFolderName}/${teamsfx_api_1.AppPackageFolderName}`;
|
|
131
|
+
await fs.ensureDir(buildFolderPath);
|
|
132
|
+
const appDefinitionRes = await this.getAppDefinitionAndManifest(projectPath, envInfo);
|
|
133
|
+
if (appDefinitionRes.isErr()) {
|
|
134
|
+
return teamsfx_api_1.err(appDefinitionRes.error);
|
|
135
|
+
}
|
|
136
|
+
const manifest = appDefinitionRes.value[1];
|
|
137
|
+
// manifest.bots = undefined;
|
|
138
|
+
// manifest.composeExtensions = undefined;
|
|
139
|
+
const appDirectory = await common_1.getAppDirectory(projectPath);
|
|
140
|
+
const colorFile = `${appDirectory}/${manifest.icons.color}`;
|
|
141
|
+
if (!(await fs.pathExists(colorFile))) {
|
|
142
|
+
return teamsfx_api_1.err(results_1.AppStudioResultFactory.UserError(errors_1.AppStudioError.FileNotFoundError.name, errors_1.AppStudioError.FileNotFoundError.message(colorFile)));
|
|
143
|
+
}
|
|
144
|
+
const outlineFile = `${appDirectory}/${manifest.icons.outline}`;
|
|
145
|
+
if (!(await fs.pathExists(outlineFile))) {
|
|
146
|
+
return teamsfx_api_1.err(results_1.AppStudioResultFactory.UserError(errors_1.AppStudioError.FileNotFoundError.name, errors_1.AppStudioError.FileNotFoundError.message(outlineFile)));
|
|
147
|
+
}
|
|
148
|
+
const zip = new adm_zip_1.default();
|
|
149
|
+
zip.addFile(constants_1.Constants.MANIFEST_FILE, Buffer.from(JSON.stringify(manifest)));
|
|
150
|
+
zip.addLocalFile(colorFile);
|
|
151
|
+
zip.addLocalFile(outlineFile);
|
|
152
|
+
const zipFileName = `${buildFolderPath}/appPackage.${envInfo.envName}.zip`;
|
|
153
|
+
zip.writeZip(zipFileName);
|
|
154
|
+
const manifestFileName = `${buildFolderPath}/manifest.${envInfo.envName}.json`;
|
|
155
|
+
if (await fs.pathExists(manifestFileName)) {
|
|
156
|
+
await fs.chmod(manifestFileName, 0o777);
|
|
157
|
+
}
|
|
158
|
+
await fs.writeFile(manifestFileName, JSON.stringify(manifest, null, 4));
|
|
159
|
+
await fs.chmod(manifestFileName, 0o444);
|
|
160
|
+
return teamsfx_api_1.ok(zipFileName);
|
|
161
|
+
}
|
|
162
|
+
/**
|
|
163
|
+
* Validate manifest
|
|
164
|
+
* @returns an array of validation error strings
|
|
165
|
+
*/
|
|
166
|
+
async validateManifest(manifest) {
|
|
167
|
+
// TODO: import teamsfx-manifest package
|
|
168
|
+
return teamsfx_api_1.ok([]);
|
|
169
|
+
}
|
|
90
170
|
async getAppDefinitionAndManifest(projectPath, envInfo) {
|
|
91
171
|
// Read template
|
|
172
|
+
const manifestTemplateRes = await manifestTemplate_1.loadManifest(projectPath, false);
|
|
173
|
+
if (manifestTemplateRes.isErr()) {
|
|
174
|
+
return teamsfx_api_1.err(manifestTemplateRes.error);
|
|
175
|
+
}
|
|
176
|
+
let manifestString = JSON.stringify(manifestTemplateRes.value);
|
|
92
177
|
// Render mustache template with state and config
|
|
93
|
-
|
|
178
|
+
const view = {
|
|
179
|
+
config: envInfo.config,
|
|
180
|
+
state: envInfo.state,
|
|
181
|
+
};
|
|
182
|
+
manifestString = common_1.compileHandlebarsTemplateString(manifestString, view);
|
|
183
|
+
const manifest = JSON.parse(manifestString);
|
|
184
|
+
const appDefinition = utils_1.convertToAppDefinition(manifest);
|
|
185
|
+
return teamsfx_api_1.ok([appDefinition, manifest]);
|
|
94
186
|
}
|
|
95
187
|
}
|
|
96
188
|
exports.AppStudioPluginImpl = AppStudioPluginImpl;
|