@microsoft/teamsfx-core 2.0.0 → 2.0.1-alpha.6f92bb6f7.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 +0 -5
- package/build/common/armInterface.d.ts.map +1 -1
- package/build/common/deps-checker/checkerFactory.d.ts.map +1 -1
- package/build/common/deps-checker/checkerFactory.js +0 -7
- package/build/common/deps-checker/checkerFactory.js.map +1 -1
- package/build/common/deps-checker/constant/helpLink.d.ts +0 -4
- package/build/common/deps-checker/constant/helpLink.d.ts.map +1 -1
- package/build/common/deps-checker/constant/helpLink.js +1 -9
- package/build/common/deps-checker/constant/helpLink.js.map +1 -1
- package/build/common/deps-checker/constant/message.d.ts +0 -5
- package/build/common/deps-checker/constant/message.d.ts.map +1 -1
- package/build/common/deps-checker/constant/message.js +0 -6
- package/build/common/deps-checker/constant/message.js.map +1 -1
- package/build/common/deps-checker/constant/telemetry.d.ts +2 -33
- package/build/common/deps-checker/constant/telemetry.d.ts.map +1 -1
- package/build/common/deps-checker/constant/telemetry.js +0 -31
- package/build/common/deps-checker/constant/telemetry.js.map +1 -1
- package/build/common/deps-checker/depsChecker.d.ts +0 -3
- package/build/common/deps-checker/depsChecker.d.ts.map +1 -1
- package/build/common/deps-checker/depsChecker.js +0 -3
- package/build/common/deps-checker/depsChecker.js.map +1 -1
- package/build/common/deps-checker/depsError.d.ts +0 -9
- package/build/common/deps-checker/depsError.d.ts.map +1 -1
- package/build/common/deps-checker/depsError.js +1 -22
- package/build/common/deps-checker/depsError.js.map +1 -1
- package/build/common/deps-checker/depsManager.d.ts.map +1 -1
- package/build/common/deps-checker/depsManager.js +0 -3
- package/build/common/deps-checker/depsManager.js.map +1 -1
- package/build/common/deps-checker/internal/funcToolChecker.d.ts +2 -2
- package/build/common/deps-checker/internal/funcToolChecker.d.ts.map +1 -1
- package/build/common/deps-checker/internal/funcToolChecker.js +4 -2
- package/build/common/deps-checker/internal/funcToolChecker.js.map +1 -1
- package/build/common/deps-checker/internal/nodeChecker.d.ts +0 -20
- package/build/common/deps-checker/internal/nodeChecker.d.ts.map +1 -1
- package/build/common/deps-checker/internal/nodeChecker.js +1 -51
- package/build/common/deps-checker/internal/nodeChecker.js.map +1 -1
- package/build/common/local/localEnvManager.d.ts +0 -9
- package/build/common/local/localEnvManager.d.ts.map +1 -1
- package/build/common/local/localEnvManager.js +0 -59
- package/build/common/local/localEnvManager.js.map +1 -1
- package/build/common/projectSettingsHelper.d.ts +1 -7
- package/build/common/projectSettingsHelper.d.ts.map +1 -1
- package/build/common/projectSettingsHelper.js +5 -81
- package/build/common/projectSettingsHelper.js.map +1 -1
- package/build/common/projectSettingsHelperV3.d.ts +0 -1
- package/build/common/projectSettingsHelperV3.d.ts.map +1 -1
- package/build/common/projectSettingsHelperV3.js +1 -10
- package/build/common/projectSettingsHelperV3.js.map +1 -1
- package/build/common/samples.d.ts.map +1 -1
- package/build/common/samples.js +18 -40
- package/build/common/samples.js.map +1 -1
- package/build/common/templates-config.json +2 -2
- package/build/common/tools.d.ts +1 -2
- package/build/common/tools.d.ts.map +1 -1
- package/build/common/tools.js +5 -70
- package/build/common/tools.js.map +1 -1
- package/build/component/code/utils.d.ts +1 -8
- package/build/component/code/utils.d.ts.map +1 -1
- package/build/component/code/utils.js +5 -144
- package/build/component/code/utils.js.map +1 -1
- package/build/component/constants.d.ts +3 -0
- package/build/component/constants.d.ts.map +1 -1
- package/build/component/constants.js +13 -2
- package/build/component/constants.js.map +1 -1
- package/build/component/coordinator/index.d.ts +7 -7
- package/build/component/coordinator/index.d.ts.map +1 -1
- package/build/component/coordinator/index.js +15 -179
- package/build/component/coordinator/index.js.map +1 -1
- package/build/component/debug/error.d.ts +0 -1
- package/build/component/debug/error.d.ts.map +1 -1
- package/build/component/debug/error.js +1 -11
- package/build/component/debug/error.js.map +1 -1
- package/build/component/debug/index.d.ts.map +1 -1
- package/build/component/debug/index.js +1 -25
- package/build/component/debug/index.js.map +1 -1
- package/build/component/driver/aad/create.d.ts.map +1 -1
- package/build/component/driver/aad/create.js +2 -2
- package/build/component/driver/aad/create.js.map +1 -1
- package/build/component/driver/aad/update.d.ts.map +1 -1
- package/build/component/driver/aad/update.js +6 -20
- package/build/component/driver/aad/update.js.map +1 -1
- package/build/component/driver/botAadApp/create.d.ts.map +1 -1
- package/build/component/driver/botAadApp/create.js +2 -2
- package/build/component/driver/botAadApp/create.js.map +1 -1
- package/build/component/driver/devTool/error/dotnetInstallationUserError.d.ts +1 -1
- package/build/component/driver/devTool/error/dotnetInstallationUserError.d.ts.map +1 -1
- package/build/component/driver/devTool/error/dotnetInstallationUserError.js +4 -2
- package/build/component/driver/devTool/error/dotnetInstallationUserError.js.map +1 -1
- package/build/component/driver/devTool/error/funcInstallationUserError.d.ts +1 -1
- package/build/component/driver/devTool/error/funcInstallationUserError.d.ts.map +1 -1
- package/build/component/driver/devTool/error/funcInstallationUserError.js +4 -2
- package/build/component/driver/devTool/error/funcInstallationUserError.js.map +1 -1
- package/build/component/driver/devTool/installDriver.d.ts +1 -0
- package/build/component/driver/devTool/installDriver.d.ts.map +1 -1
- package/build/component/driver/devTool/installDriver.js +17 -24
- package/build/component/driver/devTool/installDriver.js.map +1 -1
- package/build/component/driver/script/baseBuildDriver.d.ts.map +1 -1
- package/build/component/driver/script/baseBuildDriver.js +2 -2
- package/build/component/driver/script/baseBuildDriver.js.map +1 -1
- package/build/component/driver/script/scriptDriver.d.ts +11 -1
- package/build/component/driver/script/scriptDriver.d.ts.map +1 -1
- package/build/component/driver/script/scriptDriver.js +121 -4
- package/build/component/driver/script/scriptDriver.js.map +1 -1
- package/build/component/driver/teamsApp/createAppPackage.d.ts +0 -1
- package/build/component/driver/teamsApp/createAppPackage.d.ts.map +1 -1
- package/build/component/driver/teamsApp/createAppPackage.js +1 -11
- package/build/component/driver/teamsApp/createAppPackage.js.map +1 -1
- package/build/component/driver/teamsApp/validate.d.ts +0 -1
- package/build/component/driver/teamsApp/validate.d.ts.map +1 -1
- package/build/component/driver/teamsApp/validate.js +34 -18
- package/build/component/driver/teamsApp/validate.js.map +1 -1
- package/build/component/feature/bot/question.d.ts.map +1 -1
- package/build/component/feature/bot/question.js +7 -16
- package/build/component/feature/bot/question.js.map +1 -1
- package/build/component/feature/sso.d.ts +0 -4
- package/build/component/feature/sso.d.ts.map +1 -1
- package/build/component/feature/sso.js +10 -144
- package/build/component/feature/sso.js.map +1 -1
- package/build/component/question.d.ts +3 -64
- package/build/component/question.d.ts.map +1 -1
- package/build/component/question.js +61 -663
- package/build/component/question.js.map +1 -1
- package/build/component/registerService.d.ts +0 -14
- package/build/component/registerService.d.ts.map +1 -1
- package/build/component/registerService.js +0 -14
- package/build/component/registerService.js.map +1 -1
- package/build/component/resource/aadApp/aadApp.d.ts.map +1 -1
- package/build/component/resource/aadApp/aadApp.js +6 -24
- package/build/component/resource/aadApp/aadApp.js.map +1 -1
- package/build/component/resource/appManifest/appStudio.js +1 -1
- package/build/component/resource/appManifest/appStudio.js.map +1 -1
- package/build/component/resource/appManifest/utils/ManifestUtils.d.ts +1 -1
- package/build/component/resource/appManifest/utils/ManifestUtils.d.ts.map +1 -1
- package/build/component/resource/appManifest/utils/ManifestUtils.js +1 -9
- package/build/component/resource/appManifest/utils/ManifestUtils.js.map +1 -1
- package/build/component/resource/spfx/utils/questions.d.ts.map +1 -1
- package/build/component/resource/spfx/utils/questions.js +1 -4
- package/build/component/resource/spfx/utils/questions.js.map +1 -1
- package/build/component/utils/backupFiles.d.ts +2 -1
- package/build/component/utils/backupFiles.d.ts.map +1 -1
- package/build/component/utils/backupFiles.js +23 -3
- package/build/component/utils/backupFiles.js.map +1 -1
- package/build/component/utils/charsetUtils.d.ts +3 -0
- package/build/component/utils/charsetUtils.d.ts.map +1 -0
- package/build/component/utils/charsetUtils.js +241 -0
- package/build/component/utils/charsetUtils.js.map +1 -0
- package/build/component/utils/envUtil.d.ts.map +1 -1
- package/build/component/utils/envUtil.js +4 -1
- package/build/component/utils/envUtil.js.map +1 -1
- package/build/component/utils/metadataUtil.d.ts.map +1 -1
- package/build/component/utils/metadataUtil.js +9 -7
- package/build/component/utils/metadataUtil.js.map +1 -1
- package/build/component/utils/pathUtils.d.ts.map +1 -1
- package/build/component/utils/pathUtils.js +8 -7
- package/build/component/utils/pathUtils.js.map +1 -1
- package/build/component/utils/settingsUtil.js +3 -3
- package/build/component/utils/settingsUtil.js.map +1 -1
- package/build/component/utils.d.ts +1 -12
- package/build/component/utils.d.ts.map +1 -1
- package/build/component/utils.js +2 -225
- package/build/component/utils.js.map +1 -1
- package/build/component/workflow.d.ts +0 -1
- package/build/component/workflow.d.ts.map +1 -1
- package/build/component/workflow.js +1 -687
- package/build/component/workflow.js.map +1 -1
- package/build/core/FxCore.d.ts +26 -34
- package/build/core/FxCore.d.ts.map +1 -1
- package/build/core/FxCore.js +86 -654
- package/build/core/FxCore.js.map +1 -1
- package/build/core/FxCoreImplementV3.d.ts +15 -9
- package/build/core/FxCoreImplementV3.d.ts.map +1 -1
- package/build/core/FxCoreImplementV3.js +105 -105
- package/build/core/FxCoreImplementV3.js.map +1 -1
- package/build/core/middleware/envInfoLoaderV3.d.ts +1 -10
- package/build/core/middleware/envInfoLoaderV3.d.ts.map +1 -1
- package/build/core/middleware/envInfoLoaderV3.js +1 -207
- package/build/core/middleware/envInfoLoaderV3.js.map +1 -1
- package/build/core/middleware/projectMigratorV3.d.ts +1 -0
- package/build/core/middleware/projectMigratorV3.d.ts.map +1 -1
- package/build/core/middleware/projectMigratorV3.js +7 -7
- package/build/core/middleware/projectMigratorV3.js.map +1 -1
- package/build/core/middleware/projectSettingsLoader.d.ts +1 -4
- package/build/core/middleware/projectSettingsLoader.d.ts.map +1 -1
- package/build/core/middleware/projectSettingsLoader.js +4 -58
- package/build/core/middleware/projectSettingsLoader.js.map +1 -1
- package/build/core/middleware/projectVersionChecker.d.ts.map +1 -1
- package/build/core/middleware/projectVersionChecker.js +4 -5
- package/build/core/middleware/projectVersionChecker.js.map +1 -1
- package/build/core/middleware/questionModel.d.ts +0 -1
- package/build/core/middleware/questionModel.d.ts.map +1 -1
- package/build/core/middleware/questionModel.js +8 -54
- package/build/core/middleware/questionModel.js.map +1 -1
- package/build/core/middleware/utils/MigrationUtils.d.ts +0 -5
- package/build/core/middleware/utils/MigrationUtils.d.ts.map +1 -1
- package/build/core/middleware/utils/MigrationUtils.js +1 -77
- package/build/core/middleware/utils/MigrationUtils.js.map +1 -1
- package/build/core/question.d.ts +2 -12
- package/build/core/question.d.ts.map +1 -1
- package/build/core/question.js +14 -236
- package/build/core/question.js.map +1 -1
- package/build/core/types.d.ts +3 -3
- package/build/core/types.d.ts.map +1 -1
- package/build/error/common.d.ts +9 -0
- package/build/error/common.d.ts.map +1 -1
- package/build/error/common.js +39 -1
- package/build/error/common.js.map +1 -1
- package/build/error/script.d.ts +1 -1
- package/build/error/script.d.ts.map +1 -1
- package/build/error/script.js +3 -3
- package/build/error/script.js.map +1 -1
- package/build/index.d.ts +0 -2
- package/build/index.d.ts.map +1 -1
- package/build/index.js +1 -4
- package/build/index.js.map +1 -1
- package/package.json +12 -28
- package/resource/package.nls.json +10 -97
- package/templates/fallback/common.zip +0 -0
- package/templates/fallback/csharp.zip +0 -0
- package/templates/fallback/js.zip +0 -0
- package/templates/fallback/ts.zip +0 -0
- package/build/common/deps-checker/internal/ngrokChecker.d.ts +0 -27
- package/build/common/deps-checker/internal/ngrokChecker.d.ts.map +0 -1
- package/build/common/deps-checker/internal/ngrokChecker.js +0 -222
- package/build/common/deps-checker/internal/ngrokChecker.js.map +0 -1
- package/build/component/connection/apimConfig.d.ts +0 -11
- package/build/component/connection/apimConfig.d.ts.map +0 -1
- package/build/component/connection/apimConfig.js +0 -44
- package/build/component/connection/apimConfig.js.map +0 -1
- package/build/component/connection/azureFunctionConfig.d.ts +0 -9
- package/build/component/connection/azureFunctionConfig.d.ts.map +0 -1
- package/build/component/connection/azureFunctionConfig.js +0 -25
- package/build/component/connection/azureFunctionConfig.js.map +0 -1
- package/build/component/connection/azureResourceConfig.d.ts +0 -11
- package/build/component/connection/azureResourceConfig.d.ts.map +0 -1
- package/build/component/connection/azureResourceConfig.js +0 -72
- package/build/component/connection/azureResourceConfig.js.map +0 -1
- package/build/component/connection/azureWebAppConfig.d.ts +0 -9
- package/build/component/connection/azureWebAppConfig.d.ts.map +0 -1
- package/build/component/connection/azureWebAppConfig.js +0 -25
- package/build/component/connection/azureWebAppConfig.js.map +0 -1
- package/build/component/coordinator/lifecycleStage.d.ts +0 -2
- package/build/component/coordinator/lifecycleStage.d.ts.map +0 -1
- package/build/component/coordinator/lifecycleStage.js +0 -23
- package/build/component/coordinator/lifecycleStage.js.map +0 -1
- package/build/component/core.d.ts +0 -65
- package/build/component/core.d.ts.map +0 -1
- package/build/component/core.js +0 -653
- package/build/component/core.js.map +0 -1
- package/build/component/debug/util/ngrok.d.ts +0 -6
- package/build/component/debug/util/ngrok.d.ts.map +0 -1
- package/build/component/debug/util/ngrok.js +0 -65
- package/build/component/debug/util/ngrok.js.map +0 -1
- package/build/component/feature/api/api.d.ts +0 -8
- package/build/component/feature/api/api.d.ts.map +0 -1
- package/build/component/feature/api/api.js +0 -188
- package/build/component/feature/api/api.js.map +0 -1
- package/build/component/feature/apiconnector/apiConnector.d.ts +0 -11
- package/build/component/feature/apiconnector/apiConnector.d.ts.map +0 -1
- package/build/component/feature/apiconnector/apiConnector.js +0 -43
- package/build/component/feature/apiconnector/apiConnector.js.map +0 -1
- package/build/component/feature/apim.d.ts +0 -8
- package/build/component/feature/apim.d.ts.map +0 -1
- package/build/component/feature/apim.js +0 -123
- package/build/component/feature/apim.js.map +0 -1
- package/build/component/feature/bot/bot.d.ts +0 -12
- package/build/component/feature/bot/bot.d.ts.map +0 -1
- package/build/component/feature/bot/bot.js +0 -309
- package/build/component/feature/bot/bot.js.map +0 -1
- package/build/component/feature/keyVault.d.ts +0 -16
- package/build/component/feature/keyVault.d.ts.map +0 -1
- package/build/component/feature/keyVault.js +0 -90
- package/build/component/feature/keyVault.js.map +0 -1
- package/build/component/feature/spfx.d.ts +0 -9
- package/build/component/feature/spfx.d.ts.map +0 -1
- package/build/component/feature/spfx.js +0 -121
- package/build/component/feature/spfx.js.map +0 -1
- package/build/component/feature/sql.d.ts +0 -10
- package/build/component/feature/sql.d.ts.map +0 -1
- package/build/component/feature/sql.js +0 -80
- package/build/component/feature/sql.js.map +0 -1
- package/build/component/feature/tab.d.ts +0 -10
- package/build/component/feature/tab.d.ts.map +0 -1
- package/build/component/feature/tab.js +0 -238
- package/build/component/feature/tab.js.map +0 -1
- package/build/component/resource/azureSql/actions/configure.d.ts +0 -15
- package/build/component/resource/azureSql/actions/configure.d.ts.map +0 -1
- package/build/component/resource/azureSql/actions/configure.js +0 -92
- package/build/component/resource/azureSql/actions/configure.js.map +0 -1
- package/build/component/resource/azureSql/actions/provision.d.ts +0 -10
- package/build/component/resource/azureSql/actions/provision.d.ts.map +0 -1
- package/build/component/resource/azureSql/actions/provision.js +0 -63
- package/build/component/resource/azureSql/actions/provision.js.map +0 -1
- package/build/component/resource/azureSql/actions/utils.d.ts +0 -12
- package/build/component/resource/azureSql/actions/utils.d.ts.map +0 -1
- package/build/component/resource/azureSql/actions/utils.js +0 -82
- package/build/component/resource/azureSql/actions/utils.js.map +0 -1
- package/build/component/resource/azureSql/azureSql.d.ts +0 -24
- package/build/component/resource/azureSql/azureSql.d.ts.map +0 -1
- package/build/component/resource/azureSql/azureSql.js +0 -75
- package/build/component/resource/azureSql/azureSql.js.map +0 -1
- package/build/component/resource/azureSql/clients/management.d.ts +0 -18
- package/build/component/resource/azureSql/clients/management.d.ts.map +0 -1
- package/build/component/resource/azureSql/clients/management.js +0 -124
- package/build/component/resource/azureSql/clients/management.js.map +0 -1
- package/build/component/resource/azureSql/clients/sql.d.ts +0 -13
- package/build/component/resource/azureSql/clients/sql.d.ts.map +0 -1
- package/build/component/resource/azureSql/clients/sql.js +0 -153
- package/build/component/resource/azureSql/clients/sql.js.map +0 -1
- package/build/component/resource/azureSql/config.d.ts +0 -7
- package/build/component/resource/azureSql/config.d.ts.map +0 -1
- package/build/component/resource/azureSql/config.js +0 -77
- package/build/component/resource/azureSql/config.js.map +0 -1
- package/build/component/resource/azureSql/constants.d.ts +0 -85
- package/build/component/resource/azureSql/constants.d.ts.map +0 -1
- package/build/component/resource/azureSql/constants.js +0 -95
- package/build/component/resource/azureSql/constants.js.map +0 -1
- package/build/component/resource/azureSql/errors.d.ts +0 -63
- package/build/component/resource/azureSql/errors.d.ts.map +0 -1
- package/build/component/resource/azureSql/errors.js +0 -107
- package/build/component/resource/azureSql/errors.js.map +0 -1
- package/build/component/resource/azureSql/index.d.ts +0 -2
- package/build/component/resource/azureSql/index.d.ts.map +0 -1
- package/build/component/resource/azureSql/index.js +0 -7
- package/build/component/resource/azureSql/index.js.map +0 -1
- package/build/component/resource/azureSql/questions.d.ts +0 -6
- package/build/component/resource/azureSql/questions.d.ts.map +0 -1
- package/build/component/resource/azureSql/questions.js +0 -59
- package/build/component/resource/azureSql/questions.js.map +0 -1
- package/build/component/resource/azureSql/results.d.ts +0 -10
- package/build/component/resource/azureSql/results.d.ts.map +0 -1
- package/build/component/resource/azureSql/results.js +0 -34
- package/build/component/resource/azureSql/results.js.map +0 -1
- package/build/component/resource/azureSql/types.d.ts +0 -12
- package/build/component/resource/azureSql/types.d.ts.map +0 -1
- package/build/component/resource/azureSql/types.js +0 -5
- package/build/component/resource/azureSql/types.js.map +0 -1
- package/build/component/resource/azureSql/utils/checkInput.d.ts +0 -10
- package/build/component/resource/azureSql/utils/checkInput.d.ts.map +0 -1
- package/build/component/resource/azureSql/utils/checkInput.js +0 -89
- package/build/component/resource/azureSql/utils/checkInput.js.map +0 -1
- package/build/component/resource/azureSql/utils/common.d.ts +0 -12
- package/build/component/resource/azureSql/utils/common.d.ts.map +0 -1
- package/build/component/resource/azureSql/utils/common.js +0 -51
- package/build/component/resource/azureSql/utils/common.js.map +0 -1
- package/build/component/resource/identity.d.ts +0 -28
- package/build/component/resource/identity.d.ts.map +0 -1
- package/build/component/resource/identity.js +0 -42
- package/build/component/resource/identity.js.map +0 -1
- package/build/component/resource/keyVault.d.ts +0 -29
- package/build/component/resource/keyVault.d.ts.map +0 -1
- package/build/component/resource/keyVault.js +0 -47
- package/build/component/resource/keyVault.js.map +0 -1
- package/build/component/resource/simpleAuth/constants.d.ts +0 -122
- package/build/component/resource/simpleAuth/constants.d.ts.map +0 -1
- package/build/component/resource/simpleAuth/constants.js +0 -163
- package/build/component/resource/simpleAuth/constants.js.map +0 -1
- package/build/component/resource/simpleAuth/errors.d.ts +0 -17
- package/build/component/resource/simpleAuth/errors.d.ts.map +0 -1
- package/build/component/resource/simpleAuth/errors.js +0 -91
- package/build/component/resource/simpleAuth/errors.js.map +0 -1
- package/build/component/resource/simpleAuth/index.d.ts +0 -12
- package/build/component/resource/simpleAuth/index.d.ts.map +0 -1
- package/build/component/resource/simpleAuth/index.js +0 -115
- package/build/component/resource/simpleAuth/index.js.map +0 -1
- package/build/component/resource/simpleAuth/result.d.ts +0 -9
- package/build/component/resource/simpleAuth/result.d.ts.map +0 -1
- package/build/component/resource/simpleAuth/result.js +0 -35
- package/build/component/resource/simpleAuth/result.js.map +0 -1
- package/build/component/resource/simpleAuth/utils/common.d.ts +0 -23
- package/build/component/resource/simpleAuth/utils/common.d.ts.map +0 -1
- package/build/component/resource/simpleAuth/utils/common.js +0 -150
- package/build/component/resource/simpleAuth/utils/common.js.map +0 -1
- package/build/component/resource/simpleAuth/utils/dialog.d.ts +0 -5
- package/build/component/resource/simpleAuth/utils/dialog.d.ts.map +0 -1
- package/build/component/resource/simpleAuth/utils/dialog.js +0 -7
- package/build/component/resource/simpleAuth/utils/dialog.js.map +0 -1
- package/build/component/resource/simpleAuth/utils/telemetry.d.ts +0 -17
- package/build/component/resource/simpleAuth/utils/telemetry.d.ts.map +0 -1
- package/build/component/resource/simpleAuth/utils/telemetry.js +0 -45
- package/build/component/resource/simpleAuth/utils/telemetry.js.map +0 -1
- package/build/core/dependencyChecker.d.ts +0 -1
- package/build/core/dependencyChecker.d.ts.map +0 -1
- package/build/core/dependencyChecker.js +0 -2
- package/build/core/dependencyChecker.js.map +0 -1
- package/build/core/middleware/CommonErrorHandlerMW.d.ts +0 -14
- package/build/core/middleware/CommonErrorHandlerMW.d.ts.map +0 -1
- package/build/core/middleware/CommonErrorHandlerMW.js +0 -63
- package/build/core/middleware/CommonErrorHandlerMW.js.map +0 -1
- package/build/core/middleware/aadManifestMigration.d.ts +0 -3
- package/build/core/middleware/aadManifestMigration.d.ts.map +0 -1
- package/build/core/middleware/aadManifestMigration.js +0 -119
- package/build/core/middleware/aadManifestMigration.js.map +0 -1
- package/build/core/middleware/consolidateLocalRemote.d.ts +0 -5
- package/build/core/middleware/consolidateLocalRemote.d.ts.map +0 -1
- package/build/core/middleware/consolidateLocalRemote.js +0 -378
- package/build/core/middleware/consolidateLocalRemote.js.map +0 -1
- package/build/core/middleware/envInfoWriter.d.ts +0 -8
- package/build/core/middleware/envInfoWriter.d.ts.map +0 -1
- package/build/core/middleware/envInfoWriter.js +0 -76
- package/build/core/middleware/envInfoWriter.js.map +0 -1
- package/build/core/middleware/envInfoWriterV3.d.ts +0 -6
- package/build/core/middleware/envInfoWriterV3.d.ts.map +0 -1
- package/build/core/middleware/envInfoWriterV3.js +0 -67
- package/build/core/middleware/envInfoWriterV3.js.map +0 -1
- package/build/core/middleware/projectMigrator.d.ts +0 -40
- package/build/core/middleware/projectMigrator.d.ts.map +0 -1
- package/build/core/middleware/projectMigrator.js +0 -1014
- package/build/core/middleware/projectMigrator.js.map +0 -1
- package/build/core/middleware/projectSettingsWriter.d.ts +0 -6
- package/build/core/middleware/projectSettingsWriter.d.ts.map +0 -1
- package/build/core/middleware/projectSettingsWriter.js +0 -52
- package/build/core/middleware/projectSettingsWriter.js.map +0 -1
|
@@ -2,617 +2,7 @@
|
|
|
2
2
|
// Copyright (c) Microsoft Corporation.
|
|
3
3
|
// Licensed under the MIT license.
|
|
4
4
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5
|
-
exports.
|
|
6
|
-
// import * as Handlebars from "handlebars";
|
|
7
|
-
// import { Container } from "typedi";
|
|
8
|
-
// import toposort from "toposort";
|
|
9
|
-
// import { assign, cloneDeep, merge } from "lodash";
|
|
10
|
-
// import {
|
|
11
|
-
// fileEffectPlanStrings,
|
|
12
|
-
// persistBicep,
|
|
13
|
-
// persistBicepPlans,
|
|
14
|
-
// serviceEffectPlanString,
|
|
15
|
-
// } from "./utils";
|
|
16
|
-
// import { convertToAlphanumericOnly } from "../common/utils";
|
|
17
|
-
// import { ActionNotExist, ComponentNotExist } from "./error";
|
|
18
|
-
// import { globalVars } from "../core/globalVars";
|
|
19
|
-
// import { TelemetryConstants, Scenarios } from "./constants";
|
|
20
|
-
// export async function getAction(
|
|
21
|
-
// name: string,
|
|
22
|
-
// context: ContextV3,
|
|
23
|
-
// inputs: InputsWithProjectPath,
|
|
24
|
-
// required: boolean
|
|
25
|
-
// ): Promise<Action | undefined> {
|
|
26
|
-
// const arr = name.split(".");
|
|
27
|
-
// if (arr.length !== 2) {
|
|
28
|
-
// throw new ActionNotExist(name);
|
|
29
|
-
// }
|
|
30
|
-
// const componentName = arr[0];
|
|
31
|
-
// const actionName = arr[1];
|
|
32
|
-
// let component;
|
|
33
|
-
// try {
|
|
34
|
-
// component = Container.get(componentName) as any;
|
|
35
|
-
// } catch (e) {
|
|
36
|
-
// if (required) throw new ComponentNotExist(componentName);
|
|
37
|
-
// else return undefined;
|
|
38
|
-
// }
|
|
39
|
-
// if (!component[actionName]) {
|
|
40
|
-
// if (required) {
|
|
41
|
-
// throw new ActionNotExist(name);
|
|
42
|
-
// } else return undefined;
|
|
43
|
-
// }
|
|
44
|
-
// try {
|
|
45
|
-
// const res = await component[actionName](context, inputs);
|
|
46
|
-
// if (res.isOk()) {
|
|
47
|
-
// const action = res.value;
|
|
48
|
-
// return action;
|
|
49
|
-
// } else {
|
|
50
|
-
// throw res.error;
|
|
51
|
-
// }
|
|
52
|
-
// } catch (e) {
|
|
53
|
-
// throw assembleError(e);
|
|
54
|
-
// }
|
|
55
|
-
// }
|
|
56
|
-
// function _resolveVariables(schema: Json) {
|
|
57
|
-
// const variables = new Set<string>();
|
|
58
|
-
// extractVariables(schema, variables);
|
|
59
|
-
// const graph: Array<[string, string | undefined]> = [];
|
|
60
|
-
// for (const variable of variables) {
|
|
61
|
-
// const variableValue = getEmbeddedValueByPath(schema, variable);
|
|
62
|
-
// const dependentVariables = extractVariablesInString(variableValue); // variables's dependent variables
|
|
63
|
-
// if (dependentVariables.size > 0) {
|
|
64
|
-
// for (const dependency of dependentVariables) {
|
|
65
|
-
// graph.push([variable, dependency]);
|
|
66
|
-
// }
|
|
67
|
-
// }
|
|
68
|
-
// }
|
|
69
|
-
// const list = toposort(graph).reverse();
|
|
70
|
-
// for (let i = 1; i < list.length; ++i) {
|
|
71
|
-
// const variable = list[i];
|
|
72
|
-
// const variableValue = getEmbeddedValueByPath(schema, variable);
|
|
73
|
-
// const replacedValue = _replaceVariables(variableValue, schema);
|
|
74
|
-
// setValueByPath(schema, variable, replacedValue);
|
|
75
|
-
// }
|
|
76
|
-
// _replaceVariables(schema, schema);
|
|
77
|
-
// }
|
|
78
|
-
// function _replaceVariables(schema: any, context: Json) {
|
|
79
|
-
// if (typeof schema === "string") {
|
|
80
|
-
// const schemaStr = schema as string;
|
|
81
|
-
// if (schemaStr.includes("{{") && schemaStr.includes("}}")) {
|
|
82
|
-
// const template = Handlebars.compile(schema);
|
|
83
|
-
// const newValue = template(context);
|
|
84
|
-
// return newValue;
|
|
85
|
-
// }
|
|
86
|
-
// return schemaStr;
|
|
87
|
-
// } else if (typeof schema === "object") {
|
|
88
|
-
// for (const key of Object.keys(schema)) {
|
|
89
|
-
// const subSchema = schema[key];
|
|
90
|
-
// schema[key] = _replaceVariables(subSchema, context);
|
|
91
|
-
// }
|
|
92
|
-
// return schema;
|
|
93
|
-
// } else {
|
|
94
|
-
// return schema;
|
|
95
|
-
// }
|
|
96
|
-
// }
|
|
97
|
-
// function extractVariables(obj: any, set: Set<string>) {
|
|
98
|
-
// if (!obj) return;
|
|
99
|
-
// if (typeof obj === "string") {
|
|
100
|
-
// const subSet = extractVariablesInString(obj as string);
|
|
101
|
-
// subSet.forEach((v) => set.add(v));
|
|
102
|
-
// } else if (typeof obj === "object") {
|
|
103
|
-
// for (const key of Object.keys(obj)) {
|
|
104
|
-
// const value = obj[key] as any;
|
|
105
|
-
// extractVariables(value, set);
|
|
106
|
-
// }
|
|
107
|
-
// }
|
|
108
|
-
// }
|
|
109
|
-
// function extractVariablesInString(schema: string): Set<string> {
|
|
110
|
-
// if (!schema) return new Set<string>();
|
|
111
|
-
// let end = 0;
|
|
112
|
-
// let start = schema.indexOf("{{");
|
|
113
|
-
// let name;
|
|
114
|
-
// const set = new Set<string>();
|
|
115
|
-
// while (start >= 0) {
|
|
116
|
-
// end = schema.indexOf("}}", start + 2);
|
|
117
|
-
// name = schema.substring(start + 2, end).trim();
|
|
118
|
-
// if (name) {
|
|
119
|
-
// set.add(name);
|
|
120
|
-
// }
|
|
121
|
-
// start = schema.indexOf("{{", end + 2);
|
|
122
|
-
// }
|
|
123
|
-
// return set;
|
|
124
|
-
// }
|
|
125
|
-
// export function getEmbeddedValueByPath(obj: Json, path: string): any {
|
|
126
|
-
// const array = path.split(".");
|
|
127
|
-
// let subObj = obj;
|
|
128
|
-
// for (let i = 0; i < array.length; ++i) {
|
|
129
|
-
// const key = array[i];
|
|
130
|
-
// subObj = subObj[key];
|
|
131
|
-
// if (!subObj) return undefined;
|
|
132
|
-
// if (i < array.length - 1 && typeof subObj !== "object") return undefined;
|
|
133
|
-
// }
|
|
134
|
-
// return subObj;
|
|
135
|
-
// }
|
|
136
|
-
// function setValueByPath(obj: Json, path: string, value: any) {
|
|
137
|
-
// const array = path.split(".");
|
|
138
|
-
// const mergeObj: any = {};
|
|
139
|
-
// let subObj = mergeObj;
|
|
140
|
-
// for (let i = 0; i < array.length - 1; ++i) {
|
|
141
|
-
// const key = array[i];
|
|
142
|
-
// subObj[key] = {};
|
|
143
|
-
// subObj = subObj[key];
|
|
144
|
-
// }
|
|
145
|
-
// subObj[array[array.length - 1]] = value;
|
|
146
|
-
// merge(obj, mergeObj);
|
|
147
|
-
// }
|
|
148
|
-
// function resolveVariables(params: Json, schema: Json) {
|
|
149
|
-
// merge(params, schema);
|
|
150
|
-
// _resolveVariables(params);
|
|
151
|
-
// }
|
|
152
|
-
// export async function resolveAction(
|
|
153
|
-
// action: Action,
|
|
154
|
-
// context: ContextV3,
|
|
155
|
-
// inputs: InputsWithProjectPath
|
|
156
|
-
// ): Promise<Action> {
|
|
157
|
-
// if (action.type === "call") {
|
|
158
|
-
// if (action.inputs) {
|
|
159
|
-
// resolveVariables(inputs, action.inputs);
|
|
160
|
-
// }
|
|
161
|
-
// const targetAction = await getAction(action.targetAction, context, inputs, action.required);
|
|
162
|
-
// if (targetAction) {
|
|
163
|
-
// if (targetAction.type !== "function") {
|
|
164
|
-
// const resolvedAction = await resolveAction(targetAction, context, inputs);
|
|
165
|
-
// if (action.inputs) {
|
|
166
|
-
// (resolvedAction as any)["inputs"] = action.inputs;
|
|
167
|
-
// }
|
|
168
|
-
// return resolvedAction;
|
|
169
|
-
// }
|
|
170
|
-
// }
|
|
171
|
-
// return action;
|
|
172
|
-
// } else if (action.type === "group") {
|
|
173
|
-
// if (action.inputs) {
|
|
174
|
-
// resolveVariables(inputs, action.inputs);
|
|
175
|
-
// }
|
|
176
|
-
// for (let i = 0; i < action.actions.length; ++i) {
|
|
177
|
-
// action.actions[i] = await resolveAction(action.actions[i], context, inputs);
|
|
178
|
-
// }
|
|
179
|
-
// }
|
|
180
|
-
// return action;
|
|
181
|
-
// }
|
|
182
|
-
// export async function getQuestionsV3(
|
|
183
|
-
// actionName: string,
|
|
184
|
-
// context: ContextV3,
|
|
185
|
-
// inputs: InputsWithProjectPath,
|
|
186
|
-
// required = false
|
|
187
|
-
// ): Promise<Result<QTreeNode | undefined, FxError>> {
|
|
188
|
-
// const nodes: QTreeNode[] = [];
|
|
189
|
-
// const action = await getAction(actionName, context, inputs, required);
|
|
190
|
-
// if (!action) {
|
|
191
|
-
// if (!required) return ok(undefined);
|
|
192
|
-
// return err(new ActionNotExist(actionName));
|
|
193
|
-
// }
|
|
194
|
-
// await collectActionQuestions(action, context, inputs, nodes);
|
|
195
|
-
// if (nodes.length === 0) return ok(undefined);
|
|
196
|
-
// const group = new QTreeNode({ type: "group" });
|
|
197
|
-
// group.children = nodes;
|
|
198
|
-
// return ok(group);
|
|
199
|
-
// }
|
|
200
|
-
// export function getActionName(action: Action): string {
|
|
201
|
-
// if (action.type === "call") return `call:${action.targetAction}`;
|
|
202
|
-
// return action.name as string;
|
|
203
|
-
// }
|
|
204
|
-
// /**
|
|
205
|
-
// * traverse the workflow tree, collect all questions rooted on action, use for CLI_HELP
|
|
206
|
-
// */
|
|
207
|
-
// export async function collectActionQuestions(
|
|
208
|
-
// action: Action,
|
|
209
|
-
// context: ContextV3,
|
|
210
|
-
// inputs: InputsWithProjectPath,
|
|
211
|
-
// nodes: QTreeNode[]
|
|
212
|
-
// ): Promise<Result<undefined, FxError>> {
|
|
213
|
-
// // console.log(`collectActionQuestions: ${getActionName(action)}`);
|
|
214
|
-
// if (action.question) {
|
|
215
|
-
// const res = await action.question(context, inputs);
|
|
216
|
-
// if (res.isErr()) return err(res.error);
|
|
217
|
-
// const node = res.value;
|
|
218
|
-
// if (node) {
|
|
219
|
-
// nodes.push(node);
|
|
220
|
-
// }
|
|
221
|
-
// }
|
|
222
|
-
// if (action.type === "call") {
|
|
223
|
-
// if (action.inputs) {
|
|
224
|
-
// resolveVariables(inputs, action.inputs);
|
|
225
|
-
// }
|
|
226
|
-
// const targetAction = await getAction(action.targetAction, context, inputs, action.required);
|
|
227
|
-
// if (action.required && !targetAction) {
|
|
228
|
-
// return err(new ActionNotExist(action.targetAction));
|
|
229
|
-
// }
|
|
230
|
-
// if (targetAction) {
|
|
231
|
-
// return await collectActionQuestions(targetAction, context, inputs, nodes);
|
|
232
|
-
// }
|
|
233
|
-
// } else if (action.type === "group") {
|
|
234
|
-
// if (action.inputs) {
|
|
235
|
-
// resolveVariables(inputs, action.inputs);
|
|
236
|
-
// }
|
|
237
|
-
// for (const subAction of action.actions) {
|
|
238
|
-
// const res = await collectActionQuestions(subAction, context, inputs, nodes);
|
|
239
|
-
// if (res.isErr()) return err(res.error);
|
|
240
|
-
// }
|
|
241
|
-
// }
|
|
242
|
-
// return ok(undefined);
|
|
243
|
-
// }
|
|
244
|
-
// /**
|
|
245
|
-
// * traverse the workflow tree, ask questions on nodes if they have implemented question API.
|
|
246
|
-
// */
|
|
247
|
-
// export async function askActionQuestions(
|
|
248
|
-
// action: Action,
|
|
249
|
-
// context: ContextV3,
|
|
250
|
-
// inputs: InputsWithProjectPath
|
|
251
|
-
// ): Promise<Result<undefined, FxError>> {
|
|
252
|
-
// if (action.condition) {
|
|
253
|
-
// const res = await action.condition(context, inputs);
|
|
254
|
-
// if (res.isErr()) return err(res.error);
|
|
255
|
-
// if (res.value === false) {
|
|
256
|
-
// // skip ask question rooted on this action
|
|
257
|
-
// return ok(undefined);
|
|
258
|
-
// }
|
|
259
|
-
// }
|
|
260
|
-
// if (action.question) {
|
|
261
|
-
// const getQuestionRes = await action.question(context, inputs);
|
|
262
|
-
// if (getQuestionRes.isErr()) return err(getQuestionRes.error);
|
|
263
|
-
// const node = getQuestionRes.value;
|
|
264
|
-
// if (node) {
|
|
265
|
-
// const questionRes = await traverse(
|
|
266
|
-
// node,
|
|
267
|
-
// inputs,
|
|
268
|
-
// context.userInteraction,
|
|
269
|
-
// context.telemetryReporter
|
|
270
|
-
// );
|
|
271
|
-
// if (questionRes.isErr()) return err(questionRes.error);
|
|
272
|
-
// }
|
|
273
|
-
// }
|
|
274
|
-
// if (action.type === "call") {
|
|
275
|
-
// if (action.inputs) {
|
|
276
|
-
// resolveVariables(inputs, action.inputs);
|
|
277
|
-
// }
|
|
278
|
-
// const targetAction = await getAction(action.targetAction, context, inputs, action.required);
|
|
279
|
-
// if (action.required && !targetAction) {
|
|
280
|
-
// return err(new ActionNotExist(action.targetAction));
|
|
281
|
-
// }
|
|
282
|
-
// if (targetAction) {
|
|
283
|
-
// return await askActionQuestions(targetAction, context, inputs);
|
|
284
|
-
// }
|
|
285
|
-
// } else if (action.type === "group") {
|
|
286
|
-
// if (action.inputs) {
|
|
287
|
-
// resolveVariables(inputs, action.inputs);
|
|
288
|
-
// }
|
|
289
|
-
// for (const act of action.actions) {
|
|
290
|
-
// const res = await askActionQuestions(act, context, inputs);
|
|
291
|
-
// if (res.isErr()) return err(res.error);
|
|
292
|
-
// }
|
|
293
|
-
// }
|
|
294
|
-
// return ok(undefined);
|
|
295
|
-
// }
|
|
296
|
-
// export async function showPlanAndConfirm(
|
|
297
|
-
// title: string,
|
|
298
|
-
// effects: Effect[],
|
|
299
|
-
// context: ContextV3,
|
|
300
|
-
// inputs: InputsWithProjectPath
|
|
301
|
-
// ) {
|
|
302
|
-
// let plans: string[] = [];
|
|
303
|
-
// for (const effect of effects) {
|
|
304
|
-
// if (typeof effect === "string") {
|
|
305
|
-
// plans.push(effect);
|
|
306
|
-
// } else if (effect.type === "file") {
|
|
307
|
-
// plans = plans.concat(fileEffectPlanStrings(effect));
|
|
308
|
-
// } else if (effect.type === "service") {
|
|
309
|
-
// plans.push(serviceEffectPlanString(effect));
|
|
310
|
-
// } else if (effect.type === "bicep") {
|
|
311
|
-
// plans = plans.concat(await persistBicepPlans(inputs.projectPath, effect));
|
|
312
|
-
// } else if (effect.type === "shell") {
|
|
313
|
-
// plans.push(`shell command: ${effect.description}`);
|
|
314
|
-
// }
|
|
315
|
-
// }
|
|
316
|
-
// for (let i = 0; i < plans.length; ++i) {
|
|
317
|
-
// plans[i] = `step ${i + 1} - ${plans[i]}`;
|
|
318
|
-
// }
|
|
319
|
-
// const res = await context.userInteraction.showMessage(
|
|
320
|
-
// "info",
|
|
321
|
-
// title + "\n" + plans.join("\n"),
|
|
322
|
-
// true,
|
|
323
|
-
// "Confirm"
|
|
324
|
-
// );
|
|
325
|
-
// if (res.isOk() && res.value === "Confirm") {
|
|
326
|
-
// return true;
|
|
327
|
-
// }
|
|
328
|
-
// return false;
|
|
329
|
-
// }
|
|
330
|
-
// export async function showSummary(
|
|
331
|
-
// title: string,
|
|
332
|
-
// effects: Effect[],
|
|
333
|
-
// context: ContextV3,
|
|
334
|
-
// inputs: InputsWithProjectPath
|
|
335
|
-
// ) {
|
|
336
|
-
// let plans: string[] = [];
|
|
337
|
-
// for (const effect of effects) {
|
|
338
|
-
// if (typeof effect === "string") {
|
|
339
|
-
// plans.push(effect);
|
|
340
|
-
// } else if (effect.type === "file") {
|
|
341
|
-
// plans = plans.concat(fileEffectPlanStrings(effect));
|
|
342
|
-
// } else if (effect.type === "service") {
|
|
343
|
-
// plans.push(serviceEffectPlanString(effect));
|
|
344
|
-
// } else if (effect.type === "bicep") {
|
|
345
|
-
// plans = plans.concat(await persistBicepPlans(inputs.projectPath, effect));
|
|
346
|
-
// } else if (effect.type === "shell") {
|
|
347
|
-
// plans.push(`shell command: ${effect.description}`);
|
|
348
|
-
// }
|
|
349
|
-
// }
|
|
350
|
-
// context.logProvider.info(title);
|
|
351
|
-
// plans.forEach((p) => context.logProvider.info(p));
|
|
352
|
-
// }
|
|
353
|
-
// export async function planAction(
|
|
354
|
-
// action: Action,
|
|
355
|
-
// context: ContextV3,
|
|
356
|
-
// inputs: InputsWithProjectPath,
|
|
357
|
-
// effects: Effect[]
|
|
358
|
-
// ): Promise<Result<undefined, FxError>> {
|
|
359
|
-
// if (action.condition) {
|
|
360
|
-
// const res = await action.condition(context, inputs);
|
|
361
|
-
// if (res.isErr()) return err(res.error);
|
|
362
|
-
// if (res.value === false) {
|
|
363
|
-
// // skip ask question rooted on this action
|
|
364
|
-
// return ok(undefined);
|
|
365
|
-
// }
|
|
366
|
-
// }
|
|
367
|
-
// if (action.type === "function") {
|
|
368
|
-
// if (action.plan) {
|
|
369
|
-
// const planRes = await action.plan(context, inputs);
|
|
370
|
-
// if (planRes.isErr()) return err(planRes.error);
|
|
371
|
-
// planRes.value.forEach((e) => effects.push(e));
|
|
372
|
-
// }
|
|
373
|
-
// } else if (action.type === "shell") {
|
|
374
|
-
// effects.push(action);
|
|
375
|
-
// } else if (action.type === "call") {
|
|
376
|
-
// if (action.inputs) {
|
|
377
|
-
// resolveVariables(inputs, action.inputs);
|
|
378
|
-
// }
|
|
379
|
-
// const targetAction = await getAction(action.targetAction, context, inputs, action.required);
|
|
380
|
-
// if (action.required && !targetAction) {
|
|
381
|
-
// return err(new ActionNotExist(action.targetAction));
|
|
382
|
-
// }
|
|
383
|
-
// if (targetAction) {
|
|
384
|
-
// await planAction(targetAction, context, inputs, effects);
|
|
385
|
-
// }
|
|
386
|
-
// } else {
|
|
387
|
-
// if (action.inputs) {
|
|
388
|
-
// resolveVariables(inputs, action.inputs);
|
|
389
|
-
// }
|
|
390
|
-
// for (const act of action.actions) {
|
|
391
|
-
// const res = await planAction(act, context, inputs, effects);
|
|
392
|
-
// if (res.isErr()) return err(res.error);
|
|
393
|
-
// }
|
|
394
|
-
// }
|
|
395
|
-
// return ok(undefined);
|
|
396
|
-
// }
|
|
397
|
-
// export async function executeAction(
|
|
398
|
-
// action: Action,
|
|
399
|
-
// context: ContextV3,
|
|
400
|
-
// inputs: InputsWithProjectPath,
|
|
401
|
-
// effects: Effect[]
|
|
402
|
-
// ): Promise<Result<undefined, FxError>> {
|
|
403
|
-
// if (action.condition) {
|
|
404
|
-
// const res = await action.condition(context, inputs);
|
|
405
|
-
// if (res.isErr()) return err(res.error);
|
|
406
|
-
// if (res.value === false) {
|
|
407
|
-
// // skip ask question rooted on this action
|
|
408
|
-
// return ok(undefined);
|
|
409
|
-
// }
|
|
410
|
-
// }
|
|
411
|
-
// console.log(`executeAction: ${getActionName(action)}`);
|
|
412
|
-
// if (action.pre) {
|
|
413
|
-
// const res = await action.pre(context, inputs);
|
|
414
|
-
// if (res.isErr()) return err(res.error);
|
|
415
|
-
// }
|
|
416
|
-
// let res: Result<undefined, FxError>;
|
|
417
|
-
// if (action.type === "function") {
|
|
418
|
-
// res = await executeFunctionAction(action, context, inputs, effects);
|
|
419
|
-
// } else if (action.type === "shell") {
|
|
420
|
-
// effects.push(`shell executed: ${action.command}`);
|
|
421
|
-
// res = ok(undefined);
|
|
422
|
-
// } else if (action.type === "call") {
|
|
423
|
-
// const clonedInputs = cloneDeep(inputs);
|
|
424
|
-
// if (action.inputs) {
|
|
425
|
-
// resolveVariables(clonedInputs, action.inputs);
|
|
426
|
-
// }
|
|
427
|
-
// const targetAction = await getAction(
|
|
428
|
-
// action.targetAction,
|
|
429
|
-
// context,
|
|
430
|
-
// clonedInputs,
|
|
431
|
-
// action.required
|
|
432
|
-
// );
|
|
433
|
-
// if (action.required && !targetAction) {
|
|
434
|
-
// return err(new ActionNotExist(action.targetAction));
|
|
435
|
-
// }
|
|
436
|
-
// if (targetAction) {
|
|
437
|
-
// res = await executeAction(targetAction, context, clonedInputs, effects);
|
|
438
|
-
// } else {
|
|
439
|
-
// res = ok(undefined);
|
|
440
|
-
// }
|
|
441
|
-
// } else {
|
|
442
|
-
// const clonedInputs = cloneDeep(inputs);
|
|
443
|
-
// if (action.inputs) {
|
|
444
|
-
// resolveVariables(clonedInputs, action.inputs);
|
|
445
|
-
// }
|
|
446
|
-
// if (action.mode === "parallel") {
|
|
447
|
-
// const promises = action.actions.map((a) => {
|
|
448
|
-
// const subInputs = cloneDeep(clonedInputs);
|
|
449
|
-
// return executeAction(a, context, subInputs, effects);
|
|
450
|
-
// });
|
|
451
|
-
// const results = await Promise.all(promises);
|
|
452
|
-
// for (const result of results) {
|
|
453
|
-
// if (result.isErr()) return err(result.error);
|
|
454
|
-
// }
|
|
455
|
-
// } else {
|
|
456
|
-
// for (const act of action.actions) {
|
|
457
|
-
// const subInputs = cloneDeep(clonedInputs);
|
|
458
|
-
// const res = await executeAction(act, context, subInputs, effects);
|
|
459
|
-
// if (res.isErr()) return err(res.error);
|
|
460
|
-
// }
|
|
461
|
-
// }
|
|
462
|
-
// res = ok(undefined);
|
|
463
|
-
// }
|
|
464
|
-
// if (action.post) {
|
|
465
|
-
// const res = await action.post(context, inputs);
|
|
466
|
-
// if (res.isErr()) return err(res.error);
|
|
467
|
-
// }
|
|
468
|
-
// return res;
|
|
469
|
-
// }
|
|
470
|
-
// export class ValidationError extends UserError {
|
|
471
|
-
// constructor(msg: string) {
|
|
472
|
-
// super({ message: msg, displayMessage: msg, source: "core" });
|
|
473
|
-
// }
|
|
474
|
-
// }
|
|
475
|
-
// export async function validateQuestion(
|
|
476
|
-
// question: Question,
|
|
477
|
-
// ui: UserInteraction,
|
|
478
|
-
// inputs: Inputs,
|
|
479
|
-
// step?: number,
|
|
480
|
-
// totalSteps?: number
|
|
481
|
-
// ): Promise<Result<InputResult<any>, FxError>> {
|
|
482
|
-
// const validationFunc = (question as any).validation
|
|
483
|
-
// ? getValidationFunction<string>((question as any).validation, inputs)
|
|
484
|
-
// : undefined;
|
|
485
|
-
// const answer = getEmbeddedValueByPath(inputs, question.name);
|
|
486
|
-
// if (validationFunc) {
|
|
487
|
-
// if (!answer) return err(new ValidationError(`question ${question.name} has no answer!`));
|
|
488
|
-
// let res = await validationFunc(answer);
|
|
489
|
-
// if (res) {
|
|
490
|
-
// res = `${question.name}: ${res}`;
|
|
491
|
-
// return err(new ValidationError(res));
|
|
492
|
-
// }
|
|
493
|
-
// }
|
|
494
|
-
// return ok({ type: "success", result: answer });
|
|
495
|
-
// }
|
|
496
|
-
// export async function executeFunctionAction(
|
|
497
|
-
// action: FunctionAction,
|
|
498
|
-
// context: ContextV3,
|
|
499
|
-
// inputs: InputsWithProjectPath,
|
|
500
|
-
// effects: Effect[]
|
|
501
|
-
// ): Promise<Result<undefined, FxError>> {
|
|
502
|
-
// context.logProvider.info(`executeFunctionAction [${getActionName(action)}] start!`);
|
|
503
|
-
// const arr = action.name.split(".");
|
|
504
|
-
// const eventName = action.telemetryEventName || arr[1];
|
|
505
|
-
// const componentName = action.telemetryComponentName || arr[0];
|
|
506
|
-
// const telemetryProps = {
|
|
507
|
-
// [TelemetryConstants.properties.component]: componentName,
|
|
508
|
-
// [TelemetryConstants.properties.appId]: globalVars.teamsAppId,
|
|
509
|
-
// [TelemetryConstants.properties.tenantId]: globalVars.m365TenantId,
|
|
510
|
-
// };
|
|
511
|
-
// let progressBar;
|
|
512
|
-
// try {
|
|
513
|
-
// // send start telemetry
|
|
514
|
-
// if (action.enableTelemetry) {
|
|
515
|
-
// if (action.telemetryProps) assign(telemetryProps, action.telemetryProps);
|
|
516
|
-
// const startEvent = eventName + "-start";
|
|
517
|
-
// context.telemetryReporter.sendTelemetryEvent(startEvent, telemetryProps);
|
|
518
|
-
// }
|
|
519
|
-
// // validate inputs
|
|
520
|
-
// if (action.question) {
|
|
521
|
-
// const getQuestionRes = await action.question(context, inputs);
|
|
522
|
-
// if (getQuestionRes.isErr()) throw getQuestionRes.error;
|
|
523
|
-
// const node = getQuestionRes.value;
|
|
524
|
-
// if (node) {
|
|
525
|
-
// const validationRes = await traverse(
|
|
526
|
-
// node,
|
|
527
|
-
// inputs,
|
|
528
|
-
// context.userInteraction,
|
|
529
|
-
// context.telemetryReporter,
|
|
530
|
-
// validateQuestion
|
|
531
|
-
// );
|
|
532
|
-
// if (validationRes.isErr()) throw validationRes.error;
|
|
533
|
-
// }
|
|
534
|
-
// }
|
|
535
|
-
// // progress bar
|
|
536
|
-
// if (action.enableProgressBar) {
|
|
537
|
-
// progressBar = context.userInteraction.createProgressBar(
|
|
538
|
-
// action.progressTitle || action.name,
|
|
539
|
-
// action.progressSteps || 1
|
|
540
|
-
// );
|
|
541
|
-
// progressBar.start();
|
|
542
|
-
// }
|
|
543
|
-
// const res = await action.execute(
|
|
544
|
-
// context,
|
|
545
|
-
// inputs,
|
|
546
|
-
// progressBar,
|
|
547
|
-
// action.enableTelemetry ? telemetryProps : undefined
|
|
548
|
-
// );
|
|
549
|
-
// if (res.isErr()) throw res.error;
|
|
550
|
-
// if (res.value) {
|
|
551
|
-
// //persist bicep files for bicep effects
|
|
552
|
-
// for (const effect of res.value) {
|
|
553
|
-
// if (typeof effect !== "string" && effect.type === "bicep") {
|
|
554
|
-
// const bicep = effect as Bicep;
|
|
555
|
-
// if (bicep) {
|
|
556
|
-
// const bicepPlans = await persistBicepPlans(inputs.projectPath, bicep);
|
|
557
|
-
// bicepPlans.forEach((p) => effects.push(p));
|
|
558
|
-
// // TODO: handle the returned error of bicep generation
|
|
559
|
-
// const bicepRes = await persistBicep(
|
|
560
|
-
// inputs.projectPath,
|
|
561
|
-
// convertToAlphanumericOnly(context.projectSetting.appName),
|
|
562
|
-
// bicep
|
|
563
|
-
// );
|
|
564
|
-
// if (bicepRes.isErr()) throw bicepRes.error;
|
|
565
|
-
// }
|
|
566
|
-
// } else {
|
|
567
|
-
// effects.push(effect);
|
|
568
|
-
// }
|
|
569
|
-
// }
|
|
570
|
-
// }
|
|
571
|
-
// // send end telemetry
|
|
572
|
-
// if (action.enableTelemetry) {
|
|
573
|
-
// context.telemetryReporter.sendTelemetryEvent(eventName, {
|
|
574
|
-
// ...telemetryProps,
|
|
575
|
-
// [TelemetryConstants.properties.success]: TelemetryConstants.values.yes,
|
|
576
|
-
// });
|
|
577
|
-
// }
|
|
578
|
-
// progressBar?.end(true);
|
|
579
|
-
// context.logProvider.info(`executeFunctionAction [${action.name}] finish!`);
|
|
580
|
-
// return ok(undefined);
|
|
581
|
-
// } catch (e) {
|
|
582
|
-
// progressBar?.end(false);
|
|
583
|
-
// let fxError;
|
|
584
|
-
// if (action.errorHandler) {
|
|
585
|
-
// fxError = action.errorHandler(e, telemetryProps);
|
|
586
|
-
// } else {
|
|
587
|
-
// fxError = assembleError(e);
|
|
588
|
-
// if (fxError.source === "unknown") {
|
|
589
|
-
// fxError.source = action.errorSource || fxError.source;
|
|
590
|
-
// }
|
|
591
|
-
// if (fxError instanceof UserError) {
|
|
592
|
-
// fxError.helpLink = fxError.helpLink || action.errorHelpLink;
|
|
593
|
-
// }
|
|
594
|
-
// if (fxError instanceof SystemError) {
|
|
595
|
-
// fxError.issueLink = fxError.issueLink || action.errorIssueLink;
|
|
596
|
-
// }
|
|
597
|
-
// }
|
|
598
|
-
// // send error telemetry
|
|
599
|
-
// if (action.enableTelemetry) {
|
|
600
|
-
// const errorCode = fxError.source + "." + fxError.name;
|
|
601
|
-
// const errorType =
|
|
602
|
-
// fxError instanceof SystemError
|
|
603
|
-
// ? TelemetryConstants.values.systemError
|
|
604
|
-
// : TelemetryConstants.values.userError;
|
|
605
|
-
// context.telemetryReporter.sendTelemetryErrorEvent(eventName, {
|
|
606
|
-
// ...telemetryProps,
|
|
607
|
-
// [TelemetryConstants.properties.success]: TelemetryConstants.values.no,
|
|
608
|
-
// [TelemetryConstants.properties.errorCode]: errorCode,
|
|
609
|
-
// [TelemetryConstants.properties.errorType]: errorType,
|
|
610
|
-
// [TelemetryConstants.properties.errorMessage]: fxError.message,
|
|
611
|
-
// });
|
|
612
|
-
// }
|
|
613
|
-
// return err(fxError);
|
|
614
|
-
// }
|
|
615
|
-
// }
|
|
5
|
+
exports.getComponentByScenario = exports.getComponents = exports.getComponent = void 0;
|
|
616
6
|
function getComponent(projectSettings, resourceType) {
|
|
617
7
|
var _a;
|
|
618
8
|
return (_a = projectSettings.components) === null || _a === void 0 ? void 0 : _a.find((r) => r.name === resourceType);
|
|
@@ -630,80 +20,4 @@ function getComponentByScenario(projectSetting, resourceType, scenario) {
|
|
|
630
20
|
: getComponent(projectSetting, resourceType);
|
|
631
21
|
}
|
|
632
22
|
exports.getComponentByScenario = getComponentByScenario;
|
|
633
|
-
function getHostingParentComponent(projectSettings, resourceType, scenario) {
|
|
634
|
-
var _a;
|
|
635
|
-
const hostingComponent = getComponentByScenario(projectSettings, resourceType, scenario);
|
|
636
|
-
const parentName = (_a = hostingComponent === null || hostingComponent === void 0 ? void 0 : hostingComponent.connections) === null || _a === void 0 ? void 0 : _a.find((name) => {
|
|
637
|
-
const component = getComponent(projectSettings, name);
|
|
638
|
-
return (component === null || component === void 0 ? void 0 : component.hosting) === hostingComponent.name;
|
|
639
|
-
});
|
|
640
|
-
if (!parentName) {
|
|
641
|
-
return undefined;
|
|
642
|
-
}
|
|
643
|
-
const parent = getComponent(projectSettings, parentName);
|
|
644
|
-
return parent;
|
|
645
|
-
}
|
|
646
|
-
exports.getHostingParentComponent = getHostingParentComponent;
|
|
647
|
-
// export async function runAction(
|
|
648
|
-
// action: Action,
|
|
649
|
-
// context: ContextV3,
|
|
650
|
-
// inputs: InputsWithProjectPath
|
|
651
|
-
// ): Promise<Result<undefined, FxError>> {
|
|
652
|
-
// const actionName = getActionName(action);
|
|
653
|
-
// context.logProvider.info(
|
|
654
|
-
// `------------------------run action: ${actionName} start!------------------------`
|
|
655
|
-
// );
|
|
656
|
-
// try {
|
|
657
|
-
// // 1. run question model for the whole workflow rooted on action
|
|
658
|
-
// const questionRes = await askActionQuestions(action, context, inputs);
|
|
659
|
-
// if (questionRes.isErr()) return err(questionRes.error);
|
|
660
|
-
// // 3. plan action
|
|
661
|
-
// // const planEffects: Effect[] = [];
|
|
662
|
-
// // await planAction(action, context, cloneDeep(inputs), planEffects);
|
|
663
|
-
// // const confirm = await showPlanAndConfirm(
|
|
664
|
-
// // `action: ${actionName} will do the following changes:`,
|
|
665
|
-
// // planEffects,
|
|
666
|
-
// // context,
|
|
667
|
-
// // inputs
|
|
668
|
-
// // );
|
|
669
|
-
// // if (confirm) {
|
|
670
|
-
// // 4. execute action
|
|
671
|
-
// const execEffects: Effect[] = [];
|
|
672
|
-
// const execRes = await executeAction(action, context, inputs, execEffects);
|
|
673
|
-
// if (execRes.isErr()) return execRes;
|
|
674
|
-
// await showSummary(`${actionName} summary:`, execEffects, context, inputs);
|
|
675
|
-
// // }
|
|
676
|
-
// } catch (e) {
|
|
677
|
-
// return err(assembleError(e));
|
|
678
|
-
// }
|
|
679
|
-
// context.logProvider.info(
|
|
680
|
-
// `------------------------run action: ${actionName} finish!------------------------`
|
|
681
|
-
// );
|
|
682
|
-
// return ok(undefined);
|
|
683
|
-
// }
|
|
684
|
-
// export async function runActionByName(
|
|
685
|
-
// actionName: string,
|
|
686
|
-
// context: ContextV3,
|
|
687
|
-
// inputs: InputsWithProjectPath
|
|
688
|
-
// ): Promise<Result<undefined, FxError>> {
|
|
689
|
-
// let res: Result<undefined, FxError>;
|
|
690
|
-
// try {
|
|
691
|
-
// // 1. find the action body
|
|
692
|
-
// const action = await getAction(actionName, context, inputs, true);
|
|
693
|
-
// if (action) {
|
|
694
|
-
// res = await runAction(action, context, inputs);
|
|
695
|
-
// } else {
|
|
696
|
-
// return err(
|
|
697
|
-
// new SystemError({
|
|
698
|
-
// source: "fx",
|
|
699
|
-
// name: "ActionNotFoundError",
|
|
700
|
-
// message: "action not found:" + actionName,
|
|
701
|
-
// })
|
|
702
|
-
// );
|
|
703
|
-
// }
|
|
704
|
-
// } catch (e) {
|
|
705
|
-
// res = err(assembleError(e));
|
|
706
|
-
// }
|
|
707
|
-
// return res;
|
|
708
|
-
// }
|
|
709
23
|
//# sourceMappingURL=workflow.js.map
|