@microsoft/teamsfx-core 2.0.4-alpha.4f379e6ab.0 → 2.0.4-alpha.5925cbfed.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/internal/dotnetChecker.d.ts.map +1 -1
- package/build/common/deps-checker/internal/dotnetChecker.js +2 -2
- package/build/common/deps-checker/internal/dotnetChecker.js.map +1 -1
- package/build/common/deps-checker/internal/funcToolChecker.d.ts.map +1 -1
- package/build/common/deps-checker/internal/funcToolChecker.js +2 -2
- package/build/common/deps-checker/internal/funcToolChecker.js.map +1 -1
- package/build/common/deps-checker/internal/nodeChecker.d.ts.map +1 -1
- package/build/common/deps-checker/internal/nodeChecker.js +7 -7
- package/build/common/deps-checker/internal/nodeChecker.js.map +1 -1
- package/build/common/deps-checker/internal/vxTestAppChecker.js +1 -1
- package/build/common/deps-checker/internal/vxTestAppChecker.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.js +1 -1
- package/build/common/local/localCertificateManager.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 +4 -4
- package/build/common/m365/launchHelper.js.map +1 -1
- package/build/common/projectSettingsHelper.js.map +1 -1
- package/build/common/samples-config-v3.json +213 -21
- package/build/common/samples.d.ts +9 -4
- package/build/common/samples.d.ts.map +1 -1
- package/build/common/samples.js +19 -26
- package/build/common/samples.js.map +1 -1
- package/build/common/spec-parser/adaptiveCardGenerator.d.ts +5 -0
- package/build/common/spec-parser/adaptiveCardGenerator.d.ts.map +1 -0
- package/build/common/spec-parser/adaptiveCardGenerator.js +113 -0
- package/build/common/spec-parser/adaptiveCardGenerator.js.map +1 -0
- package/build/common/spec-parser/constants.d.ts +15 -7
- package/build/common/spec-parser/constants.d.ts.map +1 -1
- package/build/common/spec-parser/constants.js +15 -7
- package/build/common/spec-parser/constants.js.map +1 -1
- package/build/common/spec-parser/interfaces.d.ts +70 -13
- package/build/common/spec-parser/interfaces.d.ts.map +1 -1
- package/build/common/spec-parser/interfaces.js +13 -13
- package/build/common/spec-parser/interfaces.js.map +1 -1
- package/build/common/spec-parser/manifestUpdater.d.ts +5 -0
- package/build/common/spec-parser/manifestUpdater.d.ts.map +1 -0
- package/build/common/spec-parser/manifestUpdater.js +78 -0
- package/build/common/spec-parser/manifestUpdater.js.map +1 -0
- package/build/common/spec-parser/specFilter.d.ts +3 -0
- package/build/common/spec-parser/specFilter.d.ts.map +1 -0
- package/build/common/spec-parser/specFilter.js +47 -0
- package/build/common/spec-parser/specFilter.js.map +1 -0
- package/build/common/spec-parser/specParser.d.ts +8 -4
- package/build/common/spec-parser/specParser.d.ts.map +1 -1
- package/build/common/spec-parser/specParser.js +62 -21
- package/build/common/spec-parser/specParser.js.map +1 -1
- package/build/common/spec-parser/utils.d.ts +7 -0
- package/build/common/spec-parser/utils.d.ts.map +1 -0
- package/build/common/spec-parser/utils.js +79 -0
- package/build/common/spec-parser/utils.js.map +1 -0
- package/build/common/telemetry.d.ts +0 -1
- package/build/common/telemetry.d.ts.map +1 -1
- package/build/common/telemetry.js +2 -11
- package/build/common/telemetry.js.map +1 -1
- package/build/common/tools.js +2 -2
- package/build/common/tools.js.map +1 -1
- package/build/component/configManager/interface.d.ts +2 -0
- 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 +12 -11
- 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 +10 -1
- package/build/component/configManager/parser.js.map +1 -1
- package/build/component/configManager/validator.js +1 -1
- 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 +5 -0
- package/build/component/constants.js.map +1 -1
- package/build/component/coordinator/index.d.ts +5 -3
- package/build/component/coordinator/index.d.ts.map +1 -1
- package/build/component/coordinator/index.js +27 -12
- package/build/component/coordinator/index.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 +4 -4
- package/build/component/developerPortalScaffoldUtils.js.map +1 -1
- 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/utility/aadAppClient.d.ts.map +1 -1
- package/build/component/driver/aad/utility/aadAppClient.js +22 -10
- 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/deployImpl.d.ts +2 -1
- package/build/component/driver/arm/deployImpl.d.ts.map +1 -1
- package/build/component/driver/arm/deployImpl.js +7 -0
- package/build/component/driver/arm/deployImpl.js.map +1 -1
- package/build/component/driver/arm/validator.d.ts.map +1 -1
- package/build/component/driver/arm/validator.js +3 -3
- package/build/component/driver/arm/validator.js.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/botFramework/createOrUpdateBot.d.ts.map +1 -1
- package/build/component/driver/botFramework/createOrUpdateBot.js +4 -2
- package/build/component/driver/botFramework/createOrUpdateBot.js.map +1 -1
- package/build/component/driver/deploy/azure/azureStorageStaticWebsiteConfigDriver.js +1 -1
- package/build/component/driver/deploy/azure/azureStorageStaticWebsiteConfigDriver.js.map +1 -1
- package/build/component/driver/deploy/spfx/deployDriver.js +3 -3
- package/build/component/driver/deploy/spfx/deployDriver.js.map +1 -1
- package/build/component/driver/devTool/installDriver.js +4 -4
- package/build/component/driver/devTool/installDriver.js.map +1 -1
- package/build/component/driver/file/createOrUpdateEnvironmentFile.js +2 -2
- package/build/component/driver/file/createOrUpdateEnvironmentFile.js.map +1 -1
- package/build/component/driver/file/createOrUpdateJsonFile.js +2 -2
- package/build/component/driver/file/createOrUpdateJsonFile.js.map +1 -1
- package/build/component/driver/m365/acquire.js +2 -2
- package/build/component/driver/m365/acquire.js.map +1 -1
- package/build/component/driver/teamsApp/appStudio.d.ts.map +1 -1
- package/build/component/driver/teamsApp/appStudio.js +6 -6
- package/build/component/driver/teamsApp/appStudio.js.map +1 -1
- package/build/component/driver/teamsApp/configure.d.ts.map +1 -1
- package/build/component/driver/teamsApp/configure.js +3 -13
- package/build/component/driver/teamsApp/configure.js.map +1 -1
- package/build/component/driver/teamsApp/constants.d.ts +0 -1
- package/build/component/driver/teamsApp/constants.d.ts.map +1 -1
- package/build/component/driver/teamsApp/constants.js +1 -2
- package/build/component/driver/teamsApp/constants.js.map +1 -1
- package/build/component/driver/teamsApp/copyAppPackageToSPFx.js +1 -1
- package/build/component/driver/teamsApp/copyAppPackageToSPFx.js.map +1 -1
- package/build/component/driver/teamsApp/create.js +1 -1
- package/build/component/driver/teamsApp/create.js.map +1 -1
- package/build/component/driver/teamsApp/createAppPackage.d.ts.map +1 -1
- package/build/component/driver/teamsApp/createAppPackage.js +26 -0
- package/build/component/driver/teamsApp/createAppPackage.js.map +1 -1
- package/build/component/driver/teamsApp/publishAppPackage.js +1 -1
- package/build/component/driver/teamsApp/publishAppPackage.js.map +1 -1
- package/build/component/driver/teamsApp/utils/ManifestUtils.d.ts +1 -1
- package/build/component/driver/teamsApp/utils/ManifestUtils.d.ts.map +1 -1
- package/build/component/driver/teamsApp/utils/ManifestUtils.js +2 -2
- package/build/component/driver/teamsApp/utils/ManifestUtils.js.map +1 -1
- package/build/component/driver/teamsApp/validate.js +1 -1
- package/build/component/driver/teamsApp/validate.js.map +1 -1
- package/build/component/driver/teamsApp/validateAppPackage.d.ts.map +1 -1
- package/build/component/driver/teamsApp/validateAppPackage.js +19 -7
- 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 -15
- package/build/component/feature/collaboration.js.map +1 -1
- package/build/component/feature/createAuthFiles.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 +96 -23
- package/build/component/generator/copilotPlugin/generator.js.map +1 -1
- package/build/component/generator/copilotPlugin/helper.d.ts +9 -7
- package/build/component/generator/copilotPlugin/helper.d.ts.map +1 -1
- package/build/component/generator/copilotPlugin/helper.js +163 -31
- 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.js +3 -3
- package/build/component/generator/generator.js.map +1 -1
- package/build/component/generator/generatorAction.d.ts.map +1 -1
- package/build/component/generator/generatorAction.js +4 -3
- package/build/component/generator/generatorAction.js.map +1 -1
- package/build/component/generator/officeAddin/helperMethods.js +3 -3
- package/build/component/generator/officeAddin/helperMethods.js.map +1 -1
- package/build/component/generator/spfx/depsChecker/generatorChecker.js +6 -6
- package/build/component/generator/spfx/depsChecker/generatorChecker.js.map +1 -1
- package/build/component/generator/spfx/depsChecker/yoChecker.d.ts +1 -1
- package/build/component/generator/spfx/depsChecker/yoChecker.d.ts.map +1 -1
- package/build/component/generator/spfx/depsChecker/yoChecker.js +7 -7
- 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 +12 -12
- package/build/component/generator/spfx/spfxGenerator.js.map +1 -1
- package/build/component/generator/spfx/utils/constants.d.ts +1 -0
- package/build/component/generator/spfx/utils/constants.d.ts.map +1 -1
- package/build/component/generator/spfx/utils/constants.js +1 -0
- package/build/component/generator/spfx/utils/constants.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 -3
- package/build/component/generator/utils.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/migrate.js.map +1 -1
- package/build/component/telemetry.d.ts.map +1 -1
- package/build/component/telemetry.js +3 -6
- package/build/component/telemetry.js.map +1 -1
- package/build/component/utils/azureResourceOperation.js +2 -2
- package/build/component/utils/azureResourceOperation.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 -4
- package/build/component/utils/common.js.map +1 -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 +3 -2
- package/build/component/utils/metadataUtil.js.map +1 -1
- package/build/component/utils/teamsFxTelemetryReporter.d.ts.map +1 -1
- package/build/component/utils/teamsFxTelemetryReporter.js +3 -6
- package/build/component/utils/teamsFxTelemetryReporter.js.map +1 -1
- package/build/component/utils.js.map +1 -1
- package/build/core/FxCore.d.ts +9 -2
- package/build/core/FxCore.d.ts.map +1 -1
- package/build/core/FxCore.js +13 -16
- package/build/core/FxCore.js.map +1 -1
- package/build/core/FxCoreImplementV3.d.ts +7 -2
- package/build/core/FxCoreImplementV3.d.ts.map +1 -1
- package/build/core/FxCoreImplementV3.js +81 -29
- package/build/core/FxCoreImplementV3.js.map +1 -1
- package/build/core/collaborator.d.ts +1 -1
- package/build/core/collaborator.d.ts.map +1 -1
- package/build/core/collaborator.js +18 -12
- package/build/core/collaborator.js.map +1 -1
- package/build/core/error.d.ts +6 -0
- package/build/core/error.d.ts.map +1 -1
- package/build/core/error.js +23 -1
- package/build/core/error.js.map +1 -1
- package/build/core/middleware/projectMigratorV3.d.ts +3 -1
- package/build/core/middleware/projectMigratorV3.d.ts.map +1 -1
- package/build/core/middleware/projectMigratorV3.js +1 -2
- 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.js.map +1 -1
- package/build/core/middleware/utils/debug/appLocalYmlGenerator.d.ts.map +1 -1
- package/build/core/middleware/utils/debug/appLocalYmlGenerator.js +3 -2
- package/build/core/middleware/utils/debug/appLocalYmlGenerator.js.map +1 -1
- package/build/core/middleware/utils/debug/debugV3MigrationUtils.js.map +1 -1
- package/build/core/middleware/utils/debug/taskMigrator.d.ts.map +1 -1
- package/build/core/middleware/utils/debug/taskMigrator.js +30 -15
- package/build/core/middleware/utils/debug/taskMigrator.js.map +1 -1
- package/build/core/middleware/utils/v3MigrationUtils.js +1 -1
- package/build/core/middleware/utils/v3MigrationUtils.js.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 +130 -15
- package/build/error/common.js.map +1 -1
- package/build/index.d.ts +1 -0
- package/build/index.d.ts.map +1 -1
- package/build/index.js +1 -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 +6 -2
- package/build/question/create.d.ts.map +1 -1
- package/build/question/create.js +334 -231
- package/build/question/create.js.map +1 -1
- package/build/question/generator.d.ts +3 -0
- package/build/question/generator.d.ts.map +1 -0
- package/build/question/generator.js +270 -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 +36 -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 +122 -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 +41 -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 +113 -28
- package/build/question/other.js.map +1 -1
- package/build/question/questionNames.d.ts +2 -0
- package/build/question/questionNames.d.ts.map +1 -1
- package/build/question/questionNames.js +2 -0
- package/build/question/questionNames.js.map +1 -1
- package/build/ui/validationUtils.d.ts +12 -0
- package/build/ui/validationUtils.d.ts.map +1 -0
- package/build/ui/validationUtils.js +84 -0
- package/build/ui/validationUtils.js.map +1 -0
- package/build/ui/visitor.d.ts +12 -1
- package/build/ui/visitor.d.ts.map +1 -1
- package/build/ui/visitor.js +327 -204
- package/build/ui/visitor.js.map +1 -1
- package/package.json +13 -6
- package/resource/package.nls.json +20 -4
- package/resource/yaml-schema/1.1.1/yaml.schema.json +1468 -0
- 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/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/build/component/generator/copilotPlugin/constant.d.ts +0 -4
- package/build/component/generator/copilotPlugin/constant.d.ts.map +0 -1
- package/build/component/generator/copilotPlugin/constant.js +0 -10
- package/build/component/generator/copilotPlugin/constant.js.map +0 -1
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.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;
|
|
@@ -47,10 +50,16 @@ async function getCallFuncValue(inputs, raw) {
|
|
|
47
50
|
* @param inputs
|
|
48
51
|
*/
|
|
49
52
|
const questionVisitor = async function (question, ui, inputs, step, totalSteps) {
|
|
53
|
+
// 1. check and validate preset answer
|
|
50
54
|
if (inputs[question.name] !== undefined) {
|
|
55
|
+
// validate existing answer in inputs object
|
|
56
|
+
const res = await validationUtils_1.validationUtils.validateManualInputs(question, inputs);
|
|
57
|
+
if (res)
|
|
58
|
+
return teamsfx_api_1.err(new error_1.InputValidationError(question.name, res));
|
|
51
59
|
return teamsfx_api_1.ok({ type: "skip", result: inputs[question.name] });
|
|
52
60
|
}
|
|
53
61
|
const title = (await getCallFuncValue(inputs, question.title));
|
|
62
|
+
// 2. run auto function question
|
|
54
63
|
if (question.type === "func") {
|
|
55
64
|
try {
|
|
56
65
|
let res;
|
|
@@ -68,277 +77,391 @@ const questionVisitor = async function (question, ui, inputs, step, totalSteps)
|
|
|
68
77
|
if (typeof res === "object" && "isOk" in res) {
|
|
69
78
|
const fxresult = res;
|
|
70
79
|
if (fxresult.isOk()) {
|
|
71
|
-
return teamsfx_api_1.ok({ type: "
|
|
80
|
+
return teamsfx_api_1.ok({ type: "skip", result: fxresult.value });
|
|
72
81
|
}
|
|
73
82
|
else {
|
|
74
83
|
return teamsfx_api_1.err(fxresult.error);
|
|
75
84
|
}
|
|
76
85
|
}
|
|
77
|
-
return teamsfx_api_1.ok({ type: "
|
|
86
|
+
return teamsfx_api_1.ok({ type: "skip", result: res });
|
|
78
87
|
}
|
|
79
88
|
catch (e) {
|
|
80
89
|
return teamsfx_api_1.err(error_1.assembleError(e));
|
|
81
90
|
}
|
|
82
91
|
}
|
|
92
|
+
// 3. for non-interactive mode, skip question asking and return error
|
|
93
|
+
if (inputs.nonInteractive && featureFlags_1.isCliNewUxEnabled()) {
|
|
94
|
+
return teamsfx_api_1.err(new error_1.MissingRequiredInputError(question.name, "core-ui"));
|
|
95
|
+
}
|
|
96
|
+
// 4. need manual input from user
|
|
97
|
+
let defaultValue = undefined;
|
|
98
|
+
if (question.forgetLastValue !== true && question.value)
|
|
99
|
+
defaultValue = question.value;
|
|
83
100
|
else {
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
if (question.default) {
|
|
89
|
-
if (typeof question.default === "function") {
|
|
90
|
-
defaultValue = async () => {
|
|
91
|
-
return question.default(inputs);
|
|
92
|
-
};
|
|
93
|
-
}
|
|
94
|
-
else {
|
|
95
|
-
defaultValue = question.default;
|
|
96
|
-
}
|
|
97
|
-
}
|
|
98
|
-
}
|
|
99
|
-
const placeholder = (await getCallFuncValue(inputs, question.placeholder));
|
|
100
|
-
const prompt = (await getCallFuncValue(inputs, question.prompt));
|
|
101
|
-
if (question.type === "text") {
|
|
102
|
-
const validationFunc = question.validation
|
|
103
|
-
? teamsfx_api_1.getValidationFunction(question.validation, inputs)
|
|
104
|
-
: undefined;
|
|
105
|
-
const inputQuestion = question;
|
|
106
|
-
return await ui.inputText({
|
|
107
|
-
name: question.name,
|
|
108
|
-
title: title,
|
|
109
|
-
password: inputQuestion.password,
|
|
110
|
-
default: defaultValue,
|
|
111
|
-
placeholder: placeholder,
|
|
112
|
-
prompt: prompt,
|
|
113
|
-
validation: validationFunc,
|
|
114
|
-
step: step,
|
|
115
|
-
totalSteps: totalSteps,
|
|
116
|
-
});
|
|
117
|
-
}
|
|
118
|
-
else if (question.type === "singleSelect" || question.type === "multiSelect") {
|
|
119
|
-
const selectQuestion = question;
|
|
120
|
-
let options = undefined;
|
|
121
|
-
if (selectQuestion.dynamicOptions) {
|
|
122
|
-
options = async () => {
|
|
123
|
-
return selectQuestion.dynamicOptions(inputs);
|
|
101
|
+
if (question.default) {
|
|
102
|
+
if (typeof question.default === "function") {
|
|
103
|
+
defaultValue = async () => {
|
|
104
|
+
return question.default(inputs);
|
|
124
105
|
};
|
|
125
106
|
}
|
|
126
107
|
else {
|
|
127
|
-
|
|
128
|
-
return teamsfx_api_1.err(new error_1.EmptyOptionError());
|
|
129
|
-
}
|
|
130
|
-
if (selectQuestion.skipSingleOption && selectQuestion.staticOptions.length === 1) {
|
|
131
|
-
const returnResult = getSingleOption(selectQuestion, selectQuestion.staticOptions);
|
|
132
|
-
return teamsfx_api_1.ok({ type: "skip", result: returnResult });
|
|
133
|
-
}
|
|
134
|
-
options = selectQuestion.staticOptions;
|
|
108
|
+
defaultValue = question.default;
|
|
135
109
|
}
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
const placeholder = (await getCallFuncValue(inputs, question.placeholder));
|
|
113
|
+
const prompt = (await getCallFuncValue(inputs, question.prompt));
|
|
114
|
+
if (question.type === "text") {
|
|
115
|
+
const validationFunc = question.validation
|
|
116
|
+
? teamsfx_api_1.getValidationFunction(question.validation, inputs)
|
|
117
|
+
: undefined;
|
|
118
|
+
const additionalValidationOnAcceptFunc = question.additionalValidationOnAccept
|
|
119
|
+
? teamsfx_api_1.getValidationFunction(question.additionalValidationOnAccept, inputs)
|
|
120
|
+
: undefined;
|
|
121
|
+
const inputQuestion = question;
|
|
122
|
+
return await ui.inputText({
|
|
123
|
+
name: question.name,
|
|
124
|
+
title: title,
|
|
125
|
+
password: inputQuestion.password,
|
|
126
|
+
default: defaultValue,
|
|
127
|
+
placeholder: placeholder,
|
|
128
|
+
prompt: prompt,
|
|
129
|
+
validation: validationFunc,
|
|
130
|
+
step: step,
|
|
131
|
+
totalSteps: totalSteps,
|
|
132
|
+
additionalValidationOnAccept: additionalValidationOnAcceptFunc,
|
|
133
|
+
});
|
|
134
|
+
}
|
|
135
|
+
else if (question.type === "singleSelect" || question.type === "multiSelect") {
|
|
136
|
+
const selectQuestion = question;
|
|
137
|
+
let options = undefined;
|
|
138
|
+
if (selectQuestion.dynamicOptions) {
|
|
139
|
+
options = async () => {
|
|
140
|
+
return selectQuestion.dynamicOptions(inputs);
|
|
141
|
+
};
|
|
142
|
+
}
|
|
143
|
+
else {
|
|
144
|
+
if (!selectQuestion.staticOptions || selectQuestion.staticOptions.length === 0) {
|
|
145
|
+
return teamsfx_api_1.err(new error_1.EmptyOptionError());
|
|
154
146
|
}
|
|
155
|
-
|
|
156
|
-
const
|
|
157
|
-
|
|
158
|
-
? teamsfx_api_1.getValidationFunction(question.validation, inputs)
|
|
159
|
-
: undefined;
|
|
160
|
-
return await ui.selectOptions({
|
|
161
|
-
name: question.name,
|
|
162
|
-
title: title,
|
|
163
|
-
options: options,
|
|
164
|
-
returnObject: selectQuestion.returnObject,
|
|
165
|
-
default: defaultValue,
|
|
166
|
-
placeholder: placeholder,
|
|
167
|
-
prompt: prompt,
|
|
168
|
-
onDidChangeSelection: mq.onDidChangeSelection,
|
|
169
|
-
step: step,
|
|
170
|
-
totalSteps: totalSteps,
|
|
171
|
-
validation: validationFunc,
|
|
172
|
-
skipSingleOption: selectQuestion.skipSingleOption,
|
|
173
|
-
});
|
|
147
|
+
if (selectQuestion.skipSingleOption && selectQuestion.staticOptions.length === 1) {
|
|
148
|
+
const returnResult = getSingleOption(selectQuestion, selectQuestion.staticOptions);
|
|
149
|
+
return teamsfx_api_1.ok({ type: "skip", result: returnResult });
|
|
174
150
|
}
|
|
151
|
+
options = selectQuestion.staticOptions;
|
|
175
152
|
}
|
|
176
|
-
|
|
153
|
+
if (question.type === "singleSelect") {
|
|
177
154
|
const validationFunc = question.validation
|
|
178
155
|
? teamsfx_api_1.getValidationFunction(question.validation, inputs)
|
|
179
156
|
: undefined;
|
|
180
|
-
return await ui.
|
|
157
|
+
return await ui.selectOption({
|
|
181
158
|
name: question.name,
|
|
182
159
|
title: title,
|
|
183
|
-
|
|
184
|
-
|
|
160
|
+
options: options,
|
|
161
|
+
returnObject: selectQuestion.returnObject,
|
|
185
162
|
default: defaultValue,
|
|
186
|
-
step: step,
|
|
187
|
-
totalSteps: totalSteps,
|
|
188
|
-
validation: validationFunc,
|
|
189
|
-
});
|
|
190
|
-
}
|
|
191
|
-
else if (question.type === "singleFile") {
|
|
192
|
-
const validationFunc = question.validation
|
|
193
|
-
? teamsfx_api_1.getValidationFunction(question.validation, inputs)
|
|
194
|
-
: undefined;
|
|
195
|
-
return await ui.selectFile({
|
|
196
|
-
name: question.name,
|
|
197
|
-
title: title,
|
|
198
163
|
placeholder: placeholder,
|
|
199
164
|
prompt: prompt,
|
|
200
|
-
default: defaultValue,
|
|
201
165
|
step: step,
|
|
202
166
|
totalSteps: totalSteps,
|
|
167
|
+
buttons: question.buttons,
|
|
203
168
|
validation: validationFunc,
|
|
204
|
-
|
|
169
|
+
skipSingleOption: selectQuestion.skipSingleOption,
|
|
205
170
|
});
|
|
206
171
|
}
|
|
207
|
-
else
|
|
172
|
+
else {
|
|
173
|
+
const mq = selectQuestion;
|
|
208
174
|
const validationFunc = question.validation
|
|
209
175
|
? teamsfx_api_1.getValidationFunction(question.validation, inputs)
|
|
210
176
|
: undefined;
|
|
211
|
-
return await ui.
|
|
177
|
+
return await ui.selectOptions({
|
|
212
178
|
name: question.name,
|
|
213
179
|
title: title,
|
|
214
|
-
|
|
215
|
-
|
|
180
|
+
options: options,
|
|
181
|
+
returnObject: selectQuestion.returnObject,
|
|
216
182
|
default: defaultValue,
|
|
217
|
-
step: step,
|
|
218
|
-
totalSteps: totalSteps,
|
|
219
|
-
validation: validationFunc,
|
|
220
|
-
});
|
|
221
|
-
}
|
|
222
|
-
else if (question.type === "singleFileOrText" && !!ui.selectFileOrInput) {
|
|
223
|
-
const validationFunc = question.validation
|
|
224
|
-
? teamsfx_api_1.getValidationFunction(question.validation, inputs)
|
|
225
|
-
: undefined;
|
|
226
|
-
const res = await ui.selectFileOrInput({
|
|
227
|
-
name: question.name,
|
|
228
|
-
title: title,
|
|
229
183
|
placeholder: placeholder,
|
|
230
184
|
prompt: prompt,
|
|
231
|
-
|
|
232
|
-
inputBoxConfig: question.inputBoxConfig,
|
|
233
|
-
filters: question.filters,
|
|
185
|
+
onDidChangeSelection: mq.onDidChangeSelection,
|
|
234
186
|
step: step,
|
|
235
187
|
totalSteps: totalSteps,
|
|
236
188
|
validation: validationFunc,
|
|
189
|
+
skipSingleOption: selectQuestion.skipSingleOption,
|
|
237
190
|
});
|
|
238
|
-
return res;
|
|
239
191
|
}
|
|
240
192
|
}
|
|
193
|
+
else if (question.type === "multiFile") {
|
|
194
|
+
const validationFunc = question.validation
|
|
195
|
+
? teamsfx_api_1.getValidationFunction(question.validation, inputs)
|
|
196
|
+
: undefined;
|
|
197
|
+
return await ui.selectFiles({
|
|
198
|
+
name: question.name,
|
|
199
|
+
title: title,
|
|
200
|
+
placeholder: placeholder,
|
|
201
|
+
prompt: prompt,
|
|
202
|
+
default: defaultValue,
|
|
203
|
+
step: step,
|
|
204
|
+
totalSteps: totalSteps,
|
|
205
|
+
validation: validationFunc,
|
|
206
|
+
});
|
|
207
|
+
}
|
|
208
|
+
else if (question.type === "singleFile") {
|
|
209
|
+
const validationFunc = question.validation
|
|
210
|
+
? teamsfx_api_1.getValidationFunction(question.validation, inputs)
|
|
211
|
+
: undefined;
|
|
212
|
+
return await ui.selectFile({
|
|
213
|
+
name: question.name,
|
|
214
|
+
title: title,
|
|
215
|
+
placeholder: placeholder,
|
|
216
|
+
prompt: prompt,
|
|
217
|
+
default: defaultValue,
|
|
218
|
+
step: step,
|
|
219
|
+
totalSteps: totalSteps,
|
|
220
|
+
validation: validationFunc,
|
|
221
|
+
filters: question.filters,
|
|
222
|
+
});
|
|
223
|
+
}
|
|
224
|
+
else if (question.type === "folder") {
|
|
225
|
+
const validationFunc = question.validation
|
|
226
|
+
? teamsfx_api_1.getValidationFunction(question.validation, inputs)
|
|
227
|
+
: undefined;
|
|
228
|
+
return await ui.selectFolder({
|
|
229
|
+
name: question.name,
|
|
230
|
+
title: title,
|
|
231
|
+
placeholder: placeholder,
|
|
232
|
+
prompt: prompt,
|
|
233
|
+
default: defaultValue,
|
|
234
|
+
step: step,
|
|
235
|
+
totalSteps: totalSteps,
|
|
236
|
+
validation: validationFunc,
|
|
237
|
+
});
|
|
238
|
+
}
|
|
239
|
+
else if (question.type === "singleFileOrText" && !!ui.selectFileOrInput) {
|
|
240
|
+
const validationFunc = question.validation
|
|
241
|
+
? teamsfx_api_1.getValidationFunction(question.validation, inputs)
|
|
242
|
+
: undefined;
|
|
243
|
+
const additionalValidationOnAcceptFunc = question.inputBoxConfig.additionalValidationOnAccept
|
|
244
|
+
? teamsfx_api_1.getValidationFunction({ validFunc: question.inputBoxConfig.additionalValidationOnAccept }, inputs)
|
|
245
|
+
: undefined;
|
|
246
|
+
question.inputBoxConfig.additionalValidationOnAccept = additionalValidationOnAcceptFunc;
|
|
247
|
+
const res = await ui.selectFileOrInput({
|
|
248
|
+
name: question.name,
|
|
249
|
+
title: title,
|
|
250
|
+
placeholder: placeholder,
|
|
251
|
+
prompt: prompt,
|
|
252
|
+
inputOptionItem: question.inputOptionItem,
|
|
253
|
+
inputBoxConfig: question.inputBoxConfig,
|
|
254
|
+
filters: question.filters,
|
|
255
|
+
step: step,
|
|
256
|
+
totalSteps: totalSteps,
|
|
257
|
+
validation: validationFunc,
|
|
258
|
+
});
|
|
259
|
+
return res;
|
|
260
|
+
}
|
|
241
261
|
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)}`));
|
|
242
262
|
};
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
263
|
+
exports.questionVisitor = questionVisitor;
|
|
264
|
+
// export async function traverse(
|
|
265
|
+
// root: IQTreeNode,
|
|
266
|
+
// inputs: Inputs,
|
|
267
|
+
// ui: UserInteraction,
|
|
268
|
+
// telemetryReporter?: TelemetryReporter,
|
|
269
|
+
// visitor: QuestionTreeVisitor = questionVisitor
|
|
270
|
+
// ): Promise<Result<Void, FxError>> {
|
|
271
|
+
// const stack: IQTreeNode[] = [];
|
|
272
|
+
// const history: IQTreeNode[] = [];
|
|
273
|
+
// stack.push(root);
|
|
274
|
+
// let step = 1; // manual input step
|
|
275
|
+
// let totalStep = 1;
|
|
276
|
+
// const parentMap = new Map<IQTreeNode, IQTreeNode>();
|
|
277
|
+
// // const valueMap = new Map<QTreeNode, unknown>();
|
|
278
|
+
// const autoSkipSet = new Set<IQTreeNode>();
|
|
279
|
+
// while (stack.length > 0) {
|
|
280
|
+
// const curr = stack.pop();
|
|
281
|
+
// if (!curr) continue;
|
|
282
|
+
// //visit
|
|
283
|
+
// if (curr.data.type !== "group") {
|
|
284
|
+
// const question = curr.data;
|
|
285
|
+
// totalStep = step + stack.length;
|
|
286
|
+
// let qvRes;
|
|
287
|
+
// try {
|
|
288
|
+
// qvRes = await visitor(question, ui, inputs, step, totalStep);
|
|
289
|
+
// sendTelemetryEvent(telemetryReporter, qvRes, question, inputs);
|
|
290
|
+
// } catch (e) {
|
|
291
|
+
// return err(assembleError(e));
|
|
292
|
+
// }
|
|
293
|
+
// if (qvRes.isErr()) {
|
|
294
|
+
// // Cancel or Error
|
|
295
|
+
// return err(qvRes.error);
|
|
296
|
+
// }
|
|
297
|
+
// const inputResult = qvRes.value;
|
|
298
|
+
// if (inputResult.type === "back") {
|
|
299
|
+
// stack.push(curr);
|
|
300
|
+
// // find the previous input that is neither group nor func nor single option select
|
|
301
|
+
// let found = false;
|
|
302
|
+
// while (history.length > 0) {
|
|
303
|
+
// const last = history.pop();
|
|
304
|
+
// if (!last) continue;
|
|
305
|
+
// if (last.children) {
|
|
306
|
+
// while (stack.length > 0) {
|
|
307
|
+
// const tmp = stack[stack.length - 1];
|
|
308
|
+
// if (last.children.includes(tmp)) {
|
|
309
|
+
// stack.pop();
|
|
310
|
+
// } else {
|
|
311
|
+
// break;
|
|
312
|
+
// }
|
|
313
|
+
// }
|
|
314
|
+
// }
|
|
315
|
+
// stack.push(last);
|
|
316
|
+
// if (last.data.type !== "group") delete inputs[last.data.name];
|
|
317
|
+
// const lastIsAutoSkip = autoSkipSet.has(last);
|
|
318
|
+
// if (last.data.type !== "group" && last.data.type !== "func" && !lastIsAutoSkip) {
|
|
319
|
+
// found = true;
|
|
320
|
+
// break;
|
|
321
|
+
// }
|
|
322
|
+
// }
|
|
323
|
+
// if (!found) {
|
|
324
|
+
// return err(new UserCancelError());
|
|
325
|
+
// }
|
|
326
|
+
// --step;
|
|
327
|
+
// continue; //ignore the following steps
|
|
328
|
+
// } else {
|
|
329
|
+
// //success or skip
|
|
330
|
+
// question.value = inputResult.result;
|
|
331
|
+
// inputs[question.name] = question.value;
|
|
332
|
+
// if (inputResult.type === "skip" || question.type === "func") {
|
|
333
|
+
// if (inputResult.type === "skip") autoSkipSet.add(curr);
|
|
334
|
+
// } else {
|
|
335
|
+
// ++step;
|
|
336
|
+
// }
|
|
337
|
+
// }
|
|
338
|
+
// }
|
|
339
|
+
// history.push(curr);
|
|
340
|
+
// if (curr.children) {
|
|
341
|
+
// const matchChildren: IQTreeNode[] = [];
|
|
342
|
+
// const valueInMap = findValue(curr, parentMap); //curr.data.type !== "group" ? curr.data.value : undefined; //valueMap.get(curr);
|
|
343
|
+
// for (const child of curr.children) {
|
|
344
|
+
// if (!child) continue;
|
|
345
|
+
// if (child.condition) {
|
|
346
|
+
// const validRes = await validate(
|
|
347
|
+
// child.condition,
|
|
348
|
+
// valueInMap as string | string[] | OptionItem | OptionItem[],
|
|
349
|
+
// inputs
|
|
350
|
+
// );
|
|
351
|
+
// if (validRes !== undefined) {
|
|
352
|
+
// continue;
|
|
353
|
+
// }
|
|
354
|
+
// }
|
|
355
|
+
// matchChildren.push(child);
|
|
356
|
+
// }
|
|
357
|
+
// for (let i = matchChildren.length - 1; i >= 0; --i) {
|
|
358
|
+
// const child = matchChildren[i];
|
|
359
|
+
// parentMap.set(child, curr);
|
|
360
|
+
// stack.push(child);
|
|
361
|
+
// }
|
|
362
|
+
// }
|
|
363
|
+
// }
|
|
364
|
+
// return ok(Void);
|
|
365
|
+
// }
|
|
366
|
+
/**
|
|
367
|
+
* serialize the tree node into array in DFS order
|
|
368
|
+
*/
|
|
369
|
+
function collect(node, list, parentMap) {
|
|
370
|
+
list.push(node);
|
|
371
|
+
if (node.children) {
|
|
372
|
+
for (const child of node.children) {
|
|
373
|
+
if (child) {
|
|
374
|
+
parentMap.set(child, node);
|
|
375
|
+
collect(child, list, parentMap);
|
|
376
|
+
}
|
|
377
|
+
}
|
|
378
|
+
}
|
|
379
|
+
}
|
|
380
|
+
exports.collect = collect;
|
|
381
|
+
async function traverse(root, inputs, ui, telemetryReporter, visitor = exports.questionVisitor) {
|
|
382
|
+
// The reason to clone is that we don't want to change the original inputs if user cancel the process
|
|
383
|
+
const clonedInputs = lodash_1.cloneDeep(inputs);
|
|
384
|
+
// 1. collect all nodes into array
|
|
249
385
|
const parentMap = new Map();
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
if
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
386
|
+
const nodeList = [];
|
|
387
|
+
collect(root, nodeList, parentMap);
|
|
388
|
+
const visitedNodeSet = new Set();
|
|
389
|
+
const visitedInputNodeArray = [];
|
|
390
|
+
let i = 0;
|
|
391
|
+
for (; i < nodeList.length; ++i) {
|
|
392
|
+
const node = nodeList[i];
|
|
393
|
+
// if parent node is not visited, current node should not be visited
|
|
394
|
+
const parent = parentMap.get(node);
|
|
395
|
+
if (parent) {
|
|
396
|
+
if (!visitedNodeSet.has(parent)) {
|
|
397
|
+
continue;
|
|
398
|
+
}
|
|
399
|
+
}
|
|
400
|
+
// 1. check condition
|
|
401
|
+
if (node.condition) {
|
|
402
|
+
let parentValue = undefined;
|
|
403
|
+
// const parent = parentMap.get(node);
|
|
404
|
+
if (parent) {
|
|
405
|
+
parentValue = findValue(parent, parentMap);
|
|
406
|
+
}
|
|
407
|
+
const validRes = await teamsfx_api_1.validate(node.condition, parentValue, clonedInputs);
|
|
408
|
+
if (validRes !== undefined) {
|
|
409
|
+
continue;
|
|
410
|
+
}
|
|
411
|
+
}
|
|
412
|
+
// 2. visit node if not group
|
|
413
|
+
if (node.data.type !== "group") {
|
|
414
|
+
const question = node.data;
|
|
415
|
+
let res;
|
|
261
416
|
try {
|
|
262
|
-
|
|
263
|
-
sendTelemetryEvent(telemetryReporter,
|
|
417
|
+
res = await visitor(question, ui, clonedInputs, visitedInputNodeArray.length + 1, undefined);
|
|
418
|
+
sendTelemetryEvent(telemetryReporter, res, question, clonedInputs);
|
|
264
419
|
}
|
|
265
420
|
catch (e) {
|
|
266
421
|
return teamsfx_api_1.err(error_1.assembleError(e));
|
|
267
422
|
}
|
|
268
|
-
if (
|
|
423
|
+
if (res.isErr()) {
|
|
269
424
|
// Cancel or Error
|
|
270
|
-
return teamsfx_api_1.err(
|
|
425
|
+
return teamsfx_api_1.err(res.error);
|
|
271
426
|
}
|
|
272
|
-
const inputResult =
|
|
427
|
+
const inputResult = res.value;
|
|
273
428
|
if (inputResult.type === "back") {
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
}
|
|
287
|
-
else {
|
|
288
|
-
break;
|
|
289
|
-
}
|
|
290
|
-
}
|
|
429
|
+
const prevNode = visitedInputNodeArray.pop();
|
|
430
|
+
if (!prevNode) {
|
|
431
|
+
return teamsfx_api_1.err(new error_1.UserCancelError());
|
|
432
|
+
}
|
|
433
|
+
for (--i; i >= 0; --i) {
|
|
434
|
+
const tmpNode = nodeList[i];
|
|
435
|
+
visitedNodeSet.delete(tmpNode);
|
|
436
|
+
// clear prevNode data
|
|
437
|
+
if (tmpNode.data.type !== "group") {
|
|
438
|
+
delete tmpNode.data.value;
|
|
439
|
+
delete tmpNode.data.valueType;
|
|
440
|
+
delete clonedInputs[tmpNode.data.name];
|
|
291
441
|
}
|
|
292
|
-
|
|
293
|
-
if (last.data.type !== "group")
|
|
294
|
-
delete inputs[last.data.name];
|
|
295
|
-
const lastIsAutoSkip = autoSkipSet.has(last);
|
|
296
|
-
if (last.data.type !== "group" && last.data.type !== "func" && !lastIsAutoSkip) {
|
|
297
|
-
found = true;
|
|
442
|
+
if (tmpNode === prevNode) {
|
|
298
443
|
break;
|
|
299
444
|
}
|
|
300
445
|
}
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
}
|
|
304
|
-
--step;
|
|
305
|
-
continue; //ignore the following steps
|
|
446
|
+
--i;
|
|
447
|
+
continue;
|
|
306
448
|
}
|
|
307
449
|
else {
|
|
308
|
-
//success or skip
|
|
450
|
+
//success or skip: set value
|
|
309
451
|
question.value = inputResult.result;
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
else {
|
|
316
|
-
++step;
|
|
452
|
+
question.valueType = inputResult.type;
|
|
453
|
+
clonedInputs[question.name] = question.value;
|
|
454
|
+
visitedNodeSet.add(node);
|
|
455
|
+
if (question.valueType === "success") {
|
|
456
|
+
visitedInputNodeArray.push(node);
|
|
317
457
|
}
|
|
318
458
|
}
|
|
319
459
|
}
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
const matchChildren = [];
|
|
323
|
-
const valueInMap = findValue(curr, parentMap); //curr.data.type !== "group" ? curr.data.value : undefined; //valueMap.get(curr);
|
|
324
|
-
for (const child of curr.children) {
|
|
325
|
-
if (!child)
|
|
326
|
-
continue;
|
|
327
|
-
if (child.condition) {
|
|
328
|
-
const validRes = await teamsfx_api_1.validate(child.condition, valueInMap, inputs);
|
|
329
|
-
if (validRes !== undefined) {
|
|
330
|
-
continue;
|
|
331
|
-
}
|
|
332
|
-
}
|
|
333
|
-
matchChildren.push(child);
|
|
334
|
-
}
|
|
335
|
-
for (let i = matchChildren.length - 1; i >= 0; --i) {
|
|
336
|
-
const child = matchChildren[i];
|
|
337
|
-
parentMap.set(child, curr);
|
|
338
|
-
stack.push(child);
|
|
339
|
-
}
|
|
460
|
+
else {
|
|
461
|
+
visitedNodeSet.add(node);
|
|
340
462
|
}
|
|
341
463
|
}
|
|
464
|
+
lodash_1.assign(inputs, clonedInputs);
|
|
342
465
|
return teamsfx_api_1.ok(teamsfx_api_1.Void);
|
|
343
466
|
}
|
|
344
467
|
exports.traverse = traverse;
|