@microsoft/teamsfx-core 2.0.1-alpha.c8eab1a43.0 → 2.0.1-alpha.d4f96cccc.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 (493) hide show
  1. package/build/common/local/localStateHelper.d.ts.map +1 -1
  2. package/build/common/local/localStateHelper.js.map +1 -1
  3. package/build/common/samples.d.ts.map +1 -1
  4. package/build/common/samples.js +2 -2
  5. package/build/common/samples.js.map +1 -1
  6. package/build/common/telemetry.d.ts +0 -13
  7. package/build/common/telemetry.d.ts.map +1 -1
  8. package/build/common/telemetry.js +0 -13
  9. package/build/common/telemetry.js.map +1 -1
  10. package/build/common/templates-config.json +2 -1
  11. package/build/common/tools.d.ts +1 -15
  12. package/build/common/tools.d.ts.map +1 -1
  13. package/build/common/tools.js +53 -138
  14. package/build/common/tools.js.map +1 -1
  15. package/build/component/code/appSettingUtils.d.ts +1 -2
  16. package/build/component/code/appSettingUtils.d.ts.map +1 -1
  17. package/build/component/code/appSettingUtils.js +1 -46
  18. package/build/component/code/appSettingUtils.js.map +1 -1
  19. package/build/component/constant/deployConstant.d.ts.map +1 -1
  20. package/build/component/constant/deployConstant.js.map +1 -1
  21. package/build/component/constants.d.ts +3 -210
  22. package/build/component/constants.d.ts.map +1 -1
  23. package/build/component/constants.js +7 -404
  24. package/build/component/constants.js.map +1 -1
  25. package/build/component/coordinator/index.d.ts +1 -0
  26. package/build/component/coordinator/index.d.ts.map +1 -1
  27. package/build/component/coordinator/index.js +21 -10
  28. package/build/component/coordinator/index.js.map +1 -1
  29. package/build/component/deployUtils.d.ts +1 -8
  30. package/build/component/deployUtils.d.ts.map +1 -1
  31. package/build/component/deployUtils.js +2 -98
  32. package/build/component/deployUtils.js.map +1 -1
  33. package/build/component/driver/add/addWebPart.js +3 -3
  34. package/build/component/driver/add/addWebPart.js.map +1 -1
  35. package/build/component/driver/deploy/azure/impl/AzureZipDeployImpl.js +9 -9
  36. package/build/component/driver/deploy/azure/impl/AzureZipDeployImpl.js.map +1 -1
  37. package/build/component/driver/interface/buildAndDeployArgs.d.ts +11 -11
  38. package/build/component/driver/interface/buildAndDeployArgs.d.ts.map +1 -1
  39. package/build/component/driver/script/scriptDriver.js +6 -6
  40. package/build/component/driver/script/scriptDriver.js.map +1 -1
  41. package/build/component/error.d.ts +0 -3
  42. package/build/component/error.d.ts.map +1 -1
  43. package/build/component/error.js +1 -11
  44. package/build/component/error.js.map +1 -1
  45. package/build/component/feature/cicd/cicd.d.ts +1 -2
  46. package/build/component/feature/cicd/cicd.d.ts.map +1 -1
  47. package/build/component/feature/cicd/cicd.js +2 -87
  48. package/build/component/feature/cicd/cicd.js.map +1 -1
  49. package/build/component/feature/sso.d.ts +0 -1
  50. package/build/component/feature/sso.d.ts.map +1 -1
  51. package/build/component/feature/sso.js +0 -1
  52. package/build/component/feature/sso.js.map +1 -1
  53. package/build/component/generator/generatorAction.d.ts.map +1 -1
  54. package/build/component/generator/generatorAction.js +1 -1
  55. package/build/component/generator/generatorAction.js.map +1 -1
  56. package/build/component/generator/spfx/depsChecker/dependencyChecker.d.ts +8 -0
  57. package/build/component/generator/spfx/depsChecker/dependencyChecker.d.ts.map +1 -0
  58. package/build/component/generator/spfx/depsChecker/dependencyChecker.js.map +1 -0
  59. package/build/component/{resource → generator}/spfx/depsChecker/generatorChecker.d.ts +1 -4
  60. package/build/component/generator/spfx/depsChecker/generatorChecker.d.ts.map +1 -0
  61. package/build/component/{resource → generator}/spfx/depsChecker/generatorChecker.js +0 -39
  62. package/build/component/generator/spfx/depsChecker/generatorChecker.js.map +1 -0
  63. package/build/component/{resource → generator}/spfx/depsChecker/yoChecker.d.ts +1 -4
  64. package/build/component/generator/spfx/depsChecker/yoChecker.d.ts.map +1 -0
  65. package/build/component/{resource → generator}/spfx/depsChecker/yoChecker.js +0 -33
  66. package/build/component/generator/spfx/depsChecker/yoChecker.js.map +1 -0
  67. package/build/component/generator/spfx/error.d.ts +8 -0
  68. package/build/component/generator/spfx/error.d.ts.map +1 -0
  69. package/build/component/generator/spfx/error.js +55 -0
  70. package/build/component/generator/spfx/error.js.map +1 -0
  71. package/build/component/generator/spfx/spfxGenerator.d.ts.map +1 -0
  72. package/build/component/generator/{spfxGenerator.js → spfx/spfxGenerator.js} +16 -16
  73. package/build/component/generator/spfx/spfxGenerator.js.map +1 -0
  74. package/build/component/{resource → generator}/spfx/utils/constants.d.ts +0 -33
  75. package/build/component/generator/spfx/utils/constants.d.ts.map +1 -0
  76. package/build/component/{resource → generator}/spfx/utils/constants.js +1 -39
  77. package/build/component/generator/spfx/utils/constants.js.map +1 -0
  78. package/build/component/{resource → generator}/spfx/utils/progress-helper.d.ts +0 -5
  79. package/build/component/generator/spfx/utils/progress-helper.d.ts.map +1 -0
  80. package/build/component/generator/spfx/utils/progress-helper.js +21 -0
  81. package/build/component/generator/spfx/utils/progress-helper.js.map +1 -0
  82. package/build/component/generator/spfx/utils/question-helper.d.ts.map +1 -0
  83. package/build/component/generator/spfx/utils/question-helper.js.map +1 -0
  84. package/build/component/{resource → generator}/spfx/utils/questions.d.ts +0 -1
  85. package/build/component/generator/spfx/utils/questions.d.ts.map +1 -0
  86. package/build/component/{resource → generator}/spfx/utils/questions.js +1 -23
  87. package/build/component/generator/spfx/utils/questions.js.map +1 -0
  88. package/build/component/generator/spfx/utils/telemetry-helper.d.ts.map +1 -0
  89. package/build/component/generator/spfx/utils/telemetry-helper.js.map +1 -0
  90. package/build/component/generator/spfx/utils/telemetryEvents.d.ts.map +1 -0
  91. package/build/component/generator/spfx/utils/telemetryEvents.js.map +1 -0
  92. package/build/component/generator/spfx/utils/utils.d.ts.map +1 -0
  93. package/build/component/generator/spfx/utils/utils.js.map +1 -0
  94. package/build/component/generator/utils.js +2 -2
  95. package/build/component/generator/utils.js.map +1 -1
  96. package/build/component/middleware/envMW.js.map +1 -1
  97. package/build/component/provisionUtils.d.ts +2 -23
  98. package/build/component/provisionUtils.d.ts.map +1 -1
  99. package/build/component/provisionUtils.js +5 -523
  100. package/build/component/provisionUtils.js.map +1 -1
  101. package/build/component/question.js +1 -1
  102. package/build/component/question.js.map +1 -1
  103. package/build/component/registerService.d.ts +0 -3
  104. package/build/component/registerService.d.ts.map +1 -1
  105. package/build/component/registerService.js +0 -3
  106. package/build/component/registerService.js.map +1 -1
  107. package/build/component/resource/aadApp/utils/aadManifestHelper.js +2 -1
  108. package/build/component/resource/aadApp/utils/aadManifestHelper.js.map +1 -1
  109. package/build/component/resource/appManifest/appManifest.d.ts +0 -6
  110. package/build/component/resource/appManifest/appManifest.d.ts.map +1 -1
  111. package/build/component/resource/appManifest/appManifest.js +24 -247
  112. package/build/component/resource/appManifest/appManifest.js.map +1 -1
  113. package/build/component/resource/appManifest/appStudio.d.ts +1 -21
  114. package/build/component/resource/appManifest/appStudio.d.ts.map +1 -1
  115. package/build/component/resource/appManifest/appStudio.js +15 -257
  116. package/build/component/resource/appManifest/appStudio.js.map +1 -1
  117. package/build/component/resource/botService/errors.d.ts +0 -2
  118. package/build/component/resource/botService/errors.d.ts.map +1 -1
  119. package/build/component/resource/botService/errors.js +1 -43
  120. package/build/component/resource/botService/errors.js.map +1 -1
  121. package/build/component/utils/ResourceGroupHelper.d.ts +1 -5
  122. package/build/component/utils/ResourceGroupHelper.d.ts.map +1 -1
  123. package/build/component/utils/ResourceGroupHelper.js +0 -6
  124. package/build/component/utils/ResourceGroupHelper.js.map +1 -1
  125. package/build/component/utils/pathUtils.d.ts.map +1 -1
  126. package/build/component/utils/pathUtils.js +2 -2
  127. package/build/component/utils/pathUtils.js.map +1 -1
  128. package/build/component/utils.d.ts +1 -18
  129. package/build/component/utils.d.ts.map +1 -1
  130. package/build/component/utils.js +23 -277
  131. package/build/component/utils.js.map +1 -1
  132. package/build/component/workflow.d.ts +0 -1
  133. package/build/component/workflow.d.ts.map +1 -1
  134. package/build/component/workflow.js +1 -6
  135. package/build/component/workflow.js.map +1 -1
  136. package/build/core/FxCore.d.ts +0 -8
  137. package/build/core/FxCore.d.ts.map +1 -1
  138. package/build/core/FxCore.js +0 -12
  139. package/build/core/FxCore.js.map +1 -1
  140. package/build/core/FxCoreImplementV3.d.ts.map +1 -1
  141. package/build/core/FxCoreImplementV3.js +7 -20
  142. package/build/core/FxCoreImplementV3.js.map +1 -1
  143. package/build/core/collaborator.d.ts +2 -0
  144. package/build/core/collaborator.d.ts.map +1 -1
  145. package/build/core/collaborator.js +2 -0
  146. package/build/core/collaborator.js.map +1 -1
  147. package/build/core/environment.d.ts +2 -4
  148. package/build/core/environment.d.ts.map +1 -1
  149. package/build/core/environment.js +44 -108
  150. package/build/core/environment.js.map +1 -1
  151. package/build/core/error.d.ts +1 -34
  152. package/build/core/error.d.ts.map +1 -1
  153. package/build/core/error.js +1 -112
  154. package/build/core/error.js.map +1 -1
  155. package/build/core/globalVars.d.ts +0 -1
  156. package/build/core/globalVars.d.ts.map +1 -1
  157. package/build/core/globalVars.js +1 -15
  158. package/build/core/globalVars.js.map +1 -1
  159. package/build/core/middleware/projectMigratorV3.d.ts +2 -1
  160. package/build/core/middleware/projectMigratorV3.d.ts.map +1 -1
  161. package/build/core/middleware/projectMigratorV3.js +40 -46
  162. package/build/core/middleware/projectMigratorV3.js.map +1 -1
  163. package/build/core/middleware/projectSettingsLoader.d.ts.map +1 -1
  164. package/build/core/middleware/projectSettingsLoader.js +9 -20
  165. package/build/core/middleware/projectSettingsLoader.js.map +1 -1
  166. package/build/core/middleware/projectVersionChecker.d.ts.map +1 -1
  167. package/build/core/middleware/projectVersionChecker.js +6 -18
  168. package/build/core/middleware/projectVersionChecker.js.map +1 -1
  169. package/build/core/middleware/utils/migrationContext.d.ts.map +1 -1
  170. package/build/core/middleware/utils/migrationContext.js +0 -4
  171. package/build/core/middleware/utils/migrationContext.js.map +1 -1
  172. package/build/core/question.d.ts.map +1 -1
  173. package/build/core/question.js +4 -4
  174. package/build/core/question.js.map +1 -1
  175. package/build/core/types.d.ts +0 -10
  176. package/build/core/types.d.ts.map +1 -1
  177. package/build/index.d.ts +0 -1
  178. package/build/index.d.ts.map +1 -1
  179. package/build/index.js +0 -1
  180. package/build/index.js.map +1 -1
  181. package/package.json +7 -11
  182. package/resource/package.nls.json +3 -177
  183. package/templates/fallback/common.zip +0 -0
  184. package/templates/fallback/csharp.zip +0 -0
  185. package/templates/fallback/js.zip +0 -0
  186. package/templates/fallback/ts.zip +0 -0
  187. package/build/common/azure-hosting/azureAppServiceHosting.d.ts +0 -16
  188. package/build/common/azure-hosting/azureAppServiceHosting.d.ts.map +0 -1
  189. package/build/common/azure-hosting/azureAppServiceHosting.js +0 -33
  190. package/build/common/azure-hosting/azureAppServiceHosting.js.map +0 -1
  191. package/build/common/azure-hosting/azureFunctionHosting.d.ts +0 -14
  192. package/build/common/azure-hosting/azureFunctionHosting.d.ts.map +0 -1
  193. package/build/common/azure-hosting/azureFunctionHosting.js +0 -34
  194. package/build/common/azure-hosting/azureFunctionHosting.js.map +0 -1
  195. package/build/common/azure-hosting/azureHosting.d.ts +0 -23
  196. package/build/common/azure-hosting/azureHosting.d.ts.map +0 -1
  197. package/build/common/azure-hosting/azureHosting.js +0 -95
  198. package/build/common/azure-hosting/azureHosting.js.map +0 -1
  199. package/build/common/azure-hosting/azureOps.d.ts +0 -17
  200. package/build/common/azure-hosting/azureOps.d.ts.map +0 -1
  201. package/build/common/azure-hosting/azureOps.js +0 -94
  202. package/build/common/azure-hosting/azureOps.js.map +0 -1
  203. package/build/common/azure-hosting/hostingConstant.d.ts +0 -46
  204. package/build/common/azure-hosting/hostingConstant.d.ts.map +0 -1
  205. package/build/common/azure-hosting/hostingConstant.js +0 -86
  206. package/build/common/azure-hosting/hostingConstant.js.map +0 -1
  207. package/build/common/azure-hosting/hostingError.d.ts +0 -47
  208. package/build/common/azure-hosting/hostingError.d.ts.map +0 -1
  209. package/build/common/azure-hosting/hostingError.js +0 -83
  210. package/build/common/azure-hosting/hostingError.js.map +0 -1
  211. package/build/common/azure-hosting/hostingFactory.d.ts +0 -6
  212. package/build/common/azure-hosting/hostingFactory.d.ts.map +0 -1
  213. package/build/common/azure-hosting/hostingFactory.js +0 -22
  214. package/build/common/azure-hosting/hostingFactory.js.map +0 -1
  215. package/build/common/azure-hosting/interfaces.d.ts +0 -58
  216. package/build/common/azure-hosting/interfaces.d.ts.map +0 -1
  217. package/build/common/azure-hosting/interfaces.js +0 -12
  218. package/build/common/azure-hosting/interfaces.js.map +0 -1
  219. package/build/common/azure-hosting/messages.d.ts +0 -10
  220. package/build/common/azure-hosting/messages.d.ts.map +0 -1
  221. package/build/common/azure-hosting/messages.js +0 -16
  222. package/build/common/azure-hosting/messages.js.map +0 -1
  223. package/build/common/azure-hosting/utils.d.ts +0 -10
  224. package/build/common/azure-hosting/utils.d.ts.map +0 -1
  225. package/build/common/azure-hosting/utils.js +0 -107
  226. package/build/common/azure-hosting/utils.js.map +0 -1
  227. package/build/common/samples-config.json +0 -201
  228. package/build/component/code/spfxTabCode.d.ts +0 -11
  229. package/build/component/code/spfxTabCode.d.ts.map +0 -1
  230. package/build/component/code/spfxTabCode.js +0 -237
  231. package/build/component/code/spfxTabCode.js.map +0 -1
  232. package/build/component/envManager.d.ts +0 -4
  233. package/build/component/envManager.d.ts.map +0 -1
  234. package/build/component/envManager.js +0 -25
  235. package/build/component/envManager.js.map +0 -1
  236. package/build/component/feature/apiconnector/ApiConnectorImpl.d.ts +0 -23
  237. package/build/component/feature/apiconnector/ApiConnectorImpl.d.ts.map +0 -1
  238. package/build/component/feature/apiconnector/ApiConnectorImpl.js +0 -288
  239. package/build/component/feature/apiconnector/ApiConnectorImpl.js.map +0 -1
  240. package/build/component/feature/apiconnector/checker.d.ts +0 -7
  241. package/build/component/feature/apiconnector/checker.d.ts.map +0 -1
  242. package/build/component/feature/apiconnector/checker.js +0 -74
  243. package/build/component/feature/apiconnector/checker.js.map +0 -1
  244. package/build/component/feature/apiconnector/config.d.ts +0 -23
  245. package/build/component/feature/apiconnector/config.d.ts.map +0 -1
  246. package/build/component/feature/apiconnector/config.js +0 -5
  247. package/build/component/feature/apiconnector/config.js.map +0 -1
  248. package/build/component/feature/apiconnector/constants.d.ts +0 -50
  249. package/build/component/feature/apiconnector/constants.d.ts.map +0 -1
  250. package/build/component/feature/apiconnector/constants.js +0 -61
  251. package/build/component/feature/apiconnector/constants.js.map +0 -1
  252. package/build/component/feature/apiconnector/depsHandler.d.ts +0 -14
  253. package/build/component/feature/apiconnector/depsHandler.d.ts.map +0 -1
  254. package/build/component/feature/apiconnector/depsHandler.js +0 -109
  255. package/build/component/feature/apiconnector/depsHandler.js.map +0 -1
  256. package/build/component/feature/apiconnector/envHandler.d.ts +0 -21
  257. package/build/component/feature/apiconnector/envHandler.d.ts.map +0 -1
  258. package/build/component/feature/apiconnector/envHandler.js +0 -128
  259. package/build/component/feature/apiconnector/envHandler.js.map +0 -1
  260. package/build/component/feature/apiconnector/errors.d.ts +0 -53
  261. package/build/component/feature/apiconnector/errors.d.ts.map +0 -1
  262. package/build/component/feature/apiconnector/errors.js +0 -64
  263. package/build/component/feature/apiconnector/errors.js.map +0 -1
  264. package/build/component/feature/apiconnector/questions.d.ts +0 -41
  265. package/build/component/feature/apiconnector/questions.d.ts.map +0 -1
  266. package/build/component/feature/apiconnector/questions.js +0 -262
  267. package/build/component/feature/apiconnector/questions.js.map +0 -1
  268. package/build/component/feature/apiconnector/result.d.ts +0 -23
  269. package/build/component/feature/apiconnector/result.d.ts.map +0 -1
  270. package/build/component/feature/apiconnector/result.js +0 -40
  271. package/build/component/feature/apiconnector/result.js.map +0 -1
  272. package/build/component/feature/apiconnector/sampleHandler.d.ts +0 -10
  273. package/build/component/feature/apiconnector/sampleHandler.d.ts.map +0 -1
  274. package/build/component/feature/apiconnector/sampleHandler.js +0 -62
  275. package/build/component/feature/apiconnector/sampleHandler.js.map +0 -1
  276. package/build/component/feature/apiconnector/telemetry.d.ts +0 -42
  277. package/build/component/feature/apiconnector/telemetry.d.ts.map +0 -1
  278. package/build/component/feature/apiconnector/telemetry.js +0 -70
  279. package/build/component/feature/apiconnector/telemetry.js.map +0 -1
  280. package/build/component/feature/apiconnector/utils.d.ts +0 -18
  281. package/build/component/feature/apiconnector/utils.d.ts.map +0 -1
  282. package/build/component/feature/apiconnector/utils.js +0 -90
  283. package/build/component/feature/apiconnector/utils.js.map +0 -1
  284. package/build/component/generator/spfxGenerator.d.ts.map +0 -1
  285. package/build/component/generator/spfxGenerator.js.map +0 -1
  286. package/build/component/resource/azureAppService/azureAppService.d.ts +0 -12
  287. package/build/component/resource/azureAppService/azureAppService.d.ts.map +0 -1
  288. package/build/component/resource/azureAppService/azureAppService.js +0 -48
  289. package/build/component/resource/azureAppService/azureAppService.js.map +0 -1
  290. package/build/component/resource/azureAppService/azureFunction.d.ts +0 -36
  291. package/build/component/resource/azureAppService/azureFunction.d.ts.map +0 -1
  292. package/build/component/resource/azureAppService/azureFunction.js +0 -155
  293. package/build/component/resource/azureAppService/azureFunction.js.map +0 -1
  294. package/build/component/resource/azureAppService/azureLibs.d.ts +0 -6
  295. package/build/component/resource/azureAppService/azureLibs.d.ts.map +0 -1
  296. package/build/component/resource/azureAppService/azureLibs.js +0 -13
  297. package/build/component/resource/azureAppService/azureLibs.js.map +0 -1
  298. package/build/component/resource/azureAppService/azureWebApp.d.ts +0 -30
  299. package/build/component/resource/azureAppService/azureWebApp.d.ts.map +0 -1
  300. package/build/component/resource/azureAppService/azureWebApp.js +0 -43
  301. package/build/component/resource/azureAppService/azureWebApp.js.map +0 -1
  302. package/build/component/resource/azureAppService/common.d.ts +0 -10
  303. package/build/component/resource/azureAppService/common.d.ts.map +0 -1
  304. package/build/component/resource/azureAppService/common.js +0 -80
  305. package/build/component/resource/azureAppService/common.js.map +0 -1
  306. package/build/component/resource/azureAppService/dir-walk.d.ts +0 -4
  307. package/build/component/resource/azureAppService/dir-walk.d.ts.map +0 -1
  308. package/build/component/resource/azureAppService/dir-walk.js +0 -21
  309. package/build/component/resource/azureAppService/dir-walk.js.map +0 -1
  310. package/build/component/resource/azureSql/actions/configure.d.ts +0 -15
  311. package/build/component/resource/azureSql/actions/configure.d.ts.map +0 -1
  312. package/build/component/resource/azureSql/actions/configure.js +0 -92
  313. package/build/component/resource/azureSql/actions/configure.js.map +0 -1
  314. package/build/component/resource/azureSql/actions/provision.d.ts +0 -10
  315. package/build/component/resource/azureSql/actions/provision.d.ts.map +0 -1
  316. package/build/component/resource/azureSql/actions/provision.js +0 -63
  317. package/build/component/resource/azureSql/actions/provision.js.map +0 -1
  318. package/build/component/resource/azureSql/actions/utils.d.ts +0 -12
  319. package/build/component/resource/azureSql/actions/utils.d.ts.map +0 -1
  320. package/build/component/resource/azureSql/actions/utils.js +0 -82
  321. package/build/component/resource/azureSql/actions/utils.js.map +0 -1
  322. package/build/component/resource/azureSql/azureSql.d.ts +0 -24
  323. package/build/component/resource/azureSql/azureSql.d.ts.map +0 -1
  324. package/build/component/resource/azureSql/azureSql.js +0 -75
  325. package/build/component/resource/azureSql/azureSql.js.map +0 -1
  326. package/build/component/resource/azureSql/clients/management.d.ts +0 -18
  327. package/build/component/resource/azureSql/clients/management.d.ts.map +0 -1
  328. package/build/component/resource/azureSql/clients/management.js +0 -124
  329. package/build/component/resource/azureSql/clients/management.js.map +0 -1
  330. package/build/component/resource/azureSql/clients/sql.d.ts +0 -13
  331. package/build/component/resource/azureSql/clients/sql.d.ts.map +0 -1
  332. package/build/component/resource/azureSql/clients/sql.js +0 -153
  333. package/build/component/resource/azureSql/clients/sql.js.map +0 -1
  334. package/build/component/resource/azureSql/config.d.ts +0 -7
  335. package/build/component/resource/azureSql/config.d.ts.map +0 -1
  336. package/build/component/resource/azureSql/config.js +0 -77
  337. package/build/component/resource/azureSql/config.js.map +0 -1
  338. package/build/component/resource/azureSql/constants.d.ts +0 -85
  339. package/build/component/resource/azureSql/constants.d.ts.map +0 -1
  340. package/build/component/resource/azureSql/constants.js +0 -95
  341. package/build/component/resource/azureSql/constants.js.map +0 -1
  342. package/build/component/resource/azureSql/errors.d.ts +0 -63
  343. package/build/component/resource/azureSql/errors.d.ts.map +0 -1
  344. package/build/component/resource/azureSql/errors.js +0 -107
  345. package/build/component/resource/azureSql/errors.js.map +0 -1
  346. package/build/component/resource/azureSql/index.d.ts +0 -2
  347. package/build/component/resource/azureSql/index.d.ts.map +0 -1
  348. package/build/component/resource/azureSql/index.js +0 -7
  349. package/build/component/resource/azureSql/index.js.map +0 -1
  350. package/build/component/resource/azureSql/questions.d.ts +0 -6
  351. package/build/component/resource/azureSql/questions.d.ts.map +0 -1
  352. package/build/component/resource/azureSql/questions.js +0 -59
  353. package/build/component/resource/azureSql/questions.js.map +0 -1
  354. package/build/component/resource/azureSql/results.d.ts +0 -10
  355. package/build/component/resource/azureSql/results.d.ts.map +0 -1
  356. package/build/component/resource/azureSql/results.js +0 -34
  357. package/build/component/resource/azureSql/results.js.map +0 -1
  358. package/build/component/resource/azureSql/types.d.ts +0 -12
  359. package/build/component/resource/azureSql/types.d.ts.map +0 -1
  360. package/build/component/resource/azureSql/types.js +0 -5
  361. package/build/component/resource/azureSql/types.js.map +0 -1
  362. package/build/component/resource/azureSql/utils/checkInput.d.ts +0 -10
  363. package/build/component/resource/azureSql/utils/checkInput.d.ts.map +0 -1
  364. package/build/component/resource/azureSql/utils/checkInput.js +0 -89
  365. package/build/component/resource/azureSql/utils/checkInput.js.map +0 -1
  366. package/build/component/resource/azureSql/utils/common.d.ts +0 -12
  367. package/build/component/resource/azureSql/utils/common.d.ts.map +0 -1
  368. package/build/component/resource/azureSql/utils/common.js +0 -51
  369. package/build/component/resource/azureSql/utils/common.js.map +0 -1
  370. package/build/component/resource/azureStorage/azureStorage.d.ts +0 -31
  371. package/build/component/resource/azureStorage/azureStorage.d.ts.map +0 -1
  372. package/build/component/resource/azureStorage/azureStorage.js +0 -111
  373. package/build/component/resource/azureStorage/azureStorage.js.map +0 -1
  374. package/build/component/resource/azureStorage/clients.d.ts +0 -23
  375. package/build/component/resource/azureStorage/clients.d.ts.map +0 -1
  376. package/build/component/resource/azureStorage/clients.js +0 -133
  377. package/build/component/resource/azureStorage/clients.js.map +0 -1
  378. package/build/component/resource/azureStorage/configs.d.ts +0 -12
  379. package/build/component/resource/azureStorage/configs.d.ts.map +0 -1
  380. package/build/component/resource/azureStorage/configs.js +0 -30
  381. package/build/component/resource/azureStorage/configs.js.map +0 -1
  382. package/build/component/resource/azureStorage/constants.d.ts +0 -11
  383. package/build/component/resource/azureStorage/constants.d.ts.map +0 -1
  384. package/build/component/resource/azureStorage/constants.js +0 -17
  385. package/build/component/resource/azureStorage/constants.js.map +0 -1
  386. package/build/component/resource/azureStorage/messages.d.ts +0 -14
  387. package/build/component/resource/azureStorage/messages.d.ts.map +0 -1
  388. package/build/component/resource/azureStorage/messages.js +0 -28
  389. package/build/component/resource/azureStorage/messages.js.map +0 -1
  390. package/build/component/resource/botService/botService.d.ts +0 -24
  391. package/build/component/resource/botService/botService.d.ts.map +0 -1
  392. package/build/component/resource/botService/botService.js +0 -146
  393. package/build/component/resource/botService/botService.js.map +0 -1
  394. package/build/component/resource/spfx/depsChecker/dependencyChecker.d.ts +0 -11
  395. package/build/component/resource/spfx/depsChecker/dependencyChecker.d.ts.map +0 -1
  396. package/build/component/resource/spfx/depsChecker/dependencyChecker.js.map +0 -1
  397. package/build/component/resource/spfx/depsChecker/generatorChecker.d.ts.map +0 -1
  398. package/build/component/resource/spfx/depsChecker/generatorChecker.js.map +0 -1
  399. package/build/component/resource/spfx/depsChecker/yoChecker.d.ts.map +0 -1
  400. package/build/component/resource/spfx/depsChecker/yoChecker.js.map +0 -1
  401. package/build/component/resource/spfx/error.d.ts +0 -21
  402. package/build/component/resource/spfx/error.d.ts.map +0 -1
  403. package/build/component/resource/spfx/error.js +0 -138
  404. package/build/component/resource/spfx/error.js.map +0 -1
  405. package/build/component/resource/spfx/index.d.ts +0 -15
  406. package/build/component/resource/spfx/index.d.ts.map +0 -1
  407. package/build/component/resource/spfx/index.js +0 -248
  408. package/build/component/resource/spfx/index.js.map +0 -1
  409. package/build/component/resource/spfx/spoClient.d.ts +0 -25
  410. package/build/component/resource/spfx/spoClient.d.ts.map +0 -1
  411. package/build/component/resource/spfx/spoClient.js +0 -79
  412. package/build/component/resource/spfx/spoClient.js.map +0 -1
  413. package/build/component/resource/spfx/utils/constants.d.ts.map +0 -1
  414. package/build/component/resource/spfx/utils/constants.js.map +0 -1
  415. package/build/component/resource/spfx/utils/progress-helper.d.ts.map +0 -1
  416. package/build/component/resource/spfx/utils/progress-helper.js +0 -46
  417. package/build/component/resource/spfx/utils/progress-helper.js.map +0 -1
  418. package/build/component/resource/spfx/utils/question-helper.d.ts.map +0 -1
  419. package/build/component/resource/spfx/utils/question-helper.js.map +0 -1
  420. package/build/component/resource/spfx/utils/questions.d.ts.map +0 -1
  421. package/build/component/resource/spfx/utils/questions.js.map +0 -1
  422. package/build/component/resource/spfx/utils/telemetry-helper.d.ts.map +0 -1
  423. package/build/component/resource/spfx/utils/telemetry-helper.js.map +0 -1
  424. package/build/component/resource/spfx/utils/telemetryEvents.d.ts.map +0 -1
  425. package/build/component/resource/spfx/utils/telemetryEvents.js.map +0 -1
  426. package/build/component/resource/spfx/utils/utils.d.ts.map +0 -1
  427. package/build/component/resource/spfx/utils/utils.js.map +0 -1
  428. package/build/component/utils/backupFiles.d.ts +0 -4
  429. package/build/component/utils/backupFiles.d.ts.map +0 -1
  430. package/build/component/utils/backupFiles.js +0 -162
  431. package/build/component/utils/backupFiles.js.map +0 -1
  432. package/build/component/utils/executor.d.ts +0 -12
  433. package/build/component/utils/executor.d.ts.map +0 -1
  434. package/build/component/utils/executor.js +0 -87
  435. package/build/component/utils/executor.js.map +0 -1
  436. package/build/core/downloadSample.d.ts +0 -9
  437. package/build/core/downloadSample.d.ts.map +0 -1
  438. package/build/core/downloadSample.js +0 -161
  439. package/build/core/downloadSample.js.map +0 -1
  440. package/resource/backup-config-change-logs.md +0 -24
  441. package/templates/bicep/azureSql.parameters.json +0 -4
  442. package/templates/bicep/azureSql.provisionDatabase.module.bicep +0 -15
  443. package/templates/bicep/azureSql.provisionDatabase.orchestration.bicep +0 -5
  444. package/templates/bicep/azureSql.provisionServer.module.bicep +0 -44
  445. package/templates/bicep/azureSql.provisionServer.orchestration.bicep +0 -14
  446. package/templates/bicep/identity.provision.module.bicep +0 -15
  447. package/templates/bicep/identity.provision.orchestration.bicep +0 -14
  448. package/templates/bicep/keyVault.provision.module.bicep +0 -57
  449. package/templates/bicep/keyVault.provision.orchestration.bicep +0 -15
  450. package/templates/plugins/resource/apiconnector/package.json +0 -5
  451. package/templates/plugins/resource/apiconnector/sample/footerComment.template +0 -20
  452. package/templates/plugins/resource/apiconnector/sample/headerComment.template +0 -52
  453. package/templates/plugins/resource/apiconnector/sample/js/aad.template +0 -31
  454. package/templates/plugins/resource/apiconnector/sample/js/apikey.template +0 -19
  455. package/templates/plugins/resource/apiconnector/sample/js/basic.template +0 -14
  456. package/templates/plugins/resource/apiconnector/sample/js/cert.template +0 -17
  457. package/templates/plugins/resource/apiconnector/sample/js/custom.template +0 -39
  458. package/templates/plugins/resource/apiconnector/sample/ts/aad.template +0 -36
  459. package/templates/plugins/resource/apiconnector/sample/ts/apikey.template +0 -16
  460. package/templates/plugins/resource/apiconnector/sample/ts/basic.template +0 -14
  461. package/templates/plugins/resource/apiconnector/sample/ts/cert.template +0 -19
  462. package/templates/plugins/resource/apiconnector/sample/ts/custom.template +0 -42
  463. package/templates/plugins/resource/identity/bicep/identityProvision.template.bicep +0 -15
  464. package/templates/plugins/resource/identity/bicep/provision.template.bicep +0 -14
  465. package/templates/plugins/resource/identity/parameters.json +0 -12
  466. package/templates/plugins/resource/identity/template.json +0 -28
  467. package/templates/plugins/resource/keyvault/bicep/keyVaultProvision.template.bicep +0 -57
  468. package/templates/plugins/resource/keyvault/bicep/provision.template.bicep +0 -15
  469. package/templates/plugins/resource/simpleauth/SimpleAuth.zip +0 -0
  470. package/templates/plugins/resource/simpleauth/bicep/config.template.bicep +0 -12
  471. package/templates/plugins/resource/simpleauth/bicep/provision.template.bicep +0 -14
  472. package/templates/plugins/resource/simpleauth/bicep/simpleAuthConfiguration.template.bicep +0 -62
  473. package/templates/plugins/resource/simpleauth/bicep/simpleAuthProvision.template.bicep +0 -51
  474. package/templates/plugins/resource/simpleauth/version.txt +0 -2
  475. package/templates/plugins/resource/spfx/solution/README.md +0 -82
  476. package/templates/plugins/resource/spfx/solution/manifest.local.template.json +0 -62
  477. package/templates/plugins/resource/spfx/solution/manifest_multi_env.json +0 -63
  478. package/templates/plugins/resource/spfx/solution/rootREADME.md +0 -13
  479. package/templates/plugins/resource/sql/bicep/newDatabase.orchestration.template.bicep +0 -5
  480. package/templates/plugins/resource/sql/bicep/newDatabaseProvision.template.bicep +0 -15
  481. package/templates/plugins/resource/sql/bicep/parameters.json +0 -4
  482. package/templates/plugins/resource/sql/bicep/provision.template.bicep +0 -14
  483. package/templates/plugins/resource/sql/bicep/sqlProvision.template.bicep +0 -44
  484. /package/build/component/{resource → generator}/spfx/depsChecker/dependencyChecker.js +0 -0
  485. /package/build/component/generator/{spfxGenerator.d.ts → spfx/spfxGenerator.d.ts} +0 -0
  486. /package/build/component/{resource → generator}/spfx/utils/question-helper.d.ts +0 -0
  487. /package/build/component/{resource → generator}/spfx/utils/question-helper.js +0 -0
  488. /package/build/component/{resource → generator}/spfx/utils/telemetry-helper.d.ts +0 -0
  489. /package/build/component/{resource → generator}/spfx/utils/telemetry-helper.js +0 -0
  490. /package/build/component/{resource → generator}/spfx/utils/telemetryEvents.d.ts +0 -0
  491. /package/build/component/{resource → generator}/spfx/utils/telemetryEvents.js +0 -0
  492. /package/build/component/{resource → generator}/spfx/utils/utils.d.ts +0 -0
  493. /package/build/component/{resource → generator}/spfx/utils/utils.js +0 -0
@@ -1,21 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.forEachFileAndDir = void 0;
4
- const tslib_1 = require("tslib");
5
- const klaw_1 = tslib_1.__importDefault(require("klaw"));
6
- async function forEachFileAndDir(root, callback, filter) {
7
- await new Promise((resolve, reject) => {
8
- const stream = klaw_1.default(root, { filter: filter });
9
- stream
10
- .on("data", (item) => {
11
- if (callback(item.path, item.stats)) {
12
- stream.emit("close");
13
- }
14
- })
15
- .on("end", () => resolve({}))
16
- .on("error", (err) => reject(err))
17
- .on("close", () => resolve({}));
18
- });
19
- }
20
- exports.forEachFileAndDir = forEachFileAndDir;
21
- //# sourceMappingURL=dir-walk.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"dir-walk.js","sourceRoot":"","sources":["../../../../src/component/resource/azureAppService/dir-walk.ts"],"names":[],"mappings":";;;;AAGA,wDAAwB;AAEjB,KAAK,UAAU,iBAAiB,CACrC,IAAY,EACZ,QAA+D,EAC/D,MAAsC;IAEtC,MAAM,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE;QACpC,MAAM,MAAM,GAAgB,cAAI,CAAC,IAAI,EAAE,EAAE,MAAM,EAAE,MAAM,EAAE,CAAC,CAAC;QAC3D,MAAM;aACH,EAAE,CAAC,MAAM,EAAE,CAAC,IAAI,EAAE,EAAE;YACnB,IAAI,QAAQ,CAAC,IAAI,CAAC,IAAI,EAAE,IAAI,CAAC,KAAK,CAAC,EAAE;gBACnC,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;aACtB;QACH,CAAC,CAAC;aACD,EAAE,CAAC,KAAK,EAAE,GAAG,EAAE,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC;aAC5B,EAAE,CAAC,OAAO,EAAE,CAAC,GAAG,EAAE,EAAE,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;aACjC,EAAE,CAAC,OAAO,EAAE,GAAG,EAAE,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC,CAAC;IACpC,CAAC,CAAC,CAAC;AACL,CAAC;AAjBD,8CAiBC"}
@@ -1,15 +0,0 @@
1
- import { ContextV3, InputsWithProjectPath, Result, FxError, Effect } from "@microsoft/teamsfx-api";
2
- export declare class ConfigureActionImplement {
3
- static readonly source = "SQL";
4
- static readonly stage = "post-provision";
5
- static readonly telemetryComponentName = "fx-resource-azure-sql";
6
- static readonly progressTitle = "Configuring SQL";
7
- static readonly progressMessage: {
8
- addAadmin: string;
9
- addUser: string;
10
- };
11
- static readonly loggerPrefix = "[SQL Component]";
12
- static readonly logFormatter: (message: string) => string;
13
- static execute(context: ContextV3, inputs: InputsWithProjectPath): Promise<Result<Effect[], FxError>>;
14
- }
15
- //# sourceMappingURL=configure.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"configure.d.ts","sourceRoot":"","sources":["../../../../../src/component/resource/azureSql/actions/configure.ts"],"names":[],"mappings":"AAIA,OAAO,EACL,SAAS,EACT,qBAAqB,EAIrB,MAAM,EACN,OAAO,EACP,MAAM,EACP,MAAM,wBAAwB,CAAC;AAehC,qBAAa,wBAAwB;IACnC,MAAM,CAAC,QAAQ,CAAC,MAAM,SAAS;IAC/B,MAAM,CAAC,QAAQ,CAAC,KAAK,oBAAoB;IACzC,MAAM,CAAC,QAAQ,CAAC,sBAAsB,2BAA2B;IACjE,MAAM,CAAC,QAAQ,CAAC,aAAa,qBAAqB;IAClD,MAAM,CAAC,QAAQ,CAAC,eAAe;;;MAG7B;IACF,MAAM,CAAC,QAAQ,CAAC,YAAY,qBAAqB;IACjD,MAAM,CAAC,QAAQ,CAAC,YAAY,YAAa,MAAM,YACS;WAiB3C,OAAO,CAClB,OAAO,EAAE,SAAS,EAClB,MAAM,EAAE,qBAAqB,GAC5B,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,EAAE,OAAO,CAAC,CAAC;CAuEtC"}
@@ -1,92 +0,0 @@
1
- "use strict";
2
- // Copyright (c) Microsoft Corporation.
3
- // Licensed under the MIT license.
4
- Object.defineProperty(exports, "__esModule", { value: true });
5
- exports.ConfigureActionImplement = void 0;
6
- const tslib_1 = require("tslib");
7
- const lib_1 = require("@feathersjs/hooks/lib");
8
- const teamsfx_api_1 = require("@microsoft/teamsfx-api");
9
- const typedi_1 = tslib_1.__importDefault(require("typedi"));
10
- const constants_1 = require("../../../constants");
11
- const logger_1 = require("../../../middleware/logger");
12
- const progressbar_1 = require("../../../middleware/progressbar");
13
- const runWithCatchError_1 = require("../../../middleware/runWithCatchError");
14
- const telemetry_1 = require("../../../middleware/telemetry");
15
- const management_1 = require("../clients/management");
16
- const sql_1 = require("../clients/sql");
17
- const config_1 = require("../config");
18
- const constants_2 = require("../constants");
19
- const errors_1 = require("../errors");
20
- const common_1 = require("../utils/common");
21
- const utils_1 = require("./utils");
22
- class ConfigureActionImplement {
23
- static async execute(context, inputs) {
24
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
25
- const ctx = context;
26
- const actionContext = context;
27
- const solutionConfig = ctx.envInfo.state.solution;
28
- const state = ctx.envInfo.state[constants_1.ComponentNames.AzureSQL];
29
- const sqlMgrConfig = config_1.LoadManagementConfig(state);
30
- const sqlMgrClient = await management_1.ManagementClient.create(ctx.tokenProvider.azureAccountProvider, sqlMgrConfig);
31
- (_a = actionContext.logger) === null || _a === void 0 ? void 0 : _a.info(constants_2.Message.addFirewall);
32
- await sqlMgrClient.addLocalFirewallRule();
33
- const adminInfo = await utils_1.UtilFunctions.parseLoginToken(ctx.tokenProvider.azureAccountProvider);
34
- await ((_b = actionContext.progressBar) === null || _b === void 0 ? void 0 : _b.next(ConfigureActionImplement.progressMessage.addAadmin));
35
- const existAdmin = await utils_1.UtilFunctions.CheckAndSetAadAdmin(sqlMgrClient, adminInfo.name, adminInfo.objectId, solutionConfig.tenantId);
36
- if (existAdmin) {
37
- (_c = actionContext.logger) === null || _c === void 0 ? void 0 : _c.info(constants_2.Message.skipAddAadAdmin);
38
- }
39
- else {
40
- (_d = actionContext.logger) === null || _d === void 0 ? void 0 : _d.info(constants_2.Message.addSqlAadAdmin);
41
- }
42
- // update outputKeys
43
- const databases = config_1.loadDatabases(state);
44
- const resource = typedi_1.default.get(constants_1.ComponentNames.AzureSQL);
45
- resource.finalOutputKeys.push(...Object.keys(databases));
46
- const identity = utils_1.UtilFunctions.getIdentity(ctx);
47
- const sqlConfig = config_1.LoadSqlConfig(state, identity);
48
- const skipAddingUser = await utils_1.UtilFunctions.getSkipAddingUser(ctx.envInfo.config, ctx.tokenProvider.azureAccountProvider);
49
- (_e = actionContext.telemetry) === null || _e === void 0 ? void 0 : _e.addProperty(constants_2.Telemetry.properties.skipAddingUser, skipAddingUser ? constants_1.TelemetryConstants.values.yes : constants_1.TelemetryConstants.values.no);
50
- (_f = actionContext.telemetry) === null || _f === void 0 ? void 0 : _f.addProperty(constants_2.Telemetry.properties.dbCount, sqlConfig.databases.length.toString());
51
- if (!skipAddingUser) {
52
- if (adminInfo.userType === common_1.UserType.User) {
53
- await ((_g = actionContext.progressBar) === null || _g === void 0 ? void 0 : _g.next(ConfigureActionImplement.progressMessage.addUser));
54
- const sqlClient = await sql_1.SqlClient.create(ctx.tokenProvider.azureAccountProvider, sqlConfig);
55
- (_h = actionContext.logger) === null || _h === void 0 ? void 0 : _h.info(constants_2.Message.addDatabaseUser(identity));
56
- await utils_1.UtilFunctions.addDatabaseUser(ctx.logProvider, sqlClient, sqlMgrClient);
57
- }
58
- else {
59
- const message = errors_1.ErrorMessage.ServicePrincipalWarning(identity, sqlConfig.databases.join(","));
60
- (_j = actionContext.logger) === null || _j === void 0 ? void 0 : _j.warning(`${message}. You can follow ${constants_2.HelpLinks.default} to add database user ${identity}`);
61
- }
62
- }
63
- else {
64
- (_k = actionContext.logger) === null || _k === void 0 ? void 0 : _k.warning(`Skip adding database user. You can follow ${constants_2.HelpLinks.default} to add database user ${identity}`);
65
- }
66
- await sqlMgrClient.deleteLocalFirewallRule();
67
- return teamsfx_api_1.ok([{ type: "service", name: "azure", remarks: "configure azure-sql" }]);
68
- }
69
- }
70
- ConfigureActionImplement.source = "SQL";
71
- ConfigureActionImplement.stage = "post-provision";
72
- ConfigureActionImplement.telemetryComponentName = "fx-resource-azure-sql";
73
- ConfigureActionImplement.progressTitle = "Configuring SQL";
74
- ConfigureActionImplement.progressMessage = {
75
- addAadmin: "Configure aad admin for SQL",
76
- addUser: "Configure database user",
77
- };
78
- ConfigureActionImplement.loggerPrefix = "[SQL Component]";
79
- ConfigureActionImplement.logFormatter = (message) => `${ConfigureActionImplement.loggerPrefix} ${message}`;
80
- tslib_1.__decorate([
81
- lib_1.hooks([
82
- telemetry_1.TelemetryMW(telemetry_1.ActionTelemetryImplement.bind(null, ConfigureActionImplement.stage, ConfigureActionImplement.telemetryComponentName)),
83
- runWithCatchError_1.RunWithCatchErrorMW(ConfigureActionImplement.source, runWithCatchError_1.ActionErrorHandler),
84
- progressbar_1.ProgressBarMW(ConfigureActionImplement.progressTitle, Object.keys(ConfigureActionImplement.progressMessage).length),
85
- logger_1.LoggerMW(logger_1.ActionLogger.bind(null, ConfigureActionImplement.logFormatter)),
86
- ]),
87
- tslib_1.__metadata("design:type", Function),
88
- tslib_1.__metadata("design:paramtypes", [Object, Object]),
89
- tslib_1.__metadata("design:returntype", Promise)
90
- ], ConfigureActionImplement, "execute", null);
91
- exports.ConfigureActionImplement = ConfigureActionImplement;
92
- //# sourceMappingURL=configure.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"configure.js","sourceRoot":"","sources":["../../../../../src/component/resource/azureSql/actions/configure.ts"],"names":[],"mappings":";AAAA,uCAAuC;AACvC,kCAAkC;;;;AAElC,+CAA8C;AAC9C,wDASgC;AAChC,4DAA+B;AAC/B,kDAAwE;AACxE,uDAAoE;AACpE,iEAAgE;AAChE,6EAAgG;AAChG,6DAAsF;AAEtF,sDAAyD;AACzD,wCAA2C;AAC3C,sCAA+E;AAC/E,4CAA6D;AAC7D,sCAAyC;AACzC,4CAA2C;AAC3C,mCAAwC;AACxC,MAAa,wBAAwB;IA4BnC,MAAM,CAAC,KAAK,CAAC,OAAO,CAClB,OAAkB,EAClB,MAA6B;;QAE7B,MAAM,GAAG,GAAG,OAA4B,CAAC;QACzC,MAAM,aAAa,GAAG,OAAwB,CAAC;QAC/C,MAAM,cAAc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AAC,IAAI,EAAE,wBAAwB,CAAC,YAAY,CAAC,CAAC;KACzE,CAAC;;;;6CA0ED;AArGH,4DAsGC"}
@@ -1,10 +0,0 @@
1
- import { ContextV3, InputsWithProjectPath, Effect, FxError, Result } from "@microsoft/teamsfx-api";
2
- export declare class ProvisionActionImplement {
3
- static readonly source = "SQL";
4
- static readonly stage = "pre-provision";
5
- static readonly telemetryComponentName = "fx-resource-azure-sql";
6
- static readonly loggerPrefix = "[SQL Component]";
7
- static readonly logFormatter: (message: string) => string;
8
- static execute(context: ContextV3, inputs: InputsWithProjectPath): Promise<Result<Effect[], FxError>>;
9
- }
10
- //# sourceMappingURL=provision.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"provision.d.ts","sourceRoot":"","sources":["../../../../../src/component/resource/azureSql/actions/provision.ts"],"names":[],"mappings":"AAIA,OAAO,EACL,SAAS,EACT,qBAAqB,EAGrB,MAAM,EACN,OAAO,EACP,MAAM,EAEP,MAAM,wBAAwB,CAAC;AAYhC,qBAAa,wBAAwB;IACnC,MAAM,CAAC,QAAQ,CAAC,MAAM,SAAS;IAC/B,MAAM,CAAC,QAAQ,CAAC,KAAK,mBAAmB;IACxC,MAAM,CAAC,QAAQ,CAAC,sBAAsB,2BAA2B;IACjE,MAAM,CAAC,QAAQ,CAAC,YAAY,qBAAqB;IACjD,MAAM,CAAC,QAAQ,CAAC,YAAY,YAAa,MAAM,YACS;WAa3C,OAAO,CAClB,OAAO,EAAE,SAAS,EAClB,MAAM,EAAE,qBAAqB,GAC5B,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,EAAE,OAAO,CAAC,CAAC;CA+BtC"}
@@ -1,63 +0,0 @@
1
- "use strict";
2
- // Copyright (c) Microsoft Corporation.
3
- // Licensed under the MIT license.
4
- Object.defineProperty(exports, "__esModule", { value: true });
5
- exports.ProvisionActionImplement = void 0;
6
- const tslib_1 = require("tslib");
7
- const lib_1 = require("@feathersjs/hooks/lib");
8
- const teamsfx_api_1 = require("@microsoft/teamsfx-api");
9
- const constants_1 = require("../../../constants");
10
- const logger_1 = require("../../../middleware/logger");
11
- const runWithCatchError_1 = require("../../../middleware/runWithCatchError");
12
- const telemetry_1 = require("../../../middleware/telemetry");
13
- const management_1 = require("../clients/management");
14
- const config_1 = require("../config");
15
- const constants_2 = require("../constants");
16
- const errors_1 = require("../errors");
17
- const questions_1 = require("../questions");
18
- const results_1 = require("../results");
19
- class ProvisionActionImplement {
20
- static async execute(context, inputs) {
21
- var _a;
22
- var _b, _c;
23
- const ctx = context;
24
- const state = ((_a = (_b = ctx.envInfo.state)[_c = constants_1.ComponentNames.AzureSQL]) !== null && _a !== void 0 ? _a : (_b[_c] = {}));
25
- config_1.removeDatabases(state);
26
- let shouldAsk;
27
- if (state.sqlResourceId) {
28
- const sqlMgrConfig = config_1.LoadManagementConfig(state);
29
- const sqlMgrClient = await management_1.ManagementClient.create(ctx.tokenProvider.azureAccountProvider, sqlMgrConfig);
30
- shouldAsk = !(await sqlMgrClient.existAzureSQL());
31
- }
32
- else {
33
- shouldAsk = true;
34
- }
35
- if (shouldAsk) {
36
- const node = questions_1.buildQuestionNode();
37
- const res = await teamsfx_api_1.traverse(node, inputs, ctx.userInteraction);
38
- if (res.isErr()) {
39
- throw results_1.SqlResultFactory.UserError(errors_1.ErrorMessage.SqlAskInputError.name, errors_1.ErrorMessage.SqlAskInputError.message(), res.error);
40
- }
41
- state.admin = inputs[constants_2.Constants.questionKey.adminName];
42
- state.adminPassword = inputs[constants_2.Constants.questionKey.adminPassword];
43
- }
44
- return teamsfx_api_1.ok([{ type: "service", name: "azure", remarks: "configure azure-sql" }]);
45
- }
46
- }
47
- ProvisionActionImplement.source = "SQL";
48
- ProvisionActionImplement.stage = "pre-provision";
49
- ProvisionActionImplement.telemetryComponentName = "fx-resource-azure-sql";
50
- ProvisionActionImplement.loggerPrefix = "[SQL Component]";
51
- ProvisionActionImplement.logFormatter = (message) => `${ProvisionActionImplement.loggerPrefix} ${message}`;
52
- tslib_1.__decorate([
53
- lib_1.hooks([
54
- telemetry_1.TelemetryMW(telemetry_1.ActionTelemetryImplement.bind(null, ProvisionActionImplement.stage, ProvisionActionImplement.telemetryComponentName)),
55
- runWithCatchError_1.RunWithCatchErrorMW(ProvisionActionImplement.source, runWithCatchError_1.ActionErrorHandler),
56
- logger_1.LoggerMW(logger_1.ActionLogger.bind(null, ProvisionActionImplement.logFormatter)),
57
- ]),
58
- tslib_1.__metadata("design:type", Function),
59
- tslib_1.__metadata("design:paramtypes", [Object, Object]),
60
- tslib_1.__metadata("design:returntype", Promise)
61
- ], ProvisionActionImplement, "execute", null);
62
- exports.ProvisionActionImplement = ProvisionActionImplement;
63
- //# sourceMappingURL=provision.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"provision.js","sourceRoot":"","sources":["../../../../../src/component/resource/azureSql/actions/provision.ts"],"names":[],"mappings":";AAAA,uCAAuC;AACvC,kCAAkC;;;;AAElC,+CAA8C;AAC9C,wDASgC;AAChC,kDAAoD;AACpD,uDAAoE;AACpE,6EAAgG;AAChG,6DAAsF;AACtF,sDAAyD;AACzD,sCAAkE;AAClE,4CAAyC;AACzC,sCAAyC;AACzC,4CAAiD;AACjD,wCAA8C;AAE9C,MAAa,wBAAwB;IAmBnC,MAAM,CAAC,KAAK,CAAC,OAAO,CAClB,OAAkB,EAClB,MAA6B;;;QAE7B,MAAM,GAAG,GAAG,OAA4B,CAAC;QACzC,MAAM,KAAK,GAAG,aAAC,GAAG,CAAC,OAAO,CAAC,KAAK,OAAC,0BAAc,CAAC,QAAQ,8CAAM,EAAE,EAAC,CAAC;QAClE,wBAAe,CAAC,KAAK,CAAC,CAAC;QACvB,IAAI,SAAS,CAAC;QACd,IAAI,KAAK,CAAC,aAAa,EAAE;YACvB,MAAM,YAAY,GAAG,6BAAoB,CAAC,KAAK,CAAC,CAAC;YACjD,MAAM,YAAY,GAAG,MAAM,6BAAgB,CAAC,MAAM,CAChD,GAAG,CAAC,aAAa,CAAC,oBAAoB,EAC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AAM,EAAE,sCAAkB,CAAC;QACxE,iBAAQ,CAAC,qBAAY,CAAC,IAAI,CAAC,IAAI,EAAE,wBAAwB,CAAC,YAAY,CAAC,CAAC;KACzE,CAAC;;;;6CAkCD;AApDH,4DAqDC"}
@@ -1,12 +0,0 @@
1
- import { ResourceContextV3, AzureAccountProvider, LogProvider, Json } from "@microsoft/teamsfx-api";
2
- import { ManagementClient } from "../clients/management";
3
- import { SqlClient } from "../clients/sql";
4
- import { TokenInfo } from "../utils/common";
5
- export declare class UtilFunctions {
6
- static CheckAndSetAadAdmin(client: ManagementClient, aadAdmin: string, objectId: string, tenantId: string): Promise<boolean>;
7
- static parseLoginToken(azureAccountProvider: AzureAccountProvider): Promise<TokenInfo>;
8
- static getSkipAddingUser(config: Json, azureAccountProvider: AzureAccountProvider): Promise<boolean>;
9
- static getIdentity(ctx: ResourceContextV3): string;
10
- static addDatabaseUser(logProvider: LogProvider, sqlClient: SqlClient, managementClient: ManagementClient): Promise<void>;
11
- }
12
- //# sourceMappingURL=utils.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../../../src/component/resource/azureSql/actions/utils.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,iBAAiB,EAAE,oBAAoB,EAAE,WAAW,EAAE,IAAI,EAAE,MAAM,wBAAwB,CAAC;AAGpG,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AACzD,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAI3C,OAAO,EAAc,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAExD,qBAAa,aAAa;WACX,mBAAmB,CAC9B,MAAM,EAAE,gBAAgB,EACxB,QAAQ,EAAE,MAAM,EAChB,QAAQ,EAAE,MAAM,EAChB,QAAQ,EAAE,MAAM,GACf,OAAO,CAAC,OAAO,CAAC;WAQN,eAAe,CAAC,oBAAoB,EAAE,oBAAoB,GAAG,OAAO,CAAC,SAAS,CAAC;WAgB/E,iBAAiB,CAC5B,MAAM,EAAE,IAAI,EACZ,oBAAoB,EAAE,oBAAoB,GACzC,OAAO,CAAC,OAAO,CAAC;IASnB,MAAM,CAAC,WAAW,CAAC,GAAG,EAAE,iBAAiB,GAAG,MAAM;WAarC,eAAe,CAC1B,WAAW,EAAE,WAAW,EACxB,SAAS,EAAE,SAAS,EACpB,gBAAgB,EAAE,gBAAgB,GACjC,OAAO,CAAC,IAAI,CAAC;CA+BjB"}
@@ -1,82 +0,0 @@
1
- "use strict";
2
- // Copyright (c) Microsoft Corporation.
3
- // Licensed under the MIT license.
4
- Object.defineProperty(exports, "__esModule", { value: true });
5
- exports.UtilFunctions = void 0;
6
- const tools_1 = require("../../../../common/tools");
7
- const constants_1 = require("../../../constants");
8
- const sql_1 = require("../clients/sql");
9
- const constants_2 = require("../constants");
10
- const errors_1 = require("../errors");
11
- const results_1 = require("../results");
12
- const common_1 = require("../utils/common");
13
- class UtilFunctions {
14
- static async CheckAndSetAadAdmin(client, aadAdmin, objectId, tenantId) {
15
- const existAdmin = await client.existAadAdmin(aadAdmin);
16
- if (!existAdmin) {
17
- await client.addAADadmin(tenantId, objectId, aadAdmin);
18
- }
19
- return existAdmin;
20
- }
21
- static async parseLoginToken(azureAccountProvider) {
22
- // get login user info to set aad admin in sql
23
- try {
24
- const credential = await azureAccountProvider.getIdentityCredentialAsync();
25
- const token = await credential.getToken(tools_1.AzureScopes);
26
- const accessToken = token === null || token === void 0 ? void 0 : token.token;
27
- return common_1.parseToken(accessToken);
28
- }
29
- catch (error) {
30
- throw results_1.SqlResultFactory.SystemError(errors_1.ErrorMessage.SqlUserInfoError.name, errors_1.ErrorMessage.SqlUserInfoError.message(), error);
31
- }
32
- }
33
- static async getSkipAddingUser(config, azureAccountProvider) {
34
- const skipAddingUser = config[constants_2.Constants.skipAddingSqlUser];
35
- if (skipAddingUser === undefined) {
36
- return (await (azureAccountProvider === null || azureAccountProvider === void 0 ? void 0 : azureAccountProvider.getIdentityCredentialAsync())) ? false : true;
37
- }
38
- else {
39
- return skipAddingUser;
40
- }
41
- }
42
- static getIdentity(ctx) {
43
- const config = ctx.envInfo.state[constants_1.ComponentNames.Identity];
44
- const identity = config[constants_2.Constants.identityName];
45
- if (!identity) {
46
- const error = results_1.SqlResultFactory.SystemError(errors_1.ErrorMessage.SqlGetConfigError.name, errors_1.ErrorMessage.SqlGetConfigError.message(constants_2.Constants.identityPlugin, constants_2.Constants.identityName));
47
- throw error;
48
- }
49
- return identity;
50
- }
51
- static async addDatabaseUser(logProvider, sqlClient, managementClient) {
52
- let retryCount = 0;
53
- const databaseWithUser = {};
54
- sqlClient.config.databases.forEach((element) => {
55
- databaseWithUser[element] = false;
56
- });
57
- while (true) {
58
- try {
59
- for (const database in databaseWithUser) {
60
- if (!databaseWithUser[database]) {
61
- await sqlClient.addDatabaseUser(database);
62
- databaseWithUser[database] = true;
63
- }
64
- }
65
- return;
66
- }
67
- catch (error) {
68
- if (!sql_1.SqlClient.isFireWallError(error === null || error === void 0 ? void 0 : error.innerError) ||
69
- retryCount >= constants_2.Constants.maxRetryTimes) {
70
- throw error;
71
- }
72
- else {
73
- retryCount++;
74
- logProvider.warning(`[${constants_2.Constants.pluginName}] Retry adding new firewall rule to access azure sql, because the local IP address has changed after added firewall rule for it. [Retry time: ${retryCount}]`);
75
- await managementClient.addLocalFirewallRule();
76
- }
77
- }
78
- }
79
- }
80
- }
81
- exports.UtilFunctions = UtilFunctions;
82
- //# sourceMappingURL=utils.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../../../src/component/resource/azureSql/actions/utils.ts"],"names":[],"mappings":";AAAA,uCAAuC;AACvC,kCAAkC;;;AAGlC,oDAAuD;AACvD,kDAAoD;AAEpD,wCAA2C;AAC3C,4CAAyC;AACzC,sCAAyC;AACzC,wCAA8C;AAC9C,4CAAwD;AAExD,MAAa,aAAa;IACxB,MAAM,CAAC,KAAK,CAAC,mBAAmB,CAC9B,MAAwB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AAW,CAAC,OAAO,CACjB,IAAI,qBAAS,CAAC,UAAU,iJAAiJ,UAAU,GAAG,CACvL,CAAC;oBACF,MAAM,gBAAgB,CAAC,oBAAoB,EAAE,CAAC;iBAC/C;aACF;SACF;IACH,CAAC;CACF;AA1FD,sCA0FC"}
@@ -1,24 +0,0 @@
1
- import { FxError, Result, CloudResource, ContextV3, InputsWithProjectPath, Bicep, ResourceContextV3 } from "@microsoft/teamsfx-api";
2
- import "reflect-metadata";
3
- export declare class AzureSqlResource implements CloudResource {
4
- readonly name: string;
5
- readonly outputs: {
6
- sqlResourceId: {
7
- key: string;
8
- bicepVariable: string;
9
- };
10
- sqlEndpoint: {
11
- key: string;
12
- bicepVariable: string;
13
- };
14
- databaseName: {
15
- key: string;
16
- bicepVariable: string;
17
- };
18
- };
19
- readonly finalOutputKeys: string[];
20
- generateBicep(context: ContextV3, inputs: InputsWithProjectPath): Promise<Result<Bicep[], FxError>>;
21
- provision(context: ResourceContextV3, inputs: InputsWithProjectPath): Promise<Result<undefined, FxError>>;
22
- configure(context: ResourceContextV3, inputs: InputsWithProjectPath): Promise<Result<undefined, FxError>>;
23
- }
24
- //# sourceMappingURL=azureSql.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"azureSql.d.ts","sourceRoot":"","sources":["../../../../src/component/resource/azureSql/azureSql.ts"],"names":[],"mappings":"AAGA,OAAO,EACL,OAAO,EAEP,MAAM,EACN,aAAa,EACb,SAAS,EACT,qBAAqB,EACrB,KAAK,EACL,iBAAiB,EAElB,MAAM,wBAAwB,CAAC;AAChC,OAAO,kBAAkB,CAAC;AAU1B,qBACa,gBAAiB,YAAW,aAAa;IACpD,QAAQ,CAAC,IAAI,SAA2B;IACxC,QAAQ,CAAC,OAAO;;;;;;;;;;;;;MAAmB;IACnC,QAAQ,CAAC,eAAe,WAAiD;IACnE,aAAa,CACjB,OAAO,EAAE,SAAS,EAClB,MAAM,EAAE,qBAAqB,GAC5B,OAAO,CAAC,MAAM,CAAC,KAAK,EAAE,EAAE,OAAO,CAAC,CAAC;IA+B9B,SAAS,CACb,OAAO,EAAE,iBAAiB,EAC1B,MAAM,EAAE,qBAAqB,GAC5B,OAAO,CAAC,MAAM,CAAC,SAAS,EAAE,OAAO,CAAC,CAAC;IAQhC,SAAS,CACb,OAAO,EAAE,iBAAiB,EAC1B,MAAM,EAAE,qBAAqB,GAC5B,OAAO,CAAC,MAAM,CAAC,SAAS,EAAE,OAAO,CAAC,CAAC;CAQvC"}
@@ -1,75 +0,0 @@
1
- "use strict";
2
- // Copyright (c) Microsoft Corporation.
3
- // Licensed under the MIT license.
4
- Object.defineProperty(exports, "__esModule", { value: true });
5
- exports.AzureSqlResource = void 0;
6
- const tslib_1 = require("tslib");
7
- const teamsfx_api_1 = require("@microsoft/teamsfx-api");
8
- require("reflect-metadata");
9
- const typedi_1 = require("typedi");
10
- const constants_1 = require("../../constants");
11
- const configure_1 = require("./actions/configure");
12
- const provision_1 = require("./actions/provision");
13
- const path = tslib_1.__importStar(require("path"));
14
- const fs_extra_1 = tslib_1.__importDefault(require("fs-extra"));
15
- const folder_1 = require("../../../folder");
16
- const tools_1 = require("../../../common/tools");
17
- const utils_1 = require("../../utils");
18
- let AzureSqlResource = class AzureSqlResource {
19
- constructor() {
20
- this.name = constants_1.ComponentNames.AzureSQL;
21
- this.outputs = constants_1.AzureSqlOutputs;
22
- this.finalOutputKeys = ["sqlResourceId", "endpoint", "databaseName"];
23
- }
24
- async generateBicep(context, inputs) {
25
- const prefix = inputs.provisionType === "database"
26
- ? "azureSql.provisionDatabase"
27
- : "azureSql.provisionServer";
28
- const mPath = path.join(folder_1.getTemplatesFolder(), "bicep", `${prefix}.module.bicep`);
29
- const oPath = path.join(folder_1.getTemplatesFolder(), "bicep", `${prefix}.orchestration.bicep`);
30
- let module = await fs_extra_1.default.readFile(mPath, "utf-8");
31
- let orch = await fs_extra_1.default.readFile(oPath, "utf-8");
32
- const suffix = tools_1.getUuid().substring(0, 6);
33
- const compileCtx = {
34
- suffix: suffix,
35
- };
36
- if (inputs.provisionType === "database") {
37
- module = await tools_1.generateBicepFromFile(mPath, compileCtx);
38
- orch = await tools_1.generateBicepFromFile(oPath, compileCtx);
39
- }
40
- const bicep = {
41
- type: "bicep",
42
- Provision: {
43
- Modules: { azureSql: module },
44
- Orchestration: orch,
45
- },
46
- };
47
- if (inputs.provisionType === "server") {
48
- bicep.Parameters = await fs_extra_1.default.readJson(path.join(folder_1.getTemplatesFolder(), "bicep", "azureSql.parameters.json"));
49
- }
50
- return teamsfx_api_1.ok([bicep]);
51
- }
52
- async provision(context, inputs) {
53
- if (utils_1.isLocalEnv(context)) {
54
- return teamsfx_api_1.ok(undefined);
55
- }
56
- const res = await provision_1.ProvisionActionImplement.execute(context, inputs);
57
- if (res.isErr())
58
- return teamsfx_api_1.err(res.error);
59
- return teamsfx_api_1.ok(undefined);
60
- }
61
- async configure(context, inputs) {
62
- if (utils_1.isLocalEnv(context)) {
63
- return teamsfx_api_1.ok(undefined);
64
- }
65
- const res = await configure_1.ConfigureActionImplement.execute(context, inputs);
66
- if (res.isErr())
67
- return teamsfx_api_1.err(res.error);
68
- return teamsfx_api_1.ok(undefined);
69
- }
70
- };
71
- AzureSqlResource = tslib_1.__decorate([
72
- typedi_1.Service("azure-sql")
73
- ], AzureSqlResource);
74
- exports.AzureSqlResource = AzureSqlResource;
75
- //# sourceMappingURL=azureSql.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"azureSql.js","sourceRoot":"","sources":["../../../../src/component/resource/azureSql/azureSql.ts"],"names":[],"mappings":";AAAA,uCAAuC;AACvC,kCAAkC;;;;AAElC,wDAUgC;AAChC,4BAA0B;AAC1B,mCAAiC;AACjC,+CAAkE;AAClE,mDAA+D;AAC/D,mDAA+D;AAC/D,mDAA6B;AAC7B,gEAA0B;AAC1B,4CAAqD;AACrD,iDAAuE;AACvE,uCAAyC;AAEzC,IAAa,gBAAgB,GAA7B,MAAa,gBAAgB;IAA7B;QACW,SAAI,GAAG,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QAAQ,EAAE;YACrC,KAAK,CAAC,UAAU,GAAG,MAAM,kBAAE,CAAC,QAAQ,CAClC,IAAI,CAAC,IAAI,CAAC,2BAAkB,EAAE,EAAE,OAAO,EAAE,0BAA0B,CAAC,CACrE,CAAC;SACH;QACD,OAAO,gBAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC;IACrB,CAAC;IACD,KAAK,CAAC,SAAS,CACb,OAA0B,EAC1B,MAA6B;QAE7B,IAAI,kBAAU,CAAC,OAAO,CAAC,EAAE;YACvB,OAAO,gBAAE,CAAC,SAAS,CAAC,CAAC;SACtB;QACD,MAAM,GAAG,GAAG,MAAM,oCAAwB,CAAC,OAAO,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC;QACpE,IAAI,GAAG,CAAC,KAAK,EAAE;YAAE,OAAO,iBAAG,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;QACvC,OAAO,gBAAE,CAAC,SAAS,CAAC,CAAC;IACvB,CAAC;IACD,KAAK,CAAC,SAAS,CACb,OAA0B,EAC1B,MAA6B;QAE7B,IAAI,kBAAU,CAAC,OAAO,CAAC,EAAE;YACvB,OAAO,gBAAE,CAAC,SAAS,CAAC,CAAC;SACtB;QACD,MAAM,GAAG,GAAG,MAAM,oCAAwB,CAAC,OAAO,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC;QACpE,IAAI,GAAG,CAAC,KAAK,EAAE;YAAE,OAAO,iBAAG,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;QACvC,OAAO,gBAAE,CAAC,SAAS,CAAC,CAAC;IACvB,CAAC;CACF,CAAA;AA5DY,gBAAgB;IAD5B,gBAAO,CAAC,WAAW,CAAC;GACR,gBAAgB,CA4D5B;AA5DY,4CAAgB"}
@@ -1,18 +0,0 @@
1
- import { SqlManagementClient } from "@azure/arm-sql";
2
- import { AzureAccountProvider } from "@microsoft/teamsfx-api";
3
- import { ManagementConfig } from "../types";
4
- export declare class ManagementClient {
5
- manager: SqlManagementClient;
6
- config: ManagementConfig;
7
- totalFirewallRuleCount: number;
8
- private constructor();
9
- static create(azureAccountProvider: AzureAccountProvider, config: ManagementConfig): Promise<ManagementClient>;
10
- existAzureSQL(): Promise<boolean>;
11
- existAadAdmin(aadAdmin: string): Promise<boolean>;
12
- addAADadmin(tenantId: string, aadAdminObjectId: string, aadAdmin: string): Promise<void>;
13
- addLocalFirewallRule(): Promise<void>;
14
- deleteLocalFirewallRule(): Promise<void>;
15
- getRuleName(suffix: number): string;
16
- delay(s: number): Promise<void>;
17
- }
18
- //# sourceMappingURL=management.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"management.d.ts","sourceRoot":"","sources":["../../../../../src/component/resource/azureSql/clients/management.ts"],"names":[],"mappings":"AAGA,OAAO,EAIL,mBAAmB,EACpB,MAAM,gBAAgB,CAAC;AAKxB,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAC9D,OAAO,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAC;AAE5C,qBAAa,gBAAgB;IAC3B,OAAO,EAAE,mBAAmB,CAAC;IAC7B,MAAM,EAAE,gBAAgB,CAAC;IACzB,sBAAsB,SAAK;IAE3B,OAAO;WAKa,MAAM,CACxB,oBAAoB,EAAE,oBAAoB,EAC1C,MAAM,EAAE,gBAAgB,GACvB,OAAO,CAAC,gBAAgB,CAAC;IAMtB,aAAa,IAAI,OAAO,CAAC,OAAO,CAAC;IAoBjC,aAAa,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC;IAqBjD,WAAW,CAAC,QAAQ,EAAE,MAAM,EAAE,gBAAgB,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAuBxF,oBAAoB,IAAI,OAAO,CAAC,IAAI,CAAC;IAkCrC,uBAAuB,IAAI,OAAO,CAAC,IAAI,CAAC;IAqB9C,WAAW,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM;IAI7B,KAAK,CAAC,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;CAGtC"}
@@ -1,124 +0,0 @@
1
- "use strict";
2
- // Copyright (c) Microsoft Corporation.
3
- // Licensed under the MIT license.
4
- Object.defineProperty(exports, "__esModule", { value: true });
5
- exports.ManagementClient = void 0;
6
- const tslib_1 = require("tslib");
7
- const arm_sql_1 = require("@azure/arm-sql");
8
- const axios_1 = tslib_1.__importDefault(require("axios"));
9
- const errors_1 = require("../errors");
10
- const constants_1 = require("../constants");
11
- const results_1 = require("../results");
12
- class ManagementClient {
13
- constructor(manager, config) {
14
- this.totalFirewallRuleCount = 0;
15
- this.manager = manager;
16
- this.config = config;
17
- }
18
- static async create(azureAccountProvider, config) {
19
- const credential = await azureAccountProvider.getIdentityCredentialAsync();
20
- const manager = new arm_sql_1.SqlManagementClient(credential, config.azureSubscriptionId);
21
- return new ManagementClient(manager, config);
22
- }
23
- async existAzureSQL() {
24
- try {
25
- const result = await this.manager.servers.checkNameAvailability({
26
- name: this.config.sqlServer,
27
- type: "Microsoft.Sql/servers",
28
- });
29
- if (result.available) {
30
- return false;
31
- }
32
- else {
33
- return true;
34
- }
35
- }
36
- catch (error) {
37
- throw results_1.SqlResultFactory.SystemError(errors_1.ErrorMessage.SqlCheckError.name, errors_1.ErrorMessage.SqlCheckError.message(this.config.sqlEndpoint, error.message), error);
38
- }
39
- }
40
- async existAadAdmin(aadAdmin) {
41
- var e_1, _a;
42
- try {
43
- try {
44
- for (var _b = tslib_1.__asyncValues(this.manager.serverAzureADAdministrators
45
- .listByServer(this.config.resourceGroup, this.config.sqlServer)
46
- .byPage()), _c; _c = await _b.next(), !_c.done;) {
47
- const page = _c.value;
48
- for (const item of page) {
49
- if (item.login === aadAdmin) {
50
- return true;
51
- }
52
- }
53
- }
54
- }
55
- catch (e_1_1) { e_1 = { error: e_1_1 }; }
56
- finally {
57
- try {
58
- if (_c && !_c.done && (_a = _b.return)) await _a.call(_b);
59
- }
60
- finally { if (e_1) throw e_1.error; }
61
- }
62
- return false;
63
- }
64
- catch (error) {
65
- throw results_1.SqlResultFactory.UserError(errors_1.ErrorMessage.SqlCheckAdminError.name, errors_1.ErrorMessage.SqlCheckAdminError.message(this.config.sqlServer, error.message), error);
66
- }
67
- }
68
- async addAADadmin(tenantId, aadAdminObjectId, aadAdmin) {
69
- const model = {
70
- tenantId: tenantId,
71
- sid: aadAdminObjectId,
72
- login: aadAdmin,
73
- administratorType: arm_sql_1.KnownAdministratorType.ActiveDirectory,
74
- };
75
- try {
76
- await this.manager.serverAzureADAdministrators.beginCreateOrUpdateAndWait(this.config.resourceGroup, this.config.sqlServer, arm_sql_1.KnownAdministratorType.ActiveDirectory, model);
77
- }
78
- catch (error) {
79
- throw results_1.SqlResultFactory.UserError(errors_1.ErrorMessage.SqlAddAdminError.name, errors_1.ErrorMessage.SqlAddAdminError.message(aadAdmin, error.message), error);
80
- }
81
- }
82
- async addLocalFirewallRule() {
83
- try {
84
- const response = await axios_1.default.get(constants_1.Constants.echoIpAddress);
85
- const localIp = response.data;
86
- const partials = localIp.split(".");
87
- partials[2] = constants_1.Constants.ipBeginToken;
88
- partials[3] = constants_1.Constants.ipBeginToken;
89
- const startIp = partials.join(".");
90
- partials[2] = constants_1.Constants.ipEndToken;
91
- partials[3] = constants_1.Constants.ipEndToken;
92
- const endIp = partials.join(".");
93
- const model = {
94
- startIpAddress: startIp,
95
- endIpAddress: endIp,
96
- };
97
- const ruleName = this.getRuleName(this.totalFirewallRuleCount);
98
- await this.manager.firewallRules.createOrUpdate(this.config.resourceGroup, this.config.sqlServer, ruleName, model);
99
- this.totalFirewallRuleCount++;
100
- }
101
- catch (error) {
102
- throw results_1.SqlResultFactory.UserError(errors_1.ErrorMessage.SqlLocalFirwallError.name, errors_1.ErrorMessage.SqlLocalFirwallError.message(this.config.sqlEndpoint, error.message), error);
103
- }
104
- }
105
- async deleteLocalFirewallRule() {
106
- try {
107
- await Promise.all(Array.from(Array(this.totalFirewallRuleCount).keys()).map(async (i) => {
108
- const ruleName = this.getRuleName(i);
109
- await this.manager.firewallRules.delete(this.config.resourceGroup, this.config.sqlServer, ruleName);
110
- }));
111
- }
112
- catch (error) {
113
- throw results_1.SqlResultFactory.UserError(errors_1.ErrorMessage.SqlDeleteLocalFirwallError.name, errors_1.ErrorMessage.SqlDeleteLocalFirwallError.message(this.config.sqlEndpoint, error.message), error);
114
- }
115
- }
116
- getRuleName(suffix) {
117
- return constants_1.Constants.firewall.localRule + suffix;
118
- }
119
- async delay(s) {
120
- return new Promise((resolve) => setTimeout(resolve, s * 1000));
121
- }
122
- }
123
- exports.ManagementClient = ManagementClient;
124
- //# sourceMappingURL=management.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"management.js","sourceRoot":"","sources":["../../../../../src/component/resource/azureSql/clients/management.ts"],"names":[],"mappings":";AAAA,uCAAuC;AACvC,kCAAkC;;;;AAElC,4CAKwB;AACxB,0DAA0B;AAC1B,sCAAyC;AACzC,4CAAyC;AACzC,wCAA8C;AAI9C,MAAa,gBAAgB;IAK3B,YAAoB,OAA4B,EAAE,MAAwB;QAF1E,2BAAsB,GAAG,CAAC,CAAC;QAGzB,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;QACvB,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;IACvB,CAAC;IAEM,MAAM,CAAC,KAAK,CAAC,MAAM,CACxB,oBAA0C,EAC1C,MAAwB;QAExB,MAAM,UAAU,GAAG,MAAM,oBAAoB,CAAC,0BAA0B,EAAE,CAAC;QAC3E,MAAM,OAAO,GAAG,IAAI,6BAAmB,CAAC,UAAW,EAAE,MAAM,CAAC,mBAAmB,CAAC,CAAC;QACjF,OAAO,IAAI,gBAAgB,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC;IAC/C,CAAC;IAED,KAAK,CAAC,aAAa;QACjB,IAAI;YACF,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,qBAAqB,CAAC;gBAC9D,IAA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ACH,CAAC;IAED,WAAW,CAAC,MAAc;QACxB,OAAO,qBAAS,CAAC,QAAQ,CAAC,SAAS,GAAG,MAAM,CAAC;IAC/C,CAAC;IAED,KAAK,CAAC,KAAK,CAAC,CAAS;QACnB,OAAO,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,UAAU,CAAC,OAAO,EAAE,CAAC,GAAG,IAAI,CAAC,CAAC,CAAC;IACjE,CAAC;CACF;AAjJD,4CAiJC"}
@@ -1,13 +0,0 @@
1
- import { AzureAccountProvider } from "@microsoft/teamsfx-api";
2
- import { SqlConfig } from "../types";
3
- export declare class SqlClient {
4
- config: SqlConfig;
5
- token: string;
6
- private constructor();
7
- static create(azureAccountProvider: AzureAccountProvider, config: SqlConfig): Promise<SqlClient>;
8
- addDatabaseUser(database: string): Promise<void>;
9
- static initToken(azureAccountProvider: AzureAccountProvider, config: SqlConfig): Promise<string>;
10
- doQuery(cmd: string, database: string): Promise<any[]>;
11
- static isFireWallError(error: any): boolean;
12
- }
13
- //# sourceMappingURL=sql.d.ts.map