@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.
Files changed (392) hide show
  1. package/build/common/deps-checker/internal/dotnetChecker.d.ts.map +1 -1
  2. package/build/common/deps-checker/internal/dotnetChecker.js +2 -2
  3. package/build/common/deps-checker/internal/dotnetChecker.js.map +1 -1
  4. package/build/common/deps-checker/internal/funcToolChecker.d.ts.map +1 -1
  5. package/build/common/deps-checker/internal/funcToolChecker.js +2 -2
  6. package/build/common/deps-checker/internal/funcToolChecker.js.map +1 -1
  7. package/build/common/deps-checker/internal/nodeChecker.d.ts.map +1 -1
  8. package/build/common/deps-checker/internal/nodeChecker.js +7 -7
  9. package/build/common/deps-checker/internal/nodeChecker.js.map +1 -1
  10. package/build/common/deps-checker/internal/vxTestAppChecker.js +1 -1
  11. package/build/common/deps-checker/internal/vxTestAppChecker.js.map +1 -1
  12. package/build/common/featureFlags.d.ts +1 -0
  13. package/build/common/featureFlags.d.ts.map +1 -1
  14. package/build/common/featureFlags.js +5 -1
  15. package/build/common/featureFlags.js.map +1 -1
  16. package/build/common/local/localCertificateManager.js +1 -1
  17. package/build/common/local/localCertificateManager.js.map +1 -1
  18. package/build/common/m365/launchHelper.d.ts +2 -2
  19. package/build/common/m365/launchHelper.d.ts.map +1 -1
  20. package/build/common/m365/launchHelper.js +4 -4
  21. package/build/common/m365/launchHelper.js.map +1 -1
  22. package/build/common/projectSettingsHelper.js.map +1 -1
  23. package/build/common/samples-config-v3.json +213 -21
  24. package/build/common/samples.d.ts +9 -4
  25. package/build/common/samples.d.ts.map +1 -1
  26. package/build/common/samples.js +19 -26
  27. package/build/common/samples.js.map +1 -1
  28. package/build/common/spec-parser/adaptiveCardGenerator.d.ts +5 -0
  29. package/build/common/spec-parser/adaptiveCardGenerator.d.ts.map +1 -0
  30. package/build/common/spec-parser/adaptiveCardGenerator.js +113 -0
  31. package/build/common/spec-parser/adaptiveCardGenerator.js.map +1 -0
  32. package/build/common/spec-parser/constants.d.ts +15 -7
  33. package/build/common/spec-parser/constants.d.ts.map +1 -1
  34. package/build/common/spec-parser/constants.js +15 -7
  35. package/build/common/spec-parser/constants.js.map +1 -1
  36. package/build/common/spec-parser/interfaces.d.ts +70 -13
  37. package/build/common/spec-parser/interfaces.d.ts.map +1 -1
  38. package/build/common/spec-parser/interfaces.js +13 -13
  39. package/build/common/spec-parser/interfaces.js.map +1 -1
  40. package/build/common/spec-parser/manifestUpdater.d.ts +5 -0
  41. package/build/common/spec-parser/manifestUpdater.d.ts.map +1 -0
  42. package/build/common/spec-parser/manifestUpdater.js +78 -0
  43. package/build/common/spec-parser/manifestUpdater.js.map +1 -0
  44. package/build/common/spec-parser/specFilter.d.ts +3 -0
  45. package/build/common/spec-parser/specFilter.d.ts.map +1 -0
  46. package/build/common/spec-parser/specFilter.js +47 -0
  47. package/build/common/spec-parser/specFilter.js.map +1 -0
  48. package/build/common/spec-parser/specParser.d.ts +8 -4
  49. package/build/common/spec-parser/specParser.d.ts.map +1 -1
  50. package/build/common/spec-parser/specParser.js +62 -21
  51. package/build/common/spec-parser/specParser.js.map +1 -1
  52. package/build/common/spec-parser/utils.d.ts +7 -0
  53. package/build/common/spec-parser/utils.d.ts.map +1 -0
  54. package/build/common/spec-parser/utils.js +79 -0
  55. package/build/common/spec-parser/utils.js.map +1 -0
  56. package/build/common/telemetry.d.ts +0 -1
  57. package/build/common/telemetry.d.ts.map +1 -1
  58. package/build/common/telemetry.js +2 -11
  59. package/build/common/telemetry.js.map +1 -1
  60. package/build/common/tools.js +2 -2
  61. package/build/common/tools.js.map +1 -1
  62. package/build/component/configManager/interface.d.ts +2 -0
  63. package/build/component/configManager/interface.d.ts.map +1 -1
  64. package/build/component/configManager/interface.js.map +1 -1
  65. package/build/component/configManager/lifecycle.d.ts.map +1 -1
  66. package/build/component/configManager/lifecycle.js +12 -11
  67. package/build/component/configManager/lifecycle.js.map +1 -1
  68. package/build/component/configManager/parser.d.ts.map +1 -1
  69. package/build/component/configManager/parser.js +10 -1
  70. package/build/component/configManager/parser.js.map +1 -1
  71. package/build/component/configManager/validator.js +1 -1
  72. package/build/component/configManager/validator.js.map +1 -1
  73. package/build/component/constants.d.ts +5 -0
  74. package/build/component/constants.d.ts.map +1 -1
  75. package/build/component/constants.js +5 -0
  76. package/build/component/constants.js.map +1 -1
  77. package/build/component/coordinator/index.d.ts +5 -3
  78. package/build/component/coordinator/index.d.ts.map +1 -1
  79. package/build/component/coordinator/index.js +27 -12
  80. package/build/component/coordinator/index.js.map +1 -1
  81. package/build/component/developerPortalScaffoldUtils.d.ts +1 -1
  82. package/build/component/developerPortalScaffoldUtils.d.ts.map +1 -1
  83. package/build/component/developerPortalScaffoldUtils.js +4 -4
  84. package/build/component/developerPortalScaffoldUtils.js.map +1 -1
  85. package/build/component/driver/aad/create.js.map +1 -1
  86. package/build/component/driver/aad/error/aadManifestError.d.ts +3 -0
  87. package/build/component/driver/aad/error/aadManifestError.d.ts.map +1 -1
  88. package/build/component/driver/aad/error/aadManifestError.js +13 -1
  89. package/build/component/driver/aad/error/aadManifestError.js.map +1 -1
  90. package/build/component/driver/aad/utility/aadAppClient.d.ts.map +1 -1
  91. package/build/component/driver/aad/utility/aadAppClient.js +22 -10
  92. package/build/component/driver/aad/utility/aadAppClient.js.map +1 -1
  93. package/build/component/driver/aad/utility/constants.d.ts +3 -0
  94. package/build/component/driver/aad/utility/constants.d.ts.map +1 -1
  95. package/build/component/driver/aad/utility/constants.js +4 -1
  96. package/build/component/driver/aad/utility/constants.js.map +1 -1
  97. package/build/component/driver/add/addWebPart.js +1 -1
  98. package/build/component/driver/add/addWebPart.js.map +1 -1
  99. package/build/component/driver/arm/deployImpl.d.ts +2 -1
  100. package/build/component/driver/arm/deployImpl.d.ts.map +1 -1
  101. package/build/component/driver/arm/deployImpl.js +7 -0
  102. package/build/component/driver/arm/deployImpl.js.map +1 -1
  103. package/build/component/driver/arm/validator.d.ts.map +1 -1
  104. package/build/component/driver/arm/validator.js +3 -3
  105. package/build/component/driver/arm/validator.js.map +1 -1
  106. package/build/component/driver/botAadApp/create.js +2 -2
  107. package/build/component/driver/botAadApp/create.js.map +1 -1
  108. package/build/component/driver/botFramework/createOrUpdateBot.d.ts.map +1 -1
  109. package/build/component/driver/botFramework/createOrUpdateBot.js +4 -2
  110. package/build/component/driver/botFramework/createOrUpdateBot.js.map +1 -1
  111. package/build/component/driver/deploy/azure/azureStorageStaticWebsiteConfigDriver.js +1 -1
  112. package/build/component/driver/deploy/azure/azureStorageStaticWebsiteConfigDriver.js.map +1 -1
  113. package/build/component/driver/deploy/spfx/deployDriver.js +3 -3
  114. package/build/component/driver/deploy/spfx/deployDriver.js.map +1 -1
  115. package/build/component/driver/devTool/installDriver.js +4 -4
  116. package/build/component/driver/devTool/installDriver.js.map +1 -1
  117. package/build/component/driver/file/createOrUpdateEnvironmentFile.js +2 -2
  118. package/build/component/driver/file/createOrUpdateEnvironmentFile.js.map +1 -1
  119. package/build/component/driver/file/createOrUpdateJsonFile.js +2 -2
  120. package/build/component/driver/file/createOrUpdateJsonFile.js.map +1 -1
  121. package/build/component/driver/m365/acquire.js +2 -2
  122. package/build/component/driver/m365/acquire.js.map +1 -1
  123. package/build/component/driver/teamsApp/appStudio.d.ts.map +1 -1
  124. package/build/component/driver/teamsApp/appStudio.js +6 -6
  125. package/build/component/driver/teamsApp/appStudio.js.map +1 -1
  126. package/build/component/driver/teamsApp/configure.d.ts.map +1 -1
  127. package/build/component/driver/teamsApp/configure.js +3 -13
  128. package/build/component/driver/teamsApp/configure.js.map +1 -1
  129. package/build/component/driver/teamsApp/constants.d.ts +0 -1
  130. package/build/component/driver/teamsApp/constants.d.ts.map +1 -1
  131. package/build/component/driver/teamsApp/constants.js +1 -2
  132. package/build/component/driver/teamsApp/constants.js.map +1 -1
  133. package/build/component/driver/teamsApp/copyAppPackageToSPFx.js +1 -1
  134. package/build/component/driver/teamsApp/copyAppPackageToSPFx.js.map +1 -1
  135. package/build/component/driver/teamsApp/create.js +1 -1
  136. package/build/component/driver/teamsApp/create.js.map +1 -1
  137. package/build/component/driver/teamsApp/createAppPackage.d.ts.map +1 -1
  138. package/build/component/driver/teamsApp/createAppPackage.js +26 -0
  139. package/build/component/driver/teamsApp/createAppPackage.js.map +1 -1
  140. package/build/component/driver/teamsApp/publishAppPackage.js +1 -1
  141. package/build/component/driver/teamsApp/publishAppPackage.js.map +1 -1
  142. package/build/component/driver/teamsApp/utils/ManifestUtils.d.ts +1 -1
  143. package/build/component/driver/teamsApp/utils/ManifestUtils.d.ts.map +1 -1
  144. package/build/component/driver/teamsApp/utils/ManifestUtils.js +2 -2
  145. package/build/component/driver/teamsApp/utils/ManifestUtils.js.map +1 -1
  146. package/build/component/driver/teamsApp/validate.js +1 -1
  147. package/build/component/driver/teamsApp/validate.js.map +1 -1
  148. package/build/component/driver/teamsApp/validateAppPackage.d.ts.map +1 -1
  149. package/build/component/driver/teamsApp/validateAppPackage.js +19 -7
  150. package/build/component/driver/teamsApp/validateAppPackage.js.map +1 -1
  151. package/build/component/error/componentError.d.ts +2 -1
  152. package/build/component/error/componentError.d.ts.map +1 -1
  153. package/build/component/error/componentError.js +8 -4
  154. package/build/component/error/componentError.js.map +1 -1
  155. package/build/component/feature/collaboration.d.ts.map +1 -1
  156. package/build/component/feature/collaboration.js +25 -15
  157. package/build/component/feature/collaboration.js.map +1 -1
  158. package/build/component/feature/createAuthFiles.js.map +1 -1
  159. package/build/component/generator/copilotPlugin/generator.d.ts +5 -2
  160. package/build/component/generator/copilotPlugin/generator.d.ts.map +1 -1
  161. package/build/component/generator/copilotPlugin/generator.js +96 -23
  162. package/build/component/generator/copilotPlugin/generator.js.map +1 -1
  163. package/build/component/generator/copilotPlugin/helper.d.ts +9 -7
  164. package/build/component/generator/copilotPlugin/helper.d.ts.map +1 -1
  165. package/build/component/generator/copilotPlugin/helper.js +163 -31
  166. package/build/component/generator/copilotPlugin/helper.js.map +1 -1
  167. package/build/component/generator/error.d.ts +1 -1
  168. package/build/component/generator/error.d.ts.map +1 -1
  169. package/build/component/generator/error.js +2 -2
  170. package/build/component/generator/error.js.map +1 -1
  171. package/build/component/generator/generator.js +3 -3
  172. package/build/component/generator/generator.js.map +1 -1
  173. package/build/component/generator/generatorAction.d.ts.map +1 -1
  174. package/build/component/generator/generatorAction.js +4 -3
  175. package/build/component/generator/generatorAction.js.map +1 -1
  176. package/build/component/generator/officeAddin/helperMethods.js +3 -3
  177. package/build/component/generator/officeAddin/helperMethods.js.map +1 -1
  178. package/build/component/generator/spfx/depsChecker/generatorChecker.js +6 -6
  179. package/build/component/generator/spfx/depsChecker/generatorChecker.js.map +1 -1
  180. package/build/component/generator/spfx/depsChecker/yoChecker.d.ts +1 -1
  181. package/build/component/generator/spfx/depsChecker/yoChecker.d.ts.map +1 -1
  182. package/build/component/generator/spfx/depsChecker/yoChecker.js +7 -7
  183. package/build/component/generator/spfx/depsChecker/yoChecker.js.map +1 -1
  184. package/build/component/generator/spfx/spfxGenerator.d.ts.map +1 -1
  185. package/build/component/generator/spfx/spfxGenerator.js +12 -12
  186. package/build/component/generator/spfx/spfxGenerator.js.map +1 -1
  187. package/build/component/generator/spfx/utils/constants.d.ts +1 -0
  188. package/build/component/generator/spfx/utils/constants.d.ts.map +1 -1
  189. package/build/component/generator/spfx/utils/constants.js +1 -0
  190. package/build/component/generator/spfx/utils/constants.js.map +1 -1
  191. package/build/component/generator/utils.d.ts +10 -2
  192. package/build/component/generator/utils.d.ts.map +1 -1
  193. package/build/component/generator/utils.js +4 -3
  194. package/build/component/generator/utils.js.map +1 -1
  195. package/build/component/middleware/questionMW.d.ts +2 -2
  196. package/build/component/middleware/questionMW.d.ts.map +1 -1
  197. package/build/component/middleware/questionMW.js +7 -11
  198. package/build/component/middleware/questionMW.js.map +1 -1
  199. package/build/component/migrate.js.map +1 -1
  200. package/build/component/telemetry.d.ts.map +1 -1
  201. package/build/component/telemetry.js +3 -6
  202. package/build/component/telemetry.js.map +1 -1
  203. package/build/component/utils/azureResourceOperation.js +2 -2
  204. package/build/component/utils/azureResourceOperation.js.map +1 -1
  205. package/build/component/utils/common.d.ts +1 -1
  206. package/build/component/utils/common.d.ts.map +1 -1
  207. package/build/component/utils/common.js +3 -4
  208. package/build/component/utils/common.js.map +1 -1
  209. package/build/component/utils/envUtil.js.map +1 -1
  210. package/build/component/utils/metadataUtil.d.ts.map +1 -1
  211. package/build/component/utils/metadataUtil.js +3 -2
  212. package/build/component/utils/metadataUtil.js.map +1 -1
  213. package/build/component/utils/teamsFxTelemetryReporter.d.ts.map +1 -1
  214. package/build/component/utils/teamsFxTelemetryReporter.js +3 -6
  215. package/build/component/utils/teamsFxTelemetryReporter.js.map +1 -1
  216. package/build/component/utils.js.map +1 -1
  217. package/build/core/FxCore.d.ts +9 -2
  218. package/build/core/FxCore.d.ts.map +1 -1
  219. package/build/core/FxCore.js +13 -16
  220. package/build/core/FxCore.js.map +1 -1
  221. package/build/core/FxCoreImplementV3.d.ts +7 -2
  222. package/build/core/FxCoreImplementV3.d.ts.map +1 -1
  223. package/build/core/FxCoreImplementV3.js +81 -29
  224. package/build/core/FxCoreImplementV3.js.map +1 -1
  225. package/build/core/collaborator.d.ts +1 -1
  226. package/build/core/collaborator.d.ts.map +1 -1
  227. package/build/core/collaborator.js +18 -12
  228. package/build/core/collaborator.js.map +1 -1
  229. package/build/core/error.d.ts +6 -0
  230. package/build/core/error.d.ts.map +1 -1
  231. package/build/core/error.js +23 -1
  232. package/build/core/error.js.map +1 -1
  233. package/build/core/middleware/projectMigratorV3.d.ts +3 -1
  234. package/build/core/middleware/projectMigratorV3.d.ts.map +1 -1
  235. package/build/core/middleware/projectMigratorV3.js +1 -2
  236. package/build/core/middleware/projectMigratorV3.js.map +1 -1
  237. package/build/core/middleware/projectVersionChecker.js +5 -5
  238. package/build/core/middleware/projectVersionChecker.js.map +1 -1
  239. package/build/core/middleware/utils/appYmlGenerator.js.map +1 -1
  240. package/build/core/middleware/utils/debug/appLocalYmlGenerator.d.ts.map +1 -1
  241. package/build/core/middleware/utils/debug/appLocalYmlGenerator.js +3 -2
  242. package/build/core/middleware/utils/debug/appLocalYmlGenerator.js.map +1 -1
  243. package/build/core/middleware/utils/debug/debugV3MigrationUtils.js.map +1 -1
  244. package/build/core/middleware/utils/debug/taskMigrator.d.ts.map +1 -1
  245. package/build/core/middleware/utils/debug/taskMigrator.js +30 -15
  246. package/build/core/middleware/utils/debug/taskMigrator.js.map +1 -1
  247. package/build/core/middleware/utils/v3MigrationUtils.js +1 -1
  248. package/build/core/middleware/utils/v3MigrationUtils.js.map +1 -1
  249. package/build/error/common.d.ts +9 -0
  250. package/build/error/common.d.ts.map +1 -1
  251. package/build/error/common.js +130 -15
  252. package/build/error/common.js.map +1 -1
  253. package/build/index.d.ts +1 -0
  254. package/build/index.d.ts.map +1 -1
  255. package/build/index.js +1 -0
  256. package/build/index.js.map +1 -1
  257. package/build/question/constants.d.ts +4 -0
  258. package/build/question/constants.d.ts.map +1 -0
  259. package/build/question/constants.js +12 -0
  260. package/build/question/constants.js.map +1 -0
  261. package/build/question/create.d.ts +6 -2
  262. package/build/question/create.d.ts.map +1 -1
  263. package/build/question/create.js +334 -231
  264. package/build/question/create.js.map +1 -1
  265. package/build/question/generator.d.ts +3 -0
  266. package/build/question/generator.d.ts.map +1 -0
  267. package/build/question/generator.js +270 -0
  268. package/build/question/generator.js.map +1 -0
  269. package/build/question/index.d.ts +18 -30
  270. package/build/question/index.d.ts.map +1 -1
  271. package/build/question/index.js +13 -47
  272. package/build/question/index.js.map +1 -1
  273. package/build/question/inputs/CreateEnvInputs.d.ts +14 -0
  274. package/build/question/inputs/CreateEnvInputs.d.ts.map +1 -0
  275. package/build/question/inputs/CreateEnvInputs.js +5 -0
  276. package/build/question/inputs/CreateEnvInputs.js.map +1 -0
  277. package/build/question/inputs/CreateProjectInputs.d.ts +36 -0
  278. package/build/question/inputs/CreateProjectInputs.d.ts.map +1 -0
  279. package/build/question/inputs/CreateProjectInputs.js +5 -0
  280. package/build/question/inputs/CreateProjectInputs.js.map +1 -0
  281. package/build/question/inputs/CreateSampleProjectInputs.d.ts +12 -0
  282. package/build/question/inputs/CreateSampleProjectInputs.d.ts.map +1 -0
  283. package/build/question/inputs/CreateSampleProjectInputs.js +5 -0
  284. package/build/question/inputs/CreateSampleProjectInputs.js.map +1 -0
  285. package/build/question/inputs/DeployAadManifestInputs.d.ts +14 -0
  286. package/build/question/inputs/DeployAadManifestInputs.d.ts.map +1 -0
  287. package/build/question/inputs/DeployAadManifestInputs.js +5 -0
  288. package/build/question/inputs/DeployAadManifestInputs.js.map +1 -0
  289. package/build/question/inputs/PermissionGrantInputs.d.ts +18 -0
  290. package/build/question/inputs/PermissionGrantInputs.d.ts.map +1 -0
  291. package/build/question/inputs/PermissionGrantInputs.js +5 -0
  292. package/build/question/inputs/PermissionGrantInputs.js.map +1 -0
  293. package/build/question/inputs/PermissionListInputs.d.ts +16 -0
  294. package/build/question/inputs/PermissionListInputs.d.ts.map +1 -0
  295. package/build/question/inputs/PermissionListInputs.js +5 -0
  296. package/build/question/inputs/PermissionListInputs.js.map +1 -0
  297. package/build/question/inputs/PreviewTeamsAppInputs.d.ts +14 -0
  298. package/build/question/inputs/PreviewTeamsAppInputs.d.ts.map +1 -0
  299. package/build/question/inputs/PreviewTeamsAppInputs.js +5 -0
  300. package/build/question/inputs/PreviewTeamsAppInputs.js.map +1 -0
  301. package/build/question/inputs/SPFxAddWebpartInputs.d.ts +18 -0
  302. package/build/question/inputs/SPFxAddWebpartInputs.d.ts.map +1 -0
  303. package/build/question/inputs/SPFxAddWebpartInputs.js +5 -0
  304. package/build/question/inputs/SPFxAddWebpartInputs.js.map +1 -0
  305. package/build/question/inputs/SelectTeamsManifestInputs.d.ts +12 -0
  306. package/build/question/inputs/SelectTeamsManifestInputs.d.ts.map +1 -0
  307. package/build/question/inputs/SelectTeamsManifestInputs.js +5 -0
  308. package/build/question/inputs/SelectTeamsManifestInputs.js.map +1 -0
  309. package/build/question/inputs/ValidateTeamsAppInputs.d.ts +14 -0
  310. package/build/question/inputs/ValidateTeamsAppInputs.d.ts.map +1 -0
  311. package/build/question/inputs/ValidateTeamsAppInputs.js +5 -0
  312. package/build/question/inputs/ValidateTeamsAppInputs.js.map +1 -0
  313. package/build/question/inputs/index.d.ts +11 -0
  314. package/build/question/inputs/index.d.ts.map +1 -0
  315. package/build/question/inputs/index.js +16 -0
  316. package/build/question/inputs/index.js.map +1 -0
  317. package/build/question/options/CreateEnvOptions.d.ts +10 -0
  318. package/build/question/options/CreateEnvOptions.d.ts.map +1 -0
  319. package/build/question/options/CreateEnvOptions.js +24 -0
  320. package/build/question/options/CreateEnvOptions.js.map +1 -0
  321. package/build/question/options/CreateProjectOptions.d.ts +10 -0
  322. package/build/question/options/CreateProjectOptions.d.ts.map +1 -0
  323. package/build/question/options/CreateProjectOptions.js +122 -0
  324. package/build/question/options/CreateProjectOptions.js.map +1 -0
  325. package/build/question/options/CreateSampleProjectOptions.d.ts +10 -0
  326. package/build/question/options/CreateSampleProjectOptions.d.ts.map +1 -0
  327. package/build/question/options/CreateSampleProjectOptions.js +41 -0
  328. package/build/question/options/CreateSampleProjectOptions.js.map +1 -0
  329. package/build/question/options/DeployAadManifestOptions.d.ts +10 -0
  330. package/build/question/options/DeployAadManifestOptions.d.ts.map +1 -0
  331. package/build/question/options/DeployAadManifestOptions.js +21 -0
  332. package/build/question/options/DeployAadManifestOptions.js.map +1 -0
  333. package/build/question/options/PermissionGrantOptions.d.ts +10 -0
  334. package/build/question/options/PermissionGrantOptions.d.ts.map +1 -0
  335. package/build/question/options/PermissionGrantOptions.js +33 -0
  336. package/build/question/options/PermissionGrantOptions.js.map +1 -0
  337. package/build/question/options/PermissionListOptions.d.ts +10 -0
  338. package/build/question/options/PermissionListOptions.d.ts.map +1 -0
  339. package/build/question/options/PermissionListOptions.js +28 -0
  340. package/build/question/options/PermissionListOptions.js.map +1 -0
  341. package/build/question/options/PreviewTeamsAppOptions.d.ts +10 -0
  342. package/build/question/options/PreviewTeamsAppOptions.d.ts.map +1 -0
  343. package/build/question/options/PreviewTeamsAppOptions.js +26 -0
  344. package/build/question/options/PreviewTeamsAppOptions.js.map +1 -0
  345. package/build/question/options/SPFxAddWebpartOptions.d.ts +10 -0
  346. package/build/question/options/SPFxAddWebpartOptions.d.ts.map +1 -0
  347. package/build/question/options/SPFxAddWebpartOptions.js +38 -0
  348. package/build/question/options/SPFxAddWebpartOptions.js.map +1 -0
  349. package/build/question/options/SelectTeamsManifestOptions.d.ts +10 -0
  350. package/build/question/options/SelectTeamsManifestOptions.d.ts.map +1 -0
  351. package/build/question/options/SelectTeamsManifestOptions.js +17 -0
  352. package/build/question/options/SelectTeamsManifestOptions.js.map +1 -0
  353. package/build/question/options/ValidateTeamsAppOptions.d.ts +10 -0
  354. package/build/question/options/ValidateTeamsAppOptions.d.ts.map +1 -0
  355. package/build/question/options/ValidateTeamsAppOptions.js +23 -0
  356. package/build/question/options/ValidateTeamsAppOptions.js.map +1 -0
  357. package/build/question/options/index.d.ts +11 -0
  358. package/build/question/options/index.d.ts.map +1 -0
  359. package/build/question/options/index.js +16 -0
  360. package/build/question/options/index.js.map +1 -0
  361. package/build/question/other.d.ts +12 -1
  362. package/build/question/other.d.ts.map +1 -1
  363. package/build/question/other.js +113 -28
  364. package/build/question/other.js.map +1 -1
  365. package/build/question/questionNames.d.ts +2 -0
  366. package/build/question/questionNames.d.ts.map +1 -1
  367. package/build/question/questionNames.js +2 -0
  368. package/build/question/questionNames.js.map +1 -1
  369. package/build/ui/validationUtils.d.ts +12 -0
  370. package/build/ui/validationUtils.d.ts.map +1 -0
  371. package/build/ui/validationUtils.js +84 -0
  372. package/build/ui/validationUtils.js.map +1 -0
  373. package/build/ui/visitor.d.ts +12 -1
  374. package/build/ui/visitor.d.ts.map +1 -1
  375. package/build/ui/visitor.js +327 -204
  376. package/build/ui/visitor.js.map +1 -1
  377. package/package.json +13 -6
  378. package/resource/package.nls.json +20 -4
  379. package/resource/yaml-schema/1.1.1/yaml.schema.json +1468 -0
  380. package/templates/fallback/common.zip +0 -0
  381. package/templates/fallback/csharp.zip +0 -0
  382. package/templates/fallback/js.zip +0 -0
  383. package/templates/fallback/ts.zip +0 -0
  384. package/templates/plugins/resource/aad/auth/bot/README.md +281 -263
  385. package/templates/plugins/resource/aad/auth/bot/js/sso/handleMessageExtensionQueryWithToken.js +13 -3
  386. package/templates/plugins/resource/aad/auth/bot/js/sso/profileSsoCommandHandler.js +14 -5
  387. package/templates/plugins/resource/aad/auth/bot/ts/sso/handleMessageExtensionQueryWithToken.ts +11 -3
  388. package/templates/plugins/resource/aad/auth/bot/ts/sso/profileSsoCommandHandler.ts +12 -3
  389. package/build/component/generator/copilotPlugin/constant.d.ts +0 -4
  390. package/build/component/generator/copilotPlugin/constant.d.ts.map +0 -1
  391. package/build/component/generator/copilotPlugin/constant.js +0 -10
  392. package/build/component/generator/copilotPlugin/constant.js.map +0 -1
@@ -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: "success", result: fxresult.value });
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: "success", result: res });
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
- let defaultValue = undefined;
85
- if (question.forgetLastValue !== true && question.value)
86
- defaultValue = question.value;
87
- else {
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
- if (!selectQuestion.staticOptions || selectQuestion.staticOptions.length === 0) {
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
- if (question.type === "singleSelect") {
137
- const validationFunc = question.validation
138
- ? teamsfx_api_1.getValidationFunction(question.validation, inputs)
139
- : undefined;
140
- return await ui.selectOption({
141
- name: question.name,
142
- title: title,
143
- options: options,
144
- returnObject: selectQuestion.returnObject,
145
- default: defaultValue,
146
- placeholder: placeholder,
147
- prompt: prompt,
148
- step: step,
149
- totalSteps: totalSteps,
150
- buttons: question.buttons,
151
- validation: validationFunc,
152
- skipSingleOption: selectQuestion.skipSingleOption,
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
- else {
156
- const mq = selectQuestion;
157
- const validationFunc = question.validation
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
- else if (question.type === "multiFile") {
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.selectFiles({
157
+ return await ui.selectOption({
181
158
  name: question.name,
182
159
  title: title,
183
- placeholder: placeholder,
184
- prompt: prompt,
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
- filters: question.filters,
169
+ skipSingleOption: selectQuestion.skipSingleOption,
205
170
  });
206
171
  }
207
- else if (question.type === "folder") {
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.selectFolder({
177
+ return await ui.selectOptions({
212
178
  name: question.name,
213
179
  title: title,
214
- placeholder: placeholder,
215
- prompt: prompt,
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
- inputOptionItem: question.inputOptionItem,
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
- async function traverse(root, inputs, ui, telemetryReporter, visitor = questionVisitor) {
244
- const stack = [];
245
- const history = [];
246
- stack.push(root);
247
- let step = 1; // manual input step
248
- let totalStep = 1;
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
- // const valueMap = new Map<QTreeNode, unknown>();
251
- const autoSkipSet = new Set();
252
- while (stack.length > 0) {
253
- const curr = stack.pop();
254
- if (!curr)
255
- continue;
256
- //visit
257
- if (curr.data.type !== "group") {
258
- const question = curr.data;
259
- totalStep = step + stack.length;
260
- let qvRes;
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
- qvRes = await visitor(question, ui, inputs, step, totalStep);
263
- sendTelemetryEvent(telemetryReporter, qvRes, question, inputs);
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 (qvRes.isErr()) {
423
+ if (res.isErr()) {
269
424
  // Cancel or Error
270
- return teamsfx_api_1.err(qvRes.error);
425
+ return teamsfx_api_1.err(res.error);
271
426
  }
272
- const inputResult = qvRes.value;
427
+ const inputResult = res.value;
273
428
  if (inputResult.type === "back") {
274
- stack.push(curr);
275
- // find the previous input that is neither group nor func nor single option select
276
- let found = false;
277
- while (history.length > 0) {
278
- const last = history.pop();
279
- if (!last)
280
- continue;
281
- if (last.children) {
282
- while (stack.length > 0) {
283
- const tmp = stack[stack.length - 1];
284
- if (last.children.includes(tmp)) {
285
- stack.pop();
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
- stack.push(last);
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
- if (!found) {
302
- return teamsfx_api_1.err(new error_1.UserCancelError());
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
- inputs[question.name] = question.value;
311
- if (inputResult.type === "skip" || question.type === "func") {
312
- if (inputResult.type === "skip")
313
- autoSkipSet.add(curr);
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
- history.push(curr);
321
- if (curr.children) {
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;