@microsoft/teamsfx-core 2.0.4-alpha.dea6b9e8a.0 → 2.0.4-alpha.e432bab97.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/deps-checker/checkerFactory.d.ts +1 -2
- package/build/common/deps-checker/checkerFactory.d.ts.map +1 -1
- package/build/common/deps-checker/checkerFactory.js +2 -2
- package/build/common/deps-checker/checkerFactory.js.map +1 -1
- package/build/common/deps-checker/depsLogger.d.ts +14 -14
- package/build/common/deps-checker/depsLogger.d.ts.map +1 -1
- package/build/common/deps-checker/depsLogger.js +7 -21
- package/build/common/deps-checker/depsLogger.js.map +1 -1
- package/build/common/deps-checker/internal/dotnetChecker.d.ts.map +1 -1
- package/build/common/deps-checker/internal/dotnetChecker.js +40 -35
- package/build/common/deps-checker/internal/dotnetChecker.js.map +1 -1
- package/build/common/deps-checker/internal/nodeChecker.js +3 -3
- package/build/common/deps-checker/internal/nodeChecker.js.map +1 -1
- package/build/common/deps-checker/util/cpUtils.d.ts +1 -1
- package/build/common/deps-checker/util/cpUtils.d.ts.map +1 -1
- package/build/common/deps-checker/util/cpUtils.js +4 -4
- package/build/common/deps-checker/util/cpUtils.js.map +1 -1
- package/build/common/deps-checker/util/progressIndicator.js +2 -2
- package/build/common/deps-checker/util/progressIndicator.js.map +1 -1
- package/build/common/featureFlags.d.ts +1 -0
- package/build/common/featureFlags.d.ts.map +1 -1
- package/build/common/featureFlags.js +5 -1
- package/build/common/featureFlags.js.map +1 -1
- package/build/common/local/localCertificateManager.d.ts.map +1 -1
- package/build/common/local/localCertificateManager.js +3 -0
- package/build/common/local/localCertificateManager.js.map +1 -1
- package/build/common/local/packageJsonHelper.d.ts.map +1 -1
- package/build/common/local/packageJsonHelper.js +1 -0
- package/build/common/local/packageJsonHelper.js.map +1 -1
- package/build/common/local/portChecker.js.map +1 -1
- package/build/common/m365/launchHelper.d.ts +2 -2
- package/build/common/m365/launchHelper.d.ts.map +1 -1
- package/build/common/m365/launchHelper.js +13 -4
- package/build/common/m365/launchHelper.js.map +1 -1
- package/build/common/m365/packageService.d.ts.map +1 -1
- package/build/common/m365/packageService.js +38 -0
- package/build/common/m365/packageService.js.map +1 -1
- package/build/common/projectSettingsHelper.d.ts.map +1 -1
- package/build/common/projectSettingsHelper.js +1 -0
- package/build/common/projectSettingsHelper.js.map +1 -1
- package/build/common/samples-config-v3.json +234 -21
- package/build/common/samples.d.ts +8 -3
- package/build/common/samples.d.ts.map +1 -1
- package/build/common/samples.js +17 -14
- package/build/common/samples.js.map +1 -1
- package/build/common/spec-parser/adaptiveCardGenerator.d.ts.map +1 -1
- package/build/common/spec-parser/adaptiveCardGenerator.js +38 -32
- package/build/common/spec-parser/adaptiveCardGenerator.js.map +1 -1
- package/build/common/spec-parser/constants.d.ts +10 -10
- package/build/common/spec-parser/constants.d.ts.map +1 -1
- package/build/common/spec-parser/constants.js +11 -10
- package/build/common/spec-parser/constants.js.map +1 -1
- package/build/common/spec-parser/interfaces.d.ts +28 -18
- package/build/common/spec-parser/interfaces.d.ts.map +1 -1
- package/build/common/spec-parser/interfaces.js +19 -13
- package/build/common/spec-parser/interfaces.js.map +1 -1
- package/build/common/spec-parser/manifestUpdater.d.ts.map +1 -1
- package/build/common/spec-parser/manifestUpdater.js +25 -21
- package/build/common/spec-parser/manifestUpdater.js.map +1 -1
- package/build/common/spec-parser/specFilter.d.ts.map +1 -1
- package/build/common/spec-parser/specFilter.js +26 -33
- package/build/common/spec-parser/specFilter.js.map +1 -1
- package/build/common/spec-parser/specParser.d.ts +5 -0
- package/build/common/spec-parser/specParser.d.ts.map +1 -1
- package/build/common/spec-parser/specParser.js +147 -96
- package/build/common/spec-parser/specParser.js.map +1 -1
- package/build/common/spec-parser/utils.d.ts +1 -0
- package/build/common/spec-parser/utils.d.ts.map +1 -1
- package/build/common/spec-parser/utils.js +13 -1
- package/build/common/spec-parser/utils.js.map +1 -1
- package/build/common/telemetry.d.ts +7 -4
- package/build/common/telemetry.d.ts.map +1 -1
- package/build/common/telemetry.js +42 -8
- package/build/common/telemetry.js.map +1 -1
- package/build/component/configManager/interface.d.ts +5 -2
- package/build/component/configManager/interface.d.ts.map +1 -1
- package/build/component/configManager/interface.js.map +1 -1
- package/build/component/configManager/lifecycle.d.ts.map +1 -1
- package/build/component/configManager/lifecycle.js +15 -9
- package/build/component/configManager/lifecycle.js.map +1 -1
- package/build/component/configManager/parser.d.ts.map +1 -1
- package/build/component/configManager/parser.js +6 -7
- package/build/component/configManager/parser.js.map +1 -1
- package/build/component/configManager/validator.d.ts.map +1 -1
- package/build/component/configManager/validator.js +2 -3
- package/build/component/configManager/validator.js.map +1 -1
- package/build/component/constants.d.ts +5 -0
- package/build/component/constants.d.ts.map +1 -1
- package/build/component/constants.js +6 -1
- package/build/component/constants.js.map +1 -1
- package/build/component/coordinator/index.d.ts +11 -8
- package/build/component/coordinator/index.d.ts.map +1 -1
- package/build/component/coordinator/index.js +68 -63
- package/build/component/coordinator/index.js.map +1 -1
- package/build/component/coordinator/summary.d.ts.map +1 -1
- package/build/component/coordinator/summary.js +2 -1
- package/build/component/coordinator/summary.js.map +1 -1
- package/build/component/developerPortalScaffoldUtils.d.ts +1 -1
- package/build/component/developerPortalScaffoldUtils.d.ts.map +1 -1
- package/build/component/developerPortalScaffoldUtils.js +7 -7
- package/build/component/developerPortalScaffoldUtils.js.map +1 -1
- package/build/component/driver/aad/create.d.ts +1 -0
- package/build/component/driver/aad/create.d.ts.map +1 -1
- package/build/component/driver/aad/create.js +2 -5
- package/build/component/driver/aad/create.js.map +1 -1
- package/build/component/driver/aad/error/aadManifestError.d.ts +3 -0
- package/build/component/driver/aad/error/aadManifestError.d.ts.map +1 -1
- package/build/component/driver/aad/error/aadManifestError.js +13 -1
- package/build/component/driver/aad/error/aadManifestError.js.map +1 -1
- package/build/component/driver/aad/update.d.ts +1 -0
- package/build/component/driver/aad/update.d.ts.map +1 -1
- package/build/component/driver/aad/update.js +2 -5
- package/build/component/driver/aad/update.js.map +1 -1
- package/build/component/driver/aad/utility/aadAppClient.d.ts +1 -1
- package/build/component/driver/aad/utility/aadAppClient.d.ts.map +1 -1
- package/build/component/driver/aad/utility/aadAppClient.js +58 -13
- package/build/component/driver/aad/utility/aadAppClient.js.map +1 -1
- package/build/component/driver/aad/utility/constants.d.ts +3 -0
- package/build/component/driver/aad/utility/constants.d.ts.map +1 -1
- package/build/component/driver/aad/utility/constants.js +4 -1
- package/build/component/driver/aad/utility/constants.js.map +1 -1
- package/build/component/driver/add/addWebPart.js +1 -1
- package/build/component/driver/add/addWebPart.js.map +1 -1
- package/build/component/driver/arm/deploy.d.ts +1 -0
- package/build/component/driver/arm/deploy.d.ts.map +1 -1
- package/build/component/driver/arm/deploy.js +1 -8
- package/build/component/driver/arm/deploy.js.map +1 -1
- package/build/component/driver/arm/deployImpl.d.ts.map +1 -1
- package/build/component/driver/arm/deployImpl.js +8 -0
- package/build/component/driver/arm/deployImpl.js.map +1 -1
- package/build/component/driver/arm/util/bicepChecker.js +7 -6
- package/build/component/driver/arm/util/bicepChecker.js.map +1 -1
- package/build/component/driver/arm/util/handleError.js.map +1 -1
- package/build/component/driver/botAadApp/create.d.ts +1 -0
- package/build/component/driver/botAadApp/create.d.ts.map +1 -1
- package/build/component/driver/botAadApp/create.js +4 -7
- package/build/component/driver/botAadApp/create.js.map +1 -1
- package/build/component/driver/botFramework/createOrUpdateBot.d.ts +1 -0
- package/build/component/driver/botFramework/createOrUpdateBot.d.ts.map +1 -1
- package/build/component/driver/botFramework/createOrUpdateBot.js +5 -11
- package/build/component/driver/botFramework/createOrUpdateBot.js.map +1 -1
- package/build/component/driver/deploy/azure/azureStorageDeployDriver.d.ts.map +1 -1
- package/build/component/driver/deploy/azure/azureStorageDeployDriver.js +12 -5
- package/build/component/driver/deploy/azure/azureStorageDeployDriver.js.map +1 -1
- package/build/component/driver/deploy/azure/azureStorageStaticWebsiteConfigDriver.d.ts.map +1 -1
- package/build/component/driver/deploy/azure/azureStorageStaticWebsiteConfigDriver.js +11 -4
- package/build/component/driver/deploy/azure/azureStorageStaticWebsiteConfigDriver.js.map +1 -1
- package/build/component/driver/deploy/azure/impl/AzureZipDeployImpl.d.ts.map +1 -1
- package/build/component/driver/deploy/azure/impl/AzureZipDeployImpl.js +22 -14
- package/build/component/driver/deploy/azure/impl/AzureZipDeployImpl.js.map +1 -1
- package/build/component/driver/deploy/azure/impl/azureDeployImpl.d.ts.map +1 -1
- package/build/component/driver/deploy/azure/impl/azureDeployImpl.js +8 -8
- package/build/component/driver/deploy/azure/impl/azureDeployImpl.js.map +1 -1
- package/build/component/driver/deploy/azure/impl/baseDeployImpl.js +4 -4
- package/build/component/driver/deploy/azure/impl/baseDeployImpl.js.map +1 -1
- package/build/component/driver/deploy/spfx/deployDriver.d.ts +1 -0
- package/build/component/driver/deploy/spfx/deployDriver.d.ts.map +1 -1
- package/build/component/driver/deploy/spfx/deployDriver.js +9 -3
- package/build/component/driver/deploy/spfx/deployDriver.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 +10 -6
- package/build/component/driver/devTool/installDriver.js.map +1 -1
- package/build/component/driver/file/createOrUpdateEnvironmentFile.d.ts +1 -0
- package/build/component/driver/file/createOrUpdateEnvironmentFile.d.ts.map +1 -1
- package/build/component/driver/file/createOrUpdateEnvironmentFile.js +5 -11
- package/build/component/driver/file/createOrUpdateEnvironmentFile.js.map +1 -1
- package/build/component/driver/file/createOrUpdateJsonFile.d.ts +1 -0
- package/build/component/driver/file/createOrUpdateJsonFile.d.ts.map +1 -1
- package/build/component/driver/file/createOrUpdateJsonFile.js +5 -11
- package/build/component/driver/file/createOrUpdateJsonFile.js.map +1 -1
- package/build/component/driver/interface/stepDriver.d.ts +1 -0
- package/build/component/driver/interface/stepDriver.d.ts.map +1 -1
- package/build/component/driver/m365/acquire.d.ts +1 -0
- package/build/component/driver/m365/acquire.d.ts.map +1 -1
- package/build/component/driver/m365/acquire.js +5 -11
- package/build/component/driver/m365/acquire.js.map +1 -1
- package/build/component/driver/script/baseBuildDriver.d.ts.map +1 -1
- package/build/component/driver/script/baseBuildDriver.js +1 -0
- package/build/component/driver/script/baseBuildDriver.js.map +1 -1
- package/build/component/driver/script/scriptDriver.d.ts +1 -0
- package/build/component/driver/script/scriptDriver.d.ts.map +1 -1
- package/build/component/driver/script/scriptDriver.js +28 -21
- package/build/component/driver/script/scriptDriver.js.map +1 -1
- package/build/component/driver/teamsApp/appStudio.d.ts.map +1 -1
- package/build/component/driver/teamsApp/appStudio.js +3 -3
- package/build/component/driver/teamsApp/appStudio.js.map +1 -1
- package/build/component/driver/teamsApp/clients/appStudioClient.d.ts.map +1 -1
- package/build/component/driver/teamsApp/clients/appStudioClient.js +21 -5
- package/build/component/driver/teamsApp/clients/appStudioClient.js.map +1 -1
- package/build/component/driver/teamsApp/clients/authSvcClient.d.ts.map +1 -1
- package/build/component/driver/teamsApp/clients/authSvcClient.js +2 -0
- package/build/component/driver/teamsApp/clients/authSvcClient.js.map +1 -1
- package/build/component/driver/teamsApp/configure.d.ts +1 -0
- package/build/component/driver/teamsApp/configure.d.ts.map +1 -1
- package/build/component/driver/teamsApp/configure.js +3 -6
- package/build/component/driver/teamsApp/configure.js.map +1 -1
- package/build/component/driver/teamsApp/copyAppPackageToSPFx.d.ts +1 -0
- package/build/component/driver/teamsApp/copyAppPackageToSPFx.d.ts.map +1 -1
- package/build/component/driver/teamsApp/copyAppPackageToSPFx.js +3 -6
- package/build/component/driver/teamsApp/copyAppPackageToSPFx.js.map +1 -1
- package/build/component/driver/teamsApp/create.d.ts +1 -0
- package/build/component/driver/teamsApp/create.d.ts.map +1 -1
- package/build/component/driver/teamsApp/create.js +5 -6
- package/build/component/driver/teamsApp/create.js.map +1 -1
- package/build/component/driver/teamsApp/createAppPackage.d.ts +3 -2
- package/build/component/driver/teamsApp/createAppPackage.d.ts.map +1 -1
- package/build/component/driver/teamsApp/createAppPackage.js +22 -24
- package/build/component/driver/teamsApp/createAppPackage.js.map +1 -1
- package/build/component/driver/teamsApp/errors.d.ts.map +1 -1
- package/build/component/driver/teamsApp/errors.js +2 -0
- package/build/component/driver/teamsApp/errors.js.map +1 -1
- package/build/component/driver/teamsApp/interfaces/appdefinitions/messagingExtension.d.ts +3 -0
- package/build/component/driver/teamsApp/interfaces/appdefinitions/messagingExtension.d.ts.map +1 -1
- package/build/component/driver/teamsApp/interfaces/appdefinitions/messagingExtensionCommand.d.ts +1 -0
- package/build/component/driver/teamsApp/interfaces/appdefinitions/messagingExtensionCommand.d.ts.map +1 -1
- package/build/component/driver/teamsApp/publishAppPackage.d.ts +1 -0
- package/build/component/driver/teamsApp/publishAppPackage.d.ts.map +1 -1
- package/build/component/driver/teamsApp/publishAppPackage.js +3 -6
- package/build/component/driver/teamsApp/publishAppPackage.js.map +1 -1
- package/build/component/driver/teamsApp/utils/ManifestUtils.d.ts.map +1 -1
- package/build/component/driver/teamsApp/utils/ManifestUtils.js +2 -0
- package/build/component/driver/teamsApp/utils/ManifestUtils.js.map +1 -1
- package/build/component/driver/teamsApp/utils/utils.d.ts +2 -2
- package/build/component/driver/teamsApp/utils/utils.d.ts.map +1 -1
- package/build/component/driver/teamsApp/utils/utils.js +21 -10
- package/build/component/driver/teamsApp/utils/utils.js.map +1 -1
- package/build/component/driver/teamsApp/validate.d.ts +1 -0
- package/build/component/driver/teamsApp/validate.d.ts.map +1 -1
- package/build/component/driver/teamsApp/validate.js +3 -6
- package/build/component/driver/teamsApp/validate.js.map +1 -1
- package/build/component/driver/teamsApp/validateAppPackage.d.ts +1 -0
- package/build/component/driver/teamsApp/validateAppPackage.d.ts.map +1 -1
- package/build/component/driver/teamsApp/validateAppPackage.js +3 -6
- package/build/component/driver/teamsApp/validateAppPackage.js.map +1 -1
- package/build/component/error/componentError.d.ts +2 -1
- package/build/component/error/componentError.d.ts.map +1 -1
- package/build/component/error/componentError.js +8 -4
- package/build/component/error/componentError.js.map +1 -1
- package/build/component/feature/collaboration.d.ts.map +1 -1
- package/build/component/feature/collaboration.js +25 -6
- package/build/component/feature/collaboration.js.map +1 -1
- package/build/component/generator/copilotPlugin/generator.d.ts +5 -2
- package/build/component/generator/copilotPlugin/generator.d.ts.map +1 -1
- package/build/component/generator/copilotPlugin/generator.js +42 -14
- package/build/component/generator/copilotPlugin/generator.js.map +1 -1
- package/build/component/generator/copilotPlugin/helper.d.ts +5 -3
- package/build/component/generator/copilotPlugin/helper.d.ts.map +1 -1
- package/build/component/generator/copilotPlugin/helper.js +107 -35
- package/build/component/generator/copilotPlugin/helper.js.map +1 -1
- package/build/component/generator/error.d.ts +1 -1
- package/build/component/generator/error.d.ts.map +1 -1
- package/build/component/generator/error.js +2 -2
- package/build/component/generator/error.js.map +1 -1
- package/build/component/generator/generator.d.ts.map +1 -1
- package/build/component/generator/generator.js +18 -15
- package/build/component/generator/generator.js.map +1 -1
- package/build/component/generator/officeAddin/generator.d.ts.map +1 -1
- package/build/component/generator/officeAddin/generator.js +9 -1
- package/build/component/generator/officeAddin/generator.js.map +1 -1
- package/build/component/generator/officeAddin/helperMethods.d.ts.map +1 -1
- package/build/component/generator/officeAddin/helperMethods.js +8 -4
- package/build/component/generator/officeAddin/helperMethods.js.map +1 -1
- package/build/component/generator/spfx/depsChecker/generatorChecker.d.ts.map +1 -1
- package/build/component/generator/spfx/depsChecker/generatorChecker.js +4 -2
- package/build/component/generator/spfx/depsChecker/generatorChecker.js.map +1 -1
- package/build/component/generator/spfx/depsChecker/yoChecker.d.ts.map +1 -1
- package/build/component/generator/spfx/depsChecker/yoChecker.js +3 -3
- package/build/component/generator/spfx/depsChecker/yoChecker.js.map +1 -1
- package/build/component/generator/spfx/spfxGenerator.d.ts.map +1 -1
- package/build/component/generator/spfx/spfxGenerator.js +2 -2
- package/build/component/generator/spfx/spfxGenerator.js.map +1 -1
- package/build/component/generator/spfx/utils/utils.js +3 -3
- package/build/component/generator/spfx/utils/utils.js.map +1 -1
- package/build/component/generator/utils.d.ts +10 -2
- package/build/component/generator/utils.d.ts.map +1 -1
- package/build/component/generator/utils.js +4 -2
- package/build/component/generator/utils.js.map +1 -1
- package/build/component/messages.d.ts +2 -3
- package/build/component/messages.d.ts.map +1 -1
- package/build/component/messages.js +3 -4
- package/build/component/messages.js.map +1 -1
- package/build/component/middleware/questionMW.d.ts +2 -2
- package/build/component/middleware/questionMW.d.ts.map +1 -1
- package/build/component/middleware/questionMW.js +7 -11
- package/build/component/middleware/questionMW.js.map +1 -1
- package/build/component/provisionUtils.d.ts +3 -3
- package/build/component/provisionUtils.d.ts.map +1 -1
- package/build/component/provisionUtils.js +3 -3
- package/build/component/provisionUtils.js.map +1 -1
- package/build/component/resource/botService/appStudio/appStudioClient.d.ts.map +1 -1
- package/build/component/resource/botService/appStudio/appStudioClient.js +24 -2
- package/build/component/resource/botService/appStudio/appStudioClient.js.map +1 -1
- package/build/component/telemetry.js +2 -2
- package/build/component/telemetry.js.map +1 -1
- package/build/component/utils/ResourceGroupHelper.d.ts +2 -2
- package/build/component/utils/ResourceGroupHelper.d.ts.map +1 -1
- package/build/component/utils/ResourceGroupHelper.js +1 -4
- package/build/component/utils/ResourceGroupHelper.js.map +1 -1
- package/build/component/utils/charsetUtils.js +3 -3
- package/build/component/utils/charsetUtils.js.map +1 -1
- package/build/component/utils/common.d.ts +1 -1
- package/build/component/utils/common.d.ts.map +1 -1
- package/build/component/utils/common.js +3 -3
- package/build/component/utils/common.js.map +1 -1
- package/build/component/utils/depsChecker/cpUtils.d.ts.map +1 -1
- package/build/component/utils/depsChecker/cpUtils.js +8 -4
- package/build/component/utils/depsChecker/cpUtils.js.map +1 -1
- package/build/component/utils/envUtil.js +2 -2
- package/build/component/utils/envUtil.js.map +1 -1
- package/build/component/utils/metadataUtil.d.ts +3 -0
- package/build/component/utils/metadataUtil.d.ts.map +1 -1
- package/build/component/utils/metadataUtil.js +16 -3
- package/build/component/utils/metadataUtil.js.map +1 -1
- package/build/component/utils/teamsFxTelemetryReporter.js +2 -2
- package/build/component/utils/teamsFxTelemetryReporter.js.map +1 -1
- package/build/core/FxCore.d.ts +40 -33
- package/build/core/FxCore.d.ts.map +1 -1
- package/build/core/FxCore.js +810 -66
- package/build/core/FxCore.js.map +1 -1
- package/build/core/collaborator.js +2 -2
- package/build/core/collaborator.js.map +1 -1
- package/build/core/globalVars.d.ts +16 -0
- package/build/core/globalVars.d.ts.map +1 -1
- package/build/core/globalVars.js +34 -1
- package/build/core/globalVars.js.map +1 -1
- package/build/core/middleware/concurrentLocker.d.ts.map +1 -1
- package/build/core/middleware/concurrentLocker.js +7 -3
- package/build/core/middleware/concurrentLocker.js.map +1 -1
- package/build/core/middleware/projectMigratorV3.d.ts +4 -0
- package/build/core/middleware/projectMigratorV3.d.ts.map +1 -1
- package/build/core/middleware/projectMigratorV3.js +34 -32
- package/build/core/middleware/projectMigratorV3.js.map +1 -1
- package/build/core/middleware/projectVersionChecker.js +5 -5
- package/build/core/middleware/projectVersionChecker.js.map +1 -1
- package/build/core/middleware/utils/appYmlGenerator.d.ts.map +1 -1
- package/build/core/middleware/utils/appYmlGenerator.js +2 -1
- package/build/core/middleware/utils/appYmlGenerator.js.map +1 -1
- package/build/core/middleware/utils/debug/taskMigrator.d.ts.map +1 -1
- package/build/core/middleware/utils/debug/taskMigrator.js +3 -0
- package/build/core/middleware/utils/debug/taskMigrator.js.map +1 -1
- package/build/core/middleware/utils/migrationContext.d.ts +1 -0
- package/build/core/middleware/utils/migrationContext.d.ts.map +1 -1
- package/build/core/middleware/utils/migrationContext.js.map +1 -1
- package/build/core/middleware/utils/v3MigrationUtils.d.ts.map +1 -1
- package/build/core/middleware/utils/v3MigrationUtils.js +5 -1
- package/build/core/middleware/utils/v3MigrationUtils.js.map +1 -1
- package/build/error/common.d.ts +2 -8
- package/build/error/common.d.ts.map +1 -1
- package/build/error/common.js +8 -33
- package/build/error/common.js.map +1 -1
- package/build/index.d.ts +2 -0
- package/build/index.d.ts.map +1 -1
- package/build/index.js +2 -0
- package/build/index.js.map +1 -1
- package/build/question/constants.d.ts +4 -0
- package/build/question/constants.d.ts.map +1 -0
- package/build/question/constants.js +12 -0
- package/build/question/constants.js.map +1 -0
- package/build/question/create.d.ts +11 -3
- package/build/question/create.d.ts.map +1 -1
- package/build/question/create.js +339 -248
- package/build/question/create.js.map +1 -1
- package/build/question/generator.d.ts +4 -0
- package/build/question/generator.d.ts.map +1 -0
- package/build/question/generator.js +371 -0
- package/build/question/generator.js.map +1 -0
- package/build/question/index.d.ts +18 -30
- package/build/question/index.d.ts.map +1 -1
- package/build/question/index.js +13 -47
- package/build/question/index.js.map +1 -1
- package/build/question/inputs/CreateEnvInputs.d.ts +14 -0
- package/build/question/inputs/CreateEnvInputs.d.ts.map +1 -0
- package/build/question/inputs/CreateEnvInputs.js +5 -0
- package/build/question/inputs/CreateEnvInputs.js.map +1 -0
- package/build/question/inputs/CreateProjectInputs.d.ts +40 -0
- package/build/question/inputs/CreateProjectInputs.d.ts.map +1 -0
- package/build/question/inputs/CreateProjectInputs.js +5 -0
- package/build/question/inputs/CreateProjectInputs.js.map +1 -0
- package/build/question/inputs/CreateSampleProjectInputs.d.ts +12 -0
- package/build/question/inputs/CreateSampleProjectInputs.d.ts.map +1 -0
- package/build/question/inputs/CreateSampleProjectInputs.js +5 -0
- package/build/question/inputs/CreateSampleProjectInputs.js.map +1 -0
- package/build/question/inputs/DeployAadManifestInputs.d.ts +14 -0
- package/build/question/inputs/DeployAadManifestInputs.d.ts.map +1 -0
- package/build/question/inputs/DeployAadManifestInputs.js +5 -0
- package/build/question/inputs/DeployAadManifestInputs.js.map +1 -0
- package/build/question/inputs/PermissionGrantInputs.d.ts +18 -0
- package/build/question/inputs/PermissionGrantInputs.d.ts.map +1 -0
- package/build/question/inputs/PermissionGrantInputs.js +5 -0
- package/build/question/inputs/PermissionGrantInputs.js.map +1 -0
- package/build/question/inputs/PermissionListInputs.d.ts +16 -0
- package/build/question/inputs/PermissionListInputs.d.ts.map +1 -0
- package/build/question/inputs/PermissionListInputs.js +5 -0
- package/build/question/inputs/PermissionListInputs.js.map +1 -0
- package/build/question/inputs/PreviewTeamsAppInputs.d.ts +14 -0
- package/build/question/inputs/PreviewTeamsAppInputs.d.ts.map +1 -0
- package/build/question/inputs/PreviewTeamsAppInputs.js +5 -0
- package/build/question/inputs/PreviewTeamsAppInputs.js.map +1 -0
- package/build/question/inputs/SPFxAddWebpartInputs.d.ts +18 -0
- package/build/question/inputs/SPFxAddWebpartInputs.d.ts.map +1 -0
- package/build/question/inputs/SPFxAddWebpartInputs.js +5 -0
- package/build/question/inputs/SPFxAddWebpartInputs.js.map +1 -0
- package/build/question/inputs/SelectTeamsManifestInputs.d.ts +12 -0
- package/build/question/inputs/SelectTeamsManifestInputs.d.ts.map +1 -0
- package/build/question/inputs/SelectTeamsManifestInputs.js +5 -0
- package/build/question/inputs/SelectTeamsManifestInputs.js.map +1 -0
- package/build/question/inputs/ValidateTeamsAppInputs.d.ts +14 -0
- package/build/question/inputs/ValidateTeamsAppInputs.d.ts.map +1 -0
- package/build/question/inputs/ValidateTeamsAppInputs.js +5 -0
- package/build/question/inputs/ValidateTeamsAppInputs.js.map +1 -0
- package/build/question/inputs/index.d.ts +11 -0
- package/build/question/inputs/index.d.ts.map +1 -0
- package/build/question/inputs/index.js +16 -0
- package/build/question/inputs/index.js.map +1 -0
- package/build/question/options/CreateEnvOptions.d.ts +10 -0
- package/build/question/options/CreateEnvOptions.d.ts.map +1 -0
- package/build/question/options/CreateEnvOptions.js +24 -0
- package/build/question/options/CreateEnvOptions.js.map +1 -0
- package/build/question/options/CreateProjectOptions.d.ts +10 -0
- package/build/question/options/CreateProjectOptions.d.ts.map +1 -0
- package/build/question/options/CreateProjectOptions.js +139 -0
- package/build/question/options/CreateProjectOptions.js.map +1 -0
- package/build/question/options/CreateSampleProjectOptions.d.ts +10 -0
- package/build/question/options/CreateSampleProjectOptions.d.ts.map +1 -0
- package/build/question/options/CreateSampleProjectOptions.js +52 -0
- package/build/question/options/CreateSampleProjectOptions.js.map +1 -0
- package/build/question/options/DeployAadManifestOptions.d.ts +10 -0
- package/build/question/options/DeployAadManifestOptions.d.ts.map +1 -0
- package/build/question/options/DeployAadManifestOptions.js +21 -0
- package/build/question/options/DeployAadManifestOptions.js.map +1 -0
- package/build/question/options/PermissionGrantOptions.d.ts +10 -0
- package/build/question/options/PermissionGrantOptions.d.ts.map +1 -0
- package/build/question/options/PermissionGrantOptions.js +33 -0
- package/build/question/options/PermissionGrantOptions.js.map +1 -0
- package/build/question/options/PermissionListOptions.d.ts +10 -0
- package/build/question/options/PermissionListOptions.d.ts.map +1 -0
- package/build/question/options/PermissionListOptions.js +28 -0
- package/build/question/options/PermissionListOptions.js.map +1 -0
- package/build/question/options/PreviewTeamsAppOptions.d.ts +10 -0
- package/build/question/options/PreviewTeamsAppOptions.d.ts.map +1 -0
- package/build/question/options/PreviewTeamsAppOptions.js +26 -0
- package/build/question/options/PreviewTeamsAppOptions.js.map +1 -0
- package/build/question/options/SPFxAddWebpartOptions.d.ts +10 -0
- package/build/question/options/SPFxAddWebpartOptions.d.ts.map +1 -0
- package/build/question/options/SPFxAddWebpartOptions.js +38 -0
- package/build/question/options/SPFxAddWebpartOptions.js.map +1 -0
- package/build/question/options/SelectTeamsManifestOptions.d.ts +10 -0
- package/build/question/options/SelectTeamsManifestOptions.d.ts.map +1 -0
- package/build/question/options/SelectTeamsManifestOptions.js +17 -0
- package/build/question/options/SelectTeamsManifestOptions.js.map +1 -0
- package/build/question/options/ValidateTeamsAppOptions.d.ts +10 -0
- package/build/question/options/ValidateTeamsAppOptions.d.ts.map +1 -0
- package/build/question/options/ValidateTeamsAppOptions.js +23 -0
- package/build/question/options/ValidateTeamsAppOptions.js.map +1 -0
- package/build/question/options/index.d.ts +11 -0
- package/build/question/options/index.d.ts.map +1 -0
- package/build/question/options/index.js +16 -0
- package/build/question/options/index.js.map +1 -0
- package/build/question/other.d.ts +12 -1
- package/build/question/other.d.ts.map +1 -1
- package/build/question/other.js +123 -30
- package/build/question/other.js.map +1 -1
- package/build/question/questionNames.d.ts +6 -1
- package/build/question/questionNames.d.ts.map +1 -1
- package/build/question/questionNames.js +8 -2
- package/build/question/questionNames.js.map +1 -1
- package/build/ui/validationUtils.d.ts +15 -0
- package/build/ui/validationUtils.d.ts.map +1 -0
- package/build/ui/validationUtils.js +95 -0
- package/build/ui/validationUtils.js.map +1 -0
- package/build/ui/visitor.d.ts +13 -1
- package/build/ui/visitor.d.ts.map +1 -1
- package/build/ui/visitor.js +257 -232
- package/build/ui/visitor.js.map +1 -1
- package/package.json +9 -10
- package/resource/package.nls.json +34 -14
- package/resource/yaml-schema/{1.1.1 → v1.2}/yaml.schema.json +11 -5
- 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/templates/plugins/resource/aad/auth/V3/Tab/GetUserProfile.razor +1 -2
- package/templates/plugins/resource/aad/auth/bot/README.md +281 -263
- package/templates/plugins/resource/aad/auth/bot/js/sso/handleMessageExtensionQueryWithToken.js +13 -3
- package/templates/plugins/resource/aad/auth/bot/js/sso/profileSsoCommandHandler.js +14 -5
- package/templates/plugins/resource/aad/auth/bot/ts/sso/handleMessageExtensionQueryWithToken.ts +11 -3
- package/templates/plugins/resource/aad/auth/bot/ts/sso/profileSsoCommandHandler.ts +12 -3
- package/templates/plugins/resource/aad/auth/tab/csharp/GetUserProfile.razor +1 -2
- package/build/component/driver/middleware/updateProgress.d.ts +0 -6
- package/build/component/driver/middleware/updateProgress.d.ts.map +0 -1
- package/build/component/driver/middleware/updateProgress.js +0 -15
- package/build/component/driver/middleware/updateProgress.js.map +0 -1
- package/build/core/FxCoreImplementV3.d.ts +0 -47
- package/build/core/FxCoreImplementV3.d.ts.map +0 -1
- package/build/core/FxCoreImplementV3.js +0 -702
- package/build/core/FxCoreImplementV3.js.map +0 -1
package/build/ui/visitor.d.ts
CHANGED
|
@@ -1,6 +1,18 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { FxError, IQTreeNode, InputResult, Inputs, MultiSelectQuestion, Question, Result, SingleSelectQuestion, StaticOptions, TelemetryReporter, UserInteraction, Void } from "@microsoft/teamsfx-api";
|
|
2
2
|
export declare function isAutoSkipSelect(q: Question): boolean;
|
|
3
3
|
export declare function getSingleOption(q: SingleSelectQuestion | MultiSelectQuestion, option?: StaticOptions): any;
|
|
4
|
+
export declare function loadOptions(question: SingleSelectQuestion | MultiSelectQuestion, inputs: Inputs): Promise<StaticOptions>;
|
|
4
5
|
export declare type QuestionTreeVisitor = (question: Question, ui: UserInteraction, inputs: Inputs, step?: number, totalSteps?: number) => Promise<Result<InputResult<any>, FxError>>;
|
|
6
|
+
/**
|
|
7
|
+
* ask question when visiting the question tree
|
|
8
|
+
* @param question
|
|
9
|
+
* @param core
|
|
10
|
+
* @param inputs
|
|
11
|
+
*/
|
|
12
|
+
export declare const questionVisitor: QuestionTreeVisitor;
|
|
13
|
+
/**
|
|
14
|
+
* serialize the tree node into array in DFS order
|
|
15
|
+
*/
|
|
16
|
+
export declare function collect(node: IQTreeNode, list: IQTreeNode[], parentMap: Map<IQTreeNode, IQTreeNode>): void;
|
|
5
17
|
export declare function traverse(root: IQTreeNode, inputs: Inputs, ui: UserInteraction, telemetryReporter?: TelemetryReporter, visitor?: QuestionTreeVisitor): Promise<Result<Void, FxError>>;
|
|
6
18
|
//# sourceMappingURL=visitor.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"visitor.d.ts","sourceRoot":"","sources":["../../src/ui/visitor.ts"],"names":[],"mappings":"AAGA,OAAO,
|
|
1
|
+
{"version":3,"file":"visitor.d.ts","sourceRoot":"","sources":["../../src/ui/visitor.ts"],"names":[],"mappings":"AAGA,OAAO,EACL,OAAO,EACP,UAAU,EACV,WAAW,EACX,MAAM,EACN,mBAAmB,EAGnB,QAAQ,EACR,MAAM,EACN,oBAAoB,EACpB,aAAa,EAGb,iBAAiB,EAEjB,eAAe,EACf,IAAI,EAKL,MAAM,wBAAwB,CAAC;AAYhC,wBAAgB,gBAAgB,CAAC,CAAC,EAAE,QAAQ,GAAG,OAAO,CAQrD;AAED,wBAAgB,eAAe,CAC7B,CAAC,EAAE,oBAAoB,GAAG,mBAAmB,EAC7C,MAAM,CAAC,EAAE,aAAa,GACrB,GAAG,CAWL;AASD,wBAAsB,WAAW,CAC/B,QAAQ,EAAE,oBAAoB,GAAG,mBAAmB,EACpD,MAAM,EAAE,MAAM,GACb,OAAO,CAAC,aAAa,CAAC,CAMxB;AAED,oBAAY,mBAAmB,GAAG,CAChC,QAAQ,EAAE,QAAQ,EAClB,EAAE,EAAE,eAAe,EACnB,MAAM,EAAE,MAAM,EACd,IAAI,CAAC,EAAE,MAAM,EACb,UAAU,CAAC,EAAE,MAAM,KAChB,OAAO,CAAC,MAAM,CAAC,WAAW,CAAC,GAAG,CAAC,EAAE,OAAO,CAAC,CAAC,CAAC;AAEhD;;;;;GAKG;AACH,eAAO,MAAM,eAAe,EAAE,mBAwO7B,CAAC;AAEF;;GAEG;AACH,wBAAgB,OAAO,CACrB,IAAI,EAAE,UAAU,EAChB,IAAI,EAAE,UAAU,EAAE,EAClB,SAAS,EAAE,GAAG,CAAC,UAAU,EAAE,UAAU,CAAC,GACrC,IAAI,CAUN;AAED,wBAAsB,QAAQ,CAC5B,IAAI,EAAE,UAAU,EAChB,MAAM,EAAE,MAAM,EACd,EAAE,EAAE,eAAe,EACnB,iBAAiB,CAAC,EAAE,iBAAiB,EACrC,OAAO,GAAE,mBAAqC,GAC7C,OAAO,CAAC,MAAM,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC,CAmGhC"}
|
package/build/ui/visitor.js
CHANGED
|
@@ -2,9 +2,12 @@
|
|
|
2
2
|
// Copyright (c) Microsoft Corporation.
|
|
3
3
|
// Licensed under the MIT license.
|
|
4
4
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5
|
-
exports.traverse = exports.getSingleOption = exports.isAutoSkipSelect = void 0;
|
|
5
|
+
exports.traverse = exports.collect = exports.questionVisitor = exports.loadOptions = exports.getSingleOption = exports.isAutoSkipSelect = void 0;
|
|
6
6
|
const teamsfx_api_1 = require("@microsoft/teamsfx-api");
|
|
7
|
+
const lodash_1 = require("lodash");
|
|
7
8
|
const error_1 = require("../error");
|
|
9
|
+
const validationUtils_1 = require("./validationUtils");
|
|
10
|
+
const featureFlags_1 = require("../common/featureFlags");
|
|
8
11
|
function isAutoSkipSelect(q) {
|
|
9
12
|
if (q.type === "singleSelect" || q.type === "multiSelect") {
|
|
10
13
|
const select = q;
|
|
@@ -40,6 +43,14 @@ async function getCallFuncValue(inputs, raw) {
|
|
|
40
43
|
}
|
|
41
44
|
return raw;
|
|
42
45
|
}
|
|
46
|
+
async function loadOptions(question, inputs) {
|
|
47
|
+
let options = question.staticOptions;
|
|
48
|
+
if (question.dynamicOptions) {
|
|
49
|
+
options = await question.dynamicOptions(inputs);
|
|
50
|
+
}
|
|
51
|
+
return options;
|
|
52
|
+
}
|
|
53
|
+
exports.loadOptions = loadOptions;
|
|
43
54
|
/**
|
|
44
55
|
* ask question when visiting the question tree
|
|
45
56
|
* @param question
|
|
@@ -47,306 +58,320 @@ async function getCallFuncValue(inputs, raw) {
|
|
|
47
58
|
* @param inputs
|
|
48
59
|
*/
|
|
49
60
|
const questionVisitor = async function (question, ui, inputs, step, totalSteps) {
|
|
61
|
+
// check and validate preset answer
|
|
50
62
|
if (inputs[question.name] !== undefined) {
|
|
63
|
+
// validate existing answer in inputs object
|
|
64
|
+
const res = await validationUtils_1.validationUtils.validateInputs(question, inputs[question.name], inputs);
|
|
65
|
+
if (res)
|
|
66
|
+
return teamsfx_api_1.err(new error_1.InputValidationError(question.name, res, "questionVisitor"));
|
|
51
67
|
return teamsfx_api_1.ok({ type: "skip", result: inputs[question.name] });
|
|
52
68
|
}
|
|
53
|
-
|
|
54
|
-
if (
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
if (
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
func: question.func,
|
|
62
|
-
inputs: inputs,
|
|
63
|
-
});
|
|
64
|
-
}
|
|
65
|
-
else {
|
|
66
|
-
res = await question.func(inputs);
|
|
67
|
-
}
|
|
68
|
-
if (typeof res === "object" && "isOk" in res) {
|
|
69
|
-
const fxresult = res;
|
|
70
|
-
if (fxresult.isOk()) {
|
|
71
|
-
return teamsfx_api_1.ok({ type: "success", result: fxresult.value });
|
|
69
|
+
// non-interactive mode
|
|
70
|
+
if (inputs.nonInteractive && featureFlags_1.isCliNewUxEnabled()) {
|
|
71
|
+
// first priority: use single option as value
|
|
72
|
+
if (question.type === "singleSelect" || question.type === "multiSelect") {
|
|
73
|
+
if (question.skipSingleOption) {
|
|
74
|
+
const options = await loadOptions(question, inputs);
|
|
75
|
+
if (options.length === 0) {
|
|
76
|
+
return teamsfx_api_1.err(new error_1.EmptyOptionError(question.name, "questionVisitor"));
|
|
72
77
|
}
|
|
73
|
-
|
|
74
|
-
|
|
78
|
+
if (options.length === 1) {
|
|
79
|
+
const value = getSingleOption(question, options);
|
|
80
|
+
if (value) {
|
|
81
|
+
return teamsfx_api_1.ok({ type: "skip", result: value });
|
|
82
|
+
}
|
|
75
83
|
}
|
|
76
84
|
}
|
|
77
|
-
return teamsfx_api_1.ok({ type: "success", result: res });
|
|
78
|
-
}
|
|
79
|
-
catch (e) {
|
|
80
|
-
return teamsfx_api_1.err(error_1.assembleError(e));
|
|
81
85
|
}
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
if (typeof question.default === "function") {
|
|
90
|
-
defaultValue = async () => {
|
|
91
|
-
return question.default(inputs);
|
|
92
|
-
};
|
|
86
|
+
// second priority: use default as value
|
|
87
|
+
if (question.default) {
|
|
88
|
+
const value = (await getCallFuncValue(inputs, question.default));
|
|
89
|
+
if (value) {
|
|
90
|
+
const validateRes = await validationUtils_1.validationUtils.validateInputs(question, value, inputs);
|
|
91
|
+
if (validateRes) {
|
|
92
|
+
return teamsfx_api_1.err(new error_1.InputValidationError(question.name, validateRes, "questionVisitor"));
|
|
93
93
|
}
|
|
94
94
|
else {
|
|
95
|
-
|
|
95
|
+
return teamsfx_api_1.ok({ type: "skip", result: value });
|
|
96
96
|
}
|
|
97
97
|
}
|
|
98
98
|
}
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
title: title,
|
|
112
|
-
password: inputQuestion.password,
|
|
113
|
-
default: defaultValue,
|
|
114
|
-
placeholder: placeholder,
|
|
115
|
-
prompt: prompt,
|
|
116
|
-
validation: validationFunc,
|
|
117
|
-
step: step,
|
|
118
|
-
totalSteps: totalSteps,
|
|
119
|
-
additionalValidationOnAccept: additionalValidationOnAcceptFunc,
|
|
120
|
-
});
|
|
121
|
-
}
|
|
122
|
-
else if (question.type === "singleSelect" || question.type === "multiSelect") {
|
|
123
|
-
const selectQuestion = question;
|
|
124
|
-
let options = undefined;
|
|
125
|
-
if (selectQuestion.dynamicOptions) {
|
|
126
|
-
options = async () => {
|
|
127
|
-
return selectQuestion.dynamicOptions(inputs);
|
|
99
|
+
return teamsfx_api_1.err(new error_1.MissingRequiredInputError(question.name, "questionVisitor"));
|
|
100
|
+
}
|
|
101
|
+
// interactive mode
|
|
102
|
+
const title = (await getCallFuncValue(inputs, question.title));
|
|
103
|
+
let defaultValue = undefined;
|
|
104
|
+
if (question.forgetLastValue !== true && question.value)
|
|
105
|
+
defaultValue = question.value;
|
|
106
|
+
else {
|
|
107
|
+
if (question.default) {
|
|
108
|
+
if (typeof question.default === "function") {
|
|
109
|
+
defaultValue = async () => {
|
|
110
|
+
return await question.default(inputs);
|
|
128
111
|
};
|
|
129
112
|
}
|
|
130
113
|
else {
|
|
131
|
-
|
|
132
|
-
return teamsfx_api_1.err(new error_1.EmptyOptionError());
|
|
133
|
-
}
|
|
134
|
-
if (selectQuestion.skipSingleOption && selectQuestion.staticOptions.length === 1) {
|
|
135
|
-
const returnResult = getSingleOption(selectQuestion, selectQuestion.staticOptions);
|
|
136
|
-
return teamsfx_api_1.ok({ type: "skip", result: returnResult });
|
|
137
|
-
}
|
|
138
|
-
options = selectQuestion.staticOptions;
|
|
114
|
+
defaultValue = question.default;
|
|
139
115
|
}
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
const placeholder = (await getCallFuncValue(inputs, question.placeholder));
|
|
119
|
+
const prompt = (await getCallFuncValue(inputs, question.prompt));
|
|
120
|
+
if (question.type === "text") {
|
|
121
|
+
const validationFunc = question.validation
|
|
122
|
+
? teamsfx_api_1.getValidationFunction(question.validation, inputs)
|
|
123
|
+
: undefined;
|
|
124
|
+
const additionalValidationOnAcceptFunc = question.additionalValidationOnAccept
|
|
125
|
+
? teamsfx_api_1.getValidationFunction(question.additionalValidationOnAccept, inputs)
|
|
126
|
+
: undefined;
|
|
127
|
+
return await ui.inputText({
|
|
128
|
+
name: question.name,
|
|
129
|
+
title: title,
|
|
130
|
+
password: question.password,
|
|
131
|
+
default: defaultValue,
|
|
132
|
+
placeholder: placeholder,
|
|
133
|
+
prompt: prompt,
|
|
134
|
+
validation: validationFunc,
|
|
135
|
+
step: step,
|
|
136
|
+
totalSteps: totalSteps,
|
|
137
|
+
additionalValidationOnAccept: additionalValidationOnAcceptFunc,
|
|
138
|
+
});
|
|
139
|
+
}
|
|
140
|
+
else if (question.type === "singleSelect" || question.type === "multiSelect") {
|
|
141
|
+
let options = undefined;
|
|
142
|
+
if (question.dynamicOptions) {
|
|
143
|
+
options = async () => {
|
|
144
|
+
return question.dynamicOptions(inputs);
|
|
145
|
+
};
|
|
146
|
+
}
|
|
147
|
+
else {
|
|
148
|
+
if (!question.staticOptions || question.staticOptions.length === 0) {
|
|
149
|
+
return teamsfx_api_1.err(new error_1.EmptyOptionError(question.name, "questionVisitor"));
|
|
158
150
|
}
|
|
159
|
-
|
|
160
|
-
const
|
|
161
|
-
|
|
162
|
-
? teamsfx_api_1.getValidationFunction(question.validation, inputs)
|
|
163
|
-
: undefined;
|
|
164
|
-
return await ui.selectOptions({
|
|
165
|
-
name: question.name,
|
|
166
|
-
title: title,
|
|
167
|
-
options: options,
|
|
168
|
-
returnObject: selectQuestion.returnObject,
|
|
169
|
-
default: defaultValue,
|
|
170
|
-
placeholder: placeholder,
|
|
171
|
-
prompt: prompt,
|
|
172
|
-
onDidChangeSelection: mq.onDidChangeSelection,
|
|
173
|
-
step: step,
|
|
174
|
-
totalSteps: totalSteps,
|
|
175
|
-
validation: validationFunc,
|
|
176
|
-
skipSingleOption: selectQuestion.skipSingleOption,
|
|
177
|
-
});
|
|
151
|
+
if (question.skipSingleOption && question.staticOptions.length === 1) {
|
|
152
|
+
const returnResult = getSingleOption(question, question.staticOptions);
|
|
153
|
+
return teamsfx_api_1.ok({ type: "skip", result: returnResult });
|
|
178
154
|
}
|
|
155
|
+
options = question.staticOptions;
|
|
179
156
|
}
|
|
180
|
-
|
|
157
|
+
if (question.type === "singleSelect") {
|
|
181
158
|
const validationFunc = question.validation
|
|
182
159
|
? teamsfx_api_1.getValidationFunction(question.validation, inputs)
|
|
183
160
|
: undefined;
|
|
184
|
-
return await ui.
|
|
161
|
+
return await ui.selectOption({
|
|
185
162
|
name: question.name,
|
|
186
163
|
title: title,
|
|
187
|
-
|
|
188
|
-
|
|
164
|
+
options: options,
|
|
165
|
+
returnObject: question.returnObject,
|
|
189
166
|
default: defaultValue,
|
|
190
|
-
step: step,
|
|
191
|
-
totalSteps: totalSteps,
|
|
192
|
-
validation: validationFunc,
|
|
193
|
-
});
|
|
194
|
-
}
|
|
195
|
-
else if (question.type === "singleFile") {
|
|
196
|
-
const validationFunc = question.validation
|
|
197
|
-
? teamsfx_api_1.getValidationFunction(question.validation, inputs)
|
|
198
|
-
: undefined;
|
|
199
|
-
return await ui.selectFile({
|
|
200
|
-
name: question.name,
|
|
201
|
-
title: title,
|
|
202
167
|
placeholder: placeholder,
|
|
203
168
|
prompt: prompt,
|
|
204
|
-
default: defaultValue,
|
|
205
169
|
step: step,
|
|
206
170
|
totalSteps: totalSteps,
|
|
171
|
+
buttons: question.buttons,
|
|
207
172
|
validation: validationFunc,
|
|
208
|
-
|
|
173
|
+
skipSingleOption: question.skipSingleOption,
|
|
209
174
|
});
|
|
210
175
|
}
|
|
211
|
-
else
|
|
176
|
+
else {
|
|
212
177
|
const validationFunc = question.validation
|
|
213
178
|
? teamsfx_api_1.getValidationFunction(question.validation, inputs)
|
|
214
179
|
: undefined;
|
|
215
|
-
return await ui.
|
|
180
|
+
return await ui.selectOptions({
|
|
216
181
|
name: question.name,
|
|
217
182
|
title: title,
|
|
218
|
-
|
|
219
|
-
|
|
183
|
+
options: options,
|
|
184
|
+
returnObject: question.returnObject,
|
|
220
185
|
default: defaultValue,
|
|
221
|
-
step: step,
|
|
222
|
-
totalSteps: totalSteps,
|
|
223
|
-
validation: validationFunc,
|
|
224
|
-
});
|
|
225
|
-
}
|
|
226
|
-
else if (question.type === "singleFileOrText" && !!ui.selectFileOrInput) {
|
|
227
|
-
const validationFunc = question.validation
|
|
228
|
-
? teamsfx_api_1.getValidationFunction(question.validation, inputs)
|
|
229
|
-
: undefined;
|
|
230
|
-
const additionalValidationOnAcceptFunc = question.inputBoxConfig.additionalValidationOnAccept
|
|
231
|
-
? teamsfx_api_1.getValidationFunction({ validFunc: question.inputBoxConfig.additionalValidationOnAccept }, inputs)
|
|
232
|
-
: undefined;
|
|
233
|
-
question.inputBoxConfig.additionalValidationOnAccept = additionalValidationOnAcceptFunc;
|
|
234
|
-
const res = await ui.selectFileOrInput({
|
|
235
|
-
name: question.name,
|
|
236
|
-
title: title,
|
|
237
186
|
placeholder: placeholder,
|
|
238
187
|
prompt: prompt,
|
|
239
|
-
|
|
240
|
-
inputBoxConfig: question.inputBoxConfig,
|
|
241
|
-
filters: question.filters,
|
|
188
|
+
onDidChangeSelection: question.onDidChangeSelection,
|
|
242
189
|
step: step,
|
|
243
190
|
totalSteps: totalSteps,
|
|
244
191
|
validation: validationFunc,
|
|
192
|
+
skipSingleOption: question.skipSingleOption,
|
|
245
193
|
});
|
|
246
|
-
return res;
|
|
247
194
|
}
|
|
248
195
|
}
|
|
196
|
+
else if (question.type === "multiFile") {
|
|
197
|
+
const validationFunc = question.validation
|
|
198
|
+
? teamsfx_api_1.getValidationFunction(question.validation, inputs)
|
|
199
|
+
: undefined;
|
|
200
|
+
return await ui.selectFiles({
|
|
201
|
+
name: question.name,
|
|
202
|
+
title: title,
|
|
203
|
+
placeholder: placeholder,
|
|
204
|
+
prompt: prompt,
|
|
205
|
+
default: defaultValue,
|
|
206
|
+
step: step,
|
|
207
|
+
totalSteps: totalSteps,
|
|
208
|
+
validation: validationFunc,
|
|
209
|
+
});
|
|
210
|
+
}
|
|
211
|
+
else if (question.type === "singleFile") {
|
|
212
|
+
const validationFunc = question.validation
|
|
213
|
+
? teamsfx_api_1.getValidationFunction(question.validation, inputs)
|
|
214
|
+
: undefined;
|
|
215
|
+
return await ui.selectFile({
|
|
216
|
+
name: question.name,
|
|
217
|
+
title: title,
|
|
218
|
+
placeholder: placeholder,
|
|
219
|
+
prompt: prompt,
|
|
220
|
+
default: defaultValue,
|
|
221
|
+
step: step,
|
|
222
|
+
totalSteps: totalSteps,
|
|
223
|
+
validation: validationFunc,
|
|
224
|
+
filters: question.filters,
|
|
225
|
+
});
|
|
226
|
+
}
|
|
227
|
+
else if (question.type === "folder") {
|
|
228
|
+
const validationFunc = question.validation
|
|
229
|
+
? teamsfx_api_1.getValidationFunction(question.validation, inputs)
|
|
230
|
+
: undefined;
|
|
231
|
+
return await ui.selectFolder({
|
|
232
|
+
name: question.name,
|
|
233
|
+
title: title,
|
|
234
|
+
placeholder: placeholder,
|
|
235
|
+
prompt: prompt,
|
|
236
|
+
default: defaultValue,
|
|
237
|
+
step: step,
|
|
238
|
+
totalSteps: totalSteps,
|
|
239
|
+
validation: validationFunc,
|
|
240
|
+
});
|
|
241
|
+
}
|
|
242
|
+
else if (question.type === "singleFileOrText" && !!ui.selectFileOrInput) {
|
|
243
|
+
const validationFunc = question.validation
|
|
244
|
+
? teamsfx_api_1.getValidationFunction(question.validation, inputs)
|
|
245
|
+
: undefined;
|
|
246
|
+
const inputValidationFunc = question.inputBoxConfig.validation
|
|
247
|
+
? teamsfx_api_1.getValidationFunction(question.inputBoxConfig.validation, inputs)
|
|
248
|
+
: undefined;
|
|
249
|
+
const innerTitle = (await getCallFuncValue(inputs, question.inputBoxConfig.title));
|
|
250
|
+
const innerPlaceholder = (await getCallFuncValue(inputs, question.inputBoxConfig.placeholder));
|
|
251
|
+
const innerPrompt = (await getCallFuncValue(inputs, question.inputBoxConfig.prompt));
|
|
252
|
+
const res = await ui.selectFileOrInput({
|
|
253
|
+
name: question.name,
|
|
254
|
+
title: title,
|
|
255
|
+
placeholder: placeholder,
|
|
256
|
+
prompt: prompt,
|
|
257
|
+
inputOptionItem: question.inputOptionItem,
|
|
258
|
+
inputBoxConfig: {
|
|
259
|
+
name: question.inputBoxConfig.name,
|
|
260
|
+
title: innerTitle,
|
|
261
|
+
placeholder: innerPlaceholder,
|
|
262
|
+
prompt: innerPrompt,
|
|
263
|
+
validation: inputValidationFunc,
|
|
264
|
+
step: question.inputBoxConfig.step,
|
|
265
|
+
},
|
|
266
|
+
filters: question.filters,
|
|
267
|
+
step: step,
|
|
268
|
+
totalSteps: totalSteps,
|
|
269
|
+
validation: validationFunc,
|
|
270
|
+
});
|
|
271
|
+
return res;
|
|
272
|
+
}
|
|
249
273
|
return teamsfx_api_1.err(new teamsfx_api_1.UserError("API", "UnsupportedNodeType", `Unsupported question node type:${JSON.stringify(question)}`, `Unsupported question node type:${JSON.stringify(question)}`));
|
|
250
274
|
};
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
275
|
+
exports.questionVisitor = questionVisitor;
|
|
276
|
+
/**
|
|
277
|
+
* serialize the tree node into array in DFS order
|
|
278
|
+
*/
|
|
279
|
+
function collect(node, list, parentMap) {
|
|
280
|
+
list.push(node);
|
|
281
|
+
if (node.children) {
|
|
282
|
+
for (const child of node.children) {
|
|
283
|
+
if (child) {
|
|
284
|
+
parentMap.set(child, node);
|
|
285
|
+
collect(child, list, parentMap);
|
|
286
|
+
}
|
|
287
|
+
}
|
|
288
|
+
}
|
|
289
|
+
}
|
|
290
|
+
exports.collect = collect;
|
|
291
|
+
async function traverse(root, inputs, ui, telemetryReporter, visitor = exports.questionVisitor) {
|
|
292
|
+
// The reason to clone is that we don't want to change the original inputs if user cancel the process
|
|
293
|
+
const clonedInputs = lodash_1.cloneDeep(inputs);
|
|
294
|
+
// 1. collect all nodes into array
|
|
257
295
|
const parentMap = new Map();
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
if
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
296
|
+
const nodeList = [];
|
|
297
|
+
collect(root, nodeList, parentMap);
|
|
298
|
+
const visitedNodeSet = new Set();
|
|
299
|
+
const visitedInputNodeArray = [];
|
|
300
|
+
let i = 0;
|
|
301
|
+
for (; i < nodeList.length; ++i) {
|
|
302
|
+
const node = nodeList[i];
|
|
303
|
+
// if parent node is not visited, current node should not be visited
|
|
304
|
+
const parent = parentMap.get(node);
|
|
305
|
+
if (parent) {
|
|
306
|
+
if (!visitedNodeSet.has(parent)) {
|
|
307
|
+
continue;
|
|
308
|
+
}
|
|
309
|
+
}
|
|
310
|
+
// 1. check condition
|
|
311
|
+
if (node.condition) {
|
|
312
|
+
let parentValue = undefined;
|
|
313
|
+
// const parent = parentMap.get(node);
|
|
314
|
+
if (parent) {
|
|
315
|
+
parentValue = findValue(parent, parentMap);
|
|
316
|
+
}
|
|
317
|
+
const validRes = await teamsfx_api_1.validate(node.condition, parentValue, clonedInputs);
|
|
318
|
+
if (validRes !== undefined) {
|
|
319
|
+
continue;
|
|
320
|
+
}
|
|
321
|
+
}
|
|
322
|
+
// 2. visit node if not group
|
|
323
|
+
if (node.data.type !== "group") {
|
|
324
|
+
const question = node.data;
|
|
325
|
+
let res;
|
|
269
326
|
try {
|
|
270
|
-
|
|
271
|
-
sendTelemetryEvent(telemetryReporter,
|
|
327
|
+
res = await visitor(question, ui, clonedInputs, visitedInputNodeArray.length + 1, undefined);
|
|
328
|
+
sendTelemetryEvent(telemetryReporter, res, question, clonedInputs);
|
|
272
329
|
}
|
|
273
330
|
catch (e) {
|
|
274
331
|
return teamsfx_api_1.err(error_1.assembleError(e));
|
|
275
332
|
}
|
|
276
|
-
if (
|
|
333
|
+
if (res.isErr()) {
|
|
277
334
|
// Cancel or Error
|
|
278
|
-
return teamsfx_api_1.err(
|
|
335
|
+
return teamsfx_api_1.err(res.error);
|
|
279
336
|
}
|
|
280
|
-
const inputResult =
|
|
337
|
+
const inputResult = res.value;
|
|
281
338
|
if (inputResult.type === "back") {
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
}
|
|
295
|
-
else {
|
|
296
|
-
break;
|
|
297
|
-
}
|
|
298
|
-
}
|
|
339
|
+
const prevNode = visitedInputNodeArray.pop();
|
|
340
|
+
if (!prevNode) {
|
|
341
|
+
return teamsfx_api_1.err(new error_1.UserCancelError());
|
|
342
|
+
}
|
|
343
|
+
for (--i; i >= 0; --i) {
|
|
344
|
+
const tmpNode = nodeList[i];
|
|
345
|
+
visitedNodeSet.delete(tmpNode);
|
|
346
|
+
// clear prevNode data
|
|
347
|
+
if (tmpNode.data.type !== "group") {
|
|
348
|
+
delete tmpNode.data.value;
|
|
349
|
+
delete tmpNode.data.valueType;
|
|
350
|
+
delete clonedInputs[tmpNode.data.name];
|
|
299
351
|
}
|
|
300
|
-
|
|
301
|
-
if (last.data.type !== "group")
|
|
302
|
-
delete inputs[last.data.name];
|
|
303
|
-
const lastIsAutoSkip = autoSkipSet.has(last);
|
|
304
|
-
if (last.data.type !== "group" && last.data.type !== "func" && !lastIsAutoSkip) {
|
|
305
|
-
found = true;
|
|
352
|
+
if (tmpNode === prevNode) {
|
|
306
353
|
break;
|
|
307
354
|
}
|
|
308
355
|
}
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
}
|
|
312
|
-
--step;
|
|
313
|
-
continue; //ignore the following steps
|
|
356
|
+
--i;
|
|
357
|
+
continue;
|
|
314
358
|
}
|
|
315
359
|
else {
|
|
316
|
-
//success or skip
|
|
360
|
+
//success or skip: set value
|
|
317
361
|
question.value = inputResult.result;
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
else {
|
|
324
|
-
++step;
|
|
362
|
+
question.valueType = inputResult.type;
|
|
363
|
+
clonedInputs[question.name] = question.value;
|
|
364
|
+
visitedNodeSet.add(node);
|
|
365
|
+
if (question.valueType === "success") {
|
|
366
|
+
visitedInputNodeArray.push(node);
|
|
325
367
|
}
|
|
326
368
|
}
|
|
327
369
|
}
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
const matchChildren = [];
|
|
331
|
-
const valueInMap = findValue(curr, parentMap); //curr.data.type !== "group" ? curr.data.value : undefined; //valueMap.get(curr);
|
|
332
|
-
for (const child of curr.children) {
|
|
333
|
-
if (!child)
|
|
334
|
-
continue;
|
|
335
|
-
if (child.condition) {
|
|
336
|
-
const validRes = await teamsfx_api_1.validate(child.condition, valueInMap, inputs);
|
|
337
|
-
if (validRes !== undefined) {
|
|
338
|
-
continue;
|
|
339
|
-
}
|
|
340
|
-
}
|
|
341
|
-
matchChildren.push(child);
|
|
342
|
-
}
|
|
343
|
-
for (let i = matchChildren.length - 1; i >= 0; --i) {
|
|
344
|
-
const child = matchChildren[i];
|
|
345
|
-
parentMap.set(child, curr);
|
|
346
|
-
stack.push(child);
|
|
347
|
-
}
|
|
370
|
+
else {
|
|
371
|
+
visitedNodeSet.add(node);
|
|
348
372
|
}
|
|
349
373
|
}
|
|
374
|
+
lodash_1.assign(inputs, clonedInputs);
|
|
350
375
|
return teamsfx_api_1.ok(teamsfx_api_1.Void);
|
|
351
376
|
}
|
|
352
377
|
exports.traverse = traverse;
|