@microsoft/teamsfx-core 1.1.2 → 1.1.3-alpha.17023c57.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/index.d.ts +4 -0
- package/build/common/deps-checker/constant/index.d.ts.map +1 -0
- package/build/common/deps-checker/constant/index.js +9 -0
- package/build/common/deps-checker/constant/index.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 +43 -0
- package/build/common/deps-checker/constant/telemetry.d.ts.map +1 -0
- package/build/common/deps-checker/constant/telemetry.js +51 -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 +36 -0
- package/build/common/deps-checker/depsManager.d.ts.map +1 -0
- package/build/common/deps-checker/depsManager.js +83 -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/index.d.ts +8 -0
- package/build/common/deps-checker/index.d.ts.map +1 -0
- package/build/common/deps-checker/index.js +13 -0
- package/build/common/deps-checker/index.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 +2 -0
- package/build/common/index.d.ts.map +1 -1
- package/build/common/index.js +2 -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 +16 -0
- package/build/common/local/localEnvManager.d.ts.map +1 -0
- package/build/common/local/localEnvManager.js +72 -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 +10 -5
- package/build/common/tools.d.ts.map +1 -1
- package/build/common/tools.js +29 -85
- 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/index.js +2 -2
- package/build/plugins/resource/apim/index.js.map +1 -1
- package/build/plugins/resource/apim/managers/apimManager.d.ts +2 -2
- package/build/plugins/resource/apim/managers/apimManager.d.ts.map +1 -1
- package/build/plugins/resource/apim/managers/apimManager.js +26 -20
- 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 +2 -2
- package/build/plugins/resource/bot/plugin.d.ts.map +1 -1
- package/build/plugins/resource/bot/plugin.js +30 -24
- 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 +38 -21
- 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 +26 -21
- 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 +21 -17
- 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 +17 -14
- 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 +41 -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 +26 -21
- 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 +2 -1
- 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 +51 -40
- 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/deploy.d.ts.map +1 -1
- package/build/plugins/solution/fx-solution/v2/deploy.js +3 -0
- package/build/plugins/solution/fx-solution/v2/deploy.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 +261 -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 +8 -0
- package/build/plugins/solution/fx-solution/v3/error.d.ts.map +1 -0
- package/build/plugins/solution/fx-solution/v3/error.js +17 -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/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/addModule.d.ts +5 -0
- package/build/plugins/solution/spfx-solution/addModule.d.ts.map +1 -0
- package/build/plugins/solution/spfx-solution/addModule.js +29 -0
- package/build/plugins/solution/spfx-solution/addModule.js.map +1 -0
- 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/error.d.ts +5 -0
- package/build/plugins/solution/spfx-solution/error.d.ts.map +1 -0
- package/build/plugins/solution/spfx-solution/error.js +13 -0
- package/build/plugins/solution/spfx-solution/error.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 +7 -0
- package/build/plugins/solution/spfx-solution/index.js.map +1 -0
- package/build/plugins/solution/spfx-solution/init.d.ts +4 -0
- package/build/plugins/solution/spfx-solution/init.d.ts.map +1 -0
- package/build/plugins/solution/spfx-solution/init.js +52 -0
- package/build/plugins/solution/spfx-solution/init.js.map +1 -0
- package/build/plugins/solution/spfx-solution/questions.d.ts +4 -0
- package/build/plugins/solution/spfx-solution/questions.d.ts.map +1 -0
- package/build/plugins/solution/spfx-solution/questions.js +10 -0
- package/build/plugins/solution/spfx-solution/questions.js.map +1 -0
- package/build/plugins/solution/spfx-solution/scaffold.d.ts +13 -0
- package/build/plugins/solution/spfx-solution/scaffold.d.ts.map +1 -0
- package/build/plugins/solution/spfx-solution/scaffold.js +105 -0
- package/build/plugins/solution/spfx-solution/scaffold.js.map +1 -0
- package/build/plugins/solution/spfx-solution/solution.d.ts +22 -0
- package/build/plugins/solution/spfx-solution/solution.d.ts.map +1 -0
- package/build/plugins/solution/spfx-solution/solution.js +31 -0
- package/build/plugins/solution/spfx-solution/solution.js.map +1 -0
- package/build/plugins/solution/utils/error.d.ts +5 -0
- package/build/plugins/solution/utils/error.d.ts.map +1 -0
- package/build/plugins/solution/utils/error.js +13 -0
- package/build/plugins/solution/utils/error.js.map +1 -0
- package/build/plugins/solution/utils/questions.d.ts +16 -0
- package/build/plugins/solution/utils/questions.d.ts.map +1 -0
- package/build/plugins/solution/utils/questions.js +86 -0
- package/build/plugins/solution/utils/questions.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 +1 -2
- 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 +24 -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
package/build/core/index.js
CHANGED
|
@@ -2,45 +2,49 @@
|
|
|
2
2
|
// Copyright (c) Microsoft Corporation.
|
|
3
3
|
// Licensed under the MIT license.
|
|
4
4
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5
|
-
exports.getProjectSettingsVersion = exports.undefinedName = exports.createV2Context = exports.newProjectSettings = exports.
|
|
5
|
+
exports.getProjectSettingsVersion = exports.undefinedName = exports.createV2Context = exports.newProjectSettings = exports.createBasicFolderStructure = exports.FxCore = exports.setTools = exports.TOOLS = exports.currentStage = exports.telemetryReporter = exports.Logger = exports.isVsCallingCli = exports.isV3 = void 0;
|
|
6
6
|
const tslib_1 = require("tslib");
|
|
7
7
|
const hooks_1 = require("@feathersjs/hooks");
|
|
8
8
|
const teamsfx_api_1 = require("@microsoft/teamsfx-api");
|
|
9
|
-
const adm_zip_1 = tslib_1.__importDefault(require("adm-zip"));
|
|
10
9
|
const fs = tslib_1.__importStar(require("fs-extra"));
|
|
11
10
|
const jsonschema = tslib_1.__importStar(require("jsonschema"));
|
|
11
|
+
const lodash_1 = require("lodash");
|
|
12
12
|
const path = tslib_1.__importStar(require("path"));
|
|
13
|
+
const typedi_1 = require("typedi");
|
|
13
14
|
const uuid = tslib_1.__importStar(require("uuid"));
|
|
14
15
|
const __1 = require("..");
|
|
15
16
|
const constants_1 = require("../common/constants");
|
|
16
17
|
const globalState_1 = require("../common/globalState");
|
|
17
18
|
const localSettingsProvider_1 = require("../common/localSettingsProvider");
|
|
18
|
-
const telemetry_1 = require("../common/telemetry");
|
|
19
19
|
const tools_1 = require("../common/tools");
|
|
20
|
-
const
|
|
21
|
-
const
|
|
20
|
+
const question_1 = require("../plugins/solution/fx-solution/question");
|
|
21
|
+
const constants_2 = require("../plugins/solution/fx-solution/v3/constants");
|
|
22
22
|
const callback_1 = require("./callback");
|
|
23
|
+
const crypto_1 = require("./crypto");
|
|
24
|
+
const downloadSample_1 = require("./downloadSample");
|
|
23
25
|
const error_1 = require("./error");
|
|
24
26
|
const concurrentLocker_1 = require("./middleware/concurrentLocker");
|
|
25
27
|
const contextInjector_1 = require("./middleware/contextInjector");
|
|
26
28
|
const envInfoLoader_1 = require("./middleware/envInfoLoader");
|
|
29
|
+
const envInfoLoaderV3_1 = require("./middleware/envInfoLoaderV3");
|
|
27
30
|
const envInfoWriter_1 = require("./middleware/envInfoWriter");
|
|
31
|
+
const envInfoWriterV3_1 = require("./middleware/envInfoWriterV3");
|
|
28
32
|
const errorHandler_1 = require("./middleware/errorHandler");
|
|
29
33
|
const localSettingsLoader_1 = require("./middleware/localSettingsLoader");
|
|
30
34
|
const localSettingsWriter_1 = require("./middleware/localSettingsWriter");
|
|
31
35
|
const migrateConditionHandler_1 = require("./middleware/migrateConditionHandler");
|
|
32
36
|
const projectMigrator_1 = require("./middleware/projectMigrator");
|
|
33
37
|
const projectSettingsLoader_1 = require("./middleware/projectSettingsLoader");
|
|
38
|
+
const projectSettingsLoaderV3_1 = require("./middleware/projectSettingsLoaderV3");
|
|
34
39
|
const projectSettingsWriter_1 = require("./middleware/projectSettingsWriter");
|
|
35
40
|
const projectUpgrader_1 = require("./middleware/projectUpgrader");
|
|
36
41
|
const questionModel_1 = require("./middleware/questionModel");
|
|
37
42
|
const solutionLoader_1 = require("./middleware/solutionLoader");
|
|
38
|
-
const
|
|
43
|
+
const solutionLoaderV3_1 = require("./middleware/solutionLoaderV3");
|
|
44
|
+
const supportV1ConditionHandler_1 = require("./middleware/supportV1ConditionHandler");
|
|
45
|
+
const question_2 = require("./question");
|
|
39
46
|
const SolutionPluginContainer_1 = require("./SolutionPluginContainer");
|
|
40
47
|
const tools_2 = require("./tools");
|
|
41
|
-
const crypto_1 = require("./crypto");
|
|
42
|
-
const supportV1ConditionHandler_1 = require("./middleware/supportV1ConditionHandler");
|
|
43
|
-
const lodash_1 = require("lodash");
|
|
44
48
|
// TODO: For package.json,
|
|
45
49
|
// use require instead of import because of core building/packaging method.
|
|
46
50
|
// Using import will cause the build folder structure to change.
|
|
@@ -54,18 +58,36 @@ function featureFlagEnabled(flagName) {
|
|
|
54
58
|
return false;
|
|
55
59
|
}
|
|
56
60
|
}
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
return tools_1.isMultiEnvEnabled();
|
|
61
|
+
function isV3() {
|
|
62
|
+
return featureFlagEnabled(constants_1.FeatureFlagName.APIV3);
|
|
60
63
|
}
|
|
61
|
-
exports.
|
|
64
|
+
exports.isV3 = isV3;
|
|
62
65
|
// On VS calling CLI, interactive questions need to be skipped.
|
|
63
66
|
function isVsCallingCli() {
|
|
64
67
|
return featureFlagEnabled(constants_1.FeatureFlagName.VSCallingCLI);
|
|
65
68
|
}
|
|
66
69
|
exports.isVsCallingCli = isVsCallingCli;
|
|
70
|
+
function setTools(tools) {
|
|
71
|
+
exports.TOOLS = tools;
|
|
72
|
+
}
|
|
73
|
+
exports.setTools = setTools;
|
|
67
74
|
class FxCore {
|
|
68
75
|
constructor(tools) {
|
|
76
|
+
//V1,V2 questions
|
|
77
|
+
this._getQuestionsForCreateProjectV2 = questionModel_1.getQuestionsForCreateProjectV2;
|
|
78
|
+
this._getQuestionsForCreateProjectV3 = questionModel_1.getQuestionsForCreateProjectV3;
|
|
79
|
+
this._getQuestionsForUserTask = questionModel_1.getQuestionsForUserTaskV2;
|
|
80
|
+
this._getQuestions = questionModel_1.getQuestionsV2;
|
|
81
|
+
this._getQuestionsForMigrateV1Project = questionModel_1.getQuestionsForMigrateV1Project;
|
|
82
|
+
//v3 questions
|
|
83
|
+
this._getQuestionsForScaffold = questionModel_1.getQuestionsForScaffold;
|
|
84
|
+
this._getQuestionsForAddModule = questionModel_1.getQuestionsForAddModule;
|
|
85
|
+
this._getQuestionsForAddResource = questionModel_1.getQuestionsForAddResource;
|
|
86
|
+
this._getQuestionsForProvision = questionModel_1.getQuestionsForProvision;
|
|
87
|
+
this._getQuestionsForDeploy = questionModel_1.getQuestionsForDeploy;
|
|
88
|
+
this._getQuestionsForLocalProvision = questionModel_1.getQuestionsForLocalProvision;
|
|
89
|
+
this._getQuestionsForPublish = questionModel_1.getQuestionsForPublish;
|
|
90
|
+
this._getQuestionsForInit = questionModel_1.getQuestionsForInit;
|
|
69
91
|
this.tools = tools;
|
|
70
92
|
exports.TOOLS = tools;
|
|
71
93
|
exports.Logger = tools.logProvider;
|
|
@@ -78,24 +100,36 @@ class FxCore {
|
|
|
78
100
|
on(event, callback) {
|
|
79
101
|
return callback_1.CallbackRegistry.set(event, callback);
|
|
80
102
|
}
|
|
81
|
-
async createProject(inputs
|
|
103
|
+
async createProject(inputs) {
|
|
104
|
+
if (isV3()) {
|
|
105
|
+
return this.createProjectV3(inputs);
|
|
106
|
+
}
|
|
107
|
+
else {
|
|
108
|
+
return this.createProjectV2(inputs);
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
async createProjectV2(inputs, ctx) {
|
|
82
112
|
if (!ctx) {
|
|
83
113
|
return teamsfx_api_1.err(new error_1.ObjectIsUndefinedError("ctx for createProject"));
|
|
84
114
|
}
|
|
85
115
|
exports.currentStage = teamsfx_api_1.Stage.create;
|
|
86
116
|
inputs.stage = teamsfx_api_1.Stage.create;
|
|
87
|
-
let folder = inputs[
|
|
117
|
+
let folder = inputs[question_2.QuestionRootFolder.name];
|
|
88
118
|
if (inputs.platform === teamsfx_api_1.Platform.VSCode) {
|
|
89
119
|
folder = tools_1.getRootDirectory();
|
|
90
|
-
|
|
120
|
+
try {
|
|
121
|
+
await fs.ensureDir(folder);
|
|
122
|
+
}
|
|
123
|
+
catch (e) {
|
|
124
|
+
throw error_1.ProjectFolderInvalidError(folder);
|
|
125
|
+
}
|
|
91
126
|
}
|
|
92
|
-
const scratch = inputs[
|
|
127
|
+
const scratch = inputs[question_2.CoreQuestionNames.CreateFromScratch];
|
|
93
128
|
let projectPath;
|
|
94
129
|
let globalStateDescription = "openReadme";
|
|
95
|
-
|
|
96
|
-
if (scratch === question_1.ScratchOptionNo.id) {
|
|
130
|
+
if (scratch === question_2.ScratchOptionNo.id) {
|
|
97
131
|
// create from sample
|
|
98
|
-
const downloadRes = await downloadSample(
|
|
132
|
+
const downloadRes = await downloadSample_1.downloadSample(inputs, ctx);
|
|
99
133
|
if (downloadRes.isErr()) {
|
|
100
134
|
return teamsfx_api_1.err(downloadRes.error);
|
|
101
135
|
}
|
|
@@ -104,11 +138,11 @@ class FxCore {
|
|
|
104
138
|
}
|
|
105
139
|
else {
|
|
106
140
|
// create from new
|
|
107
|
-
const appName = inputs[
|
|
141
|
+
const appName = inputs[question_2.QuestionAppName.name];
|
|
108
142
|
if (undefined === appName)
|
|
109
143
|
return teamsfx_api_1.err(error_1.InvalidInputError(`App Name is empty`, inputs));
|
|
110
144
|
const validateResult = jsonschema.validate(appName, {
|
|
111
|
-
pattern:
|
|
145
|
+
pattern: question_2.ProjectNamePattern,
|
|
112
146
|
});
|
|
113
147
|
if (validateResult.errors && validateResult.errors.length > 0) {
|
|
114
148
|
return teamsfx_api_1.err(error_1.InvalidInputError(`${validateResult.errors[0].message}`, inputs));
|
|
@@ -121,7 +155,7 @@ class FxCore {
|
|
|
121
155
|
}
|
|
122
156
|
await fs.ensureDir(projectPath);
|
|
123
157
|
await fs.ensureDir(path.join(projectPath, `.${teamsfx_api_1.ConfigFolderName}`));
|
|
124
|
-
await fs.ensureDir(path.join(projectPath,
|
|
158
|
+
await fs.ensureDir(path.join(projectPath, path.join("templates", `${teamsfx_api_1.AppPackageFolderName}`)));
|
|
125
159
|
const basicFolderRes = await createBasicFolderStructure(inputs);
|
|
126
160
|
if (basicFolderRes.isErr()) {
|
|
127
161
|
return teamsfx_api_1.err(basicFolderRes.error);
|
|
@@ -137,77 +171,211 @@ class FxCore {
|
|
|
137
171
|
isFromSample: false,
|
|
138
172
|
};
|
|
139
173
|
ctx.projectSettings = projectSettings;
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
return teamsfx_api_1.err(createEnvResult.error);
|
|
144
|
-
}
|
|
174
|
+
const createEnvResult = await this.createEnvWithName(__1.environmentManager.getDefaultEnvName(), projectSettings, inputs);
|
|
175
|
+
if (createEnvResult.isErr()) {
|
|
176
|
+
return teamsfx_api_1.err(createEnvResult.error);
|
|
145
177
|
}
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
178
|
+
const solution = await SolutionPluginContainer_1.getSolutionPluginV2ByName(inputs[question_2.CoreQuestionNames.Solution]);
|
|
179
|
+
if (!solution) {
|
|
180
|
+
return teamsfx_api_1.err(new error_1.LoadSolutionError());
|
|
181
|
+
}
|
|
182
|
+
ctx.solutionV2 = solution;
|
|
183
|
+
projectSettings.solutionSettings.name = solution.name;
|
|
184
|
+
const contextV2 = createV2Context(projectSettings);
|
|
185
|
+
ctx.contextV2 = contextV2;
|
|
186
|
+
const scaffoldSourceCodeRes = await solution.scaffoldSourceCode(contextV2, inputs);
|
|
187
|
+
if (scaffoldSourceCodeRes.isErr()) {
|
|
188
|
+
return teamsfx_api_1.err(scaffoldSourceCodeRes.error);
|
|
189
|
+
}
|
|
190
|
+
const generateResourceTemplateRes = await solution.generateResourceTemplate(contextV2, inputs);
|
|
191
|
+
if (generateResourceTemplateRes.isErr()) {
|
|
192
|
+
return teamsfx_api_1.err(generateResourceTemplateRes.error);
|
|
193
|
+
}
|
|
194
|
+
// ctx.provisionInputConfig = generateResourceTemplateRes.value;
|
|
195
|
+
if (solution.createEnv) {
|
|
196
|
+
inputs.copy = false;
|
|
197
|
+
const createEnvRes = await solution.createEnv(contextV2, inputs);
|
|
198
|
+
if (createEnvRes.isErr()) {
|
|
199
|
+
return teamsfx_api_1.err(createEnvRes.error);
|
|
158
200
|
}
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
201
|
+
}
|
|
202
|
+
}
|
|
203
|
+
if (inputs.platform === teamsfx_api_1.Platform.VSCode) {
|
|
204
|
+
await globalState_1.globalStateUpdate(globalStateDescription, true);
|
|
205
|
+
}
|
|
206
|
+
return teamsfx_api_1.ok(projectPath);
|
|
207
|
+
}
|
|
208
|
+
async createProjectV3(inputs, ctx) {
|
|
209
|
+
if (!ctx) {
|
|
210
|
+
return teamsfx_api_1.err(new error_1.ObjectIsUndefinedError("ctx for createProject"));
|
|
211
|
+
}
|
|
212
|
+
exports.currentStage = teamsfx_api_1.Stage.create;
|
|
213
|
+
inputs.stage = teamsfx_api_1.Stage.create;
|
|
214
|
+
let folder = inputs[question_2.QuestionRootFolder.name];
|
|
215
|
+
if (inputs.platform === teamsfx_api_1.Platform.VSCode || inputs.platform === teamsfx_api_1.Platform.VS) {
|
|
216
|
+
folder = tools_1.getRootDirectory();
|
|
217
|
+
try {
|
|
218
|
+
await fs.ensureDir(folder);
|
|
219
|
+
}
|
|
220
|
+
catch (e) {
|
|
221
|
+
throw error_1.ProjectFolderInvalidError(folder);
|
|
222
|
+
}
|
|
223
|
+
}
|
|
224
|
+
const scratch = inputs[question_2.CoreQuestionNames.CreateFromScratch];
|
|
225
|
+
let projectPath;
|
|
226
|
+
let globalStateDescription = "openReadme";
|
|
227
|
+
if (scratch === question_2.ScratchOptionNo.id) {
|
|
228
|
+
// create from sample
|
|
229
|
+
const downloadRes = await downloadSample_1.downloadSample(inputs, ctx);
|
|
230
|
+
if (downloadRes.isErr()) {
|
|
231
|
+
return teamsfx_api_1.err(downloadRes.error);
|
|
232
|
+
}
|
|
233
|
+
projectPath = downloadRes.value;
|
|
234
|
+
globalStateDescription = "openSampleReadme";
|
|
235
|
+
}
|
|
236
|
+
else {
|
|
237
|
+
// create from new
|
|
238
|
+
const appName = inputs[question_2.QuestionAppName.name];
|
|
239
|
+
if (undefined === appName)
|
|
240
|
+
return teamsfx_api_1.err(error_1.InvalidInputError(`App Name is empty`, inputs));
|
|
241
|
+
const validateResult = jsonschema.validate(appName, {
|
|
242
|
+
pattern: question_2.ProjectNamePattern,
|
|
243
|
+
});
|
|
244
|
+
if (validateResult.errors && validateResult.errors.length > 0) {
|
|
245
|
+
return teamsfx_api_1.err(error_1.InvalidInputError(`${validateResult.errors[0].message}`, inputs));
|
|
246
|
+
}
|
|
247
|
+
projectPath = path.join(folder, appName);
|
|
248
|
+
inputs.projectPath = projectPath;
|
|
249
|
+
const folderExist = await fs.pathExists(projectPath);
|
|
250
|
+
if (folderExist) {
|
|
251
|
+
return teamsfx_api_1.err(error_1.ProjectFolderExistError(projectPath));
|
|
252
|
+
}
|
|
253
|
+
await fs.ensureDir(projectPath);
|
|
254
|
+
await fs.ensureDir(path.join(projectPath, `.${teamsfx_api_1.ConfigFolderName}`));
|
|
255
|
+
let capabilities = inputs[question_2.CoreQuestionNames.Capabilities];
|
|
256
|
+
let projectType = "";
|
|
257
|
+
if (capabilities.includes(question_2.TabSPFxItem.id))
|
|
258
|
+
projectType = "spfx";
|
|
259
|
+
else if (capabilities.includes(question_2.TabOptionItem.id) && capabilities.length === 1)
|
|
260
|
+
projectType = "tab";
|
|
261
|
+
else if ((capabilities.includes(question_2.BotOptionItem.id) ||
|
|
262
|
+
capabilities.includes(question_1.MessageExtensionItem.id)) &&
|
|
263
|
+
!capabilities.includes(question_2.TabOptionItem.id))
|
|
264
|
+
projectType = "bot";
|
|
265
|
+
else if ((capabilities.includes(question_2.BotOptionItem.id) ||
|
|
266
|
+
capabilities.includes(question_1.MessageExtensionItem.id)) &&
|
|
267
|
+
capabilities.includes(question_2.TabOptionItem.id))
|
|
268
|
+
projectType = "tab+bot";
|
|
269
|
+
const programmingLanguage = inputs[question_2.CoreQuestionNames.ProgrammingLanguage];
|
|
270
|
+
// const solution = capabilities.includes(TabSPFxItem.id)
|
|
271
|
+
// ? BuiltInSolutionNames.spfx
|
|
272
|
+
// : BuiltInSolutionNames.azure;
|
|
273
|
+
// init
|
|
274
|
+
const initInputs = Object.assign(Object.assign({}, inputs), { projectPath: projectPath });
|
|
275
|
+
const initRes = await this._init(initInputs, ctx);
|
|
276
|
+
if (initRes.isErr()) {
|
|
277
|
+
return teamsfx_api_1.err(initRes.error);
|
|
278
|
+
}
|
|
279
|
+
// addModule, scaffold and addResource
|
|
280
|
+
if (inputs.platform === teamsfx_api_1.Platform.VS) {
|
|
281
|
+
// addModule
|
|
282
|
+
const addModuleInputs = Object.assign(Object.assign({}, inputs), { projectPath: projectPath, capabilities: capabilities });
|
|
283
|
+
const addModuleRes = await this._addModule(addModuleInputs, ctx);
|
|
284
|
+
if (addModuleRes.isErr()) {
|
|
285
|
+
return teamsfx_api_1.err(addModuleRes.error);
|
|
162
286
|
}
|
|
163
|
-
//
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
if (createEnvRes.isErr()) {
|
|
169
|
-
return teamsfx_api_1.err(createEnvRes.error);
|
|
170
|
-
}
|
|
171
|
-
}
|
|
287
|
+
// addResource
|
|
288
|
+
const addResourceInputs = Object.assign(Object.assign({}, inputs), { projectPath: projectPath, module: "0", resource: constants_2.BuiltInResourcePluginNames.webApp });
|
|
289
|
+
const addResourceRes = await this._addResource(addResourceInputs, ctx);
|
|
290
|
+
if (addResourceRes.isErr()) {
|
|
291
|
+
return teamsfx_api_1.err(addResourceRes.error);
|
|
172
292
|
}
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
293
|
+
// scaffold
|
|
294
|
+
let templateName = "";
|
|
295
|
+
if (projectType === "tab")
|
|
296
|
+
templateName = "BlazorTab";
|
|
297
|
+
else if (projectType === "bot")
|
|
298
|
+
templateName = "BlazorBot";
|
|
299
|
+
else if (projectType === "tabbot")
|
|
300
|
+
templateName = "BlazorTabBot";
|
|
301
|
+
const scaffoldInputs = Object.assign(Object.assign({}, inputs), { projectPath: projectPath, module: "0", template: {
|
|
302
|
+
id: `${constants_2.BuiltInScaffoldPluginNames.blazor}/${templateName}`,
|
|
303
|
+
label: `${constants_2.BuiltInScaffoldPluginNames.blazor}/${templateName}`,
|
|
304
|
+
data: {
|
|
305
|
+
pluginName: constants_2.BuiltInScaffoldPluginNames.blazor,
|
|
306
|
+
templateName: templateName,
|
|
307
|
+
},
|
|
308
|
+
} });
|
|
309
|
+
const scaffoldRes = await this._scaffold(scaffoldInputs, ctx);
|
|
310
|
+
if (scaffoldRes.isErr()) {
|
|
311
|
+
return teamsfx_api_1.err(scaffoldRes.error);
|
|
185
312
|
}
|
|
186
313
|
}
|
|
187
314
|
else {
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
315
|
+
if (capabilities.includes(question_2.TabOptionItem.id) || capabilities.includes(question_2.TabSPFxItem.id)) {
|
|
316
|
+
const addModuleInputs = Object.assign(Object.assign({}, inputs), { projectPath: projectPath, capabilities: capabilities.includes(question_2.TabOptionItem.id)
|
|
317
|
+
? [question_2.TabOptionItem.id]
|
|
318
|
+
: [question_2.TabSPFxItem.id] });
|
|
319
|
+
const addModuleRes = await this._addModule(addModuleInputs, ctx);
|
|
320
|
+
if (addModuleRes.isErr()) {
|
|
321
|
+
return teamsfx_api_1.err(addModuleRes.error);
|
|
322
|
+
}
|
|
323
|
+
// addResource
|
|
324
|
+
const addResourceInputs = Object.assign(Object.assign({}, inputs), { projectPath: projectPath, module: "0", resource: capabilities.includes(question_2.TabOptionItem.id)
|
|
325
|
+
? constants_2.BuiltInResourcePluginNames.storage
|
|
326
|
+
: constants_2.BuiltInResourcePluginNames.spfx });
|
|
327
|
+
const addResourceRes = await this._addResource(addResourceInputs, ctx);
|
|
328
|
+
if (addResourceRes.isErr()) {
|
|
329
|
+
return teamsfx_api_1.err(addResourceRes.error);
|
|
330
|
+
}
|
|
331
|
+
// scaffold
|
|
332
|
+
const pluginName = capabilities.includes(question_2.TabOptionItem.id)
|
|
333
|
+
? constants_2.BuiltInScaffoldPluginNames.tab
|
|
334
|
+
: constants_2.BuiltInScaffoldPluginNames.spfx;
|
|
335
|
+
const templateName = capabilities.includes(question_2.TabOptionItem.id)
|
|
336
|
+
? programmingLanguage === "javascript"
|
|
337
|
+
? "ReactTab_JS"
|
|
338
|
+
: "ReactTab_TS"
|
|
339
|
+
: "SPFxTab";
|
|
340
|
+
const scaffoldInputs = Object.assign(Object.assign({}, inputs), { projectPath: projectPath, module: "0", template: {
|
|
341
|
+
id: `${pluginName}/${templateName}`,
|
|
342
|
+
label: `${pluginName}/${templateName}`,
|
|
343
|
+
data: {
|
|
344
|
+
pluginName: pluginName,
|
|
345
|
+
templateName: templateName, //TODO
|
|
346
|
+
},
|
|
347
|
+
} });
|
|
348
|
+
const scaffoldRes = await this._scaffold(scaffoldInputs, ctx);
|
|
349
|
+
if (scaffoldRes.isErr()) {
|
|
350
|
+
return teamsfx_api_1.err(scaffoldRes.error);
|
|
351
|
+
}
|
|
203
352
|
}
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
353
|
+
capabilities = capabilities.filter((c) => c !== question_2.TabOptionItem.id && c !== question_2.TabSPFxItem.id);
|
|
354
|
+
if (capabilities.length > 0) {
|
|
355
|
+
const addModuleInputs = Object.assign(Object.assign({}, inputs), { projectPath: projectPath, capabilities: capabilities });
|
|
356
|
+
const addModuleRes = await this._addModule(addModuleInputs, ctx);
|
|
357
|
+
if (addModuleRes.isErr()) {
|
|
358
|
+
return teamsfx_api_1.err(addModuleRes.error);
|
|
359
|
+
}
|
|
360
|
+
// addResource
|
|
361
|
+
const addResourceInputs = Object.assign(Object.assign({}, inputs), { projectPath: projectPath, module: "1", resource: constants_2.BuiltInResourcePluginNames.bot });
|
|
362
|
+
const addResourceRes = await this._addResource(addResourceInputs, ctx);
|
|
363
|
+
if (addResourceRes.isErr()) {
|
|
364
|
+
return teamsfx_api_1.err(addResourceRes.error);
|
|
365
|
+
}
|
|
366
|
+
// scaffold
|
|
367
|
+
const templateName = programmingLanguage === "javascript" ? "NodejsBot_JS" : "NodejsBot_TS";
|
|
368
|
+
const scaffoldInputs = Object.assign(Object.assign({}, inputs), { projectPath: projectPath, module: "1", resource: constants_2.BuiltInScaffoldPluginNames.bot, template: {
|
|
369
|
+
id: `${constants_2.BuiltInScaffoldPluginNames.bot}/${templateName}`,
|
|
370
|
+
label: `${constants_2.BuiltInScaffoldPluginNames.bot}/${templateName}`,
|
|
371
|
+
data: {
|
|
372
|
+
pluginName: constants_2.BuiltInScaffoldPluginNames.bot,
|
|
373
|
+
templateName: templateName, //TODO
|
|
374
|
+
},
|
|
375
|
+
} });
|
|
376
|
+
const scaffoldRes = await this._scaffold(scaffoldInputs, ctx);
|
|
377
|
+
if (scaffoldRes.isErr()) {
|
|
378
|
+
return teamsfx_api_1.err(scaffoldRes.error);
|
|
211
379
|
}
|
|
212
380
|
}
|
|
213
381
|
}
|
|
@@ -222,11 +390,11 @@ class FxCore {
|
|
|
222
390
|
exports.currentStage = teamsfx_api_1.Stage.migrateV1;
|
|
223
391
|
inputs.stage = teamsfx_api_1.Stage.migrateV1;
|
|
224
392
|
const globalStateDescription = "openReadme";
|
|
225
|
-
const appName = ((_a = inputs[
|
|
393
|
+
const appName = ((_a = inputs[question_2.DefaultAppNameFunc.name]) !== null && _a !== void 0 ? _a : inputs[question_2.QuestionV1AppName.name]);
|
|
226
394
|
if (undefined === appName)
|
|
227
395
|
return teamsfx_api_1.err(error_1.InvalidInputError(`App Name is empty`, inputs));
|
|
228
396
|
const validateResult = jsonschema.validate(appName, {
|
|
229
|
-
pattern:
|
|
397
|
+
pattern: question_2.ProjectNamePattern,
|
|
230
398
|
});
|
|
231
399
|
if (validateResult.errors && validateResult.errors.length > 0) {
|
|
232
400
|
return teamsfx_api_1.err(error_1.InvalidInputError(`${validateResult.errors[0].message}`, inputs));
|
|
@@ -302,104 +470,131 @@ class FxCore {
|
|
|
302
470
|
return teamsfx_api_1.err(error_1.ArchiveProjectError(e.message));
|
|
303
471
|
}
|
|
304
472
|
}
|
|
305
|
-
|
|
473
|
+
/**
|
|
474
|
+
* switch to different versions of provisionResources
|
|
475
|
+
*/
|
|
476
|
+
async provisionResources(inputs) {
|
|
477
|
+
if (isV3()) {
|
|
478
|
+
return this.provisionResourcesV3(inputs);
|
|
479
|
+
}
|
|
480
|
+
else {
|
|
481
|
+
return this.provisionResourcesV2(inputs);
|
|
482
|
+
}
|
|
483
|
+
}
|
|
484
|
+
async provisionResourcesV2(inputs, ctx) {
|
|
306
485
|
exports.currentStage = teamsfx_api_1.Stage.provision;
|
|
307
486
|
inputs.stage = teamsfx_api_1.Stage.provision;
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
ctx.envInfoV2.state = lodash_1.assign(ctx.envInfoV2.state, result.output);
|
|
321
|
-
return teamsfx_api_1.err(result.error);
|
|
322
|
-
}
|
|
323
|
-
else {
|
|
324
|
-
return teamsfx_api_1.err(result.error);
|
|
325
|
-
}
|
|
487
|
+
if (!ctx || !ctx.solutionV2 || !ctx.contextV2 || !ctx.envInfoV2) {
|
|
488
|
+
return teamsfx_api_1.err(new error_1.ObjectIsUndefinedError("Provision input stuff"));
|
|
489
|
+
}
|
|
490
|
+
const envInfo = ctx.envInfoV2;
|
|
491
|
+
const result = await ctx.solutionV2.provisionResources(ctx.contextV2, inputs, envInfo, this.tools.tokenProvider);
|
|
492
|
+
if (result.kind === "success") {
|
|
493
|
+
ctx.envInfoV2.state = lodash_1.assign(ctx.envInfoV2.state, result.output);
|
|
494
|
+
return teamsfx_api_1.ok(teamsfx_api_1.Void);
|
|
495
|
+
}
|
|
496
|
+
else if (result.kind === "partialSuccess") {
|
|
497
|
+
ctx.envInfoV2.state = lodash_1.assign(ctx.envInfoV2.state, result.output);
|
|
498
|
+
return teamsfx_api_1.err(result.error);
|
|
326
499
|
}
|
|
327
500
|
else {
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
501
|
+
return teamsfx_api_1.err(result.error);
|
|
502
|
+
}
|
|
503
|
+
}
|
|
504
|
+
async provisionResourcesV3(inputs, ctx) {
|
|
505
|
+
exports.currentStage = teamsfx_api_1.Stage.provision;
|
|
506
|
+
inputs.stage = teamsfx_api_1.Stage.provision;
|
|
507
|
+
if (ctx &&
|
|
508
|
+
ctx.solutionV3 &&
|
|
509
|
+
ctx.contextV2 &&
|
|
510
|
+
ctx.envInfoV3 &&
|
|
511
|
+
ctx.solutionV3.provisionResources) {
|
|
512
|
+
const res = await ctx.solutionV3.provisionResources(ctx.contextV2, inputs, ctx.envInfoV3, exports.TOOLS.tokenProvider);
|
|
513
|
+
if (res.isOk()) {
|
|
514
|
+
ctx.envInfoV3 = res.value;
|
|
335
515
|
}
|
|
336
|
-
|
|
337
|
-
return provisionRes;
|
|
516
|
+
return res;
|
|
338
517
|
}
|
|
518
|
+
return teamsfx_api_1.ok(teamsfx_api_1.Void);
|
|
519
|
+
}
|
|
520
|
+
async deployArtifacts(inputs) {
|
|
521
|
+
if (isV3())
|
|
522
|
+
return this.deployArtifactsV3(inputs);
|
|
523
|
+
else
|
|
524
|
+
return this.deployArtifactsV2(inputs);
|
|
339
525
|
}
|
|
340
|
-
async
|
|
526
|
+
async deployArtifactsV2(inputs, ctx) {
|
|
341
527
|
exports.currentStage = teamsfx_api_1.Stage.deploy;
|
|
342
528
|
inputs.stage = teamsfx_api_1.Stage.deploy;
|
|
343
|
-
if (
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
529
|
+
if (!ctx || !ctx.solutionV2 || !ctx.contextV2 || !ctx.envInfoV2) {
|
|
530
|
+
const name = undefinedName([ctx, ctx === null || ctx === void 0 ? void 0 : ctx.solutionV2, ctx === null || ctx === void 0 ? void 0 : ctx.contextV2, ctx === null || ctx === void 0 ? void 0 : ctx.envInfoV2], ["ctx", "ctx.solutionV2", "ctx.contextV2", "ctx.envInfoV2"]);
|
|
531
|
+
return teamsfx_api_1.err(new error_1.ObjectIsUndefinedError(`Deploy input stuff: ${name}`));
|
|
532
|
+
}
|
|
533
|
+
if (ctx.solutionV2.deploy)
|
|
534
|
+
return await ctx.solutionV2.deploy(ctx.contextV2, inputs, ctx.envInfoV2, this.tools.tokenProvider);
|
|
535
|
+
else
|
|
536
|
+
return teamsfx_api_1.ok(teamsfx_api_1.Void);
|
|
537
|
+
}
|
|
538
|
+
async deployArtifactsV3(inputs, ctx) {
|
|
539
|
+
exports.currentStage = teamsfx_api_1.Stage.deploy;
|
|
540
|
+
inputs.stage = teamsfx_api_1.Stage.deploy;
|
|
541
|
+
if (ctx && ctx.solutionV3 && ctx.contextV2 && ctx.envInfoV3 && ctx.solutionV3.deploy) {
|
|
542
|
+
const res = await ctx.solutionV3.deploy(ctx.contextV2, inputs, ctx.envInfoV3, exports.TOOLS.tokenProvider);
|
|
543
|
+
return res;
|
|
544
|
+
}
|
|
545
|
+
return teamsfx_api_1.ok(teamsfx_api_1.Void);
|
|
546
|
+
}
|
|
547
|
+
async localDebug(inputs) {
|
|
548
|
+
if (isV3())
|
|
549
|
+
return this.localDebugV3(inputs);
|
|
550
|
+
else
|
|
551
|
+
return this.localDebugV2(inputs);
|
|
552
|
+
}
|
|
553
|
+
async localDebugV2(inputs, ctx) {
|
|
554
|
+
exports.currentStage = teamsfx_api_1.Stage.debug;
|
|
555
|
+
inputs.stage = teamsfx_api_1.Stage.debug;
|
|
556
|
+
if (!ctx || !ctx.solutionV2 || !ctx.contextV2) {
|
|
557
|
+
const name = undefinedName([ctx, ctx === null || ctx === void 0 ? void 0 : ctx.solutionV2, ctx === null || ctx === void 0 ? void 0 : ctx.contextV2], ["ctx", "ctx.solutionV2", "ctx.contextV2"]);
|
|
558
|
+
return teamsfx_api_1.err(new error_1.ObjectIsUndefinedError(`localDebug input stuff (${name})`));
|
|
559
|
+
}
|
|
560
|
+
if (!ctx.localSettings)
|
|
561
|
+
ctx.localSettings = {};
|
|
562
|
+
if (ctx.solutionV2.provisionLocalResource) {
|
|
563
|
+
const res = await ctx.solutionV2.provisionLocalResource(ctx.contextV2, inputs, ctx.localSettings, this.tools.tokenProvider);
|
|
564
|
+
if (res.kind === "success") {
|
|
565
|
+
ctx.localSettings = res.output;
|
|
351
566
|
return teamsfx_api_1.ok(teamsfx_api_1.Void);
|
|
567
|
+
}
|
|
568
|
+
else if (res.kind === "partialSuccess") {
|
|
569
|
+
ctx.localSettings = res.output;
|
|
570
|
+
return teamsfx_api_1.err(res.error);
|
|
571
|
+
}
|
|
572
|
+
else {
|
|
573
|
+
return teamsfx_api_1.err(res.error);
|
|
574
|
+
}
|
|
352
575
|
}
|
|
353
576
|
else {
|
|
354
|
-
|
|
355
|
-
const name = undefinedName([ctx, ctx === null || ctx === void 0 ? void 0 : ctx.solution, ctx === null || ctx === void 0 ? void 0 : ctx.solutionContext], ["ctx", "ctx.solution", "ctx.solutionContext"]);
|
|
356
|
-
return teamsfx_api_1.err(new error_1.ObjectIsUndefinedError(`Deploy input stuff: ${name}`));
|
|
357
|
-
}
|
|
358
|
-
return await ctx.solution.deploy(ctx.solutionContext);
|
|
577
|
+
return teamsfx_api_1.ok(teamsfx_api_1.Void);
|
|
359
578
|
}
|
|
360
579
|
}
|
|
361
|
-
async
|
|
580
|
+
async localDebugV3(inputs, ctx) {
|
|
362
581
|
exports.currentStage = teamsfx_api_1.Stage.debug;
|
|
363
582
|
inputs.stage = teamsfx_api_1.Stage.debug;
|
|
364
|
-
if (
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
if (ctx.solutionV2.provisionLocalResource) {
|
|
373
|
-
const res = await ctx.solutionV2.provisionLocalResource(ctx.contextV2, inputs, ctx.localSettings, this.tools.tokenProvider);
|
|
374
|
-
if (res.kind === "success") {
|
|
375
|
-
ctx.localSettings = res.output;
|
|
376
|
-
return teamsfx_api_1.ok(teamsfx_api_1.Void);
|
|
377
|
-
}
|
|
378
|
-
else if (res.kind === "partialSuccess") {
|
|
379
|
-
ctx.localSettings = res.output;
|
|
380
|
-
return teamsfx_api_1.err(res.error);
|
|
381
|
-
}
|
|
382
|
-
else {
|
|
383
|
-
return teamsfx_api_1.err(res.error);
|
|
384
|
-
}
|
|
385
|
-
}
|
|
386
|
-
else {
|
|
387
|
-
return teamsfx_api_1.ok(teamsfx_api_1.Void);
|
|
388
|
-
}
|
|
583
|
+
if (ctx &&
|
|
584
|
+
ctx.solutionV3 &&
|
|
585
|
+
ctx.contextV2 &&
|
|
586
|
+
ctx.localSettings &&
|
|
587
|
+
ctx.solutionV3.provisionLocalResources) {
|
|
588
|
+
const res = await ctx.solutionV3.provisionLocalResources(ctx.contextV2, inputs, ctx.localSettings, exports.TOOLS.tokenProvider);
|
|
589
|
+
if (res.isOk()) {
|
|
590
|
+
ctx.localSettings = res.value;
|
|
389
591
|
}
|
|
592
|
+
return res;
|
|
390
593
|
}
|
|
391
|
-
|
|
392
|
-
const name = undefinedName([ctx, ctx === null || ctx === void 0 ? void 0 : ctx.solution, ctx === null || ctx === void 0 ? void 0 : ctx.solutionContext, ctx === null || ctx === void 0 ? void 0 : ctx.projectSettings], ["ctx", "ctx.solution", "ctx.solutionContext", "ctx.projectSettings"]);
|
|
393
|
-
return teamsfx_api_1.err(new error_1.ObjectIsUndefinedError(`localDebug input stuff (${name})`));
|
|
394
|
-
}
|
|
395
|
-
envInfoLoader_1.upgradeProgrammingLanguage(ctx.solutionContext.envInfo.state, ctx.projectSettings);
|
|
396
|
-
envInfoLoader_1.upgradeDefaultFunctionName(ctx.solutionContext.envInfo.state, ctx.projectSettings);
|
|
397
|
-
const res = await ctx.solution.localDebug(ctx.solutionContext);
|
|
398
|
-
this._setEnvInfoV2(ctx);
|
|
399
|
-
return res;
|
|
594
|
+
return teamsfx_api_1.ok(teamsfx_api_1.Void);
|
|
400
595
|
}
|
|
401
596
|
_setEnvInfoV2(ctx) {
|
|
402
|
-
if (
|
|
597
|
+
if (ctx && ctx.solutionContext) {
|
|
403
598
|
//workaround, compatible to api v2
|
|
404
599
|
ctx.envInfoV2 = {
|
|
405
600
|
envName: ctx.solutionContext.envInfo.envName,
|
|
@@ -409,23 +604,33 @@ class FxCore {
|
|
|
409
604
|
ctx.envInfoV2.state = tools_1.mapToJson(ctx.solutionContext.envInfo.state);
|
|
410
605
|
}
|
|
411
606
|
}
|
|
412
|
-
async publishApplication(inputs
|
|
607
|
+
async publishApplication(inputs) {
|
|
608
|
+
if (isV3())
|
|
609
|
+
return this.publishApplicationV3(inputs);
|
|
610
|
+
else
|
|
611
|
+
return this.publishApplicationV2(inputs);
|
|
612
|
+
}
|
|
613
|
+
async publishApplicationV2(inputs, ctx) {
|
|
413
614
|
exports.currentStage = teamsfx_api_1.Stage.publish;
|
|
414
615
|
inputs.stage = teamsfx_api_1.Stage.publish;
|
|
415
|
-
if (
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
return teamsfx_api_1.err(new error_1.ObjectIsUndefinedError(`publish input stuff: ${name}`));
|
|
419
|
-
}
|
|
420
|
-
return await ctx.solutionV2.publishApplication(ctx.contextV2, inputs, ctx.envInfoV2, this.tools.tokenProvider.appStudioToken);
|
|
616
|
+
if (!ctx || !ctx.solutionV2 || !ctx.contextV2 || !ctx.envInfoV2) {
|
|
617
|
+
const name = undefinedName([ctx, ctx === null || ctx === void 0 ? void 0 : ctx.solutionV2, ctx === null || ctx === void 0 ? void 0 : ctx.contextV2, ctx === null || ctx === void 0 ? void 0 : ctx.envInfoV2], ["ctx", "ctx.solutionV2", "ctx.contextV2", "ctx.envInfoV2"]);
|
|
618
|
+
return teamsfx_api_1.err(new error_1.ObjectIsUndefinedError(`publish input stuff: ${name}`));
|
|
421
619
|
}
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
620
|
+
return await ctx.solutionV2.publishApplication(ctx.contextV2, inputs, ctx.envInfoV2, this.tools.tokenProvider.appStudioToken);
|
|
621
|
+
}
|
|
622
|
+
async publishApplicationV3(inputs, ctx) {
|
|
623
|
+
exports.currentStage = teamsfx_api_1.Stage.publish;
|
|
624
|
+
inputs.stage = teamsfx_api_1.Stage.publish;
|
|
625
|
+
if (ctx &&
|
|
626
|
+
ctx.solutionV3 &&
|
|
627
|
+
ctx.contextV2 &&
|
|
628
|
+
ctx.envInfoV3 &&
|
|
629
|
+
ctx.solutionV3.publishApplication) {
|
|
630
|
+
const res = await ctx.solutionV3.publishApplication(ctx.contextV2, inputs, ctx.envInfoV3, exports.TOOLS.tokenProvider.appStudioToken);
|
|
631
|
+
return res;
|
|
428
632
|
}
|
|
633
|
+
return teamsfx_api_1.ok(teamsfx_api_1.Void);
|
|
429
634
|
}
|
|
430
635
|
async executeUserTask(func, inputs, ctx) {
|
|
431
636
|
exports.currentStage = teamsfx_api_1.Stage.userTask;
|
|
@@ -433,32 +638,20 @@ class FxCore {
|
|
|
433
638
|
const namespace = func.namespace;
|
|
434
639
|
const array = namespace ? namespace.split("/") : [];
|
|
435
640
|
if ("" !== namespace && array.length > 0) {
|
|
436
|
-
if (
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
return teamsfx_api_1.err(new error_1.ObjectIsUndefinedError(`executeUserTask input stuff: ${name}`));
|
|
440
|
-
}
|
|
441
|
-
if (!ctx.contextV2)
|
|
442
|
-
ctx.contextV2 = createV2Context(this, newProjectSettings());
|
|
443
|
-
if (ctx.solutionV2.executeUserTask) {
|
|
444
|
-
if (!ctx.localSettings)
|
|
445
|
-
ctx.localSettings = {};
|
|
446
|
-
const res = await ctx.solutionV2.executeUserTask(ctx.contextV2, inputs, func, ctx.localSettings, ctx.envInfoV2, this.tools.tokenProvider);
|
|
447
|
-
return res;
|
|
448
|
-
}
|
|
449
|
-
else
|
|
450
|
-
return teamsfx_api_1.err(error_1.FunctionRouterError(func));
|
|
641
|
+
if (!ctx || !ctx.solutionV2 || !ctx.envInfoV2) {
|
|
642
|
+
const name = undefinedName([ctx, ctx === null || ctx === void 0 ? void 0 : ctx.solutionV2, ctx === null || ctx === void 0 ? void 0 : ctx.envInfoV2], ["ctx", "ctx.solutionV2", "ctx.envInfoV2"]);
|
|
643
|
+
return teamsfx_api_1.err(new error_1.ObjectIsUndefinedError(`executeUserTask input stuff: ${name}`));
|
|
451
644
|
}
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
if (!ctx.
|
|
456
|
-
ctx.
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
else
|
|
460
|
-
return teamsfx_api_1.err(error_1.FunctionRouterError(func));
|
|
645
|
+
if (!ctx.contextV2)
|
|
646
|
+
ctx.contextV2 = createV2Context(newProjectSettings());
|
|
647
|
+
if (ctx.solutionV2.executeUserTask) {
|
|
648
|
+
if (!ctx.localSettings)
|
|
649
|
+
ctx.localSettings = {};
|
|
650
|
+
const res = await ctx.solutionV2.executeUserTask(ctx.contextV2, inputs, func, ctx.localSettings, ctx.envInfoV2, this.tools.tokenProvider);
|
|
651
|
+
return res;
|
|
461
652
|
}
|
|
653
|
+
else
|
|
654
|
+
return teamsfx_api_1.err(error_1.FunctionRouterError(func));
|
|
462
655
|
}
|
|
463
656
|
return teamsfx_api_1.err(error_1.FunctionRouterError(func));
|
|
464
657
|
}
|
|
@@ -469,27 +662,16 @@ class FxCore {
|
|
|
469
662
|
exports.currentStage = teamsfx_api_1.Stage.getQuestions;
|
|
470
663
|
if (stage === teamsfx_api_1.Stage.create) {
|
|
471
664
|
delete inputs.projectPath;
|
|
472
|
-
return await this.
|
|
665
|
+
return await this._getQuestionsForCreateProjectV2(inputs);
|
|
473
666
|
}
|
|
474
667
|
else {
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
: { envName: __1.environmentManager.getDefaultEnvName(), config: {}, state: {} };
|
|
483
|
-
inputs.stage = stage;
|
|
484
|
-
return await this._getQuestions(contextV2, solutionV2, stage, inputs, envInfoV2);
|
|
485
|
-
}
|
|
486
|
-
else {
|
|
487
|
-
const solutionContext = ctx.solutionContext
|
|
488
|
-
? ctx.solutionContext
|
|
489
|
-
: await projectSettingsLoader_1.newSolutionContext(this.tools, inputs);
|
|
490
|
-
const solution = ctx.solution ? ctx.solution : SolutionPluginContainer_1.getAllSolutionPlugins()[0];
|
|
491
|
-
return await this._getQuestions(solutionContext, solution, stage, inputs);
|
|
492
|
-
}
|
|
668
|
+
const contextV2 = ctx.contextV2 ? ctx.contextV2 : createV2Context(newProjectSettings());
|
|
669
|
+
const solutionV2 = ctx.solutionV2 ? ctx.solutionV2 : await SolutionPluginContainer_1.getAllSolutionPluginsV2()[0];
|
|
670
|
+
const envInfoV2 = ctx.envInfoV2
|
|
671
|
+
? ctx.envInfoV2
|
|
672
|
+
: { envName: __1.environmentManager.getDefaultEnvName(), config: {}, state: {} };
|
|
673
|
+
inputs.stage = stage;
|
|
674
|
+
return await this._getQuestions(contextV2, solutionV2, stage, inputs, envInfoV2);
|
|
493
675
|
}
|
|
494
676
|
}
|
|
495
677
|
async getQuestionsForUserTask(func, inputs, ctx) {
|
|
@@ -497,21 +679,12 @@ class FxCore {
|
|
|
497
679
|
return teamsfx_api_1.err(new error_1.ObjectIsUndefinedError("getQuestionsForUserTask input stuff"));
|
|
498
680
|
inputs.stage = teamsfx_api_1.Stage.getQuestions;
|
|
499
681
|
exports.currentStage = teamsfx_api_1.Stage.getQuestions;
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
return await this._getQuestionsForUserTask(contextV2, solutionV2, func, inputs, envInfoV2);
|
|
507
|
-
}
|
|
508
|
-
else {
|
|
509
|
-
const solutionContext = ctx.solutionContext
|
|
510
|
-
? ctx.solutionContext
|
|
511
|
-
: await projectSettingsLoader_1.newSolutionContext(this.tools, inputs);
|
|
512
|
-
const solution = ctx.solution ? ctx.solution : SolutionPluginContainer_1.getAllSolutionPlugins()[0];
|
|
513
|
-
return await this._getQuestionsForUserTask(solutionContext, solution, func, inputs);
|
|
514
|
-
}
|
|
682
|
+
const contextV2 = ctx.contextV2 ? ctx.contextV2 : createV2Context(newProjectSettings());
|
|
683
|
+
const solutionV2 = ctx.solutionV2 ? ctx.solutionV2 : await SolutionPluginContainer_1.getAllSolutionPluginsV2()[0];
|
|
684
|
+
const envInfoV2 = ctx.envInfoV2
|
|
685
|
+
? ctx.envInfoV2
|
|
686
|
+
: { envName: __1.environmentManager.getDefaultEnvName(), config: {}, state: {} };
|
|
687
|
+
return await this._getQuestionsForUserTask(contextV2, solutionV2, func, inputs, envInfoV2);
|
|
515
688
|
}
|
|
516
689
|
async getProjectConfig(inputs, ctx) {
|
|
517
690
|
var _a, _b;
|
|
@@ -528,175 +701,56 @@ class FxCore {
|
|
|
528
701
|
async grantPermission(inputs, ctx) {
|
|
529
702
|
exports.currentStage = teamsfx_api_1.Stage.grantPermission;
|
|
530
703
|
inputs.stage = teamsfx_api_1.Stage.grantPermission;
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
else {
|
|
535
|
-
const projectPath = inputs.projectPath;
|
|
536
|
-
if (!projectPath) {
|
|
537
|
-
return teamsfx_api_1.err(new error_1.ObjectIsUndefinedError("projectPath"));
|
|
538
|
-
}
|
|
539
|
-
return ctx.solutionV2.grantPermission(ctx.contextV2, Object.assign(Object.assign({}, inputs), { projectPath: projectPath }), ctx.envInfoV2, this.tools.tokenProvider);
|
|
704
|
+
const projectPath = inputs.projectPath;
|
|
705
|
+
if (!projectPath) {
|
|
706
|
+
return teamsfx_api_1.err(new error_1.ObjectIsUndefinedError("projectPath"));
|
|
540
707
|
}
|
|
708
|
+
return ctx.solutionV2.grantPermission(ctx.contextV2, Object.assign(Object.assign({}, inputs), { projectPath: projectPath }), ctx.envInfoV2, this.tools.tokenProvider);
|
|
541
709
|
}
|
|
542
710
|
async checkPermission(inputs, ctx) {
|
|
543
711
|
exports.currentStage = teamsfx_api_1.Stage.checkPermission;
|
|
544
712
|
inputs.stage = teamsfx_api_1.Stage.checkPermission;
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
else {
|
|
549
|
-
const projectPath = inputs.projectPath;
|
|
550
|
-
if (!projectPath) {
|
|
551
|
-
return teamsfx_api_1.err(new error_1.ObjectIsUndefinedError("projectPath"));
|
|
552
|
-
}
|
|
553
|
-
return ctx.solutionV2.checkPermission(ctx.contextV2, Object.assign(Object.assign({}, inputs), { projectPath: projectPath }), ctx.envInfoV2, this.tools.tokenProvider);
|
|
713
|
+
const projectPath = inputs.projectPath;
|
|
714
|
+
if (!projectPath) {
|
|
715
|
+
return teamsfx_api_1.err(new error_1.ObjectIsUndefinedError("projectPath"));
|
|
554
716
|
}
|
|
717
|
+
return ctx.solutionV2.checkPermission(ctx.contextV2, Object.assign(Object.assign({}, inputs), { projectPath: projectPath }), ctx.envInfoV2, this.tools.tokenProvider);
|
|
555
718
|
}
|
|
556
719
|
async listCollaborator(inputs, ctx) {
|
|
557
720
|
exports.currentStage = teamsfx_api_1.Stage.listCollaborator;
|
|
558
721
|
inputs.stage = teamsfx_api_1.Stage.listCollaborator;
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
else {
|
|
563
|
-
const projectPath = inputs.projectPath;
|
|
564
|
-
if (!projectPath) {
|
|
565
|
-
return teamsfx_api_1.err(new error_1.ObjectIsUndefinedError("projectPath"));
|
|
566
|
-
}
|
|
567
|
-
return ctx.solutionV2.listCollaborator(ctx.contextV2, Object.assign(Object.assign({}, inputs), { projectPath: projectPath }), ctx.envInfoV2, this.tools.tokenProvider);
|
|
722
|
+
const projectPath = inputs.projectPath;
|
|
723
|
+
if (!projectPath) {
|
|
724
|
+
return teamsfx_api_1.err(new error_1.ObjectIsUndefinedError("projectPath"));
|
|
568
725
|
}
|
|
726
|
+
return ctx.solutionV2.listCollaborator(ctx.contextV2, Object.assign(Object.assign({}, inputs), { projectPath: projectPath }), ctx.envInfoV2, this.tools.tokenProvider);
|
|
569
727
|
}
|
|
570
728
|
async listAllCollaborators(inputs, ctx) {
|
|
571
729
|
exports.currentStage = teamsfx_api_1.Stage.listAllCollaborators;
|
|
572
730
|
inputs.stage = teamsfx_api_1.Stage.listAllCollaborators;
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
else {
|
|
577
|
-
const projectPath = inputs.projectPath;
|
|
578
|
-
if (!projectPath) {
|
|
579
|
-
return teamsfx_api_1.err(new error_1.ObjectIsUndefinedError("projectPath"));
|
|
580
|
-
}
|
|
581
|
-
return ctx.solutionV2.listAllCollaborators(ctx.contextV2, Object.assign(Object.assign({}, inputs), { projectPath: projectPath }), ctx.envInfoV2, this.tools.tokenProvider);
|
|
731
|
+
const projectPath = inputs.projectPath;
|
|
732
|
+
if (!projectPath) {
|
|
733
|
+
return teamsfx_api_1.err(new error_1.ObjectIsUndefinedError("projectPath"));
|
|
582
734
|
}
|
|
735
|
+
return ctx.solutionV2.listAllCollaborators(ctx.contextV2, Object.assign(Object.assign({}, inputs), { projectPath: projectPath }), ctx.envInfoV2, this.tools.tokenProvider);
|
|
583
736
|
}
|
|
584
737
|
async getSelectedEnv(inputs, ctx) {
|
|
585
|
-
var _a
|
|
586
|
-
|
|
587
|
-
return teamsfx_api_1.err(new error_1.TaskNotSupportError("getSelectedEnv"));
|
|
588
|
-
}
|
|
589
|
-
if (isV2()) {
|
|
590
|
-
return teamsfx_api_1.ok((_a = ctx === null || ctx === void 0 ? void 0 : ctx.envInfoV2) === null || _a === void 0 ? void 0 : _a.envName);
|
|
591
|
-
}
|
|
592
|
-
else {
|
|
593
|
-
return teamsfx_api_1.ok((_b = ctx === null || ctx === void 0 ? void 0 : ctx.solutionContext) === null || _b === void 0 ? void 0 : _b.envInfo.envName);
|
|
594
|
-
}
|
|
595
|
-
}
|
|
596
|
-
async _getQuestionsForUserTask(ctx, solution, func, inputs, envInfo) {
|
|
597
|
-
const namespace = func.namespace;
|
|
598
|
-
const array = namespace ? namespace.split("/") : [];
|
|
599
|
-
if (namespace && "" !== namespace && array.length > 0) {
|
|
600
|
-
let res = teamsfx_api_1.ok(undefined);
|
|
601
|
-
if (isV2()) {
|
|
602
|
-
const solutionV2 = solution;
|
|
603
|
-
if (solutionV2.getQuestionsForUserTask) {
|
|
604
|
-
res = await solutionV2.getQuestionsForUserTask(ctx, inputs, func, envInfo, this.tools.tokenProvider);
|
|
605
|
-
}
|
|
606
|
-
}
|
|
607
|
-
else {
|
|
608
|
-
const solutionv1 = solution;
|
|
609
|
-
if (solutionv1.getQuestionsForUserTask) {
|
|
610
|
-
res = await solutionv1.getQuestionsForUserTask(func, ctx);
|
|
611
|
-
}
|
|
612
|
-
}
|
|
613
|
-
if (res.isOk()) {
|
|
614
|
-
if (res.value) {
|
|
615
|
-
const node = res.value.trim();
|
|
616
|
-
return teamsfx_api_1.ok(node);
|
|
617
|
-
}
|
|
618
|
-
}
|
|
619
|
-
return res;
|
|
620
|
-
}
|
|
621
|
-
return teamsfx_api_1.err(error_1.FunctionRouterError(func));
|
|
622
|
-
}
|
|
623
|
-
async _getQuestionsForMigrateV1Project(inputs) {
|
|
624
|
-
const node = new teamsfx_api_1.QTreeNode({ type: "group" });
|
|
625
|
-
const globalSolutions = await SolutionPluginContainer_1.getAllSolutionPlugins();
|
|
626
|
-
const solutionContext = await projectSettingsLoader_1.newSolutionContext(this.tools, inputs);
|
|
627
|
-
for (const v of globalSolutions) {
|
|
628
|
-
if (v.getQuestions) {
|
|
629
|
-
const res = await v.getQuestions(teamsfx_api_1.Stage.migrateV1, solutionContext);
|
|
630
|
-
if (res.isErr())
|
|
631
|
-
return res;
|
|
632
|
-
if (res.value) {
|
|
633
|
-
const solutionNode = res.value;
|
|
634
|
-
solutionNode.condition = { equals: v.name };
|
|
635
|
-
if (solutionNode.data)
|
|
636
|
-
node.addChild(solutionNode);
|
|
637
|
-
}
|
|
638
|
-
}
|
|
639
|
-
}
|
|
640
|
-
const defaultAppNameFunc = new teamsfx_api_1.QTreeNode(question_1.DefaultAppNameFunc);
|
|
641
|
-
node.addChild(defaultAppNameFunc);
|
|
642
|
-
const appNameQuestion = new teamsfx_api_1.QTreeNode(question_1.QuestionV1AppName);
|
|
643
|
-
appNameQuestion.condition = {
|
|
644
|
-
validFunc: (input) => (!input ? undefined : "App name is auto generated."),
|
|
645
|
-
};
|
|
646
|
-
defaultAppNameFunc.addChild(appNameQuestion);
|
|
647
|
-
return teamsfx_api_1.ok(node.trim());
|
|
648
|
-
}
|
|
649
|
-
async _getQuestions(ctx, solution, stage, inputs, envInfo) {
|
|
650
|
-
if (stage !== teamsfx_api_1.Stage.create) {
|
|
651
|
-
let res = teamsfx_api_1.ok(undefined);
|
|
652
|
-
if (isV2()) {
|
|
653
|
-
const solutionV2 = solution;
|
|
654
|
-
if (solutionV2.getQuestions) {
|
|
655
|
-
inputs.stage = stage;
|
|
656
|
-
res = await solutionV2.getQuestions(ctx, inputs, envInfo, this.tools.tokenProvider);
|
|
657
|
-
}
|
|
658
|
-
}
|
|
659
|
-
else {
|
|
660
|
-
res = await solution.getQuestions(stage, ctx);
|
|
661
|
-
}
|
|
662
|
-
if (res.isErr())
|
|
663
|
-
return res;
|
|
664
|
-
if (res.value) {
|
|
665
|
-
const node = res.value;
|
|
666
|
-
if (node.data) {
|
|
667
|
-
return teamsfx_api_1.ok(node.trim());
|
|
668
|
-
}
|
|
669
|
-
}
|
|
670
|
-
}
|
|
671
|
-
return teamsfx_api_1.ok(undefined);
|
|
738
|
+
var _a;
|
|
739
|
+
return teamsfx_api_1.ok((_a = ctx === null || ctx === void 0 ? void 0 : ctx.envInfoV2) === null || _a === void 0 ? void 0 : _a.envName);
|
|
672
740
|
}
|
|
673
741
|
async encrypt(plaintext, inputs, ctx) {
|
|
674
742
|
if (!ctx)
|
|
675
743
|
return teamsfx_api_1.err(new error_1.ObjectIsUndefinedError("ctx"));
|
|
676
|
-
if (
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
return ctx.contextV2.cryptoProvider.encrypt(plaintext);
|
|
680
|
-
}
|
|
681
|
-
else {
|
|
682
|
-
if (!ctx.solutionContext)
|
|
683
|
-
return teamsfx_api_1.err(new error_1.ObjectIsUndefinedError("ctx.solutionContext"));
|
|
684
|
-
return ctx.solutionContext.cryptoProvider.encrypt(plaintext);
|
|
685
|
-
}
|
|
744
|
+
if (!ctx.contextV2)
|
|
745
|
+
return teamsfx_api_1.err(new error_1.ObjectIsUndefinedError("ctx.contextV2"));
|
|
746
|
+
return ctx.contextV2.cryptoProvider.encrypt(plaintext);
|
|
686
747
|
}
|
|
687
748
|
async decrypt(ciphertext, inputs, ctx) {
|
|
688
749
|
if (!ctx)
|
|
689
750
|
return teamsfx_api_1.err(new error_1.ObjectIsUndefinedError("ctx"));
|
|
690
|
-
if (
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
return ctx.contextV2.cryptoProvider.decrypt(ciphertext);
|
|
694
|
-
}
|
|
695
|
-
else {
|
|
696
|
-
if (!ctx.solutionContext)
|
|
697
|
-
return teamsfx_api_1.err(new error_1.ObjectIsUndefinedError("ctx.solutionContext"));
|
|
698
|
-
return ctx.solutionContext.cryptoProvider.decrypt(ciphertext);
|
|
699
|
-
}
|
|
751
|
+
if (!ctx.contextV2)
|
|
752
|
+
return teamsfx_api_1.err(new error_1.ObjectIsUndefinedError("ctx.contextV2"));
|
|
753
|
+
return ctx.contextV2.cryptoProvider.decrypt(ciphertext);
|
|
700
754
|
}
|
|
701
755
|
async buildArtifacts(inputs) {
|
|
702
756
|
throw new error_1.TaskNotSupportError(teamsfx_api_1.Stage.build);
|
|
@@ -705,7 +759,7 @@ class FxCore {
|
|
|
705
759
|
if (!ctx)
|
|
706
760
|
return teamsfx_api_1.err(new error_1.ObjectIsUndefinedError("createEnv input stuff"));
|
|
707
761
|
const projectSettings = ctx.projectSettings;
|
|
708
|
-
if (!
|
|
762
|
+
if (!projectSettings) {
|
|
709
763
|
return teamsfx_api_1.ok(teamsfx_api_1.Void);
|
|
710
764
|
}
|
|
711
765
|
const core = ctx.self;
|
|
@@ -721,21 +775,11 @@ class FxCore {
|
|
|
721
775
|
}
|
|
722
776
|
inputs.sourceEnvName = createEnvCopyInput.sourceEnvName;
|
|
723
777
|
inputs.targetEnvName = createEnvCopyInput.targetEnvName;
|
|
724
|
-
if (
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
return await ctx.solutionV2.createEnv(ctx.contextV2, inputs);
|
|
730
|
-
}
|
|
731
|
-
}
|
|
732
|
-
else {
|
|
733
|
-
if (!ctx.solution || !ctx.solutionContext)
|
|
734
|
-
return teamsfx_api_1.err(new error_1.ObjectIsUndefinedError("ctx.solution, ctx.solutionContext"));
|
|
735
|
-
if (ctx.solution.createEnv) {
|
|
736
|
-
ctx.solutionContext.answers.copy = true;
|
|
737
|
-
return await ctx.solution.createEnv(ctx.solutionContext);
|
|
738
|
-
}
|
|
778
|
+
if (!ctx.solutionV2 || !ctx.contextV2)
|
|
779
|
+
return teamsfx_api_1.err(new error_1.ObjectIsUndefinedError("ctx.solutionV2, ctx.contextV2"));
|
|
780
|
+
if (ctx.solutionV2.createEnv) {
|
|
781
|
+
inputs.copy = true;
|
|
782
|
+
return await ctx.solutionV2.createEnv(ctx.contextV2, inputs);
|
|
739
783
|
}
|
|
740
784
|
return teamsfx_api_1.ok(teamsfx_api_1.Void);
|
|
741
785
|
}
|
|
@@ -759,7 +803,7 @@ class FxCore {
|
|
|
759
803
|
catch (e) {
|
|
760
804
|
return teamsfx_api_1.err(error_1.CopyFileError(e));
|
|
761
805
|
}
|
|
762
|
-
|
|
806
|
+
exports.TOOLS.logProvider.debug(`[core] copy env config file for ${targetEnvName} environment to path ${targetEnvConfigFilePath}`);
|
|
763
807
|
return teamsfx_api_1.ok(teamsfx_api_1.Void);
|
|
764
808
|
}
|
|
765
809
|
// deprecated
|
|
@@ -768,7 +812,7 @@ class FxCore {
|
|
|
768
812
|
if (!env) {
|
|
769
813
|
return teamsfx_api_1.err(new error_1.ObjectIsUndefinedError("env"));
|
|
770
814
|
}
|
|
771
|
-
if (!
|
|
815
|
+
if (!ctx.projectSettings) {
|
|
772
816
|
return teamsfx_api_1.ok(teamsfx_api_1.Void);
|
|
773
817
|
}
|
|
774
818
|
const envConfigs = await __1.environmentManager.listEnvConfigs(inputs.projectPath);
|
|
@@ -779,73 +823,78 @@ class FxCore {
|
|
|
779
823
|
return teamsfx_api_1.err(error_1.NonExistEnvNameError(env));
|
|
780
824
|
}
|
|
781
825
|
const core = ctx.self;
|
|
782
|
-
const solutionContext = await envInfoLoader_1.loadSolutionContext(
|
|
826
|
+
const solutionContext = await envInfoLoader_1.loadSolutionContext(inputs, ctx.projectSettings, env);
|
|
783
827
|
if (!solutionContext.isErr()) {
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
ctx.provisionOutputs = solutionContext.value.envInfo.state;
|
|
788
|
-
ctx.envName = solutionContext.value.envInfo.envName;
|
|
789
|
-
}
|
|
790
|
-
else {
|
|
791
|
-
ctx.solutionContext = solutionContext.value;
|
|
792
|
-
}
|
|
828
|
+
ctx.provisionInputConfig = solutionContext.value.envInfo.config;
|
|
829
|
+
ctx.provisionOutputs = solutionContext.value.envInfo.state;
|
|
830
|
+
ctx.envName = solutionContext.value.envInfo.envName;
|
|
793
831
|
}
|
|
794
832
|
this.tools.ui.showMessage("info", `[${env}] is activated.`, false);
|
|
795
833
|
return teamsfx_api_1.ok(teamsfx_api_1.Void);
|
|
796
834
|
}
|
|
797
|
-
async
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
const selectSolution = question_1.QuestionSelectSolution;
|
|
808
|
-
selectSolution.staticOptions = solutionNames;
|
|
809
|
-
const solutionSelectNode = new teamsfx_api_1.QTreeNode(selectSolution);
|
|
810
|
-
createNew.addChild(solutionSelectNode);
|
|
811
|
-
const context = isV2()
|
|
812
|
-
? createV2Context(this, newProjectSettings())
|
|
813
|
-
: await projectSettingsLoader_1.newSolutionContext(this.tools, inputs);
|
|
814
|
-
for (const solutionPlugin of globalSolutions) {
|
|
815
|
-
let res = teamsfx_api_1.ok(undefined);
|
|
816
|
-
if (isV2()) {
|
|
817
|
-
const v2plugin = solutionPlugin;
|
|
818
|
-
res = v2plugin.getQuestionsForScaffolding
|
|
819
|
-
? await v2plugin.getQuestionsForScaffolding(context, inputs)
|
|
820
|
-
: teamsfx_api_1.ok(undefined);
|
|
821
|
-
}
|
|
822
|
-
else {
|
|
823
|
-
const v1plugin = solutionPlugin;
|
|
824
|
-
res = v1plugin.getQuestions
|
|
825
|
-
? await v1plugin.getQuestions(teamsfx_api_1.Stage.create, context)
|
|
826
|
-
: teamsfx_api_1.ok(undefined);
|
|
827
|
-
}
|
|
828
|
-
if (res.isErr())
|
|
829
|
-
return res;
|
|
830
|
-
if (res.value) {
|
|
831
|
-
const solutionNode = res.value;
|
|
832
|
-
solutionNode.condition = { equals: solutionPlugin.name };
|
|
833
|
-
if (solutionNode.data)
|
|
834
|
-
solutionSelectNode.addChild(solutionNode);
|
|
835
|
-
}
|
|
835
|
+
async _init(inputs, ctx) {
|
|
836
|
+
if (!ctx) {
|
|
837
|
+
return teamsfx_api_1.err(new error_1.ObjectIsUndefinedError("ctx for createProject"));
|
|
838
|
+
}
|
|
839
|
+
const appName = inputs[question_2.QuestionAppName.name];
|
|
840
|
+
const validateResult = jsonschema.validate(appName, {
|
|
841
|
+
pattern: question_2.ProjectNamePattern,
|
|
842
|
+
});
|
|
843
|
+
if (validateResult.errors && validateResult.errors.length > 0) {
|
|
844
|
+
return teamsfx_api_1.err(error_1.InvalidInputError("invalid app-name", inputs));
|
|
836
845
|
}
|
|
837
|
-
|
|
838
|
-
|
|
846
|
+
const projectSettings = newProjectSettings();
|
|
847
|
+
projectSettings.appName = appName;
|
|
848
|
+
ctx.projectSettings = projectSettings;
|
|
849
|
+
if (!inputs.solution) {
|
|
850
|
+
return teamsfx_api_1.err(error_1.InvalidInputError("solution is undefined", inputs));
|
|
839
851
|
}
|
|
840
|
-
|
|
841
|
-
|
|
842
|
-
|
|
843
|
-
|
|
844
|
-
|
|
845
|
-
|
|
846
|
-
|
|
852
|
+
const createEnvResult = await this.createEnvWithName(__1.environmentManager.getDefaultEnvName(), projectSettings, inputs);
|
|
853
|
+
if (createEnvResult.isErr()) {
|
|
854
|
+
return teamsfx_api_1.err(createEnvResult.error);
|
|
855
|
+
}
|
|
856
|
+
await fs.ensureDir(path.join(inputs.projectPath, `.${teamsfx_api_1.ConfigFolderName}`));
|
|
857
|
+
await fs.ensureDir(path.join(inputs.projectPath, "templates", `${teamsfx_api_1.AppPackageFolderName}`));
|
|
858
|
+
const basicFolderRes = await createBasicFolderStructure(inputs);
|
|
859
|
+
if (basicFolderRes.isErr()) {
|
|
860
|
+
return teamsfx_api_1.err(basicFolderRes.error);
|
|
861
|
+
}
|
|
862
|
+
const solution = typedi_1.Container.get(inputs.solution);
|
|
863
|
+
projectSettings.solutionSettings.name = inputs.solution;
|
|
864
|
+
const context = createV2Context(projectSettings);
|
|
865
|
+
ctx.contextV2 = context;
|
|
866
|
+
ctx.solutionV3 = solution;
|
|
867
|
+
return await solution.init(context, inputs);
|
|
868
|
+
}
|
|
869
|
+
async init(inputs, ctx) {
|
|
870
|
+
return this._init(inputs, ctx);
|
|
871
|
+
}
|
|
872
|
+
async _addModule(inputs, ctx) {
|
|
873
|
+
if (ctx && ctx.solutionV3 && ctx.contextV2) {
|
|
874
|
+
return await ctx.solutionV3.addModule(ctx.contextV2, {}, inputs);
|
|
847
875
|
}
|
|
848
|
-
return teamsfx_api_1.ok(
|
|
876
|
+
return teamsfx_api_1.ok(teamsfx_api_1.Void);
|
|
877
|
+
}
|
|
878
|
+
async addModule(inputs, ctx) {
|
|
879
|
+
return this._addModule(inputs, ctx);
|
|
880
|
+
}
|
|
881
|
+
async scaffold(inputs, ctx) {
|
|
882
|
+
return this._scaffold(inputs, ctx);
|
|
883
|
+
}
|
|
884
|
+
async _scaffold(inputs, ctx) {
|
|
885
|
+
if (ctx && ctx.solutionV3 && ctx.contextV2) {
|
|
886
|
+
return await ctx.solutionV3.scaffold(ctx.contextV2, inputs);
|
|
887
|
+
}
|
|
888
|
+
return teamsfx_api_1.ok(teamsfx_api_1.Void);
|
|
889
|
+
}
|
|
890
|
+
async addResource(inputs, ctx) {
|
|
891
|
+
return this._addResource(inputs, ctx);
|
|
892
|
+
}
|
|
893
|
+
async _addResource(inputs, ctx) {
|
|
894
|
+
if (ctx && ctx.solutionV3 && ctx.contextV2) {
|
|
895
|
+
return await ctx.solutionV3.addResource(ctx.contextV2, inputs);
|
|
896
|
+
}
|
|
897
|
+
return teamsfx_api_1.ok(teamsfx_api_1.Void);
|
|
849
898
|
}
|
|
850
899
|
}
|
|
851
900
|
tslib_1.__decorate([
|
|
@@ -860,7 +909,20 @@ tslib_1.__decorate([
|
|
|
860
909
|
tslib_1.__metadata("design:type", Function),
|
|
861
910
|
tslib_1.__metadata("design:paramtypes", [Object, Object]),
|
|
862
911
|
tslib_1.__metadata("design:returntype", Promise)
|
|
863
|
-
], FxCore.prototype, "
|
|
912
|
+
], FxCore.prototype, "createProjectV2", null);
|
|
913
|
+
tslib_1.__decorate([
|
|
914
|
+
hooks_1.hooks([
|
|
915
|
+
errorHandler_1.ErrorHandlerMW,
|
|
916
|
+
supportV1ConditionHandler_1.SupportV1ConditionMW(true),
|
|
917
|
+
questionModel_1.QuestionModelMW,
|
|
918
|
+
contextInjector_1.ContextInjectorMW,
|
|
919
|
+
projectSettingsWriter_1.ProjectSettingsWriterMW,
|
|
920
|
+
envInfoWriterV3_1.EnvInfoWriterMW_V3(true),
|
|
921
|
+
]),
|
|
922
|
+
tslib_1.__metadata("design:type", Function),
|
|
923
|
+
tslib_1.__metadata("design:paramtypes", [Object, Object]),
|
|
924
|
+
tslib_1.__metadata("design:returntype", Promise)
|
|
925
|
+
], FxCore.prototype, "createProjectV3", null);
|
|
864
926
|
tslib_1.__decorate([
|
|
865
927
|
hooks_1.hooks([
|
|
866
928
|
errorHandler_1.ErrorHandlerMW,
|
|
@@ -883,7 +945,7 @@ tslib_1.__decorate([
|
|
|
883
945
|
projectMigrator_1.ProjectMigratorMW,
|
|
884
946
|
projectSettingsLoader_1.ProjectSettingsLoaderMW,
|
|
885
947
|
envInfoLoader_1.EnvInfoLoaderMW(false),
|
|
886
|
-
solutionLoader_1.SolutionLoaderMW
|
|
948
|
+
solutionLoader_1.SolutionLoaderMW,
|
|
887
949
|
questionModel_1.QuestionModelMW,
|
|
888
950
|
contextInjector_1.ContextInjectorMW,
|
|
889
951
|
projectSettingsWriter_1.ProjectSettingsWriterMW,
|
|
@@ -892,7 +954,25 @@ tslib_1.__decorate([
|
|
|
892
954
|
tslib_1.__metadata("design:type", Function),
|
|
893
955
|
tslib_1.__metadata("design:paramtypes", [Object, Object]),
|
|
894
956
|
tslib_1.__metadata("design:returntype", Promise)
|
|
895
|
-
], FxCore.prototype, "
|
|
957
|
+
], FxCore.prototype, "provisionResourcesV2", null);
|
|
958
|
+
tslib_1.__decorate([
|
|
959
|
+
hooks_1.hooks([
|
|
960
|
+
errorHandler_1.ErrorHandlerMW,
|
|
961
|
+
concurrentLocker_1.ConcurrentLockerMW,
|
|
962
|
+
supportV1ConditionHandler_1.SupportV1ConditionMW(false),
|
|
963
|
+
projectMigrator_1.ProjectMigratorMW,
|
|
964
|
+
projectSettingsLoaderV3_1.ProjectSettingsLoaderMW_V3,
|
|
965
|
+
envInfoLoaderV3_1.EnvInfoLoaderMW_V3(false),
|
|
966
|
+
solutionLoaderV3_1.SolutionLoaderMW_V3,
|
|
967
|
+
questionModel_1.QuestionModelMW,
|
|
968
|
+
contextInjector_1.ContextInjectorMW,
|
|
969
|
+
projectSettingsWriter_1.ProjectSettingsWriterMW,
|
|
970
|
+
envInfoWriterV3_1.EnvInfoWriterMW_V3(),
|
|
971
|
+
]),
|
|
972
|
+
tslib_1.__metadata("design:type", Function),
|
|
973
|
+
tslib_1.__metadata("design:paramtypes", [Object, Object]),
|
|
974
|
+
tslib_1.__metadata("design:returntype", Promise)
|
|
975
|
+
], FxCore.prototype, "provisionResourcesV3", null);
|
|
896
976
|
tslib_1.__decorate([
|
|
897
977
|
hooks_1.hooks([
|
|
898
978
|
errorHandler_1.ErrorHandlerMW,
|
|
@@ -901,7 +981,7 @@ tslib_1.__decorate([
|
|
|
901
981
|
projectMigrator_1.ProjectMigratorMW,
|
|
902
982
|
projectSettingsLoader_1.ProjectSettingsLoaderMW,
|
|
903
983
|
envInfoLoader_1.EnvInfoLoaderMW(false),
|
|
904
|
-
solutionLoader_1.SolutionLoaderMW
|
|
984
|
+
solutionLoader_1.SolutionLoaderMW,
|
|
905
985
|
questionModel_1.QuestionModelMW,
|
|
906
986
|
contextInjector_1.ContextInjectorMW,
|
|
907
987
|
projectSettingsWriter_1.ProjectSettingsWriterMW,
|
|
@@ -910,7 +990,25 @@ tslib_1.__decorate([
|
|
|
910
990
|
tslib_1.__metadata("design:type", Function),
|
|
911
991
|
tslib_1.__metadata("design:paramtypes", [Object, Object]),
|
|
912
992
|
tslib_1.__metadata("design:returntype", Promise)
|
|
913
|
-
], FxCore.prototype, "
|
|
993
|
+
], FxCore.prototype, "deployArtifactsV2", null);
|
|
994
|
+
tslib_1.__decorate([
|
|
995
|
+
hooks_1.hooks([
|
|
996
|
+
errorHandler_1.ErrorHandlerMW,
|
|
997
|
+
concurrentLocker_1.ConcurrentLockerMW,
|
|
998
|
+
supportV1ConditionHandler_1.SupportV1ConditionMW(false),
|
|
999
|
+
projectMigrator_1.ProjectMigratorMW,
|
|
1000
|
+
projectSettingsLoaderV3_1.ProjectSettingsLoaderMW_V3,
|
|
1001
|
+
envInfoLoaderV3_1.EnvInfoLoaderMW_V3(false),
|
|
1002
|
+
solutionLoaderV3_1.SolutionLoaderMW_V3,
|
|
1003
|
+
questionModel_1.QuestionModelMW,
|
|
1004
|
+
contextInjector_1.ContextInjectorMW,
|
|
1005
|
+
projectSettingsWriter_1.ProjectSettingsWriterMW,
|
|
1006
|
+
envInfoWriterV3_1.EnvInfoWriterMW_V3(),
|
|
1007
|
+
]),
|
|
1008
|
+
tslib_1.__metadata("design:type", Function),
|
|
1009
|
+
tslib_1.__metadata("design:paramtypes", [Object, Object]),
|
|
1010
|
+
tslib_1.__metadata("design:returntype", Promise)
|
|
1011
|
+
], FxCore.prototype, "deployArtifactsV3", null);
|
|
914
1012
|
tslib_1.__decorate([
|
|
915
1013
|
hooks_1.hooks([
|
|
916
1014
|
errorHandler_1.ErrorHandlerMW,
|
|
@@ -921,7 +1019,7 @@ tslib_1.__decorate([
|
|
|
921
1019
|
projectSettingsLoader_1.ProjectSettingsLoaderMW,
|
|
922
1020
|
envInfoLoader_1.EnvInfoLoaderMW(true),
|
|
923
1021
|
localSettingsLoader_1.LocalSettingsLoaderMW,
|
|
924
|
-
solutionLoader_1.SolutionLoaderMW
|
|
1022
|
+
solutionLoader_1.SolutionLoaderMW,
|
|
925
1023
|
questionModel_1.QuestionModelMW,
|
|
926
1024
|
contextInjector_1.ContextInjectorMW,
|
|
927
1025
|
projectSettingsWriter_1.ProjectSettingsWriterMW,
|
|
@@ -931,7 +1029,26 @@ tslib_1.__decorate([
|
|
|
931
1029
|
tslib_1.__metadata("design:type", Function),
|
|
932
1030
|
tslib_1.__metadata("design:paramtypes", [Object, Object]),
|
|
933
1031
|
tslib_1.__metadata("design:returntype", Promise)
|
|
934
|
-
], FxCore.prototype, "
|
|
1032
|
+
], FxCore.prototype, "localDebugV2", null);
|
|
1033
|
+
tslib_1.__decorate([
|
|
1034
|
+
hooks_1.hooks([
|
|
1035
|
+
errorHandler_1.ErrorHandlerMW,
|
|
1036
|
+
concurrentLocker_1.ConcurrentLockerMW,
|
|
1037
|
+
supportV1ConditionHandler_1.SupportV1ConditionMW(true),
|
|
1038
|
+
projectMigrator_1.ProjectMigratorMW,
|
|
1039
|
+
projectUpgrader_1.ProjectUpgraderMW,
|
|
1040
|
+
projectSettingsLoaderV3_1.ProjectSettingsLoaderMW_V3,
|
|
1041
|
+
localSettingsLoader_1.LocalSettingsLoaderMW,
|
|
1042
|
+
solutionLoaderV3_1.SolutionLoaderMW_V3,
|
|
1043
|
+
questionModel_1.QuestionModelMW,
|
|
1044
|
+
contextInjector_1.ContextInjectorMW,
|
|
1045
|
+
projectSettingsWriter_1.ProjectSettingsWriterMW,
|
|
1046
|
+
localSettingsWriter_1.LocalSettingsWriterMW,
|
|
1047
|
+
]),
|
|
1048
|
+
tslib_1.__metadata("design:type", Function),
|
|
1049
|
+
tslib_1.__metadata("design:paramtypes", [Object, Object]),
|
|
1050
|
+
tslib_1.__metadata("design:returntype", Promise)
|
|
1051
|
+
], FxCore.prototype, "localDebugV3", null);
|
|
935
1052
|
tslib_1.__decorate([
|
|
936
1053
|
hooks_1.hooks([
|
|
937
1054
|
errorHandler_1.ErrorHandlerMW,
|
|
@@ -940,7 +1057,7 @@ tslib_1.__decorate([
|
|
|
940
1057
|
projectMigrator_1.ProjectMigratorMW,
|
|
941
1058
|
projectSettingsLoader_1.ProjectSettingsLoaderMW,
|
|
942
1059
|
envInfoLoader_1.EnvInfoLoaderMW(false),
|
|
943
|
-
solutionLoader_1.SolutionLoaderMW
|
|
1060
|
+
solutionLoader_1.SolutionLoaderMW,
|
|
944
1061
|
questionModel_1.QuestionModelMW,
|
|
945
1062
|
contextInjector_1.ContextInjectorMW,
|
|
946
1063
|
projectSettingsWriter_1.ProjectSettingsWriterMW,
|
|
@@ -949,7 +1066,25 @@ tslib_1.__decorate([
|
|
|
949
1066
|
tslib_1.__metadata("design:type", Function),
|
|
950
1067
|
tslib_1.__metadata("design:paramtypes", [Object, Object]),
|
|
951
1068
|
tslib_1.__metadata("design:returntype", Promise)
|
|
952
|
-
], FxCore.prototype, "
|
|
1069
|
+
], FxCore.prototype, "publishApplicationV2", null);
|
|
1070
|
+
tslib_1.__decorate([
|
|
1071
|
+
hooks_1.hooks([
|
|
1072
|
+
errorHandler_1.ErrorHandlerMW,
|
|
1073
|
+
concurrentLocker_1.ConcurrentLockerMW,
|
|
1074
|
+
supportV1ConditionHandler_1.SupportV1ConditionMW(false),
|
|
1075
|
+
projectMigrator_1.ProjectMigratorMW,
|
|
1076
|
+
projectSettingsLoader_1.ProjectSettingsLoaderMW,
|
|
1077
|
+
envInfoLoader_1.EnvInfoLoaderMW(false),
|
|
1078
|
+
solutionLoader_1.SolutionLoaderMW,
|
|
1079
|
+
questionModel_1.QuestionModelMW,
|
|
1080
|
+
contextInjector_1.ContextInjectorMW,
|
|
1081
|
+
projectSettingsWriter_1.ProjectSettingsWriterMW,
|
|
1082
|
+
envInfoWriter_1.EnvInfoWriterMW(),
|
|
1083
|
+
]),
|
|
1084
|
+
tslib_1.__metadata("design:type", Function),
|
|
1085
|
+
tslib_1.__metadata("design:paramtypes", [Object, Object]),
|
|
1086
|
+
tslib_1.__metadata("design:returntype", Promise)
|
|
1087
|
+
], FxCore.prototype, "publishApplicationV3", null);
|
|
953
1088
|
tslib_1.__decorate([
|
|
954
1089
|
hooks_1.hooks([
|
|
955
1090
|
errorHandler_1.ErrorHandlerMW,
|
|
@@ -959,7 +1094,7 @@ tslib_1.__decorate([
|
|
|
959
1094
|
projectSettingsLoader_1.ProjectSettingsLoaderMW,
|
|
960
1095
|
envInfoLoader_1.EnvInfoLoaderMW(false),
|
|
961
1096
|
localSettingsLoader_1.LocalSettingsLoaderMW,
|
|
962
|
-
solutionLoader_1.SolutionLoaderMW
|
|
1097
|
+
solutionLoader_1.SolutionLoaderMW,
|
|
963
1098
|
questionModel_1.QuestionModelMW,
|
|
964
1099
|
contextInjector_1.ContextInjectorMW,
|
|
965
1100
|
projectSettingsWriter_1.ProjectSettingsWriterMW,
|
|
@@ -976,7 +1111,7 @@ tslib_1.__decorate([
|
|
|
976
1111
|
supportV1ConditionHandler_1.SupportV1ConditionMW(true),
|
|
977
1112
|
projectSettingsLoader_1.ProjectSettingsLoaderMW,
|
|
978
1113
|
envInfoLoader_1.EnvInfoLoaderMW(true),
|
|
979
|
-
solutionLoader_1.SolutionLoaderMW
|
|
1114
|
+
solutionLoader_1.SolutionLoaderMW,
|
|
980
1115
|
contextInjector_1.ContextInjectorMW,
|
|
981
1116
|
envInfoWriter_1.EnvInfoWriterMW(),
|
|
982
1117
|
]),
|
|
@@ -991,7 +1126,7 @@ tslib_1.__decorate([
|
|
|
991
1126
|
supportV1ConditionHandler_1.SupportV1ConditionMW(true),
|
|
992
1127
|
projectSettingsLoader_1.ProjectSettingsLoaderMW,
|
|
993
1128
|
envInfoLoader_1.EnvInfoLoaderMW(true),
|
|
994
|
-
solutionLoader_1.SolutionLoaderMW
|
|
1129
|
+
solutionLoader_1.SolutionLoaderMW,
|
|
995
1130
|
contextInjector_1.ContextInjectorMW,
|
|
996
1131
|
envInfoWriter_1.EnvInfoWriterMW(),
|
|
997
1132
|
]),
|
|
@@ -1022,7 +1157,7 @@ tslib_1.__decorate([
|
|
|
1022
1157
|
projectMigrator_1.ProjectMigratorMW,
|
|
1023
1158
|
projectSettingsLoader_1.ProjectSettingsLoaderMW,
|
|
1024
1159
|
envInfoLoader_1.EnvInfoLoaderMW(false),
|
|
1025
|
-
solutionLoader_1.SolutionLoaderMW
|
|
1160
|
+
solutionLoader_1.SolutionLoaderMW,
|
|
1026
1161
|
questionModel_1.QuestionModelMW,
|
|
1027
1162
|
contextInjector_1.ContextInjectorMW,
|
|
1028
1163
|
]),
|
|
@@ -1038,7 +1173,7 @@ tslib_1.__decorate([
|
|
|
1038
1173
|
projectMigrator_1.ProjectMigratorMW,
|
|
1039
1174
|
projectSettingsLoader_1.ProjectSettingsLoaderMW,
|
|
1040
1175
|
envInfoLoader_1.EnvInfoLoaderMW(false),
|
|
1041
|
-
solutionLoader_1.SolutionLoaderMW
|
|
1176
|
+
solutionLoader_1.SolutionLoaderMW,
|
|
1042
1177
|
questionModel_1.QuestionModelMW,
|
|
1043
1178
|
contextInjector_1.ContextInjectorMW,
|
|
1044
1179
|
]),
|
|
@@ -1054,7 +1189,7 @@ tslib_1.__decorate([
|
|
|
1054
1189
|
projectMigrator_1.ProjectMigratorMW,
|
|
1055
1190
|
projectSettingsLoader_1.ProjectSettingsLoaderMW,
|
|
1056
1191
|
envInfoLoader_1.EnvInfoLoaderMW(false),
|
|
1057
|
-
solutionLoader_1.SolutionLoaderMW
|
|
1192
|
+
solutionLoader_1.SolutionLoaderMW,
|
|
1058
1193
|
questionModel_1.QuestionModelMW,
|
|
1059
1194
|
contextInjector_1.ContextInjectorMW,
|
|
1060
1195
|
]),
|
|
@@ -1069,7 +1204,7 @@ tslib_1.__decorate([
|
|
|
1069
1204
|
supportV1ConditionHandler_1.SupportV1ConditionMW(true),
|
|
1070
1205
|
projectSettingsLoader_1.ProjectSettingsLoaderMW,
|
|
1071
1206
|
envInfoLoader_1.EnvInfoLoaderMW(true),
|
|
1072
|
-
solutionLoader_1.SolutionLoaderMW
|
|
1207
|
+
solutionLoader_1.SolutionLoaderMW,
|
|
1073
1208
|
questionModel_1.QuestionModelMW,
|
|
1074
1209
|
contextInjector_1.ContextInjectorMW,
|
|
1075
1210
|
]),
|
|
@@ -1121,7 +1256,7 @@ tslib_1.__decorate([
|
|
|
1121
1256
|
concurrentLocker_1.ConcurrentLockerMW,
|
|
1122
1257
|
supportV1ConditionHandler_1.SupportV1ConditionMW(false),
|
|
1123
1258
|
projectSettingsLoader_1.ProjectSettingsLoaderMW,
|
|
1124
|
-
solutionLoader_1.SolutionLoaderMW
|
|
1259
|
+
solutionLoader_1.SolutionLoaderMW,
|
|
1125
1260
|
envInfoLoader_1.EnvInfoLoaderMW(true),
|
|
1126
1261
|
contextInjector_1.ContextInjectorMW,
|
|
1127
1262
|
]),
|
|
@@ -1136,7 +1271,7 @@ tslib_1.__decorate([
|
|
|
1136
1271
|
supportV1ConditionHandler_1.SupportV1ConditionMW(true),
|
|
1137
1272
|
projectMigrator_1.ProjectMigratorMW,
|
|
1138
1273
|
projectSettingsLoader_1.ProjectSettingsLoaderMW,
|
|
1139
|
-
solutionLoader_1.SolutionLoaderMW
|
|
1274
|
+
solutionLoader_1.SolutionLoaderMW,
|
|
1140
1275
|
contextInjector_1.ContextInjectorMW,
|
|
1141
1276
|
projectSettingsWriter_1.ProjectSettingsWriterMW,
|
|
1142
1277
|
]),
|
|
@@ -1144,39 +1279,84 @@ tslib_1.__decorate([
|
|
|
1144
1279
|
tslib_1.__metadata("design:paramtypes", [Object, Object]),
|
|
1145
1280
|
tslib_1.__metadata("design:returntype", Promise)
|
|
1146
1281
|
], FxCore.prototype, "activateEnv", null);
|
|
1282
|
+
tslib_1.__decorate([
|
|
1283
|
+
hooks_1.hooks([errorHandler_1.ErrorHandlerMW, questionModel_1.QuestionModelMW, contextInjector_1.ContextInjectorMW, projectSettingsWriter_1.ProjectSettingsWriterMW]),
|
|
1284
|
+
tslib_1.__metadata("design:type", Function),
|
|
1285
|
+
tslib_1.__metadata("design:paramtypes", [Object, Object]),
|
|
1286
|
+
tslib_1.__metadata("design:returntype", Promise)
|
|
1287
|
+
], FxCore.prototype, "init", null);
|
|
1288
|
+
tslib_1.__decorate([
|
|
1289
|
+
hooks_1.hooks([
|
|
1290
|
+
errorHandler_1.ErrorHandlerMW,
|
|
1291
|
+
projectSettingsLoaderV3_1.ProjectSettingsLoaderMW_V3,
|
|
1292
|
+
solutionLoaderV3_1.SolutionLoaderMW_V3,
|
|
1293
|
+
questionModel_1.QuestionModelMW,
|
|
1294
|
+
contextInjector_1.ContextInjectorMW,
|
|
1295
|
+
projectSettingsWriter_1.ProjectSettingsWriterMW,
|
|
1296
|
+
]),
|
|
1297
|
+
tslib_1.__metadata("design:type", Function),
|
|
1298
|
+
tslib_1.__metadata("design:paramtypes", [Object, Object]),
|
|
1299
|
+
tslib_1.__metadata("design:returntype", Promise)
|
|
1300
|
+
], FxCore.prototype, "addModule", null);
|
|
1301
|
+
tslib_1.__decorate([
|
|
1302
|
+
hooks_1.hooks([
|
|
1303
|
+
errorHandler_1.ErrorHandlerMW,
|
|
1304
|
+
projectSettingsLoaderV3_1.ProjectSettingsLoaderMW_V3,
|
|
1305
|
+
solutionLoaderV3_1.SolutionLoaderMW_V3,
|
|
1306
|
+
questionModel_1.QuestionModelMW,
|
|
1307
|
+
contextInjector_1.ContextInjectorMW,
|
|
1308
|
+
projectSettingsWriter_1.ProjectSettingsWriterMW,
|
|
1309
|
+
]),
|
|
1310
|
+
tslib_1.__metadata("design:type", Function),
|
|
1311
|
+
tslib_1.__metadata("design:paramtypes", [Object, Object]),
|
|
1312
|
+
tslib_1.__metadata("design:returntype", Promise)
|
|
1313
|
+
], FxCore.prototype, "scaffold", null);
|
|
1314
|
+
tslib_1.__decorate([
|
|
1315
|
+
hooks_1.hooks([
|
|
1316
|
+
errorHandler_1.ErrorHandlerMW,
|
|
1317
|
+
projectSettingsLoaderV3_1.ProjectSettingsLoaderMW_V3,
|
|
1318
|
+
solutionLoaderV3_1.SolutionLoaderMW_V3,
|
|
1319
|
+
questionModel_1.QuestionModelMW,
|
|
1320
|
+
contextInjector_1.ContextInjectorMW,
|
|
1321
|
+
projectSettingsWriter_1.ProjectSettingsWriterMW,
|
|
1322
|
+
]),
|
|
1323
|
+
tslib_1.__metadata("design:type", Function),
|
|
1324
|
+
tslib_1.__metadata("design:paramtypes", [Object, Object]),
|
|
1325
|
+
tslib_1.__metadata("design:returntype", Promise)
|
|
1326
|
+
], FxCore.prototype, "addResource", null);
|
|
1147
1327
|
exports.FxCore = FxCore;
|
|
1148
1328
|
async function createBasicFolderStructure(inputs) {
|
|
1149
1329
|
if (!inputs.projectPath) {
|
|
1150
1330
|
return teamsfx_api_1.err(new error_1.ObjectIsUndefinedError("projectPath"));
|
|
1151
1331
|
}
|
|
1152
1332
|
try {
|
|
1153
|
-
const appName = inputs[
|
|
1154
|
-
|
|
1155
|
-
|
|
1156
|
-
|
|
1157
|
-
|
|
1158
|
-
|
|
1159
|
-
|
|
1160
|
-
|
|
1161
|
-
|
|
1162
|
-
|
|
1163
|
-
|
|
1164
|
-
|
|
1165
|
-
|
|
1166
|
-
|
|
1167
|
-
|
|
1168
|
-
|
|
1169
|
-
|
|
1170
|
-
|
|
1171
|
-
|
|
1172
|
-
|
|
1173
|
-
|
|
1174
|
-
|
|
1175
|
-
|
|
1176
|
-
|
|
1177
|
-
|
|
1178
|
-
|
|
1179
|
-
|
|
1333
|
+
const appName = inputs[question_2.QuestionAppName.name];
|
|
1334
|
+
if (inputs.platform !== teamsfx_api_1.Platform.VS) {
|
|
1335
|
+
await fs.writeFile(path.join(inputs.projectPath, `package.json`), JSON.stringify({
|
|
1336
|
+
name: appName,
|
|
1337
|
+
version: "0.0.1",
|
|
1338
|
+
description: "",
|
|
1339
|
+
author: "",
|
|
1340
|
+
scripts: {
|
|
1341
|
+
test: 'echo "Error: no test specified" && exit 1',
|
|
1342
|
+
},
|
|
1343
|
+
devDependencies: {
|
|
1344
|
+
"@microsoft/teamsfx-cli": "0.*",
|
|
1345
|
+
},
|
|
1346
|
+
license: "MIT",
|
|
1347
|
+
}, null, 4));
|
|
1348
|
+
}
|
|
1349
|
+
await fs.writeFile(path.join(inputs.projectPath, `.gitignore`), [
|
|
1350
|
+
"node_modules",
|
|
1351
|
+
`.${teamsfx_api_1.ConfigFolderName}/${teamsfx_api_1.InputConfigsFolderName}/${localSettingsProvider_1.localSettingsFileName}`,
|
|
1352
|
+
`.${teamsfx_api_1.ConfigFolderName}/${teamsfx_api_1.StatesFolderName}/*.userdata`,
|
|
1353
|
+
".DS_Store",
|
|
1354
|
+
`${teamsfx_api_1.ArchiveFolderName}`,
|
|
1355
|
+
`${teamsfx_api_1.ArchiveLogFileName}`,
|
|
1356
|
+
".env.teamsfx.local",
|
|
1357
|
+
"subscriptionInfo.json",
|
|
1358
|
+
teamsfx_api_1.BuildFolderName,
|
|
1359
|
+
].join("\n"));
|
|
1180
1360
|
}
|
|
1181
1361
|
catch (e) {
|
|
1182
1362
|
return teamsfx_api_1.err(error_1.WriteFileError(e));
|
|
@@ -1184,70 +1364,6 @@ async function createBasicFolderStructure(inputs) {
|
|
|
1184
1364
|
return teamsfx_api_1.ok(null);
|
|
1185
1365
|
}
|
|
1186
1366
|
exports.createBasicFolderStructure = createBasicFolderStructure;
|
|
1187
|
-
async function downloadSample(fxCore, inputs, ctx) {
|
|
1188
|
-
let fxError;
|
|
1189
|
-
const progress = fxCore.tools.ui.createProgressBar("Fetch sample app", 3);
|
|
1190
|
-
progress.start();
|
|
1191
|
-
const telemetryProperties = {
|
|
1192
|
-
[telemetry_1.TelemetryProperty.Success]: telemetry_1.TelemetrySuccess.Yes,
|
|
1193
|
-
module: "fx-core",
|
|
1194
|
-
};
|
|
1195
|
-
try {
|
|
1196
|
-
let folder = inputs[question_1.QuestionRootFolder.name];
|
|
1197
|
-
if (inputs.platform === teamsfx_api_1.Platform.VSCode) {
|
|
1198
|
-
folder = tools_1.getRootDirectory();
|
|
1199
|
-
await fs.ensureDir(folder);
|
|
1200
|
-
}
|
|
1201
|
-
const sampleId = inputs[question_1.CoreQuestionNames.Samples];
|
|
1202
|
-
if (!(sampleId && folder)) {
|
|
1203
|
-
throw error_1.InvalidInputError(`invalid answer for '${question_1.CoreQuestionNames.Samples}'`, inputs);
|
|
1204
|
-
}
|
|
1205
|
-
telemetryProperties[telemetry_1.TelemetryProperty.SampleAppName] = sampleId;
|
|
1206
|
-
const samples = __1.sampleProvider.SampleCollection.samples.filter((sample) => sample.id.toLowerCase() === sampleId.toLowerCase());
|
|
1207
|
-
if (samples.length === 0) {
|
|
1208
|
-
throw error_1.InvalidInputError(`invalid sample id: '${sampleId}'`, inputs);
|
|
1209
|
-
}
|
|
1210
|
-
const sample = samples[0];
|
|
1211
|
-
const url = sample.link;
|
|
1212
|
-
let sampleAppPath = path.resolve(folder, sampleId);
|
|
1213
|
-
if ((await fs.pathExists(sampleAppPath)) && (await fs.readdir(sampleAppPath)).length > 0) {
|
|
1214
|
-
let suffix = 1;
|
|
1215
|
-
while (await fs.pathExists(sampleAppPath)) {
|
|
1216
|
-
sampleAppPath = `${folder}/${sampleId}_${suffix++}`;
|
|
1217
|
-
}
|
|
1218
|
-
}
|
|
1219
|
-
progress.next(`Downloading from ${url}`);
|
|
1220
|
-
const fetchRes = await tools_1.fetchCodeZip(url);
|
|
1221
|
-
if (fetchRes === undefined) {
|
|
1222
|
-
throw new teamsfx_api_1.SystemError("FetchSampleError", "Fetch sample app error: empty zip file", error_1.CoreSource);
|
|
1223
|
-
}
|
|
1224
|
-
progress.next("Unzipping the sample package");
|
|
1225
|
-
await tools_1.saveFilesRecursively(new adm_zip_1.default(fetchRes.data), sampleId, sampleAppPath);
|
|
1226
|
-
await tools_1.downloadSampleHook(sampleId, sampleAppPath);
|
|
1227
|
-
progress.next("Update project settings");
|
|
1228
|
-
const loadInputs = Object.assign(Object.assign({}, inputs), { projectPath: sampleAppPath });
|
|
1229
|
-
const projectSettingsRes = await projectSettingsLoader_1.loadProjectSettings(loadInputs, tools_1.isMultiEnvEnabled());
|
|
1230
|
-
if (projectSettingsRes.isOk()) {
|
|
1231
|
-
const projectSettings = projectSettingsRes.value;
|
|
1232
|
-
projectSettings.projectId = inputs.projectId ? inputs.projectId : uuid.v4();
|
|
1233
|
-
inputs.projectId = projectSettings.projectId;
|
|
1234
|
-
telemetryProperties[telemetry_1.TelemetryProperty.ProjectId] = projectSettings.projectId;
|
|
1235
|
-
ctx.projectSettings = projectSettings;
|
|
1236
|
-
inputs.projectPath = sampleAppPath;
|
|
1237
|
-
}
|
|
1238
|
-
progress.end(true);
|
|
1239
|
-
telemetry_1.sendTelemetryEvent(telemetry_1.Component.core, telemetry_1.TelemetryEvent.DownloadSample, telemetryProperties);
|
|
1240
|
-
return teamsfx_api_1.ok(sampleAppPath);
|
|
1241
|
-
}
|
|
1242
|
-
catch (e) {
|
|
1243
|
-
fxError = teamsfx_api_1.assembleError(e);
|
|
1244
|
-
progress.end(false);
|
|
1245
|
-
telemetryProperties[telemetry_1.TelemetryProperty.Success] = telemetry_1.TelemetrySuccess.No;
|
|
1246
|
-
telemetry_1.sendTelemetryErrorEvent(telemetry_1.Component.core, telemetry_1.TelemetryEvent.DownloadSample, fxError, telemetryProperties);
|
|
1247
|
-
return teamsfx_api_1.err(fxError);
|
|
1248
|
-
}
|
|
1249
|
-
}
|
|
1250
|
-
exports.downloadSample = downloadSample;
|
|
1251
1367
|
function newProjectSettings() {
|
|
1252
1368
|
const projectSettings = {
|
|
1253
1369
|
appName: "",
|
|
@@ -1260,13 +1376,13 @@ function newProjectSettings() {
|
|
|
1260
1376
|
return projectSettings;
|
|
1261
1377
|
}
|
|
1262
1378
|
exports.newProjectSettings = newProjectSettings;
|
|
1263
|
-
function createV2Context(
|
|
1379
|
+
function createV2Context(projectSettings) {
|
|
1264
1380
|
const context = {
|
|
1265
|
-
userInteraction:
|
|
1266
|
-
logProvider:
|
|
1267
|
-
telemetryReporter:
|
|
1381
|
+
userInteraction: exports.TOOLS.ui,
|
|
1382
|
+
logProvider: exports.TOOLS.logProvider,
|
|
1383
|
+
telemetryReporter: exports.TOOLS.telemetryReporter,
|
|
1268
1384
|
cryptoProvider: new crypto_1.LocalCrypto(projectSettings.projectId),
|
|
1269
|
-
permissionRequestProvider:
|
|
1385
|
+
permissionRequestProvider: exports.TOOLS.permissionRequest,
|
|
1270
1386
|
projectSetting: projectSettings,
|
|
1271
1387
|
};
|
|
1272
1388
|
return context;
|
|
@@ -1282,12 +1398,10 @@ function undefinedName(objs, names) {
|
|
|
1282
1398
|
}
|
|
1283
1399
|
exports.undefinedName = undefinedName;
|
|
1284
1400
|
function getProjectSettingsVersion() {
|
|
1285
|
-
|
|
1286
|
-
return "2.0.0";
|
|
1287
|
-
else
|
|
1288
|
-
return "1.0.0";
|
|
1401
|
+
return "2.0.0";
|
|
1289
1402
|
}
|
|
1290
1403
|
exports.getProjectSettingsVersion = getProjectSettingsVersion;
|
|
1291
1404
|
tslib_1.__exportStar(require("./error"), exports);
|
|
1292
1405
|
tslib_1.__exportStar(require("./tools"), exports);
|
|
1406
|
+
tslib_1.__exportStar(require("./downloadSample"), exports);
|
|
1293
1407
|
//# sourceMappingURL=index.js.map
|