@microsoft/teamsfx-core 1.1.2 → 1.1.3-alpha.b985a359.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/armInterface.d.ts +1 -1
- package/build/common/armInterface.d.ts.map +1 -1
- package/build/common/constants.d.ts +3 -2
- package/build/common/constants.d.ts.map +1 -1
- package/build/common/constants.js +3 -2
- package/build/common/constants.js.map +1 -1
- package/build/common/deps-checker/checkerFactory.d.ts +8 -0
- package/build/common/deps-checker/checkerFactory.d.ts.map +1 -0
- package/build/common/deps-checker/checkerFactory.js +32 -0
- package/build/common/deps-checker/checkerFactory.js.map +1 -0
- package/build/common/deps-checker/constant/helpLink.d.ts +11 -0
- package/build/common/deps-checker/constant/helpLink.d.ts.map +1 -0
- package/build/common/deps-checker/constant/helpLink.js +16 -0
- package/build/common/deps-checker/constant/helpLink.js.map +1 -0
- package/build/common/deps-checker/constant/message.d.ts +29 -0
- package/build/common/deps-checker/constant/message.d.ts.map +1 -0
- package/build/common/deps-checker/constant/message.js +57 -0
- package/build/common/deps-checker/constant/message.js.map +1 -0
- package/build/common/deps-checker/constant/telemetry.d.ts +41 -0
- package/build/common/deps-checker/constant/telemetry.d.ts.map +1 -0
- package/build/common/deps-checker/constant/telemetry.js +49 -0
- package/build/common/deps-checker/constant/telemetry.js.map +1 -0
- package/build/common/deps-checker/depsChecker.d.ts +24 -0
- package/build/common/deps-checker/depsChecker.d.ts.map +1 -0
- package/build/common/deps-checker/depsChecker.js +13 -0
- package/build/common/deps-checker/depsChecker.js.map +1 -0
- package/build/common/deps-checker/depsError.d.ts +17 -0
- package/build/common/deps-checker/depsError.d.ts.map +1 -0
- package/build/common/deps-checker/depsError.js +42 -0
- package/build/common/deps-checker/depsError.js.map +1 -0
- package/build/common/deps-checker/depsLogger.d.ts +11 -0
- package/build/common/deps-checker/depsLogger.d.ts.map +1 -0
- package/build/common/deps-checker/depsLogger.js +5 -0
- package/build/common/deps-checker/depsLogger.js.map +1 -0
- package/build/common/deps-checker/depsManager.d.ts +35 -0
- package/build/common/deps-checker/depsManager.d.ts.map +1 -0
- package/build/common/deps-checker/depsManager.js +82 -0
- package/build/common/deps-checker/depsManager.js.map +1 -0
- package/build/common/deps-checker/depsTelemetry.d.ts +10 -0
- package/build/common/deps-checker/depsTelemetry.d.ts.map +1 -0
- package/build/common/deps-checker/depsTelemetry.js +5 -0
- package/build/common/deps-checker/depsTelemetry.js.map +1 -0
- package/build/common/deps-checker/internal/dotnetChecker.d.ts +50 -0
- package/build/common/deps-checker/internal/dotnetChecker.d.ts.map +1 -0
- package/build/common/deps-checker/internal/dotnetChecker.js +406 -0
- package/build/common/deps-checker/internal/dotnetChecker.js.map +1 -0
- package/build/common/deps-checker/internal/funcToolChecker.d.ts +40 -0
- package/build/common/deps-checker/internal/funcToolChecker.d.ts.map +1 -0
- package/build/common/deps-checker/internal/funcToolChecker.js +279 -0
- package/build/common/deps-checker/internal/funcToolChecker.js.map +1 -0
- package/build/common/deps-checker/internal/ngrokChecker.d.ts +28 -0
- package/build/common/deps-checker/internal/ngrokChecker.d.ts.map +1 -0
- package/build/common/deps-checker/internal/ngrokChecker.js +183 -0
- package/build/common/deps-checker/internal/ngrokChecker.js.map +1 -0
- package/build/common/deps-checker/internal/nodeChecker.d.ts +40 -0
- package/build/common/deps-checker/internal/nodeChecker.d.ts.map +1 -0
- package/build/common/deps-checker/internal/nodeChecker.js +144 -0
- package/build/common/deps-checker/internal/nodeChecker.js.map +1 -0
- package/build/common/deps-checker/util/cpUtils.d.ts +24 -0
- package/build/common/deps-checker/util/cpUtils.d.ts.map +1 -0
- package/build/common/deps-checker/util/cpUtils.js +99 -0
- package/build/common/deps-checker/util/cpUtils.js.map +1 -0
- package/build/common/deps-checker/util/progressIndicator.d.ts +3 -0
- package/build/common/deps-checker/util/progressIndicator.d.ts.map +1 -0
- package/build/common/deps-checker/util/progressIndicator.js +18 -0
- package/build/common/deps-checker/util/progressIndicator.js.map +1 -0
- package/build/common/deps-checker/util/system.d.ts +5 -0
- package/build/common/deps-checker/util/system.d.ts.map +1 -0
- package/build/common/deps-checker/util/system.js +24 -0
- package/build/common/deps-checker/util/system.js.map +1 -0
- package/build/common/index.d.ts +1 -0
- package/build/common/index.d.ts.map +1 -1
- package/build/common/index.js +1 -0
- package/build/common/index.js.map +1 -1
- package/build/common/local/constants.d.ts +109 -0
- package/build/common/local/constants.d.ts.map +1 -0
- package/build/common/local/constants.js +115 -0
- package/build/common/local/constants.js.map +1 -0
- package/build/common/local/localEnvManager.d.ts +19 -0
- package/build/common/local/localEnvManager.d.ts.map +1 -0
- package/build/common/local/localEnvManager.js +85 -0
- package/build/common/local/localEnvManager.js.map +1 -0
- package/build/{plugins/resource/localdebug/localEnvMulti.d.ts → common/local/localEnvProvider.d.ts} +5 -4
- package/build/common/local/localEnvProvider.d.ts.map +1 -0
- package/build/{plugins/resource/localdebug/localEnvMulti.js → common/local/localEnvProvider.js} +19 -15
- package/build/common/local/localEnvProvider.js.map +1 -0
- package/build/common/local/localSettingsHelper.d.ts +3 -0
- package/build/common/local/localSettingsHelper.d.ts.map +1 -0
- package/build/common/local/localSettingsHelper.js +129 -0
- package/build/common/local/localSettingsHelper.js.map +1 -0
- package/build/common/local/npmLogHelper.d.ts +11 -0
- package/build/common/local/npmLogHelper.d.ts.map +1 -0
- package/build/common/local/npmLogHelper.js +82 -0
- package/build/common/local/npmLogHelper.js.map +1 -0
- package/build/common/local/packageJsonHelper.d.ts +4 -0
- package/build/common/local/packageJsonHelper.d.ts.map +1 -0
- package/build/common/local/packageJsonHelper.js +36 -0
- package/build/common/local/packageJsonHelper.js.map +1 -0
- package/build/common/local/portChecker.d.ts +3 -0
- package/build/common/local/portChecker.d.ts.map +1 -0
- package/build/common/local/portChecker.js +100 -0
- package/build/common/local/portChecker.js.map +1 -0
- package/build/common/local/projectSettingsHelper.d.ts +10 -0
- package/build/common/local/projectSettingsHelper.d.ts.map +1 -0
- package/build/common/local/projectSettingsHelper.js +34 -0
- package/build/common/local/projectSettingsHelper.js.map +1 -0
- package/build/common/localSettingsProvider.d.ts +3 -3
- package/build/common/localSettingsProvider.d.ts.map +1 -1
- package/build/common/localSettingsProvider.js +12 -10
- package/build/common/localSettingsProvider.js.map +1 -1
- package/build/common/samples-config.json +14 -0
- package/build/common/templatesActions.d.ts +2 -0
- package/build/common/templatesActions.d.ts.map +1 -1
- package/build/common/templatesActions.js +33 -1
- package/build/common/templatesActions.js.map +1 -1
- package/build/common/tools.d.ts +9 -4
- package/build/common/tools.d.ts.map +1 -1
- package/build/common/tools.js +21 -77
- package/build/common/tools.js.map +1 -1
- package/build/core/SolutionPluginContainer.d.ts +2 -1
- package/build/core/SolutionPluginContainer.d.ts.map +1 -1
- package/build/core/SolutionPluginContainer.js +9 -1
- package/build/core/SolutionPluginContainer.js.map +1 -1
- package/build/core/dependencyChecker.d.ts +1 -0
- package/build/core/dependencyChecker.d.ts.map +1 -0
- package/build/core/dependencyChecker.js +2 -0
- package/build/core/dependencyChecker.js.map +1 -0
- package/build/core/downloadSample.d.ts +9 -0
- package/build/core/downloadSample.d.ts.map +1 -0
- package/build/core/downloadSample.js +150 -0
- package/build/core/downloadSample.js.map +1 -0
- package/build/core/environment.d.ts +5 -5
- package/build/core/environment.d.ts.map +1 -1
- package/build/core/environment.js +40 -25
- package/build/core/environment.js.map +1 -1
- package/build/core/error.d.ts +2 -1
- package/build/core/error.d.ts.map +1 -1
- package/build/core/error.js +7 -3
- package/build/core/error.js.map +1 -1
- package/build/core/index.d.ts +53 -15
- package/build/core/index.d.ts.map +1 -1
- package/build/core/index.js +689 -575
- package/build/core/index.js.map +1 -1
- package/build/core/middleware/concurrentLocker.d.ts.map +1 -1
- package/build/core/middleware/concurrentLocker.js +23 -12
- package/build/core/middleware/concurrentLocker.js.map +1 -1
- package/build/core/middleware/envInfoLoader.d.ts +5 -1
- package/build/core/middleware/envInfoLoader.d.ts.map +1 -1
- package/build/core/middleware/envInfoLoader.js +52 -46
- package/build/core/middleware/envInfoLoader.js.map +1 -1
- package/build/core/middleware/envInfoLoaderV3.d.ts +3 -0
- package/build/core/middleware/envInfoLoaderV3.d.ts.map +1 -0
- package/build/core/middleware/envInfoLoaderV3.js +64 -0
- package/build/core/middleware/envInfoLoaderV3.js.map +1 -0
- package/build/core/middleware/envInfoWriter.js +14 -31
- package/build/core/middleware/envInfoWriter.js.map +1 -1
- package/build/core/middleware/envInfoWriterV3.d.ts +6 -0
- package/build/core/middleware/envInfoWriterV3.d.ts.map +1 -0
- package/build/core/middleware/envInfoWriterV3.js +63 -0
- package/build/core/middleware/envInfoWriterV3.js.map +1 -0
- package/build/core/middleware/errorHandler.d.ts.map +1 -1
- package/build/core/middleware/errorHandler.js +3 -5
- package/build/core/middleware/errorHandler.js.map +1 -1
- package/build/core/middleware/localSettingsLoader.d.ts.map +1 -1
- package/build/core/middleware/localSettingsLoader.js +1 -2
- package/build/core/middleware/localSettingsLoader.js.map +1 -1
- package/build/core/middleware/localSettingsWriter.d.ts.map +1 -1
- package/build/core/middleware/localSettingsWriter.js +7 -18
- package/build/core/middleware/localSettingsWriter.js.map +1 -1
- package/build/core/middleware/projectMigrator.d.ts.map +1 -1
- package/build/core/middleware/projectMigrator.js +25 -57
- package/build/core/middleware/projectMigrator.js.map +1 -1
- package/build/core/middleware/projectSettingsLoader.d.ts.map +1 -1
- package/build/core/middleware/projectSettingsLoader.js +3 -6
- package/build/core/middleware/projectSettingsLoader.js.map +1 -1
- package/build/core/middleware/projectSettingsLoaderV3.d.ts +4 -0
- package/build/core/middleware/projectSettingsLoaderV3.d.ts.map +1 -0
- package/build/core/middleware/projectSettingsLoaderV3.js +49 -0
- package/build/core/middleware/projectSettingsLoaderV3.js.map +1 -0
- package/build/core/middleware/projectSettingsWriter.d.ts.map +1 -1
- package/build/core/middleware/projectSettingsWriter.js +5 -12
- package/build/core/middleware/projectSettingsWriter.js.map +1 -1
- package/build/core/middleware/projectUpgrader.d.ts.map +1 -1
- package/build/core/middleware/projectUpgrader.js +7 -15
- package/build/core/middleware/projectUpgrader.js.map +1 -1
- package/build/core/middleware/questionModel.d.ts +14 -1
- package/build/core/middleware/questionModel.d.ts.map +1 -1
- package/build/core/middleware/questionModel.js +319 -23
- package/build/core/middleware/questionModel.js.map +1 -1
- package/build/core/middleware/solutionLoader.d.ts +3 -2
- package/build/core/middleware/solutionLoader.d.ts.map +1 -1
- package/build/core/middleware/solutionLoader.js +21 -23
- package/build/core/middleware/solutionLoader.js.map +1 -1
- package/build/core/middleware/solutionLoaderV3.d.ts +4 -0
- package/build/core/middleware/solutionLoaderV3.d.ts.map +1 -0
- package/build/core/middleware/solutionLoaderV3.js +19 -0
- package/build/core/middleware/solutionLoaderV3.js.map +1 -0
- package/build/core/question.d.ts +9 -1
- package/build/core/question.d.ts.map +1 -1
- package/build/core/question.js +113 -3
- package/build/core/question.js.map +1 -1
- package/build/core/tools.d.ts +2 -1
- package/build/core/tools.d.ts.map +1 -1
- package/build/core/tools.js +19 -10
- package/build/core/tools.js.map +1 -1
- package/build/plugins/resource/aad/plugin.d.ts.map +1 -1
- package/build/plugins/resource/aad/plugin.js +3 -12
- package/build/plugins/resource/aad/plugin.js.map +1 -1
- package/build/plugins/resource/apim/managers/apimManager.d.ts.map +1 -1
- package/build/plugins/resource/apim/managers/apimManager.js +5 -7
- package/build/plugins/resource/apim/managers/apimManager.js.map +1 -1
- package/build/plugins/resource/appstudio/appStudio.d.ts +1 -1
- package/build/plugins/resource/appstudio/appStudio.d.ts.map +1 -1
- package/build/plugins/resource/appstudio/appStudio.js +106 -85
- package/build/plugins/resource/appstudio/appStudio.js.map +1 -1
- package/build/plugins/resource/appstudio/constants.d.ts +6 -1
- package/build/plugins/resource/appstudio/constants.d.ts.map +1 -1
- package/build/plugins/resource/appstudio/constants.js +6 -1
- package/build/plugins/resource/appstudio/constants.js.map +1 -1
- package/build/plugins/resource/appstudio/errors.d.ts +1 -1
- package/build/plugins/resource/appstudio/errors.d.ts.map +1 -1
- package/build/plugins/resource/appstudio/errors.js +2 -1
- package/build/plugins/resource/appstudio/errors.js.map +1 -1
- package/build/plugins/resource/appstudio/index.d.ts.map +1 -1
- package/build/plugins/resource/appstudio/index.js +15 -12
- package/build/plugins/resource/appstudio/index.js.map +1 -1
- package/build/plugins/resource/appstudio/plugin.d.ts +2 -3
- package/build/plugins/resource/appstudio/plugin.d.ts.map +1 -1
- package/build/plugins/resource/appstudio/plugin.js +233 -443
- package/build/plugins/resource/appstudio/plugin.js.map +1 -1
- package/build/plugins/resource/appstudio/utils/telemetry.d.ts.map +1 -1
- package/build/plugins/resource/appstudio/utils/telemetry.js +12 -16
- package/build/plugins/resource/appstudio/utils/telemetry.js.map +1 -1
- package/build/plugins/resource/appstudio/v3/index.d.ts +49 -0
- package/build/plugins/resource/appstudio/v3/index.d.ts.map +1 -0
- package/build/plugins/resource/appstudio/v3/index.js +51 -0
- package/build/plugins/resource/appstudio/v3/index.js.map +1 -0
- package/build/plugins/resource/bot/index.d.ts.map +1 -1
- package/build/plugins/resource/bot/index.js +5 -1
- package/build/plugins/resource/bot/index.js.map +1 -1
- package/build/plugins/resource/bot/plugin.d.ts.map +1 -1
- package/build/plugins/resource/bot/plugin.js +9 -11
- package/build/plugins/resource/bot/plugin.js.map +1 -1
- package/build/plugins/resource/frontend/constants.d.ts +1 -7
- package/build/plugins/resource/frontend/constants.d.ts.map +1 -1
- package/build/plugins/resource/frontend/constants.js +2 -9
- package/build/plugins/resource/frontend/constants.js.map +1 -1
- package/build/plugins/resource/frontend/env.d.ts +21 -0
- package/build/plugins/resource/frontend/env.d.ts.map +1 -0
- package/build/plugins/resource/frontend/env.js +82 -0
- package/build/plugins/resource/frontend/env.js.map +1 -0
- package/build/plugins/resource/frontend/ops/deploy.d.ts +2 -1
- package/build/plugins/resource/frontend/ops/deploy.d.ts.map +1 -1
- package/build/plugins/resource/frontend/ops/deploy.js +2 -2
- package/build/plugins/resource/frontend/ops/deploy.js.map +1 -1
- package/build/plugins/resource/frontend/plugin.d.ts +2 -0
- package/build/plugins/resource/frontend/plugin.d.ts.map +1 -1
- package/build/plugins/resource/frontend/plugin.js +28 -16
- package/build/plugins/resource/frontend/plugin.js.map +1 -1
- package/build/plugins/resource/frontend/utils/environment-utils.d.ts.map +1 -1
- package/build/plugins/resource/frontend/utils/environment-utils.js +4 -2
- package/build/plugins/resource/frontend/utils/environment-utils.js.map +1 -1
- package/build/plugins/resource/frontend/utils.d.ts +6 -1
- package/build/plugins/resource/frontend/utils.d.ts.map +1 -1
- package/build/plugins/resource/frontend/utils.js +17 -6
- package/build/plugins/resource/frontend/utils.js.map +1 -1
- package/build/plugins/resource/function/plugin.d.ts.map +1 -1
- package/build/plugins/resource/function/plugin.js +7 -9
- package/build/plugins/resource/function/plugin.js.map +1 -1
- package/build/plugins/resource/function/utils/depsChecker/checker.d.ts +0 -1
- package/build/plugins/resource/function/utils/depsChecker/checker.d.ts.map +1 -1
- package/build/plugins/resource/function/utils/depsChecker/checker.js +2 -2
- package/build/plugins/resource/function/utils/depsChecker/checker.js.map +1 -1
- package/build/plugins/resource/function/utils/depsChecker/common.d.ts +2 -2
- package/build/plugins/resource/function/utils/depsChecker/common.d.ts.map +1 -1
- package/build/plugins/resource/function/utils/depsChecker/common.js +6 -6
- package/build/plugins/resource/function/utils/depsChecker/common.js.map +1 -1
- package/build/plugins/resource/function/utils/depsChecker/dotnetChecker.d.ts +3 -2
- package/build/plugins/resource/function/utils/depsChecker/dotnetChecker.d.ts.map +1 -1
- package/build/plugins/resource/function/utils/depsChecker/dotnetChecker.js +3 -2
- package/build/plugins/resource/function/utils/depsChecker/dotnetChecker.js.map +1 -1
- package/build/plugins/resource/function/utils/depsChecker/funcPluginAdapter.d.ts +0 -1
- package/build/plugins/resource/function/utils/depsChecker/funcPluginAdapter.d.ts.map +1 -1
- package/build/plugins/resource/function/utils/depsChecker/funcPluginAdapter.js +1 -23
- package/build/plugins/resource/function/utils/depsChecker/funcPluginAdapter.js.map +1 -1
- package/build/plugins/resource/identity/index.d.ts.map +1 -1
- package/build/plugins/resource/identity/index.js +11 -13
- package/build/plugins/resource/identity/index.js.map +1 -1
- package/build/plugins/resource/keyvault/plugin.d.ts.map +1 -1
- package/build/plugins/resource/keyvault/plugin.js +7 -9
- package/build/plugins/resource/keyvault/plugin.js.map +1 -1
- package/build/plugins/resource/localdebug/index.d.ts +0 -7
- package/build/plugins/resource/localdebug/index.d.ts.map +1 -1
- package/build/plugins/resource/localdebug/index.js +3 -501
- package/build/plugins/resource/localdebug/index.js.map +1 -1
- package/build/plugins/resource/localdebug/util/error.d.ts.map +1 -1
- package/build/plugins/resource/localdebug/util/error.js +1 -1
- package/build/plugins/resource/localdebug/util/error.js.map +1 -1
- package/build/plugins/resource/localdebug/util/localService.d.ts +0 -1
- package/build/plugins/resource/localdebug/util/localService.d.ts.map +1 -1
- package/build/plugins/resource/localdebug/util/localService.js +1 -40
- package/build/plugins/resource/localdebug/util/localService.js.map +1 -1
- package/build/plugins/resource/localdebug/v2/index.d.ts.map +1 -1
- package/build/plugins/resource/localdebug/v2/index.js +39 -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 +7 -9
- package/build/plugins/resource/simpleauth/plugin.js.map +1 -1
- package/build/plugins/resource/simpleauth/utils/common.d.ts.map +1 -1
- package/build/plugins/resource/simpleauth/utils/common.js +3 -1
- package/build/plugins/resource/simpleauth/utils/common.js.map +1 -1
- package/build/plugins/resource/sql/config.d.ts +0 -1
- package/build/plugins/resource/sql/config.d.ts.map +1 -1
- package/build/plugins/resource/sql/config.js +0 -1
- package/build/plugins/resource/sql/config.js.map +1 -1
- package/build/plugins/resource/sql/constants.d.ts +1 -0
- package/build/plugins/resource/sql/constants.d.ts.map +1 -1
- package/build/plugins/resource/sql/constants.js +1 -0
- package/build/plugins/resource/sql/constants.js.map +1 -1
- package/build/plugins/resource/sql/errors.d.ts +3 -1
- package/build/plugins/resource/sql/errors.d.ts.map +1 -1
- package/build/plugins/resource/sql/errors.js +3 -1
- package/build/plugins/resource/sql/errors.js.map +1 -1
- package/build/plugins/resource/sql/managementClient.d.ts +3 -1
- package/build/plugins/resource/sql/managementClient.d.ts.map +1 -1
- package/build/plugins/resource/sql/managementClient.js +11 -20
- package/build/plugins/resource/sql/managementClient.js.map +1 -1
- package/build/plugins/resource/sql/plugin.d.ts +3 -0
- package/build/plugins/resource/sql/plugin.d.ts.map +1 -1
- package/build/plugins/resource/sql/plugin.js +41 -36
- package/build/plugins/resource/sql/plugin.js.map +1 -1
- package/build/plugins/resource/sql/results.d.ts +2 -2
- package/build/plugins/resource/sql/results.d.ts.map +1 -1
- package/build/plugins/resource/sql/results.js +4 -4
- package/build/plugins/resource/sql/results.js.map +1 -1
- package/build/plugins/resource/sql/sqlClient.d.ts +1 -1
- package/build/plugins/resource/sql/sqlClient.d.ts.map +1 -1
- package/build/plugins/resource/sql/sqlClient.js +33 -46
- package/build/plugins/resource/sql/sqlClient.js.map +1 -1
- package/build/plugins/resource/sql/utils/checkInput.js +2 -2
- package/build/plugins/resource/sql/utils/checkInput.js.map +1 -1
- package/build/plugins/resource/sql/utils/message.d.ts +0 -1
- package/build/plugins/resource/sql/utils/message.d.ts.map +1 -1
- package/build/plugins/resource/sql/utils/message.js +0 -1
- package/build/plugins/resource/sql/utils/message.js.map +1 -1
- package/build/plugins/resource/utils4v2.d.ts.map +1 -1
- package/build/plugins/resource/utils4v2.js +0 -4
- package/build/plugins/resource/utils4v2.js.map +1 -1
- package/build/plugins/solution/fx-solution/arm.d.ts +18 -11
- package/build/plugins/solution/fx-solution/arm.d.ts.map +1 -1
- package/build/plugins/solution/fx-solution/arm.js +390 -131
- package/build/plugins/solution/fx-solution/arm.js.map +1 -1
- package/build/plugins/solution/fx-solution/commonQuestions.d.ts +13 -2
- package/build/plugins/solution/fx-solution/commonQuestions.d.ts.map +1 -1
- package/build/plugins/solution/fx-solution/commonQuestions.js +24 -26
- package/build/plugins/solution/fx-solution/commonQuestions.js.map +1 -1
- package/build/plugins/solution/fx-solution/debug/constants.d.ts +14 -0
- package/build/plugins/solution/fx-solution/debug/constants.d.ts.map +1 -0
- package/build/plugins/solution/fx-solution/debug/constants.js +22 -0
- package/build/plugins/solution/fx-solution/debug/constants.js.map +1 -0
- package/build/plugins/solution/fx-solution/debug/error.d.ts +9 -0
- package/build/plugins/solution/fx-solution/debug/error.d.ts.map +1 -0
- package/build/plugins/solution/fx-solution/debug/error.js +36 -0
- package/build/plugins/solution/fx-solution/debug/error.js.map +1 -0
- package/build/plugins/solution/fx-solution/debug/provisionLocal.d.ts +4 -0
- package/build/plugins/solution/fx-solution/debug/provisionLocal.d.ts.map +1 -0
- package/build/plugins/solution/fx-solution/debug/provisionLocal.js +233 -0
- package/build/plugins/solution/fx-solution/debug/provisionLocal.js.map +1 -0
- package/build/plugins/solution/fx-solution/debug/scaffolding.d.ts +5 -0
- package/build/plugins/solution/fx-solution/debug/scaffolding.d.ts.map +1 -0
- package/build/plugins/solution/fx-solution/debug/scaffolding.js +164 -0
- package/build/plugins/solution/fx-solution/debug/scaffolding.js.map +1 -0
- package/build/plugins/{resource/localdebug → solution/fx-solution/debug/util}/certificate.d.ts +2 -2
- package/build/plugins/solution/fx-solution/debug/util/certificate.d.ts.map +1 -0
- package/build/plugins/{resource/localdebug → solution/fx-solution/debug/util}/certificate.js +8 -9
- package/build/plugins/solution/fx-solution/debug/util/certificate.js.map +1 -0
- package/build/plugins/{resource/localdebug → solution/fx-solution/debug}/util/codespace.d.ts +0 -0
- package/build/plugins/solution/fx-solution/debug/util/codespace.d.ts.map +1 -0
- package/build/plugins/{resource/localdebug → solution/fx-solution/debug}/util/codespace.js +0 -0
- package/build/plugins/solution/fx-solution/debug/util/codespace.js.map +1 -0
- package/build/plugins/{resource/localdebug → solution/fx-solution/debug/util}/launch.d.ts +0 -0
- package/build/plugins/solution/fx-solution/debug/util/launch.d.ts.map +1 -0
- package/build/plugins/{resource/localdebug → solution/fx-solution/debug/util}/launch.js +1 -1
- package/build/plugins/solution/fx-solution/debug/util/launch.js.map +1 -0
- package/build/plugins/solution/fx-solution/debug/util/localService.d.ts +3 -0
- package/build/plugins/solution/fx-solution/debug/util/localService.d.ts.map +1 -0
- package/build/plugins/solution/fx-solution/debug/util/localService.js +52 -0
- package/build/plugins/solution/fx-solution/debug/util/localService.js.map +1 -0
- package/build/plugins/{resource/localdebug → solution/fx-solution/debug}/util/ngrok.d.ts +0 -0
- package/build/plugins/solution/fx-solution/debug/util/ngrok.d.ts.map +1 -0
- package/build/plugins/{resource/localdebug → solution/fx-solution/debug}/util/ngrok.js +2 -2
- package/build/plugins/solution/fx-solution/debug/util/ngrok.js.map +1 -0
- package/build/plugins/{resource/localdebug → solution/fx-solution/debug}/util/process.d.ts +0 -0
- package/build/plugins/solution/fx-solution/debug/util/process.d.ts.map +1 -0
- package/build/plugins/{resource/localdebug → solution/fx-solution/debug}/util/process.js +0 -0
- package/build/plugins/solution/fx-solution/debug/util/process.js.map +1 -0
- package/build/plugins/solution/fx-solution/debug/util/settings.d.ts +2 -0
- package/build/plugins/solution/fx-solution/debug/util/settings.d.ts.map +1 -0
- package/build/plugins/solution/fx-solution/debug/util/settings.js +22 -0
- package/build/plugins/solution/fx-solution/debug/util/settings.js.map +1 -0
- package/build/plugins/{resource/localdebug → solution/fx-solution/debug/util}/tasks.d.ts +0 -0
- package/build/plugins/solution/fx-solution/debug/util/tasks.d.ts.map +1 -0
- package/build/plugins/{resource/localdebug → solution/fx-solution/debug/util}/tasks.js +11 -11
- package/build/plugins/solution/fx-solution/debug/util/tasks.js.map +1 -0
- package/build/plugins/{resource/localdebug → solution/fx-solution/debug}/util/telemetry.d.ts +7 -6
- package/build/plugins/solution/fx-solution/debug/util/telemetry.d.ts.map +1 -0
- package/build/plugins/{resource/localdebug → solution/fx-solution/debug}/util/telemetry.js +16 -19
- package/build/plugins/solution/fx-solution/debug/util/telemetry.js.map +1 -0
- package/build/plugins/solution/fx-solution/index.d.ts +1 -0
- package/build/plugins/solution/fx-solution/index.d.ts.map +1 -1
- package/build/plugins/solution/fx-solution/index.js +1 -0
- package/build/plugins/solution/fx-solution/index.js.map +1 -1
- package/build/plugins/solution/fx-solution/question.d.ts +2 -2
- package/build/plugins/solution/fx-solution/question.d.ts.map +1 -1
- package/build/plugins/solution/fx-solution/question.js +2 -32
- package/build/plugins/solution/fx-solution/question.js.map +1 -1
- package/build/plugins/solution/fx-solution/solution.d.ts.map +1 -1
- package/build/plugins/solution/fx-solution/solution.js +14 -5
- package/build/plugins/solution/fx-solution/solution.js.map +1 -1
- package/build/plugins/solution/fx-solution/utils/depsChecker/bicepChecker.d.ts +2 -2
- package/build/plugins/solution/fx-solution/utils/depsChecker/bicepChecker.d.ts.map +1 -1
- package/build/plugins/solution/fx-solution/utils/depsChecker/bicepChecker.js +13 -14
- package/build/plugins/solution/fx-solution/utils/depsChecker/bicepChecker.js.map +1 -1
- package/build/plugins/solution/fx-solution/utils/progressHelper.d.ts +2 -2
- package/build/plugins/solution/fx-solution/utils/progressHelper.d.ts.map +1 -1
- package/build/plugins/solution/fx-solution/utils/progressHelper.js +4 -4
- package/build/plugins/solution/fx-solution/utils/progressHelper.js.map +1 -1
- package/build/plugins/solution/fx-solution/v2/constants.d.ts +2 -0
- package/build/plugins/solution/fx-solution/v2/constants.d.ts.map +1 -0
- package/build/plugins/solution/fx-solution/v2/constants.js +7 -0
- package/build/plugins/solution/fx-solution/v2/constants.js.map +1 -0
- package/build/plugins/solution/fx-solution/v2/createEnv.d.ts.map +1 -1
- package/build/plugins/solution/fx-solution/v2/createEnv.js +1 -1
- package/build/plugins/solution/fx-solution/v2/createEnv.js.map +1 -1
- package/build/plugins/solution/fx-solution/v2/executeUserTask.d.ts.map +1 -1
- package/build/plugins/solution/fx-solution/v2/executeUserTask.js +7 -4
- package/build/plugins/solution/fx-solution/v2/executeUserTask.js.map +1 -1
- package/build/plugins/solution/fx-solution/v2/getQuestions.d.ts.map +1 -1
- package/build/plugins/solution/fx-solution/v2/getQuestions.js +67 -25
- package/build/plugins/solution/fx-solution/v2/getQuestions.js.map +1 -1
- package/build/plugins/solution/fx-solution/v2/listAllCollaborators.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 +9 -1
- package/build/plugins/solution/fx-solution/v2/provision.js.map +1 -1
- package/build/plugins/solution/fx-solution/v2/provisionLocal.d.ts.map +1 -1
- package/build/plugins/solution/fx-solution/v2/provisionLocal.js +12 -1
- package/build/plugins/solution/fx-solution/v2/provisionLocal.js.map +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 -0
- package/build/plugins/solution/fx-solution/v2/scaffolding.js.map +1 -1
- package/build/plugins/solution/fx-solution/v2/solution.d.ts.map +1 -1
- package/build/plugins/solution/fx-solution/v2/solution.js +2 -1
- package/build/plugins/solution/fx-solution/v2/solution.js.map +1 -1
- package/build/plugins/solution/fx-solution/v3/addModule.d.ts +6 -0
- package/build/plugins/solution/fx-solution/v3/addModule.d.ts.map +1 -0
- package/build/plugins/solution/fx-solution/v3/addModule.js +35 -0
- package/build/plugins/solution/fx-solution/v3/addModule.js.map +1 -0
- package/build/plugins/solution/fx-solution/v3/addResource.d.ts +37 -0
- package/build/plugins/solution/fx-solution/v3/addResource.d.ts.map +1 -0
- package/build/plugins/solution/fx-solution/v3/addResource.js +260 -0
- package/build/plugins/solution/fx-solution/v3/addResource.js.map +1 -0
- package/build/plugins/solution/fx-solution/v3/constants.d.ts +20 -0
- package/build/plugins/solution/fx-solution/v3/constants.d.ts.map +1 -0
- package/build/plugins/solution/fx-solution/v3/constants.js +25 -0
- package/build/plugins/solution/fx-solution/v3/constants.js.map +1 -0
- package/build/plugins/solution/fx-solution/v3/deploy.d.ts +6 -0
- package/build/plugins/solution/fx-solution/v3/deploy.d.ts.map +1 -0
- package/build/plugins/solution/fx-solution/v3/deploy.js +78 -0
- package/build/plugins/solution/fx-solution/v3/deploy.js.map +1 -0
- package/build/plugins/solution/fx-solution/v3/error.d.ts +11 -0
- package/build/plugins/solution/fx-solution/v3/error.d.ts.map +1 -0
- package/build/plugins/solution/fx-solution/v3/error.js +23 -0
- package/build/plugins/solution/fx-solution/v3/error.js.map +1 -0
- package/build/plugins/solution/fx-solution/v3/init.d.ts +4 -0
- package/build/plugins/solution/fx-solution/v3/init.d.ts.map +1 -0
- package/build/plugins/solution/fx-solution/v3/init.js +35 -0
- package/build/plugins/solution/fx-solution/v3/init.js.map +1 -0
- package/build/plugins/solution/fx-solution/v3/provision.d.ts +4 -0
- package/build/plugins/solution/fx-solution/v3/provision.d.ts.map +1 -0
- package/build/plugins/solution/fx-solution/v3/provision.js +124 -0
- package/build/plugins/solution/fx-solution/v3/provision.js.map +1 -0
- package/build/plugins/solution/fx-solution/v3/provisionLocal.d.ts +4 -0
- package/build/plugins/solution/fx-solution/v3/provisionLocal.d.ts.map +1 -0
- package/build/plugins/solution/fx-solution/v3/provisionLocal.js +13 -0
- package/build/plugins/solution/fx-solution/v3/provisionLocal.js.map +1 -0
- package/build/plugins/solution/fx-solution/v3/publish.d.ts +4 -0
- package/build/plugins/solution/fx-solution/v3/publish.d.ts.map +1 -0
- package/build/plugins/solution/fx-solution/v3/publish.js +15 -0
- package/build/plugins/solution/fx-solution/v3/publish.js.map +1 -0
- package/build/plugins/solution/fx-solution/v3/questions.d.ts +16 -0
- package/build/plugins/solution/fx-solution/v3/questions.d.ts.map +1 -0
- package/build/plugins/solution/fx-solution/v3/questions.js +86 -0
- package/build/plugins/solution/fx-solution/v3/questions.js.map +1 -0
- package/build/plugins/solution/fx-solution/v3/scaffold.d.ts +27 -0
- package/build/plugins/solution/fx-solution/v3/scaffold.d.ts.map +1 -0
- package/build/plugins/solution/fx-solution/v3/scaffold.js +241 -0
- package/build/plugins/solution/fx-solution/v3/scaffold.js.map +1 -0
- package/build/plugins/solution/fx-solution/v3/solution.d.ts +32 -0
- package/build/plugins/solution/fx-solution/v3/solution.d.ts.map +1 -0
- package/build/plugins/solution/fx-solution/v3/solution.js +45 -0
- package/build/plugins/solution/fx-solution/v3/solution.js.map +1 -0
- package/build/plugins/solution/fx-solution/v3/userTask.d.ts +4 -0
- package/build/plugins/solution/fx-solution/v3/userTask.d.ts.map +1 -0
- package/build/plugins/solution/fx-solution/v3/userTask.js +15 -0
- package/build/plugins/solution/fx-solution/v3/userTask.js.map +1 -0
- package/build/plugins/solution/fx-solution/v3/utils.d.ts +3 -0
- package/build/plugins/solution/fx-solution/v3/utils.d.ts.map +1 -0
- package/build/plugins/solution/fx-solution/v3/utils.js +16 -0
- package/build/plugins/solution/fx-solution/v3/utils.js.map +1 -0
- package/build/plugins/solution/index.d.ts +1 -0
- package/build/plugins/solution/index.d.ts.map +1 -1
- package/build/plugins/solution/index.js +1 -0
- package/build/plugins/solution/index.js.map +1 -1
- package/build/plugins/solution/spfx-solution/constants.d.ts +2 -0
- package/build/plugins/solution/spfx-solution/constants.d.ts.map +1 -0
- package/build/plugins/solution/spfx-solution/constants.js +7 -0
- package/build/plugins/solution/spfx-solution/constants.js.map +1 -0
- package/build/plugins/solution/spfx-solution/index.d.ts +2 -0
- package/build/plugins/solution/spfx-solution/index.d.ts.map +1 -0
- package/build/plugins/solution/spfx-solution/index.js +5 -0
- package/build/plugins/solution/spfx-solution/index.js.map +1 -0
- package/build/plugins/solution/spfx-solution/init.d.ts +3 -0
- package/build/plugins/solution/spfx-solution/init.d.ts.map +1 -0
- package/build/plugins/solution/spfx-solution/init.js +20 -0
- package/build/plugins/solution/spfx-solution/init.js.map +1 -0
- package/build/plugins/solution/spfx-solution/questions.d.ts +6 -0
- package/build/plugins/solution/spfx-solution/questions.d.ts.map +1 -0
- package/build/plugins/solution/spfx-solution/questions.js +36 -0
- package/build/plugins/solution/spfx-solution/questions.js.map +1 -0
- package/build/plugins/solution/spfx-solution/scaffolding.d.ts +17 -0
- package/build/plugins/solution/spfx-solution/scaffolding.d.ts.map +1 -0
- package/build/plugins/solution/spfx-solution/scaffolding.js +29 -0
- package/build/plugins/solution/spfx-solution/scaffolding.js.map +1 -0
- package/build/plugins/solution/spfx-solution/solution.d.ts +23 -0
- package/build/plugins/solution/spfx-solution/solution.d.ts.map +1 -0
- package/build/plugins/solution/spfx-solution/solution.js +29 -0
- package/build/plugins/solution/spfx-solution/solution.js.map +1 -0
- package/package.json +20 -5
- package/resource/deps-checker/dotnet-install.ps1 +1095 -0
- package/resource/deps-checker/dotnet-install.sh +1222 -0
- package/resource/strings.json +0 -1
- package/templates/plugins/resource/apim/bicep/apimConfiguration.bicep +16 -16
- package/templates/plugins/resource/apim/bicep/config.template.bicep +1 -1
- package/templates/plugins/resource/apim/bicep/provision.template.bicep +1 -1
- package/templates/plugins/resource/bot/bicep/botConfiguration.template.bicep +28 -29
- package/templates/plugins/resource/bot/bicep/config.template.bicep +1 -1
- package/templates/plugins/resource/bot/bicep/provision.template.bicep +2 -2
- package/templates/plugins/resource/frontend/bicep/provision.template.bicep +1 -1
- package/templates/plugins/resource/function/bicep/config.template.bicep +1 -1
- package/templates/plugins/resource/function/bicep/functionConfiguration.template.bicep +33 -31
- package/templates/plugins/resource/function/bicep/provision.template.bicep +2 -2
- package/templates/plugins/resource/identity/bicep/provision.template.bicep +1 -1
- package/templates/plugins/resource/keyvault/bicep/keyVaultProvision.template.bicep +1 -0
- package/templates/plugins/resource/keyvault/bicep/provision.template.bicep +4 -2
- package/templates/plugins/resource/simpleauth/bicep/config.template.bicep +1 -1
- package/templates/plugins/resource/simpleauth/bicep/provision.template.bicep +2 -2
- package/templates/plugins/resource/simpleauth/bicep/simpleAuthConfiguration.template.bicep +20 -24
- package/templates/plugins/resource/simpleauth/version.txt +2 -1
- package/templates/plugins/resource/sql/bicep/provision.template.bicep +1 -1
- package/build/plugins/resource/localdebug/certificate.d.ts.map +0 -1
- package/build/plugins/resource/localdebug/certificate.js.map +0 -1
- package/build/plugins/resource/localdebug/launch.d.ts.map +0 -1
- package/build/plugins/resource/localdebug/launch.js.map +0 -1
- package/build/plugins/resource/localdebug/legacyPlugin.d.ts +0 -6
- package/build/plugins/resource/localdebug/legacyPlugin.d.ts.map +0 -1
- package/build/plugins/resource/localdebug/legacyPlugin.js +0 -208
- package/build/plugins/resource/localdebug/legacyPlugin.js.map +0 -1
- package/build/plugins/resource/localdebug/localEnvMulti.d.ts.map +0 -1
- package/build/plugins/resource/localdebug/localEnvMulti.js.map +0 -1
- package/build/plugins/resource/localdebug/settings.d.ts +0 -2
- package/build/plugins/resource/localdebug/settings.d.ts.map +0 -1
- package/build/plugins/resource/localdebug/settings.js +0 -18
- package/build/plugins/resource/localdebug/settings.js.map +0 -1
- package/build/plugins/resource/localdebug/tasks.d.ts.map +0 -1
- package/build/plugins/resource/localdebug/tasks.js.map +0 -1
- package/build/plugins/resource/localdebug/util/codespace.d.ts.map +0 -1
- package/build/plugins/resource/localdebug/util/codespace.js.map +0 -1
- package/build/plugins/resource/localdebug/util/ngrok.d.ts.map +0 -1
- package/build/plugins/resource/localdebug/util/ngrok.js.map +0 -1
- package/build/plugins/resource/localdebug/util/process.d.ts.map +0 -1
- package/build/plugins/resource/localdebug/util/process.js.map +0 -1
- package/build/plugins/resource/localdebug/util/telemetry.d.ts.map +0 -1
- package/build/plugins/resource/localdebug/util/telemetry.js.map +0 -1
- package/templates/azure/config.bicep +0 -25
- package/templates/azure/main.bicep +0 -20
- package/templates/azure/provision/azureSql.bicep +0 -39
- package/templates/azure/provision/frontendHosting.bicep +0 -23
- package/templates/azure/provision/function.bicep +0 -79
- package/templates/azure/provision/simpleAuth.bicep +0 -44
- package/templates/azure/provision.bicep +0 -58
- package/templates/azure/teamsFx/bot.bicep +0 -34
- package/templates/azure/teamsFx/function.bicep +0 -71
- package/templates/azure/teamsFx/simpleAuth.bicep +0 -40
- package/templates/plugins/resource/aad/bicep/param.template.bicep +0 -6
- package/templates/plugins/resource/aad/bicep/variables.template.bicep +0 -13
|
@@ -65,7 +65,7 @@ class AppStudioPluginImpl {
|
|
|
65
65
|
}
|
|
66
66
|
}
|
|
67
67
|
async getSPFxLocalDebugAppDefinitionAndUpdate(ctx, manifest) {
|
|
68
|
-
var _a
|
|
68
|
+
var _a;
|
|
69
69
|
const appDirectory = await common_1.getAppDirectory(ctx.root);
|
|
70
70
|
const appStudioToken = await ((_a = ctx.appStudioToken) === null || _a === void 0 ? void 0 : _a.getAccessToken());
|
|
71
71
|
const localTeamsAppID = await this.getTeamsAppId(ctx, true);
|
|
@@ -78,42 +78,15 @@ class AppStudioPluginImpl {
|
|
|
78
78
|
create = true;
|
|
79
79
|
}
|
|
80
80
|
}
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
teamsAppId: localTeamsAppID,
|
|
86
|
-
},
|
|
81
|
+
const view = {
|
|
82
|
+
localSettings: {
|
|
83
|
+
teamsApp: {
|
|
84
|
+
teamsAppId: localTeamsAppID,
|
|
87
85
|
},
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
else {
|
|
93
|
-
manifest.name.short = utils_1.getLocalAppName(ctx.projectSettings.appName);
|
|
94
|
-
manifest.id = localTeamsAppID !== null && localTeamsAppID !== void 0 ? localTeamsAppID : "";
|
|
95
|
-
if (manifest.configurableTabs) {
|
|
96
|
-
for (const tab of manifest.configurableTabs) {
|
|
97
|
-
const reg = /[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}/;
|
|
98
|
-
const result = tab.configurationUrl.match(reg);
|
|
99
|
-
if (result && result.length > 0) {
|
|
100
|
-
const componentID = result[0];
|
|
101
|
-
tab.configurationUrl = `https://{teamSiteDomain}{teamSitePath}/_layouts/15/TeamsLogon.aspx?SPFX=true&dest={teamSitePath}/_layouts/15/TeamsWorkBench.aspx%3FcomponentId=${componentID}%26openPropertyPane=true%26teams%26forceLocale={locale}%26loadSPFX%3Dtrue%26debugManifestsFile%3Dhttps%3A%2F%2Flocalhost%3A4321%2Ftemp%2Fmanifests.js`;
|
|
102
|
-
}
|
|
103
|
-
else {
|
|
104
|
-
const message = "Cannot find componentID in configurableTabs[0].configrationUrl, local debug may fail.";
|
|
105
|
-
(_b = ctx.logProvider) === null || _b === void 0 ? void 0 : _b.error(message);
|
|
106
|
-
(_c = ctx.ui) === null || _c === void 0 ? void 0 : _c.showMessage("warn", message, false);
|
|
107
|
-
}
|
|
108
|
-
}
|
|
109
|
-
}
|
|
110
|
-
if (manifest.staticTabs) {
|
|
111
|
-
for (const tab of manifest.staticTabs) {
|
|
112
|
-
const componentID = tab.entityId;
|
|
113
|
-
tab.contentUrl = `https://{teamSiteDomain}/_layouts/15/TeamsLogon.aspx?SPFX=true&dest={teamSitePath}/_layouts/15/TeamsWorkBench.aspx%3FcomponentId=${componentID}%26teams%26personal%26forceLocale={locale}%26loadSPFX%3Dtrue%26debugManifestsFile%3Dhttps%3A%2F%2Flocalhost%3A4321%2Ftemp%2Fmanifests.js`;
|
|
114
|
-
}
|
|
115
|
-
}
|
|
116
|
-
}
|
|
86
|
+
},
|
|
87
|
+
};
|
|
88
|
+
const manifestString = mustache_1.default.render(JSON.stringify(manifest), view);
|
|
89
|
+
manifest = JSON.parse(manifestString);
|
|
117
90
|
const appDefinition = await this.convertToAppDefinition(ctx, manifest, false);
|
|
118
91
|
if (appDefinition.isErr()) {
|
|
119
92
|
return teamsfx_api_1.err(appDefinition.error);
|
|
@@ -129,46 +102,31 @@ class AppStudioPluginImpl {
|
|
|
129
102
|
async createV1Manifest(ctx) {
|
|
130
103
|
var _a, _b;
|
|
131
104
|
const archiveManifestPath = path_1.default.join(ctx.root, teamsfx_api_1.ArchiveFolderName, teamsfx_api_1.AppPackageFolderName, teamsfx_api_1.V1ManifestFileName);
|
|
132
|
-
const manifestSourceRes = await this.
|
|
105
|
+
const manifestSourceRes = await this.reloadManifest(archiveManifestPath);
|
|
133
106
|
if (manifestSourceRes.isErr()) {
|
|
134
107
|
throw manifestSourceRes.error;
|
|
135
108
|
}
|
|
136
109
|
const manifestSource = manifestSourceRes.value;
|
|
137
110
|
let manifestString = (await fs.readFile(archiveManifestPath)).toString();
|
|
138
|
-
manifestString = this.replaceExistingValueToPlaceholder(manifestString, manifestSource.developer.websiteUrl,
|
|
111
|
+
manifestString = this.replaceExistingValueToPlaceholder(manifestString, manifestSource.developer.websiteUrl, "{{{localSettings.frontend.tabEndpoint}}}");
|
|
139
112
|
const manifest = JSON.parse(manifestString);
|
|
140
|
-
manifest.id =
|
|
113
|
+
manifest.id = "{{localSettings.teamsApp.teamsAppId}}";
|
|
141
114
|
manifest.validDomains = [];
|
|
142
115
|
const includeBot = (_b = ((_a = ctx.projectSettings) === null || _a === void 0 ? void 0 : _a.solutionSettings).activeResourcePlugins) === null || _b === void 0 ? void 0 : _b.includes(constants_1.PluginNames.BOT);
|
|
143
116
|
if (includeBot) {
|
|
144
117
|
if (manifest.bots !== undefined && manifest.bots.length > 0) {
|
|
145
118
|
for (let index = 0; index < manifest.bots.length; ++index) {
|
|
146
|
-
manifest.bots[index].botId =
|
|
147
|
-
? "{{localSettings.bot.botId}}"
|
|
148
|
-
: `{${constants_2.BOT_ID}}`;
|
|
119
|
+
manifest.bots[index].botId = "{{localSettings.bot.botId}}";
|
|
149
120
|
}
|
|
150
121
|
}
|
|
151
122
|
if (manifest.composeExtensions !== undefined && manifest.composeExtensions.length > 0) {
|
|
152
123
|
for (let index = 0; index < manifest.composeExtensions.length; ++index) {
|
|
153
|
-
manifest.composeExtensions[index].botId =
|
|
154
|
-
? "{{localSettings.bot.botId}}"
|
|
155
|
-
: `{${constants_2.BOT_ID}}`;
|
|
124
|
+
manifest.composeExtensions[index].botId = "{{localSettings.bot.botId}}";
|
|
156
125
|
}
|
|
157
126
|
}
|
|
158
127
|
}
|
|
159
128
|
return manifest;
|
|
160
129
|
}
|
|
161
|
-
async reloadManifestAndCheckRequiredFields(manifestPath) {
|
|
162
|
-
const result = await this.reloadManifest(manifestPath);
|
|
163
|
-
return result.andThen((manifest) => {
|
|
164
|
-
if (manifest === undefined ||
|
|
165
|
-
manifest.name.short === undefined ||
|
|
166
|
-
manifest.name.short.length === 0) {
|
|
167
|
-
return teamsfx_api_1.err(results_1.AppStudioResultFactory.SystemError(errors_1.AppStudioError.ManifestLoadFailedError.name, errors_1.AppStudioError.ManifestLoadFailedError.message("Name is missing")));
|
|
168
|
-
}
|
|
169
|
-
return teamsfx_api_1.ok(manifest);
|
|
170
|
-
});
|
|
171
|
-
}
|
|
172
130
|
async provision(ctx) {
|
|
173
131
|
var _a, _b, _c;
|
|
174
132
|
let remoteTeamsAppId = await this.getTeamsAppId(ctx, false);
|
|
@@ -193,9 +151,7 @@ class AppStudioPluginImpl {
|
|
|
193
151
|
remoteTeamsAppId = result.value.teamsAppId;
|
|
194
152
|
(_b = ctx.logProvider) === null || _b === void 0 ? void 0 : _b.info(`Teams app created ${remoteTeamsAppId}`);
|
|
195
153
|
}
|
|
196
|
-
|
|
197
|
-
(_c = ctx.envInfo.state.get(constants_1.PluginNames.APPST)) === null || _c === void 0 ? void 0 : _c.set(constants_2.Constants.TEAMS_APP_ID, remoteTeamsAppId);
|
|
198
|
-
}
|
|
154
|
+
(_c = ctx.envInfo.state.get(constants_1.PluginNames.APPST)) === null || _c === void 0 ? void 0 : _c.set(constants_2.Constants.TEAMS_APP_ID, remoteTeamsAppId);
|
|
199
155
|
return teamsfx_api_1.ok(remoteTeamsAppId);
|
|
200
156
|
}
|
|
201
157
|
async postProvision(ctx) {
|
|
@@ -204,7 +160,7 @@ class AppStudioPluginImpl {
|
|
|
204
160
|
let manifestString;
|
|
205
161
|
const appDirectory = await common_1.getAppDirectory(ctx.root);
|
|
206
162
|
const manifestPath = await this.getManifestTemplatePath(ctx.root);
|
|
207
|
-
const manifestResult = await this.
|
|
163
|
+
const manifestResult = await this.reloadManifest(manifestPath);
|
|
208
164
|
if (manifestResult.isErr()) {
|
|
209
165
|
return teamsfx_api_1.err(manifestResult.error);
|
|
210
166
|
}
|
|
@@ -213,17 +169,7 @@ class AppStudioPluginImpl {
|
|
|
213
169
|
}
|
|
214
170
|
let appDefinition;
|
|
215
171
|
if (common_1.isSPFxProject(ctx.projectSettings)) {
|
|
216
|
-
|
|
217
|
-
const view = {
|
|
218
|
-
config: ctx.envInfo.config,
|
|
219
|
-
state: {
|
|
220
|
-
"fx-resource-appstudio": {
|
|
221
|
-
teamsAppId: remoteTeamsAppId,
|
|
222
|
-
},
|
|
223
|
-
},
|
|
224
|
-
};
|
|
225
|
-
manifestString = mustache_1.default.render(manifestString, view);
|
|
226
|
-
}
|
|
172
|
+
manifestString = await this.getSPFxManifest(ctx, false);
|
|
227
173
|
const appDefinitionRes = await this.convertToAppDefinition(ctx, JSON.parse(manifestString), false);
|
|
228
174
|
if (appDefinitionRes.isErr()) {
|
|
229
175
|
return teamsfx_api_1.err(appDefinitionRes.error);
|
|
@@ -245,42 +191,23 @@ class AppStudioPluginImpl {
|
|
|
245
191
|
(_b = ctx.logProvider) === null || _b === void 0 ? void 0 : _b.info(`Teams app updated: ${result.value}`);
|
|
246
192
|
return teamsfx_api_1.ok(remoteTeamsAppId);
|
|
247
193
|
}
|
|
248
|
-
async validateManifest(ctx) {
|
|
249
|
-
var _a, _b
|
|
194
|
+
async validateManifest(ctx, isLocalDebug) {
|
|
195
|
+
var _a, _b;
|
|
250
196
|
const appStudioToken = await ((_a = ctx === null || ctx === void 0 ? void 0 : ctx.appStudioToken) === null || _a === void 0 ? void 0 : _a.getAccessToken());
|
|
251
197
|
let manifestString = undefined;
|
|
252
198
|
if (common_1.isSPFxProject(ctx.projectSettings)) {
|
|
253
|
-
manifestString =
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
state: {
|
|
258
|
-
"fx-resource-appstudio": {
|
|
259
|
-
teamsAppId: this.getTeamsAppId(ctx, false),
|
|
260
|
-
},
|
|
261
|
-
},
|
|
262
|
-
};
|
|
263
|
-
manifestString = mustache_1.default.render(manifestString, view);
|
|
264
|
-
const manifest = JSON.parse(manifestString);
|
|
265
|
-
if (!isUUID_1.default(manifest.id)) {
|
|
266
|
-
manifest.id = uuid_1.v4();
|
|
267
|
-
}
|
|
268
|
-
manifestString = JSON.stringify(manifest, null, 4);
|
|
199
|
+
manifestString = await this.getSPFxManifest(ctx, isLocalDebug);
|
|
200
|
+
const manifest = JSON.parse(manifestString);
|
|
201
|
+
if (!isUUID_1.default(manifest.id)) {
|
|
202
|
+
manifest.id = uuid_1.v4();
|
|
269
203
|
}
|
|
204
|
+
manifestString = JSON.stringify(manifest, null, 4);
|
|
270
205
|
}
|
|
271
206
|
else {
|
|
272
|
-
const appDefinitionAndManifest = await this.getAppDefinitionAndManifest(ctx,
|
|
207
|
+
const appDefinitionAndManifest = await this.getAppDefinitionAndManifest(ctx, isLocalDebug);
|
|
273
208
|
if (appDefinitionAndManifest.isErr()) {
|
|
274
209
|
(_b = ctx.logProvider) === null || _b === void 0 ? void 0 : _b.error("[Teams Toolkit] Manifest Validation failed!");
|
|
275
|
-
|
|
276
|
-
.get("solution")) === null || _c === void 0 ? void 0 : _c.get(constants_1.SOLUTION_PROVISION_SUCCEEDED));
|
|
277
|
-
if (appDefinitionAndManifest.error.name === errors_1.AppStudioError.GetRemoteConfigError.name &&
|
|
278
|
-
!isProvisionSucceeded) {
|
|
279
|
-
return teamsfx_api_1.err(results_1.AppStudioResultFactory.UserError(errors_1.AppStudioError.GetRemoteConfigError.name, errors_1.AppStudioError.GetRemoteConfigError.message("Manifest validation failed"), constants_3.HelpLinks.WhyNeedProvision));
|
|
280
|
-
}
|
|
281
|
-
else {
|
|
282
|
-
return teamsfx_api_1.err(appDefinitionAndManifest.error);
|
|
283
|
-
}
|
|
210
|
+
return teamsfx_api_1.err(appDefinitionAndManifest.error);
|
|
284
211
|
}
|
|
285
212
|
else {
|
|
286
213
|
manifestString = JSON.stringify(appDefinitionAndManifest.value[1]);
|
|
@@ -316,13 +243,13 @@ class AppStudioPluginImpl {
|
|
|
316
243
|
return teamsfx_api_1.ok(errors);
|
|
317
244
|
}
|
|
318
245
|
async updateManifest(ctx, isLocalDebug) {
|
|
319
|
-
var _a, _b, _c, _d, _e, _f;
|
|
246
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
|
320
247
|
const teamsAppId = await this.getTeamsAppId(ctx, isLocalDebug);
|
|
321
248
|
let manifest;
|
|
322
249
|
let manifestString;
|
|
323
250
|
const appDirectory = await common_1.getAppDirectory(ctx.root);
|
|
324
251
|
const manifestPath = await this.getManifestTemplatePath(ctx.root, isLocalDebug);
|
|
325
|
-
const manifestResult = await this.
|
|
252
|
+
const manifestResult = await this.reloadManifest(manifestPath);
|
|
326
253
|
if (manifestResult.isErr()) {
|
|
327
254
|
throw manifestResult;
|
|
328
255
|
}
|
|
@@ -331,27 +258,7 @@ class AppStudioPluginImpl {
|
|
|
331
258
|
}
|
|
332
259
|
let appDefinition;
|
|
333
260
|
if (common_1.isSPFxProject(ctx.projectSettings)) {
|
|
334
|
-
|
|
335
|
-
if (isLocalDebug) {
|
|
336
|
-
view = {
|
|
337
|
-
localSettings: {
|
|
338
|
-
teamsApp: {
|
|
339
|
-
teamsAppId: teamsAppId,
|
|
340
|
-
},
|
|
341
|
-
},
|
|
342
|
-
};
|
|
343
|
-
}
|
|
344
|
-
else {
|
|
345
|
-
view = {
|
|
346
|
-
config: ctx.envInfo.config,
|
|
347
|
-
state: {
|
|
348
|
-
"fx-resource-appstudio": {
|
|
349
|
-
teamsAppId: teamsAppId,
|
|
350
|
-
},
|
|
351
|
-
},
|
|
352
|
-
};
|
|
353
|
-
}
|
|
354
|
-
manifestString = mustache_1.default.render(manifestString, view);
|
|
261
|
+
manifestString = await this.getSPFxManifest(ctx, isLocalDebug);
|
|
355
262
|
manifest = JSON.parse(manifestString);
|
|
356
263
|
const appDefinitionRes = await this.convertToAppDefinition(ctx, manifest, false);
|
|
357
264
|
if (appDefinitionRes.isErr()) {
|
|
@@ -398,12 +305,26 @@ class AppStudioPluginImpl {
|
|
|
398
305
|
}
|
|
399
306
|
const appStudioToken = await ((_d = ctx === null || ctx === void 0 ? void 0 : ctx.appStudioToken) === null || _d === void 0 ? void 0 : _d.getAccessToken());
|
|
400
307
|
try {
|
|
308
|
+
const localUpdateTime = isLocalDebug
|
|
309
|
+
? undefined
|
|
310
|
+
: (_e = ctx.envInfo.state.get(constants_1.PluginNames.APPST)) === null || _e === void 0 ? void 0 : _e.get(constants_2.Constants.TEAMS_APP_UPDATED_AT);
|
|
311
|
+
if (localUpdateTime) {
|
|
312
|
+
const app = await appStudio_1.AppStudioClient.getApp(teamsAppId, appStudioToken, ctx.logProvider);
|
|
313
|
+
const devPortalUpdateTime = (_g = (_f = new Date(app.updatedAt)) === null || _f === void 0 ? void 0 : _f.getTime()) !== null && _g !== void 0 ? _g : -1;
|
|
314
|
+
if (localUpdateTime < devPortalUpdateTime) {
|
|
315
|
+
const res = await ((_h = ctx.ui) === null || _h === void 0 ? void 0 : _h.showMessage("warn", "The manifest file on Teams platform has been changed since your last update. Do you want to continue to update and overwrite the manifest file on Teams platform?", true, "Overwrite and update"));
|
|
316
|
+
if (!((res === null || res === void 0 ? void 0 : res.isOk()) && res.value === "Overwrite and update")) {
|
|
317
|
+
const error = results_1.AppStudioResultFactory.UserError(errors_1.AppStudioError.UpdateManifestCancelError.name, errors_1.AppStudioError.UpdateManifestCancelError.message(manifest.name.short));
|
|
318
|
+
return teamsfx_api_1.err(error);
|
|
319
|
+
}
|
|
320
|
+
}
|
|
321
|
+
}
|
|
401
322
|
const result = await this.updateApp(ctx, appDefinition, appStudioToken, isLocalDebug, false, appDirectory, teamsAppId, ctx.logProvider);
|
|
402
323
|
if (result.isErr()) {
|
|
403
324
|
throw result.error;
|
|
404
325
|
}
|
|
405
|
-
(
|
|
406
|
-
(
|
|
326
|
+
(_j = ctx.logProvider) === null || _j === void 0 ? void 0 : _j.info(`Teams app updated: ${result.value}`);
|
|
327
|
+
(_k = ctx.ui) === null || _k === void 0 ? void 0 : _k.showMessage("info", `Successfully updated manifest for [${manifest.name.short}]`, false);
|
|
407
328
|
return teamsfx_api_1.ok(teamsAppId);
|
|
408
329
|
}
|
|
409
330
|
catch (error) {
|
|
@@ -421,39 +342,31 @@ class AppStudioPluginImpl {
|
|
|
421
342
|
const archiveAppPackageFolder = path_1.default.join(ctx.root, teamsfx_api_1.ArchiveFolderName, teamsfx_api_1.AppPackageFolderName);
|
|
422
343
|
const archiveManifestPath = path_1.default.join(archiveAppPackageFolder, teamsfx_api_1.V1ManifestFileName);
|
|
423
344
|
// cannot use getAppDirectory before creating the manifest file
|
|
424
|
-
const newAppPackageFolder =
|
|
425
|
-
? `${ctx.root}/${constants_2.APP_PACKAGE_FOLDER_FOR_MULTI_ENV}`
|
|
426
|
-
: `${ctx.root}/${teamsfx_api_1.AppPackageFolderName}`;
|
|
345
|
+
const newAppPackageFolder = `${ctx.root}/${constants_2.APP_PACKAGE_FOLDER_FOR_MULTI_ENV}`;
|
|
427
346
|
await fs.ensureDir(newAppPackageFolder);
|
|
428
|
-
if (await
|
|
347
|
+
if (await fs.pathExists(archiveManifestPath)) {
|
|
429
348
|
manifest = await this.createV1Manifest(ctx);
|
|
430
|
-
const resourcesDir =
|
|
431
|
-
? path_1.default.join(newAppPackageFolder, constants_2.MANIFEST_RESOURCES)
|
|
432
|
-
: newAppPackageFolder;
|
|
349
|
+
const resourcesDir = path_1.default.join(newAppPackageFolder, constants_2.MANIFEST_RESOURCES);
|
|
433
350
|
await fs.ensureDir(resourcesDir);
|
|
434
351
|
if (((_a = manifest === null || manifest === void 0 ? void 0 : manifest.icons) === null || _a === void 0 ? void 0 : _a.color) && !manifest.icons.color.startsWith("https://")) {
|
|
435
352
|
const archiveColorFile = path_1.default.join(archiveAppPackageFolder, manifest.icons.color);
|
|
436
|
-
const existColorFile = await
|
|
353
|
+
const existColorFile = await fs.pathExists(archiveColorFile);
|
|
437
354
|
const newColorFileName = existColorFile
|
|
438
355
|
? path_1.default.basename(manifest.icons.color)
|
|
439
356
|
: constants_2.DEFAULT_COLOR_PNG_FILENAME;
|
|
440
357
|
await fs.copyFile(existColorFile ? archiveColorFile : path_1.default.join(__1.getTemplatesFolder(), constants_2.COLOR_TEMPLATE), path_1.default.join(resourcesDir, newColorFileName));
|
|
441
|
-
manifest.icons.color =
|
|
442
|
-
? `${constants_2.MANIFEST_RESOURCES}/${newColorFileName}`
|
|
443
|
-
: newColorFileName;
|
|
358
|
+
manifest.icons.color = `${constants_2.MANIFEST_RESOURCES}/${newColorFileName}`;
|
|
444
359
|
}
|
|
445
360
|
if (((_b = manifest === null || manifest === void 0 ? void 0 : manifest.icons) === null || _b === void 0 ? void 0 : _b.outline) && !manifest.icons.outline.startsWith("https://")) {
|
|
446
361
|
const archiveOutlineFile = path_1.default.join(archiveAppPackageFolder, manifest.icons.outline);
|
|
447
|
-
const existOutlineFile = await
|
|
362
|
+
const existOutlineFile = await fs.pathExists(archiveOutlineFile);
|
|
448
363
|
const newOutlineFileName = existOutlineFile
|
|
449
364
|
? path_1.default.basename(manifest.icons.outline)
|
|
450
365
|
: constants_2.DEFAULT_OUTLINE_PNG_FILENAME;
|
|
451
366
|
await fs.copyFile(existOutlineFile ? archiveOutlineFile : path_1.default.join(__1.getTemplatesFolder(), constants_2.OUTLINE_TEMPLATE), path_1.default.join(resourcesDir, newOutlineFileName));
|
|
452
|
-
manifest.icons.outline =
|
|
453
|
-
? `${constants_2.MANIFEST_RESOURCES}/${newOutlineFileName}`
|
|
454
|
-
: newOutlineFileName;
|
|
367
|
+
manifest.icons.outline = `${constants_2.MANIFEST_RESOURCES}/${newOutlineFileName}`;
|
|
455
368
|
}
|
|
456
|
-
await fs.writeFile(path_1.default.join(newAppPackageFolder,
|
|
369
|
+
await fs.writeFile(path_1.default.join(newAppPackageFolder, constants_2.MANIFEST_LOCAL), JSON.stringify(manifest, null, 4));
|
|
457
370
|
return { enableAuth: !!((_c = manifest === null || manifest === void 0 ? void 0 : manifest.webApplicationInfo) === null || _c === void 0 ? void 0 : _c.id) };
|
|
458
371
|
}
|
|
459
372
|
else {
|
|
@@ -466,20 +379,14 @@ class AppStudioPluginImpl {
|
|
|
466
379
|
let manifest;
|
|
467
380
|
const templatesFolder = __1.getTemplatesFolder();
|
|
468
381
|
// cannot use getAppDirectory before creating the manifest file
|
|
469
|
-
const appDir =
|
|
470
|
-
? `${ctx.root}/${constants_2.APP_PACKAGE_FOLDER_FOR_MULTI_ENV}`
|
|
471
|
-
: `${ctx.root}/${teamsfx_api_1.AppPackageFolderName}`;
|
|
382
|
+
const appDir = `${ctx.root}/${constants_2.APP_PACKAGE_FOLDER_FOR_MULTI_ENV}`;
|
|
472
383
|
if (common_1.isSPFxProject(ctx.projectSettings)) {
|
|
473
384
|
const templateManifestFolder = path_1.default.join(templatesFolder, "plugins", "resource", "spfx");
|
|
474
|
-
const manifestFile =
|
|
475
|
-
? path_1.default.resolve(templateManifestFolder, "./solution/manifest_multi_env.json")
|
|
476
|
-
: path_1.default.resolve(templateManifestFolder, "./solution/manifest.json");
|
|
385
|
+
const manifestFile = path_1.default.resolve(templateManifestFolder, "./solution/manifest_multi_env.json");
|
|
477
386
|
const manifestString = (await fs.readFile(manifestFile)).toString();
|
|
478
387
|
manifest = JSON.parse(manifestString);
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
await fs.writeFile(`${appDir}/${constants_2.MANIFEST_LOCAL}`, JSON.stringify(localManifest, null, 4));
|
|
482
|
-
}
|
|
388
|
+
const localManifest = await createLocalManifest(ctx.projectSettings.appName, false, false, false, true, false);
|
|
389
|
+
await fs.writeFile(`${appDir}/${constants_2.MANIFEST_LOCAL}`, JSON.stringify(localManifest, null, 4));
|
|
483
390
|
}
|
|
484
391
|
else {
|
|
485
392
|
const solutionSettings = (_a = ctx.projectSettings) === null || _a === void 0 ? void 0 : _a.solutionSettings;
|
|
@@ -487,19 +394,15 @@ class AppStudioPluginImpl {
|
|
|
487
394
|
const hasBot = solutionSettings.capabilities.includes(question_1.BotOptionItem.id);
|
|
488
395
|
const hasMessageExtension = solutionSettings.capabilities.includes(question_1.MessageExtensionItem.id);
|
|
489
396
|
manifest = await createManifest(ctx.projectSettings.appName, hasFrontend, hasBot, hasMessageExtension, false, !!(solutionSettings === null || solutionSettings === void 0 ? void 0 : solutionSettings.migrateFromV1));
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
await fs.writeFile(`${appDir}/${constants_2.MANIFEST_LOCAL}`, JSON.stringify(localDebugManifest, null, 4));
|
|
493
|
-
}
|
|
397
|
+
const localDebugManifest = await createLocalManifest(ctx.projectSettings.appName, hasFrontend, hasBot, hasMessageExtension, false, !!(solutionSettings === null || solutionSettings === void 0 ? void 0 : solutionSettings.migrateFromV1));
|
|
398
|
+
await fs.writeFile(`${appDir}/${constants_2.MANIFEST_LOCAL}`, JSON.stringify(localDebugManifest, null, 4));
|
|
494
399
|
}
|
|
495
400
|
await fs.ensureDir(appDir);
|
|
496
|
-
const manifestTemplatePath =
|
|
497
|
-
? `${appDir}/${constants_2.MANIFEST_TEMPLATE}`
|
|
498
|
-
: `${appDir}/${constants_2.REMOTE_MANIFEST}`;
|
|
401
|
+
const manifestTemplatePath = `${appDir}/${constants_2.MANIFEST_TEMPLATE}`;
|
|
499
402
|
await fs.writeFile(manifestTemplatePath, JSON.stringify(manifest, null, 4));
|
|
500
403
|
const defaultColorPath = path_1.default.join(templatesFolder, constants_2.COLOR_TEMPLATE);
|
|
501
404
|
const defaultOutlinePath = path_1.default.join(templatesFolder, constants_2.OUTLINE_TEMPLATE);
|
|
502
|
-
const resourcesDir =
|
|
405
|
+
const resourcesDir = path_1.default.join(appDir, constants_2.MANIFEST_RESOURCES);
|
|
503
406
|
await fs.ensureDir(resourcesDir);
|
|
504
407
|
await fs.copy(defaultColorPath, `${resourcesDir}/${constants_2.DEFAULT_COLOR_PNG_FILENAME}`);
|
|
505
408
|
await fs.copy(defaultOutlinePath, `${resourcesDir}/${constants_2.DEFAULT_OUTLINE_PNG_FILENAME}`);
|
|
@@ -507,41 +410,32 @@ class AppStudioPluginImpl {
|
|
|
507
410
|
}
|
|
508
411
|
async buildTeamsAppPackage(ctx, isLocalDebug) {
|
|
509
412
|
var _a, _b, _c;
|
|
413
|
+
// Validate manifest
|
|
414
|
+
const validationResult = await this.validateManifest(ctx, isLocalDebug);
|
|
415
|
+
if (validationResult.isOk() && validationResult.value.length > 0) {
|
|
416
|
+
const errMessage = errors_1.AppStudioError.ValidationFailedError.message(validationResult.value);
|
|
417
|
+
const validationFailed = results_1.AppStudioResultFactory.UserError(errors_1.AppStudioError.ValidationFailedError.name, errMessage);
|
|
418
|
+
throw validationFailed;
|
|
419
|
+
}
|
|
510
420
|
let manifestString = undefined;
|
|
511
421
|
if (!((_a = ctx.envInfo) === null || _a === void 0 ? void 0 : _a.envName)) {
|
|
512
422
|
throw new Error("Failed to get target environment name from plugin context.");
|
|
513
423
|
}
|
|
514
424
|
const appDirectory = await common_1.getAppDirectory(ctx.root);
|
|
515
425
|
let zipFileName;
|
|
516
|
-
if (
|
|
517
|
-
|
|
518
|
-
zipFileName = `${ctx.root}/${teamsfx_api_1.BuildFolderName}/${teamsfx_api_1.AppPackageFolderName}/appPackage.local.zip`;
|
|
519
|
-
}
|
|
520
|
-
else {
|
|
521
|
-
zipFileName = `${ctx.root}/${teamsfx_api_1.BuildFolderName}/${teamsfx_api_1.AppPackageFolderName}/appPackage.${ctx.envInfo.envName}.zip`;
|
|
522
|
-
}
|
|
426
|
+
if (isLocalDebug) {
|
|
427
|
+
zipFileName = `${ctx.root}/${teamsfx_api_1.BuildFolderName}/${teamsfx_api_1.AppPackageFolderName}/appPackage.local.zip`;
|
|
523
428
|
}
|
|
524
429
|
else {
|
|
525
|
-
zipFileName = `${ctx.root}/${teamsfx_api_1.AppPackageFolderName}/appPackage.zip`;
|
|
430
|
+
zipFileName = `${ctx.root}/${teamsfx_api_1.BuildFolderName}/${teamsfx_api_1.AppPackageFolderName}/appPackage.${ctx.envInfo.envName}.zip`;
|
|
526
431
|
}
|
|
527
432
|
if (common_1.isSPFxProject(ctx.projectSettings)) {
|
|
528
|
-
manifestString =
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
state: {
|
|
533
|
-
"fx-resource-appstudio": {
|
|
534
|
-
teamsAppId: await this.getTeamsAppId(ctx, isLocalDebug),
|
|
535
|
-
},
|
|
536
|
-
},
|
|
537
|
-
};
|
|
538
|
-
manifestString = mustache_1.default.render(manifestString, view);
|
|
539
|
-
const manifest = JSON.parse(manifestString);
|
|
540
|
-
if (!isUUID_1.default(manifest.id)) {
|
|
541
|
-
manifest.id = uuid_1.v4();
|
|
542
|
-
}
|
|
543
|
-
manifestString = JSON.stringify(manifest, null, 4);
|
|
433
|
+
manifestString = await this.getSPFxManifest(ctx, isLocalDebug);
|
|
434
|
+
const manifest = JSON.parse(manifestString);
|
|
435
|
+
if (!isUUID_1.default(manifest.id)) {
|
|
436
|
+
manifest.id = uuid_1.v4();
|
|
544
437
|
}
|
|
438
|
+
manifestString = JSON.stringify(manifest, null, 4);
|
|
545
439
|
}
|
|
546
440
|
else {
|
|
547
441
|
const manifest = await this.getAppDefinitionAndManifest(ctx, isLocalDebug);
|
|
@@ -571,7 +465,7 @@ class AppStudioPluginImpl {
|
|
|
571
465
|
// color icon
|
|
572
466
|
if (manifest.icons.color && !manifest.icons.color.startsWith("https://")) {
|
|
573
467
|
const colorFile = `${appDirectory}/${manifest.icons.color}`;
|
|
574
|
-
const fileExists = await
|
|
468
|
+
const fileExists = await fs.pathExists(colorFile);
|
|
575
469
|
if (!fileExists) {
|
|
576
470
|
throw results_1.AppStudioResultFactory.UserError(errors_1.AppStudioError.FileNotFoundError.name, errors_1.AppStudioError.FileNotFoundError.message(colorFile));
|
|
577
471
|
}
|
|
@@ -581,20 +475,22 @@ class AppStudioPluginImpl {
|
|
|
581
475
|
// outline icon
|
|
582
476
|
if (manifest.icons.outline && !manifest.icons.outline.startsWith("https://")) {
|
|
583
477
|
const outlineFile = `${appDirectory}/${manifest.icons.outline}`;
|
|
584
|
-
const fileExists = await
|
|
478
|
+
const fileExists = await fs.pathExists(outlineFile);
|
|
585
479
|
if (!fileExists) {
|
|
586
480
|
throw results_1.AppStudioResultFactory.UserError(errors_1.AppStudioError.FileNotFoundError.name, errors_1.AppStudioError.FileNotFoundError.message(outlineFile));
|
|
587
481
|
}
|
|
588
482
|
const dir = path_1.default.dirname(manifest.icons.outline);
|
|
589
483
|
zip.addLocalFile(outlineFile, dir === "." ? "" : dir);
|
|
590
484
|
}
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
await fs.
|
|
485
|
+
await fs.ensureDir(path_1.default.dirname(zipFileName));
|
|
486
|
+
const manifestFileName = `${ctx.root}/${teamsfx_api_1.BuildFolderName}/${teamsfx_api_1.AppPackageFolderName}/manifest.` +
|
|
487
|
+
(isLocalDebug ? "local" : ctx.envInfo.envName) +
|
|
488
|
+
`.json`;
|
|
489
|
+
if (await fs.pathExists(manifestFileName)) {
|
|
490
|
+
await fs.chmod(manifestFileName, 0o777);
|
|
597
491
|
}
|
|
492
|
+
await fs.writeFile(manifestFileName, manifestString);
|
|
493
|
+
await fs.chmod(manifestFileName, 0o444);
|
|
598
494
|
// localization file
|
|
599
495
|
if (manifest.localizationInfo &&
|
|
600
496
|
manifest.localizationInfo.additionalLanguages &&
|
|
@@ -616,18 +512,12 @@ class AppStudioPluginImpl {
|
|
|
616
512
|
if (appDirectory === `${ctx.root}/.${teamsfx_api_1.ConfigFolderName}`) {
|
|
617
513
|
await fs.ensureDir(path_1.default.join(ctx.root, `${teamsfx_api_1.AppPackageFolderName}`));
|
|
618
514
|
const formerZipFileName = `${appDirectory}/appPackage.zip`;
|
|
619
|
-
if (await
|
|
515
|
+
if (await fs.pathExists(formerZipFileName)) {
|
|
620
516
|
await fs.remove(formerZipFileName);
|
|
621
517
|
}
|
|
622
|
-
await fs.move(`${appDirectory}/${manifest.icons.color}`,
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
await fs.move(`${appDirectory}/${manifest.icons.outline}`, common_1.isMultiEnvEnabled()
|
|
626
|
-
? `${ctx.root}/${constants_2.APP_PACKAGE_FOLDER_FOR_MULTI_ENV}/${constants_2.MANIFEST_RESOURCES}/${manifest.icons.outline}`
|
|
627
|
-
: `${ctx.root}/${teamsfx_api_1.AppPackageFolderName}/${manifest.icons.outline}`);
|
|
628
|
-
await fs.move(`${appDirectory}/${constants_2.REMOTE_MANIFEST}`, common_1.isMultiEnvEnabled()
|
|
629
|
-
? `${ctx.root}/${constants_2.APP_PACKAGE_FOLDER_FOR_MULTI_ENV}/${constants_2.MANIFEST_TEMPLATE}`
|
|
630
|
-
: `${ctx.root}/${teamsfx_api_1.AppPackageFolderName}/${constants_2.REMOTE_MANIFEST}`);
|
|
518
|
+
await fs.move(`${appDirectory}/${manifest.icons.color}`, `${ctx.root}/${constants_2.APP_PACKAGE_FOLDER_FOR_MULTI_ENV}/${constants_2.MANIFEST_RESOURCES}/${manifest.icons.color}`);
|
|
519
|
+
await fs.move(`${appDirectory}/${manifest.icons.outline}`, `${ctx.root}/${constants_2.APP_PACKAGE_FOLDER_FOR_MULTI_ENV}/${constants_2.MANIFEST_RESOURCES}/${manifest.icons.outline}`);
|
|
520
|
+
await fs.move(`${appDirectory}/${constants_2.REMOTE_MANIFEST}`, `${ctx.root}/${constants_2.APP_PACKAGE_FOLDER_FOR_MULTI_ENV}/${constants_2.MANIFEST_TEMPLATE}`);
|
|
631
521
|
}
|
|
632
522
|
return zipFileName;
|
|
633
523
|
}
|
|
@@ -637,17 +527,7 @@ class AppStudioPluginImpl {
|
|
|
637
527
|
const appDirectory = await common_1.getAppDirectory(ctx.root);
|
|
638
528
|
let manifestString = JSON.stringify(await fs.readJSON(await this.getManifestTemplatePath(ctx.root)));
|
|
639
529
|
if (common_1.isSPFxProject(ctx.projectSettings)) {
|
|
640
|
-
|
|
641
|
-
const view = {
|
|
642
|
-
config: ctx.envInfo.config,
|
|
643
|
-
state: {
|
|
644
|
-
"fx-resource-appstudio": {
|
|
645
|
-
teamsAppId: await this.getTeamsAppId(ctx, false),
|
|
646
|
-
},
|
|
647
|
-
},
|
|
648
|
-
};
|
|
649
|
-
manifestString = mustache_1.default.render(manifestString, view);
|
|
650
|
-
}
|
|
530
|
+
manifestString = await this.getSPFxManifest(ctx, false);
|
|
651
531
|
manifest = JSON.parse(manifestString);
|
|
652
532
|
}
|
|
653
533
|
else {
|
|
@@ -690,10 +570,10 @@ class AppStudioPluginImpl {
|
|
|
690
570
|
}
|
|
691
571
|
}
|
|
692
572
|
async postLocalDebug(ctx) {
|
|
693
|
-
var _a, _b
|
|
573
|
+
var _a, _b;
|
|
694
574
|
let teamsAppId;
|
|
695
575
|
const manifestPath = await this.getManifestTemplatePath(ctx.root, true);
|
|
696
|
-
const manifest = await this.
|
|
576
|
+
const manifest = await this.reloadManifest(manifestPath);
|
|
697
577
|
if (manifest.isErr()) {
|
|
698
578
|
return teamsfx_api_1.err(manifest.error);
|
|
699
579
|
}
|
|
@@ -706,12 +586,7 @@ class AppStudioPluginImpl {
|
|
|
706
586
|
if (teamsAppId.isErr()) {
|
|
707
587
|
return teamsAppId;
|
|
708
588
|
}
|
|
709
|
-
|
|
710
|
-
(_b = (_a = ctx.localSettings) === null || _a === void 0 ? void 0 : _a.teamsApp) === null || _b === void 0 ? void 0 : _b.set(constants_2.Constants.TEAMS_APP_ID, teamsAppId.value);
|
|
711
|
-
}
|
|
712
|
-
else {
|
|
713
|
-
(_d = (_c = ctx.envInfo) === null || _c === void 0 ? void 0 : _c.state.get("solution")) === null || _d === void 0 ? void 0 : _d.set(constants_1.LOCAL_DEBUG_TEAMS_APP_ID, teamsAppId.value);
|
|
714
|
-
}
|
|
589
|
+
(_b = (_a = ctx.localSettings) === null || _a === void 0 ? void 0 : _a.teamsApp) === null || _b === void 0 ? void 0 : _b.set(constants_2.Constants.TEAMS_APP_ID, teamsAppId.value);
|
|
715
590
|
return teamsfx_api_1.ok(teamsAppId.value);
|
|
716
591
|
}
|
|
717
592
|
async checkPermission(ctx, userInfo) {
|
|
@@ -719,12 +594,7 @@ class AppStudioPluginImpl {
|
|
|
719
594
|
const appStudioToken = await ((_a = ctx === null || ctx === void 0 ? void 0 : ctx.appStudioToken) === null || _a === void 0 ? void 0 : _a.getAccessToken());
|
|
720
595
|
const teamsAppId = await this.getTeamsAppId(ctx, false);
|
|
721
596
|
if (!teamsAppId) {
|
|
722
|
-
|
|
723
|
-
throw new Error(constants_2.ErrorMessages.GetConfigError(constants_2.Constants.TEAMS_APP_ID, constants_1.PluginNames.APPST));
|
|
724
|
-
}
|
|
725
|
-
else {
|
|
726
|
-
throw new Error(constants_2.ErrorMessages.GetConfigError(constants_1.REMOTE_TEAMS_APP_ID, constants_2.SOLUTION));
|
|
727
|
-
}
|
|
597
|
+
throw new Error(constants_2.ErrorMessages.GetConfigError(constants_2.Constants.TEAMS_APP_ID, constants_1.PluginNames.APPST));
|
|
728
598
|
}
|
|
729
599
|
const teamsAppRoles = await appStudio_1.AppStudioClient.checkPermission(teamsAppId, appStudioToken, userInfo.aadId);
|
|
730
600
|
const result = [
|
|
@@ -742,12 +612,7 @@ class AppStudioPluginImpl {
|
|
|
742
612
|
const appStudioToken = await ((_a = ctx === null || ctx === void 0 ? void 0 : ctx.appStudioToken) === null || _a === void 0 ? void 0 : _a.getAccessToken());
|
|
743
613
|
const teamsAppId = await this.getTeamsAppId(ctx, false);
|
|
744
614
|
if (!teamsAppId) {
|
|
745
|
-
|
|
746
|
-
throw new Error(constants_2.ErrorMessages.GetConfigError(constants_2.Constants.TEAMS_APP_ID, constants_1.PluginNames.APPST));
|
|
747
|
-
}
|
|
748
|
-
else {
|
|
749
|
-
throw new Error(constants_2.ErrorMessages.GetConfigError(constants_1.REMOTE_TEAMS_APP_ID, constants_2.SOLUTION));
|
|
750
|
-
}
|
|
615
|
+
throw new Error(constants_2.ErrorMessages.GetConfigError(constants_2.Constants.TEAMS_APP_ID, constants_1.PluginNames.APPST));
|
|
751
616
|
}
|
|
752
617
|
let userLists;
|
|
753
618
|
try {
|
|
@@ -781,12 +646,7 @@ class AppStudioPluginImpl {
|
|
|
781
646
|
const appStudioToken = await ((_a = ctx === null || ctx === void 0 ? void 0 : ctx.appStudioToken) === null || _a === void 0 ? void 0 : _a.getAccessToken());
|
|
782
647
|
const teamsAppId = await this.getTeamsAppId(ctx, false);
|
|
783
648
|
if (!teamsAppId) {
|
|
784
|
-
|
|
785
|
-
throw new Error(errors_1.AppStudioError.GrantPermissionFailedError.message(constants_2.ErrorMessages.GetConfigError(constants_2.Constants.TEAMS_APP_ID, constants_1.PluginNames.APPST)));
|
|
786
|
-
}
|
|
787
|
-
else {
|
|
788
|
-
throw new Error(errors_1.AppStudioError.GrantPermissionFailedError.message(constants_2.ErrorMessages.GetConfigError(constants_1.REMOTE_TEAMS_APP_ID, constants_2.SOLUTION)));
|
|
789
|
-
}
|
|
649
|
+
throw new Error(errors_1.AppStudioError.GrantPermissionFailedError.message(constants_2.ErrorMessages.GetConfigError(constants_2.Constants.TEAMS_APP_ID, constants_1.PluginNames.APPST)));
|
|
790
650
|
}
|
|
791
651
|
try {
|
|
792
652
|
await appStudio_1.AppStudioClient.grantPermission(teamsAppId, appStudioToken, userInfo);
|
|
@@ -805,7 +665,7 @@ class AppStudioPluginImpl {
|
|
|
805
665
|
return result;
|
|
806
666
|
}
|
|
807
667
|
async beforePublish(ctx, appDirectory, manifestString, update) {
|
|
808
|
-
var _a, _b, _c, _d;
|
|
668
|
+
var _a, _b, _c, _d, _e;
|
|
809
669
|
const manifest = JSON.parse(manifestString);
|
|
810
670
|
const publishProgress = (_a = ctx.ui) === null || _a === void 0 ? void 0 : _a.createProgressBar(`Publishing ${manifest.name.short}`, 3);
|
|
811
671
|
try {
|
|
@@ -830,7 +690,11 @@ class AppStudioPluginImpl {
|
|
|
830
690
|
? (await fs.readFile(`${appDirectory}/${manifest.icons.outline}`)).toString("base64")
|
|
831
691
|
: undefined;
|
|
832
692
|
try {
|
|
833
|
-
await appStudio_1.AppStudioClient.updateApp(remoteTeamsAppId, appDefinitionRes.value, appStudioToken, undefined, colorIconContent, outlineIconContent);
|
|
693
|
+
const app = await appStudio_1.AppStudioClient.updateApp(remoteTeamsAppId, appDefinitionRes.value, appStudioToken, undefined, colorIconContent, outlineIconContent);
|
|
694
|
+
if (app.updatedAt) {
|
|
695
|
+
(_d = ctx.envInfo.state
|
|
696
|
+
.get(constants_1.PluginNames.APPST)) === null || _d === void 0 ? void 0 : _d.set(constants_2.Constants.TEAMS_APP_UPDATED_AT, new Date(app.updatedAt).getTime());
|
|
697
|
+
}
|
|
834
698
|
}
|
|
835
699
|
catch (e) {
|
|
836
700
|
if (e.name === 404) {
|
|
@@ -842,7 +706,7 @@ class AppStudioPluginImpl {
|
|
|
842
706
|
await (publishProgress === null || publishProgress === void 0 ? void 0 : publishProgress.next(`Building Teams app package in ${appDirectory}.`));
|
|
843
707
|
const appPackage = await this.buildTeamsAppPackage(ctx, false);
|
|
844
708
|
const appContent = await fs.readFile(appPackage);
|
|
845
|
-
appStudioToken = await ((
|
|
709
|
+
appStudioToken = await ((_e = ctx.appStudioToken) === null || _e === void 0 ? void 0 : _e.getAccessToken());
|
|
846
710
|
await (publishProgress === null || publishProgress === void 0 ? void 0 : publishProgress.next(`Publishing ${manifest.name.short}`));
|
|
847
711
|
if (update) {
|
|
848
712
|
// Update existing app in App Catalog
|
|
@@ -857,15 +721,6 @@ class AppStudioPluginImpl {
|
|
|
857
721
|
await (publishProgress === null || publishProgress === void 0 ? void 0 : publishProgress.end(true));
|
|
858
722
|
}
|
|
859
723
|
}
|
|
860
|
-
async checkFileExist(filePath) {
|
|
861
|
-
try {
|
|
862
|
-
await fs.stat(filePath);
|
|
863
|
-
return true;
|
|
864
|
-
}
|
|
865
|
-
catch (error) {
|
|
866
|
-
return false;
|
|
867
|
-
}
|
|
868
|
-
}
|
|
869
724
|
replaceExistingValueToPlaceholder(config, value, placeholderName) {
|
|
870
725
|
if (config && value && placeholderName) {
|
|
871
726
|
config = config.split(value).join(placeholderName);
|
|
@@ -962,113 +817,61 @@ class AppStudioPluginImpl {
|
|
|
962
817
|
};
|
|
963
818
|
}
|
|
964
819
|
getTabEndpoint(ctx, isLocalDebug) {
|
|
965
|
-
var _a, _b, _c
|
|
966
|
-
|
|
967
|
-
|
|
968
|
-
|
|
969
|
-
? (_b = (_a = ctx.localSettings) === null || _a === void 0 ? void 0 : _a.frontend) === null || _b === void 0 ? void 0 : _b.get(localSettingsConstants_1.LocalSettingsFrontendKeys.TabEndpoint)
|
|
970
|
-
: (_c = ctx.envInfo.state.get(constants_1.PluginNames.FE)) === null || _c === void 0 ? void 0 : _c.get(constants_2.FRONTEND_ENDPOINT);
|
|
971
|
-
}
|
|
972
|
-
else {
|
|
973
|
-
tabEndpoint = isLocalDebug
|
|
974
|
-
? (_d = ctx.envInfo.state.get(constants_1.PluginNames.LDEBUG)) === null || _d === void 0 ? void 0 : _d.get(constants_1.LOCAL_DEBUG_TAB_ENDPOINT)
|
|
975
|
-
: (_e = ctx.envInfo.state.get(constants_1.PluginNames.FE)) === null || _e === void 0 ? void 0 : _e.get(constants_2.FRONTEND_ENDPOINT);
|
|
976
|
-
}
|
|
820
|
+
var _a, _b, _c;
|
|
821
|
+
const tabEndpoint = isLocalDebug
|
|
822
|
+
? (_b = (_a = ctx.localSettings) === null || _a === void 0 ? void 0 : _a.frontend) === null || _b === void 0 ? void 0 : _b.get(localSettingsConstants_1.LocalSettingsFrontendKeys.TabEndpoint)
|
|
823
|
+
: (_c = ctx.envInfo.state.get(constants_1.PluginNames.FE)) === null || _c === void 0 ? void 0 : _c.get(constants_2.FRONTEND_ENDPOINT);
|
|
977
824
|
return tabEndpoint;
|
|
978
825
|
}
|
|
979
826
|
getTabDomain(ctx, isLocalDebug) {
|
|
980
|
-
var _a, _b, _c
|
|
981
|
-
|
|
982
|
-
|
|
983
|
-
|
|
984
|
-
? (_b = (_a = ctx.localSettings) === null || _a === void 0 ? void 0 : _a.frontend) === null || _b === void 0 ? void 0 : _b.get(localSettingsConstants_1.LocalSettingsFrontendKeys.TabDomain)
|
|
985
|
-
: (_c = ctx.envInfo.state.get(constants_1.PluginNames.FE)) === null || _c === void 0 ? void 0 : _c.get(constants_2.FRONTEND_DOMAIN);
|
|
986
|
-
}
|
|
987
|
-
else {
|
|
988
|
-
tabDomain = isLocalDebug
|
|
989
|
-
? (_d = ctx.envInfo.state.get(constants_1.PluginNames.LDEBUG)) === null || _d === void 0 ? void 0 : _d.get(constants_1.LOCAL_DEBUG_TAB_DOMAIN)
|
|
990
|
-
: (_e = ctx.envInfo.state.get(constants_1.PluginNames.FE)) === null || _e === void 0 ? void 0 : _e.get(constants_2.FRONTEND_DOMAIN);
|
|
991
|
-
}
|
|
827
|
+
var _a, _b, _c;
|
|
828
|
+
const tabDomain = isLocalDebug
|
|
829
|
+
? (_b = (_a = ctx.localSettings) === null || _a === void 0 ? void 0 : _a.frontend) === null || _b === void 0 ? void 0 : _b.get(localSettingsConstants_1.LocalSettingsFrontendKeys.TabDomain)
|
|
830
|
+
: (_c = ctx.envInfo.state.get(constants_1.PluginNames.FE)) === null || _c === void 0 ? void 0 : _c.get(constants_2.FRONTEND_DOMAIN);
|
|
992
831
|
return tabDomain;
|
|
993
832
|
}
|
|
994
833
|
getAadClientId(ctx, isLocalDebug) {
|
|
995
|
-
var _a, _b, _c
|
|
996
|
-
|
|
997
|
-
|
|
998
|
-
|
|
999
|
-
? (_b = (_a = ctx.localSettings) === null || _a === void 0 ? void 0 : _a.auth) === null || _b === void 0 ? void 0 : _b.get(localSettingsConstants_1.LocalSettingsAuthKeys.ClientId)
|
|
1000
|
-
: (_c = ctx.envInfo.state.get(constants_1.PluginNames.AAD)) === null || _c === void 0 ? void 0 : _c.get(constants_1.REMOTE_AAD_ID);
|
|
1001
|
-
}
|
|
1002
|
-
else {
|
|
1003
|
-
clientId = (_d = ctx.envInfo.state
|
|
1004
|
-
.get(constants_1.PluginNames.AAD)) === null || _d === void 0 ? void 0 : _d.get(isLocalDebug ? constants_1.LOCAL_DEBUG_AAD_ID : constants_1.REMOTE_AAD_ID);
|
|
1005
|
-
}
|
|
834
|
+
var _a, _b, _c;
|
|
835
|
+
const clientId = isLocalDebug
|
|
836
|
+
? (_b = (_a = ctx.localSettings) === null || _a === void 0 ? void 0 : _a.auth) === null || _b === void 0 ? void 0 : _b.get(localSettingsConstants_1.LocalSettingsAuthKeys.ClientId)
|
|
837
|
+
: (_c = ctx.envInfo.state.get(constants_1.PluginNames.AAD)) === null || _c === void 0 ? void 0 : _c.get(constants_1.REMOTE_AAD_ID);
|
|
1006
838
|
return clientId;
|
|
1007
839
|
}
|
|
1008
840
|
getBotId(ctx, isLocalDebug) {
|
|
1009
|
-
var _a, _b, _c
|
|
1010
|
-
|
|
1011
|
-
|
|
1012
|
-
|
|
1013
|
-
? (_b = (_a = ctx.localSettings) === null || _a === void 0 ? void 0 : _a.bot) === null || _b === void 0 ? void 0 : _b.get(localSettingsConstants_1.LocalSettingsBotKeys.BotId)
|
|
1014
|
-
: (_c = ctx.envInfo.state.get(constants_1.PluginNames.BOT)) === null || _c === void 0 ? void 0 : _c.get(constants_2.BOT_ID);
|
|
1015
|
-
}
|
|
1016
|
-
else {
|
|
1017
|
-
botId = (_d = ctx.envInfo.state
|
|
1018
|
-
.get(constants_1.PluginNames.BOT)) === null || _d === void 0 ? void 0 : _d.get(isLocalDebug ? constants_2.LOCAL_BOT_ID : constants_2.BOT_ID);
|
|
1019
|
-
}
|
|
841
|
+
var _a, _b, _c;
|
|
842
|
+
const botId = isLocalDebug
|
|
843
|
+
? (_b = (_a = ctx.localSettings) === null || _a === void 0 ? void 0 : _a.bot) === null || _b === void 0 ? void 0 : _b.get(localSettingsConstants_1.LocalSettingsBotKeys.BotId)
|
|
844
|
+
: (_c = ctx.envInfo.state.get(constants_1.PluginNames.BOT)) === null || _c === void 0 ? void 0 : _c.get(constants_2.BOT_ID);
|
|
1020
845
|
return botId;
|
|
1021
846
|
}
|
|
1022
847
|
getBotDomain(ctx, isLocalDebug) {
|
|
1023
|
-
var _a, _b, _c
|
|
1024
|
-
|
|
1025
|
-
|
|
1026
|
-
|
|
1027
|
-
? (_b = (_a = ctx.localSettings) === null || _a === void 0 ? void 0 : _a.bot) === null || _b === void 0 ? void 0 : _b.get(localSettingsConstants_1.LocalSettingsBotKeys.BotDomain)
|
|
1028
|
-
: (_c = ctx.envInfo.state.get(constants_1.PluginNames.BOT)) === null || _c === void 0 ? void 0 : _c.get(constants_1.BOT_DOMAIN);
|
|
1029
|
-
}
|
|
1030
|
-
else {
|
|
1031
|
-
botDomain = isLocalDebug
|
|
1032
|
-
? (_d = ctx.envInfo.state.get(constants_1.PluginNames.LDEBUG)) === null || _d === void 0 ? void 0 : _d.get(constants_1.LOCAL_DEBUG_BOT_DOMAIN)
|
|
1033
|
-
: (_e = ctx.envInfo.state.get(constants_1.PluginNames.BOT)) === null || _e === void 0 ? void 0 : _e.get(constants_1.BOT_DOMAIN);
|
|
1034
|
-
}
|
|
848
|
+
var _a, _b, _c;
|
|
849
|
+
const botDomain = isLocalDebug
|
|
850
|
+
? (_b = (_a = ctx.localSettings) === null || _a === void 0 ? void 0 : _a.bot) === null || _b === void 0 ? void 0 : _b.get(localSettingsConstants_1.LocalSettingsBotKeys.BotDomain)
|
|
851
|
+
: (_c = ctx.envInfo.state.get(constants_1.PluginNames.BOT)) === null || _c === void 0 ? void 0 : _c.get(constants_1.BOT_DOMAIN);
|
|
1035
852
|
return botDomain;
|
|
1036
853
|
}
|
|
1037
854
|
getApplicationIdUris(ctx, isLocalDebug) {
|
|
1038
|
-
var _a, _b, _c
|
|
1039
|
-
|
|
1040
|
-
|
|
1041
|
-
|
|
1042
|
-
? (_b = (_a = ctx.localSettings) === null || _a === void 0 ? void 0 : _a.auth) === null || _b === void 0 ? void 0 : _b.get(localSettingsConstants_1.LocalSettingsAuthKeys.ApplicationIdUris)
|
|
1043
|
-
: (_c = ctx.envInfo.state.get(constants_1.PluginNames.AAD)) === null || _c === void 0 ? void 0 : _c.get(constants_1.WEB_APPLICATION_INFO_SOURCE);
|
|
1044
|
-
}
|
|
1045
|
-
else {
|
|
1046
|
-
applicationIdUris = (_d = ctx.envInfo.state
|
|
1047
|
-
.get(constants_1.PluginNames.AAD)) === null || _d === void 0 ? void 0 : _d.get(isLocalDebug ? constants_1.LOCAL_WEB_APPLICATION_INFO_SOURCE : constants_1.WEB_APPLICATION_INFO_SOURCE);
|
|
1048
|
-
}
|
|
855
|
+
var _a, _b, _c;
|
|
856
|
+
const applicationIdUris = isLocalDebug
|
|
857
|
+
? (_b = (_a = ctx.localSettings) === null || _a === void 0 ? void 0 : _a.auth) === null || _b === void 0 ? void 0 : _b.get(localSettingsConstants_1.LocalSettingsAuthKeys.ApplicationIdUris)
|
|
858
|
+
: (_c = ctx.envInfo.state.get(constants_1.PluginNames.AAD)) === null || _c === void 0 ? void 0 : _c.get(constants_1.WEB_APPLICATION_INFO_SOURCE);
|
|
1049
859
|
return applicationIdUris;
|
|
1050
860
|
}
|
|
1051
861
|
async getTeamsAppId(ctx, isLocalDebug) {
|
|
1052
|
-
var _a, _b, _c
|
|
1053
|
-
let teamsAppId;
|
|
1054
|
-
|
|
1055
|
-
|
|
1056
|
-
|
|
1057
|
-
|
|
862
|
+
var _a, _b, _c;
|
|
863
|
+
let teamsAppId = "";
|
|
864
|
+
// User may manually update id in manifest template file, rather than configuration file
|
|
865
|
+
// The id in manifest template file should override configurations
|
|
866
|
+
const manifestFile = await this.getManifestTemplatePath(ctx.root, isLocalDebug);
|
|
867
|
+
if (await fs.pathExists(manifestFile)) {
|
|
868
|
+
const manifest = await fs.readJSON(manifestFile);
|
|
1058
869
|
teamsAppId = manifest.id;
|
|
1059
|
-
if (!isUUID_1.default(teamsAppId)) {
|
|
1060
|
-
if (common_1.isMultiEnvEnabled()) {
|
|
1061
|
-
teamsAppId = isLocalDebug
|
|
1062
|
-
? (_b = (_a = ctx.localSettings) === null || _a === void 0 ? void 0 : _a.teamsApp) === null || _b === void 0 ? void 0 : _b.get(localSettingsConstants_1.LocalSettingsTeamsAppKeys.TeamsAppId)
|
|
1063
|
-
: (_c = ctx.envInfo.state.get(constants_1.PluginNames.APPST)) === null || _c === void 0 ? void 0 : _c.get(constants_2.Constants.TEAMS_APP_ID);
|
|
1064
|
-
}
|
|
1065
|
-
else {
|
|
1066
|
-
teamsAppId = (_d = ctx.envInfo.state.get("solution")) === null || _d === void 0 ? void 0 : _d.get(constants_1.REMOTE_TEAMS_APP_ID);
|
|
1067
|
-
}
|
|
1068
|
-
}
|
|
1069
870
|
}
|
|
1070
|
-
|
|
1071
|
-
teamsAppId =
|
|
871
|
+
if (!isUUID_1.default(teamsAppId)) {
|
|
872
|
+
teamsAppId = isLocalDebug
|
|
873
|
+
? (_b = (_a = ctx.localSettings) === null || _a === void 0 ? void 0 : _a.teamsApp) === null || _b === void 0 ? void 0 : _b.get(localSettingsConstants_1.LocalSettingsTeamsAppKeys.TeamsAppId)
|
|
874
|
+
: (_c = ctx.envInfo.state.get(constants_1.PluginNames.APPST)) === null || _c === void 0 ? void 0 : _c.get(constants_2.Constants.TEAMS_APP_ID);
|
|
1072
875
|
}
|
|
1073
876
|
return teamsAppId;
|
|
1074
877
|
}
|
|
@@ -1181,6 +984,7 @@ class AppStudioPluginImpl {
|
|
|
1181
984
|
}
|
|
1182
985
|
}
|
|
1183
986
|
async updateApp(ctx, appDefinition, appStudioToken, isLocalDebug, createIfNotExist, appDirectory, teamsAppId, logProvider) {
|
|
987
|
+
var _a;
|
|
1184
988
|
if (appStudioToken === undefined || appStudioToken.length === 0) {
|
|
1185
989
|
return teamsfx_api_1.err(results_1.AppStudioResultFactory.SystemError(errors_1.AppStudioError.AppStudioTokenGetFailedError.name, errors_1.AppStudioError.AppStudioTokenGetFailedError.message));
|
|
1186
990
|
}
|
|
@@ -1206,7 +1010,11 @@ class AppStudioPluginImpl {
|
|
|
1206
1010
|
: undefined;
|
|
1207
1011
|
appDefinition.appId = teamsAppId;
|
|
1208
1012
|
try {
|
|
1209
|
-
await appStudio_1.AppStudioClient.updateApp(teamsAppId, appDefinition, appStudioToken, logProvider, colorIconContent, outlineIconContent);
|
|
1013
|
+
const app = await appStudio_1.AppStudioClient.updateApp(teamsAppId, appDefinition, appStudioToken, logProvider, colorIconContent, outlineIconContent);
|
|
1014
|
+
if (app.updatedAt && !isLocalDebug) {
|
|
1015
|
+
const time = new Date(app.updatedAt).getTime();
|
|
1016
|
+
(_a = ctx.envInfo.state.get(constants_1.PluginNames.APPST)) === null || _a === void 0 ? void 0 : _a.set(constants_2.Constants.TEAMS_APP_UPDATED_AT, time);
|
|
1017
|
+
}
|
|
1210
1018
|
return teamsfx_api_1.ok(teamsAppId);
|
|
1211
1019
|
}
|
|
1212
1020
|
catch (e) {
|
|
@@ -1219,7 +1027,7 @@ class AppStudioPluginImpl {
|
|
|
1219
1027
|
}
|
|
1220
1028
|
}
|
|
1221
1029
|
async getAppDefinitionAndManifest(ctx, isLocalDebug) {
|
|
1222
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u
|
|
1030
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u;
|
|
1223
1031
|
const { tabEndpoint, tabDomain, aadId, botDomain, botId, webApplicationInfoResource, teamsAppId, } = await this.getConfigForCreatingManifest(ctx, isLocalDebug);
|
|
1224
1032
|
const isProvisionSucceeded = !!((_a = ctx.envInfo.state
|
|
1225
1033
|
.get("solution")) === null || _a === void 0 ? void 0 : _a.get(constants_1.SOLUTION_PROVISION_SUCCEEDED));
|
|
@@ -1240,7 +1048,11 @@ class AppStudioPluginImpl {
|
|
|
1240
1048
|
validDomains.push(botDomain);
|
|
1241
1049
|
}
|
|
1242
1050
|
}
|
|
1243
|
-
|
|
1051
|
+
const manifestFile = await this.getManifestTemplatePath(ctx.root, isLocalDebug);
|
|
1052
|
+
if (!(await fs.pathExists(manifestFile))) {
|
|
1053
|
+
return teamsfx_api_1.err(results_1.AppStudioResultFactory.SystemError(errors_1.AppStudioError.FileNotFoundError.name, errors_1.AppStudioError.FileNotFoundError.message(manifestFile)));
|
|
1054
|
+
}
|
|
1055
|
+
let manifest = (await fs.readFile(manifestFile)).toString();
|
|
1244
1056
|
// Bot only project, without frontend hosting
|
|
1245
1057
|
let endpoint = tabEndpoint;
|
|
1246
1058
|
const solutionSettings = (_b = ctx.projectSettings) === null || _b === void 0 ? void 0 : _b.solutionSettings;
|
|
@@ -1248,90 +1060,65 @@ class AppStudioPluginImpl {
|
|
|
1248
1060
|
if (!endpoint && !hasFrontend) {
|
|
1249
1061
|
endpoint = constants_2.DEFAULT_DEVELOPER_WEBSITE_URL;
|
|
1250
1062
|
}
|
|
1251
|
-
|
|
1252
|
-
|
|
1253
|
-
|
|
1254
|
-
|
|
1255
|
-
|
|
1256
|
-
|
|
1257
|
-
|
|
1258
|
-
|
|
1259
|
-
"fx-resource-frontend-hosting"
|
|
1260
|
-
endpoint: endpoint !== null && endpoint !== void 0 ? endpoint : "{{{state.fx-resource-frontend-hosting.endpoint}}}",
|
|
1261
|
-
},
|
|
1262
|
-
"fx-resource-aad-app-for-teams": {
|
|
1263
|
-
clientId: aadId !== null && aadId !== void 0 ? aadId : "{{state.fx-resource-aad-app-for-teams.clientId}}",
|
|
1264
|
-
applicationIdUris: webApplicationInfoResource !== null && webApplicationInfoResource !== void 0 ? webApplicationInfoResource : "{{{state.fx-resource-aad-app-for-teams.applicationIdUris}}}",
|
|
1265
|
-
},
|
|
1266
|
-
"fx-resource-appstudio": {
|
|
1267
|
-
teamsAppId: teamsAppId !== null && teamsAppId !== void 0 ? teamsAppId : "{{state.fx-resource-appstudio.teamsAppId}}",
|
|
1268
|
-
},
|
|
1269
|
-
"fx-resource-bot": {
|
|
1270
|
-
botId: botId !== null && botId !== void 0 ? botId : "{{state.fx-resource-bot.botId}}",
|
|
1271
|
-
},
|
|
1063
|
+
const customizedKeys = utils_1.getCustomizedKeys("", JSON.parse(manifest));
|
|
1064
|
+
this.commonProperties = {
|
|
1065
|
+
[telemetry_1.TelemetryPropertyKey.customizedKeys]: JSON.stringify(customizedKeys),
|
|
1066
|
+
};
|
|
1067
|
+
const view = {
|
|
1068
|
+
config: ctx.envInfo.config,
|
|
1069
|
+
state: {
|
|
1070
|
+
"fx-resource-frontend-hosting": {
|
|
1071
|
+
endpoint: endpoint !== null && endpoint !== void 0 ? endpoint : "{{{state.fx-resource-frontend-hosting.endpoint}}}",
|
|
1272
1072
|
},
|
|
1273
|
-
|
|
1274
|
-
|
|
1275
|
-
|
|
1276
|
-
},
|
|
1277
|
-
auth: {
|
|
1278
|
-
clientId: ((_d = (_c = ctx.localSettings) === null || _c === void 0 ? void 0 : _c.auth) === null || _d === void 0 ? void 0 : _d.get(localSettingsConstants_1.LocalSettingsAuthKeys.ClientId))
|
|
1279
|
-
? (_f = (_e = ctx.localSettings) === null || _e === void 0 ? void 0 : _e.auth) === null || _f === void 0 ? void 0 : _f.get(localSettingsConstants_1.LocalSettingsAuthKeys.ClientId)
|
|
1280
|
-
: "{{localSettings.auth.clientId}}",
|
|
1281
|
-
applicationIdUris: ((_h = (_g = ctx.localSettings) === null || _g === void 0 ? void 0 : _g.auth) === null || _h === void 0 ? void 0 : _h.get(localSettingsConstants_1.LocalSettingsAuthKeys.ApplicationIdUris))
|
|
1282
|
-
? (_k = (_j = ctx.localSettings) === null || _j === void 0 ? void 0 : _j.auth) === null || _k === void 0 ? void 0 : _k.get(localSettingsConstants_1.LocalSettingsAuthKeys.ApplicationIdUris)
|
|
1283
|
-
: "{{{localSettings.auth.applicationIdUris}}}",
|
|
1284
|
-
},
|
|
1285
|
-
teamsApp: {
|
|
1286
|
-
teamsAppId: ((_m = (_l = ctx.localSettings) === null || _l === void 0 ? void 0 : _l.teamsApp) === null || _m === void 0 ? void 0 : _m.get(localSettingsConstants_1.LocalSettingsTeamsAppKeys.TeamsAppId))
|
|
1287
|
-
? (_p = (_o = ctx.localSettings) === null || _o === void 0 ? void 0 : _o.teamsApp) === null || _p === void 0 ? void 0 : _p.get(localSettingsConstants_1.LocalSettingsTeamsAppKeys.TeamsAppId)
|
|
1288
|
-
: "{{localSettings.teamsApp.teamsAppId}}",
|
|
1289
|
-
},
|
|
1290
|
-
bot: {
|
|
1291
|
-
botId: ((_r = (_q = ctx.localSettings) === null || _q === void 0 ? void 0 : _q.bot) === null || _r === void 0 ? void 0 : _r.get(localSettingsConstants_1.LocalSettingsBotKeys.BotId))
|
|
1292
|
-
? (_t = (_s = ctx.localSettings) === null || _s === void 0 ? void 0 : _s.bot) === null || _t === void 0 ? void 0 : _t.get(localSettingsConstants_1.LocalSettingsBotKeys.BotId)
|
|
1293
|
-
: "{{localSettings.bot.botId}}",
|
|
1294
|
-
},
|
|
1073
|
+
"fx-resource-aad-app-for-teams": {
|
|
1074
|
+
clientId: aadId !== null && aadId !== void 0 ? aadId : "{{state.fx-resource-aad-app-for-teams.clientId}}",
|
|
1075
|
+
applicationIdUris: webApplicationInfoResource !== null && webApplicationInfoResource !== void 0 ? webApplicationInfoResource : "{{{state.fx-resource-aad-app-for-teams.applicationIdUris}}}",
|
|
1295
1076
|
},
|
|
1296
|
-
|
|
1297
|
-
|
|
1298
|
-
|
|
1299
|
-
|
|
1300
|
-
|
|
1301
|
-
|
|
1302
|
-
|
|
1303
|
-
|
|
1304
|
-
|
|
1305
|
-
|
|
1306
|
-
|
|
1307
|
-
|
|
1308
|
-
|
|
1309
|
-
|
|
1310
|
-
|
|
1311
|
-
|
|
1312
|
-
|
|
1313
|
-
|
|
1314
|
-
|
|
1315
|
-
|
|
1316
|
-
|
|
1317
|
-
|
|
1318
|
-
|
|
1319
|
-
|
|
1320
|
-
|
|
1321
|
-
|
|
1322
|
-
|
|
1323
|
-
|
|
1324
|
-
|
|
1325
|
-
|
|
1326
|
-
|
|
1077
|
+
"fx-resource-appstudio": {
|
|
1078
|
+
teamsAppId: teamsAppId !== null && teamsAppId !== void 0 ? teamsAppId : "{{state.fx-resource-appstudio.teamsAppId}}",
|
|
1079
|
+
},
|
|
1080
|
+
"fx-resource-bot": {
|
|
1081
|
+
botId: botId !== null && botId !== void 0 ? botId : "{{state.fx-resource-bot.botId}}",
|
|
1082
|
+
},
|
|
1083
|
+
},
|
|
1084
|
+
localSettings: {
|
|
1085
|
+
frontend: {
|
|
1086
|
+
tabEndpoint: endpoint ? endpoint : "{{{localSettings.frontend.tabEndpoint}}}",
|
|
1087
|
+
},
|
|
1088
|
+
auth: {
|
|
1089
|
+
clientId: ((_d = (_c = ctx.localSettings) === null || _c === void 0 ? void 0 : _c.auth) === null || _d === void 0 ? void 0 : _d.get(localSettingsConstants_1.LocalSettingsAuthKeys.ClientId))
|
|
1090
|
+
? (_f = (_e = ctx.localSettings) === null || _e === void 0 ? void 0 : _e.auth) === null || _f === void 0 ? void 0 : _f.get(localSettingsConstants_1.LocalSettingsAuthKeys.ClientId)
|
|
1091
|
+
: "{{localSettings.auth.clientId}}",
|
|
1092
|
+
applicationIdUris: ((_h = (_g = ctx.localSettings) === null || _g === void 0 ? void 0 : _g.auth) === null || _h === void 0 ? void 0 : _h.get(localSettingsConstants_1.LocalSettingsAuthKeys.ApplicationIdUris))
|
|
1093
|
+
? (_k = (_j = ctx.localSettings) === null || _j === void 0 ? void 0 : _j.auth) === null || _k === void 0 ? void 0 : _k.get(localSettingsConstants_1.LocalSettingsAuthKeys.ApplicationIdUris)
|
|
1094
|
+
: "{{{localSettings.auth.applicationIdUris}}}",
|
|
1095
|
+
},
|
|
1096
|
+
teamsApp: {
|
|
1097
|
+
teamsAppId: ((_m = (_l = ctx.localSettings) === null || _l === void 0 ? void 0 : _l.teamsApp) === null || _m === void 0 ? void 0 : _m.get(localSettingsConstants_1.LocalSettingsTeamsAppKeys.TeamsAppId))
|
|
1098
|
+
? (_p = (_o = ctx.localSettings) === null || _o === void 0 ? void 0 : _o.teamsApp) === null || _p === void 0 ? void 0 : _p.get(localSettingsConstants_1.LocalSettingsTeamsAppKeys.TeamsAppId)
|
|
1099
|
+
: "{{localSettings.teamsApp.teamsAppId}}",
|
|
1100
|
+
},
|
|
1101
|
+
bot: {
|
|
1102
|
+
botId: ((_r = (_q = ctx.localSettings) === null || _q === void 0 ? void 0 : _q.bot) === null || _r === void 0 ? void 0 : _r.get(localSettingsConstants_1.LocalSettingsBotKeys.BotId))
|
|
1103
|
+
? (_t = (_s = ctx.localSettings) === null || _s === void 0 ? void 0 : _s.bot) === null || _t === void 0 ? void 0 : _t.get(localSettingsConstants_1.LocalSettingsBotKeys.BotId)
|
|
1104
|
+
: "{{localSettings.bot.botId}}",
|
|
1105
|
+
},
|
|
1106
|
+
},
|
|
1107
|
+
};
|
|
1108
|
+
manifest = mustache_1.default.render(manifest, view);
|
|
1109
|
+
const tokens = [
|
|
1110
|
+
...new Set(mustache_1.default.parse(manifest)
|
|
1111
|
+
.filter((x) => {
|
|
1112
|
+
return x[0] != "text" && x[1] != "localSettings.teamsApp.teamsAppId";
|
|
1113
|
+
})
|
|
1114
|
+
.map((x) => x[1])),
|
|
1115
|
+
];
|
|
1116
|
+
if (tokens.length > 0) {
|
|
1117
|
+
if (isLocalDebug) {
|
|
1118
|
+
return teamsfx_api_1.err(results_1.AppStudioResultFactory.UserError(errors_1.AppStudioError.GetLocalDebugConfigFailedError.name, errors_1.AppStudioError.GetLocalDebugConfigFailedError.message(new Error(`Data required: ${tokens.join(",")}`))));
|
|
1327
1119
|
}
|
|
1328
|
-
|
|
1329
|
-
|
|
1330
|
-
return teamsfx_api_1.err(results_1.AppStudioResultFactory.SystemError(errors_1.AppStudioError.GetLocalDebugConfigFailedError.name, errors_1.AppStudioError.GetLocalDebugConfigFailedError.message(e)));
|
|
1331
|
-
}
|
|
1332
|
-
else {
|
|
1333
|
-
return teamsfx_api_1.err(results_1.AppStudioResultFactory.UserError(errors_1.AppStudioError.GetRemoteConfigFailedError.name, errors_1.AppStudioError.GetRemoteConfigFailedError.message(e, isProvisionSucceeded), constants_3.HelpLinks.WhyNeedProvision));
|
|
1334
|
-
}
|
|
1120
|
+
else {
|
|
1121
|
+
return teamsfx_api_1.err(results_1.AppStudioResultFactory.UserError(errors_1.AppStudioError.GetRemoteConfigFailedError.name, errors_1.AppStudioError.GetRemoteConfigFailedError.message(new Error(`Data required: ${tokens.join(",")}`), isProvisionSucceeded), constants_3.HelpLinks.WhyNeedProvision));
|
|
1335
1122
|
}
|
|
1336
1123
|
}
|
|
1337
1124
|
let updatedManifest;
|
|
@@ -1353,28 +1140,37 @@ class AppStudioPluginImpl {
|
|
|
1353
1140
|
}
|
|
1354
1141
|
}
|
|
1355
1142
|
for (const domain of validDomains) {
|
|
1356
|
-
(
|
|
1143
|
+
(_u = updatedManifest.validDomains) === null || _u === void 0 ? void 0 : _u.push(domain);
|
|
1357
1144
|
}
|
|
1358
1145
|
const appDefinitionRes = await this.convertToAppDefinition(ctx, updatedManifest, false);
|
|
1359
1146
|
if (appDefinitionRes.isErr()) {
|
|
1360
1147
|
return teamsfx_api_1.err(appDefinitionRes.error);
|
|
1361
1148
|
}
|
|
1362
1149
|
const appDefinition = appDefinitionRes.value;
|
|
1363
|
-
if (isLocalDebug && !common_1.isMultiEnvEnabled()) {
|
|
1364
|
-
const appName = utils_1.getLocalAppName((_w = appDefinition.shortName) !== null && _w !== void 0 ? _w : "");
|
|
1365
|
-
appDefinition.shortName = appName;
|
|
1366
|
-
appDefinition.appName = appName;
|
|
1367
|
-
}
|
|
1368
1150
|
return teamsfx_api_1.ok([appDefinition, updatedManifest]);
|
|
1369
1151
|
}
|
|
1152
|
+
async getSPFxManifest(ctx, isLocalDebug) {
|
|
1153
|
+
var _a, _b;
|
|
1154
|
+
let manifestString = JSON.stringify(await fs.readJSON(await this.getManifestTemplatePath(ctx.root, isLocalDebug)));
|
|
1155
|
+
const view = {
|
|
1156
|
+
config: ctx.envInfo.config,
|
|
1157
|
+
state: {
|
|
1158
|
+
"fx-resource-appstudio": {
|
|
1159
|
+
teamsAppId: await this.getTeamsAppId(ctx, isLocalDebug),
|
|
1160
|
+
},
|
|
1161
|
+
},
|
|
1162
|
+
localSettings: {
|
|
1163
|
+
teamsApp: {
|
|
1164
|
+
teamsAppId: (_b = (_a = ctx.localSettings) === null || _a === void 0 ? void 0 : _a.teamsApp) === null || _b === void 0 ? void 0 : _b.get(localSettingsConstants_1.LocalSettingsTeamsAppKeys.TeamsAppId),
|
|
1165
|
+
},
|
|
1166
|
+
},
|
|
1167
|
+
};
|
|
1168
|
+
manifestString = mustache_1.default.render(manifestString, view);
|
|
1169
|
+
return manifestString;
|
|
1170
|
+
}
|
|
1370
1171
|
async getManifestTemplatePath(projectRoot, isLocalDebug = false) {
|
|
1371
1172
|
const appDir = await common_1.getAppDirectory(projectRoot);
|
|
1372
|
-
|
|
1373
|
-
return isLocalDebug ? `${appDir}/${constants_2.MANIFEST_LOCAL}` : `${appDir}/${constants_2.MANIFEST_TEMPLATE}`;
|
|
1374
|
-
}
|
|
1375
|
-
else {
|
|
1376
|
-
return `${appDir}/${constants_2.REMOTE_MANIFEST}`;
|
|
1377
|
-
}
|
|
1173
|
+
return isLocalDebug ? `${appDir}/${constants_2.MANIFEST_LOCAL}` : `${appDir}/${constants_2.MANIFEST_TEMPLATE}`;
|
|
1378
1174
|
}
|
|
1379
1175
|
}
|
|
1380
1176
|
exports.AppStudioPluginImpl = AppStudioPluginImpl;
|
|
@@ -1419,25 +1215,19 @@ async function createManifest(appName, hasFrontend, hasBot, hasMessageExtension,
|
|
|
1419
1215
|
throw new Error(`Invalid capability`);
|
|
1420
1216
|
}
|
|
1421
1217
|
if (!isSPFx || hasBot || hasMessageExtension) {
|
|
1422
|
-
let manifestString =
|
|
1423
|
-
? constants_2.TEAMS_APP_MANIFEST_TEMPLATE_FOR_MULTI_ENV
|
|
1424
|
-
: constants_2.TEAMS_APP_MANIFEST_TEMPLATE;
|
|
1218
|
+
let manifestString = constants_2.TEAMS_APP_MANIFEST_TEMPLATE_FOR_MULTI_ENV;
|
|
1425
1219
|
manifestString = utils_1.replaceConfigValue(manifestString, "appName", appName);
|
|
1426
1220
|
manifestString = utils_1.replaceConfigValue(manifestString, "version", "1.0.0");
|
|
1427
1221
|
const manifest = JSON.parse(manifestString);
|
|
1428
1222
|
if (hasFrontend) {
|
|
1429
|
-
manifest.staticTabs =
|
|
1430
|
-
manifest.configurableTabs =
|
|
1431
|
-
? constants_2.CONFIGURABLE_TABS_TPL_FOR_MULTI_ENV
|
|
1432
|
-
: constants_2.CONFIGURABLE_TABS_TPL;
|
|
1223
|
+
manifest.staticTabs = constants_2.STATIC_TABS_TPL_FOR_MULTI_ENV;
|
|
1224
|
+
manifest.configurableTabs = constants_2.CONFIGURABLE_TABS_TPL_FOR_MULTI_ENV;
|
|
1433
1225
|
}
|
|
1434
1226
|
if (hasBot) {
|
|
1435
|
-
manifest.bots =
|
|
1227
|
+
manifest.bots = constants_2.BOTS_TPL_FOR_MULTI_ENV;
|
|
1436
1228
|
}
|
|
1437
1229
|
if (hasMessageExtension) {
|
|
1438
|
-
manifest.composeExtensions =
|
|
1439
|
-
? constants_2.COMPOSE_EXTENSIONS_TPL_FOR_MULTI_ENV
|
|
1440
|
-
: constants_2.COMPOSE_EXTENSIONS_TPL;
|
|
1230
|
+
manifest.composeExtensions = constants_2.COMPOSE_EXTENSIONS_TPL_FOR_MULTI_ENV;
|
|
1441
1231
|
}
|
|
1442
1232
|
if (migrateFromV1) {
|
|
1443
1233
|
manifest.webApplicationInfo = undefined;
|