@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.
- package/build/common/local/localStateHelper.d.ts.map +1 -1
- package/build/common/local/localStateHelper.js.map +1 -1
- package/build/common/samples.d.ts.map +1 -1
- package/build/common/samples.js +2 -2
- package/build/common/samples.js.map +1 -1
- package/build/common/telemetry.d.ts +0 -13
- package/build/common/telemetry.d.ts.map +1 -1
- package/build/common/telemetry.js +0 -13
- package/build/common/telemetry.js.map +1 -1
- package/build/common/templates-config.json +2 -1
- package/build/common/tools.d.ts +1 -15
- package/build/common/tools.d.ts.map +1 -1
- package/build/common/tools.js +53 -138
- package/build/common/tools.js.map +1 -1
- package/build/component/code/appSettingUtils.d.ts +1 -2
- package/build/component/code/appSettingUtils.d.ts.map +1 -1
- package/build/component/code/appSettingUtils.js +1 -46
- package/build/component/code/appSettingUtils.js.map +1 -1
- package/build/component/constant/deployConstant.d.ts.map +1 -1
- package/build/component/constant/deployConstant.js.map +1 -1
- package/build/component/constants.d.ts +3 -210
- package/build/component/constants.d.ts.map +1 -1
- package/build/component/constants.js +7 -404
- package/build/component/constants.js.map +1 -1
- package/build/component/coordinator/index.d.ts +1 -0
- package/build/component/coordinator/index.d.ts.map +1 -1
- package/build/component/coordinator/index.js +21 -10
- package/build/component/coordinator/index.js.map +1 -1
- package/build/component/deployUtils.d.ts +1 -8
- package/build/component/deployUtils.d.ts.map +1 -1
- package/build/component/deployUtils.js +2 -98
- package/build/component/deployUtils.js.map +1 -1
- package/build/component/driver/add/addWebPart.js +3 -3
- package/build/component/driver/add/addWebPart.js.map +1 -1
- package/build/component/driver/deploy/azure/impl/AzureZipDeployImpl.js +9 -9
- package/build/component/driver/deploy/azure/impl/AzureZipDeployImpl.js.map +1 -1
- package/build/component/driver/interface/buildAndDeployArgs.d.ts +11 -11
- package/build/component/driver/interface/buildAndDeployArgs.d.ts.map +1 -1
- package/build/component/driver/script/scriptDriver.js +6 -6
- package/build/component/driver/script/scriptDriver.js.map +1 -1
- package/build/component/error.d.ts +0 -3
- package/build/component/error.d.ts.map +1 -1
- package/build/component/error.js +1 -11
- package/build/component/error.js.map +1 -1
- package/build/component/feature/cicd/cicd.d.ts +1 -2
- package/build/component/feature/cicd/cicd.d.ts.map +1 -1
- package/build/component/feature/cicd/cicd.js +2 -87
- package/build/component/feature/cicd/cicd.js.map +1 -1
- package/build/component/feature/sso.d.ts +0 -1
- package/build/component/feature/sso.d.ts.map +1 -1
- package/build/component/feature/sso.js +0 -1
- package/build/component/feature/sso.js.map +1 -1
- package/build/component/generator/generatorAction.d.ts.map +1 -1
- package/build/component/generator/generatorAction.js +1 -1
- package/build/component/generator/generatorAction.js.map +1 -1
- package/build/component/generator/spfx/depsChecker/dependencyChecker.d.ts +8 -0
- package/build/component/generator/spfx/depsChecker/dependencyChecker.d.ts.map +1 -0
- package/build/component/generator/spfx/depsChecker/dependencyChecker.js.map +1 -0
- package/build/component/{resource → generator}/spfx/depsChecker/generatorChecker.d.ts +1 -4
- package/build/component/generator/spfx/depsChecker/generatorChecker.d.ts.map +1 -0
- package/build/component/{resource → generator}/spfx/depsChecker/generatorChecker.js +0 -39
- package/build/component/generator/spfx/depsChecker/generatorChecker.js.map +1 -0
- package/build/component/{resource → generator}/spfx/depsChecker/yoChecker.d.ts +1 -4
- package/build/component/generator/spfx/depsChecker/yoChecker.d.ts.map +1 -0
- package/build/component/{resource → generator}/spfx/depsChecker/yoChecker.js +0 -33
- package/build/component/generator/spfx/depsChecker/yoChecker.js.map +1 -0
- package/build/component/generator/spfx/error.d.ts +8 -0
- package/build/component/generator/spfx/error.d.ts.map +1 -0
- package/build/component/generator/spfx/error.js +55 -0
- package/build/component/generator/spfx/error.js.map +1 -0
- package/build/component/generator/spfx/spfxGenerator.d.ts.map +1 -0
- package/build/component/generator/{spfxGenerator.js → spfx/spfxGenerator.js} +16 -16
- package/build/component/generator/spfx/spfxGenerator.js.map +1 -0
- package/build/component/{resource → generator}/spfx/utils/constants.d.ts +0 -33
- package/build/component/generator/spfx/utils/constants.d.ts.map +1 -0
- package/build/component/{resource → generator}/spfx/utils/constants.js +1 -39
- package/build/component/generator/spfx/utils/constants.js.map +1 -0
- package/build/component/{resource → generator}/spfx/utils/progress-helper.d.ts +0 -5
- package/build/component/generator/spfx/utils/progress-helper.d.ts.map +1 -0
- package/build/component/generator/spfx/utils/progress-helper.js +21 -0
- package/build/component/generator/spfx/utils/progress-helper.js.map +1 -0
- package/build/component/generator/spfx/utils/question-helper.d.ts.map +1 -0
- package/build/component/generator/spfx/utils/question-helper.js.map +1 -0
- package/build/component/{resource → generator}/spfx/utils/questions.d.ts +0 -1
- package/build/component/generator/spfx/utils/questions.d.ts.map +1 -0
- package/build/component/{resource → generator}/spfx/utils/questions.js +1 -23
- package/build/component/generator/spfx/utils/questions.js.map +1 -0
- package/build/component/generator/spfx/utils/telemetry-helper.d.ts.map +1 -0
- package/build/component/generator/spfx/utils/telemetry-helper.js.map +1 -0
- package/build/component/generator/spfx/utils/telemetryEvents.d.ts.map +1 -0
- package/build/component/generator/spfx/utils/telemetryEvents.js.map +1 -0
- package/build/component/generator/spfx/utils/utils.d.ts.map +1 -0
- package/build/component/generator/spfx/utils/utils.js.map +1 -0
- package/build/component/generator/utils.js +2 -2
- package/build/component/generator/utils.js.map +1 -1
- package/build/component/middleware/envMW.js.map +1 -1
- package/build/component/provisionUtils.d.ts +2 -23
- package/build/component/provisionUtils.d.ts.map +1 -1
- package/build/component/provisionUtils.js +5 -523
- package/build/component/provisionUtils.js.map +1 -1
- package/build/component/question.js +1 -1
- package/build/component/question.js.map +1 -1
- package/build/component/registerService.d.ts +0 -3
- package/build/component/registerService.d.ts.map +1 -1
- package/build/component/registerService.js +0 -3
- package/build/component/registerService.js.map +1 -1
- package/build/component/resource/aadApp/utils/aadManifestHelper.js +2 -1
- package/build/component/resource/aadApp/utils/aadManifestHelper.js.map +1 -1
- package/build/component/resource/appManifest/appManifest.d.ts +0 -6
- package/build/component/resource/appManifest/appManifest.d.ts.map +1 -1
- package/build/component/resource/appManifest/appManifest.js +24 -247
- package/build/component/resource/appManifest/appManifest.js.map +1 -1
- package/build/component/resource/appManifest/appStudio.d.ts +1 -21
- package/build/component/resource/appManifest/appStudio.d.ts.map +1 -1
- package/build/component/resource/appManifest/appStudio.js +15 -257
- package/build/component/resource/appManifest/appStudio.js.map +1 -1
- package/build/component/resource/botService/errors.d.ts +0 -2
- package/build/component/resource/botService/errors.d.ts.map +1 -1
- package/build/component/resource/botService/errors.js +1 -43
- package/build/component/resource/botService/errors.js.map +1 -1
- package/build/component/utils/ResourceGroupHelper.d.ts +1 -5
- package/build/component/utils/ResourceGroupHelper.d.ts.map +1 -1
- package/build/component/utils/ResourceGroupHelper.js +0 -6
- package/build/component/utils/ResourceGroupHelper.js.map +1 -1
- package/build/component/utils/pathUtils.d.ts.map +1 -1
- package/build/component/utils/pathUtils.js +2 -2
- package/build/component/utils/pathUtils.js.map +1 -1
- package/build/component/utils.d.ts +1 -18
- package/build/component/utils.d.ts.map +1 -1
- package/build/component/utils.js +23 -277
- package/build/component/utils.js.map +1 -1
- package/build/component/workflow.d.ts +0 -1
- package/build/component/workflow.d.ts.map +1 -1
- package/build/component/workflow.js +1 -6
- package/build/component/workflow.js.map +1 -1
- package/build/core/FxCore.d.ts +0 -8
- package/build/core/FxCore.d.ts.map +1 -1
- package/build/core/FxCore.js +0 -12
- package/build/core/FxCore.js.map +1 -1
- package/build/core/FxCoreImplementV3.d.ts.map +1 -1
- package/build/core/FxCoreImplementV3.js +7 -20
- package/build/core/FxCoreImplementV3.js.map +1 -1
- package/build/core/collaborator.d.ts +2 -0
- package/build/core/collaborator.d.ts.map +1 -1
- package/build/core/collaborator.js +2 -0
- package/build/core/collaborator.js.map +1 -1
- package/build/core/environment.d.ts +2 -4
- package/build/core/environment.d.ts.map +1 -1
- package/build/core/environment.js +44 -108
- package/build/core/environment.js.map +1 -1
- package/build/core/error.d.ts +1 -34
- package/build/core/error.d.ts.map +1 -1
- package/build/core/error.js +1 -112
- package/build/core/error.js.map +1 -1
- package/build/core/globalVars.d.ts +0 -1
- package/build/core/globalVars.d.ts.map +1 -1
- package/build/core/globalVars.js +1 -15
- package/build/core/globalVars.js.map +1 -1
- package/build/core/middleware/projectMigratorV3.d.ts +2 -1
- package/build/core/middleware/projectMigratorV3.d.ts.map +1 -1
- package/build/core/middleware/projectMigratorV3.js +40 -46
- package/build/core/middleware/projectMigratorV3.js.map +1 -1
- package/build/core/middleware/projectSettingsLoader.d.ts.map +1 -1
- package/build/core/middleware/projectSettingsLoader.js +9 -20
- package/build/core/middleware/projectSettingsLoader.js.map +1 -1
- package/build/core/middleware/projectVersionChecker.d.ts.map +1 -1
- package/build/core/middleware/projectVersionChecker.js +6 -18
- package/build/core/middleware/projectVersionChecker.js.map +1 -1
- package/build/core/middleware/utils/migrationContext.d.ts.map +1 -1
- package/build/core/middleware/utils/migrationContext.js +0 -4
- package/build/core/middleware/utils/migrationContext.js.map +1 -1
- package/build/core/question.d.ts.map +1 -1
- package/build/core/question.js +4 -4
- package/build/core/question.js.map +1 -1
- package/build/core/types.d.ts +0 -10
- package/build/core/types.d.ts.map +1 -1
- package/build/index.d.ts +0 -1
- package/build/index.d.ts.map +1 -1
- package/build/index.js +0 -1
- package/build/index.js.map +1 -1
- package/package.json +7 -11
- package/resource/package.nls.json +3 -177
- package/templates/fallback/common.zip +0 -0
- package/templates/fallback/csharp.zip +0 -0
- package/templates/fallback/js.zip +0 -0
- package/templates/fallback/ts.zip +0 -0
- package/build/common/azure-hosting/azureAppServiceHosting.d.ts +0 -16
- package/build/common/azure-hosting/azureAppServiceHosting.d.ts.map +0 -1
- package/build/common/azure-hosting/azureAppServiceHosting.js +0 -33
- package/build/common/azure-hosting/azureAppServiceHosting.js.map +0 -1
- package/build/common/azure-hosting/azureFunctionHosting.d.ts +0 -14
- package/build/common/azure-hosting/azureFunctionHosting.d.ts.map +0 -1
- package/build/common/azure-hosting/azureFunctionHosting.js +0 -34
- package/build/common/azure-hosting/azureFunctionHosting.js.map +0 -1
- package/build/common/azure-hosting/azureHosting.d.ts +0 -23
- package/build/common/azure-hosting/azureHosting.d.ts.map +0 -1
- package/build/common/azure-hosting/azureHosting.js +0 -95
- package/build/common/azure-hosting/azureHosting.js.map +0 -1
- package/build/common/azure-hosting/azureOps.d.ts +0 -17
- package/build/common/azure-hosting/azureOps.d.ts.map +0 -1
- package/build/common/azure-hosting/azureOps.js +0 -94
- package/build/common/azure-hosting/azureOps.js.map +0 -1
- package/build/common/azure-hosting/hostingConstant.d.ts +0 -46
- package/build/common/azure-hosting/hostingConstant.d.ts.map +0 -1
- package/build/common/azure-hosting/hostingConstant.js +0 -86
- package/build/common/azure-hosting/hostingConstant.js.map +0 -1
- package/build/common/azure-hosting/hostingError.d.ts +0 -47
- package/build/common/azure-hosting/hostingError.d.ts.map +0 -1
- package/build/common/azure-hosting/hostingError.js +0 -83
- package/build/common/azure-hosting/hostingError.js.map +0 -1
- package/build/common/azure-hosting/hostingFactory.d.ts +0 -6
- package/build/common/azure-hosting/hostingFactory.d.ts.map +0 -1
- package/build/common/azure-hosting/hostingFactory.js +0 -22
- package/build/common/azure-hosting/hostingFactory.js.map +0 -1
- package/build/common/azure-hosting/interfaces.d.ts +0 -58
- package/build/common/azure-hosting/interfaces.d.ts.map +0 -1
- package/build/common/azure-hosting/interfaces.js +0 -12
- package/build/common/azure-hosting/interfaces.js.map +0 -1
- package/build/common/azure-hosting/messages.d.ts +0 -10
- package/build/common/azure-hosting/messages.d.ts.map +0 -1
- package/build/common/azure-hosting/messages.js +0 -16
- package/build/common/azure-hosting/messages.js.map +0 -1
- package/build/common/azure-hosting/utils.d.ts +0 -10
- package/build/common/azure-hosting/utils.d.ts.map +0 -1
- package/build/common/azure-hosting/utils.js +0 -107
- package/build/common/azure-hosting/utils.js.map +0 -1
- package/build/common/samples-config.json +0 -201
- package/build/component/code/spfxTabCode.d.ts +0 -11
- package/build/component/code/spfxTabCode.d.ts.map +0 -1
- package/build/component/code/spfxTabCode.js +0 -237
- package/build/component/code/spfxTabCode.js.map +0 -1
- package/build/component/envManager.d.ts +0 -4
- package/build/component/envManager.d.ts.map +0 -1
- package/build/component/envManager.js +0 -25
- package/build/component/envManager.js.map +0 -1
- package/build/component/feature/apiconnector/ApiConnectorImpl.d.ts +0 -23
- package/build/component/feature/apiconnector/ApiConnectorImpl.d.ts.map +0 -1
- package/build/component/feature/apiconnector/ApiConnectorImpl.js +0 -288
- package/build/component/feature/apiconnector/ApiConnectorImpl.js.map +0 -1
- package/build/component/feature/apiconnector/checker.d.ts +0 -7
- package/build/component/feature/apiconnector/checker.d.ts.map +0 -1
- package/build/component/feature/apiconnector/checker.js +0 -74
- package/build/component/feature/apiconnector/checker.js.map +0 -1
- package/build/component/feature/apiconnector/config.d.ts +0 -23
- package/build/component/feature/apiconnector/config.d.ts.map +0 -1
- package/build/component/feature/apiconnector/config.js +0 -5
- package/build/component/feature/apiconnector/config.js.map +0 -1
- package/build/component/feature/apiconnector/constants.d.ts +0 -50
- package/build/component/feature/apiconnector/constants.d.ts.map +0 -1
- package/build/component/feature/apiconnector/constants.js +0 -61
- package/build/component/feature/apiconnector/constants.js.map +0 -1
- package/build/component/feature/apiconnector/depsHandler.d.ts +0 -14
- package/build/component/feature/apiconnector/depsHandler.d.ts.map +0 -1
- package/build/component/feature/apiconnector/depsHandler.js +0 -109
- package/build/component/feature/apiconnector/depsHandler.js.map +0 -1
- package/build/component/feature/apiconnector/envHandler.d.ts +0 -21
- package/build/component/feature/apiconnector/envHandler.d.ts.map +0 -1
- package/build/component/feature/apiconnector/envHandler.js +0 -128
- package/build/component/feature/apiconnector/envHandler.js.map +0 -1
- package/build/component/feature/apiconnector/errors.d.ts +0 -53
- package/build/component/feature/apiconnector/errors.d.ts.map +0 -1
- package/build/component/feature/apiconnector/errors.js +0 -64
- package/build/component/feature/apiconnector/errors.js.map +0 -1
- package/build/component/feature/apiconnector/questions.d.ts +0 -41
- package/build/component/feature/apiconnector/questions.d.ts.map +0 -1
- package/build/component/feature/apiconnector/questions.js +0 -262
- package/build/component/feature/apiconnector/questions.js.map +0 -1
- package/build/component/feature/apiconnector/result.d.ts +0 -23
- package/build/component/feature/apiconnector/result.d.ts.map +0 -1
- package/build/component/feature/apiconnector/result.js +0 -40
- package/build/component/feature/apiconnector/result.js.map +0 -1
- package/build/component/feature/apiconnector/sampleHandler.d.ts +0 -10
- package/build/component/feature/apiconnector/sampleHandler.d.ts.map +0 -1
- package/build/component/feature/apiconnector/sampleHandler.js +0 -62
- package/build/component/feature/apiconnector/sampleHandler.js.map +0 -1
- package/build/component/feature/apiconnector/telemetry.d.ts +0 -42
- package/build/component/feature/apiconnector/telemetry.d.ts.map +0 -1
- package/build/component/feature/apiconnector/telemetry.js +0 -70
- package/build/component/feature/apiconnector/telemetry.js.map +0 -1
- package/build/component/feature/apiconnector/utils.d.ts +0 -18
- package/build/component/feature/apiconnector/utils.d.ts.map +0 -1
- package/build/component/feature/apiconnector/utils.js +0 -90
- package/build/component/feature/apiconnector/utils.js.map +0 -1
- package/build/component/generator/spfxGenerator.d.ts.map +0 -1
- package/build/component/generator/spfxGenerator.js.map +0 -1
- package/build/component/resource/azureAppService/azureAppService.d.ts +0 -12
- package/build/component/resource/azureAppService/azureAppService.d.ts.map +0 -1
- package/build/component/resource/azureAppService/azureAppService.js +0 -48
- package/build/component/resource/azureAppService/azureAppService.js.map +0 -1
- package/build/component/resource/azureAppService/azureFunction.d.ts +0 -36
- package/build/component/resource/azureAppService/azureFunction.d.ts.map +0 -1
- package/build/component/resource/azureAppService/azureFunction.js +0 -155
- package/build/component/resource/azureAppService/azureFunction.js.map +0 -1
- package/build/component/resource/azureAppService/azureLibs.d.ts +0 -6
- package/build/component/resource/azureAppService/azureLibs.d.ts.map +0 -1
- package/build/component/resource/azureAppService/azureLibs.js +0 -13
- package/build/component/resource/azureAppService/azureLibs.js.map +0 -1
- package/build/component/resource/azureAppService/azureWebApp.d.ts +0 -30
- package/build/component/resource/azureAppService/azureWebApp.d.ts.map +0 -1
- package/build/component/resource/azureAppService/azureWebApp.js +0 -43
- package/build/component/resource/azureAppService/azureWebApp.js.map +0 -1
- package/build/component/resource/azureAppService/common.d.ts +0 -10
- package/build/component/resource/azureAppService/common.d.ts.map +0 -1
- package/build/component/resource/azureAppService/common.js +0 -80
- package/build/component/resource/azureAppService/common.js.map +0 -1
- package/build/component/resource/azureAppService/dir-walk.d.ts +0 -4
- package/build/component/resource/azureAppService/dir-walk.d.ts.map +0 -1
- package/build/component/resource/azureAppService/dir-walk.js +0 -21
- package/build/component/resource/azureAppService/dir-walk.js.map +0 -1
- package/build/component/resource/azureSql/actions/configure.d.ts +0 -15
- package/build/component/resource/azureSql/actions/configure.d.ts.map +0 -1
- package/build/component/resource/azureSql/actions/configure.js +0 -92
- package/build/component/resource/azureSql/actions/configure.js.map +0 -1
- package/build/component/resource/azureSql/actions/provision.d.ts +0 -10
- package/build/component/resource/azureSql/actions/provision.d.ts.map +0 -1
- package/build/component/resource/azureSql/actions/provision.js +0 -63
- package/build/component/resource/azureSql/actions/provision.js.map +0 -1
- package/build/component/resource/azureSql/actions/utils.d.ts +0 -12
- package/build/component/resource/azureSql/actions/utils.d.ts.map +0 -1
- package/build/component/resource/azureSql/actions/utils.js +0 -82
- package/build/component/resource/azureSql/actions/utils.js.map +0 -1
- package/build/component/resource/azureSql/azureSql.d.ts +0 -24
- package/build/component/resource/azureSql/azureSql.d.ts.map +0 -1
- package/build/component/resource/azureSql/azureSql.js +0 -75
- package/build/component/resource/azureSql/azureSql.js.map +0 -1
- package/build/component/resource/azureSql/clients/management.d.ts +0 -18
- package/build/component/resource/azureSql/clients/management.d.ts.map +0 -1
- package/build/component/resource/azureSql/clients/management.js +0 -124
- package/build/component/resource/azureSql/clients/management.js.map +0 -1
- package/build/component/resource/azureSql/clients/sql.d.ts +0 -13
- package/build/component/resource/azureSql/clients/sql.d.ts.map +0 -1
- package/build/component/resource/azureSql/clients/sql.js +0 -153
- package/build/component/resource/azureSql/clients/sql.js.map +0 -1
- package/build/component/resource/azureSql/config.d.ts +0 -7
- package/build/component/resource/azureSql/config.d.ts.map +0 -1
- package/build/component/resource/azureSql/config.js +0 -77
- package/build/component/resource/azureSql/config.js.map +0 -1
- package/build/component/resource/azureSql/constants.d.ts +0 -85
- package/build/component/resource/azureSql/constants.d.ts.map +0 -1
- package/build/component/resource/azureSql/constants.js +0 -95
- package/build/component/resource/azureSql/constants.js.map +0 -1
- package/build/component/resource/azureSql/errors.d.ts +0 -63
- package/build/component/resource/azureSql/errors.d.ts.map +0 -1
- package/build/component/resource/azureSql/errors.js +0 -107
- package/build/component/resource/azureSql/errors.js.map +0 -1
- package/build/component/resource/azureSql/index.d.ts +0 -2
- package/build/component/resource/azureSql/index.d.ts.map +0 -1
- package/build/component/resource/azureSql/index.js +0 -7
- package/build/component/resource/azureSql/index.js.map +0 -1
- package/build/component/resource/azureSql/questions.d.ts +0 -6
- package/build/component/resource/azureSql/questions.d.ts.map +0 -1
- package/build/component/resource/azureSql/questions.js +0 -59
- package/build/component/resource/azureSql/questions.js.map +0 -1
- package/build/component/resource/azureSql/results.d.ts +0 -10
- package/build/component/resource/azureSql/results.d.ts.map +0 -1
- package/build/component/resource/azureSql/results.js +0 -34
- package/build/component/resource/azureSql/results.js.map +0 -1
- package/build/component/resource/azureSql/types.d.ts +0 -12
- package/build/component/resource/azureSql/types.d.ts.map +0 -1
- package/build/component/resource/azureSql/types.js +0 -5
- package/build/component/resource/azureSql/types.js.map +0 -1
- package/build/component/resource/azureSql/utils/checkInput.d.ts +0 -10
- package/build/component/resource/azureSql/utils/checkInput.d.ts.map +0 -1
- package/build/component/resource/azureSql/utils/checkInput.js +0 -89
- package/build/component/resource/azureSql/utils/checkInput.js.map +0 -1
- package/build/component/resource/azureSql/utils/common.d.ts +0 -12
- package/build/component/resource/azureSql/utils/common.d.ts.map +0 -1
- package/build/component/resource/azureSql/utils/common.js +0 -51
- package/build/component/resource/azureSql/utils/common.js.map +0 -1
- package/build/component/resource/azureStorage/azureStorage.d.ts +0 -31
- package/build/component/resource/azureStorage/azureStorage.d.ts.map +0 -1
- package/build/component/resource/azureStorage/azureStorage.js +0 -111
- package/build/component/resource/azureStorage/azureStorage.js.map +0 -1
- package/build/component/resource/azureStorage/clients.d.ts +0 -23
- package/build/component/resource/azureStorage/clients.d.ts.map +0 -1
- package/build/component/resource/azureStorage/clients.js +0 -133
- package/build/component/resource/azureStorage/clients.js.map +0 -1
- package/build/component/resource/azureStorage/configs.d.ts +0 -12
- package/build/component/resource/azureStorage/configs.d.ts.map +0 -1
- package/build/component/resource/azureStorage/configs.js +0 -30
- package/build/component/resource/azureStorage/configs.js.map +0 -1
- package/build/component/resource/azureStorage/constants.d.ts +0 -11
- package/build/component/resource/azureStorage/constants.d.ts.map +0 -1
- package/build/component/resource/azureStorage/constants.js +0 -17
- package/build/component/resource/azureStorage/constants.js.map +0 -1
- package/build/component/resource/azureStorage/messages.d.ts +0 -14
- package/build/component/resource/azureStorage/messages.d.ts.map +0 -1
- package/build/component/resource/azureStorage/messages.js +0 -28
- package/build/component/resource/azureStorage/messages.js.map +0 -1
- package/build/component/resource/botService/botService.d.ts +0 -24
- package/build/component/resource/botService/botService.d.ts.map +0 -1
- package/build/component/resource/botService/botService.js +0 -146
- package/build/component/resource/botService/botService.js.map +0 -1
- package/build/component/resource/spfx/depsChecker/dependencyChecker.d.ts +0 -11
- package/build/component/resource/spfx/depsChecker/dependencyChecker.d.ts.map +0 -1
- package/build/component/resource/spfx/depsChecker/dependencyChecker.js.map +0 -1
- package/build/component/resource/spfx/depsChecker/generatorChecker.d.ts.map +0 -1
- package/build/component/resource/spfx/depsChecker/generatorChecker.js.map +0 -1
- package/build/component/resource/spfx/depsChecker/yoChecker.d.ts.map +0 -1
- package/build/component/resource/spfx/depsChecker/yoChecker.js.map +0 -1
- package/build/component/resource/spfx/error.d.ts +0 -21
- package/build/component/resource/spfx/error.d.ts.map +0 -1
- package/build/component/resource/spfx/error.js +0 -138
- package/build/component/resource/spfx/error.js.map +0 -1
- package/build/component/resource/spfx/index.d.ts +0 -15
- package/build/component/resource/spfx/index.d.ts.map +0 -1
- package/build/component/resource/spfx/index.js +0 -248
- package/build/component/resource/spfx/index.js.map +0 -1
- package/build/component/resource/spfx/spoClient.d.ts +0 -25
- package/build/component/resource/spfx/spoClient.d.ts.map +0 -1
- package/build/component/resource/spfx/spoClient.js +0 -79
- package/build/component/resource/spfx/spoClient.js.map +0 -1
- package/build/component/resource/spfx/utils/constants.d.ts.map +0 -1
- package/build/component/resource/spfx/utils/constants.js.map +0 -1
- package/build/component/resource/spfx/utils/progress-helper.d.ts.map +0 -1
- package/build/component/resource/spfx/utils/progress-helper.js +0 -46
- package/build/component/resource/spfx/utils/progress-helper.js.map +0 -1
- package/build/component/resource/spfx/utils/question-helper.d.ts.map +0 -1
- package/build/component/resource/spfx/utils/question-helper.js.map +0 -1
- package/build/component/resource/spfx/utils/questions.d.ts.map +0 -1
- package/build/component/resource/spfx/utils/questions.js.map +0 -1
- package/build/component/resource/spfx/utils/telemetry-helper.d.ts.map +0 -1
- package/build/component/resource/spfx/utils/telemetry-helper.js.map +0 -1
- package/build/component/resource/spfx/utils/telemetryEvents.d.ts.map +0 -1
- package/build/component/resource/spfx/utils/telemetryEvents.js.map +0 -1
- package/build/component/resource/spfx/utils/utils.d.ts.map +0 -1
- package/build/component/resource/spfx/utils/utils.js.map +0 -1
- package/build/component/utils/backupFiles.d.ts +0 -4
- package/build/component/utils/backupFiles.d.ts.map +0 -1
- package/build/component/utils/backupFiles.js +0 -162
- package/build/component/utils/backupFiles.js.map +0 -1
- package/build/component/utils/executor.d.ts +0 -12
- package/build/component/utils/executor.d.ts.map +0 -1
- package/build/component/utils/executor.js +0 -87
- package/build/component/utils/executor.js.map +0 -1
- package/build/core/downloadSample.d.ts +0 -9
- package/build/core/downloadSample.d.ts.map +0 -1
- package/build/core/downloadSample.js +0 -161
- package/build/core/downloadSample.js.map +0 -1
- package/resource/backup-config-change-logs.md +0 -24
- package/templates/bicep/azureSql.parameters.json +0 -4
- package/templates/bicep/azureSql.provisionDatabase.module.bicep +0 -15
- package/templates/bicep/azureSql.provisionDatabase.orchestration.bicep +0 -5
- package/templates/bicep/azureSql.provisionServer.module.bicep +0 -44
- package/templates/bicep/azureSql.provisionServer.orchestration.bicep +0 -14
- package/templates/bicep/identity.provision.module.bicep +0 -15
- package/templates/bicep/identity.provision.orchestration.bicep +0 -14
- package/templates/bicep/keyVault.provision.module.bicep +0 -57
- package/templates/bicep/keyVault.provision.orchestration.bicep +0 -15
- package/templates/plugins/resource/apiconnector/package.json +0 -5
- package/templates/plugins/resource/apiconnector/sample/footerComment.template +0 -20
- package/templates/plugins/resource/apiconnector/sample/headerComment.template +0 -52
- package/templates/plugins/resource/apiconnector/sample/js/aad.template +0 -31
- package/templates/plugins/resource/apiconnector/sample/js/apikey.template +0 -19
- package/templates/plugins/resource/apiconnector/sample/js/basic.template +0 -14
- package/templates/plugins/resource/apiconnector/sample/js/cert.template +0 -17
- package/templates/plugins/resource/apiconnector/sample/js/custom.template +0 -39
- package/templates/plugins/resource/apiconnector/sample/ts/aad.template +0 -36
- package/templates/plugins/resource/apiconnector/sample/ts/apikey.template +0 -16
- package/templates/plugins/resource/apiconnector/sample/ts/basic.template +0 -14
- package/templates/plugins/resource/apiconnector/sample/ts/cert.template +0 -19
- package/templates/plugins/resource/apiconnector/sample/ts/custom.template +0 -42
- package/templates/plugins/resource/identity/bicep/identityProvision.template.bicep +0 -15
- package/templates/plugins/resource/identity/bicep/provision.template.bicep +0 -14
- package/templates/plugins/resource/identity/parameters.json +0 -12
- package/templates/plugins/resource/identity/template.json +0 -28
- package/templates/plugins/resource/keyvault/bicep/keyVaultProvision.template.bicep +0 -57
- package/templates/plugins/resource/keyvault/bicep/provision.template.bicep +0 -15
- package/templates/plugins/resource/simpleauth/SimpleAuth.zip +0 -0
- package/templates/plugins/resource/simpleauth/bicep/config.template.bicep +0 -12
- package/templates/plugins/resource/simpleauth/bicep/provision.template.bicep +0 -14
- package/templates/plugins/resource/simpleauth/bicep/simpleAuthConfiguration.template.bicep +0 -62
- package/templates/plugins/resource/simpleauth/bicep/simpleAuthProvision.template.bicep +0 -51
- package/templates/plugins/resource/simpleauth/version.txt +0 -2
- package/templates/plugins/resource/spfx/solution/README.md +0 -82
- package/templates/plugins/resource/spfx/solution/manifest.local.template.json +0 -62
- package/templates/plugins/resource/spfx/solution/manifest_multi_env.json +0 -63
- package/templates/plugins/resource/spfx/solution/rootREADME.md +0 -13
- package/templates/plugins/resource/sql/bicep/newDatabase.orchestration.template.bicep +0 -5
- package/templates/plugins/resource/sql/bicep/newDatabaseProvision.template.bicep +0 -15
- package/templates/plugins/resource/sql/bicep/parameters.json +0 -4
- package/templates/plugins/resource/sql/bicep/provision.template.bicep +0 -14
- package/templates/plugins/resource/sql/bicep/sqlProvision.template.bicep +0 -44
- /package/build/component/{resource → generator}/spfx/depsChecker/dependencyChecker.js +0 -0
- /package/build/component/generator/{spfxGenerator.d.ts → spfx/spfxGenerator.d.ts} +0 -0
- /package/build/component/{resource → generator}/spfx/utils/question-helper.d.ts +0 -0
- /package/build/component/{resource → generator}/spfx/utils/question-helper.js +0 -0
- /package/build/component/{resource → generator}/spfx/utils/telemetry-helper.d.ts +0 -0
- /package/build/component/{resource → generator}/spfx/utils/telemetry-helper.js +0 -0
- /package/build/component/{resource → generator}/spfx/utils/telemetryEvents.d.ts +0 -0
- /package/build/component/{resource → generator}/spfx/utils/telemetryEvents.js +0 -0
- /package/build/component/{resource → generator}/spfx/utils/utils.d.ts +0 -0
- /package/build/component/{resource → generator}/spfx/utils/utils.js +0 -0
|
@@ -2,109 +2,22 @@
|
|
|
2
2
|
// Copyright (c) Microsoft Corporation.
|
|
3
3
|
// Licensed under the MIT license.
|
|
4
4
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5
|
-
exports.provisionUtils = exports.
|
|
5
|
+
exports.provisionUtils = exports.parseUserName = exports.parseTeamsAppTenantId = exports.checkWhetherLocalDebugM365TenantMatches = exports.findSubscriptionFromList = exports.ProvisionUtils = void 0;
|
|
6
6
|
const tslib_1 = require("tslib");
|
|
7
7
|
const arm_resources_1 = require("@azure/arm-resources");
|
|
8
8
|
const teamsfx_api_1 = require("@microsoft/teamsfx-api");
|
|
9
|
-
const
|
|
9
|
+
const fs_extra_1 = tslib_1.__importDefault(require("fs-extra"));
|
|
10
10
|
const constants_1 = require("../common/constants");
|
|
11
11
|
const localizeUtils_1 = require("../common/localizeUtils");
|
|
12
|
-
const projectSettingsHelperV3_1 = require("../common/projectSettingsHelperV3");
|
|
13
12
|
const telemetry_1 = require("../common/telemetry");
|
|
14
13
|
const tools_1 = require("../common/tools");
|
|
15
|
-
const utils_1 = require("../common/utils");
|
|
16
14
|
const globalVars_1 = require("../core/globalVars");
|
|
17
|
-
const constants_2 = require("./constants");
|
|
18
|
-
const backupFiles_1 = require("./utils/backupFiles");
|
|
19
|
-
const ResourceGroupHelper_1 = require("./utils/ResourceGroupHelper");
|
|
20
|
-
const appSettingUtils_1 = require("./code/appSettingUtils");
|
|
21
|
-
const constants_3 = require("./resource/appManifest/constants");
|
|
22
|
-
const utils_2 = require("./utils");
|
|
23
|
-
const fs_extra_1 = tslib_1.__importDefault(require("fs-extra"));
|
|
24
|
-
const arm_1 = require("./arm");
|
|
25
|
-
const path_1 = tslib_1.__importDefault(require("path"));
|
|
26
|
-
const hostingConstant_1 = require("../common/azure-hosting/hostingConstant");
|
|
27
15
|
const azure_1 = require("../error/azure");
|
|
28
16
|
const m365_1 = require("../error/m365");
|
|
17
|
+
const constants_2 = require("./constants");
|
|
18
|
+
const constants_3 = require("./resource/appManifest/constants");
|
|
19
|
+
const ResourceGroupHelper_1 = require("./utils/ResourceGroupHelper");
|
|
29
20
|
class ProvisionUtils {
|
|
30
|
-
async preProvision(context, inputs) {
|
|
31
|
-
const ctx = context;
|
|
32
|
-
const envInfo = ctx.envInfo;
|
|
33
|
-
const hasBotServiceCreatedBefore = hasBotServiceCreated(envInfo);
|
|
34
|
-
// 1. check M365 tenant
|
|
35
|
-
envInfo.state[constants_2.ComponentNames.AppManifest] = envInfo.state[constants_2.ComponentNames.AppManifest] || {};
|
|
36
|
-
envInfo.state.solution = envInfo.state.solution || {};
|
|
37
|
-
const appManifest = envInfo.state[constants_2.ComponentNames.AppManifest];
|
|
38
|
-
const solutionConfig = envInfo.state.solution;
|
|
39
|
-
solutionConfig.provisionSucceeded = false;
|
|
40
|
-
const tenantIdInConfig = appManifest.tenantId;
|
|
41
|
-
const isLocalDebug = envInfo.envName === "local";
|
|
42
|
-
const tenantInfoInTokenRes = await this.getM365TenantId(ctx.tokenProvider.m365TokenProvider);
|
|
43
|
-
if (tenantInfoInTokenRes.isErr()) {
|
|
44
|
-
addShouldSkipWriteEnvInfo(tenantInfoInTokenRes.error);
|
|
45
|
-
return teamsfx_api_1.err(tenantInfoInTokenRes.error);
|
|
46
|
-
}
|
|
47
|
-
const tenantIdInToken = tenantInfoInTokenRes.value.tenantIdInToken;
|
|
48
|
-
const hasSwitchedM365Tenant = !!tenantIdInConfig && !!tenantIdInToken && tenantIdInToken !== tenantIdInConfig;
|
|
49
|
-
if (!isLocalDebug) {
|
|
50
|
-
if (hasSwitchedM365Tenant) {
|
|
51
|
-
utils_2.resetEnvInfoWhenSwitchM365(envInfo);
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
else {
|
|
55
|
-
const res = await checkWhetherLocalDebugM365TenantMatches(envInfo, ctx, utils_2.isCSharpProject(ctx.projectSetting.programmingLanguage), tenantIdInConfig, ctx.tokenProvider.m365TokenProvider, inputs);
|
|
56
|
-
if (res.isErr()) {
|
|
57
|
-
addShouldSkipWriteEnvInfo(res.error);
|
|
58
|
-
return teamsfx_api_1.err(res.error);
|
|
59
|
-
}
|
|
60
|
-
}
|
|
61
|
-
envInfo.state[constants_2.ComponentNames.AppManifest] = envInfo.state[constants_2.ComponentNames.AppManifest] || {};
|
|
62
|
-
envInfo.state[constants_2.ComponentNames.AppManifest].tenantId = tenantIdInToken;
|
|
63
|
-
envInfo.state.solution.teamsAppTenantId = tenantIdInToken;
|
|
64
|
-
globalVars_1.globalVars.m365TenantId = tenantIdInToken;
|
|
65
|
-
// 3. check Azure configs
|
|
66
|
-
if (projectSettingsHelperV3_1.hasAzureResourceV3(ctx.projectSetting) && envInfo.envName !== "local") {
|
|
67
|
-
// ask common question and fill in solution config
|
|
68
|
-
const subscriptionIdInState = envInfo.state.solution.subscriptionId;
|
|
69
|
-
const solutionConfigRes = await this.fillInAzureConfigs(ctx, inputs, envInfo, ctx.tokenProvider);
|
|
70
|
-
if (solutionConfigRes.isErr()) {
|
|
71
|
-
addShouldSkipWriteEnvInfo(solutionConfigRes.error);
|
|
72
|
-
return teamsfx_api_1.err(solutionConfigRes.error);
|
|
73
|
-
}
|
|
74
|
-
const consentResult = await this.askForProvisionConsent(ctx, ctx.tokenProvider.azureAccountProvider, envInfo, hasSwitchedM365Tenant, solutionConfigRes.value.hasSwitchedSubscription, tenantInfoInTokenRes.value.tenantUserName, true, tenantIdInConfig, subscriptionIdInState);
|
|
75
|
-
if (consentResult.isErr()) {
|
|
76
|
-
addShouldSkipWriteEnvInfo(consentResult.error);
|
|
77
|
-
return teamsfx_api_1.err(consentResult.error);
|
|
78
|
-
}
|
|
79
|
-
if (solutionConfigRes.value.hasSwitchedSubscription || hasSwitchedM365Tenant) {
|
|
80
|
-
const handleConfigFilesWhenSwitchAccountsRes = await handleConfigFilesWhenSwitchAccount(envInfo, ctx, inputs, hasSwitchedM365Tenant, solutionConfigRes.value.hasSwitchedSubscription, hasBotServiceCreatedBefore, utils_2.isCSharpProject(ctx.projectSetting.programmingLanguage));
|
|
81
|
-
if (handleConfigFilesWhenSwitchAccountsRes.isErr()) {
|
|
82
|
-
addShouldSkipWriteEnvInfo(handleConfigFilesWhenSwitchAccountsRes.error);
|
|
83
|
-
return teamsfx_api_1.err(handleConfigFilesWhenSwitchAccountsRes.error);
|
|
84
|
-
}
|
|
85
|
-
}
|
|
86
|
-
// create resource group if needed
|
|
87
|
-
if (solutionConfig.needCreateResourceGroup) {
|
|
88
|
-
const createRgRes = await ResourceGroupHelper_1.resourceGroupHelper.createNewResourceGroup(solutionConfig.resourceGroupName, ctx.tokenProvider.azureAccountProvider, solutionConfig.subscriptionId, solutionConfig.location);
|
|
89
|
-
if (createRgRes.isErr()) {
|
|
90
|
-
return teamsfx_api_1.err(createRgRes.error);
|
|
91
|
-
}
|
|
92
|
-
}
|
|
93
|
-
}
|
|
94
|
-
else if (hasSwitchedM365Tenant && !isLocalDebug) {
|
|
95
|
-
const consentResult = await this.askForProvisionConsent(ctx, ctx.tokenProvider.azureAccountProvider, envInfo, hasSwitchedM365Tenant, false, tenantInfoInTokenRes.value.tenantUserName, false, tenantIdInConfig);
|
|
96
|
-
if (consentResult.isErr()) {
|
|
97
|
-
addShouldSkipWriteEnvInfo(consentResult.error);
|
|
98
|
-
return teamsfx_api_1.err(consentResult.error);
|
|
99
|
-
}
|
|
100
|
-
const handleConfigFilesWhenSwitchAccountsRes = await handleConfigFilesWhenSwitchAccount(envInfo, ctx, inputs, hasSwitchedM365Tenant, false, false, utils_2.isCSharpProject(ctx.projectSetting.programmingLanguage));
|
|
101
|
-
if (handleConfigFilesWhenSwitchAccountsRes.isErr()) {
|
|
102
|
-
addShouldSkipWriteEnvInfo(handleConfigFilesWhenSwitchAccountsRes.error);
|
|
103
|
-
return teamsfx_api_1.err(handleConfigFilesWhenSwitchAccountsRes.error);
|
|
104
|
-
}
|
|
105
|
-
}
|
|
106
|
-
return teamsfx_api_1.ok(undefined);
|
|
107
|
-
}
|
|
108
21
|
/**
|
|
109
22
|
* make sure subscription is correct before provision for V3
|
|
110
23
|
* subscriptionId is provided from .env.xxx file
|
|
@@ -141,135 +54,6 @@ class ProvisionUtils {
|
|
|
141
54
|
globalVars_1.TOOLS.logProvider.info("subscription validate success");
|
|
142
55
|
return teamsfx_api_1.ok(foundSubscriptionInfo);
|
|
143
56
|
}
|
|
144
|
-
/**
|
|
145
|
-
* make sure subscription is correct before provision
|
|
146
|
-
*
|
|
147
|
-
*/
|
|
148
|
-
async checkProvisionSubscription(ctx, envInfo, azureAccountProvider, targetSubscriptionIdFromCLI, envName, isResourceGroupOnlyFromCLI) {
|
|
149
|
-
var _a, _b, _c, _d;
|
|
150
|
-
const subscriptionIdInConfig = (_a = envInfo.config.azure) === null || _a === void 0 ? void 0 : _a.subscriptionId;
|
|
151
|
-
const subscriptionNameInConfig = ((_b = envInfo.config.azure) === null || _b === void 0 ? void 0 : _b.subscriptionName) || subscriptionIdInConfig;
|
|
152
|
-
const subscriptionIdInState = envInfo.state.solution.subscriptionId;
|
|
153
|
-
const subscriptionNameInState = envInfo.state.solution.subscriptionName || subscriptionIdInState;
|
|
154
|
-
(_c = ctx.telemetryReporter) === null || _c === void 0 ? void 0 : _c.sendTelemetryEvent(telemetry_1.TelemetryEvent.CheckSubscriptionStart, envName ? { [telemetry_1.TelemetryProperty.Env]: tools_1.getHashedEnv(envName) } : {});
|
|
155
|
-
if (!subscriptionIdInState && !subscriptionIdInConfig && !targetSubscriptionIdFromCLI) {
|
|
156
|
-
const subscriptionInAccount = await azureAccountProvider.getSelectedSubscription(true);
|
|
157
|
-
if (!subscriptionInAccount) {
|
|
158
|
-
return teamsfx_api_1.err(new azure_1.SelectSubscriptionError());
|
|
159
|
-
}
|
|
160
|
-
else {
|
|
161
|
-
this.updateEnvInfoSubscription(envInfo, subscriptionInAccount);
|
|
162
|
-
ctx.logProvider.info(`[${constants_1.PluginDisplayName.Solution}] checkAzureSubscription pass!`);
|
|
163
|
-
(_d = ctx.telemetryReporter) === null || _d === void 0 ? void 0 : _d.sendTelemetryEvent(telemetry_1.TelemetryEvent.CheckSubscription, {
|
|
164
|
-
[telemetry_1.TelemetryProperty.Env]: !envName ? "" : tools_1.getHashedEnv(envName),
|
|
165
|
-
[telemetry_1.TelemetryProperty.HasSwitchedSubscription]: "false",
|
|
166
|
-
[telemetry_1.TelemetryProperty.CustomizeSubscriptionType]: telemetry_1.CustomizeSubscriptionType.Default,
|
|
167
|
-
});
|
|
168
|
-
return teamsfx_api_1.ok({ hasSwitchedSubscription: false });
|
|
169
|
-
}
|
|
170
|
-
}
|
|
171
|
-
// make sure the user is logged in
|
|
172
|
-
await azureAccountProvider.getIdentityCredentialAsync(true);
|
|
173
|
-
// verify valid subscription (permission)
|
|
174
|
-
const subscriptions = await azureAccountProvider.listSubscriptions();
|
|
175
|
-
if (targetSubscriptionIdFromCLI) {
|
|
176
|
-
const targetSubscriptionInfo = findSubscriptionFromList(targetSubscriptionIdFromCLI, subscriptions);
|
|
177
|
-
if (!targetSubscriptionInfo) {
|
|
178
|
-
return teamsfx_api_1.err(new azure_1.InvalidAzureSubscriptionError(targetSubscriptionIdFromCLI));
|
|
179
|
-
}
|
|
180
|
-
else {
|
|
181
|
-
this.updateEnvInfoSubscription(envInfo, targetSubscriptionInfo);
|
|
182
|
-
ctx.logProvider.info(`[${constants_1.PluginDisplayName.Solution}] checkAzureSubscription pass!`);
|
|
183
|
-
return this.compareWithStateSubscription(ctx, envInfo, targetSubscriptionInfo, subscriptionIdInState, envName, telemetry_1.CustomizeSubscriptionType.CommandLine);
|
|
184
|
-
}
|
|
185
|
-
}
|
|
186
|
-
if (subscriptionIdInConfig && !isResourceGroupOnlyFromCLI) {
|
|
187
|
-
const targetConfigSubInfo = findSubscriptionFromList(subscriptionIdInConfig, subscriptions);
|
|
188
|
-
if (!targetConfigSubInfo) {
|
|
189
|
-
return teamsfx_api_1.err(new azure_1.InvalidAzureSubscriptionError(subscriptionIdInConfig));
|
|
190
|
-
}
|
|
191
|
-
else {
|
|
192
|
-
return this.compareWithStateSubscription(ctx, envInfo, targetConfigSubInfo, subscriptionIdInState, envName, telemetry_1.CustomizeSubscriptionType.EnvConfig);
|
|
193
|
-
}
|
|
194
|
-
}
|
|
195
|
-
else {
|
|
196
|
-
const targetStateSubInfo = subscriptions.find((item) => item.subscriptionId === subscriptionIdInState);
|
|
197
|
-
const subscriptionInAccount = await azureAccountProvider.getSelectedSubscription(true);
|
|
198
|
-
if (!subscriptionInAccount) {
|
|
199
|
-
if (targetStateSubInfo) {
|
|
200
|
-
this.updateEnvInfoSubscription(envInfo, targetStateSubInfo);
|
|
201
|
-
ctx.logProvider.info(`[${constants_1.PluginDisplayName.Solution}] checkAzureSubscription pass!`);
|
|
202
|
-
return teamsfx_api_1.ok({ hasSwitchedSubscription: false });
|
|
203
|
-
}
|
|
204
|
-
else {
|
|
205
|
-
return teamsfx_api_1.err(new azure_1.InvalidAzureSubscriptionError(subscriptionIdInState));
|
|
206
|
-
}
|
|
207
|
-
}
|
|
208
|
-
else {
|
|
209
|
-
return this.compareWithStateSubscription(ctx, envInfo, subscriptionInAccount, subscriptionIdInState, envName, telemetry_1.CustomizeSubscriptionType.EnvState);
|
|
210
|
-
}
|
|
211
|
-
}
|
|
212
|
-
}
|
|
213
|
-
updateEnvInfoSubscription(envInfo, subscriptionInfo) {
|
|
214
|
-
envInfo.state.solution.subscriptionId = subscriptionInfo.subscriptionId;
|
|
215
|
-
envInfo.state.solution.subscriptionName = subscriptionInfo.subscriptionName;
|
|
216
|
-
envInfo.state.solution.tenantId = subscriptionInfo.tenantId;
|
|
217
|
-
}
|
|
218
|
-
async compareWithStateSubscription(ctx, envInfo, targetSubscriptionInfo, subscriptionInStateId, envName, customizeSubscriptionType) {
|
|
219
|
-
var _a, _b;
|
|
220
|
-
const hasSwitchedSubscription = !!subscriptionInStateId && targetSubscriptionInfo.subscriptionId !== subscriptionInStateId;
|
|
221
|
-
if (hasSwitchedSubscription) {
|
|
222
|
-
this.updateEnvInfoSubscription(envInfo, targetSubscriptionInfo);
|
|
223
|
-
this.clearEnvInfoStateResource(envInfo);
|
|
224
|
-
ctx.logProvider.info(`[${constants_1.PluginDisplayName.Solution}] checkAzureSubscription pass!`);
|
|
225
|
-
(_a = ctx.telemetryReporter) === null || _a === void 0 ? void 0 : _a.sendTelemetryEvent(telemetry_1.TelemetryEvent.CheckSubscription, {
|
|
226
|
-
[telemetry_1.TelemetryProperty.Env]: !envName ? "" : tools_1.getHashedEnv(envName),
|
|
227
|
-
[telemetry_1.TelemetryProperty.HasSwitchedSubscription]: "true",
|
|
228
|
-
[telemetry_1.TelemetryProperty.CustomizeSubscriptionType]: customizeSubscriptionType,
|
|
229
|
-
});
|
|
230
|
-
return teamsfx_api_1.ok({ hasSwitchedSubscription: true });
|
|
231
|
-
}
|
|
232
|
-
else {
|
|
233
|
-
this.updateEnvInfoSubscription(envInfo, targetSubscriptionInfo);
|
|
234
|
-
ctx.logProvider.info(`[${constants_1.PluginDisplayName.Solution}] checkAzureSubscription pass!`);
|
|
235
|
-
(_b = ctx.telemetryReporter) === null || _b === void 0 ? void 0 : _b.sendTelemetryEvent(telemetry_1.TelemetryEvent.CheckSubscription, {
|
|
236
|
-
[telemetry_1.TelemetryProperty.Env]: !envName ? "" : tools_1.getHashedEnv(envName),
|
|
237
|
-
[telemetry_1.TelemetryProperty.HasSwitchedSubscription]: "false",
|
|
238
|
-
[telemetry_1.TelemetryProperty.CustomizeSubscriptionType]: customizeSubscriptionType,
|
|
239
|
-
});
|
|
240
|
-
return teamsfx_api_1.ok({ hasSwitchedSubscription: false });
|
|
241
|
-
}
|
|
242
|
-
}
|
|
243
|
-
// clear resources related info in envInfo so that we could provision successfully using new sub.
|
|
244
|
-
clearEnvInfoStateResource(envInfo) {
|
|
245
|
-
envInfo.state.solution.resourceGroupName = "";
|
|
246
|
-
envInfo.state.solution.resourceNameSuffix = "";
|
|
247
|
-
const keysToClear = [
|
|
248
|
-
constants_2.BuiltInFeaturePluginNames.bot,
|
|
249
|
-
constants_2.BuiltInFeaturePluginNames.frontend,
|
|
250
|
-
constants_2.BuiltInFeaturePluginNames.function,
|
|
251
|
-
constants_2.BuiltInFeaturePluginNames.identity,
|
|
252
|
-
constants_2.BuiltInFeaturePluginNames.keyVault,
|
|
253
|
-
constants_2.BuiltInFeaturePluginNames.sql,
|
|
254
|
-
constants_2.BuiltInFeaturePluginNames.simpleAuth,
|
|
255
|
-
constants_2.ComponentNames.TeamsBot,
|
|
256
|
-
constants_2.ComponentNames.TeamsTab,
|
|
257
|
-
constants_2.ComponentNames.TeamsApi,
|
|
258
|
-
constants_2.ComponentNames.Identity,
|
|
259
|
-
constants_2.ComponentNames.KeyVault,
|
|
260
|
-
constants_2.ComponentNames.AzureSQL,
|
|
261
|
-
];
|
|
262
|
-
const keysToModify = [constants_2.BuiltInFeaturePluginNames.apim, constants_2.ComponentNames.APIM];
|
|
263
|
-
const keys = Object.keys(envInfo.state);
|
|
264
|
-
for (const key of keys) {
|
|
265
|
-
if (keysToClear.includes(key)) {
|
|
266
|
-
delete envInfo.state[key];
|
|
267
|
-
}
|
|
268
|
-
if (keysToModify.includes(key)) {
|
|
269
|
-
delete envInfo.state[key]["serviceResourceId"];
|
|
270
|
-
}
|
|
271
|
-
}
|
|
272
|
-
}
|
|
273
57
|
async ensureResourceGroup(azureAccountProvider, subscriptionId, givenResourceGroupName, defaultResourceGroupName) {
|
|
274
58
|
const azureToken = await azureAccountProvider.getIdentityCredentialAsync();
|
|
275
59
|
if (azureToken === undefined) {
|
|
@@ -301,137 +85,6 @@ class ProvisionUtils {
|
|
|
301
85
|
}
|
|
302
86
|
return teamsfx_api_1.ok(resourceGroupInfo);
|
|
303
87
|
}
|
|
304
|
-
/**
|
|
305
|
-
* Asks common questions and puts the answers in the global namespace of SolutionConfig
|
|
306
|
-
*
|
|
307
|
-
*/
|
|
308
|
-
async fillInAzureConfigs(ctx, inputs, envInfo, tokenProvider) {
|
|
309
|
-
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
310
|
-
//1. check subscriptionId
|
|
311
|
-
const targetSubscriptionIdFromCLI = inputs.targetSubscriptionId;
|
|
312
|
-
const subscriptionResult = await this.checkProvisionSubscription(ctx, envInfo, tokenProvider.azureAccountProvider, targetSubscriptionIdFromCLI, inputs.env, !!inputs.targetResourceGroupName &&
|
|
313
|
-
!targetSubscriptionIdFromCLI &&
|
|
314
|
-
inputs.platform === teamsfx_api_1.Platform.CLI);
|
|
315
|
-
if (subscriptionResult.isErr()) {
|
|
316
|
-
return teamsfx_api_1.err(subscriptionResult.error);
|
|
317
|
-
}
|
|
318
|
-
// Note setSubscription here will change the token returned by getAccountCredentialAsync according to the subscription selected.
|
|
319
|
-
// So getting azureToken needs to precede setSubscription.
|
|
320
|
-
const azureToken = await tokenProvider.azureAccountProvider.getIdentityCredentialAsync();
|
|
321
|
-
if (azureToken === undefined) {
|
|
322
|
-
return teamsfx_api_1.err(new azure_1.InvalidAzureCredentialError());
|
|
323
|
-
}
|
|
324
|
-
//2. check resource group
|
|
325
|
-
(_a = ctx.telemetryReporter) === null || _a === void 0 ? void 0 : _a.sendTelemetryEvent(telemetry_1.TelemetryEvent.CheckResourceGroupStart, inputs.env ? { [telemetry_1.TelemetryProperty.Env]: tools_1.getHashedEnv(inputs.env) } : {});
|
|
326
|
-
const rmClient = new arm_resources_1.ResourceManagementClient(azureToken, envInfo.state.solution.subscriptionId);
|
|
327
|
-
// Resource group info precedence are:
|
|
328
|
-
// 0. ctx.answers, for VS targetResourceGroupName and targetResourceLocationName to create a new rg
|
|
329
|
-
// 1. ctx.answers, for CLI --resource-group argument, only support existing resource group
|
|
330
|
-
// 2. env config (config.{envName}.json), for user customization, only support existing resource group
|
|
331
|
-
// 3. states (state.{envName}.json), for re-provision
|
|
332
|
-
// 4. asking user with a popup
|
|
333
|
-
const resourceGroupNameFromEnvConfig = (_b = envInfo.config.azure) === null || _b === void 0 ? void 0 : _b.resourceGroupName;
|
|
334
|
-
const resourceGroupNameFromState = envInfo.state.solution.resourceGroupName;
|
|
335
|
-
const resourceGroupLocationFromState = envInfo.state.solution.location;
|
|
336
|
-
const appName = utils_1.convertToAlphanumericOnly(ctx.projectSetting.appName);
|
|
337
|
-
const defaultResourceGroupName = `${appName.replace(" ", "_")}${"-" + envInfo.envName}-rg`;
|
|
338
|
-
let resourceGroupInfo;
|
|
339
|
-
const telemetryProperties = {};
|
|
340
|
-
if (inputs.env) {
|
|
341
|
-
telemetryProperties[telemetry_1.TelemetryProperty.Env] = tools_1.getHashedEnv(inputs.env);
|
|
342
|
-
}
|
|
343
|
-
if (inputs.targetResourceGroupName) {
|
|
344
|
-
const getRes = await ResourceGroupHelper_1.resourceGroupHelper.getResourceGroupInfo(inputs.targetResourceGroupName, rmClient);
|
|
345
|
-
if (getRes.isErr()) {
|
|
346
|
-
// support vs to create a new resource group
|
|
347
|
-
if (inputs.platform === teamsfx_api_1.Platform.VS && inputs.targetResourceLocationName) {
|
|
348
|
-
resourceGroupInfo = {
|
|
349
|
-
createNewResourceGroup: true,
|
|
350
|
-
name: inputs.targetResourceGroupName,
|
|
351
|
-
location: inputs.targetResourceLocationName,
|
|
352
|
-
};
|
|
353
|
-
}
|
|
354
|
-
else
|
|
355
|
-
return teamsfx_api_1.err(getRes.error);
|
|
356
|
-
}
|
|
357
|
-
else {
|
|
358
|
-
if (!getRes.value) {
|
|
359
|
-
// Currently we do not support creating resource group from command line arguments
|
|
360
|
-
return teamsfx_api_1.err(new azure_1.ResourceGroupNotExistError(inputs.targetResourceGroupName, envInfo.state.solution.subscriptionId));
|
|
361
|
-
}
|
|
362
|
-
telemetryProperties[telemetry_1.TelemetryProperty.CustomizeResourceGroupType] =
|
|
363
|
-
telemetry_1.CustomizeResourceGroupType.CommandLine;
|
|
364
|
-
resourceGroupInfo = getRes.value;
|
|
365
|
-
}
|
|
366
|
-
}
|
|
367
|
-
else if (resourceGroupNameFromEnvConfig && !targetSubscriptionIdFromCLI) {
|
|
368
|
-
const resourceGroupName = resourceGroupNameFromEnvConfig;
|
|
369
|
-
const envFile = teamsfx_api_1.EnvConfigFileNameTemplate.replace(teamsfx_api_1.EnvNamePlaceholder, envInfo.envName);
|
|
370
|
-
if (!((_c = envInfo.config.azure) === null || _c === void 0 ? void 0 : _c.subscriptionId)) {
|
|
371
|
-
return teamsfx_api_1.err(new teamsfx_api_1.UserError(constants_2.SolutionSource, constants_2.SolutionError.MissingSubscriptionIdInConfig, localizeUtils_1.getDefaultString("error.MissingSubscriptionInConfig", resourceGroupName, envFile), localizeUtils_1.getLocalizedString("error.MissingSubscriptionInConfig", resourceGroupName, envFile)));
|
|
372
|
-
}
|
|
373
|
-
const getRes = await ResourceGroupHelper_1.resourceGroupHelper.getResourceGroupInfo(resourceGroupName, rmClient);
|
|
374
|
-
if (getRes.isErr())
|
|
375
|
-
return teamsfx_api_1.err(getRes.error);
|
|
376
|
-
if (!getRes.value) {
|
|
377
|
-
// Currently we do not support creating resource group by input config, so just throw an error.
|
|
378
|
-
return teamsfx_api_1.err(new azure_1.ResourceGroupNotExistError(resourceGroupName, envInfo.state.solution.subscriptionId));
|
|
379
|
-
}
|
|
380
|
-
telemetryProperties[telemetry_1.TelemetryProperty.CustomizeResourceGroupType] =
|
|
381
|
-
telemetry_1.CustomizeResourceGroupType.EnvConfig;
|
|
382
|
-
resourceGroupInfo = getRes.value;
|
|
383
|
-
}
|
|
384
|
-
else if (resourceGroupNameFromState &&
|
|
385
|
-
resourceGroupLocationFromState &&
|
|
386
|
-
!targetSubscriptionIdFromCLI) {
|
|
387
|
-
const checkRes = await ResourceGroupHelper_1.resourceGroupHelper.checkResourceGroupExistence(resourceGroupNameFromState, rmClient);
|
|
388
|
-
if (checkRes.isErr()) {
|
|
389
|
-
return teamsfx_api_1.err(checkRes.error);
|
|
390
|
-
}
|
|
391
|
-
const exist = checkRes.value;
|
|
392
|
-
resourceGroupInfo = {
|
|
393
|
-
createNewResourceGroup: !exist,
|
|
394
|
-
name: resourceGroupNameFromState,
|
|
395
|
-
location: resourceGroupLocationFromState,
|
|
396
|
-
};
|
|
397
|
-
telemetryProperties[telemetry_1.TelemetryProperty.CustomizeResourceGroupType] =
|
|
398
|
-
telemetry_1.CustomizeResourceGroupType.EnvState;
|
|
399
|
-
}
|
|
400
|
-
else {
|
|
401
|
-
const resourceGroupInfoResult = await ResourceGroupHelper_1.resourceGroupHelper.askResourceGroupInfo(ctx, inputs, tokenProvider.azureAccountProvider, rmClient, defaultResourceGroupName);
|
|
402
|
-
if (resourceGroupInfoResult.isErr()) {
|
|
403
|
-
return teamsfx_api_1.err(resourceGroupInfoResult.error);
|
|
404
|
-
}
|
|
405
|
-
resourceGroupInfo = resourceGroupInfoResult.value;
|
|
406
|
-
if (resourceGroupInfo.createNewResourceGroup) {
|
|
407
|
-
if (resourceGroupInfo.name === defaultResourceGroupName) {
|
|
408
|
-
telemetryProperties[telemetry_1.TelemetryProperty.CustomizeResourceGroupType] =
|
|
409
|
-
telemetry_1.CustomizeResourceGroupType.InteractiveCreateDefault;
|
|
410
|
-
}
|
|
411
|
-
else {
|
|
412
|
-
telemetryProperties[telemetry_1.TelemetryProperty.CustomizeResourceGroupType] =
|
|
413
|
-
telemetry_1.CustomizeResourceGroupType.InteractiveCreateCustomized;
|
|
414
|
-
}
|
|
415
|
-
}
|
|
416
|
-
else {
|
|
417
|
-
telemetryProperties[telemetry_1.TelemetryProperty.CustomizeResourceGroupType] =
|
|
418
|
-
telemetry_1.CustomizeResourceGroupType.InteractiveUseExisting;
|
|
419
|
-
}
|
|
420
|
-
}
|
|
421
|
-
(_d = ctx.telemetryReporter) === null || _d === void 0 ? void 0 : _d.sendTelemetryEvent(telemetry_1.TelemetryEvent.CheckResourceGroup, telemetryProperties);
|
|
422
|
-
envInfo.state.solution.needCreateResourceGroup = resourceGroupInfo.createNewResourceGroup;
|
|
423
|
-
envInfo.state.solution.resourceGroupName = resourceGroupInfo.name;
|
|
424
|
-
envInfo.state.solution.location = resourceGroupInfo.location;
|
|
425
|
-
(_e = ctx.logProvider) === null || _e === void 0 ? void 0 : _e.info(`[${constants_1.PluginDisplayName.Solution}] check resource group pass!`);
|
|
426
|
-
(_f = ctx.logProvider) === null || _f === void 0 ? void 0 : _f.info(`[${constants_1.PluginDisplayName.Solution}] check teamsAppTenantId pass!`);
|
|
427
|
-
//resourceNameSuffix
|
|
428
|
-
const resourceNameSuffix = ((_g = envInfo.config.azure) === null || _g === void 0 ? void 0 : _g.resourceNameSuffix) ||
|
|
429
|
-
envInfo.state.solution.resourceNameSuffix ||
|
|
430
|
-
uuid_1.v4().substr(0, 6);
|
|
431
|
-
envInfo.state.solution.resourceNameSuffix = resourceNameSuffix;
|
|
432
|
-
(_h = ctx.logProvider) === null || _h === void 0 ? void 0 : _h.info(`[${constants_1.PluginDisplayName.Solution}] check resourceNameSuffix pass!`);
|
|
433
|
-
return teamsfx_api_1.ok({ hasSwitchedSubscription: subscriptionResult.value.hasSwitchedSubscription });
|
|
434
|
-
}
|
|
435
88
|
async getM365TenantId(m365TokenProvider) {
|
|
436
89
|
// Just to trigger M365 login before the concurrent execution of localDebug.
|
|
437
90
|
// Because concurrent execution of localDebug may getAccessToken() concurrently, which
|
|
@@ -504,112 +157,12 @@ class ProvisionUtils {
|
|
|
504
157
|
error.helpLink = constants_1.HelpLinks.SwitchTenant;
|
|
505
158
|
return !hasSwitched ? teamsfx_api_1.ok(undefined) : teamsfx_api_1.err(error);
|
|
506
159
|
}
|
|
507
|
-
async askForProvisionConsent(ctx, azureAccountProvider, envInfo, hasSwitchedM365Tenant, hasSwitchedSubscription, m365AccountName, hasAzureResource, previousM365TenantId, previousSubscriptionId) {
|
|
508
|
-
var _a, _b, _c, _d, _e;
|
|
509
|
-
const azureTokenJson = await azureAccountProvider.getJsonObject();
|
|
510
|
-
const username = azureTokenJson.unique_name || "";
|
|
511
|
-
const subscriptionId = ((_a = envInfo.state.solution) === null || _a === void 0 ? void 0 : _a.subscriptionId) || "";
|
|
512
|
-
const subscriptionName = ((_b = envInfo.state.solution) === null || _b === void 0 ? void 0 : _b.subscriptionName) || "";
|
|
513
|
-
const m365TenantId = ((_c = envInfo.state.solution) === null || _c === void 0 ? void 0 : _c.teamsAppTenantId) || "";
|
|
514
|
-
let switchedNotice = "";
|
|
515
|
-
if (hasSwitchedM365Tenant && hasSwitchedSubscription) {
|
|
516
|
-
switchedNotice = localizeUtils_1.getLocalizedString("core.provision.switchedM365AccountAndAzureSubscriptionNotice");
|
|
517
|
-
}
|
|
518
|
-
else if (hasSwitchedM365Tenant && !hasSwitchedSubscription) {
|
|
519
|
-
switchedNotice = localizeUtils_1.getLocalizedString("core.provision.switchedM365AccountNotice");
|
|
520
|
-
}
|
|
521
|
-
else if (!hasSwitchedM365Tenant && hasSwitchedSubscription) {
|
|
522
|
-
switchedNotice = localizeUtils_1.getLocalizedString("core.provision.switchedAzureSubscriptionNotice");
|
|
523
|
-
const botResource = (_d = envInfo.state[constants_2.BuiltInFeaturePluginNames.bot]) !== null && _d !== void 0 ? _d : envInfo.state[constants_2.ComponentNames.TeamsBot];
|
|
524
|
-
const newBotNotice = !!botResource && !!botResource["resourceId"]
|
|
525
|
-
? localizeUtils_1.getLocalizedString("core.provision.createNewAzureBotNotice")
|
|
526
|
-
: "";
|
|
527
|
-
switchedNotice = switchedNotice + newBotNotice;
|
|
528
|
-
}
|
|
529
|
-
const azureAccountInfo = localizeUtils_1.getLocalizedString("core.provision.azureAccount", username);
|
|
530
|
-
const azureSubscriptionInfo = localizeUtils_1.getLocalizedString("core.provision.azureSubscription", subscriptionName ? subscriptionName : subscriptionId);
|
|
531
|
-
const m365AccountInfo = localizeUtils_1.getLocalizedString("core.provision.m365Account", m365AccountName ? m365AccountName : m365TenantId);
|
|
532
|
-
let accountsInfo = "";
|
|
533
|
-
if (!switchedNotice && !hasAzureResource) {
|
|
534
|
-
return teamsfx_api_1.ok(teamsfx_api_1.Void);
|
|
535
|
-
}
|
|
536
|
-
else if (!switchedNotice && hasAzureResource) {
|
|
537
|
-
accountsInfo = [azureAccountInfo, azureSubscriptionInfo, m365AccountInfo].join("\n");
|
|
538
|
-
}
|
|
539
|
-
else {
|
|
540
|
-
// switchedNotice
|
|
541
|
-
accountsInfo = hasAzureResource
|
|
542
|
-
? [switchedNotice, azureAccountInfo, azureSubscriptionInfo, m365AccountInfo].join("\n")
|
|
543
|
-
: [switchedNotice, m365AccountInfo].join("\n");
|
|
544
|
-
}
|
|
545
|
-
const confirmMsg = hasAzureResource
|
|
546
|
-
? localizeUtils_1.getLocalizedString("core.provision.confirmEnvAndCostNotice", envInfo.envName)
|
|
547
|
-
: hasSwitchedM365Tenant
|
|
548
|
-
? localizeUtils_1.getLocalizedString("core.provision.confirmEnvOnlyNotice", envInfo.envName)
|
|
549
|
-
: "";
|
|
550
|
-
const provisionText = localizeUtils_1.getLocalizedString("core.provision.provision");
|
|
551
|
-
const learnMoreText = localizeUtils_1.getLocalizedString("core.provision.learnMore");
|
|
552
|
-
const items = hasSwitchedM365Tenant || hasSwitchedSubscription
|
|
553
|
-
? [provisionText, learnMoreText]
|
|
554
|
-
: [provisionText];
|
|
555
|
-
let confirm;
|
|
556
|
-
do {
|
|
557
|
-
const confirmRes = await ctx.userInteraction.showMessage("warn", accountsInfo + "\n\n" + confirmMsg, true, ...items);
|
|
558
|
-
confirm = (confirmRes === null || confirmRes === void 0 ? void 0 : confirmRes.isOk()) ? confirmRes.value : undefined;
|
|
559
|
-
(_e = ctx.telemetryReporter) === null || _e === void 0 ? void 0 : _e.sendTelemetryEvent(telemetry_1.TelemetryEvent.ConfirmProvision, envInfo.envName
|
|
560
|
-
? {
|
|
561
|
-
[telemetry_1.TelemetryProperty.Env]: tools_1.getHashedEnv(envInfo.envName),
|
|
562
|
-
[telemetry_1.TelemetryProperty.HasSwitchedM365Tenant]: hasSwitchedM365Tenant.toString(),
|
|
563
|
-
[telemetry_1.TelemetryProperty.HasSwitchedSubscription]: hasSwitchedSubscription.toString(),
|
|
564
|
-
[constants_2.SolutionTelemetryProperty.SubscriptionId]: getSubscriptionId(envInfo.state),
|
|
565
|
-
[constants_2.SolutionTelemetryProperty.M365TenantId]: getTeamsAppTenantId(envInfo.state),
|
|
566
|
-
[constants_2.SolutionTelemetryProperty.PreviousM365TenantId]: previousM365TenantId,
|
|
567
|
-
[constants_2.SolutionTelemetryProperty.PreviousSubsriptionId]: previousSubscriptionId !== null && previousSubscriptionId !== void 0 ? previousSubscriptionId : "",
|
|
568
|
-
[constants_2.SolutionTelemetryProperty.ConfirmRes]: !confirm
|
|
569
|
-
? "Error"
|
|
570
|
-
: confirm === learnMoreText
|
|
571
|
-
? "Learn more"
|
|
572
|
-
: confirm === provisionText
|
|
573
|
-
? "Provision"
|
|
574
|
-
: "",
|
|
575
|
-
}
|
|
576
|
-
: {});
|
|
577
|
-
if (confirm !== provisionText) {
|
|
578
|
-
if (confirm === learnMoreText) {
|
|
579
|
-
ctx.userInteraction.openUrl("https://aka.ms/teamsfx-switch-tenant-or-subscription-help");
|
|
580
|
-
}
|
|
581
|
-
else {
|
|
582
|
-
return teamsfx_api_1.err(new teamsfx_api_1.UserError(constants_2.SolutionSource, "CancelProvision", "CancelProvision"));
|
|
583
|
-
}
|
|
584
|
-
}
|
|
585
|
-
} while (confirm === learnMoreText);
|
|
586
|
-
return teamsfx_api_1.ok(teamsfx_api_1.Void);
|
|
587
|
-
}
|
|
588
160
|
}
|
|
589
161
|
exports.ProvisionUtils = ProvisionUtils;
|
|
590
|
-
function getSubscriptionId(state) {
|
|
591
|
-
if (state && state[constants_2.GLOBAL_CONFIG] && state[constants_2.GLOBAL_CONFIG][constants_2.SUBSCRIPTION_ID]) {
|
|
592
|
-
return state[constants_2.GLOBAL_CONFIG][constants_2.SUBSCRIPTION_ID];
|
|
593
|
-
}
|
|
594
|
-
return "";
|
|
595
|
-
}
|
|
596
|
-
exports.getSubscriptionId = getSubscriptionId;
|
|
597
|
-
function getTeamsAppTenantId(state) {
|
|
598
|
-
if (state && state[constants_2.GLOBAL_CONFIG] && state[constants_2.GLOBAL_CONFIG][constants_2.REMOTE_TEAMS_APP_TENANT_ID]) {
|
|
599
|
-
return state[constants_2.GLOBAL_CONFIG][constants_2.REMOTE_TEAMS_APP_TENANT_ID];
|
|
600
|
-
}
|
|
601
|
-
return "";
|
|
602
|
-
}
|
|
603
|
-
exports.getTeamsAppTenantId = getTeamsAppTenantId;
|
|
604
162
|
function findSubscriptionFromList(subscriptionId, subscriptions) {
|
|
605
163
|
return subscriptions.find((item) => item.subscriptionId === subscriptionId);
|
|
606
164
|
}
|
|
607
165
|
exports.findSubscriptionFromList = findSubscriptionFromList;
|
|
608
|
-
function addShouldSkipWriteEnvInfo(error) {
|
|
609
|
-
if (!error.userData) {
|
|
610
|
-
error.userData = { shouldSkipWriteEnvInfo: true };
|
|
611
|
-
}
|
|
612
|
-
}
|
|
613
166
|
async function checkWhetherLocalDebugM365TenantMatches(envInfo, ctx, isCSharpProject, localDebugTenantId, m365TokenProvider, inputs) {
|
|
614
167
|
var _a, _b;
|
|
615
168
|
if (localDebugTenantId) {
|
|
@@ -646,15 +199,6 @@ async function checkWhetherLocalDebugM365TenantMatches(envInfo, ctx, isCSharpPro
|
|
|
646
199
|
delete envInfo.state[key];
|
|
647
200
|
}
|
|
648
201
|
}
|
|
649
|
-
if (projectPath !== undefined) {
|
|
650
|
-
const backupFilesRes = await backupFiles_1.backupFiles(envInfo.envName, projectPath, isCSharpProject, (inputs === null || inputs === void 0 ? void 0 : inputs.platform) === teamsfx_api_1.Platform.VS, ctx);
|
|
651
|
-
if (backupFilesRes.isErr()) {
|
|
652
|
-
return teamsfx_api_1.err(backupFilesRes.error);
|
|
653
|
-
}
|
|
654
|
-
if (isCSharpProject) {
|
|
655
|
-
await appSettingUtils_1.resetAppSettingsDevelopment(projectPath);
|
|
656
|
-
}
|
|
657
|
-
}
|
|
658
202
|
}
|
|
659
203
|
}
|
|
660
204
|
else {
|
|
@@ -692,67 +236,5 @@ function parseUserName(appStudioToken) {
|
|
|
692
236
|
return teamsfx_api_1.ok(userName);
|
|
693
237
|
}
|
|
694
238
|
exports.parseUserName = parseUserName;
|
|
695
|
-
function hasBotServiceCreated(envInfo) {
|
|
696
|
-
if (!envInfo || !envInfo.state) {
|
|
697
|
-
return false;
|
|
698
|
-
}
|
|
699
|
-
return ((!!envInfo.state[constants_2.BuiltInFeaturePluginNames.bot] &&
|
|
700
|
-
!!envInfo.state[constants_2.BuiltInFeaturePluginNames.bot]["resourceId"]) ||
|
|
701
|
-
(!!envInfo.state[constants_2.ComponentNames.TeamsBot] &&
|
|
702
|
-
!!envInfo.state[constants_2.ComponentNames.TeamsBot]["resourceId"]) ||
|
|
703
|
-
(!!envInfo.state[constants_2.ComponentNames.TeamsBot] &&
|
|
704
|
-
!!envInfo.state[constants_2.ComponentNames.TeamsBot]["functionAppResourceId"]));
|
|
705
|
-
}
|
|
706
|
-
exports.hasBotServiceCreated = hasBotServiceCreated;
|
|
707
|
-
async function handleConfigFilesWhenSwitchAccount(envInfo, context, inputs, hasSwitchedM365Tenant, hasSwitchedSubscription, hasBotServiceCreatedBefore, isCSharpProject) {
|
|
708
|
-
var _a, _b;
|
|
709
|
-
if (!hasSwitchedM365Tenant && !hasSwitchedSubscription) {
|
|
710
|
-
return teamsfx_api_1.ok(undefined);
|
|
711
|
-
}
|
|
712
|
-
const backupFilesRes = await backupFiles_1.backupFiles(envInfo.envName, inputs.projectPath, isCSharpProject, inputs.platform === teamsfx_api_1.Platform.VS, context);
|
|
713
|
-
if (backupFilesRes.isErr()) {
|
|
714
|
-
return teamsfx_api_1.err(backupFilesRes.error);
|
|
715
|
-
}
|
|
716
|
-
const updateAzureParametersRes = await arm_1.updateAzureParameters(inputs.projectPath, context.projectSetting.appName, envInfo.envName, hasSwitchedM365Tenant, hasSwitchedSubscription, hasBotServiceCreatedBefore);
|
|
717
|
-
if (updateAzureParametersRes.isErr()) {
|
|
718
|
-
return teamsfx_api_1.err(updateAzureParametersRes.error);
|
|
719
|
-
}
|
|
720
|
-
if (hasSwitchedSubscription) {
|
|
721
|
-
const envName = envInfo.envName;
|
|
722
|
-
const maybeBotFolder = path_1.default.join(inputs.projectPath, constants_2.PathConstants.botWorkingDir);
|
|
723
|
-
const maybeBotDeploymentFile = path_1.default.join(maybeBotFolder, path_1.default.join(hostingConstant_1.DeployConfigsConstants.DEPLOYMENT_FOLDER, hostingConstant_1.DeployConfigsConstants.DEPLOYMENT_INFO_FILE));
|
|
724
|
-
if (await fs_extra_1.default.pathExists(maybeBotDeploymentFile)) {
|
|
725
|
-
try {
|
|
726
|
-
const botDeployJson = await fs_extra_1.default.readJSON(maybeBotDeploymentFile);
|
|
727
|
-
const lastTime = Math.max((_b = (_a = botDeployJson[envInfo.envName]) === null || _a === void 0 ? void 0 : _a.time) !== null && _b !== void 0 ? _b : 0, 0);
|
|
728
|
-
if (lastTime !== 0) {
|
|
729
|
-
botDeployJson[envName] = {
|
|
730
|
-
time: 0,
|
|
731
|
-
};
|
|
732
|
-
await fs_extra_1.default.writeJSON(maybeBotDeploymentFile, botDeployJson);
|
|
733
|
-
}
|
|
734
|
-
}
|
|
735
|
-
catch (exception) {
|
|
736
|
-
// do nothing
|
|
737
|
-
}
|
|
738
|
-
}
|
|
739
|
-
const maybeTabFolder = path_1.default.join(inputs.projectPath, constants_2.PathConstants.tabWorkingDir);
|
|
740
|
-
const maybeTabDeploymentFile = path_1.default.join(maybeTabFolder, path_1.default.join(hostingConstant_1.DeployConfigsConstants.DEPLOYMENT_FOLDER, hostingConstant_1.DeployConfigsConstants.DEPLOYMENT_INFO_FILE));
|
|
741
|
-
if (await fs_extra_1.default.pathExists(maybeTabDeploymentFile)) {
|
|
742
|
-
try {
|
|
743
|
-
const deploymentInfoJson = await fs_extra_1.default.readJSON(maybeTabDeploymentFile);
|
|
744
|
-
if (!!deploymentInfoJson[envName] && !!deploymentInfoJson[envName].lastDeployTime) {
|
|
745
|
-
delete deploymentInfoJson[envName].lastDeployTime;
|
|
746
|
-
await fs_extra_1.default.writeJSON(maybeTabDeploymentFile, deploymentInfoJson);
|
|
747
|
-
}
|
|
748
|
-
}
|
|
749
|
-
catch (exception) {
|
|
750
|
-
// do nothing
|
|
751
|
-
}
|
|
752
|
-
}
|
|
753
|
-
}
|
|
754
|
-
return teamsfx_api_1.ok(undefined);
|
|
755
|
-
}
|
|
756
|
-
exports.handleConfigFilesWhenSwitchAccount = handleConfigFilesWhenSwitchAccount;
|
|
757
239
|
exports.provisionUtils = new ProvisionUtils();
|
|
758
240
|
//# sourceMappingURL=provisionUtils.js.map
|