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