@microsoft/teamsfx-core 1.12.0 → 1.12.1-rc.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 (305) hide show
  1. package/build/common/constants.d.ts +0 -1
  2. package/build/common/constants.d.ts.map +1 -1
  3. package/build/common/constants.js +0 -1
  4. package/build/common/constants.js.map +1 -1
  5. package/build/common/featureFlags.d.ts.map +1 -1
  6. package/build/common/featureFlags.js +0 -1
  7. package/build/common/featureFlags.js.map +1 -1
  8. package/build/common/local/localEnvManager.d.ts.map +1 -1
  9. package/build/common/local/localEnvManager.js +1 -7
  10. package/build/common/local/localEnvManager.js.map +1 -1
  11. package/build/common/local/localTelemetryReporter.d.ts +2 -1
  12. package/build/common/local/localTelemetryReporter.d.ts.map +1 -1
  13. package/build/common/local/localTelemetryReporter.js +6 -1
  14. package/build/common/local/localTelemetryReporter.js.map +1 -1
  15. package/build/common/localizeUtils.d.ts.map +1 -1
  16. package/build/common/localizeUtils.js +3 -0
  17. package/build/common/localizeUtils.js.map +1 -1
  18. package/build/common/telemetry.d.ts +2 -1
  19. package/build/common/telemetry.d.ts.map +1 -1
  20. package/build/common/telemetry.js +1 -0
  21. package/build/common/telemetry.js.map +1 -1
  22. package/build/common/templates-config.json +1 -1
  23. package/build/common/tools.d.ts +0 -1
  24. package/build/common/tools.d.ts.map +1 -1
  25. package/build/common/tools.js +8 -8
  26. package/build/common/tools.js.map +1 -1
  27. package/build/common/utils.js +1 -1
  28. package/build/component/code/tabCode.d.ts +4 -0
  29. package/build/component/code/tabCode.d.ts.map +1 -1
  30. package/build/component/code/tabCode.js +89 -5
  31. package/build/component/code/tabCode.js.map +1 -1
  32. package/build/component/connection/azureResourceConfig.d.ts.map +1 -1
  33. package/build/component/connection/azureResourceConfig.js +9 -4
  34. package/build/component/connection/azureResourceConfig.js.map +1 -1
  35. package/build/component/constants.d.ts +3 -0
  36. package/build/component/constants.d.ts.map +1 -1
  37. package/build/component/constants.js +7 -1
  38. package/build/component/constants.js.map +1 -1
  39. package/build/component/core.d.ts +4 -2
  40. package/build/component/core.d.ts.map +1 -1
  41. package/build/component/core.js +5 -21
  42. package/build/component/core.js.map +1 -1
  43. package/build/component/feature/bot.d.ts +1 -1
  44. package/build/component/feature/bot.d.ts.map +1 -1
  45. package/build/component/feature/bot.js +13 -1
  46. package/build/component/feature/bot.js.map +1 -1
  47. package/build/component/feature/cicd.d.ts.map +1 -1
  48. package/build/component/feature/cicd.js +7 -3
  49. package/build/component/feature/cicd.js.map +1 -1
  50. package/build/component/feature/tab.d.ts +2 -0
  51. package/build/component/feature/tab.d.ts.map +1 -1
  52. package/build/component/feature/tab.js +43 -5
  53. package/build/component/feature/tab.js.map +1 -1
  54. package/build/component/migrate.d.ts +88 -0
  55. package/build/component/migrate.d.ts.map +1 -0
  56. package/build/component/migrate.js +53 -0
  57. package/build/component/migrate.js.map +1 -0
  58. package/build/component/resource/appManifest/appManifest.d.ts.map +1 -1
  59. package/build/component/resource/appManifest/appManifest.js +1 -6
  60. package/build/component/resource/appManifest/appManifest.js.map +1 -1
  61. package/build/component/resource/appManifest/constants.d.ts +1 -1
  62. package/build/component/resource/appManifest/constants.d.ts.map +1 -1
  63. package/build/component/resource/appManifest/constants.js +1 -1
  64. package/build/component/resource/appManifest/constants.js.map +1 -1
  65. package/build/component/resource/azureAppService/azureAppService.d.ts +13 -0
  66. package/build/component/resource/azureAppService/azureAppService.d.ts.map +1 -0
  67. package/build/component/resource/azureAppService/azureAppService.js +72 -0
  68. package/build/component/resource/azureAppService/azureAppService.js.map +1 -0
  69. package/build/component/resource/{azureFunction.d.ts → azureAppService/azureFunction.d.ts} +6 -6
  70. package/build/component/resource/azureAppService/azureFunction.d.ts.map +1 -0
  71. package/build/component/resource/azureAppService/azureFunction.js +60 -0
  72. package/build/component/resource/azureAppService/azureFunction.js.map +1 -0
  73. package/build/component/resource/azureAppService/azureWebApp.d.ts +19 -0
  74. package/build/component/resource/azureAppService/azureWebApp.d.ts.map +1 -0
  75. package/build/component/resource/azureAppService/azureWebApp.js +33 -0
  76. package/build/component/resource/azureAppService/azureWebApp.js.map +1 -0
  77. package/build/component/resource/azureAppService/errors.d.ts +15 -0
  78. package/build/component/resource/azureAppService/errors.d.ts.map +1 -0
  79. package/build/component/resource/azureAppService/errors.js +54 -0
  80. package/build/component/resource/azureAppService/errors.js.map +1 -0
  81. package/build/component/resource/azureAppService/messages.d.ts +10 -0
  82. package/build/component/resource/azureAppService/messages.d.ts.map +1 -0
  83. package/build/component/resource/azureAppService/messages.js +30 -0
  84. package/build/component/resource/azureAppService/messages.js.map +1 -0
  85. package/build/component/resource/azureResource.d.ts.map +1 -1
  86. package/build/component/resource/azureResource.js +9 -4
  87. package/build/component/resource/azureResource.js.map +1 -1
  88. package/build/component/resource/azureSql/actions/configure.d.ts.map +1 -1
  89. package/build/component/resource/azureSql/actions/configure.js +3 -3
  90. package/build/component/resource/azureSql/actions/configure.js.map +1 -1
  91. package/build/component/resource/azureSql/actions/provision.d.ts.map +1 -1
  92. package/build/component/resource/azureSql/actions/provision.js +1 -1
  93. package/build/component/resource/azureSql/actions/provision.js.map +1 -1
  94. package/build/component/resource/azureStorage.d.ts +1 -1
  95. package/build/component/resource/azureStorage.d.ts.map +1 -1
  96. package/build/component/resource/azureStorage.js +30 -13
  97. package/build/component/resource/azureStorage.js.map +1 -1
  98. package/build/component/resource/botService.d.ts +4 -2
  99. package/build/component/resource/botService.d.ts.map +1 -1
  100. package/build/component/resource/botService.js +17 -42
  101. package/build/component/resource/botService.js.map +1 -1
  102. package/build/component/utils.d.ts +2 -1
  103. package/build/component/utils.d.ts.map +1 -1
  104. package/build/component/utils.js +39 -24
  105. package/build/component/utils.js.map +1 -1
  106. package/build/component/workflow.d.ts +1 -0
  107. package/build/component/workflow.d.ts.map +1 -1
  108. package/build/component/workflow.js +24 -5
  109. package/build/component/workflow.js.map +1 -1
  110. package/build/core/FxCore.d.ts +1 -1
  111. package/build/core/FxCore.d.ts.map +1 -1
  112. package/build/core/FxCore.js +61 -38
  113. package/build/core/FxCore.js.map +1 -1
  114. package/build/core/downloadSample.d.ts.map +1 -1
  115. package/build/core/downloadSample.js +10 -2
  116. package/build/core/downloadSample.js.map +1 -1
  117. package/build/core/environment.d.ts +1 -1
  118. package/build/core/environment.d.ts.map +1 -1
  119. package/build/core/environment.js +29 -16
  120. package/build/core/environment.js.map +1 -1
  121. package/build/core/generateAadManifestTemplate.d.ts.map +1 -1
  122. package/build/core/generateAadManifestTemplate.js +2 -1
  123. package/build/core/generateAadManifestTemplate.js.map +1 -1
  124. package/build/core/middleware/MigrationUtils.js +1 -1
  125. package/build/core/middleware/MigrationUtils.js.map +1 -1
  126. package/build/core/middleware/consolidateLocalRemote.d.ts.map +1 -1
  127. package/build/core/middleware/consolidateLocalRemote.js +2 -4
  128. package/build/core/middleware/consolidateLocalRemote.js.map +1 -1
  129. package/build/core/middleware/envInfoLoader.d.ts.map +1 -1
  130. package/build/core/middleware/envInfoLoader.js +1 -4
  131. package/build/core/middleware/envInfoLoader.js.map +1 -1
  132. package/build/core/middleware/envInfoWriter.d.ts.map +1 -1
  133. package/build/core/middleware/envInfoWriter.js +5 -4
  134. package/build/core/middleware/envInfoWriter.js.map +1 -1
  135. package/build/core/middleware/envInfoWriterV3.d.ts.map +1 -1
  136. package/build/core/middleware/envInfoWriterV3.js +4 -0
  137. package/build/core/middleware/envInfoWriterV3.js.map +1 -1
  138. package/build/core/middleware/index.d.ts +0 -2
  139. package/build/core/middleware/index.d.ts.map +1 -1
  140. package/build/core/middleware/index.js +0 -2
  141. package/build/core/middleware/index.js.map +1 -1
  142. package/build/core/middleware/questionModelV3.d.ts.map +1 -1
  143. package/build/core/middleware/questionModelV3.js +3 -6
  144. package/build/core/middleware/questionModelV3.js.map +1 -1
  145. package/build/plugins/resource/aad/plugin.d.ts.map +1 -1
  146. package/build/plugins/resource/aad/plugin.js +9 -13
  147. package/build/plugins/resource/aad/plugin.js.map +1 -1
  148. package/build/plugins/resource/apiconnector/depsHandler.d.ts +4 -3
  149. package/build/plugins/resource/apiconnector/depsHandler.d.ts.map +1 -1
  150. package/build/plugins/resource/apiconnector/depsHandler.js +21 -7
  151. package/build/plugins/resource/apiconnector/depsHandler.js.map +1 -1
  152. package/build/plugins/resource/apiconnector/plugin.d.ts +0 -1
  153. package/build/plugins/resource/apiconnector/plugin.d.ts.map +1 -1
  154. package/build/plugins/resource/apiconnector/plugin.js +3 -51
  155. package/build/plugins/resource/apiconnector/plugin.js.map +1 -1
  156. package/build/plugins/resource/apiconnector/questions.d.ts +8 -1
  157. package/build/plugins/resource/apiconnector/questions.d.ts.map +1 -1
  158. package/build/plugins/resource/apiconnector/questions.js +94 -1
  159. package/build/plugins/resource/apiconnector/questions.js.map +1 -1
  160. package/build/plugins/resource/apiconnector/telemetry.d.ts +1 -0
  161. package/build/plugins/resource/apiconnector/telemetry.d.ts.map +1 -1
  162. package/build/plugins/resource/apiconnector/telemetry.js +1 -0
  163. package/build/plugins/resource/apiconnector/telemetry.js.map +1 -1
  164. package/build/plugins/resource/apiconnector/utils.d.ts +2 -1
  165. package/build/plugins/resource/apiconnector/utils.d.ts.map +1 -1
  166. package/build/plugins/resource/apiconnector/utils.js +11 -1
  167. package/build/plugins/resource/apiconnector/utils.js.map +1 -1
  168. package/build/plugins/resource/appstudio/appStudio.d.ts.map +1 -1
  169. package/build/plugins/resource/appstudio/appStudio.js +19 -40
  170. package/build/plugins/resource/appstudio/appStudio.js.map +1 -1
  171. package/build/plugins/resource/appstudio/constants.d.ts +6 -14
  172. package/build/plugins/resource/appstudio/constants.d.ts.map +1 -1
  173. package/build/plugins/resource/appstudio/constants.js +7 -232
  174. package/build/plugins/resource/appstudio/constants.js.map +1 -1
  175. package/build/plugins/resource/appstudio/errors.d.ts +4 -0
  176. package/build/plugins/resource/appstudio/errors.d.ts.map +1 -1
  177. package/build/plugins/resource/appstudio/errors.js +17 -10
  178. package/build/plugins/resource/appstudio/errors.js.map +1 -1
  179. package/build/plugins/resource/appstudio/index.d.ts.map +1 -1
  180. package/build/plugins/resource/appstudio/index.js +5 -5
  181. package/build/plugins/resource/appstudio/index.js.map +1 -1
  182. package/build/plugins/resource/appstudio/manifestTemplate.d.ts +3 -3
  183. package/build/plugins/resource/appstudio/manifestTemplate.d.ts.map +1 -1
  184. package/build/plugins/resource/appstudio/manifestTemplate.js +75 -182
  185. package/build/plugins/resource/appstudio/manifestTemplate.js.map +1 -1
  186. package/build/plugins/resource/appstudio/plugin.d.ts +1 -9
  187. package/build/plugins/resource/appstudio/plugin.d.ts.map +1 -1
  188. package/build/plugins/resource/appstudio/plugin.js +89 -241
  189. package/build/plugins/resource/appstudio/plugin.js.map +1 -1
  190. package/build/plugins/resource/appstudio/utils/telemetry.d.ts +7 -2
  191. package/build/plugins/resource/appstudio/utils/telemetry.d.ts.map +1 -1
  192. package/build/plugins/resource/appstudio/utils/telemetry.js +8 -22
  193. package/build/plugins/resource/appstudio/utils/telemetry.js.map +1 -1
  194. package/build/plugins/resource/appstudio/v3/index.d.ts +1 -19
  195. package/build/plugins/resource/appstudio/v3/index.d.ts.map +1 -1
  196. package/build/plugins/resource/appstudio/v3/index.js +3 -46
  197. package/build/plugins/resource/appstudio/v3/index.js.map +1 -1
  198. package/build/plugins/resource/bot/constants.d.ts +3 -0
  199. package/build/plugins/resource/bot/constants.d.ts.map +1 -1
  200. package/build/plugins/resource/bot/constants.js +3 -0
  201. package/build/plugins/resource/bot/constants.js.map +1 -1
  202. package/build/plugins/resource/bot/plugin.d.ts.map +1 -1
  203. package/build/plugins/resource/bot/plugin.js +12 -36
  204. package/build/plugins/resource/bot/plugin.js.map +1 -1
  205. package/build/plugins/resource/bot/utils/telemetry-helper.d.ts +3 -0
  206. package/build/plugins/resource/bot/utils/telemetry-helper.d.ts.map +1 -1
  207. package/build/plugins/resource/bot/utils/telemetry-helper.js +16 -0
  208. package/build/plugins/resource/bot/utils/telemetry-helper.js.map +1 -1
  209. package/build/plugins/resource/bot/v2/common.d.ts.map +1 -1
  210. package/build/plugins/resource/bot/v2/common.js +4 -7
  211. package/build/plugins/resource/bot/v2/common.js.map +1 -1
  212. package/build/plugins/resource/cicd/utils/buildScripts.d.ts.map +1 -1
  213. package/build/plugins/resource/cicd/utils/buildScripts.js +38 -16
  214. package/build/plugins/resource/cicd/utils/buildScripts.js.map +1 -1
  215. package/build/plugins/resource/frontend/dotnet/plugin.js +1 -1
  216. package/build/plugins/resource/frontend/dotnet/plugin.js.map +1 -1
  217. package/build/plugins/resource/frontend/plugin.d.ts.map +1 -1
  218. package/build/plugins/resource/frontend/plugin.js +3 -9
  219. package/build/plugins/resource/frontend/plugin.js.map +1 -1
  220. package/build/plugins/resource/frontend/resources/templateInfo.js +2 -2
  221. package/build/plugins/resource/frontend/resources/templateInfo.js.map +1 -1
  222. package/build/plugins/resource/simpleauth/plugin.d.ts.map +1 -1
  223. package/build/plugins/resource/simpleauth/plugin.js +7 -23
  224. package/build/plugins/resource/simpleauth/plugin.js.map +1 -1
  225. package/build/plugins/resource/spfx/depsChecker/yoChecker.d.ts.map +1 -1
  226. package/build/plugins/resource/spfx/depsChecker/yoChecker.js +14 -0
  227. package/build/plugins/resource/spfx/depsChecker/yoChecker.js.map +1 -1
  228. package/build/plugins/resource/spfx/plugin.d.ts.map +1 -1
  229. package/build/plugins/resource/spfx/plugin.js +27 -34
  230. package/build/plugins/resource/spfx/plugin.js.map +1 -1
  231. package/build/plugins/resource/utils4v2.js +4 -4
  232. package/build/plugins/resource/utils4v2.js.map +1 -1
  233. package/build/plugins/solution/fx-solution/debug/scaffolding.d.ts.map +1 -1
  234. package/build/plugins/solution/fx-solution/debug/scaffolding.js +0 -7
  235. package/build/plugins/solution/fx-solution/debug/scaffolding.js.map +1 -1
  236. package/build/plugins/solution/fx-solution/question.d.ts.map +1 -1
  237. package/build/plugins/solution/fx-solution/question.js +16 -0
  238. package/build/plugins/solution/fx-solution/question.js.map +1 -1
  239. package/build/plugins/solution/fx-solution/v2/provisionLocal.d.ts.map +1 -1
  240. package/build/plugins/solution/fx-solution/v2/provisionLocal.js +9 -36
  241. package/build/plugins/solution/fx-solution/v2/provisionLocal.js.map +1 -1
  242. package/build/plugins/solution/fx-solution/v2/utils.d.ts.map +1 -1
  243. package/build/plugins/solution/fx-solution/v2/utils.js +3 -7
  244. package/build/plugins/solution/fx-solution/v2/utils.js.map +1 -1
  245. package/package.json +3 -3
  246. package/resource/package.nls.json +11 -9
  247. package/templates/bicep/azureFunction.config.orchestration.bicep +3 -3
  248. package/templates/bicep/azureFunction.provision.orchestration.bicep +10 -10
  249. package/templates/bicep/azureStorage.provision.orchestration.bicep +8 -8
  250. package/templates/bicep/azureWebApp.config.orchestration.bicep +3 -3
  251. package/templates/bicep/azureWebApp.provision.module.bicep +6 -6
  252. package/templates/bicep/azureWebApp.provision.orchestration.bicep +10 -10
  253. package/templates/bicep/botService.parameters.json +4 -0
  254. package/templates/bicep/{botService.config.module.bicep → botService.provision.module.bicep} +2 -2
  255. package/templates/bicep/botService.provision.orchestration.bicep +8 -0
  256. package/templates/fallback/bot.csharp.command-and-response.zip +0 -0
  257. package/templates/fallback/bot.csharp.default.zip +0 -0
  258. package/templates/fallback/bot.csharp.notification-function-base.zip +0 -0
  259. package/templates/fallback/bot.csharp.notification-trigger-http.zip +0 -0
  260. package/templates/fallback/bot.csharp.notification-trigger-timer.zip +0 -0
  261. package/templates/fallback/bot.csharp.notification-webapi.zip +0 -0
  262. package/templates/fallback/bot.js.command-and-response.zip +0 -0
  263. package/templates/fallback/bot.js.default.zip +0 -0
  264. package/templates/fallback/bot.js.m365.zip +0 -0
  265. package/templates/fallback/bot.js.notification-function-base.zip +0 -0
  266. package/templates/fallback/bot.js.notification-restify.zip +0 -0
  267. package/templates/fallback/bot.js.notification-trigger-http.zip +0 -0
  268. package/templates/fallback/bot.js.notification-trigger-timer.zip +0 -0
  269. package/templates/fallback/bot.ts.command-and-response.zip +0 -0
  270. package/templates/fallback/bot.ts.default.zip +0 -0
  271. package/templates/fallback/bot.ts.m365.zip +0 -0
  272. package/templates/fallback/bot.ts.notification-function-base.zip +0 -0
  273. package/templates/fallback/bot.ts.notification-restify.zip +0 -0
  274. package/templates/fallback/bot.ts.notification-trigger-http.zip +0 -0
  275. package/templates/fallback/bot.ts.notification-trigger-timer.zip +0 -0
  276. package/templates/fallback/function-base.js.default.zip +0 -0
  277. package/templates/fallback/function-base.ts.default.zip +0 -0
  278. package/templates/fallback/function-triggers.js.HTTPTrigger.zip +0 -0
  279. package/templates/fallback/function-triggers.ts.HTTPTrigger.zip +0 -0
  280. package/templates/fallback/tab.csharp.default.zip +0 -0
  281. package/templates/fallback/tab.js.default.zip +0 -0
  282. package/templates/fallback/tab.js.m365.zip +0 -0
  283. package/templates/fallback/tab.js.non-sso.zip +0 -0
  284. package/templates/fallback/tab.ts.default.zip +0 -0
  285. package/templates/fallback/tab.ts.m365.zip +0 -0
  286. package/templates/fallback/tab.ts.non-sso.zip +0 -0
  287. package/templates/plugins/resource/spfx/solution/README.md +1 -1
  288. package/build/component/resource/azureFunction.d.ts.map +0 -1
  289. package/build/component/resource/azureFunction.js +0 -117
  290. package/build/component/resource/azureFunction.js.map +0 -1
  291. package/build/component/resource/azureWebApp.d.ts +0 -28
  292. package/build/component/resource/azureWebApp.d.ts.map +0 -1
  293. package/build/component/resource/azureWebApp.js +0 -99
  294. package/build/component/resource/azureWebApp.js.map +0 -1
  295. package/build/core/middleware/localSettingsLoader.d.ts +0 -3
  296. package/build/core/middleware/localSettingsLoader.d.ts.map +0 -1
  297. package/build/core/middleware/localSettingsLoader.js +0 -69
  298. package/build/core/middleware/localSettingsLoader.js.map +0 -1
  299. package/build/core/middleware/localSettingsWriter.d.ts +0 -6
  300. package/build/core/middleware/localSettingsWriter.d.ts.map +0 -1
  301. package/build/core/middleware/localSettingsWriter.js +0 -33
  302. package/build/core/middleware/localSettingsWriter.js.map +0 -1
  303. package/templates/bicep/azureFunction.parameters.json +0 -4
  304. package/templates/bicep/azureWebApp.parameters.json +0 -4
  305. package/templates/bicep/botService.config.orchestration.bicep +0 -8
@@ -2,7 +2,7 @@
2
2
  // Copyright (c) Microsoft Corporation.
3
3
  // Licensed under the MIT license.
4
4
  Object.defineProperty(exports, "__esModule", { value: true });
5
- exports.createManifest = exports.createLocalManifest = exports.AppStudioPluginImpl = void 0;
5
+ exports.createManifest = exports.AppStudioPluginImpl = void 0;
6
6
  const tslib_1 = require("tslib");
7
7
  const teamsfx_api_1 = require("@microsoft/teamsfx-api");
8
8
  const appStudio_1 = require("./appStudio");
@@ -18,7 +18,6 @@ const folder_1 = require("../../../folder");
18
18
  const path_1 = tslib_1.__importDefault(require("path"));
19
19
  const util = tslib_1.__importStar(require("util"));
20
20
  const common_1 = require("../../../common");
21
- const localSettingsConstants_1 = require("../../../common/localSettingsConstants");
22
21
  const uuid_1 = require("uuid");
23
22
  const isUUID_1 = tslib_1.__importDefault(require("validator/lib/isUUID"));
24
23
  const mustache_1 = tslib_1.__importDefault(require("mustache"));
@@ -31,6 +30,7 @@ const environment_1 = require("../../../core/environment");
31
30
  const localizeUtils_1 = require("../../../common/localizeUtils");
32
31
  const utils_2 = require("../../../common/utils");
33
32
  const utils_3 = require("./utils/utils");
33
+ const strings_1 = require("../../resource/bot/resources/strings");
34
34
  class AppStudioPluginImpl {
35
35
  constructor() {
36
36
  this.commonProperties = {};
@@ -50,7 +50,7 @@ class AppStudioPluginImpl {
50
50
  if (appDefinitionAndManifest.isErr()) {
51
51
  return teamsfx_api_1.err(appDefinitionAndManifest.error);
52
52
  }
53
- const localTeamsAppID = await this.getTeamsAppId(ctx, true);
53
+ const localTeamsAppID = await this.getTeamsAppId(ctx);
54
54
  let createIfNotExist = false;
55
55
  if (!localTeamsAppID) {
56
56
  createIfNotExist = true;
@@ -84,7 +84,7 @@ class AppStudioPluginImpl {
84
84
  return teamsfx_api_1.err(appStudioTokenRes.error);
85
85
  }
86
86
  const appStudioToken = appStudioTokenRes.value;
87
- const localTeamsAppID = await this.getTeamsAppId(ctx, true);
87
+ const localTeamsAppID = await this.getTeamsAppId(ctx);
88
88
  let create = !localTeamsAppID;
89
89
  if (localTeamsAppID) {
90
90
  try {
@@ -96,11 +96,6 @@ class AppStudioPluginImpl {
96
96
  }
97
97
  const view = {
98
98
  config: ctx.envInfo.config,
99
- localSettings: {
100
- teamsApp: {
101
- teamsAppId: localTeamsAppID,
102
- },
103
- },
104
99
  };
105
100
  const manifestString = utils_3.renderTemplate(JSON.stringify(manifest), view);
106
101
  manifest = JSON.parse(manifestString);
@@ -116,7 +111,7 @@ class AppStudioPluginImpl {
116
111
  const provisionProgress = (_a = ctx.ui) === null || _a === void 0 ? void 0 : _a.createProgressBar(localizeUtils_1.getLocalizedString("plugins.appstudio.provisionTitle"), 1);
117
112
  await (provisionProgress === null || provisionProgress === void 0 ? void 0 : provisionProgress.start());
118
113
  await (provisionProgress === null || provisionProgress === void 0 ? void 0 : provisionProgress.next(localizeUtils_1.getLocalizedString("plugins.appstudio.provisionProgress", ctx.projectSettings.appName)));
119
- let remoteTeamsAppId = await this.getTeamsAppId(ctx, false);
114
+ let remoteTeamsAppId = await this.getTeamsAppId(ctx);
120
115
  let create = false;
121
116
  if (!remoteTeamsAppId) {
122
117
  create = true;
@@ -154,9 +149,9 @@ class AppStudioPluginImpl {
154
149
  const postProvisionProgress = (_a = ctx.ui) === null || _a === void 0 ? void 0 : _a.createProgressBar(localizeUtils_1.getLocalizedString("plugins.appstudio.provisionTitle"), 1);
155
150
  await (postProvisionProgress === null || postProvisionProgress === void 0 ? void 0 : postProvisionProgress.start(localizeUtils_1.getLocalizedString("plugins.appstudio.postProvisionProgress", ctx.projectSettings.appName)));
156
151
  await (postProvisionProgress === null || postProvisionProgress === void 0 ? void 0 : postProvisionProgress.next());
157
- const remoteTeamsAppId = await this.getTeamsAppId(ctx, false);
152
+ const remoteTeamsAppId = await this.getTeamsAppId(ctx);
158
153
  let manifestString;
159
- const manifestResult = await manifestTemplate_1.loadManifest(ctx.root, false);
154
+ const manifestResult = await manifestTemplate_1.loadManifest(ctx.root);
160
155
  if (manifestResult.isErr()) {
161
156
  await (postProvisionProgress === null || postProvisionProgress === void 0 ? void 0 : postProvisionProgress.end(false));
162
157
  return teamsfx_api_1.err(manifestResult.error);
@@ -166,7 +161,7 @@ class AppStudioPluginImpl {
166
161
  }
167
162
  let appDefinition;
168
163
  if (common_1.isSPFxProject(ctx.projectSettings)) {
169
- manifestString = await this.getSPFxManifest(ctx, false);
164
+ manifestString = await this.getSPFxManifest(ctx);
170
165
  const appDefinitionRes = await this.convertToAppDefinition(ctx, JSON.parse(manifestString), false);
171
166
  if (appDefinitionRes.isErr()) {
172
167
  await (postProvisionProgress === null || postProvisionProgress === void 0 ? void 0 : postProvisionProgress.end(false));
@@ -203,7 +198,7 @@ class AppStudioPluginImpl {
203
198
  var _a;
204
199
  let manifestString = undefined;
205
200
  if (common_1.isSPFxProject(ctx.projectSettings)) {
206
- manifestString = await this.getSPFxManifest(ctx, isLocalDebug);
201
+ manifestString = await this.getSPFxManifest(ctx);
207
202
  const manifest = JSON.parse(manifestString);
208
203
  if (!isUUID_1.default(manifest.id)) {
209
204
  manifest.id = uuid_1.v4();
@@ -261,10 +256,10 @@ class AppStudioPluginImpl {
261
256
  }
262
257
  async updateManifest(ctx, isLocalDebug) {
263
258
  var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
264
- const teamsAppId = await this.getTeamsAppId(ctx, isLocalDebug);
259
+ const teamsAppId = await this.getTeamsAppId(ctx);
265
260
  let manifest;
266
261
  let manifestString;
267
- const manifestResult = await manifestTemplate_1.loadManifest(ctx.root, isLocalDebug);
262
+ const manifestResult = await manifestTemplate_1.loadManifest(ctx.root);
268
263
  if (manifestResult.isErr()) {
269
264
  return teamsfx_api_1.err(manifestResult.error);
270
265
  }
@@ -273,7 +268,7 @@ class AppStudioPluginImpl {
273
268
  }
274
269
  let appDefinition;
275
270
  if (common_1.isSPFxProject(ctx.projectSettings)) {
276
- manifestString = await this.getSPFxManifest(ctx, isLocalDebug);
271
+ manifestString = await this.getSPFxManifest(ctx);
277
272
  manifest = JSON.parse(manifestString);
278
273
  const appDefinitionRes = await this.convertToAppDefinition(ctx, manifest, false);
279
274
  if (appDefinitionRes.isErr()) {
@@ -386,10 +381,6 @@ class AppStudioPluginImpl {
386
381
  const manifestFile = path_1.default.resolve(templateManifestFolder, "./solution/manifest_multi_env.json");
387
382
  const manifestString = (await fs.readFile(manifestFile)).toString();
388
383
  manifest = JSON.parse(manifestString);
389
- if (!common_1.isConfigUnifyEnabled()) {
390
- const localManifest = await createLocalManifest(ctx.projectSettings.appName, false, false, false, true);
391
- await fs.writeFile(`${appDir}/${constants_2.MANIFEST_LOCAL}`, JSON.stringify(localManifest, null, 4));
392
- }
393
384
  }
394
385
  else {
395
386
  const solutionSettings = (_a = ctx.projectSettings) === null || _a === void 0 ? void 0 : _a.solutionSettings;
@@ -401,11 +392,7 @@ class AppStudioPluginImpl {
401
392
  const hasMessageExtension = solutionSettings.capabilities.includes(question_1.MessageExtensionItem.id);
402
393
  const hasAad = common_1.isAADEnabled(solutionSettings);
403
394
  const isM365 = (_c = ctx.projectSettings) === null || _c === void 0 ? void 0 : _c.isM365;
404
- manifest = await createManifest(ctx.projectSettings.appName, hasFrontend, hasBot, hasNotificationBot, hasCommandAndResponseBot, hasMessageExtension, false, hasAad, isM365);
405
- if (!common_1.isConfigUnifyEnabled()) {
406
- const localDebugManifest = await createLocalManifest(ctx.projectSettings.appName, hasFrontend, hasBot, hasMessageExtension, false, hasAad, isM365);
407
- await fs.writeFile(`${appDir}/${constants_2.MANIFEST_LOCAL}`, JSON.stringify(localDebugManifest, null, 4));
408
- }
395
+ manifest = await createManifest(hasFrontend, hasBot, hasNotificationBot, hasCommandAndResponseBot, hasMessageExtension, false, hasAad, isM365);
409
396
  }
410
397
  await fs.ensureDir(appDir);
411
398
  const manifestTemplatePath = await manifestTemplate_1.getManifestTemplatePath(ctx.root);
@@ -443,7 +430,7 @@ class AppStudioPluginImpl {
443
430
  zipFileName = path_1.default.join(ctx.root, teamsfx_api_1.BuildFolderName, teamsfx_api_1.AppPackageFolderName, `appPackage.${ctx.envInfo.envName}.zip`);
444
431
  }
445
432
  if (common_1.isSPFxProject(ctx.projectSettings)) {
446
- manifestString = await this.getSPFxManifest(ctx, isLocalDebug);
433
+ manifestString = await this.getSPFxManifest(ctx);
447
434
  const manifest = JSON.parse(manifestString);
448
435
  if (!isUUID_1.default(manifest.id)) {
449
436
  manifest.id = uuid_1.v4();
@@ -557,7 +544,7 @@ class AppStudioPluginImpl {
557
544
  let manifest;
558
545
  const appDirectory = await common_1.getAppDirectory(ctx.root);
559
546
  if (common_1.isSPFxProject(ctx.projectSettings)) {
560
- const manifestString = await this.getSPFxManifest(ctx, false);
547
+ const manifestString = await this.getSPFxManifest(ctx);
561
548
  manifest = JSON.parse(manifestString);
562
549
  }
563
550
  else {
@@ -607,9 +594,8 @@ class AppStudioPluginImpl {
607
594
  }
608
595
  }
609
596
  async postLocalDebug(ctx) {
610
- var _a, _b;
611
597
  let teamsAppId;
612
- const manifest = await manifestTemplate_1.loadManifest(ctx.root, true);
598
+ const manifest = await manifestTemplate_1.loadManifest(ctx.root);
613
599
  if (manifest.isErr()) {
614
600
  return teamsfx_api_1.err(manifest.error);
615
601
  }
@@ -622,14 +608,7 @@ class AppStudioPluginImpl {
622
608
  if (teamsAppId.isErr()) {
623
609
  return teamsAppId;
624
610
  }
625
- if (common_1.isConfigUnifyEnabled()) {
626
- ctx.envInfo.state
627
- .get(constants_3.ResourcePlugins.AppStudio)
628
- .set(constants_2.Constants.TEAMS_APP_ID, teamsAppId.value);
629
- }
630
- else {
631
- (_b = (_a = ctx.localSettings) === null || _a === void 0 ? void 0 : _a.teamsApp) === null || _b === void 0 ? void 0 : _b.set(constants_2.Constants.TEAMS_APP_ID, teamsAppId.value);
632
- }
611
+ ctx.envInfo.state.get(constants_3.ResourcePlugins.AppStudio).set(constants_2.Constants.TEAMS_APP_ID, teamsAppId.value);
633
612
  return teamsfx_api_1.ok(teamsAppId.value);
634
613
  }
635
614
  async checkPermission(ctx, userInfo) {
@@ -640,7 +619,7 @@ class AppStudioPluginImpl {
640
619
  throw appStudioTokenRes.error;
641
620
  }
642
621
  const appStudioToken = appStudioTokenRes.value;
643
- const teamsAppId = await this.getTeamsAppId(ctx, false);
622
+ const teamsAppId = await this.getTeamsAppId(ctx);
644
623
  if (!teamsAppId) {
645
624
  throw new Error(constants_2.ErrorMessages.GetConfigError(constants_2.Constants.TEAMS_APP_ID, constants_1.PluginNames.APPST));
646
625
  }
@@ -663,7 +642,7 @@ class AppStudioPluginImpl {
663
642
  throw appStudioTokenRes.error;
664
643
  }
665
644
  const appStudioToken = appStudioTokenRes.value;
666
- const teamsAppId = await this.getTeamsAppId(ctx, false);
645
+ const teamsAppId = await this.getTeamsAppId(ctx);
667
646
  if (!teamsAppId) {
668
647
  throw new Error(constants_2.ErrorMessages.GetConfigError(constants_2.Constants.TEAMS_APP_ID, constants_1.PluginNames.APPST));
669
648
  }
@@ -702,7 +681,7 @@ class AppStudioPluginImpl {
702
681
  throw appStudioTokenRes.error;
703
682
  }
704
683
  const appStudioToken = appStudioTokenRes.value;
705
- const teamsAppId = await this.getTeamsAppId(ctx, false);
684
+ const teamsAppId = await this.getTeamsAppId(ctx);
706
685
  if (!teamsAppId) {
707
686
  const msgs = errors_1.AppStudioError.GrantPermissionFailedError.message(constants_2.ErrorMessages.GetConfigError(constants_2.Constants.TEAMS_APP_ID, constants_1.PluginNames.APPST));
708
687
  throw new teamsfx_api_1.UserError(constants_1.PluginNames.APPST, "GetConfigError", msgs[0], msgs[1]);
@@ -739,7 +718,7 @@ class AppStudioPluginImpl {
739
718
  throw results_1.AppStudioResultFactory.UserError(errors_1.AppStudioError.ValidationFailedError.name, errors_1.AppStudioError.ValidationFailedError.message(validationResult.value));
740
719
  }
741
720
  // Update App in App Studio
742
- const remoteTeamsAppId = await this.getTeamsAppId(ctx, false);
721
+ const remoteTeamsAppId = await this.getTeamsAppId(ctx);
743
722
  await (publishProgress === null || publishProgress === void 0 ? void 0 : publishProgress.next(localizeUtils_1.getLocalizedString("plugins.appstudio.publishProgressUpdate", remoteTeamsAppId)));
744
723
  const appDefinitionRes = await this.convertToAppDefinition(ctx, manifest, true);
745
724
  if (appDefinitionRes.isErr()) {
@@ -789,16 +768,18 @@ class AppStudioPluginImpl {
789
768
  await (publishProgress === null || publishProgress === void 0 ? void 0 : publishProgress.end(true));
790
769
  }
791
770
  }
792
- async getConfigForCreatingManifest(ctx, localDebug) {
793
- const tabEndpoint = this.getTabEndpoint(ctx, localDebug);
794
- const tabDomain = this.getTabDomain(ctx, localDebug);
795
- const tabIndexPath = this.getTabIndexPath(ctx, localDebug);
796
- const aadId = this.getAadClientId(ctx, localDebug);
797
- const botId = this.getBotId(ctx, localDebug);
798
- const botDomain = this.getBotDomain(ctx, localDebug);
799
- const teamsAppId = await this.getTeamsAppId(ctx, localDebug);
771
+ async getConfigForCreatingManifest(ctx) {
772
+ var _a, _b, _c, _d, _e, _f, _g;
773
+ const tabEndpoint = (_a = ctx.envInfo.state.get(constants_1.PluginNames.FE)) === null || _a === void 0 ? void 0 : _a.get(constants_2.FRONTEND_ENDPOINT);
774
+ const tabDomain = (_b = ctx.envInfo.state.get(constants_1.PluginNames.FE)) === null || _b === void 0 ? void 0 : _b.get(constants_2.FRONTEND_DOMAIN);
775
+ const tabIndexPath = (_c = ctx.envInfo.state.get(constants_1.PluginNames.FE)) === null || _c === void 0 ? void 0 : _c.get(constants_2.FRONTEND_INDEX_PATH);
776
+ const aadId = (_d = ctx.envInfo.state.get(constants_1.PluginNames.AAD)) === null || _d === void 0 ? void 0 : _d.get(constants_1.REMOTE_AAD_ID);
777
+ const botId = (_e = ctx.envInfo.state.get(constants_1.PluginNames.BOT)) === null || _e === void 0 ? void 0 : _e.get(constants_2.BOT_ID);
778
+ const botDomain = (_f = ctx.envInfo.state.get(constants_1.PluginNames.BOT)) === null || _f === void 0 ? void 0 : _f.get(constants_1.BOT_DOMAIN);
779
+ const teamsAppId = await this.getTeamsAppId(ctx);
800
780
  // This config value is set by aadPlugin.setApplicationInContext. so aadPlugin.setApplicationInContext needs to run first.
801
- const webApplicationInfoResource = this.getApplicationIdUris(ctx, localDebug);
781
+ const webApplicationInfoResource = (_g = ctx.envInfo.state
782
+ .get(constants_1.PluginNames.AAD)) === null || _g === void 0 ? void 0 : _g.get(constants_1.WEB_APPLICATION_INFO_SOURCE);
802
783
  return {
803
784
  tabEndpoint,
804
785
  tabDomain,
@@ -810,70 +791,18 @@ class AppStudioPluginImpl {
810
791
  teamsAppId,
811
792
  };
812
793
  }
813
- getTabEndpoint(ctx, isLocalDebug) {
814
- var _a, _b, _c;
815
- const tabEndpoint = isLocalDebug && !common_1.isConfigUnifyEnabled()
816
- ? (_b = (_a = ctx.localSettings) === null || _a === void 0 ? void 0 : _a.frontend) === null || _b === void 0 ? void 0 : _b.get(localSettingsConstants_1.LocalSettingsFrontendKeys.TabEndpoint)
817
- : (_c = ctx.envInfo.state.get(constants_1.PluginNames.FE)) === null || _c === void 0 ? void 0 : _c.get(constants_2.FRONTEND_ENDPOINT);
818
- return tabEndpoint;
819
- }
820
- getTabDomain(ctx, isLocalDebug) {
821
- var _a, _b, _c;
822
- const tabDomain = isLocalDebug && !common_1.isConfigUnifyEnabled()
823
- ? (_b = (_a = ctx.localSettings) === null || _a === void 0 ? void 0 : _a.frontend) === null || _b === void 0 ? void 0 : _b.get(localSettingsConstants_1.LocalSettingsFrontendKeys.TabDomain)
824
- : (_c = ctx.envInfo.state.get(constants_1.PluginNames.FE)) === null || _c === void 0 ? void 0 : _c.get(constants_2.FRONTEND_DOMAIN);
825
- return tabDomain;
826
- }
827
- getTabIndexPath(ctx, isLocalDebug) {
828
- var _a, _b, _c;
829
- const tabIndexPath = isLocalDebug && !common_1.isConfigUnifyEnabled()
830
- ? (_b = (_a = ctx.localSettings) === null || _a === void 0 ? void 0 : _a.frontend) === null || _b === void 0 ? void 0 : _b.get(localSettingsConstants_1.LocalSettingsFrontendKeys.TabIndexPath)
831
- : (_c = ctx.envInfo.state.get(constants_1.PluginNames.FE)) === null || _c === void 0 ? void 0 : _c.get(constants_2.FRONTEND_INDEX_PATH);
832
- return tabIndexPath;
833
- }
834
- getAadClientId(ctx, isLocalDebug) {
835
- var _a, _b, _c;
836
- const clientId = isLocalDebug && !common_1.isConfigUnifyEnabled()
837
- ? (_b = (_a = ctx.localSettings) === null || _a === void 0 ? void 0 : _a.auth) === null || _b === void 0 ? void 0 : _b.get(localSettingsConstants_1.LocalSettingsAuthKeys.ClientId)
838
- : (_c = ctx.envInfo.state.get(constants_1.PluginNames.AAD)) === null || _c === void 0 ? void 0 : _c.get(constants_1.REMOTE_AAD_ID);
839
- return clientId;
840
- }
841
- getBotId(ctx, isLocalDebug) {
842
- var _a, _b, _c;
843
- const botId = isLocalDebug && !common_1.isConfigUnifyEnabled()
844
- ? (_b = (_a = ctx.localSettings) === null || _a === void 0 ? void 0 : _a.bot) === null || _b === void 0 ? void 0 : _b.get(localSettingsConstants_1.LocalSettingsBotKeys.BotId)
845
- : (_c = ctx.envInfo.state.get(constants_1.PluginNames.BOT)) === null || _c === void 0 ? void 0 : _c.get(constants_2.BOT_ID);
846
- return botId;
847
- }
848
- getBotDomain(ctx, isLocalDebug) {
849
- var _a, _b, _c;
850
- const botDomain = isLocalDebug && !common_1.isConfigUnifyEnabled()
851
- ? (_b = (_a = ctx.localSettings) === null || _a === void 0 ? void 0 : _a.bot) === null || _b === void 0 ? void 0 : _b.get(localSettingsConstants_1.LocalSettingsBotKeys.BotDomain)
852
- : (_c = ctx.envInfo.state.get(constants_1.PluginNames.BOT)) === null || _c === void 0 ? void 0 : _c.get(constants_1.BOT_DOMAIN);
853
- return botDomain;
854
- }
855
- getApplicationIdUris(ctx, isLocalDebug) {
856
- var _a, _b, _c;
857
- const applicationIdUris = isLocalDebug
858
- ? (_b = (_a = ctx.localSettings) === null || _a === void 0 ? void 0 : _a.auth) === null || _b === void 0 ? void 0 : _b.get(localSettingsConstants_1.LocalSettingsAuthKeys.ApplicationIdUris)
859
- : (_c = ctx.envInfo.state.get(constants_1.PluginNames.AAD)) === null || _c === void 0 ? void 0 : _c.get(constants_1.WEB_APPLICATION_INFO_SOURCE);
860
- return applicationIdUris;
861
- }
862
794
  // TODO: remove isLocalDebug later after merging local and remote configs
863
- async getTeamsAppId(ctx, isLocalDebug) {
864
- var _a, _b, _c;
795
+ async getTeamsAppId(ctx) {
796
+ var _a;
865
797
  let teamsAppId = "";
866
798
  // User may manually update id in manifest template file, rather than configuration file
867
799
  // The id in manifest template file should override configurations
868
- const manifestResult = await manifestTemplate_1.loadManifest(ctx.root, isLocalDebug);
800
+ const manifestResult = await manifestTemplate_1.loadManifest(ctx.root);
869
801
  if (manifestResult.isOk()) {
870
802
  teamsAppId = manifestResult.value.id;
871
803
  }
872
804
  if (!isUUID_1.default(teamsAppId)) {
873
- teamsAppId =
874
- isLocalDebug && !common_1.isConfigUnifyEnabled()
875
- ? (_b = (_a = ctx.localSettings) === null || _a === void 0 ? void 0 : _a.teamsApp) === null || _b === void 0 ? void 0 : _b.get(localSettingsConstants_1.LocalSettingsTeamsAppKeys.TeamsAppId)
876
- : (_c = ctx.envInfo.state.get(constants_1.PluginNames.APPST)) === null || _c === void 0 ? void 0 : _c.get(constants_2.Constants.TEAMS_APP_ID);
805
+ teamsAppId = (_a = ctx.envInfo.state.get(constants_1.PluginNames.APPST)) === null || _a === void 0 ? void 0 : _a.get(constants_2.Constants.TEAMS_APP_ID);
877
806
  }
878
807
  return teamsAppId;
879
808
  }
@@ -1018,7 +947,7 @@ class AppStudioPluginImpl {
1018
947
  if (!status.isDirectory()) {
1019
948
  throw results_1.AppStudioResultFactory.UserError(errors_1.AppStudioError.NotADirectoryError.name, errors_1.AppStudioError.NotADirectoryError.message(appDirectory));
1020
949
  }
1021
- const manifestResult = await manifestTemplate_1.loadManifest(ctx.root, isLocalDebug);
950
+ const manifestResult = await manifestTemplate_1.loadManifest(ctx.root);
1022
951
  if (manifestResult.isErr()) {
1023
952
  return teamsfx_api_1.err(manifestResult.error);
1024
953
  }
@@ -1089,7 +1018,7 @@ class AppStudioPluginImpl {
1089
1018
  appDefinition.appId = teamsAppId;
1090
1019
  try {
1091
1020
  const app = await appStudio_1.AppStudioClient.updateApp(teamsAppId, appDefinition, appStudioToken, logProvider, colorIconContent, outlineIconContent);
1092
- if (app.updatedAt && (!isLocalDebug || common_1.isConfigUnifyEnabled())) {
1021
+ if (app.updatedAt) {
1093
1022
  const time = new Date(app.updatedAt).getTime();
1094
1023
  (_a = ctx.envInfo.state.get(constants_1.PluginNames.APPST)) === null || _a === void 0 ? void 0 : _a.set(constants_2.Constants.TEAMS_APP_UPDATED_AT, time);
1095
1024
  }
@@ -1123,31 +1052,11 @@ class AppStudioPluginImpl {
1123
1052
  }
1124
1053
  }
1125
1054
  async getAppDefinitionAndManifest(ctx, isLocalDebug) {
1126
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u;
1127
- const { tabEndpoint, tabDomain, tabIndexPath, aadId, botDomain, botId, webApplicationInfoResource, teamsAppId, } = await this.getConfigForCreatingManifest(ctx, isLocalDebug && !common_1.isConfigUnifyEnabled());
1055
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
1056
+ const { tabEndpoint, tabDomain, tabIndexPath, aadId, botDomain, botId, webApplicationInfoResource, teamsAppId, } = await this.getConfigForCreatingManifest(ctx);
1128
1057
  const isProvisionSucceeded = !!((_a = ctx.envInfo.state
1129
1058
  .get("solution")) === null || _a === void 0 ? void 0 : _a.get(constants_1.SOLUTION_PROVISION_SUCCEEDED));
1130
- const validDomains = [];
1131
- if (tabDomain) {
1132
- validDomains.push(tabDomain);
1133
- }
1134
- if (tabEndpoint && isLocalDebug) {
1135
- validDomains.push(tabEndpoint.slice(8));
1136
- }
1137
- if (botId) {
1138
- if (!botDomain) {
1139
- if (isLocalDebug && !common_1.isConfigUnifyEnabled()) {
1140
- return teamsfx_api_1.err(results_1.AppStudioResultFactory.SystemError(errors_1.AppStudioError.GetLocalDebugConfigFailedError.name, errors_1.AppStudioError.GetLocalDebugConfigFailedError.message(new Error(localizeUtils_1.getLocalizedString("plugins.appstudio.dataRequired", constants_1.LOCAL_DEBUG_BOT_DOMAIN)))));
1141
- }
1142
- else {
1143
- return teamsfx_api_1.err(results_1.AppStudioResultFactory.UserError(errors_1.AppStudioError.GetRemoteConfigFailedError.name, errors_1.AppStudioError.GetRemoteConfigFailedError.message(localizeUtils_1.getLocalizedString("plugins.appstudio.dataRequired", constants_1.BOT_DOMAIN), isProvisionSucceeded), constants_3.HelpLinks.WhyNeedProvision));
1144
- }
1145
- }
1146
- else {
1147
- validDomains.push(botDomain);
1148
- }
1149
- }
1150
- const manifestResult = await manifestTemplate_1.loadManifest(ctx.root, isLocalDebug);
1059
+ const manifestResult = await manifestTemplate_1.loadManifest(ctx.root);
1151
1060
  if (manifestResult.isErr()) {
1152
1061
  return teamsfx_api_1.err(manifestResult.error);
1153
1062
  }
@@ -1156,20 +1065,14 @@ class AppStudioPluginImpl {
1156
1065
  let endpoint = tabEndpoint;
1157
1066
  let indexPath = tabIndexPath;
1158
1067
  let hasFrontend = false;
1159
- if (common_1.isConfigUnifyEnabled()) {
1160
- const capabilities = await manifestTemplate_1.getCapabilities(ctx.root);
1161
- if (capabilities.isErr()) {
1162
- return teamsfx_api_1.err(capabilities.error);
1163
- }
1164
- hasFrontend =
1165
- capabilities.value.includes("staticTab") || capabilities.value.includes("configurableTab");
1166
- }
1167
- else {
1168
- const solutionSettings = (_b = ctx.projectSettings) === null || _b === void 0 ? void 0 : _b.solutionSettings;
1169
- hasFrontend = solutionSettings.capabilities.includes(question_1.TabOptionItem.id);
1068
+ const capabilities = await manifestTemplate_1.getCapabilities(ctx.root);
1069
+ if (capabilities.isErr()) {
1070
+ return teamsfx_api_1.err(capabilities.error);
1170
1071
  }
1072
+ hasFrontend =
1073
+ capabilities.value.includes("staticTab") || capabilities.value.includes("configurableTab");
1171
1074
  if (!endpoint && !hasFrontend) {
1172
- endpoint = constants_2.DEFAULT_DEVELOPER_WEBSITE_URL;
1075
+ endpoint = constants_2.DEFAULT_DEVELOPER.websiteUrl;
1173
1076
  indexPath = "";
1174
1077
  }
1175
1078
  const customizedKeys = utils_1.getCustomizedKeys("", JSON.parse(manifestString));
@@ -1180,50 +1083,22 @@ class AppStudioPluginImpl {
1180
1083
  config: ctx.envInfo.config,
1181
1084
  state: {
1182
1085
  "fx-resource-frontend-hosting": {
1183
- endpoint: endpoint !== null && endpoint !== void 0 ? endpoint : "{{{state.fx-resource-frontend-hosting.endpoint}}}",
1184
- indexPath: indexPath !== null && indexPath !== void 0 ? indexPath : "{{{state.fx-resource-frontend-hosting.indexPath}}}",
1086
+ endpoint: endpoint !== null && endpoint !== void 0 ? endpoint : "{{state.fx-resource-frontend-hosting.endpoint}}",
1087
+ indexPath: indexPath !== null && indexPath !== void 0 ? indexPath : "{{state.fx-resource-frontend-hosting.indexPath}}",
1088
+ domain: tabDomain !== null && tabDomain !== void 0 ? tabDomain : "{{state.fx-resource-frontend-hosting.domain}}",
1185
1089
  },
1186
1090
  "fx-resource-aad-app-for-teams": {
1187
1091
  clientId: aadId !== null && aadId !== void 0 ? aadId : "{{state.fx-resource-aad-app-for-teams.clientId}}",
1188
- applicationIdUris: webApplicationInfoResource !== null && webApplicationInfoResource !== void 0 ? webApplicationInfoResource : "{{{state.fx-resource-aad-app-for-teams.applicationIdUris}}}",
1092
+ applicationIdUris: webApplicationInfoResource !== null && webApplicationInfoResource !== void 0 ? webApplicationInfoResource : "{{state.fx-resource-aad-app-for-teams.applicationIdUris}}",
1189
1093
  },
1190
1094
  "fx-resource-appstudio": {
1191
1095
  teamsAppId: teamsAppId !== null && teamsAppId !== void 0 ? teamsAppId : "{{state.fx-resource-appstudio.teamsAppId}}",
1192
1096
  },
1193
1097
  "fx-resource-bot": {
1194
1098
  botId: botId !== null && botId !== void 0 ? botId : "{{state.fx-resource-bot.botId}}",
1195
- },
1196
- },
1197
- localSettings: {
1198
- frontend: {
1199
- tabEndpoint: endpoint ? endpoint : "{{{localSettings.frontend.tabEndpoint}}}",
1200
- tabIndexPath: indexPath !== null && indexPath !== void 0 ? indexPath : "{{{localSettings.frontend.tabIndexPath}}}",
1201
- },
1202
- auth: {
1203
- clientId: common_1.isConfigUnifyEnabled() && aadId
1204
- ? aadId
1205
- : ((_d = (_c = ctx.localSettings) === null || _c === void 0 ? void 0 : _c.auth) === null || _d === void 0 ? void 0 : _d.get(localSettingsConstants_1.LocalSettingsAuthKeys.ClientId))
1206
- ? (_f = (_e = ctx.localSettings) === null || _e === void 0 ? void 0 : _e.auth) === null || _f === void 0 ? void 0 : _f.get(localSettingsConstants_1.LocalSettingsAuthKeys.ClientId)
1207
- : "{{localSettings.auth.clientId}}",
1208
- applicationIdUris: common_1.isConfigUnifyEnabled() && webApplicationInfoResource
1209
- ? webApplicationInfoResource
1210
- : ((_h = (_g = ctx.localSettings) === null || _g === void 0 ? void 0 : _g.auth) === null || _h === void 0 ? void 0 : _h.get(localSettingsConstants_1.LocalSettingsAuthKeys.ApplicationIdUris))
1211
- ? (_k = (_j = ctx.localSettings) === null || _j === void 0 ? void 0 : _j.auth) === null || _k === void 0 ? void 0 : _k.get(localSettingsConstants_1.LocalSettingsAuthKeys.ApplicationIdUris)
1212
- : "{{{localSettings.auth.applicationIdUris}}}",
1213
- },
1214
- teamsApp: {
1215
- teamsAppId: common_1.isConfigUnifyEnabled() && teamsAppId
1216
- ? teamsAppId
1217
- : ((_m = (_l = ctx.localSettings) === null || _l === void 0 ? void 0 : _l.teamsApp) === null || _m === void 0 ? void 0 : _m.get(localSettingsConstants_1.LocalSettingsTeamsAppKeys.TeamsAppId))
1218
- ? (_p = (_o = ctx.localSettings) === null || _o === void 0 ? void 0 : _o.teamsApp) === null || _p === void 0 ? void 0 : _p.get(localSettingsConstants_1.LocalSettingsTeamsAppKeys.TeamsAppId)
1219
- : "{{localSettings.teamsApp.teamsAppId}}",
1220
- },
1221
- bot: {
1222
- botId: common_1.isConfigUnifyEnabled() && botId
1223
- ? botId
1224
- : ((_r = (_q = ctx.localSettings) === null || _q === void 0 ? void 0 : _q.bot) === null || _r === void 0 ? void 0 : _r.get(localSettingsConstants_1.LocalSettingsBotKeys.BotId))
1225
- ? (_t = (_s = ctx.localSettings) === null || _s === void 0 ? void 0 : _s.bot) === null || _t === void 0 ? void 0 : _t.get(localSettingsConstants_1.LocalSettingsBotKeys.BotId)
1226
- : "{{localSettings.bot.botId}}",
1099
+ siteEndpoint: (_c = (_b = ctx.envInfo.state.get(constants_1.PluginNames.BOT)) === null || _b === void 0 ? void 0 : _b.get(strings_1.PluginBot.SITE_ENDPOINT)) !== null && _c !== void 0 ? _c : "{{state.fx-resource-bot.siteEndpoint}}",
1100
+ siteName: (_e = (_d = ctx.envInfo.state.get(constants_1.PluginNames.BOT)) === null || _d === void 0 ? void 0 : _d.get(strings_1.PluginBot.SITE_NAME)) !== null && _e !== void 0 ? _e : "{{state.fx-resource-bot.siteName}}",
1101
+ validDomain: (_g = (_f = ctx.envInfo.state.get(constants_1.PluginNames.BOT)) === null || _f === void 0 ? void 0 : _f.get(strings_1.PluginBot.VALID_DOMAIN)) !== null && _g !== void 0 ? _g : "{{state.fx-resource-bot.validDomain}}",
1227
1102
  },
1228
1103
  },
1229
1104
  };
@@ -1231,15 +1106,9 @@ class AppStudioPluginImpl {
1231
1106
  const tokens = [
1232
1107
  ...new Set(mustache_1.default.parse(manifestString)
1233
1108
  .filter((x) => {
1234
- if (common_1.isConfigUnifyEnabled()) {
1235
- // TODO: update local check
1236
- return (x[0] != "text" &&
1237
- (ctx.envInfo.envName !== environment_1.environmentManager.getLocalEnvName() ||
1238
- x[1] != "state.fx-resource-appstudio.teamsAppId"));
1239
- }
1240
- else {
1241
- return x[0] != "text" && x[1] != "localSettings.teamsApp.teamsAppId";
1242
- }
1109
+ return (x[0] != "text" &&
1110
+ (ctx.envInfo.envName !== environment_1.environmentManager.getLocalEnvName() ||
1111
+ x[1] != "state.fx-resource-appstudio.teamsAppId"));
1243
1112
  })
1244
1113
  .map((x) => x[1])),
1245
1114
  ];
@@ -1269,8 +1138,28 @@ class AppStudioPluginImpl {
1269
1138
  return teamsfx_api_1.err(error);
1270
1139
  }
1271
1140
  }
1272
- for (const domain of validDomains) {
1273
- (_u = updatedManifest.validDomains) === null || _u === void 0 ? void 0 : _u.push(domain);
1141
+ // This should be removed in future, the valid domains will be rendered by states
1142
+ if (((_h = updatedManifest.validDomains) === null || _h === void 0 ? void 0 : _h.length) == 0 || isLocalDebug) {
1143
+ const validDomains = [];
1144
+ if (tabDomain) {
1145
+ validDomains.push(tabDomain);
1146
+ }
1147
+ if (tabEndpoint && isLocalDebug) {
1148
+ validDomains.push(tabEndpoint.slice(8));
1149
+ }
1150
+ if (botId) {
1151
+ if (!botDomain) {
1152
+ return teamsfx_api_1.err(results_1.AppStudioResultFactory.UserError(errors_1.AppStudioError.GetRemoteConfigFailedError.name, errors_1.AppStudioError.GetRemoteConfigFailedError.message(localizeUtils_1.getLocalizedString("plugins.appstudio.dataRequired", constants_1.BOT_DOMAIN), isProvisionSucceeded), constants_3.HelpLinks.WhyNeedProvision));
1153
+ }
1154
+ else {
1155
+ validDomains.push(botDomain);
1156
+ }
1157
+ }
1158
+ for (const domain of validDomains) {
1159
+ if (((_j = updatedManifest.validDomains) === null || _j === void 0 ? void 0 : _j.indexOf(domain)) == -1) {
1160
+ (_k = updatedManifest.validDomains) === null || _k === void 0 ? void 0 : _k.push(domain);
1161
+ }
1162
+ }
1274
1163
  }
1275
1164
  const appDefinitionRes = await this.convertToAppDefinition(ctx, updatedManifest, false);
1276
1165
  if (appDefinitionRes.isErr()) {
@@ -1279,9 +1168,8 @@ class AppStudioPluginImpl {
1279
1168
  const appDefinition = appDefinitionRes.value;
1280
1169
  return teamsfx_api_1.ok([appDefinition, updatedManifest]);
1281
1170
  }
1282
- async getSPFxManifest(ctx, isLocalDebug) {
1283
- var _a, _b;
1284
- const manifestResult = await manifestTemplate_1.loadManifest(ctx.root, isLocalDebug);
1171
+ async getSPFxManifest(ctx) {
1172
+ const manifestResult = await manifestTemplate_1.loadManifest(ctx.root);
1285
1173
  if (manifestResult.isErr()) {
1286
1174
  throw manifestResult.error;
1287
1175
  }
@@ -1290,12 +1178,7 @@ class AppStudioPluginImpl {
1290
1178
  config: ctx.envInfo.config,
1291
1179
  state: {
1292
1180
  "fx-resource-appstudio": {
1293
- teamsAppId: await this.getTeamsAppId(ctx, isLocalDebug),
1294
- },
1295
- },
1296
- localSettings: {
1297
- teamsApp: {
1298
- teamsAppId: (_b = (_a = ctx.localSettings) === null || _a === void 0 ? void 0 : _a.teamsApp) === null || _b === void 0 ? void 0 : _b.get(localSettingsConstants_1.LocalSettingsTeamsAppKeys.TeamsAppId),
1181
+ teamsAppId: await this.getTeamsAppId(ctx),
1299
1182
  },
1300
1183
  },
1301
1184
  };
@@ -1304,48 +1187,8 @@ class AppStudioPluginImpl {
1304
1187
  }
1305
1188
  }
1306
1189
  exports.AppStudioPluginImpl = AppStudioPluginImpl;
1307
- async function createLocalManifest(appName, hasFrontend, hasBot, hasMessageExtension, isSPFx, hasAad = true, isM365 = false) {
1308
- let name = appName;
1309
- const suffix = "-local-debug";
1310
- if (suffix.length + appName.length <= constants_2.TEAMS_APP_SHORT_NAME_MAX_LENGTH) {
1311
- name = name + suffix;
1312
- }
1313
- if (isSPFx) {
1314
- const templateManifestFolder = path_1.default.join(folder_1.getTemplatesFolder(), "plugins", "resource", "spfx");
1315
- const localManifestFile = path_1.default.resolve(templateManifestFolder, `./solution/${constants_2.MANIFEST_LOCAL}`);
1316
- let manifestString = (await fs.readFile(localManifestFile)).toString();
1317
- manifestString = utils_1.replaceConfigValue(manifestString, "appName", name);
1318
- const manifest = JSON.parse(manifestString);
1319
- return manifest;
1320
- }
1321
- else {
1322
- let manifestString = constants_2.TEAMS_APP_MANIFEST_TEMPLATE_LOCAL_DEBUG_V3;
1323
- manifestString = utils_1.replaceConfigValue(manifestString, "appName", name);
1324
- const manifest = JSON.parse(manifestString);
1325
- if (hasAad) {
1326
- manifest.webApplicationInfo = constants_2.WEB_APPLICATION_INFO_LOCAL_DEBUG;
1327
- }
1328
- if (hasFrontend) {
1329
- manifest.staticTabs = constants_2.STATIC_TABS_TPL_LOCAL_DEBUG;
1330
- if (!isM365) {
1331
- manifest.configurableTabs = constants_2.CONFIGURABLE_TABS_TPL_LOCAL_DEBUG;
1332
- }
1333
- }
1334
- if (hasBot) {
1335
- manifest.bots = constants_2.BOTS_TPL_LOCAL_DEBUG;
1336
- }
1337
- if (hasMessageExtension) {
1338
- manifest.composeExtensions = constants_2.COMPOSE_EXTENSIONS_TPL_LOCAL_DEBUG;
1339
- }
1340
- if (isM365) {
1341
- manifest.$schema = constants_2.M365_SCHEMA;
1342
- manifest.manifestVersion = constants_2.M365_MANIFEST_VERSION;
1343
- }
1344
- return manifest;
1345
- }
1346
- }
1347
- exports.createLocalManifest = createLocalManifest;
1348
- async function createManifest(appName, hasFrontend, hasBot, hasNotificationBot, hasCommandAndResponseBot, hasMessageExtension, isSPFx, hasAad = true, isM365 = false) {
1190
+ async function createManifest(hasFrontend, hasBot, hasNotificationBot, hasCommandAndResponseBot, hasMessageExtension, isSPFx, hasAad = true, isM365 = false) {
1191
+ var _a, _b;
1349
1192
  if (!hasBot && !hasMessageExtension && !hasFrontend && !hasAad) {
1350
1193
  throw new Error(`Invalid capability`);
1351
1194
  }
@@ -1360,6 +1203,10 @@ async function createManifest(appName, hasFrontend, hasBot, hasNotificationBot,
1360
1203
  if (!isM365) {
1361
1204
  manifest.configurableTabs = constants_2.CONFIGURABLE_TABS_TPL_FOR_MULTI_ENV;
1362
1205
  }
1206
+ (_a = manifest.validDomains) === null || _a === void 0 ? void 0 : _a.push("{{state.fx-resource-frontend-hosting.domain}}");
1207
+ }
1208
+ else {
1209
+ manifest.developer = constants_2.DEFAULT_DEVELOPER;
1363
1210
  }
1364
1211
  if (hasBot) {
1365
1212
  if (hasCommandAndResponseBot) {
@@ -1371,6 +1218,7 @@ async function createManifest(appName, hasFrontend, hasBot, hasNotificationBot,
1371
1218
  else {
1372
1219
  manifest.bots = constants_2.BOTS_TPL_FOR_MULTI_ENV;
1373
1220
  }
1221
+ (_b = manifest.validDomains) === null || _b === void 0 ? void 0 : _b.push("{{state.fx-resource-bot.validDomain}}");
1374
1222
  }
1375
1223
  if (hasMessageExtension) {
1376
1224
  manifest.composeExtensions = isM365