@microsoft/teamsfx-core 1.5.0 → 1.5.1-alpha.3fc0dea41.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 (696) hide show
  1. package/build/common/constants.d.ts +7 -0
  2. package/build/common/constants.d.ts.map +1 -1
  3. package/build/common/constants.js +8 -0
  4. package/build/common/constants.js.map +1 -1
  5. package/build/common/deps-checker/internal/dotnetChecker.d.ts.map +1 -1
  6. package/build/common/deps-checker/internal/dotnetChecker.js +1 -1
  7. package/build/common/deps-checker/internal/dotnetChecker.js.map +1 -1
  8. package/build/common/index.d.ts +1 -0
  9. package/build/common/index.d.ts.map +1 -1
  10. package/build/common/index.js +1 -0
  11. package/build/common/index.js.map +1 -1
  12. package/build/common/local/constants.d.ts +5 -0
  13. package/build/common/local/constants.d.ts.map +1 -1
  14. package/build/common/local/constants.js +6 -1
  15. package/build/common/local/constants.js.map +1 -1
  16. package/build/common/local/localEnvManager.d.ts.map +1 -1
  17. package/build/common/local/localEnvManager.js +3 -2
  18. package/build/common/local/localEnvManager.js.map +1 -1
  19. package/build/common/local/projectSettingsHelper.d.ts +1 -0
  20. package/build/common/local/projectSettingsHelper.d.ts.map +1 -1
  21. package/build/common/local/projectSettingsHelper.js +9 -5
  22. package/build/common/local/projectSettingsHelper.js.map +1 -1
  23. package/build/common/localSettingsProvider.d.ts +1 -1
  24. package/build/common/localSettingsProvider.d.ts.map +1 -1
  25. package/build/common/localSettingsProvider.js +4 -1
  26. package/build/common/localSettingsProvider.js.map +1 -1
  27. package/build/common/localizeUtils.d.ts +3 -0
  28. package/build/common/localizeUtils.d.ts.map +1 -0
  29. package/build/common/localizeUtils.js +38 -0
  30. package/build/common/localizeUtils.js.map +1 -0
  31. package/build/common/projectSettingsHelper.d.ts +11 -0
  32. package/build/common/projectSettingsHelper.d.ts.map +1 -0
  33. package/build/common/projectSettingsHelper.js +134 -0
  34. package/build/common/projectSettingsHelper.js.map +1 -0
  35. package/build/common/template-utils/templatesActions.d.ts.map +1 -1
  36. package/build/common/template-utils/templatesActions.js +3 -2
  37. package/build/common/template-utils/templatesActions.js.map +1 -1
  38. package/build/common/templates-config.json +2 -2
  39. package/build/common/tools.d.ts +8 -2
  40. package/build/common/tools.d.ts.map +1 -1
  41. package/build/common/tools.js +62 -10
  42. package/build/common/tools.js.map +1 -1
  43. package/build/core/FxCore.d.ts +78 -0
  44. package/build/core/FxCore.d.ts.map +1 -0
  45. package/build/core/FxCore.js +1305 -0
  46. package/build/core/FxCore.js.map +1 -0
  47. package/build/core/SolutionPluginContainer.d.ts.map +1 -1
  48. package/build/core/SolutionPluginContainer.js.map +1 -1
  49. package/build/core/collaborator.d.ts +1 -4
  50. package/build/core/collaborator.d.ts.map +1 -1
  51. package/build/core/collaborator.js +56 -77
  52. package/build/core/collaborator.js.map +1 -1
  53. package/build/core/downloadSample.d.ts +2 -2
  54. package/build/core/downloadSample.d.ts.map +1 -1
  55. package/build/core/downloadSample.js +6 -5
  56. package/build/core/downloadSample.js.map +1 -1
  57. package/build/core/environment.d.ts +4 -2
  58. package/build/core/environment.d.ts.map +1 -1
  59. package/build/core/environment.js +50 -43
  60. package/build/core/environment.js.map +1 -1
  61. package/build/core/error.d.ts +27 -12
  62. package/build/core/error.d.ts.map +1 -1
  63. package/build/core/error.js +45 -33
  64. package/build/core/error.js.map +1 -1
  65. package/build/core/globalVars.d.ts +12 -0
  66. package/build/core/globalVars.d.ts.map +1 -0
  67. package/build/core/globalVars.js +41 -0
  68. package/build/core/globalVars.js.map +1 -0
  69. package/build/core/index.d.ts +4 -101
  70. package/build/core/index.d.ts.map +1 -1
  71. package/build/core/index.js +5 -1377
  72. package/build/core/index.js.map +1 -1
  73. package/build/core/middleware/concurrentLocker.d.ts +1 -0
  74. package/build/core/middleware/concurrentLocker.d.ts.map +1 -1
  75. package/build/core/middleware/concurrentLocker.js +17 -12
  76. package/build/core/middleware/concurrentLocker.js.map +1 -1
  77. package/build/core/middleware/envInfoLoader.d.ts +1 -1
  78. package/build/core/middleware/envInfoLoader.d.ts.map +1 -1
  79. package/build/core/middleware/envInfoLoader.js +28 -21
  80. package/build/core/middleware/envInfoLoader.js.map +1 -1
  81. package/build/core/middleware/envInfoLoaderV3.d.ts.map +1 -1
  82. package/build/core/middleware/envInfoLoaderV3.js +2 -3
  83. package/build/core/middleware/envInfoLoaderV3.js.map +1 -1
  84. package/build/core/middleware/envInfoWriter.js +3 -4
  85. package/build/core/middleware/envInfoWriter.js.map +1 -1
  86. package/build/core/middleware/envInfoWriterV3.js +3 -4
  87. package/build/core/middleware/envInfoWriterV3.js.map +1 -1
  88. package/build/core/middleware/errorHandler.d.ts.map +1 -1
  89. package/build/core/middleware/errorHandler.js +7 -5
  90. package/build/core/middleware/errorHandler.js.map +1 -1
  91. package/build/core/middleware/localSettingsLoader.js +3 -4
  92. package/build/core/middleware/localSettingsLoader.js.map +1 -1
  93. package/build/core/middleware/localSettingsWriter.d.ts.map +1 -1
  94. package/build/core/middleware/localSettingsWriter.js +4 -4
  95. package/build/core/middleware/localSettingsWriter.js.map +1 -1
  96. package/build/core/middleware/projectMigrator.d.ts +1 -1
  97. package/build/core/middleware/projectMigrator.d.ts.map +1 -1
  98. package/build/core/middleware/projectMigrator.js +52 -57
  99. package/build/core/middleware/projectMigrator.js.map +1 -1
  100. package/build/core/middleware/projectSettingsLoader.d.ts +1 -1
  101. package/build/core/middleware/projectSettingsLoader.d.ts.map +1 -1
  102. package/build/core/middleware/projectSettingsLoader.js +12 -10
  103. package/build/core/middleware/projectSettingsLoader.js.map +1 -1
  104. package/build/core/middleware/projectSettingsWriter.js +2 -2
  105. package/build/core/middleware/projectSettingsWriter.js.map +1 -1
  106. package/build/core/middleware/questionModel.d.ts.map +1 -1
  107. package/build/core/middleware/questionModel.js +78 -48
  108. package/build/core/middleware/questionModel.js.map +1 -1
  109. package/build/core/middleware/solutionLoader.d.ts +1 -1
  110. package/build/core/middleware/solutionLoader.d.ts.map +1 -1
  111. package/build/core/middleware/solutionLoader.js.map +1 -1
  112. package/build/core/middleware/solutionLoaderV3.d.ts +1 -1
  113. package/build/core/middleware/solutionLoaderV3.d.ts.map +1 -1
  114. package/build/core/middleware/solutionLoaderV3.js.map +1 -1
  115. package/build/core/pvm/broker.js +1 -1
  116. package/build/core/pvm/broker.js.map +1 -1
  117. package/build/core/question.d.ts +10 -7
  118. package/build/core/question.d.ts.map +1 -1
  119. package/build/core/question.js +156 -109
  120. package/build/core/question.js.map +1 -1
  121. package/build/core/types.d.ts +14 -0
  122. package/build/core/types.d.ts.map +1 -0
  123. package/build/core/types.js +5 -0
  124. package/build/core/types.js.map +1 -0
  125. package/build/plugins/resource/aad/aadAppClient.d.ts.map +1 -1
  126. package/build/plugins/resource/aad/aadAppClient.js +8 -9
  127. package/build/plugins/resource/aad/aadAppClient.js.map +1 -1
  128. package/build/plugins/resource/aad/aadAppManifestManager.d.ts +9 -0
  129. package/build/plugins/resource/aad/aadAppManifestManager.d.ts.map +1 -0
  130. package/build/plugins/resource/aad/aadAppManifestManager.js +78 -0
  131. package/build/plugins/resource/aad/aadAppManifestManager.js.map +1 -0
  132. package/build/plugins/resource/aad/appStudio.js +2 -2
  133. package/build/plugins/resource/aad/appStudio.js.map +1 -1
  134. package/build/plugins/resource/aad/constants.d.ts +5 -5
  135. package/build/plugins/resource/aad/constants.d.ts.map +1 -1
  136. package/build/plugins/resource/aad/constants.js +10 -9
  137. package/build/plugins/resource/aad/constants.js.map +1 -1
  138. package/build/plugins/resource/aad/errors.d.ts +19 -19
  139. package/build/plugins/resource/aad/errors.d.ts.map +1 -1
  140. package/build/plugins/resource/aad/errors.js +44 -48
  141. package/build/plugins/resource/aad/errors.js.map +1 -1
  142. package/build/plugins/resource/aad/index.d.ts.map +1 -1
  143. package/build/plugins/resource/aad/index.js +2 -6
  144. package/build/plugins/resource/aad/index.js.map +1 -1
  145. package/build/plugins/resource/aad/interfaces/AADApplication.d.ts +122 -0
  146. package/build/plugins/resource/aad/interfaces/AADApplication.d.ts.map +1 -0
  147. package/build/plugins/resource/aad/interfaces/AADApplication.js +3 -0
  148. package/build/plugins/resource/aad/interfaces/AADApplication.js.map +1 -0
  149. package/build/plugins/resource/aad/interfaces/AADManifest.d.ts +111 -0
  150. package/build/plugins/resource/aad/interfaces/AADManifest.d.ts.map +1 -0
  151. package/build/plugins/resource/aad/interfaces/AADManifest.js +3 -0
  152. package/build/plugins/resource/aad/interfaces/AADManifest.js.map +1 -0
  153. package/build/plugins/resource/aad/permissions/index.d.ts +5 -0
  154. package/build/plugins/resource/aad/permissions/index.d.ts.map +1 -0
  155. package/build/plugins/resource/aad/permissions/index.js +38 -0
  156. package/build/plugins/resource/aad/permissions/index.js.map +1 -0
  157. package/build/plugins/resource/aad/plugin.d.ts.map +1 -1
  158. package/build/plugins/resource/aad/plugin.js +21 -22
  159. package/build/plugins/resource/aad/plugin.js.map +1 -1
  160. package/build/plugins/resource/aad/utils/aadManifestHelper.d.ts +7 -0
  161. package/build/plugins/resource/aad/utils/aadManifestHelper.d.ts.map +1 -0
  162. package/build/plugins/resource/aad/utils/aadManifestHelper.js +150 -0
  163. package/build/plugins/resource/aad/utils/aadManifestHelper.js.map +1 -0
  164. package/build/plugins/resource/aad/utils/configs.d.ts +18 -1
  165. package/build/plugins/resource/aad/utils/configs.d.ts.map +1 -1
  166. package/build/plugins/resource/aad/utils/configs.js +128 -7
  167. package/build/plugins/resource/aad/utils/configs.js.map +1 -1
  168. package/build/plugins/resource/aad/utils/telemetry.js +3 -3
  169. package/build/plugins/resource/aad/utils/telemetry.js.map +1 -1
  170. package/build/plugins/resource/aad/v3/index.d.ts +1 -5
  171. package/build/plugins/resource/aad/v3/index.d.ts.map +1 -1
  172. package/build/plugins/resource/aad/v3/index.js +8 -42
  173. package/build/plugins/resource/aad/v3/index.js.map +1 -1
  174. package/build/plugins/resource/apim/constants.d.ts +8 -7
  175. package/build/plugins/resource/apim/constants.d.ts.map +1 -1
  176. package/build/plugins/resource/apim/constants.js +55 -55
  177. package/build/plugins/resource/apim/constants.js.map +1 -1
  178. package/build/plugins/resource/apim/error.d.ts +0 -1
  179. package/build/plugins/resource/apim/error.d.ts.map +1 -1
  180. package/build/plugins/resource/apim/error.js +20 -24
  181. package/build/plugins/resource/apim/error.js.map +1 -1
  182. package/build/plugins/resource/appstudio/appStudio.js +2 -2
  183. package/build/plugins/resource/appstudio/appStudio.js.map +1 -1
  184. package/build/plugins/resource/appstudio/constants.d.ts +11 -0
  185. package/build/plugins/resource/appstudio/constants.d.ts.map +1 -1
  186. package/build/plugins/resource/appstudio/constants.js +12 -1
  187. package/build/plugins/resource/appstudio/constants.js.map +1 -1
  188. package/build/plugins/resource/appstudio/errors.d.ts +9 -33
  189. package/build/plugins/resource/appstudio/errors.d.ts.map +1 -1
  190. package/build/plugins/resource/appstudio/errors.js +37 -64
  191. package/build/plugins/resource/appstudio/errors.js.map +1 -1
  192. package/build/plugins/resource/appstudio/index.d.ts +1 -1
  193. package/build/plugins/resource/appstudio/index.d.ts.map +1 -1
  194. package/build/plugins/resource/appstudio/index.js +12 -9
  195. package/build/plugins/resource/appstudio/index.js.map +1 -1
  196. package/build/plugins/resource/appstudio/manifestTemplate.d.ts +10 -4
  197. package/build/plugins/resource/appstudio/manifestTemplate.d.ts.map +1 -1
  198. package/build/plugins/resource/appstudio/manifestTemplate.js +147 -63
  199. package/build/plugins/resource/appstudio/manifestTemplate.js.map +1 -1
  200. package/build/plugins/resource/appstudio/plugin.d.ts +2 -2
  201. package/build/plugins/resource/appstudio/plugin.d.ts.map +1 -1
  202. package/build/plugins/resource/appstudio/plugin.js +110 -58
  203. package/build/plugins/resource/appstudio/plugin.js.map +1 -1
  204. package/build/plugins/resource/appstudio/questions.d.ts.map +1 -1
  205. package/build/plugins/resource/appstudio/questions.js +5 -4
  206. package/build/plugins/resource/appstudio/questions.js.map +1 -1
  207. package/build/plugins/resource/appstudio/utils/utils.d.ts.map +1 -1
  208. package/build/plugins/resource/appstudio/utils/utils.js +2 -1
  209. package/build/plugins/resource/appstudio/utils/utils.js.map +1 -1
  210. package/build/plugins/resource/appstudio/v2/index.d.ts +2 -3
  211. package/build/plugins/resource/appstudio/v2/index.d.ts.map +1 -1
  212. package/build/plugins/resource/appstudio/v2/index.js +1 -2
  213. package/build/plugins/resource/appstudio/v2/index.js.map +1 -1
  214. package/build/plugins/resource/appstudio/v3/index.d.ts +2 -2
  215. package/build/plugins/resource/appstudio/v3/index.d.ts.map +1 -1
  216. package/build/plugins/resource/appstudio/v3/index.js +2 -2
  217. package/build/plugins/resource/appstudio/v3/index.js.map +1 -1
  218. package/build/plugins/resource/appstudio/v3/plugin.d.ts +2 -2
  219. package/build/plugins/resource/appstudio/v3/plugin.d.ts.map +1 -1
  220. package/build/plugins/resource/appstudio/v3/plugin.js +3 -3
  221. package/build/plugins/resource/appstudio/v3/plugin.js.map +1 -1
  222. package/build/plugins/resource/bot/aadRegistration.d.ts.map +1 -1
  223. package/build/plugins/resource/bot/aadRegistration.js +4 -8
  224. package/build/plugins/resource/bot/aadRegistration.js.map +1 -1
  225. package/build/plugins/resource/bot/appStudio/appStudio.d.ts.map +1 -1
  226. package/build/plugins/resource/bot/appStudio/appStudio.js +5 -8
  227. package/build/plugins/resource/bot/appStudio/appStudio.js.map +1 -1
  228. package/build/plugins/resource/bot/azureOps.d.ts +0 -1
  229. package/build/plugins/resource/bot/azureOps.d.ts.map +1 -1
  230. package/build/plugins/resource/bot/azureOps.js +2 -21
  231. package/build/plugins/resource/bot/azureOps.js.map +1 -1
  232. package/build/plugins/resource/bot/configs/localDebugConfig.d.ts.map +1 -1
  233. package/build/plugins/resource/bot/configs/localDebugConfig.js +13 -38
  234. package/build/plugins/resource/bot/configs/localDebugConfig.js.map +1 -1
  235. package/build/plugins/resource/bot/configs/scaffoldConfig.d.ts +11 -0
  236. package/build/plugins/resource/bot/configs/scaffoldConfig.d.ts.map +1 -1
  237. package/build/plugins/resource/bot/configs/scaffoldConfig.js +55 -6
  238. package/build/plugins/resource/bot/configs/scaffoldConfig.js.map +1 -1
  239. package/build/plugins/resource/bot/configs/teamsBotConfig.d.ts.map +1 -1
  240. package/build/plugins/resource/bot/configs/teamsBotConfig.js +8 -1
  241. package/build/plugins/resource/bot/configs/teamsBotConfig.js.map +1 -1
  242. package/build/plugins/resource/bot/constants.d.ts +25 -2
  243. package/build/plugins/resource/bot/constants.d.ts.map +1 -1
  244. package/build/plugins/resource/bot/constants.js +27 -3
  245. package/build/plugins/resource/bot/constants.js.map +1 -1
  246. package/build/plugins/resource/bot/enums/pluginActRoles.d.ts +2 -1
  247. package/build/plugins/resource/bot/enums/pluginActRoles.d.ts.map +1 -1
  248. package/build/plugins/resource/bot/enums/pluginActRoles.js +1 -0
  249. package/build/plugins/resource/bot/enums/pluginActRoles.js.map +1 -1
  250. package/build/plugins/resource/bot/errors.d.ts +44 -23
  251. package/build/plugins/resource/bot/errors.d.ts.map +1 -1
  252. package/build/plugins/resource/bot/errors.js +57 -44
  253. package/build/plugins/resource/bot/errors.js.map +1 -1
  254. package/build/plugins/resource/bot/functionsHostedBot/plugin.d.ts +7 -0
  255. package/build/plugins/resource/bot/functionsHostedBot/plugin.d.ts.map +1 -0
  256. package/build/plugins/resource/bot/functionsHostedBot/plugin.js +39 -0
  257. package/build/plugins/resource/bot/functionsHostedBot/plugin.js.map +1 -0
  258. package/build/plugins/resource/bot/index.d.ts +8 -3
  259. package/build/plugins/resource/bot/index.d.ts.map +1 -1
  260. package/build/plugins/resource/bot/index.js +84 -31
  261. package/build/plugins/resource/bot/index.js.map +1 -1
  262. package/build/plugins/resource/bot/languageStrategy.d.ts +4 -1
  263. package/build/plugins/resource/bot/languageStrategy.d.ts.map +1 -1
  264. package/build/plugins/resource/bot/languageStrategy.js +30 -3
  265. package/build/plugins/resource/bot/languageStrategy.js.map +1 -1
  266. package/build/plugins/resource/bot/plugin.d.ts +3 -6
  267. package/build/plugins/resource/bot/plugin.d.ts.map +1 -1
  268. package/build/plugins/resource/bot/plugin.js +42 -110
  269. package/build/plugins/resource/bot/plugin.js.map +1 -1
  270. package/build/plugins/resource/bot/question.d.ts +12 -0
  271. package/build/plugins/resource/bot/question.d.ts.map +1 -0
  272. package/build/plugins/resource/bot/question.js +69 -0
  273. package/build/plugins/resource/bot/question.js.map +1 -0
  274. package/build/plugins/resource/bot/resources/messages.d.ts +34 -56
  275. package/build/plugins/resource/bot/resources/messages.d.ts.map +1 -1
  276. package/build/plugins/resource/bot/resources/messages.js +58 -73
  277. package/build/plugins/resource/bot/resources/messages.js.map +1 -1
  278. package/build/plugins/resource/bot/resources/strings.d.ts +17 -28
  279. package/build/plugins/resource/bot/resources/strings.d.ts.map +1 -1
  280. package/build/plugins/resource/bot/resources/strings.js +19 -30
  281. package/build/plugins/resource/bot/resources/strings.js.map +1 -1
  282. package/build/plugins/resource/bot/utils/common.d.ts +5 -1
  283. package/build/plugins/resource/bot/utils/common.d.ts.map +1 -1
  284. package/build/plugins/resource/bot/utils/common.js +19 -1
  285. package/build/plugins/resource/bot/utils/common.js.map +1 -1
  286. package/build/plugins/resource/bot/utils/retryHandler.d.ts +1 -1
  287. package/build/plugins/resource/bot/utils/retryHandler.d.ts.map +1 -1
  288. package/build/plugins/resource/bot/utils/retryHandler.js.map +1 -1
  289. package/build/plugins/resource/bot/utils/telemetry-helper.d.ts.map +1 -1
  290. package/build/plugins/resource/bot/utils/telemetry-helper.js +3 -1
  291. package/build/plugins/resource/bot/utils/telemetry-helper.js.map +1 -1
  292. package/build/plugins/resource/bot/v2/index.d.ts +3 -1
  293. package/build/plugins/resource/bot/v2/index.d.ts.map +1 -1
  294. package/build/plugins/resource/bot/v2/index.js +6 -0
  295. package/build/plugins/resource/bot/v2/index.js.map +1 -1
  296. package/build/plugins/resource/bot/v3/index.d.ts +2 -1
  297. package/build/plugins/resource/bot/v3/index.d.ts.map +1 -1
  298. package/build/plugins/resource/bot/v3/index.js +15 -1
  299. package/build/plugins/resource/bot/v3/index.js.map +1 -1
  300. package/build/plugins/resource/cicd/constants.d.ts +39 -0
  301. package/build/plugins/resource/cicd/constants.d.ts.map +1 -0
  302. package/build/plugins/resource/cicd/constants.js +52 -0
  303. package/build/plugins/resource/cicd/constants.js.map +1 -0
  304. package/build/plugins/resource/cicd/errors.d.ts +24 -0
  305. package/build/plugins/resource/cicd/errors.d.ts.map +1 -0
  306. package/build/plugins/resource/cicd/errors.js +48 -0
  307. package/build/plugins/resource/cicd/errors.js.map +1 -0
  308. package/build/plugins/resource/cicd/index.d.ts +17 -0
  309. package/build/plugins/resource/cicd/index.d.ts.map +1 -0
  310. package/build/plugins/resource/cicd/index.js +117 -0
  311. package/build/plugins/resource/cicd/index.js.map +1 -0
  312. package/build/plugins/resource/cicd/logger.d.ts +10 -0
  313. package/build/plugins/resource/cicd/logger.d.ts.map +1 -0
  314. package/build/plugins/resource/cicd/logger.js +27 -0
  315. package/build/plugins/resource/cicd/logger.js.map +1 -0
  316. package/build/plugins/resource/cicd/plugin.d.ts +10 -0
  317. package/build/plugins/resource/cicd/plugin.d.ts.map +1 -0
  318. package/build/plugins/resource/cicd/plugin.js +78 -0
  319. package/build/plugins/resource/cicd/plugin.js.map +1 -0
  320. package/build/plugins/resource/cicd/providers/azdoProvider.d.ts +6 -0
  321. package/build/plugins/resource/cicd/providers/azdoProvider.d.ts.map +1 -0
  322. package/build/plugins/resource/cicd/providers/azdoProvider.js +25 -0
  323. package/build/plugins/resource/cicd/providers/azdoProvider.js.map +1 -0
  324. package/build/plugins/resource/cicd/providers/enums.d.ts +12 -0
  325. package/build/plugins/resource/cicd/providers/enums.d.ts.map +1 -0
  326. package/build/plugins/resource/cicd/providers/enums.js +19 -0
  327. package/build/plugins/resource/cicd/providers/enums.js.map +1 -0
  328. package/build/plugins/resource/cicd/providers/factory.d.ts +6 -0
  329. package/build/plugins/resource/cicd/providers/factory.d.ts.map +1 -0
  330. package/build/plugins/resource/cicd/providers/factory.js +28 -0
  331. package/build/plugins/resource/cicd/providers/factory.js.map +1 -0
  332. package/build/plugins/resource/cicd/providers/githubProvider.d.ts +6 -0
  333. package/build/plugins/resource/cicd/providers/githubProvider.d.ts.map +1 -0
  334. package/build/plugins/resource/cicd/providers/githubProvider.js +25 -0
  335. package/build/plugins/resource/cicd/providers/githubProvider.js.map +1 -0
  336. package/build/plugins/resource/cicd/providers/jenkinsProvider.d.ts +6 -0
  337. package/build/plugins/resource/cicd/providers/jenkinsProvider.d.ts.map +1 -0
  338. package/build/plugins/resource/cicd/providers/jenkinsProvider.js +25 -0
  339. package/build/plugins/resource/cicd/providers/jenkinsProvider.js.map +1 -0
  340. package/build/plugins/resource/cicd/providers/provider.d.ts +11 -0
  341. package/build/plugins/resource/cicd/providers/provider.d.ts.map +1 -0
  342. package/build/plugins/resource/cicd/providers/provider.js +92 -0
  343. package/build/plugins/resource/cicd/providers/provider.js.map +1 -0
  344. package/build/plugins/resource/cicd/questions.d.ts +14 -0
  345. package/build/plugins/resource/cicd/questions.d.ts.map +1 -0
  346. package/build/plugins/resource/cicd/questions.js +45 -0
  347. package/build/plugins/resource/cicd/questions.js.map +1 -0
  348. package/build/plugins/resource/cicd/result.d.ts +11 -0
  349. package/build/plugins/resource/cicd/result.d.ts.map +1 -0
  350. package/build/plugins/resource/cicd/result.js +23 -0
  351. package/build/plugins/resource/cicd/result.js.map +1 -0
  352. package/build/plugins/resource/cicd/utils/buildScripts.d.ts +3 -0
  353. package/build/plugins/resource/cicd/utils/buildScripts.d.ts.map +1 -0
  354. package/build/plugins/resource/cicd/utils/buildScripts.js +34 -0
  355. package/build/plugins/resource/cicd/utils/buildScripts.js.map +1 -0
  356. package/build/plugins/resource/cicd/utils/telemetry-helper.d.ts +29 -0
  357. package/build/plugins/resource/cicd/utils/telemetry-helper.d.ts.map +1 -0
  358. package/build/plugins/resource/cicd/utils/telemetry-helper.js +46 -0
  359. package/build/plugins/resource/cicd/utils/telemetry-helper.js.map +1 -0
  360. package/build/plugins/resource/frontend/configs.js +4 -4
  361. package/build/plugins/resource/frontend/configs.js.map +1 -1
  362. package/build/plugins/resource/frontend/dotnet/ops/scaffold.d.ts.map +1 -1
  363. package/build/plugins/resource/frontend/dotnet/ops/scaffold.js +1 -2
  364. package/build/plugins/resource/frontend/dotnet/ops/scaffold.js.map +1 -1
  365. package/build/plugins/resource/frontend/dotnet/plugin.d.ts +2 -2
  366. package/build/plugins/resource/frontend/dotnet/plugin.d.ts.map +1 -1
  367. package/build/plugins/resource/frontend/dotnet/plugin.js.map +1 -1
  368. package/build/plugins/resource/frontend/env.d.ts.map +1 -1
  369. package/build/plugins/resource/frontend/env.js +2 -3
  370. package/build/plugins/resource/frontend/env.js.map +1 -1
  371. package/build/plugins/resource/frontend/index.d.ts.map +1 -1
  372. package/build/plugins/resource/frontend/index.js +3 -3
  373. package/build/plugins/resource/frontend/index.js.map +1 -1
  374. package/build/plugins/resource/frontend/ops/scaffold.d.ts.map +1 -1
  375. package/build/plugins/resource/frontend/ops/scaffold.js +1 -1
  376. package/build/plugins/resource/frontend/ops/scaffold.js.map +1 -1
  377. package/build/plugins/resource/frontend/resources/errors.d.ts +5 -4
  378. package/build/plugins/resource/frontend/resources/errors.d.ts.map +1 -1
  379. package/build/plugins/resource/frontend/resources/errors.js +50 -65
  380. package/build/plugins/resource/frontend/resources/errors.js.map +1 -1
  381. package/build/plugins/resource/frontend/resources/messages.d.ts +0 -2
  382. package/build/plugins/resource/frontend/resources/messages.d.ts.map +1 -1
  383. package/build/plugins/resource/frontend/resources/messages.js +0 -2
  384. package/build/plugins/resource/frontend/resources/messages.js.map +1 -1
  385. package/build/plugins/resource/frontend/resources/templateInfo.d.ts +1 -0
  386. package/build/plugins/resource/frontend/resources/templateInfo.d.ts.map +1 -1
  387. package/build/plugins/resource/frontend/resources/templateInfo.js +3 -1
  388. package/build/plugins/resource/frontend/resources/templateInfo.js.map +1 -1
  389. package/build/plugins/resource/frontend/utils/telemetry-helper.d.ts +1 -1
  390. package/build/plugins/resource/frontend/utils/telemetry-helper.d.ts.map +1 -1
  391. package/build/plugins/resource/frontend/utils/telemetry-helper.js +2 -3
  392. package/build/plugins/resource/frontend/utils/telemetry-helper.js.map +1 -1
  393. package/build/plugins/resource/frontend/v2/index.d.ts.map +1 -1
  394. package/build/plugins/resource/frontend/v2/index.js.map +1 -1
  395. package/build/plugins/resource/frontend/v3/error.d.ts.map +1 -1
  396. package/build/plugins/resource/frontend/v3/error.js +8 -20
  397. package/build/plugins/resource/frontend/v3/error.js.map +1 -1
  398. package/build/plugins/resource/function/index.d.ts.map +1 -1
  399. package/build/plugins/resource/function/index.js +1 -2
  400. package/build/plugins/resource/function/index.js.map +1 -1
  401. package/build/plugins/resource/function/ops/scaffold.d.ts.map +1 -1
  402. package/build/plugins/resource/function/ops/scaffold.js +1 -1
  403. package/build/plugins/resource/function/ops/scaffold.js.map +1 -1
  404. package/build/plugins/resource/function/plugin.d.ts +0 -2
  405. package/build/plugins/resource/function/plugin.d.ts.map +1 -1
  406. package/build/plugins/resource/function/plugin.js +2 -50
  407. package/build/plugins/resource/function/plugin.js.map +1 -1
  408. package/build/plugins/resource/function/resources/errors.d.ts +2 -15
  409. package/build/plugins/resource/function/resources/errors.d.ts.map +1 -1
  410. package/build/plugins/resource/function/resources/errors.js +40 -74
  411. package/build/plugins/resource/function/resources/errors.js.map +1 -1
  412. package/build/plugins/resource/function/utils/telemetry-helper.d.ts +1 -2
  413. package/build/plugins/resource/function/utils/telemetry-helper.d.ts.map +1 -1
  414. package/build/plugins/resource/function/utils/telemetry-helper.js +2 -3
  415. package/build/plugins/resource/function/utils/telemetry-helper.js.map +1 -1
  416. package/build/plugins/resource/function/v3/error.d.ts +1 -1
  417. package/build/plugins/resource/function/v3/error.d.ts.map +1 -1
  418. package/build/plugins/resource/function/v3/error.js +12 -23
  419. package/build/plugins/resource/function/v3/error.js.map +1 -1
  420. package/build/plugins/resource/function/v3/index.d.ts.map +1 -1
  421. package/build/plugins/resource/function/v3/index.js +1 -1
  422. package/build/plugins/resource/function/v3/index.js.map +1 -1
  423. package/build/plugins/resource/identity/constants.d.ts +2 -1
  424. package/build/plugins/resource/identity/constants.d.ts.map +1 -1
  425. package/build/plugins/resource/identity/constants.js +2 -1
  426. package/build/plugins/resource/identity/constants.js.map +1 -1
  427. package/build/plugins/resource/identity/index.d.ts +4 -16
  428. package/build/plugins/resource/identity/index.d.ts.map +1 -1
  429. package/build/plugins/resource/identity/index.js +46 -119
  430. package/build/plugins/resource/identity/index.js.map +1 -1
  431. package/build/plugins/resource/identity/utils/telemetryUtil.d.ts +3 -3
  432. package/build/plugins/resource/identity/utils/telemetryUtil.d.ts.map +1 -1
  433. package/build/plugins/resource/identity/utils/telemetryUtil.js +6 -6
  434. package/build/plugins/resource/identity/utils/telemetryUtil.js.map +1 -1
  435. package/build/plugins/resource/identity/v2/index.d.ts.map +1 -1
  436. package/build/plugins/resource/identity/v2/index.js.map +1 -1
  437. package/build/plugins/resource/identity/v3/index.d.ts +0 -2
  438. package/build/plugins/resource/identity/v3/index.d.ts.map +1 -1
  439. package/build/plugins/resource/identity/v3/index.js +0 -2
  440. package/build/plugins/resource/identity/v3/index.js.map +1 -1
  441. package/build/plugins/resource/index.d.ts +1 -0
  442. package/build/plugins/resource/index.d.ts.map +1 -1
  443. package/build/plugins/resource/index.js +1 -0
  444. package/build/plugins/resource/index.js.map +1 -1
  445. package/build/plugins/resource/simpleauth/constants.d.ts +1 -1
  446. package/build/plugins/resource/simpleauth/constants.d.ts.map +1 -1
  447. package/build/plugins/resource/simpleauth/constants.js +4 -3
  448. package/build/plugins/resource/simpleauth/constants.js.map +1 -1
  449. package/build/plugins/resource/simpleauth/errors.d.ts.map +1 -1
  450. package/build/plugins/resource/simpleauth/errors.js +13 -12
  451. package/build/plugins/resource/simpleauth/errors.js.map +1 -1
  452. package/build/plugins/resource/simpleauth/plugin.d.ts.map +1 -1
  453. package/build/plugins/resource/simpleauth/plugin.js +2 -13
  454. package/build/plugins/resource/simpleauth/plugin.js.map +1 -1
  455. package/build/plugins/resource/simpleauth/utils/common.d.ts.map +1 -1
  456. package/build/plugins/resource/simpleauth/utils/common.js +17 -50
  457. package/build/plugins/resource/simpleauth/utils/common.js.map +1 -1
  458. package/build/plugins/resource/spfx/error.d.ts.map +1 -1
  459. package/build/plugins/resource/spfx/error.js +8 -9
  460. package/build/plugins/resource/spfx/error.js.map +1 -1
  461. package/build/plugins/resource/spfx/index.d.ts.map +1 -1
  462. package/build/plugins/resource/spfx/index.js +3 -29
  463. package/build/plugins/resource/spfx/index.js.map +1 -1
  464. package/build/plugins/resource/spfx/plugin.d.ts.map +1 -1
  465. package/build/plugins/resource/spfx/plugin.js +149 -78
  466. package/build/plugins/resource/spfx/plugin.js.map +1 -1
  467. package/build/plugins/resource/spfx/utils/constants.d.ts +11 -6
  468. package/build/plugins/resource/spfx/utils/constants.d.ts.map +1 -1
  469. package/build/plugins/resource/spfx/utils/constants.js +15 -8
  470. package/build/plugins/resource/spfx/utils/constants.js.map +1 -1
  471. package/build/plugins/resource/spfx/utils/progress-helper.d.ts +3 -0
  472. package/build/plugins/resource/spfx/utils/progress-helper.d.ts.map +1 -1
  473. package/build/plugins/resource/spfx/utils/progress-helper.js +11 -0
  474. package/build/plugins/resource/spfx/utils/progress-helper.js.map +1 -1
  475. package/build/plugins/resource/spfx/utils/questions.d.ts.map +1 -1
  476. package/build/plugins/resource/spfx/utils/questions.js +11 -4
  477. package/build/plugins/resource/spfx/utils/questions.js.map +1 -1
  478. package/build/plugins/resource/spfx/utils/utils.js +2 -2
  479. package/build/plugins/resource/spfx/utils/utils.js.map +1 -1
  480. package/build/plugins/resource/spfx/v3/index.d.ts.map +1 -1
  481. package/build/plugins/resource/spfx/v3/index.js +2 -14
  482. package/build/plugins/resource/spfx/v3/index.js.map +1 -1
  483. package/build/plugins/resource/spfx/v3/plugin.d.ts.map +1 -1
  484. package/build/plugins/resource/spfx/v3/plugin.js +9 -8
  485. package/build/plugins/resource/spfx/v3/plugin.js.map +1 -1
  486. package/build/plugins/resource/sql/constants.d.ts +0 -6
  487. package/build/plugins/resource/sql/constants.d.ts.map +1 -1
  488. package/build/plugins/resource/sql/constants.js +0 -6
  489. package/build/plugins/resource/sql/constants.js.map +1 -1
  490. package/build/plugins/resource/sql/errors.d.ts +0 -10
  491. package/build/plugins/resource/sql/errors.d.ts.map +1 -1
  492. package/build/plugins/resource/sql/errors.js +18 -27
  493. package/build/plugins/resource/sql/errors.js.map +1 -1
  494. package/build/plugins/resource/sql/questions.d.ts.map +1 -1
  495. package/build/plugins/resource/sql/questions.js +4 -3
  496. package/build/plugins/resource/sql/questions.js.map +1 -1
  497. package/build/plugins/resource/sql/sqlClient.d.ts.map +1 -1
  498. package/build/plugins/resource/sql/sqlClient.js +8 -2
  499. package/build/plugins/resource/sql/sqlClient.js.map +1 -1
  500. package/build/plugins/resource/sql/utils/checkInput.d.ts.map +1 -1
  501. package/build/plugins/resource/sql/utils/checkInput.js +11 -11
  502. package/build/plugins/resource/sql/utils/checkInput.js.map +1 -1
  503. package/build/plugins/resource/sql/utils/message.d.ts +0 -17
  504. package/build/plugins/resource/sql/utils/message.d.ts.map +1 -1
  505. package/build/plugins/resource/sql/utils/message.js +0 -17
  506. package/build/plugins/resource/sql/utils/message.js.map +1 -1
  507. package/build/plugins/resource/utils4v2.d.ts +4 -0
  508. package/build/plugins/resource/utils4v2.d.ts.map +1 -1
  509. package/build/plugins/resource/utils4v2.js +30 -6
  510. package/build/plugins/resource/utils4v2.js.map +1 -1
  511. package/build/plugins/solution/fx-solution/ResourcePluginContainer.d.ts +1 -0
  512. package/build/plugins/solution/fx-solution/ResourcePluginContainer.d.ts.map +1 -1
  513. package/build/plugins/solution/fx-solution/ResourcePluginContainer.js +1 -0
  514. package/build/plugins/solution/fx-solution/ResourcePluginContainer.js.map +1 -1
  515. package/build/plugins/solution/fx-solution/arm.d.ts.map +1 -1
  516. package/build/plugins/solution/fx-solution/arm.js +19 -14
  517. package/build/plugins/solution/fx-solution/arm.js.map +1 -1
  518. package/build/plugins/solution/fx-solution/debug/constants.d.ts +5 -0
  519. package/build/plugins/solution/fx-solution/debug/constants.d.ts.map +1 -1
  520. package/build/plugins/solution/fx-solution/debug/constants.js +7 -1
  521. package/build/plugins/solution/fx-solution/debug/constants.js.map +1 -1
  522. package/build/plugins/solution/fx-solution/debug/provisionLocal.d.ts.map +1 -1
  523. package/build/plugins/solution/fx-solution/debug/provisionLocal.js +18 -12
  524. package/build/plugins/solution/fx-solution/debug/provisionLocal.js.map +1 -1
  525. package/build/plugins/solution/fx-solution/debug/scaffolding.d.ts.map +1 -1
  526. package/build/plugins/solution/fx-solution/debug/scaffolding.js +24 -41
  527. package/build/plugins/solution/fx-solution/debug/scaffolding.js.map +1 -1
  528. package/build/plugins/solution/fx-solution/debug/util/launch.d.ts.map +1 -1
  529. package/build/plugins/solution/fx-solution/debug/util/launch.js +5 -1
  530. package/build/plugins/solution/fx-solution/debug/util/launch.js.map +1 -1
  531. package/build/plugins/solution/fx-solution/debug/util/launchNext.d.ts +2 -0
  532. package/build/plugins/solution/fx-solution/debug/util/launchNext.d.ts.map +1 -1
  533. package/build/plugins/solution/fx-solution/debug/util/launchNext.js +116 -1
  534. package/build/plugins/solution/fx-solution/debug/util/launchNext.js.map +1 -1
  535. package/build/plugins/solution/fx-solution/debug/util/tasksNext.d.ts +2 -1
  536. package/build/plugins/solution/fx-solution/debug/util/tasksNext.d.ts.map +1 -1
  537. package/build/plugins/solution/fx-solution/debug/util/tasksNext.js +151 -3
  538. package/build/plugins/solution/fx-solution/debug/util/tasksNext.js.map +1 -1
  539. package/build/plugins/solution/fx-solution/question.d.ts +16 -4
  540. package/build/plugins/solution/fx-solution/question.d.ts.map +1 -1
  541. package/build/plugins/solution/fx-solution/question.js +59 -78
  542. package/build/plugins/solution/fx-solution/question.js.map +1 -1
  543. package/build/plugins/solution/fx-solution/solution.d.ts +5 -11
  544. package/build/plugins/solution/fx-solution/solution.d.ts.map +1 -1
  545. package/build/plugins/solution/fx-solution/solution.js +50 -59
  546. package/build/plugins/solution/fx-solution/solution.js.map +1 -1
  547. package/build/plugins/solution/fx-solution/types.d.ts +10 -0
  548. package/build/plugins/solution/fx-solution/types.d.ts.map +1 -0
  549. package/build/plugins/solution/fx-solution/types.js +12 -0
  550. package/build/plugins/solution/fx-solution/types.js.map +1 -0
  551. package/build/plugins/solution/fx-solution/utils/progressHelper.d.ts +0 -3
  552. package/build/plugins/solution/fx-solution/utils/progressHelper.d.ts.map +1 -1
  553. package/build/plugins/solution/fx-solution/utils/progressHelper.js +4 -8
  554. package/build/plugins/solution/fx-solution/utils/progressHelper.js.map +1 -1
  555. package/build/plugins/solution/fx-solution/v2/adaptor.js +6 -6
  556. package/build/plugins/solution/fx-solution/v2/adaptor.js.map +1 -1
  557. package/build/plugins/solution/fx-solution/v2/checkPermission.d.ts.map +1 -1
  558. package/build/plugins/solution/fx-solution/v2/checkPermission.js +20 -13
  559. package/build/plugins/solution/fx-solution/v2/checkPermission.js.map +1 -1
  560. package/build/plugins/solution/fx-solution/v2/createEnv.d.ts.map +1 -1
  561. package/build/plugins/solution/fx-solution/v2/createEnv.js +2 -1
  562. package/build/plugins/solution/fx-solution/v2/createEnv.js.map +1 -1
  563. package/build/plugins/solution/fx-solution/v2/deploy.d.ts.map +1 -1
  564. package/build/plugins/solution/fx-solution/v2/deploy.js +8 -10
  565. package/build/plugins/solution/fx-solution/v2/deploy.js.map +1 -1
  566. package/build/plugins/solution/fx-solution/v2/executeUserTask.d.ts.map +1 -1
  567. package/build/plugins/solution/fx-solution/v2/executeUserTask.js +52 -24
  568. package/build/plugins/solution/fx-solution/v2/executeUserTask.js.map +1 -1
  569. package/build/plugins/solution/fx-solution/v2/getQuestions.d.ts.map +1 -1
  570. package/build/plugins/solution/fx-solution/v2/getQuestions.js +27 -11
  571. package/build/plugins/solution/fx-solution/v2/getQuestions.js.map +1 -1
  572. package/build/plugins/solution/fx-solution/v2/grantPermission.d.ts.map +1 -1
  573. package/build/plugins/solution/fx-solution/v2/grantPermission.js +16 -16
  574. package/build/plugins/solution/fx-solution/v2/grantPermission.js.map +1 -1
  575. package/build/plugins/solution/fx-solution/v2/listCollaborator.d.ts.map +1 -1
  576. package/build/plugins/solution/fx-solution/v2/listCollaborator.js +24 -17
  577. package/build/plugins/solution/fx-solution/v2/listCollaborator.js.map +1 -1
  578. package/build/plugins/solution/fx-solution/v2/provision.d.ts.map +1 -1
  579. package/build/plugins/solution/fx-solution/v2/provision.js +20 -15
  580. package/build/plugins/solution/fx-solution/v2/provision.js.map +1 -1
  581. package/build/plugins/solution/fx-solution/v2/provisionLocal.d.ts.map +1 -1
  582. package/build/plugins/solution/fx-solution/v2/provisionLocal.js +10 -3
  583. package/build/plugins/solution/fx-solution/v2/provisionLocal.js.map +1 -1
  584. package/build/plugins/solution/fx-solution/v2/publish.d.ts.map +1 -1
  585. package/build/plugins/solution/fx-solution/v2/publish.js +12 -6
  586. package/build/plugins/solution/fx-solution/v2/publish.js.map +1 -1
  587. package/build/plugins/solution/fx-solution/v2/scaffolding.d.ts.map +1 -1
  588. package/build/plugins/solution/fx-solution/v2/scaffolding.js +21 -21
  589. package/build/plugins/solution/fx-solution/v2/scaffolding.js.map +1 -1
  590. package/build/plugins/solution/fx-solution/v2/utils.d.ts +1 -1
  591. package/build/plugins/solution/fx-solution/v2/utils.d.ts.map +1 -1
  592. package/build/plugins/solution/fx-solution/v2/utils.js +21 -11
  593. package/build/plugins/solution/fx-solution/v2/utils.js.map +1 -1
  594. package/build/plugins/solution/fx-solution/v3/addFeature.d.ts.map +1 -1
  595. package/build/plugins/solution/fx-solution/v3/addFeature.js +8 -15
  596. package/build/plugins/solution/fx-solution/v3/addFeature.js.map +1 -1
  597. package/build/plugins/solution/fx-solution/v3/deploy.d.ts.map +1 -1
  598. package/build/plugins/solution/fx-solution/v3/deploy.js +5 -7
  599. package/build/plugins/solution/fx-solution/v3/deploy.js.map +1 -1
  600. package/build/plugins/solution/fx-solution/v3/provision.d.ts.map +1 -1
  601. package/build/plugins/solution/fx-solution/v3/provision.js +34 -21
  602. package/build/plugins/solution/fx-solution/v3/provision.js.map +1 -1
  603. package/build/plugins/solution/fx-solution/v3/publish.d.ts.map +1 -1
  604. package/build/plugins/solution/fx-solution/v3/publish.js +4 -1
  605. package/build/plugins/solution/fx-solution/v3/publish.js.map +1 -1
  606. package/build/plugins/solution/fx-solution/v3/userTask.d.ts.map +1 -1
  607. package/build/plugins/solution/fx-solution/v3/userTask.js +12 -11
  608. package/build/plugins/solution/fx-solution/v3/userTask.js.map +1 -1
  609. package/build/plugins/solution/spfx-solution/addFeature.d.ts.map +1 -1
  610. package/build/plugins/solution/spfx-solution/addFeature.js +2 -2
  611. package/build/plugins/solution/spfx-solution/addFeature.js.map +1 -1
  612. package/package.json +9 -9
  613. package/resource/package.nls.json +515 -0
  614. package/templates/core/README-auto-generated.md +0 -0
  615. package/templates/plugins/resource/aad/manifest/aad.template.json +116 -0
  616. package/templates/plugins/resource/bot/bicep/botConfiguration.template.bicep +14 -8
  617. package/templates/plugins/resource/bot/bot.csharp.default.zip +0 -0
  618. package/templates/plugins/resource/bot/bot.js.default.zip +0 -0
  619. package/templates/plugins/resource/bot/bot.ts.default.zip +0 -0
  620. package/templates/plugins/resource/cicd/azdo/README.md +48 -0
  621. package/templates/plugins/resource/cicd/azdo/cd.yml +55 -0
  622. package/templates/plugins/resource/cicd/azdo/ci.yml +37 -0
  623. package/templates/plugins/resource/cicd/azdo/provision.yml +54 -0
  624. package/templates/plugins/resource/cicd/azdo/publish.yml +46 -0
  625. package/templates/plugins/resource/cicd/github/README.md +48 -0
  626. package/templates/plugins/resource/cicd/github/cd.yml +71 -0
  627. package/templates/plugins/resource/cicd/github/ci.yml +34 -0
  628. package/templates/plugins/resource/cicd/github/provision.yml +65 -0
  629. package/templates/plugins/resource/cicd/github/publish.yml +47 -0
  630. package/templates/plugins/resource/cicd/jenkins/Jenkinsfile.cd +78 -0
  631. package/templates/plugins/resource/cicd/jenkins/Jenkinsfile.ci +34 -0
  632. package/templates/plugins/resource/cicd/jenkins/Jenkinsfile.provision +79 -0
  633. package/templates/plugins/resource/cicd/jenkins/Jenkinsfile.publish +57 -0
  634. package/templates/plugins/resource/cicd/jenkins/README.md +45 -0
  635. package/templates/plugins/resource/dotnet/blazor-base.csharp.default.zip +0 -0
  636. package/templates/plugins/resource/frontend/tab.csharp.default.zip +0 -0
  637. package/templates/plugins/resource/frontend/tab.js.default.zip +0 -0
  638. package/templates/plugins/resource/frontend/tab.ts.default.zip +0 -0
  639. package/templates/plugins/resource/function/function-base.js.default.zip +0 -0
  640. package/templates/plugins/resource/function/function-base.ts.default.zip +0 -0
  641. package/templates/plugins/resource/function/function-triggers.js.HTTPTrigger.zip +0 -0
  642. package/templates/plugins/resource/function/function-triggers.ts.HTTPTrigger.zip +0 -0
  643. package/build/common/fileUtils.d.ts +0 -2
  644. package/build/common/fileUtils.d.ts.map +0 -1
  645. package/build/common/fileUtils.js +0 -46
  646. package/build/common/fileUtils.js.map +0 -1
  647. package/build/common/projectSettingsValidator.d.ts +0 -3
  648. package/build/common/projectSettingsValidator.d.ts.map +0 -1
  649. package/build/common/projectSettingsValidator.js +0 -54
  650. package/build/common/projectSettingsValidator.js.map +0 -1
  651. package/build/core/tools.d.ts +0 -8
  652. package/build/core/tools.d.ts.map +0 -1
  653. package/build/core/tools.js +0 -72
  654. package/build/core/tools.js.map +0 -1
  655. package/build/core/utils.d.ts +0 -3
  656. package/build/core/utils.d.ts.map +0 -1
  657. package/build/core/utils.js +0 -10
  658. package/build/core/utils.js.map +0 -1
  659. package/build/plugins/resource/aad/utils/common.d.ts +0 -19
  660. package/build/plugins/resource/aad/utils/common.d.ts.map +0 -1
  661. package/build/plugins/resource/aad/utils/common.js +0 -132
  662. package/build/plugins/resource/aad/utils/common.js.map +0 -1
  663. package/build/plugins/resource/frontend/dotnet/error-factory.d.ts +0 -10
  664. package/build/plugins/resource/frontend/dotnet/error-factory.d.ts.map +0 -1
  665. package/build/plugins/resource/frontend/dotnet/error-factory.js +0 -20
  666. package/build/plugins/resource/frontend/dotnet/error-factory.js.map +0 -1
  667. package/build/plugins/resource/identity/config.d.ts +0 -11
  668. package/build/plugins/resource/identity/config.d.ts.map +0 -1
  669. package/build/plugins/resource/identity/config.js +0 -17
  670. package/build/plugins/resource/identity/config.js.map +0 -1
  671. package/build/plugins/resource/identity/errors.d.ts +0 -11
  672. package/build/plugins/resource/identity/errors.d.ts.map +0 -1
  673. package/build/plugins/resource/identity/errors.js +0 -15
  674. package/build/plugins/resource/identity/errors.js.map +0 -1
  675. package/build/plugins/resource/identity/results.d.ts +0 -10
  676. package/build/plugins/resource/identity/results.d.ts.map +0 -1
  677. package/build/plugins/resource/identity/results.js +0 -18
  678. package/build/plugins/resource/identity/results.js.map +0 -1
  679. package/build/plugins/resource/identity/utils/commonUtils.d.ts +0 -2
  680. package/build/plugins/resource/identity/utils/commonUtils.d.ts.map +0 -1
  681. package/build/plugins/resource/identity/utils/commonUtils.js +0 -10
  682. package/build/plugins/resource/identity/utils/commonUtils.js.map +0 -1
  683. package/build/plugins/resource/identity/utils/contextUtils.d.ts +0 -5
  684. package/build/plugins/resource/identity/utils/contextUtils.d.ts.map +0 -1
  685. package/build/plugins/resource/identity/utils/contextUtils.js +0 -11
  686. package/build/plugins/resource/identity/utils/contextUtils.js.map +0 -1
  687. package/build/plugins/resource/identity/utils/messages.d.ts +0 -10
  688. package/build/plugins/resource/identity/utils/messages.d.ts.map +0 -1
  689. package/build/plugins/resource/identity/utils/messages.js +0 -15
  690. package/build/plugins/resource/identity/utils/messages.js.map +0 -1
  691. package/resource/strings.json +0 -103
  692. package/templates/plugins/resource/bot/bot-msgext.csharp.default.zip +0 -0
  693. package/templates/plugins/resource/bot/bot-msgext.js.default.zip +0 -0
  694. package/templates/plugins/resource/bot/bot-msgext.ts.default.zip +0 -0
  695. package/templates/plugins/resource/bot/msgext.js.default.zip +0 -0
  696. package/templates/plugins/resource/bot/msgext.ts.default.zip +0 -0
@@ -1,1386 +1,14 @@
1
1
  "use strict";
2
2
  // Copyright (c) Microsoft Corporation.
3
- // Licensed under the MIT license.
4
3
  Object.defineProperty(exports, "__esModule", { value: true });
5
- exports.getProjectSettingsVersion = exports.undefinedName = exports.createV2Context = exports.newProjectSettings = exports.createBasicFolderStructure = exports.FxCore = exports.setTools = exports.TOOLS = exports.currentStage = exports.Logger = exports.isVSProject = exports.isVsCallingCli = exports.isV3 = void 0;
6
4
  const tslib_1 = require("tslib");
7
- const hooks_1 = require("@feathersjs/hooks");
8
- const teamsfx_api_1 = require("@microsoft/teamsfx-api");
9
- const fs = tslib_1.__importStar(require("fs-extra"));
10
- const jsonschema = tslib_1.__importStar(require("jsonschema"));
11
- const path = tslib_1.__importStar(require("path"));
12
- const typedi_1 = require("typedi");
13
- const uuid = tslib_1.__importStar(require("uuid"));
14
- const __1 = require("..");
15
- const constants_1 = require("../common/constants");
16
- const globalState_1 = require("../common/globalState");
17
- const localSettingsProvider_1 = require("../common/localSettingsProvider");
18
- const telemetry_1 = require("../common/telemetry");
19
- const tools_1 = require("../common/tools");
20
- const utils_1 = require("../plugins/resource/appstudio/utils/utils");
21
- const question_1 = require("../plugins/solution/fx-solution/question");
22
- const constants_2 = require("../plugins/solution/fx-solution/v3/constants");
23
- const callback_1 = require("./callback");
24
- const collaborator_1 = require("./collaborator");
25
- const crypto_1 = require("./crypto");
26
- const downloadSample_1 = require("./downloadSample");
27
- const error_1 = require("./error");
28
- const concurrentLocker_1 = require("./middleware/concurrentLocker");
29
- const contextInjector_1 = require("./middleware/contextInjector");
30
- const envInfoLoader_1 = require("./middleware/envInfoLoader");
31
- const envInfoLoaderV3_1 = require("./middleware/envInfoLoaderV3");
32
- const envInfoWriter_1 = require("./middleware/envInfoWriter");
33
- const envInfoWriterV3_1 = require("./middleware/envInfoWriterV3");
34
- const errorHandler_1 = require("./middleware/errorHandler");
35
- const localSettingsLoader_1 = require("./middleware/localSettingsLoader");
36
- const localSettingsWriter_1 = require("./middleware/localSettingsWriter");
37
- const projectMigrator_1 = require("./middleware/projectMigrator");
38
- const projectSettingsLoader_1 = require("./middleware/projectSettingsLoader");
39
- const projectSettingsWriter_1 = require("./middleware/projectSettingsWriter");
40
- const questionModel_1 = require("./middleware/questionModel");
41
- const solutionLoader_1 = require("./middleware/solutionLoader");
42
- const solutionLoaderV3_1 = require("./middleware/solutionLoaderV3");
43
- const question_2 = require("./question");
44
- const SolutionPluginContainer_1 = require("./SolutionPluginContainer");
45
- const tools_2 = require("./tools");
46
- const utils_2 = require("./utils");
47
5
  // TODO: For package.json,
48
6
  // use require instead of import because of core building/packaging method.
49
7
  // Using import will cause the build folder structure to change.
50
- const corePackage = require("../../package.json");
51
- function featureFlagEnabled(flagName) {
52
- const flag = process.env[flagName];
53
- if (flag !== undefined && flag.toLowerCase() === "true") {
54
- return true;
55
- }
56
- else {
57
- return false;
58
- }
59
- }
60
- function isV3() {
61
- return featureFlagEnabled(constants_1.FeatureFlagName.APIV3);
62
- }
63
- exports.isV3 = isV3;
64
- // On VS calling CLI, interactive questions need to be skipped.
65
- function isVsCallingCli() {
66
- return featureFlagEnabled(constants_1.FeatureFlagName.VSCallingCLI);
67
- }
68
- exports.isVsCallingCli = isVsCallingCli;
69
- function isVSProject(projectSettings) {
70
- return projectSettings.programmingLanguage === "csharp";
71
- }
72
- exports.isVSProject = isVSProject;
73
- function setTools(tools) {
74
- exports.TOOLS = tools;
75
- }
76
- exports.setTools = setTools;
77
- class FxCore {
78
- constructor(tools) {
79
- //V1,V2 questions
80
- this._getQuestionsForCreateProjectV2 = questionModel_1.getQuestionsForCreateProjectV2;
81
- this._getQuestionsForCreateProjectV3 = questionModel_1.getQuestionsForCreateProjectV3;
82
- this._getQuestionsForUserTask = questionModel_1.getQuestionsForUserTaskV2;
83
- this._getQuestions = questionModel_1.getQuestionsV2;
84
- //v3 questions
85
- this._getQuestionsForAddFeature = questionModel_1.getQuestionsForAddFeature;
86
- this._getQuestionsForProvision = questionModel_1.getQuestionsForProvision;
87
- this._getQuestionsForDeploy = questionModel_1.getQuestionsForDeploy;
88
- this._getQuestionsForPublish = questionModel_1.getQuestionsForPublish;
89
- this._getQuestionsForInit = questionModel_1.getQuestionsForInit;
90
- this._getQuestionsForUserTaskV3 = questionModel_1.getQuestionsForUserTaskV3;
91
- this.tools = tools;
92
- exports.TOOLS = tools;
93
- exports.Logger = tools.logProvider;
94
- telemetry_1.TelemetryReporterInstance.telemetryReporter = tools.telemetryReporter;
95
- }
96
- /**
97
- * @todo this's a really primitive implement. Maybe could use Subscription Model to
98
- * refactor later.
99
- */
100
- on(event, callback) {
101
- return callback_1.CallbackRegistry.set(event, callback);
102
- }
103
- async createProject(inputs) {
104
- if (isV3()) {
105
- return this.createProjectV3(inputs);
106
- }
107
- else {
108
- return this.createProjectV2(inputs);
109
- }
110
- }
111
- async createProjectV2(inputs, ctx) {
112
- var _a;
113
- if (!ctx) {
114
- return teamsfx_api_1.err(new error_1.ObjectIsUndefinedError("ctx for createProject"));
115
- }
116
- exports.currentStage = teamsfx_api_1.Stage.create;
117
- inputs.stage = teamsfx_api_1.Stage.create;
118
- let folder = inputs[question_2.QuestionRootFolder.name];
119
- if (inputs.platform === teamsfx_api_1.Platform.VSCode) {
120
- folder = tools_1.getRootDirectory();
121
- try {
122
- await fs.ensureDir(folder);
123
- }
124
- catch (e) {
125
- throw error_1.ProjectFolderInvalidError(folder);
126
- }
127
- }
128
- const scratch = inputs[question_2.CoreQuestionNames.CreateFromScratch];
129
- let projectPath;
130
- let globalStateDescription = "openReadme";
131
- const automaticNpmInstall = "automaticNpmInstall";
132
- if (scratch === question_2.ScratchOptionNo.id) {
133
- // create from sample
134
- const downloadRes = await downloadSample_1.downloadSample(inputs, ctx);
135
- if (downloadRes.isErr()) {
136
- return teamsfx_api_1.err(downloadRes.error);
137
- }
138
- projectPath = downloadRes.value;
139
- globalStateDescription = "openSampleReadme";
140
- }
141
- else {
142
- // create from new
143
- const appName = inputs[question_2.QuestionAppName.name];
144
- if (undefined === appName)
145
- return teamsfx_api_1.err(error_1.InvalidInputError(`App Name is empty`, inputs));
146
- const validateResult = jsonschema.validate(appName, {
147
- pattern: question_2.ProjectNamePattern,
148
- });
149
- if (validateResult.errors && validateResult.errors.length > 0) {
150
- return teamsfx_api_1.err(error_1.InvalidInputError(`${validateResult.errors[0].message}`, inputs));
151
- }
152
- projectPath = path.join(folder, appName);
153
- inputs.projectPath = projectPath;
154
- const folderExist = await fs.pathExists(projectPath);
155
- if (folderExist) {
156
- return teamsfx_api_1.err(error_1.ProjectFolderExistError(projectPath));
157
- }
158
- await fs.ensureDir(projectPath);
159
- await fs.ensureDir(path.join(projectPath, `.${teamsfx_api_1.ConfigFolderName}`));
160
- await fs.ensureDir(path.join(projectPath, path.join("templates", `${teamsfx_api_1.AppPackageFolderName}`)));
161
- const basicFolderRes = await createBasicFolderStructure(inputs);
162
- if (basicFolderRes.isErr()) {
163
- return teamsfx_api_1.err(basicFolderRes.error);
164
- }
165
- const projectSettings = {
166
- appName: appName,
167
- projectId: inputs.projectId ? inputs.projectId : uuid.v4(),
168
- version: getProjectSettingsVersion(),
169
- isFromSample: false,
170
- };
171
- if ((_a = inputs.existingAppConfig) === null || _a === void 0 ? void 0 : _a.isCreatedFromExistingApp) {
172
- // there is no solution settings if created from existing app
173
- // create default env
174
- ctx.projectSettings = projectSettings;
175
- const newEnvConfig = __1.environmentManager.newEnvConfigData(appName, inputs.existingAppConfig);
176
- const writeEnvResult = await __1.environmentManager.writeEnvConfig(projectPath, newEnvConfig, __1.environmentManager.getDefaultEnvName());
177
- if (writeEnvResult.isErr()) {
178
- return teamsfx_api_1.err(writeEnvResult.error);
179
- }
180
- // call App Studio V3 API to create manifest with placeholder
181
- const appStudio = typedi_1.Container.get(constants_2.BuiltInFeaturePluginNames.appStudio);
182
- const contextV2 = createV2Context(projectSettings);
183
- const initRes = await appStudio.init(contextV2, inputs);
184
- if (initRes.isErr())
185
- return teamsfx_api_1.err(initRes.error);
186
- const manifestCaps = [];
187
- inputs.existingAppConfig.newAppTypes.forEach((t) => {
188
- if (t === teamsfx_api_1.ExistingTeamsAppType.Bot)
189
- manifestCaps.push({ name: "Bot", existingApp: true });
190
- else if (t === teamsfx_api_1.ExistingTeamsAppType.StaticTab)
191
- manifestCaps.push({ name: "staticTab", existingApp: true });
192
- else if (t === teamsfx_api_1.ExistingTeamsAppType.ConfigurableTab)
193
- manifestCaps.push({ name: "configurableTab", existingApp: true });
194
- else if (t === teamsfx_api_1.ExistingTeamsAppType.MessageExtension)
195
- manifestCaps.push({ name: "MessageExtension", existingApp: true });
196
- });
197
- const addCapabilitiesRes = await appStudio.addCapabilities(contextV2, inputs, manifestCaps);
198
- if (addCapabilitiesRes.isErr())
199
- return teamsfx_api_1.err(addCapabilitiesRes.error);
200
- if (tools_1.isConfigUnifyEnabled()) {
201
- const createLocalEnvResult = await this.createEnvWithName(__1.environmentManager.getLocalEnvName(), projectSettings, inputs);
202
- if (createLocalEnvResult.isErr()) {
203
- return teamsfx_api_1.err(createLocalEnvResult.error);
204
- }
205
- }
206
- }
207
- else {
208
- projectSettings.solutionSettings = {
209
- name: "",
210
- version: "1.0.0",
211
- };
212
- projectSettings.programmingLanguage = inputs[question_2.CoreQuestionNames.ProgrammingLanguage];
213
- ctx.projectSettings = projectSettings;
214
- const createEnvResult = await this.createEnvWithName(__1.environmentManager.getDefaultEnvName(), projectSettings, inputs);
215
- if (createEnvResult.isErr()) {
216
- return teamsfx_api_1.err(createEnvResult.error);
217
- }
218
- if (tools_1.isConfigUnifyEnabled()) {
219
- const createLocalEnvResult = await this.createEnvWithName(__1.environmentManager.getLocalEnvName(), projectSettings, inputs);
220
- if (createLocalEnvResult.isErr()) {
221
- return teamsfx_api_1.err(createLocalEnvResult.error);
222
- }
223
- }
224
- const solution = await SolutionPluginContainer_1.getSolutionPluginV2ByName(inputs[question_2.CoreQuestionNames.Solution]);
225
- if (!solution) {
226
- return teamsfx_api_1.err(new error_1.LoadSolutionError());
227
- }
228
- ctx.solutionV2 = solution;
229
- projectSettings.solutionSettings.name = solution.name;
230
- const contextV2 = createV2Context(projectSettings);
231
- ctx.contextV2 = contextV2;
232
- const scaffoldSourceCodeRes = await solution.scaffoldSourceCode(contextV2, inputs);
233
- if (scaffoldSourceCodeRes.isErr()) {
234
- return teamsfx_api_1.err(scaffoldSourceCodeRes.error);
235
- }
236
- const generateResourceTemplateRes = await solution.generateResourceTemplate(contextV2, inputs);
237
- if (generateResourceTemplateRes.isErr()) {
238
- return teamsfx_api_1.err(generateResourceTemplateRes.error);
239
- }
240
- // ctx.provisionInputConfig = generateResourceTemplateRes.value;
241
- if (solution.createEnv) {
242
- inputs.copy = false;
243
- const createEnvRes = await solution.createEnv(contextV2, inputs);
244
- if (createEnvRes.isErr()) {
245
- return teamsfx_api_1.err(createEnvRes.error);
246
- }
247
- }
248
- }
249
- }
250
- if (inputs.platform === teamsfx_api_1.Platform.VSCode) {
251
- await globalState_1.globalStateUpdate(globalStateDescription, true);
252
- await globalState_1.globalStateUpdate(automaticNpmInstall, true);
253
- }
254
- return teamsfx_api_1.ok(projectPath);
255
- }
256
- async createProjectV3(inputs, ctx) {
257
- var _a;
258
- if (!ctx) {
259
- return teamsfx_api_1.err(new error_1.ObjectIsUndefinedError("ctx for createProject"));
260
- }
261
- exports.currentStage = teamsfx_api_1.Stage.create;
262
- inputs.stage = teamsfx_api_1.Stage.create;
263
- let folder = inputs[question_2.QuestionRootFolder.name];
264
- if (inputs.platform === teamsfx_api_1.Platform.VSCode || inputs.platform === teamsfx_api_1.Platform.VS) {
265
- folder = tools_1.getRootDirectory();
266
- try {
267
- await fs.ensureDir(folder);
268
- }
269
- catch (e) {
270
- throw error_1.ProjectFolderInvalidError(folder);
271
- }
272
- }
273
- const scratch = inputs[question_2.CoreQuestionNames.CreateFromScratch];
274
- let projectPath;
275
- let globalStateDescription = "openReadme";
276
- const automaticNpmInstall = "automaticNpmInstall";
277
- if (scratch === question_2.ScratchOptionNo.id) {
278
- // create from sample
279
- const downloadRes = await downloadSample_1.downloadSample(inputs, ctx);
280
- if (downloadRes.isErr()) {
281
- return teamsfx_api_1.err(downloadRes.error);
282
- }
283
- projectPath = downloadRes.value;
284
- globalStateDescription = "openSampleReadme";
285
- }
286
- else {
287
- // create from new
288
- const appName = inputs[question_2.QuestionAppName.name];
289
- if (undefined === appName)
290
- return teamsfx_api_1.err(error_1.InvalidInputError(`App Name is empty`, inputs));
291
- const validateResult = jsonschema.validate(appName, {
292
- pattern: question_2.ProjectNamePattern,
293
- });
294
- if (validateResult.errors && validateResult.errors.length > 0) {
295
- return teamsfx_api_1.err(error_1.InvalidInputError(`${validateResult.errors[0].message}`, inputs));
296
- }
297
- projectPath = path.join(folder, appName);
298
- inputs.projectPath = projectPath;
299
- const folderExist = await fs.pathExists(projectPath);
300
- if (folderExist) {
301
- return teamsfx_api_1.err(error_1.ProjectFolderExistError(projectPath));
302
- }
303
- await fs.ensureDir(projectPath);
304
- await fs.ensureDir(path.join(projectPath, `.${teamsfx_api_1.ConfigFolderName}`));
305
- const capabilities = inputs[question_2.CoreQuestionNames.Capabilities];
306
- // init
307
- const initInputs = Object.assign(Object.assign({}, inputs), { projectPath: projectPath });
308
- const initRes = await this._init(initInputs, ctx);
309
- if (initRes.isErr()) {
310
- return teamsfx_api_1.err(initRes.error);
311
- }
312
- // persist projectSettings.json
313
- ctx.projectSettings.programmingLanguage = inputs[question_2.CoreQuestionNames.ProgrammingLanguage];
314
- ctx.projectSettings.isFromSample = false;
315
- const projectSettingsPath = projectSettingsLoader_1.getProjectSettingsPath(projectPath);
316
- await fs.writeFile(projectSettingsPath, JSON.stringify(ctx.projectSettings, null, 4));
317
- if (!((_a = inputs.existingAppConfig) === null || _a === void 0 ? void 0 : _a.isCreatedFromExistingApp)) {
318
- // addFeature
319
- const features = [];
320
- if (!capabilities.includes(question_2.TabSPFxItem.id)) {
321
- features.push(constants_2.BuiltInFeaturePluginNames.aad);
322
- }
323
- if (inputs.platform === teamsfx_api_1.Platform.VS) {
324
- features.push(constants_2.BuiltInFeaturePluginNames.dotnet);
325
- }
326
- else {
327
- if (capabilities.includes(question_2.TabOptionItem.id)) {
328
- features.push(constants_2.BuiltInFeaturePluginNames.frontend);
329
- }
330
- else if (capabilities.includes(question_2.TabSPFxItem.id)) {
331
- features.push(constants_2.BuiltInFeaturePluginNames.spfx);
332
- }
333
- if (capabilities.includes(question_2.BotOptionItem.id) ||
334
- capabilities.includes(question_1.MessageExtensionItem.id)) {
335
- features.push(constants_2.BuiltInFeaturePluginNames.bot);
336
- }
337
- }
338
- const addFeatureInputs = Object.assign(Object.assign({}, inputs), { projectPath: projectPath, features: features });
339
- const addFeatureRes = await this.addFeature(addFeatureInputs);
340
- if (addFeatureRes.isErr()) {
341
- return teamsfx_api_1.err(addFeatureRes.error);
342
- }
343
- }
344
- }
345
- if (inputs.platform === teamsfx_api_1.Platform.VSCode) {
346
- await globalState_1.globalStateUpdate(globalStateDescription, true);
347
- await globalState_1.globalStateUpdate(automaticNpmInstall, true);
348
- }
349
- return teamsfx_api_1.ok(projectPath);
350
- }
351
- /**
352
- * switch to different versions of provisionResources
353
- */
354
- async provisionResources(inputs) {
355
- if (isV3()) {
356
- return this.provisionResourcesV3(inputs);
357
- }
358
- else {
359
- return this.provisionResourcesV2(inputs);
360
- }
361
- }
362
- async provisionResourcesV2(inputs, ctx) {
363
- exports.currentStage = teamsfx_api_1.Stage.provision;
364
- inputs.stage = teamsfx_api_1.Stage.provision;
365
- if (!ctx || !ctx.solutionV2 || !ctx.contextV2 || !ctx.envInfoV2) {
366
- return teamsfx_api_1.err(new error_1.ObjectIsUndefinedError("Provision input stuff"));
367
- }
368
- const envInfo = ctx.envInfoV2;
369
- const result = await ctx.solutionV2.provisionResources(ctx.contextV2, inputs, envInfo, this.tools.tokenProvider);
370
- return result;
371
- }
372
- async provisionResourcesV3(inputs, ctx) {
373
- exports.currentStage = teamsfx_api_1.Stage.provision;
374
- inputs.stage = teamsfx_api_1.Stage.provision;
375
- if (ctx &&
376
- ctx.solutionV3 &&
377
- ctx.contextV2 &&
378
- ctx.envInfoV3 &&
379
- ctx.solutionV3.provisionResources) {
380
- const res = await ctx.solutionV3.provisionResources(ctx.contextV2, inputs, ctx.envInfoV3, exports.TOOLS.tokenProvider);
381
- return res;
382
- }
383
- return teamsfx_api_1.ok(teamsfx_api_1.Void);
384
- }
385
- /**
386
- * Only used to provision Teams app with user provided app package
387
- * @param inputs
388
- * @returns teamsAppId on provision success
389
- */
390
- async provisionTeamsAppForCLI(inputs) {
391
- if (!inputs.appPackagePath) {
392
- return teamsfx_api_1.err(error_1.InvalidInputError("appPackagePath is not defined", inputs));
393
- }
394
- const projectSettings = {
395
- appName: "fake",
396
- projectId: uuid.v4(),
397
- };
398
- const context = {
399
- userInteraction: exports.TOOLS.ui,
400
- logProvider: exports.TOOLS.logProvider,
401
- telemetryReporter: exports.TOOLS.telemetryReporter,
402
- cryptoProvider: new crypto_1.LocalCrypto(projectSettings.projectId),
403
- permissionRequestProvider: exports.TOOLS.permissionRequest,
404
- projectSetting: projectSettings,
405
- };
406
- const appStudioV3 = typedi_1.Container.get(constants_2.BuiltInFeaturePluginNames.appStudio);
407
- return appStudioV3.registerTeamsApp(context, inputs, tools_2.newEnvInfoV3(), exports.TOOLS.tokenProvider);
408
- }
409
- async deployArtifacts(inputs) {
410
- if (isV3())
411
- return this.deployArtifactsV3(inputs);
412
- else
413
- return this.deployArtifactsV2(inputs);
414
- }
415
- async deployArtifactsV2(inputs, ctx) {
416
- exports.currentStage = teamsfx_api_1.Stage.deploy;
417
- inputs.stage = teamsfx_api_1.Stage.deploy;
418
- if (!(ctx === null || ctx === void 0 ? void 0 : ctx.projectSettings)) {
419
- return teamsfx_api_1.err(new error_1.ObjectIsUndefinedError("deploy input stuff"));
420
- }
421
- if (utils_2.isPureExistingApp(ctx.projectSettings)) {
422
- // existing app scenario, deploy has no effect
423
- return teamsfx_api_1.err(new error_1.OperationNotSupportedForExistingAppError("deploy"));
424
- }
425
- if (!ctx.solutionV2 || !ctx.contextV2 || !ctx.envInfoV2) {
426
- const name = undefinedName([ctx, ctx === null || ctx === void 0 ? void 0 : ctx.solutionV2, ctx === null || ctx === void 0 ? void 0 : ctx.contextV2, ctx === null || ctx === void 0 ? void 0 : ctx.envInfoV2], ["ctx", "ctx.solutionV2", "ctx.contextV2", "ctx.envInfoV2"]);
427
- return teamsfx_api_1.err(new error_1.ObjectIsUndefinedError(`Deploy input stuff: ${name}`));
428
- }
429
- if (ctx.solutionV2.deploy)
430
- return await ctx.solutionV2.deploy(ctx.contextV2, inputs, ctx.envInfoV2, this.tools.tokenProvider);
431
- else
432
- return teamsfx_api_1.ok(teamsfx_api_1.Void);
433
- }
434
- async deployArtifactsV3(inputs, ctx) {
435
- exports.currentStage = teamsfx_api_1.Stage.deploy;
436
- inputs.stage = teamsfx_api_1.Stage.deploy;
437
- if (ctx && ctx.solutionV3 && ctx.contextV2 && ctx.envInfoV3 && ctx.solutionV3.deploy) {
438
- const res = await ctx.solutionV3.deploy(ctx.contextV2, inputs, ctx.envInfoV3, exports.TOOLS.tokenProvider);
439
- return res;
440
- }
441
- return teamsfx_api_1.ok(teamsfx_api_1.Void);
442
- }
443
- async localDebug(inputs) {
444
- inputs.env = __1.environmentManager.getLocalEnvName();
445
- if (isV3())
446
- return this.provisionResourcesV3(inputs);
447
- else
448
- return this.localDebugV2(inputs);
449
- }
450
- async localDebugV2(inputs, ctx) {
451
- exports.currentStage = teamsfx_api_1.Stage.debug;
452
- inputs.stage = teamsfx_api_1.Stage.debug;
453
- if (!(ctx === null || ctx === void 0 ? void 0 : ctx.projectSettings)) {
454
- return teamsfx_api_1.err(new error_1.ObjectIsUndefinedError("local debug input stuff"));
455
- }
456
- if (utils_2.isPureExistingApp(ctx.projectSettings)) {
457
- // existing app scenario, local debug has no effect
458
- return teamsfx_api_1.err(new error_1.OperationNotSupportedForExistingAppError("localDebug"));
459
- }
460
- if (!ctx.solutionV2 || !ctx.contextV2) {
461
- const name = undefinedName([ctx, ctx === null || ctx === void 0 ? void 0 : ctx.solutionV2, ctx === null || ctx === void 0 ? void 0 : ctx.contextV2], ["ctx", "ctx.solutionV2", "ctx.contextV2"]);
462
- return teamsfx_api_1.err(new error_1.ObjectIsUndefinedError(`localDebug input stuff (${name})`));
463
- }
464
- if (!ctx.localSettings)
465
- ctx.localSettings = {};
466
- if (ctx.solutionV2.provisionLocalResource) {
467
- const res = await ctx.solutionV2.provisionLocalResource(ctx.contextV2, inputs, ctx.localSettings, this.tools.tokenProvider, ctx.envInfoV2);
468
- if (res.kind === "success") {
469
- ctx.localSettings = res.output;
470
- return teamsfx_api_1.ok(teamsfx_api_1.Void);
471
- }
472
- else if (res.kind === "partialSuccess") {
473
- ctx.localSettings = res.output;
474
- return teamsfx_api_1.err(res.error);
475
- }
476
- else {
477
- return teamsfx_api_1.err(res.error);
478
- }
479
- }
480
- else {
481
- return teamsfx_api_1.ok(teamsfx_api_1.Void);
482
- }
483
- }
484
- _setEnvInfoV2(ctx) {
485
- if (ctx && ctx.solutionContext) {
486
- //workaround, compatible to api v2
487
- ctx.envInfoV2 = {
488
- envName: ctx.solutionContext.envInfo.envName,
489
- config: ctx.solutionContext.envInfo.config,
490
- state: {},
491
- };
492
- ctx.envInfoV2.state = tools_1.mapToJson(ctx.solutionContext.envInfo.state);
493
- }
494
- }
495
- async publishApplication(inputs) {
496
- if (isV3())
497
- return this.publishApplicationV3(inputs);
498
- else
499
- return this.publishApplicationV2(inputs);
500
- }
501
- async publishApplicationV2(inputs, ctx) {
502
- exports.currentStage = teamsfx_api_1.Stage.publish;
503
- inputs.stage = teamsfx_api_1.Stage.publish;
504
- if (!ctx || !ctx.solutionV2 || !ctx.contextV2 || !ctx.envInfoV2) {
505
- const name = undefinedName([ctx, ctx === null || ctx === void 0 ? void 0 : ctx.solutionV2, ctx === null || ctx === void 0 ? void 0 : ctx.contextV2, ctx === null || ctx === void 0 ? void 0 : ctx.envInfoV2], ["ctx", "ctx.solutionV2", "ctx.contextV2", "ctx.envInfoV2"]);
506
- return teamsfx_api_1.err(new error_1.ObjectIsUndefinedError(`publish input stuff: ${name}`));
507
- }
508
- return await ctx.solutionV2.publishApplication(ctx.contextV2, inputs, ctx.envInfoV2, this.tools.tokenProvider.appStudioToken);
509
- }
510
- async publishApplicationV3(inputs, ctx) {
511
- exports.currentStage = teamsfx_api_1.Stage.publish;
512
- inputs.stage = teamsfx_api_1.Stage.publish;
513
- if (ctx &&
514
- ctx.solutionV3 &&
515
- ctx.contextV2 &&
516
- ctx.envInfoV3 &&
517
- ctx.solutionV3.publishApplication) {
518
- const res = await ctx.solutionV3.publishApplication(ctx.contextV2, inputs, ctx.envInfoV3, exports.TOOLS.tokenProvider.appStudioToken);
519
- return res;
520
- }
521
- return teamsfx_api_1.ok(teamsfx_api_1.Void);
522
- }
523
- async executeUserTask(func, inputs) {
524
- if (isV3())
525
- return this.executeUserTaskV3(func, inputs);
526
- else
527
- return this.executeUserTaskV2(func, inputs);
528
- }
529
- async executeUserTaskV2(func, inputs, ctx) {
530
- exports.currentStage = teamsfx_api_1.Stage.userTask;
531
- inputs.stage = teamsfx_api_1.Stage.userTask;
532
- const namespace = func.namespace;
533
- const array = namespace ? namespace.split("/") : [];
534
- if ("" !== namespace && array.length > 0) {
535
- if (!ctx || !ctx.solutionV2 || !ctx.envInfoV2) {
536
- const name = undefinedName([ctx, ctx === null || ctx === void 0 ? void 0 : ctx.solutionV2, ctx === null || ctx === void 0 ? void 0 : ctx.envInfoV2], ["ctx", "ctx.solutionV2", "ctx.envInfoV2"]);
537
- return teamsfx_api_1.err(new error_1.ObjectIsUndefinedError(`executeUserTask input stuff: ${name}`));
538
- }
539
- if (!ctx.contextV2)
540
- ctx.contextV2 = createV2Context(newProjectSettings());
541
- if (ctx.solutionV2.executeUserTask) {
542
- if (!ctx.localSettings)
543
- ctx.localSettings = {};
544
- const res = await ctx.solutionV2.executeUserTask(ctx.contextV2, inputs, func, ctx.localSettings, ctx.envInfoV2, this.tools.tokenProvider);
545
- return res;
546
- }
547
- else
548
- return teamsfx_api_1.err(error_1.FunctionRouterError(func));
549
- }
550
- return teamsfx_api_1.err(error_1.FunctionRouterError(func));
551
- }
552
- async executeUserTaskV3(func, inputs, ctx) {
553
- exports.currentStage = teamsfx_api_1.Stage.userTask;
554
- inputs.stage = teamsfx_api_1.Stage.userTask;
555
- const namespace = func.namespace;
556
- const array = namespace ? namespace.split("/") : [];
557
- if ("" !== namespace && array.length > 0) {
558
- if (!ctx || !ctx.solutionV3 || !ctx.envInfoV3) {
559
- const name = undefinedName([ctx, ctx === null || ctx === void 0 ? void 0 : ctx.solutionV3, ctx === null || ctx === void 0 ? void 0 : ctx.envInfoV3], ["ctx", "ctx.solutionV3", "ctx.envInfoV3"]);
560
- return teamsfx_api_1.err(new error_1.ObjectIsUndefinedError(`executeUserTask input stuff: ${name}`));
561
- }
562
- if (!ctx.contextV2)
563
- ctx.contextV2 = createV2Context(newProjectSettings());
564
- if (ctx.solutionV3.executeUserTask) {
565
- const res = await ctx.solutionV3.executeUserTask(ctx.contextV2, inputs, func, ctx.envInfoV3, this.tools.tokenProvider);
566
- return res;
567
- }
568
- else
569
- return teamsfx_api_1.err(error_1.FunctionRouterError(func));
570
- }
571
- return teamsfx_api_1.err(error_1.FunctionRouterError(func));
572
- }
573
- async getQuestions(stage, inputs, ctx) {
574
- if (!ctx)
575
- return teamsfx_api_1.err(new error_1.ObjectIsUndefinedError("getQuestions input stuff"));
576
- inputs.stage = teamsfx_api_1.Stage.getQuestions;
577
- exports.currentStage = teamsfx_api_1.Stage.getQuestions;
578
- if (stage === teamsfx_api_1.Stage.create) {
579
- delete inputs.projectPath;
580
- return await this._getQuestionsForCreateProjectV2(inputs);
581
- }
582
- else {
583
- const contextV2 = ctx.contextV2 ? ctx.contextV2 : createV2Context(newProjectSettings());
584
- const solutionV2 = ctx.solutionV2 ? ctx.solutionV2 : await SolutionPluginContainer_1.getAllSolutionPluginsV2()[0];
585
- const envInfoV2 = ctx.envInfoV2
586
- ? ctx.envInfoV2
587
- : { envName: __1.environmentManager.getDefaultEnvName(), config: {}, state: {} };
588
- inputs.stage = stage;
589
- return await this._getQuestions(contextV2, solutionV2, stage, inputs, envInfoV2);
590
- }
591
- }
592
- async getQuestionsForUserTask(func, inputs, ctx) {
593
- if (!ctx)
594
- return teamsfx_api_1.err(new error_1.ObjectIsUndefinedError("getQuestionsForUserTask input stuff"));
595
- inputs.stage = teamsfx_api_1.Stage.getQuestions;
596
- exports.currentStage = teamsfx_api_1.Stage.getQuestions;
597
- const contextV2 = ctx.contextV2 ? ctx.contextV2 : createV2Context(newProjectSettings());
598
- const solutionV2 = ctx.solutionV2 ? ctx.solutionV2 : await SolutionPluginContainer_1.getAllSolutionPluginsV2()[0];
599
- const envInfoV2 = ctx.envInfoV2
600
- ? ctx.envInfoV2
601
- : { envName: __1.environmentManager.getDefaultEnvName(), config: {}, state: {} };
602
- return await this._getQuestionsForUserTask(contextV2, solutionV2, func, inputs, envInfoV2);
603
- }
604
- async getProjectConfig(inputs, ctx) {
605
- var _a, _b;
606
- if (!ctx)
607
- return teamsfx_api_1.err(new error_1.ObjectIsUndefinedError("getProjectConfig input stuff"));
608
- inputs.stage = teamsfx_api_1.Stage.getProjectConfig;
609
- exports.currentStage = teamsfx_api_1.Stage.getProjectConfig;
610
- return teamsfx_api_1.ok({
611
- settings: ctx.projectSettings,
612
- config: (_a = ctx.solutionContext) === null || _a === void 0 ? void 0 : _a.envInfo.state,
613
- localSettings: (_b = ctx.solutionContext) === null || _b === void 0 ? void 0 : _b.localSettings,
614
- });
615
- }
616
- async getProjectConfigV3(inputs, ctx) {
617
- if (!ctx || !ctx.projectSettings)
618
- return teamsfx_api_1.err(new error_1.ObjectIsUndefinedError("getProjectConfigV3 input stuff"));
619
- if (!inputs.projectPath)
620
- return teamsfx_api_1.ok(undefined);
621
- inputs.stage = teamsfx_api_1.Stage.getProjectConfig;
622
- exports.currentStage = teamsfx_api_1.Stage.getProjectConfig;
623
- const config = {
624
- projectSettings: ctx.projectSettings,
625
- envInfos: {},
626
- };
627
- const envNamesRes = await __1.environmentManager.listAllEnvConfigs(inputs.projectPath);
628
- if (envNamesRes.isErr()) {
629
- return teamsfx_api_1.err(envNamesRes.error);
630
- }
631
- for (const env of envNamesRes.value) {
632
- const result = await envInfoLoaderV3_1.loadEnvInfoV3(inputs, ctx.projectSettings, env, false);
633
- if (result.isErr()) {
634
- return teamsfx_api_1.err(result.error);
635
- }
636
- config.envInfos[env] = result.value;
637
- }
638
- return teamsfx_api_1.ok(config);
639
- }
640
- async grantPermission(inputs) {
641
- if (isV3())
642
- return this.grantPermissionV3(inputs);
643
- else
644
- return this.grantPermissionV2(inputs);
645
- }
646
- async grantPermissionV2(inputs, ctx) {
647
- exports.currentStage = teamsfx_api_1.Stage.grantPermission;
648
- inputs.stage = teamsfx_api_1.Stage.grantPermission;
649
- const projectPath = inputs.projectPath;
650
- if (!projectPath) {
651
- return teamsfx_api_1.err(new error_1.ObjectIsUndefinedError("projectPath"));
652
- }
653
- return ctx.solutionV2.grantPermission(ctx.contextV2, Object.assign(Object.assign({}, inputs), { projectPath: projectPath }), ctx.envInfoV2, this.tools.tokenProvider);
654
- }
655
- async grantPermissionV3(inputs, ctx) {
656
- exports.currentStage = teamsfx_api_1.Stage.grantPermission;
657
- inputs.stage = teamsfx_api_1.Stage.grantPermission;
658
- const projectPath = inputs.projectPath;
659
- if (!projectPath) {
660
- return teamsfx_api_1.err(new error_1.ObjectIsUndefinedError("projectPath"));
661
- }
662
- if (ctx && ctx.contextV2 && ctx.envInfoV3) {
663
- const res = await collaborator_1.grantPermission(ctx.contextV2, inputs, ctx.envInfoV3, exports.TOOLS.tokenProvider);
664
- return res;
665
- }
666
- return teamsfx_api_1.err(new error_1.ObjectIsUndefinedError("ctx, contextV2, envInfoV3"));
667
- }
668
- async checkPermission(inputs) {
669
- if (isV3())
670
- return this.checkPermissionV3(inputs);
671
- else
672
- return this.checkPermissionV2(inputs);
673
- }
674
- async checkPermissionV2(inputs, ctx) {
675
- exports.currentStage = teamsfx_api_1.Stage.checkPermission;
676
- inputs.stage = teamsfx_api_1.Stage.checkPermission;
677
- const projectPath = inputs.projectPath;
678
- if (!projectPath) {
679
- return teamsfx_api_1.err(new error_1.ObjectIsUndefinedError("projectPath"));
680
- }
681
- return ctx.solutionV2.checkPermission(ctx.contextV2, Object.assign(Object.assign({}, inputs), { projectPath: projectPath }), ctx.envInfoV2, this.tools.tokenProvider);
682
- }
683
- async checkPermissionV3(inputs, ctx) {
684
- exports.currentStage = teamsfx_api_1.Stage.checkPermission;
685
- inputs.stage = teamsfx_api_1.Stage.checkPermission;
686
- const projectPath = inputs.projectPath;
687
- if (!projectPath) {
688
- return teamsfx_api_1.err(new error_1.ObjectIsUndefinedError("projectPath"));
689
- }
690
- if (ctx && ctx.contextV2 && ctx.envInfoV3) {
691
- const res = await collaborator_1.checkPermission(ctx.contextV2, inputs, ctx.envInfoV3, exports.TOOLS.tokenProvider);
692
- return res;
693
- }
694
- return teamsfx_api_1.err(new error_1.ObjectIsUndefinedError("ctx, contextV2, envInfoV3"));
695
- }
696
- async listCollaborator(inputs) {
697
- if (isV3())
698
- return this.listCollaboratorV3(inputs);
699
- else
700
- return this.listCollaboratorV2(inputs);
701
- }
702
- async listCollaboratorV2(inputs, ctx) {
703
- exports.currentStage = teamsfx_api_1.Stage.listCollaborator;
704
- inputs.stage = teamsfx_api_1.Stage.listCollaborator;
705
- const projectPath = inputs.projectPath;
706
- if (!projectPath) {
707
- return teamsfx_api_1.err(new error_1.ObjectIsUndefinedError("projectPath"));
708
- }
709
- return ctx.solutionV2.listCollaborator(ctx.contextV2, Object.assign(Object.assign({}, inputs), { projectPath: projectPath }), ctx.envInfoV2, this.tools.tokenProvider);
710
- }
711
- async listCollaboratorV3(inputs, ctx) {
712
- exports.currentStage = teamsfx_api_1.Stage.listCollaborator;
713
- inputs.stage = teamsfx_api_1.Stage.listCollaborator;
714
- const projectPath = inputs.projectPath;
715
- if (!projectPath) {
716
- return teamsfx_api_1.err(new error_1.ObjectIsUndefinedError("projectPath"));
717
- }
718
- if (ctx && ctx.contextV2 && ctx.envInfoV3) {
719
- const res = await collaborator_1.listCollaborator(ctx.contextV2, inputs, ctx.envInfoV3, exports.TOOLS.tokenProvider);
720
- return res;
721
- }
722
- return teamsfx_api_1.err(new error_1.ObjectIsUndefinedError("ctx, contextV2, envInfoV3"));
723
- }
724
- async getSelectedEnv(inputs, ctx) {
725
- var _a;
726
- return teamsfx_api_1.ok((_a = ctx === null || ctx === void 0 ? void 0 : ctx.envInfoV2) === null || _a === void 0 ? void 0 : _a.envName);
727
- }
728
- async encrypt(plaintext, inputs, ctx) {
729
- if (!ctx)
730
- return teamsfx_api_1.err(new error_1.ObjectIsUndefinedError("ctx"));
731
- if (!ctx.contextV2)
732
- return teamsfx_api_1.err(new error_1.ObjectIsUndefinedError("ctx.contextV2"));
733
- return ctx.contextV2.cryptoProvider.encrypt(plaintext);
734
- }
735
- async decrypt(ciphertext, inputs, ctx) {
736
- if (!ctx)
737
- return teamsfx_api_1.err(new error_1.ObjectIsUndefinedError("ctx"));
738
- if (!ctx.contextV2)
739
- return teamsfx_api_1.err(new error_1.ObjectIsUndefinedError("ctx.contextV2"));
740
- return ctx.contextV2.cryptoProvider.decrypt(ciphertext);
741
- }
742
- async buildArtifacts(inputs) {
743
- throw new error_1.TaskNotSupportError(teamsfx_api_1.Stage.build);
744
- }
745
- async createEnv(inputs, ctx) {
746
- if (!ctx)
747
- return teamsfx_api_1.err(new error_1.ObjectIsUndefinedError("createEnv input stuff"));
748
- const projectSettings = ctx.projectSettings;
749
- if (!projectSettings) {
750
- return teamsfx_api_1.ok(teamsfx_api_1.Void);
751
- }
752
- const core = ctx.self;
753
- const createEnvCopyInput = await envInfoLoader_1.askNewEnvironment(ctx, inputs);
754
- if (!createEnvCopyInput ||
755
- !createEnvCopyInput.targetEnvName ||
756
- !createEnvCopyInput.sourceEnvName) {
757
- return teamsfx_api_1.err(teamsfx_api_1.UserCancelError);
758
- }
759
- const createEnvResult = await this.createEnvCopy(createEnvCopyInput.targetEnvName, createEnvCopyInput.sourceEnvName, inputs, core);
760
- if (createEnvResult.isErr()) {
761
- return createEnvResult;
762
- }
763
- inputs.sourceEnvName = createEnvCopyInput.sourceEnvName;
764
- inputs.targetEnvName = createEnvCopyInput.targetEnvName;
765
- if (!ctx.solutionV2 || !ctx.contextV2)
766
- return teamsfx_api_1.err(new error_1.ObjectIsUndefinedError("ctx.solutionV2, ctx.contextV2"));
767
- if (ctx.solutionV2.createEnv) {
768
- inputs.copy = true;
769
- return await ctx.solutionV2.createEnv(ctx.contextV2, inputs);
770
- }
771
- return teamsfx_api_1.ok(teamsfx_api_1.Void);
772
- }
773
- async createEnvWithName(targetEnvName, projectSettings, inputs) {
774
- let appName = projectSettings.appName;
775
- if (targetEnvName === __1.environmentManager.getLocalEnvName()) {
776
- appName = utils_1.getLocalAppName(appName);
777
- }
778
- const newEnvConfig = __1.environmentManager.newEnvConfigData(appName);
779
- const writeEnvResult = await __1.environmentManager.writeEnvConfig(inputs.projectPath, newEnvConfig, targetEnvName);
780
- if (writeEnvResult.isErr()) {
781
- return teamsfx_api_1.err(writeEnvResult.error);
782
- }
783
- this.tools.logProvider.debug(`[core] persist ${targetEnvName} env state to path ${writeEnvResult.value}: ${JSON.stringify(newEnvConfig)}`);
784
- return teamsfx_api_1.ok(teamsfx_api_1.Void);
785
- }
786
- async createEnvCopy(targetEnvName, sourceEnvName, inputs, core) {
787
- // copy env config file
788
- const targetEnvConfigFilePath = __1.environmentManager.getEnvConfigPath(targetEnvName, inputs.projectPath);
789
- const sourceEnvConfigFilePath = __1.environmentManager.getEnvConfigPath(sourceEnvName, inputs.projectPath);
790
- try {
791
- await fs.copy(sourceEnvConfigFilePath, targetEnvConfigFilePath);
792
- }
793
- catch (e) {
794
- return teamsfx_api_1.err(error_1.CopyFileError(e));
795
- }
796
- exports.TOOLS.logProvider.debug(`[core] copy env config file for ${targetEnvName} environment to path ${targetEnvConfigFilePath}`);
797
- return teamsfx_api_1.ok(teamsfx_api_1.Void);
798
- }
799
- // deprecated
800
- async activateEnv(inputs, ctx) {
801
- const env = inputs.env;
802
- if (!env) {
803
- return teamsfx_api_1.err(new error_1.ObjectIsUndefinedError("env"));
804
- }
805
- if (!ctx.projectSettings) {
806
- return teamsfx_api_1.ok(teamsfx_api_1.Void);
807
- }
808
- const envConfigs = await __1.environmentManager.listRemoteEnvConfigs(inputs.projectPath);
809
- if (envConfigs.isErr()) {
810
- return envConfigs;
811
- }
812
- if (envConfigs.isErr() || envConfigs.value.indexOf(env) < 0) {
813
- return teamsfx_api_1.err(error_1.NonExistEnvNameError(env));
814
- }
815
- const core = ctx.self;
816
- const solutionContext = await envInfoLoader_1.loadSolutionContext(inputs, ctx.projectSettings, env);
817
- if (!solutionContext.isErr()) {
818
- ctx.provisionInputConfig = solutionContext.value.envInfo.config;
819
- ctx.provisionOutputs = solutionContext.value.envInfo.state;
820
- ctx.envName = solutionContext.value.envInfo.envName;
821
- }
822
- this.tools.ui.showMessage("info", `[${env}] is activated.`, false);
823
- return teamsfx_api_1.ok(teamsfx_api_1.Void);
824
- }
825
- async _init(inputs, ctx) {
826
- var _a;
827
- if (!ctx) {
828
- return teamsfx_api_1.err(new error_1.ObjectIsUndefinedError("ctx for createProject"));
829
- }
830
- // validate app name
831
- const appName = inputs[question_2.QuestionAppName.name];
832
- const validateResult = jsonschema.validate(appName, {
833
- pattern: question_2.ProjectNamePattern,
834
- });
835
- if (validateResult.errors && validateResult.errors.length > 0) {
836
- return teamsfx_api_1.err(error_1.InvalidInputError("invalid app-name", inputs));
837
- }
838
- // create ProjectSettings
839
- const projectSettings = newProjectSettings();
840
- projectSettings.appName = appName;
841
- ctx.projectSettings = projectSettings;
842
- // create folder structure
843
- await fs.ensureDir(path.join(inputs.projectPath, `.${teamsfx_api_1.ConfigFolderName}`));
844
- await fs.ensureDir(path.join(inputs.projectPath, "templates", `${teamsfx_api_1.AppPackageFolderName}`));
845
- const basicFolderRes = await createBasicFolderStructure(inputs);
846
- if (basicFolderRes.isErr()) {
847
- return teamsfx_api_1.err(basicFolderRes.error);
848
- }
849
- // create contextV2
850
- const context = createV2Context(projectSettings);
851
- ctx.contextV2 = context;
852
- const appStudioV3 = typedi_1.Container.get(constants_2.BuiltInFeaturePluginNames.appStudio);
853
- // init manifest
854
- const manifestInitRes = await appStudioV3.init(context, inputs);
855
- if (manifestInitRes.isErr())
856
- return teamsfx_api_1.err(manifestInitRes.error);
857
- if ((_a = inputs.existingAppConfig) === null || _a === void 0 ? void 0 : _a.isCreatedFromExistingApp) {
858
- const newEnvConfig = __1.environmentManager.newEnvConfigData(appName, inputs.existingAppConfig);
859
- const writeEnvResult = await __1.environmentManager.writeEnvConfig(inputs.projectPath, newEnvConfig, __1.environmentManager.getDefaultEnvName());
860
- if (writeEnvResult.isErr()) {
861
- return teamsfx_api_1.err(writeEnvResult.error);
862
- }
863
- // call App Studio V3 API to create manifest with placeholder
864
- const appStudio = typedi_1.Container.get(constants_2.BuiltInFeaturePluginNames.appStudio);
865
- const contextV2 = createV2Context(projectSettings);
866
- const initRes = await appStudio.init(contextV2, inputs);
867
- if (initRes.isErr())
868
- return teamsfx_api_1.err(initRes.error);
869
- const manifestCaps = [];
870
- inputs.existingAppConfig.newAppTypes.forEach((t) => {
871
- if (t === teamsfx_api_1.ExistingTeamsAppType.Bot)
872
- manifestCaps.push({ name: "Bot", existingApp: true });
873
- else if (t === teamsfx_api_1.ExistingTeamsAppType.StaticTab)
874
- manifestCaps.push({ name: "staticTab", existingApp: true });
875
- else if (t === teamsfx_api_1.ExistingTeamsAppType.ConfigurableTab)
876
- manifestCaps.push({ name: "configurableTab", existingApp: true });
877
- else if (t === teamsfx_api_1.ExistingTeamsAppType.MessageExtension)
878
- manifestCaps.push({ name: "MessageExtension", existingApp: true });
879
- });
880
- const addCapabilitiesRes = await appStudio.addCapabilities(contextV2, inputs, manifestCaps);
881
- if (addCapabilitiesRes.isErr())
882
- return teamsfx_api_1.err(addCapabilitiesRes.error);
883
- }
884
- else {
885
- const createEnvResult = await this.createEnvWithName(__1.environmentManager.getDefaultEnvName(), projectSettings, inputs);
886
- if (createEnvResult.isErr()) {
887
- return teamsfx_api_1.err(createEnvResult.error);
888
- }
889
- }
890
- const createLocalEnvResult = await this.createEnvWithName(__1.environmentManager.getLocalEnvName(), projectSettings, inputs);
891
- if (createLocalEnvResult.isErr()) {
892
- return teamsfx_api_1.err(createLocalEnvResult.error);
893
- }
894
- return teamsfx_api_1.ok(teamsfx_api_1.Void);
895
- }
896
- async init(inputs, ctx) {
897
- return this._init(inputs, ctx);
898
- }
899
- async addFeature(inputs, ctx) {
900
- return this._addFeature(inputs, ctx);
901
- }
902
- async _addFeature(inputs, ctx) {
903
- if (ctx && ctx.solutionV3 && ctx.contextV2 && ctx.solutionV3.addFeature) {
904
- return await ctx.solutionV3.addFeature(ctx.contextV2, inputs);
905
- }
906
- return teamsfx_api_1.ok(teamsfx_api_1.Void);
907
- }
908
- }
909
- tslib_1.__decorate([
910
- hooks_1.hooks([
911
- errorHandler_1.ErrorHandlerMW,
912
- questionModel_1.QuestionModelMW,
913
- contextInjector_1.ContextInjectorMW,
914
- projectSettingsWriter_1.ProjectSettingsWriterMW,
915
- envInfoWriter_1.EnvInfoWriterMW(true),
916
- ]),
917
- tslib_1.__metadata("design:type", Function),
918
- tslib_1.__metadata("design:paramtypes", [Object, Object]),
919
- tslib_1.__metadata("design:returntype", Promise)
920
- ], FxCore.prototype, "createProjectV2", null);
921
- tslib_1.__decorate([
922
- hooks_1.hooks([errorHandler_1.ErrorHandlerMW, questionModel_1.QuestionModelMW, contextInjector_1.ContextInjectorMW]),
923
- tslib_1.__metadata("design:type", Function),
924
- tslib_1.__metadata("design:paramtypes", [Object, Object]),
925
- tslib_1.__metadata("design:returntype", Promise)
926
- ], FxCore.prototype, "createProjectV3", null);
927
- tslib_1.__decorate([
928
- hooks_1.hooks([
929
- errorHandler_1.ErrorHandlerMW,
930
- concurrentLocker_1.ConcurrentLockerMW,
931
- projectMigrator_1.ProjectMigratorMW,
932
- projectSettingsLoader_1.ProjectSettingsLoaderMW,
933
- envInfoLoader_1.EnvInfoLoaderMW(false),
934
- solutionLoader_1.SolutionLoaderMW,
935
- questionModel_1.QuestionModelMW,
936
- contextInjector_1.ContextInjectorMW,
937
- projectSettingsWriter_1.ProjectSettingsWriterMW,
938
- envInfoWriter_1.EnvInfoWriterMW(),
939
- ]),
940
- tslib_1.__metadata("design:type", Function),
941
- tslib_1.__metadata("design:paramtypes", [Object, Object]),
942
- tslib_1.__metadata("design:returntype", Promise)
943
- ], FxCore.prototype, "provisionResourcesV2", null);
944
- tslib_1.__decorate([
945
- hooks_1.hooks([
946
- errorHandler_1.ErrorHandlerMW,
947
- concurrentLocker_1.ConcurrentLockerMW,
948
- projectMigrator_1.ProjectMigratorMW,
949
- projectSettingsLoader_1.ProjectSettingsLoaderMW,
950
- envInfoLoaderV3_1.EnvInfoLoaderMW_V3(false),
951
- solutionLoaderV3_1.SolutionLoaderMW_V3,
952
- questionModel_1.QuestionModelMW,
953
- contextInjector_1.ContextInjectorMW,
954
- projectSettingsWriter_1.ProjectSettingsWriterMW,
955
- envInfoWriterV3_1.EnvInfoWriterMW_V3(),
956
- ]),
957
- tslib_1.__metadata("design:type", Function),
958
- tslib_1.__metadata("design:paramtypes", [Object, Object]),
959
- tslib_1.__metadata("design:returntype", Promise)
960
- ], FxCore.prototype, "provisionResourcesV3", null);
961
- tslib_1.__decorate([
962
- hooks_1.hooks([
963
- errorHandler_1.ErrorHandlerMW,
964
- concurrentLocker_1.ConcurrentLockerMW,
965
- projectMigrator_1.ProjectMigratorMW,
966
- projectSettingsLoader_1.ProjectSettingsLoaderMW,
967
- envInfoLoader_1.EnvInfoLoaderMW(false),
968
- solutionLoader_1.SolutionLoaderMW,
969
- questionModel_1.QuestionModelMW,
970
- contextInjector_1.ContextInjectorMW,
971
- projectSettingsWriter_1.ProjectSettingsWriterMW,
972
- envInfoWriter_1.EnvInfoWriterMW(),
973
- ]),
974
- tslib_1.__metadata("design:type", Function),
975
- tslib_1.__metadata("design:paramtypes", [Object, Object]),
976
- tslib_1.__metadata("design:returntype", Promise)
977
- ], FxCore.prototype, "deployArtifactsV2", null);
978
- tslib_1.__decorate([
979
- hooks_1.hooks([
980
- errorHandler_1.ErrorHandlerMW,
981
- concurrentLocker_1.ConcurrentLockerMW,
982
- projectMigrator_1.ProjectMigratorMW,
983
- projectSettingsLoader_1.ProjectSettingsLoaderMW,
984
- envInfoLoaderV3_1.EnvInfoLoaderMW_V3(false),
985
- solutionLoaderV3_1.SolutionLoaderMW_V3,
986
- questionModel_1.QuestionModelMW,
987
- contextInjector_1.ContextInjectorMW,
988
- projectSettingsWriter_1.ProjectSettingsWriterMW,
989
- envInfoWriterV3_1.EnvInfoWriterMW_V3(),
990
- ]),
991
- tslib_1.__metadata("design:type", Function),
992
- tslib_1.__metadata("design:paramtypes", [Object, Object]),
993
- tslib_1.__metadata("design:returntype", Promise)
994
- ], FxCore.prototype, "deployArtifactsV3", null);
995
- tslib_1.__decorate([
996
- hooks_1.hooks([
997
- errorHandler_1.ErrorHandlerMW,
998
- concurrentLocker_1.ConcurrentLockerMW,
999
- projectMigrator_1.ProjectMigratorMW,
1000
- projectSettingsLoader_1.ProjectSettingsLoaderMW,
1001
- envInfoLoader_1.EnvInfoLoaderMW(!tools_1.isConfigUnifyEnabled()),
1002
- localSettingsLoader_1.LocalSettingsLoaderMW,
1003
- solutionLoader_1.SolutionLoaderMW,
1004
- questionModel_1.QuestionModelMW,
1005
- contextInjector_1.ContextInjectorMW,
1006
- projectSettingsWriter_1.ProjectSettingsWriterMW,
1007
- envInfoWriter_1.EnvInfoWriterMW(!tools_1.isConfigUnifyEnabled()),
1008
- localSettingsWriter_1.LocalSettingsWriterMW,
1009
- ]),
1010
- tslib_1.__metadata("design:type", Function),
1011
- tslib_1.__metadata("design:paramtypes", [Object, Object]),
1012
- tslib_1.__metadata("design:returntype", Promise)
1013
- ], FxCore.prototype, "localDebugV2", null);
1014
- tslib_1.__decorate([
1015
- hooks_1.hooks([
1016
- errorHandler_1.ErrorHandlerMW,
1017
- concurrentLocker_1.ConcurrentLockerMW,
1018
- projectMigrator_1.ProjectMigratorMW,
1019
- projectSettingsLoader_1.ProjectSettingsLoaderMW,
1020
- envInfoLoader_1.EnvInfoLoaderMW(false),
1021
- solutionLoader_1.SolutionLoaderMW,
1022
- questionModel_1.QuestionModelMW,
1023
- contextInjector_1.ContextInjectorMW,
1024
- projectSettingsWriter_1.ProjectSettingsWriterMW,
1025
- envInfoWriter_1.EnvInfoWriterMW(),
1026
- ]),
1027
- tslib_1.__metadata("design:type", Function),
1028
- tslib_1.__metadata("design:paramtypes", [Object, Object]),
1029
- tslib_1.__metadata("design:returntype", Promise)
1030
- ], FxCore.prototype, "publishApplicationV2", null);
1031
- tslib_1.__decorate([
1032
- hooks_1.hooks([
1033
- errorHandler_1.ErrorHandlerMW,
1034
- concurrentLocker_1.ConcurrentLockerMW,
1035
- projectMigrator_1.ProjectMigratorMW,
1036
- projectSettingsLoader_1.ProjectSettingsLoaderMW,
1037
- envInfoLoader_1.EnvInfoLoaderMW(false),
1038
- solutionLoader_1.SolutionLoaderMW,
1039
- questionModel_1.QuestionModelMW,
1040
- contextInjector_1.ContextInjectorMW,
1041
- projectSettingsWriter_1.ProjectSettingsWriterMW,
1042
- envInfoWriter_1.EnvInfoWriterMW(),
1043
- ]),
1044
- tslib_1.__metadata("design:type", Function),
1045
- tslib_1.__metadata("design:paramtypes", [Object, Object]),
1046
- tslib_1.__metadata("design:returntype", Promise)
1047
- ], FxCore.prototype, "publishApplicationV3", null);
1048
- tslib_1.__decorate([
1049
- hooks_1.hooks([
1050
- errorHandler_1.ErrorHandlerMW,
1051
- concurrentLocker_1.ConcurrentLockerMW,
1052
- projectMigrator_1.ProjectMigratorMW,
1053
- projectSettingsLoader_1.ProjectSettingsLoaderMW,
1054
- envInfoLoader_1.EnvInfoLoaderMW(false),
1055
- localSettingsLoader_1.LocalSettingsLoaderMW,
1056
- solutionLoader_1.SolutionLoaderMW,
1057
- questionModel_1.QuestionModelMW,
1058
- contextInjector_1.ContextInjectorMW,
1059
- projectSettingsWriter_1.ProjectSettingsWriterMW,
1060
- envInfoWriter_1.EnvInfoWriterMW(),
1061
- ]),
1062
- tslib_1.__metadata("design:type", Function),
1063
- tslib_1.__metadata("design:paramtypes", [Object, Object, Object]),
1064
- tslib_1.__metadata("design:returntype", Promise)
1065
- ], FxCore.prototype, "executeUserTaskV2", null);
1066
- tslib_1.__decorate([
1067
- hooks_1.hooks([
1068
- errorHandler_1.ErrorHandlerMW,
1069
- concurrentLocker_1.ConcurrentLockerMW,
1070
- projectMigrator_1.ProjectMigratorMW,
1071
- projectSettingsLoader_1.ProjectSettingsLoaderMW,
1072
- envInfoLoaderV3_1.EnvInfoLoaderMW_V3(false),
1073
- localSettingsLoader_1.LocalSettingsLoaderMW,
1074
- solutionLoaderV3_1.SolutionLoaderMW_V3,
1075
- questionModel_1.QuestionModelMW,
1076
- contextInjector_1.ContextInjectorMW,
1077
- projectSettingsWriter_1.ProjectSettingsWriterMW,
1078
- envInfoWriter_1.EnvInfoWriterMW(),
1079
- ]),
1080
- tslib_1.__metadata("design:type", Function),
1081
- tslib_1.__metadata("design:paramtypes", [Object, Object, Object]),
1082
- tslib_1.__metadata("design:returntype", Promise)
1083
- ], FxCore.prototype, "executeUserTaskV3", null);
1084
- tslib_1.__decorate([
1085
- hooks_1.hooks([
1086
- errorHandler_1.ErrorHandlerMW,
1087
- concurrentLocker_1.ConcurrentLockerMW,
1088
- projectSettingsLoader_1.ProjectSettingsLoaderMW,
1089
- envInfoLoader_1.EnvInfoLoaderMW(true),
1090
- solutionLoader_1.SolutionLoaderMW,
1091
- contextInjector_1.ContextInjectorMW,
1092
- envInfoWriter_1.EnvInfoWriterMW(),
1093
- ]),
1094
- tslib_1.__metadata("design:type", Function),
1095
- tslib_1.__metadata("design:paramtypes", [String, Object, Object]),
1096
- tslib_1.__metadata("design:returntype", Promise)
1097
- ], FxCore.prototype, "getQuestions", null);
1098
- tslib_1.__decorate([
1099
- hooks_1.hooks([
1100
- errorHandler_1.ErrorHandlerMW,
1101
- concurrentLocker_1.ConcurrentLockerMW,
1102
- projectSettingsLoader_1.ProjectSettingsLoaderMW,
1103
- envInfoLoader_1.EnvInfoLoaderMW(true),
1104
- solutionLoader_1.SolutionLoaderMW,
1105
- contextInjector_1.ContextInjectorMW,
1106
- envInfoWriter_1.EnvInfoWriterMW(),
1107
- ]),
1108
- tslib_1.__metadata("design:type", Function),
1109
- tslib_1.__metadata("design:paramtypes", [Object, Object, Object]),
1110
- tslib_1.__metadata("design:returntype", Promise)
1111
- ], FxCore.prototype, "getQuestionsForUserTask", null);
1112
- tslib_1.__decorate([
1113
- hooks_1.hooks([
1114
- errorHandler_1.ErrorHandlerMW,
1115
- concurrentLocker_1.ConcurrentLockerMW,
1116
- projectMigrator_1.ProjectMigratorMW,
1117
- projectSettingsLoader_1.ProjectSettingsLoaderMW,
1118
- envInfoLoader_1.EnvInfoLoaderMW(false),
1119
- localSettingsLoader_1.LocalSettingsLoaderMW,
1120
- contextInjector_1.ContextInjectorMW,
1121
- ]),
1122
- tslib_1.__metadata("design:type", Function),
1123
- tslib_1.__metadata("design:paramtypes", [Object, Object]),
1124
- tslib_1.__metadata("design:returntype", Promise)
1125
- ], FxCore.prototype, "getProjectConfig", null);
1126
- tslib_1.__decorate([
1127
- hooks_1.hooks([errorHandler_1.ErrorHandlerMW, concurrentLocker_1.ConcurrentLockerMW, projectSettingsLoader_1.ProjectSettingsLoaderMW, contextInjector_1.ContextInjectorMW]),
1128
- tslib_1.__metadata("design:type", Function),
1129
- tslib_1.__metadata("design:paramtypes", [Object, Object]),
1130
- tslib_1.__metadata("design:returntype", Promise)
1131
- ], FxCore.prototype, "getProjectConfigV3", null);
1132
- tslib_1.__decorate([
1133
- hooks_1.hooks([
1134
- errorHandler_1.ErrorHandlerMW,
1135
- concurrentLocker_1.ConcurrentLockerMW,
1136
- projectMigrator_1.ProjectMigratorMW,
1137
- projectSettingsLoader_1.ProjectSettingsLoaderMW,
1138
- envInfoLoader_1.EnvInfoLoaderMW(false),
1139
- solutionLoader_1.SolutionLoaderMW,
1140
- questionModel_1.QuestionModelMW,
1141
- contextInjector_1.ContextInjectorMW,
1142
- ]),
1143
- tslib_1.__metadata("design:type", Function),
1144
- tslib_1.__metadata("design:paramtypes", [Object, Object]),
1145
- tslib_1.__metadata("design:returntype", Promise)
1146
- ], FxCore.prototype, "grantPermissionV2", null);
1147
- tslib_1.__decorate([
1148
- hooks_1.hooks([
1149
- errorHandler_1.ErrorHandlerMW,
1150
- concurrentLocker_1.ConcurrentLockerMW,
1151
- projectMigrator_1.ProjectMigratorMW,
1152
- projectSettingsLoader_1.ProjectSettingsLoaderMW,
1153
- envInfoLoaderV3_1.EnvInfoLoaderMW_V3(false),
1154
- questionModel_1.QuestionModelMW,
1155
- contextInjector_1.ContextInjectorMW,
1156
- ]),
1157
- tslib_1.__metadata("design:type", Function),
1158
- tslib_1.__metadata("design:paramtypes", [Object, Object]),
1159
- tslib_1.__metadata("design:returntype", Promise)
1160
- ], FxCore.prototype, "grantPermissionV3", null);
1161
- tslib_1.__decorate([
1162
- hooks_1.hooks([
1163
- errorHandler_1.ErrorHandlerMW,
1164
- concurrentLocker_1.ConcurrentLockerMW,
1165
- projectMigrator_1.ProjectMigratorMW,
1166
- projectSettingsLoader_1.ProjectSettingsLoaderMW,
1167
- envInfoLoader_1.EnvInfoLoaderMW(false),
1168
- solutionLoader_1.SolutionLoaderMW,
1169
- questionModel_1.QuestionModelMW,
1170
- contextInjector_1.ContextInjectorMW,
1171
- ]),
1172
- tslib_1.__metadata("design:type", Function),
1173
- tslib_1.__metadata("design:paramtypes", [Object, Object]),
1174
- tslib_1.__metadata("design:returntype", Promise)
1175
- ], FxCore.prototype, "checkPermissionV2", null);
1176
- tslib_1.__decorate([
1177
- hooks_1.hooks([
1178
- errorHandler_1.ErrorHandlerMW,
1179
- concurrentLocker_1.ConcurrentLockerMW,
1180
- projectMigrator_1.ProjectMigratorMW,
1181
- projectSettingsLoader_1.ProjectSettingsLoaderMW,
1182
- envInfoLoaderV3_1.EnvInfoLoaderMW_V3(false),
1183
- contextInjector_1.ContextInjectorMW,
1184
- ]),
1185
- tslib_1.__metadata("design:type", Function),
1186
- tslib_1.__metadata("design:paramtypes", [Object, Object]),
1187
- tslib_1.__metadata("design:returntype", Promise)
1188
- ], FxCore.prototype, "checkPermissionV3", null);
1189
- tslib_1.__decorate([
1190
- hooks_1.hooks([
1191
- errorHandler_1.ErrorHandlerMW,
1192
- concurrentLocker_1.ConcurrentLockerMW,
1193
- projectMigrator_1.ProjectMigratorMW,
1194
- projectSettingsLoader_1.ProjectSettingsLoaderMW,
1195
- envInfoLoader_1.EnvInfoLoaderMW(false),
1196
- solutionLoader_1.SolutionLoaderMW,
1197
- questionModel_1.QuestionModelMW,
1198
- contextInjector_1.ContextInjectorMW,
1199
- ]),
1200
- tslib_1.__metadata("design:type", Function),
1201
- tslib_1.__metadata("design:paramtypes", [Object, Object]),
1202
- tslib_1.__metadata("design:returntype", Promise)
1203
- ], FxCore.prototype, "listCollaboratorV2", null);
1204
- tslib_1.__decorate([
1205
- hooks_1.hooks([
1206
- errorHandler_1.ErrorHandlerMW,
1207
- concurrentLocker_1.ConcurrentLockerMW,
1208
- projectMigrator_1.ProjectMigratorMW,
1209
- projectSettingsLoader_1.ProjectSettingsLoaderMW,
1210
- envInfoLoaderV3_1.EnvInfoLoaderMW_V3(false),
1211
- contextInjector_1.ContextInjectorMW,
1212
- ]),
1213
- tslib_1.__metadata("design:type", Function),
1214
- tslib_1.__metadata("design:paramtypes", [Object, Object]),
1215
- tslib_1.__metadata("design:returntype", Promise)
1216
- ], FxCore.prototype, "listCollaboratorV3", null);
1217
- tslib_1.__decorate([
1218
- hooks_1.hooks([
1219
- errorHandler_1.ErrorHandlerMW,
1220
- concurrentLocker_1.ConcurrentLockerMW,
1221
- projectSettingsLoader_1.ProjectSettingsLoaderMW,
1222
- envInfoLoader_1.EnvInfoLoaderMW(false),
1223
- contextInjector_1.ContextInjectorMW,
1224
- ]),
1225
- tslib_1.__metadata("design:type", Function),
1226
- tslib_1.__metadata("design:paramtypes", [Object, Object]),
1227
- tslib_1.__metadata("design:returntype", Promise)
1228
- ], FxCore.prototype, "getSelectedEnv", null);
1229
- tslib_1.__decorate([
1230
- hooks_1.hooks([
1231
- errorHandler_1.ErrorHandlerMW,
1232
- concurrentLocker_1.ConcurrentLockerMW,
1233
- projectSettingsLoader_1.ProjectSettingsLoaderMW,
1234
- envInfoLoader_1.EnvInfoLoaderMW(true),
1235
- contextInjector_1.ContextInjectorMW,
1236
- ]),
1237
- tslib_1.__metadata("design:type", Function),
1238
- tslib_1.__metadata("design:paramtypes", [String, Object, Object]),
1239
- tslib_1.__metadata("design:returntype", Promise)
1240
- ], FxCore.prototype, "encrypt", null);
1241
- tslib_1.__decorate([
1242
- hooks_1.hooks([
1243
- errorHandler_1.ErrorHandlerMW,
1244
- concurrentLocker_1.ConcurrentLockerMW,
1245
- projectSettingsLoader_1.ProjectSettingsLoaderMW,
1246
- envInfoLoader_1.EnvInfoLoaderMW(true),
1247
- contextInjector_1.ContextInjectorMW,
1248
- ]),
1249
- tslib_1.__metadata("design:type", Function),
1250
- tslib_1.__metadata("design:paramtypes", [String, Object, Object]),
1251
- tslib_1.__metadata("design:returntype", Promise)
1252
- ], FxCore.prototype, "decrypt", null);
1253
- tslib_1.__decorate([
1254
- hooks_1.hooks([
1255
- errorHandler_1.ErrorHandlerMW,
1256
- concurrentLocker_1.ConcurrentLockerMW,
1257
- projectSettingsLoader_1.ProjectSettingsLoaderMW,
1258
- solutionLoader_1.SolutionLoaderMW,
1259
- envInfoLoader_1.EnvInfoLoaderMW(true),
1260
- contextInjector_1.ContextInjectorMW,
1261
- ]),
1262
- tslib_1.__metadata("design:type", Function),
1263
- tslib_1.__metadata("design:paramtypes", [Object, Object]),
1264
- tslib_1.__metadata("design:returntype", Promise)
1265
- ], FxCore.prototype, "createEnv", null);
1266
- tslib_1.__decorate([
1267
- hooks_1.hooks([
1268
- errorHandler_1.ErrorHandlerMW,
1269
- concurrentLocker_1.ConcurrentLockerMW,
1270
- projectMigrator_1.ProjectMigratorMW,
1271
- projectSettingsLoader_1.ProjectSettingsLoaderMW,
1272
- solutionLoader_1.SolutionLoaderMW,
1273
- contextInjector_1.ContextInjectorMW,
1274
- projectSettingsWriter_1.ProjectSettingsWriterMW,
1275
- ]),
1276
- tslib_1.__metadata("design:type", Function),
1277
- tslib_1.__metadata("design:paramtypes", [Object, Object]),
1278
- tslib_1.__metadata("design:returntype", Promise)
1279
- ], FxCore.prototype, "activateEnv", null);
1280
- tslib_1.__decorate([
1281
- hooks_1.hooks([
1282
- errorHandler_1.ErrorHandlerMW,
1283
- concurrentLocker_1.ConcurrentLockerMW,
1284
- questionModel_1.QuestionModelMW,
1285
- contextInjector_1.ContextInjectorMW,
1286
- projectSettingsWriter_1.ProjectSettingsWriterMW,
1287
- ]),
1288
- tslib_1.__metadata("design:type", Function),
1289
- tslib_1.__metadata("design:paramtypes", [Object, Object]),
1290
- tslib_1.__metadata("design:returntype", Promise)
1291
- ], FxCore.prototype, "init", null);
1292
- tslib_1.__decorate([
1293
- hooks_1.hooks([
1294
- errorHandler_1.ErrorHandlerMW,
1295
- concurrentLocker_1.ConcurrentLockerMW,
1296
- projectSettingsLoader_1.ProjectSettingsLoaderMW,
1297
- solutionLoaderV3_1.SolutionLoaderMW_V3,
1298
- envInfoLoaderV3_1.EnvInfoLoaderMW_V3(false),
1299
- questionModel_1.QuestionModelMW,
1300
- contextInjector_1.ContextInjectorMW,
1301
- projectSettingsWriter_1.ProjectSettingsWriterMW,
1302
- ]),
1303
- tslib_1.__metadata("design:type", Function),
1304
- tslib_1.__metadata("design:paramtypes", [Object, Object]),
1305
- tslib_1.__metadata("design:returntype", Promise)
1306
- ], FxCore.prototype, "addFeature", null);
1307
- exports.FxCore = FxCore;
1308
- async function createBasicFolderStructure(inputs) {
1309
- if (!inputs.projectPath) {
1310
- return teamsfx_api_1.err(new error_1.ObjectIsUndefinedError("projectPath"));
1311
- }
1312
- try {
1313
- const appName = inputs[question_2.QuestionAppName.name];
1314
- if (inputs.platform !== teamsfx_api_1.Platform.VS) {
1315
- await fs.writeFile(path.join(inputs.projectPath, `package.json`), JSON.stringify({
1316
- name: appName,
1317
- version: "0.0.1",
1318
- description: "",
1319
- author: "",
1320
- scripts: {
1321
- test: 'echo "Error: no test specified" && exit 1',
1322
- },
1323
- devDependencies: {
1324
- "@microsoft/teamsfx-cli": "0.*",
1325
- },
1326
- license: "MIT",
1327
- }, null, 4));
1328
- }
1329
- const gitIgnoreContent = [
1330
- "node_modules",
1331
- `.${teamsfx_api_1.ConfigFolderName}/${teamsfx_api_1.InputConfigsFolderName}/${localSettingsProvider_1.localSettingsFileName}`,
1332
- `.${teamsfx_api_1.ConfigFolderName}/${teamsfx_api_1.StatesFolderName}/*.userdata`,
1333
- ".DS_Store",
1334
- ".env.teamsfx.local",
1335
- "subscriptionInfo.json",
1336
- teamsfx_api_1.BuildFolderName,
1337
- ];
1338
- if (inputs.platform === teamsfx_api_1.Platform.VS) {
1339
- gitIgnoreContent.push("appsettings.Development.json");
1340
- }
1341
- await fs.writeFile(path.join(inputs.projectPath, `.gitignore`), gitIgnoreContent.join("\n"));
1342
- }
1343
- catch (e) {
1344
- return teamsfx_api_1.err(error_1.WriteFileError(e));
1345
- }
1346
- return teamsfx_api_1.ok(null);
1347
- }
1348
- exports.createBasicFolderStructure = createBasicFolderStructure;
1349
- function newProjectSettings() {
1350
- const projectSettings = {
1351
- appName: "",
1352
- projectId: uuid.v4(),
1353
- version: getProjectSettingsVersion(),
1354
- };
1355
- return projectSettings;
1356
- }
1357
- exports.newProjectSettings = newProjectSettings;
1358
- function createV2Context(projectSettings) {
1359
- const context = {
1360
- userInteraction: exports.TOOLS.ui,
1361
- logProvider: exports.TOOLS.logProvider,
1362
- telemetryReporter: exports.TOOLS.telemetryReporter,
1363
- cryptoProvider: new crypto_1.LocalCrypto(projectSettings.projectId),
1364
- permissionRequestProvider: exports.TOOLS.permissionRequest,
1365
- projectSetting: projectSettings,
1366
- };
1367
- return context;
1368
- }
1369
- exports.createV2Context = createV2Context;
1370
- function undefinedName(objs, names) {
1371
- for (let i = 0; i < objs.length; ++i) {
1372
- if (objs[i] === undefined) {
1373
- return names[i];
1374
- }
1375
- }
1376
- return undefined;
1377
- }
1378
- exports.undefinedName = undefinedName;
1379
- function getProjectSettingsVersion() {
1380
- return "2.1.0";
1381
- }
1382
- exports.getProjectSettingsVersion = getProjectSettingsVersion;
1383
- tslib_1.__exportStar(require("./error"), exports);
1384
- tslib_1.__exportStar(require("./tools"), exports);
8
+ require("../../package.json");
1385
9
  tslib_1.__exportStar(require("./downloadSample"), exports);
10
+ tslib_1.__exportStar(require("./error"), exports);
11
+ tslib_1.__exportStar(require("./FxCore"), exports);
12
+ tslib_1.__exportStar(require("./globalVars"), exports);
13
+ tslib_1.__exportStar(require("./types"), exports);
1386
14
  //# sourceMappingURL=index.js.map